* { box-sizing:border-box }
html, body { margin:0; height:100%; background:#000; color:#fcfcfc; font:14px system-ui,sans-serif; color-scheme:dark }
main { height:100%; height:100dvh; display:flex; flex-direction:column; align-items:center; padding:6px; gap:6px }
#viewport { flex:1; min-height:0; width:100%; display:grid; place-items:center; overflow:hidden }
#screen { position:relative; max-width:100%; max-height:100%; }
canvas { display:block; width:100%; height:100%; image-rendering:pixelated; outline:0 }
#screen.crt::after { content:""; position:absolute; inset:0; pointer-events:none; background:radial-gradient(ellipse,transparent 55%,#0008),repeating-linear-gradient(transparent 0 50%,#0006 50% 100%); background-size:100% 100%,100% calc(100% / 240) }
#loading { position:absolute; inset:0; display:grid; place-items:center; background:#000; white-space:nowrap }
[hidden] { display:none!important }
nav,.pad { display:flex; align-items:center; justify-content:center; gap:5px }
button { background:#0e1022; border:1px solid #6068b4; border-radius:3px; padding:5px 10px; color:#fcfcfc; font:inherit; touch-action:none; user-select:none; cursor:pointer }
button:active,button:focus-visible { border-color:#fac85a; color:#fac85a }
.pad { display:none }
.hint { margin:0; color:#9696a0; font-size:12px; text-align:center }
@media (pointer:coarse),(max-width:640px) { .pad { display:flex } .hint { display:none } button { min-height:38px; padding:4px 8px } nav { flex-wrap:wrap } }
