/* iOS/mobile hardening: a fixed, non-scrollable page. position:fixed +
   overflow:hidden + touch-action:none together kill pull-to-refresh, the
   rubber-band bounce, double-tap zoom and scroll gestures reaching the page;
   user-select/touch-callout suppress the long-press text/save menus that
   would interrupt a held fire button. */
html, body {
    position: fixed;
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    color: rgba(255, 255, 255, 0.87);
    background-color: #0e1016;
}

/* The iPhone safe-area insets (notch, home indicator), published as custom
   properties so the game's touch overlay can read them via getComputedStyle
   and keep the on-screen controls clear of the hardware. */
:root {
    --sai-t: env(safe-area-inset-top, 0px);
    --sai-r: env(safe-area-inset-right, 0px);
    --sai-b: env(safe-area-inset-bottom, 0px);
    --sai-l: env(safe-area-inset-left, 0px);
}

#app {
    width: 100%;
    height: 100vh;
    height: 100dvh; /* iOS Safari: track the real viewport as the URL bar collapses */
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Landscape-only lock, the only way that works on iOS (no Screen Orientation
   API, manifest orientation ignored): in portrait, cover the game with a
   full-screen prompt. The game keeps running underneath; rotating back
   removes the overlay with no game code involved. */
#rotate-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10;
    background: #0e1016;
    color: #ffb83c;
    align-items: center;
    justify-content: center;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 4px;
}

@media (orientation: portrait) {
    #rotate-overlay {
        display: flex;
    }
}
