html,body{height:100%;height:100dvh}
:root{--ink:#122b3d;--cream:#fff4d7;--gold:#ffcb53;--orange:#fd734b;color:var(--cream);background:var(--ink);font-family:FlightPixel,"Courier New",monospace;color-scheme:dark}
*{box-sizing:border-box}body{margin:0;overflow:hidden}button,a{font:inherit;color:inherit;-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:focus-visible,a:focus-visible{outline:3px solid white;outline-offset:4px}[hidden]{display:none!important}
#arcade{position:relative;isolation:isolate;width:100%;height:100%;outline:none;overflow:hidden;touch-action:none;user-select:none}
#sky{position:absolute;inset:0;width:100%;height:100%;image-rendering:pixelated;touch-action:none}
#arcade::before{content:"";position:absolute;z-index:1;inset:0;pointer-events:none;background:linear-gradient(90deg,#122c40f0 0%,#15384cdc 33%,#183f501a 67%,transparent);opacity:0}
#arcade[data-phase=title]::before,#arcade[data-phase=paused]::before,#arcade[data-phase=lost]::before{opacity:1}
#tools{position:absolute;z-index:5;right:max(12px,env(safe-area-inset-right));top:max(10px,env(safe-area-inset-top));display:flex;gap:5px}
#tools>:is(a,button){display:grid;place-items:center;text-decoration:none;width:clamp(32px,5cqh,46px);height:clamp(32px,5cqh,46px);border:2px solid var(--ink);border-bottom-width:4px;background:#153245ed;color:var(--cream);font:700 20px/1 system-ui}
#tools #lang{font:15px FlightPixel,monospace}#tools>button[aria-pressed=false]{color:#9da9aa}#tools button:active{transform:translateY(1px)}
.panel{position:absolute;left:clamp(24px,8cqw,160px);top:50%;transform:translateY(-48%);z-index:2;max-width:49%;text-shadow:2px 2px var(--ink)}
h1.flight-mark{font-size:clamp(68px,min(9cqw,12cqh),170px);margin:0 0 .26em}
.brief{max-width:35ch;font:650 clamp(16px,2.5cqh,23px)/1.32 system-ui,sans-serif;margin:0 0 .85em}.flight-controls{display:flex;align-items:center;flex-wrap:wrap;gap:.5em .85em;color:#fff4dd;font:600 clamp(13px,1.9cqh,18px)/1.2 system-ui,sans-serif}
.keyboard-prompt,.touch-prompt{display:flex;align-items:center;gap:.55em}.touch-prompt{display:none}.autofire{border-left:2px solid #b0c0aa;padding-left:.85em}
.wasd{display:grid;grid-template-columns:repeat(3,15px);grid-template-rows:repeat(2,14px);width:45px;align-items:center}.wasd img,.touch-prompt img,#pulse img{width:100%;image-rendering:pixelated}.wasd img:first-child{grid-column:2}.wasd img:nth-child(2){grid-column:1}.touch-prompt img{width:28px}
.primary,.secondary{border:3px solid var(--ink);border-bottom-width:6px;font:normal clamp(18px,2.8cqh,30px)/1 FlightPixel,monospace;text-transform:uppercase;padding:.65em 1.1em .51em;min-height:42px;margin-top:clamp(12px,2.8cqh,28px);background:var(--gold);color:var(--ink);box-shadow:inset 0 3px #fff2a0,3px 3px #102b3d8c}
.primary:active,.secondary:active{transform:translateY(2px)}.secondary{margin-left:6px;background:#204556;color:var(--cream);box-shadow:inset 0 3px #527787;font-size:clamp(15px,2.2cqh,23px)}
.record{font-size:clamp(13px,1.9cqh,19px);margin:12px 0 0;color:#d6eadc}.record b{font-weight:400;margin-left:6px;color:#ffdb73}
#hud{position:absolute;z-index:2;left:max(10px,env(safe-area-inset-left));top:max(10px,env(safe-area-inset-top));display:flex;gap:3px;pointer-events:none}.hud-cell{background:#133446ed;border-bottom:3px solid #102536;min-height:34px;padding:5px 8px 3px;display:grid;gap:2px;align-content:center}.hud-cell small,.results small{font-size:clamp(9px,1.6cqh,14px);text-transform:uppercase;color:#b8dcdf}.hud-cell strong,.results b{font-weight:400;font-size:clamp(15px,2.5cqh,26px);color:#ffda75}
#hearts{display:flex;align-items:center;gap:2px;height:1em}#hearts i{width:clamp(12px,1.8cqh,18px);aspect-ratio:1;background:url('shield.png') center/contain no-repeat;image-rendering:pixelated}#hearts i.empty{filter:grayscale(1);opacity:.32}
#boss-hud{z-index:2;position:absolute;left:50%;top:max(64px,9cqh);transform:translateX(-50%);display:flex;gap:6px;align-items:center;background:var(--ink);padding:4px 7px;color:#ffc5a5;font-size:12px;pointer-events:none}#boss-hud i{background:#743e46;width:clamp(65px,13cqw,165px);height:6px}#boss-hud b{display:block;background:#ff9665;height:100%;transform-origin:left}
#callout{position:absolute;z-index:2;top:27%;left:50%;transform:translateX(-50%);font-size:clamp(16px,3.3cqh,34px);text-align:center;white-space:pre-line;pointer-events:none;text-shadow:2px 2px 0 var(--ink),-2px 0 var(--ink),0 -2px var(--ink);color:var(--cream);width:92%}
#pulse{position:absolute;z-index:3;right:max(12px,env(safe-area-inset-right));bottom:max(12px,env(safe-area-inset-bottom));min-height:44px;display:flex;gap:8px;align-items:center;background:#18394b;border:2px solid #b2ded9;border-bottom:4px solid #0b2935;padding:5px 12px 4px;color:var(--cream);font-size:clamp(14px,2cqh,22px);text-transform:uppercase}#pulse picture{display:flex}#pulse img{width:33px}#pulse strong{font-weight:400;color:#9ef1d4}#pulse:disabled{opacity:.78}
#headline{font-size:clamp(36px,min(7cqw,10cqh),110px);line-height:1;margin:0 0 .15em;color:var(--gold);text-shadow:3px 4px 0 var(--ink);text-transform:uppercase}.results{display:flex;gap:24px;margin:12px 0 0}.results>div{display:grid;gap:.25em}.results b{color:var(--cream)}#loading{position:absolute;inset:0;z-index:8;display:grid;place-items:center;background:var(--ink);color:var(--gold)}
@media (pointer:coarse){.keyboard-prompt{display:none}.touch-prompt{display:flex}#pulse img{display:block;width:23px}}
@container playable (max-aspect-ratio:4/5){#arcade::before{background:linear-gradient(0deg,#122c40fa 0%,#15384ce8 40%,#183f501a 70%,transparent)}.panel{max-width:none;left:7%;right:6%;top:auto;bottom:max(6%,env(safe-area-inset-bottom));transform:none}h1.flight-mark{font-size:clamp(57px,min(16cqw,9cqh),105px)}.brief{max-width:34ch}.hud-cell{padding:4px 5px 3px}.hud-cell small{font-size:9px}.hud-cell strong{font-size:15px}#tools{gap:3px}#tools>:is(a,button){width:31px;height:31px}#headline{font-size:clamp(38px,12cqw,80px)}}
@container playable (max-height:420px){.panel{left:6%;max-width:57%;transform:translateY(-49%)}h1.flight-mark{font-size:clamp(44px,12cqh,58px)}.brief{font-size:14px;margin-bottom:5px}.record{margin-top:6px}.primary,.secondary{margin-top:8px;min-height:33px;padding:.43em .8em .38em}.wasd{grid-template-columns:repeat(3,12px);grid-template-rows:repeat(2,11px);width:36px}.flight-controls{font-size:12px}#boss-hud{top:12px}}

.pulse-legend{margin-top:.3em;display:flex;align-items:center;gap:.55em;color:#deebdf;font:600 clamp(12px,1.8cqh,16px)/1.2 system-ui,sans-serif}.pulse-legend img{width:36px;image-rendering:pixelated}.tap-help{display:none}
@media(pointer:coarse){.pulse-legend img,.desk-help{display:none}.tap-help{display:inline}}

@container playable (max-width:420px){#hud{top:calc(max(10px,env(safe-area-inset-top)) + 39px)}#boss-hud{top:calc(max(10px,env(safe-area-inset-top)) + 82px)}}

@media(pointer:coarse){#pulse{min-height:calc(44px / var(--play-scale,1))}}
