:root {
  --bg: #0b1026; --bg2: #121a3a; --card: #161f45; --line: #2a3566;
  --text: #eef0fa; --muted: #9aa3c7; --gold: #f5c542; --gold2: #ffdf80;
  --up: #4ade80; --down: #ff6b6b; --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: radial-gradient(1200px 600px at 50% -200px, #1d2a66 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--gold); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
small { color: var(--muted); }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; max-width: 980px; width: 100%; margin: 0 auto; }
.logo { font-size: 26px; font-weight: 800; letter-spacing: -.5px; color: var(--text); text-decoration: none; }
.logo span { color: var(--gold); }
.top nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.top nav a { color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; }
.top nav a:hover { color: var(--gold); }

main { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 8px 16px 40px; }
main.wide, body.wide main { max-width: 980px; }
.foot { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; padding: 20px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--text); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin: 0 0 18px; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.stage { text-align: center; padding: 32px 24px; }
.eyebrow { color: var(--gold); font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 10px; }
.category { font-family: Georgia, "Times New Roman", serif; font-size: clamp(34px, 8vw, 54px); margin: 0 0 10px; }
.lead { color: var(--muted); margin: 0 0 22px; }
.fine { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
.up { color: var(--up); } .down { color: var(--down); }

.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.chip { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; text-align: center; text-decoration: none; color: var(--text); }
.chip small { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.chip b { font-size: 20px; }

.btn { display: inline-block; background: var(--gold); color: #0b1026; font-weight: 800; font-size: 16px; text-decoration: none; text-align: center;
  border: 0; border-radius: 12px; padding: 12px 20px; cursor: pointer; transition: transform .05s, background .15s; font-family: inherit; }
.btn:hover { background: var(--gold2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.big { display: block; width: 100%; font-size: 18px; padding: 16px 20px; }
.btn.small { padding: 7px 14px; font-size: 14px; color: #0b1026 !important; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); font-weight: 600; margin-top: 12px; }
.btn.ghost:hover { border-color: var(--gold); color: var(--gold); background: transparent; }
.btn.danger { background: var(--down); color: #fff; }
.btn.google { display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #1f1f1f; width: 100%; font-weight: 600; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 16px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.bet { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 18px; }
.bet-amount span { font-size: 46px; font-weight: 800; color: var(--gold); }
input[type=range] { width: 100%; margin: 12px 0; accent-color: var(--gold); height: 28px; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick button { background: transparent; color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 9px 4px; font-weight: 700; cursor: pointer; font-family: inherit; font-size: 14px; }
.quick button:hover { border-color: var(--gold); color: var(--gold); }
.bet-note { margin: 14px 0 0; font-size: 14px; color: var(--muted); }

.timer { height: 8px; background: var(--bg2); border-radius: 99px; overflow: hidden; }
.timer-bar { height: 100%; width: 100%; background: var(--gold); transition: width .2s linear; }
.timer-bar.hot { background: var(--down); }
.timer-num { font-size: 40px; font-weight: 800; margin: 8px 0 4px; font-variant-numeric: tabular-nums; }
.timer-num.hot { color: var(--down); }
.question { font-family: Georgia, "Times New Roman", serif; font-size: clamp(21px, 4.6vw, 28px); line-height: 1.35; margin: 10px 0 20px; }
.question.small { font-size: 18px; color: var(--muted); }
.clues { list-style: none; padding: 0; margin: 0 0 18px; text-align: left; }
.clues li { background: var(--bg2); border-left: 3px solid var(--gold); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.clues small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }

input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], input[type=number], textarea, select {
  width: 100%; background: #0d1430; color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font: inherit; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
#answer { font-size: 20px; text-align: center; margin-bottom: 12px; padding: 16px; }

.verdict { font-size: clamp(30px, 7vw, 44px); }
.result.win { border-color: rgba(74, 222, 128, .5); }
.result.lose { border-color: rgba(255, 107, 107, .45); }
.answer-box { background: var(--bg2); border-radius: 12px; padding: 14px; margin: 0 0 14px; }
.answer-box small { display: block; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.answer-box b { font-size: 26px; color: var(--gold); }
.answer-box .yours { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; }
.explain { color: var(--text); text-align: left; margin: 0 0 16px; }
.stats { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.cta { background: var(--bg2); border: 1px dashed var(--gold); border-radius: 12px; padding: 16px; margin-top: 16px; }
.cta-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.cta-btns .btn.ghost { margin-top: 0; }
.next { color: var(--muted); margin: 18px 0 0; }
.next b { color: var(--text); font-variant-numeric: tabular-nums; }

.flash { border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; background: rgba(74, 222, 128, .12); border: 1px solid rgba(74, 222, 128, .5); }
.flash.err { background: rgba(255, 107, 107, .12); border-color: rgba(255, 107, 107, .5); }

form.stack label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; }
form.stack .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--muted); }
form.stack .check input { margin-top: 4px; width: 18px; height: 18px; flex: none; accent-color: var(--gold); }
form.stack .btn { margin-top: 18px; }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.center { text-align: center; }
.prose h2 { margin-top: 1.4em; }
.prose p, .prose li { color: #d5d9ee; }

table.board { width: 100%; border-collapse: collapse; }
table.board th, table.board td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--line); }
table.board th { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
table.board td.num, table.board th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.board tr.me td { background: rgba(245, 197, 66, .1); font-weight: 700; }
table.board td.rank { width: 48px; color: var(--muted); font-weight: 700; }
table.board tr:nth-child(-n+3) td.rank { color: var(--gold); }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs a { padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; }
.tabs a.on { background: var(--gold); color: #0b1026; border-color: var(--gold); }

@media (max-width: 480px) {
  .top { padding: 12px 14px; } .top nav { gap: 12px; }
  .card { padding: 18px; } .stage { padding: 24px 16px; }
  .chip b { font-size: 17px; }
}

/* ---------- daily bonus ---------- */
.bonus { display: inline-block; margin: -8px 0 18px; padding: 7px 14px; border-radius: 99px; font-weight: 700; font-size: 14px;
  background: rgba(74, 222, 128, .12); border: 1px solid rgba(74, 222, 128, .5); color: var(--up); }
.bonus.guest { background: rgba(245, 197, 66, .1); border-color: rgba(245, 197, 66, .45); color: var(--text); font-weight: 600; }

/* ---------- intro for first-time visitors ---------- */
.intro { position: relative; text-align: center; padding: 30px 22px 24px; margin: 4px 0 10px; border-radius: var(--radius);
  background: radial-gradient(600px 260px at 50% 0%, rgba(245, 197, 66, .16), transparent 70%), var(--card);
  border: 1px solid rgba(245, 197, 66, .45); box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.intro.off { display: none; }
.intro h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(28px, 6.6vw, 42px); margin: 0 0 10px; }
.intro h1 span { color: var(--gold); }
.intro-sub { color: var(--muted); margin: 0 0 22px; font-size: 17px; }
.intro-close { position: absolute; top: 8px; right: 10px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent;
  color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; }
.intro-close:hover { color: var(--text); background: var(--bg2); }
.steps { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 10px; text-align: left; counter-reset: step; }
.steps li { display: flex; gap: 14px; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.steps .ico { width: 54px; height: 54px; flex: none; }
.steps b { display: block; font-size: 17px; }
.steps b::before { counter-increment: step; content: counter(step) ". "; color: var(--gold); }
.steps span { color: var(--muted); font-size: 14px; }
.steps em { color: var(--gold); font-style: normal; font-weight: 700; }
@media (min-width: 600px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .steps li { flex-direction: column; text-align: center; padding: 16px 12px; }
  .steps .ico { width: 64px; height: 64px; }
}
.intro-cta .btn.big { max-width: 360px; margin: 0 auto; }
.intro-fine { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.intro-live { margin: 16px 0 0; font-size: 14px; color: var(--text); }
.intro-live .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--up); margin-right: 8px; vertical-align: 1px;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, .6); animation: pulse 2s infinite; }
.intro-link { text-align: right; margin: 0 0 8px; font-size: 13px; }
.intro-link a { color: var(--muted); }
.intro-link a:hover { color: var(--gold); }
.intro:not(.off) + script + .intro-link { display: none; }

/* small animations on the step pictures */
.ico-bet .knob { animation: knob 3.2s ease-in-out infinite; }
.ico-bet .fill { animation: fill 3.2s ease-in-out infinite; }
.ico-win .tick { stroke-dasharray: 40; stroke-dashoffset: 40; animation: tick 3.2s ease-out infinite; }
@keyframes knob { 0%, 15% { transform: translateX(-14px); } 50%, 70% { transform: translateX(10px); } 100% { transform: translateX(-14px); } }
@keyframes fill { 0%, 15% { width: 16px; } 50%, 70% { width: 40px; } 100% { width: 16px; } }
@keyframes tick { 0%, 30% { stroke-dashoffset: 40; } 55%, 90% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 40; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, .6); } 70% { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); } 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); } }
@media (prefers-reduced-motion: reduce) { .ico-bet .knob, .ico-bet .fill, .ico-win .tick, .intro-live .dot { animation: none; } .ico-win .tick { stroke-dashoffset: 0; } }
@media (max-width: 599px) {
  .intro { padding: 22px 16px 18px; }
  .intro h1 { font-size: 27px; margin-bottom: 6px; }
  .intro-sub { font-size: 15px; margin-bottom: 14px; }
  .steps { gap: 6px; margin-bottom: 16px; }
  .steps li { padding: 8px 12px; gap: 12px; }
  .steps .ico { width: 40px; height: 40px; }
  .steps b { font-size: 15px; }
  .steps span { font-size: 13px; }
  .intro-cta .btn.big { padding: 14px 18px; font-size: 17px; }
  .intro-close { top: 4px; right: 4px; }
}

/* ---------- no layout shift while the game loads ---------- */
html { scrollbar-gutter: stable; }
#game { min-height: 790px; }
@media (max-width: 599px) { #game { min-height: 830px; } }

/* ---------- three levels a day ---------- */
.ladder { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ladder .step { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 6px; border-radius: 12px;
  background: var(--bg2); border: 1px solid var(--line); color: var(--muted); text-align: center; }
.ladder .step b { width: 26px; height: 26px; line-height: 26px; border-radius: 50%; background: var(--line); color: var(--text); font-size: 14px; }
.ladder .step span { font-weight: 700; font-size: 14px; color: var(--text); }
.ladder .step small { font-size: 11px; }
.ladder .step:last-child span { color: var(--gold); }
.ladder .now { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.ladder .now b { background: var(--gold); color: #0b1026; }
.ladder .won b { background: var(--up); color: #0b1026; }
.ladder .lost b { background: var(--down); color: #fff; }
.ladder .won, .ladder .lost { opacity: .85; }
.card.final { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(245, 197, 66, .5), 0 20px 50px rgba(0, 0, 0, .35); }
.climb { margin-top: 18px; padding: 18px; border-radius: 14px; background: var(--bg2); border: 1px dashed var(--gold); }
.climb h2 { font-family: Georgia, "Times New Roman", serif; font-size: 28px; margin: 4px 0 8px; }
.climb p { color: var(--muted); margin: 0 0 14px; }
.climb .btn.ghost { width: 100%; }
.dayover { margin: 18px 0 14px; }
.day-total { font-size: 34px; font-weight: 800; margin: 0; }
@media (max-width: 480px) { .ladder .step small { display: none; } }
/* hint shop */
.btn.hintbtn { display: block; width: 100%; margin-top: 14px; background: rgba(245,197,66,.08); color: var(--gold); border: 1px dashed var(--gold); font-weight: 600; }
.btn.hintbtn:hover { background: rgba(245,197,66,.16); }
.btn.hintbtn b { color: var(--text); }
.btn.hintbtn:disabled { color: var(--muted); border-color: var(--line); background: transparent; }
.hintnote { margin-top: 6px; text-align: center; }
