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

body {
    font-family: system-ui, sans-serif;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3a 100%);
    color: #fff;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

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

.hud-left, .hud-right {
    position: absolute;
    top: 20px;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.hud-left {
    left: 20px;
}

.hud-right {
    right: 20px;
    text-align: right;
}

.hud-center {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.score-display, .high-score-display, .wave-display, .weapon-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.score-label, .high-score-label, .wave-label, .weapon-label, .energy-label, .powerup-label {
    font-size: 12px;
    color: #00ffff;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 10px #00ffff;
}

#score, #high-score, #wave, #weapon {
    font-size: 28px;
    font-weight: bold;
    text-shadow: 0 0 20px #00ffff;
    color: #fff;
}

.energy-bar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.energy-bar {
    width: 200px;
    height: 15px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    overflow: hidden;
}

.energy-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ffff, #ff00ff);
    width: 100%;
    transition: width 0.3s ease;
    box-shadow: 0 0 15px #00ffff;
}

.superzapper-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.superzapper-icon {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #00ffff, #ff00ff);
    border-radius: 50%;
    box-shadow: 0 0 20px #00ffff;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 20px #00ffff; }
    50% { box-shadow: 0 0 40px #00ffff, 0 0 60px #ff00ff; }
}

/* Overlay Screens */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 100;
}

.hidden {
    display: none !important;
}

.start-content, .gameover-content {
    text-align: center;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.game-title {
    font-size: 64px;
    font-weight: bold;
    background: linear-gradient(135deg, #00ffff, #ff00ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    margin-bottom: 10px;
    letter-spacing: 5px;
}

.game-subtitle {
    font-size: 18px;
    color: #aaa;
    margin-bottom: 30px;
    letter-spacing: 3px;
}

.primary-button {
    padding: 20px 60px;
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, #00ffff, #ff00ff);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 255, 255, 0.3);
    pointer-events: auto;
}

.primary-button:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 255, 255, 0.5);
}

.primary-button:active {
    transform: scale(0.95);
}

.controls-info {
    margin-top: 40px;
    text-align: left;
    max-width: 400px;
}

.controls-info h3 {
    font-size: 16px;
    color: #00ffff;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.control-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
}

.control-label {
    font-size: 16px;
    color: #00ffff;
    font-weight: bold;
}

.control-desc {
    font-size: 14px;
    color: #888;
}

.gameover-title {
    font-size: 48px;
    font-weight: bold;
    background: linear-gradient(135deg, #ff00ff, #ff0066);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    margin-bottom: 20px;
    letter-spacing: 5px;
}

.final-score, .high-score-display {
    margin-bottom: 20px;
}

.final-label {
    font-size: 16px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#final-score {
    font-size: 48px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 30px #ff00ff;
}

#final-high-score {
    font-size: 24px;
    color: #00ffff;
    text-shadow: 0 0 20px #00ffff;
}

.new-record-badge {
    font-size: 24px;
    color: #ff00ff;
    text-shadow: 0 0 20px #ff00ff;
    margin-bottom: 20px;
    animation: glow 1s infinite alternate;
}

@keyframes glow {
    from { opacity: 0.8; }
    to { opacity: 1; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-title {
        font-size: 42px;
    }

    .game-subtitle {
        font-size: 14px;
    }

    .hud-left, .hud-right {
        padding: 10px 15px;
    }

    .score-label, .high-score-label, .wave-label, .weapon-label,
    .energy-label, .powerup-label {
        font-size: 10px;
    }

    #score, #high-score, #wave, #weapon {
        font-size: 20px;
    }

    .energy-bar {
        width: 150px;
    }

    .controls-info {
        max-width: 300px;
        font-size: 14px;
    }

    .control-label {
        font-size: 14px;
    }

    .control-desc {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 32px;
    }

    .hud-left, .hud-right {
        top: 10px;
        padding: 8px 10px;
    }

    .score-label, .high-score-label, .wave-label, .weapon-label,
    .energy-label, .powerup-label {
        font-size: 8px;
    }

    #score, #high-score, #wave, #weapon {
        font-size: 16px;
    }

    .energy-bar {
        width: 120px;
        height: 12px;
    }

    .primary-button {
        padding: 15px 40px;
        font-size: 16px;
    }
}
