/* ==========================================================================
   ODIBET – Trivia games — design tokens
   ========================================================================== */
:root {
  --bg: #0a0e1f;
  --bg-2: #0f1530;
  --surface: #141b38;
  --surface-2: #1b2347;
  --surface-3: #232d58;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #eef1ff;
  --text-2: #a9b1d6;
  --text-3: #6f78a3;

  --brand: #ff6b2c;
  --brand-2: #ff2e7e;
  --brand-grad: linear-gradient(135deg, #ff8a2c 0%, #ff2e7e 100%);
  --ok: #2ee6a6;
  --bad: #ff5470;
  --warn: #fbbf24;

  --mint: #2ee6a6;
  --sky: #38bdf8;
  --violet: #a78bfa;
  --gold: #fbbf24;

  --opt-a: #3b82f6;
  --opt-b: #f43f5e;
  --opt-c: #f59e0b;
  --opt-d: #10b981;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
  --max: 1200px;
}

/* Country flags: Twemoji flag font (self-hosted, CC-BY 4.0), only used for the flag code points */
@font-face {
  font-family: 'Twemoji Country Flags';
  src: url('/fonts/TwemojiCountryFlags.woff2') format('woff2');
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
  font-display: swap;
}
.flag { font-family: 'Twemoji Country Flags', 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; font-size: 1.05em; line-height: 1; margin-right: 0.35em; display: inline-block; vertical-align: -0.08em; font-weight: 400; }
.country-pick { display: grid; gap: 4px; max-width: 260px; margin: 6px 0 4px; }
.country-pick span { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(255, 46, 126, 0.16), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(56, 189, 248, 0.12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.5;
  font-size: 15px;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img, svg { display: block; }
h1, h2, h3, h4 { font-family: var(--display); margin: 0; line-height: 1.15; letter-spacing: -0.01em; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.mono { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* ==========================================================================
   Header
   ========================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(10, 14, 31, 0.72);
  border-bottom: 1px solid var(--line);
}
.topbar .container { display: flex; align-items: center; gap: 18px; height: 66px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 21px; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--brand-grad);
  display: grid; place-items: center; box-shadow: 0 6px 18px rgba(255, 46, 126, 0.35);
}
.logo b { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-text { display: grid; line-height: 1; letter-spacing: 0.02em; }
.logo-text small {
  margin-top: 3px; font-family: var(--font); font-size: 10px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3);
}
.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a { padding: 8px 12px; border-radius: 10px; color: var(--text-2); font-weight: 500; font-size: 14px; }
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a.active { color: var(--text); background: var(--surface-2); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.balance-pill {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-weight: 700;
}
.balance-pill .coin { width: 24px; height: 24px; }
.balance-pill { position: relative; }
.balance-pill.bump { animation: bump 0.5s ease; }
.balance-pill.drain { animation: drain 0.6s ease; }
@keyframes drain { 30% { transform: scale(0.94); border-color: var(--bad); box-shadow: 0 0 0 4px rgba(255, 84, 112, 0.18); } }
.bal-delta { position: absolute; right: 8px; top: 50%; font-family: var(--display); font-weight: 800; font-size: 15px; pointer-events: none; white-space: nowrap;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6); animation: deltaFloat 1.5s cubic-bezier(0.2, 0.7, 0.3, 1) forwards; z-index: 5; }
.bal-delta.neg { color: var(--bad); --dy: 34px; }
.bal-delta.pos { color: var(--gold); --dy: -34px; }
@keyframes deltaFloat { 0% { opacity: 0; transform: translateY(-50%) scale(0.7); } 15% { opacity: 1; transform: translateY(-50%) scale(1.1); } 100% { opacity: 0; transform: translateY(calc(-50% + var(--dy))) scale(1); } }
@keyframes bump { 40% { transform: scale(1.08); border-color: var(--gold); } }
.sound-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); display: grid; place-items: center; cursor: pointer; padding: 0; flex: none; transition: color 0.15s, border-color 0.15s; }
.sound-btn:hover { color: var(--text); border-color: var(--line-strong); }
.sound-btn.on { color: var(--ok); }
.sound-btn.off { color: var(--text-3); }
.sound-btn.music { color: var(--text-2); }
.music-wrap { position: relative; }
.music-menu { position: absolute; right: 0; top: 44px; z-index: 50; width: 250px; padding: 6px; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow); animation: rise 0.15s ease; }
.music-menu.hidden { display: none; }
.mm-title { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); font-weight: 700; padding: 8px 10px 6px; }
.music-menu button { display: flex; align-items: start; gap: 10px; width: 100%; text-align: left; padding: 9px 10px; border-radius: 10px; background: none; border: 0; cursor: pointer; color: var(--text-2); }
.music-menu button:hover { background: var(--surface-3); color: var(--text); }
.music-menu button.on { color: var(--text); }
.music-menu b { display: block; font-size: 14px; }
.music-menu small { display: block; font-size: 12px; color: var(--text-3); line-height: 1.35; margin-top: 1px; }
.mm-check { width: 12px; flex: none; color: var(--brand); font-size: 10px; margin-top: 4px; }
.user-menu { position: relative; }
.avatar.char { background: none; overflow: hidden; padding: 0; }
.avatar.char svg { display: block; width: 100%; height: 100%; }
.avatar.avatar-lg { width: 64px; height: 64px; }
.profile-link { display: grid; justify-items: center; gap: 4px; flex: none; }
.profile-link span { font-size: 11px; font-weight: 700; color: var(--brand); }
.profile-link:hover .avatar { box-shadow: 0 0 0 3px var(--brand); }
.avatar.avatar-xl { width: 132px; height: 132px; box-shadow: 0 12px 34px rgba(0, 0, 0, 0.4); border: 4px solid var(--surface-3); }

/* Profile */
.profile-card { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; padding: 28px; }
.profile-hero { display: grid; justify-items: center; gap: 10px; }
.profile-char { font-family: var(--display); font-weight: 800; font-size: 15px; color: var(--text-2); }
.profile-meta { display: grid; gap: 6px; }
.profile-stats { display: flex; gap: 26px; margin: 10px 0 8px; }
.profile-stats div { display: grid; }
.profile-stats b { font-size: 20px; }
.profile-stats span { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; }
.avatar-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
.avatar-option {
  display: grid; justify-items: center; gap: 8px; padding: 14px 8px 12px; border-radius: 16px; cursor: pointer;
  background: var(--surface); border: 2px solid var(--line); transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.avatar-option:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.avatar-option.selected { border-color: var(--brand); background: linear-gradient(180deg, rgba(255, 107, 44, 0.16), var(--surface)); }
.avatar-option-img { width: 68px; height: 68px; border-radius: 50%; overflow: hidden; display: block; }
.avatar-option-img svg { display: block; width: 100%; height: 100%; }
.avatar-option-name { font-size: 13px; font-weight: 700; color: var(--text-2); }
.avatar-option.selected .avatar-option-name { color: var(--text); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 14px; color: #0a0e1f; flex: none;
  background: linear-gradient(135deg, #38bdf8, #a78bfa);
  border: 0; cursor: pointer;
}
.dropdown {
  position: absolute; right: 0; top: 46px; min-width: 200px; padding: 6px;
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow);
}
.dropdown a, .dropdown button {
  display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 9px;
  background: none; border: 0; cursor: pointer; font-size: 14px;
}
.dropdown a:hover, .dropdown button:hover { background: var(--surface-3); }
.dropdown .who { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.burger { display: none; background: none; border: 0; cursor: pointer; padding: 6px; }

/* ==========================================================================
   Buttons, inputs, chips
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 12px; border: 1px solid transparent; cursor: pointer;
  font-weight: 700; font-size: 14px; transition: transform 0.12s, filter 0.12s, background 0.12s; white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--brand-grad); color: #fff; box-shadow: 0 8px 22px rgba(255, 46, 126, 0.28); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-ok { background: rgba(46, 230, 166, 0.14); color: var(--ok); border-color: rgba(46, 230, 166, 0.35); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn-lg { padding: 15px 24px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--brand); font-weight: 700; font-size: 13px; }
.link-btn:hover { text-decoration: underline; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line);
}
.chip svg { width: 13px; height: 13px; }
.chip.live { background: rgba(255, 84, 112, 0.14); color: #ff8aa0; border-color: rgba(255, 84, 112, 0.35); }
.chip.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); animation: pulse 1.2s infinite; }
.chip.open { background: rgba(46, 230, 166, 0.12); color: var(--ok); border-color: rgba(46, 230, 166, 0.3); }
@keyframes pulse { 50% { opacity: 0.3; } }

.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.input, select.input {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--bg-2); color: var(--text); font: inherit; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 107, 44, 0.18); }
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.form-grid .span-2 { grid-column: span 2; }
.form-error { color: #ff8aa0; font-size: 13px; min-height: 18px; }

/* ==========================================================================
   Layout pieces
   ========================================================================== */
main { padding: 28px 0 60px; min-height: calc(100vh - 66px - 200px); }
.section { margin-top: 40px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head h2 { font-size: 24px; }
.section-head p { margin: 4px 0 0; color: var(--text-2); font-size: 14px; }
.card {
  background: linear-gradient(180deg, var(--surface) 0%, rgba(20, 27, 56, 0.8) 100%);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
}
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* ==========================================================================
   Hero / countdown
   ========================================================================== */
.hero {
  position: relative; overflow: hidden; border-radius: 26px; padding: 34px;
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(255, 46, 126, 0.35), transparent 70%),
    radial-gradient(500px 300px at 0% 100%, rgba(56, 189, 248, 0.25), transparent 70%),
    linear-gradient(135deg, #18204a, #10163a);
  border: 1px solid var(--line-strong);
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: center;
}
.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.35;
  background-image: radial-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 22px 22px; mask-image: linear-gradient(90deg, transparent, #000 70%);
}
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 12px; font-weight: 700; color: #ffb38a; }
.hero h1 { font-size: clamp(30px, 4.4vw, 48px); margin: 10px 0 12px; font-weight: 800; }
.hero h1 .grad { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { color: var(--text-2); font-size: 16px; margin: 0 0 22px; max-width: 520px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.countdown-box {
  position: relative; z-index: 1; text-align: center; padding: 26px 20px; border-radius: 22px;
  background: rgba(10, 14, 31, 0.55); border: 1px solid var(--line-strong);
}
.countdown-box .label { font-size: 13px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-2); font-weight: 700; }
.countdown-digits { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 14px 0 10px; }
.digit-group { display: grid; gap: 6px; }
.digit-group b {
  font-family: var(--display); font-size: clamp(44px, 7vw, 72px); font-weight: 800; line-height: 1;
  min-width: 1.4em; padding: 14px 12px; border-radius: 16px; background: var(--surface-2);
  border: 1px solid var(--line-strong); font-variant-numeric: tabular-nums;
}
.digit-group span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-3); }
.countdown-digits .colon { font-family: var(--display); font-size: 48px; font-weight: 800; color: var(--text-3); margin-top: -26px; }
.countdown-box .sub { font-size: 14px; color: var(--text-2); }
.hero-stats { display: flex; gap: 22px; margin-top: 26px; flex-wrap: wrap; }
.hero-stats div b { display: block; font-family: var(--display); font-size: 22px; }
.hero-stats div span { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; }

/* ==========================================================================
   Draw cards
   ========================================================================== */
.draw-card {
  --tier: var(--sky);
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 18px;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s; overflow: hidden;
}
.draw-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 120px; pointer-events: none;
  background: radial-gradient(260px 120px at 20% 0%, color-mix(in srgb, var(--tier) 28%, transparent), transparent 70%);
}
.draw-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--tier) 45%, transparent); box-shadow: var(--shadow); }
.draw-card.joined { border-color: color-mix(in srgb, var(--tier) 60%, transparent); }
.tier-mint { --tier: var(--mint); } .tier-sky { --tier: var(--sky); } .tier-violet { --tier: var(--violet); } .tier-gold { --tier: var(--gold); }
.draw-top { position: relative; display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.tier-badge { display: flex; align-items: center; gap: 10px; }
.tier-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--tier) 18%, transparent); color: var(--tier);
  border: 1px solid color-mix(in srgb, var(--tier) 40%, transparent);
}
.tier-badge h3 { font-size: 19px; }
.tier-badge small { color: var(--text-2); font-size: 12.5px; }
.buyin { position: relative; display: flex; align-items: baseline; gap: 6px; }
.buyin b { font-family: var(--display); font-size: 28px; }
.buyin span { color: var(--text-2); font-size: 13px; }
.paid-line { font-size: 12px; color: var(--text-2); text-align: center; margin: -4px 0 4px; }
.paid-line b { color: var(--ok); }
.prize-ladder { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; width: 100%; max-width: 520px; }
.prize-ladder span { display: grid; justify-items: center; min-width: 52px; padding: 5px 8px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.prize-ladder small { font-size: 10px; color: var(--text-3); font-weight: 700; }
.prize-ladder b { font-size: 13px; font-family: var(--display); }
.prize-ladder span.refund { border-color: rgba(46, 230, 166, 0.35); }
.prize-ladder span.refund b { color: var(--ok); }
.prizes { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.prize { padding: 8px 6px; border-radius: 10px; background: var(--bg-2); text-align: center; border: 1px solid var(--line); }
.prize small { display: block; font-size: 11px; color: var(--text-3); font-weight: 600; }
.prize b { font-size: 14px; }
.prize.first { border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.08); }
.prize.first b { color: var(--gold); }
.seats { position: relative; }
.seats-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.seats-row b { color: var(--text); }
.bar { height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--tier); transition: width 0.4s ease; }
.draw-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.draw-status { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 6px; min-height: 20px; }
.draw-status b { color: var(--text); font-variant-numeric: tabular-nums; }
.draw-card .btn { margin-top: auto; }

/* Upcoming rounds strip */
.upcoming-card { padding: 0; overflow: hidden; }
.round-row { display: grid; grid-template-columns: 170px 1fr; align-items: stretch; gap: 18px; padding: 18px; }
.round-row + .round-row { border-top: 1px solid var(--line); }
.round-time { display: grid; align-content: center; gap: 4px; padding-right: 18px; border-right: 1px solid var(--line); }
.round-clock { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); margin-bottom: 4px; }
.round-time b { font-family: var(--display); font-size: 26px; line-height: 1; }
.round-time small { color: var(--text-3); font-size: 12.5px; }
.round-time small .mono { color: var(--text-2); font-weight: 700; }
.round-tiers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.up-tier {
  display: grid; gap: 10px; padding: 14px; border-radius: var(--radius-sm); min-width: 0;
  background: linear-gradient(160deg, color-mix(in srgb, var(--tier) 10%, var(--surface-2)), var(--surface) 70%);
  border: 1px solid color-mix(in srgb, var(--tier) 28%, var(--line));
}
.up-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.up-head .tier-icon { width: 34px; height: 34px; border-radius: 10px; flex: none; }
.up-head .tier-icon svg { width: 18px; height: 18px; }
.up-head b { display: block; font-family: var(--display); font-size: 16px; line-height: 1.15; }
.up-head small { color: var(--text-2); font-size: 12px; }
.up-cat { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-prize { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.up-prize small { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.up-prize b { font-family: var(--display); font-size: 18px; color: var(--gold); }

/* Winners ticker */
.winners { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.winner { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.winner .meta { min-width: 0; }
.winner .meta b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.winner .meta small { color: var(--text-3); font-size: 12px; }
.winner .won { margin-left: auto; color: var(--gold); font-weight: 800; white-space: nowrap; }

/* How it works */
.steps { counter-reset: s; }
.step { position: relative; padding: 22px; }
.step .num {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 800;
  background: var(--brand-grad); margin-bottom: 14px; font-family: var(--display);
}
.step h3 { font-size: 18px; margin-bottom: 6px; }
.step p { margin: 0; color: var(--text-2); font-size: 14px; }

.cat-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.cat {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); font-weight: 600;
}
.cat .dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 16px; }

/* ==========================================================================
   Auth
   ========================================================================== */
.auth-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 0; max-width: 940px; margin: 10px auto; border-radius: 26px; overflow: hidden; border: 1px solid var(--line-strong); }
.auth-side {
  padding: 40px; background:
    radial-gradient(400px 260px at 100% 0%, rgba(255, 46, 126, 0.4), transparent 70%),
    radial-gradient(400px 260px at 0% 100%, rgba(56, 189, 248, 0.3), transparent 70%), #141b44;
  display: flex; flex-direction: column; justify-content: space-between; gap: 24px;
}
.auth-side h2 { font-size: 34px; }
.auth-side ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.auth-side li { display: flex; gap: 10px; align-items: center; color: var(--text-2); }
.auth-side li svg { color: var(--ok); flex: none; }
.auth-form { padding: 40px; background: var(--surface); display: grid; gap: 16px; align-content: center; }
.auth-form h1 { font-size: 28px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg-2); border-radius: 12px; border: 1px solid var(--line); }
.tabs button, .tabs a { flex: 1; padding: 9px; border-radius: 9px; border: 0; background: none; cursor: pointer; font-weight: 600; color: var(--text-2); text-align: center; font-size: 14px; }
.tabs .active { background: var(--surface-3); color: var(--text); }

/* ==========================================================================
   Game room
   ========================================================================== */
.room { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.room-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.room-head h1 { font-size: 26px; }
.stage { min-height: 460px; padding: 28px; position: relative; overflow: hidden; }
.stage-center { text-align: center; display: grid; justify-items: center; gap: 14px; padding: 20px 0; }
.big-count { font-family: var(--display); font-size: clamp(60px, 10vw, 110px); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.seat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; width: 100%; margin-top: 10px; }
.seat {
  height: 52px; border-radius: 12px; border: 1px dashed var(--line-strong); display: flex; align-items: center; gap: 8px;
  padding: 0 10px; font-size: 13px; color: var(--text-3); overflow: hidden;
}
.seat.taken { border-style: solid; background: var(--surface-2); color: var(--text); animation: pop 0.3s ease; }
.seat.me { border-color: var(--brand); background: rgba(255, 107, 44, 0.12); }
.seat .avatar { width: 28px; height: 28px; font-size: 11px; cursor: default; }
.seat span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes pop { from { transform: scale(0.9); opacity: 0; } }

.q-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.q-progress { display: flex; gap: 5px; }
.q-progress i { width: 22px; height: 6px; border-radius: 99px; background: var(--surface-3); }
.q-progress i.done { background: var(--text-3); }
.q-progress i.now { background: var(--brand); }
.timer { position: relative; width: 64px; height: 64px; flex: none; }
.timer svg { transform: rotate(-90deg); }
.timer .t-bg { stroke: var(--surface-3); }
.timer .t-fg { stroke: var(--ok); transition: stroke 0.3s; stroke-linecap: round; }
.timer.low .t-fg { stroke: var(--bad); }
.timer b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 22px; font-variant-numeric: tabular-nums; }
.q-text { font-family: var(--display); font-size: clamp(22px, 3vw, 32px); font-weight: 700; margin: 6px 0 26px; min-height: 2.4em; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opt {
  --c: var(--opt-a);
  position: relative; display: flex; align-items: center; gap: 14px; text-align: left; cursor: pointer;
  padding: 18px; min-height: 78px; border-radius: 16px; font-size: 16px; font-weight: 600;
  background: color-mix(in srgb, var(--c) 14%, var(--surface-2)); border: 2px solid color-mix(in srgb, var(--c) 40%, transparent);
  transition: transform 0.12s, background 0.15s, opacity 0.2s, border-color 0.15s;
}
.opt:nth-child(2) { --c: var(--opt-b); } .opt:nth-child(3) { --c: var(--opt-c); } .opt:nth-child(4) { --c: var(--opt-d); }
.opt:hover:not(:disabled) { transform: translateY(-2px); background: color-mix(in srgb, var(--c) 26%, var(--surface-2)); }
.opt .key {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: var(--c); color: #fff; font-weight: 800; font-family: var(--display);
}
.opt:disabled { cursor: default; }
.opt.picked { border-color: #fff; background: color-mix(in srgb, var(--c) 32%, var(--surface-2)); }
.opt.faded { opacity: 0.35; }
.opt.correct { border-color: var(--ok); background: rgba(46, 230, 166, 0.2); opacity: 1; }
.opt.wrong { border-color: var(--bad); background: rgba(255, 84, 112, 0.18); opacity: 1; }
.opt .count { margin-left: auto; font-size: 13px; color: var(--text-2); font-weight: 700; }
.q-foot { margin-top: 18px; min-height: 28px; display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--text-2); font-size: 14px; }
.points-pop {
  font-family: var(--display); font-weight: 800; font-size: 20px; color: var(--ok); animation: rise 0.6s ease;
}
.points-pop.zero { color: var(--bad); }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }

.side-board { padding: 0; overflow: hidden; position: sticky; top: 86px; }
.side-board h3 { font-size: 15px; padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }
.board-list { max-height: 520px; overflow: auto; }
.board-row { display: grid; grid-template-columns: 26px 28px 1fr auto; align-items: center; gap: 10px; padding: 9px 18px; font-size: 14px; }
.board-row.me { background: rgba(255, 107, 44, 0.12); }
.board-row .rk { color: var(--text-3); font-weight: 700; font-variant-numeric: tabular-nums; }
.board-row .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-row .sc { font-weight: 700; font-variant-numeric: tabular-nums; }
.board-row .avatar { width: 28px; height: 28px; font-size: 11px; cursor: default; }
.board-row .pz { display: block; font-size: 11px; color: var(--gold); font-weight: 700; }
.board-row.cash .rk { color: var(--gold); }
.cash-line { position: relative; margin: 2px 18px; border-top: 1px dashed rgba(251, 191, 36, 0.45); height: 0; }
.cash-line span { position: absolute; right: 0; top: -9px; padding: 0 6px; background: var(--surface); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.game-hud, .board-sheet { display: none; }
.board-row .delta { font-size: 11px; color: var(--ok); font-weight: 700; display: block; text-align: right; }

/* Podium */
.podium { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; align-items: end; max-width: 560px; margin: 10px auto 0; }
.pod { text-align: center; display: grid; justify-items: center; gap: 8px; }
.pod .avatar { width: 56px; height: 56px; font-size: 20px; cursor: default; }
.pod .block { width: 100%; border-radius: 14px 14px 6px 6px; display: grid; place-items: center; font-family: var(--display); font-size: 30px; font-weight: 800; }
.pod.p1 .block { height: 130px; background: linear-gradient(180deg, rgba(251, 191, 36, 0.4), rgba(251, 191, 36, 0.08)); color: var(--gold); }
.pod.p2 .block { height: 96px; background: linear-gradient(180deg, rgba(203, 213, 225, 0.3), rgba(203, 213, 225, 0.06)); color: #cbd5e1; }
.pod.p3 .block { height: 74px; background: linear-gradient(180deg, rgba(234, 140, 85, 0.35), rgba(234, 140, 85, 0.06)); color: #f0a374; }
.pod b { font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod small { color: var(--gold); font-weight: 700; }
.result-banner { text-align: center; margin: 22px 0 6px; }
.result-banner h2 { font-size: 30px; }

/* ==========================================================================
   Wallet / packages
   ========================================================================== */
.packages { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.pkg {
  position: relative; display: grid; gap: 4px; justify-items: center; text-align: center; cursor: pointer;
  padding: 22px 12px 18px; border-radius: 18px; background: var(--surface); border: 2px solid var(--line); transition: all 0.15s;
}
.pkg { transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 0.18s ease-out, border-color 0.15s, background 0.15s, box-shadow 0.2s; overflow: hidden; }
.pkg::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.2s;
  background: radial-gradient(240px circle at var(--mx, 50%) 0%, rgba(255, 255, 255, 0.09), transparent 60%); }
.pkg:hover { border-color: var(--line-strong); }
.pkg:hover::after { opacity: 1; }
.pkg:active { transform: perspective(700px) scale(0.97); }
.pkg.selected { box-shadow: 0 12px 30px rgba(255, 107, 44, 0.18); }
.pkg.just-picked .coin-stack { animation: coinHop 0.55s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes coinHop { 30% { transform: translateY(-10px) rotate(-6deg); } 60% { transform: translateY(2px); } }
.pkg-rate { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.pkg.selected { border-color: var(--brand); background: linear-gradient(180deg, rgba(255, 107, 44, 0.14), var(--surface)); }
.pkg .coin-stack { width: 46px; height: 46px; margin-bottom: 6px; }
.pkg .pts { font-family: var(--display); font-size: 26px; font-weight: 800; }
.pkg .bonus { font-size: 12px; font-weight: 700; color: var(--ok); min-height: 18px; }
.pkg .price { margin-top: 8px; font-weight: 800; font-size: 17px; padding: 6px 14px; border-radius: 99px; background: var(--surface-3); }
.pkg .ribbon {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%); padding: 3px 10px; border-radius: 99px;
  background: var(--brand-grad); font-size: 11px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap;
}
.checkout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; margin-top: 22px; }
.summary-hero { display: grid; justify-items: center; padding: 6px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.summary-hero small { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); font-weight: 700; }
.summary-hero b { font-family: var(--display); font-size: 40px; font-weight: 800; line-height: 1.1; }
.summary-hero span { font-size: 13px; color: var(--text-2); }
.summary-line { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.summary-line.total { border: 0; font-size: 18px; font-weight: 800; }
.secure-note { display: flex; gap: 10px; align-items: start; font-size: 13px; color: var(--text-2); margin-top: 14px; }
.secure-note svg { flex: none; color: var(--ok); margin-top: 2px; }
.phone-row { display: grid; grid-template-columns: 110px 1fr; gap: 8px; }

/* Daily bonus wheel */
.daily-wheel { display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: center; }
.wheel-wrap { position: relative; width: 280px; height: 280px; border-radius: 50%; }
.wheel-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; cursor: pointer; display: block; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.4); }
.wheel-glow { position: absolute; inset: -8%; border-radius: 50%; pointer-events: none; opacity: 0.45; filter: blur(14px); transition: opacity 0.5s;
  background: radial-gradient(circle, rgba(255, 190, 80, 0.55), rgba(255, 46, 126, 0.25) 50%, transparent 70%); }
.wheel-wrap.has-offer .wheel-glow { opacity: 0.7; }
.wheel-wrap.won .wheel-glow { opacity: 1; animation: wheelPulse 1.4s ease-in-out 4; }
@keyframes wheelPulse { 50% { opacity: 0.45; transform: scale(0.96); } }
.wheel-lights { position: absolute; inset: 0; pointer-events: none; }
.wheel-lights i { position: absolute; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #fff6d0; box-shadow: 0 0 5px 1px rgba(255, 225, 140, 0.9); opacity: 0.9; }
.wheel-lights i:nth-child(even) { opacity: 0.45; }
.wheel-wrap.spinning .wheel-lights i { animation: lightChase 0.3s steps(1) infinite; }
.wheel-wrap.spinning .wheel-lights i:nth-child(even) { animation-delay: 0.15s; }
@keyframes lightChase { 0% { opacity: 1; } 50% { opacity: 0.35; } }
.wheel-gloss { position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse 60% 45% at 50% 18%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.05) 60%, transparent 100%); }
.wheel-hub { position: absolute; left: 50%; top: 50%; width: 24%; height: 24%; transform: translate(-50%, -50%); border-radius: 50%; z-index: 2; cursor: pointer; border: 0;
  background: radial-gradient(circle at 35% 30%, #2f3a66, #0b1026 70%); color: #f5e2a6; font-family: var(--display); font-weight: 800; font-size: 15px; letter-spacing: 0.08em;
  box-shadow: 0 0 0 3px #d9a640, 0 0 0 4px #5c3d08, 0 8px 18px rgba(0, 0, 0, 0.55), inset 0 2px 4px rgba(255, 255, 255, 0.12); transition: transform 0.1s; }
.wheel-hub:active { transform: translate(-50%, -50%) scale(0.95); }
.wheel-wrap.spinning .wheel-hub { pointer-events: none; }
.wheel-pointer { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); z-index: 3; filter: drop-shadow(0 5px 6px rgba(0, 0, 0, 0.55)); transform-origin: 50% 20%; }
.wheel-pointer svg { display: block; }
.wheel-wrap.spinning .wheel-pointer { animation: pointerTick 0.14s ease-in-out infinite alternate; }
@keyframes pointerTick { from { transform: translateX(-50%) rotate(-7deg); } to { transform: translateX(-50%) rotate(6deg); } }
.tag-hot { background: var(--brand-grad); color: #fff; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 99px; letter-spacing: 0.04em; }
.offer-box { border: 1px solid rgba(46, 230, 166, 0.25); background: rgba(46, 230, 166, 0.07); border-radius: var(--radius-sm); padding: 16px 18px; display: grid; gap: 4px; }
.offer-box.active { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok) inset; }
.offer-box.used { border-color: var(--line-strong); background: var(--surface-2); }
.offer-pct { font-family: var(--display); font-size: 30px; font-weight: 800; background: linear-gradient(135deg, #2ee6a6, #38bdf8); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.offer-main { font-size: 17px; }
.offer-main .mono { font-weight: 800; font-size: 20px; }

/* Custom amount: toggle + slider */
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; cursor: pointer; }
.switch { position: relative; flex: none; width: 52px; height: 30px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-track { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line-strong); transition: background 0.15s; pointer-events: none; }
.switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch input:checked + .switch-track { background: var(--brand); border-color: var(--brand); }
.switch input:checked + .switch-track::after { transform: translateX(22px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--sky); outline-offset: 2px; }
.custom-body { margin-top: 22px; }
.custom-amount { display: flex; justify-content: center; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.custom-amount .mono { font-family: var(--display); font-size: 40px; font-weight: 800; }
.custom-bonus { font-weight: 800; color: var(--ok); background: rgba(46, 230, 166, 0.1); border-radius: 99px; padding: 4px 12px; font-size: 14px; }
.custom-bonus.none { color: var(--text-3); background: var(--surface-2); }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 99px; outline: none; cursor: pointer;
  background: linear-gradient(90deg, var(--brand) 0, var(--brand-2) var(--fill, 0%), var(--surface-3) var(--fill, 0%)); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 4px solid var(--brand); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); }
.range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 4px solid var(--brand); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); }
.range:focus-visible { outline: 2px solid var(--sky); outline-offset: 6px; }
.range-wrap { position: relative; padding-top: 34px; padding-bottom: 30px; }
.range-bubble { position: absolute; top: 0; transform: translateX(-50%); padding: 3px 9px; border-radius: 8px; background: var(--surface-3); border: 1px solid var(--line-strong);
  font-family: var(--display); font-weight: 800; font-size: 13px; white-space: nowrap; pointer-events: none; }
.range-bubble::after { content: ''; position: absolute; left: 50%; bottom: -5px; width: 8px; height: 8px; transform: translateX(-50%) rotate(45deg); background: var(--surface-3); border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.range-steps { position: absolute; left: 13px; right: 13px; bottom: 0; height: 26px; pointer-events: none; }
.range-steps span { position: absolute; transform: translateX(-50%); display: grid; justify-items: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--text-3); transition: color 0.2s; }
.range-steps i { width: 2px; height: 7px; border-radius: 2px; background: var(--line-strong); transition: background 0.2s; }
.range-steps span.reached { color: var(--ok); }
.range-steps span.reached i { background: var(--ok); }
.custom-bonus.pop { animation: badgePop 0.4s cubic-bezier(0.3, 1.7, 0.5, 1); }
@keyframes badgePop { 40% { transform: scale(1.18); } }
.range-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); margin-top: 8px; }

/* Tables */
.table-wrap { overflow-x: auto; min-width: 0; max-width: 100%; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.pos { color: var(--ok); font-weight: 700; }
.neg { color: var(--text-2); }
.state { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--surface-3); }
.state.COMPLETED, .state.finished { background: rgba(46, 230, 166, 0.14); color: var(--ok); }
.state.DECLINED, .state.ERROR, .state.CANCELLED, .state.cancelled { background: rgba(255, 84, 112, 0.14); color: #ff8aa0; }
.state.PENDING, .state.CHECKOUT, .state.CREATED, .state.running, .state.open, .state.starting { background: rgba(251, 191, 36, 0.14); color: var(--warn); }

.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-tile { padding: 18px; }
.stat-tile span { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.stat-tile b { display: block; font-family: var(--display); font-size: 28px; margin-top: 4px; }

/* Payment return */
.status-card { max-width: 520px; margin: 30px auto; text-align: center; padding: 40px 30px; display: grid; gap: 14px; justify-items: center; }
.status-icon { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; }
.status-icon.ok { background: rgba(46, 230, 166, 0.15); color: var(--ok); }
.status-icon.bad { background: rgba(255, 84, 112, 0.15); color: var(--bad); }
.status-icon.wait { background: rgba(251, 191, 36, 0.12); color: var(--warn); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(251, 191, 36, 0.25); border-top-color: var(--warn); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Toasts & modal */
/* "You're in a game" return bar */
.game-bar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 16px;
  background: rgba(20, 27, 56, 0.96); border: 1px solid rgba(46, 230, 166, 0.45); border-radius: 16px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5); backdrop-filter: blur(12px); animation: rise 0.25s ease; max-width: calc(100vw - 24px); }
.game-bar.hidden { display: none; }
.game-bar-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(46, 230, 166, 0.6); animation: livePulse 1.6s ease-out infinite; flex: none; }
@keyframes livePulse { to { box-shadow: 0 0 0 10px rgba(46, 230, 166, 0); } }
.game-bar-text { display: grid; line-height: 1.25; font-size: 13px; color: var(--text-2); min-width: 0; }
.game-bar-text b { color: var(--text); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-bar .btn { flex: none; }

.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 10px; max-width: min(380px, calc(100vw - 36px)); }
.toast {
  padding: 13px 16px; border-radius: 14px; background: var(--surface-3); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  font-size: 14px; display: flex; gap: 10px; align-items: start; animation: rise 0.25s ease;
}
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity 0.25s, transform 0.25s; }
.toast.ok { border-color: rgba(46, 230, 166, 0.4); }
.toast.bad { border-color: rgba(255, 84, 112, 0.5); }
.modal-back { position: fixed; inset: 0; background: rgba(5, 8, 20, 0.7); backdrop-filter: blur(4px); z-index: 90; display: grid; place-items: center; padding: 20px; }
.modal { max-width: 420px; width: 100%; padding: 28px; text-align: center; display: grid; gap: 14px; }
.modal h3 { font-size: 22px; }
.modal .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.empty { text-align: center; padding: 40px 20px; color: var(--text-2); }
.empty svg { margin: 0 auto 10px; color: var(--text-3); }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 36px 0 30px; color: var(--text-2); font-size: 14px; background: rgba(10, 14, 31, 0.6); }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(4, 1fr); gap: 28px; }
.footer h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text); margin-bottom: 12px; font-family: var(--font); }
.footer a { display: block; padding: 3px 0; }
.footer a:hover { color: var(--text); }
.footer a.logo { display: flex; color: var(--text); }
.footer .legal { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; }
.footer .credit { font-size: 11px; color: var(--text-3); width: 100%; }
.footer .legal-note { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.footer .age-badge { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--bad); color: var(--bad); font-size: 11px; font-weight: 800; }

/* Confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 95; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  .grid-4, .winners { grid-template-columns: repeat(2, 1fr); }
  .packages { grid-template-columns: repeat(3, 1fr); }
  .room { grid-template-columns: 1fr; }
  .side-board { position: static; }
}
@media (max-width: 820px) {
  .daily-wheel { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .daily-wheel .wheel-side > div:first-child { justify-content: center; }
  .nav { display: none; }
  .nav.open {
    display: grid; position: absolute; top: 66px; left: 0; right: 0; padding: 10px 16px 16px; margin: 0;
    background: var(--bg-2); border-bottom: 1px solid var(--line);
  }
  .burger { display: block; }
  .hero { grid-template-columns: 1fr; padding: 24px; }
  .grid-3, .grid-2, .checkout, .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .stat-tiles { grid-template-columns: repeat(2, 1fr); }
  .round-row { grid-template-columns: 1fr; gap: 14px; padding: 14px; }
  .round-time { border-right: 0; padding-right: 0; grid-template-columns: auto auto 1fr; align-items: center; column-gap: 10px; }
  .round-clock { margin: 0; }
  .round-time small { justify-self: end; }
  .round-tiers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .up-cat { white-space: normal; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-brand { grid-column: 1 / -1; }
  .seat-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 560px) {
  .wheel-wrap { width: 240px; height: 240px; }
  .container { padding: 0 16px; }
  .grid-4, .winners, .options { grid-template-columns: 1fr; }
  .packages { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .stage { padding: 18px; }
  .auth-form { padding: 26px 20px; }
  .seat-grid { grid-template-columns: repeat(2, 1fr); }
  .balance-pill { padding-right: 10px; font-size: 14px; }
  .top-right .btn-buy span, .hide-sm { display: none; }
  .topbar .container { gap: 10px; }
  .top-right { gap: 8px; }
  .top-right .btn-sm { padding: 7px 10px; }
  .opt { min-height: 62px; padding: 14px; }
}

/* ==========================================================================
   Mobile app shell (PWA): bottom tab bar, safe areas, touch tuning
   ========================================================================== */
html { -webkit-tap-highlight-color: transparent; }
a, button, .opt, .pkg, .seat, input[type="range"] { touch-action: manipulation; }
.tabbar { display: none; }
.install-bar.hidden { display: none; }

@media (hover: none) {
  .pkg:hover, .opt:hover:not(:disabled) { transform: none; }
}

@media (max-width: 820px) {
  /* Top bar: logo + balance + avatar; navigation lives in the tab bar */
  .topbar { padding-top: env(safe-area-inset-top); }
  .topbar .container { height: 58px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .burger, .nav, .nav.open { display: none; }
  .top-right .btn-buy { display: none; }
  .top-right .btn { white-space: nowrap; }
  .logo { font-size: 19px; }
  .logo-mark { width: 30px; height: 30px; }

  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  main { padding: 18px 0 32px; min-height: 0; }

  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    padding: 6px max(6px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-right));
    background: rgba(10, 14, 31, 0.94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
  }
  .tabbar a {
    display: grid; justify-items: center; gap: 3px; padding: 4px 0 2px; border-radius: 12px;
    font-size: 11px; font-weight: 600; color: var(--text-3); transition: color 0.15s;
  }
  .tabbar a.active { color: var(--text); }
  .tabbar a.active svg { color: var(--brand); }
  .tabbar a:active { transform: scale(0.94); }
  .tab-buy-icon {
    width: 46px; height: 46px; margin-top: -22px; border-radius: 50%; display: grid; place-items: center; color: #fff;
    background: var(--brand-grad); box-shadow: 0 8px 20px rgba(255, 46, 126, 0.4); border: 3px solid var(--bg);
  }
  .tabbar a.tab-buy.active svg { color: #fff; }

  .install-bar {
    position: fixed; left: 12px; right: 12px; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 46;
    display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px;
    background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: var(--shadow);
    animation: rise 0.25s ease;
  }
  .install-bar img { border-radius: 10px; flex: none; }
  .install-text { display: grid; gap: 2px; font-size: 13px; color: var(--text-2); min-width: 0; }
  .install-text > b { color: var(--text); font-size: 14px; }
  .install-close { background: none; border: 0; color: var(--text-3); font-size: 16px; padding: 6px; cursor: pointer; flex: none; }

  /* Phones: messages appear just under the top bar, one at a time, and stay in view while scrolling */
  .toasts { position: fixed; left: 12px; right: 12px; top: calc(66px + env(safe-area-inset-top)); bottom: auto; max-width: none; z-index: 120; }
  .toast { animation: dropIn 0.22s ease; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45); }

  /* Question header: dots shrink so the timer ring always fits inside the card */
  .q-top > div:first-child { min-width: 0; flex: 1; }
  .q-progress { gap: 4px; }
  .q-progress i { width: auto; flex: 1 1 0; min-width: 8px; max-width: 22px; }
  .timer { width: 56px; height: 56px; }
  .timer svg { width: 56px; height: 56px; }

  /* Game mode: while a game runs the page becomes a single screen with a fixed HUD */
  .in-game .tabbar, .in-game .footer, .in-game .side-board, .in-game #gameBar, .in-game #installBar { display: none !important; }
  .in-game { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .in-game main { padding-top: 10px; }
  .in-game .room-head { margin-bottom: 8px; gap: 6px; }
  .in-game .room-head .chip:not(.open) { display: none; }
  .in-game .room-head h1 { font-size: 18px; }
  .in-game .room-head .tier-icon { width: 34px; height: 34px; }
  .game-hud { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 70; display: grid; grid-template-columns: 1fr 1fr 1.25fr auto; align-items: stretch; gap: 6px; padding: 6px;
    background: rgba(16, 22, 48, 0.97); border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55); backdrop-filter: blur(12px); }
  .game-hud.hidden { display: none; }
  .hud-cell { display: grid; align-content: center; padding: 6px 8px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
  .hud-cell small { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); font-weight: 700; white-space: nowrap; }
  .hud-cell b { font-family: var(--display); font-size: 19px; line-height: 1.1; white-space: nowrap; }
  .hud-cell b span { font-size: 12px; color: var(--text-3); font-family: var(--font); }
  .hud-name { overflow: hidden; text-overflow: ellipsis; font-size: 15px !important; }
  .hud-rank.up { animation: hudUp 0.7s ease; }
  .hud-rank.down { animation: hudDown 0.7s ease; }
  @keyframes hudUp { 30% { background: rgba(46, 230, 166, 0.25); transform: translateY(-3px); } }
  @keyframes hudDown { 30% { background: rgba(255, 84, 112, 0.22); transform: translateY(3px); } }
  .hud-prize.in { background: linear-gradient(140deg, rgba(251, 191, 36, 0.22), rgba(255, 107, 44, 0.16)); border: 1px solid rgba(251, 191, 36, 0.45); }
  .hud-prize.in b { color: var(--gold); }
  .hud-table { display: grid; justify-items: center; align-content: center; gap: 2px; padding: 6px 12px; border-radius: 12px; border: 0; cursor: pointer;
    background: var(--brand-grad); color: #fff; font-weight: 800; font-size: 11px; }
  .hud-table svg { width: 18px; height: 18px; }
  .board-sheet { position: fixed; inset: 0; z-index: 95; display: flex; align-items: flex-end; background: rgba(5, 8, 20, 0.6); backdrop-filter: blur(3px); animation: fadeIn 0.15s ease; }
  .board-sheet.hidden { display: none; }
  .sheet-panel { width: 100%; max-height: 82vh; display: flex; flex-direction: column; gap: 10px; padding: 14px 12px calc(14px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--line-strong); border-radius: 22px 22px 0 0; animation: sheetUp 0.22s cubic-bezier(0.2, 0.8, 0.3, 1); }
  .sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 6px; }
  .sheet-head b { font-family: var(--display); font-size: 17px; }
  .sheet-x { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2); cursor: pointer; }
  .sheet-list { overflow: auto; margin: 0 -12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .sheet-list .board-row { padding: 9px 16px; }
  @keyframes sheetUp { from { transform: translateY(100%); } }
  @keyframes fadeIn { from { opacity: 0; } }
  @keyframes dropIn { from { opacity: 0; transform: translateY(-8px); } }
  .music-menu { position: fixed; top: calc(62px + env(safe-area-inset-top)); left: 12px; right: 12px; width: auto; }
  .game-bar { left: 12px; right: 12px; transform: none; bottom: calc(74px + env(safe-area-inset-bottom)); max-width: none; }
  .game-bar:not(.hidden) ~ .install-bar { bottom: calc(146px + env(safe-area-inset-bottom)); }
  .modal-back { align-items: end; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
  .modal { border-radius: 22px; }

  /* iOS zooms into inputs under 16px */
  .input, select, textarea { font-size: 16px; }

  /* Game room: everything on one screen without endless scrolling */
  .room-head { gap: 8px; margin-bottom: 12px; }
  .room-head h1 { font-size: 21px; }
  .stage { min-height: 0; padding: 18px 14px; }
  .seat-grid { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .seat {
    height: auto; min-height: 58px; flex-direction: column; justify-content: center; gap: 4px;
    padding: 7px 2px; font-size: 10px; text-align: center;
  }
  .seat span { max-width: 100%; }
  .seat .avatar { width: 26px; height: 26px; font-size: 10px; }
  .opt { min-height: 60px; }
  .table th, .table td { padding: 10px 8px; font-size: 13px; }
  .table .col-opt { display: none; }
  .profile-card { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 22px 16px; gap: 16px; }
  .profile-meta { justify-items: center; }
  .profile-meta .btn { justify-self: center !important; }
  .avatar-picker { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .avatar-option { padding: 10px 4px 8px; gap: 6px; border-radius: 14px; }
  .avatar-option-img { width: 54px; height: 54px; }
  .avatar-option-name { font-size: 11px; }
  .table td:first-child { white-space: normal; min-width: 64px; }
  .table .btn-sm { padding: 6px 9px; }
  .table th:last-child, .table td:last-child { padding-right: 4px; }
  .section-head { flex-wrap: wrap; }
  .section-head .tabs { width: 100%; min-width: 0 !important; }
  .btn { white-space: normal; text-align: center; }
  .btn-lg { padding: 14px 20px; }

  /* The tab bar covers Play/Account links, keep the footer short */
  .footer { padding: 26px 0 20px; }
  .footer-grid > div:nth-child(2), .footer-grid > div:nth-child(3) { display: none; }
}

@media (max-width: 380px) {
  .seat-grid { grid-template-columns: repeat(4, 1fr); }
  .tabbar a { font-size: 10px; }
}

