/* ═══════════════════════════════════════════════════════════════════════════════
   ANHAD — Universal Mobile Scaling Lock
   Loaded on ALL pages to guarantee fixed layout regardless of:
   - Android Display Size (Small → Huge)
   - iOS Dynamic Type / Accessibility Text Size
   - Pinch-to-zoom attempts
   - Double-tap zoom
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Prevent rotation on mobile devices — CSS fallback when JS lock unavailable */
@media screen and (orientation: landscape) and (max-width: 932px) and (max-height: 500px) {
    body {
        transform: rotate(-90deg);
        transform-origin: center center;
        width: 100dvh;
        height: 100dvw;
        overflow: hidden;
        position: fixed;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Message overlay for landscape on phones */
    body::before {
        content: "Please rotate your device to portrait mode";
        position: fixed;
        inset: 0;
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
        color: #fff;
        font-family: system-ui, -apple-system, sans-serif;
        font-size: 18px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 40px;
        z-index: 999999;
    }
    
    body::after {
        content: "☬";
        position: fixed;
        top: 30%;
        left: 50%;
        transform: translateX(-50%);
        font-size: 60px;
        color: #ffd700;
        z-index: 9999999;
    }
}

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

body {
    overflow-x: hidden;
}

html {
    font-size: 16px !important;
    -webkit-text-size-adjust: 100% !important;
    -moz-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
    touch-action: pan-y !important;
}

/* Prevent any element from scaling beyond bounds */
* {
    max-width: 100%;
    box-sizing: border-box;
}

/* Lock keyboard and sheet overlays to fixed positioning */
.keyboard-overlay,
.keyboard-sheet,
.settings-overlay,
.settings-sheet,
.sheet,
.sheet-overlay,
.bottom-sheet {
    -webkit-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
}
