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

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

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

#scene-container canvas {
    display: block;
}

/* Start Screen */
#start-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    background: #0a0a0a;
    cursor: default;
}

.fire-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: 
        radial-gradient(ellipse at 50% 100%, rgba(255,80,0,0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 30% 90%, rgba(255,160,0,0.1) 0%, transparent 40%),
        radial-gradient(ellipse at 70% 95%, rgba(255,40,0,0.1) 0%, transparent 40%);
    animation: fireGlow 3s ease-in-out infinite alternate;
}

@keyframes fireGlow {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

.start-content {
    text-align: center;
    z-index: 1;
    position: relative;
}

.game-title {
    font-size: clamp(2rem, 6vw, 4.5rem);
    font-weight: 900;
    background: linear-gradient(180deg, #ffe066 0%, #ff8800 40%, #ff3300 80%, #aa0000 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 0 20px rgba(255,100,0,0.6));
    animation: titlePulse 2s ease-in-out infinite alternate;
    letter-spacing: 4px;
}

.edition-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.8rem);
    font-weight: 700;
    background: linear-gradient(180deg, #ff99cc 0%, #ff6699 50%, #cc3366 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 12px rgba(255,100,180,0.5));
    letter-spacing: 6px;
    margin-top: 8px;
}

@keyframes titlePulse {
    0% { filter: drop-shadow(0 0 20px rgba(255,100,0,0.4)); }
    100% { filter: drop-shadow(0 0 40px rgba(255,100,0,0.8)); }
}

.subtitle {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.8rem, 2vw, 1.2rem);
    color: #aa8866;
    margin: 20px 0 40px;
    letter-spacing: 2px;
}

.start-button {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 16px 48px;
    background: linear-gradient(135deg, #ff6600, #ff3300);
    color: #fff;
    border: 2px solid #ff8800;
    border-radius: 8px;
    cursor: pointer;
    letter-spacing: 3px;
    transition: all 0.3s;
    text-transform: uppercase;
}

.start-button:hover {
    background: linear-gradient(135deg, #ff8800, #ff5500);
    box-shadow: 0 0 30px rgba(255,100,0,0.5);
    transform: scale(1.05);
}

.controls-ref {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    color: #666;
    margin-top: 30px;
    line-height: 1.8;
}

.controls-ref span {
    color: #ff8800;
    font-weight: 700;
}

.footer-start {
    position: absolute;
    bottom: 16px;
    width: 100%;
    text-align: center;
}

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

.footer-start a:hover {
    color: #ff8800;
}

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

#crosshair {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Share Tech Mono', monospace;
    font-size: 24px;
    color: rgba(255,255,255,0.7);
    text-shadow: 0 0 4px rgba(255,255,255,0.3);
    line-height: 1;
}

#hud-top {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#score-display, #wave-display, #kill-display {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.8rem, 1.5vw, 1.1rem);
    text-shadow: 0 0 10px rgba(0,0,0,0.8);
    letter-spacing: 2px;
}

#wave-display {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: #ff8800;
}

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

#health-container, #fuel-container {
    width: clamp(140px, 20vw, 240px);
}

.bar-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 4px;
    opacity: 0.8;
}

.bar-bg {
    width: 100%;
    height: 14px;
    background: rgba(30,30,30,0.8);
    border-radius: 7px;
    border: 1px solid rgba(255,255,255,0.1);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 7px;
    transition: width 0.15s ease;
}

.health-fill {
    background: linear-gradient(90deg, #cc0000, #ff3333);
    box-shadow: 0 0 8px rgba(255,0,0,0.4);
}

.fuel-fill {
    background: linear-gradient(90deg, #cc6600, #ffaa00);
    box-shadow: 0 0 8px rgba(255,170,0,0.4);
}

#wave-banner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.5rem, 4vw, 3rem);
    font-weight: 900;
    color: #ff6600;
    text-shadow: 0 0 30px rgba(255,100,0,0.6), 0 0 60px rgba(255,50,0,0.3);
    letter-spacing: 6px;
    white-space: nowrap;
    animation: bannerIn 0.5s ease-out;
}

#powerup-display {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(0.7rem, 1.5vw, 1rem);
    font-weight: 700;
    letter-spacing: 2px;
    text-align: center;
    white-space: nowrap;
    text-shadow: 0 0 10px rgba(0,0,0,0.8);
    animation: powerupPulse 1s ease-in-out infinite alternate;
}

@keyframes powerupPulse {
    0% { opacity: 0.8; }
    100% { opacity: 1; filter: brightness(1.3); }
}

@keyframes bannerIn {
    0% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* Music Player Widget */
#music-widget {
    position: absolute;
    top: 50px;
    right: 16px;
    pointer-events: all;
    z-index: 20;
    cursor: default;
}

#music-toggle-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255,136,0,0.5);
    background: rgba(20,20,30,0.85);
    color: #ff8800;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#music-toggle-btn:hover {
    background: rgba(255,136,0,0.2);
    box-shadow: 0 0 10px rgba(255,136,0,0.3);
}

#music-panel {
    position: absolute;
    top: 42px;
    right: 0;
    width: 220px;
    background: rgba(15,15,25,0.92);
    border: 1px solid rgba(255,136,0,0.3);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    backdrop-filter: blur(8px);
}

#music-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
}

#music-controls button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255,136,0,0.4);
    background: rgba(30,30,40,0.9);
    color: #ff8800;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#music-controls button:hover {
    background: rgba(255,136,0,0.2);
}

#music-track-name {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    color: #aaa;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#music-upload-label {
    display: block;
    text-align: center;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: #ff8800;
    cursor: pointer;
    padding: 6px 12px;
    border: 1px dashed rgba(255,136,0,0.4);
    border-radius: 6px;
    transition: all 0.2s;
}

#music-upload-label:hover {
    background: rgba(255,136,0,0.15);
}

#music-track-list {
    max-height: 120px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#music-track-list::-webkit-scrollbar {
    width: 4px;
}

#music-track-list::-webkit-scrollbar-track {
    background: transparent;
}

#music-track-list::-webkit-scrollbar-thumb {
    background: rgba(255,136,0,0.3);
    border-radius: 2px;
}

/* Overlays */
.overlay-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.75);
}

#pause-screen, #gameover-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}

.overlay-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.overlay-content h2 {
    font-size: clamp(1.5rem, 4vw, 3rem);
    letter-spacing: 6px;
    margin-bottom: 16px;
}

.overlay-content p {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
    color: #888;
}

.gameover-title {
    background: linear-gradient(180deg, #ff6600, #cc0000);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(255,50,0,0.5));
}

#final-stats {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
    color: #aaa;
    margin: 24px 0;
    line-height: 2;
}

#final-stats span {
    color: #ff8800;
    font-weight: 700;
}

/* Damage flash */
.damage-flash {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(255,0,0,0.3);
    pointer-events: none;
    z-index: 9;
    animation: dmgFlash 0.3s ease-out forwards;
}

@keyframes dmgFlash {
    0% { opacity: 1; }
    100% { opacity: 0; }
}