@font-face{font-family:Arcade;src:url("/assets/fonts/barlow-condensed-latin-800-normal.woff2") format("woff2");font-weight:100 900;font-display:swap}
:root{color-scheme:dark;font-family:var(--font-body,ui-sans-serif,system-ui,sans-serif);background:#071020;--panel:rgba(5,8,15,.82)}
*{box-sizing:border-box}
html,body{width:100%;height:100%;margin:0;overflow:hidden;background:#030712}
button{font:inherit}
.game-shell{width:100%;height:100%;display:grid;place-items:center;padding:clamp(4px,1.5vw,18px);background:radial-gradient(circle at 50% 20%,#244ff0 0,#081535 50%,#02050c 100%)}
.game-shell[data-mode="ranked"]{background:radial-gradient(circle at 50% 18%,#263985 0,#0a102d 40%,#02030c 100%)}
.game-frame{position:relative;width:min(100%,calc(100vh * 16 / 9));aspect-ratio:16/9;max-height:100%;overflow:hidden;border:clamp(2px,.35vw,5px) solid #040609;border-radius:clamp(10px,1.6vw,24px);box-shadow:0 0 0 2px var(--accent),0 20px 70px rgba(0,0,0,.65),inset 0 0 40px rgba(0,0,0,.25);background:#1d55d8;isolation:isolate}
canvas{display:block;width:100%;height:100%;touch-action:none;cursor:pointer;outline:0}
canvas:focus-visible{box-shadow:inset 0 0 0 5px #fff}
.hud{position:absolute;inset:0;pointer-events:none;display:flex;align-items:flex-start;gap:12px;padding:clamp(8px,1.4vw,20px);text-transform:uppercase;text-shadow:2px 3px 0 #000}
.hud-cluster{display:grid;grid-template-columns:auto auto;align-items:end;gap:0 8px;color:#fff;font-weight:900;letter-spacing:.12em}
.hud-cluster strong{font-family:Arcade,Impact,sans-serif;font-size:clamp(26px,5vw,72px);line-height:.8;color:var(--accent)}
.hud-cluster span{font-size:clamp(8px,1vw,13px)}
.hud-secondary{grid-template-columns:auto auto auto auto;margin-top:4px;padding:8px 12px;background:rgba(0,0,0,.45);border:1px solid rgba(255,255,255,.22);border-radius:999px;text-shadow:none}
.hud-secondary strong{font-size:clamp(13px,1.8vw,24px)}
.hud-actions{margin-left:auto;display:flex;gap:8px;pointer-events:auto}
.hud-actions button{min-width:44px;min-height:44px;width:clamp(44px,4vw,50px);height:clamp(44px,4vw,50px);border:2px solid rgba(255,255,255,.45);border-radius:50%;background:rgba(0,0,0,.65);color:#fff;font-weight:900;cursor:pointer;box-shadow:2px 3px 0 #000}
.hud-actions button:hover,.hud-actions button:focus-visible{background:var(--accent);color:#050607;border-color:#050607;outline:2px solid #fff;outline-offset:2px}
.event-callout{position:absolute;z-index:4;left:50%;top:18%;margin:0;transform:translate(-50%,-12px) scale(.9);opacity:0;color:var(--accent);font-family:Arcade,Impact,sans-serif;font-size:clamp(24px,4vw,58px);letter-spacing:.04em;text-transform:uppercase;text-align:center;text-shadow:4px 5px 0 #000;pointer-events:none;transition:opacity .16s,transform .2s}
.event-callout.is-visible{opacity:1;transform:translate(-50%,0) scale(1)}
.overlay{position:absolute;inset:0;z-index:5;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:6%;background:linear-gradient(180deg,rgba(4,8,20,.22),rgba(4,8,20,.76));backdrop-filter:blur(2px);color:#fff}
.overlay.is-hidden{display:none}
.overlay .eyebrow{margin:0 0 8px;padding:6px 12px;border:2px solid currentColor;border-radius:999px;color:var(--accent);font-size:clamp(9px,1.2vw,14px);font-weight:900;letter-spacing:.28em;text-transform:uppercase;background:#080b12}
.overlay h1,.overlay h2{margin:0;font-family:Arcade,Impact,sans-serif;font-size:clamp(42px,9vw,122px);line-height:.76;letter-spacing:-.04em;text-transform:uppercase;text-shadow:5px 7px 0 #000}
.overlay h1 em{font-style:normal;color:var(--accent);font-size:.62em}
.overlay h2#resultScore{font-size:clamp(82px,18vw,220px);color:var(--accent)}
.overlay>p:not(.eyebrow){max-width:610px;margin:clamp(12px,2vw,26px) 0;color:#e6edff;font-size:clamp(12px,1.7vw,20px);font-weight:700;line-height:1.45}
.primary-button{min-width:min(320px,80%);padding:clamp(12px,1.5vw,18px) 30px;border:3px solid #050607;border-radius:999px;background:var(--accent);color:#050607;font-family:Arcade,Impact,sans-serif;font-size:clamp(16px,2vw,28px);letter-spacing:.08em;text-transform:uppercase;box-shadow:6px 7px 0 #050607;cursor:pointer;transition:transform .15s,box-shadow .15s}
.primary-button:hover,.primary-button:focus-visible{transform:translate(2px,2px);box-shadow:3px 4px 0 #050607;outline:3px solid #fff;outline-offset:3px}
.primary-button:disabled{filter:grayscale(.7);cursor:wait}
.overlay small{margin-top:18px;font-size:clamp(8px,1vw,12px);font-weight:800;letter-spacing:.18em;text-transform:uppercase}
.result-stats{display:flex;gap:10px;flex-wrap:wrap;justify-content:center;margin:0 0 22px}
.result-stats span{padding:8px 12px;border:1px solid rgba(255,255,255,.3);border-radius:999px;background:rgba(0,0,0,.6);font-size:clamp(10px,1.2vw,14px);font-weight:900;letter-spacing:.1em;text-transform:uppercase}
.replay-timeline{position:relative;display:flex;align-items:flex-end;gap:3px;width:min(520px,86%);height:42px;margin:-10px 0 18px;padding:5px 7px;border:1px solid rgba(255,255,255,.24);border-radius:10px;background:rgba(0,0,0,.55);cursor:pointer}
.replay-timeline span{flex:1;min-height:3px;border-radius:2px 2px 0 0;background:linear-gradient(180deg,#fff,var(--accent));box-shadow:0 0 8px color-mix(in srgb,var(--accent) 55%,transparent)}
.replay-playhead{position:absolute;top:3px;bottom:3px;width:2px;background:#fff;box-shadow:0 0 8px #fff;pointer-events:none;left:0}
.overlay.is-replaying{background:linear-gradient(180deg,rgba(4,8,20,.06),rgba(4,8,20,.62));justify-content:flex-end;padding-bottom:3%}
.overlay.is-replaying h2#resultScore{font-size:clamp(36px,7vw,84px)}
.overlay.is-replaying>p:not(.eyebrow){display:none}
.result-actions,.pause-actions{display:flex;gap:14px;flex-wrap:wrap;justify-content:center;width:min(680px,90%)}
.result-actions .primary-button{min-width:min(280px,100%)}
#resultOverlay button{min-height:44px}
.secondary-button{padding:clamp(10px,1.4vw,16px) 24px;border:2px solid #fff;border-radius:999px;background:rgba(0,0,0,.72);color:#fff;font-family:Arcade,Impact,sans-serif;font-size:clamp(13px,1.6vw,21px);letter-spacing:.07em;text-transform:uppercase;cursor:pointer}
.secondary-button:hover,.secondary-button:focus-visible{background:#fff;color:#050607;outline:3px solid var(--accent);outline-offset:3px}
.share-row-mount{width:min(680px,90%)}.share-row{display:flex;gap:10px;flex-wrap:wrap;justify-content:center;margin-top:12px}.share-row .share-button{display:inline-flex;align-items:center;min-height:44px;padding:8px 18px;font-size:clamp(12px,1.4vw,17px);text-decoration:none}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:700px){.game-shell{padding:0}.game-frame{width:100%;border-radius:0;border-left:0;border-right:0}.hud{padding:8px}.hud-secondary{display:grid;position:absolute;left:8px;top:54px;grid-template-columns:auto auto auto auto;gap:0 5px;padding:5px 8px}.hud-secondary strong{font-size:13px}.hud-secondary span{font-size:11px}.hud-actions{position:absolute;top:54px;right:8px;gap:4px;margin-left:0}.hud-actions button{width:44px;height:44px}.hud-actions #muteButton,.hud-actions #fullscreenButton,.hud-actions #exitButton{display:none}.event-callout{top:24%;font-size:24px}.overlay>p:not(.eyebrow){margin:10px 0}.primary-button{min-width:70%}}
@media(max-height:400px){#startOverlay,#pauseOverlay,#resultOverlay{padding:4px 2%;justify-content:center}#startOverlay .eyebrow,#pauseOverlay .eyebrow,#resultOverlay .eyebrow{margin:0 0 2px;padding:2px 7px;font-size:11px;letter-spacing:.12em}#startOverlay h1{font-size:34px;line-height:.7;text-shadow:2px 3px 0 #000}#startOverlay>p:not(.eyebrow){max-width:94%;margin:4px 0;font-size:11px;line-height:1.3}#startOverlay small{margin-top:4px;font-size:11px;letter-spacing:.04em}#startOverlay .primary-button{min-width:58%;min-height:44px;padding:5px 12px;font-size:11px;box-shadow:2px 2px 0 #050607}#pauseOverlay h2{font-size:42px;margin-bottom:8px}.pause-actions{width:92%;gap:6px;flex-wrap:nowrap}.pause-actions button{min-width:0;min-height:44px;flex:1;padding:6px 8px;font-size:11px;box-shadow:2px 2px 0 #050607;white-space:nowrap}#resultOverlay h2#resultScore{font-size:42px;line-height:.72;text-shadow:2px 3px 0 #000}#resultOverlay>p:not(.eyebrow){display:block;max-width:94%;margin:2px 0;font-size:11px;line-height:1.3}.result-stats{gap:3px;margin:3px 0;flex-wrap:nowrap}.result-stats span{padding:2px 5px;font-size:11px;letter-spacing:.02em;white-space:nowrap}.replay-timeline{height:18px;width:min(420px,88%);margin:0 0 3px;padding:2px 4px;gap:2px}.result-actions{width:96%;gap:5px;flex-wrap:nowrap}.result-actions .primary-button,.result-actions .secondary-button{min-width:0;min-height:44px;padding:4px 7px;border-width:2px;font-size:11px;letter-spacing:.02em;box-shadow:2px 2px 0 #050607;white-space:nowrap}.result-actions .primary-button{flex:1.15}.result-actions .secondary-button{flex:1}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}.overlay{backdrop-filter:none}}

/* Afterlight: warm metal, coastal haze and Chikun's original red/charcoal palette. */
:root{--accent:var(--site-brass,#dfc48c);--panel:rgba(12,27,41,.90)}
.game-shell,.game-shell[data-mode="ranked"]{background:radial-gradient(ellipse at 50% 35%,#244458,#081421 75%);--accent:var(--site-brass,#ead09b);padding:clamp(0px,1.2vw,18px)}
.game-shell[data-mode="ranked"]{--accent:var(--site-brass,#f0c67f)}
.game-frame{border:1px solid #60757c;border-radius:14px;box-shadow:0 24px 90px #0008,0 0 0 7px #0b1c2859;background:#163146}
.hud{padding:24px;text-shadow:none;color:#e8e5d7}
.hud-cluster{letter-spacing:.1em;gap:4px 10px;background:#122738b5;border:1px solid #b4cbc329;border-radius:8px;padding:12px 16px}
.hud-cluster strong{font-size:clamp(26px,3.5vw,46px);font-family:ui-sans-serif,system-ui;font-variant-numeric:tabular-nums;font-weight:700;color:#f3e5c8}
.hud-cluster span{font-size:11px;opacity:.75;align-self:center}
.hud-secondary{gap:3px 9px;margin-top:0;border-radius:8px;padding:12px 14px}
.hud-secondary strong{font-size:17px;color:#c5e4d9}
.hud-actions button{border:1px solid #a6c3c457;background:#152a3abf;border-radius:9px;box-shadow:none;color:#e8e9da;font-size:18px}
.hud-actions button:hover,.hud-actions button:focus-visible{background:#d6c395;color:#162c3b;outline-offset:3px}
.overlay{backdrop-filter:none;background:linear-gradient(90deg,#10233500,#0e21368c);padding:5%;color:#f5ebd6}
#startOverlay{left:44%;align-items:flex-start;text-align:left;padding:6% 7% 6% 3%;background:linear-gradient(90deg,transparent,#10243540)}
/* The start column grows when the session's course copy arrives; anchoring it to the bottom keeps Start Running where it is (no jump under a finger or cursor). `safe` keeps a tall column scrollable; older engines keep centring. */
@media(min-height:401px){#startOverlay{justify-content:center;justify-content:safe flex-end;padding-top:4%;padding-bottom:4%}#startOverlay>p#modeCopy{margin:16px 0}}
#startOverlay h1{font-family:Arcade,Impact,ui-sans-serif,sans-serif;font-weight:900;font-size:clamp(38px,6.8vw,88px);line-height:.9;letter-spacing:-.025em;text-shadow:0 5px 25px #0b243b45}
#startOverlay h1 em{font-size:1.2em;color:#f4e4c1;display:inline-block;margin-top:8px;letter-spacing:.005em}
.overlay .eyebrow{border:0;border-radius:0;border-left:2px solid #e0c08b;background:transparent;padding:2px 0 2px 12px;margin-bottom:20px;font-size:11px;letter-spacing:.18em;color:#e8d6b6}
#startOverlay>p:not(.eyebrow){font-size:clamp(11px,1.2vw,16px);font-weight:400;line-height:1.65;color:#d6e2df;max-width:390px;margin:22px 0}
.primary-button{border:1px solid #f0deb7;border-radius:7px;box-shadow:0 5px 24px #081a3338;background:#e8c78b;color:#1e303d;padding:15px 25px;font:800 15px ui-sans-serif,system-ui;letter-spacing:.12em;min-width:250px;min-height:48px}
.primary-button:hover,.primary-button:focus-visible{background:#ffdfa2;box-shadow:0 5px 28px #e8c78b35;transform:translateY(-1px)}
.overlay small{font-size:11px;line-height:1.8;font-weight:500;letter-spacing:.05em;color:#b9cecf;margin-top:18px}
.secondary-button{border:1px solid #8aabaa;background:#163044d6;border-radius:7px;font:700 12px ui-sans-serif,system-ui;letter-spacing:.07em;padding:14px 20px}
.event-callout{font:800 clamp(21px,3vw,36px) ui-sans-serif,system-ui;text-shadow:0 3px 14px #142b3f;letter-spacing:.06em;color:#f2d497}
.overlay h2{font-family:Arcade,Impact,system-ui;letter-spacing:.01em;text-shadow:0 4px 25px #06192b}
.result-stats span{border-radius:5px;border:1px solid #97beb845;background:#152b3bbd;font-size:11px;font-weight:600;letter-spacing:.04em}
#resultOverlay,#pauseOverlay{background:linear-gradient(180deg,#071a2b73,#0d223adf)}
.replay-timeline{border-radius:5px;background:#0e2338b8;border-color:#94b6ac45}
.game-shell[data-phase="ready"] .hud-cluster,.game-shell[data-phase="waiting"] .hud-cluster{visibility:hidden}
@media(max-width:700px){
 .game-shell{padding:0}.game-frame{border-radius:0}.hud{padding:8px}.hud-cluster{padding:7px 9px}.hud-secondary{top:58px;padding:5px 8px;gap:0 5px}.hud-secondary strong{font-size:12px}.hud-actions{top:8px}.hud-actions button{border-radius:7px}
 #startOverlay{left:40%;padding:3% 4% 3% 2%}#startOverlay h1{font-size:clamp(23px,6.5vw,42px)}#startOverlay .eyebrow{font-size:11px;margin-bottom:7px;padding-left:6px}#startOverlay>p:not(.eyebrow){font-size:11px;line-height:1.35;margin:9px 0}#startOverlay .primary-button{min-width:0;width:100%;font-size:11px;padding:8px 12px;min-height:44px}#startOverlay small{font-size:11px;letter-spacing:0;margin-top:5px;line-height:1.4}
 .overlay{padding:3%}.overlay h2#resultScore{font-size:64px}.result-stats{gap:4px;margin:6px 0 12px}.result-stats span{font-size:11px;padding:4px 7px}.result-actions,.pause-actions{gap:6px;width:98%}.result-actions button{padding:8px 10px;font-size:11px}.result-actions .primary-button{min-width:100px}.replay-timeline{margin:0 0 10px;height:24px}.overlay .eyebrow{font-size:11px;margin-bottom:8px}
}
@media(max-height:400px){#startOverlay h1{font-size:34px}#startOverlay .eyebrow{margin-bottom:6px;font-size:11px}#startOverlay>p:not(.eyebrow){font-size:11px;margin:8px 0;line-height:1.35}#startOverlay .primary-button{min-width:0;min-height:44px;font-size:11px;padding:6px 14px}#startOverlay small{font-size:11px;margin-top:6px}.hud{padding:8px}.hud-cluster{padding:7px 12px}.hud-cluster strong{font-size:26px}.hud-secondary strong{font-size:14px}}
@media(max-height:260px){#startOverlay{left:42%;padding:8px}#startOverlay h1{font-size:27px;line-height:.82}#startOverlay h1 em{margin-top:4px}#startOverlay .eyebrow{font-size:11px;margin-bottom:8px}#startOverlay #modeCopy{display:none}#startOverlay .primary-button{margin-top:12px;font-size:11px}#startOverlay small{font-size:11px;margin-top:6px}#resultOverlay .result-stats span{font-size:11px;padding:2px 4px}#resultOverlay .result-stats{margin:4px 0}#resultOverlay .replay-timeline{height:18px;margin:0 0 4px}#resultOverlay h2#resultScore{font-size:42px}#resultOverlay .result-actions{gap:4px}#resultOverlay .result-actions button{padding:4px 6px;font-size:11px;min-width:0}}
@media(max-width:700px) and (max-height:260px){.hud-cluster{padding:7px 8px;gap:3px 5px}.hud-cluster strong{font-size:22px}.hud-cluster span{font-size:11px}.hud-secondary{left:112px;top:8px;padding:6px 7px;gap:1px 4px}.hud-secondary strong{font-size:11px}.hud-secondary span{font-size:11px}}

.event-callout{font-size:clamp(14px,1.7vw,22px);font-weight:650;letter-spacing:.035em;top:15%;}

.game-shell,.game-shell[data-mode="ranked"]{padding:0}
.game-frame{border:0;border-radius:0;box-shadow:none;width:min(100%,calc(100dvh * 16 / 9))}
@media(orientation:portrait){
 .game-frame{width:min(100%,calc(100dvh * 9 / 16));aspect-ratio:9/16;max-height:100dvh}
 .hud{padding:max(10px,env(safe-area-inset-top)) 12px 10px}
 /* Keep the left flight column clear at every altitude. The 166-unit character
    is centred at 26% of the portrait camera; HUD panels start past its edge. */
 .hud>.hud-cluster:first-child{margin-left:auto;width:44%;padding:8px;gap:4px;grid-template-columns:minmax(0,1fr) auto}
 .hud>.hud-cluster:first-child strong{font-size:clamp(16px,4.5vw,22px);letter-spacing:0}
 .hud>.hud-cluster:first-child span{font-size:11px;letter-spacing:.04em}
 .hud-secondary{top:68px;left:auto;right:12px;width:44%;grid-template-columns:minmax(0,1fr) auto;padding:7px 8px;gap:3px 5px}
 .hud-secondary strong{font-size:12px;letter-spacing:0}.hud-secondary span{font-size:11px;letter-spacing:.04em}
 .hud-actions{top:auto;bottom:max(12px,env(safe-area-inset-bottom));right:12px}
 .event-callout{top:166px;left:auto;right:12px;width:44%;font-size:14px;text-align:right;transform:translateY(-12px)}
 .event-callout.is-visible{transform:translateY(0)}
 #startOverlay{inset:0;padding:28px 24px 42px;align-items:center;justify-content:flex-end;text-align:center;background:linear-gradient(180deg,transparent 38%,#102435c9)}
 #startOverlay h1{font-size:45px;line-height:.9}
 #startOverlay .eyebrow{font-size:11px;margin-bottom:14px}
 #startOverlay>p:not(.eyebrow){font-size:13px;max-width:290px;line-height:1.5;margin:18px 0}
 #startOverlay .primary-button{width:100%;min-height:52px;font-size:15px}
 #startOverlay small{font-size:11px;line-height:1.5;margin-top:15px}
 .overlay{padding:24px 16px;background:linear-gradient(180deg,#10233545,#0e2136eb)}
 .result-actions{display:grid;grid-template-columns:1fr 1fr;width:100%;gap:10px}
 .result-actions button{min-width:0;min-height:48px;font-size:12px}
 .result-stats{gap:8px;margin:14px 0}
 .result-stats span{font-size:11px;padding:7px 9px}
 .replay-timeline{height:38px;margin:12px 0 22px}
 #resultOverlay h2#resultScore{font-size:94px}
 #pauseOverlay .pause-actions{grid-template-columns:1fr 1fr;gap:12px}
 #pauseOverlay .pause-actions button{font-size:12px;min-height:50px}
 #pauseOverlay #resumeButton{grid-column:1/-1}
}

@media(max-width:700px){
 .pause-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
 .pause-actions button{min-width:0;min-height:44px;padding:7px 3px;font-size:11px;letter-spacing:0;white-space:normal}
 #pauseOverlay h2{font-size:34px;margin-bottom:6px}
}
/* Flight readiness, a short control guide and accessible replay transport. */
#startOverlay>p.flight-tip{font-size:12px;line-height:1.5;margin:0 0 14px;color:#efe0bd;max-width:390px}
#startOverlay>p.asset-status{flex:0 0 auto;min-height:1.4em;font-size:11px;line-height:1.4;margin:10px 0 0;color:#efce95}
.asset-status[hidden]{display:block;visibility:hidden}
.load-progress{flex:0 0 auto;width:min(250px,100%);height:4px;margin:10px 0 0;border-radius:2px;background:#ffffff24;overflow:hidden;transition:opacity .35s ease .15s}
.load-progress>span{display:block;height:100%;width:calc(var(--p,0) * 100%);background:linear-gradient(90deg,#c9a46a,#ffdfa2);transition:width .25s ease-out}
.load-progress.is-done{opacity:0}
@media(prefers-reduced-motion:reduce){.load-progress,.load-progress>span{transition:none}}
.primary-button:disabled{opacity:.65;cursor:wait;transform:none}
.replay-readout{display:flex;gap:20px;align-items:center;justify-content:center;color:#d6e2df;font:12px ui-sans-serif,system-ui;font-variant-numeric:tabular-nums;margin:0 0 12px}
.replay-readout label{display:flex;align-items:center;gap:8px}
.replay-readout select{min-height:44px;padding:6px 12px;background:#163044;color:#f5ebd6;border:1px solid #8aabaa;border-radius:5px}
.replay-timeline{touch-action:none;min-height:28px}
button:focus-visible,select:focus-visible,.replay-timeline:focus-visible{outline:3px solid #ffe0a1;outline-offset:3px}
@media(max-width:700px){#startOverlay>p.flight-tip{font-size:11px;max-width:95%;margin:0 0 9px}#startOverlay>p.asset-status{font-size:11px;margin:5px 0}.replay-readout{gap:12px;font-size:11px;margin-bottom:6px}}
@media(max-height:450px){#startOverlay>p.flight-tip{font-size:11px;line-height:1.3;margin:0 0 5px}#startOverlay>p.asset-status{font-size:11px;margin:2px 0}.replay-readout{position:absolute;right:8px;top:8px;flex-direction:column;gap:2px;margin:0;font-size:11px}.replay-readout label{font-size:0}.replay-readout select{font-size:11px;min-height:44px}.result-stats{max-width:90%;flex-wrap:wrap}}

.route-readout{position:absolute;left:14px;bottom:16px;margin:0;padding:5px 9px;background:#152b3bbd;border-radius:4px;color:#e2d8b4;font:600 11px system-ui;pointer-events:none}
.skip-death{position:absolute;bottom:16px;right:16px;z-index:8;min-height:44px}
.skip-death[hidden]{display:none}
#speedValue{font-size:16px}
.overlay{overflow-y:auto}
@media(orientation:portrait){.route-readout{bottom:8px;font-size:11px}#startOverlay{padding-top:100px;padding-bottom:24px}#startOverlay>p:not(.eyebrow){margin:10px 0}#startOverlay small{margin-top:8px}.hud-secondary{top:65px}}

.mode-tease{display:flex;flex-wrap:wrap;gap:8px;list-style:none;margin:0 0 14px;padding:0;max-width:390px}
.mode-tease li{display:flex;flex-direction:column;gap:2px;padding:7px 11px;border:1px solid #d6c39a55;border-left:2px solid #e0c08b;border-radius:5px;background:#12283899;color:#efe0bd;font:600 11px/1.35 ui-sans-serif,system-ui;letter-spacing:.08em;text-transform:uppercase;text-align:left}
.mode-tease li span{font-weight:400;letter-spacing:.02em;text-transform:none;color:#d6e2df}
.mode-tease:empty{display:none}
@media(max-width:700px){.mode-tease{gap:5px;margin:0 0 8px;max-width:95%}.mode-tease li{padding:4px 7px;font-size:11px}.mode-tease li span{display:none}}
@media(max-height:450px){.mode-tease{gap:4px;margin:0 0 5px}.mode-tease li{padding:3px 6px;font-size:11px}.mode-tease li span{display:none}}
@media(max-height:260px){.mode-tease{display:none}}
@media(orientation:portrait){.mode-tease{justify-content:center;max-width:290px}.mode-tease li{text-align:center;align-items:center}}
.run-objectives{font:11px/1.6 system-ui;color:#d9d9bd;max-width:500px;margin:0 0 8px}.result-actions{flex-wrap:wrap}

/* Ranked onboarding copy (2026-09-26): start-overlay explainer and the Free results hint. Copy only. */
.ranked-help{width:100%;max-width:390px;margin:12px 0 0;text-align:left;font:12px/1.55 ui-sans-serif,system-ui;color:#d6e2df}
.ranked-help summary{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;min-height:44px;padding:6px 0;border-top:1px solid #d6c39a55;cursor:pointer;list-style:none;font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#efe0bd}
.ranked-help summary::-webkit-details-marker{display:none}
.ranked-help summary::before{content:"";width:0;height:0;border:4px solid transparent;border-left:6px solid #e0c08b;transition:transform .15s}
.ranked-help[open] summary::before{transform:rotate(90deg)}
.ranked-help summary span{font-weight:400;letter-spacing:.02em;text-transform:none;color:#d6e2df}
.ranked-help summary:focus-visible{outline:3px solid #ffe0a1;outline-offset:3px}
.ranked-help-body p{margin:6px 0;font-size:inherit;font-weight:400;line-height:inherit;color:inherit;overflow-wrap:anywhere}
.ranked-help a,#resultOverlay>p.ranked-hint a{color:#f4e4c1;text-decoration:underline;text-underline-offset:3px}
.ranked-help a:focus-visible,#resultOverlay>p.ranked-hint a:focus-visible{outline:3px solid #ffe0a1;outline-offset:3px}
#resultOverlay>p.ranked-hint{width:min(680px,90%);max-width:none;margin:12px 0 0;font:600 12px/1.5 ui-sans-serif,system-ui;color:#d6e2df}
.game-shell[data-mode="ranked"] .ranked-hint{display:none}
@media(max-width:700px){.ranked-help{max-width:95%;margin-top:6px;font-size:11px;line-height:1.35}.ranked-help summary{min-height:40px;padding:4px 0;font-size:11px}#resultOverlay>p.ranked-hint{width:98%;margin-top:8px;font-size:11px}}
@media(orientation:portrait){.ranked-help{max-width:290px;font-size:11px;line-height:1.45}.ranked-help[open] .ranked-help-body{max-height:34dvh;overflow-y:auto}}
@media(max-height:450px){.ranked-help{margin-top:4px;font-size:11px;line-height:1.3}.ranked-help summary{min-height:32px;padding:2px 0;font-size:11px}}
@media(max-height:260px){.ranked-help{display:none}}
.sfx-volume{display:flex;align-items:center;flex-wrap:wrap;gap:.6rem;flex:1 1 100%;padding:.6rem .8rem;color:#f0e7ce;font-size:.85rem;background:#112a35;border:1px solid #9b855745;border-radius:10px;}
.sfx-volume output{margin-left:auto;font-variant-numeric:tabular-nums;}
.sfx-volume input{flex:1 1 100%;width:100%;min-width:0;accent-color:#dabb76;}
.sfx-volume input:focus-visible{outline:2px solid #e7cc8d;outline-offset:4px;}

/* 2.4.0 shared pause menu: the five-action rail, one open section below it
   (Settings or Music), and a scrollable overlay that centres when it fits. */
#pauseOverlay{justify-content:flex-start;overflow-y:auto;overscroll-behavior:contain}
#pauseOverlay>:first-child{margin-top:auto}
#pauseOverlay>:last-child{margin-bottom:auto}
#pauseOverlay .pause-actions{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;width:min(720px,100%);margin:14px 0 4px}
#pauseOverlay .pause-actions #resumeButton{grid-column:auto}
#pauseOverlay .pause-actions button{min-width:0;min-height:48px;padding:8px 6px;font-size:12px;letter-spacing:.04em;white-space:normal}
#pauseOverlay .pause-note{max-width:min(720px,100%);margin:6px 0 0;font:600 12px/1.45 ui-sans-serif,system-ui;color:#d6e2df}
#pauseOverlay .pause-section{width:min(720px,100%);margin-top:10px}
#pauseOverlay .pause-section[hidden]{display:none}
#pauseOverlay .pause-settings{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
#pauseOverlay .pause-settings .sfx-volume{grid-column:1/-1;margin:0}
#pauseOverlay .pause-settings h3{grid-column:1/-1;margin:4px 0 0;text-align:left}
#pauseOverlay .pause-settings button{min-width:0;min-height:44px;font-size:12px}
#pauseOverlay .pause-music .arcade-music-panel__list{max-height:min(34dvh,280px)}
@media(max-width:700px),(orientation:portrait){
 #pauseOverlay .pause-actions{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
 #pauseOverlay .pause-actions #resumeButton{grid-column:1/-1}
 #pauseOverlay .pause-actions button:not(#resumeButton){flex-direction:column;gap:3px;padding:6px 2px;font-size:11px}
 #pauseOverlay .pause-settings{grid-template-columns:1fr 1fr}
}
@media(max-height:450px){
 #pauseOverlay{padding:8px 3%}
 #pauseOverlay h2{font-size:30px;margin-bottom:2px}
 #pauseOverlay .pause-actions{margin:6px 0 2px}
 #pauseOverlay .pause-actions button{min-height:44px;padding:4px;font-size:11px}
 #pauseOverlay .arcade-music-panel{gap:6px;padding:8px}
 #pauseOverlay .arcade-music-panel__list{max-height:30dvh}
}

/* 2.5.1: the start-screen intro and control tip sat straight on the bright sky
   (well under 4.5:1). A dark backing panel keeps them readable on every region,
   day or night; the worst case (white sky behind the panel) stays above 7:1. */
#startOverlay>p#modeCopy,#startOverlay>p.flight-tip{background:rgba(8,22,34,.86);padding:8px 12px;border-radius:6px;box-shadow:0 2px 14px rgba(4,10,18,.25)}
#startOverlay>p#modeCopy{color:#e3ebe8}
@media(max-height:450px){#startOverlay>p#modeCopy,#startOverlay>p.flight-tip{padding:4px 8px}}

/* 2.5.1: "Share on X" and "More sharing" used their own larger pill style
   under the results grid. The share row now takes the same grid, gap and
   button size as the result actions above it (arcade-game-ui.css), so the
   eight results controls read as one set. */
.game-shell #resultOverlay #shareRow{width:100%}
.game-shell #resultOverlay #shareRow .share-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;width:100%;margin-top:10px}
.game-shell #resultOverlay #shareRow .share-button{display:flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:0;min-height:44px;margin:0;padding:10px 8px;font-size:12px;letter-spacing:.02em;white-space:normal;text-align:center;text-decoration:none}
@media(max-width:600px){.game-shell #resultOverlay #shareRow .share-row{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* 2.5.1: in portrait the pause button sat at the bottom-right, exactly where
   pits, waterfalls and ground hazards enter (measured at 390x844: a pit was
   up to 72% hidden behind it as it came on screen). It now shares the top
   row with the score panel, which already occupies that band, so it hides
   nothing new; the score panel gives up the button's width. */
@media(orientation:portrait){
 .hud>.hud-cluster:first-child{width:calc(44% - 50px);margin-right:50px}
 .hud-actions{top:max(10px,env(safe-area-inset-top));bottom:auto}
}

/* Daily course extras (next-update plan, Chikun #2): live reset countdown,
   on-device streak and the race-your-best ghost. The start card is a
   sibling of the start overlay, so it never lengthens the start column:
   bottom-left beside Chikun in landscape, a strip across the top in portrait.
   Tabular figures and a fixed minimum width keep the ticking countdown from
   reflowing its line. */
.daily-panel{position:absolute;z-index:6;left:clamp(10px,1.6vw,22px);bottom:clamp(40px,7%,64px);width:min(340px,36%);padding:8px 12px;border-radius:6px;background:rgba(8,22,34,.88);box-shadow:0 2px 14px rgba(4,10,18,.25);color:#d6e2df}
.daily-panel[hidden]{display:none}
.daily-line,#gameShell #resultOverlay>p.daily-meta{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 12px;margin:0 0 6px;color:#d6e2df;font:600 12px/1.4 ui-sans-serif,system-ui}
/* #gameShell outranks the shared results paragraph rule in arcade-game-ui.css. */
#gameShell #resultOverlay>p.daily-meta{justify-content:center;width:auto;max-width:610px;margin:0 0 10px;padding:6px 12px;border-radius:6px;background:rgba(8,22,34,.86)}
#gameShell #resultOverlay>p.daily-meta[hidden]{display:none}
.daily-countdown{display:inline-block;min-width:8.4ch;color:#f3e5c8;font-weight:800;font-variant-numeric:tabular-nums;letter-spacing:.02em}
.daily-streak,#resultStreak{color:#efce95}
.daily-streak:empty,#resultStreak:empty{display:none}
.daily-actions{display:flex;flex-wrap:wrap;gap:6px}
.daily-chip{min-height:44px;padding:6px 12px;border:1px solid #8aabaa;border-radius:7px;background:#163044d6;color:#f5ebd6;font:700 11px ui-sans-serif,system-ui;letter-spacing:.05em;cursor:pointer}
.daily-chip[aria-pressed="false"]{color:#b9cecf;border-style:dashed}
.daily-chip:hover,.daily-chip:focus-visible{background:#f5ebd6;color:#162c3b}
.daily-ghost{margin:6px 0 0;color:#b9cecf;font:500 11px/1.4 ui-sans-serif,system-ui}
.daily-ghost:empty{display:none}
@media(max-width:700px),(max-height:450px){.daily-panel{padding:5px 8px;bottom:36px;width:min(300px,38%)}.daily-line{font-size:11px;gap:0 8px;margin:0 0 4px}.daily-chip{padding:3px 8px;font-size:11px;letter-spacing:.02em}.daily-ghost{font-size:11px;margin-top:3px}#gameShell #resultOverlay>p.daily-meta{font-size:11px;padding:4px 10px;margin:0 0 6px}}
/* Portrait: a strip across the top that stops short of the pause button. */
@media(orientation:portrait){.daily-panel{left:8px;right:64px;top:max(8px,env(safe-area-inset-top));bottom:auto;width:auto;padding:5px 8px}.daily-line{margin:0 0 4px;font-size:11px}.daily-actions{flex-wrap:nowrap}.daily-chip{padding:3px 9px;font-size:11px}.daily-ghost{margin:4px 0 0;font-size:11px}}
/* Level-start intro (intro.mjs): "Let's Get Lit!" callout, the 3-2-1 countdown and GO. Overlay only, never takes input. */
.intro-overlay{position:absolute;inset:0;z-index:5;pointer-events:none}
.intro-overlay[hidden]{display:none}
.intro-callout{position:absolute;right:4%;top:22%;margin:0;max-width:44%;color:#ffd447;font:900 clamp(30px,6.2vw,88px)/.95 Arcade,Impact,ui-sans-serif,system-ui,sans-serif;letter-spacing:.02em;text-transform:uppercase;text-align:right;-webkit-text-stroke:2px #3a0710;text-shadow:0 5px 0 #c8102e,0 10px 22px rgba(0,0,0,.55);opacity:0;transform:rotate(-6deg) scale(.6);transition:opacity .14s,transform .26s cubic-bezier(.2,1.6,.4,1)}
.intro-callout.is-visible{opacity:1;transform:rotate(-6deg) scale(1)}
.intro-count{position:absolute;left:50%;top:36%;margin:0;transform:translate(-50%,-50%);color:#fff;font:900 clamp(64px,12vw,170px)/1 Arcade,Impact,ui-sans-serif,system-ui,sans-serif;-webkit-text-stroke:3px #04121f;text-shadow:0 7px 0 #c8102e,0 14px 30px rgba(0,0,0,.5);opacity:0}
.intro-count.is-visible{opacity:1;animation:introCount .9s ease-out both}
.intro-count[data-label="READY"]{font-size:clamp(36px,6vw,84px);color:#f2d497;animation:none}
.intro-count[data-label="GO!"]{color:#2dff5c}
.game-shell[data-mode="ranked"] .intro-count[data-label="GO!"]{color:#ffe138}
.intro-skip{position:absolute;left:50%;bottom:8%;margin:0;transform:translateX(-50%);padding:6px 14px;border-radius:999px;background:rgba(4,12,22,.6);color:#d9e6ea;font:700 13px ui-sans-serif,system-ui;letter-spacing:.08em;text-transform:uppercase;opacity:0;transition:opacity .3s}
.intro-skip.is-visible{opacity:.85}
@keyframes introCount{0%{transform:translate(-50%,-50%) scale(1.6);opacity:0}18%{transform:translate(-50%,-50%) scale(1);opacity:1}80%{opacity:1}100%{transform:translate(-50%,-50%) scale(.92);opacity:.0}}
[data-reduce-motion="true"] .intro-count.is-visible{animation:none}
[data-reduce-motion="true"] .intro-callout{transition:none;transform:none}
@media(prefers-reduced-motion:reduce){.intro-count.is-visible{animation:none}.intro-callout{transform:none}}
@media(max-width:700px),(orientation:portrait){.intro-callout{right:auto;left:4%;top:8%;max-width:50%;text-align:left;font-size:clamp(24px,8vw,44px);transform-origin:left top}.intro-count{top:40%}}
/* Beta 2.11: the landscape-phone type floor is 9 px (it was 6-8 px) and the result copy stays visible there (game.css @media max-height blocks above). */
/* Phone landscape (lane 360): the start column used to run under the HUD button row and overflow.
   It now starts below the row, the title sits on one line, the course copy keeps a four-line box
   (no jump when the session's copy arrives), and touch phones drop the keyboard legend. */
@media(max-height:450px){#startOverlay{padding-top:60px;justify-content:flex-start}#startOverlay h1{font-size:30px;line-height:1;white-space:nowrap}#startOverlay h1 br{display:none}#startOverlay h1 em{display:inline;margin:0 0 0 .25em;font-size:1em}#startOverlay>p#modeCopy{min-height:calc(4 * 1.35em)}}
@media(max-height:450px) and (pointer:coarse){#startOverlay small{display:none}}
.route-readout{transition:opacity .25s ease}
.game-shell[data-chase] .route-readout{opacity:0}
/* 2026-10-22 polish: a HUD panel fades while Chikun flies behind it; the portrait intro hint sits clear of him; touch screens skip the keyboard legend. */
.hud-cluster{transition:opacity .16s ease-out}.hud-cluster.is-behind{opacity:.28}
@media(orientation:portrait){.intro-skip{bottom:auto;top:calc(max(10px,env(safe-area-inset-top)) + 190px);font-size:12px;white-space:nowrap}}
@media(pointer:coarse){#startOverlay small{display:none}}
/* Portrait start: tighter copy leaves a band for Chikun under the daily panel. */
@media(orientation:portrait) and (max-width:700px){#startOverlay>p#modeCopy,#startOverlay>p.flight-tip{font-size:13px;line-height:1.38;margin:8px 0}#startOverlay h1{margin-top:0}}
/* Results: the live HUD hides under the result card (its labels collided with the score on phones), and on a portrait phone the actions come right after the score, so Run Again needs no scroll. */
.game-shell:has(#resultOverlay:not(.is-hidden)) .hud-cluster{visibility:hidden}
@media(orientation:portrait) and (max-width:700px){#resultOverlay>.result-actions{order:1;margin:6px 0 12px}#resultOverlay>#resultStats,#resultOverlay>.run-objectives,#resultOverlay>.replay-timeline,#resultOverlay>.replay-readout,#resultOverlay>#shareRow,#resultOverlay>p.ranked-hint{order:2}}
/* ---- 2026-10-23 title screen ------------------------------------------------
   The wordmark lockup in the key art's colours (cream fill, red extrusion, navy
   outline, a forward skew), then one card: mode, the day's numbers, Start and a
   picture of how to play. Chikun stands on the ground beside it (main.mjs). */
@font-face{font-family:"Chikun Display";src:url("../assets/fonts/barlow-condensed-latin-800-normal.woff2") format("woff2");font-weight:800;font-display:swap}
#gameShell #startOverlay{left:44%;right:0;padding:clamp(14px,3.2vh,44px) clamp(16px,3.4vw,60px) clamp(14px,3vh,40px) clamp(8px,1.4vw,24px);justify-content:center;align-items:stretch;gap:clamp(8px,1.8vh,20px);text-align:left;background:linear-gradient(90deg,rgba(7,17,29,0) 0%,rgba(7,17,29,.42) 22%,rgba(7,17,29,.7) 100%);backdrop-filter:none}
#gameShell .start-title{display:flex;flex-direction:column;align-items:flex-start;gap:clamp(4px,1vh,10px)}
#gameShell #startOverlay .eyebrow{margin:0;padding:4px 10px;border-left:0;border-radius:999px;background:rgba(244,228,193,.14);color:#f6dd9c;font:700 clamp(11px,1vw,12px)/1.3 ui-sans-serif,system-ui;letter-spacing:.14em;text-transform:uppercase}
#gameShell #startOverlay h1.wordmark{margin:0;font-family:"Chikun Display",Impact,"Arial Black",sans-serif;font-weight:800;font-size:clamp(40px,6.6vw,100px);line-height:.86;letter-spacing:.005em;text-transform:uppercase;color:#fbf0d9;-webkit-text-stroke:.07em #13213a;paint-order:stroke fill;text-shadow:0 .055em 0 #c8202a,0 .1em 0 #8a121c,0 .18em .28em rgba(4,10,20,.45);transform:skewX(-7deg) rotate(-3deg);transform-origin:left bottom}
#gameShell #startOverlay h1.wordmark em{display:block;margin-top:.04em;font-family:"Chikun Display",Impact,"Arial Black",sans-serif;font-weight:800;font-style:normal;font-size:1.32em;color:#fff6e4;letter-spacing:.01em}
#gameShell .start-card{display:flex;flex-direction:column;gap:clamp(8px,1.3vh,14px);max-width:560px;padding:clamp(12px,2vh,22px) clamp(14px,1.7vw,24px);border:1px solid rgba(244,228,193,.18);border-radius:16px;background:linear-gradient(180deg,rgba(14,30,47,.86),rgba(9,21,34,.9));box-shadow:0 18px 50px rgba(2,8,16,.38),inset 0 1px 0 rgba(255,255,255,.06)}
#gameShell .start-card>p#modeCopy{margin:0;max-width:none;font:400 clamp(11px,1.05vw,14px)/1.5 ui-sans-serif,system-ui;color:#d3dfdc}
#gameShell .start-stats{display:flex;gap:10px;flex-wrap:wrap}
#gameShell .start-stats[hidden]{display:none}
#gameShell .start-stat{display:flex;flex-direction:column;gap:2px;margin:0;padding:7px 12px;border-radius:10px;background:rgba(244,228,193,.08);min-width:120px}
#gameShell .start-stat span{font:700 11px/1.2 ui-sans-serif,system-ui;letter-spacing:.14em;text-transform:uppercase;color:#9fb6b4}
#gameShell .start-stat strong{font:800 clamp(16px,1.6vw,22px)/1.1 "Chikun Display",ui-sans-serif,system-ui;letter-spacing:.02em;color:#f3d48a;font-variant-numeric:tabular-nums}
#gameShell #startOverlay .daily-panel{position:static;inset:auto;width:auto;max-width:none;margin:0;padding:0;background:none;box-shadow:none;border-radius:0}
#gameShell #startOverlay .daily-line{margin:0 0 6px;font-size:12px}
#gameShell #startOverlay .daily-actions{display:flex;gap:8px;flex-wrap:wrap}
#gameShell #startOverlay .daily-chip{min-height:36px;padding:5px 12px;border-radius:999px;font-size:11px}
#gameShell #startOverlay .start-button{width:100%;min-width:0;min-height:58px;margin:2px 0 0;padding:10px 18px;border:2px solid #13213a;border-radius:12px;background:var(--site-brass,#dfc48c);color:#13213a;font:800 clamp(20px,2vw,28px)/1 "Chikun Display",Impact,sans-serif;letter-spacing:.08em;text-transform:uppercase;text-shadow:none;box-shadow:0 5px 0 #8a6f3e,0 12px 30px rgba(0,0,0,.35);cursor:pointer;transition:transform .12s ease-out,box-shadow .12s ease-out,filter .12s}
#gameShell #startOverlay .start-button:not(:disabled){animation:chikun-start-glow 2.4s ease-in-out infinite}
#gameShell #startOverlay .start-button:hover:not(:disabled),#gameShell #startOverlay .start-button:focus-visible{filter:brightness(1.08);transform:translateY(-1px);outline:3px solid #ffe3a1;outline-offset:3px}
#gameShell #startOverlay .start-button:active:not(:disabled){transform:translateY(3px);box-shadow:0 2px 0 #8a6f3e,0 6px 18px rgba(0,0,0,.3)}
#gameShell #startOverlay .start-button:disabled{background:linear-gradient(180deg,#45566a,#2c3a4b);color:#c9d3dc;text-shadow:none;box-shadow:0 4px 0 #1a2532;cursor:progress}
@keyframes chikun-start-glow{0%,100%{box-shadow:0 5px 0 #8a6f3e,0 12px 30px rgba(0,0,0,.35)}50%{box-shadow:0 5px 0 #8a6f3e,0 12px 40px rgba(223,196,140,.45)}}
#gameShell .start-howto{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 14px;margin:0;padding:0;list-style:none}
#gameShell .start-howto li{display:flex;align-items:center;gap:8px;min-width:0;font:600 clamp(11px,.95vw,12px)/1.25 ui-sans-serif,system-ui;color:#cad8d5}
#gameShell .start-howto li.howto-move{grid-column:1/-1}
#gameShell .howto-icon{flex:0 0 auto;width:22px;height:22px}
#gameShell .howto-shield{fill:#6fdcf0}#gameShell .howto-magnet{fill:#ef5d5d}#gameShell .howto-feather{fill:#f1e2b0}#gameShell .howto-can{fill:#ff7a3d}
#gameShell .howto-keys{display:flex;gap:4px}
#gameShell .start-howto kbd{display:inline-block;min-width:34px;padding:3px 8px;border:1px solid rgba(244,228,193,.35);border-bottom-width:3px;border-radius:6px;background:rgba(255,255,255,.07);color:#fbf0d9;font:700 11px/1.2 ui-sans-serif,system-ui;text-align:center}
#gameShell .start-card>p.flight-tip{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
#gameShell #startOverlay .start-card>small{margin:0;font-size:11px;line-height:1.4;color:#8ea4a2;letter-spacing:.02em}
#gameShell #startOverlay .ranked-help{margin:0;max-width:none}
#gameShell #startOverlay .asset-status:empty{display:none}
/* The menu is not a flight: no pause button and no route readout on it. */
.game-shell[data-phase="ready"] #pauseButton,.game-shell[data-phase="waiting"] #pauseButton,.game-shell[data-phase="ready"] .route-readout,.game-shell[data-phase="waiting"] .route-readout{display:none}
@media(prefers-reduced-motion:reduce){#gameShell #startOverlay .start-button:not(:disabled){animation:none}}
/* Portrait: wordmark at the top, Chikun in the band below it, the card at the bottom. */
@media(orientation:portrait){
 #gameShell #startOverlay{inset:0;left:0;padding:calc(max(10px,env(safe-area-inset-top)) + 58px) 14px max(14px,env(safe-area-inset-bottom));justify-content:space-between;align-items:stretch;gap:10px;background:linear-gradient(180deg,rgba(7,17,29,.35) 0%,rgba(7,17,29,0) 26%,rgba(7,17,29,0) 44%,rgba(7,17,29,.72) 72%,rgba(7,17,29,.9) 100%)}
 #gameShell .start-title{align-items:center;text-align:center}
 #gameShell #startOverlay h1.wordmark{font-size:clamp(40px,12.5vw,64px);transform:skewX(-7deg) rotate(-3deg);transform-origin:center}
 #gameShell .start-card{max-width:none;padding:12px 14px;gap:9px}
 #gameShell .start-card>p#modeCopy{font-size:12px;line-height:1.42}
 #gameShell #startOverlay .start-card>small{display:none}
 #gameShell .start-stat{padding:5px 10px;min-width:0;flex:1}
}
/* Short landscape screens: one-line wordmark, a compact card. */
@media(max-height:450px) and (orientation:landscape){
 #gameShell #startOverlay{left:40%;padding:10px 14px 10px 8px;gap:6px;justify-content:center}
 #gameShell #startOverlay h1.wordmark{font-size:clamp(26px,4.6vw,40px);white-space:nowrap}
 #gameShell #startOverlay h1.wordmark br{display:none}
 #gameShell #startOverlay h1.wordmark em{display:inline;font-size:1em;margin:0 0 0 .2em}
 #gameShell .start-card{padding:9px 12px;gap:6px;border-radius:12px}
 #gameShell .start-card>p#modeCopy{font-size:11px;line-height:1.35}
 #gameShell .start-stat{padding:4px 8px}#gameShell .start-stat strong{font-size:15px}
 #gameShell #startOverlay .start-button{min-height:46px;font-size:19px}
 #gameShell .start-howto{grid-template-columns:repeat(4,minmax(0,1fr));gap:4px 8px}
 #gameShell .start-howto li{font-size:11px;gap:4px}
 #gameShell .howto-icon{width:16px;height:16px}
 #gameShell #startOverlay .start-card>small{display:none}
}
/* Title screen, phones: portrait keeps the card compact so Chikun has a band
   under the wordmark; short landscape moves the wordmark over Chikun's column,
   clear of the HUD buttons. */
@media(orientation:portrait){
 #gameShell .start-card{gap:8px;padding:11px 13px}
 #gameShell .start-card>p#modeCopy{font-size:11.5px;line-height:1.38}
 #gameShell .start-card:has(.daily-panel:not([hidden]))>p#modeCopy{display:none}
 #gameShell .start-stats{gap:8px}
 #gameShell .start-stat{flex-direction:row;align-items:baseline;gap:8px;padding:5px 10px}
 #gameShell .start-stat strong{font-size:16px}
 #gameShell #startOverlay .daily-line{margin:0 0 5px;font-size:11px}
 #gameShell #startOverlay .daily-chip{min-height:34px;padding:4px 11px}
 #gameShell #startOverlay .start-button{min-height:52px;font-size:22px}
 #gameShell .start-howto{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px 6px}
 #gameShell .start-howto li{flex-direction:column;gap:3px;text-align:center;font-size:11px;line-height:1.2}
 #gameShell .start-howto li.howto-move{flex-direction:row;justify-content:center;font-size:11px}
 #gameShell .howto-icon{width:20px;height:20px}
}
@media(max-height:450px) and (orientation:landscape){
 #gameShell #startOverlay:not(.is-hidden){left:0;display:grid;grid-template-columns:40% minmax(0,1fr);grid-template-rows:auto 1fr;align-items:start;column-gap:10px;padding:max(8px,env(safe-area-inset-top)) 14px 8px 10px;background:linear-gradient(90deg,rgba(7,17,29,0) 0%,rgba(7,17,29,0) 36%,rgba(7,17,29,.55) 44%,rgba(7,17,29,.72) 100%)}
 #gameShell .start-title{grid-column:1;grid-row:1;align-items:center;text-align:center;padding-top:2px}
 #gameShell #startOverlay h1.wordmark{font-size:clamp(28px,5vw,44px);white-space:normal;transform-origin:center}
 #gameShell #startOverlay h1.wordmark br{display:inline}
 #gameShell #startOverlay h1.wordmark em{display:block;font-size:1.3em;margin:.02em 0 0}
 #gameShell .start-card{grid-column:2;grid-row:1/3;margin-top:52px;max-height:calc(100% - 52px);overflow:auto}
 #gameShell .start-card:has(.daily-panel:not([hidden]))>p#modeCopy{display:none}
 #gameShell .start-howto li.howto-move{display:flex;grid-column:1/-1}
}

/* Wide game frames: keep statistics outside Chikun's fixed flight column.
   The frame query also protects short, wide windows whose canvas is smaller. */
.game-frame{container-type:inline-size}
@container(min-width:1200px){.hud{padding-left:32%}}

/* The title overlay used to intercept the visible Exit button. Keep the
   pre-run actions above it, including a reachable Exit on phones, while
   leaving the running/paused HUD and its input policy unchanged. */
.game-shell:is([data-phase="ready"],[data-phase="waiting"]) .hud-actions{
 position:absolute;z-index:6;top:max(12px,env(safe-area-inset-top));right:12px;bottom:auto
}
.game-shell:is([data-phase="ready"],[data-phase="waiting"]) #exitButton{display:inline-flex;align-items:center;justify-content:center}
/* Cohesion patch: the pause menu's Controls reference (collapsed until opened). */
#pauseOverlay .pause-controls{width:min(720px,100%);margin-top:10px;text-align:left;border:1px solid var(--arcade-edge,#3a4a66);border-radius:var(--arcade-radius,8px);background:var(--arcade-well,#101a2c);padding:0 12px}
#pauseOverlay .pause-controls summary{min-height:44px;display:flex;align-items:center;cursor:pointer;font-weight:700;color:var(--arcade-ink,#f3f0e6)}
#pauseOverlay .pause-controls dl{display:grid;gap:8px;margin:0 0 12px}
#pauseOverlay .pause-controls dt{font-weight:700;color:var(--arcade-gold,#f2c464)}
#pauseOverlay .pause-controls dd{margin:2px 0 0;color:var(--arcade-muted,#bac7da);line-height:1.45}
#pauseOverlay .pause-controls summary::-webkit-details-marker{display:none}
#pauseOverlay .pause-controls summary::after{content:"+";margin-left:auto;font-size:18px;color:var(--arcade-muted,#bac7da)}
#pauseOverlay .pause-controls[open] summary::after{content:"−"}

.result-stats .chikun-score-breakdown{grid-column:1/-1;width:100%}
.result-stats .chikun-score-breakdown dd{display:flex;overflow:hidden;height:18px;margin-top:6px;border:1px solid #bac7da;border-radius:4px;background:#101a2c}
.chikun-score-breakdown i{display:block;height:100%;background:#bac7da}
.chikun-score-breakdown i:nth-child(2){background:#f2c464}
.chikun-score-breakdown i:nth-child(3){background:#61d5ae}
.chikun-score-breakdown i:nth-child(4){background:#77b5ff}
.chikun-score-breakdown i:nth-child(5){background:#c3a0ef}
.chikun-score-breakdown i:nth-child(6){background:#f09871}

#resultMilestones{width:min(610px,100%);margin:8px 0;text-align:left;font:14px/1.5 ui-sans-serif,system-ui;color:#e9eee9}
#resultMilestones[hidden]{display:none}
#resultMilestones summary{min-height:44px;box-sizing:border-box;padding:12px;cursor:pointer;border:1px solid #65788a;border-radius:6px;background:#102236}
#resultMilestones summary:focus-visible{outline:3px solid #f2c464;outline-offset:3px}
#resultMilestones ul{margin:8px 0;padding-left:32px}
@media(orientation:portrait) and (max-width:700px){#resultMilestones{order:2}}

#gameShell #resultOverlay .result-primary-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
#resultMore{width:100%;text-align:left}
#resultMore summary{min-height:44px;box-sizing:border-box;padding:12px;cursor:pointer;color:var(--arcade-text,#f0f3ff);font:600 14px/1.5 ui-sans-serif,system-ui}
#resultMore summary:focus-visible{outline:3px solid #f2c464;outline-offset:2px}
#resultOverlay.is-replaying #resultMore,#resultOverlay.is-replaying #resultMilestones{display:none}
@media(orientation:portrait) and (max-width:700px){#resultMore{order:1}}
@media (pointer: coarse) {
  #gameShell[data-phase="running"] .hud-actions button:not(#pauseButton) { display: none; }
}
.hud { left: env(safe-area-inset-left, 0px); right: env(safe-area-inset-right, 0px); }
.hud-cluster :is(strong,span) { zoom: var(--chikun-hud-scale, 1); }
#pauseSettings :is(#hudScale, #introMode) { min-height: 44px; font: inherit; }

.hud-secondary:has(.lap-progress:not([hidden])) .legacy-course-stat { display: none; }
.lap-progress:not([hidden]) { display: grid; grid-column: 1 / -1; gap: 1px; min-width: 0; }
.lap-progress canvas { width: 100%; min-width: 104px; height: 8px; cursor: inherit; }
.lap-progress span { color: #fff; letter-spacing: .04em; }

/* The child keeps the native running scene visible beside its briefing. */
#gameShell #startOverlay .start-title {
  align-self: stretch;
  align-items: flex-start;
  justify-content: flex-end;
  padding: clamp(8px, 1.7vh, 16px) clamp(12px, 2vw, 24px);
  min-height: clamp(74px, 16vh, 130px);
  text-align: left;
  border: 1px solid #78989a;
  border-radius: 12px;
  background: linear-gradient(90deg, #071823ed, #10283887 48%, #142e3900 75%), url(./art/river-briefing.webp) 68% 31% / cover no-repeat;
}
#gameShell #startOverlay .start-title h1.wordmark {
  font-size: clamp(27px, 4.4vw, 54px);
  transform-origin: left bottom;
}
#gameShell #startOverlay .start-card>p.flight-tip {
  position: static; width: auto; height: auto; margin: 0;
  padding: 0 0 0 9px; border-left: 2px solid #94b8a4;
  overflow: visible; clip: auto; white-space: normal;
  color: #d0dfd2; font-size: 12px; line-height: 1.35;
}
@media(max-height:440px) and (orientation:landscape) {
  #gameShell #startOverlay .start-title { min-height: 58px; padding: 6px 9px; }
  #gameShell #startOverlay .start-title h1.wordmark { font-size: 23px; }
  #gameShell #startOverlay .start-card>p.flight-tip { font-size: 10px; }
}
.flight-lesson{position:absolute;bottom:clamp(36px,8%,62px);left:clamp(8px,2%,22px);z-index:2;max-width:min(31ch,calc(100% - 32px));margin:0;padding:7px 11px;border-left:3px solid #f3c967;border-radius:2px 6px 6px 2px;background:#112b36f5;color:#fff5d8;font:600 clamp(.75rem,1.5vw,.96rem)/1.3 system-ui;pointer-events:none}
.flight-lesson[data-band="sky"]{top:clamp(112px,24%,148px);bottom:auto}
.flight-lesson:empty,.game-shell[data-mode="ranked"] .free-lesson-option,.game-shell:not([data-phase="running"]) .flight-lesson{display:none}
.game-shell:not([data-briefing-ready="true"]):not([data-sprint-ready]) #startOverlay [data-sprint-entry]{display:none}

#resultOverlay.is-replaying #watchApproachButton{display:none}
#resultOverlay .chikun-approach-cue{font:600 13px/1.4 system-ui,sans-serif;color:#fff4d5;background:#102330;padding:4px 9px;border-radius:4px}
#resultOverlay .chikun-approach-cue[hidden]{display:none}

/* Leave the contact line visible and keep transport stationary while the clip runs. */
#gameShell #resultOverlay.is-replaying {
  justify-content:flex-end;
  background:transparent;
  gap:4px;
  padding:8px;
}
#gameShell #resultOverlay.is-replaying.replay-floor{justify-content:flex-start}
#gameShell #resultOverlay.is-replaying > :is(p,h2,dl,details),
#gameShell #resultOverlay.is-replaying :is(#restartButton,[data-sprint-entry]){display:none}
#gameShell #resultOverlay.is-replaying :is(.replay-timeline,.replay-readout,.result-primary-actions,.chikun-approach-cue){order:0;margin:0;position:static}
#gameShell #resultOverlay.is-replaying :is(.replay-timeline,.result-primary-actions){width:min(340px,94%);flex:none}
#gameShell #resultOverlay.is-replaying .replay-timeline{position:relative}
#gameShell #resultOverlay.is-replaying .replay-readout{background:#102330;padding:0 8px;border-radius:4px;flex-direction:row}
#gameShell:has(#resultOverlay.is-replaying) #pauseButton{visibility:hidden}
@media(min-width:800px){
  #gameShell #resultOverlay.is-replaying{align-items:flex-end;padding:72px 12px 12px}
}

#gameShell .overlay .chikun-tracked-goal:not([hidden]){display:grid;gap:.18rem;width:min(32rem,94%);box-sizing:border-box;margin:.45rem auto;padding:.45rem .75rem;border-left:3px solid #ccac71;background:#142830;color:#f4efdb;text-align:left;overflow-wrap:anywhere}
.chikun-tracked-goal span{color:#dac492;font-weight:700;font-size:.78em}
#gameShell .chikun-tracked-goal small{color:#e0e7e2;font-size:.9em;text-transform:none;letter-spacing:normal}
/* Each split shows the same distant terrain as the region the player crossed. */
#chikunRegionSplits li[class^="vista-"]::before {
  content: "";
  display: inline-block;
  width: 3.4em;
  height: 1.45em;
  margin-inline-end: .6em;
  vertical-align: middle;
  border-radius: 3px;
  background: var(--route-vista) center / cover;
}
.vista-farmland { --route-vista: url('../assets/generated/chikun-route-vistas-v1/farmland.webp'); }
.vista-forest { --route-vista: url('../assets/generated/chikun-route-vistas-v1/forest.webp'); }
.vista-town { --route-vista: url('../assets/generated/chikun-route-vistas-v1/town.webp'); }
.vista-city { --route-vista: url('../assets/generated/chikun-route-vistas-v1/city.webp'); }
.vista-industrial { --route-vista: url('../assets/generated/chikun-route-vistas-v1/industrial.webp'); }
.vista-suburbs { --route-vista: url('../assets/generated/chikun-route-vistas-v1/suburbs.webp'); }
.vista-coast { --route-vista: url('../assets/generated/chikun-route-vistas-v1/coast.webp'); }

.wardrobe-fitting { text-align: left; color: #d1ddd6; font-size: .86rem; }
.wardrobe-fitting summary { cursor: pointer; padding: .4em 0; font-weight: 650; }
.wardrobe-fitting label[hidden] { display: none; }
.wardrobe-fitting label { display: inline-grid; gap: .22em; margin: .2em .6em .3em 0; }
.wardrobe-fitting select { max-width: 100%; padding: .3em; color: #f1eee3; background: #22372f; border: 1px solid #728578; border-radius: .3em; font: inherit; }

.route-finish-map { display:block; width:min(100%, 330px); height:auto; margin:.35rem auto; pointer-events:none; transform-origin:left center; animation:unfold-route-map .52s ease-out both; }
.route-finish-map[hidden], .is-replaying .route-finish-map { display:none; }
#resultOverlay:has(.route-finish-map:not([hidden])):not(.is-replaying) > :is(.result-primary-actions,#resultMore) { order:1; }
#resultOverlay:has(.route-finish-map:not([hidden])):not(.is-replaying) > :is(#resultStats,.run-objectives,.replay-timeline,.replay-readout,#shareRow,.ranked-hint) { order:2; }
@keyframes unfold-route-map { from { clip-path:inset(0 78% 0 0); transform:scaleX(.74); opacity:.65; } to { clip-path:inset(0); transform:scaleX(1); opacity:1; } }
[data-reduce-motion="true"] .route-finish-map { animation:none; }
@media(prefers-reduced-motion:reduce) { .route-finish-map { animation:none; } }
/* The first result viewport shows the score and primary controls before the run breakdown. */
#gameShell #resultOverlay:not(.is-replaying) > :is(#resultEyebrow,.arcade-result-score) { order:-2; }
#gameShell #resultOverlay:not(.is-replaying) > .result-primary-actions { order:-1; flex-shrink:0; }
/* Pause on a phone is a bottom sheet (game-flow spec section 6): the five actions in one column of full-width
   targets under the thumb, the run still visible above. Keep this block last: it settles the older phone rules. */
@media(max-width:700px) and (orientation:portrait){
 #pauseOverlay{justify-content:flex-end;padding:0 0 max(14px,env(safe-area-inset-bottom));background:linear-gradient(180deg,#071a2b33 0,#0d223acc 34%,#0d223af2 100%)}
 #pauseOverlay>:first-child{margin-top:auto}
 #pauseOverlay>:last-child{margin-bottom:0}
 #pauseOverlay h2{font-size:30px;margin-bottom:4px}
 #pauseOverlay .pause-actions{grid-template-columns:1fr;gap:8px;width:100%;margin:10px 0 6px;padding:0 16px;box-sizing:border-box}
 /* Settings, Music and Controls keep the same 16 px margins as the actions (they ran flush to the screen edge). */
 #pauseOverlay>.pause-section,#pauseOverlay>.pause-controls{width:auto;align-self:stretch;margin-left:16px;margin-right:16px;box-sizing:border-box}
 /* With Settings or Music open the sheet reaches the top: the HUD under it must not show through the title. */
 .game-shell:has(#pauseOverlay:not(.is-hidden)) .hud{visibility:hidden}
 #pauseOverlay .pause-actions #resumeButton{grid-column:auto}
 #pauseOverlay .pause-actions button{min-height:48px;padding:8px 12px;font-size:14px;letter-spacing:.04em;display:flex;flex-direction:row;align-items:center;justify-content:center;gap:10px}
 #pauseOverlay .pause-actions button span{font-size:14px}
}
/* A hidden pause action is gone, whatever display the row gives its buttons (Ranked has no Restart). */
#pauseOverlay .pause-actions button[hidden]{display:none}
/* Start card top bar and intro Skip (game-flow spec sections 2 and 3): Back top-left, a real Skip button top-right.
   A tap anywhere still skips the intro; the button is the visible, 44 px target. */
/* It hides with the start overlay. */
#startOverlay.is-hidden+.start-back,#startOverlay[hidden]+.start-back{display:none}
.start-back{position:absolute;left:max(14px,env(safe-area-inset-left));top:max(14px,env(safe-area-inset-top));z-index:6;min-height:44px;padding:8px 14px;border:1px solid rgba(255,255,255,.22);border-radius:10px;background:rgba(6,16,30,.72);color:#eef4f7;font:600 14px/1 var(--font-body,ui-sans-serif,system-ui,sans-serif);cursor:pointer}
.start-back:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.intro-skip{left:auto;right:max(12px,env(safe-area-inset-right));top:max(12px,env(safe-area-inset-top));bottom:auto;transform:none;min-height:44px;padding:8px 16px;border:1px solid rgba(255,255,255,.22);font:600 14px/1 var(--font-body,ui-sans-serif,system-ui,sans-serif);cursor:pointer;pointer-events:none}
.intro-skip.is-visible{pointer-events:auto}
@media(orientation:portrait){.intro-skip{top:max(12px,env(safe-area-inset-top));font-size:14px}}
/* The primary action on every overlay is the site's brass (game-flow spec section 9), not blue. */
#gameShell .overlay .primary-button{background:var(--site-brass,#dfc48c);color:#13213a;border-color:#13213a;text-shadow:none}
#gameShell .overlay .primary-button:hover:not(:disabled),#gameShell .overlay .primary-button:focus-visible{background:#ecd6a6;color:#13213a}
