*{box-sizing:border-box}
html,body{margin:0;width:100%;height:100%;overflow:hidden;overscroll-behavior:none}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{background:#071525;color:white;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;display:grid;place-items:center;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}
button{font:inherit;color:inherit;cursor:pointer;touch-action:manipulation;-webkit-appearance:none;appearance:none}
button:focus-visible,canvas:focus-visible{outline:3px solid #ffd459;outline-offset:-5px}
#cabinet{width:100%;height:100vh;padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px);display:flex;flex-direction:column;align-items:center;justify-content:center}
#stage{position:relative;flex:none;width:288px;height:512px;max-width:100%;overflow:hidden;background:#39a9e8;box-shadow:0 0 100px #12406440;touch-action:none;-webkit-touch-callout:none}
canvas{display:block;height:100%;width:100%;touch-action:none;image-rendering:pixelated;outline:0}
#hud{position:absolute;left:0;top:0;width:288px;height:512px;transform:scale(var(--game-scale,1));transform-origin:top left;pointer-events:none}
#hud button{pointer-events:auto}
footer{flex:none;width:100%;max-width:495px;height:32px;display:flex;align-items:center;justify-content:space-between;font-size:9px;letter-spacing:1.5px;color:#7c8ca1}
footer>span:first-child{font-weight:900;font-size:13px;color:#d7e5f3}.gold{color:#ffcb43}
.icon-button{position:absolute;top:8px;right:8px;width:44px;height:44px;border:0;background:#08244338;border-radius:6px;padding:12px;z-index:4;opacity:.85}
.icon-button svg{width:100%;height:100%;fill:white;stroke:#fff;stroke-width:1.8;stroke-linecap:square;stroke-linejoin:miter}.icon-button .waves{fill:none}.icon-button.muted .waves{opacity:.15}
.play-target{position:absolute;top:49%;left:0;width:100%;height:35%;background:none;border:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-shadow:2px 2px #14395b,-2px -2px #14395b,2px -2px #14395b,-2px 2px #14395b;z-index:2}
.play-target>span{font-size:17px;font-weight:900;letter-spacing:.7px;white-space:nowrap}.play-target small{font-size:9px;letter-spacing:1.5px;margin-top:12px;opacity:.82}.play-target i{font-style:normal;display:block;margin-top:15px;font-size:28px;animation:tap 1.2s ease-in-out infinite}
#loading{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:15px;background:#123d63;letter-spacing:1px;font-size:12px;z-index:8}#loading span{color:#ffd45b;animation:tap 1s ease-in-out infinite}
#results{position:absolute;inset:23% 8% auto;text-align:center;z-index:3}
#results h1{font-size:25px;margin:0 0 18px;color:#fff;letter-spacing:1px;text-shadow:3px 3px #0b223f,-2px -2px #0b223f,2px -2px #0b223f,-2px 2px #0b223f;white-space:nowrap}
.scorecard{position:relative;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:18px 14px;background:#fff0ce;border:4px solid #172f48;box-shadow:0 5px 0 #081c34,inset 0 0 0 3px #e8c887;color:#1a3652}
.scores{flex:1;min-width:0}.scores p{margin:0 0 14px;display:flex;justify-content:space-between;align-items:center;font-size:10px;letter-spacing:.5px;gap:8px}.scores p:last-child{margin:0}.scores strong{font-size:24px;letter-spacing:0}
.medal{flex:0 0 48px;height:48px;border:4px solid #c2bba4;box-shadow:inset 0 0 0 3px #fff7dd;display:grid;place-items:center;border-radius:50%;color:#c2bba4;background:#ddd7c1;font-size:27px}.medal.bronze{background:#c98843;border-color:#7f4e2b;color:#ffe6a5}.medal.silver{background:#b4c9d8;border-color:#6b8398;color:white}.medal.gold{background:#ffc742;border-color:#bd8424;color:#fff3b8}.medal.platinum{background:#b8f9ee;border-color:#63b4bc;color:white}
#new-best{position:absolute;right:13px;bottom:-9px;background:#f25a47;border:2px solid #172f48;color:#fff;padding:2px 5px;font-size:9px;font-weight:bold}
#retry{margin-top:24px;border:3px solid #17324d;background:#ffcb43;box-shadow:0 5px 0 #0a213b,inset 0 2px 0 #fff29a;color:#172f48;font-size:13px;font-weight:900;padding:12px 14px;letter-spacing:.3px;min-height:44px;white-space:nowrap}#retry:active{transform:translateY(3px);box-shadow:0 2px 0 #0a213b}#retry span{font-size:18px}.retry-hint{font-size:8px;letter-spacing:1px;text-shadow:1px 1px #0b223f;margin-top:17px}
#resume{position:absolute;inset:0;background:#09213bb8;border:0;z-index:5;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:17px}#resume strong{font-size:23px}#resume span{font-size:10px;letter-spacing:1px}
[hidden]{display:none!important}.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}
@keyframes tap{50%{transform:translateY(-6px);opacity:.6}}
@media(prefers-reduced-motion:reduce){*{animation:none!important}}
