/* ========== MOBILE CONTROLS ========== */
.mobile-controls {
    position: fixed; 
    bottom: 2rem; 
    left: 50%; 
    transform: translateX(-50%);
    display: flex; 
    gap: 1.5rem; 
    z-index: 100;
    padding: 0 1rem;
    max-width: 100%;
}

.control-btn {
    background: rgba(0, 0, 0, 0.7); 
    color: white;
    border: 3px solid rgba(255, 255, 255, 0.3); 
    border-radius: 50%;
    width: 80px; 
    height: 80px; 
    font-size: 2rem; 
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1); 
    backdrop-filter: blur(10px);
    display: flex; 
    align-items: center; 
    justify-content: center; 
    user-select: none;
    touch-action: manipulation;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    position: relative;
}

.control-btn::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    padding: 5px;
    background: transparent;
    transition: all 0.15s;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.control-btn:active, .control-btn.pressed {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.95);
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7), inset 0 2px 8px rgba(255, 255, 255, 0.2);
}

.control-btn.pressed::before {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
}

.shoot-btn { 
    background: rgba(220, 38, 38, 0.8); 
    border-color: rgba(248, 113, 113, 0.6);
    width: 90px;
    height: 90px;
}

.shoot-btn:hover { 
    background: rgba(220, 38, 38, 0.9); 
    border-color: rgba(248, 113, 113, 0.8);
}

.shoot-btn:active, .shoot-btn.pressed { 
    background: rgba(239, 68, 68, 1); 
    border-color: rgba(248, 113, 113, 1);
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.8), inset 0 2px 8px rgba(255, 255, 255, 0.3);
}

/* ========== MOBILE & RESPONSIVE ========== */

/* Responsive title screen adjustments */
@media (max-width: 1024px) {
    .game-title { font-size: 1.5rem; }
    .player-mode-button { min-width: 120px; max-width: 140px; padding: 10px 8px; }
    .mode-buttons-container { gap: 10px; }
}

@media (max-width: 768px) {
    body { padding-top: 1rem; }
    
    /* Title screen responsive sizing */
    .game-title { font-size: 1.4rem; }
    .subtitle { font-size: 0.75rem; }
    .mode-selection-prompt { font-size: 0.85rem; }
    .player-mode-button { 
        min-width: 110px; 
        max-width: 130px;
        padding: 10px 8px;
    }
    .mode-icon { height: 32px; margin-bottom: 4px; }
    .player-avatar { font-size: 1.5rem; }
    .mode-title { font-size: 0.8rem; }
    .mode-subtitle { font-size: 0.65rem; }
    .mode-buttons-container { 
        gap: 8px; 
        margin-top: 10px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
        justify-content: flex-start;
    }
    .game-title-container { margin-bottom: 10px; }
    
    /* Enhanced mobile controls positioning */
    .mobile-controls {
        bottom: 1.5rem;
        gap: 1rem;
        width: 100%;
        justify-content: center;
        padding: 0 1rem;
    }
    
    .control-btn {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
    
    .shoot-btn {
        width: 80px;
        height: 80px;
    }
    
    .game-container { 
        padding: var(--spacing-md);
        gap: var(--spacing-lg);
        max-width: 95%;
    }
    
    .canvas-container {
        padding: var(--spacing-md);
        margin: 0;
        width: 100%;
        max-width: none;
    }
    
    #gameCanvas {
        width: 100%;
        max-width: 100%;
        height: auto;
        margin: 0;
    }
    
    h1, .awesome-heading { font-size: 2rem; }
    .title-main { font-size: 2.5rem; }
    .title-sub { font-size: 0.9rem; }
    
    .controls-info, .powerups-info { 
        margin: 0;
        padding: var(--spacing-md);
        max-width: 100%;
        width: 100%;
    }
    
    .game-info {
        flex-direction: column;
        gap: var(--spacing-md);
        padding: var(--spacing-md);
        max-width: 100%;
        width: 100%;
    }
    
    .player-stats {
        justify-content: center;
        gap: var(--spacing-lg);
    }
    
    .level-info {
        justify-content: center;
    }
    
    .controls-info h3, .powerups-info h3 { 
        font-size: 1.2rem; 
    }
    
    .controls-grid { 
        grid-template-columns: 1fr; /* Stack vertically on mobile */
        gap: 1rem; 
    }
    
    .powerup-grid { 
        grid-template-columns: 1fr; /* Stack vertically on mobile */
        gap: 0.75rem; 
    }
    
    .control-item, .powerup-item { 
        padding: 1rem; /* Consistent padding on mobile */
    }
    
    .player-icon { 
        width: 50px; 
        height: 50px; 
        font-size: 1.5rem; 
    }
    .control-description { font-size: 0.9rem; }
    .control-description strong { 
        font-size: 1.1rem; 
    }
    .key-combo { 
        font-size: 0.9rem; 
    }
    .key { 
        padding: 0.3rem 0.5rem; 
        font-size: 0.8rem; 
        min-width: 1.5rem; 
    }
    .controls-note { font-size: 0.8rem; }
    
    .panda-corner {
        bottom: 5px;
        right: 5px;
    }
    
    .panda-corner img {
        width: 50px;
        height: 50px;
    }
    
    .powerup-icon { width: 35px; height: 35px; font-size: 1rem; }
    .powerup-description { font-size: 0.9rem; }
    .powerup-note { font-size: 0.8rem; }
    
    .powerup-timer { top: 80px; padding: 0.5rem; min-width: 100px; }
    .powerup-timer-content { gap: 0.5rem; margin-bottom: 0.25rem; }
    .powerup-name { font-size: 0.7rem; }
    .powerup-time { font-size: 0.9rem; }
    .powerup-player { font-size: 0.7rem; }
    .powerup-progress { height: 3px; }
}

@media (max-width: 480px) {
    /* Extra small screens - stack buttons vertically */
    .game-title { font-size: 1.3rem; }
    .subtitle { font-size: 0.7rem; }
    .mode-selection-prompt { font-size: 0.8rem; }
    .player-mode-button { 
        min-width: 140px; 
        max-width: 180px;
        padding: 10px 8px;
    }
    .mode-icon { height: 30px; margin-bottom: 4px; }
    .player-avatar { font-size: 1.4rem; }
    .mode-title { font-size: 0.75rem; }
    .mode-subtitle { font-size: 0.6rem; }
    .mode-buttons-container { 
        flex-direction: row; 
        align-items: center;
        gap: 8px; 
        margin-top: 8px; 
    }
    .game-title-container { margin-bottom: 8px; }
    
    .mobile-controls {
        bottom: 1rem;
        gap: 0.75rem;
        padding: 0 1rem;
    }
    
    .control-btn {
        width: 65px;
        height: 65px;
        font-size: 1.6rem;
    }
    
    .shoot-btn {
        width: 75px;
        height: 75px;
    }
    
    .game-container {
        padding: var(--spacing-sm);
    }
    
    .canvas-container {
        padding: var(--spacing-sm);
    }
    
    .controls-info, .powerups-info {
        padding: var(--spacing-sm);
    }
    
    .panda-corner {
        display: none; /* Hide panda on very small screens */
    }
    
    .title-main { 
        font-size: 2rem; 
    }
    
    .title-sub { 
        font-size: 0.8rem; 
    }
    
    #actionButton {
        padding: 15px 30px;
        font-size: 18px;
        min-width: 160px;
    }
}

@media (min-width: 768px) { 
    .mobile-controls { display: none; } 
}