/* =====================================================================
   92stake.club - design system
   Dark emerald. One palette, one scale, one shadow ladder.
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;

  /* Neutral greys - the whole UI is built from these five */
  --bg:         #0e1215;
  --bg-2:       #12171a;
  --surface:    #171d21;
  --surface-2:  #1e262b;
  --surface-3:  #283238;
  --border:     #313c43;
  --border-soft:#232c31;

  /* One green, used for accents only */
  --brand:      #28d16c;
  --brand-2:    #1fb95c;
  --brand-dim:  #17864a;
  --brand-wash: rgba(40, 209, 108, .12);

  /* Text */
  --text:       #ffffff;
  --text-2:     #b6c0c6;
  --muted:      #8b979e;
  --muted-2:    #636f76;

  /* Semantic */
  --win:        #28d16c;
  --loss:       #ec5b6b;
  --warn:       #e9a13b;
  --info:       #4aa8e0;
  --gold:       #e0b544;

  /* Radii */
  --r-xs: 4px;  --r-sm: 6px;  --r: 8px;  --r-lg: 10px;  --r-xl: 12px;  --r-full: 999px;

  /* Elevation */
  --sh-1: 0 1px 2px rgba(0,0,0,.35);
  --sh-2: 0 3px 10px rgba(0,0,0,.4);
  --sh-3: 0 10px 28px rgba(0,0,0,.5);
  --sh-brand: none;

  /* Layout */
  --sidebar-w: 240px;
  --sidebar-w-min: 62px;
  --topbar-h: 60px;
  --bottom-h: 60px;
  --maxw: 1400px;

  --ease: cubic-bezier(.4,0,.2,1);
  --fast: 120ms var(--ease);
  --med:  200ms var(--ease);

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1,h2,h3,h4,h5 { margin: 0; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
p { margin: 0 0 .8em; }
ul { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }
hr { border: 0; border-top: 1px solid var(--border-soft); margin: 18px 0; }
::selection { background: var(--brand); color: #06120b; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--border); background-clip: content-box; }

/* ---------- Utilities ---------- */
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
/* Grid/flex children must be allowed to shrink below a wide table's
   min-content width, otherwise the whole page overflows on phones. */
.lobby-split > * { min-width: 0; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { display: grid; place-items: center; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.dim { color: var(--text-2); }
.win { color: var(--win); }
.loss { color: var(--loss); }
.info { color: var(--info); }
.gold { color: var(--gold); }
.warn { color: var(--warn); }
.tiny { font-size: 11px; }
.sm { font-size: 12.5px; }
.lg { font-size: 16px; }
.b { font-weight: 600; }
.bb { font-weight: 700; }
.upper { text-transform: uppercase; letter-spacing: .08em; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hide { display: none !important; }
.mt0{margin-top:0}.mt1{margin-top:6px}.mt2{margin-top:12px}.mt3{margin-top:20px}.mt4{margin-top:32px}
.mb0{margin-bottom:0}.mb1{margin-bottom:6px}.mb2{margin-bottom:12px}.mb3{margin-bottom:20px}
.gap4{gap:4px}.gap8{gap:8px}.gap12{gap:12px}.gap16{gap:16px}.gap20{gap:20px}
.full { width: 100%; }
.rel { position: relative; }
.nowrap { white-space: nowrap; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* =====================================================================
   Shell
   ===================================================================== */
.shell { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 60;
  width: var(--sidebar-w);
  background: var(--bg-2);
  border-right: 1px solid var(--border-soft);
  display: flex; flex-direction: column;
  transition: width var(--med), transform var(--med);
}
.sidebar__brand {
  height: var(--topbar-h); flex: none;
  display: flex; align-items: center; gap: 10px; padding: 0 16px;
  border-bottom: 1px solid var(--border-soft);
}
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: -.03em; font-size: 17px; }
.logo__mark {
  width: 28px; height: 28px; flex: none; border-radius: var(--r-sm);
  background: var(--brand);
  display: grid; place-items: center; color: #06120b; font-weight: 800; font-size: 12.5px;
}
.logo__text b { color: var(--brand); }
.logo__text small { display: block; font-size: 9.5px; font-weight: 600; color: var(--muted-2); letter-spacing: .18em; text-transform: uppercase; margin-top: -2px; }
.logo__img { height: 42px; width: auto; max-width: 205px; object-fit: contain; display: block; }
body.nav-min .sidebar .logo__img { height: auto; width: 46px; max-width: 46px; }

.sidebar__scroll { flex: 1; overflow-y: auto; padding: 14px 10px 20px; }
.navgroup + .navgroup { margin-top: 18px; }
.navgroup__label {
  font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
  color: var(--muted-2); padding: 0 10px 8px;
}
.navlink {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 550; font-size: 13.5px;
  transition: background var(--fast), color var(--fast);
  position: relative;
}
.navlink i, .navlink .ico { width: 18px; text-align: center; font-size: 14px; color: var(--muted); transition: color var(--fast); flex: none; }
.navlink:hover { background: var(--surface); color: var(--text); }
.navlink:hover i, .navlink:hover .ico { color: var(--brand); }
.navlink.is-active { background: var(--surface-2); color: #fff; }
.navlink.is-active i, .navlink.is-active .ico { color: var(--brand); }
.navlink.is-active::before {
  content: ""; position: absolute; left: -10px; top: 50%; translate: 0 -50%;
  width: 2px; height: 18px; background: var(--brand);
}
.navlink__badge {
  margin-left: auto; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 5px;
  background: var(--brand-wash); color: var(--brand); letter-spacing: .04em;
}
.navlink__badge--hot { background: rgba(240,84,106,.14); color: var(--loss); }

.sidebar__foot { flex: none; padding: 12px; border-top: 1px solid var(--border-soft); }
.online-pill {
  display: flex; align-items: center; gap: 8px; padding: 8px 11px;
  background: var(--surface); border-radius: var(--r-sm); font-size: 12px; color: var(--text-2);
}
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); flex: none; }

/* ---------- Main column ---------- */
.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; transition: margin var(--med); }
body.nav-min .sidebar { width: var(--sidebar-w-min); }
body.nav-min .main { margin-left: var(--sidebar-w-min); }
body.nav-min .sidebar .navgroup__label,
body.nav-min .sidebar .logo__text,
body.nav-min .sidebar .navlink span,
body.nav-min .sidebar .navlink__badge,
body.nav-min .sidebar .online-pill span { display: none; }
body.nav-min .sidebar .navlink { justify-content: center; padding: 11px 0; }
body.nav-min .sidebar__brand { justify-content: center; padding: 0; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50; height: var(--topbar-h); flex: none;
  display: flex; align-items: center; gap: 12px; padding: 0 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
}
.iconbtn {
  width: 36px; height: 36px; flex: none; border-radius: var(--r-sm);
  display: grid; place-items: center; color: var(--text-2);
  transition: background var(--fast), color var(--fast);
}
.iconbtn:hover { background: var(--surface-2); color: var(--text); }
.iconbtn--badge { position: relative; }
.iconbtn--badge[data-count]:not([data-count="0"])::after {
  content: attr(data-count); position: absolute; top: 2px; right: 2px;
  min-width: 15px; height: 15px; padding: 0 4px; border-radius: 99px;
  background: var(--loss); color: #fff; font-size: 9.5px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--bg-2);
}

.searchbox { position: relative; max-width: 340px; flex: 1 1 200px; }
.searchbox input {
  width: 100%; height: 38px; padding: 0 12px 0 36px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid transparent; color: var(--text);
  transition: border var(--fast), background var(--fast);
}
.searchbox input::placeholder { color: var(--muted-2); }
.searchbox input:focus { outline: 0; border-color: var(--border); background: var(--surface-2); }
.searchbox i { position: absolute; left: 12px; top: 50%; translate: 0 -50%; color: var(--muted-2); font-size: 13px; }

.balpill {
  display: flex; align-items: center; height: 36px; flex: none;
  border-radius: var(--r-sm); background: var(--surface-2);
  border: 1px solid var(--border-soft); overflow: hidden;
}
.balpill__amt {
  display: flex; align-items: center; gap: 8px; height: 100%; padding: 0 9px 0 12px;
  color: var(--text); font-size: 13.5px; font-weight: 600;
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
  transition: background var(--fast);
}
.balpill__amt .fa-coins { color: var(--brand); font-size: 12px; }
.balpill__sync { color: var(--muted-2); font-size: 10px; transition: color var(--fast); }
.balpill__amt:hover { background: var(--surface-3); }
.balpill__amt:hover .balpill__sync { color: var(--muted); }
.balpill__amt.is-syncing .balpill__sync { color: var(--brand); animation: bal-spin .9s linear infinite; }
.balpill__amt.is-flash b { animation: bal-pop .7s ease; }
@keyframes bal-spin { to { transform: rotate(360deg); } }
@keyframes bal-pop { 30% { color: var(--brand); } }
.balpill__sep { width: 1px; height: 16px; flex: none; background: var(--border-soft); }
.balpill__cta {
  display: flex; align-items: center; gap: 7px; height: 100%; padding: 0 14px;
  background: var(--brand); color: #06120b; font-weight: 700; font-size: 12.5px;
  transition: background var(--fast);
}
.balpill__cta:hover { background: var(--brand-2); }

.avatar {
  width: 32px; height: 32px; border-radius: var(--r-sm); flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 12.5px;
  color: var(--text-2); background: var(--surface-3);
}

/* Dropdown */
.dd { position: relative; }
.dd__menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 70;
  min-width: 224px; padding: 7px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--border-soft); box-shadow: var(--sh-3);
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all var(--fast);
}
.dd.is-open .dd__menu { opacity: 1; visibility: visible; transform: none; }
.dd__item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 11px; border-radius: var(--r-xs); color: var(--text-2); font-size: 13.5px;
  transition: background var(--fast), color var(--fast);
}
.dd__item i { width: 16px; color: var(--muted); font-size: 13px; }
.dd__item:hover { background: var(--surface-2); color: var(--text); }
.dd__item:hover i { color: var(--brand); }
.dd__sep { height: 1px; background: var(--border-soft); margin: 6px 4px; }
.dd__head { padding: 10px 11px 12px; border-bottom: 1px solid var(--border-soft); margin-bottom: 6px; }

/* ---------- Page ---------- */
.page { flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 22px 18px 60px; }
.page--flush { max-width: none; padding: 0 0 60px; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.pagehead h1 { font-size: 25px; }
.pagehead p { color: var(--muted); margin: 5px 0 0; font-size: 13.5px; }

.section { margin-bottom: 34px; }
.section__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section__title { display: flex; align-items: center; gap: 9px; font-size: 16.5px; font-weight: 700; }
.section__title i { color: var(--brand); font-size: 15px; }
.section__more { font-size: 12.5px; color: var(--muted); font-weight: 600; transition: color var(--fast); }
.section__more:hover { color: var(--brand); }

/* =====================================================================
   Components
   ===================================================================== */

/* ---------- Card / panel ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--r-lg); padding: 18px;
}
.card--pad0 { padding: 0; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--border-soft); }
.card__head h3 { font-size: 14.5px; }
.card__body { padding: 18px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: var(--r-sm);
  font-weight: 650; font-size: 13.5px; white-space: nowrap;
  transition: background var(--fast), color var(--fast), filter var(--fast), transform var(--fast), box-shadow var(--fast);
  border: 1px solid transparent;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[disabled] { opacity: .45; pointer-events: none; }
.btn--primary { background: var(--brand); color: #06120b; }
.btn--primary:hover { background: var(--brand-2); }
.btn--ghost { background: var(--surface-2); color: var(--text); border-color: var(--border-soft); }
.btn--ghost:hover { background: var(--surface-3); }
.btn--outline { border-color: var(--border); color: var(--text-2); }
.btn--outline:hover { border-color: var(--brand); color: var(--brand); }
.btn--danger { background: rgba(240,84,106,.14); color: var(--loss); border-color: rgba(240,84,106,.25); }
.btn--danger:hover { background: rgba(240,84,106,.22); }
.btn--lg { height: 48px; padding: 0 26px; font-size: 15px; border-radius: var(--r); }
.btn--sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn--xs { height: 26px; padding: 0 9px; font-size: 11.5px; border-radius: var(--r-xs); }
.btn--block { width: 100%; }
.btn--icon { width: 40px; padding: 0; }

/* ---------- Badges / chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px;
  border-radius: var(--r-xs); font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  background: var(--surface-3); color: var(--text-2);
}
.badge--brand { background: var(--brand-wash); color: var(--brand); }
.badge--win { background: var(--brand-wash); color: var(--win); }
.badge--loss { background: rgba(236,91,107,.13); color: var(--loss); }
.badge--warn { background: rgba(233,161,59,.13); color: var(--warn); }
.badge--info { background: rgba(74,168,224,.13); color: var(--info); }
.badge--gold { background: rgba(224,181,68,.13); color: var(--gold); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  height: 34px; padding: 0 14px; border-radius: var(--r-full);
  background: var(--surface); border: 1px solid var(--border-soft); color: var(--text-2);
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600;
  transition: all var(--fast);
}
.chip i { font-size: 12px; color: var(--muted); }
.chip:hover { border-color: var(--border); color: var(--text); }
.chip.is-active { background: var(--surface-3); border-color: var(--border); color: var(--brand); }
.chip.is-active i { color: var(--brand); }
.coinbadge {
  display: inline-grid; place-items: center; flex: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface-3); color: var(--c, var(--brand));
  font-size: 8.5px; font-weight: 800; letter-spacing: -.02em;
}

/* Deposit coin picker (wallet) */
.coinpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 9px; }
.coinpick .coin {
  height: auto; padding: 11px 12px; border-radius: var(--r); align-items: center; text-align: left;
}
.coinpick .coin .coinbadge { width: 36px; height: 36px; font-size: 10.5px; }
.coinpick .coin:hover { transform: translateY(-1px); }
.coinpick .coin.is-active {
  background: rgba(22,217,127,.08); border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(22,217,127,.13);
}
.coin__meta { display: grid; gap: 1px; min-width: 0; }
.coin__meta b { font-size: 14px; }
.coin__meta small { font-size: 11px; color: var(--muted); font-weight: 550; }
.coin__tick { margin-left: auto; color: var(--brand); font-size: 15px; opacity: 0; transition: opacity var(--fast); }
.coinpick .coin.is-active .coin__tick { opacity: 1; }
@media (max-width: 560px) { .coinpick { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } }

/* ---------- Form ---------- */
.field { display: block; margin-bottom: 15px; }
.field__label { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; letter-spacing: .02em; }
.input, .select, textarea.input {
  width: 100%; height: 42px; padding: 0 13px; border-radius: var(--r-sm);
  background: var(--bg-2); border: 1px solid var(--border-soft); color: var(--text);
  transition: border var(--fast), box-shadow var(--fast);
}
textarea.input { height: auto; min-height: 96px; padding: 11px 13px; resize: vertical; line-height: 1.5; }
.input::placeholder { color: var(--muted-2); }
.input:focus, .select:focus, textarea.input:focus { outline: 0; border-color: var(--border); }
.input[readonly] { color: var(--text-2); }
.select { appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238b979e' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; }
.input-group { position: relative; }
.input-group .input { padding-right: 96px; }
.input-group__suffix { position: absolute; right: 5px; top: 50%; translate: 0 -50%; display: flex; gap: 4px; }
.input-group__prefix { position: absolute; left: 13px; top: 50%; translate: 0 -50%; color: var(--muted); font-weight: 600; pointer-events: none; }
.input-group--prefixed .input { padding-left: 30px; }
.field__hint { font-size: 11.5px; color: var(--muted-2); margin-top: 6px; }
.field__error { font-size: 12px; color: var(--loss); margin-top: 6px; }

.checkbox { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.checkbox input { appearance: none; width: 18px; height: 18px; flex: none; margin-top: 1px; border-radius: 5px;
  border: 1.5px solid var(--border); background: var(--bg-2); transition: all var(--fast); }
.checkbox input:checked { background: var(--brand); border-color: var(--brand); }
.checkbox input:checked::after { content: "\2713"; display: grid; place-items: center; color: #06120b; font-size: 12px; font-weight: 900; height: 100%; }

.seg { display: inline-flex; padding: 3px; background: var(--bg-2); border-radius: var(--r-sm); border: 1px solid var(--border-soft); gap: 2px; }
.seg button { padding: 7px 15px; border-radius: var(--r-xs); font-size: 12.5px; font-weight: 650; color: var(--muted); transition: all var(--fast); }
.seg button:hover { color: var(--text-2); }
.seg button.is-active { background: var(--surface-2); color: var(--text); box-shadow: var(--sh-1); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-soft); margin-bottom: 20px; overflow-x: auto; }
.tabs button, .tabs a { padding: 11px 15px; font-size: 13.5px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: all var(--fast); }
.tabs button:hover, .tabs a:hover { color: var(--text-2); }
.tabs .is-active { color: var(--text); border-bottom-color: var(--brand); }

.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--surface-3); border-radius: 99px; transition: background var(--fast); }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: var(--muted); border-radius: 50%; transition: all var(--fast); }
.switch input:checked + span { background: var(--surface-3); }
.switch input:checked + span::before { transform: translateX(18px); background: var(--brand); }

/* ---------- Table ---------- */
.table { font-size: 13px; }
.table th {
  text-align: left; padding: 10px 14px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em; color: var(--muted-2);
  border-bottom: 1px solid var(--border-soft); white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.table tbody tr { transition: background var(--fast); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table--tight td, .table--tight th { padding: 8px 12px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

.empty { padding: 46px 20px; text-align: center; color: var(--muted); }
.empty i { font-size: 30px; color: var(--surface-3); display: block; margin-bottom: 12px; }

/* ---------- Stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 12px; }
.stat {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r);
  padding: 14px 16px;
}
.stat__label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); font-weight: 650; }
.stat__value { font-size: 22px; font-weight: 700; letter-spacing: -.025em; margin-top: 5px; font-variant-numeric: tabular-nums; }
.stat__sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* =====================================================================
   Hero
   ===================================================================== */
.hero {
  border-radius: var(--r-lg); background: var(--surface);
  border: 1px solid var(--border-soft);
  padding: 30px 32px; margin-bottom: 26px;
}

/* ---------- Hero banner slider (admin "Home banners") ---------- */
.heroslider {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--border-soft); margin-bottom: 26px;
  background: var(--surface-2);
}
.heroslider__track { display: flex; transition: transform .45s ease; }
.heroslider__slide { flex: 0 0 100%; min-width: 0; }
.heroslider__slide a { display: block; }
.heroslider__slide img {
  display: block; width: 100%; height: auto; max-height: 58vh;
  object-fit: contain; object-position: center; margin: 0 auto;
}
.heroslider__dots {
  position: absolute; left: 0; right: 0; bottom: 12px; z-index: 2;
  display: flex; justify-content: center; gap: 7px;
}
.heroslider__dots button {
  width: 26px; height: 6px; padding: 0; border: 0; border-radius: 3px; cursor: pointer;
  background: rgba(255,255,255,.22); box-shadow: 0 1px 4px rgba(0,0,0,.5);
  transition: background var(--fast), transform var(--fast);
}
.heroslider__dots button:hover { transform: scaleY(1.25); }
.heroslider__dots button.is-on { background: var(--brand); }
.hero__inner { position: relative; max-width: 620px; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: var(--r-sm);
  background: var(--brand-wash); color: var(--brand);
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  margin-bottom: 14px;
}
.hero h1 { font-size: clamp(23px, 3.2vw, 32px); line-height: 1.18; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p { color: var(--text-2); font-size: 15px; max-width: 500px; margin: 14px 0 24px; }
.hero__actions { display: flex; gap: 11px; flex-wrap: wrap; }
.hero__trust { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--border-soft); }
.hero__trust div { font-size: 12px; color: var(--muted); }
.hero__trust b { display: block; font-size: 17px; color: var(--text); font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* =====================================================================
   Game grid
   ===================================================================== */
.gamegrid {
  display: grid; gap: 13px;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
}
.gamegrid--wide { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }

.gamecard {
  position: relative; display: block; border-radius: var(--r); overflow: hidden;
  aspect-ratio: 4 / 5; background: var(--surface-2);
  border: 1px solid var(--border-soft);
  transition: transform var(--med), border-color var(--med);
}
.gamecard:hover { transform: translateY(-3px); border-color: var(--border); }
.gamecard__art { position: absolute; inset: 0; background: var(--surface-2); }
.gamecard__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gamecard__glyph {
  position: absolute; inset: 0 0 32% 0; display: grid; place-items: center;
  font-size: 40px; color: var(--muted); transition: color var(--med), transform var(--med);
}
.gamecard:hover .gamecard__glyph { color: var(--brand); }
.gamecard__foot { position: absolute; inset: auto 0 0 0; padding: 11px 12px 12px; }
.gamecard__name { font-size: 13.5px; font-weight: 700; letter-spacing: -.01em; }
.gamecard__meta { font-size: 11px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.gamecard__tags { position: absolute; top: 10px; left: 10px; display: flex; gap: 5px; z-index: 2; }
.gamecard__play {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 3;
  background: rgba(14,18,21,.6); opacity: 0; transition: opacity var(--med);
}
.gamecard:hover .gamecard__play { opacity: 1; }
.gamecard__play span {
  width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: #06120b;
  display: grid; place-items: center; font-size: 15px; padding-left: 3px;
}

/* Rail (horizontal scroller) */
.rail { display: flex; gap: 13px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { flex: 0 0 158px; scroll-snap-align: start; }
.rail::-webkit-scrollbar { height: 6px; }

/* =====================================================================
   Live feed
   ===================================================================== */
.feed { font-size: 13px; }
.feed__row { display: grid; grid-template-columns: 1.4fr 1fr .8fr .9fr; gap: 10px; align-items: center;
  padding: 9px 14px; border-bottom: 1px solid var(--border-soft); }
.feed__row:last-child { border-bottom: 0; }
.feed__head { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted-2); font-weight: 700; }
.feed__user { display: flex; align-items: center; gap: 8px; min-width: 0; }
.feed__user .avatar { width: 24px; height: 24px; border-radius: 6px; font-size: 10px; }
.feed .num { text-align: right; font-variant-numeric: tabular-nums; }
@keyframes flashin { from { background: var(--surface-2); } to { background: transparent; } }
.feed__row--new { animation: flashin 1s var(--ease); }

/* =====================================================================
   Game screen
   ===================================================================== */
.gameshell {
  display: grid; grid-template-columns: 318px 1fr; gap: 0;
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--r-lg); overflow: hidden; min-height: 560px;
}
.betpanel { background: var(--surface-2); padding: 16px; display: flex; flex-direction: column; gap: 13px; border-right: 1px solid var(--border-soft); }
.gamestage { position: relative; padding: 20px; display: flex; flex-direction: column; min-width: 0; background: var(--bg-2); }
.gamestage__inner { flex: 1; display: grid; place-items: center; min-height: 0; }
.gamebar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 11px 16px; border-top: 1px solid var(--border-soft); background: var(--surface);
  font-size: 12.5px; color: var(--muted);
}
.gamebar b { color: var(--text-2); font-weight: 600; }

.amountctl { position: relative; }
.amountctl .input { padding-right: 118px; font-weight: 650; font-variant-numeric: tabular-nums; }
.amountctl__btns { position: absolute; right: 5px; top: 5px; bottom: 5px; display: flex; gap: 3px; }
.amountctl__btns button {
  padding: 0 10px; border-radius: var(--r-xs); background: var(--surface-3); color: var(--text-2);
  font-size: 11.5px; font-weight: 700; transition: all var(--fast);
}
.amountctl__btns button:hover { background: var(--border); color: var(--text); }

.betbtn { height: 52px; font-size: 15.5px; font-weight: 750; border-radius: var(--r); }

.resultflash {
  position: absolute; top: 18px; left: 50%; translate: -50% 0; z-index: 5;
  padding: 9px 18px; border-radius: var(--r-full); font-weight: 750; font-size: 15px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--sh-3);
  opacity: 0; transform: translate(-50%, -12px); transition: all var(--med); pointer-events: none;
}
.resultflash.show { opacity: 1; transform: translate(-50%, 0); }
.resultflash.win { border-color: var(--brand); color: var(--win); }
.resultflash.loss { border-color: rgba(236,91,107,.45); color: var(--loss); }

/* =====================================================================
   Modal / toast / misc
   ===================================================================== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200; background: rgba(6,9,11,.75);
  display: grid; place-items: center; padding: 20px;
  opacity: 0; visibility: hidden; transition: opacity var(--med), visibility var(--med);
}
.modal-backdrop.is-open { opacity: 1; visibility: visible; }
.modal {
  width: min(520px, 100%); max-height: 88vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-xl);
  box-shadow: var(--sh-3); transform: scale(.96) translateY(10px); transition: transform var(--med);
}
.modal--wide { width: min(760px, 100%); }
.modal-backdrop.is-open .modal { transform: none; }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border-soft); }
.modal__head h3 { font-size: 16px; }
.modal__body { padding: 22px; }
.modal__foot { padding: 16px 22px; border-top: 1px solid var(--border-soft); display: flex; gap: 10px; justify-content: flex-end; }

#toasts { position: fixed; z-index: 300; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 9px; pointer-events: none; }
.toast {
  min-width: 250px; max-width: 380px; padding: 12px 15px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--border); box-shadow: var(--sh-3);
  display: flex; gap: 11px; align-items: flex-start; font-size: 13.5px;
  animation: toastin .3s var(--ease); pointer-events: auto;
}
@keyframes toastin { from { opacity: 0; transform: translateX(28px); } }
.toast.out { animation: toastout .25s var(--ease) forwards; }
@keyframes toastout { to { opacity: 0; transform: translateX(28px); } }
.toast i { font-size: 15px; margin-top: 1px; }
.toast--ok i { color: var(--brand); }
.toast--err i { color: var(--loss); }
.toast--info i { color: var(--info); }

.alert { display: flex; gap: 11px; padding: 13px 15px; border-radius: var(--r); font-size: 13.5px; align-items: flex-start; margin-bottom: 16px; }
.alert i { margin-top: 2px; }
.alert--ok { background: var(--surface-2); border: 1px solid var(--border-soft); color: var(--text-2); }
.alert--ok i { color: var(--brand); }
.alert--err { background: rgba(236,91,107,.08); border: 1px solid rgba(236,91,107,.22); color: #f0bcc3; }
.alert--err i { color: var(--loss); }
.alert--warn { background: rgba(233,161,59,.08); border: 1px solid rgba(233,161,59,.22); color: #efd9b2; }
.alert--warn i { color: var(--warn); }
.alert--info { background: var(--surface-2); border: 1px solid var(--border-soft); color: var(--text-2); }
.alert--info i { color: var(--info); }

.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* =====================================================================
   Auth screens - one centred card, not two full-bleed panels
   ===================================================================== */
.authwrap {
  min-height: 100vh; display: grid; place-items: center; padding: 32px 20px;
  background:
    radial-gradient(900px 520px at 15% -10%, rgba(40,209,108,.10), transparent 60%),
    radial-gradient(700px 460px at 100% 100%, rgba(40,209,108,.06), transparent 55%),
    var(--bg);
}
.authbox {
  width: min(940px, 100%); display: grid; grid-template-columns: 1.05fr .95fr;
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--r-xl); box-shadow: var(--sh-3); overflow: hidden;
}

/* Left: brand + mascot, grounded on its own surface */
.authside {
  position: relative; padding: 34px 32px;
  display: flex; flex-direction: column;
  background:
    radial-gradient(520px 300px at 50% 108%, rgba(40,209,108,.14), transparent 62%),
    var(--surface-2);
  border-right: 1px solid var(--border-soft);
}
.authside__body { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; min-height: 0; }
.authside h1 { font-size: 27px; line-height: 1.15; letter-spacing: -.02em; }
.authside__lede { color: var(--text-2); font-size: 13.5px; line-height: 1.6; margin: 10px 0 0; }
.authside__foot { margin-top: 22px; font-size: 11px; color: var(--muted-2); }

/* Right: the form */
.authmain { display: grid; place-items: center; padding: 34px 32px; background: var(--surface); }
.authcard { width: 100%; max-width: 360px; }
.authcard h1 { font-size: 23px; margin-bottom: 5px; letter-spacing: -.02em; }
.authcard > p { color: var(--muted); margin-bottom: 22px; font-size: 13.5px; }

/* Feature rows */
.authfeats { display: flex; flex-direction: column; gap: 12px; margin-top: 22px; }
.authfeat { display: flex; gap: 11px; align-items: center; }
.authfeat i { width: 30px; height: 30px; flex: none; border-radius: var(--r-sm); display: grid; place-items: center;
  background: rgba(40,209,108,.12); color: var(--brand); font-size: 12px; }
.authfeat b { display: block; font-size: 12.5px; line-height: 1.3; }
.authfeat span { font-size: 11.5px; color: var(--muted); }

/* Mascot artwork - sits on a soft pedestal so it isn't floating in the void */
.mascot-img {
  position: relative; z-index: 1;
  width: auto; height: clamp(190px, 30vh, 280px); object-fit: contain; object-position: center bottom;
  align-self: center; margin: 0 0 -6px;
  filter: drop-shadow(0 22px 26px rgba(0,0,0,.55));
  pointer-events: none; user-select: none;
}
.mascot-img--sm {
  height: 46px; margin: 0; align-self: auto; filter: drop-shadow(0 6px 12px rgba(0,0,0,.4));
}

/* Promo strip on the sign-up panel */
.authpromo {
  margin-top: 20px; padding: 12px 14px; border-radius: var(--r);
  background: rgba(40,209,108,.07); border: 1px solid rgba(40,209,108,.20);
}
.authpromo__label { font-size: 10px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--brand); }

/* Placeholder slot, kept for pages without artwork */
.mascot-slot {
  width: min(200px, 58%); aspect-ratio: 4 / 5; margin: 0 auto 8px;
  border: 1.5px dashed var(--border); border-radius: var(--r-lg); background: var(--surface-3);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--muted-2); text-align: center; padding: 16px;
}
.mascot-slot i { font-size: 26px; color: var(--muted); }
.mascot-slot span { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.mascot-slot--sm { width: 46px; aspect-ratio: 1; border-radius: var(--r); gap: 0; padding: 6px; flex: none; margin: 0; }
.mascot-slot--sm i { font-size: 15px; }
.mascot-slot--sm span { display: none; }

/* Fairness / code blocks */
.codeblock {
  background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: var(--r-sm);
  padding: 11px 13px; font-family: var(--mono); font-size: 12px; color: var(--text-2);
  word-break: break-all; line-height: 1.6;
}

/* Copy field */
.copyfield { display: flex; gap: 8px; }
.copyfield .input { font-family: var(--mono); font-size: 12.5px; }

/* QR */
.qrbox { background: #fff; padding: 10px; border-radius: var(--r); width: 168px; height: 168px; display: grid; place-items: center; margin: 0 auto; }
.qrbox img, .qrbox canvas { width: 100%; height: 100%; image-rendering: pixelated; }

/* Bottom nav (mobile) */
.bottomnav { display: none; }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 1180px) {
  .gameshell { grid-template-columns: 292px 1fr; }
}
@media (max-width: 1024px) {
  /* Stack the card: brand strip on top, form below */
  .authbox { grid-template-columns: 1fr; max-width: 460px; }
  .authside {
    padding: 24px 26px 0; border-right: 0; border-bottom: 1px solid var(--border-soft);
    /* mascot to the right so it never collides with the pinned logo */
    flex-direction: row-reverse; align-items: flex-end; gap: 16px;
  }
  .authside__brand { position: absolute; top: 20px; left: 26px; }
  .authside__body { justify-content: flex-end; padding: 44px 0 22px; }
  .authside h1 { font-size: 21px; }
  .authside__lede, .authfeats, .authpromo, .authside__foot { display: none; }
  .mascot-img { height: 132px; align-self: flex-end; margin: 0; }
  .authmain { padding: 26px 26px 30px; }

  .gameshell { grid-template-columns: 1fr; }
  .betpanel { border-right: 0; border-top: 1px solid var(--border-soft); order: 2; }
  .gamestage { order: 1; min-height: 380px; }
}
@media (max-width: 640px) {
  .authwrap { padding: 0; place-items: stretch; }
  .authbox { max-width: none; min-height: 100vh; border: 0; border-radius: 0; box-shadow: none;
             grid-template-rows: auto 1fr; }
  .authside { padding: 22px 20px 0; gap: 12px; }
  .authside__brand { top: 18px; left: 20px; }
  .authside__body { padding: 40px 0 18px; }
  .authside h1 { font-size: 19px; }
  .mascot-img { height: 108px; }
  .authmain { padding: 22px 20px 32px; align-items: start; }
  .mascot-slot { width: 92px; aspect-ratio: 1; margin-bottom: 10px; }
  .mascot-slot span { display: none; }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 260px; }
  .sidebar { transform: translateX(-100%); box-shadow: var(--sh-3); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; z-index: 55; background: rgba(6,9,11,.62); }
  .main { margin-left: 0 !important; }
  body.nav-min .sidebar { width: var(--sidebar-w); }
  .searchbox { display: none; }
  .page { padding: 16px 13px calc(var(--bottom-h) + 30px); }
  .hero { padding: 28px 22px; border-radius: var(--r-lg); }
  .feed__row { grid-template-columns: 1.3fr .9fr .8fr; }
  .feed__row > :nth-child(3) { display: none; }
  .bottomnav {
    display: flex; position: fixed; inset: auto 0 0 0; z-index: 65; height: var(--bottom-h);
    background: var(--surface); border-top: 1px solid var(--border-soft);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--muted); font-size: 10px; font-weight: 600; transition: color var(--fast); }
  .bottomnav a i { font-size: 16px; }
  .bottomnav a.is-active { color: var(--brand); }
  .bottomnav a.bottomnav__cta { flex: 0 0 74px; }
  .bottomnav a.bottomnav__cta i { width: 38px; height: 38px; border-radius: var(--r); background: var(--brand); color: #06120b;
    display: grid; place-items: center; margin-top: -16px; font-size: 16px; }
  #toasts { left: 13px; right: 13px; bottom: calc(var(--bottom-h) + 14px); }
  .toast { max-width: none; }
}
@media (max-width: 560px) {
  .gamegrid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 9px; }
  .rail { gap: 9px; }
  .rail > * { flex-basis: 112px; }
  .gamecard__foot { padding: 7px 8px 8px; }
  .gamecard__name { font-size: 11.5px; }
  .gamecard__meta { font-size: 9.5px; }
  .gamecard__play span { width: 34px; height: 34px; font-size: 12px; }
  .gamecard__glyph { font-size: 30px; }
  .balpill__cta span { display: none; }
  .balpill__cta { padding: 0 11px; }
  .balpill__amt { padding: 0 7px 0 10px; font-size: 12.5px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .pagehead h1 { font-size: 21px; }
  .modal__body, .modal__head, .modal__foot { padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
