/* Mobile-First Responsive Design */
/* Consolidated from: mobile.css, responsive.css */

/* Mobile Controls */
.mobile-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
    pointer-events: auto;
    z-index: var(--z-fixed);
    display: none; /* Hidden by default, shown via JavaScript based on device */
}

/* Mobile Touch Controls */
.mobile-joystick {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 120px;
    height: 120px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    backdrop-filter: blur(10px);
}

.mobile-buttons {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-button {
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 18px;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}

.mobile-button:active {
    background: rgba(0, 212, 255, 0.2);
    border-color: #00d4ff;
    transform: scale(0.95);
}

/* Mobile Layout Adjustments */
@media (max-width: 768px) {
    /* Hide desktop-only elements */
    .desktop-only {
        display: none !important;
    }
    
    /* Show mobile controls */
    .mobile-controls {
        display: block;
    }
    
    /* Adjust game viewport */
    #game-viewport {
        height: calc(100vh - 200px);
    }
    
    /* Mobile-friendly UI elements */
    .ui-overlay {
        padding: var(--spacing-sm);
    }
    
    .modal {
        width: 95%;
        max-width: 400px;
        margin: var(--spacing-md);
    }
    
    /* Touch-friendly button sizes */
    button, .button {
        min-height: 44px;
        min-width: 44px;
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    /* Mobile navigation */
    .nav-menu {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(0, 0, 0, 0.9);
        backdrop-filter: blur(20px);
        border-top: 1px solid var(--border-color);
        padding: var(--spacing-sm);
        display: flex;
        justify-content: space-around;
        z-index: var(--z-fixed);
    }
    
    .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: var(--spacing-sm);
        color: var(--text-primary);
        text-decoration: none;
        font-size: 12px;
        transition: color 0.2s ease;
    }
    
    .nav-item:hover,
    .nav-item.active {
        color: #00d4ff;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .mobile-joystick {
        width: 100px;
        height: 100px;
        bottom: 15px;
        left: 15px;
    }
    
    .mobile-button {
        width: 50px;
        height: 50px;
        font-size: 16px;
    }
    
    .mobile-buttons {
        bottom: 15px;
        right: 15px;
        gap: 8px;
    }
    
    .mobile-controls {
        height: 180px;
    }
    
    #game-viewport {
        height: calc(100vh - 180px);
    }
    
    /* Smaller text for mobile */
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.125rem; }
    
    /* Compact UI elements */
    .modal {
        margin: var(--spacing-sm);
        padding: var(--spacing-md);
    }
    
    .button {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 14px;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .mobile-controls {
        height: 120px;
    }
    
    #game-viewport {
        height: calc(100vh - 120px);
    }
    
    .mobile-joystick {
        width: 80px;
        height: 80px;
        bottom: 10px;
        left: 10px;
    }
    
    .mobile-button {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .mobile-buttons {
        bottom: 10px;
        right: 10px;
        gap: 6px;
    }
}

/* Hide mobile controls on desktop devices with fine pointer */
@media (pointer: fine) and (min-width: 769px) {
    .mobile-controls {
        display: none !important;
    }
    
    .mobile-only {
        display: none !important;
    }
}

/* Orientation Overlay */
#orientation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: var(--z-max);
    color: var(--text-primary);
    text-align: center;
    padding: var(--spacing-lg);
}

#orientation-overlay.show {
    display: flex;
}

.orientation-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-lg);
    animation: mystical-glow 2s ease-in-out infinite;
}

.orientation-text {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-md);
}

.orientation-subtext {
    font-size: 1rem;
    opacity: 0.8;
}

/* Show orientation overlay on mobile landscape */
@media (max-width: 768px) and (orientation: landscape) {
    #orientation-overlay {
        display: flex;
    }
}