@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');
:root{--ink:#101827;--panel:#1c2840;--cream:#ffefcb;--gold:#ffc44b;--blue:#509bee;--mint:#92e5ac;--pixel:'Press Start 2P','Courier New',monospace;--body:'VT323','Courier New',monospace;color-scheme:dark}*{box-sizing:border-box}body{margin:0;background:var(--ink);color:var(--cream);font-family:var(--body);font-size:22px}main{max-width:1230px;padding:0 26px;margin:auto}header{height:104px;display:flex;align-items:center;gap:22px}.brand{font:18px/1.6 var(--pixel);text-decoration:none;color:var(--cream)}.brand>span{color:var(--blue)}.brand small{display:block;font:11px var(--body);letter-spacing:5px;opacity:.65}.event{margin-left:auto;text-align:right;font-family:var(--pixel);font-size:14px;line-height:1.6}.event b{display:block;color:var(--gold);font-size:18px}.event>span{display:block;font:14px var(--body);letter-spacing:1px}.club-logo{height:76px;width:100px;object-fit:contain;image-rendering:pixelated}.cabinet{border:4px solid #42577c;box-shadow:0 7px 0 #080f1c}.topline,.bottomline{display:flex;justify-content:space-between;align-items:center;padding:11px 18px;background:#182339;font-size:15px;letter-spacing:1px}.topline>div{display:flex;gap:10px}.topline button{font:14px var(--body);padding:5px 7px;border:1px solid #526583;background:none;box-shadow:none}.topline button[aria-pressed=false]{opacity:.5}.screen{position:relative;height:610px;overflow:hidden;background:#91c0c9}canvas{display:block;width:100%;height:100%;image-rendering:pixelated}.menu{position:absolute;inset:0;display:grid;grid-template-columns:.95fr 1.05fr;gap:35px;align-items:center;padding:36px;background:linear-gradient(90deg,#101827e8,#101827b8)}.overline{color:var(--gold);font:11px/1.9 var(--pixel);letter-spacing:1px;margin:0 0 20px}h1{font:clamp(25px,3vw,39px)/1.55 var(--pixel);margin:0;text-shadow:4px 4px #0b1220}h1 span{color:var(--gold)}.subline{font-size:24px;line-height:1.3;max-width:300px;color:#c8d7e6}.selection{padding:23px;background:#16243df5;border:3px solid #4e6387;box-shadow:5px 5px #07101f}.step-head{display:flex;gap:14px;align-items:center;border-bottom:2px dashed #43536c;padding-bottom:15px;margin-bottom:20px}.step-head>span{color:var(--gold);font-size:17px;white-space:nowrap}h2{font:13px/1.65 var(--pixel);margin:0}.choices{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px}button{font:12px/1.6 var(--pixel);color:inherit;cursor:pointer;border:2px solid #62708c;background:var(--panel);padding:12px;box-shadow:3px 3px #080f1c;border-radius:0}button:focus-visible,a:focus-visible{outline:3px solid white;outline-offset:4px}button:hover{filter:brightness(1.13)}button:active{transform:translateY(2px);box-shadow:none}button:disabled{cursor:default;opacity:.4}.choices button{font:14px var(--body);padding:5px 2px;min-width:0;position:relative;transition:background .1s}.choices button[aria-pressed=true]{border-color:var(--gold);background:#38465b}.choices button[aria-pressed=true]:after{content:'▼';position:absolute;top:-14px;left:40%;color:var(--gold);font-size:13px}.swatch{display:block;width:28px;height:25px;background:#398bec;border:4px solid #79bbfa;margin:10px auto;box-shadow:3px 3px #173363}.portrait{display:block;background-image:url('assets/pilots-alpha.png');background-size:500% 100%;background-repeat:no-repeat;image-rendering:pixelated;width:100%;aspect-ratio:1/1.5}.choices .portrait{height:100px;aspect-ratio:auto}.choices button>span:last-child{display:block;padding:4px 0}#selectionHint{font-size:18px;color:#b9cce0;line-height:1.2;min-height:42px;margin:18px 0}.actions{display:flex;gap:12px}.primary{background:var(--gold);border-color:#ffe29b;color:#16243a;width:100%;font-size:11px;padding:16px 10px}.secondary{background:transparent;font:17px var(--body);white-space:nowrap}.how{font-size:17px;line-height:1.35;color:var(--cream);margin:20px 0 0}.how span{color:#9db4ce}.hud{position:absolute;top:20px;left:22px;right:22px;display:flex;justify-content:space-between;gap:30px;pointer-events:none;text-shadow:2px 2px #101827}.hud small{display:block;font-size:16px;letter-spacing:1px}.hud strong{font:28px/1.7 var(--pixel);color:var(--cream)}.hud .route{max-width:340px;flex:1;text-align:center}.route span{font-size:15px}.progress{border:2px solid #182b43;background:#213752;width:100%;height:13px;margin:7px 0}.progress i{display:block;background:var(--gold);height:100%;width:0}.hud.low #time{color:#ff725a}.message{position:absolute;top:110px;left:50%;transform:translateX(-50%);background:#15273be8;border:2px solid var(--gold);padding:8px 14px;text-align:center;font-size:22px;opacity:0;pointer-events:none;max-width:90%;width:max-content}.result{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;background:#101827ed;padding:25px}.result h2{font-size:25px;color:var(--gold)}.result p{max-width:550px;line-height:1.4}.result .primary{max-width:430px;margin:17px 0 10px}.result .secondary{font-size:18px}.result-pilot{height:95px;width:75px;overflow:hidden;margin:0 0 15px}.event-call{font:14px/1.9 var(--pixel)}.event-call span{font-size:11px;color:var(--gold)}.drive-controls{display:flex;gap:14px;margin-top:18px;justify-content:flex-end}.drive-controls button{touch-action:none;user-select:none;-webkit-user-select:none}.drive-controls #jump{background:var(--gold);color:#101827;border-color:#ffe7b7;min-width:230px}.drive-controls #jump small{display:block;font:14px var(--body);margin-top:4px}footer{display:flex;justify-content:space-between;gap:20px;color:#8fa4bf;font-size:16px;padding:24px 0;line-height:1.3}footer>span:first-child{color:#b8c9df}[hidden]{display:none!important}@media(max-width:800px){main{padding:0 12px}header{height:91px;gap:12px}.brand{font-size:12px}.brand small{font-size:10px;letter-spacing:2px}.event{font-size:10px}.event b{font-size:13px}.event>span{font-size:11px}.club-logo{width:65px;height:64px}.menu{grid-template-columns:1fr;gap:20px;padding:22px;align-content:center}.title-block{text-align:center}h1{font-size:28px;line-height:1.4}.overline{font-size:9px;margin-bottom:12px}.subline{font-size:21px;max-width:none;margin:10px 0 0}.selection{width:100%;max-width:490px;justify-self:center;padding:18px}.screen{height:730px}.topline{padding:9px;font-size:13px;letter-spacing:0}.topline>div{gap:5px}.topline button{font-size:13px;padding:4px}.bottomline{padding:10px;font-size:12px;gap:12px}.bottomline>span:last-child{white-space:nowrap}.choices .portrait{height:100px}.how{margin-top:14px}footer{font-size:14px;gap:14px}.hud{gap:15px;left:14px;right:14px}.hud strong{font-size:21px}.hud small{font-size:14px}.route span{font-size:13px}.playing .screen{height:clamp(330px,58svh,530px)}.playing header{height:77px}.result h2{font-size:20px}.result p{font-size:19px;margin:10px 0}.result .overline{margin-bottom:8px}.result-pilot{height:55px;width:48px;margin:0 0 8px}.event-call{font-size:11px}.event-call span{font-size:9px}.result .primary{margin:12px 0 8px;padding:12px}.result .secondary{padding:8px}.drive-controls{justify-content:space-between}.drive-controls button{flex:1}#audioStatus{max-width:220px}.event>span{max-width:150px}}@media(max-width:390px){.club-logo{width:49px}.brand{font-size:10px}.event b{font-size:11px}.menu{padding:14px}.selection{padding:14px}.choices{gap:5px}.choices button{font-size:13px}.choices .portrait{height:85px}.screen{height:710px}.primary{font-size:10px}.drive-controls #jump{min-width:190px}}@media(max-height:550px) and (min-width:700px){header{height:65px}.club-logo{height:53px}.screen{height:420px}.playing .screen{height:300px}.menu{grid-template-columns:.8fr 1.2fr;padding:20px;gap:20px}.selection{padding:14px}.step-head{padding-bottom:8px;margin-bottom:15px}.how{margin-top:12px}.choices .portrait{height:70px}.subline{font-size:20px}#selectionHint{margin:12px 0;min-height:20px}.drive-controls{margin-top:12px}footer{padding:15px 0}}
.club-logo{position:relative;display:block;overflow:hidden;height:68px;flex-shrink:0}.club-logo img{position:absolute;width:131%;height:144%;max-width:none;left:-15.56%;top:-19.5%;image-rendering:pixelated}.title-car{display:block;width:280px;height:130px;object-fit:contain;image-rendering:pixelated;margin:14px 0 0}.choice-car{display:block;width:100%;height:38px;object-fit:contain;image-rendering:pixelated;margin:6px auto}@media(max-width:800px){.club-logo{height:45px}.title-car{width:180px;height:72px;margin:6px auto 0}.screen{height:790px}.playing .screen{height:clamp(330px,58svh,530px)}.menu{gap:15px}.choices .portrait{height:110px}}@media(max-width:390px){.club-logo{height:34px}.screen{height:780px}.choices .portrait{height:95px}}@media(max-height:550px) and (min-width:700px){.screen{height:460px}.title-car{height:85px;width:200px}.playing .screen{height:300px}.club-logo{height:42px}}

/* Explicit block geometry keeps each pilot sprite visible inside its choice button. */
.choices .portrait{display:block;width:100%;min-height:100px;background-size:500% 100%;background-repeat:no-repeat}
h1{font-size:clamp(20px,2.3vw,30px);line-height:1.5}.brand{font-size:15px}.brand small{font-size:14px;letter-spacing:2px;color:var(--gold);opacity:1}
@media(max-width:800px){h1{font-size:24px}.brand{font-size:11px}.brand small{font-size:11px;letter-spacing:1px}.screen{height:830px}.playing .screen{height:clamp(330px,58svh,530px)}}
@media(max-width:390px){h1{font-size:21px}.brand{font-size:9px}.brand small{font-size:10px}.choices .portrait{min-height:95px}}
@media(max-height:550px) and (min-width:700px){.screen{height:490px}.playing .screen{height:300px}h1{font-size:23px}}

.main-logo{display:block;position:relative;overflow:hidden;width:min(100%,300px);aspect-ratio:1105/754;margin:0 0 16px;border:3px solid #ffefcb;box-shadow:5px 5px #080f1c}.main-logo img{position:absolute;width:131%;height:144%;left:-15.56%;top:-19.5%;image-rendering:pixelated}.main-logo+.overline{font-size:9px;letter-spacing:0;margin-bottom:12px}.title-car{height:95px;width:230px;margin-top:8px}.subline{font-size:21px;margin-top:8px}.pilots{grid-template-columns:repeat(5,minmax(0,1fr));gap:13px 7px}.pilots .portrait{height:96px;min-height:96px}.pilots button{font-size:16px}.selection{padding:20px}#selectionHint[hidden]{display:none}.screen{height:690px}.how{font-size:16px}.hud .route{max-width:400px}.route span{display:block;white-space:normal;line-height:1.1}.route small{line-height:1.2}
@media(max-width:800px){.menu{gap:18px;align-content:start;padding:22px}.main-logo{width:180px;margin:0 auto 12px}.main-logo+.overline{font-size:8px}h1{font-size:21px;line-height:1.4}.title-car{display:none}.subline{font-size:19px;margin:8px 0 0}.screen{height:940px}.playing .screen{height:clamp(330px,58svh,530px)}.pilots{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 10px}.pilots .portrait{height:88px;min-height:88px}.pilots button{font-size:16px}.selection{padding:16px}.step-head{padding-bottom:10px;margin-bottom:16px}.how{font-size:15px;margin-top:12px}.actions{margin-top:18px}}
@media(max-width:390px){.screen{height:940px}.main-logo{width:150px}.pilots .portrait{height:83px;min-height:83px}.menu{padding:17px}.playing .screen{height:clamp(330px,58svh,530px)}}
@media(max-height:550px) and (min-width:700px){.menu{grid-template-columns:.8fr 1.2fr;align-content:center}.screen{height:650px}.main-logo{width:220px}.title-car{display:block;width:210px;height:85px}.pilots{grid-template-columns:repeat(5,minmax(0,1fr))}.pilots .portrait{height:82px;min-height:82px}.playing .screen{height:300px}}

/* Accessible keyboard/touch switch; off selects the longer challenge. */
.difficulty{margin:16px 0;padding:12px 0;border-top:1px dashed #43536c;border-bottom:1px dashed #43536c}.mode-switch{display:flex;align-items:center;gap:12px;min-height:44px;cursor:pointer;font:11px var(--pixel);position:relative}.mode-switch input{position:absolute;width:48px;height:28px;margin:0;opacity:0}.switch-track{display:block;flex:0 0 48px;height:28px;border:2px solid #7c93b1;background:#101827;padding:3px}.switch-track:before{content:'';display:block;width:16px;height:18px;background:#a3b3c8;transition:transform .12s}.mode-switch input:checked+.switch-track{background:#27523e;border-color:var(--mint)}.mode-switch input:checked+.switch-track:before{transform:translateX(22px);background:var(--mint)}.mode-switch input:focus-visible+.switch-track{outline:3px solid white;outline-offset:4px}#modeHint{font-size:17px;line-height:1.2;color:#b9cce0;margin:6px 0 0}.menu{overflow-y:auto}@media(max-width:800px){.screen{height:1070px}.playing .screen{height:clamp(330px,58svh,530px)}.difficulty{margin:12px 0;padding:8px 0}}

.pilots{grid-template-columns:repeat(4,minmax(0,1fr))}.pilots .portrait{height:85px;min-height:85px}@media(max-width:800px){.pilots{grid-template-columns:repeat(3,minmax(0,1fr))}.screen{height:1200px}.playing .screen{height:clamp(330px,58svh,530px)}}

/* The image has intrinsic proportions; the selection cell only supplies a box. */
.portrait,.choices .portrait,.pilots .portrait{background-size:contain;background-position:center bottom;background-repeat:no-repeat}.result-pilot .portrait{height:100%;width:100%;aspect-ratio:auto}
