:root{color-scheme:dark;font-family:system-ui,sans-serif;background:#030711;color:#c5e5f4}*{box-sizing:border-box}body{margin:0;min-height:100vh;display:grid;place-items:center}main{width:min(100%,1280px)}#stage{position:relative;aspect-ratio:16/9;background:#02050c}canvas{display:block;width:100%;height:100%;outline:none}#cover{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;background:radial-gradient(ellipse at center,#122237,#030711);text-align:center;padding:24px}h1{letter-spacing:.18em;font-size:clamp(28px,6vw,64px);color:#58d9ff;margin:0}button{font:inherit;color:#bdefff;background:#12293c;border:1px solid #329dbc;padding:12px 24px;cursor:pointer}button:hover,button:focus-visible{background:#21445a}button:disabled{opacity:.5;cursor:wait}footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px;font-size:13px;color:#8aabbf}footer button{padding:6px 12px}#error{white-space:pre-wrap;color:#ffc8bb;padding:16px}#stage:fullscreen{width:100vw;height:100vh;display:grid;place-items:center}#stage:fullscreen canvas{width:min(100vw,177.777vh);height:min(100vh,56.25vw)}[hidden]{display:none!important}

footer{flex-wrap:wrap}footer span{flex:1 1 300px}

dialog{width:min(600px,92vw);background:#102237;color:#c5e5f4;border:1px solid #329dbc}dialog::backdrop{background:#000b}textarea{width:100%;background:#030711;color:#c5e5f4;padding:10px}dialog a{color:#58d9ff;margin-right:16px}dialog button{margin-top:12px;padding:8px}

/* Fixed 720p rendering, fitted into the safe area without extra GPU scaling passes. */
body{padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);min-height:100dvh}
#touch-option{margin:16px;display:flex;align-items:center;gap:10px;min-height:44px}#touch-mode{width:22px;height:22px}
canvas{touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
#rotate{position:absolute;inset:0;z-index:3;background:#06101f;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px}#rotate strong{font-size:24px;color:#58d9ff}
.touch-game main{width:min(100%,calc((100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 56px)*16/9))}
.touch-game footer{gap:6px;padding:4px;font-size:11px;justify-content:center}.touch-game footer span{display:none}.touch-game footer button{min-height:44px;padding:4px 10px}
@media(orientation:portrait){.touch-game main{width:100%}.touch-game #stage{min-height:65dvh}.touch-game #cover{padding:12px}}
#stage:fullscreen{padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
main{min-width:0;max-width:100%}#stage{min-width:0}
@media(orientation:portrait){.touch-game #stage{aspect-ratio:auto;height:65dvh}.touch-game canvas{position:absolute;inset:0}}
