/* ════════════════════════════════════════════════════════════════════
   HUD THEME — refined technical interface for every dashboard.
   Glass panels with hairline frames and corner brackets, thin technical
   type, monospaced figures, one restrained ice-cyan light. Visual only:
   colours, borders, type, shadows. Layout (position, size, display) is
   never touched, so nothing moves. ?theme=classic switches it off.
   Selectors carry :root body for specificity over styles that scripts
   inject later; visual properties use !important to beat inline colours.
   ════════════════════════════════════════════════════════════════════ */

:root {
    --hud-ink: #e4f3fb;                       /* primary text */
    --hud-ink-2: rgba(214, 236, 248, 0.72);   /* secondary text */
    --hud-ink-3: rgba(190, 220, 238, 0.46);   /* labels, hints */
    --hud-accent: #8fe6ff;                    /* ice cyan: the one light */
    --hud-accent-soft: rgba(143, 230, 255, 0.14);
    --hud-accent-glow: rgba(143, 230, 255, 0.35);
    --hud-warn: #ffc27a;
    --hud-good: #8ff5c2;
    --hud-bad: #ff8a8a;
    --hud-glass: rgba(6, 14, 22, 0.66);
    --hud-glass-2: rgba(10, 22, 34, 0.55);
    --hud-glass-deep: rgba(2, 7, 12, 0.94);
    --hud-line: rgba(160, 215, 240, 0.16);
    --hud-line-2: rgba(160, 215, 240, 0.30);
    --hud-tick: rgba(170, 230, 255, 0.75);
    --hud-sans: 'Inter Tight', 'Inter', 'Segoe UI', system-ui, sans-serif;
    --hud-mono: 'JetBrains Mono', 'Cascadia Mono', 'Consolas', monospace;
    --hud-blur: blur(16px) saturate(135%);
    --hud-radius: 2px;
    /* four corner brackets over the glass */
    --hud-brackets:
        linear-gradient(var(--hud-tick), var(--hud-tick)) left top / 12px 1px no-repeat,
        linear-gradient(var(--hud-tick), var(--hud-tick)) left top / 1px 12px no-repeat,
        linear-gradient(var(--hud-tick), var(--hud-tick)) right top / 12px 1px no-repeat,
        linear-gradient(var(--hud-tick), var(--hud-tick)) right top / 1px 12px no-repeat,
        linear-gradient(var(--hud-tick), var(--hud-tick)) left bottom / 12px 1px no-repeat,
        linear-gradient(var(--hud-tick), var(--hud-tick)) left bottom / 1px 12px no-repeat,
        linear-gradient(var(--hud-tick), var(--hud-tick)) right bottom / 12px 1px no-repeat,
        linear-gradient(var(--hud-tick), var(--hud-tick)) right bottom / 1px 12px no-repeat;
}

/* ── Type ─────────────────────────────────────────────────────────── */
:root body {
    font-family: var(--hud-sans) !important;
    color: var(--hud-ink);
    -webkit-font-smoothing: antialiased;
    font-feature-settings: 'tnum' 1, 'ss01' 1;
    letter-spacing: 0.01em;
}
:root body button, :root body input, :root body select, :root body textarea { font-family: var(--hud-sans) !important; }
:root body h1, :root body h2, :root body h3, :root body h4 {
    font-family: var(--hud-sans) !important;
    font-weight: 500 !important;
    letter-spacing: 0.18em !important;
    text-transform: uppercase;
    text-shadow: none !important;
    color: var(--hud-ink) !important;
}
:root body h2 { font-size: 15px !important; }
:root body h3, :root body h4 { font-size: 12px !important; color: var(--hud-ink-2) !important; }

/* figures read as instrument values */
:root body [id$="-credits"], :root body [id$="-materials"], :root body [id$="-fuel"], :root body [id$="-research"],
:root body [id*="-total"], :root body [id$="-ships"], :root body .value, :root body .stat-value, :root body .battle-stat-value,
:root body .pv-resource span:last-child, :root body .pmd-planet-stat .value, :root body #turn-number, :root body .tb-turn,
:root body .fleet-count-badge, :root body .pv-building-level {
    font-family: var(--hud-mono) !important;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em !important;
}
/* small labels: spaced capitals */
:root body .label, :root body .stat-label, :root body .pmd-planet-stat .label, :root body .pv-income-title,
:root body .param-category h3, :root body .battle-stat-label {
    text-transform: uppercase;
    letter-spacing: 0.16em !important;
    font-size: 10px !important;
    color: var(--hud-ink-3) !important;
}

/* ── Floating panels: glass, hairline frame, corner brackets ─────────── */
:root body #fleet-list-panel, :root body #selection-panel, :root body #help-panel, :root body #upgrade-panel,
:root body #music-widget, :root body #turn-bar, :root body #store-panel, :root body #spec, :root body .fleet-panel,
:root body .mp-panel, :root body .modal-content, :root body .arrival-dialogue-container, :root body .battle-end-content,
:root body .combat-pending-content, :root body .instructions-content, :root body #planet-view-build-panel,
:root body #planet-view-stats-panel, :root body #pv-scenario-panel, :root body #pv-result-content, :root body #pv-ai-assistant,
:root body .pv-surface-card, :root body #planet-naming-dialog, :root body .planet-rename-content, :root body .chat-panel,
:root body #planet-view-tooltip, :root body .hud-panel, :root body #game-alert > div, :root body #pv-ship-order > div,
:root body #tech-inventory-content, :root body #turn-summary-modal > div, :root body #prep-phase-ui {
    background: var(--hud-brackets), var(--hud-glass) !important;
    border: 1px solid var(--hud-line) !important;
    border-radius: var(--hud-radius) !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.035) !important;
    backdrop-filter: var(--hud-blur) !important;
    -webkit-backdrop-filter: var(--hud-blur) !important;
    color: var(--hud-ink) !important;
}

/* top and bottom bars: thin glass strips */
:root body #top-bar, :root body #bottom-toolbar {
    background: linear-gradient(180deg, rgba(4, 10, 16, 0.82), rgba(4, 10, 16, 0.62)) !important;
    border-color: var(--hud-line) !important;
    box-shadow: none !important;
    backdrop-filter: var(--hud-blur) !important;
    -webkit-backdrop-filter: var(--hud-blur) !important;
}

/* ── Full-screen dashboards: deep field with a faint measuring grid ─── */
:root body #fleet-manager, :root body #planet-manager-dashboard, :root body #battle-dashboard, :root body #tech-inventory-modal,
:root body #planet-management-modal, :root body #instructions-modal {
    background:
        radial-gradient(ellipse at 50% 0%, rgba(80, 170, 220, 0.10), transparent 60%),
        linear-gradient(rgba(150, 210, 240, 0.035) 1px, transparent 1px) 0 0 / 48px 48px,
        linear-gradient(90deg, rgba(150, 210, 240, 0.035) 1px, transparent 1px) 0 0 / 48px 48px,
        var(--hud-glass-deep) !important;
    backdrop-filter: blur(8px) !important;
}
:root body .fleet-manager-header, :root body .pmd-header, :root body .battle-dashboard-header {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid var(--hud-line) !important;
    box-shadow: none !important;
}

/* cards and sections inside dashboards: quieter glass, hairlines */
:root body .pmd-planet-card, :root body .pmd-summary-card, :root body .colony-card, :root body .faction-card,
:root body .faction-select-card, :root body .param-category, :root body .param-item, :root body .arrival-section,
:root body .fleet-list-item, :root body .pm-build-card, :root body .pm-structure-item, :root body .pm-queue-item,
:root body .pv-building-item, :root body .pv-structure-card, :root body .pv-scenario-option, :root body .pv-income-section,
:root body .battle-stat, :root body .battle-log-entry, :root body .instruction-section, :root body .merge-fleet-column,
:root body .game-mode-option, :root body .pmd-planet-stat, :root body .pmd-planet-income, :root body .pmd-planet-environment,
:root body .analysis-summary, :root body .analysis-note, :root body .discovery-narrative, :root body .ai-narrative-container,
:root body #store-panel .st-item, :root body .chat-msg, :root body .pv-resources-bar, :root body .build-capacity-info,
:root body #pv-current-structure, :root body .pv-participation-cost, :root body .bonus-item, :root body .change-item {
    background: var(--hud-glass-2) !important;
    border: 1px solid var(--hud-line) !important;
    border-radius: var(--hud-radius) !important;
    box-shadow: none !important;
}
:root body .pmd-planet-card:hover, :root body .fleet-list-item:hover, :root body .pv-building-item:hover,
:root body .pv-scenario-option:hover, :root body .faction-select-card:hover, :root body .game-mode-option:hover {
    border-color: var(--hud-line-2) !important;
    background: linear-gradient(90deg, var(--hud-accent-soft), transparent 70%), var(--hud-glass-2) !important;
}
:root body .fleet-list-item.selected, :root body .game-mode-option.selected, :root body .faction-select-card.selected {
    border-color: var(--hud-accent) !important;
    box-shadow: inset 2px 0 0 var(--hud-accent) !important;
}

/* ── Controls ─────────────────────────────────────────────────────── */
:root body .toolbar-btn, :root body .tb-btn, :root body #turn-bar .tb-btn, :root body .modal-btn, :root body .arrival-btn,
:root body .battle-action-btn, :root body .battle-btn, :root body .battle-end-btn, :root body .battle-replay-btn,
:root body .fleet-action-btn, :root body .build-btn, :root body .build-outpost-btn, :root body .choice-btn,
:root body .pv-action-btn-small, :root body .pv-view-btn, :root body .pv-upgrade-btn, :root body .pv-category-btn,
:root body .pv-assistant-btn, :root body .pv-surface-generate-btn, :root body .pmd-planet-btn, :root body .pmd-close,
:root body .fleet-manager-close, :root body .modal-close, :root body .arrival-close-btn, :root body .chat-send-btn,
:root body .ai-speed-btn, :root body .music-ctrl-btn, :root body .merge-arrow-btn, :root body .merge-fleet-done,
:root body .faction-load-btn, :root body #pv-close-btn, :root body #pv-exit-galaxy-btn, :root body #pv-result-close,
:root body #pv-rotation-toggle, :root body #store-panel button, :root body #spec button, :root body #prep-phase-ui .prep-btn,
:root body #game-alert button, :root body #pv-ship-order button, :root body .speed-btn, :root body .fleet-tab, :root body .chat-tab {
    background: rgba(143, 230, 255, 0.04) !important;
    border: 1px solid var(--hud-line-2) !important;
    border-radius: var(--hud-radius) !important;
    color: var(--hud-ink) !important;
    font-family: var(--hud-sans) !important;
    font-weight: 500 !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase;
    font-size: 11px !important;
    text-shadow: none !important;
    box-shadow: none !important;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease !important;
}
:root body .toolbar-btn:hover, :root body .tb-btn:hover, :root body .modal-btn:hover, :root body .arrival-btn:hover,
:root body .battle-action-btn:hover, :root body .battle-btn:hover, :root body .battle-end-btn:hover, :root body .fleet-action-btn:hover,
:root body .build-btn:hover, :root body .choice-btn:hover, :root body .pv-action-btn-small:hover, :root body .pv-view-btn:hover,
:root body .pv-upgrade-btn:hover, :root body .pv-category-btn:hover, :root body .pmd-planet-btn:hover, :root body #store-panel button:hover,
:root body #game-alert button:hover, :root body #pv-ship-order button:hover, :root body .speed-btn:hover, :root body .fleet-tab:hover,
:root body .chat-tab:hover, :root body .pv-assistant-btn:hover, :root body .pv-surface-generate-btn:hover, :root body #prep-phase-ui .prep-btn:hover {
    background: var(--hud-accent-soft) !important;
    border-color: var(--hud-accent) !important;
    box-shadow: 0 0 0 1px rgba(143, 230, 255, 0.15), 0 0 18px var(--hud-accent-glow) !important;
}
/* primary actions: filled with light */
:root body #end-turn-btn, :root body .tb-end, :root body #turn-bar .tb-end, :root body .modal-btn.primary, :root body .arrival-btn.primary,
:root body .battle-action-btn.attack, :root body #prep-phase-ui .prep-start-btn, :root body .pmd-planet-btn.primary,
:root body .fleet-tab.active, :root body .speed-btn.active, :root body .chat-tab.active, :root body .pv-category-btn.active,
:root body #pv-ship-go, :root body #game-alert button, :root body .merge-fleet-done {
    background: linear-gradient(180deg, rgba(143, 230, 255, 0.92), rgba(110, 200, 235, 0.92)) !important;
    border-color: rgba(200, 245, 255, 0.9) !important;
    color: #04121a !important;
    font-weight: 600 !important;
    box-shadow: 0 0 22px rgba(143, 230, 255, 0.30) !important;
}
/* danger actions */
:root body .arrival-btn.attack, :root body .battle-btn.retreat, :root body .modal-btn.engage, :root body .battle-action-btn.cancel {
    border-color: rgba(255, 138, 138, 0.5) !important;
    color: var(--hud-bad) !important;
    background: rgba(255, 138, 138, 0.06) !important;
}
:root body button:disabled, :root body button[disabled] { opacity: 0.35 !important; box-shadow: none !important; }

:root body input[type="text"], :root body input[type="number"], :root body input[type="search"], :root body textarea,
:root body select, :root body .mp-input, :root body .chat-input, :root body #fleet-search-input, :root body .pmd-search-box input {
    background: rgba(2, 8, 13, 0.7) !important;
    border: 1px solid var(--hud-line-2) !important;
    border-radius: var(--hud-radius) !important;
    color: var(--hud-ink) !important;
    box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.4) !important;
}
:root body input:focus, :root body textarea:focus, :root body select:focus {
    outline: none !important;
    border-color: var(--hud-accent) !important;
    box-shadow: 0 0 0 1px var(--hud-accent-glow) !important;
}

/* bars and meters: one-pixel tracks, light fills */
:root body .pv-bar, :root body .pv-progress-bar, :root body .ai-progress-bar, :root body .coherence-bar, :root body .capacity-bar,
:root body #loading-bar, :root body .battle-loading-bar, :root body .pv-construction-bar {
    background: rgba(160, 215, 240, 0.10) !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
:root body .pv-bar-fill, :root body .pv-progress-fill, :root body .ai-progress-fill, :root body .capacity-fill, :root body #loading-progress,
:root body .battle-loading-bar-fill, :root body #battle-loading-bar-fill {
    background: linear-gradient(90deg, rgba(143, 230, 255, 0.55), var(--hud-accent)) !important;
    box-shadow: 0 0 10px var(--hud-accent-glow) !important;
    border-radius: 0 !important;
}

/* badges and tags: outlined capsules become flat chips */
:root body .pmd-structure-badge, :root body .pmd-fleet-badge, :root body .feature-tag, :root body .trait-tag, :root body .bonus-mini,
:root body .outpost-badge, :root body .fleet-count-badge, :root body .pv-mult-item, :root body .tb-age, :root body .chat-tab-badge {
    background: rgba(143, 230, 255, 0.06) !important;
    border: 1px solid var(--hud-line) !important;
    border-radius: 1px !important;
    color: var(--hud-ink-2) !important;
    font-size: 10px !important;
    letter-spacing: 0.06em !important;
    box-shadow: none !important;
}

/* the old neon cyan text becomes the quieter ice light; old glows go */
:root body [style*="color: #00d4ff"], :root body [style*="color:#00d4ff"] { color: var(--hud-accent) !important; }
:root body [style*="text-shadow"] { text-shadow: none !important; }

/* thin scrollbars */
:root body ::-webkit-scrollbar { width: 6px; height: 6px; }
:root body ::-webkit-scrollbar-track { background: transparent !important; }
:root body ::-webkit-scrollbar-thumb { background: rgba(160, 215, 240, 0.22) !important; border-radius: 0 !important; }
:root body ::-webkit-scrollbar-thumb:hover { background: rgba(160, 215, 240, 0.4) !important; }

/* overlays behind modals: darker, blurred */
:root body .arrival-dialogue-overlay, :root body #game-alert, :root body #pv-ship-order, :root body #turn-summary-modal,
:root body #battle-loading-overlay, :root body #turn-processing-overlay {
    background: rgba(1, 4, 8, 0.72) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
}

/* a scanning hairline across the turn bar (fixed, so the line anchors to it) */
@keyframes hud-scan { 0% { background-position: -40% 0; } 100% { background-position: 140% 0; } }
:root body #turn-bar::after {
    content: '';
    position: absolute; left: 0; right: 0; top: 0; height: 1px; pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(190, 240, 255, 0.85), transparent) no-repeat;
    background-size: 30% 1px;
    animation: hud-scan 6s linear infinite;
}
@media (prefers-reduced-motion: reduce) { :root body #turn-bar::after { animation: none; } }

/* ── Pass 2: panels found on review ───────────────────────────────── */
:root body #planet-view-buildings-panel {
    background: var(--hud-brackets), var(--hud-glass) !important;
    border: 1px solid var(--hud-line) !important;
    border-radius: var(--hud-radius) !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55) !important;
    backdrop-filter: var(--hud-blur) !important;
    -webkit-backdrop-filter: var(--hud-blur) !important;
}
/* panel headers: a thin rule, no colour band */
:root body .pv-surface-card-header, :root body .pv-buildings-header, :root body .pv-stats-header, :root body .chat-header,
:root body .pv-assistant-header, :root body .music-widget-header, :root body .fleet-panel-header, :root body .modal-header,
:root body .arrival-header, :root body .pmd-section-header {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid var(--hud-line) !important;
    box-shadow: none !important;
    color: var(--hud-ink-2) !important;
    text-transform: uppercase;
    letter-spacing: 0.16em !important;
    font-size: 11px !important;
    font-weight: 500 !important;
}
:root body .chat-title, :root body .pv-surface-card-header span, :root body .pv-buildings-header span { color: var(--hud-ink-2) !important; letter-spacing: 0.16em !important; }
/* titles: the planet name and dialog titles in light ink, not neon */
:root body #pv-planet-name, :root body .arrival-title, :root body #new-arrival-name, :root body .battle-end-title, :root body #battle-end-title,
:root body #pv-result-title, :root body .fleet-manager-header h2, :root body .pmd-header h2, :root body .battle-dashboard-header h2 {
    color: var(--hud-ink) !important;
    font-weight: 400 !important;
    letter-spacing: 0.14em !important;
    text-shadow: none !important;
}
:root body #pv-planet-name { text-transform: uppercase; font-size: 15px !important; }
/* the wallet badge and the voice toggle */
:root body #akashic-credits-badge {
    background: var(--hud-glass) !important;
    border: 1px solid var(--hud-line-2) !important;
    border-radius: var(--hud-radius) !important;
    box-shadow: none !important;
    backdrop-filter: var(--hud-blur) !important;
}
:root body #akashic-credits-badge * { color: var(--hud-ink) !important; text-shadow: none !important; letter-spacing: 0.12em !important; }
:root body #voice-toggle, :root body #music-toggle-btn {
    background: var(--hud-glass) !important;
    border: 1px solid var(--hud-line-2) !important;
    border-radius: 50% !important;
    box-shadow: none !important;
    backdrop-filter: var(--hud-blur) !important;
}
:root body #voice-toggle:hover { border-color: var(--hud-accent) !important; box-shadow: 0 0 16px var(--hud-accent-glow) !important; }
/* section accent text (old neon / amber headings) settles to the palette */
:root body .pv-stat, :root body .pv-stats-grid { color: var(--hud-ink) !important; }
:root body [style*="color: #ffaa00"], :root body [style*="color:#ffaa00"] { color: var(--hud-warn) !important; }
:root body [style*="color: #00ff88"], :root body [style*="color:#00ff88"] { color: var(--hud-good) !important; }
:root body input[type="range"] { accent-color: var(--hud-accent); }

/* ── Pass 3: dashboard figures and section titles ─────────────────── */
/* headline figures: thin, large, light ink (instrument readouts) */
:root body .pmd-stat-value, :root body .pmd-summary-card .value, :root body .pmd-planet-stat .value,
:root body .fleet-stat-value, :root body .battle-stat-value, :root body .fm-stat-value, :root body #battle-end-overlay .value {
    color: var(--hud-ink) !important;
    font-family: var(--hud-mono) !important;
    font-weight: 400 !important;
    text-shadow: 0 0 18px rgba(143, 230, 255, 0.18) !important;
}
:root body .pmd-stat-value { font-size: 22px !important; font-weight: 300 !important; }
:root body .pmd-stat-label, :root body .pmd-summary-card .label { color: var(--hud-ink-3) !important; letter-spacing: 0.18em !important; text-transform: uppercase; font-size: 9px !important; }
/* section titles inside cards */
:root body .pmd-planet-structures-title, :root body .pmd-income-title, :root body .pmd-fleets-title, :root body .pmd-section-title,
:root body .pv-section-title, :root body .fm-section-title, :root body .param-category h3, :root body .arrival-section h4 {
    color: var(--hud-ink-2) !important;
    text-transform: uppercase;
    letter-spacing: 0.16em !important;
    font-size: 10px !important;
    font-weight: 500 !important;
    text-shadow: none !important;
}
/* modifier band: a quiet line of italic text, no colour block */
:root body .pmd-planet-modifiers {
    background: transparent !important;
    border: none !important;
    border-top: 1px solid var(--hud-line) !important;
    border-bottom: 1px solid var(--hud-line) !important;
    color: var(--hud-ink-3) !important;
    letter-spacing: 0.08em !important;
}
:root body .pmd-planet-header, :root body .pmd-planet-card > div:first-child { background: transparent !important; border-color: var(--hud-line) !important; }
:root body .pmd-planet-type { background: transparent !important; border: 1px solid var(--hud-line) !important; color: var(--hud-ink-3) !important; border-radius: 1px !important; }
/* status line and side-panel titles in ink, not neon */
:root body #status-text, :root body #status, :root body .status-message, :root body .fleet-panel-title, :root body .toolbar-turn-number,
:root body .fleet-list-header h3, :root body #fleet-list-panel h3 { color: var(--hud-ink-2) !important; text-shadow: none !important; letter-spacing: 0.1em !important; }
