:root {
    --amber: #ffb000;
    --amber-dim: rgba(255, 176, 0, 0.25);
    --bg-dark: #07080a;
    --panel-bg: hsla(220, 20%, 8%, 0.9);
    --neon-green: #00ff88;
    --neon-blue: #00d4ff;
    --neon-red: #ff3344;
    --ticker-bg: rgba(0, 0, 0, 0.92);
    --mobile-nav-h: 65px;
    --glass-edge: rgba(255, 255, 255, 0.08);
}

/* ═══════════════════════════════════════════════════════════
   ENTER GATEWAY — Premium entry screen (enables audio)
   ═══════════════════════════════════════════════════════════ */
#enter-gateway {
    position: fixed; inset: 0; z-index: 100000;
    background: radial-gradient(ellipse at center, #0a0e14 0%, #020304 60%, #000 100%);
    display: flex; align-items: center; justify-content: center; flex-direction: column;
    cursor: pointer;
    transition: opacity 0.8s ease, filter 0.8s ease;
}
#enter-gateway.dismissed {
    opacity: 0; filter: blur(16px); pointer-events: none;
}
.gateway-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(2.2rem, 6vw, 4.5rem);
    letter-spacing: 0.35em;
    color: #fff;
    text-shadow: 0 0 30px rgba(0,212,255,0.4), 0 0 60px rgba(0,212,255,0.15);
    animation: gateway-glow 3s ease-in-out infinite alternate;
    margin-bottom: 6px;
}
.gateway-title .gw-geo { color: #fff; }
.gateway-title .gw-pulse { color: var(--neon-blue); }
.gateway-sub {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.5rem, 1.2vw, 0.72rem);
    letter-spacing: 0.5em;
    color: rgba(255,176,0,0.5);
    margin-bottom: 48px;
}
.gateway-enter {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.65rem, 1.3vw, 0.85rem);
    letter-spacing: 0.4em;
    color: rgba(255,255,255,0.35);
    border: 1px solid rgba(0,212,255,0.15);
    padding: 14px 48px;
    border-radius: 2px;
    transition: all 0.4s ease;
    animation: gateway-pulse 2.5s ease-in-out infinite;
}
.gateway-enter:hover {
    color: #fff;
    border-color: var(--neon-blue);
    background: rgba(0,212,255,0.06);
    box-shadow: 0 0 30px rgba(0,212,255,0.15);
    text-shadow: 0 0 10px rgba(0,212,255,0.5);
}
.gateway-credit {
    position: absolute; bottom: 28px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.55rem; letter-spacing: 0.3em;
    color: rgba(255,255,255,0.12);
}
@keyframes gateway-glow {
    0% { text-shadow: 0 0 20px rgba(0,212,255,0.2), 0 0 40px rgba(0,212,255,0.08); }
    100% { text-shadow: 0 0 40px rgba(0,212,255,0.45), 0 0 80px rgba(0,212,255,0.2); }
}
@keyframes gateway-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════
   CINEMATIC SPLASH SCREEN
   ═══════════════════════════════════════════════════════════ */
#splash-screen {
    position: fixed; inset: 0; z-index: 99999;
    background: radial-gradient(ellipse at center, #0a0e14 0%, #020304 70%, #000 100%);
    display: flex; align-items: center; justify-content: center;
    transition: opacity 1.2s cubic-bezier(.4,0,.2,1), transform 1.2s cubic-bezier(.4,0,.2,1), filter 1s ease;
    will-change: opacity, transform, filter;
}
#splash-screen.dissolve {
    opacity: 0;
    transform: scale(1.08);
    filter: blur(12px);
    pointer-events: none;
}

/* Grid background */
.splash-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(0,212,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,212,255,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: splash-grid-drift 20s linear infinite;
}
@keyframes splash-grid-drift {
    to { background-position: 60px 60px; }
}

/* Horizontal scanline */
.splash-scanline {
    position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(180deg, transparent 0%, rgba(0,212,255,0.02) 50%, transparent 100%);
    background-size: 100% 4px;
    animation: splash-scan 3s linear infinite;
    z-index: 1;
}
.splash-scanline::after {
    content: ''; position: absolute; left: 0; right: 0;
    height: 2px; background: rgba(0,212,255,0.08);
    box-shadow: 0 0 20px rgba(0,212,255,0.15);
    animation: splash-scan-line 4s ease-in-out infinite;
}
@keyframes splash-scan-line {
    0% { top: -2px; }
    100% { top: 100%; }
}

/* Content container */
.splash-content {
    position: relative; z-index: 2;
    display: flex; flex-direction: column; align-items: center;
    animation: splash-content-in 1.5s cubic-bezier(.16,1,.3,1) forwards;
    opacity: 0;
}
@keyframes splash-content-in {
    0% { opacity: 0; transform: translateY(30px) scale(0.9); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Radar */
.splash-radar {
    position: relative; width: 160px; height: 160px;
    margin-bottom: 32px;
}
.splash-radar-ring {
    position: absolute; border-radius: 50%;
    border: 1px solid rgba(0,212,255,0.15);
    top: 50%; left: 50%; transform: translate(-50%, -50%);
}
.splash-radar-ring.r1 { width: 160px; height: 160px; animation: splash-ring-pulse 2.5s ease-out infinite; }
.splash-radar-ring.r2 { width: 110px; height: 110px; animation: splash-ring-pulse 2.5s ease-out 0.4s infinite; }
.splash-radar-ring.r3 { width: 60px; height: 60px; animation: splash-ring-pulse 2.5s ease-out 0.8s infinite; }
@keyframes splash-ring-pulse {
    0% { border-color: rgba(0,212,255,0.4); transform: translate(-50%, -50%) scale(1); }
    50% { border-color: rgba(0,212,255,0.15); }
    100% { border-color: rgba(0,212,255,0.05); transform: translate(-50%, -50%) scale(1.15); }
}

/* Rotating sweep */
.splash-radar-sweep {
    position: absolute; top: 50%; left: 50%; width: 80px; height: 80px;
    transform-origin: 0 0;
    background: conic-gradient(from 0deg, transparent 0deg, rgba(0,212,255,0.2) 40deg, transparent 80deg);
    animation: splash-sweep 2s linear infinite;
    border-radius: 0 80px 0 0;
}
@keyframes splash-sweep {
    to { transform: rotate(360deg); }
}

/* Center dot */
.splash-radar-dot {
    position: absolute; top: 50%; left: 50%; width: 8px; height: 8px;
    background: #00d4ff; border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 12px #00d4ff, 0 0 30px rgba(0,212,255,0.4);
    animation: splash-dot-pulse 1.5s ease-in-out infinite;
}
@keyframes splash-dot-pulse {
    0%, 100% { box-shadow: 0 0 12px #00d4ff, 0 0 30px rgba(0,212,255,0.4); }
    50% { box-shadow: 0 0 20px #00d4ff, 0 0 50px rgba(0,212,255,0.6), 0 0 80px rgba(0,212,255,0.2); }
}

/* Title */
.splash-title {
    font-family: 'Inter', 'Share Tech Mono', monospace;
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 900;
    letter-spacing: 6px;
    line-height: 1;
    margin-bottom: 12px;
    animation: splash-title-glow 3s ease-in-out infinite;
}
.splash-geo {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255,255,255,0.3);
}
.splash-pulse {
    color: #00d4ff;
    text-shadow: 0 0 20px rgba(0,212,255,0.6), 0 0 60px rgba(0,212,255,0.2);
}
@keyframes splash-title-glow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

/* Tagline */
.splash-tagline {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.6rem, 2vw, 0.85rem);
    letter-spacing: 8px;
    color: rgba(255,176,0,0.7);
    margin-bottom: 28px;
    animation: splash-tagline-in 2s cubic-bezier(.16,1,.3,1) 0.5s both;
}
@keyframes splash-tagline-in {
    0% { opacity: 0; letter-spacing: 20px; }
    100% { opacity: 1; letter-spacing: 8px; }
}

/* Loading bar */
.splash-bar {
    width: clamp(200px, 40vw, 320px); height: 2px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 20px;
}
.splash-bar-fill {
    height: 100%; width: 0;
    background: linear-gradient(90deg, #00d4ff, #ffb000);
    border-radius: 2px;
    animation: splash-bar-load 3.5s cubic-bezier(.4,0,.2,1) 0.3s forwards;
    box-shadow: 0 0 8px rgba(0,212,255,0.5);
}
@keyframes splash-bar-load {
    0% { width: 0; }
    20% { width: 15%; }
    50% { width: 45%; }
    80% { width: 80%; }
    100% { width: 100%; }
}

/* Credit */
.splash-credit {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 3px;
    color: rgba(255,255,255,0.2);
    text-transform: uppercase;
    animation: splash-credit-in 1.5s ease 1s both;
}
.splash-credit strong {
    color: rgba(255,176,0,0.45);
    font-weight: 600;
}
@keyframes splash-credit-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Share Tech Mono', monospace; }
body, html { width: 100%; height: 100%; overflow: hidden; background: #000; color: var(--amber); }

#map { position: absolute; inset: 0; z-index: 1; }
/* MapLibre Control Position Fix */
.maplibregl-ctrl-bottom-right { bottom: 65px; right: 10px; display: block; }
.maplibregl-ctrl-bottom-left { display: none; }

/* -------------------------------------------------------
   GLOBAL NEWS TICKER (Marquee)
------------------------------------------------------- */
.global-ticker {
    position: fixed;
    left: 0; width: 100%; height: 28px;
    background: rgba(0, 0, 0, 0.75);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 500;
    display: flex; align-items: center;
    overflow: hidden;
    backdrop-filter: blur(5px);
    transition: transform 0.4s ease, opacity 0.4s ease;
}

#ticker-top { top: 0; border-top: none; transform: translateY(0); opacity: 1; }
#ticker-bottom { bottom: 0; border-bottom: none; display: none; }

.ticker-content {
    white-space: nowrap;
    padding-left: 100%;
    display: inline-block;
    animation: marquee 120s linear infinite;
    font-size: 0.85rem;
    color: var(--amber) !important;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 500;
}

.ticker-content:hover { animation-play-state: paused; cursor: pointer; }

@keyframes marquee {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-100%, 0); }
}

/* -------------------------------------------------------
   MOBILE UI - NAVIGATION & SHEETS
------------------------------------------------------- */
#mobile-nav {
    display: none;
    position: fixed; bottom: 0; left: 0; width: 100%;
    height: var(--mobile-nav-h);
    background: rgba(18,24,42,0.94);
    border-top: 1px solid rgba(255,176,0,0.35);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
    z-index: 1000;
    display: none; justify-content: space-around; align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-btn {
    background: none; border: none; color: rgba(255,200,60,0.65);
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    cursor: pointer; transition: all 0.3s; width: 20%;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    padding: 8px 4px;
}
.nav-btn i { font-size: 1.2rem; }
.nav-btn span { font-size: 0.6rem; letter-spacing: 1px; }
.nav-btn.active { color: #ffcc33; text-shadow: 0 0 10px rgba(255,200,50,0.6); }

/* Unified Command Sheets (Mobile) */
@media (max-width: 768px) {
    #ticker-top { transform: translateY(0); opacity: 1; }
    #ticker-bottom { transform: translateY(0); opacity: 1; bottom: var(--mobile-nav-h); border-bottom: none; }

    /* Accelerate ticker on mobile — 120s is painfully slow on small viewports */
    .ticker-content { animation-duration: 45s; }
    
    #mobile-nav { display: flex; z-index: 1000; }
    #mobile-menu-btn { display: none !important; }

    /* CRITICAL: Override ALL inline styles from switchMode() so .active class always wins */
    #sidebar, #info-panel {
        position: fixed !important;
        width: 100% !important;
        left: 0 !important; right: 0 !important;
        border: none !important; border-radius: 0 !important;
        margin: 0 !important;
        transform: translateY(100%) !important;
        transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1) !important;
        height: calc(100% - var(--mobile-nav-h) - 28px) !important;
        max-height: none !important;
        top: 28px !important;
        bottom: var(--mobile-nav-h) !important;
        /* Override switchMode() inline styles */
        opacity: 1 !important;
        pointer-events: none !important;
        display: block !important;
        z-index: 900 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    #sidebar.active, #info-panel.active {
        transform: translateY(0%) !important;
        z-index: 950 !important;
        pointer-events: auto !important;
    }

    /* Disable desktop hover-expand on mobile — drawer handles this */
    #sidebar:hover {
        max-height: none !important;
        width: 100% !important;
    }
    #info-panel:hover {
        max-height: none !important;
        width: 100% !important;
    }

    .sidebar-body { height: calc(100% - 60px); overflow-y: auto; -webkit-overflow-scrolling: touch; }

    /* Semi-transparent backdrop when a panel is open */
    body.mobile-panel-open::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 899;
        pointer-events: none;
    }

    /* Ensure toggle switches are touch-friendly */
    .control-item {
        min-height: 36px;
        padding: 4px 6px;
    }
    .toggle-switch {
        min-width: 44px;
        min-height: 20px;
    }

    /* Collapsible sections need visible tap targets */
    .category-title {
        padding: 12px 8px;
        min-height: 44px;
    }

    #map-branding {
        display: none !important;
    }

    /* Fixed Crisis Briefing Panel on Mobile */
    #briefing-panel {
        top: 90px !important;
        right: 10px !important;
        left: 10px !important;
        width: calc(100vw - 20px) !important;
        bottom: calc(var(--mobile-nav-h) + 10px) !important;
        max-height: calc(100vh - var(--mobile-nav-h) - 100px) !important;
        z-index: 1050 !important;
    }

    /* Popups always above sidebar */
    .maplibregl-popup {
        z-index: 960 !important;
    }

    /* Tour briefing above everything */
    .tour-briefing-panel {
        z-index: 1060 !important;
    }
}

/* -------------------------------------------------------
   DESKTOP PANELS (Premium Glassmorphism V7.0)
------------------------------------------------------- */
.terminal-panel {
    position: fixed; z-index: 100;
    background: var(--panel-bg);
    border: 1px solid var(--glass-edge);
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8), inset 0 0 0 1px rgba(255,255,255,0.03);
    backdrop-filter: blur(18px);
    overflow: hidden;
    transition: all 0.45s cubic-bezier(0.19, 1, 0.22, 1);
}

#sidebar {
    top: 52px; right: 14px; width: 340px;
    border-right: 3px solid var(--amber);
    max-height: 46px;
}
#sidebar:hover { max-height: 90vh; overflow-y: auto; width: 360px; box-shadow: 0 0 30px var(--amber-dim); }

/* iPad/touch: prevent sticky :hover — collapse when tapping outside */
@media (hover: none) and (pointer: coarse) {
    #sidebar { transition: max-height 0.35s ease, width 0.35s ease; }
    #sidebar:hover { max-height: 46px; width: 340px; overflow: hidden; box-shadow: none; }
    #sidebar.touch-open { max-height: 90vh !important; overflow-y: auto !important; width: 360px !important; box-shadow: 0 0 30px var(--amber-dim) !important; }
    #info-panel:hover { max-height: 50px; width: 280px; overflow: hidden; box-shadow: none; }
    #info-panel.touch-open { max-height: 85vh !important; overflow-y: auto !important; width: 340px !important; box-shadow: 0 0 30px var(--amber-dim) !important; }
}



/* CRT Scanline Overlay */
.terminal-panel::before {
    content: ""; display: block; position: absolute; inset: 0;
    pointer-events: none; z-index: 100;
    background: linear-gradient(rgba(18,16,16,0) 50%, rgba(0,0,0,.08) 50%);
    background-size: 100% 3px; opacity: 0.25;
}

/* Header & Typography */
header {
    padding: 8px 12px; display: flex; flex-direction: column; gap: 3px;
    position: relative; border-bottom: 1px solid rgba(255,255,255,0.05);
}
#sidebar header {
    position: sticky; top: 0; z-index: 10;
    background: var(--panel-bg); backdrop-filter: blur(18px);
    padding: 6px 12px 9px;
    display: flex; flex-direction: column;
    justify-content: center;
    min-height: 40px;
}
.header-top-row { display: flex; justify-content: space-between; align-items: center; }

/* Main title row — amber, signature color */
#sidebar header h1 {
    font-size: 0.8rem; letter-spacing: 2.5px; font-weight: 700;
    margin: 0; color: #ffb000;
    text-shadow: 0 0 5px rgba(255,176,0,0.5);
}
#sidebar .header-main .sidebar-expand-hint {
    font-size: 0.7rem; letter-spacing: 2px; font-weight: 600;
    color: #ffb000; opacity: 0.8; margin: 0;
}

/* Meta row — readable secondary info */
.header-meta {
    margin-top: 3px;
    display: flex; justify-content: space-between; align-items: center;
}
.header-meta .byline {
    font-size: 0.55rem; letter-spacing: 1.5px;
    text-transform: uppercase; font-weight: normal;
    color: rgba(255,255,255,0.55);
}
.header-meta .sub-header {
    font-size: 0.55rem; letter-spacing: 1.5px;
    color: rgba(255,255,255,0.6); opacity: 1; gap: 4px;
}

header h2 { font-size: 0.85rem; letter-spacing: 2.5px; font-weight: 700; margin: 0; }

.version { font-size: 0.6rem; opacity: 0.5; }
.sub-header {
    font-size: 0.52rem; opacity: 0.5; display: flex; align-items: center;
    gap: 4px; letter-spacing: 1.2px; color: #fff;
}
.blinking-cursor {
    width: 6px; height: 10px; background: currentColor;
    animation: cursor-blink 1s step-end infinite;
}
@keyframes cursor-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.category-title {
    font-size: .75rem; text-transform: uppercase; letter-spacing: 1px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 6px; cursor: pointer;
    border-left: 2px solid var(--amber-dim); user-select: none;
}
.category-title:hover { border-left-color: var(--amber); background: rgba(255,176,0,.08); }

/* Toggles */
.toggle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.control-item { display: flex; justify-content: space-between; align-items: center; font-size: 0.72rem; min-height: 32px; margin-bottom: 6px; }
.control-item > span:first-child { flex: 1; }

/* Status Badges */
.layer-status-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 0.5rem; padding: 2px 6px; border-radius: 2px;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    letter-spacing: 1px; cursor: help; margin-top:2px; font-weight: normal;
}
.layer-status-badge.status-live { color: var(--neon-green); border-color: rgba(0,255,136,0.3); background: rgba(0,255,136,0.05); }
.layer-status-badge.status-live::before { content: ''; width: 4px; height: 4px; background: var(--neon-green); border-radius: 50%; animation: pulse-green 2s infinite; }
.layer-status-badge.status-delayed { color: var(--amber); border-color: rgba(255,176,0,0.3); background: rgba(255,176,0,0.05); }
.layer-status-badge.status-delayed::before { content: ''; width: 4px; height: 4px; background: var(--amber); border-radius: 50%; opacity: 0.8; }
.layer-status-badge.status-degraded { color: #ffb000; border-color: rgba(255,176,0,0.3); background: rgba(255,176,0,0.15); }
.layer-status-badge.status-degraded::before { content: ''; width: 4px; height: 4px; background: var(--amber); border-radius: 50%; animation: pulse-amber 2s infinite; }
@keyframes pulse-amber { 0% { box-shadow: 0 0 0 0 rgba(255,176,0,0.4); } 70% { box-shadow: 0 0 0 4px rgba(255,176,0,0); } 100% { box-shadow: 0 0 0 0 rgba(255,176,0,0); } }
.layer-status-badge.status-limited { color: var(--neon-blue); border-color: rgba(0,212,255,0.3); background: rgba(0,212,255,0.05); }
.layer-status-badge.status-limited::before { content: ''; width: 4px; height: 4px; background: var(--neon-blue); border-radius: 50%; }
.layer-status-badge.status-static { color: #aaa; border-color: rgba(255,255,255,0.15); background: rgba(255,255,255,0.02); }
.layer-status-badge.status-static::before { content: ''; width: 4px; height: 4px; background: #aaa; border-radius: 50%; }
.layer-status-badge.status-error { color: var(--neon-red); border-color: rgba(255,51,68,0.3); background: rgba(255,51,68,0.08); }
.layer-status-badge.status-error::before { content: ''; width: 4px; height: 4px; background: var(--neon-red); border-radius: 50%; animation: pulse-red 1s infinite; }
.layer-status-badge.status-experimental { color: #e066ff; border-color: rgba(224,102,255,0.3); background: rgba(224,102,255,0.05); }
.layer-status-badge.status-experimental::before { content: ''; width: 4px; height: 4px; background: #e066ff; border-radius: 50%; }

/* Hardware Toggles (V8.1 Aero-Switch) */
.toggle-switch {
    position: relative; width: 44px; height: 16px;
    background: rgba(40,45,50,0.8); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px; cursor: pointer; transition: all 0.3s;
    overflow: hidden; display: block;
}
.toggle-switch input {
    opacity: 0; width: 0; height: 0; position: absolute;
}
.slider {
    position: absolute; inset: 0; background: rgba(0,0,0,0.4);
    transition: 0.2s ease-in-out;
}
.slider:before {
    position: absolute; content: "";
    height: 100%; width: 18px; left: 0; top: 0;
    background: #555; border-right: 1px solid rgba(255,255,255,0.1);
    box-shadow: 2px 0 5px rgba(0,0,0,0.3);
    transition: 0.2s ease-in-out;
}
input:checked + .slider {
    background: rgba(0,255,255,0.15);
}
input:checked + .slider:before {
    transform: translateX(26px);
    background: var(--neon-cyan);
    box-shadow: -2px 0 10px rgba(0,255,255,0.4);
}
.control-item:hover .toggle-switch {
    border-color: rgba(0,255,255,0.3);
}



/* -------------------------------------------------------
   POWER OUTAGE MARKERS
------------------------------------------------------- */
.marker-power {
    width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}

.marker-power-live .core {
    width: 10px; height: 10px; background: #ff0000; border-radius: 50%;
    box-shadow: 0 0 10px #ff0000; animation: pulse-red 1.5s infinite;
}

.marker-power-hist .core {
    width: 8px; height: 8px; background: #555; border-radius: 50%;
    border: 1px solid var(--amber-dim); opacity: 0.7;
}

@keyframes pulse-red {
    0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(255,0,0,0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(255,0,0,0); }
    100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(255,0,0,0); }
}

/* -------------------------------------------------------
   ORIENTATION HINT
------------------------------------------------------- */
#orientation-hint {
    display: none;
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0,0,0,0.95);
    color: var(--amber);
    flex-direction: column; align-items: center; justify-content: center;
    gap: 20px; text-align: center; font-size: 1.2rem;
}

@media (max-width: 600px) and (orientation: portrait) {
    #orientation-hint { display: none; }
}

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

/* -------------------------------------------------------
   UTILITIES
------------------------------------------------------- */
.pulse { animation: pulse-green 2s infinite; }
@keyframes pulse-green {
    0%   { opacity: 1; }
    50%  { opacity: 0.4; }
    100% { opacity: 1; }
}

#status-text { color: var(--amber); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 1px; }
.cat-body { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; }
.collapsible-section.open .cat-body { max-height: 1500px; padding: 10px 0; }
.category-title { opacity: 0.9 !important; font-size: 0.75rem !important; }
.control-item span { opacity: 0.95 !important; font-size: 0.72rem !important; }



#launch-hud {
    position: fixed; bottom: 45px; left: 14px; z-index: 800;
    background: rgba(0,5,20,0.9); border: 1px solid rgba(255,100,0,0.4);
    backdrop-filter: blur(10px); padding: 10px; border-radius: 4px;
    font-size: 0.65rem; opacity: 0; pointer-events: none;
    transition: all 0.3s;
}

/* -------------------------------------------------------
   V7.1 MAP BRANDING & POPUPS
------------------------------------------------------- */
#map-branding {
    display: none;
}
.tactical-footer-hud {
    font-size: 0.52rem; color: rgba(255,255,255,0.5);
    letter-spacing: 1.5px; font-family: 'Share Tech Mono', monospace;
    background: rgba(0,0,0,0.55); padding: 3px 16px; border-radius: 0;
    border-top: 1px solid rgba(255,176,0,0.3); border-bottom: none;
    backdrop-filter: blur(6px); pointer-events: auto; text-shadow: none;
}
.tactical-footer-hud a { color: rgba(255,255,255,0.6); text-decoration: none; margin: 0 2px; transition: 0.2s; }
.tactical-footer-hud a:hover { color: var(--amber); text-shadow: 0 0 5px var(--amber); }
.neon-number { color: var(--neon-blue); text-shadow: 0 0 5px rgba(0, 212, 255, 0.5); }

/* Popup Dark Mode Correction */
.maplibregl-popup-content {
    background: rgba(10, 14, 20, 0.95) !important;
    color: #fff !important;
    border: 1px solid var(--glass-edge) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.9) !important;
    padding: 12px !important; border-radius: 4px !important;
    font-size: 0.82rem !important;
    line-height: 1.5 !important;
    max-width: 320px !important;
}
.maplibregl-popup-tip { border-top-color: var(--panel-bg) !important; }
.maplibregl-popup-close-button { color: #888 !important; outline: none !important; }

/* MapLibre attribution — collapsed by default */
.maplibregl-ctrl-attrib { font-size: 0 !important; background: transparent !important; }
.maplibregl-ctrl-attrib.maplibregl-compact { min-height: 20px; }
.maplibregl-ctrl-attrib-button { opacity: 0.3; }
.maplibregl-ctrl-attrib-button:hover { opacity: 0.7; }

/* Remove legacy elements */
/* Hide elements when ticker is disabled */
body.no-ticker .global-ticker { display: none !important; }
body.no-ticker #sidebar { top: 14px !important; }

/* -------------------------------------------------------
   SOLAR WIDGET — Integrated Menu Style
------------------------------------------------------- */
.solar-widget { margin-top: 8px; padding: 6px 8px; border-top: 1px solid rgba(255,255,255,0.07); font-family: 'Share Tech Mono', monospace; }
.solar-title { font-size: 0.58rem; letter-spacing: 1.5px; color: rgba(255,255,255,0.35); text-transform: uppercase; margin-bottom: 5px; }
.solar-loading { font-size: 0.55rem; color: rgba(255,255,255,0.25); letter-spacing: 1px; }
.solar-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; margin-bottom: 4px; }
.solar-cell { display: flex; flex-direction: column; align-items: center; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); padding: 4px 2px; border-radius: 2px; }
.solar-val { font-size: 0.85rem; font-weight: 700; line-height: 1; }
.solar-lbl { font-size: 0.42rem; opacity: 0.4; letter-spacing: 1px; margin-top: 2px; text-transform: uppercase; }
.solar-level { font-size: 0.5rem; letter-spacing: 1px; text-align: center; margin-top: 3px; opacity: 0.85; }
.solar-alert { font-size: 0.5rem; color: #ffe066; text-align: center; margin-top: 3px; letter-spacing: 1px; }

/* -------------------------------------------------------
   LAYER LEGEND (SST / Surface Temp)
------------------------------------------------------- */
#layer-legend {
    position: fixed; bottom: 65px; left: 50%; transform: translateX(-50%);
    z-index: 460; flex-direction: column; align-items: center; gap: 3px;
    background: rgba(0,0,0,0.55); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px; padding: 6px 14px; backdrop-filter: blur(6px);
    font-family: 'Share Tech Mono', monospace; pointer-events: none; min-width: 180px;
}
.legend-title { font-size: 0.5rem; letter-spacing: 1.5px; color: rgba(255,255,255,0.5); text-align: center; text-transform: uppercase; margin-bottom: 3px; }
.legend-bar { width: 100%; height: 6px; border-radius: 3px; opacity: 0.85; }
.legend-labels { display: flex; justify-content: space-between; width: 100%; font-size: 0.42rem; color: rgba(255,255,255,0.4); margin-top: 2px; }

/* -------------------------------------------------------
   TACTICAL BUTTONS (shared — scenarios, etc.)
------------------------------------------------------- */
.tactical-btn {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--neon-blue);
    color: var(--neon-blue);
    padding: 10px 20px; font-size: 0.8rem; letter-spacing: 2px;
    cursor: pointer; transition: all 0.3s; pointer-events: auto;
}
.tactical-btn:hover { background: var(--neon-blue); color: #000; box-shadow: 0 0 20px var(--neon-blue); }
.exit-btn { border-color: var(--neon-red); color: var(--neon-red); background: rgba(255, 51, 68, 0.05); }
.exit-btn:hover { background: var(--neon-red); color: #fff; box-shadow: 0 0 20px var(--neon-red); }


/* -------------------------------------------------------
   LANGUAGE SELECTOR
------------------------------------------------------- */
.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-switch {
    display: flex;
    gap: 2px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 3px;
    padding: 1px;
    margin-right: 6px;
}

.lang-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.35);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.55rem;
    padding: 3px 7px;
    cursor: pointer;
    border-radius: 2px;
    letter-spacing: 1px;
    transition: all 0.2s;
}

.lang-btn:hover {
    color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.05);
}

.lang-btn.active {
    color: var(--neon-blue);
    background: rgba(0,212,255,0.12);
    font-weight: bold;
}

/* -------------------------------------------------------
   INFO PANEL (In-App Educational Content)
------------------------------------------------------- */
/* ═══ SHARED HUD PANEL BASE — matches Main Menu style ═══ */
.hud-panel-base {
    position: fixed; z-index: 100;
    left: 14px; width: 280px;
    max-height: 50px;
    background: var(--panel-bg);
    border: 1px solid var(--glass-edge);
    border-left: 3px solid var(--amber);
    border-radius: 4px;
    backdrop-filter: blur(18px);
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8), inset 0 0 0 1px rgba(255,255,255,0.03);
    transition: all 0.45s cubic-bezier(0.19, 1, 0.22, 1);
    font-family: 'Share Tech Mono', monospace;
}
/* CRT scanlines */
.hud-panel-base::before {
    content: ""; display: block; position: absolute; inset: 0;
    pointer-events: none; z-index: 100;
    background: linear-gradient(rgba(18,16,16,0) 50%, rgba(0,0,0,.08) 50%);
    background-size: 100% 3px; opacity: 0.25;
}
.hud-header {
    display: flex; flex-direction: column; justify-content: center;
    padding: 8px 12px 7px;
    cursor: pointer;
    min-height: 48px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.hud-title {
    color: var(--amber); font-size: .78rem; font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 0 0 5px rgba(255,176,0,0.5);
    line-height: 1.2;
}
.hud-sub {
    color: rgba(255,255,255,0.5); font-size: .5rem;
    letter-spacing: 1.5px; font-weight: 400;
    margin-top: 3px;
    line-height: 1;
}

/* ── INFO PANEL ── */
#info-panel { top: 52px; z-index: 100; }
#info-panel:hover {
    max-height: 85vh; width: 340px;
    box-shadow: 0 0 30px var(--amber-dim);
    overflow-y: auto;
}

.info-panel-body {
    padding: 6px 10px 10px;
    font-size: 0.72rem;
    line-height: 1.5;
}

.info-section {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.info-section h3 {
    font-size: 0.68rem;
    letter-spacing: 1px;
    color: var(--neon-blue);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.info-section p {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.5;
    margin: 0;
}

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

.info-source-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 5px;
    background: rgba(255,255,255,0.02);
    border-radius: 3px;
}

.info-source-item strong {
    font-size: 0.62rem;
    color: rgba(255,255,255,0.8);
    letter-spacing: 0.5px;
}

.info-source-item p {
    font-size: 0.55rem !important;
    margin-top: 2px;
    color: rgba(255,255,255,0.4) !important;
}

.source-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

.source-dot.live {
    background: var(--neon-green);
    box-shadow: 0 0 4px var(--neon-green);
    animation: pulse-green 2s infinite;
}

.source-dot.static {
    background: #888;
}

.info-link-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.info-link {
    display: block;
    font-size: 0.6rem;
    color: var(--neon-blue);
    text-decoration: none;
    background: rgba(0,212,255,0.05);
    border: 1px solid rgba(0,212,255,0.15);
    padding: 5px 8px;
    border-radius: 3px;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    font-family: 'Share Tech Mono', monospace;
}

.info-link:hover {
    background: rgba(0,212,255,0.12);
    border-color: rgba(0,212,255,0.4);
}

/* -------------------------------------------------------
   Intelligence Briefing Panel
------------------------------------------------------- */
#briefing-panel {
    position: absolute;
    top: 110px;
    right: 340px;
    width: 360px;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    background: rgba(8, 12, 20, 0.96) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.9);
}

#briefing-panel.hidden {
    transform: translateX(120%);
    opacity: 0;
    pointer-events: none;
}

.briefing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.briefing-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.briefing-header.severity-critical h2 { color: #ff0000; }
.briefing-header.severity-high h2 { color: #ff3300; }
.briefing-header.severity-medium h2 { color: #ffb000; }
.briefing-header.severity-low h2 { color: #00d4ff; }

.btn-close-briefing {
    background: transparent;
    border: none;
    color: #fff;
    opacity: 0.5;
    cursor: pointer;
    font-size: 1.2rem;
    transition: opacity 0.2s;
}

.btn-close-briefing:hover {
    opacity: 1;
}

.btn-narrate-briefing {
    background: rgba(255,176,0,0.15);
    border: 1px solid rgba(255,176,0,0.5);
    color: #ffb000;
    cursor: pointer;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 5px 14px;
    border-radius: 4px;
    transition: all 0.2s;
    margin-left: auto;
    margin-right: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    animation: audioGlow 3s ease-in-out infinite;
    min-width: 80px;
    flex-shrink: 0;
    white-space: nowrap;
}
@keyframes audioGlow {
    0%, 100% { box-shadow: 0 0 4px rgba(255,176,0,0.15); }
    50% { box-shadow: 0 0 12px rgba(255,176,0,0.3); }
}
.btn-narrate-briefing:hover {
    color: #fff;
    border-color: rgba(255,176,0,0.8);
    background: rgba(255,176,0,0.25);
    box-shadow: 0 0 15px rgba(255,176,0,0.4);
}
.btn-narrate-briefing.active {
    color: #00d4ff;
    border-color: rgba(0,212,255,0.6);
    background: rgba(0,212,255,0.2);
    box-shadow: 0 0 15px rgba(0,212,255,0.35);
    animation: none;
}

.briefing-body h3 {
    margin: 0 0 5px 0;
    font-size: 0.65rem;
    color: rgba(255,255,255,0.5);
    letter-spacing: 2px;
}

.briefing-body p {
    margin: 0 0 15px 0;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #eed;
    border-left: 2px solid rgba(255,255,255,0.2);
    padding-left: 10px;
}

.briefing-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    background: rgba(0,0,0,0.2);
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 15px;
    border-radius: 4px;
}

.briefing-meta-grid div {
    font-size: 0.8rem;
    color: #fff;
}

.briefing-meta-grid span {
    font-size: 0.55rem;
    color: rgba(255,255,255,0.4);
    letter-spacing: 1px;
    display: block;
    margin-bottom: 2px;
}

.related-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.related-chip {
    background: rgba(0,212,255,0.1);
    border: 1px solid rgba(0,212,255,0.3);
    color: #00d4ff;
    padding: 5px 10px;
    font-size: 0.7rem;
    border-radius: 2px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.related-chip:hover {
    background: rgba(0,212,255,0.2);
    border-color: rgba(0,212,255,0.6);
}

@media (max-width: 768px) {
    #briefing-panel {
        top: auto;
        bottom: 85px;
        right: 10px;
        left: 10px;
        width: auto;
    }
}

/* -------------------------------------------------------
   AI Infrastructure Atlas (markers only)
------------------------------------------------------- */
.ai-atlas-marker {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    flex-direction: column;
}

.ai-score-ring {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid #ffb000;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    background: rgba(0,0,0,0.6);
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
    transition: transform 0.2s, box-shadow 0.2s;
}

.ai-atlas-marker:hover .ai-score-ring {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

.ai-cluster-label {
    position: absolute;
    bottom: -15px;
    font-size: 0.6rem;
    white-space: nowrap;
    text-shadow: 1px 1px 2px #000;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* -------------------------------------------------------
   THREAT SCENARIOS (V9.0)
------------------------------------------------------- */
.scenario-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 6px 0;
}

.preset-btn {
    background: rgba(40,45,50,0.8);
    border: 1px solid rgba(255,51,51,0.3);
    color: #ff5555;
    padding: 8px 4px;
    border-radius: 3px;
    font-size: 0.6rem;
    cursor: pointer;
    text-transform: uppercase;
    font-family: 'Share Tech Mono', monospace;
    font-weight: bold;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.preset-btn:hover {
    background: rgba(255,51,51,0.15);
    box-shadow: 0 0 10px rgba(255,51,51,0.4);
    border-color: #ff3333;
    color: #fff;
}

/* -------------------------------------------------------
   FLOATING MAP SEARCH BAR (bottom-left)
------------------------------------------------------- */
.map-search-float {
    position: fixed;
    bottom: 48px;
    left: 14px;
    z-index: 200;
    width: 280px;
}
@media (max-width: 768px) {
    .map-search-float { bottom: 70px; left: 8px; right: 8px; width: auto; }
}
.search-section {
    padding: 0 !important;
    margin-bottom: 8px !important;
    border: none !important;
    background: none !important;
}
.search-bar-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    padding: 0 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-bar-wrap:focus-within {
    border-color: var(--neon-blue, #00d4ff);
    box-shadow: 0 0 8px rgba(0,212,255,0.15);
}
.search-icon {
    color: rgba(255,255,255,0.35);
    font-size: .65rem;
    margin-right: 6px;
    flex-shrink: 0;
}
.search-input {
    background: none;
    border: none;
    color: #e0e0e0;
    font-family: 'Share Tech Mono', monospace;
    font-size: .72rem;
    padding: 8px 0;
    width: 100%;
    outline: none;
    letter-spacing: .5px;
}
.search-input::placeholder {
    color: rgba(255,255,255,0.3);
    font-size: .65rem;
}
.search-kbd {
    flex-shrink: 0;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 3px;
    color: rgba(255,255,255,0.3);
    font-family: 'Share Tech Mono', monospace;
    font-size: .5rem;
    padding: 1px 5px;
    margin-left: 4px;
    pointer-events: none;
    line-height: 1.4;
}
.search-clear {
    flex-shrink: 0;
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: .85rem;
    cursor: pointer;
    padding: 2px 4px;
    margin-left: 2px;
    line-height: 1;
}
.search-clear:hover { color: #ff3355; }

/* Search results dropdown */
.search-results {
    background: rgba(8,12,20,0.97);
    border: 1px solid rgba(0,212,255,0.2);
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 300px;
    overflow-y: auto;
    margin-top: -2px;
}
.search-results::-webkit-scrollbar { width: 4px; }
.search-results::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.search-group-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: .5rem;
    color: rgba(255,255,255,0.35);
    letter-spacing: 1.5px;
    padding: 8px 10px 3px;
    text-transform: uppercase;
}
.search-result-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    cursor: pointer;
    font-size: .68rem;
    color: rgba(255,255,255,0.8);
    border-left: 2px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}
.search-result-item:hover,
.search-result-item.active {
    background: rgba(0,212,255,0.08);
    border-left-color: var(--neon-blue, #00d4ff);
}
.search-result-item .sr-icon { font-size: .75rem; flex-shrink: 0; width: 18px; text-align: center; }
.search-result-item .sr-name { flex: 1; }
.search-result-item .sr-type {
    font-size: .45rem;
    color: rgba(255,255,255,0.3);
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
    flex-shrink: 0;
}
.search-result-item .sr-highlight {
    background: rgba(0,212,255,0.2);
    color: #00d4ff;
    padding: 0 2px;
    border-radius: 2px;
}
.search-no-results {
    padding: 15px 10px;
    text-align: center;
    color: rgba(255,255,255,0.35);
    font-size: .65rem;
    font-family: 'Share Tech Mono', monospace;
}

/* -------------------------------------------------------
   TOUR CATEGORY ACCORDION
------------------------------------------------------- */
.tour-category {
    margin-bottom: 5px;
    border-radius: 4px;
    overflow: hidden;
}
.tour-cat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 10px;
    font-size: .63rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px;
    background: rgba(255,255,255,0.03);
    transition: background 0.2s, border-color 0.2s;
    user-select: none;
}
.tour-cat-header:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.15);
}
.tour-cat-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .5rem;
    opacity: .5;
}
.tour-cat-count {
    background: rgba(255,255,255,0.1);
    padding: 1px 5px;
    border-radius: 8px;
    font-size: .48rem;
    min-width: 14px;
    text-align: center;
}
.tour-cat-chevron {
    font-size: .45rem;
    transition: transform 0.25s ease;
}
.tour-category.open .tour-cat-chevron {
    transform: rotate(90deg);
}
.tour-cat-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.3s ease;
    padding: 0 0;
}
.tour-category.open .tour-cat-body {
    max-height: 500px;
    opacity: 1;
    padding: 4px 0 2px;
}

/* ── OPTION D: NEW badges for recent tours ── */
.tour-new-badge {
    margin-left: 4px;
    font-size: .55rem;
    vertical-align: middle;
    animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}
.cat-new-indicator {
    color: #00ff88;
    font-size: .42rem;
    font-weight: normal;
    letter-spacing: .5px;
    margin-left: 2px;
}

/* -------------------------------------------------------
   LAYER DESCRIPTIONS
------------------------------------------------------- */
.layer-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.layer-desc {
    font-size: 0.55rem !important;
    color: rgba(255,255,255,0.45) !important;
    line-height: 1.3;
    margin: 0;
    opacity: 1 !important;
}

/* -------------------------------------------------------
   WELCOME OVERLAY (First Visit)
------------------------------------------------------- */
#welcome-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(0, 0, 0, 0.85);
    display: flex; align-items: center; justify-content: center;
    gap: 24px;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.6s ease;
    padding: 20px;
    opacity: 0; pointer-events: none;
    transition: opacity 0.6s ease;
}
#welcome-overlay.splash-done {
    opacity: 1; pointer-events: auto;
}

#welcome-overlay.hidden { display: none; }

/* Showcase image columns (desktop only) */
.welcome-showcase {
    display: flex; flex-direction: column; gap: 14px;
    width: 300px; max-width: 300px; min-width: 220px;
    flex-shrink: 0; flex-grow: 0;
    animation: showcase-fade 1.2s ease 0.3s both;
}
@keyframes showcase-fade {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.welcome-showcase-left { animation-delay: 0.4s; }
.welcome-showcase-right { animation-delay: 0.6s; }
.showcase-card {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255,176,0,0.2);
    box-shadow: 0 8px 30px rgba(0,0,0,0.6), 0 0 20px rgba(255,176,0,0.05);
    transition: all 0.4s ease;
}
.showcase-card:hover {
    border-color: rgba(255,176,0,0.5);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.7), 0 0 30px rgba(255,176,0,0.1);
}
.showcase-card img {
    width: 100%; height: auto; display: block;
    filter: brightness(0.8) saturate(1.1);
    transition: filter 0.4s ease;
}
.showcase-card:hover img {
    filter: brightness(0.95) saturate(1.2);
}
.showcase-label {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 6px 8px;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.55rem;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.7);
    text-align: center;
}

@media (max-width: 1100px) {
    .welcome-showcase { display: none; }
}

#welcome-card {
    position: relative;
    background: linear-gradient(135deg, rgba(10,15,25,0.95), rgba(15,20,35,0.95));
    border: 1px solid rgba(255,176,0,0.3);
    border-radius: 8px;
    padding: 24px 24px 20px;
    max-width: 420px;
    width: calc(100% - 32px);
    box-sizing: border-box;
    flex-shrink: 0;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 80px rgba(255,176,0,0.08);
    overflow: hidden;
    max-height: calc(100% - 40px);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
#welcome-card::-webkit-scrollbar { display: none; }

.welcome-glow {
    position: absolute; top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 50% 80%, rgba(255,176,0,0.06) 0%, transparent 50%);
    pointer-events: none;
    animation: welcome-rotate 20s linear infinite;
}
@keyframes welcome-rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.welcome-icon {
    font-size: 2.8rem;
    margin-bottom: 4px;
    animation: welcome-float 3s ease-in-out infinite;
}
@keyframes welcome-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.welcome-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 2rem;
    letter-spacing: 6px;
    color: var(--amber);
    text-shadow: 0 0 20px rgba(255,176,0,0.4);
    margin: 0 0 2px;
}

.welcome-subtitle {
    font-size: 0.72rem;
    letter-spacing: 2.5px;
    color: var(--neon-blue);
    opacity: 1;
    margin: 0 0 1px;
}

.welcome-credit {
    font-size: 0.55rem;
    letter-spacing: 1.5px;
    color: rgba(255,176,0,0.5);
    margin: 0 0 12px;
}

.welcome-lang-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 2;
}
.welcome-lang-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: var(--amber);
}
.welcome-lang-flag {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.7);
}

.welcome-features {
    display: flex; flex-direction: column; gap: 5px;
    margin-bottom: 14px;
    text-align: left;
}

.welcome-feat {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.88);
    display: flex; align-items: center; gap: 10px;
    padding: 6px 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
}

.welcome-feat i {
    width: 18px; text-align: center;
    color: var(--amber); font-size: 0.8rem;
}

.welcome-actions {
    display: flex; flex-direction: column; gap: 8px;
    margin-bottom: 14px;
}

.welcome-btn {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 2px;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid;
    transition: all 0.3s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}

.welcome-btn-primary {
    background: rgba(255,176,0,0.15);
    border-color: var(--amber);
    color: var(--amber);
}
.welcome-btn-primary:hover {
    background: var(--amber);
    color: #000;
    box-shadow: 0 0 30px rgba(255,176,0,0.4);
}

.welcome-btn-secondary {
    background: rgba(0,212,255,0.08);
    border-color: rgba(0,212,255,0.4);
    color: var(--neon-blue);
}
.welcome-btn-secondary:hover {
    background: rgba(0,212,255,0.2);
    border-color: var(--neon-blue);
    box-shadow: 0 0 20px rgba(0,212,255,0.2);
}

.welcome-remember {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.35);
    display: flex; align-items: center; justify-content: center; gap: 6px;
    cursor: pointer; margin-bottom: 12px;
}
.welcome-remember input { accent-color: var(--amber); }

.welcome-footer {
    font-size: 0.58rem;
    color: rgba(255,255,255,0.4);
    letter-spacing: 1px;
}

/* ── Interest Selector ── */
.welcome-interest {
    margin: 4px 0 18px;
}
.welcome-interest-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 2.5px;
    color: var(--neon-blue);
    margin-bottom: 10px;
    opacity: 0.7;
}
.welcome-interest-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.interest-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
}
.interest-btn:hover {
    background: rgba(255,176,0,0.08);
    border-color: rgba(255,176,0,0.4);
    transform: translateY(-1px);
}
.interest-btn.selected {
    background: rgba(255,176,0,0.15);
    border-color: var(--amber);
    box-shadow: 0 0 12px rgba(255,176,0,0.15);
}
.interest-btn-all {
    grid-column: 1 / -1;
}
.interest-icon {
    font-size: 1rem;
    flex-shrink: 0;
}
.interest-text {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.8);
}

/* -------------------------------------------------------
   TOUR BRIEFING PANEL
------------------------------------------------------- */
.tour-briefing-panel {
    position: fixed;
    bottom: 50px;
    left: 20px;
    z-index: 2000;
    width: 420px;
    max-width: calc(100vw - 30px);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    background: rgba(5, 10, 20, 0.95);
    border: 1px solid rgba(255,176,0,0.35);
    border-radius: 6px;
    padding: 16px 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8), 0 0 40px rgba(255,176,0,0.08);
    backdrop-filter: blur(15px);
    font-family: 'Share Tech Mono', monospace;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.tour-briefing-panel.hidden {
    opacity: 0;
    transform: translateY(30px);
    pointer-events: none;
}

.tour-briefing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    cursor: grab;
    user-select: none;
}
.tour-briefing-header:active { cursor: grabbing; }
.tour-briefing-header::before {
    content: '⠿';
    color: rgba(255,255,255,0.15);
    font-size: 0.7rem;
    margin-right: 6px;
    flex-shrink: 0;
}

.tour-step-num {
    font-size: 0.6rem;
    color: var(--amber);
    letter-spacing: 2px;
    opacity: 0.7;
}

.tour-title {
    font-size: 1rem;
    color: var(--amber);
    letter-spacing: 1.5px;
    margin: 0 0 8px;
    text-shadow: 0 0 10px rgba(255,176,0,0.3);
}

.tour-text {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.5;
    margin: 0 0 14px;
}

.tour-nav {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.tour-nav-btn {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 1.5px;
    padding: 6px 14px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.6);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex; align-items: center; gap: 5px;
}
.tour-nav-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.3);
    color: #fff;
}

.tour-nav-primary {
    background: rgba(255,176,0,0.12);
    border-color: rgba(255,176,0,0.4);
    color: var(--amber);
}
.tour-nav-primary:hover {
    background: rgba(255,176,0,0.25);
    border-color: var(--amber);
    box-shadow: 0 0 12px rgba(255,176,0,0.2);
}

/* Tour Image (Wikipedia Thumbnails) — Ken Burns Effect */
.tour-image-container {
    margin: 10px 0;
    text-align: center;
    animation: tour-img-fade 0.5s ease;
    overflow: hidden;
    border-radius: 4px;
}
.tour-image-container.hidden { display: none; }
.tour-image-container img {
    max-width: 200px;
    max-height: 130px;
    border-radius: 4px;
    border: 1px solid rgba(255,176,0,0.25);
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
    object-fit: cover;
    animation: kenburns 12s ease-in-out infinite alternate;
    transform-origin: center center;
}
.tour-image-caption {
    font-size: 0.5rem;
    color: rgba(255,255,255,0.35);
    letter-spacing: 1px;
    margin-top: 4px;
}
@keyframes tour-img-fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes kenburns {
    0% { transform: scale(1.0) translate(0, 0); }
    100% { transform: scale(1.18) translate(-3%, -2%); }
}

/* Story-Mode Progress Bar */
.tour-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,0.06);
    border-radius: 6px 6px 0 0;
    overflow: hidden;
    z-index: 1;
}
.tour-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--amber), #ff8800);
    border-radius: 3px;
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 0 8px rgba(255,176,0,0.5);
    position: relative;
}
.tour-progress-fill::after {
    content: '';
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 20px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4));
    animation: progress-shimmer 1.5s ease-in-out infinite;
}
@keyframes progress-shimmer {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* Typewriter Cursor */
.tour-text .typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 0.85em;
    background: var(--amber);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: cursor-blink 0.7s step-end infinite;
}
@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Tour Video Pilot */
.tour-video-container {
    margin: 10px 0;
    animation: tour-img-fade 0.5s ease;
}
.tour-video-container.hidden { display: none; }
.tour-video-badge {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.55rem;
    color: #ff3355;
    letter-spacing: 1.5px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tour-video-wrapper {
    position: relative;
    width: 100%;
    max-width: 280px;
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255,51,85,0.3);
    box-shadow: 0 4px 20px rgba(255,51,85,0.15);
    background: #111;
}
.tour-video-wrapper iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
    color-scheme: normal;
}

.tour-interact-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.6rem;
    color: var(--neon-blue);
    opacity: 0.7;
    padding: 8px 10px;
    margin: 8px 0;
    background: rgba(0,212,255,0.05);
    border: 1px solid rgba(0,212,255,0.12);
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.tour-interact-hint i {
    font-size: 0.75rem;
    animation: tour-point 1.5s ease-in-out infinite;
}

@keyframes tour-point {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.tour-briefing-panel.flying .tour-text {
    opacity: 0.3;
}

.tour-briefing-panel.flying .tour-title::after {
    content: ' ...';
    animation: blink 1s infinite;
}

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

@media (max-width: 768px) {
    .tour-briefing-panel {
        bottom: calc(var(--mobile-nav-h) + 10px);
        left: 10px;
        width: calc(100vw - 20px);
        max-height: calc(100vh - var(--mobile-nav-h) - 60px);
    }
    #welcome-card {
        padding: 20px 16px 16px;
        max-height: calc(100% - 20px);
        max-height: calc(100dvh - 20px);
    }
    .welcome-title { font-size: 1.5rem; }
    #quick-links { display: none; }
}

/* -------------------------------------------------------
   QUICK LINKS (bottom-left corner)
------------------------------------------------------- */
#quick-links {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 501;
    display: flex;
    justify-content: center;
    gap: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    border-top: 1px solid rgba(255,255,255,0.08);
    border-radius: 0;
    overflow: hidden;
    pointer-events: auto;
    height: 28px;
}

#quick-links a {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.55rem;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.45);
    text-decoration: none;
    text-transform: uppercase;
    padding: 0 12px;
    display: flex;
    align-items: center;
    height: 28px;
    gap: 5px;
    transition: all 0.2s;
    border-right: 1px solid rgba(255,255,255,0.06);
}

#quick-links a:last-child {
    border-right: none;
}

#quick-links a:hover {
    color: var(--amber);
    background: rgba(255,176,0,0.08);
}

#quick-links a i {
    font-size: 0.55rem;
    opacity: 0.7;
}

#demo-tour-link {
    color: rgba(0, 212, 255, 0.5) !important;
}
#demo-tour-link:hover {
    color: var(--cyan) !important;
    background: rgba(0, 212, 255, 0.08) !important;
}

#live-clock {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.55rem;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.7);
    padding: 0 12px;
    height: 28px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}

/* -------------------------------------------------------
   LAYER LEGEND (temperature / SST overlays)
------------------------------------------------------- */
#layer-legend {
    position: fixed;
    bottom: 32px;
    left: 10px;
    z-index: 500;
    background: rgba(5, 10, 20, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 5px;
    padding: 8px 12px;
    min-width: 180px;
    pointer-events: none;
}
.legend-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.55rem;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 5px;
}
.legend-bar {
    height: 6px;
    border-radius: 3px;
    width: 100%;
    margin-bottom: 3px;
}
.legend-labels {
    display: flex;
    justify-content: space-between;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.48rem;
    color: rgba(255,255,255,0.3);
    letter-spacing: 0.5px;
}

/* -------------------------------------------------------
   FEEDBACK WIDGET
------------------------------------------------------- */
#feedback-widget {
    position: fixed;
    bottom: 30px;
    right: 10px;
    z-index: 2500;
}

#feedback-toggle {
    display: none;
}
#feedback-toggle:hover {
    transform: scale(1.08);
    background: rgba(255,176,0,0.12);
    border-color: rgba(255,176,0,0.4);
    color: var(--amber);
}

#feedback-panel {
    position: absolute;
    bottom: 54px; right: 0;
    width: 300px;
    background: rgba(5, 10, 20, 0.96);
    border: 1px solid rgba(255,176,0,0.3);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 12px 50px rgba(0,0,0,0.8), 0 0 30px rgba(255,176,0,0.06);
    backdrop-filter: blur(15px);
    font-family: 'Share Tech Mono', monospace;
    transition: all 0.35s cubic-bezier(0.19, 1, 0.22, 1);
}
#feedback-panel.hidden {
    opacity: 0;
    transform: translateY(15px) scale(0.95);
    pointer-events: none;
}

.feedback-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,176,0,0.2);
}
.feedback-title {
    font-size: 0.7rem;
    color: var(--amber);
    letter-spacing: 2px;
}
.feedback-close-btn {
    background: transparent; border: none;
    color: rgba(255,255,255,0.4); cursor: pointer;
    font-size: 0.9rem; transition: color 0.2s;
}
.feedback-close-btn:hover { color: #fff; }

.feedback-section { margin-bottom: 12px; }
.feedback-label {
    display: block;
    font-size: 0.6rem;
    color: rgba(255,255,255,0.5);
    letter-spacing: 1px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

/* Star Rating */
.star-rating {
    display: flex; gap: 4px;
}
.star {
    font-size: 1.4rem;
    color: rgba(255,255,255,0.15);
    cursor: pointer;
    transition: all 0.15s;
}
.star:hover, .star.hover { color: rgba(255,176,0,0.6); transform: scale(1.15); }
.star.active { color: var(--amber); text-shadow: 0 0 8px rgba(255,176,0,0.4); }
.star-label {
    font-size: 0.55rem;
    color: var(--amber);
    margin-left: 8px;
    letter-spacing: 1px;
    opacity: 0.7;
}

/* Form inputs */
.feedback-select, .feedback-input, .feedback-textarea {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    color: #ddd;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    padding: 7px 9px;
    transition: border-color 0.2s;
    outline: none;
}
.feedback-select:focus, .feedback-input:focus, .feedback-textarea:focus {
    border-color: rgba(255,176,0,0.4);
}
.feedback-select option {
    background: #111; color: #ddd;
}
.feedback-textarea { resize: vertical; min-height: 36px; }

/* Actions */
.feedback-actions {
    display: flex; flex-direction: column; gap: 6px;
    margin-top: 14px;
}
.feedback-submit-btn {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    padding: 10px;
    border: 1px solid rgba(255,176,0,0.4);
    background: rgba(255,176,0,0.12);
    color: var(--amber);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.feedback-submit-btn:hover {
    background: var(--amber);
    color: #000;
    box-shadow: 0 0 20px rgba(255,176,0,0.3);
}
.feedback-bug-link {
    font-size: 0.55rem;
    color: rgba(255,255,255,0.35);
    text-decoration: none;
    text-align: center;
    letter-spacing: 1px;
    padding: 4px;
    transition: color 0.2s;
}
.feedback-bug-link:hover { color: var(--neon-blue); }

.feedback-footer {
    font-size: 0.45rem;
    color: rgba(255,255,255,0.2);
    text-align: center;
    margin-top: 10px;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    #feedback-panel {
        width: calc(100vw - 30px);
        right: -5px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   GEN Z VISUAL EFFECTS — Particles, Transitions, Ripples
   ═══════════════════════════════════════════════════════════════ */

/* ── Ambient Particle Canvas ── */
#particle-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 1;
    opacity: 0.4;
}

/* ── Tour Transition Blur Overlay ── */
#tour-transition-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 9;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(0,8,20,0.6) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}
#tour-transition-overlay.active {
    opacity: 1;
}

/* ── Earthquake Pulse Ripple ── */
@keyframes eq-ripple {
    0% { opacity: 0.7; transform: scale(1); }
    100% { opacity: 0; transform: scale(3); }
}

/* ── Map Cinematic Vignette ── */
#map::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(ellipse at center, transparent 55%, rgba(0,5,15,0.35) 100%);
}

/* ── Typewriter cursor blink ── */
.typewriter-cursor {
    animation: blink-cursor 0.7s step-end infinite;
}
@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ── Sidebar Utility Bar ── */
.sidebar-utility-bar {
    display: flex;
    gap: 4px;
    padding: 8px 0 4px;
    margin-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.util-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 4px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px;
    color: rgba(255,255,255,0.45);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.55rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
}
.util-btn i {
    font-size: 0.85rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.util-btn:hover {
    background: rgba(0,212,255,0.08);
    border-color: rgba(0,212,255,0.3);
    color: var(--cyan);
}
.util-btn:hover i {
    opacity: 1;
}
.util-btn:first-child:hover {
    border-color: rgba(255,180,0,0.3);
    color: var(--amber);
}
.util-btn:first-child:hover i {
    color: var(--amber);
}

/* -------------------------------------------------------
   GEOQUIZ — Setup, Panel, Choices, Results
------------------------------------------------------- */
.quiz-setup { padding: 4px 0; }
.quiz-btn-row { display:flex; gap:5px; flex-wrap:wrap; margin-top:4px; }
.quiz-cat-btn, .quiz-diff-btn {
    background: rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.75); font-family:'Share Tech Mono',monospace;
    font-size:.6rem; padding:5px 10px; border-radius:4px; cursor:pointer;
    transition: all .2s; position: relative;
}
.quiz-cat-btn:hover, .quiz-diff-btn:hover {
    border-color:rgba(255,153,0,0.5); color:#ff9900;
    background: rgba(255,153,0,0.08);
}
.quiz-cat-btn.active, .quiz-diff-btn.active {
    background:rgba(255,153,0,0.15); border-color:rgba(255,153,0,0.5); color:#ff9900;
}
/* Emoji-only category buttons — larger */
.quiz-cat-btn[data-cat]:not([data-cat="all"]) {
    font-size: .85rem; padding: 4px 10px; line-height: 1;
}
/* Tooltip styling */
.quiz-cat-btn[title]:hover::after, .quiz-diff-btn[title]:hover::after {
    content: attr(title);
    position: absolute; bottom: calc(100% + 6px); left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9); color: rgba(255,255,255,0.9);
    font-size: .5rem; padding: 3px 8px; border-radius: 3px;
    white-space: nowrap; pointer-events: none;
    border: 1px solid rgba(255,176,0,0.3);
    letter-spacing: 1px;
    z-index: 200;
}
.quiz-start-btn {
    width:100%; padding:10px; background:rgba(255,153,0,0.15);
    border:1px solid rgba(255,153,0,0.5); color:#ff9900;
    font-family:'Share Tech Mono',monospace; font-size:.7rem; font-weight:700;
    letter-spacing:2px; border-radius:5px; cursor:pointer;
    transition: all .2s;
}
.quiz-start-btn:hover { background:rgba(255,153,0,0.3); transform:scale(1.02); }

/* Quiz session panel */
.quiz-panel {
    position: fixed; top:50%; left:50%; transform:translate(-50%,-50%);
    width: min(420px, 92vw); max-height:80vh; overflow-y:auto;
    background: rgba(8,12,20,0.97); border:1px solid rgba(255,153,0,0.3);
    border-radius:10px; padding:20px; z-index:9999;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 20px rgba(255,153,0,0.1);
    font-family:'Share Tech Mono',monospace; color:#e0e0e0;
    transition: all 0.35s ease;
}
/* Locate mode: move panel to left side so map is fully clickable */
.quiz-panel.locate-mode {
    top: 100px; left: 14px; transform: none;
    width: min(320px, 45vw); max-height: 60vh;
}
@media (max-width: 768px) {
    .quiz-panel.locate-mode {
        top: auto; bottom: 70px; left: 8px; right: 8px;
        width: auto; max-height: 35vh;
    }
}
.quiz-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
.quiz-label { color:#ff9900; font-size:.8rem; font-weight:700; letter-spacing:2px; }
.quiz-progress { font-size:.6rem; opacity:.5; }
.quiz-timer { font-size:.65rem; color:#ff3355; font-weight:700; }
.quiz-progressbar { height:3px; background:rgba(255,255,255,0.1); border-radius:2px; margin-bottom:15px; }
.quiz-progressbar-fill { height:100%; background:linear-gradient(90deg,#ff9900,#ff5500); border-radius:2px; transition:width .3s; }
.quiz-question { font-size:.78rem; line-height:1.5; margin-bottom:15px; color:#fff; }
.quiz-choice {
    display:block; width:100%; text-align:left; padding:10px 12px; margin-bottom:6px;
    background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.12);
    border-radius:6px; color:#ccc; font-family:'Share Tech Mono',monospace;
    font-size:.68rem; cursor:pointer; transition:all .15s;
}
.quiz-choice:hover:not(:disabled) { border-color:rgba(255,153,0,0.4); background:rgba(255,153,0,0.06); color:#fff; }
.quiz-choice-letter { color:#ff9900; font-weight:700; margin-right:6px; }
.quiz-choice.quiz-correct { border-color:#00ff88 !important; background:rgba(0,255,136,0.1) !important; color:#00ff88 !important; }
.quiz-choice.quiz-wrong { border-color:#ff3355 !important; background:rgba(255,51,85,0.1) !important; color:#ff3355 !important; }
.quiz-locate-hint { text-align:center; padding:20px; font-size:.75rem; color:#ff9900; animation:pulse 1.5s infinite; }
.quiz-locate-feedback { text-align:center; padding:10px; margin-top:10px; font-size:.8rem; }
.quiz-explanation { padding:8px 10px; margin-top:8px; background:rgba(0,212,255,0.06); border-left:2px solid rgba(0,212,255,0.3); font-size:.6rem; color:rgba(255,255,255,0.6); line-height:1.4; border-radius:0 4px 4px 0; }
.quiz-hint-wrap { text-align:center; margin-top:8px; }
.quiz-hint-btn { background:none; border:1px solid rgba(255,255,255,0.1); color:rgba(255,255,255,0.4); font-size:.55rem; padding:4px 10px; border-radius:4px; cursor:pointer; font-family:'Share Tech Mono',monospace; }
.quiz-hint-btn:hover { border-color:rgba(0,212,255,0.3); color:#0ff; }
.quiz-next-btn {
    display:block; width:100%; margin-top:12px; padding:10px;
    background:rgba(255,153,0,0.12); border:1px solid rgba(255,153,0,0.4);
    color:#ff9900; font-family:'Share Tech Mono',monospace; font-size:.7rem;
    font-weight:700; letter-spacing:2px; border-radius:5px; cursor:pointer;
    transition:all .2s;
}
.quiz-next-btn:hover { background:rgba(255,153,0,0.25); }
/* Results */
.quiz-results { text-align:center; }
.quiz-results-title { font-size:1rem; font-weight:700; color:#ff9900; margin-bottom:10px; letter-spacing:2px; }
.quiz-score-big { font-size:1.8rem; font-weight:700; color:#fff; margin-bottom:8px; }
.quiz-rank { font-size:.85rem; margin:10px 0; }
.quiz-meta { font-size:.6rem; opacity:.5; margin:4px 0; }
.quiz-actions { display:flex; gap:8px; margin-top:15px; justify-content:center; }
.quiz-action-btn {
    padding:8px 16px; background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.15);
    color:#ccc; font-family:'Share Tech Mono',monospace; font-size:.6rem;
    border-radius:5px; cursor:pointer; transition:all .2s;
}
.quiz-action-btn:hover { border-color:rgba(255,153,0,0.4); color:#ff9900; }

/* ── QUIZ HUD ── */
.quiz-hud { top: 180px; z-index: 102; }
.quiz-hud:hover {
    max-height: 400px; width: 320px;
    box-shadow: 0 0 30px var(--amber-dim);
    overflow-y: auto;
    z-index: 103;
}
.quiz-hud-body { padding: 4px 10px 10px; }

@media (max-width: 768px) {
    .quiz-hud { top: auto; bottom: 70px; left: auto; right: 8px; width: 240px; }
    .quiz-hud:hover { width: 300px; }
}

/* Tour NEW badges */
.tour-new-badge {
    position: absolute; top: 3px; right: 6px;
    background: rgba(0,212,255,0.2);
    color: var(--neon-blue);
    padding: 1px 5px;
    font-size: .45rem;
    border-radius: 2px;
    letter-spacing: 1px;
    font-family: 'Share Tech Mono', monospace;
    font-weight: 700;
}
.cat-new-indicator {
    color: var(--neon-blue);
    font-size: .55rem;
    opacity: .8;
}

/* ── TOURS HUD ── */
.tours-hud { top: 112px; z-index: 101; }
.tours-hud:hover {
    max-height: 85vh; width: 320px;
    box-shadow: 0 0 30px var(--amber-dim);
    overflow-y: auto;
    /* Überschreibt quiz-hud wenn Tours aufgeht */
    z-index: 110;
}
.tours-hud-body {
    padding: 4px 10px 10px;
}

@media (max-width: 768px) {
    .tours-hud { display: none; }
}
/* iPad/touch: prevent sticky :hover */
@media (hover: none) and (pointer: coarse) {
    .tours-hud:hover { max-height: 50px; width: 280px; overflow: hidden; box-shadow: none; z-index: 101; }
    .tours-hud.touch-open { max-height: 85vh !important; overflow-y: auto !important; width: 320px !important; box-shadow: 0 0 30px var(--amber-dim) !important; z-index: 110 !important; }
}
