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

body {
    font-family: 'Orbitron', monospace;
    background: #000;
    color: #fff;
    overflow: hidden;
    cursor: none;
}

/* Custom Cursor */
.custom-cursor {
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    transition: transform 0.1s ease;
    mix-blend-mode: difference;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

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

.arc-reactor {
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
    position: relative;
}

.reactor-core {
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px #fff, 0 0 40px #fff, 0 0 60px #fff;
    animation: pulse 2s ease-in-out infinite;
}

.reactor-ring {
    width: 100%;
    height: 100%;
    border: 3px solid #fff;
    border-radius: 50%;
    position: absolute;
    animation: rotate 4s linear infinite;
}

.reactor-ring-2 {
    width: 80%;
    height: 80%;
    border: 2px solid #fff;
    border-radius: 50%;
    position: absolute;
    top: 10%;
    left: 10%;
    animation: rotate 3s linear infinite reverse;
}

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

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.glitch {
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
    position: relative;
    color: #fff;
    letter-spacing: 3px;
    animation: glitch 1s infinite;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #fff;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #888;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2s infinite linear alternate-reverse;
}

@keyframes glitch {
    0% { text-shadow: 0 0 10px #fff; }
    50% { text-shadow: 0 0 20px #fff; }
    100% { text-shadow: 0 0 10px #fff; }
}

@keyframes glitch-anim {
    0% { clip: rect(10px, 9999px, 31px, 0); }
    20% { clip: rect(85px, 9999px, 140px, 0); }
    40% { clip: rect(62px, 9999px, 180px, 0); }
    60% { clip: rect(25px, 9999px, 99px, 0); }
    80% { clip: rect(50px, 9999px, 200px, 0); }
    100% { clip: rect(90px, 9999px, 150px, 0); }
}

.loading-bar {
    width: 300px;
    height: 4px;
    background: #222;
    margin: 20px auto;
    border: 1px solid #fff;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: #fff;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px #fff;
}

#loading-text {
    color: #aaa;
    font-size: 14px;
    margin-top: 10px;
}

/* Start Screen */
#start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #000 0%, #111 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9998;
}

.start-content {
    text-align: center;
    max-width: 800px;
    padding: 40px;
}

.title-glitch {
    font-size: 72px;
    font-weight: 900;
    margin-bottom: 20px;
    position: relative;
    color: #fff;
    text-shadow: 0 0 20px #fff;
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { text-shadow: 0 0 20px #fff; }
    50% { text-shadow: 0 0 40px #fff, 0 0 60px #fff; }
}

.subtitle {
    font-size: 20px;
    color: #aaa;
    margin-bottom: 40px;
    letter-spacing: 2px;
}

.instructions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 40px;
    text-align: left;
}

.instructions p {
    font-size: 14px;
    color: #ccc;
    padding: 10px;
    border: 1px solid #333;
    background: rgba(255, 255, 255, 0.05);
}

.key {
    display: inline-block;
    background: #fff;
    color: #000;
    padding: 3px 8px;
    border-radius: 3px;
    font-weight: 700;
    font-size: 12px;
    margin-right: 8px;
}

.neon-button {
    background: transparent;
    border: 2px solid #fff;
    color: #fff;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Orbitron', monospace;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.neon-button:hover {
    background: #fff;
    color: #000;
    box-shadow: 0 0 20px #fff, 0 0 40px #fff;
    transform: scale(1.05);
}

.neon-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.neon-button:hover::before {
    left: 100%;
}

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

.hud-top {
    display: flex;
    justify-content: space-between;
    padding: 20px;
}

.hud-left,
.hud-right {
    display: flex;
    flex-direction: column;
    gap: 15px;
    pointer-events: auto;
}

.stat-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 15px;
    border: 1px solid #fff;
}

.stat-label {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    min-width: 60px;
}

.bar-container {
    width: 150px;
    height: 10px;
    background: #222;
    border: 1px solid #555;
    overflow: hidden;
}

.bar {
    height: 100%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px currentColor;
}

.shield-bar {
    background: #fff;
}

.energy-bar {
    background: #ccc;
}

.exp-bar {
    background: #ffaa00;
}

.stat-value {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    min-width: 30px;
}

/* Controls */
.controls {
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border: 1px solid #fff;
    margin-top: 10px;
    max-height: 300px;
    overflow-y: auto;
    /* scrollbar-width: none; */
}

.control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.control-row:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.control-key {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 4px 8px;
    border: 1px solid #fff;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    font-family: 'Orbitron', monospace;
    min-width: 60px;
    text-align: center;
    text-shadow: 0 0 5px #fff;
}

.control-desc {
    font-size: 12px;
    color: #ccc;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hud-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.crosshair {
    position: relative;
    width: 40px;
    height: 40px;
}

.crosshair-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 5px #fff;
}

.crosshair-line {
    position: absolute;
    background: #fff;
}

.crosshair-top {
    width: 2px;
    height: 10px;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.crosshair-right {
    width: 10px;
    height: 2px;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.crosshair-bottom {
    width: 2px;
    height: 10px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.crosshair-left {
    width: 10px;
    height: 2px;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.score-display,
.enemy-counter,
.wave-display,
.kill-display,
.flight-display,
.mute-display,
.weapon-display,
.dash-display,
.level-display {
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 15px;
    border: 1px solid #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 200px;
}

.score-label,
.enemy-label,
.wave-label,
.kill-label,
.flight-label,
.mute-label,
.weapon-label,
.dash-label,
.level-label {
    font-size: 12px;
    font-weight: 700;
    color: #aaa;
}

.score-value,
.enemy-value,
.wave-value,
.kill-value,
.flight-value,
.mute-value,
.weapon-value,
.dash-value,
.level-value {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px #fff;
}

.hud-bottom {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.objective {
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 30px;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    gap: 15px;
    animation: objectivePulse 2s ease-in-out infinite;
}

@keyframes objectivePulse {
    0%, 100% { box-shadow: 0 0 10px #fff; }
    50% { box-shadow: 0 0 20px #fff; }
}

.objective-icon {
    font-size: 24px;
}

#objective-text {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

/* Combo Display */
.combo-display {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
}

.combo-text {
    font-size: 48px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 20px #fff, 0 0 40px #fff;
    animation: comboPopup 0.5s ease-out;
}

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

/* Wave Intro */
.wave-intro {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    animation: waveIntroFade 2s ease-in-out;
}

@keyframes waveIntroFade {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

.wave-intro-title {
    font-size: 96px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 40px #fff;
    animation: waveIntroScale 2s ease-out;
}

@keyframes waveIntroScale {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.wave-intro-subtitle {
    font-size: 24px;
    color: #aaa;
    margin-top: 20px;
}

/* Damage Numbers */
.damage-numbers {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1500;
}

.damage-number {
    position: absolute;
    font-size: 24px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 10px #fff;
    animation: damageFloat 1s ease-out forwards;
}

@keyframes damageFloat {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-50px) scale(1.5); opacity: 0; }
}

/* Data Popup */
.data-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #fff;
    padding: 30px;
    max-width: 600px;
    z-index: 4000;
    opacity: 0;
    transition: all 0.3s ease;
}

.data-popup.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.popup-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #fff;
}

.popup-icon {
    font-size: 32px;
}

.popup-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.popup-body {
    color: #ccc;
    line-height: 1.8;
    font-size: 20px;
    font-weight: 800;
}

.popup-footer {
    margin-top: 20px;
    position: relative;
    height: 4px;
    background: #222;
    overflow: hidden;
}

.scan-line {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #fff, transparent);
    animation: scanLine 2s linear infinite;
}

@keyframes scanLine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Boss Health */
.boss-health {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    z-index: 1100;
}

.boss-name {
    font-size: 24px;
    font-weight: 900;
    color: #fff;
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 0 0 20px #fff;
}

.boss-bar-container {
    width: 100%;
    height: 30px;
    background: #000;
    border: 2px solid #fff;
    overflow: hidden;
}

.boss-bar {
    height: 100%;
    background: #fff;
    width: 100%;
    transition: width 0.3s ease;
    box-shadow: 0 0 20px #fff;
}

/* Victory Screen */
#victory-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000;
}

.victory-content {
    text-align: center;
    max-width: 800px;
    padding: 40px;
}

.victory-title {
    font-size: 64px;
    font-weight: 900;
    color: #fff;
    margin-bottom: 40px;
    text-shadow: 0 0 40px #fff;
    animation: victoryPulse 2s ease-in-out infinite;
}

@keyframes victoryPulse {
    0%, 100% { text-shadow: 0 0 40px #fff; }
    50% { text-shadow: 0 0 60px #fff, 0 0 80px #fff; }
}

.stats-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #fff;
    padding: 30px;
    margin-bottom: 30px;
}

.stats-title {
    font-size: 24px;
    color: #fff;
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    border: 1px solid #333;
    background: rgba(0, 0, 0, 0.5);
}

.stat-item .stat-label {
    color: #aaa;
}

.stat-item .stat-value {
    color: #fff;
    font-weight: 700;
}

.quote-container {
    margin: 40px 0;
    padding: 30px;
    border-left: 3px solid #fff;
    background: rgba(255, 255, 255, 0.05);
}

.quote {
    font-size: 20px;
    font-style: italic;
    color: #fff;
    margin-bottom: 10px;
}

.quote-author {
    font-size: 14px;
    color: #aaa;
}

.links-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.link-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background: transparent;
    border: 2px solid #fff;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
}

.link-button:hover {
    background: #fff;
    color: #000;
    transform: translateY(-3px);
    box-shadow: 0 0 20px #fff;
}

.link-icon {
    font-size: 20px;
}

/* Game Over Screen */
#gameover-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000;
}

.gameover-content {
    text-align: center;
    max-width: 600px;
    padding: 40px;
}

.gameover-title {
    font-size: 72px;
    font-weight: 900;
    color: #fff;
    margin-bottom: 20px;
    text-shadow: 0 0 40px #fff;
}

.gameover-text {
    font-size: 18px;
    color: #aaa;
    margin-bottom: 40px;
}

/* Mobile Controls */
.mobile-controls {
    display: none;
}

@media (max-width: 768px) {
    .mobile-controls {
        display: flex;
        position: fixed;
        bottom: 20px;
        left: 20px;
        right: 20px;
        justify-content: space-between;
        align-items: flex-end;
        z-index: 1200;
        pointer-events: auto;
    }

    .mobile-joystick {
        width: 100px;
        height: 100px;
        background: rgba(255, 255, 255, 0.2);
        border: 2px solid #fff;
        border-radius: 50%;
        position: relative;
    }

    .joystick-inner {
        width: 40px;
        height: 40px;
        background: #fff;
        border-radius: 50%;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

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

    .mobile-btn {
        background: rgba(255, 255, 255, 0.2);
        border: 2px solid #fff;
        color: #fff;
        padding: 15px 20px;
        font-size: 12px;
        font-weight: 700;
        font-family: 'Orbitron', monospace;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .mobile-btn:active {
        background: #fff;
        color: #000;
    }
}

/* Settings Modal */
.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.settings-content {
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #fff;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.settings-title {
    font-size: 32px;
    font-weight: 900;
    color: #fff;
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 0 0 20px #fff;
}

.settings-section {
    margin-bottom: 25px;
    padding: 15px;
    border: 1px solid #333;
    background: rgba(255, 255, 255, 0.05);
}

.settings-section h3 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.settings-section select,
.settings-section input[type="range"] {
    width: 100%;
    padding: 8px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #fff;
    color: #fff;
    font-family: 'Orbitron', monospace;
}

.settings-section label {
    display: block;
    color: #ccc;
    margin-bottom: 5px;
    font-size: 14px;
}

.audio-controls,
.performance-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.performance-controls label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.performance-controls input[type="checkbox"] {
    width: auto;
    margin: 0;
}

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

.button-group {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.settings-btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: #666;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
}

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

    .subtitle {
        font-size: 16px;
    }

    .instructions {
        grid-template-columns: 1fr;
        font-size: 12px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .links-container {
        flex-direction: column;
    }
    
    .button-group {
        flex-direction: column;
        align-items: center;
    }
    
    .settings-content {
        padding: 20px;
        margin: 20px;
    }
}