*{box-sizing:border-box}body{margin:0;background:#342154;color:#fff7e9;font:16px system-ui,sans-serif}main{max-width:1200px;margin:auto}header{display:flex;align-items:center;gap:24px;padding:18px 22px}header strong{font-size:24px}header span{flex:1;color:#edd7f3}button{font:700 17px system-ui;border:0;border-radius:14px;padding:12px 24px;background:#ffe08c;color:#442849;cursor:pointer;box-shadow:0 4px 0 #b87565}button:focus-visible{outline:4px solid #fff;outline-offset:4px}button:active{transform:translateY(2px)}#stage{position:relative;overflow:hidden;border-radius:24px;margin:0 16px;background:#aee5ed}canvas{display:block;width:100%;aspect-ratio:16/9}section{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:20px;background:#342154dc}section[hidden],[hidden]{display:none!important}h1{font-size:clamp(36px,7vw,76px);margin:12px 0;color:#ffe08c;letter-spacing:-3px;text-shadow:0 5px #9e4c76}h2{font-size:36px}.eyebrow{letter-spacing:3px;font-size:13px;font-weight:800}.help{font-size:14px;color:#ead5ee}#play{font-size:22px;min-width:180px;margin:15px}#hud{position:absolute;inset:16px 18px auto;display:flex;justify-content:space-between;gap:8px;pointer-events:none}#hud span{background:#342154e8;padding:8px 14px;border-radius:12px;font-weight:700}footer{padding:18px 24px;text-align:center;color:#edd7f3}.controls{display:flex;justify-content:space-between;margin-top:16px;gap:16px}.controls>div{display:flex;gap:12px}.controls button{touch-action:none;user-select:none;min-width:66px;min-height:56px}@media(max-width:600px){header{gap:10px;padding:14px}header strong{font-size:19px}header span{display:none}header button{margin-left:auto}#stage{margin:0;border-radius:0}canvas{aspect-ratio:4/3}#hud{inset:8px 8px auto;font-size:12px}#hud span{padding:6px}footer{padding:14px 10px;font-size:12px}.controls button{padding:12px 18px}section p{margin:8px}h1{letter-spacing:-1px}.eyebrow{font-size:10px}}

.picker{display:flex;gap:18px}.picker button{display:flex;flex-direction:column;align-items:center;background:#59416c;color:#fff;padding:8px 24px;border:3px solid transparent;box-shadow:none}.picker button[aria-pressed="true"]{border-color:#ffe08c;background:#775476}.picker img{width:76px;height:135px;object-fit:contain;image-rendering:pixelated}.picker small{font-size:11px;margin-top:3px}#title h1{font-size:clamp(24px,5vw,50px);margin:4px}#title p{margin:5px}#play{margin:10px;font-size:18px;padding:10px 22px}#finish button{margin:8px}header{flex-wrap:wrap;gap:12px}#title{padding:10px}.controls button{font-size:14px}@media(max-width:600px){.picker img{width:55px;height:100px}.picker button{padding:5px 14px}#title .eyebrow{display:none}#title .help{font-size:11px}#title>p{font-size:12px}#play{margin:7px;padding:8px 18px}header button{padding:10px 12px;margin-left:0}header strong{margin-right:auto}}

#game{image-rendering:pixelated}.picker img{object-position:center bottom}#hud{flex-wrap:wrap}#checkpoint{font-size:12px}#stage{min-height:320px}#title{overflow:auto}@media(max-width:600px){#stage{min-height:350px}.controls{gap:8px}.controls>div{gap:8px}.controls button{min-width:58px;padding:12px 14px}#hud{font-size:11px}#checkpoint{font-size:10px}}

.vitals{display:flex;gap:8px;flex:1 1 240px}.vitals label{background:#342154e8;padding:6px 10px;border-radius:10px;flex:1}.vitals meter{display:block;width:100%;height:12px;accent-color:#91e5ac}#hud .vitals span{padding:0;background:none;font-size:12px;display:block}.medicine-control{display:flex;align-items:center;justify-content:center;gap:12px;margin-top:12px}.medicine-control small{font-size:12px}button:disabled{opacity:.5;cursor:default}.controls{flex-wrap:wrap}@media(max-width:600px){.vitals{order:3;flex-basis:100%}.medicine-control{flex-wrap:wrap;gap:8px}.medicine-control button{padding:10px 16px;font-size:14px}#hud{gap:4px}.vitals label{padding:4px 8px}}

#medicine{touch-action:manipulation}#health-meter::-webkit-meter-optimum-value{background:#91e5ac}#boost-meter::-webkit-meter-optimum-value{background:#d8adff}

.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}

#hud .vitals{order:-1;flex:0 0 210px;flex-direction:column;gap:4px}#hud .vitals label{padding:5px 9px}#hud .vitals meter{height:11px}@media(max-width:600px){#hud .vitals{flex-basis:145px}#hud .vitals span{font-size:10px}}

.weapon-charge{background:#342154e8;padding:6px 10px;border-radius:10px;flex:0 1 160px}.weapon-charge meter{display:block;width:100%;height:12px}#hud .weapon-charge span{background:none;padding:0;display:block;font-size:11px}#finish h2{font-size:clamp(22px,4vw,36px)}#finish button{padding:9px 18px;margin:5px}

#hud{font-size:12px}#hud>span{padding:5px 8px}#timer{font-variant-numeric:tabular-nums}#hud #timer.urgent{background:#a43351}.vitals{min-width:0}@media(max-width:600px){#hud{font-size:10px;gap:3px}#hud>span{padding:4px 6px}.weapon-charge{flex-basis:110px}#medicine-status{font-size:9px}#finish button{font-size:14px}#finish p{font-size:12px}}

.game-layout{display:flex;align-items:stretch;gap:10px;margin:0 16px}.game-layout #stage{flex:1;min-width:0;margin:0}.world-sidebar{flex:0 0 145px;background:#422c60;border-radius:18px;padding:14px 10px}.world-sidebar h2{font-size:17px;margin:0 0 12px}.world-sidebar ol{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:12px}.world-sidebar li{padding:10px 7px;border-left:3px solid #7b638f;font-size:13px;color:#c1accd}.world-sidebar li.current{border-color:#ffe08c;background:#5e426f;color:#fff4cd;border-radius:6px}.world-sidebar li.complete{color:#a5dfb2}#finish{overflow:auto;justify-content:flex-start;padding:14px}#finish h2{margin:5px 0}#finish p{margin:5px 0}#world-progress{color:#ffe08c;font-weight:800}.high-score-panel{background:#21193490;border-radius:12px;padding:9px 16px;margin:7px 0;min-width:180px}.high-score-panel h3{font-size:13px;margin:0 0 5px;color:#ffe08c}#high-scores{white-space:pre-line;font-size:12px;line-height:1.5}.finish-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:3px}#next-countdown{font-size:13px;color:#a5dfb2}@media(max-width:600px){.game-layout{margin:0;gap:4px}.world-sidebar{flex-basis:66px;border-radius:0;padding:10px 3px}.world-sidebar h2{font-size:12px}.world-sidebar ol{gap:5px}.world-sidebar li{font-size:9px;line-height:1.5;padding:7px 3px;overflow-wrap:anywhere;border-left-width:2px}.game-layout #stage{border-radius:0}#finish{padding:8px}#finish h2{font-size:20px}.high-score-panel{margin:4px 0;padding:6px 12px}.finish-actions button{font-size:12px;padding:8px 11px}}

header .build-version{display:inline-flex;flex:none;align-items:center;padding:4px 7px;border-radius:6px;background:#59416c;color:#ffe08c;font-size:12px;font-weight:800;white-space:nowrap}@media(max-width:600px){header .build-version{display:inline-flex!important;font-size:10px;padding:4px}#hud{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-content:start}#hud .vitals{grid-column:1/3;min-width:0;gap:2px}#hud .vitals label{padding:3px 6px}#hud .vitals span{font-size:9px}#hud .vitals meter{height:8px}.weapon-charge{grid-column:3;min-width:0;padding:3px}.weapon-charge meter{height:8px}#hud .weapon-charge span{font-size:9px}#character-label,#checkpoint,#medicine-status{display:none}#hud>span{font-size:8px;padding:3px}#hazard-status{grid-column:1/-1}}

.world-choice{display:flex;align-items:center;justify-content:center;gap:8px;margin:8px 0;font-size:.85rem}.world-choice select{max-width:220px;padding:7px;border:2px solid #d9c8f2;border-radius:8px;background:#fff7ed;color:#342154;font:inherit}
@media(max-width:600px){.world-choice{margin:4px 0;font-size:.75rem}.world-choice select{padding:4px;max-width:195px}}

.picker{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;max-width:100%;flex-shrink:0}.picker button{padding:6px 14px;min-width:0}.picker small{max-width:125px}.picker img{height:115px}#title{justify-content:flex-start}#title h1{flex-shrink:0}#title>p{flex-shrink:0}@media(max-width:600px){.picker{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;width:100%;max-width:300px}.picker img{height:64px;width:47px}.picker button{padding:4px 8px;font-size:14px}.picker small{font-size:9px}.picker button span{line-height:1.2}#title h1{font-size:24px}#title{padding:7px}#title>p{font-size:10px}#play{font-size:15px;padding:8px 12px;margin:6px}}

#pause-screen{z-index:5;background:#342154ee}#pause-screen h2{margin:8px}#pause-screen p{max-width:280px}#pause{white-space:nowrap}@media(max-width:600px){header{gap:7px}header button{font-size:12px;padding:9px 10px}#pause-screen h2{font-size:30px}}

.picker{grid-template-columns:repeat(5,minmax(0,1fr));gap:7px}.picker button{padding:6px 10px}#wind-status{color:#e8f5cd}@media(max-width:600px){.picker{grid-template-columns:repeat(2,minmax(0,1fr))}.picker button:last-child{grid-column:1/-1;justify-self:center;width:calc(50% - 3px)}.picker img{height:58px}.picker button{padding:3px 6px}}

/* The playable canvas and its overlays share one box; portrait HUD gets its own row. */
#playfield{position:relative;width:100%;min-height:320px}
@media(max-width:600px) and (orientation:portrait){
 .game-layout #stage{display:flex;flex-direction:column;align-self:flex-start;min-height:0}
 #hud{position:static;inset:auto;flex:none;order:0;width:100%;padding:6px;gap:4px;background:#342154;pointer-events:none}
 #playfield{order:1;min-height:350px;background:#342154}
 #wind-status,#hazard-status{grid-column:1/-1}
 #hud>span{overflow-wrap:anywhere}
 #game{width:100%;height:auto;aspect-ratio:4/3}
 #title,#finish,#pause-screen{inset:0}
}
#hud{z-index:2}#title,#finish{z-index:3}
/* Status lives below the playable field at every size; never over the canvas. */
.game-layout #stage{display:flex;flex-direction:column;min-height:0}
#playfield{order:0}
#hud{position:static;inset:auto;order:1;flex:none;width:100%;z-index:auto;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:10px;background:#342154;pointer-events:none}
#hud .vitals{grid-column:1;order:0;min-width:0}
#hud .weapon-charge{grid-column:2;min-width:0}
#hud #character-label,#hud #checkpoint,#hud #medicine-status{display:block}
#hud>span{min-width:0;overflow-wrap:anywhere}
#hud #wind-status,#hud #hazard-status{grid-column:1/-1}
@media(max-width:600px){
 #playfield{min-height:0;order:0}
 #hud{order:1;padding:6px;gap:4px;font-size:10px}
 #hud>span{font-size:10px;padding:5px}
 #hud #medicine-status,#hud #character-label,#hud #checkpoint{font-size:9px}
 #hud .vitals span,#hud .weapon-charge span{font-size:10px}
 #title{min-height:100%;overflow:auto}
}

@media(max-width:600px){.world-sidebar ol{gap:2px}.world-sidebar li{font-size:8px;line-height:1.2;padding:3px 2px}}
/* Keep the extra lunar pogo control usable beside Jump and Attack. */
.controls #pogo{width:64px;padding:8px;font-size:12px;white-space:normal}
.controls #pogo[aria-pressed="true"]{background:#91e5ac;box-shadow:0 4px 0 #4e8d78}

/* Compact navigation: keep infrequent actions out of the play area. */
#game-menu{position:relative;z-index:10;flex:none}
#game-menu summary{list-style:none;cursor:pointer;font-weight:700;padding:10px 14px;border-radius:12px;background:#59416c;color:#fff7e9}
#game-menu summary::-webkit-details-marker{display:none}
#game-menu summary:focus-visible{outline:3px solid #ffe08c;outline-offset:2px}
.menu-actions{position:absolute;right:0;top:calc(100% + 8px);display:grid;gap:10px;width:174px;padding:12px;background:#422c60;border:1px solid #8a6e9c;border-radius:14px;box-shadow:0 8px 24px #15102270}
.menu-actions button{margin:0;font-size:14px;padding:10px}
/* Always show the complete canvas, preserving its actual 960 × 540 ratio. */
#game{width:100%;max-width:100%;height:auto;aspect-ratio:16/9;object-fit:contain}
.game-layout,#stage,#playfield{min-width:0}
/* Picker content owns its height instead of being trapped in a canvas overlay. */
main[data-screen="picker"] #game{display:none}
main[data-screen="picker"] #playfield{min-height:0}
main[data-screen="picker"] #title{position:relative;inset:auto;width:100%;min-height:0;max-height:none;overflow:visible;padding:16px;gap:4px}
main[data-screen="picker"] #title>*{flex-shrink:0}
main[data-screen="picker"] footer{display:none}

@media(max-width:700px){
 body{overflow-x:clip}
 main{width:100%;max-width:100%}
 header{flex-wrap:nowrap;gap:5px;padding:6px;min-height:44px}
 header strong{font-size:15px;white-space:nowrap;margin-right:auto}
 header #world-label{display:none}
 header .build-version{font-size:9px;padding:3px;flex:none}
 header #pause,#game-menu summary{font-size:12px;padding:9px 10px;box-shadow:none;border-radius:9px;margin:0}
 .menu-actions button{font-size:14px;min-height:44px}
 .game-layout{display:block;margin:0;gap:0}
 .world-sidebar{display:none}
 .game-layout #stage{margin:0;border-radius:0;width:100%;min-height:0;overflow:visible}
 #playfield{min-height:0;order:0;width:100%}
 #game{display:block;width:100%;height:auto;aspect-ratio:16/9}
 #title,#finish,#pause-screen{max-width:100%}
 /* Status remains below the full-width frame, with no tall padded cards. */
 #hud{grid-template-columns:repeat(4,minmax(0,1fr));gap:3px 5px;padding:5px 7px;font-size:10px;line-height:1.15}
 #hud .vitals{display:contents}
 #hud .vitals label:first-child{grid-column:1/3;grid-row:1}
 #hud .vitals label:last-child{grid-column:1/3;grid-row:2}
 #hud .weapon-charge{grid-column:3/5;grid-row:1}
 #hud .vitals label,#hud .weapon-charge{padding:0;background:transparent;border-radius:0}
 #hud .vitals span,#hud .weapon-charge span{font-size:10px;line-height:1.15}
 #hud .vitals meter,#hud .weapon-charge meter{height:8px;width:100%;margin:1px 0 0}
 #hud>span{padding:1px 0;background:transparent;border-radius:0;align-self:center;font-size:10px;overflow-wrap:normal}
 #hud #timer{grid-column:3;grid-row:2}
 #hud #campaign-score{grid-column:4;grid-row:2}
 #hud #character-label{grid-column:1/-1;grid-row:3;font-size:10px;color:#ffe08c}
 #hud #medicine-status{grid-column:1/3;grid-row:4;font-size:9px}
 #hud #checkpoint{grid-column:3;grid-row:4;font-size:9px}
 #hud #score{grid-column:4;grid-row:4;font-size:9px}
 #hud #wind-status,#hud #hazard-status{grid-column:1/-1;font-size:10px}
 #hud #timer.urgent{background:#a43351}
 footer{padding:5px 7px calc(7px + env(safe-area-inset-bottom,0px));font-size:11px}
 #control-hint{display:none}
 .controls{margin:0;gap:6px;flex-wrap:nowrap}
 .controls>div{gap:5px;min-width:0}
 .controls button{min-width:44px;min-height:52px;padding:8px 10px;font-size:12px;border-radius:11px;box-shadow:0 3px 0 #b87565}
 .controls #pogo{width:54px;min-width:44px;font-size:10px;padding:5px}
 main[data-screen="picker"] #title{padding:10px 8px;gap:5px}
 main[data-screen="picker"] #title h1{font-size:25px;margin:2px}
 main[data-screen="picker"] #title>p{font-size:11px;margin:2px 0}
 main[data-screen="picker"] .picker{grid-template-columns:repeat(2,minmax(0,1fr));width:100%;max-width:380px;gap:6px}
 main[data-screen="picker"] .picker button{min-height:92px;padding:5px;font-size:14px}
 main[data-screen="picker"] .picker img{width:43px;height:65px}
 main[data-screen="picker"] .picker small{font-size:10px;max-width:100%}
 main[data-screen="picker"] .picker button:last-child{grid-column:1/-1;justify-self:center;width:calc(50% - 3px)}
 main[data-screen="picker"] .world-choice{flex-wrap:wrap;max-width:100%;font-size:12px;margin:4px 0}
 main[data-screen="picker"] .world-choice select{max-width:100%;min-height:36px}
 main[data-screen="picker"] #play{font-size:17px;min-height:44px;margin:4px;padding:8px 18px}
 main[data-screen="picker"] #title .help{display:block;font-size:11px;max-width:330px}
}

/* The progress list doubles as the starting-world picker. */
.world-sidebar li{padding:0}
.world-sidebar li button{display:block;width:100%;min-height:44px;padding:8px 6px;background:transparent;color:inherit;font-size:12px;text-align:left;line-height:1.25;box-shadow:none;border-radius:5px;overflow-wrap:anywhere}
.world-sidebar li button:disabled{opacity:1;cursor:default}
.world-sidebar li button:not(:disabled):hover{background:#775476}
.world-sidebar li button:focus-visible{outline:3px solid #ffe08c;outline-offset:-3px}
#starting-world-label{font-weight:700;color:#ffe08c}
@media(max-width:700px){
 main[data-screen="picker"] .world-sidebar{display:block;width:100%;padding:8px;background:#422c60;border-radius:0}
 main[data-screen="picker"] .world-sidebar h2{font-size:12px;margin:0 0 6px}
 main[data-screen="picker"] .world-sidebar ol{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
 main[data-screen="picker"] .world-sidebar li{padding:0;border-left-width:2px;font-size:11px}
 main[data-screen="picker"] .world-sidebar li button{min-height:44px;padding:5px;font-size:11px}
 main[data-screen="picker"] #starting-world-label{font-size:12px}
}

#world-preview-panel{width:min(100%,640px);margin:8px 0;flex:none;text-align:left;background:#211a38;border-radius:12px;overflow:hidden}
#world-preview{display:block;width:100%;height:auto;aspect-ratio:8/3;image-rendering:pixelated}
#world-preview-panel figcaption{display:grid;gap:3px;padding:7px 10px;font-size:12px}
#world-preview-detail{color:#dccfe7;font-size:11px}
.pause-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:8px}
#level-intro{inset:auto 10px 10px;z-index:4;display:flex;flex-direction:row;justify-content:space-between;gap:12px;padding:8px 12px;border-radius:12px;background:#241d3ce8;text-align:left}
#level-intro>div{flex:1;min-width:0}
#intro-title{display:block;font-size:14px}
#intro-progress{width:100%;height:6px;display:block;margin-top:5px;accent-color:#ffe08c}
#skip-intro{font-size:13px;min-height:44px;padding:8px 16px;box-shadow:none}
main[data-screen="intro"] footer{display:none}
#hud #medicine-recovery{grid-column:1/-1;background:#214a3a;border:2px solid #91e5ac;border-radius:7px;padding:6px 9px;font-size:12px;color:#d2ffda}
#medicine-recovery-progress{display:block;width:100%;height:12px;accent-color:#91e5ac;margin-top:3px}
#medicine-recovery-progress::-webkit-progress-value{background:#91e5ac}
#medicine-recovery-progress::-moz-progress-bar{background:#91e5ac}
#hud #speed-status{color:#8af3df;grid-column:1/-1}
@media(max-width:700px){
 #world-preview-panel{margin:5px 0}
 #world-preview-panel figcaption{font-size:11px;padding:6px 8px}
 #world-preview-detail{font-size:10px}
 #hud #medicine-recovery{font-size:11px;padding:4px 6px}
 #level-intro{inset:auto 6px 6px;padding:5px 8px;gap:7px}
 #intro-title{font-size:12px}
 #skip-intro{font-size:12px;padding:6px 10px}
 #hud #speed-status{font-size:10px}
}

/* v0.37: compact touch controls only on devices that accept touch. */
.controls[data-touch="false"]{display:none}
#hud #timer.urgent{animation:timer-warning .7s steps(2,end) infinite}
#medicine-recovery:not([hidden]){animation:medicine-flash .4s ease-in-out alternate infinite}
@keyframes timer-warning{50%{background:#e65d69;color:#fff}}
@keyframes medicine-flash{to{box-shadow:0 0 10px #9ef0b4;background:#365d47}}
@media(prefers-reduced-motion:reduce){#hud #timer.urgent,#medicine-recovery:not([hidden]){animation:none}}

/* Controller setup is independent of the tall scrolling character picker. */
#controller-setup-panel{position:fixed;inset:4vh max(12px,calc((100vw - 620px)/2));z-index:80;background:#342154;overflow:auto;justify-content:flex-start;border:3px solid #ffe08c;border-radius:16px;padding:18px}
#controller-setup-panel h2{font-size:25px;margin:8px}
#controller-device{overflow-wrap:anywhere;font-weight:700}
.controller-bindings{display:grid;grid-template-columns:1fr 1fr;gap:12px;width:100%}
.controller-actions{display:flex;flex-wrap:wrap;gap:10px;justify-content:center}
[data-controller-focus="true"]{outline:3px solid #91efce;outline-offset:3px}
#controller-toast{position:fixed;top:52px;left:50%;transform:translateX(-50%);z-index:90;max-width:92vw;padding:9px 14px;background:#244b40;color:#dcffe8;border-radius:8px;font-size:13px;overflow-wrap:anywhere;pointer-events:none}
#controller-debug{position:fixed;bottom:4px;left:4px;z-index:95;background:#101424ee;color:#fff;padding:8px;max-width:calc(100vw - 8px);white-space:pre-wrap;overflow-wrap:anywhere;pointer-events:none;font:11px monospace}
@media(max-width:700px){.controls>div{gap:3px}.controls button{min-width:40px;padding:8px 6px}#medicine-action{font-size:10px}#controller-setup-panel{padding:10px}.controller-bindings{gap:10px}.controller-bindings button,.controller-actions button{font-size:14px;padding:12px 8px}}

main[data-controller-setup="true"] > :not(#controller-setup-panel):not(#controller-debug):not(#controller-toast){pointer-events:none}

/* Pet Shop pauses the transition and remains usable in portrait. */
#pet-shop{position:fixed;inset:8% max(12px,calc((100vw - 650px)/2));z-index:100;background:#342154;border:3px solid #ffe47d;border-radius:16px;padding:20px;overflow:auto;box-shadow:0 0 0 100vmax #120c25cc}#pet-shop[hidden]{display:none}.shop-items{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:16px 0}.shop-items button{font-size:15px;padding:12px}#pet-shop button:focus-visible{outline:4px solid white;outline-offset:3px}@media(max-width:480px){#pet-shop{inset:3% 10px;padding:12px}.shop-items{gap:8px}.shop-items button{font-size:13px}}

main[data-shop-open=true]>:not(#pet-shop):not(#controller-toast){pointer-events:none}

.shop-items button{display:flex;flex-direction:column;align-items:center;gap:6px}.shop-items canvas{width:96px;height:96px;image-rendering:pixelated;max-width:100%}#shop-message{min-height:2em}

/* v0.40 handheld shell: exact canvas aspect, theme-coloured letterboxing. */
#game{aspect-ratio:16/9!important;image-rendering:pixelated}
#secure-context-banner{background:#5c3b56;border:2px solid #ffe08c;border-radius:8px;padding:10px;max-width:650px;font-size:13px}#secure-why{font-size:13px;padding:5px 12px}
#controller-test-state{font:12px monospace;text-align:left;white-space:pre-wrap;overflow-wrap:anywhere;width:100%;padding:10px;background:#211832}#secure-help{font-size:13px}#update-toast{position:fixed;z-index:120;bottom:18px;left:50%;transform:translateX(-50%);font-size:15px}
@media(max-height:900px),(max-width:1100px){
 main[data-screen=game]{max-width:none;height:100dvh;display:flex;flex-direction:column}
 main[data-screen=game] header{padding:4px 10px;min-height:34px;gap:8px;flex-shrink:0}
 main[data-screen=game] header strong{font-size:15px}main[data-screen=game] #world-label{display:none}
 main[data-screen=game] header button,main[data-screen=game] #game-menu-toggle{padding:4px 10px;font-size:12px;min-height:28px}
 main[data-screen=game] .world-sidebar,main[data-screen=game] #hud{display:none!important}
 main[data-screen=game] .game-layout{display:flex;justify-content:center;flex:1;min-height:0;align-items:center}
 main[data-screen=game] #stage{width:var(--game-width,100vw);min-width:0;min-height:0;margin:0;flex:none;overflow:visible;border-radius:0;background:#342154}
 main[data-screen=game] #playfield{width:100%;height:var(--game-height,56.25vw);min-height:0}
 main[data-screen=game] #game{width:100%;height:100%;object-fit:contain}
 main[data-screen=game] footer{padding:2px 10px;flex-shrink:0;font-size:10px}
 main[data-screen=game] .controls{margin:3px 0;flex-wrap:nowrap;gap:8px}main[data-screen=game] .controls>div{gap:5px}
 main[data-screen=game] .controls button{min-width:42px;min-height:46px;padding:8px 12px;font-size:12px}
 main[data-screen=game] #finish,main[data-screen=game] #pause-screen{overflow:auto;justify-content:flex-start}
 main[data-screen=game] #finish h2,main[data-screen=game] #pause-screen h2{font-size:24px;margin:8px}
}
@media(min-height:901px) and (min-width:1101px){main[data-screen=game] #stage{max-width:960px}main[data-screen=game] #game{height:auto;max-height:calc(100dvh - 190px)}}
:fullscreen{background:#342154}#controller-setup-panel{display:flex}#controller-setup-panel[hidden]{display:none}

@media(max-height:900px),(max-width:1100px){main[data-screen=game] .game-layout{margin:0;gap:0;width:100%}}
/* Installed/kiosk/fullscreen play uses the whole screen, with small overlays. */
main[data-pad-connected=true] .controls{display:none}
main[data-screen=game][data-immersive=true]{max-width:none;height:100dvh;display:flex;flex-direction:column}
main[data-screen=game][data-immersive=true] header{position:fixed;right:8px;top:4px;z-index:65;padding:3px 6px;background:#342154b0;border-radius:8px;gap:6px}
main[data-screen=game][data-immersive=true] header strong,main[data-screen=game][data-immersive=true] header>span{display:none}
main[data-screen=game][data-immersive=true] header button,main[data-screen=game][data-immersive=true] #game-menu-toggle{font-size:12px;padding:5px 10px}
main[data-screen=game][data-immersive=true] .world-sidebar,main[data-screen=game][data-immersive=true] #hud{display:none!important}
main[data-screen=game][data-immersive=true] .game-layout{display:flex;justify-content:center;align-items:center;flex:1;margin:0;gap:0;width:100%}
main[data-screen=game][data-immersive=true] #stage{flex:none;align-self:center;width:var(--game-width);max-width:none;min-height:0;margin:0;border-radius:0;background:#342154;overflow:visible}
main[data-screen=game][data-immersive=true] #playfield{width:100%;height:var(--game-height);min-height:0}
main[data-screen=game][data-immersive=true] #game{width:100%;height:100%;max-height:none}
main[data-screen=game][data-immersive=true] footer{position:fixed;bottom:4px;left:0;width:100%;padding:4px 10px;z-index:60;pointer-events:none}
main[data-screen=game][data-immersive=true] #control-hint{display:none}
main[data-screen=game][data-immersive=true] .controls{margin:0;pointer-events:auto}
#swap-portrait{width:32px;height:32px;aspect-ratio:1;image-rendering:pixelated}#swap-status[data-disabled=true],#swap-action[aria-disabled=true]{opacity:.4}
#difficulty-picker{display:flex;gap:10px;justify-content:center;margin:8px}#difficulty-picker [aria-pressed=true]{outline:3px solid #91e5ac}#difficulty-picker button{font-size:14px;padding:9px 14px}
/* Canvas HUD is the sole visual status; semantic meters remain accessible. */
#hud{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
