* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Bridge CSS env() to custom properties for JS access */
    --sat: env(safe-area-inset-top, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
    --sal: env(safe-area-inset-left, 0px);
    --sar: env(safe-area-inset-right, 0px);
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0a2a0a;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    /* Safe area support */
    padding: var(--sat) var(--sar) var(--sab) var(--sal);
}

#game-canvas {
    display: block;
    position: absolute;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    -ms-interpolation-mode: nearest-neighbor;
}

/* Prevent pull-to-refresh */
body {
    overscroll-behavior: none;
}

/* Landscape orientation hint */
@media (orientation: landscape) and (max-height: 500px) {
    body::after {
        content: '';
        /* Game still works in landscape, just centered */
    }
}
