@font-face{font-family:Pinewood;src:url('fonts/pinewood-pixel.ttf') format('truetype');font-display:swap}
:root{--ink:#102633;--paper:#fff2d1;--gold:#ffd079;--muted:#bfdbd8;--frame:#c1c8b2;--pixel-cut:polygon(0 8px,4px 8px,4px 4px,8px 4px,8px 0,calc(100% - 8px) 0,calc(100% - 8px) 4px,calc(100% - 4px) 4px,calc(100% - 4px) 8px,100% 8px,100% calc(100% - 8px),calc(100% - 4px) calc(100% - 8px),calc(100% - 4px) calc(100% - 4px),calc(100% - 8px) calc(100% - 4px),calc(100% - 8px) 100%,8px 100%,8px calc(100% - 4px),4px calc(100% - 4px),4px calc(100% - 8px),0 calc(100% - 8px))}
*{box-sizing:border-box;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}[hidden]{display:none!important}
html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#071823;color:var(--paper);font-family:Pinewood,monospace;font-size:20px;line-height:1.35;touch-action:none}body{display:grid;place-items:center}button{font:inherit;color:inherit;cursor:pointer;touch-action:manipulation;border:4px solid var(--frame);background:#193543;box-shadow:inset 0 3px #42616b,inset 0 -3px #081e2b;clip-path:var(--pixel-cut);line-height:1.15}button:hover{background:#2c505a}button:focus-visible{outline:none;box-shadow:inset 0 0 0 4px var(--gold);filter:brightness(1.2)}button:disabled{cursor:wait;opacity:.7}button:active,button.pressed{transform:translateY(2px);background:#d7a85f;color:var(--ink)}
#game{position:relative;width:min(100vw,177.777778dvh);height:min(100dvh,56.25vw);overflow:hidden;isolation:isolate}#scene{display:block;width:100%;height:100%;image-rendering:pixelated}.pixel-icon{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px}.pixel-icon canvas{width:100%;height:100%;image-rendering:pixelated;display:block}
header{position:absolute;inset:18px 22px auto;display:grid;grid-template-columns:1fr auto 1fr;align-items:start;gap:15px;text-shadow:2px 2px #0b2433}.brand{font-size:30px;line-height:1.1;color:var(--gold)}.brand span{display:block;color:var(--paper)}.brand small{display:block;font-size:14px;margin-top:7px;color:var(--paper)}.level{text-align:center;background:#142d3ef5;border:4px solid var(--frame);box-shadow:inset 0 3px #45616b,inset 0 -3px #081d2d;padding:9px 15px;min-width:250px;clip-path:var(--pixel-cut)}.level>span{font-size:16px;color:var(--gold)}.level strong{display:block;font-size:20px;font-weight:normal;margin:2px 0 6px}.hud-bottom{display:flex;justify-content:space-between;gap:15px;align-items:center;font-size:20px}.hud-bottom>span{font-size:16px;color:var(--gold)}.progress{height:4px;background:#46636a;margin-top:6px}.progress i{display:block;width:100%;height:100%;background:var(--gold);transform-origin:left;transform:scaleX(0)}nav{display:flex;justify-self:end;gap:6px}nav button{display:grid;place-items:center;width:47px;height:47px;padding:6px}
#hint{position:absolute;top:139px;left:50%;transform:translateX(-50%);max-width:calc(100% - 35px);text-align:center;padding:8px 12px;background:#142d3ef2;color:var(--paper);font-size:16px;line-height:1.4;clip-path:var(--pixel-cut)}.controls{position:absolute;bottom:34px;left:24px;right:24px;display:flex;align-items:end;justify-content:space-between;gap:12px;pointer-events:none}.controls button{pointer-events:auto;min-width:142px;height:91px;background:#173346ec;padding:9px 8px}.controls .pixel-icon{width:30px;height:30px}.controls small{display:block;font-size:14px;margin-top:5px}.keyboard{text-align:center;background:#102633d9;padding:7px 12px;font-size:16px;line-height:1.6;clip-path:var(--pixel-cut)}.keyboard>span:last-child{display:block;color:var(--muted);font-size:14px}.key{display:inline-block;color:var(--gold);font-size:16px;background:#0a202d;padding:5px 7px;border-bottom:3px solid #64857f}footer{position:absolute;bottom:8px;left:25px;right:25px;display:flex;justify-content:space-between;font-size:12px;color:#eff3d8;text-shadow:2px 2px #0b263a}
#overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:18px;background:#04172388}.panel{width:min(700px,100%);max-height:100%;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;background:#102a38;border:4px solid var(--frame);box-shadow:inset 0 4px #44616a,inset 0 -4px #071d2c;padding:26px 30px;clip-path:var(--pixel-cut);scrollbar-color:#e4bc75 #183b49;scrollbar-width:thin}.eyebrow{font-size:16px;line-height:1.4;color:var(--gold)}h1{font-size:40px;line-height:1.1;font-weight:normal;margin:15px 0 13px;color:var(--paper);text-shadow:3px 3px #071c28}p{font-size:20px;line-height:1.4;color:var(--muted);margin:0 0 17px}.instructions{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:18px 0}.instructions>div{background:#1c3b48;padding:12px;border-left:4px solid #77958a}.instructions strong{font-size:18px;display:block;font-weight:normal;margin:8px 0;color:var(--paper)}.instructions p{font-size:18px;line-height:1.4;margin:0}.instructions .instruction-footer{grid-column:1/-1;font-size:16px;line-height:1.5;color:var(--paper);text-align:center;padding:1px 0}.star-guide{padding:14px;background:#1c3b48;margin:14px 0}.star-guide strong{color:var(--gold);font-weight:normal}.star-guide p{font-size:18px;line-height:1.6;margin:8px 0 0}.actions{display:flex;gap:12px}.actions button{min-height:52px;padding:13px 16px;flex:1;font-size:20px}.primary{background:#eebc6e;color:#102633;border-color:#ffe7a4;box-shadow:inset 0 3px #ffdc96,inset 0 -3px #b17c43;text-align:left}.primary:hover{background:#ffd491}.primary>span{float:right}.secondary{flex:0 1 190px!important;font-size:18px!important}.trail-picker{display:flex;gap:10px;margin:19px 0 13px}.trail-picker button{flex:1;min-width:0;padding:10px 4px;font-size:20px}.trail-picker button>span{display:block;font-size:16px;margin-top:5px}.trail-picker button.selected{border-color:var(--gold);background:#2c464b;color:var(--gold)}.earned{display:block;margin-top:9px;font-size:20px;line-height:1.2;color:var(--gold);letter-spacing:3px}.earned.unplayed{color:#bed4d0}#tip{display:block;text-align:center;font-size:16px;color:var(--muted)}
.stars{display:flex;justify-content:center;gap:14px;margin:10px 0 18px;font-size:60px;line-height:1.2;filter:drop-shadow(3px 3px 0 #061a28)}.stars>span{color:#6f8f91}.stars>span.lit{color:#ffce70;animation:star-in .25s steps(4) both;animation-delay:var(--delay)}@keyframes star-in{from{opacity:0;transform:translateY(7px) scale(.8)}to{opacity:1;transform:none}}.result-times{display:grid;grid-template-columns:1fr 1fr;background:#1d3e4b;padding:14px 8px;text-align:center;gap:8px;border:2px solid #678c88}.result-times span{display:block;font-size:16px;color:var(--muted)}.result-times strong{display:block;font-weight:normal;font-size:30px;color:var(--gold);margin-top:5px}.thresholds{margin:13px 0;border:2px solid #678c88;background:#153440;padding:8px 13px}.thresholds>div{display:flex;justify-content:space-between;gap:12px;font-size:18px;padding:5px 0}.thresholds>div>span{color:var(--gold)}.thresholds strong{font-weight:normal;text-align:right}.result-note{font-size:16px;text-align:center;color:var(--muted);margin:10px 0 15px}#result~.actions{margin-top:15px}
@media(max-width:800px){header{inset:12px 14px auto;gap:8px}.brand{font-size:20px}.brand small{font-size:12px;max-width:95px}.level{min-width:215px;padding:8px 10px}nav{gap:4px}nav button{width:40px;height:42px;padding:6px}.level strong{font-size:18px}.hud-bottom{font-size:18px}.hud-bottom>span{font-size:14px}.keyboard{display:none}.panel{padding:22px}#hint{top:125px}.controls{left:17px;right:17px}.controls button{min-width:132px}}
@media(max-width:600px){#game{width:100vw;height:100dvh}header{grid-template-columns:1fr auto}.brand{font-size:20px}.brand small{font-size:12px;max-width:none}.level{grid-row:2;grid-column:1/-1;justify-self:center;margin-top:4px;min-width:230px}.level strong{font-size:20px}.hud-bottom{font-size:20px}.hud-bottom>span{font-size:16px}nav button{width:40px;height:42px}.pixel-icon{width:24px;height:24px}#hint{top:180px;font-size:16px}.panel{padding:20px 17px}h1{font-size:30px;margin-top:12px}p{font-size:20px}.eyebrow{font-size:16px}.instructions{gap:8px}.instructions>div{padding:10px 8px}.instructions strong,.instructions p{font-size:16px}.instructions .key{font-size:14px;padding:5px}.instruction-footer{font-size:16px!important}.actions{gap:8px}.actions button{font-size:18px;padding:13px 10px}.secondary{flex-basis:125px!important;font-size:16px!important}.trail-picker{gap:7px}.trail-picker button>span{font-size:14px}.stars{font-size:50px;gap:10px;margin-bottom:13px}.thresholds>div{font-size:16px}.result-times strong{font-size:30px}.result-times span{font-size:14px}.controls button{min-width:132px}.controls{bottom:30px}footer{font-size:10px;left:19px;right:19px}#tip{font-size:14px}}
@media(max-width:360px){header{inset:10px}.brand{font-size:18px}nav button{width:35px}.panel{padding:17px 13px}.instructions{grid-template-columns:1fr}.instructions>div{display:grid;grid-template-columns:95px 1fr;column-gap:8px}.instructions strong{margin:3px 0}.instructions p{grid-column:1/-1;margin-top:7px}.controls button{min-width:117px}.controls small{font-size:12px}.trail-picker button>span{font-size:12px}.thresholds>div{font-size:14px}.result-times strong{font-size:25px}}
@media(max-height:510px) and (min-width:601px){header{top:9px}.brand{font-size:20px}.brand small{font-size:10px}.level{padding:4px 10px}.level>span{font-size:14px}.level strong{font-size:16px;margin:1px 0}.hud-bottom{font-size:16px}.hud-bottom>span{font-size:14px}#hint{top:105px;font-size:14px}.controls{bottom:24px}.controls button{height:65px;min-width:123px;padding:5px}.controls .pixel-icon{height:25px;width:25px}.controls small{font-size:12px;margin-top:2px}footer{font-size:10px;bottom:5px}.panel{padding:16px 22px}.panel h1{font-size:30px}.panel p{font-size:18px}.instructions{margin:10px 0}.instructions p{font-size:16px}.trail-picker{margin:12px 0}#overlay{padding:12px}}
@media(prefers-reduced-motion:reduce){.stars>span.lit{animation:none}}

.menu-link{display:block;width:100%;margin-top:10px;padding:10px;font-size:18px;border-width:2px;color:var(--muted)}
@media(max-width:600px){.instructions strong,.instructions p{font-size:18px}.instructions .key{font-size:16px}.thresholds>div{font-size:18px}.trail-picker button>span{font-size:16px}}
@media(max-width:600px){.instructions{grid-template-columns:1fr}.instructions>div{display:grid;grid-template-columns:105px 1fr;column-gap:10px;align-items:center}.instructions strong{margin:0}.instructions p{grid-column:1/-1;margin-top:8px}}
.instructions>div{min-width:0}
@media(max-width:360px){.instructions>div{grid-template-columns:95px minmax(0,1fr)}.trail-picker{flex-direction:column}.trail-picker button{display:grid;grid-template-columns:28px minmax(0,1fr) 74px;gap:6px;align-items:center;text-align:left;padding:8px 6px}.trail-picker button>span{font-size:16px;margin:0}.earned{margin:0;font-size:18px;letter-spacing:2px;text-align:right}}
/* Illustrated trail selection. Text labels remain available to assistive tech. */
.map-panel{width:min(1000px,100%);max-height:100%;overflow:auto;background:#142f37;border:4px solid #eddfa8;clip-path:var(--pixel-cut);padding:15px;box-shadow:inset 0 4px #496958;touch-action:pan-y}.map-heading{display:flex;align-items:center;gap:20px;padding:0 6px 13px}.map-heading h1{font-size:26px;margin:0;flex:1}.map-totals{display:flex;gap:18px;color:var(--gold);white-space:nowrap;font-size:24px}.map-totals b{font-weight:normal;color:var(--paper)}.map-heading button{width:44px;height:44px;padding:5px}.map-board{position:relative;width:100%;aspect-ratio:480/270;border:4px solid #527a67;overflow:hidden;background:#83b59a}#mapArt{width:100%;height:100%;display:block;image-rendering:pixelated}.map-node{position:absolute;left:var(--x);top:var(--y);transform:translate(-50%,-50%);width:23%;padding:5px;background:#183c44;border:3px solid #dce2bb;overflow:visible;box-shadow:inset 0 -4px #081f2c;isolation:isolate}.map-node:hover{background:#35534c;filter:brightness(1.1)}.map-node:active{transform:translate(-50%,calc(-50% + 2px))}.map-node>canvas{display:block;width:100%;height:auto;image-rendering:pixelated}.map-number{position:absolute;top:4px;left:5px;color:#fff2d1;background:#102633;padding:3px 5px;font-size:20px;z-index:1}.map-stars{display:block;color:#ffce70;font-size:30px;line-height:1.25;letter-spacing:3px;text-align:center;background:#122c37;padding-top:5px}.map-status{position:absolute;right:5px;bottom:47px;font-size:20px;color:#fff2d1;background:#193543;padding:3px 5px}.map-node.completed{border-color:#ffce70}.map-node.completed .map-status{background:#3d6650;color:#fff0ba}.show-map{background:#041723d9}#game:has(.show-map:not([hidden]))>header,#game:has(.show-map:not([hidden]))>.controls,#game:has(.show-map:not([hidden]))>#hint{visibility:hidden}
@media(max-width:800px){nav{gap:3px}nav button{width:35px}.map-heading h1{font-size:22px}.map-totals{font-size:20px;gap:12px}.map-stars{font-size:24px}.map-status{bottom:38px;font-size:16px}.map-number{font-size:16px}}
@media(max-width:600px){.map-panel{padding:10px}.map-heading{flex-wrap:wrap;gap:10px;padding:4px 2px 12px}.map-heading h1{font-size:22px;flex-basis:100%;text-align:center}.map-totals{flex:1;justify-content:center;font-size:24px}.map-board{aspect-ratio:300/410}.map-board #mapArt{width:160%;height:100%;transform:translateX(-18%)}.map-node{width:48%;left:calc(50% + (var(--x) - 50%) * .6);top:calc(15% + var(--y) * .92)}.map-stars{font-size:28px}.map-number{font-size:20px}.map-status{font-size:18px;bottom:44px}.map-heading button{width:42px;height:42px}.map-heading .pixel-icon{width:24px;height:24px}}
@media(max-height:510px) and (min-width:601px){.map-panel{width:min(660px,100%);padding:8px}.map-heading{padding-bottom:6px}.map-heading h1{font-size:20px}.map-heading button{width:32px;height:32px}.map-heading .pixel-icon{width:20px;height:20px}.map-board{max-height:270px}.map-stars{font-size:22px}.map-number{font-size:16px}.map-status{bottom:35px;font-size:16px}}
@media(max-width:600px){.map-board{aspect-ratio:300/450}.map-board #mapArt{width:100%;height:100%;transform:none}.map-node{width:38%;left:var(--x);top:var(--y)}.map-stars{font-size:24px;letter-spacing:1px}.map-number{font-size:16px}.map-status{font-size:16px;bottom:37px}}
/* Refined illustrated menu treatment, using the game's own timber and scenery. */
.map-panel,.panel{border:0;padding:18px;background:#142f37;box-shadow:0 6px 0 #071b24,inset 0 0 0 4px #3e271f,inset 0 0 0 8px #b88a52;position:relative;clip-path:var(--pixel-cut)}.map-panel:before,.map-panel:after,.panel:before,.panel:after{content:'';position:absolute;left:0;right:0;height:16px;background-image:var(--timber);background-size:320px 28px;background-position:center;z-index:2;pointer-events:none}.map-panel:before,.panel:before{top:0}.map-panel:after,.panel:after{bottom:0}.map-heading{background:#102c35;padding:10px 12px 16px;gap:16px}.map-heading h1{color:#ffe5a1;text-shadow:2px 3px #392c24}.map-totals{background:#0b222b;padding:8px 12px;border:2px solid #77917d}.map-board{border:0;box-shadow:inset 0 0 0 3px #b48b5a;aspect-ratio:16/9}.map-node{width:19%;border:3px solid #c99c62;background:#352b28;box-shadow:0 5px 0 #112b2c,inset 0 0 0 2px #f2d090;padding:5px}.map-node>canvas{border:1px solid #081e29}.map-number{background:#102633f5;color:#fff0bf;top:6px;left:7px;padding:3px 6px}.map-stars{background:#102b33;color:#ffda85;padding:4px 0 3px;font-size:28px;text-shadow:1px 2px #6c451f}.map-status{bottom:42px;background:#173943;right:6px}.map-node.completed{border-color:#ffe19a}.map-node.completed:after{content:'';position:absolute;inset:-5px;border:2px solid #fff0b0;pointer-events:none;clip-path:var(--pixel-cut)}
.panel{padding:24px;width:min(640px,100%);background:linear-gradient(#193943,#102936)}#menuScene{width:calc(100% + 16px);margin:-5px -8px 14px;display:block;height:auto;aspect-ratio:560/180;image-rendering:pixelated;border:3px solid #b58c57;box-shadow:0 4px #09202b}.panel h1{font-size:32px;text-align:center;color:#ffdfa1;margin:10px 0 14px}.panel .eyebrow:empty,.panel #message:empty,.result-note:empty,#tip:empty{display:none}.panel #message{text-align:center;font-size:18px;margin-bottom:12px}.panel .actions{margin-top:16px}.panel .actions button,.menu-link{border-color:#cca66c;box-shadow:inset 0 3px #f9d68c,inset 0 -4px #5c3d2b;background-color:#805737;background-image:linear-gradient(#a5753b99,#68462aaa),var(--timber);background-size:auto,320px 100%;color:#fff3d2;text-shadow:2px 2px #3e2a24;text-align:center}.panel .actions .primary{background-color:#356d54;background-image:linear-gradient(#3c7b57de,#204c3ce8),var(--timber);border-color:#e9d39b;box-shadow:inset 0 3px #86ab74,inset 0 -4px #142f2c}.panel .actions button:hover,.menu-link:hover{filter:brightness(1.18)}.panel .actions .primary>span{float:none;margin-left:14px}.menu-link{font-size:18px;color:#fff3d2}.instructions{margin:12px 0}.instructions>div{background:#102936;border:2px solid #789181;padding:10px;text-align:center}.instructions .key{font-size:18px}.instructions p{color:#ffe3a4}.star-guide{background:#102936;border:2px solid #789181;text-align:center;padding:10px}.star-guide strong{display:none}.star-guide p{margin:0}.result-times{background:#0e2632;border-color:#9c986f}.thresholds{background:#102b34;border-color:#70867a}.thresholds strong{font-size:16px}.stars{margin:6px 0 12px}
@media(max-width:600px){.map-panel{padding:14px}.map-heading{padding:8px 4px 14px;gap:10px}.map-heading h1{font-size:20px}.map-totals{font-size:22px;padding:6px 9px}.map-board{aspect-ratio:300/450}.map-node{width:38%}.map-stars{font-size:24px}.map-status{bottom:38px}.panel{padding:21px 17px}.panel h1{font-size:28px}.panel .instructions>div{grid-template-columns:1fr;text-align:center}.panel .instructions{grid-template-columns:1fr 1fr}.panel .instructions .key{font-size:14px}.panel .instructions strong{font-size:16px;margin:7px 0}.panel .instructions p{margin:0;font-size:16px}.panel .instructions .instruction-footer{grid-column:1/-1;font-size:14px!important}.thresholds>div{font-size:16px}.thresholds strong{font-size:14px}#menuScene{margin-bottom:10px}}
@media(max-height:510px) and (min-width:601px){.map-panel{padding:12px;width:min(690px,100%)}.map-heading{padding:4px 8px 8px}.map-board{max-height:none}.map-totals{font-size:18px;padding:4px 8px}.map-stars{font-size:22px}.map-status{bottom:35px}.panel{padding:20px;width:590px}#menuScene{height:95px;object-fit:cover}.panel h1{font-size:24px}}
#game:has(#overlay:not([hidden]))>header,#game:has(#overlay:not([hidden]))>.controls,#game:has(#overlay:not([hidden]))>#hint,#game:has(#overlay:not([hidden]))>footer{visibility:hidden}.star-guide{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.star-guide>div>span{color:#ffda85;display:block;font-size:28px;letter-spacing:2px}.star-guide small{display:block;font-size:18px;margin-top:5px;color:#fff2d1}
@media(max-width:600px){#mapArt{object-fit:cover}.star-guide>div>span{font-size:24px}.star-guide small{font-size:16px}}
/* Keep the alpine composition open and the driving controls purely visual. */
.brand{display:none}header{grid-template-columns:1fr auto 1fr}.level{grid-column:2;min-width:200px;padding:7px 13px}.level strong{display:none}.level>span{font-size:18px}.hud-bottom{font-size:18px;margin-top:5px}.hud-bottom>span{font-size:14px}.keyboard{display:none}.controls small{display:none}.controls button{width:112px;min-width:112px;height:94px;background:#142c38ed;border-color:#c9c9b1;border-width:5px;box-shadow:inset 0 0 0 3px #546269,inset 0 -5px #081e2b}.controls .pixel-icon{width:56px;height:56px}.controls{bottom:28px}footer{font-size:10px}.level{border-color:#c2c7b0;box-shadow:inset 0 0 0 2px #485c65,inset 0 -3px #071b28}#hint{top:103px;font-size:14px;background:#102b38e8}
@media(max-width:600px){header{grid-template-columns:1fr auto;inset:12px}.level{grid-column:1/-1;grid-row:2;min-width:190px;max-width:230px;margin-top:4px}.level>span{font-size:16px}.hud-bottom{font-size:18px}.controls button{min-width:100px;width:100px;height:88px}.controls .pixel-icon{width:48px;height:48px}#hint{top:143px;font-size:14px}.controls{left:16px;right:16px}.level strong{display:none}}
@media(max-height:510px) and (min-width:601px){.level{min-width:180px;padding:5px 10px}.level>span{font-size:16px}.hud-bottom{font-size:16px}.controls button{width:88px;min-width:88px;height:73px}.controls .pixel-icon{width:44px;height:44px}#hint{top:90px}}
.level{min-width:220px}.hud-bottom>span{white-space:nowrap}.hud-bottom{gap:10px}
@media(max-width:600px){header{inset:12px 12px auto;grid-template-rows:auto auto}.level{min-width:220px}#hint{top:148px}}
#hint{display:flex;align-items:center;justify-content:center;gap:9px;padding:6px 12px;font-size:16px}#hint .pixel-icon{width:20px;height:20px}
/* Menus are complete screens: adapt the layout, never scroll or crop actions. */
#overlay{container:menus / size;overflow:hidden;touch-action:none}
.panel,.map-panel{overflow:hidden;touch-action:none;overscroll-behavior:none;scrollbar-width:none}
.panel{padding:20px;max-height:100%;width:min(640px,100%)}
#menuScene{height:clamp(70px,18cqh,145px);width:calc(100% + 16px);object-fit:cover;aspect-ratio:auto;margin-bottom:10px}
.panel h1{font-size:28px;line-height:1.1;margin:6px 0 10px}.panel #message{font-size:16px;margin-bottom:6px}
.panel .stars{font-size:52px;line-height:1.05;margin:5px 0 12px;gap:14px}
.panel .result-times{padding:10px 8px}.panel .result-times span{font-size:14px}.panel .result-times strong{font-size:28px;margin-top:4px}
.panel .thresholds{padding:6px 12px;margin:10px 0}.panel .thresholds>div{font-size:16px;line-height:1.2;padding:4px 0}.panel .thresholds strong{font-size:16px}
.panel .actions{margin-top:12px}.panel .actions button{min-height:48px;padding:10px 12px;font-size:18px}.panel .secondary{font-size:16px!important}
.panel .menu-link{min-height:38px;padding:8px;margin-top:8px;font-size:16px}
.panel .instructions{margin:10px 0;gap:8px}.panel .instructions>div{padding:8px}.panel .instructions .instruction-footer{padding:0;font-size:14px!important}.panel .star-guide{margin:8px 0;padding:8px}
.map-panel{height:min(100%,650px);display:flex;flex-direction:column;min-height:0}.map-heading{flex:none}.map-board{flex:1;min-height:0;aspect-ratio:auto;max-height:none}#mapArt{object-fit:cover}
@container menus (max-height:650px){
 .panel{padding:17px}.panel #menuScene{height:85px;margin-bottom:8px}.panel h1{font-size:26px;margin:4px 0 8px}
 [data-screen="won"] .thresholds{display:none}.panel .stars{font-size:46px;margin:4px 0 10px}.panel .result-times{padding:9px 6px}
 .panel .actions{margin-top:10px}.panel .star-guide>div>span{font-size:24px}.panel .instructions strong{font-size:16px}.panel .instructions p{font-size:16px}
}
@container menus (max-height:410px){
 .panel{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.5fr);column-gap:16px;row-gap:8px;padding:18px;width:min(760px,100%);align-content:center}
 .panel>#menuScene{grid-column:1;grid-row:1 / span 5;width:100%;height:100%;min-height:140px;max-height:260px;margin:0;object-fit:cover}
 .panel>#title{grid-column:2;grid-row:1;margin:0;font-size:24px}.panel>#message{display:none}
 .panel>#result,.panel>#instructions{grid-column:2;grid-row:2;margin:0}.panel>#starGuide{grid-column:2;grid-row:3;margin:0;padding:5px}
 .panel>.actions{grid-column:2;grid-row:4;margin:0}.panel>#menu{grid-column:2;grid-row:5;margin:0}
 [data-screen="won"] .panel>.actions{grid-row:3}[data-screen="won"] .panel>#menu{grid-row:4}
 [data-screen="paused"] .panel>.actions,[data-screen="crashed"] .panel>.actions{grid-row:2}
 [data-screen="paused"] .panel>#menu,[data-screen="crashed"] .panel>#menu{grid-row:3}
 .panel .stars{font-size:38px;margin:0 0 6px}.panel .result-times{padding:6px}.panel .result-times span{font-size:12px}.panel .result-times strong{font-size:24px;margin-top:2px}
 .panel .actions button{min-height:44px;padding:8px;font-size:16px}.panel .menu-link{min-height:36px;padding:7px}
 .panel .instructions{gap:6px}.panel .instructions>div{padding:6px;display:block;text-align:center}.panel .instructions strong{font-size:14px;margin:4px 0}.panel .instructions .key{font-size:14px;padding:3px}.panel .instructions p{font-size:14px;margin:0}.panel .instructions .instruction-footer{font-size:12px!important}
 .panel .star-guide>div>span{font-size:22px}.panel .star-guide small{font-size:14px;margin-top:2px}
 .map-heading{padding:4px 8px 8px}.map-panel{padding:12px}
}
@container menus (max-height:410px){.panel>#menuScene{height:190px;max-height:70cqh;min-height:0;align-self:center}.panel .actions button{white-space:nowrap}.panel .secondary{font-size:14px!important;flex-basis:130px!important}}
@container menus (max-height:320px){
 .panel{padding:12px;row-gap:7px;column-gap:12px}.panel .stars{font-size:32px;margin:0 0 4px}.panel .result-times{padding:5px}.panel .result-times strong{font-size:22px}
 [data-screen="won"] .panel>#title,[data-screen="help"] .panel>#title{display:none}
 [data-screen="won"] .panel>#result,[data-screen="help"] .panel>#instructions{grid-row:1}
 [data-screen="won"] .panel>.actions,[data-screen="help"] .panel>#starGuide{grid-row:2}
 [data-screen="won"] .panel>#menu,[data-screen="help"] .panel>.actions{grid-row:3}
 .panel .actions button{padding:6px;min-height:40px}.panel .menu-link{padding:6px;min-height:32px}.panel .instructions .instruction-footer{display:none}
 .panel>#menuScene{grid-row:1 / span 3;height:170px}
}
#screenTransition{position:absolute;inset:0;z-index:80;width:100%;height:100%;image-rendering:pixelated;pointer-events:all}
.is-transitioning .stars>span.lit{animation-play-state:paused}
@media(prefers-reduced-motion:reduce){#overlay .panel{animation:none!important}}

/* Menu sound control remains available over every illustrated panel. */
#panelSound{position:absolute;top:22px;right:22px;width:36px;height:36px;padding:5px;z-index:4;background:#102c35}#panelSound .pixel-icon{width:22px;height:22px}
@container menus (max-height:400px){#panelSound{top:16px;left:16px;right:auto;width:30px;height:30px;padding:3px}}

/* Ghost replay toggle, shared by the HUD, map and pause/result panels. */
[data-ghost][aria-pressed="true"]{border-color:#9bd6cf}[data-ghost][aria-pressed="false"]{opacity:.65}
#panelGhost{position:absolute;top:22px;right:64px;width:36px;height:36px;padding:5px;z-index:4;background:#102c35}#panelGhost .pixel-icon{width:22px;height:22px}
@container menus (max-height:400px){#panelGhost{top:16px;left:52px;right:auto;width:30px;height:30px;padding:3px}}
@media(max-width:600px){header nav{gap:3px}header nav button{width:32px;height:38px;padding:4px}.brand{display:none}header{grid-template-columns:1fr}header nav{justify-self:end}}

/* Six courses share one no-scroll map, with two rows or three on portrait. */
.map-node{width:22%;max-width:205px}.map-board{min-height:0}.map-panel{overflow:hidden}
@media(max-width:600px){.map-node{left:var(--mx);top:var(--my);width:39%;max-width:none}.map-stars{font-size:21px;padding:1px 0}.map-number{font-size:15px}.map-status{bottom:32px;font-size:14px}.map-node{padding:3px}.map-heading{gap:6px}.map-heading h1{font-size:18px}.map-totals{font-size:18px}}
@media(max-height:510px) and (min-width:601px){.map-node{width:18%}.map-stars{font-size:18px;padding:0}.map-status{bottom:27px}.map-number{font-size:14px}}

/* Compact pixel garage, with locked bodies faded but lock hints readable. */
.garage-panel{width:min(840px,94%);max-height:94%;padding:18px;border:4px solid #a59164;background:#15343d;box-shadow:0 0 0 3px #081e28,inset 0 0 0 3px #48616a;display:flex;flex-direction:column;gap:12px;overflow:hidden}
.garage-panel[hidden]{display:none}.garage-panel h1{font-size:clamp(18px,3vw,30px);text-align:center;margin:0;color:#ffe6ae;line-height:1.1}.garage-heading{display:flex;align-items:center;justify-content:space-between;font-size:14px;color:#d4ded0;gap:10px}.garage-heading button{min-width:42px;min-height:36px;padding:4px}.garage-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;min-height:0}.car-card{position:relative;display:flex;flex-direction:column;align-items:center;padding:12px 6px;border:3px solid #657f7d;background:#102b34;color:#ffe6ae;min-width:0;gap:5px;box-shadow:inset 0 0 0 2px #071d28}.car-card.selected{border-color:#ffd675;box-shadow:0 0 0 2px #e6b152,inset 0 0 0 2px #071d28;background:#234544}.car-card strong{font-size:22px}.car-card canvas{width:100%;max-width:210px;image-rendering:pixelated}.car-character{font-size:12px;color:#e3e6d4;white-space:nowrap}.car-pace{font-size:20px;letter-spacing:3px;color:#f7b865}.car-stars{font-size:24px;color:#ffcf6b}.car-time{font-size:16px}.car-card.locked canvas,.car-card.locked .car-character,.car-card.locked .car-pace{opacity:.32;filter:grayscale(1)}.car-card.locked{cursor:not-allowed;border-color:#405c62}.car-lock{position:absolute;display:flex;align-items:center;gap:8px;top:40%;padding:6px 9px;background:#0b222ce8;border:2px solid #80918a;color:#ffe6ae;font-size:18px}.car-lock[hidden]{display:none}.car-lock .pixel-icon{width:20px;height:20px}.garage-panel>.primary{min-height:44px;font-size:20px;margin:0}#carBadge{position:absolute;left:8px;bottom:-15px;background:#102b34;color:#ffe6ae;font-size:11px;padding:2px 4px;border:1px solid #80918a}.map-garage{display:block;font-size:11px;color:#d0d9c8}
@media(max-width:540px){.garage-panel{padding:12px;gap:10px}.garage-cards{gap:6px}.car-card{padding:10px 3px;gap:4px}.car-card strong{font-size:17px}.car-character{font-size:9px}.car-pace{font-size:17px;letter-spacing:0}.car-stars{font-size:21px}.car-time{font-size:14px}.car-lock{padding:4px;gap:3px;font-size:14px}.garage-heading{font-size:11px}.garage-panel>.primary{min-height:42px}}
@media(max-height:440px){.garage-panel{padding:10px;gap:6px}.garage-panel h1{font-size:18px}.garage-heading{font-size:11px}.garage-heading button{min-height:28px}.car-card{padding:6px;gap:2px}.car-card canvas{max-width:128px}.car-card strong{font-size:17px}.car-character{font-size:10px}.car-pace{font-size:14px}.car-stars{font-size:19px}.car-time{font-size:13px}.garage-panel>.primary{min-height:34px;font-size:17px}}

#carBadge{position:static;display:inline-block;vertical-align:middle;margin-right:6px;font-size:10px;padding:2px 4px}



/* Ten illustrated routes on one map, without scrolling. */
.map-node{width:16%;max-width:158px;padding:4px}.map-stars{font-size:23px;letter-spacing:1px;padding:1px 0}.map-status{bottom:34px;font-size:14px}.map-number{font-size:16px;padding:2px 4px}.map-garage{font-size:10px}
@media(max-width:600px){.map-node{width:39%;height:17%;padding:3px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0}.map-node>canvas{width:auto;max-width:100%;height:calc(100% - 30px);max-height:50px;aspect-ratio:96/56}.map-node .map-number{font-size:13px;top:4px;left:4px;padding:1px 3px}.map-stars{font-size:18px;padding:0;line-height:1.1;align-self:stretch}.map-garage{font-size:9px;line-height:1}.map-status{font-size:11px;right:4px;bottom:24px;padding:1px 3px}.map-heading{gap:4px;padding-bottom:8px}.map-heading h1{font-size:18px}.map-heading button{width:33px;height:33px}.map-totals{font-size:17px;padding:4px 7px}}
@media(max-height:510px) and (min-width:601px){.map-node{width:16%;max-height:42%;padding:3px}.map-node>canvas{max-height:50px;object-fit:cover}.map-stars{font-size:17px}.map-garage{font-size:9px}.map-status{bottom:26px}.map-number{font-size:13px}}

/* Compact three-step introduction, using the game's existing sprite palette. */
.intro-panel{width:min(720px,94%);gap:10px}.intro-heading{display:flex;align-items:center;justify-content:space-between;color:#ffda85;font-size:18px}.intro-heading button{font-size:14px;min-height:30px;padding:5px 10px}.intro-panel h1{font-size:30px}.intro-panel canvas{display:block;width:100%;max-height:245px;object-fit:contain;image-rendering:pixelated;border:2px solid #718678;background:#15343d}.intro-panel p{margin:0;text-align:center;font-size:18px;line-height:1.3;min-height:24px}.intro-actions{display:flex;gap:12px;align-items:center}.intro-actions>button{min-height:42px;padding:8px 14px}.intro-actions>.primary{flex:1;text-align:center;font-size:20px}.intro-actions>span{color:#ffda85;letter-spacing:5px;white-space:nowrap;font-size:20px}#introPedals{display:flex;justify-content:space-around;font-size:14px;color:#fff0bd}#introPedals[hidden]{display:flex!important;visibility:hidden}#introPedals kbd{font:inherit;background:#0b2530;border:1px solid #aeb99c;padding:3px 5px}
@media(max-width:600px){.intro-panel{padding:14px;gap:9px}.intro-panel h1{font-size:23px}.intro-heading{font-size:16px}.intro-panel p{font-size:16px}.intro-actions{gap:8px}.intro-actions>span{font-size:16px;letter-spacing:2px}#introPedals{font-size:11px;gap:8px}}
@media(max-height:440px){.intro-panel{width:min(760px,96%);padding:10px;gap:5px}.intro-panel h1{font-size:21px}.intro-panel canvas{max-height:125px}.intro-panel p{font-size:14px;min-height:17px}.intro-heading{font-size:14px}.intro-actions>button{min-height:32px;padding:4px 10px}.intro-actions>.primary{font-size:17px}#introPedals{font-size:11px}}

#mapArt{object-fit:fill}

/* Short pixel entrances run only after the scene has been uncovered. */
#game:not(.is-transitioning) #screenTransition:not([hidden]){background:#091c28}
#overlay.scene-enter .map-heading,#overlay.scene-enter .intro-heading,#overlay.scene-enter .garage-heading{animation:trail-settle .16s steps(4,end) both}
#overlay.scene-enter .map-node{animation:trail-settle .18s steps(4,end) both}
#overlay.scene-enter .map-node:nth-of-type(2n){animation-delay:30ms}
#overlay.scene-enter .map-node:nth-of-type(3n){animation-delay:60ms}
#overlay.scene-enter[data-screen="garage"] .garage-panel,#overlay.scene-enter[data-screen="paused"] .panel,#overlay.scene-enter[data-screen="won"] .panel,#overlay.scene-enter[data-screen="crashed"] .panel{animation:trail-settle .18s steps(4,end) both}
@keyframes trail-settle{from{translate:0 4px;filter:brightness(.86)}to{translate:0 0;filter:brightness(1)}}
@media(prefers-reduced-motion:reduce){#overlay.scene-enter *{animation:none!important}}

/* Unlock requirements stay readable while locked vehicle art is faded. */
.garage-rule{margin:0;text-align:center;font-size:14px;line-height:1.35;color:#fff0bd}.garage-rule>span{color:#bdcfc5;font-size:12px}
.car-requirement{display:flex;flex-direction:column;align-items:center;gap:3px;line-height:1.2;color:#ffe6ae;border-top:1px solid #657f7d;padding-top:7px;width:100%}.car-requirement small{font-size:12px}.car-requirement b{font-size:17px}.car-requirement>span{font-size:24px;color:#ffcf6b}.car-lock{top:30%;padding:7px}.car-lock .pixel-icon{width:22px;height:22px}
@media(max-width:540px){.garage-rule{font-size:12px}.garage-rule>span{font-size:11px}.car-requirement small{font-size:9px}.car-requirement b{font-size:14px}.car-requirement>span{font-size:21px}}
@media(max-height:440px){.garage-rule{font-size:11px;line-height:1.2}.garage-rule>span{font-size:10px}.car-card canvas{max-width:100px}.car-requirement{padding-top:3px;gap:1px}.car-requirement small{font-size:9px}.car-requirement b{font-size:13px}.car-requirement>span{font-size:18px}}

.car-card.locked:disabled{opacity:1;cursor:not-allowed}.car-card.locked:disabled:hover{background:#102b34}

#secretToast{position:absolute;z-index:25;top:132px;left:50%;transform:translateX(-50%);padding:7px 12px;background:#102b34;border:2px solid #d5a361;color:#ffe6ae;font-size:15px;white-space:nowrap;pointer-events:none;box-shadow:0 3px #071d28}#overlay:not([hidden])~#secretToast{display:none}.map-node>canvas.map-secret{position:absolute;right:3px;top:3px;width:22px;height:22px;max-height:none;max-width:none;image-rendering:pixelated;background:#102b34;border:1px solid #d5a361;padding:1px;aspect-ratio:1}
@media(max-height:440px){#secretToast{top:105px;font-size:12px}}
