/* DonutGrade — dark glass panels over the jungle, glaze-blue as the accent,
   sprinkle colors (mint, pink, yellow) only for money, rarity and highlights. */
:root {
  color-scheme: dark;
  --bg: #06101f;
  --panel: rgba(9, 18, 34, 0.86);
  --panel-solid: #0b1628;
  --panel-2: #112038;
  --panel-3: #18294a;
  --line: rgba(140, 180, 255, 0.12);
  --text: #eaf2ff;
  --muted: #8ea0bf;
  --faint: #5d6f8f;
  --accent: #2a9cfe;
  --accent-2: #6bd6ff;
  --glaze: #0170ff;
  --navy: #06102f;
  --mint: #3fe0b0;
  --pink: #ff7ab8;
  --yellow: #ffd35a;
  --danger: #ff5f6d;
  --r-common: #9aa7b8;
  --r-uncommon: #4fd18b;
  --r-rare: #2a9cfe;
  --r-epic: #a777ff;
  --r-legendary: #ffb444;
  --r-mythic: #ff5f8f;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 10px;
  --top: 64px;
  --side: 200px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg) url("../assets/bg-jungle.jpg") center / cover fixed;
  font-size: 14px;
  line-height: 1.45;
  min-height: 100vh;
  font-variant-numeric: tabular-nums;
}
body::after {
  /* dark blue wash so panels stay readable over the jungle */
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(4, 12, 28, 0.9), rgba(4, 12, 28, 0.95));
  backdrop-filter: blur(3px) saturate(0.7);
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
h1, h2, h3 { margin: 0; letter-spacing: 0.01em; text-wrap: balance; }
.muted { color: var(--muted); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40;
  height: var(--top);
  display: flex; align-items: center; gap: 16px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: rgba(5, 12, 25, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none !important; flex: none; }
.brand-icon { width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 0 0 2px var(--navy); }
.wordmark {
  display: inline-flex; align-items: center;
  font-weight: 900; font-size: 24px; color: #fff; letter-spacing: -0.01em;
  -webkit-text-stroke: 5px var(--navy); paint-order: stroke fill;
}
.wm-o { width: 22px; height: 22px; margin: 0 1px; transform: translateY(2px); }

.mainnav { display: flex; align-self: stretch; margin: 0 auto; }
.mainnav a {
  display: flex; align-items: center; gap: 8px;
  padding: 0 22px; color: var(--muted);
  font-weight: 800; text-transform: uppercase; font-size: 13px; letter-spacing: 0.04em;
  border-bottom: 3px solid transparent; text-decoration: none;
}
.mainnav a:hover { color: var(--text); }
.mainnav a.active { color: #fff; border-bottom-color: var(--accent); background: linear-gradient(0deg, rgba(42,156,254,.22), transparent); }

.top-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.auth-area { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  position: relative; display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
}
.icon-btn:hover { background: var(--panel-3); text-decoration: none; }
.badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--pink); color: #2a0618; font-size: 11px; font-weight: 800;
  display: grid; place-items: center;
}
.balance {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  font-weight: 800;
}
.avatar { width: 40px; height: 40px; border-radius: 8px; overflow: hidden; background: var(--panel-3); display: grid; place-items: center; font-weight: 900; border: 1px solid var(--line); padding: 0; }
.avatar img { width: 100%; height: 100%; image-rendering: pixelated; }

.doney { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.2em; background: url("../assets/doney.png") center / contain no-repeat; flex: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 8px; border: 0;
  font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; font-size: 13px;
  background: var(--panel-3); color: var(--text); text-decoration: none !important;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(90deg, var(--glaze), var(--accent)); color: #fff; box-shadow: 0 4px 18px rgba(1, 112, 255, 0.35); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.1); }
.btn-mint { background: var(--mint); color: #04261c; }
.btn-mint:hover:not(:disabled) { filter: brightness(1.08); }
.btn-ghost { background: transparent; border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--panel-2); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; }
.btn-lg { height: 52px; font-size: 16px; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: calc(100vh - var(--top)); }
.view {
  min-width: 0; outline: none;
  padding-block: 28px 0;
  padding-left: max(16px, 3vw); padding-right: max(16px, 3vw, env(safe-area-inset-right, 0px));
}
.page { max-width: 1240px; margin: 0 auto; display: grid; gap: 24px; }
.page-title { font-size: 30px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; }
.section-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 20px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.03em; }
.count { background: var(--panel-3); border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 800; color: var(--muted); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- live feed ---------- */
.livefeed {
  position: sticky; top: var(--top); height: calc(100vh - var(--top));
  background: rgba(5, 12, 25, 0.88); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden;
}
.live-stats { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.live-stats > div { padding: 10px 12px; display: grid; gap: 2px; }
.live-stats > div + div { border-left: 1px solid var(--line); }
.live-stats .lbl { font-size: 10px; text-transform: uppercase; font-weight: 800; letter-spacing: 0.06em; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.live-stats b { font-size: 15px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px var(--mint); display: inline-block; }
.live-title { padding: 8px 12px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); display: flex; justify-content: space-between; }
.demo-tag { font-size: 9px; padding: 1px 5px; border-radius: 4px; background: rgba(255, 211, 90, 0.15); color: var(--yellow); }
.feed { display: grid; gap: 4px; padding: 0 6px 6px; overflow: hidden; align-content: start; }
.feed-card {
  position: relative; height: 96px; border-radius: 6px; overflow: hidden;
  border-left: 3px solid var(--rc);
  animation: slidein 0.4s ease-out;
}
.feed-card .chance { position: absolute; top: 6px; left: 6px; font-size: 10px; font-weight: 800; background: rgba(0,0,0,.45); padding: 1px 6px; border-radius: 4px; }
.feed-card .ico { position: absolute; right: 10px; top: 14px; font-size: 40px; filter: drop-shadow(0 4px 8px rgba(0,0,0,.5)); }
.feed-card .nm { position: absolute; left: 8px; bottom: 22px; right: 8px; font-size: 11px; font-weight: 800; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-card .who { position: absolute; left: 8px; bottom: 6px; font-size: 10px; color: var(--muted); }
@keyframes slidein { from { transform: translateY(-30px); opacity: 0; } }

/* ---------- rarity ---------- */
.r-common { --rc: var(--r-common); }
.r-uncommon { --rc: var(--r-uncommon); }
.r-rare { --rc: var(--r-rare); }
.r-epic { --rc: var(--r-epic); }
.r-legendary { --rc: var(--r-legendary); }
.r-mythic { --rc: var(--r-mythic); }
.rarity-pill { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: color-mix(in srgb, var(--rc) 70%, #fff); }
.bruise .nm, .bruise .pr, .bruise .rarity-pill, .bruise .who, .bruise b { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85); }

/* ---------- bruise texture behind rarity items ----------
   Soft blotches in the rarity color, roughened by an SVG noise filter (#dg-bruise in index.html),
   with a grain layer on top. Blotch positions come from --b1x..--b3y set per item. */
.bruise { position: relative; isolation: isolate; overflow: hidden; background: color-mix(in srgb, var(--rc, var(--accent)) 12%, #0a1426); }
.bruise::before {
  content: ""; position: absolute; inset: -25%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(22% 18% at var(--b1x, 35%) var(--b1y, 40%), color-mix(in srgb, var(--rc) 75%, #12001f) 0%, color-mix(in srgb, var(--rc) 45%, transparent) 50%, transparent 78%),
    radial-gradient(26% 22% at var(--b2x, 65%) var(--b2y, 60%), color-mix(in srgb, var(--rc) 60%, #1b0730) 0%, transparent 74%),
    radial-gradient(16% 14% at var(--b3x, 45%) var(--b3y, 72%), color-mix(in srgb, var(--rc) 35%, #3a0d4a) 0%, transparent 70%),
    radial-gradient(45% 40% at 50% 55%, color-mix(in srgb, var(--rc) 30%, transparent), transparent 80%),
    linear-gradient(170deg, color-mix(in srgb, var(--rc) 18%, #0a1426), #070e1c);
  filter: url(#dg-bruise);
}
.bruise::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay; opacity: .35;
}

/* ---------- item card ---------- */
.items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.item {
  position: relative; display: grid; justify-items: center; gap: 2px; text-align: center;
  padding: 12px 8px 10px; border-radius: 8px; border: 1px solid transparent;
  border-top: 2px solid var(--rc);
  cursor: pointer; user-select: none; color: var(--text);
}
.item:hover { filter: brightness(1.12); }
.item.selected { border-color: var(--accent-2); box-shadow: 0 0 0 1px var(--accent-2), 0 0 20px rgba(107, 214, 255, 0.25); }
.item.disabled { opacity: 0.35; cursor: not-allowed; }
.item .ico { font-size: 40px; line-height: 1.2; filter: drop-shadow(0 6px 10px rgba(0,0,0,.45)); }
.item .nm { font-size: 12px; font-weight: 800; text-transform: uppercase; line-height: 1.2; min-height: 2.4em; display: grid; place-items: center; }
.item .pr { font-size: 13px; font-weight: 800; display: flex; align-items: center; gap: 5px; }
.item .tick { position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; border-radius: 4px; background: var(--accent); display: none; place-items: center; font-size: 12px; font-weight: 900; }
.item.selected .tick { display: grid; }
.item .tag { position: absolute; top: 6px; left: 6px; font-size: 10px; color: var(--muted); }

.empty { padding: 48px 16px; text-align: center; color: var(--muted); display: grid; gap: 12px; justify-items: center; }
.empty h3 { color: var(--text); text-transform: uppercase; font-weight: 900; font-size: 20px; }

/* ---------- upgrader ---------- */
.up-hero { display: grid; grid-template-columns: minmax(0,1fr) 360px minmax(0,1fr); gap: 20px; align-items: stretch; }
.slot { min-height: 330px; display: flex; flex-direction: column; padding: 16px; }
.slot-head { text-align: center; font-weight: 900; text-transform: uppercase; font-size: 13px; }
.slot-sub { text-align: center; font-size: 11px; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.slot-body { flex: 1; display: grid; place-items: center; padding: 12px 0; }
.slot-ghost { font-size: 96px; opacity: 0.12; filter: grayscale(1); }
.slot-items { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.slot-items .item { width: 108px; }
.slot-big { display: grid; justify-items: center; gap: 6px; padding: 18px 26px; border-radius: 10px; border-top: 2px solid var(--rc); }
.slot-big .ico { font-size: 96px; filter: drop-shadow(0 10px 20px rgba(0,0,0,.5)); }
.slot-big .nm { font-weight: 900; text-transform: uppercase; font-size: 16px; }
.slot-total { display: flex; justify-content: space-between; font-weight: 800; padding-top: 10px; border-top: 1px solid var(--line); }
.add-bal { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); margin-top: 10px; }
.add-bal .row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.add-bal input[type=range] { width: 100%; accent-color: var(--accent); }

.wheel-col { display: grid; justify-items: center; align-content: start; gap: 14px; }
.wheel { position: relative; width: 300px; max-width: 100%; aspect-ratio: 1; }
.wheel svg { width: 100%; height: 100%; }
.wheel .needle { position: absolute; inset: 0; transition: transform 4.2s cubic-bezier(.12,.75,.12,1); }
.wheel .needle::before {
  content: ""; position: absolute; left: 50%; top: -6px; transform: translateX(-50%);
  border-left: 13px solid transparent; border-right: 13px solid transparent; border-top: 24px solid #fff;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.6));
}
.wheel-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 2px; }
.wheel-center .pct { font-size: 46px; font-weight: 900; letter-spacing: -0.02em; }
.wheel-center .lbl { font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--muted); letter-spacing: .06em; }
.wheel-center img { width: 120px; opacity: .9; justify-self: center; }
.wheel.won .pct { color: var(--mint); }
.wheel.lost .pct { color: var(--danger); }
.wheel-col .btn-lg { width: 100%; max-width: 340px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.quick button { height: 34px; min-width: 54px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel-2); font-weight: 800; }
.quick button:hover { background: var(--panel-3); }
.quick .pct-btn { color: var(--accent-2); }

.up-lists { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 20px; }
.list-panel { display: flex; flex-direction: column; min-height: 420px; }
.list-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.list-head h2 { font-size: 15px; font-weight: 900; text-transform: uppercase; margin-right: auto; }
.list-body { padding: 12px; max-height: 560px; overflow: auto; }
.field { height: 34px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel-solid); width: 92px; min-width: 0; }
.field.wide { width: 180px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 14px 0; }
.chip { height: 28px; padding: 0 10px; border-radius: 14px; border: 1px solid var(--line); background: transparent; font-size: 12px; font-weight: 700; color: var(--muted); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tabs-inline { display: flex; gap: 4px; }
.tabs-inline button { height: 34px; padding: 0 12px; border-radius: 7px; border: 0; background: var(--panel-2); font-weight: 800; font-size: 12px; text-transform: uppercase; color: var(--muted); }
.tabs-inline button.on { background: var(--accent); color: #fff; }

/* ---------- top drop strip ---------- */
.topdrop { display: grid; grid-template-columns: 200px minmax(0,1fr); overflow: hidden; }
.topdrop-label { display: grid; place-items: center; background: linear-gradient(135deg, var(--glaze), var(--accent)); font-size: 26px; font-weight: 900; text-transform: uppercase; text-align: center; line-height: 1.05; padding: 16px; }
.topdrop-track { display: flex; gap: 6px; padding: 8px; overflow-x: auto; scroll-snap-type: x mandatory; min-width: 0; }
.topdrop-track .item { width: 124px; flex: none; scroll-snap-align: start; cursor: default; }

/* ---------- cases ---------- */
.cases-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.case-card { overflow: hidden; display: grid; cursor: pointer; text-align: left; padding: 0; color: var(--text); }
.case-art { height: 180px; display: grid; place-items: center; background: radial-gradient(60% 60% at 50% 60%, rgba(42,156,254,.45), transparent 70%), var(--panel-2); }
.case-art img { width: 120px; filter: drop-shadow(0 12px 20px rgba(0,0,0,.5)); }
.case-card .meta { padding: 12px 14px; display: grid; gap: 8px; }
.case-card .meta b { text-transform: uppercase; font-size: 15px; font-weight: 900; }
.price-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(63,224,176,.14); color: var(--mint); font-weight: 800; padding: 4px 10px; border-radius: 6px; justify-self: start; }
.case-card.soon { opacity: .45; cursor: default; }

.reel-wrap { position: relative; overflow: hidden; border-radius: var(--radius); padding: 14px 0; }
.reel-wrap::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; background: var(--yellow); z-index: 2; transform: translateX(-50%); box-shadow: 0 0 12px var(--yellow); }
.reel { display: flex; gap: 8px; will-change: transform; }
.reel .item { width: 140px; flex: none; cursor: default; }
.case-actions { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; }
.odds { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.odds .item .odd { font-size: 11px; color: var(--muted); }

/* ---------- rewards ---------- */
.gw-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.gw { position: relative; overflow: hidden; padding: 18px; display: grid; gap: 14px; border-top: 3px solid var(--gc); background: linear-gradient(150deg, color-mix(in srgb, var(--gc) 32%, var(--panel-solid)), var(--panel-solid) 70%); }
.gw-top { display: flex; justify-content: space-between; align-items: center; }
.gw-top span { font-size: 18px; font-weight: 800; text-transform: uppercase; }
.gw-ent { display: flex; align-items: center; gap: 4px; font-weight: 800; color: var(--muted); }
.gw-prize { display: flex; gap: 12px; align-items: center; }
.gw-prize .ico { font-size: 64px; filter: drop-shadow(0 8px 14px rgba(0,0,0,.5)); }
.gw-prize b { display: block; font-size: 16px; }
.gw-prize .pv { font-size: 20px; font-weight: 900; display: flex; align-items: center; gap: 6px; }
.timer { display: flex; gap: 6px; }
.timer div { background: rgba(0,0,0,.35); border-radius: 6px; padding: 6px 8px; min-width: 50px; text-align: center; }
.timer b { display: block; font-size: 18px; }
.timer small { font-size: 9px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.gw-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: rgba(0,0,0,.25); border-radius: 8px; padding: 10px 12px; }
.gw-foot small { display: block; font-size: 10px; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.gw-src { font-size: 11px; color: var(--muted); }
.weekly { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: 24px; padding: 24px; align-items: center; }
.mystery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.mystery div { aspect-ratio: 3/5; border-radius: 8px; display: grid; place-items: center; font-size: 56px; font-weight: 900; color: var(--accent-2); background: linear-gradient(180deg, var(--panel-3), rgba(1,112,255,.35)); border: 1px solid rgba(107,214,255,.25); }
.weekly-copy { display: grid; gap: 12px; justify-items: center; text-align: center; }
.weekly-copy h3 { font-size: 34px; font-weight: 900; text-transform: uppercase; }
.stamp { background: #fff; color: var(--glaze); font-weight: 900; font-style: italic; text-transform: uppercase; padding: 6px 22px; transform: rotate(-2deg); font-size: 20px; }

/* ---------- profile ---------- */
.prof-top { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.prof-card { padding: 16px; display: grid; gap: 12px; align-content: start; }
.prof-id { display: flex; gap: 14px; }
.prof-av { width: 96px; height: 96px; border-radius: 10px; background: var(--panel-3); overflow: hidden; display: grid; place-items: center; font-size: 40px; font-weight: 900; flex: none; }
.prof-av img { width: 100%; height: 100%; image-rendering: pixelated; }
.prof-name { font-size: 20px; font-weight: 900; text-transform: uppercase; word-break: break-all; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-3); padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.uid { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--accent-2); background: none; border: 0; padding: 0; }
.prof-bal { display: flex; justify-content: space-between; align-items: end; gap: 10px; flex-wrap: wrap; }
.prof-bal b { font-size: 22px; display: flex; align-items: center; gap: 6px; }
.prof-bal small { display: block; font-size: 10px; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.best { text-align: center; justify-items: center; }
.best .ico { font-size: 80px; }
.stat-stack { display: grid; gap: 12px; }
.stat-stack .prof-card b { font-size: 18px; text-transform: uppercase; }
.coupon { display: flex; gap: 8px; }
.coupon .field { flex: 1; width: auto; height: 40px; }
.tabs { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px; border-bottom: 1px solid var(--line); }
.tabs .tabs-inline button { height: 40px; padding: 0 16px; font-size: 13px; }
.tabs .spacer { flex: 1; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: 0.05em; }
.pos { color: var(--mint); font-weight: 800; }
.neg { color: var(--danger); font-weight: 800; }
.status { font-size: 11px; font-weight: 800; text-transform: uppercase; padding: 2px 8px; border-radius: 5px; background: var(--panel-3); }
.status.win { background: rgba(63,224,176,.15); color: var(--mint); }
.status.lose { background: rgba(255,95,109,.15); color: var(--danger); }
.status.pending { background: rgba(255,211,90,.15); color: var(--yellow); }
.inv-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px; border-top: 1px solid var(--line); }

/* ---------- notifications dropdown ---------- */
.notif-wrap { position: relative; }
.dropdown { position: absolute; right: 0; top: 48px; width: 340px; max-width: calc(100vw - 32px); max-height: 70vh; overflow: auto; background: var(--panel-solid); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 20px 50px rgba(0,0,0,.5); z-index: 60; }
.dropdown h3 { padding: 14px 16px; font-size: 15px; text-transform: uppercase; font-weight: 900; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.notif { padding: 12px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 2px; }
.notif time { font-size: 11px; color: var(--faint); }
.notif b { text-transform: uppercase; font-size: 13px; }
.notif.unread b::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--pink); margin-left: 6px; vertical-align: 2px; }
.notif span { font-size: 12px; color: var(--muted); }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(2, 6, 16, 0.75); display: grid; place-items: center; padding: 16px; backdrop-filter: blur(3px); }
.modal { position: relative; width: min(880px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 14px; }
.modal-x { position: absolute; top: 12px; right: 12px; z-index: 2; }
.auth { display: grid; grid-template-columns: 1fr 1.1fr; }
.auth-art { position: relative; min-height: 420px; display: grid; place-items: center; background: linear-gradient(135deg, #2a9cfe, #6bd6ff); overflow: hidden; }
.auth-art .ribbon { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; font-weight: 900; text-transform: uppercase; padding: 6px 14px; border-radius: 6px; white-space: nowrap; font-size: 13px; }
.age-badge { width: 190px; height: 190px; border-radius: 50%; background: #fff; border: 14px solid var(--glaze); display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 72px; letter-spacing: -0.04em; color: var(--navy); box-shadow: 0 0 0 6px var(--navy), 0 20px 40px rgba(0,0,0,.3); }
.age-badge span { color: var(--glaze); }
.auth-art .sprinkle { position: absolute; width: 26px; height: 7px; border-radius: 4px; }
.auth-form { padding: 36px 32px; display: grid; gap: 16px; align-content: center; }
.auth-form h2 { font-size: 28px; font-weight: 900; text-transform: uppercase; }
.warn { background: rgba(255, 95, 109, 0.12); border: 1px solid rgba(255, 95, 109, 0.4); color: #ffd0d4; padding: 10px 12px; border-radius: 8px; font-weight: 800; text-transform: uppercase; font-size: 13px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; font-weight: 600; text-transform: uppercase; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex: none; }
.auth-form .field { width: 100%; height: 44px; font-size: 15px; }
.form-err { color: var(--danger); font-size: 13px; min-height: 1em; }
.topup { padding: 32px; display: grid; gap: 16px; }
.topup h2 { font-size: 24px; font-weight: 900; text-transform: uppercase; }
.note { background: rgba(255, 211, 90, 0.1); border: 1px dashed rgba(255, 211, 90, 0.45); padding: 12px 14px; border-radius: 8px; color: #ffe9a8; font-size: 13px; }

.toast { position: fixed; bottom: max(20px, env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); z-index: 200; background: var(--panel-3); border: 1px solid var(--line); padding: 12px 18px; border-radius: 10px; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.5); max-width: calc(100vw - 32px); }
.toast.err { border-color: var(--danger); }

/* ---------- legal ---------- */
.legal { max-width: 820px; margin: 0 auto; padding: 28px 32px; display: grid; gap: 14px; line-height: 1.65; }
.legal h1 { font-size: 28px; font-weight: 900; }
.legal h2 { font-size: 18px; font-weight: 800; margin-top: 10px; }
.legal p, .legal li { color: #c9d6ee; max-width: 70ch; }
.legal ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.draft-banner { background: rgba(255, 211, 90, 0.12); border: 1px solid rgba(255, 211, 90, 0.5); color: #ffe9a8; padding: 12px 14px; border-radius: 8px; font-weight: 700; }

/* ---------- footer ---------- */
.footer { margin-top: 40px; padding-block: 28px; border-top: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr auto; gap: 32px; align-items: start; max-width: 1240px; margin-left: auto; margin-right: auto; }
.footer nav { display: grid; gap: 6px; }
.footer nav b { color: var(--accent); font-size: 12px; text-transform: uppercase; }
.footer nav a { color: var(--text); font-weight: 700; text-transform: uppercase; font-size: 12px; }
.footer .fine { grid-column: 1 / -1; font-size: 11px; color: var(--faint); display: grid; gap: 4px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .up-hero { grid-template-columns: 1fr 1fr; }
  .wheel-col { grid-column: 1 / -1; grid-row: 1; }
  .prof-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  :root { --side: 0px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .livefeed { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .live-stats { display: none; }
  .live-title { display: none; }
  .feed { grid-auto-flow: column; grid-auto-columns: 150px; overflow-x: auto; padding: 6px; }
  .feed-card { height: 80px; }
  .up-lists { grid-template-columns: minmax(0, 1fr); }
  .weekly { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { min-height: 200px; }
  .age-badge { width: 120px; height: 120px; font-size: 44px; border-width: 9px; }
  .footer { grid-template-columns: minmax(0, 1fr); }
  .mainnav a { padding: 0 12px; }
}
@media (max-width: 720px) {
  .topbar { height: auto; flex-wrap: wrap; padding-block: 8px; gap: 8px; }
  .mainnav { order: 3; width: 100%; margin: 0; justify-content: space-around; overflow-x: auto; scrollbar-width: none; }
  .mainnav a { flex: none; padding: 0 8px; }
  .mainnav a { height: 40px; }
  .wordmark { font-size: 18px; }
  .wm-o { width: 16px; height: 16px; }
  .brand-icon { width: 30px; height: 30px; }
  .top-actions { margin-left: auto; }
  .balance { padding: 0 8px; }
  .btn-topup-label { display: none; }
  .up-hero { grid-template-columns: minmax(0, 1fr); }
  .prof-top { grid-template-columns: minmax(0, 1fr); }
  .topdrop { grid-template-columns: minmax(0, 1fr); }
  .topdrop-label { font-size: 18px; padding: 10px; }
  .slot { min-height: 220px; }
  .livefeed { top: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
}

/* Minecraft item icons: pixel art, sized by the parent's font-size */
img.mc { width: 1.15em; height: 1.15em; image-rendering: pixelated; vertical-align: middle; display: inline-block; }
img.mc.sm { width: 22px; height: 22px; vertical-align: -6px; }
.slot-ghost img.mc { filter: grayscale(1); }
.ico img.mc { filter: drop-shadow(0 0 1px rgba(255,255,255,.35)) drop-shadow(0 6px 10px rgba(0,0,0,.5)); }
.item .qty { position: absolute; top: 6px; right: 6px; background: var(--accent); color: #fff; font-weight: 900; font-size: 12px; padding: 1px 7px; border-radius: 6px; }
.quick button.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* pinned top win in the live feed */
.feed-pin { flex: none; padding-bottom: 6px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.feed-card.pinned { height: 112px; border-left: 0; box-shadow: inset 0 0 0 2px var(--yellow), 0 0 18px rgba(255, 211, 90, 0.25); }
.feed-card.pinned .chance { top: 28px; }
.pin-tag { position: absolute; top: 6px; left: 6px; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; background: var(--yellow); color: #2b2000; padding: 1px 6px; border-radius: 4px; }
@media (max-width: 900px) { .feed-pin { display: none; } }

/* upgrader toolbar above the stake box */
.stake-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.stake-col > .slot { flex: 1; }
.up-tools { display: flex; gap: 6px; }
.tool { width: 34px; height: 34px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); display: grid; place-items: center; padding: 0; }
.tool:hover { color: var(--text); background: var(--panel-2); }
.tool.on { color: var(--accent-2); border-color: rgba(107, 214, 255, 0.45); }
.tool svg { width: 17px; height: 17px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; color: #c9d6ee; line-height: 1.55; }
.steps b { color: var(--text); }

/* provably fair page */
.fair-page { max-width: 900px; }
.fair-intro { text-align: center; color: #c9d6ee; max-width: 62ch; margin: 0 auto; font-size: 15px; }
.fair-badges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fair-badges > div { display: grid; grid-template-columns: 30px 1fr; column-gap: 10px; padding: 14px; }
.fair-badges > div + div { border-left: 1px solid var(--line); }
.fair-badges .shield { grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(63, 224, 176, 0.15); color: var(--mint); font-weight: 900; }
.fair-badges b { font-size: 12px; text-transform: uppercase; }
.fair-badges small { color: var(--muted); font-size: 12px; }
.fair-box { padding: 18px; display: grid; gap: 12px; }
.fair-box h2 { font-size: 16px; font-weight: 900; text-transform: uppercase; }
.fair-box p { margin: 0; }
.seed-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 8px 8px 12px; min-width: 0; }
.seed-row code { margin-left: auto; font-size: 13px; overflow-x: auto; white-space: nowrap; min-width: 0; }
.seed-row .field { margin-left: auto; flex: 1; width: auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.seed-row .copy { width: 32px; height: 32px; flex: none; }
.seed-lbl { font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 700; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.seed-lbl i { font-style: normal; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--faint); display: grid; place-items: center; font-size: 10px; cursor: help; }
.seed-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 10px; }
code, .algo { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.algo { margin: 0; background: #050b16; border-radius: 8px; padding: 14px; font-size: 13px; line-height: 1.6; overflow-x: auto; color: #d6e4ff; }
code.short { display: inline-block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.verify-grid { display: grid; grid-template-columns: 2fr 1.2fr 0.6fr 0.8fr auto; gap: 10px; }
.verify-grid label { display: grid; gap: 4px; font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 700; min-width: 0; }
.verify-grid .field { width: 100%; height: 40px; }
.verify-out { display: grid; gap: 6px; }
.verify-out > div { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.verify-out span:first-child { width: 150px; color: var(--muted); font-size: 12px; }
.verify-out code { word-break: break-all; font-size: 12px; }
@media (max-width: 720px) {
  .fair-badges, .seed-grid, .verify-grid { grid-template-columns: minmax(0, 1fr); }
  .fair-badges > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .seed-row { flex-wrap: wrap; }
}

/* account hold */
.hold-bar { position: sticky; top: calc(var(--top) + env(safe-area-inset-top, 0px)); z-index: 35; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); background: #3a0f1a; border-bottom: 1px solid rgba(255, 95, 109, 0.5); color: #ffd0d4; text-align: center; }
.hold .hold-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 95, 109, 0.15); color: var(--danger); font-size: 24px; }
.hold-reason { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; background: var(--panel-2); border-radius: 8px; padding: 12px 14px; }
.hold-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--accent-2); }

/* live chat bot */
.chat-fab { position: fixed; right: max(20px, env(safe-area-inset-right, 0px)); bottom: max(20px, env(safe-area-inset-bottom, 0px)); z-index: 90; width: 56px; height: 56px; border-radius: 50%; border: 0; background: linear-gradient(135deg, var(--glaze), var(--accent)); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(1, 112, 255, 0.45); font-size: 20px; font-weight: 900; }
.chat-fab svg { width: 24px; height: 24px; }
.chat { position: fixed; right: max(20px, env(safe-area-inset-right, 0px)); bottom: calc(max(20px, env(safe-area-inset-bottom, 0px)) + 68px); z-index: 90; width: 360px; max-width: calc(100vw - 32px); height: 480px; max-height: calc(100vh - 140px); display: flex; flex-direction: column; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55); overflow: hidden; }
.chat header { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.chat header .dot { grid-row: span 2; }
.chat header small { color: var(--muted); font-size: 11px; grid-column: 2; }
.chat header .icon-btn { grid-row: 1 / span 2; grid-column: 3; width: 32px; height: 32px; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 85%; padding: 8px 12px; border-radius: 12px; font-size: 13px; line-height: 1.45; }
.msg.bot { background: var(--panel-3); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.me { background: var(--accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 12px 8px; }
.chat-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.chat-form .field { flex: 1; width: auto; height: 38px; }

[hidden] { display: none !important; }

/* ---------- Minecraft skin faces ---------- */
.face { display: inline-block; vertical-align: -3px; border-radius: 3px; image-rendering: pixelated; flex: none; margin-right: 5px; background: var(--panel-3); }
.face-x { display: inline-grid; place-items: center; font-size: 10px; font-weight: 900; color: #fff; background: linear-gradient(135deg, #4a7a3a, #2e4f24); }
.face.lg { border-radius: 8px; margin: 0; font-size: 18px; box-shadow: 0 0 0 2px var(--line); }
.feed-card .who { display: inline-flex; align-items: center; }
.item .tag { display: inline-flex; align-items: center; }
.item .tag .face { margin-right: 4px; vertical-align: 0; }

/* ---------- sign in by payment ---------- */
.name-row { display: flex; align-items: center; gap: 10px; }
.name-row .field { flex: 1; }
.pay-who { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); }
.pay-who b { display: block; font-size: 16px; }
.pay-who span { font-size: 12px; }
.pay-cmd { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 14px 16px; border-radius: 10px; border: 1px dashed rgba(42,156,254,.6); background: rgba(42,156,254,.08); color: var(--text); cursor: pointer; font: inherit; }
.pay-cmd code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 20px; font-weight: 800; color: var(--accent-2); }
.pay-cmd span { font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--muted); }
.pay-cmd:hover { background: rgba(42,156,254,.16); }
.pay-wait { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.pay-wait b { color: var(--text); font-variant-numeric: tabular-nums; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--panel-3); border-top-color: var(--accent); animation: dgspin 0.8s linear infinite; flex: none; }
@keyframes dgspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } }
.pay-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: space-between; }
.wd-form { display: grid; gap: 8px; }
.wd-row { display: flex; gap: 8px; }
.wd-row .field { flex: 1; width: auto; height: 44px; font-size: 16px; }
.wd-row .btn { height: 44px; }
.feed-empty { padding: 24px 10px; text-align: center; color: var(--muted); font-size: 12px; font-weight: 700; line-height: 1.6; }
