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

body {
    overflow: hidden;
    background: #000;
    font-family: 'Courier New', monospace;
    cursor: none;
}

#gameCanvas {
    width: 100vw;
    height: 100vh;
    display: block;
}

/* Overlays */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    z-index: 100;
    cursor: default;
}

.menu {
    text-align: center;
    color: #e0e0e0;
}

.menu h1 {
    font-size: 72px;
    color: #ff3333;
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
    margin-bottom: 10px;
    letter-spacing: 8px;
}

.menu.death h1 {
    animation: pulse 1s ease-in-out infinite;
}

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

.subtitle {
    font-size: 18px;
    color: #888;
    margin-bottom: 40px;
}

.controls-info {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px 40px;
    margin-bottom: 40px;
    display: inline-block;
}

.controls-info h3 {
    color: #ff6666;
    margin-bottom: 15px;
    letter-spacing: 4px;
}

.control-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 15px;
    text-align: left;
    font-size: 14px;
    color: #aaa;
}

.key {
    background: rgba(255, 50, 50, 0.2);
    border: 1px solid #ff3333;
    border-radius: 4px;
    padding: 2px 10px;
    color: #ff6666;
    text-align: center;
    font-weight: bold;
}

.btn {
    background: #cc0000;
    color: #fff;
    border: none;
    padding: 15px 50px;
    font-size: 22px;
    font-family: 'Courier New', monospace;
    letter-spacing: 4px;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px;
}

.btn:hover {
    background: #ff3333;
    transform: scale(1.05);
}

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

#healthBar {
    position: absolute;
    bottom: 30px;
    left: 30px;
    width: 250px;
    height: 25px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #ff3333;
    border-radius: 3px;
    overflow: hidden;
}

#healthFill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #cc0000, #ff3333);
    transition: width 0.3s;
}

#healthText {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
}

#waveInfo {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: #ff6666;
    font-size: 18px;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

#waveNumber {
    display: block;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 4px;
}

#enemyCount {
    display: block;
    font-size: 14px;
    color: #aaa;
    margin-top: 4px;
}

#scoreDisplay {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #ffcc00;
    font-size: 22px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 200, 0, 0.3);
}

#weaponDisplay {
    position: absolute;
    bottom: 30px;
    right: 30px;
    display: flex;
    gap: 10px;
}

.weapon {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #555;
    border-radius: 6px;
    padding: 8px 16px;
    text-align: center;
    color: #888;
    transition: all 0.2s;
}

.weapon.active {
    border-color: #ff3333;
    color: #ff6666;
    background: rgba(255, 0, 0, 0.1);
}

.weapon-key {
    display: block;
    font-size: 20px;
    font-weight: bold;
}

.weapon-name {
    display: block;
    font-size: 11px;
    margin-top: 2px;
}

#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

#damageFlash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(255, 0, 0, 0.4) 100%);
    opacity: 0;
    transition: opacity 0.1s;
    pointer-events: none;
}

#waveAnnouncement {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ff3333;
    font-size: 48px;
    font-weight: bold;
    letter-spacing: 6px;
    text-shadow: 0 0 30px rgba(255, 0, 0, 0.5);
    animation: fadeInOut 3s ease-in-out forwards;
}

#pickupMessage {
    position: absolute;
    top: 65%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #00ff88;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 0 15px rgba(0, 255, 100, 0.5);
    animation: fadeInOut 2s ease-in-out forwards;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    80% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.1); }
}
