/* Fullscreen Mobile Web App Styles */

/* Use CSS custom properties for dynamic viewport height */
:root {
    --vh: 1vh;
}

/* Enhanced fullscreen mode */
.mobile-fullscreen {
    height: 100vh !important;
    height: calc(var(--vh, 1vh) * 100) !important;
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    top: 0 !important;
    left: 0 !important;
}

.mobile-fullscreen .game-container {
    height: 100vh !important;
    height: calc(var(--vh, 1vh) * 100) !important;
    width: 100vw !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 1 !important;
}

/* Active fullscreen state */
.fullscreen-active body {
    padding-top: 0 !important;
}

/* Hide address bar and browser UI in landscape */
@media screen and (orientation: landscape) and (max-height: 500px) {
    body {
        height: 100vh;
        height: 100dvh; /* Use dynamic viewport height if supported */
        overflow: hidden;
    }
    
    /* Force fullscreen layout */
    html {
        height: 100%;
        height: 100dvh;
        overflow: hidden;
    }
    
    /* Ensure game container uses full viewport */
    .game-container {
        height: 100vh;
        height: 100dvh;
        width: 100vw;
        position: fixed;
        top: 0;
        left: 0;
    }
    
    /* Adjust controls for landscape */
    .control-buttons {
        padding: 10px 20px;
        height: 100px;
    }
    
    .control-btn {
        width: 60px;
        height: 60px;
        font-size: 1.4rem;
    }
    
    .btn-fire {
        width: 70px;
        height: 70px;
        font-size: 1.6rem;
    }
    

    
    /* Compact HUD for landscape */
    .game-ui .hud {
        font-size: 0.9rem;
        top: 5px;
        left: 10px;
        right: 10px;
    }
    
    /* Mobile menu button adjustment */
    .mobile-menu-btn {
        top: 5px;
        right: 10px;
        width: 35px;
        height: 35px;
    }
}

/* PWA-like fullscreen behavior */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* Hide scrollbars */
body::-webkit-scrollbar {
    display: none;
}

body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Prevent bounce/overscroll */
body {
    overscroll-behavior: none;
    touch-action: manipulation;
}

/* Auto-hide address bar techniques */
@media screen and (max-width: 768px) {
    /* Initial height trick to hide address bar */
    body {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
    
    html {
        height: -webkit-fill-available;
    }
    
    /* Fallback for older browsers */
    @supports not (height: 100dvh) {
        body {
            height: calc(100vh + env(keyboard-inset-height, 0px));
        }
    }
}

/* Chrome mobile address bar hiding - SIMPLE SCROLL METHOD */
@media screen and (orientation: landscape) {
    /* Make the page taller than viewport to force scrolling */
    body {
        height: 120vh !important;
        min-height: 120vh !important;
        overflow-x: hidden;
        overflow-y: auto;
    }
    
    /* Position game container to fill visible area after scroll */
    .game-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: 1;
    }
    
    /* Add invisible spacer at bottom to enable scrolling */
    body::after {
        content: '';
        display: block;
        height: 20vh;
        width: 1px;
    }
}

/* Landscape-specific optimizations */
@media (orientation: landscape) and (max-height: 600px) {
    /* Tighter layout for landscape phones */
    .movement-controls {
        gap: 8px;
    }
    
    .fire-controls {
        gap: 8px;
    }
    
    .control-buttons {
        padding: 8px 15px;
        height: 80px;
    }
    
    .control-btn {
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
    }
    
    .btn-fire {
        width: 65px;
        height: 65px;
        font-size: 1.5rem;
    }
    

} 