html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
    overscroll-behavior: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    touch-action: none;
}

/* Fullscreen wrapper that centers the fixed-aspect game stage,
   regardless of the device's actual screen size/aspect ratio. */
#game-wrap {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;      /* fallback for browsers without dvh support */
    height: 100dvh;     /* accounts for mobile browser UI bars */
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    /* iPhone notch / home-indicator safe area */
    padding: env(safe-area-inset-top) env(safe-area-inset-right)
             env(safe-area-inset-bottom) env(safe-area-inset-left);
    box-sizing: border-box;
}

/* enchant.js reads this element's computed CSS size to determine
   its internal rendering scale (see js/app-mobile.js). */
#enchant-stage {
    position: relative;
    background: #000;
    /* Prevents blurry upscaling on crisp pixel-art assets. */
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

canvas {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}
