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

body {
    overflow: hidden;
    background: #000;
    font-family: monospace;
}

canvas {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

/* Make sure the main game canvas is behind HUD elements but visible */
canvas:not(#radar canvas) {
    z-index: 1;
}

#radar {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    height: 32px;
    z-index: 2000;
    pointer-events: none;
    background: none;
    border: none;
}

#radar canvas {
    width: 320px;
    height: 32px;
    background: none;
    border: none;
    display: block;
    z-index: 2001;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

#score {
    position: fixed;
    top: 10px;
    left: 20px;
    color: #00ff00;
    font-family: monospace;
    font-size: 22px;
    padding: 0;
    background: none;
    border: none;
    z-index: 1000;
}

#health {
    position: fixed;
    top: 10px;
    right: 20px;
    color: #00ff00;
    font-family: monospace;
    font-size: 22px;
    padding: 0;
    background: none;
    border: none;
    z-index: 1000;
}

#gameOver {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #00ff00;
    font-family: monospace;
    font-size: 48px;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 40px;
    border: 2px solid #00ff00;
    display: none;
    z-index: 1000;
}

.restart-text {
    font-size: 24px;
    margin-top: 20px;
}

#startScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

#startContainer {
    text-align: center;
    color: #00ff00;
    font-family: monospace;
    border: 2px solid #00ff00;
    padding: 40px;
    background-color: rgba(0, 0, 0, 0.8);
}

#startContainer h1 {
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 0 0 10px #00ff00;
}

#startContainer p {
    font-size: 18px;
    margin-bottom: 30px;
    color: #00cc00;
}

#startButton {
    font-family: monospace;
    font-size: 24px;
    padding: 15px 30px;
    background: transparent;
    color: #00ff00;
    border: 2px solid #00ff00;
    cursor: pointer;
    transition: all 0.3s;
}

#startButton:hover {
    background-color: #00ff00;
    color: #000000;
    box-shadow: 0 0 20px #00ff00;
}

/* Damage flash overlay */
.damage-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, rgba(255, 0, 0, 0.4) 0%, rgba(255, 0, 0, 0.1) 50%, transparent 100%);
    z-index: 1500;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s ease-in-out;
}

.damage-flash.active {
    opacity: 1;
}

/* Invulnerability indicator */
.invulnerable-indicator {
    position: fixed;
    top: 50px;
    left: 20px;
    color: #ffff00;
    font-family: monospace;
    font-size: 18px;
    z-index: 1000;
    animation: blink 0.5s infinite;
    opacity: 0;
}

.invulnerable-indicator.active {
    opacity: 1;
}

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

/* Weapon upgrade notifications */
.upgrade-notification {
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    color: #ffff00;
    font-family: monospace;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 30px;
    border: 2px solid #ffff00;
    animation: upgradeFlash 3s ease-out forwards;
    text-shadow: 0 0 10px #ffff00;
}

@keyframes upgradeFlash {
    0% { 
        opacity: 1; 
        transform: translateX(-50%) scale(1.2); 
        box-shadow: 0 0 20px #ffff00;
    }
    20% { 
        opacity: 1; 
        transform: translateX(-50%) scale(1.0); 
    }
    80% { 
        opacity: 1; 
        transform: translateX(-50%) scale(1.0); 
    }
    100% { 
        opacity: 0; 
        transform: translateX(-50%) scale(0.8); 
    }
}
