/* ============================================================
   SHADOWSKINGS — SHARED MOBILE ORIENTATION FOUNDATION
   Portrait + landscape viewport support.
   Loaded after existing stylesheets.
   Desktop styles remain unchanged.
   ============================================================ */

@media (max-width: 900px) {

    html {
        min-height: 100%;
        -webkit-text-size-adjust: 100%;
    }

    body {
        min-height: 100vh;
        min-height: 100dvh;
    }

    /*
     * Shared fullscreen overlay.
     * Let the browser's current viewport dimensions control it
     * when the device rotates.
     */
    .overlay-veil {
        position: fixed;
        inset: 0;
        width: auto;
        height: auto;
        min-width: 0;
        min-height: 0;
        box-sizing: border-box;
    }

    /*
     * Keep overlay content scrollable on short landscape screens.
     * The fallback supports browsers without dynamic viewport units.
     */
    .overlay-panel {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100vh;
        max-height: 100dvh;
        min-width: 0;
        min-height: 0;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
    }
}

/*
 * Short mobile landscape screens.
 * Do not force every game panel into a fixed-height layout.
 */
@media
    (max-width: 900px)
    and (orientation: landscape)
    and (max-height: 600px) {

    .overlay-veil {
        align-items: stretch;
    }

    .overlay-panel {
        border-radius: 0;
        max-height: 100vh;
        max-height: 100dvh;
    }
}
