@font-face { font-family: 'Bravura'; src: url('fonts/Bravura.woff2') format('woff2'); font-display: block; }

:root {
  --bg: #0b0c0f; --bg2: #111318; --panel: #16191f; --panel2: #1c2027; --line: #272b34; --line2: #333845;
  --text: #efeae0; --muted: #9a9fab; --faint: #646a77;
  --paper: #f6f1e7; --paper2: #ece5d6; --paper3: #e2d9c6; --ink: #1b1a1f; --ink-soft: #77716a;
  --accent: #ff6a3d; --accent-ink: #d9481d; --ok: #12935e; --ok-bright: #2fd18a; --bad: #e0464c; --hint: #2d6be6; --late: #c98a12;
  --r: 18px; --r-sm: 12px;
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', monospace;
  --serif: 'Instrument Serif', ui-serif, Georgia, serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(255, 106, 61, .10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(45, 107, 230, .08), transparent 60%),
    var(--bg);
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#app { display: grid; grid-template-rows: auto 1fr auto; height: 100dvh; max-width: 1400px; margin: 0 auto; padding: env(safe-area-inset-top, 0) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }

/* ---- Top bar ---- */
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 0 10px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 27px; letter-spacing: -.01em; color: var(--text); padding: 0; }
.brand svg { width: 34px; height: 23px; color: var(--muted); }
.brand i { font-style: italic; color: var(--accent); }
.nav { display: flex; gap: 2px; margin-left: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.navbtn { padding: 7px 14px; border-radius: 999px; font-size: 14px; color: var(--muted); font-weight: 500; }
.navbtn.on { background: var(--panel2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line2); }
.pill { margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: 13.5px; color: var(--text); white-space: nowrap; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
.pill span { overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.pill.live .dot { background: var(--ok-bright); box-shadow: 0 0 0 4px rgba(47, 209, 138, .15); }
.pill.mic .dot { background: var(--accent); box-shadow: 0 0 0 calc(2px + var(--lvl, 0) * 10px) rgba(255, 106, 61, .18); }
.playing .nav, .playing .pill { opacity: .35; pointer-events: none; }

#screen { min-height: 0; overflow-y: auto; overflow-x: hidden; padding-bottom: 24px; -webkit-overflow-scrolling: touch; }
.playing #screen { overflow: hidden; padding-bottom: 8px; }

/* ---- Home ---- */
.hero { display: grid; grid-template-columns: 1.25fr 1fr; gap: 28px; align-items: end; padding: 26px 0 26px; }
.hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(42px, 6.2vw, 78px); line-height: .95; letter-spacing: -.02em; margin: 0 0 16px; }
.hero h1 em { color: var(--accent); }
.hero p { color: var(--muted); font-size: 16.5px; line-height: 1.55; margin: 0; max-width: 54ch; }
.statstrip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.stat { background: var(--panel); padding: 14px 16px; }
.stat b { display: block; font-family: var(--mono); font-weight: 500; font-size: 26px; letter-spacing: -.02em; }
.stat b small { font-size: 13px; color: var(--muted); margin-left: 4px; font-weight: 400; letter-spacing: 0; }
.stat span { font-size: 12.5px; color: var(--muted); }
.daily { display: flex; align-items: center; gap: 18px; padding: 18px 20px; border-radius: var(--r); background: linear-gradient(120deg, #2a160f, #1a1215 55%, #15161c); border: 1px solid #4a2a1f; margin-bottom: 26px; }
.daily h2 { font-family: var(--serif); font-weight: 400; font-size: 28px; margin: 0; letter-spacing: -.01em; }
.daily p { margin: 4px 0 0; color: #c9b8ad; font-size: 14px; }
.daily .steps-row { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.daily .steps-row span { font-size: 12px; padding: 4px 9px; border-radius: 999px; background: rgba(255, 255, 255, .06); color: #e6d6cb; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 20px; border-radius: 999px; font-weight: 600; font-size: 15px; background: var(--panel2); border: 1px solid var(--line2); color: var(--text); white-space: nowrap; transition: transform .12s ease, background .15s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1a0d07; }
.btn.primary:hover { background: #ff7c53; }
.btn.ghost { background: transparent; }
.daily .btn { margin-left: auto; }

.section-h { display: flex; align-items: baseline; justify-content: space-between; margin: 6px 0 12px; }
.section-h h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; margin: 0; }
.section-h span { font-size: 13px; color: var(--faint); }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.mode { text-align: left; display: flex; flex-direction: column; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); overflow: hidden; transition: border-color .15s, transform .15s; }
.mode:hover { border-color: var(--line2); transform: translateY(-2px); }
.mode .art { height: 124px; position: relative; align-self: stretch; width: 100%; }
.mode .body { align-self: stretch; width: 100%; }
.mode .art svg.staff { position: absolute; left: 12px; top: 6px; width: calc(100% - 24px); height: calc(100% - 12px); }
.mode .tag { position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 600; letter-spacing: .04em; padding: 3px 8px; border-radius: 999px; background: var(--ink); color: var(--paper); }
.mode .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.mode h4 { margin: 0; font-family: var(--serif); font-size: 26px; font-weight: 400; letter-spacing: -.01em; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.mode h4 small { font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: 0; }
.mode .line { color: var(--text); font-size: 14.5px; line-height: 1.4; }
.mode .why { color: var(--faint); font-size: 12.5px; line-height: 1.45; margin-top: auto; padding-top: 6px; }

.method { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 22px; display: grid; grid-template-columns: 220px 1fr; gap: 24px; }
.method h3 { font-family: var(--serif); font-weight: 400; font-size: 30px; margin: 0; line-height: 1.05; }
.method ol { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 28px; }
.method li { font-size: 14px; color: var(--muted); line-height: 1.5; }
.method li b { color: var(--text); font-weight: 600; display: block; margin-bottom: 2px; }
.method li cite { font-style: normal; color: var(--faint); font-size: 12.5px; }

/* ---- Setup ---- */
.setup { max-width: 760px; margin: 0 auto; padding: 22px 0; }
.setup .back { color: var(--muted); font-size: 14px; padding: 6px 0; }
.setup h2 { font-family: var(--serif); font-size: 52px; font-weight: 400; margin: 8px 0 6px; letter-spacing: -.02em; }
.setup .lede { color: var(--muted); font-size: 16px; line-height: 1.55; margin: 0 0 22px; max-width: 62ch; }
.fields { display: grid; gap: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.field { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 14px; }
.field > label { font-size: 14px; color: var(--muted); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { padding: 8px 13px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.range { display: flex; align-items: center; gap: 14px; }
.range input { flex: 1; accent-color: var(--accent); }
.range output { font-family: var(--mono); font-size: 18px; min-width: 88px; text-align: right; }
.go { display: flex; align-items: center; gap: 16px; margin-top: 20px; flex-wrap: wrap; }
.go .hintline { color: var(--faint); font-size: 13.5px; }
.go .hintline kbd, .kbdhint kbd { font-family: var(--mono); font-size: 12px; background: var(--panel2); border: 1px solid var(--line2); border-radius: 6px; padding: 1px 6px; color: var(--text); }

/* ---- Play ---- */
.play { height: 100%; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.hud { display: flex; align-items: center; gap: 14px; }
.icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-size: 16px; flex: none; }
.hud-title b { font-family: var(--serif); font-weight: 400; font-size: 26px; letter-spacing: -.01em; }
.hud-title span { color: var(--faint); font-size: 13px; margin-left: 10px; }
.hud-stats { margin-left: auto; display: flex; align-items: baseline; gap: 18px; font-family: var(--mono); }
.hud-stats .combo { color: var(--accent); font-size: 18px; font-weight: 600; }
.hud-stats .score { font-size: 22px; }
.hud-stats .time { font-size: 22px; color: var(--muted); min-width: 64px; text-align: right; }
.progress { height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--muted); transition: width .25s linear; }
.card { position: relative; flex: 1; min-height: 180px; border-radius: var(--r); overflow: hidden; }
.paper {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.3 0 0 0 0 0.2 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #f9f5ec, var(--paper));
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 30px 60px -30px rgba(0, 0, 0, .7);
}
.stage { position: absolute; inset: 8px 12px 14px; display: grid; place-items: center; }
.stage svg.staff { width: 100%; height: 100%; }
.clock { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: rgba(27, 26, 31, .06); }
.clock i { display: block; height: 100%; width: 100%; background: var(--ink); transform-origin: left; transform: scaleX(0); }
.clock i.run { animation: clock var(--ms, 3000ms) linear forwards; }
.clock i.preview { background: var(--hint); }
.clock i.stop-ok { animation-play-state: paused; background: var(--ok); }
.clock i.stop-bad { animation-play-state: paused; background: var(--bad); }
@keyframes clock { 0% { transform: scaleX(1); background: var(--ink); } 65% { background: var(--ink); } 100% { transform: scaleX(0); background: var(--accent); } }
.clock i.preview.run { animation-name: clockp; }
@keyframes clockp { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.banner { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .12s; }
.banner.on { opacity: 1; }
.banner > div { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 26px; border-radius: 16px; background: rgba(246, 241, 231, .94); box-shadow: 0 12px 40px -12px rgba(0, 0, 0, .35); animation: rise .18s ease-out; }
.banner .count { font-family: var(--serif); font-size: 96px; line-height: 1; padding: 6px 30px; background: transparent; box-shadow: none; color: var(--accent-ink); }
.banner .clef-intro b { font-family: var(--serif); font-weight: 400; font-size: 34px; }
.banner .clef-intro span { font-size: 14px; color: var(--ink-soft); }
.banner .intro-staff { width: 200px; height: 90px; }
.banner .unlock small { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ok); }
.banner .unlock b { font-family: var(--serif); font-weight: 400; font-size: 38px; }
.banner .unlock span { color: var(--ink-soft); font-size: 14px; }
@keyframes rise { from { transform: translateY(8px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.say { min-height: 26px; text-align: center; font-size: 17px; color: var(--muted); font-weight: 500; }
.say.ok { color: var(--ok-bright); }
.say.bad { color: #ff8a8e; }
.say.info { color: var(--muted); }
.say.anim { animation: sayin .16s ease-out; }
@keyframes sayin { from { transform: translateY(4px); opacity: .2; } to { transform: none; opacity: 1; } }

/* ---- SVG notation ---- */
svg.staff { color: var(--ink); overflow: visible; }
.staff-line { stroke: var(--ink); stroke-width: 1.3; }
.ledger { stroke: currentColor; stroke-width: 1.6; }
.bar-line { stroke: var(--ink); stroke-width: 1.6; }
.bar-line.final { stroke-width: 4; }
.glyph { fill: currentColor; font-family: 'Bravura'; }
.stem { stroke: currentColor; stroke-width: 1.25; }
.beam { fill: currentColor; }
.note { transition: color .12s; }
.note.ok { color: var(--ok); }
.note.bad { color: var(--bad); }
.note.late { color: var(--late); }
.note.ghost { color: var(--bad); opacity: .42; }
.note.given { color: var(--hint); }
.note.prev { color: #a39c8f; }
.note.pop { animation: pop .17s cubic-bezier(.2, .9, .3, 1.4); transform-box: fill-box; transform-origin: center; }
.note.flash { animation: shake .28s; transform-box: fill-box; }
@keyframes pop { from { transform: scale(.72); opacity: .15; } to { transform: none; opacity: 1; } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-3px); color: var(--bad); } 75% { transform: translateX(3px); color: var(--bad); } }
.note-label { font-family: var(--sans); font-size: 15px; font-weight: 600; fill: currentColor; }
.playzone { fill: rgba(255, 106, 61, .10); }
.playline { stroke: var(--accent); stroke-width: 2.2; }
.veil { fill: var(--paper3); stroke: #cbbfa7; stroke-width: 1.2; stroke-dasharray: 4 4; opacity: 0; transition: opacity .14s; }
.veil.on { opacity: 1; }
.cursor { fill: var(--accent); }
.arc { fill: none; stroke: #b3aa98; stroke-width: 1.3; stroke-dasharray: 3 4; }
.steps circle { fill: var(--hint); opacity: .7; animation: pop .2s ease-out both; transform-box: fill-box; transform-origin: center; }
.clef.swap { animation: pop .3s ease-out; transform-box: fill-box; transform-origin: center; }
.heat-0 { color: #c9c1b1; }
.heat-1 { color: #12935e; }
.heat-2 { color: #6aa632; }
.heat-3 { color: #d39a14; }
.heat-4 { color: #e2672b; }
.heat-5 { color: #d8343b; }

/* ---- Dock & keyboard ---- */
.dock { padding: 8px 0 calc(10px + var(--safe-b)); }
.dock-meta { display: flex; align-items: center; justify-content: space-between; color: var(--faint); font-size: 12.5px; margin-bottom: 6px; min-height: 22px; }
.mini { font-size: 12.5px; color: var(--muted); padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); }
.kbd { position: relative; height: clamp(84px, 15vh, 140px); user-select: none; -webkit-user-select: none; touch-action: none; }
.dock.compact .kbd { height: 56px; }
.dock.hidden-keys .kbd { display: none; }
.key { position: absolute; top: 0; border-radius: 0 0 6px 6px; transition: background .06s; }
.key.white { bottom: 0; background: linear-gradient(180deg, #e9e4da, #fbf8f2 18%); border: 1px solid #0b0c0f; border-top: 0; z-index: 1; }
.key.black { height: 62%; background: linear-gradient(180deg, #23252b, #0d0e11); z-index: 2; border-radius: 0 0 4px 4px; box-shadow: inset 0 -3px 0 rgba(255, 255, 255, .08); }
.key span { position: absolute; bottom: 6px; left: 0; right: 0; text-align: center; font-size: 10.5px; color: #8a8478; font-weight: 600; pointer-events: none; }
.key.down.white { background: #d9d2c4; }
.key.down.black { background: #3a3d45; }
.key.ok.white { background: #9fe8c4; } .key.ok.black { background: #12935e; }
.key.bad.white { background: #ffb3b5; } .key.bad.black { background: #b52f35; }
.key.hint.white { background: #b8ceff; box-shadow: inset 0 -6px 0 var(--hint); } .key.hint.black { background: var(--hint); }

/* ---- Results ---- */
.results { max-width: 900px; margin: 0 auto; padding: 22px 0; display: grid; gap: 18px; }
.results .kicker { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; }
.bigline { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.bigline b { font-family: var(--serif); font-weight: 400; font-size: clamp(80px, 13vw, 140px); line-height: .9; letter-spacing: -.03em; }
.bigline span { font-size: 22px; color: var(--muted); }
.results .sub { color: var(--muted); margin-top: -6px; }
.results .msg { font-size: 18px; line-height: 1.5; padding: 14px 18px; border-left: 3px solid var(--accent); background: var(--panel); border-radius: 0 12px 12px 0; }
.rstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.rstats div { background: var(--panel); padding: 14px 16px; }
.rstats b { display: block; font-family: var(--mono); font-size: 22px; font-weight: 500; }
.rstats span { font-size: 12.5px; color: var(--muted); }
.work { border-radius: var(--r); padding: 12px 16px 4px; }
.work h4 { margin: 0; font-size: 13px; color: var(--ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: .1em; }
.work svg.staff { width: 100%; max-height: 190px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions .hintline { color: var(--faint); font-size: 13px; margin-left: 6px; }

/* ---- Progress ---- */
.page { max-width: 1000px; margin: 0 auto; padding: 22px 0; display: grid; gap: 22px; }
.page h2 { font-family: var(--serif); font-size: 52px; font-weight: 400; margin: 0; letter-spacing: -.02em; }
.page .lede { color: var(--muted); margin: -12px 0 0; line-height: 1.5; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.heat { border-radius: var(--r); padding: 14px 16px; }
.heat h4 { margin: 0 0 4px; font-size: 13px; color: var(--ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: .1em; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.legend { display: flex; gap: 12px; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 12px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; background: currentColor; vertical-align: -1px; }
.heat svg.staff { width: 100%; }
.heat p { margin: 4px 0 6px; color: var(--ink-soft); font-size: 14px; }
.history { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.history div { background: var(--panel); display: grid; grid-template-columns: 110px 130px 1fr auto; gap: 12px; padding: 11px 16px; font-size: 14px; align-items: center; }
.history .when { color: var(--faint); font-size: 13px; }
.history .res { font-family: var(--mono); color: var(--muted); text-align: right; }
.empty { color: var(--muted); padding: 22px; border: 1px dashed var(--line2); border-radius: var(--r); text-align: center; }

/* ---- Settings & sheet ---- */
.group { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.row { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .txt { flex: 1; }
.row .txt b { display: block; font-weight: 600; font-size: 15px; }
.row .txt span { color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.switch { width: 46px; height: 28px; border-radius: 999px; background: var(--line2); position: relative; flex: none; transition: background .15s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--text); transition: transform .15s; }
.switch.on { background: var(--ok); }
.switch.on::after { transform: translateX(18px); }
.state { font-size: 13px; color: var(--muted); white-space: nowrap; }
.state.live { color: var(--ok-bright); }
.danger { color: #ff8a8e; border-color: #4a2427; }
.sheet { position: fixed; inset: 0; background: rgba(5, 6, 8, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 20; padding: 16px; }
.sheet[hidden] { display: none; }
.sheet .panel { width: min(620px, 100%); max-height: 90dvh; overflow: auto; background: var(--bg2); border: 1px solid var(--line2); border-radius: 22px; padding: 22px; animation: rise .18s ease-out; }
.sheet h3 { font-family: var(--serif); font-weight: 400; font-size: 34px; margin: 0 0 6px; }
.sheet .lede { color: var(--muted); margin: 0 0 16px; line-height: 1.5; font-size: 14.5px; }
.sheet .close { float: right; }
.note-ipad { margin-top: 14px; font-size: 13.5px; color: var(--muted); line-height: 1.55; background: var(--panel); border-radius: 12px; padding: 12px 14px; border: 1px solid var(--line); }
.note-ipad b { color: var(--text); }
.toast { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; z-index: 30; animation: rise .18s ease-out; }

/* ---- Responsive ---- */
@media (max-width: 980px) {
  .modes { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; }
  .method { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav { display: none; }
  .brand { font-size: 23px; }
  .pill { max-width: 52vw; }
  .modes { grid-template-columns: 1fr; }
  .method ol { grid-template-columns: 1fr; }
  .daily { flex-direction: column; align-items: flex-start; }
  .daily .btn { margin-left: 0; width: 100%; }
  .field { grid-template-columns: 1fr; gap: 8px; }
  .rstats { grid-template-columns: repeat(2, 1fr); }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .history div { grid-template-columns: 1fr auto; }
  .history .when, .history .mname { grid-column: 1 / -1; }
  .hud-title span { display: none; }
  .hud-stats { gap: 12px; }
  .setup h2, .page h2 { font-size: 40px; }
  .mobile-nav { display: flex !important; }
}
.mobile-nav { display: none; gap: 8px; margin: 18px 0 0; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
