@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ── Variables ──────────────────────────────────────────── */
:root {
  --bg:        #F0F4F8;
  --surface:   #FFFFFF;
  --surface2:  #F8FAFC;
  --border:    #E2E8F0;
  --border2:   #CBD5E1;
  --text:      #0F172A;
  --text2:     #64748B;
  --green:     #00C853;
  --green-dk:  #00A846;
  --green-bg:  rgba(0,200,83,.09);
  --green-bd:  rgba(0,200,83,.28);
  --red:       #EF4444;
  --red-bg:    rgba(239,68,68,.08);
  --red-bd:    rgba(239,68,68,.30);
  --orange:    #F97316;
  --orange-bg: rgba(249,115,22,.08);
  --orange-bd: rgba(249,115,22,.28);
  --gold:      #F59E0B;
  --r:         14px;
  --r-sm:      9px;
  --sh:        0 2px 12px rgba(15,23,42,.08);
  --sh-md:     0 4px 24px rgba(15,23,42,.12);
  --f:         'Plus Jakarta Sans', system-ui, sans-serif;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--f);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
button { font-family: var(--f); cursor: pointer; }

/* ══════════════════════════════════════════════════════════
   AUTH PAGE
══════════════════════════════════════════════════════════ */
.auth-wrap {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(ellipse 65% 45% at 95% 5%,  rgba(0,200,83,.12)  0%, transparent 65%),
    radial-gradient(ellipse 55% 40% at 5%  95%, rgba(245,158,11,.10) 0%, transparent 65%),
    var(--bg);
}

.auth-card {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 36px 28px 28px;
  box-shadow: var(--sh-md);
  animation: slideUp .35s ease;
}

/* Brand */
.brand { text-align: center; margin-bottom: 28px; }
.brand-logo {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--green), #00A846);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem; font-weight: 800; color: #fff;
  margin: 0 auto 12px;
  box-shadow: 0 4px 16px rgba(0,200,83,.30);
}
.brand h1 { font-size: 2rem; font-weight: 800; color: var(--text); letter-spacing: -.5px; }
.brand p  { font-size: .83rem; color: var(--text2); margin-top: 4px; font-weight: 500; }

/* Tabs */
.tabs {
  display: flex; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 4px; gap: 4px; margin-bottom: 22px;
}
.tab {
  flex: 1; padding: 9px; border: none; border-radius: 6px;
  background: transparent; color: var(--text2);
  font-size: .875rem; font-weight: 700; transition: all .2s;
}
.tab.active { background: var(--green); color: #fff; box-shadow: 0 2px 8px rgba(0,200,83,.30); }

/* Alert */
.alert {
  display: none; align-items: center; gap: 8px;
  background: var(--red-bg); border: 1.5px solid var(--red-bd);
  color: var(--red); border-radius: var(--r-sm);
  padding: 11px 14px; font-size: .85rem; font-weight: 700;
  margin-bottom: 16px; line-height: 1.4; animation: fadeIn .25s ease;
}
.alert:not(:empty) { display: flex; }

/* Forms */
.form { display: none; flex-direction: column; gap: 14px; }
.form.active { display: flex; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: .73rem; font-weight: 700; color: var(--text2);
  text-transform: uppercase; letter-spacing: .07em;
}
.field input {
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: var(--r-sm); padding: 12px 14px;
  color: var(--text); font-family: var(--f);
  font-size: .975rem; font-weight: 500; outline: none;
  transition: border-color .2s, box-shadow .2s; width: 100%;
}
.field input:focus {
  border-color: var(--green); background: #fff;
  box-shadow: 0 0 0 3px rgba(0,200,83,.12);
}
.field input::placeholder { color: var(--text2); opacity: .5; }

.phone { display: flex; gap: 8px; }
.prefix {
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: var(--r-sm); padding: 12px 14px;
  color: var(--text2); font-size: .975rem; font-weight: 700;
  white-space: nowrap; flex-shrink: 0;
}
.phone input { flex: 1; }

/* Buttons */
.primary {
  background: var(--green); color: #fff;
  font-size: .95rem; font-weight: 800;
  padding: 13px 20px; border: none;
  border-radius: var(--r-sm); cursor: pointer;
  transition: background .2s, transform .12s, box-shadow .2s;
  width: 100%; letter-spacing: .01em;
  box-shadow: 0 2px 10px rgba(0,200,83,.25);
}
.primary:hover { background: var(--green-dk); box-shadow: 0 4px 16px rgba(0,200,83,.35); }
.primary:active { transform: scale(.98); }
.primary:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.ghost {
  background: transparent; color: var(--text);
  font-size: .95rem; font-weight: 700;
  padding: 12px 20px; border: 1.5px solid var(--border2);
  border-radius: var(--r-sm); cursor: pointer;
  transition: all .2s; width: 100%;
}
.ghost:hover { border-color: var(--text2); background: var(--surface2); }

.small-btn { font-size: .82rem !important; padding: 7px 14px !important; width: auto !important; }

.auth-footer {
  text-align: center; font-size: .72rem;
  color: var(--text2); margin-top: 20px; opacity: .7;
}

/* ══════════════════════════════════════════════════════════
   APP SHELL
══════════════════════════════════════════════════════════ */
.shell { min-height: 100dvh; }
.app   { max-width: 920px; margin: 0 auto; padding-bottom: 90px; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 18px;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(15,23,42,.06);
}
.logo { font-size: 1.45rem; font-weight: 800; color: var(--text); letter-spacing: -.4px; }
.logo span { color: var(--green); }
.pill {
  background: var(--green-bg); border: 1.5px solid var(--green-bd);
  color: var(--green-dk); font-size: .82rem; font-weight: 800;
  padding: 6px 15px; border-radius: 100px; cursor: pointer;
  transition: background .2s; white-space: nowrap;
}
.pill:hover { background: rgba(0,200,83,.16); }

/* Bottom nav */
.bottom {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  display: flex;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 12px rgba(15,23,42,.06);
}
.nav {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 2px; padding: 10px 6px 9px;
  border: none; background: transparent; color: var(--text2);
  cursor: pointer; transition: color .2s; position: relative;
}
.nav em   { font-size: 1.2rem; font-style: normal; display: block; line-height: 1; }
.nav span { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.nav.active { color: var(--green); }
.nav.active::before {
  content: '';
  position: absolute; top: 0; left: 50%;
  transform: translateX(-50%);
  width: 28px; height: 3px;
  background: var(--green); border-radius: 0 0 4px 4px;
}

/* Screens */
.screen { display: none; padding: 18px 16px 12px; animation: fadeIn .22s ease; }
.screen.active { display: block; }

/* Hero card */
.hero {
  background: linear-gradient(135deg, var(--green) 0%, #00A846 100%);
  border-radius: 18px; padding: 22px 20px; margin-bottom: 18px;
  position: relative; overflow: hidden; color: #fff;
  box-shadow: 0 6px 24px rgba(0,200,83,.30);
}
.hero::after {
  content: '';
  position: absolute; top: -50px; right: -50px;
  width: 190px; height: 190px;
  background: rgba(255,255,255,.10);
  border-radius: 50%; pointer-events: none;
}
.hero::before {
  content: '';
  position: absolute; bottom: -30px; left: -30px;
  width: 130px; height: 130px;
  background: rgba(255,255,255,.06);
  border-radius: 50%; pointer-events: none;
}
.eyebrow {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .09em; color: rgba(255,255,255,.75); margin-bottom: 5px;
}
.balance {
  font-size: 2.1rem; font-weight: 800; color: #fff;
  letter-spacing: -1px; line-height: 1.1; margin-bottom: 7px;
}
.small { font-size: .79rem; color: rgba(255,255,255,.80); line-height: 1.55; font-weight: 500; }
.hint  { font-size: .76rem; color: var(--text2); line-height: 1.5; }

.actions { display: flex; gap: 10px; margin-top: 16px; }
.actions .primary {
  background: #fff; color: var(--green-dk);
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.actions .primary:hover { background: #f0fff4; }
.actions .ghost {
  border-color: rgba(255,255,255,.4); color: #fff;
}
.actions .ghost:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.6); }
.actions .primary, .actions .ghost { flex: 1; }

/* Stats */
.grid3 {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 10px; margin-bottom: 20px;
}
.metric {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 14px 8px; text-align: center;
  box-shadow: var(--sh);
}
.metric b     { display: block; font-size: 1.5rem; font-weight: 800; color: var(--green-dk); margin-bottom: 3px; }
.metric span  { font-size: .63rem; color: var(--text2); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

/* Section header */
.section-head {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 11px;
}
.section-head h2 { font-size: .95rem; font-weight: 700; color: var(--text); }

/* Badge */
.badge {
  font-size: .62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; padding: 3px 9px; border-radius: 100px;
  background: var(--green-bg); color: var(--green-dk);
  border: 1px solid var(--green-bd); white-space: nowrap;
}
.badge.soon {
  background: var(--orange-bg); color: var(--orange); border-color: var(--orange-bd);
}

/* Cards */
.cards      { display: flex; flex-direction: column; gap: 10px; }
.cards.two  { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

article.game {
  display: flex; align-items: center; gap: 13px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 15px 14px;
  cursor: pointer; box-shadow: var(--sh);
  transition: border-color .2s, box-shadow .2s, transform .12s;
  text-align: left;
}
article.game:hover {
  border-color: var(--green-bd);
  box-shadow: 0 4px 18px rgba(0,200,83,.14);
  transform: translateY(-1px);
}
article.game:active { transform: translateY(0); }

.game .icon {
  width: 46px; height: 46px;
  background: var(--green-bg); border: 1.5px solid var(--green-bd);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.game > div:nth-child(2)  { flex: 1; min-width: 0; }
.game h3  { font-size: .92rem; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.game p   { font-size: .76rem; color: var(--text2); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Panel */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 18px; margin-bottom: 4px;
  box-shadow: var(--sh);
}
.panel h3 { font-size: .92rem; font-weight: 700; margin-bottom: 6px; }

/* Stake buttons */
.stake-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 16px; }
.stake {
  background: rgba(255,255,255,.15); border: 1.5px solid rgba(255,255,255,.35);
  border-radius: var(--r-sm); color: #fff;
  font-size: .875rem; font-weight: 700; padding: 10px 6px;
  cursor: pointer; transition: all .2s;
}
.stake:hover, .stake.active {
  background: #fff; color: var(--green-dk); border-color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}

/* Wallet form */
.wallet-form { display: flex; flex-direction: column; gap: 13px; }

/* Row (transactions / leaderboard) */
.row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 13px 16px; gap: 8px;
  box-shadow: var(--sh);
}
.row p { font-size: .875rem; font-weight: 500; color: var(--text); }
.row b { font-weight: 700; color: var(--green-dk); font-size: .875rem; white-space: nowrap; }

/* Transaction color coding */
.row.credit b, .row.deposit b             { color: var(--green-dk); }
.row.debit b, .row.withdrawal b, .row.lose b { color: var(--red); }
.row.pending b                             { color: var(--orange); }

/* Desktop split */
@media (min-width: 680px) {
  .desktop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
  .screen       { padding: 22px 24px 14px; }
}

/* ══════════════════════════════════════════════════════════
   TOAST — color coded feedback
══════════════════════════════════════════════════════════ */
.toast {
  position: fixed; bottom: 88px; left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--text); color: #fff;
  font-size: .875rem; font-weight: 700;
  padding: 12px 24px; border-radius: 100px;
  pointer-events: none; opacity: 0;
  transition: opacity .28s ease, transform .28s ease;
  z-index: 9999; max-width: 90vw; text-align: center;
  white-space: nowrap; box-shadow: var(--sh-md);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ✅ Success — green */
.toast.success {
  background: var(--green);
  color: #fff;
  box-shadow: 0 4px 20px rgba(0,200,83,.35);
}
/* ❌ Error — red */
.toast.error {
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 20px rgba(239,68,68,.35);
}
/* ⏳ Warning / pending — orange */
.toast.warning {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 4px 20px rgba(249,115,22,.35);
}

/* ══════════════════════════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════════════════════════ */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
/* ══════════════════════════════════════════════════════════════════════════
   BATTLE CARDS (Arena)
══════════════════════════════════════════════════════════════════════════ */
article.battle {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 16px;
  box-shadow: var(--sh);
}
.battle-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.battle-top h3 { font-size: .92rem; font-weight: 700; }
.battle-top .amount { font-size: 1rem; font-weight: 800; color: var(--green-dk); }
.battle p { font-size: .78rem; color: var(--text2); margin-bottom: 12px; line-height: 1.5; }
.battle .actions { display: flex; gap: 8px; }

/* ══════════════════════════════════════════════════════════════════════════
   NUMBER CLASH SCREENS
══════════════════════════════════════════════════════════════════════════ */

/* Clash hero — purple/indigo gradient to distinguish from Arena green */
.hero.clash-hero {
  background: linear-gradient(135deg, #7C3AED 0%, #5B21B6 100%);
  box-shadow: 0 6px 24px rgba(124,58,237,.30);
}

/* Tabs */
.clash-tabs {
  display: flex; gap: 8px; margin-bottom: 16px;
}
.clash-tab {
  flex: 1; padding: 10px 0; border-radius: var(--r-sm);
  font-size: .82rem; font-weight: 700;
  border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text2);
  cursor: pointer; transition: all .18s;
}
.clash-tab.active {
  background: var(--green-bg); border-color: var(--green-bd);
  color: var(--green-dk);
}

/* Room cards */
.clash-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 16px;
  box-shadow: var(--sh);
  transition: border-color .2s, box-shadow .2s;
}
.clash-card:hover {
  border-color: var(--green-bd);
  box-shadow: 0 4px 18px rgba(0,200,83,.12);
}
.clash-head {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 12px;
}
.clash-head .badge { font-size: .72rem; }
.clash-head b { font-size: 1rem; font-weight: 800; color: var(--green-dk); }

/* Number slots row */
.clash-slots {
  display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap;
}
.slot {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: .82rem; font-weight: 800;
  border: 1.5px solid;
  transition: all .2s;
}
.slot.empty {
  background: var(--surface2); border-color: var(--border2);
  color: var(--text2);
}
.slot.taken {
  background: var(--green-bg); border-color: var(--green-bd);
  color: var(--green-dk);
}
.slot.mine {
  background: var(--green); border-color: var(--green-dk);
  color: #fff; box-shadow: 0 2px 8px rgba(0,200,83,.30);
}
.slot.winner {
  background: #F59E0B; border-color: #D97706;
  color: #fff; box-shadow: 0 2px 8px rgba(245,158,11,.35);
  animation: pulse .6s ease 2;
}

.clash-meta {
  font-size: .76rem; color: var(--text2);
  font-weight: 600; margin-bottom: 12px;
}

/* Progress bar */
.clash-progress {
  height: 5px; background: var(--border2);
  border-radius: 100px; margin-bottom: 10px; overflow: hidden;
}
.clash-progress-fill {
  height: 100%; background: var(--green);
  border-radius: 100px; transition: width .4s ease;
}

/* ── Number picker overlay ─────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(15,23,42,.55);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
  padding: 0 0 env(safe-area-inset-bottom);
}
.overlay.show { opacity: 1; pointer-events: all; }

.overlay-card {
  background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 28px 20px 32px;
  width: 100%; max-width: 480px;
  transform: translateY(20px);
  transition: transform .28s cubic-bezier(.22,1,.36,1);
  box-shadow: 0 -8px 40px rgba(15,23,42,.16);
}
.overlay.show .overlay-card { transform: translateY(0); }

.overlay-handle {
  width: 40px; height: 4px;
  background: var(--border2); border-radius: 100px;
  margin: 0 auto 20px; display: block;
}
.overlay-title {
  font-size: 1.05rem; font-weight: 800;
  color: var(--text); margin-bottom: 4px;
}
.overlay-sub {
  font-size: .79rem; color: var(--text2); font-weight: 500;
  margin-bottom: 20px; line-height: 1.5;
}

/* Number picker grid */
.num-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px; margin-bottom: 20px;
}
.num-btn {
  aspect-ratio: 1; border-radius: 12px;
  font-size: 1.05rem; font-weight: 800;
  border: 2px solid var(--border2);
  background: var(--surface2); color: var(--text);
  cursor: pointer; transition: all .18s;
  display: flex; align-items: center; justify-content: center;
}
.num-btn:hover:not(:disabled) {
  border-color: var(--green); background: var(--green-bg);
  color: var(--green-dk); transform: scale(1.06);
}
.num-btn.selected {
  border-color: var(--green); background: var(--green);
  color: #fff; box-shadow: 0 3px 12px rgba(0,200,83,.35);
  transform: scale(1.06);
}
.num-btn:disabled {
  background: var(--border); border-color: var(--border);
  color: var(--text2); cursor: not-allowed; opacity: .55;
}

/* Create room selector */
.player-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-bottom: 20px;
}
.player-opt {
  border: 2px solid var(--border2); border-radius: var(--r-sm);
  background: var(--surface2); padding: 14px 8px;
  text-align: center; cursor: pointer; transition: all .18s;
}
.player-opt:hover { border-color: var(--green-bd); background: var(--green-bg); }
.player-opt.selected { border-color: var(--green); background: var(--green-bg); }
.player-opt b { display: block; font-size: 1.3rem; font-weight: 800; color: var(--text); margin-bottom: 2px; }
.player-opt span { font-size: .68rem; color: var(--text2); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }

/* Result card */
.result-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 20px; margin-bottom: 10px;
  box-shadow: var(--sh);
  text-align: center;
}
.result-card .winning-num {
  width: 72px; height: 72px; border-radius: 20px;
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #fff; font-size: 2rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  box-shadow: 0 6px 20px rgba(245,158,11,.35);
  animation: pulse .6s ease 2;
}
.result-card .result-label {
  font-size: 1.05rem; font-weight: 800; margin-bottom: 6px;
}
.result-card .result-label.won { color: var(--green-dk); }
.result-card .result-label.lost { color: var(--red); }
.clash-seed {
  font-size: .68rem;
  color: var(--text2);
  font-family: monospace;
  letter-spacing: .01em;
  margin: 6px 0 4px;
  opacity: .75;
}

.overlay-seed {
  font-size: .68rem;
  color: var(--text2);
  font-family: monospace;
  text-align: center;
  margin: 4px 0 10px;
  opacity: .8;
  word-break: break-all;
}

.result-card .seed-proof,
.clash-card .seed-proof {
  font-size: .7rem; color: var(--text2); word-break: break-all;
  background: var(--surface2); border-radius: 8px;
  padding: 10px; margin-top: 12px; font-family: monospace; text-align: left;
  border: 1px solid var(--border);
}

/* Small button */
.small-btn {
  font-size: .78rem; padding: 7px 14px; border-radius: 8px;
}

/* My-rooms resolved card */
.clash-card.resolved { opacity: .82; }
.clash-card.resolved .clash-head b { color: var(--text2); }

/* ── Buttons (base) ────────────────────────────────────────────────────── */
.primary {
  background: var(--green); color: #fff; border: none;
  border-radius: var(--r-sm); font-size: .9rem; font-weight: 700;
  padding: 13px 20px; cursor: pointer; width: 100%;
  transition: background .18s, box-shadow .18s, transform .12s;
}
.primary:hover  { background: var(--green-dk); box-shadow: 0 4px 16px rgba(0,200,83,.3); }
.primary:active { transform: scale(.98); }
.primary:disabled { opacity: .5; cursor: not-allowed; }

.ghost {
  background: transparent; color: var(--text);
  border: 1.5px solid var(--border2);
  border-radius: var(--r-sm); font-size: .9rem; font-weight: 700;
  padding: 12px 20px; cursor: pointer; width: 100%;
  transition: border-color .18s, background .18s;
}
.ghost:hover  { border-color: var(--green-bd); background: var(--green-bg); color: var(--green-dk); }
.ghost:active { transform: scale(.98); }

.danger {
  background: var(--red-bg); color: var(--red);
  border: 1.5px solid var(--red-bd);
  border-radius: var(--r-sm); font-size: .875rem; font-weight: 700;
  padding: 9px 14px; cursor: pointer;
  transition: background .18s;
}
.danger:hover { background: rgba(239,68,68,.15); }

/* Field */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: .78rem; font-weight: 700; color: var(--text); }
.field input, .field select {
  background: var(--surface2); border: 1.5px solid var(--border2);
  border-radius: var(--r-sm); padding: 12px 14px;
  font-size: .92rem; font-weight: 500; font-family: var(--f);
  color: var(--text); transition: border-color .18s, box-shadow .18s;
  width: 100%;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-bg);
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.12); }
}

/* ── Responsive: 5-item bottom nav ─────────────────────────────────────── */
@media (max-width: 400px) {
  .nav span { font-size: .55rem; letter-spacing: 0; }
  .nav { padding: 10px 4px 9px; }
}
/* ══════════════════════════════════════════════════════════
   TRIVIA CLASH
══════════════════════════════════════════════════════════ */
.hero.trivia-hero { background: linear-gradient(135deg, #D97706 0%, #B45309 100%); box-shadow: 0 6px 24px rgba(217,119,6,.30); }
.trivia-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.trivia-tab { flex: 1; padding: 10px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text2); font-weight: 700; font-size: .82rem; cursor: pointer; transition: all .15s; }
.trivia-tab.active { background: #D97706; color: #fff; border-color: #D97706; box-shadow: 0 2px 8px rgba(217,119,6,.30); }
.trivia-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; transition: box-shadow .15s, transform .15s; }
.trivia-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); transform: translateY(-1px); }
.trivia-card-head { display: flex; align-items: center; justify-content: space-between; }
.trivia-card-head span { font-size: .82rem; color: var(--text2); font-weight: 600; }
.trivia-card-head b { font-size: 1rem; font-weight: 800; color: #B45309; }
.trivia-card.resolved { opacity: .82; }
.trivia-card.resolved .trivia-card-head b { color: var(--text2); }
.trivia-q-box { background: var(--surface); border: 1.5px solid var(--border); border-radius: 16px; padding: 20px 18px; margin-bottom: 12px; }
.trivia-q-num { font-size: .72rem; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.trivia-q-text { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 16px; line-height: 1.4; }
.trivia-opts { display: flex; flex-direction: column; gap: 8px; }
.trivia-opt { padding: 12px 14px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface2); color: var(--text); font-size: .9rem; font-weight: 600; cursor: pointer; text-align: left; transition: all .12s; }
.trivia-opt:hover { border-color: #D97706; background: rgba(217,119,6,.06); }
.trivia-opt.selected { border-color: #D97706; background: rgba(217,119,6,.10); color: #B45309; }
.trivia-opt.correct { border-color: var(--green); background: var(--green-bg); color: var(--green-dk); }
.trivia-opt.wrong { border-color: var(--red); background: var(--red-bg); color: var(--red); }
.trivia-timer-bar { height: 4px; background: var(--border); border-radius: 2px; margin-bottom: 14px; overflow: hidden; }
.trivia-timer-fill { height: 100%; background: #D97706; border-radius: 2px; transition: width .1s linear, background .3s; }
.trivia-progress { display: flex; gap: 6px; justify-content: center; margin-bottom: 14px; }
.trivia-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); transition: background .2s; }
.trivia-dot.done { background: #D97706; }
.trivia-dot.current { background: var(--text2); }
.trivia-result-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: 16px; padding: 24px 20px; text-align: center; margin-bottom: 12px; }
.trivia-result-icon { font-size: 2.8rem; margin-bottom: 10px; }
.trivia-result-title { font-size: 1.3rem; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.trivia-result-sub { font-size: .9rem; color: var(--text2); font-weight: 500; }
.trivia-score-row { display: flex; gap: 12px; margin: 16px 0 0; }
.trivia-score-box { flex: 1; background: var(--surface2); border: 1.5px solid var(--border); border-radius: 12px; padding: 14px 10px; text-align: center; }
.trivia-score-box b { display: block; font-size: 1.5rem; font-weight: 800; color: var(--text); }
.trivia-score-box span { font-size: .72rem; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .05em; }
.trivia-waiting { text-align: center; padding: 32px 20px; }
.trivia-waiting .spin { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: #D97706; border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
.trivia-stake-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.trivia-stake-chip { padding: 10px 6px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface2); color: var(--text); font-weight: 700; font-size: .85rem; cursor: pointer; transition: all .12s; text-align: center; }
.trivia-stake-chip.active { border-color: #D97706; background: rgba(217,119,6,.10); color: #B45309; }

/* ── Rich toasts ───────────────────────────────────────── */
#toast { display:flex; align-items:center; gap:10px; min-width:260px; max-width:340px; padding:13px 16px; border-radius:14px; font-size:.88rem; font-weight:700; box-shadow:0 8px 32px rgba(0,0,0,.18); transition:opacity .3s,transform .3s; opacity:0; transform:translateY(16px) scale(.97); pointer-events:none; position:fixed; bottom:84px; left:50%; translate:-50% 0; z-index:9999; }
#toast.show { opacity:1; transform:translateY(0) scale(1); pointer-events:auto; }
#toast.toast-success { background:#166534; color:#dcfce7; }
#toast.toast-error   { background:#991b1b; color:#fee2e2; }
#toast.toast-warning { background:#92400e; color:#fef3c7; }
#toast.toast-info    { background:#1e3a5f; color:#dbeafe; }
#toast .toast-icon   { font-size:1.1rem; flex-shrink:0; }
#toast .toast-msg    { flex:1; line-height:1.35; }

/* ── In-app notification banner ────────────────────────── */
#notifBanner { position:fixed; top:0; left:0; right:0; z-index:9998; transform:translateY(-100%); transition:transform .35s cubic-bezier(.4,0,.2,1); }
#notifBanner.show { transform:translateY(0); }
.notif-inner { margin:8px 12px; padding:14px 16px; border-radius:14px; display:flex; align-items:center; gap:12px; box-shadow:0 4px 24px rgba(0,0,0,.18); }
.notif-inner.notif-success { background:#166534; color:#dcfce7; }
.notif-inner.notif-info    { background:#1e3a5f; color:#dbeafe; }
.notif-inner.notif-warning { background:#92400e; color:#fef3c7; }
.notif-icon { font-size:1.4rem; }
.notif-body { flex:1; }
.notif-title { font-size:.9rem; font-weight:800; margin-bottom:1px; }
.notif-sub   { font-size:.78rem; font-weight:500; opacity:.85; }
.notif-close { font-size:1.1rem; opacity:.7; cursor:pointer; padding:4px; }

/* ── Home live rooms ────────────────────────────────────── */
.live-rooms-section { margin-bottom:8px; }
.live-room-chip { display:flex; align-items:center; gap:10px; padding:12px 14px; background:var(--surface); border:1.5px solid var(--border); border-radius:12px; cursor:pointer; transition:all .15s; text-decoration:none; }
.live-room-chip:hover { border-color:var(--accent); transform:translateY(-1px); box-shadow:0 4px 12px rgba(0,0,0,.08); }
.live-room-chip .lrc-icon { font-size:1.3rem; }
.live-room-chip .lrc-body { flex:1; }
.live-room-chip .lrc-title { font-size:.85rem; font-weight:800; color:var(--text); }
.live-room-chip .lrc-sub   { font-size:.75rem; font-weight:500; color:var(--text2); }
.live-room-chip .lrc-badge { font-size:.72rem; font-weight:800; padding:3px 8px; border-radius:20px; color:#fff; }
.lrc-badge.arena  { background:#16a34a; }
.lrc-badge.trivia { background:#D97706; }
.lrc-badge.clash  { background:#7c3aed; }

/* ── Trivia result breakdown ──────────────────────────── */
.trivia-result-card { background:var(--surface); border-radius:18px; padding:20px 16px; margin-bottom:14px; }
.trivia-result-icon { font-size:2.6rem; text-align:center; margin-bottom:6px; }
.trivia-result-title { font-size:1.3rem; font-weight:800; text-align:center; margin-bottom:4px; color:var(--text); }
.trivia-result-sub   { font-size:.82rem; font-weight:500; text-align:center; color:var(--text2); margin-bottom:14px; }
.trivia-score-row    { display:flex; gap:12px; margin-bottom:14px; }
.trivia-score-box    { flex:1; background:var(--surface2); border-radius:12px; padding:12px 8px; text-align:center; border:2px solid var(--border); }
.trivia-score-box b  { display:block; font-size:1.5rem; font-weight:900; color:var(--text); margin-bottom:2px; }
.trivia-score-box span { font-size:.72rem; font-weight:600; color:var(--text2); }
.trivia-score-box.tsb-win { border-color:#16a34a; background:rgba(22,163,74,.08); }
.trivia-score-box.tsb-win b { color:#16a34a; }
.trivia-tie-info { font-size:.78rem; font-weight:700; color:#D97706; background:rgba(217,119,6,.1); border-radius:8px; padding:8px 10px; margin-bottom:12px; text-align:center; }
.trivia-breakdown { background:var(--surface2); border-radius:12px; overflow:hidden; margin-top:4px; }
.tbd-header { display:grid; grid-template-columns:1fr 52px 52px; padding:7px 10px; background:var(--border); font-size:.7rem; font-weight:800; color:var(--text2); text-transform:uppercase; letter-spacing:.04em; }
.tbd-row { display:grid; grid-template-columns:1fr 52px 52px; align-items:center; padding:9px 10px; border-bottom:1px solid var(--border); position:relative; }
.tbd-row:last-child { border-bottom:none; }
.tbd-row.tbd-tiebreak { background:rgba(217,119,6,.07); }
.tbd-q { display:flex; flex-direction:column; gap:1px; }
.tbd-qno { font-size:.7rem; font-weight:800; color:var(--accent); }
.tbd-qtxt { font-size:.72rem; color:var(--text2); font-weight:500; line-height:1.3; }
.tbd-cell { text-align:center; font-size:.85rem; }
.tbd-ms   { font-size:.65rem; color:var(--text2); font-weight:600; }
.tbd-right { }
.tbd-wrong { opacity:.6; }
.tbd-lightning { position:absolute; right:4px; top:50%; transform:translateY(-50%); font-size:.8rem; }
