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

body {
    overflow: hidden;
    font-family: 'Orbitron', sans-serif;
    background: #000;
}

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

/* Start Screen - CRITICAL: Must be clickable! */
#start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #0a0a15 0%, #1a0a0a 50%, #0a0a15 100%);
    pointer-events: all;
}

.zombie-silhouettes {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to top, rgba(20, 10, 10, 0.9), transparent);
    pointer-events: none;
}

.start-content {
    z-index: 10;
    text-align: center;
    pointer-events: all;
}

.game-title {
    font-family: 'Creepster', cursive;
    font-size: clamp(3rem, 12vw, 8rem);
    color: #ff3333;
    text-shadow: 
        0 0 20px rgba(255, 50, 50, 0.8),
        0 0 40px rgba(255, 50, 50, 0.6),
        0 0 60px rgba(255, 50, 50, 0.4),
        0 4px 0 #880000;
    letter-spacing: 0.1em;
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { text-shadow: 0 0 20px rgba(255, 50, 50, 0.8), 0 0 40px rgba(255, 50, 50, 0.6); }
    50% { text-shadow: 0 0 30px rgba(255, 50, 50, 1), 0 0 60px rgba(255, 50, 50, 0.8); }
}

.subtitle {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: #888;
    margin: 1rem 0 2rem;
    letter-spacing: 0.3em;
}

.instructions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    max-width: 600px;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #aaa;
    font-size: 0.9rem;
}

.key {
    background: linear-gradient(180deg, #333 0%, #222 100%);
    border: 1px solid #444;
    border-radius: 4px;
    padding: 0.3em 0.6em;
    font-family: 'Share Tech Mono', monospace;
    color: #fff;
    font-size: 0.8rem;
}

#start-button {
    position: relative;
    background: linear-gradient(180deg, #cc2222 0%, #881111 100%);
    border: 3px solid #ff4444;
    border-radius: 8px;
    padding: 1rem 3rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
    cursor: pointer;
    pointer-events: all;
    z-index: 100;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: 0 0 20px rgba(255, 50, 50, 0.5);
}

#start-button:hover {
    transform: scale(1.1);
    background: linear-gradient(180deg, #ee3333 0%, #aa2222 100%);
    box-shadow: 0 0 40px rgba(255, 50, 50, 0.8);
}

#start-button:active {
    transform: scale(1.05);
}

.button-glow {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 12px;
    background: radial-gradient(ellipse at center, rgba(255, 50, 50, 0.3) 0%, transparent 70%);
    pointer-events: none;
    animation: glowPulse 1.5s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.mobile-warning {
    margin-top: 2rem;
    color: #666;
    font-size: 0.8rem;
}

.start-footer {
    position: absolute;
    bottom: 1rem;
    color: #444;
    font-size: 0.8rem;
}

.start-footer a {
    color: #ff6666;
    text-decoration: none;
}

/* Game HUD */
#game-hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    pointer-events: none;
    transition: box-shadow 0.1s ease;
}

.hud-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
}

.health-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.health-icon {
    font-size: 1.5rem;
}

.health-container {
    width: 150px;
    height: 20px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #ff4444;
    border-radius: 4px;
    overflow: hidden;
}

.health-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(180deg, #ff4444, #aa2222);
    transition: width 0.3s ease;
}

.health-text {
    color: #fff;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
}

.wave-indicator {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #ffaa00;
    border-radius: 4px;
    padding: 0.5rem 1.5rem;
}

#wave-text {
    color: #ffaa00;
    font-size: 1.2rem;
    font-weight: 900;
    text-shadow: 0 0 10px rgba(255, 170, 0, 0.5);
}

.zombie-counter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #44ff44;
    border-radius: 4px;
    padding: 0.5rem 1rem;
}

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

#zombie-count {
    color: #44ff44;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.2rem;
}

.hud-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 1rem;
}

.rune-memory {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 1.5rem;
}

.ammo-counter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #888;
    border-radius: 4px;
    padding: 0.5rem 1rem;
}

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

#ammo-text {
    color: #fff;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.2rem;
}

.crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 2rem;
    font-weight: 100;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
}

/* Wave Announcement */
#wave-announcement {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 200;
    text-align: center;
}

.wave-announce-text {
    font-family: 'Creepster', cursive;
    font-size: 4rem;
    color: #ff4444;
    text-shadow: 0 0 20px rgba(255, 50, 50, 0.8);
    animation: waveSlam 0.5s ease-out;
}

.wave-countdown {
    font-size: 6rem;
    color: #fff;
    font-weight: 900;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    animation: countPulse 1s ease-in-out infinite;
}

@keyframes waveSlam {
    0% { transform: scale(2); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

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

/* Rune Reveal */
#rune-reveal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 200;
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 2rem 4rem;
    border-radius: 10px;
    border: 2px solid #aa44ff;
}

.rune-reveal-text {
    color: #aa44ff;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    letter-spacing: 0.1em;
}

#rune-reveal-indicator {
    font-size: 5rem;
    animation: runeGlow 1s ease-in-out infinite;
}

@keyframes runeGlow {
    0%, 100% { filter: drop-shadow(0 0 20px currentColor); }
    50% { filter: drop-shadow(0 0 40px currentColor); }
}

/* Puzzle Phase */
#puzzle-phase {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem 2rem;
    border-radius: 10px;
    border: 2px solid #ffdd44;
}

.puzzle-text {
    color: #ffdd44;
    font-size: 1.5rem;
    font-weight: 900;
}

.puzzle-hint {
    color: #888;
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* Victory Screen */
#victory-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, rgba(255, 200, 50, 0.2) 0%, rgba(0, 0, 0, 0.95) 70%);
}

.victory-portal {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(255, 220, 100, 0.8) 0%, rgba(255, 200, 50, 0.4) 40%, transparent 70%);
    animation: portalSpin 3s linear infinite;
}

@keyframes portalSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.victory-title {
    font-family: 'Creepster', cursive;
    font-size: 5rem;
    color: #ffdd44;
    text-shadow: 0 0 30px rgba(255, 220, 100, 0.8);
    z-index: 10;
}

.victory-stats {
    color: #aaa;
    text-align: center;
    margin: 2rem 0;
    z-index: 10;
}

.victory-stats p {
    margin: 0.5rem 0;
}

/* Defeat Screen */
#defeat-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, rgba(100, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.95) 70%);
    animation: defeatFade 1s ease-out;
}

@keyframes defeatFade {
    0% { background: rgba(255, 0, 0, 0.5); }
    100% { background: radial-gradient(ellipse at center, rgba(100, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.95) 70%); }
}

.defeat-title {
    font-family: 'Creepster', cursive;
    font-size: 5rem;
    color: #ff3333;
    text-shadow: 0 0 30px rgba(255, 50, 50, 0.8);
}

.defeat-stats {
    color: #888;
    text-align: center;
    margin: 2rem 0;
}

.defeat-stats p {
    margin: 0.5rem 0;
}

.play-again-btn {
    background: linear-gradient(180deg, #444 0%, #222 100%);
    border: 2px solid #666;
    border-radius: 8px;
    padding: 1rem 2rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    pointer-events: all;
}

.play-again-btn:hover {
    background: linear-gradient(180deg, #555 0%, #333 100%);
    border-color: #888;
    transform: scale(1.05);
}

/* Interaction Prompt */
#interaction-prompt {
    position: fixed;
    bottom: 30%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 150;
    background: rgba(0, 0, 0, 0.8);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    border: 1px solid #ffdd44;
    color: #ffdd44;
    font-size: 1rem;
}

.hidden {
    display: none !important;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .health-container {
        width: 100px;
    }
    
    .hud-top {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .wave-indicator {
        order: -1;
        width: 100%;
        text-align: center;
    }
    
    .instructions {
        gap: 0.5rem;
    }
    
    .instruction-item {
        font-size: 0.7rem;
    }
    
    .key {
        padding: 0.2em 0.4em;
        font-size: 0.7rem;
    }
}