:root {
  color-scheme: dark;
  --night: #101522;
  --night-soft: #171e2d;
  --panel: #1c2636;
  --paper: #f5f6f8;
  --ink: #141a27;
  --muted: #a9b2c0;
  --line: rgba(255,255,255,.13);
  --blue: #7888ff;
  --blue-bright: #9aa5ff;
  --coral: #ff856d;
  --mint: #8bdfbf;
  --header-height: 62px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--night); }
body { margin: 0; min-width: 320px; color: var(--paper); background: var(--night); overflow-x: hidden; }
button, a, input { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--blue-bright); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.site-header { height: var(--header-height); padding: 0 clamp(18px, 4vw, 58px); display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); background: var(--night); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--paper); text-decoration: none; font-size: 13px; font-weight: 900; letter-spacing: .12em; white-space: nowrap; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.header-tools { display: flex; align-items: center; gap: 13px; }
.header-link { border: 0; padding: 8px 4px; background: transparent; color: #b8c1d0; cursor: pointer; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.header-link:hover { color: white; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: #171e2b; display: grid; place-items: center; cursor: pointer; }
.icon-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-button[aria-pressed="false"] .sound-wave { display: none; }

.hero { position: relative; min-height: calc(100vh - var(--header-height)); min-height: calc(100dvh - var(--header-height)); padding: clamp(22px, 4vh, 50px) clamp(18px, 5vw, 72px) 48px; display: flex; align-items: center; justify-content: center; }
.hero-shell { width: min(100%, 1280px); display: grid; grid-template-columns: minmax(260px, .78fr) minmax(420px, 1.22fr); align-items: center; gap: clamp(30px, 6vw, 88px); }
.hero-copy { max-width: 440px; justify-self: center; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0; color: #aeb8c8; font-size: 10px; line-height: 1.5; font-weight: 850; letter-spacing: .16em; }
.eyebrow-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 4px rgba(255,133,109,.12); flex: none; }
.hero h1 { margin: 25px 0 19px; font-size: clamp(45px, 5.8vw, 78px); font-weight: 950; letter-spacing: -.075em; line-height: .94; }
.hero h1 span { color: var(--blue-bright); }
.tagline { margin: 0 0 10px; color: #f3f5f8; font-size: clamp(19px, 2vw, 25px); line-height: 1.25; font-weight: 750; letter-spacing: -.035em; }
.intro-copy { max-width: 340px; margin: 0 0 24px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.play-button { min-height: 54px; min-width: 184px; padding: 0 20px; border: 0; border-radius: 12px; display: inline-flex; align-items: center; justify-content: space-between; gap: 36px; background: var(--blue); color: white; cursor: pointer; font-size: 12px; font-weight: 900; letter-spacing: .1em; transition: transform .18s ease, background .18s ease, box-shadow .18s ease; }
.play-button:hover { background: #6577f3; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(91,110,245,.25); }
.play-button:active { transform: translateY(1px) scale(.99); }
.play-button:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.play-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.free-note { margin: 12px 0 0; color: #8d98aa; font-size: 10px; }
.best-note { margin-top: 18px; color: #9ea9ba; font-size: 9px; font-weight: 850; letter-spacing: .12em; }
.best-note b { margin-left: 6px; color: var(--mint); font-size: 13px; font-variant-numeric: tabular-nums; }

.play-area { width: 100%; min-width: 0; padding: 14px; border: 1px solid rgba(255,255,255,.1); border-radius: 22px; background: #171e2b; box-shadow: 0 24px 70px rgba(0,0,0,.28); }
.game-topline { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 1px 3px 12px; color: #aab4c3; font-size: 9px; font-weight: 850; letter-spacing: .14em; }
.round-counter { padding: 6px 9px; border: 1px solid var(--line); border-radius: 20px; color: #d7deea; font-size: 8px; white-space: nowrap; }
.scene-wrap { position: relative; width: 100%; aspect-ratio: 1.52; overflow: hidden; border: 1px solid rgba(255,255,255,.09); border-radius: 15px; background: #111827; }
#scene-canvas { display: block; width: 100%; height: 100%; }
.scene-message { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.76); font-size: clamp(13px, 1.6vw, 18px); font-weight: 750; letter-spacing: -.02em; pointer-events: none; text-shadow: 0 1px 15px #111827; }
.scene-badge { position: absolute; top: 12px; left: 12px; padding: 7px 10px; border: 1px solid rgba(255,255,255,.2); border-radius: 20px; background: rgba(16,21,34,.76); color: white; font-size: 8px; font-weight: 900; letter-spacing: .13em; pointer-events: none; }
.control-panel { min-height: 158px; padding: 16px 5px 2px; }
.question-label { margin: 0; color: #dce1e9; text-align: center; font-size: 13px; font-weight: 750; }
.guess-controls { max-width: 590px; margin: 0 auto; display: grid; justify-items: center; }
.guess-controls label { color: #aeb8c8; font-size: 9px; font-weight: 850; letter-spacing: .14em; }
.guess-value { margin: 4px 0 6px; color: white; font-size: clamp(36px, 5vw, 52px); line-height: 1; font-weight: 850; font-variant-numeric: tabular-nums; letter-spacing: -.06em; }
.slider-row { width: min(100%, 460px); display: grid; grid-template-columns: 36px 1fr 36px; align-items: center; gap: 11px; }
.nudge-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; background: #222d3e; color: white; cursor: pointer; font-size: 20px; line-height: 1; }
input[type="range"] { width: 100%; height: 30px; margin: 0; accent-color: var(--blue-bright); cursor: pointer; touch-action: pan-x; }
.lock-button { min-height: 42px; min-width: 160px; margin-top: 10px; font-size: 10px; }
.lock-button:disabled { opacity: .42; cursor: not-allowed; transform: none; box-shadow: none; }
.play-status { min-height: 15px; margin: 8px 0 0; color: #8490a3; text-align: center; font-size: 9px; }
.reveal-controls { max-width: 470px; margin: 0 auto; display: grid; justify-items: center; animation: reveal-in .24s ease both; }
.reveal-kicker { margin: 0 0 8px; color: var(--mint); font-size: 10px; font-weight: 900; letter-spacing: .16em; }
.reveal-numbers { width: min(100%, 340px); display: grid; grid-template-columns: 1fr 24px 1fr; align-items: center; text-align: center; }
.reveal-numbers div:not(.reveal-divider) { display: grid; gap: 2px; }
.reveal-numbers span, .round-points span { color: #96a1b3; font-size: 8px; font-weight: 850; letter-spacing: .12em; }
.reveal-numbers b { color: white; font-size: 32px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.reveal-divider { color: #717d8f; font-size: 20px; }
.reveal-difference { margin: 5px 0 8px; color: #bdc6d4; font-size: 11px; font-weight: 750; }
.round-points { display: flex; align-items: baseline; gap: 5px; color: var(--mint); }
.round-points b { font-size: 20px; font-variant-numeric: tabular-nums; }
.round-points small { color: #8792a3; font-size: 9px; }
.next-button { min-height: 40px; min-width: 164px; margin-top: 11px; font-size: 9px; }
.hero-shell.is-playing { width: min(100%, 820px); grid-template-columns: minmax(0,1fr); justify-items: center; }
.hero-shell.is-playing .hero-copy { display: none; }
.hero-shell.is-playing .play-area { max-width: 820px; }
.hero-shell.is-playing .scene-wrap { aspect-ratio: 1.72; }
.hero-shell.is-playing .control-panel { min-height: 166px; }
.hero-shell.is-playing .question-label { margin-bottom: 9px; }
.hero-shell.is-playing .game-topline { padding-bottom: 9px; }
.hero-shell.is-playing .scene-badge { display: block; }
.hero.is-playing { padding-top: 12px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.hero.is-playing .scroll-cue { display: none; }
@keyframes reveal-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
.scroll-cue { position: absolute; bottom: max(12px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); border: 0; padding: 6px 11px; display: flex; align-items: center; gap: 7px; background: transparent; color: #8995a7; cursor: pointer; font-size: 8px; font-weight: 850; letter-spacing: .14em; }
.scroll-cue svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; animation: cue-down 1.5s ease-in-out infinite; }
@keyframes cue-down { 50% { transform: translateY(3px); } }

.how-section { padding: clamp(55px, 8vw, 108px) 22px; background: var(--paper); color: var(--ink); }
.how-inner { width: min(100%, 1020px); margin: 0 auto; }
.how-section .eyebrow { color: #697286; }
.how-section h2 { margin: 15px 0 35px; color: #121a2a; font-size: clamp(38px, 6vw, 68px); line-height: .98; letter-spacing: -.07em; }
.how-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.how-steps article { min-height: 155px; padding: 21px; border: 1px solid #dfe3e8; border-radius: 14px; background: white; }
.step-number { color: #6879ef; font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.how-steps h3 { margin: 22px 0 7px; font-size: 13px; font-weight: 900; letter-spacing: .1em; }
.how-steps p { max-width: 240px; margin: 0; color: #697386; font-size: 12px; line-height: 1.6; }
.closing-cta { margin-top: 32px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.closing-cta p { margin: 0; font-size: 15px; font-weight: 800; }
.text-button { border: 0; padding: 9px 0; background: transparent; color: #596df2; cursor: pointer; text-decoration: none; font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.text-button:hover { color: #354ccf; }
.site-footer { min-height: 62px; padding: 14px clamp(18px, 4vw, 58px); display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--night); color: #9da7b6; }
.footer-brand { color: white; text-decoration: none; font-size: 10px; font-weight: 900; letter-spacing: .13em; }
.footer-links { display: flex; gap: clamp(12px, 3vw, 26px); }
.footer-links a { color: #9da7b6; text-decoration: none; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.footer-links a:hover { color: white; }
.footer-note { font-size: 8px; font-weight: 800; letter-spacing: .1em; }

.game-dialog { width: min(calc(100% - 28px), 490px); max-height: min(90dvh, 760px); overflow: auto; padding: 30px; border: 1px solid #e1e4e8; border-radius: 20px; background: #f8f9fb; color: #172033; box-shadow: 0 24px 90px rgba(0,0,0,.35); }
.game-dialog::backdrop { background: rgba(5,9,18,.72); backdrop-filter: blur(5px); }
.game-dialog > form:first-child { position: absolute; top: 10px; right: 12px; }
.dialog-close { width: 35px; height: 35px; border: 0; border-radius: 50%; background: transparent; color: #687286; cursor: pointer; font-size: 24px; }
.dialog-close:hover { background: #e9edf3; }
.game-dialog .eyebrow { color: #687286; }
.game-dialog h2 { margin: 14px 0 18px; font-size: clamp(30px, 7vw, 44px); line-height: 1; letter-spacing: -.06em; }
.limit-copy, .account-copy { color: #667184; font-size: 13px; line-height: 1.65; }
.compact-dialog .text-button { display: block; margin: 13px auto 0; }
.upgrade-button { width: 100%; margin-top: 18px; }
.billing-feedback { min-height: 18px; margin: 9px 0 0; color: #687286; text-align: center; font-size: 11px; line-height: 1.45; }
.billing-feedback.error { color: #b42336; }
.results-dialog { text-align: center; }
.results-dialog .eyebrow { justify-content: center; }
.final-score { display: grid; grid-template-columns: auto auto; justify-content: center; align-items: baseline; column-gap: 8px; margin: 8px 0 3px; }
.final-score span { grid-column: 1 / -1; color: #788396; font-size: 9px; font-weight: 900; letter-spacing: .15em; }
.final-score b { color: #202a3e; font-size: clamp(54px, 13vw, 78px); line-height: 1; letter-spacing: -.07em; font-variant-numeric: tabular-nums; }
.final-score small { color: #8792a2; font-size: 12px; }
.final-best { margin: 10px 0 20px; color: #647187; font-size: 9px; font-weight: 850; letter-spacing: .1em; }
.final-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 13px 0; border-top: 1px solid #e0e4e9; border-bottom: 1px solid #e0e4e9; }
.final-stats div { display: grid; gap: 4px; }
.final-stats b { font-size: 17px; font-variant-numeric: tabular-nums; }
.final-stats span { color: #778397; font-size: 7px; font-weight: 850; letter-spacing: .08em; }
.result-play { margin-top: 19px; }
.share-feedback { min-height: 15px; margin: 4px 0 0; color: #596df2; font-size: 10px; }
.account-dialog label { display: block; margin: 16px 0 6px; font-size: 11px; font-weight: 800; }
.account-dialog input[type="email"] { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid #d8dee7; border-radius: 9px; background: white; color: #172033; }
.account-submit { width: 100%; margin-top: 10px; }
.account-divider { margin: 15px 0; color: #8993a3; text-align: center; font-size: 9px; font-weight: 850; }
.account-provider { width: 100%; min-height: 44px; border: 1px solid #d8dee7; border-radius: 9px; background: white; color: #29354a; cursor: pointer; font-size: 12px; font-weight: 750; }
.account-provider b { margin-right: 8px; color: #4285f4; }
.account-feedback { min-height: 16px; color: #5664bb; font-size: 10px; }
.account-feedback.error { color: #bd3e4d; }
.account-footnote { color: #788396; font-size: 9px; }

@media (max-width: 860px) {
  .hero { padding-right: 24px; padding-left: 24px; }
  .hero-shell { grid-template-columns: minmax(220px, .72fr) minmax(350px, 1.28fr); gap: 24px; }
  .hero h1 { font-size: clamp(42px, 6.5vw, 58px); }
  .play-area { padding: 11px; }
}
@media (max-width: 700px) {
  :root { --header-height: 56px; }
  .site-header { padding: 0 15px; }
  .brand { font-size: 11px; }
  .brand-mark { width: 30px; height: 30px; }
  .header-tools { gap: 8px; }
  .icon-button { width: 32px; height: 32px; }
  .hero { align-items: center; padding: 14px 14px 38px; }
  .hero-shell { max-width: 560px; grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .hero-copy { max-width: 520px; width: 100%; text-align: center; }
  .hero-copy .eyebrow { justify-content: center; font-size: 8px; }
  .hero h1 { margin: 10px 0 6px; font-size: clamp(34px, 9vw, 48px); line-height: .91; }
  .tagline { margin-bottom: 3px; font-size: 15px; }
  .intro-copy { max-width: 380px; margin: 0 auto 10px; font-size: 11px; line-height: 1.45; }
  .hero-copy .play-button { min-height: 43px; min-width: 160px; }
  .free-note { margin-top: 6px; font-size: 9px; }
  .best-note { margin-top: 7px; }
  .play-area { padding: 9px; border-radius: 15px; }
  .game-topline { padding-bottom: 6px; font-size: 8px; }
  .scene-wrap { aspect-ratio: 1.58; border-radius: 10px; }
  .control-panel { min-height: 91px; padding: 11px 4px 0; }
  .question-label { font-size: 11px; }
  .play-status { margin-top: 5px; font-size: 8px; }
  .guess-controls label { font-size: 8px; }
  .guess-value { font-size: 38px; }
  .slider-row { grid-template-columns: 34px 1fr 34px; gap: 8px; }
  .nudge-button { width: 34px; height: 34px; }
  .lock-button { min-height: 39px; margin-top: 6px; }
  .hero-shell.is-playing { max-width: 560px; gap: 0; }
  .hero-shell.is-playing .play-area { padding: 10px; }
  .hero-shell.is-playing .scene-wrap { aspect-ratio: 1.48; }
  .hero-shell.is-playing .control-panel { min-height: 160px; padding-top: 12px; }
  .hero-shell.is-playing .question-label { margin-bottom: 8px; }
  .hero-shell.is-playing .game-topline { padding-bottom: 7px; }
  .how-section { padding: 50px 18px; }
  .how-steps { grid-template-columns: 1fr; gap: 9px; }
  .how-steps article { min-height: auto; padding: 15px 17px; }
  .how-steps h3 { margin: 11px 0 4px; }
  .how-steps p { max-width: 100%; }
  .closing-cta { align-items: flex-start; flex-direction: column; }
  .site-footer { flex-wrap: wrap; }
  .footer-note { display: none; }
}
@media (max-width: 380px) {
  .hero { padding: 10px 10px 32px; }
  .hero-shell { gap: 9px; }
  .hero h1 { font-size: 33px; }
  .intro-copy { font-size: 10px; }
  .scene-wrap { aspect-ratio: 1.48; }
  .hero-shell.is-playing .scene-wrap { aspect-ratio: 1.3; }
  .hero-shell.is-playing .control-panel { min-height: 155px; }
  .play-area { padding: 7px; }
  .final-stats span { font-size: 6px; }
}
@media (max-height: 680px) and (min-width: 701px) {
  .hero { padding-top: 12px; padding-bottom: 38px; }
  .hero-shell { gap: 22px; }
  .hero h1 { margin-top: 14px; margin-bottom: 11px; font-size: clamp(42px, 5vw, 62px); }
  .play-area { max-width: 560px; justify-self: center; padding: 10px; }
  .scene-wrap { aspect-ratio: 1.82; }
  .control-panel { min-height: 138px; }
  .hero-shell.is-playing .play-area { max-width: 560px; }
  .hero-shell.is-playing .scene-wrap { aspect-ratio: 1.9; }
  .hero-shell.is-playing .control-panel { min-height: 138px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .hero { min-height: auto; padding-top: 8px; padding-bottom: 26px; }
  .hero-shell { grid-template-columns: minmax(190px, .65fr) minmax(320px, 1.35fr); gap: 18px; }
  .hero h1 { margin: 7px 0; font-size: clamp(30px, 5vw, 44px); }
  .intro-copy { margin-bottom: 10px; font-size: 11px; }
  .scene-wrap { aspect-ratio: 2.0; }
  .hero-shell.is-playing { max-width: 900px; }
  .hero-shell.is-playing .scene-wrap { aspect-ratio: 2.2; }
  .hero-shell.is-playing .control-panel { min-height: 130px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
