/* P-51 Math Run — game page. "Air-race flight school": cream gauge faces, navy ink,
   red-tail accents, stencil numerals. Tokens first, then components. */
:root {
  --navy: #17294d; --navy-2: #223a6b; --cream: #fff3d6; --cream-2: #ffe9b8;
  --red: #e63b2e; --gold: #ffc857; --sky: #62bcff; --sea: #1fb4c9; --green: #37d67a;
  --ink-soft: rgba(23,41,77,.62);
  --line: rgba(23,41,77,.16); --line-strong: rgba(23,41,77,.3);
  --face: rgba(255,247,228,.9);
  --shadow: 0 8px 24px rgba(10,30,70,.14);
  --stencil: "Black Ops One", "Arial Black", sans-serif;
  --body: "Fredoka", "Nunito", "Segoe UI", system-ui, sans-serif;
  --r-lg: 26px; --r-md: 18px; --r-pill: 999px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--sky); font-family: var(--body); color: var(--navy); user-select: none; -webkit-user-select: none; }
.hidden { display: none !important; }
#game { position: fixed; inset: 0; display: block; }
#game.pixelated { image-rendering: pixelated; }

/* ---------- screen filters: overlays sit between the canvas and the HUD ---------- */
.filter-overlay { position: fixed; inset: 0; pointer-events: none; }
.filter-overlay::before, .filter-overlay::after { content: ""; position: absolute; inset: -20%; pointer-events: none; opacity: 0; }
.fx-grain::before { opacity: .16; background-image: var(--noise); background-size: 160px; mix-blend-mode: overlay; animation: grain .35s steps(3) infinite; }
.fx-paper::before { opacity: .28; background-image: var(--noise); background-size: 320px; mix-blend-mode: multiply; filter: blur(.4px) contrast(.6) brightness(1.5); }
.fx-vignette::after { opacity: 1; inset: 0; background: radial-gradient(ellipse at center, transparent 55%, rgba(10,20,40,.55) 100%); }
.fx-scanlines::after { opacity: .28; inset: 0; background: repeating-linear-gradient(0deg, rgba(0,0,0,.35) 0 2px, transparent 2px 4px); }
.fx-halftone::before { opacity: .22; inset: 0; background-image: radial-gradient(circle, rgba(20,20,40,.9) 1.1px, transparent 1.6px); background-size: 6px 6px; mix-blend-mode: multiply; }
.fx-glow { backdrop-filter: blur(1.2px) brightness(1.03); -webkit-backdrop-filter: blur(1.2px) brightness(1.03); }
.fx-glow::after { opacity: 1; inset: 0; background: radial-gradient(ellipse at 50% 30%, rgba(255,255,255,.18), transparent 60%); mix-blend-mode: screen; }
@keyframes grain { 0% { transform: translate(0,0); } 33% { transform: translate(-6%, 4%); } 66% { transform: translate(5%, -5%); } 100% { transform: translate(0,0); } }
@media (prefers-reduced-motion: reduce) { .fx-grain::before { animation: none; } }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
iconify-icon { display: inline-block; vertical-align: -0.15em; }

/* ---------- shared ---------- */
.stencil, .g-num { font-family: var(--stencil); font-weight: 400; letter-spacing: .5px; }
.g-lbl { font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase; font-weight: 600; color: var(--ink-soft); }
.g-num { font-size: 40px; line-height: 1; color: var(--navy); font-variant-numeric: tabular-nums; }
.g-num.small { font-size: 22px; }
.tag { display: inline-block; padding: 4px 12px; border-radius: var(--r-pill); background: rgba(23,41,77,.08); color: var(--navy); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; font-weight: 600; }
.tag-red { background: rgba(230,59,46,.12); color: var(--red); }

/* ---------- HUD: cockpit gauges ---------- */
#hud { position: fixed; top: 16px; left: 128px; right: 128px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; pointer-events: none; }
.gauge { background: var(--face); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1.5px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 8px 16px; }
.gauge-score { justify-self: start; display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 14px; align-items: center; }
.gauge-score .g-lbl { grid-column: 1; }
.gauge-score .g-num { grid-column: 1; grid-row: 2; }
.streak { grid-column: 2; grid-row: 1 / 3; display: flex; align-items: center; gap: 5px; padding-left: 14px; border-left: 1.5px solid var(--line); }
.streak i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-strong); background: transparent; transition: background .15s, transform .15s, border-color .15s; }
.streak i.on { background: var(--red); border-color: var(--red); transform: scale(1.15); }
.streak b { font-family: var(--stencil); font-weight: 400; font-size: 20px; margin-left: 6px; color: var(--navy); }
.streak.hot b { color: var(--red); }
.gauge-center { justify-self: center; display: flex; align-items: center; gap: 16px; padding: 6px 12px 6px 22px; }
.q-echo { font-family: var(--stencil); font-size: calc(26px * var(--ui-scale, 1)); color: var(--navy); white-space: nowrap; transition: color .15s; }
.q-echo.good { color: #1e9b52; } .q-echo.bad { color: var(--red); }
.timer { position: relative; width: 56px; height: 56px; display: grid; place-items: center; }
.timer svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.timer .track { fill: none; stroke: rgba(23,41,77,.1); stroke-width: 4; }
.timer .arc { fill: none; stroke: var(--navy-2); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 125.66; stroke-dashoffset: 0; transition: stroke .3s; }
.timer.urgent .arc { stroke: var(--red); }
.timer .g-num { position: relative; }
.gauge-right { justify-self: end; display: flex; gap: 18px; align-items: center; }
.gauge-right > div { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.gauge-right .g-num.small { font-size: 26px; }

/* ---------- flash + centre callouts + labels ---------- */
#flash { position: fixed; inset: -6px; pointer-events: none; opacity: 0; border-radius: 30px; box-shadow: inset 0 0 160px 45px var(--flash, #37d67a); }
#center-text { position: fixed; inset: 0; display: grid; place-items: center; pointer-events: none; }
.callout { font-family: var(--stencil); font-size: calc(clamp(64px, 14vw, 160px) * min(var(--ui-scale, 1), 1.2)); color: var(--cream); -webkit-text-stroke: 4px var(--navy); text-shadow: 0 10px 0 var(--navy), 0 18px 40px rgba(10,30,70,.35); line-height: 1; will-change: transform, opacity; }
.callout.combo { font-size: clamp(40px, 8vw, 96px); color: var(--gold); }
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.label { position: absolute; transform: translate(-50%, -50%); font-family: var(--stencil); font-size: 40px; color: var(--cream); -webkit-text-stroke: 2px var(--navy); text-shadow: 0 5px 0 var(--navy); animation: float-up 1s ease-out forwards; white-space: nowrap; }
.label.good { color: var(--green); }
.label.miss { color: #ff7b7b; font-size: 30px; }
@keyframes float-up { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.5); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -160%) scale(1); } }

/* ---------- hand pointer marker ---------- */
#pointer { position: fixed; left: 0; top: 0; width: 38px; height: 38px; pointer-events: none; border: 2.5px solid rgba(255,243,214,.95); border-radius: 50%; box-shadow: 0 0 0 3px rgba(23,41,77,.3), 0 0 14px rgba(255,200,87,.5); }
#pointer::before, #pointer::after { content: ""; position: absolute; background: rgba(255,243,214,.95); }
#pointer::before { left: 50%; top: -9px; width: 2px; height: 8px; margin-left: -1px; box-shadow: 0 46px 0 rgba(255,243,214,.95); }
#pointer::after { top: 50%; left: -9px; height: 2px; width: 8px; margin-top: -1px; box-shadow: 46px 0 0 rgba(255,243,214,.95); }

/* ---------- top corners: home + sound ---------- */
.corner-btn { font: inherit; font-size: 22px; line-height: 1; color: var(--navy); cursor: pointer; text-decoration: none; width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--face); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--shadow); display: inline-flex; align-items: center; justify-content: center; transition: background .12s, transform .1s; }
.corner-btn:hover { background: #fff; transform: translateY(-1px); }
#home { position: fixed; left: 16px; top: 16px; z-index: 5; }
#btn-settings { position: fixed; right: 70px; top: 16px; z-index: 5; }
#btn-pause { position: fixed; left: 70px; top: 16px; z-index: 5; }
body.boot #btn-settings, body.boot #btn-pause { display: none; }
#sound { position: fixed; right: 16px; top: 16px; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 0; border-radius: var(--r-pill); }
#sound input[type=range], #sound #vol-label { opacity: 0; width: 0; overflow: hidden; white-space: nowrap; transition: opacity .15s, width .15s; pointer-events: none; }
#sound:hover input[type=range], #sound:focus-within input[type=range], #sound.open input[type=range] { opacity: 1; width: 90px; pointer-events: auto; }
#sound:hover #vol-label, #sound:focus-within #vol-label, #sound.open #vol-label { opacity: 1; width: 36px; }
#sound input[type=range] { accent-color: var(--red); cursor: pointer; }
#sound #vol-label { font-size: 13px; font-weight: 600; text-align: right; }
#sound.muted #vol-label { text-decoration: line-through; opacity: .5; }
#sound:hover, #sound:focus-within, #sound.open { padding-left: 12px; background: var(--face); border: 1.5px solid var(--line); box-shadow: var(--shadow); }
#sound:hover .corner-btn, #sound:focus-within .corner-btn, #sound.open .corner-btn { border: 0; box-shadow: none; background: transparent; }

/* ---------- camera preview ---------- */
#cam { position: fixed; right: 16px; bottom: 16px; width: 250px; display: flex; flex-direction: column; gap: 6px; }
body.far #cam { width: 340px; } body.far .cam-frame { width: 340px; height: 255px; }
.cam-frame { position: relative; width: 250px; height: 188px; border-radius: var(--r-md); overflow: hidden; border: 1.5px solid rgba(255,255,255,.6); background: #123; box-shadow: var(--shadow); }
.cam-frame video, .cam-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.cam-frame video { filter: grayscale(1) contrast(1.08) brightness(.95); }   /* monochrome preview; the tracking overlay stays in colour */
#cam-status { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 8px; font-size: 12px; text-align: center; color: #fff; background: rgba(0,0,0,.5); }
.meters { display: flex; gap: 8px; }
.meter { flex: 1; font-size: 11px; text-align: center; letter-spacing: 1px; color: var(--cream); text-shadow: 0 1px 0 var(--navy); }
.meter .bar { position: relative; height: 8px; border-radius: var(--r-pill); background: rgba(23,41,77,.45); margin-top: 3px; overflow: hidden; }
.meter .fill { position: absolute; left: 50%; top: 0; bottom: 0; width: 0; background: var(--gold); transition: width .08s, left .08s; }
.meter .bar::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.7); }

/* ---------- cockpit view: glass instrument panel ---------- */
#cockpit { position: fixed; inset: 0; pointer-events: none; }
#cockpit::before { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 140px 20px rgba(10,20,40,.35); }
.reticle { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); border: 1.5px solid rgba(255,255,255,.85); border-radius: 50%; box-shadow: 0 0 0 2px rgba(23,41,77,.25); }
.reticle::after { content: ""; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px; border-radius: 50%; background: var(--gold); }
.panel { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; align-items: center; gap: 18px; padding: 12px 20px; border-radius: 28px; background: rgba(12,22,46,.58); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,.18); box-shadow: 0 16px 40px rgba(5,15,40,.35), inset 0 1px 0 rgba(255,255,255,.12); }
.inst { position: relative; width: 96px; height: 96px; display: grid; place-items: center; }
.inst svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(135deg); }
.inst .track { fill: none; stroke: rgba(255,255,255,.14); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 188.5 251.3; }
.inst .val { fill: none; stroke-width: 7; stroke-linecap: round; stroke-dasharray: 188.5 251.3; stroke-dashoffset: 188.5; transition: stroke-dashoffset .12s linear; }
.inst .val.speed { stroke: url(#none); stroke: var(--gold); }
.inst .val.alt { stroke: #7fd0ff; }
.inst-val { font-family: var(--stencil); font-size: 22px; color: #fff; line-height: 1; margin-top: 2px; }
.inst-lbl { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,.6); font-weight: 600; }
.inst-lbl.under { bottom: -4px; }
.inst.attitude, .inst.compass { width: 86px; height: 86px; }
.horizon { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; border: 1.5px solid rgba(255,255,255,.35); transform-origin: 50% 50%; }
.horizon .sky { position: absolute; left: -50%; right: -50%; top: -100%; height: 150%; background: linear-gradient(#7cc8ff, #3a95ea); }
.horizon .ground { position: absolute; left: -50%; right: -50%; top: 50%; height: 150%; background: linear-gradient(#b4784a, #5d3d25); border-top: 1.5px solid rgba(255,255,255,.9); }
.inst.attitude .marker { position: absolute; left: 50%; top: 50%; width: 46px; height: 3px; margin: -1.5px -23px; background: var(--gold); border-radius: 2px; box-shadow: 0 0 6px rgba(0,0,0,.35); }
.inst.attitude .marker::after { content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3.5px; border-radius: 50%; background: var(--gold); }
.compass-ring { width: 74px; height: 74px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.3); background: radial-gradient(circle, rgba(255,255,255,.08), transparent 70%); display: grid; place-items: center; }
.compass-ring::before { content: ""; position: absolute; width: 4px; height: 4px; border-radius: 50%; background: rgba(255,255,255,.5); transform: translateY(-33px); }
.gate-arrow { font-size: 34px; color: var(--gold); line-height: 1; transition: transform .1s linear, color .2s; }
@media (max-width: 760px) { .panel { gap: 10px; padding: 8px 12px; bottom: 10px; } .inst { width: 72px; height: 72px; } .inst.attitude, .inst.compass { width: 64px; height: 64px; } .compass-ring { width: 56px; height: 56px; } .inst-val { font-size: 16px; } }

/* ---------- pause banner ---------- */
#paused { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.banner { padding: 16px 30px; border-radius: var(--r-md); font-size: 26px; font-weight: 600; background: var(--face); border: 1.5px solid var(--line); box-shadow: var(--shadow); animation: pulse .7s infinite alternate; }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.06); } }

/* ---------- overlay cards ("flight plan" / "logbook") ---------- */
#overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; overflow: auto; }
.card { width: min(840px, 94vw); padding: 20px 30px 22px; border-radius: var(--r-lg); text-align: center; background: var(--face); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: var(--navy); border: 1.5px solid rgba(255,255,255,.7); box-shadow: 0 24px 60px rgba(10,30,70,.22); }
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.card .title { line-height: 1; margin-bottom: 8px; }
.card .title .stencil { display: block; font-size: clamp(44px, 8vw, 72px); color: var(--navy); }
.card .title small { display: block; font-size: 18px; font-weight: 600; color: var(--red); margin-top: 6px; letter-spacing: 1px; }
.tagline { margin: 6px auto 10px; font-size: 16px; line-height: 1.5; max-width: 560px; color: var(--ink-soft); }
/* the flight plan: a calm two-column form, labels left, options left-aligned */
.plan { display: grid; grid-template-columns: 96px 1fr; column-gap: 16px; row-gap: 10px; align-items: center; text-align: left; margin: 14px 0 12px; padding: 16px 18px; background: rgba(255,255,255,.45); border: 1.5px solid var(--line); border-radius: var(--r-md); }
.plan-lbl { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; font-weight: 600; color: var(--ink-soft); text-align: right; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { font: inherit; font-size: 14px; font-weight: 600; color: var(--navy); cursor: pointer; height: 36px; padding: 0 12px; border-radius: var(--r-pill); border: 1.5px solid var(--line-strong); background: rgba(255,255,255,.7); transition: background .12s, transform .08s, border-color .12s; display: inline-flex; align-items: center; gap: 6px; }
.chip iconify-icon { font-size: 18px; }
.chip:hover { background: #fff; border-color: var(--navy-2); }
.chip.active { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.select { height: 36px; font-size: 14px; padding: 0 34px 0 14px; min-width: 140px; }
dialog.settings .plan { margin-top: 0; }
.gestures { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0 0 14px; }
.g { background: rgba(255,255,255,.6); border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 8px 6px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.g svg { width: 56px; height: 56px; fill: none; stroke: var(--navy-2); stroke-width: 3.5; stroke-linecap: round; }
.g svg circle { fill: var(--navy-2); stroke: none; }
.g svg .arrow { stroke: var(--red); }
.g .big-icon { font-size: 42px; height: 56px; display: flex; align-items: center; color: var(--navy-2); }
.g .keys { display: flex; gap: 6px; align-items: center; height: 56px; }
.g b { font-size: 15px; } .g span { font-size: 12px; color: var(--ink-soft); }
kbd { font: inherit; font-size: 15px; font-weight: 700; color: #fff; padding: 7px 11px; border-radius: 9px; background: var(--navy-2); box-shadow: 0 3px 0 rgba(13,26,54,.5); min-width: 38px; text-align: center; display: inline-flex; align-items: center; justify-content: center; }
kbd iconify-icon { font-size: 18px; }
kbd.wide { padding: 7px 16px; }
.buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn { font: inherit; font-size: 19px; font-weight: 700; color: var(--navy); cursor: pointer; padding: 13px 26px; border-radius: var(--r-pill); border: 1.5px solid var(--line-strong); background: #fff; box-shadow: 0 6px 18px rgba(10,30,70,.12); transition: transform .08s, box-shadow .08s; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 8px 22px rgba(230,59,46,.35); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(10,30,70,.18); }
.btn:active { transform: translateY(1px); box-shadow: 0 3px 10px rgba(10,30,70,.15); }
.small-buttons { margin-top: 14px; } .small-buttons .btn { font-size: 16px; padding: 10px 20px; }
.hint { margin-top: 14px; font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.card.small { width: auto; max-width: min(640px, 92vw); padding: 22px 40px; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(255,247,228,.78); border-color: rgba(255,255,255,.55); box-shadow: 0 18px 50px rgba(10,30,70,.2); }
.armed-title { font-size: 30px; font-weight: 700; line-height: 1.2; }
.armed-sub { font-size: 15px; color: var(--ink-soft); margin-top: 4px; }
@keyframes armed-pulse { from { transform: translate(-50%, -50%) scale(1); } to { transform: translate(-50%, -50%) scale(1.025); } }
#card-armed { animation: armed-pulse 1.1s ease-in-out infinite alternate; }
@media (prefers-reduced-motion: reduce) { #card-armed { animation: none; } }
.hold { width: 100%; height: 6px; margin-top: 10px; border-radius: var(--r-pill); background: rgba(23,41,77,.1); overflow: hidden; }
.hold-fill { height: 100%; width: 0%; background: var(--red); transition: width .08s linear; }
.result { display: flex; justify-content: center; gap: 36px; margin: 12px 0; }
.result div { display: flex; flex-direction: column; gap: 4px; }
.result .g-num { font-size: 48px; }
.stars { display: flex; justify-content: center; gap: 6px; margin: 4px 0 6px; }
.stars i { width: 34px; height: 34px; background: rgba(23,41,77,.1); clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); transform: scale(.6); }
.stars i.on { background: var(--gold); }
.new-best { color: var(--red); font-family: var(--stencil); font-size: 22px; margin-bottom: 8px; }
.review { margin: 4px 0 12px; }
#review-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 6px; }
#review-list span { background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-pill); padding: 5px 12px; font-family: var(--stencil); font-size: 16px; }

/* ---------- loading ---------- */
#loading { position: fixed; inset: 0; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; font-size: 20px; color: var(--navy); background: linear-gradient(var(--sky), #bfe8ff); z-index: 10; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 5px solid rgba(23,41,77,.2); border-top-color: var(--navy); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  #hud { grid-template-columns: 1fr auto; gap: 8px; left: 124px; right: 124px; }
  .gauge-right { display: none; }
  .g-num { font-size: 30px; } .q-echo { font-size: 18px; }
  .gestures { grid-template-columns: repeat(2, 1fr); }
  .plan { grid-template-columns: 1fr; row-gap: 6px; } .plan-lbl { text-align: left; margin-top: 6px; }
  #cam { width: 170px; } .cam-frame { width: 170px; height: 128px; }
  .card { padding: 20px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .banner, .label { animation: none; }
  .label { opacity: 1; }
}

/* ---------- dropdowns (look, filter) ---------- */
.select { font: inherit; font-size: 15px; font-weight: 600; color: var(--navy); padding: 8px 36px 8px 14px; border-radius: var(--r-pill); border: 1.5px solid var(--line-strong); background: rgba(255,255,255,.7) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2317294d' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; appearance: none; -webkit-appearance: none; cursor: pointer; min-width: 150px; }
.select:hover { background-color: #fff; border-color: var(--navy-2); }

/* ---------- in-game settings dialog ---------- */
dialog.settings { position: fixed; inset: 0; margin: auto; max-height: 92vh; overflow: auto; padding: 22px 30px 26px; }
dialog.settings::backdrop { background: rgba(10,25,60,.35); backdrop-filter: blur(3px); }
dialog.settings .close { font: inherit; font-size: 28px; line-height: 1; color: var(--navy); background: transparent; border: 0; cursor: pointer; border-radius: 50%; width: 40px; height: 40px; display: grid; place-items: center; }
dialog.settings .close:hover { background: rgba(23,41,77,.08); }
dialog.settings .tagline { margin: 4px auto 14px; }
dialog.settings .buttons a.btn { text-decoration: none; }

body.pointer-mode .reticle { display: none; }   /* hands mode: the pointer marker is the only target */

/* ---------- pause ---------- */
#pause-screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(10,25,60,.3); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 4; }
.pause-card { position: static; transform: none; padding: 22px 40px; }
.pause-title { font-size: 44px; line-height: 1; }

/* ---------- phones ---------- */
.mobile-only { display: none !important; }
body.mobile .mobile-only { display: inline-flex !important; }
body.mobile .desktop-only { display: none !important; }
body.mobile #game { touch-action: none; }
body.mobile #hud { top: max(10px, env(safe-area-inset-top)); left: 64px; right: 64px; gap: 6px; }
body.mobile .gauge { padding: 6px 10px; }
body.mobile .corner-btn { width: 40px; height: 40px; font-size: 19px; }
body.mobile #home { left: max(10px, env(safe-area-inset-left)); top: max(10px, env(safe-area-inset-top)); }
body.mobile #btn-pause { left: max(10px, env(safe-area-inset-left)); top: calc(max(10px, env(safe-area-inset-top)) + 48px); }
body.mobile #sound { right: max(10px, env(safe-area-inset-right)); top: max(10px, env(safe-area-inset-top)); }
body.mobile #btn-settings { right: max(10px, env(safe-area-inset-right)); top: calc(max(10px, env(safe-area-inset-top)) + 48px); }
body.mobile .streak { display: none; }
body.mobile .card { padding: 16px 14px; }
body.mobile .card .title .stencil { font-size: 40px; }
body.mobile .plan { grid-template-columns: 1fr; padding: 12px; row-gap: 6px; }
body.mobile .plan-lbl { text-align: left; margin-top: 6px; }
body.mobile .gestures { grid-template-columns: repeat(2, 1fr); }
body.mobile .panel { bottom: max(8px, env(safe-area-inset-bottom)); }
@media (max-height: 500px) and (orientation: landscape) {
  body.mobile .hud .g-num { font-size: 26px; }
  body.mobile .q-echo { font-size: 20px; }
  body.mobile .gauge-right { display: none; }
  body.mobile .card.small { top: auto; bottom: 14px; transform: translateX(-50%); padding: 12px 22px; }
  body.mobile .armed-title { font-size: 20px; }
}
