/* =========================================
   1. BASE & RESET
   ========================================= */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body { 
    overflow: hidden; /* Prevents scrolling */
    font-family: 'Courier New', Courier, monospace; 
    background-color: #050505; 
    color: white; 
}

#game-canvas { 
    width: 100vw; 
    height: 100vh; 
    display: block; 
}

/* =========================================
   2. FLASH OVERLAYS (Damage, Pickups)
   ========================================= */
#damage-flash, 
#powerup-flash, 
#ammo-flash, 
#armor-flash { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh; 
    pointer-events: none; /* Lets clicks pass through to the game */
    z-index: 5; 
    opacity: 0; 
    transition: opacity 0.2s; 
}

#damage-flash { background: rgba(255, 0, 0, 0.4); }
#powerup-flash { background: rgba(0, 255, 204, 0.3); }
#ammo-flash { background: rgba(0, 255, 255, 0.2); } 
#armor-flash { background: rgba(0, 100, 255, 0.4); }

/* =========================================
   3. TACTICAL HUD (Glassmorphism)
   ========================================= */
#hud { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    pointer-events: none; 
    z-index: 10; 
}

#crosshair { 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    font-size: 24px; 
    color: #00ffcc; 
    font-weight: bold; 
    text-shadow: 0 0 5px #00ffcc;
}

.glass-panel {
    position: absolute;
    padding: 20px;
    background: rgba(5, 15, 10, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 255, 204, 0.4);
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.1);
}

.top-left { top: 20px; left: 20px; width: 340px; }
.bottom-left { bottom: 20px; left: 20px; width: 420px; }
.top-right { top: 20px; right: 20px; width: 280px; text-align: right; }

#minimap { 
    position: absolute; 
    bottom: 20px; 
    right: 20px; 
    background: rgba(0, 10, 5, 0.8); 
    border: 2px solid #00ffcc; 
    border-radius: 5px; 
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.2); 
}

/* =========================================
   4. HUD ELEMENTS (Avatar, Bars, Texts)
   ========================================= */
.avatar-container { 
    display: flex; 
    align-items: center; 
    margin-bottom: 15px; 
    padding-bottom: 15px; 
    border-bottom: 1px solid rgba(0, 255, 204, 0.3); 
}

.avatar-img { 
    width: 60px; 
    height: 60px; 
    border: 2px solid #00ffcc; 
    border-radius: 5px; 
    background: #000; 
    margin-right: 15px; 
}

.neon-text { color: #00ffcc; font-weight: bold; font-size: 1.2rem; text-shadow: 0 0 8px #00ffcc; }
.sub-text { color: #ff9900; font-size: 0.8rem; }
.kill-text { color: #ff0055; margin-left: 10px; font-size: 1.5rem; font-weight: bold; text-shadow: 0 0 10px #ff0055; }
.sprint-ready { color: #ffff00; font-size: 1rem; margin-top: 5px; font-weight: bold; }

.status-row { 
    display: flex; 
    align-items: center; 
    margin-bottom: 10px; 
    font-weight: bold; 
    font-size: 0.9rem; 
}

.status-row > span:first-child { 
    width: 60px; 
    color: #00ffcc; 
}

/* Fixes the hearts and armor stacking bug */
#hearts-container, #armor-container { 
    width: auto !important; 
    display: flex; 
    flex-direction: row; 
    align-items: center; 
    letter-spacing: 2px; 
}

.bar-bg { 
    flex-grow: 1; 
    height: 12px; 
    background: rgba(0,0,0,0.8); 
    border: 1px solid #444; 
    margin-right: 10px; 
    border-radius: 2px; 
    overflow: hidden; 
}

.bar-fill { height: 100%; transition: width 0.15s ease-out; }
.sta { background: #ffff00; width: 100%; }
.ammo { background: #00ffff; width: 100%; }
#ammo-text { color: #00ffff; width: 60px; text-align: right; }

#timer-display { 
    font-size: 3rem; 
    color: #00ffcc; 
    margin-bottom: 5px; 
    font-weight: bold; 
    text-shadow: 0 0 15px rgba(0, 255, 204, 0.5); 
}

#buff-display { font-size: 1.2rem; color: #ff9900; font-weight: bold; }
#action-log { margin-top: 5px; color: #ff9900; font-size: 0.9rem; }

/* =========================================
   5. WEAPON WHEEL
   ========================================= */
.weapon-wheel { 
    margin-top: 15px; 
    border-top: 1px solid rgba(0, 255, 204, 0.3); 
    padding-top: 15px; 
}

.weapon-wheel div { 
    margin-bottom: 5px; 
    font-size: 1.1rem; 
}

.wpn-active { 
    color: #ff0055 !important; 
    font-weight: bold; 
    text-shadow: 0 0 10px #ff0055; 
    transform: scale(1.05); 
    transition: 0.2s; 
}

.wpn-inactive { 
    color: #555 !important; 
    transition: 0.2s; 
}

/* =========================================
   6. UI SCREENS (Start & End/Death)
   ========================================= */
#start-screen { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(5, 5, 5, 0.95); 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    z-index: 100; 
    cursor: pointer; 
    text-shadow: 0 0 10px #00ffcc; 
}

.controls-box { 
    background: rgba(0, 255, 204, 0.1); 
    padding: 20px; 
    border: 1px solid #00ffcc; 
    border-radius: 8px; 
    margin-top: 20px; 
    line-height: 1.8; 
    text-align: center; 
}

.instruction-link {
    margin-top: 16px;
    padding: 12px 18px;
    border: 1px solid #00ffcc;
    border-radius: 6px;
    color: #00ffcc;
    text-decoration: none;
    font-weight: bold;
    background: rgba(0, 255, 204, 0.1);
    box-shadow: 0 0 12px rgba(0, 255, 204, 0.2);
    transition: all 0.2s ease;
}

.instruction-link:hover {
    transform: translateY(-2px);
    color: #050505;
    background: #00ffcc;
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.45);
}

#rest-day-screen { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh; 
    background: rgba(10, 5, 10, 0.98); 
    display: none; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    text-align: center; 
    z-index: 50; 
}

#main-title { font-size: 4rem; color: #00ffcc; margin-bottom: 10px; }
#subtitle { font-size: 1.5rem; color: #aaa; margin-bottom: 40px; }

#dayle-message { 
    background: rgba(255, 0, 85, 0.1); 
    border: 3px solid #ff0055; 
    padding: 40px; 
    border-radius: 10px; 
    max-width: 700px; 
    box-shadow: 0 0 50px rgba(255, 0, 85, 0.3); 
}

.alert-header { 
    background: #ff0055; 
    color: white; 
    padding: 10px; 
    font-size: 1.8rem; 
    font-weight: bold; 
    margin: -40px -40px 20px -40px; 
    border-radius: 5px 5px 0 0; 
    text-transform: uppercase; 
}

#dayle-message p { font-size: 1.3rem; margin-bottom: 15px; line-height: 1.6; }
.highlight-text { color: #ff0055; font-size: 1.8rem; font-weight: bold; margin-top: 30px; }

/* =========================================
   7. ANIMATIONS
   ========================================= */
@keyframes flash { 
    0% { opacity: 1; } 
    50% { opacity: 0.3; } 
    100% { opacity: 1; } 
}

.warning, .critical-text { 
    animation: flash 1s infinite; 
    color: #ff0055; 
}