/*
 * The game's one typeface, self-hosted.
 *
 * Everything on screen is drawn by Phaser into a canvas, and canvas text takes
 * whatever the font stack resolves to *at the moment the text is drawn* — so a
 * face that arrives late is not re-flowed, it simply never appears. `block`
 * tells the browser to hold text rather than paint a fallback it can never take
 * back, and `BootScene` waits for the face before it starts the menu.
 *
 * The weight range is deliberate for a *single-weight* file: it tells the
 * browser this one face answers every weight the UI asks for, bold included.
 * Declaring it as 400 alone would instead invite synthetic bold, which each
 * engine fakes differently — a smeared double-strike in Safari and Firefox,
 * almost nothing in Chrome — so the same screen would carry a different weight
 * per browser. One file, one weight, everywhere.
 */
@font-face {
    font-family: "Fredoka";
    src: url("/assets/Fonts/fredoka.woff2") format("woff2");
    font-weight: 300 700;
    font-style: normal;
    font-display: block;
}

/*
 * No ground colour here on purpose: it is a property of the active theme
 * preset, and `applyPageTheme()` in game/main.ts writes it (plus color-scheme
 * and the theme-color meta) at boot. The value below is only what shows for the
 * one frame before the module runs.
 */
html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: #ffffff;
    font-family: Fredoka, "Helvetica Neue", Helvetica, Arial, sans-serif;
    overscroll-behavior: none;
}

body {
    /* No page scroll / pull-to-refresh fighting the canvas on mobile. */
    position: fixed;
    inset: 0;
    overflow: hidden;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

#app {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/*
 * Phaser's CENTER_BOTH centres the canvas inside its parent by setting margins,
 * so the parent needs a real size. A shrink-to-fit div makes that maths drift.
 */
#game-container {
    position: absolute;
    inset: 0;
}

#game-container canvas {
    display: block;
    /* Keep FIT's downscale smooth rather than nearest-neighbour. */
    image-rendering: auto;
}
