@font-face{font-family:"DM Sans";src:url("./dm-sans.ttf") format("truetype");font-weight:100 900;font-display:swap}
:root{color-scheme:dark;--bg:#101416;--panel:#1a2023;--line:#343c3e;--ink:#f3efe3;--dim:#b2bcba;--amber:#ffc259;--mint:#78d9b4;--mono:ui-monospace,"SFMono-Regular",Consolas,"Liberation Mono",monospace;font-family:"DM Sans",system-ui,sans-serif;background:var(--bg);color:var(--ink)}
*{box-sizing:border-box}
body{margin:0;min-height:100svh;background:radial-gradient(ellipse at 35% 38%,#19212444,transparent 66%),var(--bg)}
button,a{font:inherit}
button{color:inherit;cursor:pointer}
button:focus-visible,a:focus-visible,canvas:focus-visible{outline:3px solid var(--amber);outline-offset:3px;z-index:3}
button:active{transform:translateY(1px)}
[hidden]{display:none!important}
.shell{width:min(1256px,calc(100% - clamp(32px,8.6vw,152px)));margin-inline:auto}
.topbar{border-bottom:1px solid #303638;background:#131719}
.top-inner,nav,.arcade-brand,.toolbar-button,.eyebrow,.machine-head,.machine-foot,.place,.machine-status,.panel-heading,.stat-row,.air-label,.action,.room-note,.note-label,.checks,.helmets,.guide-keys>div,.dialog-head{display:flex;align-items:center}
.top-inner{height:59px;justify-content:space-between;gap:12px}
.arcade-brand{gap:11px;font:700 .93rem/1 var(--mono);letter-spacing:.065em;color:var(--ink);text-decoration:none}
.arcade-icon{width:26px;height:22px;shape-rendering:crispEdges}
nav{gap:22px}
.toolbar-button{border:0;background:none;gap:8px;min-height:40px;padding:0 2px;font-size:.875rem;color:#c6cdc9}
.toolbar-button:hover,.expand:hover{color:var(--amber)}
svg:not(.arcade-icon){width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
#sound .mute,#sound[aria-pressed=false] .waves{display:none}
#sound[aria-pressed=false] .mute{display:block}
.marquee{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:clamp(23px,3.8vh,46px) 0 clamp(21px,3.4vh,35px)}
h1,h2,p,dl,dd{margin:0}
h1{line-height:1}
h1 img{display:block;width:clamp(250px,36vw,507px);height:auto;image-rendering:pixelated}
.marquee p{font-size:clamp(.95rem,1.3vw,1.08rem);color:#bdc5c1;margin-top:9px;line-height:1.45}
.best{align-self:center;display:grid;justify-items:end;gap:5px;padding-right:1px}
.eyebrow,.level-code,.machine-foot,.note-label{font:650 .78rem/1.3 var(--mono);letter-spacing:.09em;text-transform:uppercase}
.eyebrow{color:var(--dim);gap:7px}
.best .eyebrow{font-size:.77rem}
.best svg{color:var(--amber);width:17px;height:17px}
#best-score{font:600 clamp(1.3rem,2vw,1.7rem)/1.2 var(--mono);letter-spacing:.11em}
.cabinet{display:grid;grid-template-columns:minmax(0,1fr) clamp(225px,22.3%,275px);gap:clamp(16px,1.7vw,26px);align-items:start}
.machine,.readout,.controls{background:var(--panel);border:1px solid var(--line);border-radius:6px}
.machine{overflow:hidden;box-shadow:0 7px 20px #0002}
.machine-head{padding:0 12px 0 15px;gap:13px;min-height:50px;border-bottom:1px solid #080b0d}
.level-code{display:flex;gap:.4em;align-items:center;white-space:nowrap;background:#302b20;color:var(--amber);border:1px solid #53432e;padding:5px 8px 4px;border-radius:2px;font-size:.76rem;letter-spacing:.035em}
.level-code .of{color:#c2aa7f}
.machine-head h2{font-size:clamp(1rem,1.7vw,1.32rem);font-weight:720;line-height:1.13;letter-spacing:-.02em}
.expand{width:36px;min-width:36px;height:36px;display:grid;place-items:center;margin-left:auto;padding:0;background:transparent;border:0;color:var(--dim)}
.expand svg{width:20px;height:20px}
.playfield{position:relative;background:#102027 url("./winding-house.webp") center/cover;isolation:isolate}
canvas{display:block;width:100%;height:auto;aspect-ratio:16/9;image-rendering:pixelated;outline:none;touch-action:manipulation}
canvas:focus-visible{outline-offset:-3px}
.machine-foot{min-height:42px;padding:6px 15px;gap:10px;justify-content:space-between;color:#bfc8c6;font-size:.76rem;letter-spacing:.065em;border-top:1px solid #080a0c}
.place,.machine-status{gap:8px}
.place svg{color:#96a6a8;width:16px;height:16px}
.machine-status{color:var(--mint);font-size:.72rem;letter-spacing:.09em}
.machine-status i{height:6px;width:6px;background:currentColor;box-shadow:0 0 7px #7dd9b448}
body:is([data-mode=dead],[data-mode=over],[data-mode=paused]) .machine-status{color:var(--amber)}
.room-note{gap:14px;padding:15px 1px 24px;align-items:baseline}
.note-label{color:#e2bd80;gap:6px;font-size:.73rem;letter-spacing:.08em;white-space:nowrap}
.note-label svg{width:14px;height:14px;align-self:center}
.room-note p{font-size:.91rem;line-height:1.48;color:var(--dim)}
.console{display:grid;gap:14px}
.readout{padding:0 18px 17px}
.panel-heading{font-size:1.13rem;font-weight:720;min-height:49px;justify-content:space-between;border-bottom:1px solid var(--line);letter-spacing:-.02em}
.vents{width:28px;height:7px;background:repeating-linear-gradient(110deg,transparent 0 3px,#596164 3.5px 5.5px,transparent 6px 7px)}
.instrument{padding:16px 0 14px;border-bottom:1px solid var(--line)}
.score{display:grid;gap:3px}
#score{font:650 clamp(1.8rem,2.5vw,2.35rem)/1.2 var(--mono);letter-spacing:.05em;color:#f3eddb}
.stat-row{justify-content:space-between;gap:5px;min-height:45px;border-bottom:1px solid var(--line)}
.helmets{gap:4px}
.helmets img{width:23px;height:auto;image-rendering:pixelated}
.helmets img.lost{filter:grayscale(1);opacity:.19}
.checks{font:600 1.02rem/1 var(--mono);gap:9px}
.check-icon{width:16px;height:auto;image-rendering:pixelated}
.air-block{padding:15px 0 19px}
.air-label{justify-content:space-between;margin-bottom:8px}
#air-value{font:600 .85rem var(--mono);color:var(--mint)}
.air-meter{position:relative;background:#35413f;height:10px;overflow:hidden}
.air-meter:after{content:"";position:absolute;inset:0;background:repeating-linear-gradient(90deg,transparent 0,transparent calc(5% - 2px),var(--panel) calc(5% - 2px),var(--panel) 5%)}
#air-fill{height:100%;width:100%;background:var(--mint)}
.air-low #air-fill{background:var(--amber)}
.air-low #air-value{color:var(--amber)}
.action{background:var(--amber);color:#251c10;border:1px solid #ffd995;border-bottom:3px solid #b97c29;min-height:44px;padding:8px 12px;width:100%;gap:9px;border-radius:3px;font-weight:800}
.action:hover,.touch-action:hover{background:#ffcf7b}
#action-symbol{font:700 .86rem/1 var(--mono)}
.action kbd{margin-left:auto;border-color:#a37334;color:#513510;background:transparent;font-size:.72rem;min-height:18px;padding:1px 4px}
.controls{padding:14px 18px 12px;background:#151a1d}
.controls h2{color:#cbd2cc;margin:0 0 7px}
.controls dl>div,.guide-keys>div{display:flex;justify-content:space-between;align-items:center;min-height:30px;gap:8px}
.controls dt{font-size:.89rem;color:#c7cfcb}
kbd{display:inline-flex;min-width:22px;min-height:20px;align-items:center;justify-content:center;padding:2px 5px;font:500 .8rem/1 var(--mono);text-transform:none;letter-spacing:0;color:#ecece3;background:#272e31;border:1px solid #4a5457;border-bottom:2px solid #4a5457;border-radius:3px}
dd kbd+kbd{margin-left:3px}
.overlay{position:absolute;inset:0;display:grid;place-items:center;background:#0e161bc2;padding:12px}
.overlay-card{width:min(320px,96%);padding:24px;text-align:center;border:1px solid #6a6555;border-top:3px solid var(--amber);background:#171e21;box-shadow:5px 6px 0 #080d1066}
.overlay-card h2,dialog h2{font-size:clamp(1.35rem,3vw,2rem);line-height:1.15;letter-spacing:-.04em}
.overlay-card p,dialog p{font-size:1rem;line-height:1.5;color:#c6ceca;margin:10px 0 16px}
.compact{justify-content:center}
.touch-pad{display:none}
.play-prompt{position:absolute;bottom:2%;left:50%;translate:-50% 0;display:flex;align-items:center;gap:8px;padding:7px 13px;background:#202623;color:var(--amber);border:1px solid var(--amber);border-radius:3px;box-shadow:0 2px 5px #09101299;font:700 .88rem var(--mono)}
.play-prompt:hover{background:#32382e}
body[data-mode=ready] canvas{cursor:pointer}
.controls dd button{font:500 .81rem var(--mono);color:var(--ink);padding:4px 8px;min-width:30px;min-height:26px;background:#293235;border:1px solid #566365;border-bottom-width:2px;border-radius:3px;touch-action:none;user-select:none}
.controls dd button:hover,.controls dd button.held{background:#3c494b;border-color:var(--amber)}
.controls dd button:disabled{opacity:.55;cursor:default}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
dialog{width:min(440px,calc(100% - 24px));max-height:90svh;padding:22px;color:var(--ink);background:#1a2124;border:1px solid #525c5c;border-top:3px solid var(--amber);border-radius:3px;box-shadow:12px 12px 0 #080e114d}
dialog::backdrop{background:#050a0dcc;backdrop-filter:blur(3px)}
.dialog-head{justify-content:space-between;margin-bottom:8px}
.dialog-head .eyebrow{color:var(--amber)}
.dialog-head button{font-size:1.5rem;line-height:1;width:36px;height:36px;background:transparent;border:1px solid var(--line);border-radius:3px}
.guide-keys{border-block:1px solid var(--line);padding:9px 0}
.guide-keys dt{font-size:.9rem}
.cabinet:is(:fullscreen,.expanded-view){position:fixed;inset:0;background:var(--bg);z-index:8;width:100%;height:100%;padding:12px max(12px,env(safe-area-inset-right));overflow:auto;align-content:center;align-items:center;grid-template-columns:minmax(0,min(calc((100dvh - 125px)*1.77778),calc(100% - 260px))) 235px;justify-content:center}
.cabinet:is(:fullscreen,.expanded-view) .room-note{display:none}
@media(min-width:1500px){main{padding-top:12px}}
@media(max-width:980px){.shell{width:calc(100% - 40px)}.cabinet{grid-template-columns:minmax(0,1fr) 214px;gap:14px}.readout,.controls{padding-inline:13px}.machine-head{padding-left:10px;gap:8px}.machine-head h2{font-size:1.05rem}.machine-foot{padding-inline:10px}.room-note{gap:8px}.best{padding-right:0}}
@media(max-width:740px){.shell{width:calc(100% - 28px)}.top-inner{height:48px}.arcade-brand{font-size:.8rem;gap:7px}.arcade-icon{width:22px;height:18px}nav{gap:12px}.toolbar-button{font-size:.82rem;gap:5px}.toolbar-button svg{width:16px;height:16px}.marquee{padding:22px 0 16px;align-items:flex-start}.marquee p{font-size:.94rem;line-height:1.4;max-width:30em}.best{display:none}h1 img{width:clamp(245px,65vw,370px)}.cabinet{display:flex;flex-direction:column;gap:12px}.play-section,.console{width:100%}.machine-head{min-height:42px}.machine-foot{min-height:32px}.machine-foot,.machine-status,.level-code{font-size:.68rem}.room-note{padding:10px 1px 0;align-items:flex-start}.room-note p{font-size:.85rem}.note-label{margin-top:3px}.console{grid-template-columns:1fr}.readout{padding:0 12px 12px;display:grid;grid-template-columns:1fr 1fr;gap:0 16px}.panel-heading{grid-column:1/-1;min-height:36px;font-size:1rem}.instrument{padding:10px 0;grid-row:2/4;align-content:center}.stat-row{min-height:36px}.air-block{align-self:center;padding:12px 0 0}.action{align-self:end;margin-top:12px}.controls{margin-bottom:16px}.controls dl{display:flex;gap:16px;flex-wrap:wrap}.controls dt{margin-right:4px}.controls h2{margin-bottom:2px}.controls dl>div{justify-content:start}.overlay-card{padding:12px;max-width:270px}.overlay-card p{font-size:.875rem;margin:6px 0}.overlay-card .action{min-height:34px;margin-top:7px}.cabinet:is(:fullscreen,.expanded-view){display:flex;align-items:center;justify-content:center;gap:0}.cabinet:is(:fullscreen,.expanded-view) .console{display:none}}
@media(pointer:coarse),(max-width:740px){.touch-pad{display:flex;gap:10px;justify-content:space-between;margin-top:8px}.dpad{display:flex;gap:8px}.touch-key{min-height:44px;min-width:60px;padding:6px 18px;font:700 1.05rem var(--mono);background:#272f32;border:1px solid #4a5556;border-bottom-width:3px;border-radius:4px;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}.touch-key:active,.touch-key.held{background:#444d4c}.touch-action{min-width:105px;background:var(--amber);color:#261e12;border-color:#bf8c42}.controls{display:none}.readout .action{justify-content:center}.readout .action kbd{display:none}}
@media(max-width:420px){.shell{width:calc(100% - 20px)}.toolbar-button{font-size:.78rem}nav{gap:8px}.top-inner{gap:6px}.machine-head{gap:6px}.machine-head h2{font-size:.93rem}.level-code{padding:4px 5px}.expand{width:30px;min-width:30px}.room-note{flex-wrap:wrap;gap:3px 8px}.marquee p{max-width:29em}.machine-status{white-space:nowrap}.controls dl{gap:10px}}
@media(max-height:540px) and (orientation:landscape){.cabinet:is(:fullscreen,.expanded-view){display:grid;grid-template-columns:minmax(0,min(100%,calc((100dvh - 90px)*1.77778)));align-content:center}.cabinet:is(:fullscreen,.expanded-view) .console,.cabinet:is(:fullscreen,.expanded-view) .machine-foot{display:none}.cabinet:is(:fullscreen,.expanded-view) .machine-head{min-height:28px}.cabinet:is(:fullscreen,.expanded-view) .expand{height:28px}.cabinet:is(:fullscreen,.expanded-view) .touch-key{min-height:36px}}

@media(min-width:900px) and (max-height:825px){
  main.shell{max-width:clamp(850px,calc((100svh - 240px)*2.15),1256px)}
  .marquee{padding:18px 0}
  h1 img{width:clamp(310px,31vw,425px)}
  .top-inner{height:48px}
  .machine-head{min-height:43px}
  .machine-foot{min-height:32px}
  .room-note{padding-top:9px;padding-bottom:10px}
}

.pocket-stats{display:none}
.checks{white-space:nowrap}
#touch-pause{min-width:42px;padding-inline:10px;margin-left:auto}
@media(pointer:coarse),(max-width:740px){
  body[data-mode=playing] .machine-foot .place{display:none}
  body[data-mode=playing] .pocket-stats{display:flex;gap:12px;align-items:center}
  #pocket-air{color:var(--mint)}
  .air-low #pocket-air{color:var(--amber)}
}
@media(max-width:740px){
  .readout .action{display:none}
  .readout{grid-template-columns:1fr 1.12fr;gap:0 14px}
  .instrument{grid-row:auto}
  .stat-row:nth-of-type(3){grid-column:2;grid-row:3;border:0}
  .air-block{grid-column:1;grid-row:3}
}
@media(max-height:540px) and (orientation:landscape) and (pointer:coarse){
  .cabinet:is(:fullscreen,.expanded-view){grid-template-columns:minmax(0,min(100%,calc((100dvh - 114px)*1.77778)))}
  .cabinet:is(:fullscreen,.expanded-view) .machine-foot{display:flex;min-height:24px}
}
