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

:root {
    --primary-bg: #0a0a1a;
    --secondary-bg: #1a1a2e;
    --accent-1: #00d4ff;
    --accent-2: #0099cc;
    --accent-3: #ff3366;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --success: #00ff88;
    --danger: #ff3366;
    --warning: #ffaa00;
    --border-color: rgba(0, 212, 255, 0.3);
    --neon-pink: #ff00ff;
    --neon-cyan: #00f0ff;
    --neon-purple: #b300ff;
}

body {
    font-family: 'Segoe UI', 'Arial', sans-serif;
    background: var(--primary-bg);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    position: relative;
}

/* Landing Screen */
.landing-screen {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0a0a1a 100%);
    overflow: hidden;
}

/* Idle Animation Container */
.idle-animation-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.idle-enemy {
    transition: transform 0.1s ease;
}

.idle-player {
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 40px solid var(--accent-1);
    filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.8));
}

.idle-bullet {
    width: 6px;
    height: 20px;
    background: linear-gradient(to top, var(--success), var(--accent-1));
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.8);
}

.idle-explosion {
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9), rgba(255, 100, 0, 0.8), transparent);
    border-radius: 50%;
    animation: idleExplosion 0.6s ease-out forwards;
}

@keyframes idleExplosion {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.8;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.landing-content {
    text-align: center;
    z-index: 10;
    position: relative;
    max-width: 550px;
    width: 90%;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.title-section {
    margin-bottom: 30px;
}

.game-title {
    font-size: 5rem;
    font-weight: 900;
    letter-spacing: 15px;
    font-family: 'Orbitron', 'Courier New', monospace;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-pink), var(--neon-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.4),
                 0 0 18px rgba(179, 0, 255, 0.3);
    margin-bottom: 10px;
    animation: titlePulse 3s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.3))
            drop-shadow(0 0 15px rgba(179, 0, 255, 0.25));
    position: relative;
    display: inline-block;
    text-transform: uppercase;
    font-style: italic;
}

/* Interlace effect using pseudo-element, masked to text shape */
.game-title::before {
    content: 'RETROVA';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 240, 255, 0.4) 2px,
        rgba(0, 240, 255, 0.4) 4px
    );
    background-size: 100% 4px;
    background-position: 0 0;
    animation: interlaceMoveTitle 0.15s linear infinite;
    mix-blend-mode: multiply;
    opacity: 0.9;
    /* Mask to text shape */
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    pointer-events: none;
    z-index: 1;
}

@keyframes titlePulse {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.3))
                drop-shadow(0 0 15px rgba(179, 0, 255, 0.25));
    }
    50% {
        filter: drop-shadow(0 0 12px rgba(0, 240, 255, 0.4))
                drop-shadow(0 0 20px rgba(179, 0, 255, 0.35));
    }
}

.game-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    letter-spacing: 3px;
    font-weight: 300;
    margin-bottom: 25px;
}

/* Compact Layout */
.compact-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 5px;
}

.stat-item {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    overflow: visible; /* Prevent clipping of arrow keys */
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 600;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--warning);
    text-shadow: 0 0 15px rgba(255, 170, 0, 0.6);
    font-family: 'Courier New', monospace;
}

.controls-inline {
    display: flex;
    gap: 8px;
    align-items: center;
    overflow: visible; /* Prevent clipping of arrow keys */
}

.key-inline {
    background: rgba(0, 212, 255, 0.15);
    border: 1px solid rgba(0, 212, 255, 0.4);
    padding: 10px 12px; /* Increased vertical padding to prevent clipping */
    border-radius: 5px;
    font-size: 1rem; /* Slightly larger font */
    color: var(--accent-1);
    font-weight: 700;
    font-family: 'Courier New', monospace;
    min-width: 35px;
    min-height: 40px; /* Increased minimum height to prevent clipping */
    line-height: 1.2; /* Explicit line height */
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3),
                inset 0 1px 2px rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    overflow: visible; /* Prevent clipping */
}

.key-inline:hover {
    background: rgba(0, 212, 255, 0.25);
    box-shadow: 0 3px 8px rgba(0, 212, 255, 0.4),
                inset 0 1px 2px rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.leaderboard-compact {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    padding: 18px;
}

.leaderboard-title {
    color: var(--accent-1);
    font-size: 0.75rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 12px;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.6);
}


.button-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 5px;
}

.secondary-buttons-row {
    display: flex;
    flex-direction: row;
    gap: 10px;
    width: 100%;
}

.secondary-buttons-row .how-to-play-button,
.secondary-buttons-row .audio-settings-button {
    flex: 1;
    padding: 14px 20px;
    font-size: 0.9rem;
}

.play-button,
.how-to-play-button,
.audio-settings-button {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 1rem;
    padding: 14px 40px;
    border-radius: 6px;
}

.play-button span:not(.button-interlace),
.how-to-play-button span:not(.button-interlace),
.audio-settings-button span:not(.button-interlace) {
    position: relative;
    z-index: 2;
}

.play-button {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    border-color: var(--accent-1);
    color: white;
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.3);
}

.how-to-play-button {
    background: linear-gradient(135deg, rgba(179, 0, 255, 0.3), rgba(255, 0, 255, 0.3));
    border-color: var(--neon-pink);
    color: var(--neon-pink);
    box-shadow: 0 6px 20px rgba(255, 0, 255, 0.3);
}

.audio-settings-button {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), rgba(0, 153, 204, 0.3));
    border-color: var(--accent-1);
    color: var(--accent-1);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.3);
}

.button-interlace {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.08) 2px,
        rgba(255, 255, 255, 0.08) 4px
    );
    pointer-events: none;
    z-index: 1;
    animation: interlaceMove 0.12s linear infinite;
}

@keyframes interlaceMove {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

@keyframes interlaceMoveTitle {
    0% { background-position: 0 0; }
    100% { background-position: 0 4px; }
}

.play-button:hover,
.how-to-play-button:hover,
.audio-settings-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.5);
}

.play-button:hover {
    background: linear-gradient(135deg, var(--accent-2), var(--accent-1));
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.5);
}

.how-to-play-button:hover {
    background: linear-gradient(135deg, rgba(179, 0, 255, 0.5), rgba(255, 0, 255, 0.5));
    box-shadow: 0 8px 25px rgba(255, 0, 255, 0.5);
}

.audio-settings-button:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.5), rgba(0, 153, 204, 0.5));
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.5);
}

.play-button:active,
.how-to-play-button:active,
.audio-settings-button:active {
    transform: translateY(0);
}

/* Particles Background */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.particle {
    position: absolute;
    background: rgba(0, 212, 255, 0.3);
    border-radius: 50%;
    animation: float 20s infinite linear;
}

@keyframes float {
    from {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    to {
        transform: translateY(-100px) translateX(100px);
        opacity: 0;
    }
}

/* Game Screen */
.game-screen {
    display: none;
    width: 100%;
    height: 100vh;
    position: relative;
    background: var(--primary-bg);
    justify-content: center;
    align-items: center;
}

.game-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: auto; /* Add scrollbars if container is too big for viewport */
}

.game-container {
    /* FIXED SIZE - DO NOT RESIZE */
    width: 1100px !important;
    height: 900px !important;
    min-width: 1100px !important;
    min-height: 900px !important;
    max-width: 1100px !important;
    max-height: 900px !important;
    flex-shrink: 0; /* Prevent flexbox from shrinking */
    background: rgba(10, 10, 26, 0.9);
    border: 2px solid var(--border-color);
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0, 212, 255, 0.2),
                inset 0 0 50px rgba(0, 212, 255, 0.05);
}

.stars-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.star-wrap {
    position: absolute;
    pointer-events: none;
}

.star-wrap-mid {
    animation: starDriftMid linear infinite;
}

.star-wrap-near {
    animation: starDriftNear linear infinite;
}

.star {
    position: relative;
    background: white;
    border-radius: 50%;
    animation: twinkle 4s infinite;
}

@keyframes starDriftMid {
    from {
        top: -5%;
    }
    to {
        top: 105%;
    }
}

@keyframes starDriftNear {
    from {
        top: -8%;
    }
    to {
        top: 108%;
    }
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.35;
    }
    50% {
        opacity: 1;
    }
}

.game-info {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    gap: 20px;
    pointer-events: none; /* Allow clicks through to game */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-info-left {
    display: flex;
    gap: 20px;
    margin-left: 20px;
    transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-info-right {
    display: flex;
    gap: 20px;
    margin-right: 20px;
    transition: margin-right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* When boss is active, slide UI elements out */
.game-info.boss-active .game-info-left {
    margin-left: 0;
    transform: translateX(-100%);
}

.game-info.boss-active .game-info-right {
    margin-right: 0;
    transform: translateX(100%);
}

.info-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 0;
    background: none;
    border: none;
    min-width: auto;
}

.info-label {
    color: var(--text-secondary);
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 600;
    opacity: 0.7;
}

/* Boss Health Bar - Top center, slides in/out */
.boss-health-container {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    z-index: 101;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.boss-health-container.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.boss-health-container.hiding {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
}

.boss-health-label {
    color: var(--danger);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-align: center;
    margin-bottom: 6px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
}

.boss-health-bar-bg {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(255, 0, 0, 0.3);
}

.boss-health-bar-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, 
        var(--danger) 0%, 
        #ff3333 50%, 
        var(--danger) 100%);
    border-radius: 3px;
    transition: width 0.2s ease;
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.6);
    animation: bossHealthPulse 1.5s ease-in-out infinite;
}

@keyframes bossHealthPulse {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.3);
    }
}

.info-value {
    color: var(--neon-cyan);
    font-weight: 700;
    font-size: 1.4rem;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.6),
                 0 0 20px rgba(0, 212, 255, 0.3);
    letter-spacing: 1px;
}

/* Game Elements - Clean CSS Shapes */
.player {
    position: absolute;
    bottom: 30px;
    user-select: none;
    z-index: 50;
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 40px solid var(--accent-1);
    filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.8));
    transition: left 0.1s ease-out;
}

.player::after {
    content: '';
    position: absolute;
    top: 10px;
    left: -8px;
    width: 16px;
    height: 16px;
    background: var(--accent-1);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
}

/* Player Shield Effect - Tech Arc Shape with Hexagonal Grid */
.player-shield {
    position: absolute;
    top: 0;
    left: 0;
    width: 150px;
    height: 150px;
    pointer-events: none;
    z-index: 49;
    display: none;
    animation: shieldPulse 1.2s ease-in-out infinite;
    opacity: 0.2; /* Much more transparent */
    /* Base arc shape - bright white/cyan glow */
    background: 
        /* Hexagonal grid pattern overlay */
        repeating-linear-gradient(60deg, 
            transparent 0px, 
            transparent 15px, 
            rgba(0, 255, 255, 0.08) 15px, 
            rgba(0, 255, 255, 0.08) 16px,
            transparent 16px,
            transparent 31px
        ),
        repeating-linear-gradient(-60deg, 
            transparent 0px, 
            transparent 15px, 
            rgba(0, 255, 255, 0.08) 15px, 
            rgba(0, 255, 255, 0.08) 16px,
            transparent 16px,
            transparent 31px
        ),
        /* Main arc gradient - brightest at edges, fading inward */
        radial-gradient(ellipse 150px 150px at 50% 50%, 
            transparent 0%,
            transparent 28%,
            rgba(0, 255, 255, 0.15) 32%,
            rgba(0, 255, 255, 0.18) 36%,
            rgba(255, 255, 255, 0.2) 38%,
            rgba(0, 255, 255, 0.18) 40%,
            rgba(0, 255, 255, 0.12) 44%,
            transparent 50%);
    /* Arc shape facing upward - curved arc (skinnier) */
    clip-path: polygon(
        50% 0%, 
        65% 8%, 
        75% 25%, 
        72% 42%, 
        65% 52%, 
        50% 56%, 
        35% 52%, 
        28% 42%, 
        25% 25%, 
        35% 8%
    );
    -webkit-clip-path: polygon(
        50% 0%, 
        65% 8%, 
        75% 25%, 
        72% 42%, 
        65% 52%, 
        50% 56%, 
        35% 52%, 
        28% 42%, 
        25% 25%, 
        35% 8%
    );
    /* Add vibrant pulsating glow effect */
    filter: drop-shadow(0 0 25px rgba(0, 255, 255, 1)) 
            drop-shadow(0 0 40px rgba(0, 255, 255, 0.8))
            drop-shadow(0 0 60px rgba(0, 255, 255, 0.6));
    box-shadow: 
        inset 0 0 20px rgba(0, 255, 255, 0.6),
        0 0 30px rgba(0, 255, 255, 0.8);
}

.player-shield::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Outer arc border with bright edge glow */
    background: radial-gradient(ellipse 150px 150px at 50% 50%, 
        transparent 0%,
        transparent 28%,
        rgba(255, 255, 255, 0.18) 32%,
        rgba(0, 255, 255, 0.18) 36%,
        rgba(0, 255, 255, 0.15) 40%,
        transparent 48%);
    clip-path: polygon(
        50% 0%, 
        65% 8%, 
        75% 25%, 
        72% 42%, 
        65% 52%, 
        50% 56%, 
        35% 52%, 
        28% 42%, 
        25% 25%, 
        35% 8%
    );
    -webkit-clip-path: polygon(
        50% 0%, 
        65% 8%, 
        75% 25%, 
        72% 42%, 
        65% 52%, 
        50% 56%, 
        35% 52%, 
        28% 42%, 
        25% 25%, 
        35% 8%
    );
    box-shadow: 
        0 0 30px rgba(255, 255, 255, 0.9),
        0 0 50px rgba(0, 255, 255, 0.8),
        inset 0 0 25px rgba(0, 255, 255, 0.5);
    animation: shieldGlow 1.5s ease-in-out infinite;
    opacity: 0.95;
}

.player-shield::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Energy streaks radiating outward from the arc */
    background: 
        /* Horizontal streaks */
        repeating-linear-gradient(0deg,
            transparent 0px,
            transparent 2px,
            rgba(0, 255, 255, 0.4) 2px,
            rgba(0, 255, 255, 0.4) 3px,
            transparent 3px,
            transparent 8px
        ),
        /* Diagonal streaks */
        repeating-linear-gradient(45deg,
            transparent 0px,
            transparent 3px,
            rgba(255, 255, 255, 0.3) 3px,
            rgba(255, 255, 255, 0.3) 4px,
            transparent 4px,
            transparent 10px
        ),
        /* Vertical streaks */
        repeating-linear-gradient(90deg,
            transparent 0px,
            transparent 2px,
            rgba(0, 255, 255, 0.3) 2px,
            rgba(0, 255, 255, 0.3) 3px,
            transparent 3px,
            transparent 8px
        );
    clip-path: polygon(
        50% 0%, 
        65% 8%, 
        75% 25%, 
        72% 42%, 
        65% 52%, 
        50% 56%, 
        35% 52%, 
        28% 42%, 
        25% 25%, 
        35% 8%
    );
    -webkit-clip-path: polygon(
        50% 0%, 
        65% 8%, 
        75% 25%, 
        72% 42%, 
        65% 52%, 
        50% 56%, 
        35% 52%, 
        28% 42%, 
        25% 25%, 
        35% 8%
    );
    animation: shieldStreaks 3s linear infinite;
    opacity: 0.3;
    mix-blend-mode: screen;
}

/* Shield Hit Particles */
.shield-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, rgba(255, 255, 255, 1), rgba(0, 255, 255, 0.8), transparent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 50;
    box-shadow: 0 0 8px rgba(0, 255, 255, 1), 0 0 12px rgba(255, 255, 255, 0.8);
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
    will-change: transform, opacity;
}

@keyframes shieldPulse {
    0%, 100% {
        opacity: 0.2;
        filter: drop-shadow(0 0 25px rgba(0, 255, 255, 1)) 
                drop-shadow(0 0 40px rgba(0, 255, 255, 0.8))
                drop-shadow(0 0 60px rgba(0, 255, 255, 0.6));
    }
    50% {
        opacity: 1;
        filter: drop-shadow(0 0 35px rgba(0, 255, 255, 1)) 
                drop-shadow(0 0 50px rgba(0, 255, 255, 0.9))
                drop-shadow(0 0 70px rgba(0, 255, 255, 0.7));
    }
}

@keyframes shieldGlow {
    0%, 100% {
        opacity: 0.9;
        box-shadow: 
            0 0 30px rgba(0, 255, 255, 1),
            0 0 50px rgba(0, 255, 255, 0.8),
            inset 0 0 30px rgba(0, 255, 255, 0.5);
    }
    50% {
        opacity: 1;
        box-shadow: 
            0 0 40px rgba(0, 255, 255, 1),
            0 0 60px rgba(0, 255, 255, 0.9),
            inset 0 0 40px rgba(0, 255, 255, 0.7);
    }
}

@keyframes shieldStreaks {
    0% {
        background-position: 0% 0%, 0% 0%, 0% 0%;
        opacity: 0.5;
    }
    50% {
        background-position: 50% 50%, 30% 30%, 70% 70%;
        opacity: 0.8;
    }
    100% {
        background-position: 100% 100%, 60% 60%, 100% 100%;
        opacity: 0.5;
    }
}

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

@keyframes shieldRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.enemy {
    position: absolute;
    user-select: none;
    z-index: 40;
    overflow: visible;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    contain: layout style paint;
}

/* Scout — twin-engine alien interceptor */
.enemy-standard {
    clip-path: polygon(
        50% 100%, 62% 80%, 85% 74%, 72% 56%,
        90% 40%, 68% 44%, 58% 18%, 74% 6%,
        50% 22%, 26% 6%, 42% 18%, 32% 44%,
        10% 40%, 28% 56%, 15% 74%, 38% 80%
    );
    background:
        linear-gradient(180deg, rgba(255, 80, 140, 0.95) 0%, #cc0055 38%, #880044 72%, #550028 100%),
        radial-gradient(ellipse at 50% 28%, rgba(255, 180, 220, 0.45) 0%, transparent 55%);
    border: none;
    filter: drop-shadow(0 0 10px rgba(255, 0, 102, 0.9))
            drop-shadow(0 4px 14px rgba(255, 0, 102, 0.45));
    box-shadow:
        inset 0 8px 18px rgba(255, 120, 180, 0.35),
        inset 0 -10px 20px rgba(0, 0, 0, 0.55),
        0 -6px 14px rgba(255, 0, 120, 0.55),
        0 -2px 6px rgba(255, 100, 180, 0.8);
    animation: alienEnginePulse 1.4s ease-in-out infinite;
}

.enemy-standard::before {
    content: '';
    position: absolute;
    top: 14%;
    left: 50%;
    transform: translateX(-50%);
    width: 34%;
    height: 22%;
    background: radial-gradient(ellipse, rgba(180, 255, 255, 0.95) 0%, rgba(0, 220, 255, 0.5) 45%, transparent 75%);
    border-radius: 50% 50% 40% 40%;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.7);
}

.enemy-standard::after {
    content: '';
    position: absolute;
    bottom: 6%;
    left: 50%;
    transform: translateX(-50%);
    width: 18%;
    height: 14%;
    background: radial-gradient(circle, #fff 0%, #ff66aa 55%, transparent 100%);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.95), 0 0 20px rgba(255, 0, 102, 0.9);
    animation: weaponGlow 1.1s ease-in-out infinite;
}

/* Striker — needle-nose alien dart */
.enemy-fast {
    clip-path: polygon(
        50% 100%, 58% 72%, 92% 58%, 68% 48%,
        88% 18%, 50% 32%, 12% 18%, 32% 48%,
        8% 58%, 42% 72%
    );
    background:
        linear-gradient(180deg, #ffaa22 0%, #ff6600 40%, #cc4400 75%, #882200 100%),
        linear-gradient(135deg, transparent 40%, rgba(255, 220, 100, 0.35) 50%, transparent 60%);
    border: none;
    filter: drop-shadow(0 0 12px rgba(255, 120, 0, 0.95))
            drop-shadow(0 3px 12px rgba(255, 80, 0, 0.5));
    box-shadow:
        inset 0 6px 14px rgba(255, 200, 80, 0.35),
        inset 0 -8px 16px rgba(0, 0, 0, 0.45),
        0 -8px 16px rgba(255, 140, 0, 0.65);
    animation: strikerThrust 0.55s ease-in-out infinite alternate;
}

.enemy-fast::before {
    content: '';
    position: absolute;
    top: 22%;
    left: 50%;
    transform: translateX(-50%);
    width: 28%;
    height: 30%;
    background: linear-gradient(180deg, rgba(255, 255, 200, 0.9) 0%, rgba(255, 140, 0, 0.4) 100%);
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    filter: blur(0.5px);
    opacity: 0.85;
}

.enemy-fast::after {
    content: '';
    position: absolute;
    bottom: 4%;
    left: 50%;
    transform: translateX(-50%);
    width: 10%;
    height: 22%;
    background: linear-gradient(180deg, #fff 0%, #ff8800 100%);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 1), 0 0 18px rgba(255, 120, 0, 0.9);
}

/* Tank — heavy alien gunship with side pods */
.enemy-tank {
    clip-path: polygon(
        50% 96%, 72% 86%, 96% 90%, 92% 68%,
        100% 48%, 80% 42%, 86% 16%, 64% 26%,
        50% 10%, 36% 26%, 14% 16%, 20% 42%,
        0% 48%, 8% 68%, 4% 90%, 28% 86%
    );
    background:
        linear-gradient(180deg, #cc66ff 0%, #9933ff 35%, #6600cc 70%, #3a0077 100%),
        repeating-linear-gradient(90deg, transparent 0, transparent 6px, rgba(255, 255, 255, 0.06) 6px, rgba(255, 255, 255, 0.06) 8px);
    border: none;
    filter: drop-shadow(0 0 14px rgba(153, 0, 255, 0.9))
            drop-shadow(0 4px 16px rgba(120, 0, 200, 0.5));
    box-shadow:
        inset 0 10px 22px rgba(200, 120, 255, 0.3),
        inset 0 -12px 24px rgba(0, 0, 0, 0.55),
        0 -8px 18px rgba(160, 50, 255, 0.6),
        -14px -4px 12px rgba(140, 0, 255, 0.35),
        14px -4px 12px rgba(140, 0, 255, 0.35);
}

.enemy-tank::before {
    content: '';
    position: absolute;
    top: 28%;
    left: 50%;
    transform: translateX(-50%);
    width: 44%;
    height: 26%;
    background:
        radial-gradient(ellipse at 30% 50%, rgba(0, 255, 255, 0.5) 0%, transparent 55%),
        radial-gradient(ellipse at 70% 50%, rgba(0, 255, 255, 0.5) 0%, transparent 55%),
        linear-gradient(180deg, rgba(80, 20, 120, 0.9) 0%, rgba(30, 0, 60, 0.95) 100%);
    clip-path: polygon(12% 0%, 88% 0%, 100% 100%, 0% 100%);
    border-top: 2px solid rgba(180, 100, 255, 0.6);
}

.enemy-tank::after {
    content: '';
    position: absolute;
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%);
    width: 36%;
    height: 10%;
    background: linear-gradient(90deg, transparent, #fff 20%, #fff 80%, transparent);
    border-radius: 2px;
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.9), 0 0 24px rgba(180, 80, 255, 1);
    animation: weaponGlow 1.6s ease-in-out infinite;
}

/* Diver — organic manta alien craft */
.enemy-zigzag {
    clip-path: polygon(
        50% 100%, 62% 84%, 100% 80%, 90% 60%,
        100% 40%, 78% 46%, 88% 20%, 50% 34%,
        12% 20%, 22% 46%, 0% 40%, 10% 60%,
        0% 80%, 38% 84%
    );
    background:
        linear-gradient(180deg, #33ffbb 0%, #00cc88 40%, #009966 75%, #005544 100%),
        radial-gradient(ellipse at 50% 60%, rgba(180, 255, 220, 0.35) 0%, transparent 60%);
    border: none;
    filter: drop-shadow(0 0 12px rgba(0, 255, 153, 0.9))
            drop-shadow(0 3px 12px rgba(0, 200, 140, 0.45));
    box-shadow:
        inset 0 8px 16px rgba(120, 255, 200, 0.3),
        inset 0 -8px 16px rgba(0, 60, 40, 0.5),
        0 -6px 14px rgba(0, 255, 180, 0.55);
    animation: mantaRipple 2.2s ease-in-out infinite;
}

.enemy-zigzag::before {
    content: '';
    position: absolute;
    top: 38%;
    left: 50%;
    transform: translateX(-50%);
    width: 22%;
    height: 22%;
    background: radial-gradient(circle, rgba(255, 255, 220, 0.95) 0%, rgba(0, 255, 180, 0.5) 50%, transparent 100%);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(0, 255, 200, 0.8);
    animation: bioPulse 1.5s ease-in-out infinite;
}

.enemy-zigzag::after {
    content: '';
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 8%;
    height: 8%;
    background: #fff;
    border-radius: 50%;
    box-shadow:
        0 0 8px rgba(255, 255, 255, 1),
        0 0 16px rgba(0, 255, 180, 0.9),
        0 -18px 8px rgba(0, 255, 160, 0.25),
        0 -28px 6px rgba(0, 255, 140, 0.15);
}

@keyframes alienEnginePulse {
    0%, 100% {
        box-shadow:
            inset 0 8px 18px rgba(255, 120, 180, 0.35),
            inset 0 -10px 20px rgba(0, 0, 0, 0.55),
            0 -5px 12px rgba(255, 0, 120, 0.45),
            0 -2px 5px rgba(255, 100, 180, 0.7);
    }
    50% {
        box-shadow:
            inset 0 8px 18px rgba(255, 120, 180, 0.35),
            inset 0 -10px 20px rgba(0, 0, 0, 0.55),
            0 -9px 20px rgba(255, 0, 120, 0.75),
            0 -3px 8px rgba(255, 150, 200, 1);
    }
}

@keyframes strikerThrust {
    0% {
        filter: drop-shadow(0 0 10px rgba(255, 120, 0, 0.85)) drop-shadow(0 3px 10px rgba(255, 80, 0, 0.4));
        box-shadow:
            inset 0 6px 14px rgba(255, 200, 80, 0.35),
            inset 0 -8px 16px rgba(0, 0, 0, 0.45),
            0 -6px 12px rgba(255, 140, 0, 0.5);
    }
    100% {
        filter: drop-shadow(0 0 16px rgba(255, 160, 0, 1)) drop-shadow(0 4px 14px rgba(255, 100, 0, 0.65));
        box-shadow:
            inset 0 6px 14px rgba(255, 200, 80, 0.35),
            inset 0 -8px 16px rgba(0, 0, 0, 0.45),
            0 -12px 22px rgba(255, 160, 0, 0.85);
    }
}

@keyframes mantaRipple {
    0%, 100% { filter: drop-shadow(0 0 12px rgba(0, 255, 153, 0.9)) drop-shadow(0 3px 12px rgba(0, 200, 140, 0.45)); }
    50% { filter: drop-shadow(0 0 16px rgba(0, 255, 200, 1)) drop-shadow(0 4px 14px rgba(0, 220, 160, 0.6)) hue-rotate(8deg); }
}

@keyframes bioPulse {
    0%, 100% { opacity: 0.85; transform: translateX(-50%) scale(1); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.15); }
}

@keyframes weaponGlow {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; }
}

.enemy-damaged {
    animation: damagedPulse 0.35s ease-in-out infinite !important;
}

.enemy-damaged-critical {
    filter: brightness(1.25) saturate(1.3) hue-rotate(-18deg) !important;
}

/* Boss — alien dreadnought mothership */
.enemy-boss {
    clip-path: polygon(
        50% 100%, 64% 88%, 88% 92%, 82% 72%,
        100% 58%, 78% 52%, 92% 30%, 72% 34%,
        82% 12%, 62% 22%, 50% 6%, 38% 22%,
        18% 12%, 28% 34%, 8% 30%, 22% 52%,
        0% 58%, 18% 72%, 12% 92%, 36% 88%
    );
    background:
        linear-gradient(180deg, #ff3333 0%, #cc0000 30%, #880000 65%, #440000 100%),
        repeating-linear-gradient(90deg, transparent 0, transparent 12px, rgba(255, 255, 255, 0.07) 12px, rgba(255, 255, 255, 0.07) 14px),
        radial-gradient(ellipse at 50% 35%, rgba(255, 120, 80, 0.35) 0%, transparent 60%);
    border: none;
    filter: drop-shadow(0 0 24px rgba(255, 0, 0, 1))
            drop-shadow(0 0 12px rgba(255, 80, 0, 0.9))
            drop-shadow(0 6px 20px rgba(200, 0, 0, 0.5));
    box-shadow:
        inset 0 14px 30px rgba(255, 100, 80, 0.35),
        inset 0 -16px 32px rgba(0, 0, 0, 0.6),
        0 -10px 24px rgba(255, 60, 0, 0.7),
        -20px -6px 16px rgba(255, 0, 0, 0.4),
        20px -6px 16px rgba(255, 0, 0, 0.4);
    animation: bossPulse 2s ease-in-out infinite;
}

.enemy-boss::before {
    content: '';
    position: absolute;
    top: 18%;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 28%;
    background:
        radial-gradient(ellipse at 25% 50%, rgba(255, 220, 0, 0.7) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 50%, rgba(255, 220, 0, 0.7) 0%, transparent 50%),
        linear-gradient(180deg, rgba(60, 0, 0, 0.95) 0%, rgba(20, 0, 0, 1) 100%);
    clip-path: polygon(8% 0%, 92% 0%, 100% 100%, 0% 100%);
    border-top: 3px solid rgba(255, 100, 50, 0.7);
    box-shadow: inset 0 0 20px rgba(255, 80, 0, 0.5);
}

.enemy-boss::after {
    content: '';
    position: absolute;
    bottom: 6%;
    left: 50%;
    transform: translateX(-50%);
    width: 28%;
    height: 12%;
    background: linear-gradient(90deg, transparent, #ffff88 15%, #fff 50%, #ffff88 85%, transparent);
    border-radius: 2px;
    box-shadow: 0 0 20px rgba(255, 255, 100, 1), 0 0 36px rgba(255, 0, 0, 1);
    animation: weaponGlow 0.8s ease-in-out infinite;
}

@keyframes bossPulse {
    0%, 100% {
        filter: drop-shadow(0 0 24px rgba(255, 0, 0, 1))
                drop-shadow(0 0 12px rgba(255, 80, 0, 0.9))
                brightness(1);
        box-shadow:
            inset 0 14px 30px rgba(255, 100, 80, 0.35),
            inset 0 -16px 32px rgba(0, 0, 0, 0.6),
            0 -10px 24px rgba(255, 60, 0, 0.7),
            -20px -6px 16px rgba(255, 0, 0, 0.4),
            20px -6px 16px rgba(255, 0, 0, 0.4);
    }
    50% {
        filter: drop-shadow(0 0 32px rgba(255, 0, 0, 1))
                drop-shadow(0 0 18px rgba(255, 100, 0, 1))
                brightness(1.15);
        box-shadow:
            inset 0 14px 30px rgba(255, 120, 80, 0.45),
            inset 0 -16px 32px rgba(0, 0, 0, 0.6),
            0 -14px 30px rgba(255, 80, 0, 0.9),
            -24px -8px 20px rgba(255, 0, 0, 0.55),
            24px -8px 20px rgba(255, 0, 0, 0.55);
    }
}

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

.bullet {
    position: absolute;
    user-select: none;
    z-index: 45;
    width: 6px;
    height: 20px;
    background: linear-gradient(to top, var(--success), var(--accent-1));
    border-radius: 3px;
    box-shadow: 0 0 4px rgba(0, 255, 136, 0.6);
    will-change: transform;
    contain: layout style paint;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.enemy-bullet {
    position: absolute;
    user-select: none;
    z-index: 45;
    width: 9px; /* Increased from 6px for better visibility */
    height: 30px; /* Increased from 20px for better visibility */
    background: linear-gradient(to bottom, var(--accent-3), var(--danger));
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(255, 51, 102, 0.8);
}

.enemy-bullet-boss {
    width: 12px; /* Increased from 8px for better visibility */
    height: 36px; /* Increased from 24px for better visibility */
    background: linear-gradient(to bottom, var(--danger), #cc0000);
    box-shadow: 0 0 15px rgba(255, 0, 0, 1);
}

.explosion {
    position: absolute;
    user-select: none;
    z-index: 60;
    pointer-events: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--warning), var(--danger));
    animation: explode 0.6s ease-out forwards;
    box-shadow: 0 0 20px rgba(255, 170, 0, 0.8);
}

@keyframes explode {
    0% {
        transform: scale(0.5) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: scale(3) rotate(360deg);
        opacity: 0;
    }
}

/* Powerup */
.powerup {
    position: absolute;
    user-select: none;
    z-index: 45;
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-pink));
    border: 2px solid var(--neon-cyan);
    border-radius: 50%;
    animation: powerupGlow 1s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.8),
                0 0 40px rgba(255, 0, 255, 0.6);
}

.powerup::before {
    content: '⚡';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 1);
    animation: powerupIconRotate 2s linear infinite;
}

@keyframes powerupIconRotate {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes powerupGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.8),
                    0 0 40px rgba(255, 0, 255, 0.6);
        filter: brightness(1) hue-rotate(0deg);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 212, 255, 1),
                    0 0 60px rgba(255, 0, 255, 0.9);
        filter: brightness(1.3) hue-rotate(180deg);
    }
}

/* Life Powerup - Unique Design */
.powerup-life {
    background: linear-gradient(135deg, #ffd700, #ffaa00, #ffd700);
    border: 3px solid #ffd700;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.9),
                0 0 50px rgba(255, 170, 0, 0.7),
                inset 0 0 15px rgba(255, 255, 255, 0.3);
    animation: lifePowerupGlow 1.2s ease-in-out infinite;
}

.powerup-life::before {
    content: '❤';
    font-size: 18px;
    color: #ff0000;
    text-shadow: 0 0 15px rgba(255, 0, 0, 1),
                 0 0 25px rgba(255, 215, 0, 0.8);
    animation: lifePowerupPulse 1s ease-in-out infinite;
}

@keyframes lifePowerupGlow {
    0%, 100% {
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.9),
                    0 0 50px rgba(255, 170, 0, 0.7),
                    inset 0 0 15px rgba(255, 255, 255, 0.3);
        filter: brightness(1) hue-rotate(0deg);
    }
    50% {
        box-shadow: 0 0 35px rgba(255, 215, 0, 1),
                    0 0 70px rgba(255, 170, 0, 1),
                    inset 0 0 20px rgba(255, 255, 255, 0.5);
        filter: brightness(1.4) hue-rotate(10deg);
    }
}

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

/* Elite — ornate golden alien warship */
.enemy-elite {
    clip-path: polygon(
        50% 100%, 62% 86%, 88% 90%, 78% 68%,
        100% 52%, 82% 46%, 92% 22%, 68% 30%,
        78% 8%, 50% 18%, 22% 8%, 32% 30%,
        8% 22%, 18% 46%, 0% 52%, 22% 68%,
        12% 90%, 38% 86%
    );
    background:
        linear-gradient(180deg, #ffe566 0%, #ffd700 30%, #cc9900 65%, #886600 100%),
        repeating-linear-gradient(45deg, transparent 0, transparent 7px, rgba(255, 255, 255, 0.12) 7px, rgba(255, 255, 255, 0.12) 9px),
        radial-gradient(ellipse at 50% 40%, rgba(255, 255, 200, 0.4) 0%, transparent 55%);
    border: none;
    filter: drop-shadow(0 0 18px rgba(255, 215, 0, 1))
            drop-shadow(0 0 10px rgba(255, 170, 0, 0.9))
            drop-shadow(0 4px 14px rgba(200, 150, 0, 0.5));
    box-shadow:
        inset 0 10px 22px rgba(255, 240, 150, 0.4),
        inset 0 -12px 24px rgba(80, 50, 0, 0.5),
        0 -8px 18px rgba(255, 200, 50, 0.65);
    animation: eliteShift 3s ease-in-out infinite, elitePulse 2s ease-in-out infinite;
}

.enemy-elite::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 38%;
    height: 24%;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.95) 0%, rgba(255, 220, 100, 0.5) 45%, transparent 75%);
    border-radius: 50%;
    box-shadow: 0 0 14px rgba(255, 240, 150, 0.9);
    animation: bioPulse 2s ease-in-out infinite;
}

.enemy-elite::after {
    content: '';
    position: absolute;
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%);
    width: 22%;
    height: 10%;
    background: linear-gradient(90deg, transparent, #fff 25%, #ffffaa 50%, #fff 75%, transparent);
    border-radius: 2px;
    box-shadow: 0 0 16px rgba(255, 255, 200, 1), 0 0 28px rgba(255, 200, 0, 1);
    animation: weaponGlow 1.2s ease-in-out infinite;
}

@keyframes eliteShift {
    0%, 100% {
        filter: drop-shadow(0 0 18px rgba(255, 215, 0, 1))
                drop-shadow(0 0 10px rgba(255, 170, 0, 0.9))
                brightness(1);
    }
    50% {
        filter: drop-shadow(0 0 24px rgba(255, 215, 0, 1))
                drop-shadow(0 0 14px rgba(255, 170, 0, 1))
                brightness(1.12);
    }
}

@keyframes elitePulse {
    0%, 100% {
        box-shadow:
            inset 0 10px 22px rgba(255, 240, 150, 0.4),
            inset 0 -12px 24px rgba(80, 50, 0, 0.5),
            0 -8px 18px rgba(255, 200, 50, 0.65);
    }
    50% {
        box-shadow:
            inset 0 12px 26px rgba(255, 250, 180, 0.55),
            inset 0 -12px 24px rgba(80, 50, 0, 0.5),
            0 -12px 24px rgba(255, 220, 80, 0.85);
    }
}

/* Game Over Screen */
.game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.game-over-content {
    text-align: center;
    padding: 50px;
    background: rgba(26, 26, 46, 0.95);
    border-radius: 20px;
    border: 2px solid var(--border-color);
    box-shadow: 0 0 60px rgba(0, 212, 255, 0.3);
    max-width: 500px;
}

.game-over-content h2 {
    font-size: 3rem;
    margin-bottom: 30px;
    color: var(--danger);
    text-shadow: 0 0 20px rgba(255, 51, 102, 0.6);
    letter-spacing: 4px;
}

.final-score {
    margin: 30px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 1px solid var(--border-color);
}

.final-score-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.final-score-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--warning);
    text-shadow: 0 0 15px rgba(255, 170, 0, 0.6);
}

.new-high-score {
    color: var(--warning);
    font-size: 1.2rem;
    font-weight: 600;
    margin: 20px 0;
    display: none;
    animation: pulse 1s infinite;
    letter-spacing: 2px;
}

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

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.restart-button,
.menu-button {
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border: 1px solid rgba(0, 240, 255, 0.4);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
    backdrop-filter: blur(10px);
}

.restart-button {
    background: rgba(0, 240, 255, 0.1);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.2),
                inset 0 0 20px rgba(0, 240, 255, 0.1);
}

.restart-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 240, 255, 0.3),
                inset 0 0 25px rgba(0, 240, 255, 0.15);
    background: rgba(0, 240, 255, 0.15);
}

.menu-button {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.menu-button:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* CRT Overlay Effects */
.crt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    background: 
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.15) 0px,
            rgba(0, 0, 0, 0.15) 1px,
            transparent 1px,
            transparent 2px
        );
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

.scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 101;
    background: linear-gradient(
        transparent 50%,
        rgba(0, 240, 255, 0.03) 50%
    );
    background-size: 100% 4px;
    animation: scanlines 0.1s linear infinite;
}

@keyframes scanlines {
    0% { background-position: 0 0; }
    100% { background-position: 0 4px; }
}

/* Death Screen */
.death-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.death-content {
    text-align: center;
    animation: deathPulse 0.5s ease-out;
}

.death-title {
    font-size: 3rem;
    font-weight: 900;
    color: var(--danger);
    text-shadow: 0 0 20px rgba(255, 51, 102, 0.8),
                 0 0 40px rgba(255, 51, 102, 0.6);
    margin-bottom: 30px;
    letter-spacing: 4px;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.death-animation {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 20px auto;
}

.death-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--neon-cyan);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.8);
    animation: deathParticle 1s ease-out forwards;
}

@keyframes deathParticle {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--vx), var(--vy)) scale(0);
        opacity: 0;
    }
}

.death-message {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin: 20px 0;
    letter-spacing: 2px;
}

.continue-button {
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border: 1px solid rgba(0, 240, 255, 0.4);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
    background: rgba(0, 240, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.2),
                inset 0 0 20px rgba(0, 240, 255, 0.1);
    margin: 20px auto 0;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    width: fit-content;
    min-width: 200px;
}

.button-text {
    flex: 1;
}

.button-key {
    background: rgba(0, 240, 255, 0.15);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid rgba(0, 240, 255, 0.4);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
    color: var(--neon-cyan);
}

.continue-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 240, 255, 0.3),
                inset 0 0 25px rgba(0, 240, 255, 0.15);
    background: rgba(0, 240, 255, 0.15);
}

.continue-button:active {
    transform: translateY(0);
}

/* Countdown Screen */
.countdown-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    animation: fadeIn 0.3s ease-out;
}

.countdown-content {
    text-align: center;
}

.countdown-number {
    font-size: 8rem;
    font-weight: 900;
    color: var(--accent-1);
    text-shadow: 0 0 40px rgba(0, 212, 255, 0.8),
                 0 0 80px rgba(0, 212, 255, 0.6);
    margin-bottom: 20px;
    transition: transform 0.2s ease;
    animation: countdownPulse 1s ease-in-out infinite;
}

@keyframes countdownPulse {
    0%, 100% {
        text-shadow: 0 0 40px rgba(0, 212, 255, 0.8),
                     0 0 80px rgba(0, 212, 255, 0.6);
    }
    50% {
        text-shadow: 0 0 60px rgba(0, 212, 255, 1),
                     0 0 120px rgba(0, 212, 255, 0.8);
    }
}

.countdown-text {
    font-size: 1.5rem;
    color: var(--text-secondary);
    letter-spacing: 3px;
    font-weight: 300;
}

@keyframes deathPulse {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes damagedPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.72;
    }
}

/* Version Indicator */
.version-indicator {
    position: fixed;
    top: 10px;
    right: 10px;
    font-size: 0.7rem;
    color: var(--neon-cyan);
    opacity: 0.8;
    z-index: 10000;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(0, 240, 255, 0.3);
}

/* Leaderboard */
.leaderboard-card {
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px 30px;
    grid-column: 1 / -1;
    max-width: 100%;
    margin-top: 10px;
}

.leaderboard-card h3 {
    color: var(--accent-1);
    margin-bottom: 20px;
    font-size: 1.1rem;
    letter-spacing: 3px;
    text-align: center;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.6);
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.leaderboard-item {
    display: grid;
    grid-template-columns: 30px 1fr auto;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border: 1px solid rgba(0, 212, 255, 0.2);
    font-size: 0.8rem;
    transition: all 0.2s ease;
    gap: 10px;
}

.leaderboard-item:hover {
    border-color: rgba(0, 212, 255, 0.5);
    background: rgba(0, 0, 0, 0.5);
    transform: translateX(3px);
}

.leaderboard-rank {
    color: var(--accent-1);
    font-weight: 700;
    font-size: 0.85rem;
    text-align: center;
    min-width: 30px;
    font-family: 'Courier New', monospace;
}

.leaderboard-name {
    color: var(--text-primary);
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'Courier New', 'Consolas', monospace;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-size: 0.75rem;
    text-shadow: 0 0 6px rgba(0, 240, 255, 0.5);
}

.leaderboard-score {
    color: var(--warning);
    font-weight: 700;
    font-size: 0.85rem;
    text-align: right;
    min-width: 60px;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 8px rgba(255, 170, 0, 0.5);
}

.leaderboard-empty {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 20px;
}

/* Name Entry */
.name-entry-container {
    margin: 20px 0;
    text-align: center;
}

.name-entry-label {
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 15px;
    display: block;
    letter-spacing: 1px;
}

.player-name-input {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 240, 255, 0.4);
    border-radius: 8px;
    padding: 10px 15px;
    color: var(--text-primary);
    font-size: 1rem;
    text-align: center;
    letter-spacing: 2px;
    width: 200px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.player-name-input:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.submit-name-button {
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(0, 240, 255, 0.4);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
    background: rgba(0, 240, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.2);
}

.submit-name-button:hover {
    background: rgba(0, 240, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 240, 255, 0.3);
}

/* Overhauled Player Design */
.player {
    position: absolute;
    bottom: 30px;
    user-select: none;
    z-index: 50;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    clip-path: polygon(50% 0%, 100% 40%, 85% 100%, 15% 100%, 0% 40%);
    filter: drop-shadow(0 0 15px rgba(0, 240, 255, 0.8)) 
            drop-shadow(0 0 30px rgba(179, 0, 255, 0.6));
    transition: left 0.1s ease-out;
    animation: playerPulse 2s ease-in-out infinite;
}

@keyframes playerPulse {
    0%, 100% {
        filter: drop-shadow(0 0 15px rgba(0, 240, 255, 0.8)) 
                drop-shadow(0 0 30px rgba(179, 0, 255, 0.6));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(0, 240, 255, 1)) 
                drop-shadow(0 0 40px rgba(179, 0, 255, 0.8));
    }
}

.player::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 240, 255, 1);
}

.player::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 8px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
    border-radius: 50%;
    filter: blur(4px);
    animation: engineGlow 0.5s ease-in-out infinite alternate;
}

@keyframes engineGlow {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Duplicate enemy definitions removed - using the first set above */

/* Responsive Design */
@media (max-width: 768px) {
    .game-title {
        font-size: 3rem;
    }
    
    .game-container {
        width: 95%;
        height: 85vh;
    }
    
    .stats-row {
        grid-template-columns: 1fr;
    }
    
    .enemy-types-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .game-title {
        font-size: 3rem;
        letter-spacing: 8px;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1; 
    }
}

/* About Retrova Tab */
.about-tab {
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 1000;
    font-family: 'Segoe UI', 'Arial', sans-serif;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.about-tab-header {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(179, 0, 255, 0.2));
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    padding: 6px 18px; /* Increased padding for wider tab */
    cursor: pointer;
    box-shadow: 0 -4px 20px rgba(0, 212, 255, 0.2);
    transition: all 0.3s ease;
    min-width: 130px; /* Wider minimum width */
}

.about-tab-header:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), rgba(179, 0, 255, 0.3));
    box-shadow: 0 -6px 30px rgba(0, 212, 255, 0.4);
}

.about-tab-title {
    color: var(--neon-cyan);
    font-size: 0.8rem; /* Larger font for wider tab */
    font-weight: 600;
    letter-spacing: 1.5px;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
    writing-mode: horizontal-tb;
    white-space: nowrap;
    text-align: center;
    display: block;
}

.about-tab-content {
    max-height: 0;
    max-width: 380px; /* Wider design (was 280px) */
    overflow: hidden;
    overflow-y: auto; /* Enable scrolling for tall content */
    background: rgba(10, 10, 26, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 0 8px;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease;
    box-shadow: 0 -4px 30px rgba(0, 212, 255, 0.3);
    scrollbar-width: thin;
    scrollbar-color: var(--neon-cyan) rgba(0, 0, 0, 0.3);
}

.about-tab-content::-webkit-scrollbar {
    width: 6px;
}

.about-tab-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.about-tab-content::-webkit-scrollbar-thumb {
    background: var(--neon-cyan);
    border-radius: 3px;
}

.about-tab:hover .about-tab-content {
    max-height: 500px; /* Maintain height */
    padding: 18px 22px; /* Increased horizontal padding */
}

.about-content-inner {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
}

.about-tab:hover .about-content-inner {
    opacity: 1;
    transform: translateY(0);
}

.about-title {
    font-size: 1.3rem; /* Larger for wider design */
    font-weight: 700;
    color: var(--neon-cyan);
    margin-bottom: 15px;
    text-align: center;
    letter-spacing: 2.5px;
    text-shadow: 0 0 15px rgba(0, 240, 255, 0.6),
                 0 0 30px rgba(255, 0, 255, 0.4);
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-info {
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.about-release,
.about-developer,
.about-contact {
    color: var(--text-primary);
    font-size: 0.85rem; /* Larger font for wider layout */
    margin: 7px 0;
    letter-spacing: 0.6px;
    line-height: 1.5;
}

.about-release strong,
.about-developer strong,
.about-contact strong {
    color: var(--neon-cyan);
    font-weight: 600;
}

.email-link {
    color: var(--neon-pink);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    text-shadow: 0 0 8px rgba(255, 0, 255, 0.5);
    word-break: break-all; /* Allow email to wrap in narrow layout */
}

.email-link:hover {
    color: var(--neon-cyan);
    text-shadow: 0 0 12px rgba(0, 240, 255, 0.8);
    text-decoration: underline;
}

.about-description {
    color: var(--text-secondary);
    font-size: 0.85rem; /* Larger for wider layout */
    line-height: 1.6;
    margin: 12px 0;
    letter-spacing: 0.4px;
    text-align: justify;
}

.about-tagline {
    color: var(--neon-pink);
    font-size: 0.95rem; /* Larger tagline */
    font-weight: 600;
    font-style: italic;
    text-align: center;
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 212, 255, 0.2);
    letter-spacing: 1.8px;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
}

.about-credits {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 212, 255, 0.3);
}

.about-credit-text {
    color: var(--text-secondary);
    font-size: 0.8rem; /* Larger for wider layout */
    text-align: center;
    margin: 7px 0;
    letter-spacing: 0.4px;
    line-height: 1.5;
}

.pixabay-link {
    color: var(--neon-cyan);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
    display: inline-block;
}

.pixabay-link:hover {
    color: var(--neon-pink);
    text-shadow: 0 0 12px rgba(255, 0, 255, 0.8);
    text-decoration: underline;
}

.about-credit-message {
    color: rgba(0, 212, 255, 0.7);
    font-size: 0.75rem; /* Larger for wider layout */
    text-align: center;
    font-style: italic;
    margin: 7px 0;
    letter-spacing: 0.4px;
    line-height: 1.4;
}

.about-tab.hidden {
    display: none;
}

/* Donate Tab - Bottom Left with Standout Styling */
.donate-tab {
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 1000;
    font-family: 'Segoe UI', 'Arial', sans-serif;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.donate-tab-header {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.4), rgba(255, 140, 0, 0.4));
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 215, 0, 0.6);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    padding: 8px 20px;
    cursor: pointer;
    box-shadow: 0 -4px 25px rgba(255, 215, 0, 0.5),
                0 0 20px rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
    min-width: 140px;
    animation: donatePulse 2s ease-in-out infinite;
}

@keyframes donatePulse {
    0%, 100% {
        box-shadow: 0 -4px 25px rgba(255, 215, 0, 0.5),
                    0 0 20px rgba(255, 215, 0, 0.3);
        border-color: rgba(255, 215, 0, 0.6);
    }
    50% {
        box-shadow: 0 -6px 35px rgba(255, 215, 0, 0.7),
                    0 0 30px rgba(255, 215, 0, 0.5);
        border-color: rgba(255, 215, 0, 0.9);
    }
}

.donate-tab-header:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.6), rgba(255, 140, 0, 0.6));
    box-shadow: 0 -6px 40px rgba(255, 215, 0, 0.7),
                0 0 35px rgba(255, 215, 0, 0.5);
    animation: none;
}

.donate-tab-title {
    color: #FFD700;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.8),
                 0 0 25px rgba(255, 140, 0, 0.6);
    writing-mode: horizontal-tb;
    white-space: nowrap;
    text-align: center;
    display: block;
}

.donate-tab-content {
    max-height: 0;
    max-width: 350px;
    overflow: hidden;
    overflow-y: auto;
    background: rgba(10, 10, 26, 0.98);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-top: none;
    border-radius: 0 0 0 8px;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease;
    box-shadow: 0 -4px 35px rgba(255, 215, 0, 0.4);
    scrollbar-width: thin;
    scrollbar-color: #FFD700 rgba(0, 0, 0, 0.3);
}

.donate-tab-content::-webkit-scrollbar {
    width: 6px;
}

.donate-tab-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.donate-tab-content::-webkit-scrollbar-thumb {
    background: #FFD700;
    border-radius: 3px;
}

.donate-tab:hover .donate-tab-content {
    max-height: 400px;
    padding: 20px 24px;
}

.donate-content-inner {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
}

.donate-tab:hover .donate-content-inner {
    opacity: 1;
    transform: translateY(0);
}

.donate-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #FFD700;
    margin-bottom: 15px;
    text-align: center;
    letter-spacing: 2.5px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8),
                 0 0 35px rgba(255, 140, 0, 0.6);
}

.donate-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 15px;
    text-align: center;
}

.donate-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.donate-link-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 140, 0, 0.2));
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 8px;
    color: #FFD700;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
}

.donate-link-button:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.4), rgba(255, 140, 0, 0.4));
    border-color: rgba(255, 215, 0, 0.8);
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.4);
    transform: translateY(-2px);
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
}

.donate-link-icon {
    font-size: 1.2rem;
}

.donate-thank-you {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
    margin-top: 15px;
    font-style: italic;
}

.donate-tab.hidden {
    display: none;
}

/* Button Container for Start Game and How To Play */

/* How To Play Screen */
.how-to-play-screen {
    display: none; /* Hidden by default */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0a0a1a 100%);
    z-index: 10;
    overflow-y: auto;
    padding: 40px 20px;
}

.how-to-play-screen.active {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.how-to-play-content {
    max-width: 900px;
    width: 100%;
    animation: fadeInUp 0.5s ease;
}

.how-to-play-title {
    font-size: 1.8rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: 4px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-family: 'Segoe UI', 'Arial', sans-serif;
    border-bottom: 2px solid rgba(0, 212, 255, 0.3);
    padding-bottom: 15px;
}

.how-to-play-section {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.how-to-play-section:hover {
    border-color: rgba(0, 212, 255, 0.5);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.2);
}

.section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: 'Segoe UI', 'Arial', sans-serif;
}

.section-text {
    color: var(--text-primary);
    font-size: 0.85rem;
    line-height: 1.5;
    letter-spacing: 0.5px;
    font-family: 'Segoe UI', 'Arial', sans-serif;
}

.controls-grid {
    display: flex;
        flex-direction: column;
    gap: 12px;
}

.control-row {
    display: flex;
        align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.control-key {
    background: rgba(0, 212, 255, 0.15);
    border: 1px solid rgba(0, 212, 255, 0.4);
    color: var(--accent-1);
    padding: 8px 12px;
    border-radius: 5px;
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 35px;
    min-height: 32px;
    line-height: 1.2;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3),
                inset 0 1px 2px rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.control-key:hover {
    background: rgba(0, 212, 255, 0.25);
    box-shadow: 0 3px 8px rgba(0, 212, 255, 0.4),
                inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.control-desc {
    color: var(--text-primary);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    font-family: 'Segoe UI', 'Arial', sans-serif;
}

.enemy-types-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 12px;
}

.enemy-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, 0.3);
    transition: all 0.3s ease;
}

.enemy-info:hover {
    border-color: rgba(0, 212, 255, 0.5);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.2);
    transform: translateY(-2px);
}

.enemy-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

.scout-icon {
    background: linear-gradient(180deg, #ff3388 0%, #880044 100%);
    clip-path: polygon(
        50% 100%, 62% 80%, 85% 74%, 72% 56%,
        90% 40%, 68% 44%, 58% 18%, 74% 6%,
        50% 22%, 26% 6%, 42% 18%, 32% 44%,
        10% 40%, 28% 56%, 15% 74%, 38% 80%
    );
}

.striker-icon {
    background: linear-gradient(180deg, #ffaa22 0%, #882200 100%);
    clip-path: polygon(
        50% 100%, 58% 72%, 92% 58%, 68% 48%,
        88% 18%, 50% 32%, 12% 18%, 32% 48%,
        8% 58%, 42% 72%
    );
}

.tank-icon {
    background: linear-gradient(180deg, #cc66ff 0%, #3a0077 100%);
    clip-path: polygon(
        50% 96%, 72% 86%, 96% 90%, 92% 68%,
        100% 48%, 80% 42%, 86% 16%, 64% 26%,
        50% 10%, 36% 26%, 14% 16%, 20% 42%,
        0% 48%, 8% 68%, 4% 90%, 28% 86%
    );
}

.diver-icon {
    background: linear-gradient(180deg, #33ffbb 0%, #005544 100%);
    clip-path: polygon(
        50% 100%, 62% 84%, 100% 80%, 90% 60%,
        100% 40%, 78% 46%, 88% 20%, 50% 34%,
        12% 20%, 22% 46%, 0% 40%, 10% 60%,
        0% 80%, 38% 84%
    );
}

.elite-icon {
    background: linear-gradient(180deg, #ffe566 0%, #886600 100%);
    clip-path: polygon(
        50% 100%, 62% 86%, 88% 90%, 78% 68%,
        100% 52%, 82% 46%, 92% 22%, 68% 30%,
        78% 8%, 50% 18%, 22% 8%, 32% 30%,
        8% 22%, 18% 46%, 0% 52%, 22% 68%,
        12% 90%, 38% 86%
    );
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

.boss-icon {
    background: linear-gradient(180deg, #ff3333 0%, #440000 100%);
    clip-path: polygon(
        50% 100%, 64% 88%, 88% 92%, 82% 72%,
        100% 58%, 78% 52%, 92% 30%, 72% 34%,
        82% 12%, 62% 22%, 50% 6%, 38% 22%,
        18% 12%, 28% 34%, 8% 30%, 22% 52%,
        0% 58%, 18% 72%, 12% 92%, 36% 88%
    );
    box-shadow: 0 0 25px rgba(255, 0, 0, 0.9);
}

.enemy-name {
    color: var(--accent-1);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 1px;
    font-family: 'Segoe UI', 'Arial', sans-serif;
}

.enemy-points {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
}

.enemy-detail {
    color: var(--warning);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-top: 4px;
    font-family: 'Segoe UI', 'Arial', sans-serif;
}

.tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tips-list li {
    color: var(--text-primary);
    font-size: 0.85rem;
    line-height: 1.5;
    padding: 8px 10px;
    margin-bottom: 6px;
    background: rgba(0, 0, 0, 0.2);
    border-left: 2px solid rgba(0, 212, 255, 0.4);
    border-radius: 4px;
    letter-spacing: 0.5px;
    font-family: 'Segoe UI', 'Arial', sans-serif;
}

.tips-list li::before {
    content: "⚡ ";
    color: var(--accent-1);
    font-weight: 700;
    margin-right: 6px;
}

.back-to-menu-button {
    position: relative;
    overflow: hidden;
    display: block;
    margin: 25px auto 0;
    padding: 14px 60px;
    background: linear-gradient(135deg, rgba(179, 0, 255, 0.3), rgba(255, 0, 255, 0.3));
    border: 2px solid var(--neon-pink);
    border-radius: 6px;
    color: var(--neon-pink);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: 'Segoe UI', 'Arial', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(255, 0, 255, 0.3);
}

.back-to-menu-button span:not(.button-interlace) {
    position: relative;
    z-index: 2;
}

.back-to-menu-button:hover {
    background: linear-gradient(135deg, rgba(179, 0, 255, 0.5), rgba(255, 0, 255, 0.5));
    box-shadow: 0 8px 25px rgba(255, 0, 255, 0.5);
    transform: translateY(-2px);
}

.back-to-menu-button:active {
    transform: translateY(0);
}

/* Audio Settings Screen */
.audio-settings-screen {
    display: none; /* Hidden by default */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0a0a1a 100%);
    z-index: 10;
    overflow-y: auto;
    padding: 40px 20px;
}

.audio-settings-screen.active {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.audio-settings-content {
    max-width: 500px;
    width: 100%;
    animation: fadeInUp 0.5s ease;
}

.audio-settings-title {
    font-size: 1.8rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 35px;
    letter-spacing: 4px;
    color: var(--accent-1);
    text-transform: uppercase;
    font-family: 'Segoe UI', 'Arial', sans-serif;
    border-bottom: 2px solid rgba(0, 212, 255, 0.3);
    padding-bottom: 15px;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.6);
}

.audio-settings-main {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.1);
}

.audio-settings-main:hover {
    border-color: rgba(0, 212, 255, 0.5);
    box-shadow: 0 6px 25px rgba(0, 212, 255, 0.2);
}

.audio-control-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, 0.2);
    transition: all 0.3s ease;
}

.audio-control-item:first-child {
    margin-bottom: 15px;
}

.audio-control-item:hover {
    border-color: rgba(0, 212, 255, 0.4);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 2px 10px rgba(0, 212, 255, 0.15);
}

.audio-control-header {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
}

.audio-icon {
    font-size: 1.4rem;
    filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.6));
}

.audio-label {
    flex: 1;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
    font-family: 'Segoe UI', 'Arial', sans-serif;
    text-align: left;
}

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin-left: auto;
}

.toggle-checkbox {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 26px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(0, 212, 255, 0.4);
    border-radius: 26px;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-secondary);
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-checkbox:checked + .toggle-slider {
    background: rgba(0, 212, 255, 0.3);
    border-color: var(--accent-1);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5),
                inset 0 0 10px rgba(0, 212, 255, 0.2);
}

.toggle-checkbox:checked + .toggle-slider::before {
    transform: translateX(24px);
    background: var(--accent-1);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border: 1px solid rgba(0, 212, 255, 0.15);
}

.volume-slider {
    flex: 1;
    height: 6px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-1);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.8),
                0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    margin-top: -6px;
    position: relative;
}

.volume-slider::-webkit-slider-thumb:hover {
    background: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 1),
                0 2px 6px rgba(0, 0, 0, 0.4);
    transform: scale(1.1);
}

.volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-1);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.8),
                0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.volume-slider::-moz-range-thumb:hover {
    background: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 1),
                0 2px 6px rgba(0, 0, 0, 0.4);
    transform: scale(1.1);
}

.volume-slider::-webkit-slider-runnable-track {
    height: 6px;
    background: linear-gradient(to right, 
        rgba(0, 212, 255, 0.3) 0%, 
        rgba(0, 212, 255, 0.5) 100%);
    border-radius: 3px;
}

.volume-slider::-moz-range-track {
    height: 6px;
    background: linear-gradient(to right, 
        rgba(0, 212, 255, 0.3) 0%, 
        rgba(0, 212, 255, 0.5) 100%);
    border-radius: 3px;
    border: none;
}

.slider-value {
    color: var(--accent-1);
    font-size: 0.9rem;
    font-weight: 700;
    min-width: 45px;
    text-align: right;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.6);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}