:root {
    --bg-base: #0a0f1a;
    --bg-surface: #111827;
    --bg-elevated: #1f2937;
    --bg-glass: rgba(17, 24, 39, 0.85);
    --border-glass: 1px solid rgba(255, 255, 255, 0.08);
    --border-accent: rgba(59, 130, 246, 0.5);
    --accent-primary: #3b82f6;
    --accent-secondary: #06b6d4;
    --accent-tertiary: #8b5cf6;
    --accent-glow: rgba(59, 130, 246, 0.2);
    --neon-cyan: #22d3ee;
    --neon-blue: #60a5fa;
    --neon-alert: #f43f5e;
    --risk-low: #10b981;
    --risk-med: #f59e0b;
    --risk-high: #ef4444;
    --risk-extreme: #dc2626;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #6b7280;
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-tech: 'Rajdhani', sans-serif;
    --panel-radius: 16px;
    --panel-glow: 0 0 40px rgba(59, 130, 246, 0.08);
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-ui);
}

/* Cinematic Map Canvas */
#map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background-color: #020617;
    /* Matches --bg-base */
}

/* HUD System */
.hud-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.pointer-events-auto {
    pointer-events: auto;
}

/* Header */
.hud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 12px 28px;
    border-radius: var(--panel-radius);
    border: var(--border-glass);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
}

.brand {
    font-family: var(--font-tech);
    font-weight: 700;
    font-size: 1.4rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand span {
    color: var(--accent-secondary);
}

.brand .scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--accent-glow), transparent);
    opacity: 0.3;
    pointer-events: none;
    animation: scan-line 4s linear infinite;
}

/* Mission Clock */
.mission-clock {
    font-family: var(--font-tech);
    font-size: 1.1rem;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 12px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-right: 20px;
    letter-spacing: 1px;
}

.system-status {
    display: flex;
    gap: 15px;
    font-size: 0.75rem;
    font-family: var(--font-tech);
    align-items: center;
}

.status-item {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-primary);
}

.status-dot.live {
    background: #ef4444;
    box-shadow: 0 0 12px #ef4444;
    animation: live-pulse 1.5s infinite;
}

@keyframes live-pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scan-line {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(100%);
    }
}

.hud-header .brand span {
    animation: text-flicker 3s infinite;
}

@keyframes text-flicker {

    0%,
    100% {
        opacity: 1;
    }

    92% {
        opacity: 1;
    }

    93% {
        opacity: 0.8;
    }

    94% {
        opacity: 1;
    }

    96% {
        opacity: 0.9;
    }

    97% {
        opacity: 1;
    }
}

/* Navigation */
.nav-links {
    display: flex;
    gap: 8px;
    margin-left: auto;
    margin-right: 24px;
    z-index: 100;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.25s var(--transition-smooth);
    border: 1px solid transparent;
    font-family: var(--font-tech);
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, 0.02);
}

.nav-link:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--text-primary);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

/* Left Panel */
.hud-left {
    position: absolute;
    top: 90px;
    left: 20px;
    bottom: 100px;
    width: 340px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    pointer-events: auto;
    padding-right: 4px;
}

.hud-left::-webkit-scrollbar {
    width: 4px;
}

.hud-left::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 10px;
}

/* Right Panel */
.hud-right {
    position: absolute;
    top: 90px;
    right: 20px;
    bottom: 100px;
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: auto;
}

.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: var(--border-glass);
    border-radius: var(--panel-radius);
    padding: 18px;
    box-shadow: var(--panel-glow), 0 4px 24px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s var(--transition-smooth), box-shadow 0.3s var(--transition-smooth), border-color 0.3s;
}

.glass-panel:hover {
    transform: translateY(-3px);
    box-shadow: var(--panel-glow), 0 12px 40px rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.12);
}

.panel-header {
    font-family: var(--font-tech);
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    align-items: center;
    letter-spacing: 1.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 10px;
}

.panel-subtitle {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: none;
    font-family: var(--font-ui);
    letter-spacing: 0;
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.8), rgba(31, 41, 55, 0.6));
    border-radius: 12px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(17, 24, 39, 0.9));
    border-color: var(--accent-primary);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-val {
    font-family: var(--font-tech);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 4px;
    letter-spacing: 0.5px;
}

/* Model Intelligence Panel Styles */
.model-intel-panel {
    border: 1px solid rgba(139, 92, 246, 0.2);
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.9), rgba(139, 92, 246, 0.05));
}

.model-intel-panel:hover {
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.1), 0 12px 40px rgba(0, 0, 0, 0.35);
}

.model-version {
    font-size: 0.6rem;
    padding: 3px 8px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(59, 130, 246, 0.2));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px;
    color: var(--accent-tertiary);
    font-family: var(--font-tech);
    letter-spacing: 1px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--risk-low);
    border-radius: 50%;
    animation: pulse-glow 2s ease-in-out infinite;
    box-shadow: 0 0 10px var(--risk-low);
}

@keyframes pulse-glow {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

.intel-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.intel-metric {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.2s;
}

.intel-metric:hover {
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.2);
}

.intel-metric-icon {
    font-size: 1.4rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.intel-metric-content {
    flex: 1;
    min-width: 0;
}

.intel-metric-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.intel-metric-value {
    font-family: var(--font-tech);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.model-accuracy-section {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.accuracy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.accuracy-header span:last-child {
    color: var(--risk-low);
    font-weight: 700;
    font-family: var(--font-tech);
}

.accuracy-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.accuracy-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-tertiary), var(--risk-low));
    border-radius: 3px;
    transition: width 1s var(--transition-smooth);
    box-shadow: 0 0 10px var(--risk-low);
}

.model-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.model-tag {
    font-size: 0.55rem;
    padding: 3px 8px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 4px;
    color: var(--neon-blue);
    font-family: var(--font-tech);
    letter-spacing: 0.5px;
}

/* Intel Table */
.intel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.intel-table td {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.intel-table tr:last-child td {
    border-bottom: none;
}

.intel-tag {
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.6rem;
    letter-spacing: 0.5px;
}

/* Timeline Player */
.hud-bottom {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    z-index: 100;
}

.player-bar {
    background: rgba(10, 15, 26, 0.9);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 24px;
    padding: 16px 36px;
    display: flex;
    align-items: center;
    gap: 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(59, 130, 246, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.play-btn-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s var(--transition-smooth);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

.play-btn-circle:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.8), inset 0 0 20px rgba(255, 255, 255, 0.4);
}

.play-btn-circle:active {
    transform: scale(0.95);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.8);
}

.timeline-track {
    flex: 1;
    position: relative;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    margin-top: 4px;
}

.timeline-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 3px;
    transition: width 0.4s var(--transition-smooth);
    box-shadow: 0 0 20px var(--accent-primary);
}

.timeline-track::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1), rgba(6, 182, 212, 0.1));
    z-index: -1;
}

.timeline-ticks {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding: 0 4px;
}

.tick {
    cursor: pointer;
    font-family: var(--font-tech);
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: all 0.2s;
    position: relative;
    text-align: center;
    width: 60px;
    /* Ensure labels have room to center */
}

.tick:hover {
    color: var(--text-primary);
}

.tick::before {
    content: '';
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
}

.tick.active {
    color: var(--accent-secondary);
    font-weight: 700;
    text-shadow: 0 0 10px rgba(20, 184, 166, 0.5);
}

.tick.active::before {
    background: var(--accent-secondary);
    height: 8px;
    top: -16px;
}

/* Right Tools removed */

/* Inspector removed */

/* Inputs */
#villageSelector {
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 8px;
    width: 100%;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
    font-family: var(--font-ui);
}

#villageSelector:focus {
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.2);
}

#villageSelector option {
    background: var(--bg-surface);
    color: var(--text-primary);
}

/* Rainfall Control */
.rainfall-control {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-width: 200px;
    transition: background 0.3s, border-color 0.3s;
}

.rainfall-control:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.control-label {
    font-family: var(--font-tech);
    font-size: 0.65rem;
    color: var(--accent-secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 600;
}

.control-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

#rainfallValue {
    font-family: var(--font-tech);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 45px;
    text-align: right;
}

/* Custom Range Slider */
#rainfallSlider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    transition: background 0.2s;
}

#rainfallSlider:hover {
    background: rgba(255, 255, 255, 0.25);
}

#rainfallSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--accent-secondary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
    transition: transform 0.2s, box-shadow 0.2s;
}

#rainfallSlider:hover::-webkit-slider-thumb {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.8);
}

#rainfallSlider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--accent-secondary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
    transition: transform 0.2s, box-shadow 0.2s;
}

#rainfallSlider:hover::-moz-range-thumb {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.8);
}

/* Simulation Meta */
.simulation-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.meta-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.meta-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: var(--font-tech);
    letter-spacing: 1px;
}

#timeDisplay {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-secondary);
    font-family: var(--font-tech);
}

/* Loading */
#loadingOverlay {
    position: fixed;
    inset: 0;
    background: var(--bg-base);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition: opacity 0.5s;
}

#loadingOverlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Tooltip & Info Icon */
.tooltip-container {
    position: relative;
    display: inline-block;
    margin-left: 8px;
    cursor: help;
}

.info-icon {
    font-size: 0.9rem;
    filter: grayscale(100%);
    transition: filter 0.2s;
}

.tooltip-container:hover .info-icon {
    filter: grayscale(0%);
}

.tooltip-content {
    visibility: hidden;
    width: 280px;
    background: rgba(15, 23, 42, 0.95);
    color: var(--text-secondary);
    text-transform: none;
    font-family: var(--font-ui);
    font-size: 0.75rem;
    line-height: 1.4;
    padding: 12px;
    border-radius: 8px;
    position: absolute;
    z-index: 100;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 10px;
    opacity: 0;
    transition: opacity 0.3s;
    border: 1px solid var(--border-glass);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.tooltip-container:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

.tooltip-content::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent rgba(15, 23, 42, 0.95) transparent;
}

/* Scanning Animation */
@keyframes scanning-bar {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        transform: translateY(300%);
        opacity: 0;
    }
}

.scanning-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan);
    animation: scanning-bar 2s linear infinite;
    pointer-events: none;
}

/* Tactical Panel Refinements */
.inspector-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 15px 0;
}

.inspector-item {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 6px;
    padding: 8px;
    position: relative;
    overflow: hidden;
}

.label-tiny {
    font-family: var(--font-tech);
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.val-mono {
    font-family: var(--font-tech);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Layer Control Icons */
.layer-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.9), rgba(31, 41, 55, 0.7));
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    padding: 10px 14px;
    border-radius: 10px;
    font-family: var(--font-tech);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.25s var(--transition-smooth);
    width: 100%;
    justify-content: flex-start;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.layer-btn:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(17, 24, 39, 0.95));
    border-color: var(--accent-primary);
    transform: translateX(4px);
}

.layer-btn.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(6, 182, 212, 0.15));
    border-color: var(--accent-primary);
    color: var(--text-primary);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2), inset 0 0 20px rgba(59, 130, 246, 0.05);
}

.layer-icon {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Risk Factor Tags */
.risk-factor-tag {
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(244, 63, 94, 0.1);
    color: #fda4af;
    border: 1px solid rgba(244, 63, 94, 0.2);
    font-family: var(--font-tech);
}

/* Population Risk Analysis Styles */
.pop-risk-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    transition: background 0.2s;
}

.pop-risk-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.pop-risk-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}

.pop-risk-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    flex: 1;
}

.pop-risk-count {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.priority-zone-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.15);
    transition: all 0.2s;
}

.priority-zone-card:hover {
    background: rgba(239, 68, 68, 0.15);
    transform: translateX(4px);
    border-color: rgba(239, 68, 68, 0.3);
}

.priority-zone-icon {
    font-size: 1.1rem;
}

.priority-zone-info {
    flex: 1;
}

.priority-zone-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.priority-zone-stats {
    font-size: 0.6rem;
    color: var(--text-muted);
}

/* Cluster Labels for Map */
.map-cluster-label {
    background: var(--bg-surface);
    color: var(--text-primary);
    padding: 2px 8px;
    border-radius: 12px;
    font-family: var(--font-tech);
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid var(--accent-primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    pointer-events: none;
}

/* Resource Allocation Optimizer Styles */
.coverage-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.resource-icon {
    font-size: 1.4rem;
    min-width: 32px;
    text-align: center;
}

.coverage-details {
    flex: 1;
}

.coverage-details strong {
    font-family: var(--font-tech);
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
}

.progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin: 4px 0;
}

.progress-bar {
    height: 100%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px currentColor;
}

.bg-success {
    background: #22c55e;
    color: #22c55e;
}

.bg-warning {
    background: #eab308;
    color: #eab308;
}

.bg-danger {
    background: #ef4444;
    color: #ef4444;
}

.coverage-details small {
    font-size: 0.6rem;
    color: var(--text-muted);
    display: block;
}

.alert-sm {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.7rem;
    margin-bottom: 6px;
    border-left: 3px solid transparent;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.2);
    border-left-color: #ef4444;
}

.alert-warning {
    background: rgba(234, 179, 8, 0.1);
    color: #fef08a;
    border-color: rgba(234, 179, 8, 0.2);
    border-left-color: #eab308;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #bfdbfe;
    border-color: rgba(59, 130, 246, 0.2);
    border-left-color: #3b82f6;
}

@media (max-width: 1200px) {
    .hud-container {
        padding: 14px;
    }

    .hud-header {
        padding: 12px 16px;
        gap: 12px;
        flex-wrap: wrap;
    }

    .nav-links {
        margin: 0;
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .hud-left,
    .hud-right {
        top: 96px;
        bottom: 132px;
        width: min(320px, calc(50vw - 24px));
    }

    .hud-bottom {
        width: min(960px, calc(100vw - 28px));
        bottom: 14px;
    }

    .player-bar {
        padding: 14px 18px;
        gap: 16px;
    }
}

@media (max-width: 900px) {
    body {
        overflow: auto;
    }

    .hud-container {
        position: relative;
        inset: auto;
        min-height: 100vh;
        gap: 12px;
        padding: 12px;
    }

    .hud-header,
    .hud-left,
    .hud-right,
    .hud-bottom {
        position: static;
        inset: auto;
        width: 100%;
        transform: none;
    }

    .hud-left,
    .hud-right {
        bottom: auto;
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .hud-bottom {
        margin-top: auto;
    }

    .player-bar {
        border-radius: 18px;
        flex-wrap: wrap;
        align-items: stretch;
    }

    .rainfall-control,
    .simulation-meta {
        min-width: 0;
        width: 100%;
    }

    .stat-grid,
    .intel-metrics-grid,
    .inspector-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tick {
        width: auto;
        flex: 1;
    }
}

@media (max-width: 640px) {
    .brand {
        font-size: 1.05rem;
        letter-spacing: 1.5px;
    }

    .glass-panel,
    .hud-header {
        padding: 14px;
        border-radius: 14px;
    }

    .stat-grid,
    .intel-metrics-grid,
    .inspector-grid {
        grid-template-columns: 1fr;
    }

    .player-bar {
        padding: 12px;
    }

    .timeline-ticks {
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .tick {
        min-width: 52px;
        font-size: 0.62rem;
    }
}

@media (max-width: 900px), (prefers-reduced-motion: reduce) {
    .glass-panel,
    .glass-panel:hover,
    .stat-card,
    .stat-card:hover,
    .layer-btn,
    .layer-btn:hover,
    .priority-zone-card,
    .priority-zone-card:hover,
    .play-btn-circle,
    .play-btn-circle:hover {
        transform: none;
    }

    .glass-panel,
    .hud-header,
    .player-bar {
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .brand .scan-line,
    .scanning-indicator,
    .pulse-dot {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
