/* ============================================
   Oracle Cat Shooter - Base Styles
   Professional, clean, responsive
   ============================================ */

:root {
    /* Color Palette */
    --bg-primary: #0a0e27;
    --bg-secondary: #1a1f3a;
    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;
    --accent-gold: #fbbf24;
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --health-green: #10b981;
    --neon-health: #39FF14;
    --neon-health-glow: rgba(57,255,20,0.28);
    --neon-shield: #88F0FF;
    --neon-shield-glow: rgba(136,240,255,0.22);
    --health-red: #ef4444;
    --overlay-dark: rgba(10, 14, 39, 0.95);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Borders */
    --border-radius: 8px;
    --border-radius-sm: 4px;
    --border-width: 2px;
    --powerup-opacity: 0.5;
    /* Global HUD scale -- easy tuning for responsive layouts */
    --hud-scale: 1;
}

/* Make the Power-Ups container transparent so enemies remain visible behind it */
.power-up-hud, #powerUpHUD {
    background: transparent !important;
}

/* Compact Advanced Weapons HUD (under player nickname) */
.compact-adv-weapons {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    padding: 6px 10px;
    border-radius: 8px;
    /* keep default but allow transparent override in top HUD */
    background: linear-gradient(135deg, rgba(17,24,39,0.28), rgba(17,24,39,0.18));
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.04);
    box-shadow: 0 6px 20px rgba(2,6,23,0.5);
    font-size: 13px;
}

.compact-adv-weapons .stat-label { color: rgba(255,255,255,0.6); margin-right:6px; font-weight:500; }
.compact-adv-weapons .stat-value { color: #e6eefc; font-weight:700; }

/* Force compact advanced weapons items to be vertically stacked and centered */
.hud-top .player-info .compact-adv-weapons .stat-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px 10px !important;
    min-width: 120px !important;
    gap: 2px !important;
}

.hud-top .player-info .compact-adv-weapons .stat-label {
    text-transform: none !important;
    font-size: 0.82rem !important;
    margin: 0 !important;
    color: rgba(230,238,252,0.9) !important;
}

.hud-top .player-info .compact-adv-weapons .stat-value {
    font-size: 0.92rem !important;
    font-weight: 700 !important;
    color: #e6eefc !important;
}

/* Make compact advanced weapons background transparent to show game behind it */
.hud-top .player-info .compact-adv-weapons,
.hud-top .player-info .compact-adv-weapons .stat-item {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Top-right stat boxes: make background transparent like Power-Ups modal */
.hud-top .hud-right .stat-display {
    background: rgba(10,14,39,0.92);
    padding: 6px 10px !important;
    border-radius: 8px;
    border: 1px solid rgba(139,92,246,0.12);
    box-shadow: 0 8px 20px rgba(2,6,23,0.22);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 92px;
}

.hud-top .hud-right .stat-display .stat-label {
    color: rgba(230,238,252,0.78);
    font-size: 0.78rem;
    font-weight: 600;
}

.hud-top .hud-right .stat-display .stat-value {
    color: #e6eefc;
    font-size: 0.98rem;
    font-weight: 800;
}

/* === Override: Tight compact player-info (force smaller container) === */
.hud-top .player-info {
    display: inline-flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    padding: 4px 6px !important;
    width: auto !important;
    max-width: none !important;
    box-shadow: 0 6px 18px rgba(2,6,23,0.18) !important;
}

.hud-top .player-info .nickname {
    margin-bottom: 6px !important;
}

.hud-top .player-info .compact-adv-weapons .stat-item {
    padding: 6px 8px !important;
    min-width: 88px !important;
}

/* ============================================
   Global Reset & Base
   ============================================ */

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
}

/* ============================================
   Utility Classes
   ============================================ */

.hidden {
    display: none !important;
}

.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

/* ============================================
   Loading Screen
   ============================================ */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

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

.loading-content h1 {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-lg);
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--bg-secondary);
    border-top: 4px solid var(--accent-purple);
    border-radius: 50%;
    margin: 0 auto var(--spacing-lg);
    animation: spin 1s linear infinite;
}

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

.loading-content p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ============================================
   Game Container & Canvas
   ============================================ */

.game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    background: #000;
    touch-action: none; /* Prevent touch gestures */
    outline: none; /* Remove default focus outline */
}

/* SlowField visuals (lightweight, GPU-friendly where possible) */
.slow-field-overlay {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    mix-blend-mode: overlay;
    background: radial-gradient(circle at 50% 50%, rgba(6,12,22,0.36), rgba(96,165,250,0.24) 8%, rgba(96,165,250,0.14) 44%, rgba(96,165,250,0.03) 74%, transparent 100%);
    border: 2px solid rgba(96,165,250,0.28);
    box-shadow: 0 0 32px rgba(96,165,250,0.26), 0 6px 24px rgba(6,10,20,0.28) inset;
    outline: 1px solid rgba(255,255,255,0.03);
    transition: opacity 160ms linear, transform 300ms ease;
    will-change: transform, opacity;
    animation: slowfield-overlay-pulse 1000ms ease-in-out infinite;
}

/* Slight backdrop blur on capable browsers to separate field from background. Feature-detected to avoid issues. */
/* Backdrop blur intentionally removed to ensure clear interior visibility across devices. */

/* Animated edge waves via pseudo-element (single DOM element, GPU-friendly) */
.slow-field-overlay::before {
    content: '';
    position: absolute;
    left: 0; top: 0; right: 0; bottom: 0;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle, transparent 60%, rgba(96,165,250,0.08) 72%, rgba(96,165,250,0.14) 78%, rgba(96,165,250,0.0) 82%);
    transform: scale(1);
    animation: slowfield-edge-wave 780ms cubic-bezier(.2,.9,.3,1) infinite;
    mix-blend-mode: screen;
    opacity: 1;
    box-shadow: 0 0 18px rgba(96,165,250,0.22);
}

/* Subtle noise overlay to give stormy texture without particles */
.slow-field-overlay::after {
    content: '';
    position: absolute;
    left: 0; top: 0; right: 0; bottom: 0;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle at 30% 30%, rgba(0,0,0,0.06), transparent 40%), radial-gradient(circle at 70% 70%, rgba(0,0,0,0.04), transparent 50%);
    mix-blend-mode: multiply;
    opacity: 0.9;
}

@keyframes slowfield-edge-wave {
    0% { transform: scale(0.98); opacity: 0.9; }
    50% { transform: scale(1.03); opacity: 1; }
    100% { transform: scale(0.98); opacity: 0.9; }
}

/* Removed blur-support to avoid invisible/unsupported backdrop-filter effects on some platforms */

.slow-field-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(96,165,250,0.36);
    pointer-events: none;
    transform: scale(0.01);
    opacity: 1;
    z-index: 125;
    animation: slowfield-ring 820ms cubic-bezier(.1,.9,.2,1) forwards;
}

@keyframes slowfield-ring {
    to { transform: scale(1.12); opacity: 0; }
}

@keyframes slowfield-overlay-pulse {
    0% { transform: scale(0.985); opacity: 0.94; }
    50% { transform: scale(1.02); opacity: 1; }
    100% { transform: scale(0.985); opacity: 0.94; }
}

.slow-field-hit {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(96,165,250,1);
    box-shadow: 0 0 14px rgba(96,165,250,0.8), 0 0 6px rgba(255,255,255,0.12) inset;
    pointer-events: none;
    z-index: 126;
    animation: slowfield-hit 320ms ease-out forwards;
}

@keyframes slowfield-hit {
    0% { transform: scale(0.6); opacity: 1; }
    100% { transform: scale(1.6); opacity: 0; }
}

#gameCanvas:focus {
    outline: none; /* Keep no outline even when focused */
    /* Optional: subtle glow when focused */
    /* box-shadow: inset 0 0 20px rgba(139, 92, 246, 0.3); */
}

/* ============================================
   HUD Overlay
   ============================================ */

.hud-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.hud-top {
    display: flex;
    justify-content: flex-start; /* left content flows normally; right side will be absolutely positioned */
    padding: var(--spacing-md);
    position: relative; /* allow absolute positioning of .hud-right so it can sit tight to the right edge */
}

.hud-left {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* Position the right HUD flush to the right edge without widening the top bar */
.hud-top .hud-right {
    position: absolute;
    right: calc(var(--spacing-md) - 4px); /* nudge slightly inward from top padding */
    top: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    align-items: flex-end;
}

/* Put resources above stat boxes without changing DOM order */
.hud-top .hud-right #resourceDisplay,
.hud-top .hud-right .resource-display {
    order: -1; /* move to top */
    margin-bottom: 6px !important; /* small tight gap under resources */
    align-self: center; /* center within right column */
}

.player-info {
    background: var(--overlay-dark);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius);
    border: var(--border-width) solid var(--accent-purple);
}

/* Compact transparent variant for the top HUD player-info */
.hud-top .player-info {
    background: linear-gradient(135deg, rgba(17,24,39,0.18), rgba(17,24,39,0.12)) !important;
    padding: 6px 8px !important;
    border-radius: 10px !important;
    border: 1px solid rgba(255,255,255,0.04) !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 6px 18px rgba(2,6,23,0.45);
}

.nickname {
    display: block;
    font-weight: bold;
    font-size: 0.95rem; /* smaller for compact HUD */
    margin-bottom: var(--spacing-xs);
    color: var(--accent-cyan);
}

/* Smaller weapon labels in compact HUD (Primary / Secondary) */
.hud-top .player-info #hudPrimaryWeapon,
.hud-top .player-info #hudSecondaryWeapon {
    font-size: 0.78rem !important;
    line-height: 1.05 !important;
    text-transform: none !important; /* remove forced uppercase */
    font-weight: 600 !important;
    letter-spacing: 0.2px !important;
    color: var(--text-primary) !important;
    opacity: 0.95;
}

.health-bar {
    width: 200px;
    height: 20px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: var(--spacing-xs);
}

/* Keep icons/names/badges slightly transparent (visual de-emphasis) */
.power-up-hud .power-up-icon,
.power-up-hud .badge,
.power-up-hud .power-up-abbrev {
    opacity: var(--powerup-opacity);
}

/* Make power-up numeric values and progress bars fully opaque for readability */
.power-up-hud .power-up-name,
.power-up-hud .power-up-stacks,
.power-up-hud .power-up-stack-text,
.power-up-hud .power-up-stack-fill,
.power-up-hud .laser-energy-text,
.power-up-hud .laser-energy-fill,
.power-up-hud .laser-energy-bar,
.power-up-hud .missile-cooldown-container,
.power-up-hud .missile-cooldown-container div {
    opacity: 1;
}

/* Ensure outlines/borders remain subtle but visible */
.power-up-hud .power-up-item { border-color: rgba(255,255,255,0.06); }
.health-fill {
    height: 100%;
    transform-origin: left center;
    transform: scaleX(1);
    will-change: transform, opacity;
    transition: transform 280ms cubic-bezier(.2,.9,.2,1), background 220ms ease;
    position: relative;
}

.health-fill[style*="width: 0"] {
    background: var(--health-red);
}

/* Neon liquid sheen + glow */
.health-bar {
    position: relative;
}

#healthFill {
    background: linear-gradient(90deg, var(--neon-health) 0%, #22ff7a 70%);
    box-shadow: 0 0 10px var(--neon-health-glow), inset 0 0 12px rgba(255,255,255,0.02);
}

#shieldFill {
    background: linear-gradient(90deg, var(--neon-shield) 0%, #7ee7ff 70%);
    box-shadow: 0 0 12px var(--neon-shield-glow), inset 0 0 10px rgba(255,255,255,0.02);
}

/* Sheen overlay to mimic liquid flow */
.health-fill::before, .health-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -40%;
    width: 60%;
    height: 100%;
    pointer-events: none;
    opacity: 0.45;
    transform: skewX(-20deg) translateX(0);
    background: linear-gradient(90deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.02) 60%);
    transition: opacity 200ms ease;
}

.health-fill::after {
    left: -70%;
    width: 80%;
    opacity: 0.18;
    transform: skewX(-12deg) translateX(0);
}

@keyframes sheen-move {
    0% { transform: translateX(-100%) skewX(-20deg); }
    100% { transform: translateX(200%) skewX(-20deg); }
}

.health-fill.sheen-animate::before, .health-fill.sheen-animate::after {
    animation: sheen-move 2.8s linear infinite;
}

/* Subtle neon pulse (cheap) */
@keyframes neon-pulse {
    0% { box-shadow: 0 0 8px rgba(0,0,0,0.0); transform: scaleY(1); }
    50% { box-shadow: 0 0 18px rgba(255,255,255,0.06); transform: scaleY(1.02); }
    100% { box-shadow: 0 0 8px rgba(0,0,0,0.0); transform: scaleY(1); }
}

.health-fill.pulse {
    animation: neon-pulse 1800ms ease-in-out infinite;
}

/* Ensure minimal motion for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .health-fill.pulse { animation: none; }
}

/* Subtle bubbles (cheap) */
.health-fill::marker { display: none; }

/* Accessibility: respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .health-fill.sheen-animate::before, .health-fill.sheen-animate::after {
        animation: none;
        opacity: 0;
    }
}

.health-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Stat text inside bars (numbers) */
.stat-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: rgba(6,6,6,0.95); /* dark text for max contrast */
    font-weight: 700;
    font-size: 0.9rem;
    pointer-events: none;
    background: rgba(0,0,0,0.55); /* semi-opaque dark backdrop */
    padding: 2px 6px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.45);
    z-index: 6;
}

.stat-display {
    /* Slightly transparent container to avoid occluding gameplay */
    background: rgba(10,14,39,0.72); /* lighter than --overlay-dark */
    padding: 0.32rem 0.48rem; /* slightly tighter for compact look */
    border-radius: calc(var(--border-radius) * 0.9);
    border: 1px solid rgba(251,191,36,0.18); /* subtle outline */
    transform: scale(calc(0.9 * var(--hud-scale))); /* visual scale multiplied by global HUD scale */
    transform-origin: center;
}

.stat-label {
    font-size: 0.78rem; /* slightly smaller */
    color: var(--text-secondary);
    margin-right: var(--spacing-xs);
    opacity: 1; /* ensure label remains readable */
}

.stat-value {
    font-size: 0.78rem !important; /* match Primary/Secondary compact size */
    font-weight: 700 !important;
    color: var(--accent-gold) !important;
    opacity: 1; /* ensure value remains fully visible */
}

/* Stronger layout & centering for top-right HUD stat boxes
   Keep width equal to resource display and increase font sizes
   while preventing horizontal expansion. */
.hud-top .hud-right .stat-display {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    width: 68px !important; /* match .resource-display min-width for symmetry */
    min-width: 68px !important;
    padding: 0.08rem 0.12rem !important; /* tighten padding so larger fonts don't expand */
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.hud-top .hud-right .stat-display .stat-label {
    font-size: 0.85rem !important; /* slightly larger label */
    color: var(--text-secondary) !important;
    margin-right: 0 !important;
    text-align: center !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
}

.hud-top .hud-right .stat-display .stat-value {
    font-size: 1.05rem !important; /* larger value to match resource emphasis */
    font-weight: 700 !important;
    text-align: center !important;
    line-height: 1 !important;
}

/* ============================================
   Resource Display (Phase 2)
   ============================================ */

.resource-display, #resourceDisplay {
    background: rgba(10,14,39,0.72); /* slightly transparent */
    padding: 0.224rem 0.36rem; /* tighter padding to reduce empty left space */
    border-radius: calc(var(--border-radius) * 0.85);
    border: 1px solid rgba(139,92,246,0.10);
    display: flex;
    flex-direction: column;
    gap: 0.224rem;
    min-width: 68px; /* 84px * 0.8 ≈ 67.2 -> 68 */
    transform: scale(calc(0.92 * var(--hud-scale)));
    transform-origin: top right;
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 0.22rem; /* tighter gap (~20% smaller) */
    font-size: 0.84rem; /* slightly smaller */
}

.resource-icon {
    font-size: 0.76rem; /* reduced ~20% */
    min-width: 14px; /* reduced */
    text-align: center;
}

.resource-label {
    margin-left: 3px;
    color: var(--text-secondary);
    font-size: 0.875rem; /* match .stat-label */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 52px; /* 64 * 0.8 ≈ 51.2 */
    opacity: 1; /* ensure label visible */
}

.resource-value {
    font-size: 1.0rem; /* slightly reduced from 1.25 to fit */
    font-weight: bold;
    color: var(--accent-gold);
    margin-left: 6px;
    min-width: 22px;
    text-align: right;
    opacity: 1; /* ensure value visible */
}

/* Hangar / mockup resource name/amount styles: match stat label/value */
.resource-name {
    font-size: 0.875rem; /* same as .stat-label */
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.resource-amount {
    font-size: 1.25rem; /* same as .stat-value */
    font-weight: 700;
    color: var(--accent-gold);
}

.resource-info {
    display: flex;
    flex-direction: column;
    margin-left: 6px;
}

.resource-item span:last-child {
    font-weight: bold;
    color: var(--text-primary);
    margin-left: auto;
}

/* ============================================
   FPS Display (Always Visible)
   ============================================ */

.fps-display {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    font-weight: bold;
    z-index: 150;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.fps-display #fpsCounter {
    color: #10b981;
    font-size: 1.25rem;
}

/* Color coding based on performance */
.fps-display.fps-good #fpsCounter { color: #10b981; } /* Green: 55+ FPS */
.fps-display.fps-ok #fpsCounter { color: #fbbf24; }   /* Yellow: 30-54 FPS */
.fps-display.fps-bad #fpsCounter { color: #ef4444; }  /* Red: <30 FPS */

/* ============================================
   Debug Info (Extended)
   ============================================ */

.debug-info {
    position: absolute;
    bottom: var(--spacing-md);
    left: var(--spacing-md);
    background: rgba(0, 0, 0, 0.8);
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: #0f0;
    z-index: 200;
}

.debug-info div {
    margin-bottom: 2px;
}

/* ============================================
   Center Instructions
   ============================================ */

.center-instructions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 50;
    pointer-events: none;
    opacity: 1;
    transition: opacity 1.2s ease;
}

.center-instructions.ci-hidden {
    opacity: 0;
}

.center-instructions h2 {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-md);
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(139, 92, 246, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

.center-instructions .subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.center-instructions kbd {
    display: inline-block;
    padding: 4px 8px;
    background: var(--bg-secondary);
    border: 2px solid var(--accent-purple);
    border-radius: 4px;
    font-family: monospace;
    font-weight: bold;
    color: var(--accent-cyan);
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.3);
}

.center-instructions .version {
    font-size: 0.875rem;
    color: var(--accent-gold);
    font-style: italic;
    margin-top: var(--spacing-sm);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ============================================
   Wave Start Notification (Bottom Center)
   ============================================ */

.wave-notification {
    position: absolute;
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    pointer-events: none;
}

.wave-notification.hidden {
    opacity: 0;
    visibility: hidden;
}

/* ============================================
   Bottom-center HUD (Health + Shield)
   ============================================ */
.hud-bottom-center {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 220;
    pointer-events: none;
}

.hud-bottom-center .bottom-stats {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hud-bottom-center .player-info {
    background: rgba(10,14,39,0.92);
    padding: 8px 12px;
    border-radius: 10px;
    border: 2px solid rgba(139,92,246,0.18);
    display: flex;
    align-items: center;
    gap: 10px;
}

.hud-bottom-center .health-bar { width: 220px; height: 18px; flex: 0 0 auto; position: relative; }
.hud-bottom-center .health-text { font-size: 0.9rem; color: var(--text-secondary); margin-left: 12px; }

.hud-bottom-center .player-info .health-fill { height: 100%; transition: width 0.3s ease, background 0.3s ease; }

/* center overlay text inside bars */
.hud-bottom-center .stat-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    pointer-events: none;
    text-shadow: 0 1px 0 rgba(0,0,0,0.5);
}

/* stacked rows inside player-info */
.hud-bottom-center .bottom-stats-stack { display: flex; flex-direction: column; gap: 6px; }
.hud-bottom-center .stat-row { display: flex; align-items: center; gap: 10px; }
.hud-bottom-center .stat-row .health-bar { flex: 0 0 auto; }
.hud-bottom-center .stat-row .health-text { margin-left: auto; }

.wave-notification-content {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.95), rgba(6, 182, 212, 0.95));
    border: 2px solid var(--accent-purple);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem 3rem;
    text-align: center;
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.6), 0 0 60px rgba(6, 182, 212, 0.4);
    animation: waveSlideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.wave-number-big {
    display: block;
    font-size: 3rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
}

.wave-subtitle {
    display: block;
    font-size: 1.5rem;
    color: var(--accent-gold);
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
}

/* ============================================
   Modal Overlays
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-secondary);
    padding: var(--spacing-xl);
    border-radius: var(--border-radius);
    border: 3px solid var(--accent-purple);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 50px rgba(139, 92, 246, 0.5);
    position: relative; /* enable absolutely positioned close button */
}

.modal-content h2 {
    margin-bottom: var(--spacing-lg);
    text-align: center;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-content h3 {
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    color: var(--accent-cyan);
}

/* Polished circular close button in modal header (top-right) */
.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: linear-gradient(135deg, #8b5cf6 0%, #fb7185 100%);
    color: #fff;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(139,92,246,0.18), 0 2px 6px rgba(0,0,0,0.25);
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}
.modal-close:hover { transform: translateY(-2px) scale(1.03); }
.modal-close:active { transform: translateY(0) scale(0.98); }
.modal-close:focus { outline: 2px solid rgba(255,255,255,0.08); outline-offset: 2px; }

/* ============================================
   Buttons
   ============================================ */

/* Scan-shimmer + pulsing glow — same system as hangar tabs */
@keyframes menuBtnScan {
    0%   { left: -100%; }
    100% { left:  200%; }
}
@keyframes menuBtnGlowPulse {
    0%, 100% { box-shadow: 0 0 18px rgba(139,92,246,0.30), 0 4px 16px rgba(0,0,0,0.45); }
    50%       { box-shadow: 0 0 32px rgba(139,92,246,0.60), 0 4px 22px rgba(0,0,0,0.50); }
}
@keyframes menuBtnGlowPulsePrimary {
    0%, 100% { box-shadow: 0 0 22px rgba(99,102,241,0.45), 0 4px 18px rgba(0,212,255,0.15); }
    50%       { box-shadow: 0 0 42px rgba(99,102,241,0.75), 0 4px 28px rgba(0,212,255,0.30); }
}

.menu-btn {
    position: relative;
    overflow: hidden;
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1rem;
    font-weight: 800;
    border-radius: var(--border-radius);
    cursor: pointer;
    background: rgba(255,255,255,0.03);
    color: rgba(203,213,225,0.9);
    border: 1.5px solid rgba(139,92,246,0.35);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    transition: border-color 0.22s, color 0.22s, background 0.22s, box-shadow 0.22s, transform 0.15s;
    font-family: inherit;
}
/* scan shimmer */
.menu-btn::before {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    left: -100%;
    width: 60%;
    background: linear-gradient(90deg, transparent 0%, rgba(139,92,246,0.18) 50%, transparent 100%);
    transform: skewX(-15deg);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s;
}
.menu-btn:hover::before {
    opacity: 1;
    animation: menuBtnScan 0.6s ease-in-out;
}
.menu-btn:hover {
    border-color: rgba(139,92,246,0.65);
    color: #c4b5fd;
    background: rgba(139,92,246,0.09);
    box-shadow: 0 0 18px rgba(139,92,246,0.22), 0 4px 14px rgba(0,0,0,0.35);
    transform: translateY(-2px);
}
.menu-btn:active { transform: translateY(0); }

.menu-btn.primary {
    background: linear-gradient(135deg, rgba(99,102,241,0.85), rgba(0,212,255,0.75));
    border-color: transparent;
    color: #fff;
    text-shadow: 0 0 10px rgba(0,212,255,0.5);
    animation: menuBtnGlowPulsePrimary 3s ease-in-out infinite;
}
.menu-btn.primary::before {
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.22) 50%, transparent 100%);
}
.menu-btn.primary:hover {
    background: linear-gradient(135deg, rgba(99,102,241,1), rgba(0,212,255,0.95));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 0 36px rgba(99,102,241,0.65), 0 6px 28px rgba(0,212,255,0.25);
}

.menu-btn.danger {
    background: rgba(255,255,255,0.03);
    border-color: rgba(239,68,68,0.5);
    color: #fca5a5;
}
.menu-btn.danger::before {
    background: linear-gradient(90deg, transparent 0%, rgba(239,68,68,0.18) 50%, transparent 100%);
}
.menu-btn.danger:hover {
    background: rgba(239,68,68,0.12);
    border-color: rgba(239,68,68,0.8);
    color: #fff;
    box-shadow: 0 0 18px rgba(239,68,68,0.30), 0 4px 14px rgba(0,0,0,0.35);
}

.menu-btn.small {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.875rem;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* ============================================
   Settings
   ============================================ */

.settings-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm);
    background: var(--bg-primary);
    border-radius: var(--border-radius-sm);
}

.setting-row label {
    font-size: 1rem;
    color: var(--text-primary);
}

.setting-row input[type="checkbox"] {
    width: 50px;
    height: 24px;
    cursor: pointer;
}

.nickname-section {
    background: var(--bg-primary);
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
}

.nickname-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
}

.nickname-info span {
    color: var(--accent-cyan);
    font-weight: bold;
}

/* ============================================
   Pilot ID — Lock / Edit Field
   ============================================ */

.pilot-id-block {
    margin-bottom: 0.6rem;
}

.pilot-id-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.pilot-id-label-text {
    font-size: 0.75rem;
    color: #94a3b8;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
}

.pilot-id-diamond {
    color: #00d4ff;
}

.pilot-id-lock-badge {
    font-size: 0.62rem;
    color: rgba(0,212,255,0.45);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
    transition: opacity 0.2s;
}

/* Row: input + buttons */
.pilot-id-row {
    display: flex;
    gap: 6px;
    align-items: stretch;
}

/* Input */
.pilot-id-input {
    flex: 1;
    min-width: 0;
    background: rgba(0,212,255,0.04);
    border: 1.5px solid rgba(0,212,255,0.22);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 1.05rem;
    color: #e2e8f0;
    outline: none;
    letter-spacing: 0.06em;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
}

/* Locked state — dashed, dimmed */
.pilot-id-input[readonly] {
    background: rgba(255,255,255,0.02);
    border-color: rgba(0,212,255,0.10);
    border-style: dashed;
    color: #64748b;
    cursor: default;
    box-shadow: none;
}

/* Editing state — cyan glow pulse */
.pilot-id-block.is-editing .pilot-id-input {
    border-color: rgba(0,212,255,0.65);
    border-style: solid;
    color: #e2e8f0;
    box-shadow: 0 0 14px rgba(0,212,255,0.20), inset 0 0 6px rgba(0,212,255,0.04);
    animation: pilotIdPulse 2.6s ease-in-out infinite;
}
.pilot-id-block.is-editing .pilot-id-input:focus {
    box-shadow: 0 0 22px rgba(0,212,255,0.32), inset 0 0 8px rgba(0,212,255,0.06);
}

@keyframes pilotIdPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(0,212,255,0.16); }
    50%       { box-shadow: 0 0 22px rgba(0,212,255,0.35); }
}

/* Shared button base */
.pilot-id-btn {
    height: 42px;
    padding: 0 13px;
    border-radius: 7px;
    font-size: 0.77rem;
    font-family: inherit;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.18s, box-shadow 0.18s, transform 0.12s, border-color 0.18s;
    flex-shrink: 0;
}
.pilot-id-btn:hover  { transform: translateY(-1px); }
.pilot-id-btn:active { transform: translateY(0);    }

/* EDIT — cyan ghost */
.pilot-id-btn--edit {
    background: rgba(0,212,255,0.07);
    border: 1.5px solid rgba(0,212,255,0.28);
    color: #00d4ff;
}
.pilot-id-btn--edit:hover {
    background: rgba(0,212,255,0.16);
    box-shadow: 0 0 12px rgba(0,212,255,0.22);
    border-color: rgba(0,212,255,0.55);
}

/* SAVE — cyan solid */
.pilot-id-btn--save {
    background: rgba(0,212,255,0.14);
    border: 1.5px solid rgba(0,212,255,0.55);
    color: #00d4ff;
}
.pilot-id-btn--save:hover {
    background: rgba(0,212,255,0.26);
    box-shadow: 0 0 16px rgba(0,212,255,0.32);
    border-color: rgba(0,212,255,0.85);
}

/* CANCEL — red ghost, compact */
.pilot-id-btn--cancel {
    background: rgba(239,68,68,0.07);
    border: 1.5px solid rgba(239,68,68,0.28);
    color: #f87171;
    padding: 0 10px;
}
.pilot-id-btn--cancel:hover {
    background: rgba(239,68,68,0.18);
    box-shadow: 0 0 10px rgba(239,68,68,0.20);
    border-color: rgba(239,68,68,0.55);
}

/* Error text */
.pilot-id-error {
    color: #f87171;
    font-size: 0.78rem;
    margin-top: 5px;
    min-height: 1.1em;
    letter-spacing: 0.03em;
    font-weight: 600;
}

/* Info line ("Active: Rado") */
.pilot-id-info {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 7px;
    letter-spacing: 0.03em;
}

/* ============================================
   Game Over Screen
   ============================================ */

.oracle-message {
    text-align: center;
    font-size: 1.25rem;
    font-style: italic;
    color: var(--accent-gold);
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-md);
    background: rgba(251, 191, 36, 0.1);
    border-radius: var(--border-radius);
}

.stats-summary {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-primary);
    border-radius: var(--border-radius-sm);
}

.stat-name {
    color: var(--text-secondary);
}

.stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-cyan);
}

/* ============================================
   Mobile Responsive
   ============================================ */

@media (max-width: 768px) {
    .modal-content {
        padding: var(--spacing-lg);
    }
    
    .modal-content h2 {
        font-size: 1.5rem;
    }
    
    .health-bar {
        width: 150px;
    }
    
    .hud-top {
        padding: var(--spacing-sm);
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .loading-content h1 {
        font-size: 1.75rem;
    }
    
    .hud-left, .hud-right {
        font-size: 0.75rem;
    }
    
    .health-bar {
        width: 100px;
    }
    
    .center-instructions h2 {
        font-size: 1.5rem;
    }
    
    .center-instructions .subtitle {
        font-size: 1rem;
    }
}

/* ============================================
   Game Over Screen (Professional)
   ============================================ */

.game-over-modal {
    max-width: 600px;
    animation: gameOverSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes gameOverSlideIn {
    from {
        transform: translateY(-100px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.game-over-title {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-md);
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { text-shadow: 0 0 20px rgba(239, 68, 68, 0.5); }
50% { text-shadow: 0 0 40px rgba(239, 68, 68, 0.8); }
}

.game-over-message {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    font-style: italic;
}

.high-score-badge {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--border-radius);
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: var(--spacing-lg);
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.6);
}

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

.performance-grade {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    font-size: 1.2rem;
}

.grade-value {
    font-family: 'Courier New', monospace;
    font-size: 3rem;
    font-weight: bold;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
    min-width: 80px;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.stat-box {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    text-align: center;
    transition: all 0.3s ease;
}

.stat-box:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(139, 92, 246, 0.5);
    transform: translateY(-2px);
}

.stat-box.primary {
    grid-column: span 2;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(6, 182, 212, 0.2));
    border-color: var(--accent-purple);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--spacing-xs);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--accent-cyan);
}

.stat-box.primary .stat-value {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   Oracle Dialog Overlay (Phase 3.5)
   ============================================ */

.oracle-dialog-overlay {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 900;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), 
                transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: translateX(-50%) translateY(30px) scale(0.9);
}

.oracle-dialog-overlay.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
}

.oracle-dialog-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    background: 
        radial-gradient(ellipse at top left, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(168, 85, 247, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, 
            rgba(15, 23, 42, 0.98) 0%, 
            rgba(30, 27, 75, 0.98) 50%,
            rgba(88, 28, 135, 0.98) 100%);
    border: 2px solid transparent;
    border-radius: 24px;
    padding: var(--spacing-md) var(--spacing-lg);
    box-shadow: 
        0 0 0 1px rgba(139, 92, 246, 0.5),
        0 0 0 2px rgba(88, 28, 135, 0.3),
        0 12px 48px rgba(139, 92, 246, 0.6), 
        0 0 80px rgba(139, 92, 246, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px) saturate(150%);
    position: relative;
    overflow: hidden;
    max-width: 650px;
    min-width: 450px;
}

/* Animated holographic border */
.oracle-dialog-content::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: conic-gradient(
        from 0deg at 50% 50%,
        rgba(139, 92, 246, 0) 0deg,
        rgba(139, 92, 246, 0.8) 90deg,
        rgba(168, 85, 247, 0.6) 180deg,
        rgba(139, 92, 246, 0) 270deg,
        rgba(139, 92, 246, 0) 360deg
    );
    border-radius: 24px;
    animation: rotateBorder 4s linear infinite;
    pointer-events: none;
    opacity: 0.6;
}

/* Shimmer light sweep */
.oracle-dialog-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(139, 92, 246, 0.3) 50%, 
        transparent 100%);
    animation: shimmer 3s infinite;
    pointer-events: none;
    z-index: 1;
}

/* Scanlines sci-fi effect */
.oracle-dialog-left::before,
.oracle-dialog-right::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.05) 0px,
        transparent 1px,
        transparent 2px,
        rgba(0, 0, 0, 0.05) 3px
    );
    pointer-events: none;
    opacity: 0.3;
    animation: scanlines 8s linear infinite;
}

/* Floating particles background */
.oracle-dialog-overlay::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle, rgba(255, 255, 255, 0.8) 1px, transparent 1px),
        radial-gradient(circle, rgba(139, 92, 246, 0.6) 1px, transparent 1px),
        radial-gradient(circle, rgba(168, 85, 247, 0.4) 2px, transparent 2px);
    background-size: 50px 50px, 80px 80px, 120px 120px;
    background-position: 0 0, 40px 60px, 80px 20px;
    animation: floatParticles 20s linear infinite;
    opacity: 0.15;
    pointer-events: none;
}

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

@keyframes shimmer {
    0% { left: -100%; opacity: 0; }
    50% { opacity: 1; }
    100% { left: 100%; opacity: 0; }
}

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

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

/* Color variations for different dialog types */
.oracle-dialog-overlay.taunt .oracle-dialog-content {
    background: 
        radial-gradient(ellipse at top left, rgba(239, 68, 68, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(220, 38, 38, 0.15) 0%, transparent 50%),
        linear-gradient(135deg, 
            rgba(30, 27, 75, 0.98) 0%,
            rgba(127, 29, 29, 0.98) 50%,
            rgba(153, 27, 27, 0.98) 100%);
    box-shadow: 
        0 0 0 1px rgba(239, 68, 68, 0.5),
        0 0 0 2px rgba(153, 27, 27, 0.3),
        0 12px 48px rgba(239, 68, 68, 0.6), 
        0 0 80px rgba(239, 68, 68, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.5);
}

.oracle-dialog-overlay.taunt .oracle-dialog-content::before {
    background: conic-gradient(
        from 0deg at 50% 50%,
        rgba(239, 68, 68, 0) 0deg,
        rgba(239, 68, 68, 0.8) 90deg,
        rgba(220, 38, 38, 0.6) 180deg,
        rgba(239, 68, 68, 0) 270deg,
        rgba(239, 68, 68, 0) 360deg
    );
}

.oracle-dialog-overlay.taunt .oracle-cat-icon {
    filter: drop-shadow(0 0 20px rgba(239, 68, 68, 0.8))
            drop-shadow(0 0 40px rgba(239, 68, 68, 0.4))
            drop-shadow(0 0 60px rgba(239, 68, 68, 0.2));
    animation: iconPulseRed 3s ease-in-out infinite;
}

.oracle-dialog-overlay.taunt .oracle-dialog-left::after {
    border-color: rgba(239, 68, 68, 0.4);
}

@keyframes iconPulseRed {
    0%, 100% { 
        filter: drop-shadow(0 0 20px rgba(239, 68, 68, 0.8))
                drop-shadow(0 0 40px rgba(239, 68, 68, 0.4))
                drop-shadow(0 0 60px rgba(239, 68, 68, 0.2));
    }
    50% { 
        filter: drop-shadow(0 0 30px rgba(239, 68, 68, 1))
                drop-shadow(0 0 60px rgba(239, 68, 68, 0.6))
                drop-shadow(0 0 90px rgba(239, 68, 68, 0.3));
    }
}

.oracle-dialog-overlay.praise .oracle-dialog-content {
    background: 
        radial-gradient(ellipse at top left, rgba(16, 185, 129, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(5, 150, 105, 0.15) 0%, transparent 50%),
        linear-gradient(135deg, 
            rgba(30, 27, 75, 0.98) 0%,
            rgba(6, 95, 70, 0.98) 50%,
            rgba(5, 150, 105, 0.98) 100%);
    box-shadow: 
        0 0 0 1px rgba(16, 185, 129, 0.5),
        0 0 0 2px rgba(5, 150, 105, 0.3),
        0 12px 48px rgba(16, 185, 129, 0.6), 
        0 0 80px rgba(16, 185, 129, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.5);
}

.oracle-dialog-overlay.praise .oracle-dialog-content::before {
    background: conic-gradient(
        from 0deg at 50% 50%,
        rgba(16, 185, 129, 0) 0deg,
        rgba(16, 185, 129, 0.8) 90deg,
        rgba(5, 150, 105, 0.6) 180deg,
        rgba(16, 185, 129, 0) 270deg,
        rgba(16, 185, 129, 0) 360deg
    );
}

.oracle-dialog-overlay.praise .oracle-cat-icon {
    filter: drop-shadow(0 0 20px rgba(16, 185, 129, 0.8))
            drop-shadow(0 0 40px rgba(16, 185, 129, 0.4))
            drop-shadow(0 0 60px rgba(16, 185, 129, 0.2));
    animation: iconPulseGreen 3s ease-in-out infinite;
}

.oracle-dialog-overlay.praise .oracle-dialog-left::after {
    border-color: rgba(16, 185, 129, 0.4);
}

@keyframes iconPulseGreen {
    0%, 100% { 
        filter: drop-shadow(0 0 20px rgba(16, 185, 129, 0.8))
                drop-shadow(0 0 40px rgba(16, 185, 129, 0.4))
                drop-shadow(0 0 60px rgba(16, 185, 129, 0.2));
    }
    50% { 
        filter: drop-shadow(0 0 30px rgba(16, 185, 129, 1))
                drop-shadow(0 0 60px rgba(16, 185, 129, 0.6))
                drop-shadow(0 0 90px rgba(16, 185, 129, 0.3));
    }
}

.oracle-dialog-overlay.warning .oracle-dialog-content {
    background: 
        radial-gradient(ellipse at top left, rgba(245, 158, 11, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(217, 119, 6, 0.15) 0%, transparent 50%),
        linear-gradient(135deg, 
            rgba(30, 27, 75, 0.98) 0%,
            rgba(180, 83, 9, 0.98) 50%,
            rgba(217, 119, 6, 0.98) 100%);
    box-shadow: 
        0 0 0 1px rgba(245, 158, 11, 0.5),
        0 0 0 2px rgba(217, 119, 6, 0.3),
        0 12px 48px rgba(245, 158, 11, 0.6), 
        0 0 80px rgba(245, 158, 11, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.5);
}

.oracle-dialog-overlay.warning .oracle-dialog-content::before {
    background: conic-gradient(
        from 0deg at 50% 50%,
        rgba(245, 158, 11, 0) 0deg,
        rgba(245, 158, 11, 0.8) 90deg,
        rgba(217, 119, 6, 0.6) 180deg,
        rgba(245, 158, 11, 0) 270deg,
        rgba(245, 158, 11, 0) 360deg
    );
}

.oracle-dialog-overlay.warning .oracle-cat-icon {
    filter: drop-shadow(0 0 20px rgba(245, 158, 11, 0.8))
            drop-shadow(0 0 40px rgba(245, 158, 11, 0.4))
            drop-shadow(0 0 60px rgba(245, 158, 11, 0.2));
    animation: iconPulseOrange 3s ease-in-out infinite;
}

.oracle-dialog-overlay.warning .oracle-dialog-left::after {
    border-color: rgba(245, 158, 11, 0.4);
}

@keyframes iconPulseOrange {
    0%, 100% { 
        filter: drop-shadow(0 0 20px rgba(245, 158, 11, 0.8))
                drop-shadow(0 0 40px rgba(245, 158, 11, 0.4))
                drop-shadow(0 0 60px rgba(245, 158, 11, 0.2));
    }
    50% { 
        filter: drop-shadow(0 0 30px rgba(245, 158, 11, 1))
                drop-shadow(0 0 60px rgba(245, 158, 11, 0.6))
                drop-shadow(0 0 90px rgba(245, 158, 11, 0.3));
    }
}

.oracle-dialog-overlay.info .oracle-dialog-content {
    background: 
        radial-gradient(ellipse at top left, rgba(6, 182, 212, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(14, 116, 144, 0.15) 0%, transparent 50%),
        linear-gradient(135deg, 
            rgba(30, 27, 75, 0.98) 0%,
            rgba(14, 116, 144, 0.98) 50%,
            rgba(6, 182, 212, 0.98) 100%);
    box-shadow: 
        0 0 0 1px rgba(6, 182, 212, 0.5),
        0 0 0 2px rgba(14, 116, 144, 0.3),
        0 12px 48px rgba(6, 182, 212, 0.6), 
        0 0 80px rgba(6, 182, 212, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.5);
}

.oracle-dialog-overlay.info .oracle-dialog-content::before {
    background: conic-gradient(
        from 0deg at 50% 50%,
        rgba(6, 182, 212, 0) 0deg,
        rgba(6, 182, 212, 0.8) 90deg,
        rgba(14, 116, 144, 0.6) 180deg,
        rgba(6, 182, 212, 0) 270deg,
        rgba(6, 182, 212, 0) 360deg
    );
}

.oracle-dialog-overlay.info .oracle-cat-icon {
    filter: drop-shadow(0 0 20px rgba(6, 182, 212, 0.8))
            drop-shadow(0 0 40px rgba(6, 182, 212, 0.4))
            drop-shadow(0 0 60px rgba(6, 182, 212, 0.2));
    animation: iconPulseCyan 3s ease-in-out infinite;
}

.oracle-dialog-overlay.info .oracle-dialog-left::after {
    border-color: rgba(6, 182, 212, 0.4);
}

@keyframes iconPulseCyan {
    0%, 100% { 
        filter: drop-shadow(0 0 20px rgba(6, 182, 212, 0.8))
                drop-shadow(0 0 40px rgba(6, 182, 212, 0.4))
                drop-shadow(0 0 60px rgba(6, 182, 212, 0.2));
    }
    50% { 
        filter: drop-shadow(0 0 30px rgba(6, 182, 212, 1))
                drop-shadow(0 0 60px rgba(6, 182, 212, 0.6))
                drop-shadow(0 0 90px rgba(6, 182, 212, 0.3));
    }
}

.oracle-dialog-left {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.oracle-cat-icon {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.8))
            drop-shadow(0 0 40px rgba(139, 92, 246, 0.4))
            drop-shadow(0 0 60px rgba(139, 92, 246, 0.2));
    animation: iconPulse 3s ease-in-out infinite;
    transition: transform 0.3s ease, filter 0.3s ease;
    position: relative;
}

/* Holographic ring around icon */
.oracle-dialog-left::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    border: 2px solid rgba(139, 92, 246, 0.4);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulseRing 2s ease-out infinite;
}

@keyframes iconPulse {
    0%, 100% { 
        filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.8))
                drop-shadow(0 0 40px rgba(139, 92, 246, 0.4))
                drop-shadow(0 0 60px rgba(139, 92, 246, 0.2));
    }
    50% { 
        filter: drop-shadow(0 0 30px rgba(139, 92, 246, 1))
                drop-shadow(0 0 60px rgba(139, 92, 246, 0.6))
                drop-shadow(0 0 90px rgba(139, 92, 246, 0.3));
    }
}

@keyframes pulseRing {
    0% {
        transform: translate(-50%, -50%) scale(0.796);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0;
    }
}

.oracle-cat-icon.bounce {
    animation: oracleBounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), iconPulse 3s ease-in-out infinite;
}

.oracle-dialog-right {
    flex: 1;
    position: relative;
    z-index: 2;
}

.oracle-dialog-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 
        0 2px 12px rgba(0, 0, 0, 0.8),
        0 0 30px rgba(139, 92, 246, 0.6),
        0 0 60px rgba(139, 92, 246, 0.3);
    line-height: 1.5;
    letter-spacing: 0.3px;
    position: relative;
    animation: textGlow 4s ease-in-out infinite alternate;
}

/* Sci-fi corner brackets */
.oracle-dialog-right::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: 
        linear-gradient(90deg, rgba(139, 92, 246, 0.6) 2px, transparent 2px) 0 0,
        linear-gradient(0deg, rgba(139, 92, 246, 0.6) 2px, transparent 2px) 0 0,
        linear-gradient(90deg, rgba(139, 92, 246, 0.6) 2px, transparent 2px) 100% 0,
        linear-gradient(0deg, rgba(139, 92, 246, 0.6) 2px, transparent 2px) 100% 0,
        linear-gradient(90deg, rgba(139, 92, 246, 0.6) 2px, transparent 2px) 0 100%,
        linear-gradient(0deg, rgba(139, 92, 246, 0.6) 2px, transparent 2px) 0 100%,
        linear-gradient(90deg, rgba(139, 92, 246, 0.6) 2px, transparent 2px) 100% 100%,
        linear-gradient(0deg, rgba(139, 92, 246, 0.6) 2px, transparent 2px) 100% 100%;
    background-size: 12px 12px;
    background-repeat: no-repeat;
    opacity: 0.5;
    pointer-events: none;
}

@keyframes textGlow {
    0% { 
        text-shadow: 
            0 2px 12px rgba(0, 0, 0, 0.8),
            0 0 30px rgba(139, 92, 246, 0.6),
            0 0 60px rgba(139, 92, 246, 0.3);
    }
    100% { 
        text-shadow: 
            0 2px 12px rgba(0, 0, 0, 0.8),
            0 0 40px rgba(139, 92, 246, 0.8),
            0 0 80px rgba(139, 92, 246, 0.5);
    }
}

@keyframes oracleBounce {
    0% { transform: translateY(0) scale(1) rotate(0deg); }
    15% { transform: translateY(-12px) scale(1.15) rotate(-3deg); }
    30% { transform: translateY(0) scale(0.95) rotate(3deg); }
    45% { transform: translateY(-6px) scale(1.08) rotate(-2deg); }
    60% { transform: translateY(0) scale(0.98) rotate(2deg); }
    75% { transform: translateY(-3px) scale(1.03) rotate(-1deg); }
    100% { transform: translateY(0) scale(1) rotate(0deg); }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .oracle-dialog-overlay {
        bottom: 60px;
    }
    
    .oracle-dialog-content {
        min-width: 320px;
        max-width: 90vw;
        padding: var(--spacing-sm) var(--spacing-md);
        gap: var(--spacing-md);
    }
    
    .oracle-cat-icon {
        width: 60px;
        height: 60px;
    }
    
    .oracle-dialog-text {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .oracle-dialog-content {
        min-width: 280px;
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-sm);
    }
    
    .oracle-cat-icon {
        width: 50px;
        height: 50px;
    }
    
    .oracle-dialog-text {
        font-size: 0.9rem;
    }
}

/* ============================================
   Game Notification (Custom Alert)
   ============================================ */

.game-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.95), rgba(6, 182, 212, 0.95));
    color: var(--text-primary);
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--border-radius);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(139, 92, 246, 0.6);
    z-index: 10001;
    min-width: 300px;
    max-width: 500px;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.game-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.game-notification.success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.95), rgba(16, 185, 129, 0.95));
}

.game-notification.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(220, 38, 38, 0.95));
}

@keyframes notificationSlideIn {
    from {
        transform: translateX(-50%) translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* ============================================
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Adjust power-up HUD visual scale (increased by 30% from reduced state) */
.power-up-hud {
    transform: scale(calc(0.796 * var(--hud-scale)));
    transform-origin: top left;
    gap: 8px; /* reduce spacing slightly */
}

/* Responsive HUD scale presets */
@media (max-width: 1400px) {
    :root { --hud-scale: 0.95; }
}
@media (max-width: 1024px) {
    :root { --hud-scale: 0.9; }
}
@media (max-width: 768px) {
    :root { --hud-scale: 0.82; }
}
@media (max-width: 480px) {
    :root { --hud-scale: 0.75; }
}

/* ------------------------------
   Main menu background when visible
   Uses a local banner image and keeps modal content opaque
   ------------------------------ */
#startScreen:not(.hidden),
#pauseMenu:not(.hidden),
#settingsMenu:not(.hidden),
#creatorModal:not(.hidden),
#creatorContactModal:not(.hidden) {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000; /* above HUD */
    background-color: rgba(10,14,39,0.6); /* fallback overlay */
    background-image: url("../assets/images/mainMenuBackgrounds/Oracle Cat Shooter banner NO TITLE.png");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover; /* crop to fill */
    background-attachment: fixed;
}

/* Ensure modal content is opaque (do not show background through it) */
.modal-content {
    background: var(--bg-secondary);
    border: 2px solid var(--accent-purple);
    border-radius: var(--border-radius);
    box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 6px 30px rgba(139,92,246,0.08);
    color: var(--text-primary);
    backdrop-filter: none; /* avoid translucency */
    -webkit-backdrop-filter: none;
    position: relative;
    z-index: 12; /* ensure modal content sits above bg layers */
}

/* Performance / size notes: use cover and a fixed attachment to avoid extra layout work.
   For best optimization, create a lower-resolution variant of the banner for mobile. */

@media (max-width: 1024px) {
    #startScreen:not(.hidden), #pauseMenu:not(.hidden), #settingsMenu:not(.hidden) {
        background-size: cover;
        background-position: center center;
    }
}

/* Transition + glitch effect used by the background rotator */
#startScreen:not(.hidden), #pauseMenu:not(.hidden), #settingsMenu:not(.hidden),
#creatorModal:not(.hidden), #creatorContactModal:not(.hidden) {
    transition: opacity 360ms ease-in-out, filter 360ms ease-in-out;
}

.menu-bg-glitch {
    animation: menu-glitch 420ms linear 1;
}

@keyframes menu-glitch {
    0% { transform: translateX(0) skewX(0) scale(1); filter: none; }
    20% { transform: translateX(-6px) skewX(-2deg) scale(1.01); filter: saturate(1.05) hue-rotate(-6deg); }
    40% { transform: translateX(6px) skewX(2deg) scale(0.995); filter: saturate(1.1) hue-rotate(6deg); }
    60% { transform: translateX(-4px) skewX(-1deg) scale(1.002); filter: contrast(1.05) brightness(0.98); }
    80% { transform: translateX(4px) skewX(1deg) scale(0.998); filter: contrast(0.98) brightness(1.02); }
    100% { transform: translateX(0) skewX(0) scale(1); filter: none; }
}

/* small scanline overlay for vibe */
.menu-scanlines:after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 100% 4px;
    mix-blend-mode: overlay;
    z-index: 1999;
}

/* Background layers used for crossfade */
.menu-bg-layer {
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    pointer-events: none;
    transition: opacity 1s ease-in-out;
    will-change: opacity, background-image;
    z-index: 0; /* behind modal content */
}

/* Modern crossfade enhancements: blur, clip reveal, subtle chroma, particles */
.menu-bg-layer {
    transform-origin: center center;
    filter: blur(0px) saturate(1);
}

.bg-clip-hidden {
    clip-path: inset(0 100% 0 0); /* hidden from left-to-right */
}
.bg-clip-revealing {
    transition: clip-path 1000ms cubic-bezier(.2,.9,.2,1);
    clip-path: inset(0 0 0 0);
}

.bg-blur-incoming {
    filter: blur(6px) saturate(1.05) contrast(1.02) hue-rotate(3deg);
    transition: filter 900ms ease-in-out;
}
.bg-blur-outgoing {
    filter: blur(4px) saturate(0.98) contrast(0.98) hue-rotate(-2deg);
    transition: filter 900ms ease-in-out, opacity 900ms ease-in-out;
}

.bg-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}
.bg-particles .p {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.65);
    opacity: 0;
    transform: translate3d(0,0,0) scale(0.6);
    animation: particle-burst 900ms cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes particle-burst {
    0% { opacity: 0; transform: translateY(0) scale(0.6); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-40px) translateX(20px) scale(1.2); }
}

/* Apply SVG chromatic aberration filter during transitions */
.bg-chroma-active {
    /* prefer SVG filter for subtle RGB offsets */
    filter: url(#chroma);
}

/* ═══════════════════════════════════════════════════════════════════════════
   PLAYER XP / RANK WIDGET
   Used in: HUD top-left · Start Screen · Pilot Dossier
   ═══════════════════════════════════════════════════════════════════════════ */
@keyframes xpBarShimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}
@keyframes xpGlowPulse {
    0%, 100% { opacity: 0.7; }
    50%       { opacity: 1;   }
}

/* ── Shared widget shell ─────────────────────────────────────────────── */
.xp-widget {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    min-width: 160px;
    max-width: 260px;
}

/* Top row: level badge + rank label */
.xp-top-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.xp-level-badge {
    background: rgba(0,212,255,0.12);
    border: 1px solid rgba(0,212,255,0.35);
    border-radius: 4px;
    padding: 0 6px;
    height: 20px;
    line-height: 20px;
    font-size: 0.65rem;
    font-weight: 800;
    color: #00d4ff;
    letter-spacing: 0.08em;
    white-space: nowrap;
    text-shadow: 0 0 6px rgba(0,212,255,0.6);
    flex-shrink: 0;
}

.xp-rank-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #e2e8f0;
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 0 6px rgba(255,255,255,0.15);
}

/* Bar wrapper */
.xp-bar-wrap {
    position: relative;
    width: 100%;
    height: 5px;
    background: rgba(255,255,255,0.07);
    border-radius: 3px;
    overflow: hidden;
    transition: box-shadow 0.4s ease;
}

/* Filled portion */
.xp-bar-fill {
    height: 100%;
    border-radius: 3px;
    min-width: 3px;
    transition: width 0.6s cubic-bezier(.4,0,.2,1), background 0.5s ease;
    position: relative;
    overflow: hidden;
}
/* Shimmer sweep on the bar fill */
.xp-bar-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        transparent 25%,
        rgba(255,255,255,0.28) 50%,
        transparent 75%);
    background-size: 200% 100%;
    animation: xpBarShimmer 2.4s linear infinite;
}

/* Progress tooltip */
.xp-progress-tip {
    font-size: 0.58rem;
    color: rgba(148,163,184,0.7);
    letter-spacing: 0.04em;
    text-align: right;
    margin-top: 1px;
}

/* ── HUD variant (compact, inside pilot card) ────────────────────────── */
#hudXpWidget {
    max-width: 200px;
    margin-top: 4px;
}
#hudXpWidget .xp-level-badge { height: 17px; line-height: 17px; font-size: 0.6rem; }
#hudXpWidget .xp-rank-label  { font-size: 0.6rem; }
#hudXpWidget .xp-bar-wrap     { height: 4px; }

/* ── Start screen variant (under pilot name) ─────────────────────────── */
#menuXpWidget {
    min-width: 230px;
    max-width: none;
    width: 100%;
    margin: 8px 0 0;
}
#menuXpWidget .xp-level-badge { font-size: 0.7rem; height: 22px; line-height: 22px; }
#menuXpWidget .xp-rank-label  { font-size: 0.7rem; }
#menuXpWidget .xp-bar-wrap    { height: 8px; }

/* ── Dossier rank block ──────────────────────────────────────────────── */
.pd-rank-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 12px 16px;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(0,212,255,0.18);
    border-radius: 10px;
    margin-bottom: 12px;
    width: 100%;
    box-sizing: border-box;
}
.pd-rank-header {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}
.pd-rank-icon {
    font-size: 2rem;
    line-height: 1;
    filter: drop-shadow(0 0 8px currentColor);
}
.pd-rank-info {
    flex: 1;
}
.pd-rank-name {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin: 0 0 2px;
}
.pd-rank-tier-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.7;
}
.pd-rank-level-line {
    font-size: 0.78rem;
    color: #94a3b8;
    letter-spacing: 0.04em;
    font-weight: 600;
}
.pd-rank-stars {
    font-size: 1.2rem;
    letter-spacing: 2px;
    color: #fbbf24;
    text-shadow: 0 0 8px rgba(251,191,36,0.5);
}
.pd-xp-bar-outer {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.07);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
.pd-xp-bar-inner {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(.4,0,.2,1);
    position: relative;
    overflow: hidden;
}
.pd-xp-bar-inner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        transparent 25%,
        rgba(255,255,255,0.3) 50%,
        transparent 75%);
    background-size: 200% 100%;
    animation: xpBarShimmer 2s linear infinite;
}
.pd-xp-numbers {
    font-size: 0.68rem;
    color: rgba(148,163,184,0.8);
    display: flex;
    justify-content: space-between;
    width: 100%;
    letter-spacing: 0.04em;
}

/* =================================================================
   ◈ UNIFIED SCI-FI IN-GAME UI SKIN
   Consistent transparent glass panels for all in-game HUD elements.
   Design tokens:
     bg      : rgba(4, 8, 22, 0.70)
     border  : rgba(0, 212, 255, 0.18)
     glow    : 0 0 10px rgba(0, 212, 255, 0.10)
     radius  : 8px
================================================================= */

/* ─ Shared glass panel mixin ───────────────────────────────── */
.sf-panel {
    background: rgba(4, 8, 22, 0.70) !important;
    border: 1px solid rgba(0, 212, 255, 0.18) !important;
    border-radius: 8px !important;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.10), inset 0 1px 0 rgba(255,255,255,0.03) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
}

/* ─ Top-right stat boxes (Wave / Enemies / Score) ──────────── */
.stat-display {
    background: rgba(4, 8, 22, 0.70) !important;
    border: 1px solid rgba(0, 212, 255, 0.16) !important;
    border-radius: 7px !important;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.08), inset 0 1px 0 rgba(255,255,255,0.03) !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
}

/* ─ Resource display container ────────────────────────── */
.resource-display, #resourceDisplay {
    background: rgba(4, 8, 22, 0.70) !important;
    border: 1px solid rgba(0, 212, 255, 0.16) !important;
    border-radius: 8px !important;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.08), inset 0 1px 0 rgba(255,255,255,0.03) !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
}

/* ─ Bottom-center health / shield container ─────────────── */
.hud-bottom-center .player-info {
    background: rgba(4, 8, 22, 0.72) !important;
    border: 1px solid rgba(0, 212, 255, 0.18) !important;
    border-radius: 9px !important;
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.10), inset 0 1px 0 rgba(255,255,255,0.03) !important;
    backdrop-filter: blur(7px) !important;
    -webkit-backdrop-filter: blur(7px) !important;
    padding: 6px 10px !important;
}
.hud-bottom-center .health-bar {
    border: 1px solid rgba(255,255,255,0.10) !important;
    background: rgba(255,255,255,0.05) !important;
    border-radius: 5px !important;
}

/* ─ Top-left pilot info panel ──────────────────────────── */
.hud-top .player-info {
    background: rgba(4, 8, 22, 0.68) !important;
    border: 1px solid rgba(124, 58, 237, 0.20) !important;
    border-radius: 10px !important;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.10), inset 0 1px 0 rgba(255,255,255,0.025) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
}

/* ─ Wave start notification — transparent glass, not solid ─── */
.wave-notification-content {
    background: rgba(4, 8, 22, 0.82) !important;
    border: 1px solid rgba(0, 212, 255, 0.30) !important;
    border-radius: 12px !important;
    box-shadow:
        0 0 28px rgba(0, 212, 255, 0.18),
        0 0 60px rgba(124, 58, 237, 0.12),
        inset 0 1px 0 rgba(255,255,255,0.05) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    padding: 1.1rem 2.5rem !important;
}
.wave-number-big {
    font-size: 2.4rem !important;
    color: #00d4ff !important;
    text-shadow: 0 0 18px rgba(0, 212, 255, 0.7), 0 0 40px rgba(0, 212, 255, 0.3) !important;
    letter-spacing: 0.08em !important;
}
.wave-subtitle {
    font-size: 1.1rem !important;
    color: rgba(251,191,36,0.90) !important;
    text-shadow: 0 0 10px rgba(251,191,36,0.45) !important;
    letter-spacing: 0.15em !important;
    text-transform: uppercase !important;
    font-weight: 700 !important;
}

/* ─ In-game toast notifications ────────────────────────── */
.game-notification {
    background: rgba(4, 8, 22, 0.88) !important;
    border: 1px solid rgba(0, 212, 255, 0.28) !important;
    border-radius: 9px !important;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.14), inset 0 1px 0 rgba(255,255,255,0.04) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    color: #e2e8f0 !important;
}
.game-notification.success {
    background: rgba(4, 18, 12, 0.88) !important;
    border-color: rgba(34, 197, 94, 0.35) !important;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.14), inset 0 1px 0 rgba(255,255,255,0.04) !important;
}
.game-notification.error {
    background: rgba(22, 4, 4, 0.88) !important;
    border-color: rgba(239, 68, 68, 0.35) !important;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.14), inset 0 1px 0 rgba(255,255,255,0.04) !important;
}

/* ─ FPS counter ──────────────────────────────────────── */
.fps-display {
    background: rgba(4, 8, 22, 0.65) !important;
    border: 1px solid rgba(0, 212, 255, 0.14) !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    padding: 3px 9px !important;
    font-size: 0.72rem !important;
    letter-spacing: 0.08em !important;
    opacity: 0.7;
    transition: opacity .2s;
}
.fps-display:hover { opacity: 1; }
.fps-display #fpsCounter { font-size: 0.88rem !important; }

/* ─ Debug info panel ───────────────────────────────── */
.debug-info {
    background: rgba(4, 8, 22, 0.75) !important;
    border: 1px solid rgba(0, 212, 255, 0.14) !important;
    border-radius: 6px !important;
    color: rgba(0, 212, 255, 0.75) !important;
    font-size: 0.68rem !important;
    padding: 6px 10px !important;
}

/* ─ Oracle cat speech dialog ─────────────────────────── */
.oracle-dialog-content {
    background: rgba(4, 8, 28, 0.86) !important;
    border: 1px solid rgba(124, 58, 237, 0.28) !important;
    border-radius: 12px !important;
    box-shadow:
        0 0 24px rgba(124, 58, 237, 0.16),
        inset 0 1px 0 rgba(255,255,255,0.04) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
}

/* ─ Game-over modal ────────────────────────────────── */
.game-over-modal {
    background: rgba(4, 8, 22, 0.94) !important;
    border: 1px solid rgba(239, 68, 68, 0.30) !important;
    border-radius: 14px !important;
    box-shadow:
        0 0 40px rgba(239, 68, 68, 0.14),
        0 0 80px rgba(124, 58, 237, 0.08),
        inset 0 1px 0 rgba(255,255,255,0.04) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
}

/* =================================================================
   ◈ SCI-FI HUD TYPOGRAPHY & COLOUR-CODED DATA  ─  SF3 Layer
   ─────────────────────────────────────────────────────────────────
   Pure CSS overrides – zero JS, zero animation on live-game nodes.
   Design language:
     • Monospace  font for every numeric data value
     • Uppercase, letter-spaced labels (like log field headers)
     • Per-datatype colour tokens:
         Wave     → #00d4ff  (cyan)
         Enemies  → #fb923c  (orange)
         Score    → #fbbf24  (gold)
         Credits  → #fbbf24  (gold)
         Stardust → #fde68a  (soft yellow)
         Crystal  → #c084fc  (purple)
         Core     → #67e8f9  (light cyan)
     • Panel corner-bracket decoration (pure CSS, no DOM nodes)
     • Performance: no backdrop-filter on moving elements,
       no continuous @keyframes on HUD data containers
================================================================= */

/* ── SF3 design tokens ────────────────────────────────────────── */
:root {
    --sf3-mono:          'Courier New', 'Share Tech Mono', monospace;
    --sf3-label-color:   rgba(148, 163, 184, 0.62);
    --sf3-label-size:    0.62rem;
    --sf3-label-spacing: 0.13em;

    --sf3-wave-color:     #00d4ff;
    --sf3-enemies-color:  #fb923c;
    --sf3-score-color:    #fbbf24;
    --sf3-credits-color:  #fbbf24;
    --sf3-stardust-color: #fde68a;
    --sf3-crystal-color:  #c084fc;
    --sf3-core-color:     #67e8f9;

    --sf3-bracket-color:  rgba(0, 212, 255, 0.30);
}

/* ═══════════════════════════════════════════════════════
   STAT BOXES  (Wave / Enemies / Score) — top-right
   ═══════════════════════════════════════════════════════ */

/* Label row — terminal field header style */
.hud-top .hud-right .stat-display .stat-label {
    font-family:     var(--sf3-mono) !important;
    font-size:       var(--sf3-label-size) !important;
    font-weight:     600 !important;
    color:           var(--sf3-label-color) !important;
    text-transform:  uppercase !important;
    letter-spacing:  var(--sf3-label-spacing) !important;
    margin-right:    0 !important;
}

/* Value row — big, bright, monospace */
.hud-top .hud-right .stat-display .stat-value {
    font-family:  var(--sf3-mono) !important;
    font-size:    1.18rem !important;
    font-weight:  700 !important;
    line-height:  1 !important;
    text-align:   center !important;
}

/* Per-box colour differentiation via nth-child on the wrapper column */
/* Boxes rendered: Wave (1st), Enemies (2nd), Score (3rd) */
.hud-top .hud-right .stat-display:nth-child(1) .stat-value,
.hud-top .hud-right .stat-display:first-of-type .stat-value {
    color: var(--sf3-wave-color) !important;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.45) !important;
}
.hud-top .hud-right .stat-display:nth-child(2) .stat-value {
    color: var(--sf3-enemies-color) !important;
    text-shadow: 0 0 8px rgba(251, 146, 60, 0.45) !important;
}
.hud-top .hud-right .stat-display:nth-child(3) .stat-value {
    color: var(--sf3-score-color) !important;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.45) !important;
}

/* ═══════════════════════════════════════════════════════
   RESOURCE DISPLAY  (Credits / Stardust / Crystal / Core)
   ═══════════════════════════════════════════════════════ */

/* All resource labels → monospace, uppercase, dimmed */
.resource-display .resource-label,
#resourceDisplay .resource-label {
    font-family:     var(--sf3-mono) !important;
    font-size:       var(--sf3-label-size) !important;
    font-weight:     600 !important;
    color:           var(--sf3-label-color) !important;
    text-transform:  uppercase !important;
    letter-spacing:  var(--sf3-label-spacing) !important;
    max-width: none !important;
}

/* All resource values → monospace, bright */
.resource-display .resource-value,
#resourceDisplay .resource-value {
    font-family: var(--sf3-mono) !important;
    font-size:   0.95rem !important;
    font-weight: 700 !important;
}

/* Per-resource colour by sibling index (icon + label + value = 3 children per .resource-item) */
/* Credits  → 1st row */
.resource-display .resource-item:nth-child(1) .resource-value,
#resourceDisplay .resource-item:nth-child(1) .resource-value {
    color: var(--sf3-credits-color) !important;
    text-shadow: 0 0 6px rgba(251,191,36,0.40) !important;
}
/* Stardust → 2nd row */
.resource-display .resource-item:nth-child(2) .resource-value,
#resourceDisplay .resource-item:nth-child(2) .resource-value {
    color: var(--sf3-stardust-color) !important;
    text-shadow: 0 0 6px rgba(253,230,138,0.35) !important;
}
/* Crystal  → 3rd row */
.resource-display .resource-item:nth-child(3) .resource-value,
#resourceDisplay .resource-item:nth-child(3) .resource-value {
    color: var(--sf3-crystal-color) !important;
    text-shadow: 0 0 6px rgba(192,132,252,0.40) !important;
}
/* Core     → 4th row */
.resource-display .resource-item:nth-child(4) .resource-value,
#resourceDisplay .resource-item:nth-child(4) .resource-value {
    color: var(--sf3-core-color) !important;
    text-shadow: 0 0 6px rgba(103,232,249,0.40) !important;
}

/* ═══════════════════════════════════════════════════════
   PILOT CARD  (top-left player-info)
   ═══════════════════════════════════════════════════════ */

/* Nickname — primary identity, bright cyan */
.hud-top .player-info .nickname {
    font-family:    var(--sf3-mono) !important;
    font-size:      0.88rem !important;
    font-weight:    800 !important;
    color:          #00d4ff !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    text-shadow:    0 0 10px rgba(0, 212, 255, 0.50) !important;
}

/* Ship-name hint line */
#hudShipName {
    font-family:    var(--sf3-mono) !important;
    font-size:      0.62rem !important;
    font-weight:    600 !important;
    color:          #67e8f9 !important;
    letter-spacing: 0.10em !important;
    text-transform: uppercase !important;
    opacity:        0.88 !important;
    display:        block !important;
    margin-top:     1px !important;
}

/* Pilot Dossier link hint */
.pilot-card-btn .pilot-card-hint:last-child {
    font-family:    var(--sf3-mono) !important;
    font-size:      0.58rem !important;
    color:          rgba(148, 163, 184, 0.50) !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
}

/* Corner-bracket decoration on the pilot panel (no extra DOM) */
.hud-top .player-info {
    position: relative !important;
}
.hud-top .player-info::before,
.hud-top .player-info::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    pointer-events: none;
    opacity: 0.55;
}
/* top-left bracket */
.hud-top .player-info::before {
    top: 3px; left: 3px;
    border-top:  1.5px solid var(--sf3-bracket-color);
    border-left: 1.5px solid var(--sf3-bracket-color);
}
/* bottom-right bracket */
.hud-top .player-info::after {
    bottom: 3px; right: 3px;
    border-bottom: 1.5px solid var(--sf3-bracket-color);
    border-right:  1.5px solid var(--sf3-bracket-color);
}

/* ═══════════════════════════════════════════════════════
   WEAPONS DISPLAY  (Primary / Secondary under pilot card)
   ═══════════════════════════════════════════════════════ */

/* Weapon slot labels  → terminal-field style */
.hud-top .player-info .compact-adv-weapons .stat-label {
    font-family:    var(--sf3-mono) !important;
    font-size:      var(--sf3-label-size) !important;
    font-weight:    600 !important;
    color:          var(--sf3-label-color) !important;
    text-transform: uppercase !important;
    letter-spacing: var(--sf3-label-spacing) !important;
    margin: 0 !important;
}

/* Weapon name values → readable white */
.hud-top .player-info .compact-adv-weapons .stat-value {
    font-family: var(--sf3-mono) !important;
    font-size:   0.76rem !important;
    font-weight: 700 !important;
    color:       rgba(226, 232, 240, 0.95) !important;
}

/* ═══════════════════════════════════════════════════════
   POWER-UP ITEMS
   ═══════════════════════════════════════════════════════ */

/* Override INLINE borderColor set by power-up-hud.js */
.power-up-hud .power-up-item {
    border-color: rgba(0, 212, 255, 0.18) !important;
    background:   rgba(4, 8, 22, 0.60) !important;
    border-radius: 7px !important;
}

/* Power-up name tag */
.power-up-hud .power-up-name {
    font-family:    var(--sf3-mono) !important;
    font-size:      0.62rem !important;
    font-weight:    700 !important;
    color:          rgba(226, 232, 240, 0.92) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
}

/* Stack count  */
.power-up-hud .power-up-stacks,
.power-up-hud .power-up-stack-text {
    font-family: var(--sf3-mono) !important;
    font-weight: 800 !important;
    color:       #00d4ff !important;
    text-shadow: 0 0 6px rgba(0,212,255,0.50) !important;
}

/* Stack-bar fill → cyan tint */
.power-up-hud .power-up-stack-fill {
    background: linear-gradient(90deg, rgba(0,212,255,0.65), rgba(0,212,255,0.35)) !important;
}

/* Power-up section header (if rendered by JS) */
.power-up-hud-title,
.power-up-section-title {
    font-family:    var(--sf3-mono) !important;
    font-size:      0.58rem !important;
    font-weight:    700 !important;
    color:          var(--sf3-label-color) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.16em !important;
}

/* ═══════════════════════════════════════════════════════
   DAILY MISSIONS PANEL  — override injected <style>
   #dailyMissionsHUD injects its own <style id="dm-styles">
   These rules are placed AFTER via specificity + !important.
   ═══════════════════════════════════════════════════════ */

/* Panel outer shell */
#dailyMissionsHUD {
    background: rgba(4, 8, 22, 0.78) !important;
    border:     1px solid rgba(0, 212, 255, 0.16) !important;
    border-radius: 9px !important;
    box-shadow: 0 0 12px rgba(0,212,255,0.08), inset 0 1px 0 rgba(255,255,255,0.025) !important;
}

/* Header bar */
#dailyMissionsHUD .dm-header {
    background: rgba(0, 10, 28, 0.50) !important;
    border-bottom: 1px solid rgba(0,212,255,0.12) !important;
    padding: 5px 10px !important;
}

/* Title text */
#dailyMissionsHUD .dm-title {
    font-family:    var(--sf3-mono) !important;
    font-size:      0.66rem !important;
    font-weight:    800 !important;
    color:          #00d4ff !important;
    text-transform: uppercase !important;
    letter-spacing: 0.16em !important;
    text-shadow:    0 0 8px rgba(0,212,255,0.45) !important;
}

/* Badge (mission count) */
#dailyMissionsHUD .dm-badge {
    font-family:  var(--sf3-mono) !important;
    font-size:    0.62rem !important;
    font-weight:  700 !important;
    background:   rgba(0,212,255,0.14) !important;
    border:       1px solid rgba(0,212,255,0.28) !important;
    color:        #00d4ff !important;
    border-radius: 4px !important;
    padding:      1px 5px !important;
}

/* Each mission row */
#dailyMissionsHUD .dm-row {
    border-bottom: 1px solid rgba(0,212,255,0.06) !important;
    padding: 4px 8px !important;
    background: transparent !important;
}
#dailyMissionsHUD .dm-row:last-child {
    border-bottom: none !important;
}

/* Mission description text */
#dailyMissionsHUD .dm-desc {
    font-family:  var(--sf3-mono) !important;
    font-size:    0.64rem !important;
    font-weight:  600 !important;
    color:        rgba(226, 232, 240, 0.82) !important;
    letter-spacing: 0.03em !important;
}

/* Reward chip */
#dailyMissionsHUD .dm-reward {
    font-family:  var(--sf3-mono) !important;
    font-size:    0.60rem !important;
    font-weight:  700 !important;
    color:        var(--sf3-score-color) !important;
    background:   rgba(251,191,36,0.10) !important;
    border:       1px solid rgba(251,191,36,0.22) !important;
    border-radius: 3px !important;
    padding:      1px 4px !important;
    text-shadow:  0 0 6px rgba(251,191,36,0.35) !important;
}

/* Progress bar track */
#dailyMissionsHUD .dm-bar {
    background:   rgba(255,255,255,0.06) !important;
    border-radius: 3px !important;
    height:        4px !important;
}

/* Progress bar fill */
#dailyMissionsHUD .dm-fill {
    background: linear-gradient(90deg, #00d4ff, rgba(0,212,255,0.50)) !important;
    border-radius: 3px !important;
    height: 100% !important;
}

/* Progress fraction text */
#dailyMissionsHUD .dm-prog {
    font-family: var(--sf3-mono) !important;
    font-size:   0.58rem !important;
    color:       var(--sf3-label-color) !important;
    letter-spacing: 0.06em !important;
}

/* Completion checkmark */
#dailyMissionsHUD .dm-check {
    color:       #00d4ff !important;
    font-size:   0.80rem !important;
    text-shadow: 0 0 8px rgba(0,212,255,0.60) !important;
}

/* ═══════════════════════════════════════════════════════
   BOTTOM-CENTER HEALTH/SHIELD BARS — stat text
   ═══════════════════════════════════════════════════════ */

/* HP / Shield text inside bars */
.hud-bottom-center .stat-text {
    font-family: var(--sf3-mono) !important;
    font-size:   0.72rem !important;
    font-weight: 700 !important;
    color:       rgba(255,255,255,0.96) !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.80) !important;
    background:  transparent !important;
    box-shadow:  none !important;
    padding:     0 !important;
    letter-spacing: 0.04em !important;
}

/* Health bar icon label */
.hud-bottom-center .health-text {
    font-family:    var(--sf3-mono) !important;
    font-size:      0.62rem !important;
    font-weight:    700 !important;
    color:          var(--sf3-label-color) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.10em !important;
}

/* ═══════════════════════════════════════════════════════
   FPS DISPLAY  — tiny terminal chip
   ═══════════════════════════════════════════════════════ */

.fps-display {
    font-family:    var(--sf3-mono) !important;
    font-size:      0.60rem !important;
    letter-spacing: 0.14em !important;
    text-transform: uppercase !important;
    padding:        2px 8px !important;
}

/* FPS label prefix (if rendered as "FPS") */
.fps-display::before {
    content:       'FPS ';
    color:         var(--sf3-label-color);
    font-size:     0.58rem;
    letter-spacing: 0.16em;
}

.fps-display #fpsCounter {
    font-family: var(--sf3-mono) !important;
    font-size:   0.84rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.04em !important;
}

/* ═══════════════════════════════════════════════════════
   CENTER INSTRUCTIONS — sci-fi title treatment
   ═══════════════════════════════════════════════════════ */

.center-instructions h2 {
    font-family:    var(--sf3-mono) !important;
    font-size:      2.2rem !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
}

.center-instructions .subtitle {
    font-family:    var(--sf3-mono) !important;
    font-size:      1.0rem !important;
    color:          var(--sf3-label-color) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.14em !important;
}

/* ═══════════════════════════════════════════════════════
   WAVE NOTIFICATION — monospace type upgrade
   ═══════════════════════════════════════════════════════ */

.wave-number-big {
    font-family:    var(--sf3-mono) !important;
    text-transform: uppercase !important;
}

.wave-subtitle {
    font-family: var(--sf3-mono) !important;
}

/* ═══════════════════════════════════════════════════════
   CORNER BRACKETS — resource display
   ═══════════════════════════════════════════════════════ */

.resource-display,
#resourceDisplay {
    position: relative !important;
}
.resource-display::before,
#resourceDisplay::before {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 8px; height: 8px;
    border-top:  1.5px solid var(--sf3-bracket-color);
    border-left: 1.5px solid var(--sf3-bracket-color);
    pointer-events: none;
    opacity: 0.65;
}
.resource-display::after,
#resourceDisplay::after {
    content: '';
    position: absolute;
    bottom: 3px; right: 3px;
    width: 8px; height: 8px;
    border-bottom: 1.5px solid var(--sf3-bracket-color);
    border-right:  1.5px solid var(--sf3-bracket-color);
    pointer-events: none;
    opacity: 0.65;
}

/* ═══════════════════════════════════════════════════════
   BUG FIXES  SF3-B  — layout & sizing corrections
   ═══════════════════════════════════════════════════════ */

/* ── BUG 1: Power-up HUD overlaps the top-left pilot panel ───
   SF3-C grew the pilot card to ~260 px. Push HUD well below.
   top = hud-top-padding(16) + panel-height(~260) + gap(16).    */
#powerUpHUD,
.power-up-hud {
    top: 340px !important;
    left: 14px !important;
}

/* ── BUG 2: Wave / Enemies / Score — increase 70% ────────────
   Stat boxes: cancel the 0.9× scale shrink, wider box,
   larger value font, slightly larger label for readability.     */
.hud-top .hud-right .stat-display {
    transform: scale(calc(1.0 * var(--hud-scale))) !important; /* was 0.9× */
    width:     112px !important;
    min-width: 112px !important;
    padding:   0.28rem 0.20rem !important;
}

.hud-top .hud-right .stat-display .stat-label {
    font-size: 0.72rem !important;   /* was 0.62rem */
}

.hud-top .hud-right .stat-display .stat-value {
    font-size: 2.00rem !important;   /* was 1.18rem — ≈ 70 % bigger */
}

/* ── BUG 3: Resource display — tight fit, no wasted space ────
   All sizes ×2 from the original compact values.               */
.resource-display,
#resourceDisplay {
    padding:    0.36rem 0.60rem !important;
    gap:        0.28rem !important;
    min-width:  0 !important;       /* let content dictate width */
}

.resource-display .resource-item,
#resourceDisplay .resource-item {
    gap:     0.32rem !important;
    padding: 0 !important;
}

.resource-display .resource-icon,
#resourceDisplay .resource-icon {
    font-size: 1.64rem !important;
    min-width: 26px !important;
}

.resource-display .resource-label,
#resourceDisplay .resource-label {
    font-size:  1.20rem !important;
    max-width:  92px !important;
    margin-left: 4px !important;
}

.resource-display .resource-value,
#resourceDisplay .resource-value {
    font-size:   1.84rem !important;
    margin-left: 8px !important;
    min-width:   36px !important;
}

/* ── BUG 4: Daily Missions — bottom-left, flush to edge ──────
   The injected <style id="dm-styles"> sets bottom:110px.
   Override it here so the panel sits at the bottom-left corner,
   symmetrical with the health bar at the bottom-center.         */
#dailyMissionsHUD {
    bottom: 14px !important;
    left:   14px !important;
}

/* ─ end SF3-B fixes ──────────────────────────────────────────── */

/* =================================================================
   ◈ SF3-C  LEFT PANEL SCALE-UP  — ×1.5 across all left HUD nodes
   All sizes derived by multiplying existing SF3 values by 1.5.
   Position, layout, colours and proportions remain unchanged.
================================================================= */

/* Pilot emoji avatar */
.pilot-card-btn .pilot-card-avatar {
    font-size: 1.80rem !important;
}

/* Nickname */
.hud-top .player-info .nickname {
    font-size: 1.32rem !important;   /* 0.88 × 1.5 */
}

/* Ship-name hint */
#hudShipName {
    font-size: 0.93rem !important;   /* 0.62 × 1.5 */
    margin-top: 2px !important;
}

/* "Pilot Dossier ›" link hint */
.pilot-card-btn .pilot-card-hint:last-child {
    font-size: 0.87rem !important;   /* 0.58 × 1.5 */
}

/* XP level badge */
#hudXpWidget .xp-level-badge {
    font-size:   0.90rem !important; /* 0.60 × 1.5 */
    height:      26px !important;    /* 17px × 1.5 */
    line-height: 26px !important;
    padding:     0 9px !important;
}

/* XP rank label */
#hudXpWidget .xp-rank-label {
    font-size: 0.90rem !important;   /* 0.60 × 1.5 */
}

/* XP bar track */
#hudXpWidget .xp-bar-wrap {
    height: 6px !important;          /* 4px × 1.5 */
}

/* XP progress tip */
#hudXpWidget .xp-progress-tip {
    font-size: 0.87rem !important;   /* 0.58 × 1.5 */
}

/* Weapons label (Primary / Secondary) */
.hud-top .player-info .compact-adv-weapons .stat-label {
    font-size: 0.93rem !important;   /* 0.62 × 1.5 */
}

/* Weapons value (weapon name) */
.hud-top .player-info .compact-adv-weapons .stat-value {
    font-size: 1.14rem !important;   /* 0.76 × 1.5 */
}

/* ─ end SF3-C ─────────────────────────────────────────────────── */

/* =================================================================
   ◈ SF3-D  DAILY MISSIONS +15%  &  HEALTH/SHIELD SCI-FI BARS
================================================================= */

/* ── BUG 2: Daily Missions panel — all sizes ×1.15 ───────────
   Width: 240 → 276px; all font-sizes scaled ×1.15.           */
#dailyMissionsHUD {
    width: 276px !important;   /* 240 × 1.15 */
}

#dailyMissionsHUD .dm-title {
    font-size: 0.83rem !important;   /* 0.72 × 1.15 */
}

#dailyMissionsHUD .dm-badge {
    font-size: 0.75rem !important;   /* 0.65 × 1.15 */
}

#dailyMissionsHUD .dm-icon {
    font-size: 1.15rem !important;   /* 1.00 × 1.15 */
}

#dailyMissionsHUD .dm-desc {
    font-size: 0.76rem !important;   /* 0.66 × 1.15 */
}

#dailyMissionsHUD .dm-reward {
    font-size: 0.67rem !important;   /* 0.58 × 1.15 */
}

#dailyMissionsHUD .dm-prog {
    font-size: 0.74rem !important;   /* 0.64 × 1.15 */
    min-width: 37px !important;      /* 32 × 1.15 */
}

#dailyMissionsHUD .dm-check {
    font-size: 1.04rem !important;   /* 0.90 × 1.15 */
}

#dailyMissionsHUD .dm-bar {
    height: 4px !important;          /* 3 × 1.15 → 3.45 → 4px */
}

/* ── BUG 3: Health / Shield bars — full sci-fi redesign ───────
   Wider bars, taller tracks, corner brackets on the panel,
   monospace HP/SHIELD labels, colour-coded glow overlay.      */

/* Outer container — corner brackets decoration */
.hud-bottom-center .player-info {
    position: relative !important;
    padding: 10px 16px !important;
    gap: 8px !important;
}
.hud-bottom-center .player-info::before {
    content: '';
    position: absolute;
    top: 4px; left: 4px;
    width: 12px; height: 12px;
    border-top:  1.5px solid var(--sf3-bracket-color);
    border-left: 1.5px solid var(--sf3-bracket-color);
    pointer-events: none; opacity: 0.70;
}
.hud-bottom-center .player-info::after {
    content: '';
    position: absolute;
    bottom: 4px; right: 4px;
    width: 12px; height: 12px;
    border-bottom: 1.5px solid var(--sf3-bracket-color);
    border-right:  1.5px solid var(--sf3-bracket-color);
    pointer-events: none; opacity: 0.70;
}

/* Stat row — label left + bar right */
.hud-bottom-center .stat-row {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

/* HP / SHIELD label injected via data attribute on .stat-row
   HTML has no label element, so we use ::before on the row.   */
.hud-bottom-center .stat-row:first-child::before {
    content:        'HP';
    font-family:    var(--sf3-mono);
    font-size:      0.68rem;
    font-weight:    800;
    color:          var(--neon-health);
    text-shadow:    0 0 6px rgba(57,255,20,0.60);
    letter-spacing: 0.12em;
    width:          32px;
    flex-shrink:    0;
    text-align:     right;
}
.hud-bottom-center #shieldContainer::before {
    content:        'SLD';
    font-family:    var(--sf3-mono);
    font-size:      0.68rem;
    font-weight:    800;
    color:          var(--neon-shield);
    text-shadow:    0 0 6px rgba(136,240,255,0.60);
    letter-spacing: 0.10em;
    width:          32px;
    flex-shrink:    0;
    text-align:     right;
}

/* Bar track — taller, sci-fi glass */
.hud-bottom-center .health-bar {
    width:         300px !important;
    height:        22px !important;
    background:    rgba(255,255,255,0.04) !important;
    border:        1px solid rgba(255,255,255,0.10) !important;
    border-radius: 4px !important;
    overflow:      hidden !important;
    position:      relative !important;
    box-shadow:    inset 0 1px 0 rgba(0,0,0,0.35) !important;
}

/* HP bar fill — neon green glow */
#healthFill {
    background: linear-gradient(90deg, var(--neon-health) 0%, #22ff7a 80%) !important;
    box-shadow: 0 0 14px var(--neon-health-glow), inset 0 1px 0 rgba(255,255,255,0.08) !important;
}

/* Shield bar fill — neon cyan glow */
#shieldFill {
    background: linear-gradient(90deg, var(--neon-shield) 0%, #7ee7ff 80%) !important;
    box-shadow: 0 0 14px var(--neon-shield-glow), inset 0 1px 0 rgba(255,255,255,0.08) !important;
}

/* Numbers overlay inside the bar */
.hud-bottom-center .stat-text {
    font-family:    var(--sf3-mono) !important;
    font-size:      0.78rem !important;
    font-weight:    800 !important;
    letter-spacing: 0.06em !important;
    color:          rgba(255,255,255,0.96) !important;
    text-shadow:    0 1px 4px rgba(0,0,0,0.90) !important;
    background:     transparent !important;
    box-shadow:     none !important;
    padding:        0 !important;
}

/* ─ end SF3-D ─────────────────────────────────────────────────── */

/* ─ Touch-action lock: prevents pinch zoom on the game container ─ */
#gameContainer, #gameCanvas {
    touch-action: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ASTEROID FIELD — RED ALERT OVERLAY
   Full-screen warning that fires each time an asteroid field triggers.
   ═══════════════════════════════════════════════════════════════════════════ */
#ast-field-alert {
    position: fixed;
    inset: 0;
    z-index: 99999;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    /* Red vignette — bright ring around all edges */
    background: radial-gradient(
        ellipse at center,
        transparent 28%,
        rgba(220, 20, 0, 0.18) 60%,
        rgba(255, 30, 0, 0.62) 100%
    );
}
#ast-field-alert.afa-active {
    animation: afa-fade 6.0s ease-in-out forwards;
}

/* Scanline shimmer on top of the vignette */
#ast-field-alert::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(255, 40, 0, 0.06) 3px,
        rgba(255, 40, 0, 0.06) 4px
    );
    animation: afa-scan 1.6s linear 3 forwards;
    opacity: 0;
}
#ast-field-alert.afa-active::after {
    opacity: 1;
}

/* ── Centre text block ── */
.afa-inner {
    position: relative;
    z-index: 1;
    text-align: center;
    animation: afa-text-drop 6.0s ease-in-out forwards;
    opacity: 0;
}
.afa-icon {
    display: block;
    font-size: clamp(40px, 7vw, 80px);
    margin-bottom: 10px;
    filter: drop-shadow(0 0 18px rgba(255, 90, 0, 1));
    animation: afa-icon-bounce 0.7s cubic-bezier(.18,.89,.32,1.28) forwards;
    opacity: 0;
}
.afa-title {
    font-family: 'Orbitron', 'Share Tech Mono', monospace;
    font-size: clamp(18px, 3.8vw, 48px);
    font-weight: 900;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #ff2200;
    text-shadow:
        0 0 12px rgba(255, 60,  0, 1.0),
        0 0 30px rgba(255, 40,  0, 0.9),
        0 0 70px rgba(255,  0,  0, 0.6),
        0 0 120px rgba(200, 0,  0, 0.3);
    animation: afa-title-pulse 1.1s ease-in-out 3 alternate;
}
.afa-sub {
    font-family: 'Orbitron', 'Share Tech Mono', monospace;
    font-size: clamp(10px, 1.6vw, 18px);
    letter-spacing: 0.45em;
    text-transform: uppercase;
    color: rgba(255, 185, 160, 0.88);
    margin-top: 10px;
    text-shadow: 0 0 10px rgba(255, 80, 0, 0.7);
}

/* ── Keyframes ── */
@keyframes afa-fade {
    0%   { opacity: 0; }
    5%   { opacity: 1; }
    80%  { opacity: 1; }
    100% { opacity: 0; }
}
@keyframes afa-text-drop {
    0%   { opacity: 0; transform: translateY(-28px) scale(0.88); }
    8%   { opacity: 1; transform: translateY(0)     scale(1);    }
    80%  { opacity: 1; transform: translateY(0)     scale(1);    }
    100% { opacity: 0; transform: translateY(12px)  scale(0.96); }
}
@keyframes afa-icon-bounce {
    0%   { opacity: 0; transform: scale(0.3) rotate(-20deg); }
    65%  { opacity: 1; transform: scale(1.15) rotate(6deg);  }
    82%  { transform: scale(0.94) rotate(-2deg); }
    100% { opacity: 1; transform: scale(1)   rotate(0deg);   }
}
@keyframes afa-title-pulse {
    0%   { opacity: 1;   transform: scale(1);    letter-spacing: 0.22em; }
    100% { opacity: 0.2; transform: scale(1.05); letter-spacing: 0.28em; }
}
@keyframes afa-scan {
    0%   { background-position-y: 0;    opacity: 0.8; }
    100% { background-position-y: 48px; opacity: 0;   }
}
/* ─ end Asteroid Field Alert ─────────────────────────────────────────────── */
