:root {
  --bg: #1a1915;
  --text: #f0eee6;
  --soft: #cbc6b8;
  --muted: #948e80;
  --line: rgba(240, 238, 230, 0.1);
  --line-2: rgba(240, 238, 230, 0.18);
  --accent: #d97757;
  --tide: #8fbbe3;
  --danger: #e5534b;
  --gold: #e8c170;
  --heart: #e0708a;
  --good: #a5cc86;
  --bug: #8fb86c;
  /* ink for things drawn on the sky; the scene swaps it per biome */
  --ink: #3b2a1f;
  --ink-soft: rgba(59, 42, 31, 0.62);
  --ground: 60vh;
  --vh: 100vh;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --fs-type: clamp(18px, 1.5vw + 8px, 28px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  height: var(--vh);
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
kbd {
  font-family: var(--mono);
  font-size: 0.8em;
  padding: 0 5px;
  border: 1px solid currentColor;
  border-radius: 4px;
  opacity: 0.8;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- world ---------- */
.scene { position: fixed; inset: 0; width: 100%; height: var(--vh); display: block; image-rendering: pixelated; background: #ebd3b3; }
.vignette { position: fixed; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 rgba(229, 83, 75, 0); transition: box-shadow 0.4s; z-index: 1; }
body.danger .vignette { box-shadow: inset 0 0 140px rgba(229, 83, 75, 0.55); animation: pulse 0.9s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: inset 0 0 90px rgba(229, 83, 75, 0.35); } }

/* ---------- chrome ---------- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: max(14px, env(safe-area-inset-top)) 22px 0;
  color: var(--ink);
  transition: opacity 0.6s, color 0.8s;
}
body.playing .chrome { opacity: 0.12; }
body.playing .chrome:hover, body.playing .chrome:focus-within { opacity: 1; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-family: var(--serif); font-size: 26px; line-height: 1; justify-self: start; }
.brand-mark { display: block; width: 28px; height: 21px; }
.brand-mark svg, .how-ico[data-sprite] svg { width: 100%; height: 100%; display: block; }
.modes { display: flex; align-items: center; gap: 2px; }
.mode { border: 0; background: transparent; color: var(--ink-soft); padding: 6px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 500; transition: color 0.2s; }
.mode:hover { color: var(--ink); }
.mode[aria-selected="true"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-soft); margin: 0 6px; }
.icons { display: flex; gap: 2px; justify-self: end; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border: 0; background: transparent; border-radius: 9px; color: inherit; opacity: 0.75; transition: opacity 0.15s, background 0.15s; }
.icon-btn:hover { opacity: 1; background: rgba(127, 127, 127, 0.12); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .spk { fill: currentColor; }
.icon-btn[aria-pressed="true"] .off, .icon-btn[aria-pressed="false"] .on { display: none; }

.credit {
  position: fixed; z-index: 5; right: 18px; bottom: max(12px, env(safe-area-inset-bottom));
  margin: 0; font-size: 11.5px; color: rgba(240, 238, 230, 0.38);
  transition: opacity 0.6s;
}
.credit a { color: rgba(240, 238, 230, 0.62); text-decoration: none; border-bottom: 1px solid rgba(240, 238, 230, 0.2); }
.credit a:hover { color: var(--accent); border-color: var(--accent); }
body.done-state .credit { opacity: 0.35; }

/* ---------- HUD (lives on the sky) ---------- */
.play { position: relative; z-index: 2; }
.hud {
  position: fixed; z-index: 3;
  top: clamp(60px, 11vh, 96px); left: 50%; transform: translateX(-50%);
  width: min(1000px, calc(100vw - 44px));
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  color: var(--ink);
  transition: color 0.8s, opacity 0.3s;
  pointer-events: none;
}
.play[data-mode="sprint"] [data-show="chase"], .play[data-mode="chase"] [data-show="sprint"] { display: none !important; }
.hearts { display: flex; gap: 6px; }
.play[data-mode="sprint"] .hearts { visibility: hidden; }
.heart-ico { width: 20px; height: 18px; transition: transform 0.3s, opacity 0.3s; }
.heart-ico .heart-fg { fill: var(--heart); }
.heart-ico .heart-bg { fill: var(--ink-soft); opacity: 0.3; }
.heart-ico.lost { transform: scale(0.88); }
.heart-ico.pop { animation: heartpop 0.5s ease-out; }
@keyframes heartpop { 30% { transform: scale(1.5); } }
.hud-main { font-family: var(--serif); font-size: clamp(36px, 4vw, 52px); line-height: 1; font-variant-numeric: tabular-nums; text-align: center; min-width: 4ch; }
.hud-score.bump { animation: bump 0.25s ease-out; }
@keyframes bump { 40% { transform: translateY(-2px) scale(1.04); } }
.hud-side { display: flex; align-items: center; justify-content: flex-end; gap: 16px; font-size: 13px; color: var(--ink-soft); transition: color 0.8s; }
.hud-side b { font-family: var(--mono); font-weight: 500; font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; transition: color 0.8s; }
.mult { position: relative; width: 36px; height: 36px; display: grid; place-items: center; }
.mult svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.mult circle { fill: none; stroke-width: 3; }
.ring-bg { stroke: var(--ink-soft); opacity: 0.35; }
.ring { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 94.25; stroke-dashoffset: 94.25; transition: stroke-dashoffset 0.12s linear; }
#mult { font-family: var(--mono); font-weight: 700; font-size: 12px; color: var(--ink); }
.mult.hot .ring { stroke: var(--gold); }
.mult.flash { animation: bump 0.4s ease-out; }
body:not(.playing) .hud { opacity: 0.85; }

.banner {
  position: fixed; z-index: 4; left: 50%; top: calc(var(--ground) * 0.38);
  transform: translate(-50%, 0);
  padding: 8px 16px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  background: rgba(26, 25, 21, 0.72); color: var(--text);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none; white-space: nowrap;
}
.banner.show { animation: banner 1.9s ease-out forwards; }
.banner.tide { color: #b9d4ee; }
.banner.bad { color: #ff9a92; }
.banner.gold { color: var(--gold); }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, 8px); } 12%, 75% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -6px); } }

/* ---------- words, set into the ground ---------- */
.stage {
  position: fixed; z-index: 3;
  top: calc(var(--ground) + clamp(22px, 4vh, 40px));
  left: 50%; transform: translateX(-50%);
  width: min(1000px, calc(100vw - 44px));
  cursor: text;
  -webkit-tap-highlight-color: transparent;
}
.stage.shake { animation: shake 0.28s ease-out; }
@keyframes shake { 20% { transform: translateX(calc(-50% - 3px)); } 45% { transform: translateX(calc(-50% + 3px)); } 70% { transform: translateX(calc(-50% - 1px)); } }
.text-window {
  --lh: 1.7em;
  position: relative;
  height: calc(var(--lh) * 3);
  overflow: hidden;
  font-family: var(--mono);
  font-size: var(--fs-type);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 86%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 86%, transparent 100%);
  transition: opacity 0.3s;
}
.stage.paused .text-window { opacity: 0.35; }
.text {
  position: relative;
  line-height: var(--lh);
  color: rgba(240, 238, 230, 0.5);
  transition: transform 0.22s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: transform;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}
.w { display: inline-block; white-space: pre; }
.c { transition: color 0.08s; }
.c.ok { color: #fbf8f1; }
.c.miss { color: #fff; background: var(--danger); border-radius: 3px; animation: miss 0.3s ease-out forwards; }
@keyframes miss { to { background: rgba(229, 83, 75, 0); color: #ff8f86; } }
.w.bad .c.ok { color: #f3b8ae; }
.c.fl, .c.fl.ok { color: #a9cdef; }
.w.gold { color: var(--gold); }
.w.gold .c.ok { color: #fbe7b4; }
.w.heart { color: #f18fa6; }
.w.heart .c.ok { color: #ffd6df; }
.w.won { animation: won 0.6s ease-out; }
@keyframes won { 30% { transform: translateY(-5px) scale(1.06); } }

.caret {
  position: absolute; top: 0; left: 0;
  width: 2.5px; height: 1.15em; margin-top: 0.275em;
  background: #ffb08f; border-radius: 2px;
  box-shadow: 0 0 10px rgba(217, 119, 87, 0.9);
  transition: transform 0.085s cubic-bezier(0.3, 0.7, 0.3, 1);
  will-change: transform;
  pointer-events: none;
}
.caret.idle { animation: blink 1.05s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.wavefront { display: none; }

.overlay { display: flex; justify-content: center; margin-top: 14px; transition: opacity 0.25s; pointer-events: none; }
.overlay span { padding: 7px 16px; border-radius: 999px; background: rgba(26, 25, 21, 0.55); color: var(--soft); font-size: 13px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.overlay.hide { opacity: 0; }
.stage.paused .overlay span { color: var(--text); background: rgba(26, 25, 21, 0.8); }

.kbd {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: 0; padding: 0; margin: 0;
  font-size: 16px; color: transparent; background: transparent; caret-color: transparent;
  cursor: text;
}
.hints { display: flex; justify-content: center; gap: 20px; margin: 10px 0 0; color: rgba(240, 238, 230, 0.4); font-size: 12px; transition: opacity 0.4s; }
body.playing .hints { opacity: 0; }

.popups { position: absolute; inset: 0; pointer-events: none; }
.pop {
  position: absolute; left: 0; top: 0;
  font-family: var(--mono); font-weight: 700; font-size: 13px;
  color: var(--gold); white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
.pop.tide { color: #b9d4ee; }
.pop.heart { color: #ffb3c4; }
.pop.bad { color: #ff9a92; }
.pop.good { color: var(--good); }
@keyframes rise { from { opacity: 0; transform: translate(var(--x), var(--y)) translateY(4px); } 15% { opacity: 1; } to { opacity: 0; transform: translate(var(--x), var(--y)) translateY(-30px); } }

/* ---------- glass surfaces ---------- */
.glass {
  background: rgba(26, 25, 21, 0.86);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.6);
}

/* ---------- results ---------- */
.play.done .stage, .play.done .hud { display: none; }
.results {
  position: fixed; z-index: 4;
  top: 64px; right: max(22px, 5vw);
  width: min(520px, calc(100vw - 32px));
  max-height: calc(var(--vh) - 84px);
  overflow-y: auto;
  padding: 26px 26px 22px;
  border-radius: 18px;
  animation: enter 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
  scrollbar-width: thin;
}
@keyframes enter { from { opacity: 0; transform: translateY(12px); } }
.eyebrow { margin: 0; color: var(--muted); font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; }
.res-big { font-family: var(--serif); font-size: clamp(60px, 9vw, 88px); line-height: 1; margin: 8px 0 0; font-variant-numeric: tabular-nums; }
.res-big small { font-family: var(--sans); font-size: 14px; color: var(--muted); margin-left: 8px; }
.pb { display: inline-block; margin: 10px 0 0; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--gold); background: rgba(232, 193, 112, 0.12); }
.res-stats { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 18px 0 14px; }
.res-stats div { display: flex; flex-direction: column; }
.res-stats dt { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.res-stats dd { margin: 0; font-family: var(--mono); font-size: 17px; font-variant-numeric: tabular-nums; }
.chart { margin: 0 0 16px; }
.chart svg { width: 100%; height: 90px; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .you { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linejoin: round; }
.chart .you-area { fill: url(#youGrad); }
.chart .tide { fill: none; stroke: var(--tide); stroke-width: 1.6; stroke-dasharray: 4 4; }
.chart .hitmark { stroke: var(--danger); stroke-width: 1.2; stroke-dasharray: 2 3; }
.chart .axis { fill: var(--muted); font-size: 10px; font-family: var(--mono); }
.chart figcaption { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11.5px; margin-top: 6px; }
.lg { width: 14px; height: 2px; border-radius: 2px; display: inline-block; }
.lg.you { background: var(--accent); }
.lg.tide { background: var(--tide); margin-left: 10px; }

.submit { padding-top: 14px; border-top: 1px solid var(--line); }
.submit-row { display: grid; grid-template-columns: 1fr; gap: 8px; }
.submit input, .handle-input {
  height: 42px; width: 100%; min-width: 0;
  border-radius: 10px; border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, 0.2); color: var(--text);
  font: inherit; font-size: 16px; padding: 0 12px;
  transition: border-color 0.15s;
}
.submit input:focus, .handle-input:focus-within { outline: none; border-color: var(--accent); }
.handle { display: flex; gap: 8px; min-width: 0; }
.seg { display: flex; flex-shrink: 0; padding: 3px; gap: 2px; border-radius: 10px; border: 1px solid var(--line-2); height: 42px; }
.seg button { display: grid; place-items: center; min-width: 36px; padding: 0 8px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 12px; }
.seg button svg { width: 16px; height: 16px; fill: currentColor; }
.seg button[aria-checked="true"] { background: rgba(240, 238, 230, 0.1); color: var(--text); }
.handle-input { display: flex; align-items: center; gap: 4px; padding: 0 6px 0 12px; flex: 1; }
.handle-input .at { color: var(--muted); font-family: var(--mono); }
.handle-input input { border: 0; background: transparent; height: 100%; padding: 0; font-family: var(--mono); font-size: 15px; }
.handle-input input:focus { outline: none; }
.handle-input input:disabled { opacity: 0.5; }
.handle-input.off { opacity: 0.55; }
.handle-avatar { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.form-msg { min-height: 18px; margin: 8px 0; font-size: 13px; color: var(--muted); }
.form-msg:empty { margin: 4px 0; }
.form-msg.err { color: #ff9a92; }
.form-msg.ok { color: var(--good); }
.submit.sent .submit-row, .submit.sent #submitBtn { display: none; }
.submit.sent .form-msg { margin: 0; font-size: 14.5px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(240, 238, 230, 0.06); color: var(--text); font-weight: 600; font-size: 14px; transition: background 0.15s, border-color 0.15s, transform 0.1s; white-space: nowrap; }
.btn:hover { border-color: rgba(240, 238, 230, 0.35); }
.btn:active { transform: translateY(1px); }
.btn.primary { width: 100%; background: var(--accent); border-color: var(--accent); color: #1a1915; }
.btn.primary:hover { background: #e58b6c; }
.btn.primary:disabled { opacity: 0.55; cursor: default; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--soft); }
.btn.ghost:hover { color: var(--text); border-color: var(--line-2); }
.btn kbd { border-color: var(--line-2); }
.res-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.res-actions #againBtn { flex: 1; }

/* ---------- drawers ---------- */
.drawer {
  position: fixed; z-index: 7; top: 10px; right: 10px; bottom: 10px;
  width: min(420px, calc(100vw - 20px));
  border-radius: 18px;
  padding: 20px 20px 16px;
  display: flex; flex-direction: column;
  animation: slide 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes slide { from { opacity: 0; transform: translateX(24px); } }
.scrim { position: fixed; inset: 0; z-index: 6; background: rgba(10, 10, 8, 0.25); animation: fade 0.3s; }
@keyframes fade { from { opacity: 0; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1.05; }
.close { color: var(--text); }
.board-tabs { display: flex; gap: 2px; margin-bottom: 8px; }
.board-tabs button { border: 0; background: transparent; color: var(--muted); padding: 6px 10px; border-radius: 8px; font-size: 13px; font-weight: 500; }
.board-tabs button[aria-selected="true"] { background: rgba(240, 238, 230, 0.09); color: var(--text); }
.board-list { list-style: none; margin: 0 -8px; padding: 0; overflow-y: auto; flex: 1; scrollbar-width: thin; }
.row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 10px; animation: enter 0.35s both; }
.row:hover { background: rgba(240, 238, 230, 0.04); }
.row.me { background: rgba(217, 119, 87, 0.14); }
.rank { font-family: var(--mono); color: var(--muted); font-size: 13px; text-align: center; }
.row:nth-child(1) .rank { color: var(--gold); }
.row:nth-child(2) .rank { color: #d9dde3; }
.row:nth-child(3) .rank { color: #e0a57a; }
.player { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; background: rgba(240, 238, 230, 0.08); color: var(--soft); font-weight: 600; font-size: 13px; object-fit: cover; }
.pname { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.pname b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pname a { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: max-content; max-width: 100%; }
.pname a:hover { color: var(--accent); }
.pname a svg { width: 11px; height: 11px; fill: currentColor; flex-shrink: 0; }
.pmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; min-width: 0; font-size: 12px; color: var(--muted); }
.pmeta a { flex-shrink: 1; min-width: 0; }
.pdevice { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pdevice svg { width: 12px; height: 12px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.score-col { text-align: right; line-height: 1.25; }
.score-v { display: block; font-family: var(--mono); font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.score-sub { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.board-empty { padding: 36px 8px; text-align: center; color: var(--muted); }
.board-empty b { color: var(--text); font-weight: 600; display: block; margin-top: 4px; }
.skel { height: 50px; margin: 2px 0; border-radius: 10px; background: linear-gradient(90deg, transparent, rgba(240, 238, 230, 0.05), transparent) 0 0 / 200% 100%; animation: skel 1.2s linear infinite; }
@keyframes skel { to { background-position: -200% 0; } }
.more { margin: 10px auto 0; }

.how { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.how li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; }
.how h3 { margin: 2px 0 2px; font-size: 14.5px; font-weight: 600; }
.how p { margin: 0; color: var(--soft); font-size: 13.5px; }
.how-ico { width: 40px; height: 40px; border-radius: 11px; background: rgba(240, 238, 230, 0.07); position: relative; overflow: hidden; display: grid; place-items: center; }
.how-ico[data-sprite] { padding: 9px 6px; }
.wave-ico::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 45%; background: #6a9bcc; animation: tidebob 3s ease-in-out infinite; }
@keyframes tidebob { 50% { height: 62%; } }
.adapt-ico::after { content: ''; position: absolute; inset: 11px; border: 2px solid var(--accent); border-radius: 50%; border-right-color: transparent; animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.gold-ico::after { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 14px var(--gold); }
.gold { color: var(--gold); font-weight: 600; }
.heart { color: var(--heart); font-weight: 600; }
.bug-demo { text-decoration: underline wavy var(--bug); text-underline-offset: 4px; color: var(--text); }
.bestiary { margin: 8px 0 0; display: grid; gap: 3px; font-size: 12.5px; }
.bestiary div { display: flex; gap: 8px; }
.bestiary dt { color: var(--text); font-weight: 600; min-width: 92px; }
.bestiary dd { margin: 0; color: var(--muted); }
.fine { margin: auto 0 0; padding-top: 18px; color: var(--muted); font-size: 12px; }

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  .top { grid-template-columns: auto 1fr; padding: max(10px, env(safe-area-inset-top)) 12px 0; row-gap: 2px; }
  .brand { font-size: 22px; }
  .brand-mark { width: 24px; height: 18px; }
  .modes { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .mode { font-size: 13px; padding: 5px 8px; }
  .icons { grid-column: 2; grid-row: 1; }
  .hud { top: 94px; width: calc(100vw - 28px); }
  .hud-main { font-size: 36px; }
  .hud-side { gap: 10px; font-size: 12px; }
  .hud-side b { font-size: 14px; }
  .hud-side .stat[data-show="chase"] { display: none; }
  .heart-ico { width: 17px; height: 15px; }
  .stage { width: calc(100vw - 28px); top: calc(var(--ground) + 16px); }
  .hints { display: none; }
  .results { top: auto; bottom: 10px; right: 10px; left: 10px; width: auto; max-height: calc(var(--vh) - 70px); padding: 20px 18px 16px; }
  .res-big { font-size: 60px; }
  .res-stats { gap: 6px 16px; }
  .res-actions { display: grid; grid-template-columns: 1.3fr 1fr 1fr; }
  .res-actions .btn { padding: 0 8px; font-size: 13px; }
  .btn kbd { display: none; }
}
@media (max-width: 480px) { .sub-extra { display: none; } }
@media (hover: none) { .hints { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
