/* Keep the game inside the visible browser viewport, including mobile browser chrome. */
html,body{width:100%;height:100%;min-height:0;overflow:hidden;overscroll-behavior:none;touch-action:none}
body{position:fixed;inset:0;padding:max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));display:block;user-select:none;-webkit-user-select:none}
.shell{width:100%;height:100%;height:calc(100dvh - max(10px,env(safe-area-inset-top)) - max(10px,env(safe-area-inset-bottom)));grid-template-rows:auto minmax(0,1fr) auto;gap:10px}
header{justify-content:flex-start;gap:14px}.back{color:var(--ink);text-decoration:none;font-weight:850;white-space:nowrap;min-height:44px;display:flex;align-items:center}.stats{margin-left:auto}.game-frame{min-height:0;box-shadow:none;border-radius:18px}canvas{width:100%;height:100%;aspect-ratio:auto}.footer{padding:0}.overlay{padding:12px}.card{max-height:100%;overflow:auto;touch-action:pan-y}button{font-family:inherit;font-weight:850}#pauseBtn{min-height:44px;padding:8px 12px;box-shadow:2px 2px 0 var(--ink)}
@media(max-width:620px){header{gap:8px;flex-wrap:wrap}.brand{font-size:1rem}.brand-mark{display:none}.back{margin-right:auto}.stats{order:3;width:100%;justify-content:center}.stat{min-width:100px;text-align:center}.footer{font-size:.65rem}.footer span:last-child{display:none}.card{width:min(430px,96%)}.hud{padding:9px}.mission{font-size:.55rem}.danger{font-size:.55rem}}
@media(max-height:500px){.shell{gap:5px}header{flex-wrap:nowrap}.stats{order:0;width:auto;margin-left:auto}.brand{font-size:.9rem}.brand-mark,.footer{display:none}.shell{grid-template-rows:auto minmax(0,1fr)}.card{padding:12px;max-width:460px}.card h1{font-size:2rem;margin:8px 0}.card h1 br{display:none}.card p{font-size:.8rem;margin-bottom:10px}.eyebrow{font-size:.55rem;padding:3px 7px}.controls button{min-height:40px;padding:7px 14px}}
