.about .rex-progress-pill{position:static;margin:20px 0;max-width:420px;width:auto}
:root {
  --nav-h: 56px;
  --ink: #f4f6fb;
  --muted: #a8b4c8;
  --bg: #0b1320;
  --panel: rgba(10, 16, 28, .72);
  --panel-solid: #101a2c;
  --line: rgba(255, 255, 255, .14);
  --accent: #39d0ff;
  --accent-deep: #1593c9;
  --gold: #ffcf4a;
  --good: #3ddc84;
  --warn: #ffc93d;
  --bad: #ff6b5e;
  --display: "Arial Black", "Segoe UI Black", "Helvetica Neue", Arial, system-ui, sans-serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--text); }
body.is-playing { overscroll-behavior: none; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.game { position: relative; height: calc(100vh - var(--nav-h)); height: calc(100dvh - var(--nav-h)); min-height: 320px; overflow: hidden; background: radial-gradient(circle at 50% 30%, #1d2c45, #0b1320); user-select: none; -webkit-user-select: none; }
.stage { position: absolute; inset: 0; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }

/* HUD */
.hud { position: absolute; top: calc(10px + var(--safe-t)); left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r)); display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; pointer-events: none; z-index: 5; }
.hud-left, .hud-right { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; pointer-events: auto; }
.hud-right { justify-content: flex-end; flex-wrap: nowrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 7px 11px; font-size: 14px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.level-chip { flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.15; }
.level-chip span { font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.level-chip strong { font-family: var(--display); font-size: 15px; letter-spacing: .01em; }
.timer-chip { font-variant-numeric: tabular-nums; font-weight: 700; }
.timer-chip svg { width: 16px; height: 16px; color: var(--muted); }
.goal-chip { font-size: 12.5px; color: #ffe6a8; border-color: rgba(255,207,74,.45); }
.skip-chip { min-height: 44px; color: var(--accent); cursor: pointer; font-weight: 700; }
.res-goals { list-style: none; padding: 0; margin: 4px 0; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.res-goals li { padding: 4px 10px; border-radius: 999px; font-weight: 800; font-size: 13px; background: rgba(255,255,255,.07); color: var(--muted); }
.res-goals li.met { background: rgba(61,220,132,.16); color: #9df5c2; }
.hits-chip { color: #ffd1cc; border-color: rgba(255,107,94,.5); }
.icon-btn { position: relative; min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 9px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background .15s, transform .1s; }
.icon-btn:hover { background: rgba(30, 44, 68, .85); }
.icon-btn:active { transform: scale(.95); }
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; }
.icon-btn[aria-pressed="true"]#guide-btn { color: var(--accent); border-color: rgba(57,208,255,.5); }
.btn-label { font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.sound-btn .mute { display: none; }
.sound-btn[aria-pressed="true"] .mute { display: inline; }
.sound-btn[aria-pressed="true"] .wave { display: none; }

.meter { position: absolute; left: calc(10px + var(--safe-l)); top: calc(70px + var(--safe-t)); width: 212px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 4; font-size: 13px; pointer-events: none; }
.m-row { display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 8px; padding: 3px 0; }
.m-row i { width: 12px; height: 12px; border-radius: 50%; background: #4a5568; box-shadow: inset 0 0 0 2px rgba(255,255,255,.15); transition: background .2s; }
.m-row.ok i { background: var(--good); box-shadow: 0 0 10px var(--good); }
.m-row.near i { background: var(--warn); }
.m-row b { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); }
.m-row.ok b { color: var(--ink); }
.hold { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--good); font-weight: 800; }
.hold svg { width: 30px; height: 30px; transform: rotate(-90deg); }
.hold .track { fill: none; stroke: rgba(255,255,255,.15); stroke-width: 5; }
.hold .fill { fill: none; stroke: var(--good); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 100.5; stroke-dashoffset: 100.5; }

.cluster { position: absolute; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 6px 14px 6px 8px; z-index: 4; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); pointer-events: none; }
.wheel { width: 40px; height: 40px; color: #dfe6f2; transition: transform .05s linear; }
.gauge { display: flex; align-items: baseline; gap: 10px; }
.gauge strong { font-family: var(--display); font-size: 24px; width: 22px; text-align: center; color: var(--accent); }
.gauge strong.rev { color: #ffffff; text-shadow: 0 0 10px rgba(255,255,255,.6); }
.gauge span { color: var(--muted); font-size: 13px; }
.gauge b { color: var(--ink); font-size: 18px; font-variant-numeric: tabular-nums; }

.hint { position: absolute; left: 50%; top: calc(66px + var(--safe-t)); transform: translateX(-50%); max-width: min(560px, calc(100% - 270px)); margin: 0; padding: 10px 16px; border-radius: 14px; background: rgba(8, 14, 26, .82); border: 1px solid rgba(57,208,255,.35); font-size: 15px; line-height: 1.35; text-align: center; z-index: 4; pointer-events: none; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.hint b { color: var(--accent); }
.hint kbd, .legend kbd { display: inline-block; min-width: 20px; padding: 1px 5px; margin: 0 1px; border-radius: 5px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); font: 700 12px/1.4 var(--text); text-align: center; }
.toast { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%) scale(.9); padding: 10px 18px; border-radius: 14px; font-family: var(--display); font-size: 22px; letter-spacing: .02em; background: rgba(10,16,28,.85); border: 1px solid var(--line); opacity: 0; pointer-events: none; z-index: 6; transition: opacity .2s, transform .2s; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.toast.bad { color: #ffd0cb; border-color: rgba(255,107,94,.6); }
.toast.good { color: #c8ffe0; border-color: rgba(61,220,132,.6); }
.flash { position: absolute; inset: 0; pointer-events: none; z-index: 3; box-shadow: inset 0 0 0 0 rgba(255,80,60,0); transition: box-shadow .35s; }
.flash.on { box-shadow: inset 0 0 90px 10px rgba(255,80,60,.45); transition: none; }

.legend { position: absolute; right: calc(10px + var(--safe-r)); bottom: calc(14px + var(--safe-b)); padding: 10px 34px 8px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; font-size: 13px; color: var(--muted); z-index: 4; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.legend p { margin: 0 0 4px; }
.legend-x { position: absolute; top: 2px; right: 2px; width: 32px; height: 32px; border: 0; background: none; font-size: 20px; color: var(--muted); }

/* Touch controls */
.pad { position: absolute; inset: auto 0 0 0; padding: 0 calc(12px + var(--safe-r)) calc(12px + var(--safe-b)) calc(12px + var(--safe-l)); display: flex; justify-content: space-between; align-items: flex-end; pointer-events: none; z-index: 5; }
.pad-steer, .pad-drive { display: flex; gap: 10px; align-items: flex-end; pointer-events: auto; }
.pedals { display: flex; flex-direction: column; gap: 10px; }
.pbtn { touch-action: none; -webkit-touch-callout: none; border: 1px solid rgba(255,255,255,.22); border-radius: 20px; background: rgba(12, 20, 36, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: 800 12px/1 var(--text); letter-spacing: .06em; transition: background .08s, transform .08s, border-color .08s; box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.pbtn svg { width: 30px; height: 30px; }
.pbtn.steer { width: 78px; height: 78px; border-radius: 50%; }
.pbtn.fwd, .pbtn.rev { width: 78px; height: 66px; }
.pbtn.fwd { color: #c8f0ff; }
.pbtn.rev { color: #fff; }
.pbtn.brake { width: 66px; height: 66px; color: #ffd3cd; border-radius: 16px; font-size: 11px; }
.pbtn.on { background: rgba(57, 208, 255, .45); border-color: var(--accent); transform: scale(.95); }
.pbtn.brake.on { background: rgba(255, 90, 70, .5); border-color: var(--bad); }
.touch .cluster { bottom: calc(18px + var(--safe-b)); padding: 4px 10px 4px 6px; }
.touch .cluster .wheel { width: 30px; height: 30px; }
.touch .gauge strong { font-size: 20px; }

/* Overlays */
.overlay { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: calc(14px + var(--safe-t)) calc(14px + var(--safe-r)) calc(14px + var(--safe-b)) calc(14px + var(--safe-l)); overflow-y: auto; }
.menu { background: linear-gradient(90deg, rgba(6,10,20,.82) 0%, rgba(6,10,20,.55) 42%, rgba(6,10,20,0) 70%); place-items: center start; }
.menu-card { width: min(440px, 100%); margin-left: clamp(0px, 4vw, 60px); }
.kicker { margin: 0 0 4px; color: var(--accent); font-weight: 800; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.menu h1 { margin: 0; font-family: var(--display); font-size: clamp(32px, 4vw, 48px); line-height: .98; letter-spacing: -.01em; text-shadow: 0 6px 30px rgba(0,0,0,.45); }
.menu h1 span { display: block; color: var(--gold); }
.tagline { margin: 10px 0 18px; color: #d7e0ee; font-size: 17px; }
.cta { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 26px; border: 0; border-radius: 14px; background: linear-gradient(180deg, #4fdcff, #1aa3dc); color: #04121d; font: 900 19px/1 var(--display); letter-spacing: .02em; box-shadow: 0 10px 26px rgba(26,163,220,.35), inset 0 -3px 0 rgba(0,0,0,.18); transition: transform .1s, filter .15s; }
.cta:hover { filter: brightness(1.08); }
.cta:active { transform: translateY(1px) scale(.99); }
.cta small { font: 700 13px/1 var(--text); opacity: .8; }
#play { width: 100%; }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.mode { min-height: 64px; text-align: left; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(14, 22, 38, .78); display: flex; flex-direction: column; gap: 3px; transition: border-color .15s, background .15s; }
.mode:hover { border-color: rgba(57,208,255,.55); background: rgba(20, 32, 54, .9); }
.mode strong { font-size: 15px; }
.mode span { font-size: 12.5px; color: var(--muted); }
.menu-utils { display: flex; gap: 8px; margin-top: 10px; }
.ghost { min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: rgba(14, 22, 38, .7); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; color: var(--ink); }
.ghost:hover { border-color: rgba(57,208,255,.55); }
.ghost.danger { color: #ffb4ab; border-color: rgba(255,107,94,.4); }
.menu-utils .ghost span { color: var(--muted); font-weight: 600; }

.sheet { background: rgba(5, 9, 18, .62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sheet-card { width: min(520px, 100%); max-height: 100%; overflow-y: auto; background: rgba(13, 21, 37, .96); border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.sheet-card.wide { width: min(980px, 100%); }
.sheet-card.narrow { width: min(340px, 100%); text-align: center; }
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sheet-head h2, .sheet-card h2 { margin: 0; font-family: var(--display); font-size: 24px; }
.sheet-meta { margin-left: auto; color: var(--gold); font-weight: 800; }
.back { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.05); font-size: 20px; }
.sheet-note { color: var(--muted); margin: 6px 0 14px; }
.stack { display: grid; gap: 8px; margin-top: 12px; }
.level-groups { display: grid; gap: 16px; }
.lg-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.lg-head h3 { margin: 0; font-size: 17px; }
.lg-head span { color: var(--muted); font-size: 13px; }
.lg-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.lvl { position: relative; min-height: 86px; border-radius: 14px; border: 1px solid var(--line); background: linear-gradient(160deg, color-mix(in srgb, var(--acc) 26%, #121c30), #0f1828 70%); padding: 8px; text-align: left; display: flex; flex-direction: column; gap: 2px; }
.lvl b { font-family: var(--display); font-size: 20px; }
.lvl small { font-size: 11.5px; color: #d4dceb; line-height: 1.2; }
.lvl .lstars { margin-top: auto; color: rgba(255,255,255,.22); letter-spacing: 1px; font-size: 14px; }
.lvl .lstars .on { color: var(--gold); }
.lvl .lveh { position: absolute; right: 8px; top: 8px; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.lvl:disabled { opacity: .45; cursor: not-allowed; }
.lvl:not(:disabled):hover { border-color: var(--acc); }
.lessons { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.lesson { width: 100%; display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; text-align: left; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.04); }
.lesson .num { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(57,208,255,.15); color: var(--accent); font-family: var(--display); }
.lesson.done .num { background: var(--good); color: #062214; }
.lesson span { color: var(--muted); font-size: 13px; display: block; margin-top: 2px; }
.settings { display: grid; gap: 4px; }
.set { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; padding: 4px 2px; border-bottom: 1px solid rgba(255,255,255,.06); }
.set input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); }
.set input[type=range] { width: 50%; accent-color: var(--accent); }
.set select { min-height: 40px; border-radius: 10px; background: #18233a; border: 1px solid var(--line); padding: 0 8px; }
#reset-progress { margin-top: 12px; }
.ach-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ach-list li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.04); opacity: .55; }
.ach-list li.got { opacity: 1; background: rgba(255,207,74,.09); }
.ach-list li i { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-style: normal; background: rgba(255,255,255,.08); }
.ach-list li.got i { background: var(--gold); color: #2a1d00; }
.ach-list li span { display: block; color: var(--muted); font-size: 13px; }

/* Results */
.results { background: radial-gradient(circle at 50% 40%, rgba(5,9,18,.3), rgba(5,9,18,.72)); }
.res-card { width: min(470px, 100%); max-height: 100%; overflow-y: auto; text-align: center; background: rgba(13, 21, 37, .95); border: 1px solid var(--line); border-radius: 22px; padding: 18px 18px 16px; box-shadow: 0 30px 80px rgba(0,0,0,.5); animation: pop .35s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.res-card h2 { margin: 2px 0 4px; font-family: var(--display); font-size: clamp(30px, 6vw, 42px); letter-spacing: .01em; }
.res-card h2.perfect { background: linear-gradient(90deg, #ffe37a, #ffb02e, #fff2b3); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stars { display: flex; justify-content: center; gap: 6px; font-size: 44px; line-height: 1; margin: 4px 0; }
.stars span { color: rgba(255,255,255,.14); transform: scale(.6); transition: transform .35s cubic-bezier(.2,1.8,.4,1), color .2s; }
.stars span.on { color: var(--gold); transform: scale(1); text-shadow: 0 0 22px rgba(255,207,74,.6); }
.res-score { display: flex; justify-content: center; align-items: baseline; gap: 6px; }
.res-score strong { font-family: var(--display); font-size: 40px; font-variant-numeric: tabular-nums; }
.res-score span { color: var(--muted); }
.record { display: inline-block; margin: 4px 0 0; padding: 3px 10px; border-radius: 999px; background: var(--gold); color: #2a1d00; font-weight: 900; font-size: 13px; }
.res-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0 8px; }
.res-grid div { background: rgba(255,255,255,.05); border-radius: 12px; padding: 8px 4px; }
.res-grid dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.res-grid dd { margin: 3px 0 0; font-weight: 800; font-size: 15px; }
.breakdown { text-align: left; font-size: 14px; margin: 6px 0; }
.breakdown summary { cursor: pointer; color: var(--muted); min-height: 32px; display: flex; align-items: center; }
.breakdown ul { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 3px; }
.breakdown li { display: flex; justify-content: space-between; border-bottom: 1px dashed rgba(255,255,255,.08); padding: 3px 0; }
.tips { list-style: none; padding: 0; margin: 6px 0; text-align: left; font-size: 14px; color: #d8e1ee; display: grid; gap: 4px; }
.tips li::before { content: "→ "; color: var(--accent); }
.res-ach { list-style: none; padding: 0; margin: 4px 0; }
.res-ach li { display: inline-block; margin: 2px; padding: 4px 10px; border-radius: 999px; background: rgba(255,207,74,.15); color: var(--gold); font-weight: 800; font-size: 13px; }
.res-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.res-actions .cta { grid-column: 1 / -1; }

.loading, .fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--bg); z-index: 20; color: var(--muted); font-weight: 600; text-align: center; padding: 20px; }
.game:not([data-phase="loading"]) .loading:not(.busy) { display: none; }
.loading.busy { background: rgba(5,9,18,.55); }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 4px solid rgba(255,255,255,.15); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.about { max-width: 820px; margin: 0 auto; padding: 40px 20px 60px; line-height: 1.6; color: #d5dcea; }
.about h2 { font-family: var(--display); color: var(--ink); }
.about a { color: var(--accent); }
.faq dt { font-weight: 800; margin-top: 10px; color: var(--ink); }
.faq dd { margin: 4px 0 0; }

/* Responsive */
@media (min-width: 1000px) {
  .results { place-items: center end; padding-right: max(4vw, 24px); background: linear-gradient(270deg, rgba(5,9,18,.75), rgba(5,9,18,.15) 60%, rgba(5,9,18,0)); }
}
@media (max-width: 900px) {
  .lg-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .menu { background: linear-gradient(0deg, rgba(6,10,20,.9) 0%, rgba(6,10,20,.6) 55%, rgba(6,10,20,.1) 100%); place-items: end center; }
  .menu-card { margin: 0; }
  .tagline { margin: 6px 0 12px; font-size: 15px; }
  .level-chip strong { font-size: 13px; }
  .goal-chip, .skip-chip { display: none; }
  .chip { padding: 6px 9px; font-size: 13px; }
  .icon-btn { padding: 0 6px; }
  .btn-label { display: none; }
  .meter { top: calc(108px + var(--safe-t)); bottom: auto; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 20px); display: flex; gap: 10px; align-items: center; padding: 6px 10px; border-radius: 12px; font-size: 12px; }
  .m-row { display: flex; gap: 5px; padding: 0; }
  .m-row span { display: none; }
  .m-row b { font-size: 12px; }
  .hold { margin: 0; padding: 0 0 0 8px; border-top: 0; border-left: 1px solid var(--line); font-size: 12px; }
  .hold svg { width: 22px; height: 22px; }
  .hint { top: auto; bottom: calc(158px + var(--safe-b)); max-width: calc(100% - 24px); width: max-content; font-size: 13px; padding: 7px 11px; }
  .touch .cluster { left: auto; right: calc(10px + var(--safe-r)); bottom: auto; top: calc(62px + var(--safe-t)); transform: none; }
  .res-grid { grid-template-columns: repeat(2, 1fr); }
  .lg-grid { grid-template-columns: repeat(3, 1fr); }
  .lvl { min-height: 78px; }
  .toast { font-size: 18px; }
}
@media (max-width: 380px) {
  .pbtn.steer { width: 68px; height: 68px; }
  .pbtn.fwd, .pbtn.rev { width: 70px; height: 58px; }
  .pbtn.brake { width: 56px; height: 58px; }
  .hud-right { gap: 4px; }
  .icon-btn { min-width: 40px; height: 40px; }
}
/* Landscape phones: compact HUD, pads at the sides. */
@media (max-height: 500px) and (orientation: landscape) {
  .meter { top: calc(58px + var(--safe-t)); bottom: auto; left: calc(10px + var(--safe-l)); transform: none; width: auto; display: flex; gap: 10px; align-items: center; padding: 6px 10px; font-size: 12px; }
  .m-row { display: flex; gap: 5px; padding: 0; }
  .m-row span { display: none; }
  .hold { margin: 0; padding: 0 0 0 8px; border-top: 0; border-left: 1px solid var(--line); font-size: 12px; }
  .hold svg { width: 22px; height: 22px; }
  .hint { top: auto; bottom: calc(80px + var(--safe-b)); max-width: 46%; font-size: 13px; padding: 6px 10px; }
  .goal-chip { display: none; }
  .menu h1 { font-size: 32px; }
  .tagline { display: none; }
  .mode { min-height: 52px; padding: 6px 10px; }
  .cta { min-height: 46px; }
  .res-card { padding: 10px 14px; width: min(560px, 100%); }
  .res-card h2 { font-size: 24px; margin: 0; }
  .kicker { font-size: 11px; margin: 0; }
  .stars { font-size: 26px; margin: 2px 0; }
  .res-score strong { font-size: 28px; }
  .record { position: absolute; margin: 0; transform: translate(10px, -34px); }
  .res-grid { margin: 6px 0; }
  .res-grid div { padding: 5px 4px; }
  .res-grid dd { font-size: 13px; }
  .tips, .breakdown, .res-ach { display: none; }
  .res-actions { grid-template-columns: 2fr 1fr 1fr 1fr; margin-top: 6px; }
  .res-actions .cta { grid-column: auto; min-height: 44px; font-size: 16px; }
  .touch .cluster { bottom: calc(10px + var(--safe-b)); }
}
@media (prefers-reduced-motion: reduce) {
  .res-card { animation: none; }
  .stars span, .toast, .flash { transition: none; }
}
.reduce-motion .res-card { animation: none; }
.reduce-motion .stars span { transition: none; }
