/* Is This Peak – dark data-viz design with neon line */
/* Self-hosted fonts (SIL OFL 1.1, licences in assets/fonts/) – no requests to external font services.
 * Variable woff2 files from @fontsource-variable 5.3.0, Latin + Latin Extended subsets. */
@font-face {
  font-family: "Space Grotesk"; font-style: normal; font-display: swap; font-weight: 300 700;
  src: url("assets/fonts/space-grotesk-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Space Grotesk"; font-style: normal; font-display: swap; font-weight: 300 700;
  src: url("assets/fonts/space-grotesk-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 100 800;
  src: url("assets/fonts/jetbrains-mono-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 100 800;
  src: url("assets/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  --bg: #070a12;
  --bg-2: #0b1020;
  --panel: #0e1424;
  --panel-2: #141b2e;
  --line: #1b2438;
  --line-2: #26314a;
  --text: #e9edf6;
  --muted: #8c97b0;
  --faint: #5d6882;
  --neon: #3ef0ff;
  --neon-dim: #1c8fa0;
  --hot: #ff4fd8;
  --good: #4bf2a0;
  --mid: #ffd84a;
  --warn: #ff9f43;
  --bad: #ff5a76;
  --radius: 16px;
  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: radial-gradient(1100px 560px at 50% -120px, #0f2140 0%, rgba(15, 33, 64, 0) 70%), var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
.bg-grid {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(62, 240, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(62, 240, 255, .035) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at 50% 20%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 20%, #000 30%, transparent 75%);
}
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.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; }
[hidden] { display: none !important; }
a { color: var(--neon); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--neon); outline-offset: 2px; }

/* ---------- Header ---------- */
.topbar {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  max-width: 760px; width: 100%; margin: 0 auto; padding: 10px 14px;
}
.brand {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 6px;
  background: none; border: 0; cursor: pointer;
  font-weight: 700; font-size: 20px; letter-spacing: .02em;
}
.brand-icon { width: 34px; height: 22px; }
.brand-icon path { fill: none; stroke: var(--neon); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 4px rgba(62, 240, 255, .7)); }
.brand-icon circle { fill: var(--hot); }
.topbar-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--panel); border: 1px solid var(--line-2); cursor: pointer;
  font-weight: 700; font-size: 18px; transition: border-color .15s, background .15s;
}
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.icon-btn:hover { border-color: var(--neon-dim); background: var(--panel-2); }

main { position: relative; z-index: 1; flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 4px 14px 24px; }
.screen { animation: screen-in .35s ease both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 12px; cursor: pointer;
  font-weight: 600; font-size: 16px; text-decoration: none; color: var(--text);
  border: 1px solid var(--line-2); background: var(--panel);
  transition: transform .08s, border-color .15s, background .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn:hover { border-color: var(--neon-dim); }
.btn-primary {
  background: var(--neon); color: #03141a; border-color: var(--neon);
  box-shadow: 0 0 0 1px rgba(62, 240, 255, .3), 0 6px 26px -6px rgba(62, 240, 255, .6);
}
.btn-primary:hover { background: #7ff6ff; border-color: #7ff6ff; }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-ghost { background: transparent; }
.btn-small { min-height: 44px; font-size: 14px; padding: 0 14px; color: var(--muted); }
.btn-big { min-height: 58px; font-size: 20px; width: 100%; max-width: 340px; }
.btn-danger { background: transparent; border-color: rgba(255, 90, 118, .55); color: var(--bad); }
.btn-danger:hover { background: rgba(255, 90, 118, .12); border-color: var(--bad); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------- Start ---------- */
.hero { position: relative; text-align: center; padding: 26px 0 8px; }
.hero-line { position: absolute; left: -14px; right: -14px; width: calc(100% + 28px); top: 38px; height: 150px; z-index: -1; opacity: .9; }
.hero-path { fill: none; stroke: var(--neon); stroke-width: 2.5; stroke-linejoin: round; filter: drop-shadow(0 0 6px rgba(62, 240, 255, .8)); vector-effect: non-scaling-stroke;
  stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: draw 2.4s .2s ease-out forwards; }
.hero-area { fill: url(#hero-fill); opacity: 0; animation: fade 1s 1.6s forwards; }
.hero-dot { fill: var(--hot); filter: drop-shadow(0 0 6px var(--hot)); opacity: 0; animation: fade .4s 1.2s forwards, pulse 2.4s 1.6s ease-in-out infinite; transform-origin: 260px 30px; transform-box: view-box; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.5); } }
.kicker { margin: 0; color: var(--neon); font-family: var(--mono); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.logo {
  margin: 66px 0 4px; font-size: clamp(40px, 11vw, 80px); line-height: .95; font-weight: 700; letter-spacing: -.03em; text-transform: uppercase;
  background: linear-gradient(180deg, #fff 30%, #9feeff 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 40px rgba(62, 240, 255, .25);
}
.logo-peak { background: linear-gradient(90deg, var(--neon), var(--hot)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pitch { margin: 8px auto 0; max-width: 460px; color: var(--muted); font-size: 17px; }
.start-card {
  margin: 26px auto 0; max-width: 520px; padding: 22px 18px; text-align: center;
  background: linear-gradient(180deg, rgba(20, 27, 46, .85), rgba(14, 20, 36, .85));
  border: 1px solid var(--line-2); border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.sub { margin: 0; color: var(--muted); font-size: 14px; }
.done-score { font-size: 64px; font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.done-score small, .result-score small { font-size: .4em; color: var(--muted); font-weight: 500; }
.emoji-row { margin: 0; font-size: 26px; letter-spacing: 4px; }
.emoji-row.big { font-size: 30px; }
.countdown { margin: 0; color: var(--muted); font-size: 15px; }
.countdown strong { color: var(--text); font-size: 17px; }

.premium-teaser {
  margin: 18px auto 0; max-width: 520px; width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 14px 16px; min-height: 64px; border-radius: var(--radius); cursor: pointer;
  background: linear-gradient(110deg, rgba(255, 79, 216, .10), rgba(62, 240, 255, .06));
  border: 1px dashed rgba(255, 79, 216, .45);
}
.premium-teaser:hover { border-style: solid; }
.premium-badge {
  display: inline-block; flex: none; padding: 3px 9px; border-radius: 999px; margin: 0;
  background: var(--hot); color: #2a0623; font-weight: 700; font-size: 13px; letter-spacing: .02em;
}
.premium-text { flex: 1; display: flex; flex-direction: column; font-size: 14px; color: var(--muted); }
.premium-text strong { color: var(--text); font-size: 15px; }
.premium-soon { flex: none; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--hot); }
.premium-soon.big { font-size: 13px; margin: 6px 0 14px; }
.premium-list { padding-left: 18px; margin: 10px 0; color: var(--muted); }
.premium-list li { margin: 6px 0; }
.premium-list strong { color: var(--text); }

/* ---------- Game ---------- */
.game-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 12px; }
.round-info { display: flex; flex-direction: column; line-height: 1.2; }
.mode-tag { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--neon); }

.round-count { font-size: 15px; font-weight: 600; }
.progress { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; }
.progress li { width: 22px; height: 8px; border-radius: 4px; background: var(--line-2); transition: background .3s, box-shadow .3s; }
.progress li.current { background: var(--neon); box-shadow: 0 0 10px rgba(62, 240, 255, .6); }
.progress li.p4 { background: var(--good); } .progress li.p3 { background: var(--mid); }
.progress li.p2 { background: var(--warn); } .progress li.p1 { background: var(--bad); } .progress li.p0 { background: #39415a; }
.score-pill { padding: 6px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line-2); font-size: 14px; font-weight: 600; white-space: nowrap; }
.score-pill.bump { animation: bump .5s ease; }
@keyframes bump { 30% { transform: scale(1.18); border-color: var(--good); } }

.chart-card {
  position: relative; padding: 12px 12px 6px; border-radius: var(--radius);
  background: linear-gradient(180deg, #0c1222, #0a0f1c);
  border: 1px solid var(--line-2);
  box-shadow: 0 0 0 1px rgba(62, 240, 255, .04), 0 20px 60px -30px rgba(62, 240, 255, .35);
}
.chart-card.shake { animation: shake .4s ease; }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.chart-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 2px 6px; font-size: 12px; color: var(--faint); font-family: var(--mono); }
.diff { padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.diff.d1 { color: var(--good); } .diff.d2 { color: var(--mid); } .diff.d3 { color: var(--hot); }
.chart-host { position: relative; width: 100%; }
.chart-wrap { position: relative; width: 100%; touch-action: pan-y; user-select: none; -webkit-user-select: none; border-radius: 8px; }
.chart-wrap.is-interactive { cursor: crosshair; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid .grid-soft { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.chart-grid .grid-base { stroke: var(--line-2); stroke-width: 1; shape-rendering: crispEdges; }
.chart-grid .grid-year { stroke: #222d45; stroke-width: 1; shape-rendering: crispEdges; }
.chart-grid .tick-month { stroke: #33405e; stroke-width: 1; shape-rendering: crispEdges; }
.axis-label { fill: var(--muted); font: 500 11px var(--mono); }
.axis-y { fill: var(--muted); paint-order: stroke; stroke: #0a0f1c; stroke-width: 4px; stroke-linejoin: round; }
.chart-line { fill: none; stroke: var(--neon); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-glow { fill: none; stroke: var(--neon); stroke-width: 5; stroke-opacity: .55; stroke-linejoin: round; }
.chart-area { opacity: .9; }
.pen-dot { fill: #fff; filter: drop-shadow(0 0 6px var(--neon)) drop-shadow(0 0 12px var(--neon)); }
.peak-ring { fill: none; stroke: var(--hot); stroke-width: 1.5; opacity: .8; transform-box: fill-box; transform-origin: center; animation: ring 1.8s ease-out infinite; }
.peak-dot { fill: var(--hot); stroke: var(--bg); stroke-width: 2; }
.peak-label { fill: var(--hot); font: 600 11px var(--mono); paint-order: stroke; stroke: #0a0f1c; stroke-width: 4px; stroke-linejoin: round; }
@keyframes ring { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.7); opacity: 0; } }
.hover-line { stroke: rgba(233, 237, 246, .45); stroke-width: 1; shape-rendering: crispEdges; }
.hover-dot { fill: var(--neon); stroke: var(--bg); stroke-width: 2; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 3;
  display: flex; flex-direction: column; padding: 7px 10px; border-radius: 10px;
  background: rgba(8, 12, 22, .94); border: 1px solid var(--line-2); box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
  font-size: 12px; color: var(--muted); white-space: nowrap;
}
.chart-tip strong { color: var(--text); font: 600 14px var(--mono); }

.hints { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hint {
  display: flex; gap: 8px; align-items: flex-start; padding: 9px 10px; min-height: 58px; border-radius: 12px;
  background: var(--panel); border: 1px dashed var(--line-2); color: var(--faint); font-size: 13px; line-height: 1.3;
  transition: border-color .3s, background .3s, color .3s;
}
.hint-key { flex: none; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; background: var(--line); font: 600 11px var(--mono); }
.hint-body { display: flex; flex-direction: column; min-width: 0; }
.hint-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-family: var(--mono); }
.hint-value { overflow-wrap: anywhere; }
.hint.open { border-style: solid; border-color: rgba(62, 240, 255, .45); background: rgba(62, 240, 255, .06); color: var(--text); }
.hint.open .hint-key { background: var(--neon); color: #03141a; }
.hint.open .hint-title { color: var(--neon); }
.hint.just-opened { animation: hint-in .6s ease; }
@keyframes hint-in { 0% { transform: scale(.94); box-shadow: 0 0 0 0 rgba(62, 240, 255, .6); } 60% { transform: scale(1.03); box-shadow: 0 0 0 8px rgba(62, 240, 255, 0); } 100% { transform: none; } }
.letters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 3px; margin: 3px 0 2px; font-family: var(--mono); font-weight: 600; }
.letters .lt { display: inline-block; width: 11px; height: 16px; border-bottom: 2px solid var(--neon-dim); text-align: center; font-size: 13px; line-height: 14px; }
.letters .lt-first { color: var(--neon); border-bottom-color: var(--neon); }
.letters .lt-gap { display: inline-block; width: 8px; }
.letters .lt-punct { font-size: 13px; line-height: 16px; color: var(--muted); }
.letters-meta { display: block; font-size: 12px; color: var(--muted); }

.guess-area { margin-top: 14px; }
.attempt-line { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.attempt-line strong { color: var(--text); }
.guess-form { display: flex; gap: 8px; align-items: stretch; }
.combo { position: relative; flex: 1; min-width: 0; }
#guess-input {
  width: 100%; height: 52px; padding: 0 14px; border-radius: 12px; font: 500 17px var(--font); color: var(--text);
  background: #0a0f1c; border: 1px solid var(--line-2); outline: none; transition: border-color .15s, box-shadow .15s;
}
#guess-input:focus { border-color: var(--neon); box-shadow: 0 0 0 3px rgba(62, 240, 255, .18); }
#guess-input::placeholder { color: var(--faint); }
.guess-form .btn { min-height: 52px; }
.suggest {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 20; margin: 0; padding: 6px; list-style: none;
  background: #0d1324; border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 -12px 40px rgba(0, 0, 0, .55);
  max-height: 300px; overflow-y: auto;
}
.suggest li { padding: 0 12px; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-radius: 8px; cursor: pointer; font-size: 16px; }
.suggest li mark { background: none; color: var(--neon); font-weight: 700; }
.suggest li.active, .suggest li:hover { background: var(--panel-2); }
.suggest li.used { color: var(--faint); cursor: not-allowed; }
.suggest li small { color: var(--faint); font-size: 12px; font-family: var(--mono); }
.suggest li.empty { color: var(--muted); cursor: default; font-size: 14px; }
.guess-actions { display: flex; justify-content: flex-end; margin-top: 6px; }
.wrong-list { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.wrong-list li { padding: 5px 10px; border-radius: 999px; background: rgba(255, 90, 118, .1); border: 1px solid rgba(255, 90, 118, .35); color: #ffb3c0; font-size: 14px; animation: pop-in .3s ease; }
.wrong-list li.skip { background: rgba(140, 151, 176, .08); border-color: var(--line-2); color: var(--muted); }
.wrong-list li::before { content: "✗ "; }
.wrong-list li.skip::before { content: "– "; }
@keyframes pop-in { from { transform: scale(.7); opacity: 0; } }
.feedback { min-height: 22px; margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.feedback.bad { color: #ffb3c0; }

.reveal {
  margin-top: 14px; padding: 16px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line-2); animation: screen-in .4s ease both;
}
.reveal.win { border-color: rgba(75, 242, 160, .45); box-shadow: 0 0 40px -18px rgba(75, 242, 160, .6); }
.reveal.lose { border-color: rgba(255, 90, 118, .4); }
.reveal-head { display: flex; gap: 14px; align-items: center; }
.reveal-badge { flex: none; width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; font: 700 22px var(--mono); background: var(--good); color: #04220f; }
.reveal.lose .reveal-badge { background: #39415a; color: var(--text); }
.reveal-kicker { margin: 0; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--good); }
.reveal.lose .reveal-kicker { color: var(--bad); }
.reveal-title { margin: 0; font-size: 26px; line-height: 1.15; letter-spacing: -.01em; overflow-wrap: anywhere; }
.reveal-blurb { margin: 12px 0 0; color: var(--muted); }
.note { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; background: rgba(255, 79, 216, .07); border-left: 3px solid var(--hot); }
.note-kicker { margin: 0 0 2px; font-weight: 700; color: var(--hot); font-size: 14px; }
.note-kicker .mono { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px; }
.note-text { margin: 0; }
.reveal-hint-tip { margin: 10px 0 14px; color: var(--faint); font-size: 13px; }
.reveal .btn-row { justify-content: flex-end; }

/* ---------- Result ---------- */
.result-card { text-align: center; padding: 22px 16px; border-radius: var(--radius); background: linear-gradient(180deg, rgba(20, 27, 46, .9), rgba(14, 20, 36, .9)); border: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 14px; align-items: center; }
.result-score { margin: 0; font-size: 84px; line-height: 1; letter-spacing: -.04em; font-weight: 700; text-shadow: 0 0 30px rgba(62, 240, 255, .35); }
.result-verdict { margin: 0; max-width: 440px; font-size: 18px; }
.result-list { list-style: none; padding: 0; margin: 0; width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 6px; }
.result-list li { display: grid; grid-template-columns: 70px 1fr auto auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(7, 10, 18, .5); border: 1px solid var(--line); text-align: left; }
.result-list .r-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-list .r-pts { font: 600 14px var(--mono); padding: 2px 8px; border-radius: 6px; }
.r-pts.p4 { background: rgba(75, 242, 160, .15); color: var(--good); } .r-pts.p3 { background: rgba(255, 216, 74, .14); color: var(--mid); }
.r-pts.p2 { background: rgba(255, 159, 67, .14); color: var(--warn); } .r-pts.p1 { background: rgba(255, 90, 118, .14); color: var(--bad); }
.r-pts.p0 { background: rgba(140, 151, 176, .12); color: var(--muted); }
.spark { display: block; width: 70px; height: 26px; }
.spark-line { fill: none; stroke: var(--neon); stroke-width: 1.5; stroke-linejoin: round; }
/* Ad slots: invisible unless js/ads.js switched AdSense on (html.ads-on) */
.ad-slot { display: none; }
.ads-on .ad-slot { display: block; margin: 22px auto 0; width: 100%; max-width: 728px; min-height: 100px; text-align: center; }
.ads-on .ad-slot::before { content: "Advertisement"; display: block; margin-bottom: 4px; color: var(--faint); font: 10px var(--mono); text-transform: uppercase; letter-spacing: .14em; }
.ads-on .ad-below { margin-top: max(56px, calc(100svh - 560px)); } /* start screen: below the first screen height */

/* ---------- Modals ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(3, 5, 10, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade-in .2s ease; }
@keyframes fade-in { from { opacity: 0; } }
.modal-box {
  position: relative; width: 100%; max-width: 460px; max-height: calc(100dvh - 32px); overflow-y: auto;
  padding: 22px 18px 18px; border-radius: 20px; background: #0d1324; border: 1px solid var(--line-2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(62, 240, 255, .06);
  display: flex; flex-direction: column; gap: 10px; animation: modal-in .25s ease;
}
@keyframes modal-in { from { transform: translateY(12px) scale(.98); opacity: 0; } }
.modal-box h2 { margin: 0 40px 4px 0; font-size: 24px; }
.modal-box > .btn { margin-top: 8px; }
.modal-x { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; font-size: 28px; line-height: 1; cursor: pointer; color: var(--muted); }
.modal-x:hover { color: var(--text); background: var(--panel-2); }
.howto { list-style: none; padding: 0; margin: 4px 0; display: flex; flex-direction: column; gap: 12px; }
.howto li { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); }
.howto strong { color: var(--text); }
.howto-num { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(62, 240, 255, .12); color: var(--neon); font: 700 14px var(--mono); border: 1px solid rgba(62, 240, 255, .35); }
.howto-foot { margin: 4px 0 0; color: var(--faint); font-size: 14px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { display: flex; flex-direction: column; align-items: center; padding: 10px 4px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); text-align: center; }
.stat strong { font: 700 24px var(--mono); }
.stat span { font-size: 12px; color: var(--muted); line-height: 1.2; }
.stat-h { margin: 10px 0 2px; font-size: 14px; color: var(--muted); font-weight: 500; }
.dist { display: flex; flex-direction: column; gap: 6px; }
.dist-row { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.dist-bar { position: relative; height: 22px; }
.dist-fill { height: 100%; min-width: 26px; border-radius: 0 4px 4px 0; background: var(--line-2); display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; font: 600 12px var(--mono); color: var(--text); transition: width .6s ease; }
.dist-fill.top { background: var(--neon); color: #03141a; }
.stat-foot { margin: 6px 0 0; font-size: 13px; color: var(--faint); }

.setting { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.setting input[type=range] { flex: 1; min-width: 140px; max-width: 220px; accent-color: var(--neon); height: 44px; }
.switch { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { position: relative; width: 46px; height: 26px; border-radius: 999px; background: var(--line-2); transition: background .2s; flex: none; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #c9d1e3; transition: transform .2s; }
.switch input:checked + .switch-ui { background: var(--neon); }
.switch input:checked + .switch-ui::after { transform: translateX(20px); background: #03141a; }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--neon); outline-offset: 2px; }
.danger-zone { border-bottom: 0; flex-direction: column; align-items: flex-start; }
.setting-note { margin: 6px 0 0; font-size: 13px; color: var(--faint); }
.setting-note.strong { color: var(--text); font-size: 14px; margin-bottom: 8px; }

/* ---------- Toast & Footer ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 80;
  padding: 12px 18px; border-radius: 12px; background: var(--neon); color: #03141a; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  animation: toast-in .25s ease; max-width: calc(100vw - 32px); text-align: center;
}
@keyframes toast-in { from { transform: translate(-50%, 10px); opacity: 0; } }
.footer { position: relative; z-index: 1; text-align: center; padding: 16px 14px 26px; color: var(--faint); font-size: 13px; }
.footer p { margin: 2px 0; }
.footer a { color: var(--muted); }
.footer-small { font-size: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 520px) {
  .hints { grid-template-columns: 1fr; gap: 6px; }
  .hint { min-height: 0; padding: 8px 10px; align-items: center; }
  .hint-body { flex-direction: row; gap: 8px; align-items: baseline; flex-wrap: wrap; }
  .progress li { width: 14px; }
  .chart-card { padding: 10px 8px 4px; margin: 0 -6px; }
  .reveal-title { font-size: 22px; }
  .result-score { font-size: 72px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .reveal .btn-row { justify-content: stretch; }
  .reveal .btn-row .btn { flex: 1; }
}
@media (max-width: 380px) {
  .guess-form .btn { padding: 0 14px; }
  .premium-teaser { flex-wrap: wrap; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
.reduce-motion .hero-path { stroke-dashoffset: 0; }
.reduce-motion .peak-ring { opacity: 0; }

/* ---------- Category chip + "How others did" ---------- */
.meta-left { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.cat-chip { padding: 2px 8px; border-radius: 999px; background: var(--line); color: var(--text); font-size: 11px; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.others, .others-score { width: 100%; margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: rgba(7, 10, 18, .45); border: 1px solid var(--line); text-align: left; }
.others-score { max-width: 460px; margin: 0; }
.others-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 0 8px; font-size: 14px; }
.others-src { font: 11px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }
.others-src.live { color: var(--neon); }
.others-cols { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; align-items: end; }
.oc { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.oc-tag { height: 14px; font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--neon); }
.oc-pct { font: 600 12px var(--mono); color: var(--text); }
.oc-track { position: relative; width: 100%; max-width: 44px; height: 64px; display: flex; align-items: flex-end; }
.oc-bar { display: block; width: 100%; border-radius: 4px 4px 0 0; opacity: .45; }
.oc.you .oc-bar { opacity: 1; box-shadow: 0 0 0 2px var(--panel), 0 0 0 3px var(--neon); }
.oc-bar.p4 { background: var(--good); } .oc-bar.p3 { background: var(--mid); } .oc-bar.p2 { background: var(--warn); }
.oc-bar.p1 { background: var(--bad); } .oc-bar.p0 { background: #5d6882; }
.oc-label { font-size: 11px; color: var(--muted); white-space: nowrap; }
.oc-pts { font: 10px var(--mono); color: var(--faint); }
.oc.you .oc-label { color: var(--text); font-weight: 600; }
.others-foot { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.others-foot strong { color: var(--text); font-family: var(--mono); }
.hist { display: grid; grid-template-columns: repeat(21, 1fr); gap: 2px; align-items: end; height: 72px; padding-top: 14px; }
.hc { position: relative; height: 100%; display: flex; align-items: flex-end; }
.hc-bar { display: block; width: 100%; border-radius: 2px 2px 0 0; background: var(--line-2); }
.hc.you .hc-bar { background: var(--neon); box-shadow: 0 0 10px rgba(62, 240, 255, .5); }
.hc-you { position: absolute; left: 50%; top: -14px; transform: translateX(-50%); font: 600 10px var(--mono); color: var(--neon); text-transform: uppercase; }
.hist-axis { display: flex; justify-content: space-between; margin-top: 4px; font: 10px var(--mono); color: var(--faint); }
.r-avg { font: 11px var(--mono); color: var(--faint); white-space: nowrap; }
@media (max-width: 380px) { .oc-label { font-size: 10px; } .r-avg { display: none; } }

/* ---------- Modes: Daily + Endless ---------- */
.mode-grid { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode-btn {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  min-height: 132px; padding: 16px 44px 16px 16px; border-radius: 14px; cursor: pointer; text-align: left;
  font: inherit; color: var(--text); border: 1px solid; overflow: hidden;
  transition: transform .08s, box-shadow .2s, border-color .2s; -webkit-tap-highlight-color: transparent;
}
.mode-btn:active { transform: scale(.98); }
.mode-btn:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.mode-daily { background: linear-gradient(140deg, rgba(62, 240, 255, .24), rgba(62, 240, 255, .05) 70%); border-color: rgba(62, 240, 255, .55); }
.mode-daily:hover { box-shadow: 0 8px 30px -10px rgba(62, 240, 255, .7); border-color: var(--neon); }
.mode-endless { background: linear-gradient(140deg, rgba(255, 79, 216, .24), rgba(255, 79, 216, .05) 70%); border-color: rgba(255, 79, 216, .55); }
.mode-endless:hover { box-shadow: 0 8px 30px -10px rgba(255, 79, 216, .7); border-color: var(--hot); }
.mode-kicker { font: 600 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--neon); }
.mode-endless .mode-kicker { color: var(--hot); }
.mode-name { font-size: 28px; font-weight: 700; line-height: 1.05; letter-spacing: -.02em; }
.mode-sub { font-size: 13px; line-height: 1.35; color: var(--muted); }
.mode-go { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #03141a; background: var(--neon); }
.mode-endless .mode-go { background: var(--hot); color: #2a0623; }
/* Daily done: Endless takes the stage, today's result moves into a compact strip */
.mode-grid.single { grid-template-columns: 1fr; }
.mode-grid.single .mode-daily { display: none; }
.mode-grid.single .mode-btn { min-height: 110px; }
.mode-grid.single .mode-name { font-size: 34px; }
.daily-done { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: rgba(7, 10, 18, .45); border: 1px solid var(--line); text-align: left; }
.daily-done-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.daily-done .kicker { font-size: 11px; }
.daily-done-line { margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.daily-done .done-score { font-size: 28px; }
.daily-done .emoji-row { font-size: 18px; letter-spacing: 2px; }
.daily-done .countdown { font-size: 13px; }
.daily-done .countdown strong { font-size: 14px; }
@media (max-width: 520px) {
  .mode-grid { grid-template-columns: 1fr; }
  .mode-btn { min-height: 0; padding: 14px 52px 14px 16px; }
  .mode-name { font-size: 24px; }
  .mode-grid.single .mode-name { font-size: 28px; }
}

/* ---------- Endless in game ---------- */
.mode-tag.endless { color: var(--hot); }
.lives { margin: 0; display: flex; gap: 4px; font-size: 20px; line-height: 1; letter-spacing: 0; }
.life { color: var(--hot); text-shadow: 0 0 10px rgba(255, 79, 216, .6); transition: color .3s, text-shadow .3s; }
.life.lost { color: #3a4360; text-shadow: none; }
.life.just-lost { animation: life-lost .7s ease; }
@keyframes life-lost { 0% { transform: scale(1); color: var(--hot); } 30% { transform: scale(1.5) rotate(-12deg); color: var(--bad); } 100% { transform: scale(1); } }
.reveal .btn-row #btn-end-run { margin-right: auto; }

/* ---------- Game over ---------- */
.record-flag { margin: -4px 0 -6px; padding: 4px 12px; border-radius: 999px; background: var(--hot); color: #2a0623; font: 700 13px var(--mono); letter-spacing: .12em; text-transform: uppercase; box-shadow: 0 0 24px rgba(255, 79, 216, .7); animation: record-pop .6s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes record-pop { from { transform: scale(.4); opacity: 0; } }
.result-card.record { border-color: rgba(255, 79, 216, .6); box-shadow: 0 0 0 1px rgba(255, 79, 216, .25), 0 0 60px -10px rgba(255, 79, 216, .55); }
.result-card.record .result-score { animation: record-glow 1.6s ease-in-out 3; }
@keyframes record-glow { 50% { text-shadow: 0 0 40px rgba(255, 79, 216, .9), 0 0 80px rgba(62, 240, 255, .5); } }
.result-card.endless .kicker { color: var(--hot); }
.emoji-row.long { font-size: 20px; letter-spacing: 2px; max-width: 440px; line-height: 1.5; word-break: break-all; }
.btn-ad { min-height: 44px; font-size: 14px; color: var(--muted); border-style: dashed; border-color: rgba(255, 79, 216, .45); background: rgba(255, 79, 216, .06); }
.btn-ad:hover { border-color: var(--hot); }
.soon-tag { font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--hot); }
.stat-section { margin: 6px 0 0; font: 600 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--neon); }
.stat-section.endless { margin-top: 14px; color: var(--hot); }

/* ---------- Footer links, menu links ---------- */
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin: 0 0 8px; font-size: 14px; }
.footer-links a, .menu-links a { color: var(--muted); text-decoration: none; padding: 6px 0; }
.footer-links a:hover, .menu-links a:hover { color: var(--text); text-decoration: underline; }
.menu-links { display: flex; flex-wrap: wrap; gap: 2px 16px; padding: 10px 0 0; font-size: 14px; border-top: 1px solid var(--line); }
a.brand { color: var(--text); text-decoration: none; }

/* ---------- Text pages: about, how to play, legal, privacy, 404 ---------- */
.page { max-width: 720px; }
.page-card { padding: 26px 22px 30px; border-radius: var(--radius); background: linear-gradient(180deg, rgba(20, 27, 46, .9), rgba(14, 20, 36, .9)); border: 1px solid var(--line-2); }
.page h1 { margin: 6px 0 14px; font-size: clamp(30px, 6vw, 42px); line-height: 1.1; letter-spacing: -.02em; }
.page h2 { margin: 28px 0 8px; font-size: 21px; letter-spacing: -.01em; }
.page h3 { margin: 18px 0 6px; font-size: 17px; }
.page p, .page li { color: #c9d1e3; }
.page p { margin: 0 0 12px; }
.page ul, .page ol { margin: 0 0 12px; padding-left: 22px; }
.page li { margin: 4px 0; }
.page strong { color: var(--text); }
.page .lead { font-size: 18px; color: var(--text); }
.page .muted { color: var(--muted); font-size: 14px; }
.page address { font-style: normal; margin: 0 0 12px; color: var(--text); line-height: 1.6; }
.page dl.faq dt { margin: 16px 0 4px; font-weight: 600; color: var(--text); }
.page dl.faq dd { margin: 0; color: #c9d1e3; }
.page .cta { margin-top: 24px; }
.page-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.play-btn { min-height: 40px; padding: 0 18px; font-size: 15px; }
.page .btn-primary { color: #03141a; }
.big-404 { margin: 10px 0 0; font: 700 clamp(72px, 20vw, 140px)/1 var(--font); letter-spacing: -.05em; background: linear-gradient(90deg, var(--neon), var(--hot)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Cookie settings: fixed button (every page) + fallback panel ---------- */
.cookie-btn {
  position: fixed; left: calc(12px + env(safe-area-inset-left)); bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 40;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 44px; height: 44px; padding: 0 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: rgba(14, 20, 36, .9); color: var(--muted);
  font: 500 13px var(--font); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: opacity .2s, color .15s, border-color .15s; -webkit-tap-highlight-color: transparent;
}
.cookie-btn svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.cookie-btn svg circle { fill: currentColor; stroke: none; }
.cookie-btn:hover, .cookie-btn:focus-visible { color: var(--text); border-color: var(--neon-dim); }
.cookie-btn:focus-visible { outline: 2px solid var(--neon); outline-offset: 2px; }
.cookie-btn span { display: none; }
.cookie-btn.is-tucked { opacity: 0; pointer-events: none; }
.cookie-btn.is-tucked:focus-visible { opacity: 1; pointer-events: auto; }
body.has-cookie-btn { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
@media (min-width: 1100px) {
  .cookie-btn { padding: 0 14px 0 11px; }
  .cookie-btn span { display: inline; }
  body.has-cookie-btn { padding-bottom: 0; }
}
.cookie-text { margin: 0; color: var(--muted); }
.cookie-row { display: flex; flex-wrap: wrap; gap: 8px; }
.cookie-confirm { display: flex; flex-direction: column; gap: 8px; }
.cookie-status { margin: 0; color: var(--good); }
.cookie-status:empty { display: none; }
