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

body {
    overflow: hidden;
    background: #0a0a0a;
    font-family: 'Share Tech Mono', monospace;
    cursor: none;
    user-select: none;
}

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

#scene-container canvas {
    display: block;
}

/* Film grain */
#film-grain {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 2;
    pointer-events: none;
    opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    animation: grain 0.3s steps(4) infinite;
}

@keyframes grain {
    0% { transform: translate(0,0); }
    25% { transform: translate(-2px, 2px); }
    50% { transform: translate(2px, -1px); }
    75% { transform: translate(-1px, -2px); }
    100% { transform: translate(1px, 1px); }
}

/* Damage vignette */
#damage-vignette {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(180,0,0,0.8) 100%);
    transition: opacity 0.1s ease-in;
}

#damage-vignette.flash {
    opacity: 1;
    transition: opacity 0.05s ease-in;
}

/* Crosshair */
#crosshair {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    pointer-events: none;
    display: none;
}

#crosshair .ch-h, #crosshair .ch-v {
    position: absolute;
    background: rgba(255,255,255,0.85);
}

#crosshair .ch-h {
    width: 20px; height: 2px;
    top: -1px; left: -10px;
}

#crosshair .ch-v {
    width: 2px; height: 20px;
    top: -10px; left: -1px;
}

/* Zombie direction indicators */
#zombie-indicators {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 9;
    pointer-events: none;
}

.zombie-indicator {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 14px solid rgba(255, 40, 40, 0.8);
    filter: drop-shadow(0 0 4px rgba(255,0,0,0.6));
}

/* Damage numbers */
#damage-numbers {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 11;
    pointer-events: none;
}

.damage-number {
    position: absolute;
    font-family: 'Creepster', cursive;
    font-size: 20px;
    color: #ff4444;
    text-shadow: 0 0 6px rgba(255,0,0,0.5), 1px 1px 2px #000;
    transform: translate(-50%, -50%);
    font-weight: bold;
}

.damage-number.headshot-dmg {
    font-size: 28px;
    color: #ffcc00;
    text-shadow: 0 0 10px rgba(255,200,0,0.6), 1px 1px 2px #000;
}

/* HUD */
#hud {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 8;
    pointer-events: none;
    display: none;
}

#hud-top {
    position: absolute;
    top: 16px;
    left: 0; right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 24px;
}

#wave-counter {
    font-family: 'Creepster', cursive;
    font-size: 28px;
    color: #e8e8e8;
    text-shadow: 0 0 10px rgba(200,0,0,0.5), 2px 2px 4px rgba(0,0,0,0.8);
    background: rgba(0,0,0,0.4);
    padding: 4px 16px;
    border-radius: 4px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

#score-display {
    font-size: 14px;
    color: #aaa;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
    background: rgba(0,0,0,0.4);
    padding: 6px 14px;
    border-radius: 4px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 44px;
    letter-spacing: 1px;
}

#kill-counter {
    font-size: 18px;
    color: #ccc;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
    background: rgba(0,0,0,0.4);
    padding: 6px 14px;
    border-radius: 4px;
    position: absolute;
    right: 24px;
}

#hud-bottom {
    position: absolute;
    bottom: 24px;
    left: 0; right: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 24px;
}

#health-section {
    background: rgba(0,0,0,0.5);
    padding: 10px 16px;
    border-radius: 6px;
    min-width: 200px;
}

#health-label, #stamina-label {
    font-size: 11px;
    color: #888;
    letter-spacing: 2px;
    margin-bottom: 3px;
}

#stamina-label {
    margin-top: 6px;
}

#health-bar-bg, #stamina-bar-bg {
    width: 180px;
    height: 12px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 2px;
    overflow: hidden;
}

#stamina-bar-bg {
    height: 8px;
}

#health-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #cc2222, #44cc22);
    transition: width 0.2s;
}

#stamina-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #2266cc, #22cccc);
    transition: width 0.15s;
}

#health-section.critical #health-bar {
    animation: pulse-red 0.5s ease-in-out infinite;
}

@keyframes pulse-red {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Bottom center HUD */
#bottom-center-hud {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: rgba(0,0,0,0.4);
    padding: 8px 16px;
    border-radius: 6px;
}

#weapon-name {
    font-size: 14px;
    color: #ccc;
    letter-spacing: 2px;
}

#grenade-count {
    font-size: 13px;
    color: #ff8844;
    letter-spacing: 1px;
}

#ammo-section {
    background: rgba(0,0,0,0.5);
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 32px;
    color: #e8e8e8;
    text-shadow: 0 0 8px rgba(255,200,50,0.3);
    font-family: 'Share Tech Mono', monospace;
    text-align: right;
    position: relative;
    transition: color 0.2s, text-shadow 0.2s;
}

#ammo-section.low-ammo {
    color: #ffaa33;
    text-shadow: 0 0 12px rgba(255,170,50,0.5);
    animation: ammo-pulse 0.8s ease-in-out infinite;
}

#ammo-section.no-ammo {
    color: #ff3333;
    text-shadow: 0 0 15px rgba(255,50,50,0.6);
    animation: ammo-pulse 0.4s ease-in-out infinite;
}

@keyframes ammo-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#ammo-current {
    font-weight: bold;
    font-size: 38px;
}

#reload-indicator {
    display: none;
    font-size: 14px;
    color: #ffcc00;
    letter-spacing: 2px;
    animation: blink 0.5s ease-in-out infinite;
    margin-top: 2px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

#wave-announcement {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Creepster', cursive;
    font-size: 56px;
    color: #cc2222;
    text-shadow: 0 0 30px rgba(200,0,0,0.6), 3px 3px 6px rgba(0,0,0,0.9);
    opacity: 0;
    transition: opacity 0.3s;
    text-align: center;
    white-space: pre-line;
    line-height: 1.2;
}

#headshot-text {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Creepster', cursive;
    font-size: 36px;
    color: #ffcc00;
    text-shadow: 0 0 15px rgba(255,200,0,0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
}

#kill-streak-text {
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translate(-50%, 0);
    font-family: 'Creepster', cursive;
    font-size: 42px;
    color: #ff6600;
    text-shadow: 0 0 20px rgba(255,100,0,0.7), 2px 2px 4px rgba(0,0,0,0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s, transform 0.4s;
}

#weapon-swap-text {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, 0);
    font-family: 'Share Tech Mono', monospace;
    font-size: 18px;
    color: #aaa;
    text-shadow: 0 0 8px rgba(150,150,150,0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    letter-spacing: 2px;
}

#pickup-text {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, 0);
    font-family: 'Share Tech Mono', monospace;
    font-size: 22px;
    color: #44ff44;
    text-shadow: 0 0 10px rgba(50,255,50,0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    letter-spacing: 2px;
}

/* Minimap */
#minimap-container {
    position: fixed;
    top: 80px;
    left: 16px;
    z-index: 12;
    pointer-events: none;
    border: 1px solid rgba(100,100,100,0.4);
    border-radius: 4px;
    overflow: hidden;
    background: rgba(0,0,0,0.5);
}

#minimap-canvas {
    display: block;
}

#minimap-label {
    text-align: center;
    font-size: 9px;
    color: #555;
    padding: 2px 0;
    letter-spacing: 1px;
}

/* FPS Counter */
#fps-counter {
    position: fixed;
    top: 4px;
    left: 4px;
    z-index: 15;
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    color: #44ff44;
    background: rgba(0,0,0,0.6);
    padding: 2px 6px;
    border-radius: 2px;
    pointer-events: none;
}

/* START SCREEN */
#start-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, #1a1510 0%, #0a0804 60%, #000 100%);
    cursor: default;
}

#start-content {
    text-align: center;
}

#title {
    font-family: 'Creepster', cursive;
    font-size: 96px;
    color: #cc1111;
    text-shadow: 0 0 40px rgba(200,0,0,0.5), 0 4px 8px rgba(0,0,0,0.8), 0 0 80px rgba(150,0,0,0.3);
    letter-spacing: 6px;
    margin-bottom: 12px;
    animation: title-pulse 3s ease-in-out infinite;
}

@keyframes title-pulse {
    0%, 100% { text-shadow: 0 0 40px rgba(200,0,0,0.5), 0 4px 8px rgba(0,0,0,0.8); }
    50% { text-shadow: 0 0 60px rgba(200,0,0,0.7), 0 4px 8px rgba(0,0,0,0.8), 0 0 100px rgba(150,0,0,0.4); }
}

#subtitle {
    font-family: 'Special Elite', cursive;
    font-size: 22px;
    color: #777;
    margin-bottom: 12px;
}

#menu-best {
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    color: #ffcc44;
    margin-bottom: 24px;
    letter-spacing: 1px;
    min-height: 20px;
}

#start-btn {
    font-family: 'Creepster', cursive;
    font-size: 36px;
    color: #eee;
    background: rgba(180,20,20,0.7);
    border: 2px solid #cc3333;
    padding: 16px 48px;
    cursor: pointer;
    border-radius: 4px;
    letter-spacing: 4px;
    transition: all 0.2s;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

#start-btn:hover {
    background: rgba(200,30,30,0.9);
    box-shadow: 0 0 30px rgba(200,0,0,0.5);
    transform: scale(1.05);
}

#controls-legend {
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    color: #555;
    margin-top: 28px;
    letter-spacing: 1px;
    line-height: 1.8;
}

#settings-section {
    margin-top: 20px;
    padding: 12px 20px;
    display: inline-block;
}

#sensitivity-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: default;
}

#sensitivity-slider {
    width: 120px;
    cursor: pointer;
    accent-color: #cc3333;
}

#sensitivity-value {
    color: #cc5555;
    min-width: 24px;
    display: inline-block;
}

#start-footer {
    margin-top: 36px;
}

#start-footer a {
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    color: #444;
    text-decoration: none;
}

#start-footer a:hover {
    color: #888;
}

/* DEATH SCREEN */
#death-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10,0,0,0.92);
    cursor: default;
}

#death-content {
    text-align: center;
    max-width: 500px;
}

#death-title {
    font-family: 'Creepster', cursive;
    font-size: 100px;
    color: #cc0000;
    text-shadow: 0 0 50px rgba(200,0,0,0.7), 0 0 100px rgba(150,0,0,0.4);
    animation: death-shake 0.6s ease-out;
    margin-bottom: 10px;
}

@keyframes death-shake {
    0% { transform: translate(0,0) scale(0.8); opacity: 0; }
    20% { transform: translate(-8px, 4px) scale(1.05); opacity: 1; }
    40% { transform: translate(6px, -3px) scale(1.02); }
    60% { transform: translate(-4px, 2px) scale(1.01); }
    80% { transform: translate(2px, -1px) scale(1); }
    100% { transform: translate(0,0) scale(1); }
}

#new-record {
    font-family: 'Creepster', cursive;
    font-size: 28px;
    color: #ffcc00;
    text-shadow: 0 0 20px rgba(255,200,0,0.5);
    animation: record-pulse 1s ease-in-out infinite;
    margin-bottom: 10px;
}

@keyframes record-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

#death-stats {
    background: rgba(0,0,0,0.6);
    padding: 16px 24px;
    border-radius: 6px;
    margin-bottom: 10px;
    border: 1px solid #331111;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid rgba(100,30,30,0.3);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    color: #888;
    font-size: 14px;
    letter-spacing: 1px;
}

.stat-value {
    color: #e8e8e8;
    font-size: 16px;
    font-weight: bold;
}

#personal-best {
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    color: #888;
    margin-bottom: 10px;
}

#name-input-section {
    margin-bottom: 16px;
}

#player-name-input {
    font-family: 'Share Tech Mono', monospace;
    font-size: 18px;
    background: rgba(0,0,0,0.7);
    border: 1px solid #553333;
    color: #eee;
    padding: 8px 16px;
    border-radius: 4px;
    outline: none;
    text-align: center;
    width: 200px;
}

#player-name-input:focus {
    border-color: #cc3333;
}

#submit-score-btn {
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    background: rgba(180,30,30,0.7);
    border: 1px solid #cc3333;
    color: #eee;
    padding: 8px 20px;
    cursor: pointer;
    border-radius: 4px;
    margin-left: 8px;
}

#leaderboard-section {
    margin-bottom: 16px;
}

#leaderboard-section h2 {
    font-family: 'Creepster', cursive;
    font-size: 24px;
    color: #cc5555;
    margin-bottom: 10px;
}

#leaderboard-list {
    background: rgba(0,0,0,0.5);
    border-radius: 4px;
    padding: 8px;
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid #221111;
}

.lb-entry {
    display: flex;
    justify-content: space-between;
    padding: 4px 8px;
    font-size: 13px;
    color: #aaa;
    border-bottom: 1px solid rgba(60,20,20,0.3);
}

.lb-entry:first-child {
    color: #ffcc00;
}

.lb-entry:nth-child(2) {
    color: #cccccc;
}

.lb-entry:nth-child(3) {
    color: #cc8844;
}

.lb-rank { color: inherit; min-width: 30px; text-align: left; }
.lb-name { flex: 1; text-align: left; margin-left: 8px; }
.lb-score { min-width: 80px; text-align: right; }

#retry-btn {
    font-family: 'Creepster', cursive;
    font-size: 30px;
    color: #eee;
    background: rgba(180,20,20,0.7);
    border: 2px solid #cc3333;
    padding: 12px 40px;
    cursor: pointer;
    border-radius: 4px;
    letter-spacing: 3px;
    transition: all 0.2s;
}

#retry-btn:hover {
    background: rgba(200,30,30,0.9);
    box-shadow: 0 0 30px rgba(200,0,0,0.5);
}

#quick-restart-hint {
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    color: #444;
    margin-top: 8px;
    letter-spacing: 1px;
}

/* PAUSE SCREEN */
#pause-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 22;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.75);
    cursor: default;
}

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

#pause-content h1 {
    font-family: 'Creepster', cursive;
    font-size: 64px;
    color: #cc5555;
    margin-bottom: 30px;
}

.pause-btn {
    display: block;
    width: 240px;
    margin: 12px auto;
    font-family: 'Share Tech Mono', monospace;
    font-size: 18px;
    color: #ccc;
    background: rgba(40,10,10,0.8);
    border: 1px solid #553333;
    padding: 12px;
    cursor: pointer;
    border-radius: 4px;
    letter-spacing: 2px;
    transition: all 0.15s;
}

.pause-btn:hover {
    background: rgba(150,20,20,0.8);
    border-color: #cc3333;
    color: #fff;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    #title { font-size: 48px; }
    #start-btn { font-size: 24px; padding: 12px 32px; }
    #controls-legend { font-size: 10px; }
    #wave-counter { font-size: 20px; }
    #ammo-section { font-size: 22px; }
    #ammo-current { font-size: 26px; }
    #health-bar-bg { width: 120px; }
    #death-title { font-size: 60px; }
    #minimap-container { display: none !important; }
    #kill-streak-text { font-size: 28px; }
}