* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

body {
    overflow: hidden;
    background: #0a0a0a;
    font-family: 'Oswald', sans-serif;
    color: #e0e0e0;
}

#scene-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
}

canvas {
    display: block;
}

.screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hidden { display: none !important; }

/* START SCREEN */
#start-screen {
    background: radial-gradient(ellipse at center, rgba(40,0,0,0.95) 0%, rgba(5,5,5,0.98) 70%);
    backdrop-filter: blur(4px);
}

.start-content {
    text-align: center;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.game-title {
    font-family: 'Creepster', cursive;
    font-size: clamp(4rem, 12vw, 10rem);
    color: #cc1111;
    text-shadow: 
        0 0 20px rgba(200,0,0,0.6),
        0 0 60px rgba(200,0,0,0.3),
        0 4px 8px rgba(0,0,0,0.8);
    letter-spacing: 0.05em;
    line-height: 1;
    animation: titlePulse 3s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { text-shadow: 0 0 20px rgba(200,0,0,0.6), 0 0 60px rgba(200,0,0,0.3), 0 4px 8px rgba(0,0,0,0.8); }
    50% { text-shadow: 0 0 40px rgba(200,0,0,0.9), 0 0 100px rgba(200,0,0,0.5), 0 4px 8px rgba(0,0,0,0.8); }
}

.subtitle {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.8rem, 2vw, 1.2rem);
    color: #888;
    margin: 1rem 0 2.5rem;
    font-style: italic;
}

.glow-btn {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #aa0000, #660000);
    border: 2px solid #cc2222;
    padding: 0.8rem 3rem;
    cursor: pointer;
    letter-spacing: 0.15em;
    transition: all 0.3s;
    animation: btnGlow 2s ease-in-out infinite;
}

@keyframes btnGlow {
    0%, 100% { box-shadow: 0 0 15px rgba(200,0,0,0.4); }
    50% { box-shadow: 0 0 35px rgba(200,0,0,0.7); }
}

.glow-btn:hover {
    background: linear-gradient(135deg, #cc0000, #880000);
    transform: scale(1.05);
}

.controls-info {
    margin-top: 2rem;
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.65rem, 1.4vw, 0.85rem);
    color: #666;
    line-height: 2;
}

.key {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 0.15em 0.5em;
    border-radius: 3px;
    font-size: 0.9em;
    color: #aaa;
}

.highscore-display {
    margin-top: 1.5rem;
    font-family: 'Share Tech Mono', monospace;
    color: #cc8800;
    font-size: 1rem;
}

.remix-link {
    display: inline-block;
    margin-top: 2rem;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: #555;
    text-decoration: none;
    transition: color 0.3s;
}
.remix-link:hover { color: #999; }

/* HUD */
#hud {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 50;
    pointer-events: none;
}

#crosshair {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}
.cross-h, .cross-v {
    position: absolute;
    background: rgba(255,255,255,0.85);
}
.cross-h {
    width: 20px; height: 2px;
    top: -1px; left: -10px;
}
.cross-v {
    width: 2px; height: 20px;
    top: -10px; left: -1px;
}

#minimap {
    position: absolute;
    top: 16px; left: 16px;
    width: 120px; height: 120px;
    border-radius: 50%;
    border: 2px solid rgba(100,200,100,0.4);
    overflow: hidden;
    background: rgba(0,15,0,0.6);
}

#wave-indicator {
    position: absolute;
    top: 16px; left: 50%;
    transform: translateX(-50%);
    font-size: 1.6rem;
    font-weight: 700;
    color: #e0e0e0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
    letter-spacing: 0.1em;
}

.skull-icon { font-size: 1.2rem; }

#stats-top-right {
    position: absolute;
    top: 16px; right: 20px;
    text-align: right;
}

#kill-counter {
    font-size: 1.3rem;
    font-weight: 700;
    color: #e0e0e0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

#score-display {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
    color: #ccaa00;
    margin-top: 4px;
}

#combo-display {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.1rem;
    color: #ff4444;
    margin-top: 4px;
    animation: comboPulse 0.5s ease-in-out infinite;
}

@keyframes comboPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

#health-bar-container {
    position: absolute;
    bottom: 24px; left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.heart-icon { font-size: 1.3rem; }
.stamina-icon { font-size: 1rem; }

.bar-bg {
    width: 180px; height: 16px;
    background: rgba(0,0,0,0.7);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 2px;
    overflow: hidden;
}
.stamina-bg { width: 120px; height: 8px; }

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #cc0000, #ff2222);
    transition: width 0.3s;
    width: 100%;
}

.stamina-fill {
    background: linear-gradient(90deg, #ddaa00, #ffcc00);
}

.reload-fill {
    background: linear-gradient(90deg, #4488ff, #66aaff);
    width: 0%;
}

#health-text {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
    color: #ff4444;
    min-width: 30px;
}

#stamina-bar-container {
    position: absolute;
    bottom: 48px; left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#ammo-counter {
    position: absolute;
    bottom: 24px; right: 20px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.8rem;
    color: #88ccff;
    text-shadow: 0 0 10px rgba(100,180,255,0.4);
    letter-spacing: 0.05em;
}

#ammo-counter.low { color: #ff4444; animation: ammoFlash 0.5s infinite; }
@keyframes ammoFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

#reload-bar-container {
    position: absolute;
    bottom: 60px; right: 20px;
    width: 140px;
    text-align: center;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    color: #88ccff;
}
#reload-bar-container .bar-fill {
    height: 6px;
    margin-bottom: 4px;
}

#damage-vignette {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    box-shadow: inset 0 0 150px rgba(200,0,0,0);
    transition: box-shadow 0.1s;
}
#damage-vignette.active {
    box-shadow: inset 0 0 150px rgba(200,0,0,0.6);
}

#wave-announce {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Creepster', cursive;
    font-size: 4rem;
    color: #cc1111;
    text-shadow: 0 0 30px rgba(200,0,0,0.7);
    animation: waveAnnounce 2s ease-out forwards;
    pointer-events: none;
}

@keyframes waveAnnounce {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
    80% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

/* PAUSE */
#pause-screen {
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(6px);
}

.pause-content {
    text-align: center;
}

.pause-content h2 {
    font-family: 'Creepster', cursive;
    font-size: 3rem;
    color: #cc1111;
    margin-bottom: 2rem;
}

.menu-btn {
    display: block;
    width: 220px;
    margin: 0.8rem auto;
    padding: 0.7rem 1.5rem;
    font-family: 'Oswald', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #ddd;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    cursor: pointer;
    letter-spacing: 0.1em;
    transition: all 0.2s;
    pointer-events: auto;
}
.menu-btn:hover {
    background: rgba(200,0,0,0.3);
    border-color: #cc2222;
    color: #fff;
}

/* GAME OVER */
#gameover-screen {
    background: radial-gradient(ellipse at center, rgba(60,0,0,0.95) 0%, rgba(5,0,0,0.98) 70%);
}

.gameover-content {
    text-align: center;
    animation: fadeInUp 0.8s ease-out;
}

.death-title {
    font-family: 'Creepster', cursive;
    font-size: clamp(3rem, 10vw, 7rem);
    color: #cc1111;
    text-shadow: 0 0 30px rgba(200,0,0,0.7), 0 4px 12px rgba(0,0,0,0.9);
    animation: titlePulse 2s ease-in-out infinite;
}

.death-quip {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
    color: #888;
    margin: 0.8rem 0 2rem;
    font-style: italic;
}

.final-stats {
    max-width: 320px;
    margin: 0 auto 2rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.95rem;
    color: #aaa;
}

.stat-row span:last-child {
    color: #ddd;
    font-weight: 700;
}

.stat-row.highlight {
    color: #ccaa00;
    border-bottom: none;
    margin-top: 0.5rem;
}
.stat-row.highlight span:last-child {
    color: #ffcc00;
}