html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.87);
    background-color: #0f0f0f;
    /* The game owns every touch: no page scroll, pull-to-refresh, pinch zoom, text selection or long-press menu. */
    touch-action: none;
    overscroll-behavior: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

#app {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%; /* fallback */
    height: 100dvh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container, #game-container canvas { touch-action: none; }

/* Read by src/game/ui/Device.ts: the browser resolves env(safe-area-inset-*) into these paddings. */
#safe-probe {
    position: fixed;
    top: 0; left: 0;
    width: 0; height: 0;
    visibility: hidden;
    pointer-events: none;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}

/* Shown by Device.ts on touch devices held in portrait. The run underneath is paused, not restarted. */
#rotate {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: center;
    background: #14171d;
    font-family: 'Trebuchet MS', Verdana, sans-serif;
    font-weight: bold;
}
body.portrait-lock #rotate { display: flex; }
.rotate-icon { font-size: 84px; color: #ffd23f; animation: rot 2.4s ease-in-out infinite; }
.rotate-title { font-size: 26px; color: #ffffff; letter-spacing: 1px; }
.rotate-sub { font-size: 16px; color: #9fb3c8; font-weight: normal; padding: 0 24px; }
@keyframes rot { 0%, 20% { transform: rotate(0deg); } 70%, 100% { transform: rotate(-90deg); } }

/* Shown until the game's first frame (SDK init + save load happen before Phaser starts). */
#boot {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7c8c;
    font: bold 18px monospace;
    letter-spacing: 2px;
    pointer-events: none;
}

/* Kenney Future (CC0): titles, big numbers and button labels. Small supporting text stays in a plain readable font. */
@font-face { font-family: 'Kenney Future'; src: url('assets/fonts/KenneyFuture.ttf') format('truetype'); font-display: block; }
