/* ============================================================
   SKYFALL STRIKE — Premium Cyberpunk Theme
   Comprehensive Stylesheet
   ============================================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
    --bg-dark: #06080f;
    --bg-navy: #0a0e27;
    --bg-card: rgba(10, 14, 39, 0.75);
    --bg-glass: rgba(10, 14, 39, 0.55);

    --cyan: #00f5ff;
    --cyan-dim: #00f5ff99;
    --cyan-glow: 0 0 12px #00f5ff88, 0 0 32px #00f5ff44;
    --cyan-glow-strong: 0 0 16px #00f5ffcc, 0 0 48px #00f5ff66, 0 0 80px #00f5ff33;

    --purple: #af52de;
    --purple-dim: #af52de99;
    --purple-glow: 0 0 12px #af52de88, 0 0 32px #af52de44;

    --danger: #ff2d55;
    --danger-glow: 0 0 12px #ff2d5588, 0 0 32px #ff2d5544;

    --warning: #ff9500;
    --success: #34c759;
    --gold: #ffcc00;

    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;

    --transition-fast: 0.2s ease;
    --transition-base: 0.35s ease;
    --transition-slow: 0.6s ease;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-dark);
    color: #e0e8f0;
    font-family: var(--font-body);
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    width: 100%;
    height: 100%;
    position: relative;
}

/* ---------- Utility ---------- */
.hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity var(--transition-slow);
}

.screen {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: opacity var(--transition-slow);
}

/* ---------- Background Grid ---------- */
.bg-grid {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.07;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 59px,
            var(--cyan) 59px,
            var(--cyan) 60px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 59px,
            var(--cyan) 59px,
            var(--cyan) 60px
        );
    background-size: 60px 60px;
    animation: gridDrift 20s linear infinite;
}

@keyframes gridDrift {
    0%   { background-position: 0 0; }
    100% { background-position: 60px 60px; }
}

/* ============================================================
   LOADING SCREEN
   ============================================================ */
#loading-screen {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at 50% 40%, #0c1333 0%, var(--bg-dark) 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.8s ease;
}

.loader-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.logo-glow {
    animation: pulse 2.4s ease-in-out infinite;
}

#loading-text {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 400;
    color: var(--cyan-dim);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Progress Bar */
.progress-bar {
    position: relative;
    width: 320px;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 100px;
    overflow: hidden;
    border: 1px solid rgba(0, 245, 255, 0.12);
}

.progress-fill {
    width: 0%;
    height: 100%;
    border-radius: 100px;
    background: linear-gradient(90deg, var(--cyan), var(--purple));
    transition: width 0.4s ease;
    position: relative;
}

.progress-glow {
    position: absolute;
    top: -2px;
    left: -60px;
    width: 60px;
    height: 10px;
    background: linear-gradient(90deg, transparent, rgba(0, 245, 255, 0.6), transparent);
    border-radius: 100px;
    animation: progressSweep 2s ease-in-out infinite;
}

@keyframes progressSweep {
    0%   { left: -60px; }
    100% { left: 100%; }
}

/* Loading Dots */
.loading-dots {
    display: flex;
    gap: 8px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cyan);
    animation: loadingDot 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes achievementSlideIn {
    0% { transform: translateX(-50%) translateY(-20px); opacity: 0; }
    100% { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@keyframes loadingDot {
    0%, 80%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.4;
    }
    40% {
        transform: translateY(-12px) scale(1.2);
        opacity: 1;
    }
}

/* ============================================================
   GAME LOGO
   ============================================================ */
.game-logo {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 2.8rem;
    color: var(--cyan);
    text-transform: uppercase;
    letter-spacing: 6px;
    text-shadow: var(--cyan-glow);
    line-height: 1.1;
}

.game-logo span {
    display: block;
    font-weight: 900;
    font-size: 1.1em;
    background: linear-gradient(135deg, var(--gold), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 18px rgba(175, 82, 222, 0.5));
    letter-spacing: 10px;
}

.game-logo.big {
    font-size: 4.2rem;
}

.game-logo.big span {
    font-size: 1.15em;
    letter-spacing: 14px;
}

/* ============================================================
   START SCREEN
   ============================================================ */
#start-screen {
    background: radial-gradient(ellipse at 50% 30%, #0c1333 0%, var(--bg-dark) 75%);
}

.start-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    max-width: 820px;
    padding: 40px 32px;
}

.tagline {
    font-family: var(--font-body);
    font-size: 1.25rem;
    font-weight: 400;
    color: rgba(224, 232, 240, 0.6);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: -8px;
}

/* Controls Guide */
.controls-guide {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin: 12px 0;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 245, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 16px 22px;
    min-width: 210px;
    text-align: left;
    animation: fadeInUp 0.7s ease backwards;
    transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.control-item:nth-child(1) { animation-delay: 0.1s; }
.control-item:nth-child(2) { animation-delay: 0.2s; }
.control-item:nth-child(3) { animation-delay: 0.3s; }
.control-item:nth-child(4) { animation-delay: 0.4s; }

.control-item:hover {
    border-color: rgba(0, 245, 255, 0.35);
    transform: translateY(-2px);
}

.control-icon {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 245, 255, 0.06);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.control-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.control-text strong {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.control-text span {
    font-size: 0.85rem;
    font-weight: 400;
    color: rgba(224, 232, 240, 0.5);
}

.cam-note {
    font-size: 0.85rem;
    color: rgba(224, 232, 240, 0.35);
    letter-spacing: 1px;
}

/* ============================================================
   NEON BUTTON
   ============================================================ */
.neon-btn {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--cyan);
    background: transparent;
    border: 2px solid var(--cyan);
    border-radius: var(--radius-sm);
    padding: 16px 48px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition:
        background var(--transition-fast),
        color var(--transition-fast),
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
    box-shadow: var(--cyan-glow), inset 0 0 20px rgba(0, 245, 255, 0.05);
    animation: btnPulse 3s ease-in-out infinite;
}

.neon-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 245, 255, 0.15), transparent);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.neon-btn:hover {
    background: rgba(0, 245, 255, 0.12);
    color: #ffffff;
    transform: scale(1.04);
    box-shadow: var(--cyan-glow-strong);
}

.neon-btn:hover::before {
    opacity: 1;
}

.neon-btn:active {
    transform: scale(0.97);
    box-shadow: 0 0 8px #00f5ff66;
}

/* Secondary Variant */
.neon-btn.secondary {
    color: var(--purple);
    border-color: var(--purple);
    box-shadow: var(--purple-glow), inset 0 0 20px rgba(175, 82, 222, 0.05);
    animation: btnPulsePurple 3s ease-in-out infinite;
}

.neon-btn.secondary::before {
    background: linear-gradient(135deg, rgba(175, 82, 222, 0.15), transparent);
}

.neon-btn.secondary:hover {
    background: rgba(175, 82, 222, 0.12);
    color: #ffffff;
    box-shadow: 0 0 16px #af52decc, 0 0 48px #af52de66, 0 0 80px #af52de33;
}

@keyframes btnPulse {
    0%, 100% { box-shadow: var(--cyan-glow), inset 0 0 20px rgba(0, 245, 255, 0.05); }
    50%      { box-shadow: var(--cyan-glow-strong), inset 0 0 30px rgba(0, 245, 255, 0.08); }
}

@keyframes btnPulsePurple {
    0%, 100% { box-shadow: var(--purple-glow), inset 0 0 20px rgba(175, 82, 222, 0.05); }
    50%      { box-shadow: 0 0 16px #af52decc, 0 0 48px #af52de66, inset 0 0 30px rgba(175, 82, 222, 0.08); }
}

/* ============================================================
   GAME SCREEN
   ============================================================ */
#game-screen {
    background: var(--bg-dark);
    z-index: 5;
}

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

/* ============================================================
   FACE CAM CONTAINER
   ============================================================ */
#face-cam-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 200px;
    height: 150px;
    border-radius: var(--radius-md);
    overflow: hidden;
    z-index: 50;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid rgba(0, 245, 255, 0.25);
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.1), 0 8px 32px rgba(0, 0, 0, 0.5);
}

#webcam {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scaleX(-1);
    border-radius: var(--radius-md);
}

.cam-border {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
    border: 1.5px solid transparent;
    pointer-events: none;
    animation: borderScan 4s linear infinite;
}

@keyframes borderScan {
    0%   { border-color: rgba(0, 245, 255, 0.4); }
    25%  { border-color: rgba(175, 82, 222, 0.4); }
    50%  { border-color: rgba(0, 245, 255, 0.15); }
    75%  { border-color: rgba(52, 199, 89, 0.4); }
    100% { border-color: rgba(0, 245, 255, 0.4); }
}

.cam-label {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 4px 0;
    text-align: center;
    font-family: var(--font-display);
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--cyan);
    background: linear-gradient(180deg, rgba(6, 8, 15, 0.85) 0%, transparent 100%);
    text-shadow: 0 0 8px var(--cyan);
}

.cam-dot {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    box-shadow: 0 0 6px var(--danger), 0 0 12px rgba(255, 45, 85, 0.4);
    animation: dotBlink 1.2s ease-in-out infinite;
}

@keyframes dotBlink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.2; }
}

/* ============================================================
   HUD
   ============================================================ */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 14px 24px;
    background: linear-gradient(180deg, rgba(6, 8, 15, 0.88) 0%, rgba(6, 8, 15, 0.4) 80%, transparent 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 245, 255, 0.06);
}

#hud-left {
    display: flex;
    gap: 28px;
}

#hud-center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
}

#hud-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
    min-width: 200px;
}

.hud-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.hud-label {
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--cyan-dim);
}

.hud-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

/* Bars */
.bar-container {
    width: 180px;
}

.bar {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 100px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
}

.bar-fill {
    height: 100%;
    border-radius: 100px;
    transition: width 0.4s ease;
    position: relative;
}

.bar-fill.health {
    width: 100%;
    background: linear-gradient(90deg, var(--success), var(--cyan));
    box-shadow: 0 0 8px rgba(52, 199, 89, 0.4);
}

.bar-fill.health::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    animation: shimmer 2.5s ease-in-out infinite;
}

.bar-fill.special {
    width: 0%;
    background: linear-gradient(90deg, var(--purple), #ff6eb4);
    box-shadow: 0 0 8px rgba(175, 82, 222, 0.4);
}

.bar-fill.special::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%   { left: -60%; }
    100% { left: 120%; }
}

/* ============================================================
   COMBO DISPLAY
   ============================================================ */
#combo-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    transition: opacity var(--transition-fast);
}

#combo-display:not(.hidden) {
    animation: bounceIn 0.4s ease;
}

#combo-value {
    font-family: var(--font-display);
    font-size: 2.6rem;
    font-weight: 900;
    color: var(--gold);
    text-shadow: 0 0 16px rgba(255, 204, 0, 0.7), 0 0 40px rgba(255, 204, 0, 0.3);
    line-height: 1;
}

.combo-label {
    font-family: var(--font-display);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--gold);
    opacity: 0.7;
}

/* ============================================================
   WAVE ANNOUNCEMENT
   ============================================================ */
#wave-announce {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 45;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

#wave-announce:not(.hidden) .wave-text {
    animation: waveIn 2.5s ease forwards;
}

.wave-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.wave-label {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 10px;
    color: var(--cyan-dim);
    text-transform: uppercase;
}

.wave-number {
    font-family: var(--font-display);
    font-size: 7rem;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(180deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 30px rgba(0, 245, 255, 0.5));
    animation: glitch 0.15s ease infinite alternate;
}

.wave-sub {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 8px;
    color: rgba(224, 232, 240, 0.4);
    text-transform: uppercase;
}

@keyframes waveIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    20% {
        transform: scale(1.1);
        opacity: 1;
    }
    30% {
        transform: scale(1);
        opacity: 1;
    }
    70% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* ============================================================
   CONTROL INDICATORS
   ============================================================ */
#control-indicators {
    position: fixed;
    bottom: 24px;
    left: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 40;
}

.indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: rgba(224, 232, 240, 0.35);
    text-transform: uppercase;
    transition: color var(--transition-fast);
}

.indicator.active {
    color: var(--cyan);
}

.ind-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(224, 232, 240, 0.15);
    border: 1.5px solid rgba(224, 232, 240, 0.2);
    transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.indicator.active .ind-dot {
    background: var(--cyan);
    border-color: var(--cyan);
    box-shadow: 0 0 8px var(--cyan), 0 0 20px rgba(0, 245, 255, 0.3);
}

/* ============================================================
   UPGRADE SHOP SCREEN
   ============================================================ */
#upgrade-screen {
    background: radial-gradient(ellipse at 50% 30%, rgba(10, 25, 60, 0.85) 0%, var(--bg-dark) 70%);
    z-index: 60;
}

.upgrade-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 30px 20px;
    max-width: 720px;
    width: 100%;
}

.upgrade-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 2.2rem;
    color: var(--success);
    text-transform: uppercase;
    letter-spacing: 6px;
    text-shadow: 0 0 20px rgba(52, 199, 89, 0.4);
    animation: bounceIn 0.6s ease;
}

.upgrade-title span {
    color: var(--cyan);
    text-shadow: var(--cyan-glow);
}

.upgrade-subtitle {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 4px;
    color: var(--cyan-dim);
    text-transform: uppercase;
}

.upgrade-currency {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 28px;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 204, 0, 0.2);
    border-radius: var(--radius-md);
    animation: fadeInUp 0.5s ease 0.2s backwards;
}

.currency-label {
    font-family: var(--font-display);
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 3px;
    color: var(--cyan-dim);
    text-transform: uppercase;
}

.currency-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 900;
    color: var(--gold);
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(255, 204, 0, 0.3);
}

.upgrade-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.upgrade-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 245, 255, 0.08);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), transform var(--transition-fast), background var(--transition-fast);
    animation: fadeInUp 0.5s ease backwards;
    cursor: default;
}

.upgrade-card:nth-child(1) { animation-delay: 0.15s; }
.upgrade-card:nth-child(2) { animation-delay: 0.22s; }
.upgrade-card:nth-child(3) { animation-delay: 0.29s; }
.upgrade-card:nth-child(4) { animation-delay: 0.36s; }
.upgrade-card:nth-child(5) { animation-delay: 0.43s; }

.upgrade-card:hover {
    border-color: rgba(0, 245, 255, 0.25);
    transform: translateX(4px);
    background: rgba(0, 245, 255, 0.04);
}

.upgrade-card.maxed-out {
    opacity: 0.45;
    pointer-events: none;
}

.upgrade-card.maxed-out .upgrade-buy-btn {
    display: none;
}

.upgrade-card.maxed-out .upgrade-cost::after {
    content: 'MAX';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(52, 199, 89, 0.15);
    color: var(--success);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.65rem;
    letter-spacing: 2px;
    border-radius: var(--radius-sm);
}

.upgrade-card.maxed-out .upgrade-cost {
    position: relative;
    color: transparent;
}

.upgrade-card.cant-afford {
    opacity: 0.6;
}

.upgrade-card.cant-afford .upgrade-buy-btn {
    opacity: 0.3;
    pointer-events: none;
}

.upgrade-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 245, 255, 0.05);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 245, 255, 0.1);
}

.upgrade-info {
    flex: 1;
    text-align: left;
}

.upgrade-name {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #fff;
    margin: 0;
}

.upgrade-desc {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: rgba(224, 232, 240, 0.5);
    margin: 2px 0 6px;
}

.upgrade-level-bar {
    display: flex;
    gap: 4px;
}

.level-pip {
    width: 24px;
    height: 5px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.level-pip.filled {
    background: var(--cyan);
    border-color: var(--cyan);
    box-shadow: 0 0 6px rgba(0, 245, 255, 0.4);
}

.upgrade-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.upgrade-cost {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 1px;
}

.upgrade-buy-btn {
    font-family: var(--font-display);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 6px 16px;
    background: transparent;
    border: 1.5px solid var(--cyan);
    color: var(--cyan);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-transform: uppercase;
}

.upgrade-buy-btn:hover {
    background: var(--cyan);
    color: var(--bg-dark);
    box-shadow: 0 0 12px rgba(0, 245, 255, 0.4);
    transform: scale(1.05);
}

.upgrade-buy-btn:active {
    transform: scale(0.95);
}

@keyframes upgradePurchased {
    0% { transform: scale(1); }
    30% { transform: scale(1.04); border-color: var(--success); }
    100% { transform: scale(1); }
}

.upgrade-card.just-bought {
    animation: upgradePurchased 0.4s ease;
}

#continue-btn {
    margin-top: 8px;
    animation: fadeInUp 0.5s ease 0.55s backwards;
}

/* Responsive upgrade screen */
@media (max-width: 768px) {
    .upgrade-title {
        font-size: 1.5rem;
        letter-spacing: 3px;
    }

    .upgrade-card {
        padding: 10px 12px;
        gap: 10px;
    }

    .upgrade-icon {
        width: 38px;
        height: 38px;
        font-size: 1.4rem;
    }

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

    .currency-value {
        font-size: 1.5rem;
    }
}

/* ============================================================
   GAME OVER SCREEN
   ============================================================ */
#gameover-screen {
    background: radial-gradient(ellipse at 50% 40%, rgba(40, 5, 15, 0.7) 0%, var(--bg-dark) 70%);
}

/* Scanline Overlay */
#gameover-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.08) 2px,
        rgba(0, 0, 0, 0.08) 4px
    );
    animation: scanline 8s linear infinite;
}

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

.gameover-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    padding: 40px;
}

.gameover-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 3.8rem;
    color: var(--danger);
    text-transform: uppercase;
    letter-spacing: 8px;
    text-shadow: var(--danger-glow);
    line-height: 1.1;
}

.gameover-title span {
    display: block;
    font-size: 1.1em;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    letter-spacing: 12px;
}

/* Final Stats */
.final-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    max-width: 520px;
    width: 100%;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 22px 16px;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 245, 255, 0.08);
    border-radius: var(--radius-md);
    animation: fadeInUp 0.6s ease backwards;
    transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.stat-card:nth-child(1) { animation-delay: 0.15s; }
.stat-card:nth-child(2) { animation-delay: 0.25s; }
.stat-card:nth-child(3) { animation-delay: 0.35s; }
.stat-card:nth-child(4) { animation-delay: 0.45s; }

.stat-card:hover {
    border-color: rgba(0, 245, 255, 0.25);
    transform: translateY(-3px);
}

.stat-icon {
    font-size: 1.8rem;
}

.stat-label {
    font-family: var(--font-display);
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--cyan-dim);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 2px;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
}

/* Game-over buttons */
#gameover-screen .neon-btn {
    margin-top: 4px;
}

#gameover-screen .neon-btn + .neon-btn {
    margin-top: 0;
}

/* ============================================================
   V2.0 STYLES (Skins, Boss HUD, Touch, Achievements, Leaderboard)
   ============================================================ */

/* 1. Ship Skin Selector */
#skin-selector {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.skin-title {
    font-family: var(--font-display);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--cyan-dim);
}
.skin-grid {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
.skin-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: var(--bg-glass);
    border: 1px solid rgba(0, 245, 255, 0.08);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    min-width: 80px;
}
.skin-option.selected {
    border-color: var(--cyan);
    box-shadow: 0 0 12px rgba(0, 245, 255, 0.3);
}
.skin-option.locked {
    opacity: 0.4;
    cursor: not-allowed;
}
.skin-option.locked .skin-lock {
    font-size: 0.5rem;
    color: var(--gold);
    font-family: var(--font-display);
}
.skin-preview {
    width: 40px;
    height: 50px;
    border-radius: 4px;
}
.skin-preview.striker { background: linear-gradient(135deg, #00f5ff, #0077cc); }
.skin-preview.inferno { background: linear-gradient(135deg, #ff4422, #cc2200); }
.skin-preview.phantom { background: linear-gradient(135deg, #af52de, #7722aa); }
.skin-preview.eagle   { background: linear-gradient(135deg, #ffcc00, #cc9900); }
.skin-preview.void    { background: linear-gradient(135deg, #e0e8f0, #556677); }
.skin-name {
    font-family: var(--font-display);
    font-size: 0.5rem;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.start-btns-row {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

/* 2. Boss Health Bar */
#boss-hud {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 40;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: opacity 0.3s;
}
.boss-name {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--danger);
    text-shadow: 0 0 8px rgba(255, 45, 85, 0.5);
}
.boss-bar-container {
    width: 300px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(255, 45, 85, 0.2);
    overflow: hidden;
}
.boss-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--danger), var(--secondary));
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 100%;
}

/* 3. Mobile Touch Controls */
#touch-controls {
    position: fixed;
    inset: 0;
    z-index: 30;
    pointer-events: none;
}
#touch-controls > * {
    pointer-events: auto;
}
#touch-joystick {
    position: absolute;
    bottom: 60px;
    left: 40px;
}
#joystick-base {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(0, 245, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}
#joystick-knob {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 245, 255, 0.3);
    border: 2px solid var(--cyan);
    transition: transform 0.1s;
}
#touch-buttons {
    position: absolute;
    bottom: 60px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.touch-btn {
    border-radius: 50%;
    border: 2px solid;
    font-family: var(--font-display);
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.fire-btn {
    width: 80px;
    height: 80px;
    font-size: 0.7rem;
    background: rgba(0, 245, 255, 0.1);
    border-color: var(--cyan);
    color: var(--cyan);
}
.fire-btn:active {
    background: rgba(0, 245, 255, 0.3);
    transform: scale(0.92);
}
.special-btn {
    width: 56px;
    height: 56px;
    font-size: 1.2rem;
    background: rgba(175, 82, 222, 0.1);
    border-color: var(--secondary);
    color: var(--secondary);
}
.special-btn:active {
    background: rgba(175, 82, 222, 0.3);
    transform: scale(0.92);
}

/* 4. Achievement Popup */
#achievement-popup {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: rgba(10, 14, 39, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 204, 0, 0.3);
    border-radius: 12px;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}
#achievement-popup:not(.hidden) {
    opacity: 1;
    animation: achievementSlideIn 0.5s ease;
}
.achievement-icon {
    font-size: 1.5rem;
}
.achievement-label {
    font-family: var(--font-display);
    font-size: 0.45rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gold);
}
.achievement-text {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 1px;
}
.achievement-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* 5. Leaderboard Screen */
.leaderboard-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
}
.leaderboard-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 900;
    color: var(--gold);
    text-shadow: 0 0 12px rgba(255, 204, 0, 0.4);
    letter-spacing: 4px;
}
.leaderboard-table {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.lb-header {
    display: grid;
    grid-template-columns: 50px 1fr 60px 80px;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(0, 245, 255, 0.06);
    border: 1px solid rgba(0, 245, 255, 0.15);
    border-radius: 8px;
    font-family: var(--font-display);
    font-size: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--cyan-dim);
}
.lb-row {
    display: grid;
    grid-template-columns: 50px 1fr 60px 80px;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-glass);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: #ffffff;
    animation: fadeInUp 0.4s ease backwards;
}
.lb-row:nth-child(2) {
    border-left: 3px solid var(--gold);
}
.lb-row .lb-rank {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
}
.lb-row.highlight {
    border-color: var(--cyan);
    background: rgba(0, 245, 255, 0.05);
}

/* ============================================================
   KEYFRAME ANIMATIONS
   ============================================================ */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.04); }
}

@keyframes glow {
    0%, 100% { text-shadow: var(--cyan-glow); }
    50%      { text-shadow: var(--cyan-glow-strong); }
}

@keyframes slideUp {
    0% {
        transform: translateY(30px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes glitch {
    0% {
        transform: translate(0, 0) skewX(0deg);
    }
    20% {
        transform: translate(-2px, 1px) skewX(-0.5deg);
    }
    40% {
        transform: translate(1px, -1px) skewX(0.3deg);
    }
    60% {
        transform: translate(-1px, 0px) skewX(-0.2deg);
    }
    80% {
        transform: translate(2px, 1px) skewX(0.4deg);
    }
    100% {
        transform: translate(0, 0) skewX(0deg);
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.15);
        opacity: 1;
    }
    70% {
        transform: scale(0.92);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    0% {
        transform: translateY(24px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================================
   RESPONSIVE — Small Screens
   ============================================================ */
@media (max-width: 768px) {
    .game-logo {
        font-size: 1.8rem;
        letter-spacing: 3px;
    }

    .game-logo span {
        letter-spacing: 5px;
    }

    .game-logo.big {
        font-size: 2.5rem;
    }

    .game-logo.big span {
        letter-spacing: 7px;
    }

    .tagline {
        font-size: 0.95rem;
        letter-spacing: 2px;
    }

    .controls-guide {
        flex-direction: column;
        align-items: center;
    }

    .control-item {
        min-width: unset;
        width: 100%;
        max-width: 300px;
        padding: 12px 16px;
    }

    .neon-btn {
        font-size: 0.85rem;
        padding: 14px 32px;
        letter-spacing: 3px;
    }

    /* HUD */
    #hud {
        padding: 10px 14px;
        flex-wrap: wrap;
        gap: 8px;
    }

    #hud-left {
        gap: 16px;
    }

    .hud-value {
        font-size: 1.1rem;
    }

    .hud-label {
        font-size: 0.55rem;
    }

    .bar-container {
        width: 120px;
    }

    #hud-center {
        order: -1;
        width: 100%;
        justify-content: center;
    }

    /* Face Cam */
    #face-cam-container {
        width: 130px;
        height: 100px;
        bottom: 12px;
        right: 12px;
    }

    .cam-label {
        font-size: 0.45rem;
    }

    /* Wave */
    .wave-number {
        font-size: 4.5rem;
    }

    /* Game Over */
    .gameover-title {
        font-size: 2.2rem;
        letter-spacing: 4px;
    }

    .gameover-title span {
        letter-spacing: 6px;
    }

    .final-stats {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 14px 10px;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .stat-label {
        font-size: 0.48rem;
    }

    /* Indicators */
    #control-indicators {
        bottom: 14px;
        left: 14px;
    }

    /* V2.0 Elements */
    .skin-grid { gap: 6px; }
    .skin-option { min-width: 60px; padding: 6px 8px; }
    .skin-preview { width: 30px; height: 38px; }
    #boss-hud .boss-bar-container { width: 200px; }
}

@media (max-width: 420px) {
    .game-logo.big {
        font-size: 1.8rem;
    }

    .gameover-title {
        font-size: 1.6rem;
    }

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

    #face-cam-container {
        width: 100px;
        height: 75px;
    }

    .wave-number {
        font-size: 3.5rem;
    }

    #combo-value {
        font-size: 1.8rem;
    }
}

/* Tokens & Sensitivity */
#sensitivity-container {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.sens-title {
    font-family: var(--font-display);
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-dim);
    letter-spacing: 2px;
}
.sens-options {
    display: flex;
    gap: 8px;
}
.sens-btn {
    background: rgba(0, 245, 255, 0.05);
    border: 1px solid rgba(0, 245, 255, 0.2);
    color: var(--text-dim);
    font-family: var(--font-display);
    font-size: 0.7rem;
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.sens-btn:hover {
    background: rgba(0, 245, 255, 0.1);
    border-color: rgba(0, 245, 255, 0.4);
    color: var(--text-main);
}
.sens-btn.selected {
    background: rgba(0, 245, 255, 0.2);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 245, 255, 0.2);
}
.skin-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 6px;
}


.hud-btn {
    background: rgba(0, 245, 255, 0.1);
    border: 1px solid rgba(0, 245, 255, 0.4);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 4px;
    padding: 5px 10px;
    backdrop-filter: blur(5px);
    transition: all 0.2s;
    margin-right: 15px;
}
.hud-btn:hover {
    background: rgba(0, 245, 255, 0.3);
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 245, 255, 0.5);
}
