/* ===== GLOBAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    color: #fff;
}

/* ===== GAME CONTAINER ===== */
#gameContainer {
    position: relative;
    width: 90vw;
    max-width: 600px;
    height: 90vh;
    max-height: 800px;
    background: linear-gradient(180deg, #000428 0%, #004e92 100%);
    border-radius: 10px;
    box-shadow: 0 0 50px rgba(0, 150, 255, 0.5),
                0 0 100px rgba(138, 43, 226, 0.3);
    overflow: hidden;
    border: 2px solid rgba(0, 200, 255, 0.3);
}

/* ===== CANVAS ===== */
#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* ===== HUD ===== */
#hud {
    position: absolute;
    top: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 10;
    pointer-events: none;
}

#hud > div {
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 15px;
    border-radius: 5px;
    border: 1px solid rgba(0, 200, 255, 0.5);
    box-shadow: 0 0 10px rgba(0, 200, 255, 0.3);
}

.label {
    font-size: 12px;
    color: #00d4ff;
    margin-right: 5px;
    text-transform: uppercase;
}

#scoreValue, #highScoreValue {
    font-size: 18px;
    font-weight: bold;
    color: #00ff00;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
}

#waveValue {
    font-size: 18px;
    font-weight: bold;
    color: #ffaa00;
    text-shadow: 0 0 10px rgba(255, 170, 0, 0.8);
}

#livesValue {
    font-size: 18px;
}

/* ===== WEAPON HUD ===== */
#weaponHud {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
    pointer-events: none;
}

.weapon-item {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(100, 100, 100, 0.5);
    border-radius: 8px;
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
    opacity: 0.5;
}

.weapon-item.active {
    border-color: #00ff00;
    background: rgba(0, 255, 0, 0.2);
    opacity: 1;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
}

.weapon-key {
    font-size: 20px;
    font-weight: bold;
    color: #00d4ff;
    margin-bottom: 5px;
}

.weapon-name {
    font-size: 12px;
    color: #fff;
    text-transform: uppercase;
}

.weapon-item.active .weapon-key {
    color: #00ff00;
}

/* ===== COMBO DISPLAY ===== */
#comboDisplay {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(255, 0, 150, 0.9), rgba(255, 100, 0, 0.9));
    padding: 15px 30px;
    border-radius: 10px;
    border: 2px solid #fff;
    pointer-events: none;
    animation: comboPopup 0.5s ease-out;
    z-index: 50;
}

#comboText {
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

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

/* ===== POWER-UP INDICATOR ===== */
#powerupIndicator {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 255, 200, 0.9);
    padding: 10px 20px;
    border-radius: 8px;
    border: 2px solid #fff;
    pointer-events: none;
    z-index: 50;
}

#powerupText {
    font-size: 16px;
    font-weight: bold;
    color: #000;
}

/* ===== MUTE BUTTON ===== */
.icon-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(0, 200, 255, 0.5);
    border-radius: 5px;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    background: rgba(0, 100, 255, 0.8);
    transform: scale(1.1);
}

/* ===== OVERLAYS ===== */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.overlay-content {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, rgba(0, 50, 100, 0.8), rgba(0, 20, 50, 0.9));
    border-radius: 15px;
    border: 2px solid rgba(0, 200, 255, 0.6);
    box-shadow: 0 0 30px rgba(0, 150, 255, 0.5);
    max-width: 500px;
}

.hidden {
    display: none !important;
}

/* ===== START SCREEN ===== */
.game-title {
    font-size: 48px;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #00d4ff, #00ff88, #ffaa00, #ff0080);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGlow 3s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(0, 200, 255, 0.8);
}

@keyframes titleGlow {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(0, 200, 255, 0.8));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(255, 0, 128, 0.8));
    }
}

.subtitle {
    font-size: 20px;
    color: #00d4ff;
    margin-bottom: 30px;
    letter-spacing: 3px;
}

.instructions {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid rgba(0, 200, 255, 0.3);
}

.instructions h3 {
    color: #00ff88;
    margin-bottom: 10px;
}

.instructions p {
    font-size: 14px;
    margin: 5px 0;
    color: #ddd;
}

.features {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 200, 255, 0.3);
}

.features p {
    font-size: 13px;
    color: #aaa;
    margin: 5px 0;
}

/* ===== BUTTONS ===== */
.game-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 15px 40px;
    font-size: 20px;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.game-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.8);
}

.game-btn:active {
    transform: translateY(0);
}

/* ===== GAME OVER SCREEN ===== */
.game-over-title {
    font-size: 48px;
    color: #ff0080;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255, 0, 128, 0.8);
}

.final-score {
    font-size: 28px;
    margin: 15px 0;
    color: #00ff00;
}

.best-score {
    font-size: 18px;
    margin: 10px 0;
    color: #00d4ff;
}

.wave-reached {
    font-size: 18px;
    margin: 10px 0;
    color: #ffaa00;
}

.new-high-score {
    font-size: 24px;
    color: #ffd700;
    margin: 20px 0;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* ===== PAUSE SCREEN ===== */
#pauseScreen h2 {
    font-size: 48px;
    margin-bottom: 20px;
    color: #00d4ff;
}

#pauseScreen p {
    font-size: 18px;
    margin-bottom: 30px;
    color: #ddd;
}

/* ===== MOBILE CONTROLS ===== */
#mobileControls {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    z-index: 15;
}

.mobile-btn {
    background: rgba(0, 100, 255, 0.6);
    border: 2px solid rgba(0, 200, 255, 0.8);
    border-radius: 50%;
    width: 70px;
    height: 70px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 15px rgba(0, 200, 255, 0.5);
}

.mobile-btn:active {
    background: rgba(0, 150, 255, 0.9);
    transform: scale(0.95);
}

.mobile-btn.fire {
    width: 80px;
    height: 80px;
    font-size: 28px;
}

/* ===== MOBILE WEAPON SELECTOR ===== */
#mobileWeaponSelector {
    position: absolute;
    top: 70px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 15;
}

.mobile-weapon-btn {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(100, 100, 100, 0.5);
    border-radius: 8px;
    width: 50px;
    height: 50px;
    font-size: 20px;
    font-weight: bold;
    color: #00d4ff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-weapon-btn.active {
    background: rgba(0, 255, 0, 0.3);
    border-color: #00ff00;
    color: #00ff00;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
}

.mobile-weapon-btn:active {
    transform: scale(0.95);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    #gameContainer {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }

    #hud {
        flex-wrap: wrap;
        gap: 5px;
    }

    #hud > div {
        padding: 5px 10px;
        font-size: 12px;
    }

    .game-title {
        font-size: 36px;
    }

    .overlay-content {
        padding: 20px;
    }

    #mobileControls {
        display: flex !important;
    }

    #mobileWeaponSelector {
        display: flex !important;
    }

    #weaponHud {
        display: none;
    }
}

/* ===== SCREEN SHAKE ANIMATION ===== */
@keyframes shake {
    0%, 100% { transform: translate(0, 0); }
    10%, 30%, 50%, 70%, 90% { transform: translate(-5px, 0); }
    20%, 40%, 60%, 80% { transform: translate(5px, 0); }
}

.shake {
    animation: shake 0.5s;
}
