* {
    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: 100%; height: 100%;
}

#scene-container canvas {
    display: block;
}

#crosshair {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: #ff3333;
    font-size: 28px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    pointer-events: none;
    z-index: 100;
    text-shadow: 0 0 8px rgba(255,50,50,0.8), 0 0 20px rgba(255,50,50,0.4);
    display: none;
    mix-blend-mode: screen;
}

#hud {
    position: fixed;
    top: 0; left: 0; right: 0;
    padding: 16px 24px;
    display: none;
    justify-content: space-between;
    align-items: center;
    z-index: 90;
    background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, transparent 100%);
    pointer-events: none;
}

#health-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

#health-label {
    color: #0ff;
    font-size: 11px;
    letter-spacing: 2px;
    font-family: 'Share Tech Mono', monospace;
}

#health-bar-bg {
    width: 200px;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(0,255,255,0.3);
    position: relative;
}

#health-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #0ff, #0f0);
    transition: width 0.3s, background 0.3s;
    box-shadow: 0 0 10px rgba(0,255,255,0.5);
}

#health-text {
    color: #0ff;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 16px;
    min-width: 36px;
}

#score-display, #wave-display, #ammo-display {
    color: #0ff;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(0,255,255,0.5);
}

#damage-flash {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 95;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(255,0,0,0.6) 100%);
    opacity: 0;
    transition: opacity 0.1s;
}

#muzzle-flash {
    position: fixed;
    top: 50%; left: 50%;
    width: 60px; height: 60px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0%, #ff0 30%, #f80 60%, transparent 70%);
    pointer-events: none;
    opacity: 0;
    z-index: 99;
}

.screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    background: radial-gradient(ellipse at center, rgba(5,15,25,0.95) 0%, rgba(0,0,0,0.98) 100%);
    cursor: default;
}

.screen-content {
    text-align: center;
    max-width: 600px;
    padding: 40px;
}

.glitch-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: clamp(32px, 7vw, 64px);
    color: #0ff;
    letter-spacing: 4px;
    text-shadow: 0 0 20px rgba(0,255,255,0.6), 0 0 60px rgba(0,255,255,0.2);
    animation: glitchText 3s infinite;
    position: relative;
}

.win-title { color: #0f0; text-shadow: 0 0 20px rgba(0,255,0,0.6); }
.lose-title { color: #f33; text-shadow: 0 0 20px rgba(255,50,50,0.6); }

@keyframes glitchText {
    0%, 90%, 100% { transform: none; opacity: 1; }
    91% { transform: translateX(-3px) skewX(-2deg); }
    93% { transform: translateX(3px) skewX(2deg); opacity: 0.8; }
    95% { transform: translateX(-1px); opacity: 1; }
}

.subtitle {
    font-family: 'Share Tech Mono', monospace;
    color: rgba(0,255,255,0.7);
    font-size: 14px;
    letter-spacing: 6px;
    margin-top: 12px;
    text-transform: uppercase;
}

.divider {
    width: 80%;
    height: 1px;
    margin: 24px auto;
    background: linear-gradient(90deg, transparent, #0ff, transparent);
}

.description {
    color: rgba(200,220,240,0.7);
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 24px;
}

.instructions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 32px;
}

.key-row {
    color: rgba(200,220,240,0.6);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.key {
    display: inline-block;
    padding: 4px 10px;
    border: 1px solid rgba(0,255,255,0.4);
    color: #0ff;
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
}

.action-btn {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 3px;
    color: #0ff;
    background: transparent;
    border: 2px solid #0ff;
    padding: 14px 40px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
}

.action-btn:hover {
    background: rgba(0,255,255,0.15);
    box-shadow: 0 0 30px rgba(0,255,255,0.3), inset 0 0 30px rgba(0,255,255,0.1);
    transform: scale(1.02);
}

.final-score {
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    color: #fff;
    margin: 20px 0 30px;
    letter-spacing: 2px;
}

#highscore-display {
    margin-top: 20px;
    color: rgba(255,200,0,0.8);
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    letter-spacing: 2px;
}

#footer-link {
    position: fixed;
    bottom: 8px;
    right: 12px;
    z-index: 300;
}

#footer-link a {
    color: rgba(0,255,255,0.3);
    text-decoration: none;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    letter-spacing: 1px;
    transition: color 0.3s;
}

#footer-link a:hover {
    color: rgba(0,255,255,0.7);
}

@media (max-width: 640px) {
    #hud { padding: 10px 12px; flex-wrap: wrap; gap: 6px; }
    #health-bar-bg { width: 120px; }
    #score-display, #wave-display, #ammo-display { font-size: 11px; }
    .action-btn { font-size: 13px; padding: 12px 24px; }
    .instructions { gap: 8px; }
}