/* mobile.css - ALL Mobile Overrides (Load LAST) */
/* Single source of truth for mobile styles */

/* ==========================================
   TABLET BREAKPOINT (max-width: 768px)
   ========================================== */

@media (max-width: 768px) {
    
    /* --- HUD Panel --- */
    .info-panel {
        top: 0;
        bottom: auto;
        left: 0;
        right: 0;
        transform: none;
        
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: space-around;
        align-items: center;
        
        min-width: 100%;
        max-width: 100%;
        width: 100%;
        
        padding: 0.5rem 0.75rem;
        padding-top: calc(0.5rem + env(safe-area-inset-top, 0px));
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
        
        background: linear-gradient(to bottom,
            rgba(10, 10, 20, 0.95) 0%,
            rgba(15, 15, 25, 0.9) 70%,
            rgba(20, 20, 30, 0.85) 100%);
        
        gap: 0.25rem;
    }
    
    .info-panel::before {
        top: auto;
        bottom: 0;
        height: 2px;
        background: linear-gradient(90deg,
            transparent,
            rgba(100, 150, 255, 0.5),
            transparent);
    }
    
    /* --- HUD Stat Items --- */
    
    
    
    .lives-count {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
        border-bottom: none;
        border-right: none;
        flex-direction: column;
        align-items: center;
        gap: 0.125rem;
        min-width: 0;
    }
    
    
    
    
    .lives-count .label {
        font-size: 0.55rem;
        margin-bottom: 0;
    }
    
    
    
     {
        font-size: 0.85rem;
    }
    
    .lives-count {
        font-size: 1rem;
        letter-spacing: 0.1rem;
    }
    
    /* --- Power-ups Inventory --- */
    .power-ups-inventory {
        padding: 0.25rem 0.5rem;
        border-bottom: none;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 0.25rem;
    }
    
    .power-ups-inventory .label {
        display: none;
    }
    
    .power-ups-inventory-items {
        gap: 0.25rem;
    }
    
    .power-up-item {
        width: 28px;
        height: 28px;
    }
    
    /* --- Attack Inventory --- */
    .attack-inventory {
        padding: 0.25rem 0.5rem;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 0.25rem;
        max-width: none;
    }
    
    .attack-inventory-title {
        display: none;
    }
    
    .attack-inventory-items {
        gap: 0.25rem;
        flex-wrap: nowrap;
    }
    
    .attack-item {
        width: 28px;
        height: 28px;
        min-width: 28px;
        max-width: 28px;
        flex: 0 0 28px;
    }
    
    .attack-icon {
        font-size: 1rem;
    }
    
    /* --- Status Bar --- */
    .status {
        top: calc(4rem + env(safe-area-inset-top, 0px));
        font-size: 0.7rem;
        padding: 0.375rem 0.875rem;
        max-width: 85%;
    }
    
    .status::before {
        width: 6px;
        height: 6px;
        margin-right: 0.5rem;
    }
    
    /* --- Controls (X and Theme) --- */
    .top-right-controls {
        position: fixed;
        top: calc(0.375rem + env(safe-area-inset-top, 0px));
        right: 0.5rem;
        flex-direction: row;
        gap: 0.375rem;
        z-index: 250;
    }
    
    .top-right-controls .constant-return-lobby,
    .top-right-controls .theme-toggle {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }
    
    .top-right-controls .constant-return-lobby svg,
    .top-right-controls .theme-toggle svg {
        width: 16px;
        height: 16px;
    }
    
    .constant-return-lobby,
    .theme-toggle {
        width: 38px;
        height: 38px;
        top: 1rem;
    }
    
    .theme-toggle {
        top: calc(1rem + 46px);
    }
    
    }
}

/* ==========================================
   SMALL PHONE BREAKPOINT (max-width: 480px)
   ========================================== */

@media (max-width: 480px) {
    .info-panel {
        left: 0;
        right: 0;
    }
    
    .status {
        font-size: 0.65rem;
        max-width: 80%;
    }
}

/* ==========================================
   EXTRA SMALL BREAKPOINT (max-width: 380px)
   ========================================== */

@media (max-width: 380px) {
    .info-panel {
        padding: 0.375rem 0.5rem;
        padding-top: calc(0.375rem + env(safe-area-inset-top, 0px));
    }
    
    
    
    
    .lives-count {
        padding: 0.125rem 0.375rem;
    }
    
    
    
    
    .lives-count .label {
        display: none;
    }
    
    
    
     {
        font-size: 0.75rem;
    }
    
    .lives-count {
        font-size: 0.875rem;
        letter-spacing: 0.05rem;
    }
    
    .power-up-item,
    .attack-item {
        width: 24px;
        height: 24px;
        min-width: 24px;
        max-width: 24px;
        flex: 0 0 24px;
    }
    
    .attack-icon {
        font-size: 0.85rem;
    }
    
    .status {
        top: calc(3rem + env(safe-area-inset-top, 0px));
        font-size: 0.6rem;
        padding: 0.25rem 0.625rem;
    }
    
    .top-right-controls .constant-return-lobby,
    .top-right-controls .theme-toggle {
        width: 28px;
        height: 28px;
    }
    
    .top-right-controls .constant-return-lobby svg,
    .top-right-controls .theme-toggle svg {
        width: 14px;
        height: 14px;
    }
    
    .game-notification {
        bottom: calc(8rem + env(safe-area-inset-bottom, 0px));
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

/* ==========================================
   LIGHT THEME MOBILE OVERRIDES
   ========================================== */

@media (max-width: 768px) {
    .theme-light .info-panel {
        background: linear-gradient(to bottom,
            rgba(245, 248, 255, 0.98) 0%,
            rgba(240, 243, 250, 0.95) 70%,
            rgba(235, 238, 245, 0.9) 100%);
    }
    
    .theme-light .info-panel::before {
        background: linear-gradient(90deg,
            transparent,
            rgba(100, 130, 200, 0.5),
            transparent);
    }
}

/* ==========================================
   TOP LEFT STATS - MOBILE
   ========================================== */

@media (max-width: 768px) {
    .top-left-stats {
        top: calc(0.5rem + env(safe-area-inset-top, 0px));
        left: 0.5rem;
        flex-direction: row;
        gap: 0.375rem;
    }
    
    .top-left-stats 
    .top-left-stats .flag-count {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
        border-radius: 6px;
    }
}

@media (max-width: 380px) {
    .top-left-stats {
        gap: 0.25rem;
    }
    
    .top-left-stats 
    .top-left-stats .flag-count {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
}

/* ==========================================
   BOTTOM HUD - MOBILE
   ========================================== */

@media (max-width: 768px) {
    .bottom-hud {
        bottom: calc(12rem + env(safe-area-inset-bottom, 0px));
        gap: 0.5rem;
    }
    
    .bottom-hud .attack-inventory,
    .bottom-hud .power-ups-inventory {
        padding: 0.5rem 0.625rem;
        border-radius: 8px;
    }
    
    .bottom-hud .attack-inventory-items,
    .bottom-hud .power-ups-inventory-items {
        gap: 0.25rem;
    }
}

@media (max-width: 380px) {
    .bottom-hud {
        bottom: calc(11rem + env(safe-area-inset-bottom, 0px));
        gap: 0.375rem;
    }
    
    .bottom-hud .attack-inventory,
    .bottom-hud .power-ups-inventory {
        padding: 0.375rem 0.5rem;
    }
}

/* ==========================================

/* ==========================================
   MOBILE LANDSCAPE MODE
   ========================================== */

@media (max-height: 500px) and (orientation: landscape) {
    
    /* Power-ups and attacks in single row at bottom */
    .bottom-hud {
        position: fixed;
        bottom: 4rem;
        top: auto;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        
        flex-direction: row;
        gap: 0.5rem;
        z-index: 150;
    }
    
    .bottom-hud .attack-inventory,
    .bottom-hud .power-ups-inventory {
        padding: 0.375rem 0.5rem;
        border-radius: 8px;
    }
    
    .bottom-hud .attack-inventory-items,
    .bottom-hud .power-ups-inventory-items {
        flex-direction: row;
        gap: 0.25rem;
    }
    
    .bottom-hud .attack-item,
    .bottom-hud .power-up-item {
        width: 28px;
        height: 28px;
        min-width: 28px;
    }
    
    /* Player cards - move to right side in landscape */
    .players-grid {
        position: fixed !important;
        bottom: auto !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        left: auto !important;
        right: 0.5rem !important;
        
        flex-direction: column !important;
        max-width: none !important;
        width: auto !important;
        max-height: 80% !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        
        padding: 0.375rem !important;
        gap: 0.25rem !important;
    }
    
    .players-grid .player-card {
        min-width: 80px !important;
        max-width: 80px !important;
        padding: 0.25rem !important;
    }
    
    .players-grid .player-name {
        font-size: 0.55rem !important;
    }
    
    .players-grid .progress-text,
    .players-grid .lives-text {
        font-size: 0.5rem !important;
    }
    
    /* Top left stats - more compact */
    .top-left-stats {
        top: 0.375rem;
        left: 0.375rem;
        gap: 0.25rem;
    }
    
    .top-left-stats .flag-count,
    .top-left-stats .lives-count {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
    
    /* Notifications - adjust position */
    .game-notification,
    .status {
        top: 0.375rem;
        left: 50%;
        transform: translateX(-50%);
    }
    
    /* Controls - adjust */
    .top-right-controls {
        top: 0.375rem;
        right: 0.375rem;
    }
    
    .top-right-controls .constant-return-lobby,
    .top-right-controls .theme-toggle {
        width: 28px;
        height: 28px;
    }
    
    /* Network indicator - bottom left */
    .network-indicator {
        bottom: 0.375rem;
        left: 0.375rem;
        right: auto;
    }
}
