/* Layout: one-column phone game; HUD on top, question card, answer stack, lifelines at the bottom. */
:root {
  color-scheme: dark;
  --bg: #0e1118;
  --surface: #171b26;
  --surface2: #20263a;
  --line: #2d3449;
  --fg: #f3f1ea;
  --muted: #8f95ab;
  --accent: #ffb020;
  --accent-ink: #1d1400;
  --right: #2ed39a;
  --wrong: #ff5a5f;
  --ice: #7fd4ff;
  --display: "Bricolage Grotesque", ui-rounded, system-ui, sans-serif;
  --body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
:root.light {
  color-scheme: light;
  --bg: #f6f2e8;
  --surface: #ffffff;
  --surface2: #efe9da;
  --line: #ddd4bf;
  --fg: #1b1d24;
  --muted: #6b6f7d;
  --accent: #e08f00;
  --accent-ink: #ffffff;
  --right: #12a673;
  --wrong: #e03e44;
  --ice: #1f8fc7;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  overscroll-behavior: none;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#app {
  max-width: 520px;
  margin: 0 auto;
  height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) max(14px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 12px) max(14px, env(safe-area-inset-left));
}

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; padding: 10px 0 6px; }
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand h1 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 27px; letter-spacing: -0.5px; }
.brand h1::after { content: "."; color: var(--accent); }
.day-no { color: var(--muted); font-size: 13px; font-weight: 600; }
.top-right { display: flex; gap: 6px; }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 16px; }
.streak-pill { display: flex; align-items: center; gap: 4px; height: 38px; padding: 0 12px; border-radius: 19px; border: 1px solid var(--line); background: var(--surface); font-weight: 800; }
.streak-pill.hot { border-color: var(--accent); box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 35%, transparent); }
.streak-pill.hot .flame { animation: flicker 1.4s infinite ease-in-out; display: inline-block; }
@keyframes flicker { 50% { transform: scale(1.18) rotate(4deg); } }

.level-bar { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding-bottom: 10px; }
.lvl-name { color: var(--fg); font-weight: 700; white-space: nowrap; }
.xp-track { flex: 1; height: 7px; background: var(--surface2); border-radius: 4px; overflow: hidden; }
.xp-fill { height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width 1s cubic-bezier(.2,.9,.3,1.2); }
.xp-text { font-variant-numeric: tabular-nums; white-space: nowrap; }

.screen { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* Intro */
.intro { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 8px 0 20px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); }
.hero { font-family: var(--display); font-weight: 800; font-size: clamp(40px, 12vw, 58px); line-height: .95; letter-spacing: -1.5px; margin: 0; text-wrap: balance; }
.hero em { font-style: normal; color: var(--accent); }
.lede { margin: 0; color: var(--muted); line-height: 1.5; font-size: 15px; max-width: 40ch; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: var(--surface2); color: var(--fg); }
.target { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.target b { font-family: var(--display); font-size: 24px; font-variant-numeric: tabular-nums; }
.target span { color: var(--muted); font-size: 13px; }
.go {
  border: none; border-radius: 18px; padding: 18px; font-size: 18px; font-weight: 800;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 0 color-mix(in srgb, var(--accent) 55%, #000);
  transition: transform .08s, box-shadow .08s;
}
.go:active { transform: translateY(6px); box-shadow: 0 2px 0 color-mix(in srgb, var(--accent) 55%, #000); }
.fine { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 0; }

/* HUD */
.pips { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.pip { height: 6px; border-radius: 3px; background: var(--surface2); }
.pip.now { background: var(--fg); }
.pip.ok { background: var(--right); }
.pip.no { background: var(--wrong); }
.pip.final { outline: 1px solid var(--accent); outline-offset: 1px; }
.hud-row { display: flex; justify-content: space-between; align-items: center; margin: 10px 0; }
.score span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.score b { font-family: var(--display); font-size: 30px; font-variant-numeric: tabular-nums; line-height: 1; }
.combo { font-family: var(--display); font-weight: 800; font-size: 18px; padding: 6px 12px; border-radius: 12px; background: var(--surface2); color: var(--muted); transition: transform .2s; }
.combo.on { background: var(--accent); color: var(--accent-ink); }
.combo.bump { animation: bump .35s; }
@keyframes bump { 40% { transform: scale(1.25) rotate(-4deg); } }

.timer { position: relative; height: 34px; border-radius: 12px; background: var(--surface2); overflow: hidden; }
.timer-fill { position: absolute; inset: 0; background: var(--right); transform-origin: left; }
.timer.warn .timer-fill { background: var(--accent); }
.timer.danger .timer-fill { background: var(--wrong); }
.timer.frozen .timer-fill { background: var(--ice); }
.timer-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-variant-numeric: tabular-nums; color: #0e1118; mix-blend-mode: normal; }
.timer.danger { animation: pulse .5s infinite alternate; }
@keyframes pulse { to { transform: scale(1.02); } }

.q-card { padding: 18px 2px 14px; }
.q-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 12px; font-weight: 700; }
.cat { color: var(--accent); text-transform: uppercase; letter-spacing: 1px; }
.tier { padding: 2px 8px; border-radius: 6px; background: var(--surface2); color: var(--muted); }
.tier.hard { color: var(--wrong); }
.tier.medium { color: var(--accent); }
.tier.easy { color: var(--right); }
.worth { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.badge { padding: 2px 8px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); }
.q-text { font-family: var(--display); font-weight: 600; font-size: clamp(21px, 5.8vw, 27px); line-height: 1.2; margin: 0; text-wrap: balance; }

.options { display: flex; flex-direction: column; gap: 9px; }
.opt {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  padding: 14px 14px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface);
  font-size: 16px; font-weight: 600; transition: transform .08s, background .2s, border-color .2s, opacity .2s;
  animation: slideIn .3s backwards;
}
.opt:nth-child(2) { animation-delay: .04s; } .opt:nth-child(3) { animation-delay: .08s; } .opt:nth-child(4) { animation-delay: .12s; }
@keyframes slideIn { from { transform: translateY(10px); opacity: 0; } }
.opt:active:not(:disabled) { transform: scale(.98); }
.opt:disabled { cursor: default; }
.opt[data-removed] { opacity: .18; }
.letter { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface2); font-size: 13px; font-weight: 800; }
.opt.right { background: var(--right); border-color: var(--right); color: #08130e; }
.opt.right .letter, .opt.wrong .letter { background: #0002; }
.opt.wrong { background: var(--wrong); border-color: var(--wrong); color: #fff; animation: shake .4s; }
.opt.dim { opacity: .35; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.lifelines { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: auto; padding-top: 16px; }
.life { border: 1px dashed var(--line); background: transparent; border-radius: 14px; padding: 10px 4px; font-weight: 700; font-size: 14px; }
.life small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); }
.life:disabled { opacity: .3; cursor: default; }
.life.active { border-style: solid; border-color: var(--accent); color: var(--accent); opacity: 1; }

.float-pts { position: fixed; font-family: var(--display); font-weight: 800; font-size: 34px; pointer-events: none; z-index: 30; animation: floatUp 1s ease-out forwards; }
.float-pts.plus { color: var(--right); } .float-pts.minus { color: var(--wrong); }
@keyframes floatUp { from { transform: translate(-50%, 0) scale(.6); opacity: 0; } 20% { transform: translate(-50%, -10px) scale(1.15); opacity: 1; } to { transform: translate(-50%, -70px) scale(1); opacity: 0; } }

/* Wager */
.wager { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding-bottom: 20px; }
.wager h2 { font-family: var(--display); font-size: 34px; margin: 0; line-height: 1.05; }
.wager p { margin: 0; color: var(--muted); line-height: 1.5; }
.wager p b { color: var(--fg); }
.wager-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wager-opts button { padding: 16px 10px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); }
.wager-opts button b { display: block; font-family: var(--display); font-size: 22px; }
.wager-opts button span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.wager-opts button.allin { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }

/* Done */
.done { display: flex; flex-direction: column; gap: 14px; padding-bottom: 20px; overflow-y: auto; }
.rank { font-family: var(--display); font-weight: 800; font-size: 20px; color: var(--accent); }
.final-score { font-family: var(--display); font-weight: 800; font-size: clamp(56px, 18vw, 80px); line-height: .9; letter-spacing: -2px; font-variant-numeric: tabular-nums; }
.pts-label { color: var(--muted); font-weight: 600; margin-top: -8px; }
.badge-best { align-self: flex-start; padding: 6px 12px; border-radius: 10px; background: var(--right); color: #08130e; font-weight: 800; font-size: 14px; animation: bump .5s .6s backwards; }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.summary div { padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.summary b { display: block; font-family: var(--display); font-size: 22px; font-variant-numeric: tabular-nums; }
.summary span { color: var(--muted); font-size: 12px; }
.compare { color: var(--muted); font-size: 14px; margin: 0; }
.compare b { color: var(--fg); }
.next-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.next span { display: block; font-size: 12px; color: var(--muted); }
.next b { font-family: var(--display); font-size: 28px; font-variant-numeric: tabular-nums; }
.share-btn { border: none; border-radius: 16px; padding: 14px 20px; font-weight: 800; font-size: 16px; background: var(--accent); color: var(--accent-ink); }
.review summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.review ol { margin: 8px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.review li { line-height: 1.4; font-size: 14px; }
.review .ans { display: block; font-weight: 700; }
.review .ok { color: var(--right); } .review .no { color: var(--wrong); }

/* Toasts & modals */
.toasts { position: fixed; top: calc(env(safe-area-inset-top) + 86px); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 50; }
.toast { background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 15px; animation: toastIn .2s; max-width: 90vw; text-align: center; }
.toast.out { opacity: 0; transition: opacity .3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }
.modal { position: fixed; inset: 0; background: #000a; display: flex; align-items: flex-end; justify-content: center; z-index: 40; animation: fade .2s; }
.modal[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: relative; width: 100%; max-width: 520px; max-height: 90dvh; overflow: auto; background: var(--surface); border-radius: 22px 22px 0 0; padding: 22px 20px calc(24px + env(safe-area-inset-bottom)); animation: up .3s cubic-bezier(.2,.9,.3,1); }
@media (min-width: 600px) { .modal { align-items: center; } .sheet { border-radius: 22px; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet h2 { font-family: var(--display); margin: 0 0 12px; }
.sheet h3 { margin: 18px 0 8px; font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.sheet p { line-height: 1.5; }
.close { position: absolute; top: 10px; right: 12px; border: none; background: none; font-size: 28px; color: var(--muted); }
.rules { padding-left: 18px; display: flex; flex-direction: column; gap: 10px; line-height: 1.45; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; }
.stat-row b { display: block; font-family: var(--display); font-size: 26px; font-variant-numeric: tabular-nums; }
.stat-row span { font-size: 12px; color: var(--muted); }
.shield-row { text-align: center; color: var(--muted); font-size: 13px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 120px; }
.bar { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; font-size: 11px; color: var(--muted); }
.bar i { display: block; width: 100%; border-radius: 6px 6px 2px 2px; background: var(--surface2); min-height: 4px; }
.bar.today i { background: var(--accent); }
.bar.played i { background: var(--right); }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.setting span { display: block; color: var(--muted); font-size: 13px; }
.setting input { width: 22px; height: 22px; accent-color: var(--accent); }

.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

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

/* Unlimited / paywall */
.day-no.pro { color: var(--accent); }
.upsell {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left; width: 100%;
  padding: 14px 16px; border-radius: 16px; border: 2px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}
.upsell span { color: var(--muted); font-size: 13px; }
.upsell b { font-size: 16px; color: var(--accent); }
.more-row { display: flex; flex-direction: column; gap: 10px; }
.ghost { border: 1px solid var(--line); background: transparent; border-radius: 14px; padding: 12px; font-weight: 700; }
.pay { display: flex; flex-direction: column; gap: 12px; }
.pay h2 { font-size: 30px; margin: 0; }
.perks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.perks li { display: flex; gap: 12px; align-items: center; line-height: 1.4; }
.perks b { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface2); color: var(--accent); }
.pay-btn { display: block; text-align: center; text-decoration: none; }
.center { text-align: center; }
.premium-box { display: flex; flex-direction: column; gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.premium-box span { color: var(--muted); font-size: 13px; }
.code-row { margin-top: 6px; }
.code-inner { display: flex; gap: 8px; }
.code-inner[hidden] { display: none; }
.code-inner input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; text-transform: uppercase; }
.code-inner button { border: none; border-radius: 10px; padding: 0 16px; font-weight: 700; background: var(--accent); color: var(--accent-ink); }

/* Unlimited hub, topics, badges, flags */
.ghost { color: var(--fg); }
.hub { display: flex; flex-direction: column; gap: 14px; padding: 8px 0 24px; }
.hub-title { font-family: var(--display); font-weight: 800; font-size: clamp(32px, 9vw, 44px); line-height: 1; margin: 0; letter-spacing: -1px; text-wrap: balance; }
.modes { display: flex; flex-direction: column; gap: 10px; }
.mode {
  display: flex; gap: 14px; align-items: flex-start; text-align: left; width: 100%;
  padding: 16px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface);
  transition: transform .08s, border-color .2s;
}
.mode:active { transform: scale(.98); }
.mode:hover { border-color: var(--accent); }
.mode-ico { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--surface2); }
.mode div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mode b { font-size: 17px; display: flex; align-items: center; gap: 8px; }
.mode span { color: var(--muted); font-size: 14px; line-height: 1.4; }
.mode em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--accent); }
.mode .lock { font-size: 13px; }
.free { font-size: 11px !important; font-weight: 800; color: var(--accent-ink) !important; background: var(--right); padding: 2px 8px; border-radius: 999px; }
.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cat-btn { text-align: left; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
.cat-btn b { font-size: 15px; }
.cat-btn span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.cat-btn:active { transform: scale(.97); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.q-flag { font-size: clamp(72px, 26vw, 110px); line-height: 1.1; text-align: center; margin: 4px 0 8px; }
.lives { display: flex; align-items: center; gap: 4px; font-size: 20px; }
.lives span { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--muted); }
.tier.t0 { color: var(--right); } .tier.t1 { color: var(--accent); } .tier.t2 { color: var(--wrong); }
.new-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nb-label { width: 100%; font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--accent); }
.nb { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border: 1px solid var(--accent); animation: bump .5s .8s backwards; }
.stat-row.small b { font-size: 20px; }
.badge-count { color: var(--fg); letter-spacing: 0; text-transform: none; font-weight: 600; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.bdg { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 10px 6px; border-radius: 14px; background: var(--surface2); opacity: .55; }
.bdg.on { opacity: 1; background: color-mix(in srgb, var(--accent) 16%, var(--surface2)); }
.bdg span { font-size: 26px; }
.bdg b { font-size: 12px; }
.bdg small { font-size: 10.5px; color: var(--muted); line-height: 1.3; }
.review .rq { display: block; }
.report { margin-top: 4px; border: none; background: none; padding: 0; font-size: 12px; color: var(--muted); text-decoration: underline; }
.report:disabled { text-decoration: none; opacity: .7; }
.small-btn { border: 1px solid var(--line); background: var(--surface2); border-radius: 10px; padding: 8px 12px; font-weight: 700; font-size: 13px; }
.credits { margin-top: 12px; }
.credits a { color: var(--muted); }

/* Rankings */
.wide-btn { width: 100%; margin: 14px 0 6px; }
.links a { color: var(--muted); }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface2); }
.tab { border: none; background: none; border-radius: 10px; padding: 9px 4px; font-weight: 700; font-size: 13px; color: var(--muted); }
.tab.on { background: var(--surface); color: var(--fg); box-shadow: 0 1px 0 var(--line); }
.board-body { display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.board-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.board-list li, .board-me { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.board-list li.top { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.board-list li.me, .board-me { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.board-me { position: sticky; bottom: 8px; box-shadow: 0 6px 20px #0006; }
.br { flex: none; width: 34px; text-align: center; font-family: var(--display); font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.bn { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bn b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bn small { color: var(--muted); font-size: 12px; }
.bv { font-family: var(--display); font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank-card { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.rank-big { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rank-big b { font-family: var(--display); font-size: 40px; line-height: 1; color: var(--accent); }
.rank-big span { color: var(--muted); font-weight: 600; }
.podium { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.podium li { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.podium li.me b { color: var(--accent); }
.podium b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium em { font-style: normal; font-weight: 800; font-variant-numeric: tabular-nums; }
.name-form { display: flex; flex-direction: column; gap: 10px; }
.name-form input { padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; font-size: 18px; }
.form-error { color: var(--wrong); margin: 0; min-height: 1.2em; font-size: 14px; }
.opt.pending { border-color: var(--accent); animation: pulse .6s infinite alternate; }

/* Privacy, terms and 404 pages */
.doc-page { min-height: 100%; }
.doc { max-width: 680px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 28px) max(18px, env(safe-area-inset-right)) 48px max(18px, env(safe-area-inset-left)); line-height: 1.6; }
.doc h1 { font-family: var(--display); font-size: clamp(32px, 8vw, 44px); line-height: 1.05; margin: 18px 0 6px; letter-spacing: -1px; }
.doc h2 { font-family: var(--display); font-size: 20px; margin: 26px 0 4px; }
.doc p { margin: 8px 0; max-width: 62ch; }
.doc a { color: var(--accent); }
.doc-brand { font-family: var(--display); font-weight: 800; font-size: 24px; color: var(--fg) !important; text-decoration: none; }
.doc-brand::after { content: "."; color: var(--accent); }
.doc-go { display: inline-block; text-decoration: none; color: var(--accent-ink) !important; margin-top: 10px; padding: 16px 24px; }
.contact { color: var(--muted); }

/* Header: keep "TenFold" plus the mode label and buttons inside narrow phones */
.top { gap: 8px; }
.brand { min-width: 0; flex: 1 1 auto; }
.brand h1 { white-space: nowrap; }
.day-no { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 400px) {
  .brand { gap: 6px; }
  .brand h1 { font-size: 23px; }
  .day-no { font-size: 12px; }
  .top-right { gap: 5px; }
  .icon-btn { width: 36px; height: 36px; }
  .streak-pill { height: 36px; padding: 0 10px; }
}
