/* RainSpin prototype stylesheet
   Tokens first, then layout shell, then components, then pages. */
@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #0D1626;
  --surface: #15223A;
  --raised: #1C2B47;
  --line: #26375A;
  --text: #DCE6F5;
  --muted: #8193B2;
  --rain: #4FB3FF;
  --rain-deep: #1E7FD6;
  --bolt: #FFD24A;
  --win: #3DDC97;
  --loss: #FF6B7A;
  --hdr: 60px;
  --side: 232px;
  --side-min: 72px;
  --chat: 340px;
  --bnav: 64px;
  --r-panel: 16px;
  --r-card: 10px;
  --r-input: 8px;
  --display: 'Chakra Petch', 'Segoe UI', sans-serif;
  --body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--body); min-height: 100vh; }
body.lock { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
img, svg, canvas { display: block; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; margin: 0; font-weight: 700; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--rain); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.num { font-family: var(--display); font-variant-numeric: tabular-nums; }
.win { color: var(--win); }
.loss { color: var(--loss); }
.hide-sm { display: none; }
@media (min-width: 640px) { .hide-sm { display: revert; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- Header ---------- */
.hdr { position: sticky; top: 0; z-index: 40; height: var(--hdr); display: flex; align-items: center; gap: 8px; padding: 0 12px; background: rgba(13, 22, 38, .94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.hdr__burger { display: none; width: 38px; height: 38px; border-radius: 10px; place-items: center; color: var(--muted); }
.hdr__burger:hover { color: var(--text); background: var(--raised); }
.logo { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: .01em; flex-shrink: 0; }
.logo__word { display: none; }
@media (min-width: 420px) { .logo__word { display: inline; } }
.hdr__mid { flex: 1; display: flex; justify-content: center; min-width: 0; }
.hdr__end { display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); position: relative; }
.icon-btn:hover { color: var(--text); background: var(--raised); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; background: var(--bolt); border-radius: 50%; }
.icon-btn--desk { display: none; }
@media (min-width: 1024px) { .icon-btn--desk { display: grid; } .hdr__burger { display: grid; } }

.bal { display: flex; align-items: stretch; background: var(--raised); border: 1px solid var(--line); border-radius: 10px; height: 40px; position: relative; max-width: 100%; }
.bal__pick { display: flex; align-items: center; gap: 7px; padding: 0 10px; min-width: 0; }
.bal__amt { font-family: var(--display); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bal__wallet { background: var(--rain); color: #06223D; font-weight: 800; padding: 0 12px; border-radius: 0 9px 9px 0; display: flex; align-items: center; gap: 6px; }
.bal__wallet:hover { background: #74C4FF; }
.bal__wallet span { display: none; }
@media (min-width: 480px) { .bal__wallet span { display: inline; } }

.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(140deg, var(--rain), var(--rain-deep)); color: #06223D; font-weight: 800; display: grid; place-items: center; font-family: var(--display); }

/* Dropdowns */
.dd { position: absolute; top: calc(100% + 8px); right: 0; min-width: 240px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: 0 18px 40px rgba(0, 0, 0, .45); z-index: 50; display: none; }
.dd.open { display: block; }
.dd--left { left: 0; right: auto; }
.dd__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; text-align: left; }
.dd__item:hover, .dd__item[aria-selected="true"] { background: var(--raised); }
.dd__item .grow { flex: 1; }
.dd__sep { height: 1px; background: var(--line); margin: 6px 4px; }
.dd__head { padding: 8px 10px 4px; color: var(--muted); font-size: 13px; }
.rel { position: relative; }

/* ---------- Sidebar ---------- */
.side { position: fixed; top: var(--hdr); bottom: 0; left: 0; width: min(86vw, 290px); background: var(--surface); border-right: 1px solid var(--line); transform: translateX(-100%); transition: transform .25s ease; z-index: 45; overflow-y: auto; padding: 12px 10px 90px; }
.side.open { transform: none; }
.scrim { position: fixed; inset: var(--hdr) 0 0 0; background: rgba(4, 8, 16, .6); z-index: 44; opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.side__switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.side__switch a { text-align: center; padding: 10px 0; border-radius: 10px; background: var(--raised); font-weight: 700; }
.side__switch a.on { background: var(--rain); color: #06223D; }
.side__group { padding: 6px 0; border-top: 1px solid var(--line); }
.side__group:first-of-type { border-top: 0; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 9px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.nav-link:hover { color: var(--text); background: var(--raised); }
.nav-link.on { color: var(--text); background: var(--raised); box-shadow: inset 3px 0 0 var(--rain); }
.nav-link--sub { padding-left: 42px; font-weight: 500; font-size: 14px; }
.nav-link svg { flex-shrink: 0; }

@media (min-width: 1024px) {
  .side { transform: none; width: var(--side); padding-bottom: 20px; }
  .scrim { display: none; }
  body.side-min .side { width: var(--side-min); padding-inline: 8px; }
  body.side-min .side .nav-link span, body.side-min .side .nav-link--sub, body.side-min .side__switch, body.side-min .side .lang { display: none; }
  body.side-min .side .nav-link { justify-content: center; padding: 10px 0; }
}

/* ---------- Shell ---------- */
.shell { min-height: calc(100vh - var(--hdr)); padding-bottom: calc(var(--bnav) + 24px); transition: margin .25s ease; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 16px 14px 0; }
@media (min-width: 640px) { .wrap { padding: 22px 22px 0; } }
@media (min-width: 1024px) {
  .shell { margin-left: var(--side); padding-bottom: 0; }
  body.side-min .shell { margin-left: var(--side-min); }
}
@media (min-width: 1280px) { body.chat-open .shell { margin-right: var(--chat); } }

/* ---------- Bottom nav (mobile) ---------- */
.bnav { position: fixed; left: 0; right: 0; bottom: 0; height: var(--bnav); background: var(--surface); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); z-index: 42; padding-bottom: env(safe-area-inset-bottom); }
.bnav a, .bnav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--muted); }
.bnav .on { color: var(--rain); }
@media (min-width: 1024px) { .bnav { display: none; } }

/* ---------- Buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 10px; font-weight: 800; background: var(--raised); border: 1px solid var(--line); white-space: nowrap; transition: background .15s, transform .1s; }
.btn:hover { background: #24375A; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--rain); border-color: var(--rain); color: #06223D; }
.btn--primary:hover { background: #74C4FF; }
.btn--bolt { background: var(--bolt); border-color: var(--bolt); color: #2A1E00; }
.btn--bolt:hover { background: #FFE07A; }
.btn--ghost { background: transparent; }
.btn--sm { height: 34px; padding: 0 12px; font-size: 14px; border-radius: 8px; }
.btn--block { width: 100%; }
.link { color: var(--rain); font-weight: 700; }
.link:hover { text-decoration: underline; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label, .field .lbl { font-size: 13px; font-weight: 700; color: var(--muted); }
.input, .select, .textarea { width: 100%; height: 44px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-input); padding: 0 12px; outline: none; }
.textarea { height: auto; min-height: 110px; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--rain); }
.input.bad { border-color: var(--loss); }
.input-wrap { position: relative; display: flex; }
.input-wrap .input { padding-right: 76px; }
.input-wrap .in-btn { position: absolute; right: 6px; top: 6px; height: 32px; padding: 0 10px; border-radius: 6px; background: var(--raised); font-weight: 700; font-size: 13px; }
.err { color: var(--loss); font-size: 13px; font-weight: 600; min-height: 1em; }
.hint { color: var(--muted); font-size: 13px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.check input { margin-top: 3px; accent-color: var(--rain); width: 16px; height: 16px; }

.seg { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button, .seg a { flex: 1; padding: 8px 12px; border-radius: 8px; font-weight: 700; font-size: 14px; color: var(--muted); white-space: nowrap; text-align: center; }
.seg .on { background: var(--raised); color: var(--text); }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: 14px; color: var(--muted); white-space: nowrap; }
.chip:hover { color: var(--text); }
.chip.on { background: var(--rain); border-color: var(--rain); color: #06223D; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--raised); color: var(--muted); }
.badge--live { background: rgba(255, 107, 122, .15); color: var(--loss); }
.badge--live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; }
.badge--ok { background: rgba(61, 220, 151, .14); color: var(--win); }
.badge--wait { background: rgba(255, 210, 74, .14); color: var(--bolt); }
@keyframes pulse { 50% { opacity: .3; } }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 18px; }
.panel + .panel { margin-top: 14px; }
.panel h2 { font-size: 20px; margin-bottom: 12px; }
.page-title { font-size: 26px; margin-bottom: 4px; }
.page-sub { color: var(--muted); margin-bottom: 18px; max-width: 64ch; }
.section { margin-top: 28px; }
.section__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.section__head h2 { font-size: 19px; display: flex; align-items: center; gap: 8px; }
.section__head .spacer { flex: 1; }
.rail-arrows { display: none; gap: 6px; }
@media (min-width: 1024px) { .rail-arrows { display: flex; } }
.rail-arrows button { width: 32px; height: 32px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 700; color: var(--muted); padding: 10px 12px; background: var(--surface); white-space: nowrap; font-size: 13px; }
.table td { padding: 11px 12px; border-top: 1px solid var(--line); white-space: nowrap; }
.table .r { text-align: right; }
.table tbody tr:nth-child(even) td { background: rgba(21, 34, 58, .45); }
.table tr.flash td { animation: rowIn .6s ease; }
@keyframes rowIn { from { background: rgba(79, 179, 255, .18); } }

.empty { text-align: center; padding: 38px 16px; color: var(--muted); }
.empty svg { margin: 0 auto 10px; color: var(--line); }
.empty p { margin-bottom: 14px; }

/* ---------- Game cards ---------- */
.gcard { position: relative; display: block; aspect-ratio: 3 / 4; border-radius: var(--r-card); overflow: hidden; background: linear-gradient(160deg, hsl(var(--h1) 70% 42%), hsl(var(--h2) 75% 18%)); isolation: isolate; transition: transform .15s; }
.gcard:hover { transform: translateY(-3px); }
.gcard::after { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, .18), transparent 60%); z-index: -1; }
.gcard__emb { position: absolute; top: 18%; left: 50%; transform: translateX(-50%); width: 46%; color: rgba(255, 255, 255, .9); }
.gcard__name { position: absolute; left: 8px; right: 8px; bottom: 26px; font-family: var(--display); font-weight: 700; font-size: 15px; line-height: 1.1; text-align: center; text-shadow: 0 2px 10px rgba(0, 0, 0, .5); }
.gcard__prov { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: 11px; font-weight: 700; color: rgba(255, 255, 255, .7); }
.gcard__tag { position: absolute; top: 7px; left: 7px; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: rgba(6, 34, 61, .75); color: var(--rain); }
.gcard__tag--hot { color: var(--bolt); }
.gcard__players { position: absolute; top: 7px; right: 7px; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: rgba(0, 0, 0, .45); color: var(--win); }

.rail { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 20px) / 3.3); gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
@media (min-width: 640px) { .rail { grid-auto-columns: calc((100% - 40px) / 5.3); } }
@media (min-width: 1024px) { .rail { grid-auto-columns: calc((100% - 60px) / 7.2); } }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; } }

/* ---------- Hero ---------- */
.hero { position: relative; border-radius: 18px; overflow: hidden; min-height: 250px; border: 1px solid var(--line); background: radial-gradient(90% 120% at 85% 0%, #1F3C66 0%, transparent 60%), linear-gradient(180deg, #13243E 0%, #0E1A2E 100%); display: grid; }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__body { position: relative; padding: 26px 20px; display: grid; gap: 20px; align-content: center; }
.hero h1 { font-size: clamp(28px, 7vw, 46px); letter-spacing: -.01em; max-width: 15ch; }
.hero p { color: #AFC1DD; max-width: 46ch; }
.hero__cta { display: flex; gap: 10px; flex-wrap: wrap; }
.pool { background: rgba(13, 22, 38, .72); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 360px; backdrop-filter: blur(6px); }
.pool__v { font-family: var(--display); font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pool__v--bolt { color: var(--bolt); }
.pool__l { font-size: 13px; color: var(--muted); }
@media (min-width: 900px) {
  .hero__body { grid-template-columns: 1.3fr 1fr; padding: 40px 38px; align-items: center; }
  .pool { justify-self: end; width: 100%; }
}

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
@media (min-width: 800px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; }
.tile:hover { border-color: var(--rain); }
.tile__ic { width: 40px; height: 40px; border-radius: 10px; background: var(--raised); display: grid; place-items: center; color: var(--rain); flex-shrink: 0; }
.tile small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }

/* ---------- Sports ---------- */
.sp { display: grid; gap: 18px; }
@media (min-width: 1100px) { .sp { grid-template-columns: 1fr 320px; align-items: start; } }
.league { margin-top: 18px; }
.league__head { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.event { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 10px; }
.event + .event { margin-top: 8px; }
.event__top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); font-weight: 700; }
.event__teams { display: grid; gap: 4px; font-weight: 700; }
.event__teams div { display: flex; justify-content: space-between; }
.event__teams .sc { font-family: var(--display); color: var(--bolt); }
.odds { display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: 6px; }
.odd { display: flex; justify-content: space-between; align-items: center; padding: 9px 10px; border-radius: 8px; background: var(--raised); border: 1px solid transparent; font-size: 13px; }
.odd b { font-family: var(--display); font-size: 15px; }
.odd:hover { border-color: var(--line); }
.odd.on { border-color: var(--rain); background: rgba(79, 179, 255, .12); }
.odd.up b { color: var(--win); }
.odd.down b { color: var(--loss); }
@media (min-width: 760px) {
  .event { grid-template-columns: 1fr minmax(300px, 1.1fr); align-items: center; }
  .event__top { grid-column: 1 / -1; }
}
.slip { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 16px; }
@media (min-width: 1100px) { .slip { position: sticky; top: calc(var(--hdr) + 16px); } }
.slip__item { background: var(--raised); border-radius: 10px; padding: 10px; margin-top: 8px; font-size: 14px; }
.slip__item header { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; }
.slip__sum { display: grid; gap: 6px; margin: 14px 0; font-size: 14px; }
.slip__sum div { display: flex; justify-content: space-between; }
.slip-bar { position: fixed; left: 12px; right: 12px; bottom: calc(var(--bnav) + 10px); z-index: 41; display: none; }
.slip-bar.show { display: flex; }
@media (min-width: 1100px) { .slip-bar, .slip-bar.show { display: none; } .sp .slip--mobile { display: none; } }
.slip-desk { display: none; }
@media (min-width: 1100px) { .slip-desk { display: block; } }

/* ---------- Rewards / VIP ---------- */
.cards { display: grid; gap: 12px; }
@media (min-width: 700px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .cards--3 { grid-template-columns: repeat(3, 1fr); } }
.rcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 18px; display: grid; gap: 12px; align-content: start; }
.rcard__v { font-family: var(--display); font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rcard--bolt .rcard__v { color: var(--bolt); }
.progress { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--rain-deep), var(--rain)); border-radius: inherit; }
.tier { display: grid; grid-template-columns: 48px 1fr; gap: 14px; align-items: center; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.tier + .tier { margin-top: 8px; }
.tier.on { border-color: var(--bolt); }
.tier__ic { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--raised); color: var(--c, var(--rain)); }
.tier h3 { font-size: 17px; }
.tier ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; }

/* ---------- Tabs page layouts ---------- */
.split { display: grid; gap: 16px; }
@media (min-width: 900px) { .split { grid-template-columns: 220px 1fr; align-items: start; } }
.vnav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.vnav::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .vnav { flex-direction: column; position: sticky; top: calc(var(--hdr) + 16px); } }
.vnav a { padding: 10px 14px; border-radius: 10px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.vnav a.on, .vnav a:hover { background: var(--surface); color: var(--text); }
.kv { display: grid; gap: 10px; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv > div:last-child { border-bottom: 0; }
.kv dt, .kv .k { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; }

.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-family: var(--display); color: var(--rain); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq details p { padding: 0 0 16px; color: var(--muted); max-width: 70ch; }

.prose h2 { font-size: 20px; margin: 22px 0 8px; }
.prose p, .prose li { color: #B7C5DC; max-width: 72ch; }
.prose p + p { margin-top: 10px; }

/* ---------- Game page ---------- */
.gp { display: grid; gap: 14px; }
.gp__stage { position: relative; aspect-ratio: 16 / 10; border-radius: var(--r-panel); overflow: hidden; border: 1px solid var(--line); background: linear-gradient(160deg, hsl(var(--h1) 55% 26%), hsl(var(--h2) 70% 10%)); display: grid; place-items: center; text-align: center; padding: 20px; }
.gp__stage--live { padding: 0; aspect-ratio: 16 / 9; background: #000; }
@media (max-width: 700px) { .gp__stage--live { aspect-ratio: 9 / 14; } }
.gp__frame { width: 100%; height: 100%; border: 0; display: block; }
.gp__stage .gcard__emb { position: static; transform: none; width: 90px; margin: 0 auto 12px; }
.gp__bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dice { display: grid; gap: 14px; }
@media (min-width: 900px) { .dice { grid-template-columns: 300px 1fr; } }
.dice__board { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 22px; display: grid; gap: 22px; align-content: center; }
.dice__result { font-family: var(--display); font-size: clamp(48px, 12vw, 84px); font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.dice__track { position: relative; height: 14px; border-radius: 999px; background: linear-gradient(90deg, var(--loss) 0 var(--t), var(--win) var(--t) 100%); }
.dice__track input { position: absolute; inset: -8px 0; width: 100%; opacity: 0; cursor: pointer; }
.dice__thumb { position: absolute; top: 50%; left: var(--t); width: 26px; height: 26px; border-radius: 8px; background: var(--text); transform: translate(-50%, -50%); pointer-events: none; }
.dice__marker { position: absolute; top: -34px; left: var(--r); transform: translateX(-50%); font-family: var(--display); font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--raised); opacity: 0; transition: left .3s ease, opacity .2s; }
.dice__marker.show { opacity: 1; }
.dice__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.history { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.history span { font-family: var(--display); font-size: 13px; padding: 3px 9px; border-radius: 6px; background: var(--raised); }

.gcard--img { aspect-ratio: 384 / 538; background: var(--surface); }
.gcard--img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gp__art { display: block; width: 140px; aspect-ratio: 384 / 538; object-fit: cover; border-radius: var(--r-card); margin: 0 auto 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.gcard--img::after { display: none; }

/* ---------- Bet details modal ---------- */
.betm__top { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; margin-bottom: 14px; }
.betm__top .gcard { aspect-ratio: 1; }
.betm__top .gcard__emb { top: 22%; width: 56%; }
.betm__top .gcard--img { aspect-ratio: 384 / 538; }
.betm__id { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.betm__id b { font-family: var(--display); color: var(--text); font-variant-numeric: tabular-nums; }
.stat3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.stat3 > div { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 2px; min-width: 0; }
.stat3 span { font-size: 12px; color: var(--muted); font-weight: 700; }
.stat3 b { font-family: var(--display); font-size: 15px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.betm__dice { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 34px 14px 14px; margin-bottom: 14px; }
.betm__dice .dice__marker { opacity: 1; }
.betm__sec { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; }
.betm__sec h3 { font-size: 15px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.betm__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }

/* ---------- Modals ---------- */
.modal-root { position: fixed; inset: 0; z-index: 60; display: none; }
.modal-root.open { display: block; }
.modal-scrim { position: absolute; inset: 0; background: rgba(4, 8, 16, .72); }
.modal { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 18px 18px 0 0; padding: 18px 18px calc(22px + env(safe-area-inset-bottom)); animation: sheetUp .22s ease; }
@keyframes sheetUp { from { transform: translateY(24px); opacity: 0; } }
@media (min-width: 640px) {
  .modal { left: 50%; top: 50%; bottom: auto; transform: translate(-50%, -50%); width: 460px; max-height: 88vh; border-radius: 18px; animation: fadeIn .18s ease; }
  .modal--wide { width: 720px; }
}
@keyframes fadeIn { from { opacity: 0; } }
.modal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal__head h2 { font-size: 21px; }
.modal__foot { text-align: center; color: var(--muted); font-size: 14px; margin-top: 14px; }

.curs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 14px; }
.cur-btn { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.cur-btn.on { border-color: var(--rain); background: rgba(79, 179, 255, .1); }
.cur-ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; flex-shrink: 0; font-family: var(--display); }
.addr { display: flex; gap: 8px; align-items: center; background: var(--bg); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; }
.addr .mono { flex: 1; }
.qr-box { display: flex; gap: 14px; align-items: center; margin: 14px 0; }
.qr-box canvas { width: 116px; height: 116px; border-radius: 10px; background: #fff; flex-shrink: 0; }
.note { font-size: 13px; color: var(--muted); background: var(--bg); border-radius: 10px; padding: 10px 12px; border-left: 3px solid var(--bolt); }
.sum-row { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; }

/* ---------- Chat drawer ---------- */
.chat { position: fixed; top: var(--hdr); right: 0; bottom: 0; width: 100%; background: var(--surface); border-left: 1px solid var(--line); z-index: 43; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .25s ease; }
body.chat-open .chat { transform: none; }
@media (min-width: 640px) { .chat { width: var(--chat); } }
@media (max-width: 1023px) { .chat { bottom: var(--bnav); } }
.chat__head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chat__head h2 { font-size: 17px; flex: 1; }
.rainbox { margin: 12px; padding: 12px 14px; border-radius: 12px; background: linear-gradient(135deg, rgba(79, 179, 255, .18), rgba(30, 127, 214, .08)); border: 1px solid rgba(79, 179, 255, .35); display: grid; gap: 8px; }
.rainbox__row { display: flex; justify-content: space-between; align-items: center; }
.chat__list { flex: 1; overflow-y: auto; padding: 4px 14px 12px; display: grid; gap: 10px; align-content: start; }
.msg { font-size: 14px; line-height: 1.45; }
.msg b { color: var(--rain); margin-right: 6px; }
.msg .lvl { font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 999px; background: var(--raised); color: var(--muted); margin-right: 6px; vertical-align: 1px; }
.msg--sys { color: var(--bolt); font-weight: 600; }
.chat__form { border-top: 1px solid var(--line); padding: 10px 12px; display: flex; gap: 8px; }

/* ---------- Footer ---------- */
.foot { margin-top: 48px; border-top: 1px solid var(--line); background: var(--surface); }
.foot__in { max-width: 1320px; margin: 0 auto; padding: 30px 14px 24px; }
@media (min-width: 640px) { .foot__in { padding: 36px 22px 28px; } }
.foot__cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
@media (min-width: 800px) { .foot__cols { grid-template-columns: 1.4fr repeat(3, 1fr); } }
@media (min-width: 1100px) { .foot__cols { grid-template-columns: 1.4fr repeat(6, 1fr); } }
.foot h3 { font-size: 15px; margin-bottom: 10px; color: var(--text); }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot li a { color: var(--muted); font-weight: 600; font-size: 14px; }
.foot li a:hover { color: var(--text); }
.foot__brand p { color: var(--muted); font-size: 14px; margin-top: 10px; max-width: 34ch; }
.foot__cryptos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); align-items: center; }
.foot__legal { margin-top: 18px; font-size: 13px; color: var(--muted); display: grid; gap: 8px; }
.age { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--loss); color: var(--loss); font-weight: 800; font-size: 12px; font-family: var(--display); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; top: calc(var(--hdr) + 10px); left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; width: min(92vw, 380px); pointer-events: none; }
.toast { background: var(--raised); border: 1px solid var(--line); border-left: 4px solid var(--rain); border-radius: 10px; padding: 11px 14px; font-weight: 600; font-size: 14px; box-shadow: 0 12px 30px rgba(0, 0, 0, .4); animation: fadeIn .2s ease; }
.toast--ok { border-left-color: var(--win); }
.toast--err { border-left-color: var(--loss); }
.toast--bolt { border-left-color: var(--bolt); }

/* ---------- Guard (signed-out) ---------- */
.guard { text-align: center; padding: 48px 20px; }
.guard h2 { font-size: 22px; margin-bottom: 8px; }
.guard p { color: var(--muted); margin: 0 auto 18px; max-width: 42ch; }
