@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');
:root{color-scheme:dark;--bg:#101e28;--panel:#152a35;--line:#2b424c;--text:#e4eded;--muted:#91a8b2;--mint:#a9e5cc;--gold:#f2cb85}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-family:'DM Sans',sans-serif}main{max-width:1160px;margin:auto;padding:16px 24px;min-height:100dvh;display:flex;flex-direction:column;gap:16px}button,a,select{-webkit-tap-highlight-color:transparent}button,select,header a{font:inherit;color:inherit;border:1px solid var(--line);border-radius:10px;background:var(--panel);min-height:44px;padding:10px 16px;cursor:pointer}button:hover,header a:hover{background:#233d47}button:focus-visible,a:focus-visible,select:focus-visible{outline:2px solid var(--gold);outline-offset:3px}button:disabled{opacity:.4;cursor:default}header{display:flex;align-items:center;gap:8px}header a{text-decoration:none}header button,header a{width:44px;padding:5px;text-align:center;font-size:24px;border:0;background:transparent}h1{font-family:'Space Grotesk',sans-serif;font-size:22px;font-weight:500;text-align:center;flex:1;margin:0}h2{font:500 28px 'Space Grotesk',sans-serif;letter-spacing:-.8px;margin:7px 0}.eyebrow{font-size:10px;color:var(--mint);letter-spacing:2px;font-weight:700}.mission{display:flex;justify-content:space-between;gap:24px;align-items:center}.mission p{font-size:13px;color:var(--muted);margin:6px 0;line-height:1.5}.match{min-width:155px;text-align:right}.match>span{font-size:9px;letter-spacing:1.6px;color:var(--muted)}.match strong{display:block;font:500 40px 'Space Grotesk',sans-serif;color:var(--mint)}small{font-size:12px;color:var(--muted);font-weight:400}.meter{height:4px;background:var(--line);position:relative;margin:7px 0}.meter i{display:block;width:0;height:100%;background:var(--mint)}.meter b{position:absolute;left:90%;height:10px;top:-3px;width:1px;background:var(--gold)}.board{border:1px solid var(--line);background:linear-gradient(145deg,#152b35,#11222c);border-radius:18px;overflow:hidden;position:relative}.road-head,.graph-note{display:flex;justify-content:space-between;gap:12px;padding:14px 22px;font-size:10px;color:var(--muted);letter-spacing:.6px}.dot{display:inline-block;width:6px;height:6px;background:var(--mint);border-radius:50%;margin-right:6px}#road{display:block;width:100%;height:130px}.telemetry{display:grid;grid-template-columns:repeat(4,1fr);margin:0 22px;border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:12px 0}.telemetry>div{font-size:9px;letter-spacing:1.4px;color:var(--muted);text-align:center}.telemetry strong{display:block;font:500 21px 'Space Grotesk',sans-serif;color:var(--text);margin-top:5px;font-variant-numeric:tabular-nums}.graph-head{display:flex;align-items:center;justify-content:space-between;padding:14px 22px 0;gap:10px}.tabs{display:flex;gap:3px}.tabs button{background:transparent;border:0;font-size:11px;color:var(--muted);padding:8px 12px;min-height:36px}.tabs button[aria-pressed=true]{background:#a9e5cc17;color:var(--mint)}.legend{font-size:10px;display:flex;gap:18px;color:var(--muted)}.legend span:before{content:'';display:inline-block;width:18px;border-top:2px solid var(--mint);margin-right:6px;vertical-align:middle}.legend .target-key:before{border-color:var(--gold);border-top-style:dashed}#graph{display:block;width:100%;height:clamp(180px,27vh,285px)}svg text{font:11px 'DM Sans',sans-serif;fill:var(--muted)}.graph-note{padding-top:0;font-size:10px;letter-spacing:0}.controls{display:flex;align-items:center;justify-content:center;gap:24px}.pedal{width:182px;min-height:94px;touch-action:none;user-select:none;display:flex;flex-direction:column;align-items:center;gap:5px;box-shadow:0 5px 0 #08161d}.pedal span{font-size:10px;opacity:.65}.pedal strong{font:500 20px 'Space Grotesk',sans-serif}.pedal small{font-size:8px;letter-spacing:1.5px;color:inherit;opacity:.7}.brake{color:#edac9f;border-color:#79514c;background:#382e32}.accelerator{color:var(--mint);border-color:#4d796d;background:#203d3d}.pedal.active{transform:translateY(3px);box-shadow:0 1px 0 #08161d;background:#365b50}.brake.active{background:#67453f}.run-controls{width:260px;text-align:center}.run-controls button{background:var(--mint);color:#112c29;font-weight:700;min-width:140px}.run-controls p{font-size:11px;line-height:1.5;color:var(--muted);margin:10px 0 0;min-height:32px}footer{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:12px;color:var(--muted)}footer select{margin-left:8px;max-width:220px}footer button{color:var(--mint)}dialog{max-width:510px;background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:18px;padding:28px;max-height:90dvh}dialog::backdrop{background:#06131dd9;backdrop-filter:blur(5px)}dialog p{font-size:13px;line-height:1.7;color:var(--muted)}#closeHelp{float:right;padding:4px 12px;font-size:20px}#begin{background:var(--mint);color:var(--bg);width:100%}.won .match strong{color:var(--gold)}.won .board{border-color:#a9e5cc88;box-shadow:0 0 35px #a9e5cc12}.spark{position:absolute;top:0;width:6px;height:10px;background:var(--mint);pointer-events:none;animation:fall 1.9s ease-in forwards}@keyframes fall{to{transform:translateY(650px) rotate(500deg);opacity:0}}@media(max-width:650px){main{padding:12px;gap:12px}h1{font-size:18px}h2{font-size:23px}.mission{gap:12px}.match{min-width:95px}.match strong{font-size:32px}.mission p{font-size:11px}.eyebrow{font-size:8px}.road-head,.graph-note{padding:12px;font-size:8px}#road{height:105px}.graph-head{padding:10px 8px 0;flex-wrap:wrap}.tabs{width:100%}.tabs button{flex:1;padding:6px;font-size:10px}.legend{margin-left:auto;font-size:9px}.telemetry{margin:0 12px}.telemetry strong{font-size:17px}.telemetry>div{font-size:7px;letter-spacing:.5px}.controls{gap:10px;align-items:stretch}.pedal{width:110px;padding:10px 6px}.pedal strong{font-size:16px}.pedal small{font-size:7px;letter-spacing:.5px}.run-controls{flex:1;width:auto}.run-controls button{min-width:0;width:100%;padding:10px 6px;font-size:12px}.run-controls p{font-size:10px}footer{flex-wrap:wrap;font-size:10px}footer select{max-width:160px;padding:8px}#best{flex:1;text-align:right}#next{margin-left:auto}#graph{height:210px}}
@media(prefers-reduced-motion:reduce){.spark{display:none}}

.graph-score{display:flex;justify-content:center;padding:12px 22px 0}.graph-score .match{text-align:center;width:220px}.car-fall{animation:car-drop .7s ease-in forwards}@keyframes car-drop{to{transform:translateY(150px) rotate(65deg);opacity:0}}

.bottom-bar{display:grid;grid-template-columns:minmax(150px,1.25fr) minmax(120px,1fr) minmax(160px,1.4fr) minmax(120px,1fr) auto auto;align-items:center;gap:14px;padding:14px;border:1px solid var(--line);border-radius:16px;background:var(--panel);margin-top:auto}
.bottom-bar .stage-control{display:flex;flex-direction:column;align-items:flex-start;gap:6px;min-width:0}
.bottom-bar select{width:100%;min-width:0;max-width:none;margin:0;font-size:12px;padding:10px}
.bottom-bar .pedal{width:100%;min-height:80px;padding:10px 8px;box-shadow:none}
.bottom-bar .pedal strong{font-size:18px}
.bottom-bar .run-controls{width:auto;min-width:0}
.bottom-bar .run-controls button{min-width:0;width:100%}
.bottom-bar .run-controls p{margin-top:7px;min-height:0;font-size:10px}
.bottom-bar #best{font-size:11px;white-space:nowrap;text-align:center}
.bottom-bar #next{margin:0;white-space:nowrap;padding:10px 12px;font-size:12px}
@media(max-width:900px){.bottom-bar{grid-template-columns: minmax(110px,1fr) minmax(145px,1.3fr) minmax(110px,1fr);gap:12px}.bottom-bar .stage-control{grid-column:1;grid-row:2}.bottom-bar #brake{grid-column:1;grid-row:1}.bottom-bar .run-controls{grid-column:2;grid-row:1}.bottom-bar #accelerator{grid-column:3;grid-row:1}.bottom-bar #best{grid-column:2;grid-row:2}.bottom-bar #next{grid-column:3;grid-row:2}.bottom-bar .stage-control{font-size:10px}}
@media(max-width:450px){.bottom-bar{grid-template-columns:minmax(0,1fr) minmax(0,1.2fr) minmax(0,1fr);padding:10px;gap:10px 8px}.bottom-bar .pedal strong{font-size:15px}.bottom-bar .pedal small{font-size:7px;letter-spacing:0}.bottom-bar #next{white-space:normal;padding:8px;font-size:11px}.bottom-bar select{font-size:10px;padding:8px}.bottom-bar #best{font-size:10px;white-space:normal}}

/* Compact viewport layout and acceleration console. */
main{height:100dvh;min-height:0;gap:10px;padding-top:10px;padding-bottom:10px}
header,footer{flex-shrink:0}
.board{flex:1;min-height:0;display:flex;flex-direction:column}
#road{height:clamp(90px,20vh,160px);flex-shrink:0}
.telemetry{padding:8px 0;flex-shrink:0}
.graph-score{padding:8px 14px 0;flex-shrink:0}
.graph-score .match{display:flex;align-items:center;justify-content:center;gap:12px;width:auto;min-width:0}
.graph-score .match strong{font-size:26px;white-space:nowrap}
.graph-score .meter{width:100px;margin:0}
.graph-head{padding-top:6px;flex-shrink:0}
#graph{flex:1;min-height:0;height:auto;width:100%}
.graph-note{padding-bottom:8px;flex-shrink:0;flex-wrap:wrap}
.graph-note #status{color:var(--gold)}
.bottom-bar{grid-template-columns:100px minmax(0,1fr) minmax(0,1fr) 120px;padding:10px;gap:12px;margin-top:0}
.bottom-bar .stage-control,.bottom-bar #brake,.bottom-bar #accelerator,.bottom-bar #next{grid-column:auto;grid-row:auto}
.bottom-bar .pedal{min-height:66px;position:relative;overflow:hidden;border-radius:14px;transition:transform .15s,box-shadow .15s,background .15s;box-shadow:inset 0 1px 0 #ffffff20,0 4px 12px #0003}
.bottom-bar .pedal:before{content:'';position:absolute;inset:0;background:linear-gradient(115deg,transparent 25%,#ffffff0c 50%,transparent 75%);pointer-events:none}
.bottom-bar .brake{background:linear-gradient(135deg,#493337,#28262f);border-color:#ab7163}
.bottom-bar .accelerator{background:linear-gradient(135deg,#244a48,#183039);border-color:#659d8c}
.bottom-bar .pedal strong{display:flex;align-items:center;justify-content:center;gap:12px;font-size:18px}
.bottom-bar .pedal strong b{font-size:25px;line-height:1;font-weight:400}
.bottom-bar .pedal:hover{box-shadow:inset 0 1px 0 #ffffff30,0 0 18px #a9e5cc18}
.bottom-bar .pedal.active{transform:translateY(2px);box-shadow:inset 0 2px 8px #0004,0 0 18px #a9e5cc30}
@media(max-width:650px){main{gap:8px;padding:8px}.bottom-bar{grid-template-columns:64px minmax(0,1fr) minmax(0,1fr) 72px;gap:6px;padding:8px}.bottom-bar .pedal{min-height:66px;padding:8px 4px}.bottom-bar .pedal strong{font-size:12px;gap:4px}.bottom-bar .pedal strong b{font-size:18px}.bottom-bar .pedal small{font-size:6px}.bottom-bar #next{font-size:10px;padding:6px}.bottom-bar .stage-control{font-size:9px}.graph-score .match{gap:8px}.graph-score .match>span{font-size:8px;letter-spacing:.7px}.graph-score .match strong{font-size:23px}.graph-score .meter{width:60px}.graph-head{gap:4px}.telemetry strong{font-size:16px}.telemetry{padding:6px 0}.graph-note{font-size:8px}}
@media(max-height:500px){#road{height:65px}.telemetry{padding:3px 0}.telemetry strong{font-size:15px;margin-top:2px}.bottom-bar .pedal{min-height:50px}.graph-score{padding-top:4px}.graph-head{padding-top:2px}.graph-note{padding-bottom:4px}}

#sound{width:auto;font-size:12px;white-space:nowrap}
.run-ended .telemetry,.run-ended .graph-score,.run-ended .graph-canvas{animation:review-pulse .7s ease-in-out 2;animation-fill-mode:backwards;border-radius:8px}
.run-ended .graph-score{animation-delay:1.4s}
.run-ended .graph-canvas{animation-delay:2.8s}
@keyframes review-pulse{0%,100%{box-shadow:inset 0 0 0 1px transparent;background-color:transparent}50%{box-shadow:inset 0 0 0 2px var(--gold),inset 0 0 24px #f2cb8526;background-color:#f2cb8510}}
@media(prefers-reduced-motion:reduce){.run-ended .telemetry,.run-ended .graph-score,.run-ended .graph-canvas{animation:none;box-shadow:inset 0 0 0 1px #f2cb8580}.car-fall{animation:none;visibility:hidden}.bottom-bar .pedal{transition:none}}

header{position:relative;min-height:44px;padding:0 48px}
header .home-button{position:absolute;left:0;top:0;display:grid;place-items:center;width:44px;height:44px;padding:10px}
.home-button svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.game-tools{grid-column:1/-1;display:flex;align-items:center;justify-content:flex-end;gap:6px;border-top:1px solid var(--line);padding-top:6px}
.game-tools button,.game-tools #sound{min-height:28px;padding:4px 10px;font-size:10px;background:transparent;border:0;color:var(--muted)}

.instrument-strip{display:flex;align-items:center;gap:18px;margin:0 22px;padding:10px 0;border-block:1px solid var(--line);flex-shrink:0}
.instrument-strip .telemetry{flex:1;min-width:0;margin:0;padding:0;border:0}
.instrument-strip .graph-score{padding:0 0 0 18px;border-left:1px solid var(--line)}
.instrument-strip .match{display:grid;grid-template-columns:auto auto;gap:4px 10px;text-align:left}
.instrument-strip .match strong{grid-column:2;grid-row:1 / 3;font-size:26px}
.instrument-strip .meter{width:85px;grid-row:2}
.instrument-strip .match>span:last-child{grid-column:1 / -1;font-size:7px;text-align:center}
.graph-head{flex-wrap:nowrap;padding:10px 32px 4px 6%;gap:16px;min-width:0}
.graph-axis-label{font-size:11px;color:var(--muted);white-space:nowrap;margin-right:auto}
.graph-head .tabs{width:auto;flex-shrink:0}
.graph-head .tabs button{min-height:30px;padding:6px 10px;white-space:nowrap}
.graph-head .legend{margin:0;gap:12px;white-space:nowrap}
#graph{flex:0 1 auto;height:clamp(120px,25vh,210px);min-height:0}
.board{flex:0 1 auto}
.bottom-bar{margin-top:auto}
@media(max-width:750px){.instrument-strip{margin:0 12px;gap:8px}.instrument-strip .graph-score{padding-left:8px}.instrument-strip .match strong{font-size:21px}.instrument-strip .match>span{font-size:7px;letter-spacing:.4px}.instrument-strip .meter{width:55px}.graph-head{padding:8px 10px 3px;gap:8px}.graph-axis-label{font-size:9px}.graph-head .tabs{gap:0}.graph-head .tabs button{font-size:9px;padding:5px}.graph-head .legend{font-size:8px;gap:6px}.legend span:before{width:10px;margin-right:3px}}
@media(max-width:480px){.graph-head{gap:4px;padding-inline:6px}.graph-axis-label{font-size:7px}.graph-head .tabs button{font-size:7px;padding:4px 3px}.graph-head .legend{font-size:7px;gap:4px}.legend span:before{width:7px}.instrument-strip{margin-inline:8px}.instrument-strip .telemetry strong{font-size:13px}.instrument-strip .telemetry small{font-size:9px}.instrument-strip .telemetry>div{font-size:6px}}

/* Spend remaining viewport space on the driving scene. */
html,body{height:100%;overflow:hidden}
main{height:100dvh;padding:max(10px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));min-width:0}
.board{flex:1;min-height:0;display:grid;grid-template-rows:minmax(0,1fr) auto auto minmax(0,clamp(120px,25dvh,210px)) auto}
#road{height:100%;width:100%;min-height:0;align-self:stretch}
#graph{height:100%;width:100%;min-height:0}
.bottom-bar{margin-top:0}
.rotate-screen{display:none}
@media(orientation:portrait) and (max-width:1400px) and (any-pointer:coarse){main{display:none}.rotate-screen{height:100dvh;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:28px;text-align:center;gap:12px}.rotate-screen svg{width:90px;height:90px;fill:none;stroke:var(--mint);stroke-width:3;stroke-linecap:round;stroke-linejoin:round}.rotate-screen h2{margin:8px 0;font-size:26px}.rotate-screen p{color:var(--muted);max-width:280px;line-height:1.6;margin:0}.rotate-screen a{color:var(--mint);padding:12px}}
@media(orientation:landscape) and (max-height:600px){
main{gap:5px;padding-top:max(4px,env(safe-area-inset-top));padding-bottom:max(4px,env(safe-area-inset-bottom))}
header{min-height:30px;height:30px;padding-inline:40px}header h1{font-size:17px}header .home-button{height:30px;width:36px;padding:5px}.home-button svg{width:21px;height:21px}
.board{border-radius:12px;grid-template-rows:minmax(35px,1fr) 40px 28px minmax(45px,28dvh) 16px}
.instrument-strip{margin-inline:12px;padding:3px 0;gap:10px}.instrument-strip .telemetry strong{font-size:16px;margin-top:2px}.instrument-strip .telemetry>div{font-size:7px;letter-spacing:.7px}.instrument-strip .telemetry small{font-size:9px}
.instrument-strip .graph-score{padding-left:10px}.instrument-strip .match{gap:2px 8px}.instrument-strip .match strong{font-size:20px}.instrument-strip .match>span{font-size:7px;letter-spacing:.6px}.instrument-strip .match>span:last-child{font-size:6px}.instrument-strip .meter{width:65px}
.graph-head{padding:0 3.2% 0 5.8%;gap:10px}.graph-axis-label{font-size:9px}.graph-head .tabs{width:auto}.graph-head .tabs button{font-size:9px;min-height:25px;padding:4px 7px}.graph-head .legend{font-size:8px;gap:8px}
.graph-note{padding:0 12px;gap:8px;font-size:8px;line-height:16px;flex-wrap:nowrap;overflow:hidden}.graph-note #status{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.graph-note #clockNote{white-space:nowrap;margin-left:auto}
.bottom-bar{grid-template-columns:60px minmax(0,1fr) minmax(0,1fr) 85px;padding:5px 8px;gap:8px;border-radius:12px}.bottom-bar .stage-control{font-size:8px;gap:2px}.bottom-bar select{min-height:30px;padding:4px 7px;font-size:11px}.bottom-bar .pedal{min-height:48px;padding:4px;gap:2px;border-radius:9px}.bottom-bar .pedal span{font-size:7px}.bottom-bar .pedal strong{font-size:14px;gap:8px}.bottom-bar .pedal strong b{font-size:20px}.bottom-bar .pedal small{font-size:6px}.bottom-bar #next{min-height:34px;font-size:10px;padding:5px}
}
@media(orientation:landscape) and (max-height:350px){.board{grid-template-rows:minmax(30px,1fr) 34px 25px minmax(40px,25dvh) 14px}.instrument-strip .telemetry strong{font-size:14px}.graph-note{line-height:14px;font-size:7px}.bottom-bar .pedal{min-height:42px}.bottom-bar .pedal span{display:none}}

/* Pictorial direction controls. */
.bottom-bar .pedal{display:grid;place-content:center;justify-items:center;gap:0;min-height:72px;padding:5px 36px;border-radius:16px;isolation:isolate}
.bottom-bar .pedal:after{content:'';position:absolute;inset:0;border-radius:inherit;background:radial-gradient(ellipse at 50% 100%,currentColor,transparent 70%);opacity:.07;z-index:-1}
.drive-symbol{display:block;width:160px;max-width:100%;height:40px;overflow:visible;filter:drop-shadow(0 2px 6px #0003);transition:filter .15s}
.drive-arrow{fill:currentColor}
.motion-trail{fill:none;stroke:currentColor;stroke-width:3;stroke-linecap:round}
.trail-far{opacity:.25}.trail-near{opacity:.55}
.arrow-glint{fill:none;stroke:#fff;stroke-width:1.5;opacity:.3;stroke-linecap:round}
.bottom-bar .pedal .drive-value{font-size:11px;font-weight:600;letter-spacing:1px;opacity:.9;line-height:16px}
.bottom-bar .pedal .drive-value span{font-size:8px;opacity:.65;display:inline}
.bottom-bar .pedal .drive-key{position:absolute;right:12px;top:10px;font-size:8px;letter-spacing:.5px;opacity:.4;display:block}
.bottom-bar .pedal.active .drive-symbol{filter:drop-shadow(0 0 8px currentColor)}
.bottom-bar .pedal.active .motion-trail{animation:thrust-trail .5s ease-in-out infinite alternate}
@keyframes thrust-trail{to{opacity:.95;stroke-width:4}}
@media(orientation:landscape) and (max-height:600px){.bottom-bar .pedal{min-height:48px;padding:2px 26px;gap:0}.drive-symbol{width:125px;height:30px}.bottom-bar .pedal .drive-value{font-size:9px;line-height:12px}.bottom-bar .pedal .drive-value span{font-size:7px}.bottom-bar .pedal .drive-key{top:6px;right:8px;font-size:7px}}
@media(orientation:landscape) and (max-height:350px){.bottom-bar .pedal{min-height:42px}.drive-symbol{height:26px}.bottom-bar .pedal .drive-key{display:none}}
@media(prefers-reduced-motion:reduce){.bottom-bar .pedal.active .motion-trail{animation:none}.drive-symbol{transition:none}}

/* Compact direction buttons, centered between stage controls. */
.bottom-bar{grid-template-columns:100px minmax(0,1fr) minmax(0,1fr) 120px}
.bottom-bar #brake{width:160px;max-width:100%;justify-self:end}
.bottom-bar #accelerator{width:160px;max-width:100%;justify-self:start}
.bottom-bar .pedal{padding-inline:16px}
.drive-symbol{width:125px}
@media(max-width:650px){.bottom-bar{grid-template-columns:64px minmax(0,1fr) minmax(0,1fr) 72px}.bottom-bar #brake,.bottom-bar #accelerator{width:125px}}
@media(orientation:landscape) and (max-height:600px){.bottom-bar{grid-template-columns:60px minmax(0,1fr) minmax(0,1fr) 85px}.bottom-bar #brake,.bottom-bar #accelerator{width:130px}.bottom-bar .pedal{padding-inline:12px}.drive-symbol{width:105px}}

/* Drive at the edges; stage and completion live in the center. */
.bottom-bar{position:relative;grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr);min-height:94px}
.bottom-bar #brake{grid-column:1;grid-row:1;justify-self:start}
.bottom-bar #accelerator{grid-column:3;grid-row:1;justify-self:end}
.bottom-bar .stage-control{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);margin:0;white-space:nowrap;transition:left .55s ease,transform .55s ease;font:500 17px 'Space Grotesk',sans-serif;color:var(--text)}
.bottom-bar #next{display:none;grid-column:3;grid-row:1;justify-self:end}
#congratulations{grid-column:2;grid-row:1;text-align:center;font:500 22px 'Space Grotesk',sans-serif;color:var(--mint)}
#congratulations small{display:block;margin-top:4px;font-size:11px;color:var(--muted)}
.won .bottom-bar .stage-control{left:16px;transform:translate(0,-50%)}
.won .bottom-bar .pedal{display:none}
.won .bottom-bar #next{display:block}
.won #congratulations{animation:completion-arrive .45s .25s both}
@keyframes completion-arrive{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
.road-scene{position:relative;min-height:0;overflow:hidden}
.replay-button{position:absolute;top:10px;right:12px;z-index:1;display:grid;place-items:center;width:36px;height:36px;min-height:0;padding:7px;border-radius:50%;background:#142a35cc}
.replay-button svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.replay-button.playing{color:var(--gold);border-color:var(--gold)}
.graph-canvas{min-height:0;padding:8px 10px;margin:0 12px;border-radius:10px}
.graph-canvas #graph{width:100%;height:100%;display:block}
.instrument-strip .telemetry{padding:8px 6px}
.instrument-strip .graph-score{padding:8px 10px 8px 18px}
.legend .you-key:before{border-color:var(--trace-color,#a9e5cc)}
.graph-axis-label{color:var(--trace-color,var(--muted))}
.tabs button[data-view=x]{color:#8ecbff}.tabs button[data-view=v]{color:#a9e5cc}.tabs button[data-view=a]{color:#d2adff}
.tabs button[data-view=x][aria-pressed=true]{background:#8ecbff18;color:#8ecbff}.tabs button[data-view=v][aria-pressed=true]{background:#a9e5cc18;color:#a9e5cc}.tabs button[data-view=a][aria-pressed=true]{background:#d2adff18;color:#d2adff}
@media(orientation:landscape) and (max-height:600px){.bottom-bar{grid-template-columns:1fr 1fr 1fr;min-height:60px}.bottom-bar .stage-control{font-size:13px}#congratulations{font-size:17px}#congratulations small{font-size:9px}.replay-button{top:5px;right:8px;width:30px;height:30px;padding:6px}.instrument-strip .telemetry{padding:4px}.instrument-strip .graph-score{padding:4px 8px}.graph-canvas{padding:5px 8px;margin-inline:8px}}
@media(prefers-reduced-motion:reduce){.bottom-bar .stage-control{transition:none}.won #congratulations{animation:none}}

/* Graph type is expressed by the plot surface and trace, with neutral labels. */
.graph-axis-label,.tabs button[data-view=x],.tabs button[data-view=v],.tabs button[data-view=a]{color:var(--muted)}
.tabs button[data-view=x][aria-pressed=true],.tabs button[data-view=v][aria-pressed=true],.tabs button[data-view=a][aria-pressed=true]{color:var(--text);background:#ffffff0d}
.board[data-graph-view=x] .graph-canvas{background:linear-gradient(135deg,#8ecbff16,#8ecbff05)}
.board[data-graph-view=v] .graph-canvas{background:linear-gradient(135deg,#a9e5cc16,#a9e5cc05)}
.board[data-graph-view=a] .graph-canvas{background:linear-gradient(135deg,#d2adff1c,#d2adff06)}
.graph-canvas{border:1px solid color-mix(in srgb,var(--trace-color) 25%,transparent)}

.graph-info-button{flex-shrink:0;display:grid;place-items:center;min-height:0;width:24px;height:24px;padding:0;border-radius:50%;font:italic 600 14px Georgia,serif;color:var(--muted);margin-right:auto}
.graph-axis-label{margin-right:0}
.graph-guide{max-width:920px;width:calc(100% - 32px);padding:22px;max-height:calc(100dvh - 24px);overflow:auto}
.graph-guide-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}.graph-guide-heading h2{font-size:24px;margin:0}.graph-guide-heading button{min-height:32px;padding:2px 10px;font-size:22px}
.graph-guide-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.graph-explainer h3{font:500 16px 'Space Grotesk',sans-serif;margin:0 0 6px}.graph-explainer>p{font-size:11px;line-height:1.5;margin:0 0 12px;min-height:34px}
.graph-pills{display:flex;flex-direction:column;gap:8px}
.graph-pill{display:flex;align-items:center;gap:8px;padding:8px 10px;border:1px solid var(--line);border-radius:24px;background:#ffffff04}
.graph-pill svg{width:48px;height:38px;flex-shrink:0}.mini-axes{fill:none;stroke:var(--muted);stroke-width:1;opacity:.4}.mini-zero{fill:none;stroke:var(--muted);stroke-width:1;stroke-dasharray:3 3}.mini-motion{fill:none;stroke:currentColor;stroke-width:2.5;stroke-linecap:round}
.graph-pill.positive{color:#a9e5cc}.graph-pill.zero{color:#b6c6d0}.graph-pill.negative{color:#edac9f}.graph-pill b{display:block;font-size:10px;font-weight:500}.graph-pill small{display:block;font-size:10px;margin-top:3px;color:var(--muted)}
.graph-guide .graph-guide-note{font-size:11px;margin:16px 0 0;line-height:1.5}
@media(orientation:landscape) and (max-height:600px){.graph-info-button{width:21px;height:21px;font-size:12px}.graph-guide{padding:12px 16px}.graph-guide-heading{margin-bottom:8px}.graph-guide-heading h2{font-size:20px}.graph-guide-cards{gap:12px}.graph-explainer h3{font-size:13px}.graph-explainer>p{font-size:10px;min-height:30px;margin-bottom:6px}.graph-pills{gap:5px}.graph-pill{padding:4px 8px;gap:5px}.graph-pill svg{width:38px;height:29px}.graph-pill b,.graph-pill small{font-size:9px}.graph-guide .graph-guide-note{margin-top:8px;font-size:9px}}
@media(max-width:500px) and (orientation:portrait){.graph-guide-cards{grid-template-columns:1fr}}

header .graph-info-button{position:absolute;right:0;top:0;width:36px;height:36px;min-height:0;padding:0;margin:4px 0;border:1px solid var(--line);font:italic 600 17px Georgia,serif}
.graph-guide{max-width:620px}
.graph-guide-tabs{display:flex;gap:8px;margin-bottom:18px}
.graph-type-pill{flex:1;border-radius:24px;padding:8px 12px;min-height:36px;font-size:12px;white-space:nowrap;color:var(--muted);background:transparent}
.graph-type-pill[aria-pressed=true]{color:var(--text);background:#ffffff10;border-color:#91a8b2}
.graph-guide-cards{display:block}
.graph-explainer[hidden]{display:none}
.graph-explainer>p{min-height:0}
.graph-pills{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.graph-pill{flex-direction:column;text-align:center;border-radius:18px;padding:12px 6px}
.graph-pill svg{width:68px;height:52px}
@media(orientation:landscape) and (max-height:600px){header .graph-info-button{width:28px;height:28px;margin:1px 0;font-size:15px}.graph-guide-tabs{margin-bottom:10px;gap:6px}.graph-type-pill{font-size:11px;padding:5px 10px;min-height:30px}.graph-pills{gap:8px}.graph-pill{padding:6px}.graph-pill svg{width:58px;height:42px}}

header .graph-info-button{color:var(--gold);background:#f2cb8517;border-color:#f2cb8580;box-shadow:0 0 14px #f2cb8525,inset 0 1px 0 #ffffff15}
header .graph-info-button:hover{color:#ffe3b1;background:#f2cb852b;border-color:var(--gold);box-shadow:0 0 20px #f2cb8540}
