/* Mobile Flying Fox Game - Main Styles */

/* Rotate Device Screen Styles */
.rotate-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.rotate-content {
    text-align: center;
    padding: 2rem;
    max-width: 90%;
}

.rotate-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    animation: rotatePhone 2s ease-in-out infinite;
}

.rotate-content h2 {
    font-size: 2rem;
    margin: 0 0 1rem 0;
    font-weight: 300;
}

.rotate-content p {
    font-size: 1.1rem;
    margin: 0 0 2rem 0;
    opacity: 0.9;
    line-height: 1.5;
}

.rotate-animation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    font-size: 1.5rem;
    margin-top: 1rem;
}

.phone-portrait {
    transform: rotate(0deg);
    transition: transform 0.5s ease;
}

.phone-landscape {
    transform: rotate(90deg);
    transition: transform 0.5s ease;
}

.arrow {
    animation: pulse 1.5s ease-in-out infinite;
    font-size: 1.2rem;
}

@keyframes rotatePhone {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-10deg) scale(1.1); }
    50% { transform: rotate(90deg) scale(1.2); }
    75% { transform: rotate(80deg) scale(1.1); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

/* Show rotate screen only in portrait mode */
@media (orientation: portrait) {
    .rotate-screen {
        display: flex !important;
    }
    
    #game-container,
    #loading-screen,
    #main-menu,
    #game-ui,
    #game-over,
    #pause-screen {
        display: none !important;
    }
}

/* Hide rotate screen in landscape mode */
@media (orientation: landscape) {
    .rotate-screen {
        display: none !important;
    }
}

/* CSS Variables */
:root {
    /* Colors */
    --primary-color: #ff6b35;
    --secondary-color: #d84315;
    --accent-color: #ff8a50;
    --background-primary: #0a0f1c;
    --background-secondary: #1a1f2e;
    --background-gradient: linear-gradient(135deg, #0a0f1c 0%, #1a1f2e 50%, #2a2f3e 100%);
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-accent: #ffd700;
    
    /* UI Colors */
    --button-primary: #ff6b35;
    --button-secondary: #2c3e50;
    --button-accent: #e74c3c;
    --overlay-bg: rgba(0, 0, 0, 0.85);
    
    /* Shadows */
    --shadow-light: 0 2px 8px rgba(255, 107, 53, 0.3);
    --shadow-medium: 0 4px 16px rgba(255, 107, 53, 0.4);
    --shadow-heavy: 0 8px 32px rgba(255, 107, 53, 0.5);
    
    /* Border Radius */
    --radius-small: 8px;
    --radius-medium: 16px;
    --radius-large: 24px;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Typography */
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-md: 16px;
    --font-size-lg: 20px;
    --font-size-xl: 24px;
    --font-size-xxl: 32px;
    
    /* Animation */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: var(--font-family);
    background: var(--background-gradient);
    color: var(--text-primary);
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
}

/* Mobile Optimizations */
body {
    position: fixed;
    width: 100%;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none;
}

/* Game Container */
.game-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--background-gradient);
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    visibility: visible;
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    color: var(--text-primary);
}

.loading-fox {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    animation: foxFloat 2s ease-in-out infinite;
}

.loading-text {
    font-size: var(--font-size-xxl);
    font-weight: bold;
    margin-bottom: var(--spacing-lg);
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loading-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: var(--spacing-lg) auto;
    overflow: hidden;
}

.loading-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
    animation: loadingProgress 2s ease-in-out infinite;
}

.loading-tips {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-top: var(--spacing-md);
}

/* Animations */
@keyframes foxFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes loadingProgress {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(0%); }
    100% { transform: translateX(100%); }
}

/* Responsive Design */
@media screen and (max-width: 480px) {
    :root {
        --font-size-xxl: 28px;
        --font-size-xl: 20px;
        --font-size-lg: 18px;
    }
    
    .loading-fox {
        font-size: 3rem;
    }
}

@media screen and (max-height: 600px) {
    .loading-content {
        transform: scale(0.9);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --background-primary: #000;
        --background-secondary: #111;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}