:root{--paper:#eeeae2;--shell:#dedbd3;--ink:#2c2a28;--red:#bb3e30;--gray:#77746e;--line:#c4c0b6;--screen:#080809}*{box-sizing:border-box}html{background:var(--paper)}body{margin:0;color:var(--ink);font-family:"Avenir Next","PingFang SC","Microsoft Yahei",sans-serif;padding:32px 24px 18px}.machine{max-width:min(1040px,calc((100dvh - 340px)*1.6 + 46px));margin:auto}.heading{display:flex;align-items:center;justify-content:space-between;margin:0 4px 22px}.eyebrow{font:10px "Courier New",monospace;letter-spacing:.23em;margin:0 0 7px;color:var(--gray)}h1{font-family:"Arial Black",Impact,sans-serif;font-size:32px;line-height:.95;letter-spacing:-1.6px;margin:0;font-weight:1000;color:var(--red)}h1 span{display:block;font-size:19px;letter-spacing:2px;margin-top:4px}.edition{font:12px "Courier New",monospace;letter-spacing:.08em;text-align:right}.edition b{font-size:21px}.edition small{display:block;font:11px sans-serif;letter-spacing:.1em;color:var(--gray);margin-top:8px}.red-dot{display:inline-block;background:var(--red);width:6px;height:6px;margin-right:7px}.console{background:var(--shell);padding:0 22px;border:1px solid #c9c4ba;border-radius:11px;box-shadow:0 5px 0 #c5c0b7,0 12px 28px #4d463914,inset 0 1px #fff8;overflow:hidden}.console-top,.console-bottom{height:45px;display:flex;align-items:center;justify-content:space-between;font:10px "Courier New",monospace;letter-spacing:.08em;color:#79756d}.console-top>span:first-child{display:flex;align-items:center;gap:8px}.console-top i{width:5px;height:5px;border-radius:50%;background:var(--red);box-shadow:0 0 5px #bb3e3088}.console-top>div,.console-bottom>div{display:flex;gap:16px}button{cursor:pointer;font:inherit;touch-action:manipulation}button:focus-visible,a:focus-visible,canvas:focus-visible{outline:3px solid var(--red);outline-offset:4px}.console-top button,.console-bottom button{padding:3px 0;border:0;background:none;color:#69665f;font-size:10px;letter-spacing:.04em}.console-top button:hover,.console-bottom button:hover{color:var(--red)}button:disabled{opacity:.4;cursor:default}.bezel{position:relative;background:var(--screen);border:12px solid #272625;border-radius:5px;box-shadow:0 1px 0 #f7f4ee;aspect-ratio:8/5;overflow:hidden}.bezel canvas{display:block;width:100%;height:100%;image-rendering:pixelated;image-rendering:crisp-edges;outline:0;touch-action:none}.overlay{position:absolute;inset:0;display:grid;place-items:center;background:#08080966;padding:14px}.overlay[hidden]{display:none}.menu{color:#fff;text-align:center;padding:28px 40px;background:#121212f2;border-top:3px solid #b83e2d;box-shadow:8px 8px #0005;max-width:90%}.menu>p:first-child{font:11px "Courier New",monospace;letter-spacing:.25em;color:#e7ac62;margin:0 0 16px}.menu h2{font:900 clamp(24px,4.5vw,44px) "Courier New",monospace;letter-spacing:-1px;line-height:1;margin:0 0 14px}.menu>p{font-size:12px;line-height:1.8;color:#ccc9c1;margin:0 0 20px}.menu button{font-size:13px;background:var(--red);color:#fff;border:0;padding:12px 30px;box-shadow:0 3px #7b281f}.menu button:hover{background:#d14b39}.menu button span{margin-left:14px}.menu small{display:block;font:10px "Courier New",monospace;margin-top:18px;color:#8e8b85}.console-bottom{height:47px}.console-bottom>span:first-child{display:flex;align-items:center;gap:10px}.tiny-squares{width:19px;height:7px;display:block;background:repeating-linear-gradient(90deg,var(--red) 0 4px,transparent 4px 6px)}#stateLabel{font-size:9px}.instructions{margin:24px 4px 0;text-align:center;color:#7c786f}.instructions>div{display:flex;justify-content:center;align-items:center;gap:5px;flex-wrap:wrap}.instructions span{font-size:11px;margin:0 12px 0 3px}.instructions p{font-size:11px;margin:14px 0 0;letter-spacing:.06em}kbd{font:10px "Courier New",monospace;min-width:23px;text-align:center;border:1px solid #c8c3ba;box-shadow:0 2px #d3cec5;border-radius:3px;background:#f7f4ed;padding:4px 6px;color:#686359}.credits{display:flex;justify-content:space-between;font:8px "Courier New",monospace;letter-spacing:.14em;color:#aaa59b;margin:26px 4px 0}.credits a{color:inherit}.touch-controls{display:none;justify-content:space-between;align-items:center;padding:24px 8px 12px;user-select:none;touch-action:none}.dpad{display:flex;gap:5px}.touch-controls button{width:48px;height:48px;border:0;border-bottom:4px solid #201f1d;border-radius:7px;background:#363431;color:#fff;font-size:19px;user-select:none;touch-action:none}.actions{display:flex;gap:18px}.actions label{display:flex;flex-direction:column;align-items:center;gap:5px;font-size:9px;color:#8b463a}.actions button{border-radius:50%;background:var(--red);border-bottom-color:#7b2a21}.touch-controls button.active{transform:translateY(3px);border-bottom-width:1px;filter:brightness(1.2)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.bezel:fullscreen{width:100vw;height:100vh;max-height:none;aspect-ratio:auto;border:0;display:grid;place-items:center}.bezel:fullscreen canvas{height:100vh;width:min(100vw,160vh);object-fit:contain}.bezel:fullscreen .overlay{inset:0} @media(pointer:coarse){.touch-controls{display:flex}.instructions>div{display:none}.instructions{margin-top:10px}}@media(max-width:600px){body{padding:18px 10px}.heading{margin-bottom:16px}h1{font-size:24px}h1 span{font-size:14px}.eyebrow{font-size:8px;letter-spacing:.13em}.edition{font-size:9px}.edition b{font-size:15px}.edition small{font-size:9px}.console{padding:0 8px;border-radius:7px}.console-top>span:nth-child(2){display:none}.console-top,.console-bottom{height:36px;font-size:8px}.console-top button,.console-bottom button{font-size:9px}.bezel{border-width:5px}.menu{padding:14px 16px}.menu>p:first-child{font-size:8px;margin-bottom:8px}.menu h2{font-size:23px;margin-bottom:8px}.menu>p{font-size:10px;margin-bottom:10px}.menu button{padding:9px 20px;font-size:11px}.menu small{font-size:8px;margin-top:10px}.credits{font-size:7px;letter-spacing:.03em}.instructions span{margin-right:7px}.touch-controls{padding-top:18px}.touch-controls button{width:45px;height:45px}.actions{gap:14px}}@media(max-height:600px) and (orientation:landscape){body{padding:8px 12px}.heading,.credits,.instructions{display:none}.machine{max-width:740px}.console{padding:0 10px}.console-top,.console-bottom{height:26px}.bezel{max-height:calc(100dvh - 80px);aspect-ratio:8/5;margin:auto}.touch-controls{position:fixed;inset:auto 20px 20px;pointer-events:none;z-index:9}.touch-controls button{pointer-events:auto;opacity:.7}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

/* Doraemon: blue body, white pocket, red collar and a golden bell. */
:root{--paper:#eef6fa;--shell:#dfedf3;--ink:#25485b;--red:#dc4e50;--gray:#6b8796;--line:#bfd6e0}.heading h1{color:#078ec5;letter-spacing:-.5px}.heading h1 span{font-family:"PingFang SC",sans-serif;font-size:15px;letter-spacing:3px;margin-top:7px}.console{border-color:#b9d2de;box-shadow:0 5px 0 #bdd3df,0 12px 28px #385a6d18,inset 0 1px #fff9}.console-top i{background:#04a6d5;box-shadow:0 0 5px #0aa6d5aa}.bezel{border-color:#244758}.menu{border-top-color:#ffd14d;background:#12384bec}.menu>p:first-child{color:#ffd877}.menu h2{font-family:"PingFang SC",sans-serif;font-size:clamp(23px,3vw,36px)}.menu small{color:#91b3c5}.credits{color:#7d9aa8}.console-top,.console-bottom{color:#608190}.console-top button,.console-bottom button{color:#507385}.actions label{color:#567e92}.instructions{color:#628093}kbd{background:#f9fdff;border-color:#bdd3df;box-shadow:0 2px #c8dce4;color:#517184}@media(max-width:600px){.heading h1{font-size:26px}.heading h1 span{font-size:12px;letter-spacing:2px}.menu h2{font-size:23px}.eyebrow{font-size:7px}}

/* Smooth 2.5D toy world, with a readable HUD independent of the WebGL scene. */
.bezel canvas{image-rendering:auto}.bezel{border-color:#aacad8;box-shadow:inset 0 0 0 1px #86b2c8;border-width:7px;border-radius:9px}.game-hud{position:absolute;left:0;top:0;right:0;display:flex;justify-content:space-between;gap:12px;padding:15px 19px 25px;background:linear-gradient(#effaffbd,#effaff00);color:#265b76;pointer-events:none;z-index:1}.game-hud>div{display:flex;flex-direction:column;gap:4px;min-width:30px}.game-hud small{font-size:8px;letter-spacing:.12em;opacity:.7}.game-hud b{font:700 13px "Avenir Next","PingFang SC",sans-serif;font-variant-numeric:tabular-nums;letter-spacing:.04em}.game-hud #hudLives{color:#df5c65}.game-hud .power-hud b{font-size:11px;line-height:18px}.overlay{z-index:2;background:#4065763d;backdrop-filter:blur(2px)}.menu{background:#f5fcffed;color:#245b76;border-top:3px solid #ffd36e;border-radius:12px;box-shadow:0 10px 40px #315b6f35}.menu>p:first-child{color:#d09632}.menu>p{color:#648495}.menu h2{color:#168cc0}.menu small{color:#89a6b4}.menu button{border-radius:6px;background:#e15a64;box-shadow:0 3px #b84854}.heading h1 span{letter-spacing:2px}@media(max-width:600px){.game-hud{padding:10px 10px 20px;gap:7px}.game-hud small{font-size:7px;letter-spacing:0}.game-hud b{font-size:10px}.game-hud .power-hud{display:none}.bezel{border-width:4px}.menu{border-radius:8px}}

/* Phone controls stay inside the fullscreen root; CSS focus mode covers iPhone too. */
.mobile-note{display:none;font-size:10px;line-height:1.7;text-align:center;color:#7395a6;margin:8px 0 0}.touch-controls button{-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none}.machine:fullscreen{background:var(--paper)}
@media(pointer:coarse),(max-width:600px),(max-height:600px) and (orientation:landscape){.touch-controls{display:flex}.instructions>div{display:none}.mobile-note{display:block}.touch-controls button{width:54px;height:54px}.touch-controls{gap:12px}.dpad{gap:5px}.actions{gap:14px}.instructions{margin-top:10px}.instructions p{font-size:10px;line-height:1.8}.machine{min-width:0}}
@media(max-height:600px) and (orientation:landscape){body{padding:6px 12px}.mobile-note{display:none}.machine{max-width:100%}.console{padding:0 7px}.bezel{max-height:none;height:calc(100dvh - 76px);aspect-ratio:auto}.touch-controls{inset:auto max(18px,env(safe-area-inset-right)) max(15px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left))}.touch-controls button{opacity:.8}.touch-controls .dpad button{background:#234f68bf}.actions label{color:#315e77}.game-hud{padding-left:18px;padding-right:18px}}
body.immersive{overflow:hidden;padding:0}body.immersive .machine{position:fixed;inset:0;z-index:100;max-width:none;width:100%;height:100dvh;display:flex;flex-direction:column;background:var(--paper);padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}body.immersive .heading,body.immersive .credits,body.immersive .instructions,body.immersive .mobile-note{display:none}body.immersive .console{display:flex;flex-direction:column;flex:1;min-height:0;border:0;border-radius:0;padding:0;box-shadow:none}body.immersive .console-top{height:32px;min-height:32px;padding:0 14px}body.immersive .console-top>span:nth-child(2){display:none}body.immersive .console-top>div{margin-left:auto}body.immersive .console-bottom{height:26px;min-height:26px;padding:0 14px}body.immersive .bezel{flex:1;min-height:0;max-height:none;width:100%;height:auto;aspect-ratio:auto;border:0;border-radius:0;margin:0}body.immersive .touch-controls{position:fixed;z-index:105;left:max(16px,env(safe-area-inset-left));right:max(16px,env(safe-area-inset-right));bottom:max(38px,calc(env(safe-area-inset-bottom) + 30px));padding:0;pointer-events:none}body.immersive .touch-controls button{pointer-events:auto;opacity:.85}body.immersive .game-hud{padding-top:12px}body.immersive .console-top button,body.immersive .console-bottom button{padding:6px 4px}
@media(orientation:portrait){body.immersive .console{justify-content:center}body.immersive .bezel{flex:0 0 auto;aspect-ratio:8/5;height:auto}body.immersive .console-top,body.immersive .console-bottom{flex:0 0 auto}body.immersive .touch-controls{bottom:max(28px,calc(env(safe-area-inset-bottom) + 22px))}}
@media(max-height:600px) and (orientation:landscape){
 .bezel{width:min(100%,calc((100dvh - 76px)*1.6));margin:0 auto}
 body.immersive .bezel{width:min(100%,calc((100dvh - 58px - env(safe-area-inset-top) - env(safe-area-inset-bottom))*1.6));margin:0 auto}
 .touch-controls .dpad{display:grid;grid-template-columns:48px 48px;grid-template-rows:48px 34px;gap:5px}
 .touch-controls .dpad button[data-input="left"]{grid-column:1;grid-row:1}
 .touch-controls .dpad button[data-input="right"]{grid-column:2;grid-row:1}
 .touch-controls .dpad button[data-input="down"]{grid-column:1 / span 2;grid-row:2;width:48px;height:34px;justify-self:center}
 .touch-controls button{width:48px;height:48px}.touch-controls .actions{gap:12px}
}

/* The opening menu explains both keyboard and touch flight controls. */
.menu{max-height:100%;overflow:auto;padding:20px 26px}.menu h2{margin-bottom:9px}.menu>p{margin-bottom:10px}.menu small{margin-top:9px}.control-guide{text-align:left;margin:0 auto 14px;max-width:360px;font-size:11px;line-height:1.8}.control-guide p{margin:6px 0}.control-guide kbd{font-size:9px;padding:1px 4px;min-width:0}.control-guide .flight-guide{padding:7px 10px;background:#def0f6;border-radius:6px;line-height:1.6;color:#267898}.control-guide small{font:9px/1.6 "PingFang SC",sans-serif;margin:6px 0;color:#6a8999}.touch-guide{display:none}.control-guide[hidden],.clear-results[hidden]{display:none}.clear-results{margin:12px auto 18px;text-align:left;font-size:12px;min-width:240px}.clear-results>div{display:flex;justify-content:space-between;gap:24px;padding:5px 0}.clear-results dt{color:#638496}.clear-results dd{margin:0;font-weight:700;font-variant-numeric:tabular-nums}.clear-results .result-total{border-top:1px solid #c6dfe9;margin-top:5px;padding-top:9px;font-size:16px;color:#168cc0}.goal-notice{position:absolute;bottom:16px;left:50%;transform:translateX(-50%);padding:9px 16px;border-radius:30px;color:#245b76;background:#f5fcfff0;box-shadow:0 3px 15px #245b7625;font-size:12px;white-space:nowrap;z-index:1;font-variant-numeric:tabular-nums}.goal-notice[hidden]{display:none}
@media(pointer:coarse),(max-width:600px),(max-height:600px) and (orientation:landscape){.keyboard-guide{display:none}.touch-guide{display:block}}
@media(max-width:600px),(max-height:600px){.overlay{padding:6px}.menu{padding:10px 14px;max-width:98%}.menu>p:first-child{margin-bottom:5px;font-size:8px}.menu h2{font-size:20px;margin-bottom:5px}.menu>p{font-size:10px;line-height:1.4;margin-bottom:5px}.control-guide{font-size:9px;line-height:1.5;margin-bottom:8px}.control-guide p{margin:4px 0}.control-guide .flight-guide{padding:4px 8px;line-height:1.4}.control-guide small{font-size:8px;line-height:1.4;margin-top:4px}.menu button{padding:7px 18px;font-size:11px}.menu small{font-size:8px;margin-top:6px}.clear-results{font-size:10px;min-width:210px;margin:8px auto 10px}.clear-results>div{padding:3px 0}.clear-results .result-total{font-size:14px}.goal-notice{font-size:10px;bottom:10px;padding:7px 11px}}

@media(pointer:coarse),(max-width:600px),(max-height:600px) and (orientation:landscape){#menuHint{display:none}}

/* Stored copter has its own touch button. */
.touch-controls .actions .fly{background:#4cabb7;border-bottom-color:#317b8c;color:#fff6ca;font-size:17px}.touch-controls .actions .fly-action{transform:none}.touch-controls .actions .fly:disabled{opacity:.32;filter:grayscale(.4)}
@media(max-width:420px){.touch-controls{padding-left:0;padding-right:0;gap:8px}.touch-controls .actions{gap:9px}.touch-controls .actions button{width:44px;height:44px}.touch-controls .actions label{font-size:8px}}

/* Gadget combinations stay visible beside the normal movement controls. */
.gadget-controls{display:flex;justify-content:center;align-items:center;gap:8px;margin:16px 0 0;font-size:11px}.gadget-controls button{border:1px solid #b9d3df;border-radius:8px;background:#f6fcff;color:#31687e;padding:7px 12px;box-shadow:0 2px #bdd3df}.gadget-controls button.active{transform:translateY(2px);box-shadow:none;background:#d9f1f7}.gadget-controls #sizeState{color:#6b8b9b;margin-right:4px}.gadget-controls #sizeState[data-mode="mini"]{color:#a36cac}.gadget-controls #sizeState[data-mode="big"]{color:#d18a4b}.flight-notice.scared{color:#734e86;background:#fcf1fff2}.speed-notice{position:absolute;left:14px;top:56px;color:#2789a3;font-size:11px;font-weight:700;background:#f2fcffdd;border-radius:20px;padding:5px 10px;pointer-events:none}.speed-notice[hidden]{display:none}#recordHint{font-size:9px;color:#779aaa;margin-top:8px}.control-guide .flight-guide{font-size:10px}
body.immersive .gadget-controls{position:fixed;z-index:106;margin:0;bottom:100px;left:50%;transform:translateX(-50%);padding:6px 9px;border-radius:14px;background:#eef8fbe6;white-space:nowrap}body.immersive .gadget-controls #sizeState{display:none}
@media(max-width:600px){.gadget-controls{gap:6px;font-size:10px;margin-top:13px}.gadget-controls button{padding:7px 10px}.touch-controls{padding-top:14px}.control-guide .flight-guide{font-size:9px}.speed-notice{font-size:9px;top:40px;left:9px}#recordHint{font-size:8px}}
@media(max-height:600px) and (orientation:landscape){.gadget-controls{position:fixed;z-index:10;bottom:14px;left:50%;transform:translateX(-50%);margin:0;white-space:nowrap;background:#f0f9fbe0;border-radius:10px;padding:4px}.gadget-controls #sizeState{display:none}body.immersive .gadget-controls{bottom:42px}.gadget-controls button{padding:6px 8px;font-size:10px}.goal-notice{max-width:90%;font-size:10px;white-space:normal;text-align:center}}

/* Keep the start action visible even in a short game viewport. */
.menu{padding:14px 20px}.menu>p:first-child{margin-bottom:8px;font-size:9px}.menu h2{font-size:25px;margin-bottom:7px}.menu>p{font-size:11px;line-height:1.4;margin-bottom:7px}.control-guide{font-size:10px;line-height:1.5;margin-bottom:8px}.control-guide p{margin:4px 0}.control-guide .flight-guide{font-size:9px;line-height:1.5;padding:5px 8px}.control-guide small{font-size:8px;margin:4px 0}.menu button{padding:9px 24px}.menu small{font-size:8px;margin-top:7px}#recordHint{font-size:8px;margin-top:6px}
@media(max-width:600px),(max-height:600px){.menu{padding:9px 14px}.menu h2{font-size:20px}.control-guide{font-size:9px}.control-guide .flight-guide{font-size:8px}.menu button{padding:7px 20px}.menu>p:first-child{font-size:8px;margin-bottom:5px}}

/* Tool controls take space only while the matching item is available. */
.gadget-controls[hidden],.gadget-controls [hidden],.touch-controls label[hidden],.menu [hidden]{display:none!important}.gadget-controls{flex-wrap:wrap}#lampCount{font-size:10px;color:#7695a5}.menu #menuText:empty,.menu #menuHint:empty{display:none}.control-guide{text-align:center;margin:14px auto}.control-guide p{white-space:nowrap}.gadget-controls button{white-space:nowrap}
@media(max-width:600px){.gadget-controls{gap:5px}.gadget-controls button{padding:7px 8px;font-size:9px}}

/* Timed tools activate on pickup; only the two cannon actions need buttons. */
.game-hud .power-hud[hidden]{display:none!important}.game-hud .power-hud b{max-width:175px;white-space:normal}.gadget-controls{gap:8px}.gadget-controls button{min-width:64px}
@media(max-width:600px){.game-hud .power-hud:not([hidden]){display:flex;max-width:112px}.game-hud .power-hud b{font-size:8px;line-height:1.4}.game-hud{gap:5px}}

/* One brief reminder on cannon pickup; hidden as soon as the tool is lost. */
.cannon-hint{position:absolute;left:50%;bottom:18px;transform:translateX(-50%);z-index:2;background:#f4fcfff2;color:#285f78;border:1px solid #c2dce8;border-radius:20px;padding:8px 14px;font-size:12px;white-space:nowrap;pointer-events:none}.cannon-hint[hidden]{display:none}@media(max-width:600px){.cannon-hint{font-size:10px;padding:6px 10px;bottom:10px}}

/* Keep each active tool on its own complete line, including on phones. */
.game-hud .power-hud{flex:0 0 auto;min-width:max-content;max-width:none}.game-hud .power-hud b{max-width:none;width:max-content;white-space:nowrap;line-height:1.45}.game-hud .power-hud b>span{display:block;white-space:nowrap}.game-hud .power-hud b>span[hidden]{display:none!important}@media(max-width:600px){.game-hud .power-hud:not([hidden]){max-width:none;min-width:max-content}.game-hud .power-hud b{font-size:9px;line-height:1.5}}

.game-hud .round-hud{flex-shrink:0;white-space:nowrap}.game-hud #hudRound{color:#1687b4}@media(max-width:600px){.game-hud{padding-left:8px;padding-right:8px;gap:4px}.game-hud #hudRound{font-size:9px;letter-spacing:0}}

/* Mobile controls share one right-hand cluster; no floating center controls. */
.machine,.machine *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
.machine{overscroll-behavior:contain}.machine button,.machine canvas,.touch-controls{touch-action:none}
.touch-controls{display:flex;justify-content:flex-end;align-items:center;padding:0;margin-top:16px;position:static;inset:auto;pointer-events:auto}
.touch-controls:has(.gadget-controls[hidden]){display:none}
.touch-controls .dpad,.touch-controls .jump-action{display:none}
.touch-controls .actions{display:flex;align-items:center;gap:12px}
.touch-controls .gadget-controls{position:static;inset:auto;transform:none;padding:0;margin:0;display:flex;gap:8px;background:none;border-radius:0;flex-wrap:nowrap}
.touch-controls .gadget-controls[hidden]{display:none!important}
.touch-controls .gadget-controls button{width:auto;height:auto;min-width:0;border:1px solid #b9d3df;border-radius:8px;background:#f6fcff;color:#31687e;padding:8px 12px;font-size:11px;box-shadow:0 2px #bdd3df;opacity:1}
.fullscreen-help{position:fixed;top:calc(var(--game-top,0px) + env(safe-area-inset-top) + 40px);right:16px;left:16px;z-index:110;max-width:480px;margin:auto;padding:12px 38px 12px 14px;border:1px solid #b9d3df;border-radius:10px;background:#f4fcff;color:#285f78;font-size:12px;line-height:1.6}
.fullscreen-help[hidden]{display:none!important}.fullscreen-help button{position:absolute;right:8px;top:6px;border:0;background:none;font-size:22px;color:inherit;padding:0 6px}
@media(pointer:coarse),(max-width:600px),(max-height:600px) and (orientation:landscape){
 .touch-controls,.touch-controls:has(.gadget-controls[hidden]){display:flex;justify-content:space-between;gap:12px;padding:16px 0 4px;margin:0;position:static;inset:auto}
 .touch-controls .dpad{display:flex;gap:8px;grid-template:none}
 .touch-controls .dpad button{width:50px;height:52px}
 .touch-controls .jump-action{display:flex;transform:none;gap:4px}
 .touch-controls .actions{gap:10px;align-items:center}
 .touch-controls .jump-action button{width:58px;height:58px;opacity:1}
 .touch-controls .gadget-controls{display:flex;flex-direction:column;gap:6px}
 .touch-controls .gadget-controls button{width:68px;min-height:40px;padding:6px 4px;font-size:11px;border-radius:10px;border-bottom:3px solid #a9c9d8;box-shadow:none}
 .gadget-controls .keyboard-key{display:none}
}
/* Fill Safari's visual viewport rather than keeping a portrait 8:5 letterbox. */
html.game-immersive,body.immersive{height:100%;overflow:hidden;overscroll-behavior:none}
body.immersive .machine{inset:auto;left:var(--game-left,0px);top:var(--game-top,0px);width:var(--game-width,100vw);height:var(--game-height,100dvh);min-height:0;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);overflow:hidden}
body.immersive .console{flex:1 1 0;min-height:0;justify-content:flex-start}
body.immersive .console-top{flex:0 0 32px;height:32px;min-height:32px}
body.immersive .console-bottom{flex:0 0 26px;height:26px;min-height:26px}
body.immersive .bezel{flex:1 1 0;min-height:0;width:100%;max-height:none;height:auto;aspect-ratio:auto;margin:0}
body.immersive .touch-controls{display:flex;position:absolute;z-index:105;left:16px;right:16px;bottom:calc(env(safe-area-inset-bottom) + 34px);margin:0;padding:0;pointer-events:none;justify-content:space-between}
body.immersive .touch-controls .dpad,body.immersive .touch-controls .jump-action{display:flex}
body.immersive .touch-controls button{pointer-events:auto;opacity:.88}
body.immersive .touch-controls .gadget-controls{position:static;inset:auto;transform:none;padding:0;margin:0;background:none;flex-direction:column;gap:6px}
body.immersive .touch-controls .gadget-controls button{width:68px;min-height:40px;padding:6px 4px;font-size:11px;border-radius:10px;box-shadow:none}
body.immersive .keyboard-key{display:none}
body.immersive .touch-controls .dpad{display:flex;gap:8px;grid-template:none}
@media(orientation:portrait){body.immersive .touch-controls{bottom:calc(env(safe-area-inset-bottom) + 42px)}}

/* Optional player codes and a shared, server-backed adventure board. */
.online-message{margin:12px auto 0;color:#678899;text-align:center;font-size:11px;line-height:1.6}
.player-code-form{max-width:360px;margin:12px auto;padding:12px;border:1px solid #bedce8;border-radius:10px;background:#eaf6fb;text-align:left}
.player-code-form>label{display:block;color:#247896;font-size:12px;font-weight:700}
.player-code-form p{margin:6px 0;color:#668796;font:10px/1.6 "PingFang SC",sans-serif}
.code-entry{display:flex;gap:8px;align-items:center}
.machine input#playerCode{-webkit-user-select:text;user-select:text;-webkit-touch-callout:default;touch-action:manipulation;min-width:0;flex:1;width:100%;border:1px solid #a5ccd9;border-radius:6px;padding:8px;color:#245b76;background:#fff;font:16px "Avenir Next",sans-serif;text-transform:uppercase}
.machine input#playerCode:focus{outline:2px solid #209dca;outline-offset:2px}
.menu .player-code-form button{padding:8px 10px;font-size:11px;white-space:nowrap}
.menu .player-code-form .skip-code{display:block;margin:7px auto 0;background:none;box-shadow:none;color:#4d8194;padding:4px 8px;text-decoration:underline}
.player-code-form #codeNotice:empty{display:none}
.player-code-form #codeNotice{color:#a64a53}
.player-code-form button:disabled{opacity:.55}
.leaderboard-dialog{width:min(580px,calc(100vw - 24px));max-height:calc(100dvh - 36px);overflow:auto;border:1px solid #a7ccdc;border-radius:18px;padding:24px;background:#f4fbff;color:#28566c;box-shadow:0 20px 80px #163d6555}
.leaderboard-dialog::backdrop{background:#23495f88;backdrop-filter:blur(4px)}
.leaderboard-dialog[open]{display:block}
.board-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.board-heading p{margin:0;color:#a88244;font:9px "Avenir Next",sans-serif;letter-spacing:.2em}
.board-heading h2{font:700 25px "PingFang SC",sans-serif;margin:5px 0 18px;color:#1287b6}
.leaderboard-dialog button{border:1px solid #aacfdc;border-radius:7px;background:#e1f1f8;color:#286981;padding:7px 12px;font:12px "PingFang SC",sans-serif;cursor:pointer;touch-action:manipulation}
.leaderboard-dialog #closeLeaderboard{font-size:26px;line-height:1;padding:0 7px;border:0;background:none}
.visitor-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;padding:15px 0;border-block:1px solid #c9e0ea}
.visitor-stats>div{display:flex;flex-direction:column;gap:5px;text-align:center}
.visitor-stats strong{font:700 25px "Avenir Next",sans-serif;color:#187eaa;font-variant-numeric:tabular-nums}
.visitor-stats span{font-size:10px;color:#6b8d9d}
.board-note,.board-privacy{font:10px/1.7 "PingFang SC",sans-serif;color:#6a8c9c}
.board-table{overflow-x:auto}
.board-table table{width:100%;border-collapse:collapse;text-align:left;font-size:12px}
.board-table th{font-size:10px;font-weight:500;color:#7a99a7;white-space:nowrap;padding:10px 5px}
.board-table td{padding:12px 5px;border-top:1px solid #d5e7ee;font-variant-numeric:tabular-nums}
.board-table td:nth-child(2){font-weight:700;letter-spacing:.05em}
.board-table td:nth-child(3){color:#b58234;font-weight:700}
.board-table tr.my-record{background:#dceff6}
.board-table #leaderboardEmpty{font-size:12px;text-align:center;padding:24px 8px;color:#7b9baa}
.board-footer{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:16px}
.board-footer span{font-size:10px;color:#7a99a7}
.board-privacy{margin:16px 0 0}
body.immersive .online-message{display:none}
@media(max-width:600px),(max-height:600px){.leaderboard-dialog{padding:16px;border-radius:12px}.board-heading h2{font-size:21px;margin-bottom:12px}.visitor-stats strong{font-size:21px}.board-table td{font-size:11px;padding:9px 4px}.player-code-form{padding:9px;margin:8px auto}.player-code-form>label{font-size:11px}.menu .player-code-form button{padding:8px;font-size:10px}.console-top>div{gap:5px}.online-message{font-size:10px}}

@media(orientation:portrait){body.immersive .touch-controls{position:relative;flex:0 0 110px;left:auto;right:auto;bottom:auto;width:100%;padding:6px 16px;pointer-events:auto}}
@media(orientation:landscape){body.immersive .touch-controls{left:max(16px,env(safe-area-inset-left));right:max(16px,env(safe-area-inset-right))}}

/* Phone layout uses the visual viewport after Safari has laid out its toolbars. */
body:not(.touch-layout) #zoom{display:none}
body.touch-layout .console-top>span,body.touch-layout .console-bottom{display:none}
body.touch-layout .console-top{height:auto;min-height:44px;flex:0 0 auto;padding:3px 10px;justify-content:center}
body.touch-layout .console-top>div{display:flex;flex-wrap:wrap;justify-content:center;gap:2px 8px;width:100%;margin:0}
body.touch-layout .console-top button{font:500 14px/1.35 -apple-system,'PingFang SC',sans-serif;min-height:38px;padding:6px 3px;letter-spacing:0;white-space:nowrap}
body.touch-layout .game-hud{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));align-content:start;gap:5px 7px;padding:10px 12px 18px}
body.touch-layout .game-hud>div{min-width:0;gap:4px}
body.touch-layout .game-hud small{font-size:11px;letter-spacing:0;line-height:1.2}
body.touch-layout .game-hud b,body.touch-layout .game-hud #hudRound{font-size:16px;font-weight:750;line-height:1.3;letter-spacing:0;white-space:nowrap}
body.touch-layout .game-hud .power-hud:not([hidden]){display:flex;flex-direction:row;align-items:baseline;gap:10px;grid-column:1 / -1;grid-row:2;min-width:0;max-width:none}
body.touch-layout .game-hud .power-hud b{width:auto;max-width:100%;font-size:13px;white-space:normal;line-height:1.45}
body.touch-layout .game-hud .power-hud b>span{display:inline-block;margin-right:12px}
body.touch-layout .game-hud .power-hud b>span[hidden]{display:none!important}
body.touch-layout .touch-controls .dpad button{width:62px;height:62px;font:25px -apple-system,sans-serif}
body.touch-layout .touch-controls .jump-action button{width:72px;height:72px;font-size:29px}
body.touch-layout .touch-controls .jump-action>span{font-size:14px}
body.touch-layout .touch-controls .gadget-controls button{width:76px;min-height:44px;font-size:13px}
body.touch-layout .touch-controls .actions{gap:10px}
body.touch-layout .menu{padding:18px 20px;max-width:96%}
body.touch-layout .menu h2{font-size:27px;line-height:1.25;margin-bottom:12px}
body.touch-layout .menu>p{font-size:14px;line-height:1.5}
body.touch-layout .menu>p:first-child{font-size:11px;margin-bottom:10px}
body.touch-layout .control-guide{font-size:14px;margin:12px 0;line-height:1.6}
body.touch-layout .menu #start{font-size:18px;min-height:48px;padding:12px 28px}
body.touch-layout #recordHint,body.touch-layout .menu small{font-size:12px;line-height:1.5}
body.touch-layout .clear-results{font-size:13px;min-width:230px}
body.touch-layout .clear-results>div{gap:14px;padding:5px 0}
body.touch-layout .clear-results .result-total{font-size:18px}
body.touch-layout .goal-notice,body.touch-layout .cannon-hint{font-size:13px;padding:8px 12px}
body.touch-layout .speed-notice{font-size:12px;top:auto;bottom:12px}
body.touch-layout.immersive .machine.portrait-layout{justify-content:center}
body.touch-layout.immersive .machine.portrait-layout .console{flex:0 1 auto;width:100%;justify-content:flex-start}
body.touch-layout.immersive .machine.portrait-layout .bezel{flex:0 0 auto;height:var(--portrait-stage-height);max-height:none;min-height:0}
body.touch-layout.immersive .machine.portrait-layout .touch-controls{position:relative;flex:0 0 128px;inset:auto;width:100%;padding:12px 16px 6px;pointer-events:auto}
body.touch-layout.immersive .machine.landscape-layout .console{flex:1 1 0;min-height:0;justify-content:flex-start}
body.touch-layout.immersive .machine.landscape-layout .bezel{flex:1 1 0;height:auto;min-height:0;max-height:none;aspect-ratio:auto}
body.touch-layout.immersive .machine.landscape-layout .touch-controls{position:absolute;flex:none;left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));bottom:calc(env(safe-area-inset-bottom) + 12px);width:auto;padding:0;pointer-events:none}
body.touch-layout.immersive .machine.landscape-layout .touch-controls button{pointer-events:auto}
body.touch-layout .machine.landscape-layout .menu{padding:10px 18px}
body.touch-layout .machine.landscape-layout .menu h2{font-size:23px;margin:0 0 5px}
body.touch-layout .machine.landscape-layout .control-guide{margin:5px 0;font-size:13px}
body.touch-layout .machine.landscape-layout .menu #start{font-size:17px;min-height:42px;padding:9px 24px}
body.touch-layout .machine.landscape-layout .game-hud{padding-top:7px;padding-bottom:12px}
@media(max-width:370px){body.touch-layout .console-top>div{gap:0 5px}body.touch-layout .console-top button{font-size:13px}body.touch-layout .game-hud{padding:8px;gap:4px}body.touch-layout .game-hud b,body.touch-layout .game-hud #hudRound{font-size:14px}body.touch-layout .game-hud small{font-size:10px}body.touch-layout .touch-controls .dpad button{width:52px;height:58px}body.touch-layout .touch-controls .jump-action button{width:64px;height:64px}body.touch-layout .touch-controls .gadget-controls button{width:68px;font-size:12px}}

/* Keyboard labels remain readable in fullscreen and short desktop windows. */
body.keyboard-controls .gadget-controls .keyboard-key{display:inline!important;font-weight:750}
body.keyboard-controls .touch-controls .dpad,body.keyboard-controls .touch-controls .jump-action{display:none!important}
body.keyboard-controls .touch-controls .gadget-controls{flex-direction:row}
body.keyboard-controls .touch-controls .gadget-controls button{width:auto;min-width:112px;min-height:36px;font-size:12px;padding:8px 12px}
body.keyboard-controls .touch-controls:not(:has(.gadget-controls[hidden])){display:flex;justify-content:flex-end}
body.keyboard-controls.immersive .touch-controls:not(:has(.gadget-controls[hidden])){justify-content:flex-end}
body.keyboard-controls .cannon-hint{font-size:13px;max-width:calc(100% - 24px);text-align:center;white-space:normal}

/* Keep all three directions beside the jump and cannon buttons on narrow phones. */
@media(max-width:440px){
 body.touch-layout .touch-controls{gap:8px}
 body.touch-layout .touch-controls .dpad{gap:6px;flex-shrink:0}
 body.touch-layout .touch-controls .dpad button{width:52px;height:62px;flex-shrink:0}
 body.touch-layout .touch-controls .actions{gap:8px;flex-shrink:0}
 body.touch-layout.immersive .machine.portrait-layout .touch-controls{padding-left:12px;padding-right:12px}
}
@media(max-width:350px){
 body.touch-layout .touch-controls .dpad button{width:44px;height:58px}
}
