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

body {
    background: #000000;
    font-family: 'Orbitron', 'Segoe UI', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile browsers */
    height: 100vh;
    padding: 3px 8px;
    padding: max(3px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(3px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    color: white;
    overflow-x: hidden;
    overflow-y: auto;
    touch-action: none;
    gap: 2px;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 255, 255, 0.05) 2px, rgba(0, 255, 255, 0.05) 4px);
    pointer-events: none;
    z-index: 1;
    animation: scanlines 8s linear infinite;
}

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

h1 {
    font-size: 1.3rem;
    background: linear-gradient(90deg, #00ffff 0%, #ff00ff 50%, #00ffff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 10px #00ffff) drop-shadow(0 0 20px #ff00ff);
    letter-spacing: 5px;
    font-weight: 900;
    z-index: 2;
    position: relative;
    animation: neonPulse 2s ease-in-out infinite, gradientSlide 4s linear infinite;
    text-shadow: 0 0 30px rgba(0, 255, 255, 0.9);
    text-align: center;
    padding: 2px 10px;
    margin: 0;
    border: 1px solid transparent;
    border-image: linear-gradient(90deg, #00ffff, #ff00ff, #00ffff) 1;
    background-clip: text, border-box;
    -webkit-background-clip: text, border-box;
}

@keyframes gradientSlide {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

@keyframes neonPulse {
    0%, 100% {
        filter: drop-shadow(0 0 20px #00ffff) drop-shadow(0 0 40px #ff00ff);
    }
    50% {
        filter: drop-shadow(0 0 30px #00ffff) drop-shadow(0 0 60px #ff00ff) drop-shadow(0 0 80px #00ffff);
    }
}

.hud {
    background:
        linear-gradient(180deg, #0a0a1a 0%, #000 100%);
    border: 3px solid #00ffff;
    border-radius: 8px;
    padding: 12px 20px;
    width: 100%;
    max-width: 100%;
    box-shadow:
        0 0 20px rgba(0, 255, 255, 0.4),
        inset 0 0 30px rgba(0, 255, 255, 0.1),
        0 4px 0 rgba(0, 0, 0, 0.5);
    position: relative;
}

.hud::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 5px;
    pointer-events: none;
}

.hud-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 12px;
}

.hud-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 50px;
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
}

.hud-label {
    color: #00ffff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow:
        0 0 10px #00ffff,
        0 0 20px #00ffff;
    filter: drop-shadow(0 0 5px rgba(0, 255, 255, 0.8));
}

.hud-value {
    color: #ffff00;
    font-size: 1.6rem;
    font-weight: 900;
    text-shadow:
        0 0 10px #ffff00,
        0 0 20px #ffff00,
        0 0 30px #ff00ff,
        2px 2px 4px rgba(0, 0, 0, 0.8);
    min-width: 60px;
    text-align: center;
    filter: drop-shadow(0 0 8px rgba(255, 255, 0, 0.8));
}

.hud-value-purple {
    color: #ff00ff;
    text-shadow:
        0 0 10px #ff00ff,
        0 0 20px #ff00ff,
        0 0 30px #ff00ff,
        2px 2px 4px rgba(0, 0, 0, 0.8);
    filter: drop-shadow(0 0 8px rgba(255, 0, 255, 0.8));
}

.hud-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.hud-button {
    padding: 8px 20px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    background:
        linear-gradient(180deg, #333 0%, #111 100%);
    border: 2px solid #00ffff;
    border-radius: 6px;
    cursor: pointer;
    color: #00ffff;
    transition: all 0.2s;
    box-shadow:
        0 0 10px rgba(0, 255, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 3px 0 rgba(0, 0, 0, 0.4);
    text-shadow: 0 0 5px #00ffff;
}

.hud-button:hover {
    background:
        linear-gradient(180deg, #444 0%, #222 100%);
    box-shadow:
        0 0 20px rgba(0, 255, 255, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 3px 0 rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.hud-button:active {
    transform: translateY(1px);
    box-shadow:
        0 0 15px rgba(0, 255, 255, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 1px 0 rgba(0, 0, 0, 0.4);
}

#pauseButton.paused {
    background:
        linear-gradient(180deg, #0a5 0%, #063 100%);
    border-color: #0f7;
    color: #0f7;
    text-shadow: 0 0 5px #0f7;
    box-shadow:
        0 0 15px rgba(0, 255, 119, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 3px 0 rgba(0, 0, 0, 0.4);
}

.health-bar-container {
    width: 100%;
    padding: 0 20px 8px 20px;
    background: #000;
}

.health-bar-bg {
    width: 100%;
    height: 24px;
    background:
        linear-gradient(180deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%);
    border: 3px solid #00ffff;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 0 15px rgba(0, 255, 255, 0.4),
        inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.health-bar {
    height: 100%;
    background:
        linear-gradient(90deg,
            #00ff00 0%,
            #44ff00 25%,
            #ffff00 50%,
            #44ff00 75%,
            #00ff00 100%);
    transition: width 0.3s ease;
    box-shadow:
        0 0 20px rgba(0, 255, 0, 0.8),
        inset 0 2px 10px rgba(255, 255, 255, 0.3),
        inset 0 -2px 10px rgba(0, 0, 0, 0.3);
    animation: healthPulse 2s ease-in-out infinite;
}

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

.health-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 900;
    text-shadow:
        0 0 5px #000,
        0 0 10px #000,
        1px 1px 3px #000,
        -1px -1px 3px #000;
    z-index: 1;
    letter-spacing: 1px;
}

.health-container {
    width: 100%;
}

.health-label {
    color: #00ffff;
    font-size: 0.9rem;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 10px #00ffff;
}

.health-value {
    color: #ffff00;
    font-weight: 900;
    font-size: 1.1rem;
    text-shadow: 0 0 10px #ffff00;
}

.health-bar-bg {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #00ffff;
    border-radius: 10px;
    height: 30px;
    position: relative;
    overflow: hidden;
    box-shadow:
        inset 0 2px 10px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(0, 255, 255, 0.3);
}

.health-bar {
    height: 100%;
    background: linear-gradient(90deg, #00ff00, #00ffff);
    border-radius: 8px;
    transition: width 0.3s ease, background 0.3s ease;
    position: relative;
    box-shadow:
        0 0 30px rgba(0, 255, 255, 0.8),
        inset 0 0 20px rgba(255, 255, 255, 0.3);
}

.health-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.4), transparent);
    border-radius: 8px 8px 0 0;
}

.health-bar.medium {
    background: linear-gradient(90deg, #ffaa00, #ffff00);
    box-shadow:
        0 0 30px rgba(255, 170, 0, 0.8),
        inset 0 0 20px rgba(255, 255, 255, 0.3);
}

.health-bar.low {
    background: linear-gradient(90deg, #ff0000, #ff00ff);
    box-shadow:
        0 0 40px rgba(255, 0, 255, 1),
        inset 0 0 20px rgba(255, 255, 255, 0.3);
    animation: healthPulse 0.5s ease-in-out infinite;
}

@keyframes healthPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

#gameCanvas {
    border: 3px solid #00ffff;
    box-shadow:
        0 0 20px rgba(0, 255, 255, 0.9),
        0 0 40px rgba(0, 255, 255, 0.5),
        inset 0 0 80px rgba(0, 255, 255, 0.15),
        inset 0 0 100px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 600px;
    height: auto;
    aspect-ratio: 4 / 3;
    touch-action: none;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
    z-index: 2;
    position: relative;
    background: #000;
    filter: contrast(1.15) brightness(1.05);
    image-rendering: pixelated;
}

/* PC Screen Optimization - Centered canvas */
@media (min-width: 1200px) {
    body {
        padding: 5px 10px 5px 10px;
        gap: 4px;
        justify-content: flex-start;
    }

    #gameCanvas {
        max-width: 600px;
    }

    .game-wrapper {
        max-width: 100%;
        gap: 4px;
    }

    .canvas-container {
        max-width: 100%;
        padding: 8px;
    }

    .desktop-layout {
        gap: 15px;
        padding: 0 10px;
        margin-top: 3px;
        margin-bottom: 5px;
    }

    h1 {
        font-size: 1.5rem;
        letter-spacing: 5px;
        margin-bottom: 3px;
        margin-top: 3px;
        padding: 6px 12px;
    }

    .hud {
        max-width: 640px;
        padding: 5px 10px;
    }




    .side-panel {
        padding: 12px;
        width: 180px;
        font-size: 0.85rem;
    }

    .panel-title {
        font-size: 0.85rem;
        margin-bottom: 10px;
        padding-bottom: 6px;
    }

    .enemy-item,
    .control-item {
        margin-bottom: 8px;
        padding: 6px;
    }

    .enemy-name,
    .control-desc {
        font-size: 0.75rem;
    }

    .enemy-stats,
    .tips-list p,
    .boss-list p {
        font-size: 0.7rem;
    }

    kbd {
        padding: 6px 10px;
        font-size: 0.8rem;
        min-width: 35px;
    }

    kbd.key-large {
        padding: 10px 16px;
        font-size: 0.85rem;
        min-width: 80px;
    }

    .control-item {
        margin-bottom: 12px;
        padding: 8px;
    }

    .control-desc {
        font-size: 0.85rem;
    }
}

/* Viewport height adjustments for shorter screens */
@media (min-width: 1200px) and (max-height: 850px) {
    body {
        padding: 3px 10px 3px 10px;
        gap: 3px;
    }

    h1 {
        font-size: 1.4rem;
        letter-spacing: 4px;
        margin-bottom: 2px;
        margin-top: 2px;
        padding: 5px 10px;
    }

    .hud {
        padding: 4px 10px;
    }


    .canvas-container {
        padding: 6px;
    }

    .desktop-layout {
        gap: 12px;
        margin-top: 2px;
        margin-bottom: 3px;
    }
}

@media (min-width: 1200px) and (max-height: 780px) {
    body {
        padding: 2px 10px 2px 10px;
        gap: 2px;
    }

    h1 {
        font-size: 1.3rem;
        letter-spacing: 3px;
        margin-bottom: 1px;
        margin-top: 1px;
        padding: 4px 8px;
    }

    .hud {
        padding: 3px 8px;
    }


    .canvas-container {
        padding: 5px;
    }

    .desktop-layout {
        gap: 10px;
        margin-top: 1px;
        margin-bottom: 2px;
    }

    .side-panel {
        padding: 10px;
        font-size: 0.8rem;
    }
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(0, 20, 40, 0.98), rgba(0, 0, 0, 0.99));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    z-index: 100;
    backdrop-filter: blur(5px);
    padding: 15px;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
}

.overlay h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    margin-top: 10px;
    font-weight: 900;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-align: center;
    padding: 10px 15px;
    background: linear-gradient(135deg, #0a0a0a, #1a1a1a);
    border: 2px solid rgba(0, 255, 255, 0.5);
    border-radius: 6px;
    box-shadow:
        0 0 20px rgba(0, 255, 255, 0.3),
        inset 0 0 15px rgba(0, 0, 0, 0.8);
}

.start-title {
    background: linear-gradient(45deg, #00ffff, #ff00ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGlow 2s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { filter: drop-shadow(0 0 20px #00ffff) drop-shadow(0 0 40px #ff00ff); }
    50% { filter: drop-shadow(0 0 40px #00ffff) drop-shadow(0 0 60px #ff00ff); }
}

.game-over-title {
    background: linear-gradient(45deg, #ff0000, #ff00ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 30px rgba(255, 0, 255, 1));
}

.pause-title {
    background: linear-gradient(45deg, #00ffff, #00ff00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 30px rgba(0, 255, 255, 1));
    animation: titleGlow 2s ease-in-out infinite;
}

.pause-info {
    font-size: 1rem;
    color: #00ffff;
    margin: 10px 0;
    text-shadow: 0 0 15px rgba(0, 255, 255, 1);
    font-weight: 600;
    text-align: center;
}

.pause-info kbd {
    font-size: 0.9rem;
    padding: 5px 10px;
    margin: 0 3px;
}

.mobile-pause-info {
    display: none;
}

/* SETTINGS MENU STYLES */
.settings-overlay {
    max-width: 600px;
    margin: 0 auto;
}

.settings-title {
    background: linear-gradient(45deg, #ffaa00, #ff00ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 30px rgba(255, 170, 0, 1));
    animation: titleGlow 2s ease-in-out infinite;
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 550px;
    margin: 0 auto;
}

.settings-section {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #00ffff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.settings-section-title {
    color: #00ffff;
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(0, 255, 255, 1);
}

.setting-item {
    margin-bottom: 15px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-item label {
    display: block;
    color: #88ddff;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: linear-gradient(to right, #003366, #0066cc);
    border-radius: 4px;
    outline: none;
    border: 1px solid #00ffff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #00ffff, #0088ff);
    border: 2px solid #00ffff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
    transition: all 0.2s;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 25px rgba(0, 255, 255, 1);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #00ffff, #0088ff);
    border: 2px solid #00ffff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
    transition: all 0.2s;
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 25px rgba(0, 255, 255, 1);
}

.slider-value {
    color: #00ffff;
    font-size: 0.8rem;
    font-weight: 700;
    min-width: 45px;
    text-align: right;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

.settings-select {
    width: 100%;
    padding: 10px 15px;
    background: rgba(0, 30, 60, 0.8);
    color: #00ffff;
    border: 2px solid #00ffff;
    border-radius: 6px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
    transition: all 0.2s;
}

.settings-select:hover {
    background: rgba(0, 40, 80, 0.9);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.settings-select:focus {
    border-color: #00ff00;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

.settings-select option {
    background: #001a33;
    color: #00ffff;
    padding: 10px;
}

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

.controls-display p {
    color: #88ddff;
    font-size: 0.65rem;
    margin: 0;
    padding: 8px 12px;
    background: rgba(0, 100, 150, 0.2);
    border-left: 3px solid #00ffff;
    border-radius: 4px;
}

.controls-display kbd {
    background: rgba(0, 255, 255, 0.2);
    border: 1px solid #00ffff;
    border-radius: 3px;
    padding: 3px 6px;
    font-size: 0.6rem;
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.3);
}

.settings-button {
    padding: 12px 35px;
    font-size: 0.9rem;
    margin: 5px 0;
}

.settings-button.primary {
    background: radial-gradient(ellipse at top, #00cc00 0%, #008800 50%, #005500 100%);
    box-shadow:
        0 0 0 2px #004400,
        0 0 0 4px #000,
        0 0 30px rgba(0, 255, 0, 0.8),
        0 6px 0 #002200,
        inset 0 4px 15px rgba(255, 255, 255, 0.2),
        inset 0 -4px 15px rgba(0, 0, 0, 0.5);
}

.settings-button.primary:hover {
    box-shadow:
        0 0 0 2px #004400,
        0 0 0 4px #000,
        0 0 40px rgba(0, 255, 0, 1),
        0 3px 0 #002200,
        inset 0 4px 15px rgba(255, 255, 255, 0.3),
        inset 0 -4px 15px rgba(0, 0, 0, 0.5);
}

.settings-button.danger {
    background: radial-gradient(ellipse at top, #cc4400 0%, #882200 50%, #550000 100%);
    box-shadow:
        0 0 0 2px #440000,
        0 0 0 4px #000,
        0 0 30px rgba(255, 100, 0, 0.8),
        0 6px 0 #220000,
        inset 0 4px 15px rgba(255, 255, 255, 0.2),
        inset 0 -4px 15px rgba(0, 0, 0, 0.5);
}

.settings-button.danger:hover {
    box-shadow:
        0 0 0 2px #440000,
        0 0 0 4px #000,
        0 0 40px rgba(255, 100, 0, 1),
        0 3px 0 #220000,
        inset 0 4px 15px rgba(255, 255, 255, 0.3),
        inset 0 -4px 15px rgba(0, 0, 0, 0.5);
}

.final-score {
    font-size: 1.2rem;
    color: #ffff00;
    margin-bottom: 15px;
    text-shadow: 0 0 20px rgba(255, 255, 0, 1);
    font-weight: 700;
    text-align: center;
}

button {
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 900;
    background:
        radial-gradient(ellipse at top, #ff0000 0%, #cc0000 50%, #990000 100%);
    color: #fff;
    border: 3px solid #000;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Orbitron', 'Segoe UI', sans-serif;
    box-shadow:
        0 0 0 2px #660000,
        0 0 0 4px #000,
        0 0 30px rgba(255, 0, 0, 0.8),
        0 6px 0 #330000,
        inset 0 4px 15px rgba(255, 255, 255, 0.2),
        inset 0 -4px 15px rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: visible;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.8),
        0 0 10px rgba(255, 255, 255, 0.5);
    margin: 10px 0;
}

button::before {
    content: '●';
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    font-size: 0.6rem;
    color: #00ff00;
    text-shadow: 0 0 15px #00ff00;
    animation: buttonLED 1s infinite;
}

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

button::after {
    content: '▼ PRESS ▼';
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.45rem;
    color: #666;
    letter-spacing: 1px;
}

button:hover {
    transform: translateY(3px);
    box-shadow:
        0 0 0 2px #660000,
        0 0 0 4px #000,
        0 0 40px rgba(255, 0, 0, 1),
        0 3px 0 #330000,
        inset 0 4px 15px rgba(255, 255, 255, 0.3),
        inset 0 -4px 15px rgba(0, 0, 0, 0.6);
}

button:active {
    transform: translateY(6px);
    box-shadow:
        0 0 0 2px #660000,
        0 0 0 4px #000,
        0 0 50px rgba(255, 0, 0, 1),
        0 0px 0 #330000,
        inset 0 4px 15px rgba(255, 255, 255, 0.1),
        inset 0 -4px 20px rgba(0, 0, 0, 0.8);
}

button span {
    position: relative;
    z-index: 1;
}

.instructions {
    margin-top: 20px;
    text-align: center;
    line-height: 1.6;
    background: rgba(0, 255, 255, 0.05);
    padding: 15px 20px;
    border-radius: 15px;
    border: 2px solid;
    border-image: linear-gradient(45deg, #00ffff, #ff00ff) 1;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.2);
    max-width: 90%;
}

.instructions p {
    margin: 5px 0;
    color: #aaddff;
    font-size: 0.9rem;
}

.section-title {
    color: #00ffff;
    font-weight: 700;
    font-size: 0.95rem;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 10px #00ffff;
}

.info-text {
    text-align: center;
    color: #888;
    font-size: 0.9rem;
    width: 100%;
    line-height: 1.6;
    z-index: 2;
    position: relative;
}

.enemy-info {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.enemy-type {
    background: rgba(0, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 8px;
    border: 2px solid rgba(0, 255, 255, 0.4);
    font-size: 0.85rem;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}

.mobile-tip {
    color: #00ff88;
    font-size: 0.9rem;
    margin-top: 10px;
    font-weight: 600;
    text-shadow: 0 0 10px #00ff88;
}

.canvas-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    padding: 8px;
    background:
        linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%);
    border: 4px solid #000;
    border-radius: 12px;
    box-shadow:
        0 0 0 2px #333,
        0 0 0 3px #000,
        0 0 30px rgba(0, 255, 255, 0.3),
        inset 0 0 30px rgba(0, 0, 0, 0.8),
        inset 0 10px 20px rgba(0, 255, 255, 0.08);
}

.canvas-container::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 255, 255, 0.02) 2px,
            rgba(0, 255, 255, 0.02) 4px
        );
    pointer-events: none;
    z-index: 5;
    border-radius: 4px;
}

.canvas-container::after {
    content: 'INSERT COIN';
    position: absolute;
    top: 3px;
    right: 15px;
    font-size: 0.5rem;
    color: #ff0000;
    text-shadow: 0 0 6px #ff0000;
    letter-spacing: 1px;
    font-weight: 900;
    animation: coinBlink 1.5s infinite;
    z-index: 6;
}

@keyframes coinBlink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.game-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: 100%;
    max-width: 100%;
    position: relative;
}

/* Arcade corner decorations */
.game-wrapper::before {
    content: '⚠ HIGH VOLTAGE ⚠';
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    padding: 2px 12px;
    border: 2px solid #ffff00;
    border-radius: 3px;
    font-size: 0.45rem;
    color: #ffff00;
    text-shadow: 0 0 8px #ffff00;
    letter-spacing: 1px;
    font-weight: 900;
    box-shadow: 0 0 12px rgba(255, 255, 0, 0.6);
    z-index: 5;
}

@media (max-width: 600px) {
    body {
        padding: 5px;
        gap: 5px;
        height: auto;
        min-height: 100vh;
    }

    h1 {
        font-size: 1.4rem;
        letter-spacing: 3px;
        margin-bottom: 5px;
        padding: 5px;
    }

    .hud {
        padding: 8px 10px;
        padding-top: 16px;
    }



    #pauseButton,
    #muteButton {
        font-size: 0.9rem;
        padding: 5px 10px;
        margin-left: 0;
        order: 3;
    }

    #pauseButton {
        margin-right: 5px;
    }

    .mobile-pause-info {
        display: block;
    }

    .pause-info:not(.mobile-pause-info) {
        display: none;
    }



    .health-label {
        font-size: 0.75rem;
        margin-bottom: 5px;
    }

    .health-value {
        font-size: 0.85rem;
    }

    .health-bar-bg {
        height: 20px;
    }

    .canvas-container {
        padding: 5px;
        border: 3px solid #000;
        border-radius: 8px;
    }

    #gameCanvas {
        border: 2px solid #00ffff;
        border-radius: 3px;
    }

    .overlay {
        padding: 10px;
    }

    .overlay h2 {
        font-size: 1.1rem;
        padding: 8px 15px;
        text-align: center;
        letter-spacing: 1px;
        margin-bottom: 10px;
        margin-top: 5px;
    }

    button {
        padding: 10px 25px;
        font-size: 0.85rem;
    }

    .instructions {
        padding: 10px 12px;
        margin-top: 10px;
    }

    .instructions p {
        font-size: 0.75rem;
    }

    .section-title {
        font-size: 0.8rem;
        margin-top: 6px;
    }

    .final-score {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }

    .enemy-info {
        gap: 6px;
        flex-wrap: wrap;
    }

    .enemy-type {
        font-size: 0.65rem;
        padding: 5px 8px;
    }

    .info-text {
        font-size: 0.8rem;
    }

    .mobile-tip {
        font-size: 0.75rem;
        margin-top: 8px;
    }

    .game-wrapper {
        gap: 4px;
    }

    .game-wrapper::before {
        font-size: 0.4rem;
        padding: 2px 10px;
        bottom: -18px;
    }
}

@media (max-width: 400px) {
    body {
        padding: 3px;
        gap: 3px;
    }

    h1 {
        font-size: 1.2rem;
        letter-spacing: 2px;
        padding: 4px;
        margin-bottom: 3px;
    }

    .hud {
        padding: 6px 8px;
        padding-top: 14px;
    }





    .health-label {
        font-size: 0.7rem;
    }

    .health-value {
        font-size: 0.8rem;
    }

    .health-bar-bg {
        height: 18px;
    }

    .canvas-container {
        padding: 4px;
        border: 2px solid #000;
    }

    #gameCanvas {
        border: 2px solid #00ffff;
    }

    .enemy-type {
        font-size: 0.6rem;
        padding: 4px 6px;
    }

    .overlay h2 {
        font-size: 1rem;
        letter-spacing: 0.5px;
        padding: 6px 12px;
    }

    button {
        padding: 8px 20px;
        font-size: 0.8rem;
    }

    .instructions {
        padding: 8px 10px;
        margin-top: 8px;
    }

    .instructions p {
        font-size: 0.7rem;
    }

    .mobile-tip {
        font-size: 0.7rem;
    }

    .final-score {
        font-size: 1rem;
    }

    #pauseButton,
    #muteButton {
        font-size: 0.85rem;
        padding: 4px 8px;
    }

    #pauseButton {
        margin-right: 4px;
    }

    .pause-info {
        font-size: 0.85rem;
    }

    .pause-info kbd {
        font-size: 0.75rem;
        padding: 3px 7px;
    }
}

/* ===== DESKTOP LAYOUT WITH SIDE PANELS ===== */
.desktop-layout {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 1400px;
    justify-content: center;
    align-items: flex-start;
    z-index: 2;
    position: relative;
    padding: 0 5px 30px 5px;
    margin-top: 8px;
}

.side-panel {
    background:
        linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 50%, #1a1a1a 100%);
    border: 3px solid #000;
    border-radius: 10px;
    padding: 8px 6px 6px 6px;
    width: 150px;
    max-height: 75vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow:
        0 0 0 2px #333,
        0 0 0 3px #000,
        0 0 30px rgba(0, 255, 255, 0.3),
        inset 0 0 30px rgba(0, 0, 0, 0.8),
        inset 0 8px 20px rgba(0, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    position: relative;
    margin-top: 0;
}

.side-panel::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 8px;
    pointer-events: none;
}


.panel-title {
    color: #00ffff;
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    text-shadow: 0 0 6px #00ffff;
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
    padding-bottom: 2px;
}

/* Arcade Button Keys Styling */
kbd {
    background:
        radial-gradient(ellipse at top, #00ccff 0%, #0099cc 40%, #006699 100%);
    border: 1px solid #000;
    border-radius: 3px;
    padding: 3px 4px;
    font-family: 'Orbitron', monospace;
    font-size: 0.5rem;
    font-weight: 900;
    color: #fff;
    box-shadow:
        0 0 0 1px #003344,
        0 0 0 1px #000,
        0 0 8px rgba(0, 255, 255, 0.4),
        0 2px 0 #002233,
        inset 0 1px 3px rgba(255, 255, 255, 0.3),
        inset 0 -1px 3px rgba(0, 0, 0, 0.5);
    display: inline-block;
    min-width: 16px;
    text-align: center;
    margin: 1px;
    text-shadow:
        0 1px 1px rgba(0, 0, 0, 0.8),
        0 0 4px rgba(255, 255, 255, 0.4);
    transition: all 0.1s;
    position: relative;
}

kbd:hover {
    transform: translateY(2px);
    box-shadow:
        0 0 0 2px #003344,
        0 0 0 4px #000,
        0 0 25px rgba(0, 255, 255, 0.8),
        0 3px 0 #002233,
        inset 0 3px 10px rgba(255, 255, 255, 0.4),
        inset 0 -3px 10px rgba(0, 0, 0, 0.6);
}

kbd.key-large {
    padding: 4px 6px;
    font-size: 0.5rem;
    min-width: 35px;
    background:
        radial-gradient(ellipse at top, #ff9900 0%, #cc6600 40%, #994400 100%);
    box-shadow:
        0 0 0 1px #663300,
        0 0 0 1px #000,
        0 0 8px rgba(255, 153, 0, 0.4),
        0 2px 0 #442200,
        inset 0 1px 3px rgba(255, 255, 255, 0.3),
        inset 0 -1px 3px rgba(0, 0, 0, 0.5);
}

kbd.key-large:hover {
    box-shadow:
        0 0 0 2px #663300,
        0 0 0 4px #000,
        0 0 25px rgba(255, 153, 0, 0.8),
        0 3px 0 #442200,
        inset 0 3px 10px rgba(255, 255, 255, 0.4),
        inset 0 -3px 10px rgba(0, 0, 0, 0.6);
}

.key-group {
    display: inline-block;
    text-align: center;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
    padding: 3px;
    background:
        linear-gradient(135deg, rgba(10, 10, 10, 0.8), rgba(20, 20, 20, 0.6));
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 4px;
    box-shadow:
        inset 0 1px 3px rgba(0, 0, 0, 0.6),
        0 1px 3px rgba(0, 255, 255, 0.1);
}

.control-desc {
    color: #aaddff;
    font-size: 0.5rem;
    font-weight: 600;
}

/* Mobile Controls Info */
.mobile-controls-info p,
.objective-info p,
.tips-list p {
    color: #aaddff;
    font-size: 0.5rem;
    margin: 2px 0;
    line-height: 1.2;
}

/* Enemy List */
.enemy-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.enemy-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    background: rgba(0, 255, 255, 0.05);
    border-radius: 5px;
    border-left: 2px solid rgba(0, 255, 255, 0.4);
}

.enemy-icon {
    font-size: 0.8rem;
    flex-shrink: 0;
}

.enemy-details {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.enemy-name {
    color: #00ffff;
    font-weight: 700;
    font-size: 0.5rem;
}

.enemy-stats {
    color: #ffff00;
    font-size: 0.45rem;
}

/* Power-up List */
.powerup-list p {
    color: #aaddff;
    font-size: 0.5rem;
    margin: 2px 0;
    line-height: 1.2;
}

.powerup-list strong {
    color: #ffff00;
    text-shadow: 0 0 5px #ffff00;
    font-size: 0.5rem;
}

/* Boss List */
.boss-list p {
    color: #aaddff;
    font-size: 0.5rem;
    margin: 2px 0;
    line-height: 1.2;
}

.boss-list strong {
    color: #ff00ff;
    text-shadow: 0 0 5px #ff00ff;
    font-size: 0.5rem;
}

/* Mobile Info - Hidden on Desktop */
.mobile-info {
    display: none;
}

/* Improved Start Instructions */
.start-instructions {
    background: rgba(0, 255, 255, 0.05);
    padding: 10px;
    border-radius: 8px;
    border: 2px solid rgba(0, 255, 255, 0.3);
    margin: 8px 0;
    max-width: 550px;
    width: 100%;
}

.start-instructions h3 {
    color: #00ffff;
    text-align: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
    text-shadow: 0 0 8px #00ffff;
}

.instruction-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    text-align: center;
}

.instruction-col {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px;
    border-radius: 6px;
    border: 1px solid rgba(0, 255, 255, 0.2);
}

.instruction-header {
    color: #00ffff;
    font-weight: 700;
    font-size: 0.7rem;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 6px #00ffff;
}

.instruction-col p {
    color: #aaddff;
    font-size: 0.7rem;
    margin: 4px 0;
    line-height: 1.3;
}

.instruction-col kbd {
    font-size: 0.6rem;
    padding: 2px 5px;
    margin: 0 2px;
    min-width: 20px;
}

/* Difficulty Selector */
.difficulty-selector {
    margin: 20px auto 15px;
    max-width: 600px;
}

.difficulty-selector-title {
    color: #ff8800;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 12px;
    text-shadow: 0 0 15px #ff8800;
    letter-spacing: 2px;
}

.difficulty-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.difficulty-button {
    background: linear-gradient(135deg, rgba(100, 0, 0, 0.3), rgba(50, 0, 0, 0.3));
    border: 2px solid rgba(255, 100, 0, 0.3);
    padding: 12px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    box-shadow: 0 0 15px rgba(255, 100, 0, 0.1);
    font-family: 'Orbitron', sans-serif;
}

.difficulty-button:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 100, 0, 0.8);
    background: linear-gradient(135deg, rgba(150, 0, 0, 0.4), rgba(75, 0, 0, 0.4));
    box-shadow: 0 0 25px rgba(255, 100, 0, 0.4);
}

.difficulty-button.active {
    border: 2px solid #ff8800;
    background: linear-gradient(135deg, rgba(255, 136, 0, 0.3), rgba(200, 100, 0, 0.3));
    box-shadow: 0 0 30px rgba(255, 136, 0, 0.6);
}

.difficulty-name {
    color: #ff8800;
    font-size: 1.1rem;
    font-weight: bold;
    text-shadow: 0 0 10px #ff8800;
}

.difficulty-button.active .difficulty-name {
    color: #ffff00;
    text-shadow: 0 0 15px #ffff00;
}

.difficulty-desc {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.65rem;
    text-align: center;
    line-height: 1.3;
}

.difficulty-button.active .difficulty-desc {
    color: rgba(255, 255, 255, 0.9);
}

/* Music Selector */
.music-selector {
    margin: 20px auto 15px;
    max-width: 600px;
}

.music-selector-title {
    color: #ffff00;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 12px;
    text-shadow: 0 0 15px #ffff00;
    letter-spacing: 2px;
}

.music-tracks {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.track-button {
    background: linear-gradient(135deg, rgba(0, 100, 100, 0.3), rgba(0, 50, 50, 0.3));
    border: 2px solid rgba(0, 255, 255, 0.3);
    padding: 10px 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.1);
    font-family: 'Orbitron', sans-serif;
}

.track-button:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 255, 255, 0.8);
    background: linear-gradient(135deg, rgba(0, 150, 150, 0.4), rgba(0, 75, 75, 0.4));
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.4);
}

.track-button.active {
    border: 2px solid #ffff00;
    background: linear-gradient(135deg, rgba(255, 255, 0, 0.2), rgba(200, 200, 0, 0.2));
    box-shadow: 0 0 30px rgba(255, 255, 0, 0.6);
}

.track-button.active .track-number {
    color: #ffff00;
    text-shadow: 0 0 10px #ffff00;
}

.track-button.active .track-name {
    color: #ffff00;
}

.track-number {
    color: #00ffff;
    font-size: 1.4rem;
    font-weight: 900;
    text-shadow: 0 0 10px #00ffff;
}

.track-name {
    color: #aaddff;
    font-size: 0.55rem;
    text-align: center;
    line-height: 1.2;
}

/* Ship Skin Selector */
.skin-selector {
    margin: 20px auto 15px;
    max-width: 600px;
}

.skin-selector-title {
    color: #ff00ff;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 12px;
    text-shadow: 0 0 15px #ff00ff;
    letter-spacing: 2px;
}

.skin-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.skin-button {
    background: linear-gradient(135deg, rgba(50, 0, 50, 0.3), rgba(25, 0, 25, 0.3));
    border: 2px solid rgba(255, 0, 255, 0.3);
    padding: 12px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.1);
    font-family: 'Orbitron', sans-serif;
}

.skin-button:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 0, 255, 0.8);
    background: linear-gradient(135deg, rgba(100, 0, 100, 0.4), rgba(50, 0, 50, 0.4));
    box-shadow: 0 0 25px rgba(255, 0, 255, 0.4);
}

.skin-button.active {
    border: 2px solid #00ffff;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.2), rgba(0, 150, 150, 0.2));
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.6);
}

.skin-preview {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.skin-button:hover .skin-preview {
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.6);
}

.skin-button.active .skin-preview {
    box-shadow: 0 0 30px rgba(0, 255, 255, 1);
    animation: skinPulse 1.5s ease-in-out infinite;
}

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

.skin-name {
    color: #ccaaff;
    font-size: 0.65rem;
    text-align: center;
    line-height: 1.2;
    font-weight: 600;
}

.skin-button.active .skin-name {
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
}

/* Game Mode Selector */
.mode-selector {
    margin: 20px auto 15px;
    max-width: 600px;
}

.mode-selector-title {
    color: #00ffff;
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 12px;
    text-shadow: 0 0 15px #00ffff;
    letter-spacing: 2px;
}

.mode-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.mode-button {
    background: linear-gradient(135deg, rgba(0, 50, 50, 0.3), rgba(0, 25, 25, 0.3));
    border: 2px solid rgba(0, 255, 255, 0.3);
    padding: 20px 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.1);
    font-family: 'Orbitron', sans-serif;
}

.mode-button:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 255, 255, 0.8);
    background: linear-gradient(135deg, rgba(0, 100, 100, 0.4), rgba(0, 50, 50, 0.4));
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.4);
}

.mode-button.active {
    border: 3px solid #00ffff;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.25), rgba(0, 150, 150, 0.25));
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.7);
}

.mode-icon {
    font-size: 2.5rem;
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

.mode-button:hover .mode-icon {
    transform: scale(1.15);
}

.mode-button.active .mode-icon {
    animation: modePulse 2s ease-in-out infinite;
}

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

.mode-name {
    color: #88dddd;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mode-button.active .mode-name {
    color: #00ffff;
    text-shadow: 0 0 12px #00ffff;
}

.mode-desc {
    color: #6699aa;
    font-size: 0.65rem;
    text-align: center;
    line-height: 1.3;
    font-weight: 400;
}

.mode-button.active .mode-desc {
    color: #88cccc;
}

/* Performance Notice */
.performance-notice {
    margin: 15px auto 10px;
    padding: 15px;
    max-width: 500px;
    background: rgba(255, 100, 0, 0.1);
    border: 2px solid rgba(255, 100, 0, 0.3);
    border-radius: 8px;
    text-align: center;
    animation: noticePulse 2s ease-in-out infinite;
}

@keyframes noticePulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 100, 0, 0.3); }
    50% { box-shadow: 0 0 20px rgba(255, 100, 0, 0.6); }
}

.performance-notice-title {
    color: #ff6600;
    font-size: 0.7rem;
    font-weight: 900;
    margin-bottom: 8px;
    text-shadow: 0 0 8px rgba(255, 100, 0, 0.8);
}

.performance-notice-text {
    color: #ffaa66;
    font-size: 0.55rem;
    line-height: 1.4;
    margin: 5px 0;
}

.performance-notice-emoji {
    font-size: 1.2rem;
    margin: 0 5px;
}

/* ===== RESPONSIVE: HIDE SIDE PANELS BELOW 1440px ===== */
@media (max-width: 1439px) {
    .side-panel {
        display: none !important;
    }

    .desktop-layout {
        justify-content: center;
    }

    body {
        padding: 10px;
    }

    .game-wrapper {
        width: 100%;
        max-width: 100%;
    }

    .canvas-container {
        max-width: 100%;
    }

    #gameCanvas {
        max-width: 100%;
        width: 100%;
    }

    .hud {
        max-width: 100%;
        width: 100%;
    }

    h1 {
        font-size: 2.5rem;
        letter-spacing: 10px;
    }
}

/* ===== RESPONSIVE: TABLET ===== */
@media (max-width: 1200px) {
    h1 {
        font-size: 2rem;
        letter-spacing: 8px;
    }
}

/* ===== RESPONSIVE: TABLET TO MOBILE ===== */
@media (max-width: 768px) {
    body {
        padding: 8px;
        gap: 8px;
        height: auto;
        min-height: 100vh;
    }

    h1 {
        font-size: 1.6rem;
        letter-spacing: 4px;
        margin-bottom: 8px;
    }

    /* Show mobile info */
    .mobile-info {
        display: block;
        width: 100%;
        z-index: 2;
        position: relative;
        margin-bottom: 10px;
    }

    .desktop-layout {
        flex-direction: column;
    }

    .hud {
        padding: 10px 15px;
        padding-top: 18px;
    }





    .canvas-container {
        padding: 6px;
    }

    /* Adjust start instructions for mobile */
    .start-instructions {
        padding: 12px;
        max-width: 100%;
    }

    .start-instructions h3 {
        font-size: 0.95rem;
    }

    .instruction-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .instruction-col {
        padding: 10px;
    }

    .instruction-header {
        font-size: 0.8rem;
    }

    .instruction-col p {
        font-size: 0.8rem;
    }

    kbd {
        font-size: 0.75rem;
        padding: 4px 8px;
        min-width: 30px;
    }

    .music-tracks {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .track-button {
        padding: 12px 8px;
    }

    .music-selector-title {
        font-size: 1rem;
    }

    /* Stack mode buttons vertically on mobile */
    .mode-grid {
        grid-template-columns: 1fr;
    }

    .mode-button {
        padding: 15px 12px;
    }

    .track-number {
        font-size: 1.6rem;
    }

    .track-name {
        font-size: 0.65rem;
    }
}

/* ===== ANIMATED SPLASH SCREEN ===== */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #001a33 0%, #000000 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    overflow: hidden;
    animation: splashPulseIntense 2s ease-in-out infinite;
}

@keyframes splashPulseIntense {
    0%, 100% {
        background: radial-gradient(ellipse at 30% 40%, #002244 0%, #000000 50%, #001122 100%);
        box-shadow: inset 0 0 200px rgba(0, 255, 255, 0.1);
    }
    25% {
        background: radial-gradient(ellipse at 70% 60%, #003355 0%, #000011 50%, #002233 100%);
        box-shadow: inset 0 0 200px rgba(255, 0, 255, 0.15);
    }
    50% {
        background: radial-gradient(ellipse at 50% 50%, #002255 0%, #000022 50%, #001133 100%);
        box-shadow: inset 0 0 200px rgba(0, 255, 255, 0.2);
    }
    75% {
        background: radial-gradient(ellipse at 40% 30%, #002244 0%, #000000 50%, #001122 100%);
        box-shadow: inset 0 0 200px rgba(255, 255, 0, 0.1);
    }
}

/* Animated starfield */
.splash-stars {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20px 30px, white, transparent),
        radial-gradient(2px 2px at 60px 70px, white, transparent),
        radial-gradient(1px 1px at 50px 50px, white, transparent),
        radial-gradient(1px 1px at 130px 80px, white, transparent),
        radial-gradient(2px 2px at 90px 10px, white, transparent);
    background-size: 200px 200px;
    background-repeat: repeat;
    animation: starScroll 20s linear infinite;
    opacity: 0.5;
}

@keyframes starScroll {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-200px, 0); }
}

/* UFO Spaceship */
.splash-ufo {
    position: absolute;
    left: -200px;
    top: 30%;
    animation: ufoFly 8s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(0, 255, 255, 0.8));
}

.ufo-body {
    width: 80px;
    height: 25px;
    background: linear-gradient(135deg, #00ffff, #0099cc);
    border-radius: 50% 50% 20% 20%;
    position: relative;
    box-shadow:
        0 0 20px rgba(0, 255, 255, 0.8),
        inset 0 -5px 10px rgba(0, 0, 0, 0.5);
}

.ufo-dome {
    width: 40px;
    height: 20px;
    background: linear-gradient(180deg, rgba(0, 255, 255, 0.6), rgba(0, 255, 255, 0.2));
    border-radius: 50% 50% 0 0;
    position: absolute;
    top: -15px;
    left: 20px;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.6);
}

.ufo-light {
    width: 60px;
    height: 80px;
    background: linear-gradient(180deg, rgba(255, 255, 0, 0.3) 0%, transparent 100%);
    position: absolute;
    top: 25px;
    left: 10px;
    clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
    animation: lightPulse 1s ease-in-out infinite;
}

@keyframes lightPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

@keyframes ufoFly {
    0% {
        left: -200px;
        top: 50%;
        transform: rotate(0deg) scale(1);
    }
    3% {
        left: 5%;
        top: 48%;
        transform: rotate(-8deg) scale(1.1);
    }
    8% {
        left: 15%;
        top: 40%;
        transform: rotate(3deg) scale(1);
    }
    12% {
        left: 25%;
        top: 25%;
        transform: rotate(-12deg) scale(1.15);
    }
    16% {
        left: 35%;
        top: 18%;
        transform: rotate(5deg) scale(1);
    }
    20% {
        left: 45%;
        top: 15%;
        transform: rotate(-5deg) scale(1.1);
    }
    24% {
        left: 55%;
        top: 20%;
        transform: rotate(8deg) scale(1);
    }
    28% {
        left: 65%;
        top: 28%;
        transform: rotate(-15deg) scale(1.2);
    }
    32% {
        left: 75%;
        top: 35%;
        transform: rotate(6deg) scale(1);
    }
    36% {
        left: 85%;
        top: 38%;
        transform: rotate(-8deg) scale(1.1);
    }
    40% {
        left: 92%;
        top: 40%;
        transform: rotate(3deg) scale(1);
    }
    44% {
        left: 98%;
        top: 38%;
        transform: rotate(-10deg) scale(1.15);
    }
    48% {
        left: 105%;
        top: 35%;
        transform: rotate(0deg) scale(1);
    }
    50% {
        left: 110%;
        top: 32%;
        transform: rotate(0deg) scale(0.8);
    }
    52% {
        left: 110%;
        top: 62%;
        transform: rotate(180deg) scale(0.8);
    }
    54% {
        left: 105%;
        top: 65%;
        transform: rotate(185deg) scale(1);
    }
    58% {
        left: 95%;
        top: 68%;
        transform: rotate(172deg) scale(1.1);
    }
    62% {
        left: 85%;
        top: 70%;
        transform: rotate(188deg) scale(1.15);
    }
    66% {
        left: 75%;
        top: 68%;
        transform: rotate(175deg) scale(1);
    }
    70% {
        left: 65%;
        top: 65%;
        transform: rotate(185deg) scale(1.1);
    }
    74% {
        left: 55%;
        top: 70%;
        transform: rotate(178deg) scale(1.2);
    }
    78% {
        left: 45%;
        top: 68%;
        transform: rotate(182deg) scale(1);
    }
    82% {
        left: 35%;
        top: 65%;
        transform: rotate(175deg) scale(1.1);
    }
    86% {
        left: 25%;
        top: 62%;
        transform: rotate(188deg) scale(1);
    }
    90% {
        left: 15%;
        top: 58%;
        transform: rotate(180deg) scale(1.15);
    }
    94% {
        left: 5%;
        top: 54%;
        transform: rotate(180deg) scale(1);
    }
    97% {
        left: -10%;
        top: 50%;
        transform: rotate(180deg) scale(0.9);
    }
    98% {
        left: -200px;
        top: 50%;
        transform: rotate(180deg) scale(0.8);
    }
    99% {
        left: -200px;
        top: 50%;
        transform: rotate(0deg) scale(0.8);
    }
    100% {
        left: -200px;
        top: 50%;
        transform: rotate(0deg) scale(1);
    }
}

/* Laser Shots - Enhanced with neon trails */
.splash-laser {
    position: absolute;
    width: 60px;
    height: 6px;
    background: linear-gradient(90deg, transparent, #00ffff, #ffffff, #00ffff, transparent);
    border-radius: 3px;
    box-shadow:
        0 0 20px #00ffff,
        0 0 40px rgba(0, 255, 255, 0.6),
        0 0 60px rgba(0, 255, 255, 0.3);
    opacity: 0;
}

/* Additional laser color variants */
.laser-2, .laser-5 {
    background: linear-gradient(90deg, transparent, #ff00ff, #ffffff, #ff00ff, transparent);
    box-shadow:
        0 0 20px #ff00ff,
        0 0 40px rgba(255, 0, 255, 0.6),
        0 0 60px rgba(255, 0, 255, 0.3);
}

.laser-3, .laser-6 {
    background: linear-gradient(90deg, transparent, #ffff00, #ffffff, #ffff00, transparent);
    box-shadow:
        0 0 20px #ffff00,
        0 0 40px rgba(255, 255, 0, 0.6),
        0 0 60px rgba(255, 255, 0, 0.3);
}

.laser-1 {
    animation: laser1Shot 8s ease-in-out infinite;
}

.laser-2 {
    animation: laser2Shot 8s ease-in-out infinite;
}

.laser-3 {
    animation: laser3Shot 8s ease-in-out infinite;
}

.laser-4 {
    animation: laser4Shot 8s ease-in-out infinite;
}

.laser-5 {
    animation: laser5Shot 8s ease-in-out infinite;
}

.laser-6 {
    animation: laser6Shot 8s ease-in-out infinite;
}

.laser-7 {
    animation: laser7Shot 8s ease-in-out infinite;
}

.laser-8 {
    animation: laser8Shot 8s ease-in-out infinite;
}

.laser-9 {
    animation: laser9Shot 8s ease-in-out infinite;
}

.laser-10 {
    animation: laser10Shot 8s ease-in-out infinite;
}

.laser-11 {
    animation: laser11Shot 8s ease-in-out infinite;
}

.laser-12 {
    animation: laser12Shot 8s ease-in-out infinite;
}

@keyframes laser1Shot {
    8% {
        left: 20%;
        top: calc(40% + 25px);
        opacity: 1;
    }
    12% {
        left: 35%;
        top: calc(35% + 25px);
        opacity: 1;
    }
    13% {
        opacity: 0;
    }
}

@keyframes laser2Shot {
    18% {
        left: 35%;
        top: calc(25% + 25px);
        opacity: 1;
    }
    22% {
        left: 50%;
        top: calc(22% + 25px);
        opacity: 1;
    }
    23% {
        opacity: 0;
    }
}

@keyframes laser3Shot {
    28% {
        left: 55%;
        top: calc(22% + 25px);
        opacity: 1;
    }
    32% {
        left: 70%;
        top: calc(25% + 25px);
        opacity: 1;
    }
    33% {
        opacity: 0;
    }
}

@keyframes laser4Shot {
    38% {
        left: 75%;
        top: calc(33% + 25px);
        opacity: 1;
    }
    42% {
        left: 90%;
        top: calc(38% + 25px);
        opacity: 1;
    }
    43% {
        opacity: 0;
    }
}

@keyframes laser5Shot {
    62% {
        left: 75%;
        top: calc(65% - 25px);
        opacity: 1;
        transform: rotate(180deg);
    }
    66% {
        left: 60%;
        top: calc(68% - 25px);
        opacity: 1;
        transform: rotate(180deg);
    }
    67% {
        opacity: 0;
    }
}

@keyframes laser6Shot {
    72% {
        left: 45%;
        top: calc(70% - 25px);
        opacity: 1;
        transform: rotate(180deg);
    }
    76% {
        left: 30%;
        top: calc(65% - 25px);
        opacity: 1;
        transform: rotate(180deg);
    }
    77% {
        opacity: 0;
    }
}

@keyframes laser7Shot {
    10% {
        left: 25%;
        top: calc(42% + 25px);
        opacity: 1;
    }
    14% {
        left: 40%;
        top: calc(30% + 25px);
        opacity: 1;
    }
    15% {
        opacity: 0;
    }
}

@keyframes laser8Shot {
    20% {
        left: 48%;
        top: calc(18% + 25px);
        opacity: 1;
    }
    24% {
        left: 63%;
        top: calc(24% + 25px);
        opacity: 1;
    }
    25% {
        opacity: 0;
    }
}

@keyframes laser9Shot {
    30% {
        left: 68%;
        top: calc(28% + 25px);
        opacity: 1;
    }
    34% {
        left: 83%;
        top: calc(36% + 25px);
        opacity: 1;
    }
    35% {
        opacity: 0;
    }
}

@keyframes laser10Shot {
    40% {
        left: 90%;
        top: calc(38% + 25px);
        opacity: 1;
    }
    44% {
        left: 105%;
        top: calc(40% + 25px);
        opacity: 1;
    }
    45% {
        opacity: 0;
    }
}

@keyframes laser11Shot {
    64% {
        left: 68%;
        top: calc(68% - 25px);
        opacity: 1;
        transform: rotate(180deg);
    }
    68% {
        left: 53%;
        top: calc(70% - 25px);
        opacity: 1;
        transform: rotate(180deg);
    }
    69% {
        opacity: 0;
    }
}

@keyframes laser12Shot {
    74% {
        left: 38%;
        top: calc(66% - 25px);
        opacity: 1;
        transform: rotate(180deg);
    }
    78% {
        left: 23%;
        top: calc(60% - 25px);
        opacity: 1;
        transform: rotate(180deg);
    }
    79% {
        opacity: 0;
    }
}

/* Enemy Ships */
.splash-enemy {
    position: absolute;
    opacity: 0;
}

.enemy-body {
    width: 40px;
    height: 30px;
    background: linear-gradient(135deg, #ff0066, #cc0044);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    box-shadow: 0 0 15px rgba(255, 0, 102, 0.8);
}

.enemy-explosion {
    position: absolute;
    top: -40px;
    left: -40px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    opacity: 0;
}

.enemy-explosion::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, #ffffff 0%, #ffff00 15%, #ff6600 35%, #ff0000 60%, transparent 100%);
    border-radius: 50%;
    animation: explosionPulse 0.6s ease-out;
    box-shadow:
        0 0 40px #ffff00,
        0 0 80px #ff6600,
        0 0 120px rgba(255, 0, 0, 0.6);
}

.enemy-explosion::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 0%, #00ffff 40%, #ff00ff 70%, transparent 100%);
    border-radius: 50%;
    animation: explosionRing 0.6s ease-out;
    box-shadow:
        0 0 60px #00ffff,
        0 0 100px rgba(255, 0, 255, 0.5);
}

@keyframes explosionPulse {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: scale(3) rotate(180deg);
        opacity: 0;
    }
}

@keyframes explosionRing {
    0% {
        transform: scale(0.5) rotate(0deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(4) rotate(-180deg);
        opacity: 0;
    }
}

.enemy-1 {
    animation: enemy1Appear 8s ease-in-out infinite;
}

.enemy-2 {
    animation: enemy2Appear 8s ease-in-out infinite;
}

.enemy-3 {
    animation: enemy3Appear 8s ease-in-out infinite;
}

.enemy-4 {
    animation: enemy4Appear 8s ease-in-out infinite;
}

.enemy-5 {
    animation: enemy5Appear 8s ease-in-out infinite;
}

.enemy-6 {
    animation: enemy6Appear 8s ease-in-out infinite;
}

@keyframes enemy1Appear {
    6% {
        left: 35%;
        top: 38%;
        opacity: 1;
        transform: rotate(0deg);
    }
    12% {
        left: 35%;
        top: 38%;
        opacity: 1;
        transform: rotate(0deg);
    }
    13% {
        opacity: 0;
    }
}

@keyframes enemy2Appear {
    16% {
        left: 50%;
        top: 24%;
        opacity: 1;
        transform: rotate(0deg);
    }
    22% {
        left: 50%;
        top: 24%;
        opacity: 1;
        transform: rotate(0deg);
    }
    23% {
        opacity: 0;
    }
}

@keyframes enemy3Appear {
    26% {
        left: 70%;
        top: 26%;
        opacity: 1;
        transform: rotate(0deg);
    }
    32% {
        left: 70%;
        top: 26%;
        opacity: 1;
        transform: rotate(0deg);
    }
    33% {
        opacity: 0;
    }
}

@keyframes enemy4Appear {
    36% {
        left: 88%;
        top: 38%;
        opacity: 1;
        transform: rotate(0deg);
    }
    42% {
        left: 88%;
        top: 38%;
        opacity: 1;
        transform: rotate(0deg);
    }
    43% {
        opacity: 0;
    }
}

@keyframes enemy5Appear {
    60% {
        left: 60%;
        top: 67%;
        opacity: 1;
        transform: rotate(180deg);
    }
    66% {
        left: 60%;
        top: 67%;
        opacity: 1;
        transform: rotate(180deg);
    }
    67% {
        opacity: 0;
    }
}

@keyframes enemy6Appear {
    70% {
        left: 30%;
        top: 63%;
        opacity: 1;
        transform: rotate(180deg);
    }
    76% {
        left: 30%;
        top: 63%;
        opacity: 1;
        transform: rotate(180deg);
    }
    77% {
        opacity: 0;
    }
}

/* Trigger explosions when laser hits - Scaled to 8s duration */
.enemy-1 .enemy-explosion {
    animation: explosionPulse 0.6s 1.0s ease-out;
}

.enemy-2 .enemy-explosion {
    animation: explosionPulse 0.6s 1.8s ease-out;
}

.enemy-3 .enemy-explosion {
    animation: explosionPulse 0.6s 2.6s ease-out;
}

.enemy-4 .enemy-explosion {
    animation: explosionPulse 0.6s 3.4s ease-out;
}

.enemy-5 .enemy-explosion {
    animation: explosionPulse 0.6s 5.3s ease-out;
}

.enemy-6 .enemy-explosion {
    animation: explosionPulse 0.6s 6.1s ease-out;
}

/* Splash Content */
.splash-content {
    position: relative;
    z-index: 10;
    text-align: center;
    margin-top: 200px;
}

.splash-title {
    font-size: 4.5rem;
    background: linear-gradient(90deg, #00ffff 0%, #ff00ff 25%, #ffff00 50%, #00ffff 75%, #ff00ff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 40px #00ffff) drop-shadow(0 0 60px #ff00ff);
    letter-spacing: 14px;
    font-weight: 900;
    margin-bottom: 40px;
    animation: titlePulse 2s ease-in-out infinite, gradientShift 6s linear infinite;
    text-shadow: 0 0 100px rgba(0, 255, 255, 0.9);
}

@keyframes gradientShift {
    0% {
        background-position: 0% center;
    }
    100% {
        background-position: 200% center;
    }
}

@keyframes titlePulse {
    0%, 100% {
        filter: drop-shadow(0 0 40px #00ffff) drop-shadow(0 0 60px #ff00ff);
        transform: scale(1) translateY(0);
    }
    25% {
        filter: drop-shadow(0 0 50px #00ffff) drop-shadow(0 0 80px #ff00ff) drop-shadow(0 0 100px #ffff00);
        transform: scale(1.08) translateY(-5px);
    }
    50% {
        filter: drop-shadow(0 0 60px #00ffff) drop-shadow(0 0 100px #ff00ff);
        transform: scale(1.1) translateY(0);
    }
    75% {
        filter: drop-shadow(0 0 50px #00ffff) drop-shadow(0 0 80px #ff00ff) drop-shadow(0 0 100px #ffff00);
        transform: scale(1.08) translateY(5px);
    }
}

.loading-bar-container {
    width: 400px;
    height: 12px;
    background: rgba(0, 255, 255, 0.15);
    border-radius: 15px;
    overflow: hidden;
    margin: 0 auto;
    border: 3px solid rgba(0, 255, 255, 0.6);
    box-shadow:
        0 0 30px rgba(0, 255, 255, 0.5),
        inset 0 0 20px rgba(0, 0, 0, 0.8);
    animation: containerPulse 3s ease-in-out infinite;
}

@keyframes containerPulse {
    0%, 100% {
        border-color: rgba(0, 255, 255, 0.6);
        box-shadow: 0 0 30px rgba(0, 255, 255, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.8);
    }
    50% {
        border-color: rgba(255, 0, 255, 0.6);
        box-shadow: 0 0 40px rgba(255, 0, 255, 0.6), inset 0 0 20px rgba(0, 0, 0, 0.8);
    }
}

.loading-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #00ffff 0%, #ff00ff 25%, #ffff00 50%, #ff00ff 75%, #00ffff 100%);
    transition: width 0.3s ease;
    box-shadow:
        0 0 25px rgba(0, 255, 255, 0.9),
        0 0 40px rgba(255, 0, 255, 0.7);
    animation: loadingShimmer 3s linear infinite;
    background-size: 300% 100%;
}

@keyframes loadingShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.loading-text {
    color: #00ffff;
    margin-top: 25px;
    font-size: 1.2rem;
    text-shadow:
        0 0 15px #00ffff,
        0 0 30px rgba(0, 255, 255, 0.8),
        0 0 45px rgba(255, 0, 255, 0.5);
    letter-spacing: 3px;
    animation: loadingTextCycle 30s ease-in-out infinite, textPulseGlow 2s ease-in-out infinite;
    font-weight: 700;
}

@keyframes textPulseGlow {
    0%, 100% {
        text-shadow:
            0 0 15px #00ffff,
            0 0 30px rgba(0, 255, 255, 0.8),
            0 0 45px rgba(255, 0, 255, 0.5);
    }
    50% {
        text-shadow:
            0 0 20px #00ffff,
            0 0 40px rgba(0, 255, 255, 1),
            0 0 60px rgba(255, 0, 255, 0.8);
    }
}

@keyframes loadingTextCycle {
    0%, 15% {
        content: "INITIALIZING COMBAT SYSTEMS...";
        opacity: 1;
    }
    20%, 35% {
        content: "LOADING WEAPON ARRAYS...";
        opacity: 1;
    }
    40%, 55% {
        content: "CALIBRATING SHIELDS...";
        opacity: 1;
    }
    60%, 75% {
        content: "SCANNING FOR HOSTILES...";
        opacity: 1;
    }
    80%, 95% {
        content: "READY FOR DEPLOYMENT...";
        opacity: 1;
    }
    17%, 19%, 37%, 39%, 57%, 59%, 77%, 79%, 97%, 99% {
        opacity: 0.3;
    }
}

/* Mobile splash adjustments */
@media (max-width: 600px) {
    .splash-title {
        font-size: 2rem;
        letter-spacing: 4px;
        margin-bottom: 30px;
    }

    .splash-content {
        margin-top: 150px;
        padding: 0 10px;
    }

    .loading-bar-container {
        width: 85%;
        max-width: 350px;
    }

    .loading-text {
        font-size: 0.8rem;
        letter-spacing: 2px;
        margin-top: 20px;
    }

    .splash-ufo {
        transform: scale(0.7);
    }

    .splash-enemy {
        transform: scale(0.7);
    }
}

@media (max-width: 400px) {
    .splash-title {
        font-size: 1.5rem;
        letter-spacing: 2px;
        margin-bottom: 25px;
    }

    .splash-content {
        margin-top: 120px;
    }

    .loading-bar-container {
        width: 90%;
        max-width: 300px;
        height: 10px;
    }

    .loading-text {
        font-size: 0.7rem;
        letter-spacing: 1px;
        margin-top: 18px;
    }

    .splash-ufo {
        transform: scale(0.5);
    }

    .splash-enemy {
        transform: scale(0.5);
    }
}

/* =================================================================================
   PROGRESSION SYSTEM STYLES - Stats, Shop, Achievements, Leaderboard
   ================================================================================= */

/* Menu Buttons */
.menu-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.menu-button {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #00ffff;
    color: #00ffff;
    padding: 10px 20px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
}

.menu-button:hover {
    background: linear-gradient(135deg, #00ffff22 0%, #00ffff44 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.5);
}

/* Stats Summary Screen */
.stats-overlay {
    background: rgba(0, 0, 0, 0.95) !important;
}

.stats-title {
    font-size: 2rem;
    margin-bottom: 20px;
    text-shadow: 0 0 20px #00ffff;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}





.stats-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.stats-button {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #00ffff;
    color: #00ffff;
    padding: 12px 25px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
}

.stats-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.5);
}

.stats-button.primary {
    background: linear-gradient(135deg, #00ffff 0%, #0088ff 100%);
    color: #000;
}

/* Shop */
.shop-overlay {
    background: rgba(0, 0, 0, 0.95) !important;
}

.shop-title {
    font-size: 2rem;
    color: #ffdd00;
    text-shadow: 0 0 20px #ffdd00;
}

.credits-display {
    font-size: 1.2rem;
    color: #ffdd00;
    font-weight: 700;
}

.shop-content {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 50vh;
    overflow-y: auto;
}

.shop-item {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #00ffff;
    border-radius: 10px;
    padding: 15px;
}

.shop-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.shop-item-name {
    font-weight: 700;
    color: #00ffff;
}

.shop-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.shop-buy-button {
    background: linear-gradient(135deg, #00ff88 0%, #00cc66 100%);
    border: none;
    color: #000;
    padding: 8px 20px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 5px;
}

.shop-buy-button:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
}

.shop-button {
    background: linear-gradient(135deg, #00ffff 0%, #0088ff 100%);
    border: none;
    color: #000;
    padding: 12px 30px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    cursor: pointer;
    border-radius: 8px;
}

/* Achievements */
.achievements-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    max-height: 55vh;
    overflow-y: auto;
}

.achievement-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #555;
    border-radius: 10px;
    padding: 15px;
}

.achievement-card.unlocked {
    border-color: #ffdd00;
    box-shadow: 0 0 15px rgba(255, 221, 0, 0.3);
}

.achievement-icon {
    font-size: 1.5rem;
    filter: grayscale(100%);
}

.achievement-card.unlocked .achievement-icon {
    filter: none;
}

.achievement-name {
    font-weight: 700;
    color: #888;
}

.achievement-card.unlocked .achievement-name {
    color: #ffdd00;
}

/* Leaderboard */
.leaderboard-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.leaderboard-tab {
    background: #1a1a2e;
    border: 2px solid #444;
    color: #888;
    padding: 8px 20px;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
    border-radius: 5px;
}

.leaderboard-tab.active {
    border-color: #00ffff;
    color: #00ffff;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #00ffff;
    padding: 12px;
    border-bottom: 2px solid #00ffff;
}

.leaderboard-table td {
    padding: 10px;
    color: #fff;
    border-bottom: 1px solid #333;
}

/* Achievement Notifications */
.achievement-notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.achievement-notification {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 3px solid #ffdd00;
    border-radius: 10px;
    padding: 15px 20px;
    min-width: 300px;
    box-shadow: 0 0 30px rgba(255, 221, 0, 0.5);
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.achievement-notification-title {
    font-size: 0.9rem;
    color: #ffdd00;
    font-weight: 700;
}

.achievement-notification-reward {
    font-size: 0.8rem;
    color: #00ff88;
    font-weight: 700;
}
