/*
 * Page chrome only — everything inside the canvas is drawn by the game.
 * The job here is to centre the canvas, letterbox it, and stop mobile browsers from
 * treating game input as page gestures.
 */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: #010409;
    color: #c9d1d9;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* Kill pull-to-refresh and rubber-band scrolling, which otherwise fight with touch input. */
    overscroll-behavior: none;
    overflow: hidden;
}

#stage {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    /* Respect notches and home indicators on phones. */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

#game {
    display: block;

    /*
     * render.js sets the CSS width/height in device-independent pixels to preserve the
     * 540x960 aspect ratio; these are just the fallbacks and the visual frame.
     */
    max-width: 100%;
    max-height: 100%;

    background: #0d1117;
    border-radius: 6px;
    box-shadow: 0 0 0 1px #21262d, 0 18px 50px rgba(0, 0, 0, 0.6);

    /* Without this, taps double-tap-zoom and drags scroll the page instead of steering. */
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.noscript {
    position: fixed;
    inset: 0;
    display: grid;
    place-content: center;
    text-align: center;
    padding: 2rem;
}
