/* ═══════════════════════════════════════════════════════════════
   Fighting.AI — War Room / Command Center Theme
   Photorealistic satellite map + military HUD aesthetic
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@300;400;500;600;700&family=Share+Tech+Mono&family=Exo+2:wght@300;400;500;600;700&display=swap');

:root {
    --hud-bg: rgba(8, 12, 20, 0.92);
    --hud-bg-solid: #080c14;
    --hud-panel: rgba(12, 18, 32, 0.95);
    --hud-border: rgba(40, 80, 140, 0.35);
    --hud-border-bright: rgba(60, 130, 220, 0.5);
    --hud-glow: rgba(60, 140, 255, 0.15);
    --hud-text: #c8d8e8;
    --hud-text-dim: #6a7a8a;
    --hud-accent: #3a9bff;
    --hud-accent-warm: #ff9c2a;
    --hud-danger: #ff3a3a;
    --hud-success: #2aff6a;
    --hud-warning: #ffd02a;
    --hud-cyan: #2af0ff;
    --scan-line: rgba(60, 140, 255, 0.03);
    --font-hud: 'Rajdhani', 'Segoe UI', sans-serif;
    --font-mono: 'Share Tech Mono', 'Consolas', monospace;
    --font-display: 'Exo 2', 'Rajdhani', sans-serif;
}

/* ── Base ──────────────────────────────────────────────────── */

body.game-body {
    background: var(--hud-bg-solid);
    color: var(--hud-text);
    font-family: var(--font-hud);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Subtle animated scan-line overlay for military feel */
body.game-body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        var(--scan-line) 2px,
        var(--scan-line) 4px
    );
    pointer-events: none;
    z-index: 9999;
    opacity: 0.4;
}

/* ── Navbar — Command Bar ─────────────────────────────────── */

.navbar-dark {
    background: linear-gradient(180deg, rgba(6, 10, 18, 0.98), rgba(10, 16, 28, 0.95)) !important;
    border-bottom: 1px solid var(--hud-border) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5), inset 0 -1px 0 var(--hud-border);
    font-family: var(--font-hud);
    letter-spacing: 0.5px;
}

.navbar-brand {
    font-family: var(--font-display) !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--hud-accent-warm), #ff6a2a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

.nav-link {
    font-family: var(--font-hud) !important;
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--hud-text-dim) !important;
    transition: all 0.2s ease;
    padding: 0.5rem 0.75rem !important;
}

.nav-link:hover, .nav-link.text-info {
    color: var(--hud-accent) !important;
    text-shadow: 0 0 8px rgba(60, 155, 255, 0.3);
}

/* ── Cards — HUD Panels ───────────────────────────────────── */

.card.bg-dark {
    background: var(--hud-panel) !important;
    border: 1px solid var(--hud-border) !important;
    border-radius: 4px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(60, 130, 220, 0.08);
    backdrop-filter: blur(8px);
}

.card-header.bg-dark {
    background: linear-gradient(180deg, rgba(15, 25, 45, 0.9), rgba(10, 18, 35, 0.9)) !important;
    border-bottom: 1px solid var(--hud-border) !important;
    font-family: var(--font-hud);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
}

/* Glow borders for emphasis */
.card.border-warning, .border-warning {
    border-color: rgba(255, 160, 40, 0.4) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 15px rgba(255, 160, 40, 0.08);
}

.card.border-danger, .border-danger {
    border-color: rgba(255, 58, 58, 0.4) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 15px rgba(255, 58, 58, 0.08);
}

.card.border-success, .border-success {
    border-color: rgba(42, 255, 106, 0.4) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 15px rgba(42, 255, 106, 0.06);
}

.card.border-info, .border-info {
    border-color: rgba(42, 240, 255, 0.4) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 15px rgba(42, 240, 255, 0.06);
}

/* ── Tables ───────────────────────────────────────────────── */

.table-dark {
    --bs-table-bg: transparent;
    --bs-table-border-color: rgba(40, 80, 140, 0.2);
    font-family: var(--font-hud);
    font-size: 0.88rem;
}

.table-dark thead th {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.78rem;
    color: var(--hud-text-dim);
    border-bottom: 1px solid var(--hud-border-bright) !important;
}

.table-dark td {
    border-color: rgba(40, 80, 140, 0.15);
    padding: 0.4rem 0.5rem;
}

.table-hover > tbody > tr:hover {
    --bs-table-hover-bg: rgba(60, 140, 255, 0.06);
}

/* ── Progress Bars — Energy Meters ────────────────────────── */

.progress {
    background: rgba(20, 30, 50, 0.8);
    border-radius: 2px;
    border: 1px solid rgba(40, 80, 140, 0.2);
    overflow: hidden;
}

.progress-bar.bg-success {
    background: linear-gradient(90deg, #1a8a3e, var(--hud-success)) !important;
    box-shadow: 0 0 8px rgba(42, 255, 106, 0.3);
}

.progress-bar.bg-warning {
    background: linear-gradient(90deg, #b87a10, var(--hud-warning)) !important;
    box-shadow: 0 0 8px rgba(255, 208, 42, 0.3);
}

.progress-bar.bg-danger {
    background: linear-gradient(90deg, #8a1a1a, var(--hud-danger)) !important;
    box-shadow: 0 0 8px rgba(255, 58, 58, 0.3);
}

.progress-bar.bg-info {
    background: linear-gradient(90deg, #0a6a8a, var(--hud-cyan)) !important;
    box-shadow: 0 0 8px rgba(42, 240, 255, 0.3);
}

.progress-bar.bg-primary {
    background: linear-gradient(90deg, #1a3a8a, var(--hud-accent)) !important;
    box-shadow: 0 0 8px rgba(60, 155, 255, 0.3);
}

/* ── Buttons — Tactical Controls ──────────────────────────── */

.btn {
    font-family: var(--font-hud);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.82rem;
    border-radius: 3px;
    transition: all 0.15s ease;
}

.btn-warning, .btn-warning:hover {
    background: linear-gradient(180deg, #ff9c2a, #e08520) !important;
    border-color: #ff9c2a !important;
    color: #000 !important;
    box-shadow: 0 2px 10px rgba(255, 156, 42, 0.3);
}

.btn-warning:hover {
    box-shadow: 0 2px 20px rgba(255, 156, 42, 0.5);
    transform: translateY(-1px);
}

.btn-outline-warning {
    border-color: rgba(255, 156, 42, 0.5) !important;
    color: var(--hud-accent-warm) !important;
}

.btn-outline-warning:hover {
    background: rgba(255, 156, 42, 0.12) !important;
    border-color: var(--hud-accent-warm) !important;
    box-shadow: 0 0 15px rgba(255, 156, 42, 0.2);
}

.btn-outline-info {
    border-color: rgba(42, 240, 255, 0.4) !important;
    color: var(--hud-cyan) !important;
}

.btn-outline-info:hover {
    background: rgba(42, 240, 255, 0.08) !important;
    box-shadow: 0 0 12px rgba(42, 240, 255, 0.15);
}

.btn-outline-danger {
    border-color: rgba(255, 58, 58, 0.4) !important;
    color: var(--hud-danger) !important;
}

.btn-outline-danger:hover {
    background: rgba(255, 58, 58, 0.08) !important;
    box-shadow: 0 0 12px rgba(255, 58, 58, 0.15);
}

.btn-outline-success {
    border-color: rgba(42, 255, 106, 0.4) !important;
    color: var(--hud-success) !important;
}

.btn-outline-light {
    border-color: rgba(200, 216, 232, 0.25) !important;
    color: var(--hud-text) !important;
}

.btn-outline-light:hover {
    background: rgba(200, 216, 232, 0.06) !important;
}

.btn-outline-secondary {
    border-color: var(--hud-border) !important;
    color: var(--hud-text-dim) !important;
}

/* ── Map Container ────────────────────────────────────────── */

#gameMap, #setupMap {
    background: #0a1020;
}

/* Vignette overlay on the map for depth */
#gameMap::after, #setupMap::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(8, 12, 20, 0.4) 100%);
    pointer-events: none;
    z-index: 500;
}

/* Map mode control panel */
.position-absolute.bg-dark {
    background: var(--hud-panel) !important;
    border: 1px solid var(--hud-border) !important;
    backdrop-filter: blur(8px);
}

/* ── Sidebar — Intelligence Console ───────────────────────── */

.col-lg-3.bg-dark {
    background: linear-gradient(180deg, var(--hud-panel), rgba(8, 14, 26, 0.98)) !important;
    border-left: 1px solid var(--hud-border) !important;
}

/* Section headers in sidebar */
.col-lg-3 h6 {
    font-family: var(--font-hud);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.75rem;
}

/* Stats labels */
.col-lg-3 small.text-secondary {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Stats values */
.col-lg-3 small.text-light,
.col-lg-3 span.text-light {
    font-family: var(--font-mono);
}

/* ── Event Feed — Intel Stream ────────────────────────────── */

.border-start.border-2 {
    transition: all 0.2s ease;
    padding: 0.5rem !important;
    margin-bottom: 0.5rem !important;
    background: rgba(15, 25, 45, 0.4);
    border-radius: 0 3px 3px 0;
}

.border-start.border-2:hover {
    background: rgba(30, 50, 80, 0.4);
}

.border-start.border-2.border-danger {
    border-color: var(--hud-danger) !important;
    background: rgba(255, 58, 58, 0.04);
}

.border-start.border-2.border-warning {
    border-color: var(--hud-accent-warm) !important;
    background: rgba(255, 156, 42, 0.04);
}

.border-start.border-2.border-info {
    border-color: var(--hud-cyan) !important;
    background: rgba(42, 240, 255, 0.04);
}

/* Event type tags */
.text-info {
    color: var(--hud-cyan) !important;
    font-family: var(--font-mono);
}

/* ── Tabs — Console Tabs ──────────────────────────────────── */

.nav-tabs {
    border-bottom: 1px solid var(--hud-border) !important;
}

.nav-tabs .nav-link {
    font-family: var(--font-hud);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
    color: var(--hud-text-dim) !important;
    border-color: transparent !important;
    padding: 0.6rem 1rem;
    background: transparent !important;
    transition: all 0.2s;
}

.nav-tabs .nav-link.active {
    color: var(--hud-accent) !important;
    background: var(--hud-panel) !important;
    border-color: var(--hud-border) var(--hud-border) transparent !important;
    box-shadow: 0 -2px 8px rgba(60, 155, 255, 0.1);
}

.nav-tabs .nav-link:hover:not(.active) {
    color: var(--hud-text) !important;
    border-color: transparent !important;
    background: rgba(60, 140, 255, 0.05) !important;
}

.tab-content {
    background: var(--hud-panel) !important;
    border-color: var(--hud-border) !important;
}

/* ── Badges — Status Indicators ───────────────────────────── */

.badge {
    font-family: var(--font-mono);
    font-weight: 500;
    letter-spacing: 0.5px;
    font-size: 0.7rem;
    padding: 0.3em 0.6em;
    border-radius: 2px;
}

.badge.bg-secondary {
    background: rgba(106, 122, 138, 0.25) !important;
    color: var(--hud-text-dim);
    border: 1px solid rgba(106, 122, 138, 0.3);
}

.badge.bg-info {
    background: rgba(42, 240, 255, 0.15) !important;
    color: var(--hud-cyan);
    border: 1px solid rgba(42, 240, 255, 0.3);
}

.badge.bg-success {
    background: rgba(42, 255, 106, 0.15) !important;
    color: var(--hud-success);
    border: 1px solid rgba(42, 255, 106, 0.3);
}

.badge.bg-danger {
    background: rgba(255, 58, 58, 0.15) !important;
    color: var(--hud-danger);
    border: 1px solid rgba(255, 58, 58, 0.3);
}

.badge.bg-warning {
    background: rgba(255, 208, 42, 0.15) !important;
    color: var(--hud-warning) !important;
    border: 1px solid rgba(255, 208, 42, 0.3);
}

/* ── Headings — Display Text ──────────────────────────────── */

h1, h2, h3, h4, h5, h6, .display-3 {
    font-family: var(--font-display);
}

.text-warning {
    color: var(--hud-accent-warm) !important;
}

.text-info {
    color: var(--hud-cyan) !important;
}

.text-danger {
    color: var(--hud-danger) !important;
}

.text-success {
    color: var(--hud-success) !important;
}

.text-light {
    color: var(--hud-text) !important;
}

.text-secondary {
    color: var(--hud-text-dim) !important;
}

/* ── Landing Page ─────────────────────────────────────────── */

.display-3 {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 4px;
    background: linear-gradient(135deg, var(--hud-accent-warm), #ff5a2a, var(--hud-warning));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(255, 156, 42, 0.3));
}

.lead {
    font-family: var(--font-hud);
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ── Country List ─────────────────────────────────────────── */

.country-list-item {
    font-size: 0.82rem;
    padding: 0.3rem 0.5rem;
    font-family: var(--font-hud);
    border-color: var(--hud-border) !important;
    color: var(--hud-text-dim) !important;
    transition: all 0.15s ease;
}

.country-list-item:hover {
    background: rgba(60, 140, 255, 0.08) !important;
    color: var(--hud-text) !important;
    border-color: var(--hud-border-bright) !important;
}

.country-list-item.active {
    background: linear-gradient(135deg, rgba(255, 156, 42, 0.2), rgba(255, 90, 42, 0.15)) !important;
    color: var(--hud-accent-warm) !important;
    border-color: var(--hud-accent-warm) !important;
    box-shadow: 0 0 10px rgba(255, 156, 42, 0.15);
}

/* ── Forms — Control Inputs ───────────────────────────────── */

.form-control.bg-dark,
.form-select.bg-dark {
    background: rgba(10, 18, 32, 0.9) !important;
    color: var(--hud-text) !important;
    border-color: var(--hud-border) !important;
    font-family: var(--font-hud);
    border-radius: 3px;
}

.form-control.bg-dark::placeholder {
    color: var(--hud-text-dim);
}

.form-control.bg-dark:focus,
.form-select.bg-dark:focus {
    border-color: var(--hud-accent) !important;
    box-shadow: 0 0 0 3px rgba(60, 155, 255, 0.12), 0 0 15px rgba(60, 155, 255, 0.08);
}

.form-label {
    font-family: var(--font-hud);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.78rem;
}

/* ── Footer ───────────────────────────────────────────────── */

footer {
    background: linear-gradient(180deg, rgba(10, 16, 28, 0.95), var(--hud-bg-solid)) !important;
    border-top: 1px solid var(--hud-border) !important;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--hud-text-dim) !important;
}

/* ── Leaflet Overrides ────────────────────────────────────── */

.leaflet-container {
    background: #040810 !important;
}

/* Country name labels */
.country-label {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

.country-label-text {
    font-family: var(--font-hud);
    font-weight: 600;
    color: rgba(200, 216, 232, 0.85);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.9), 0 0 12px rgba(0, 0, 0, 0.7), 0 1px 3px rgba(0, 0, 0, 0.9);
    white-space: nowrap;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.leaflet-popup-content-wrapper {
    background: var(--hud-panel);
    color: var(--hud-text);
    border: 1px solid var(--hud-border-bright);
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(60, 155, 255, 0.1);
    backdrop-filter: blur(12px);
}

.leaflet-popup-tip {
    background: var(--hud-panel);
    border: 1px solid var(--hud-border);
}

.leaflet-tooltip {
    background: var(--hud-panel);
    color: var(--hud-text);
    border: 1px solid var(--hud-border-bright);
    padding: 4px 10px;
    font-family: var(--font-hud);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
}

.leaflet-tooltip-top::before { border-top-color: var(--hud-panel); }
.leaflet-tooltip-bottom::before { border-bottom-color: var(--hud-panel); }
.leaflet-tooltip-left::before { border-left-color: var(--hud-panel); }
.leaflet-tooltip-right::before { border-right-color: var(--hud-panel); }

.leaflet-control-zoom a {
    background: var(--hud-panel) !important;
    color: var(--hud-text) !important;
    border-color: var(--hud-border) !important;
}

.leaflet-control-attribution {
    background: rgba(8, 12, 20, 0.7) !important;
    color: var(--hud-text-dim) !important;
    font-size: 0.6rem;
}

.leaflet-control-attribution a {
    color: var(--hud-text-dim) !important;
}

/* ── Scrollbar ────────────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--hud-bg-solid); }
::-webkit-scrollbar-thumb { background: rgba(60, 130, 220, 0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(60, 130, 220, 0.4); }

/* ── Alerts ───────────────────────────────────────────────── */

.alert-info {
    background: rgba(42, 240, 255, 0.08);
    border-color: rgba(42, 240, 255, 0.3);
    color: var(--hud-cyan);
}

.alert-success {
    background: rgba(42, 255, 106, 0.08);
    border-color: rgba(42, 255, 106, 0.3);
    color: var(--hud-success);
}

/* ── Leaderboard highlight ────────────────────────────────── */

.table-warning {
    --bs-table-bg: rgba(255, 156, 42, 0.08) !important;
    --bs-table-border-color: rgba(255, 156, 42, 0.15) !important;
}

/* ── Power score cards on Country Details ──────────────────── */

.card.text-center .fs-3,
.card.text-center .fs-4 {
    font-family: var(--font-mono);
}

/* ── Animated Progress Bars ───────────────────────────────── */

.progress-bar {
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Turn Processing Overlay ─────────────────────────────── */

.turn-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(4, 8, 16, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.turn-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.turn-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(60, 130, 220, 0.2);
    border-top: 3px solid var(--hud-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.turn-overlay .turn-text {
    font-family: var(--font-hud);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--hud-text);
    margin-top: 1.5rem;
}

.turn-overlay .turn-subtext {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--hud-text-dim);
    margin-top: 0.5rem;
    letter-spacing: 1px;
}

/* ── Toast Notifications ─────────────────────────────────── */

.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 11000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.game-toast {
    background: var(--hud-panel);
    border: 1px solid var(--hud-border-bright);
    border-radius: 4px;
    padding: 12px 20px;
    color: var(--hud-text);
    font-family: var(--font-hud);
    font-size: 0.85rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 350px;
}

.game-toast.show { transform: translateX(0); }
.game-toast.toast-success { border-left: 3px solid var(--hud-success); }
.game-toast.toast-warning { border-left: 3px solid var(--hud-accent-warm); }
.game-toast.toast-danger { border-left: 3px solid var(--hud-danger); }
.game-toast.toast-info { border-left: 3px solid var(--hud-cyan); }

.game-toast .toast-title {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.78rem;
    margin-bottom: 2px;
}

.game-toast .toast-body {
    color: var(--hud-text-dim);
    font-size: 0.8rem;
}

/* ── Rich Map Tooltip ────────────────────────────────────── */

.leaflet-tooltip.hud-tooltip {
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
}

.hud-tooltip-inner {
    background: var(--hud-panel);
    border: 1px solid var(--hud-border-bright);
    border-radius: 4px;
    padding: 10px 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    min-width: 200px;
}

.hud-tooltip-inner .tt-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--hud-text);
    margin-bottom: 6px;
}

.hud-tooltip-inner .tt-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
}

.hud-tooltip-inner .tt-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--hud-text-dim);
}

.hud-tooltip-inner .tt-value {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--hud-text);
    text-align: right;
}

.hud-tooltip-inner .tt-relation {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: 2px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tt-relation.rel-player { background: rgba(255, 156, 42, 0.2); color: var(--hud-accent-warm); border: 1px solid rgba(255, 156, 42, 0.4); }
.tt-relation.rel-ally { background: rgba(42, 255, 106, 0.15); color: var(--hud-success); border: 1px solid rgba(42, 255, 106, 0.3); }
.tt-relation.rel-war { background: rgba(255, 58, 58, 0.15); color: var(--hud-danger); border: 1px solid rgba(255, 58, 58, 0.3); }
.tt-relation.rel-neutral { background: rgba(106, 122, 138, 0.15); color: var(--hud-text-dim); border: 1px solid rgba(106, 122, 138, 0.3); }

/* ── Country Info Panel ──────────────────────────────────── */

#countryInfoPanel {
    transition: all 0.3s ease;
}

#countryInfoPanel .country-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

/* ── Map Legend ───────────────────────────────────────────── */

.map-legend {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: var(--hud-panel);
    border: 1px solid var(--hud-border);
    border-radius: 4px;
    padding: 8px 16px;
    backdrop-filter: blur(8px);
    display: flex;
    gap: 16px;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.map-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--hud-text-dim);
}

.map-legend-swatch {
    width: 14px;
    height: 10px;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ── Event Feed Icons ────────────────────────────────────── */

.event-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-family: var(--font-mono);
    font-weight: 700;
    margin-right: 6px;
    flex-shrink: 0;
}

.event-icon.ev-combat { background: rgba(255, 58, 58, 0.15); color: var(--hud-danger); border: 1px solid rgba(255, 58, 58, 0.3); }
.event-icon.ev-diplo { background: rgba(42, 240, 255, 0.12); color: var(--hud-cyan); border: 1px solid rgba(42, 240, 255, 0.25); }
.event-icon.ev-mil { background: rgba(255, 156, 42, 0.15); color: var(--hud-accent-warm); border: 1px solid rgba(255, 156, 42, 0.3); }
.event-icon.ev-econ { background: rgba(42, 255, 106, 0.12); color: var(--hud-success); border: 1px solid rgba(42, 255, 106, 0.25); }
.event-icon.ev-intel { background: rgba(60, 155, 255, 0.12); color: var(--hud-accent); border: 1px solid rgba(60, 155, 255, 0.25); }
.event-icon.ev-pol { background: rgba(200, 216, 232, 0.1); color: var(--hud-text); border: 1px solid rgba(200, 216, 232, 0.2); }

/* ── Quick Action Hover Effect ───────────────────────────── */

.quick-action-btn {
    position: relative;
    overflow: hidden;
}

.quick-action-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.05) 50%, transparent 60%);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.quick-action-btn:hover::after {
    transform: translateX(100%);
}

/* ── Stat Value Animation ────────────────────────────────── */

.stat-value {
    transition: color 0.3s ease;
}

.stat-value.changed {
    animation: statFlash 1s ease;
}

@keyframes statFlash {
    0%, 100% { color: inherit; }
    50% { color: var(--hud-warning); text-shadow: 0 0 8px rgba(255, 208, 42, 0.5); }
}

/* ── War Pulse (map borders) ─────────────────────────────── */

@keyframes warPulse {
    0%, 100% { stroke-opacity: 0.5; }
    50% { stroke-opacity: 1; }
}

.country-at-war {
    animation: warPulse 2s ease-in-out infinite;
}

/* ── Intelligence News Ticker ────────────────────────────── */

.intel-ticker {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    height: 36px;
    display: flex;
    align-items: center;
    background: linear-gradient(180deg, rgba(4, 8, 16, 0.85), rgba(4, 8, 16, 0.95));
    border-top: 1px solid var(--hud-border);
    backdrop-filter: blur(8px);
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 0.72rem;
}

.intel-ticker-label {
    flex-shrink: 0;
    padding: 0 14px;
    color: var(--hud-accent-warm);
    font-weight: 700;
    letter-spacing: 2px;
    font-size: 0.68rem;
    border-right: 1px solid var(--hud-border);
    display: flex;
    align-items: center;
    gap: 6px;
    height: 100%;
    background: rgba(255, 156, 42, 0.05);
}

.intel-ticker-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--hud-accent-warm);
    animation: tickerPulse 1.5s ease-in-out infinite;
}

@keyframes tickerPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 4px var(--hud-accent-warm); }
    50% { opacity: 0.3; box-shadow: none; }
}

.intel-ticker-track {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    /* Fade edges */
    mask-image: linear-gradient(to right, transparent 0%, black 3%, black 97%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 3%, black 97%, transparent 100%);
}

.intel-ticker-content {
    display: flex;
    align-items: center;
    white-space: nowrap;
    animation: tickerScroll var(--ticker-duration, 60s) linear infinite;
    gap: 0;
    padding-left: 100%;
}

.intel-ticker-content:hover {
    animation-play-state: paused;
}

@keyframes tickerScroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.intel-ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 32px 0 0;
    color: var(--hud-text);
}

.intel-ticker-tag {
    font-weight: 700;
    letter-spacing: 0.5px;
    font-size: 0.65rem;
}

.intel-ticker-title {
    color: var(--hud-text);
    font-weight: 600;
}

.intel-ticker-sep {
    color: var(--hud-border-bright);
    margin: 0 2px;
}

.intel-ticker-desc {
    color: var(--hud-text-dim);
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Map Activity Animations ─────────────────────────────── */

/* War zone pulsing rings */
.map-pulse-war {
    background: none !important;
    border: none !important;
}

.pulse-ring {
    position: absolute;
    top: 50%; left: 50%;
    width: 10px; height: 10px;
    margin: -5px 0 0 -5px;
    border: 2px solid rgba(255, 58, 58, 0.7);
    border-radius: 50%;
    animation: pulseExpand 2.8s ease-out infinite;
}

@keyframes pulseExpand {
    0%   { width: 10px; height: 10px; margin: -5px 0 0 -5px; opacity: 0.9; }
    100% { width: 60px; height: 60px; margin: -30px 0 0 -30px; opacity: 0; }
}

/* Explosion bursts */
.map-explosion {
    background: none !important;
    border: none !important;
}

.explosion-burst {
    position: absolute;
    top: 50%; left: 50%;
    width: 6px; height: 6px;
    margin: -3px 0 0 -3px;
    background: radial-gradient(circle, #fff 0%, #ff9c2a 30%, #ff3a3a 60%, transparent 100%);
    border-radius: 50%;
    animation: explode 1.6s ease-out forwards;
}

.explosion-burst.small {
    animation: explode 1s ease-out forwards;
}

@keyframes explode {
    0%   { width: 6px; height: 6px; margin: -3px 0 0 -3px; opacity: 1; }
    20%  { width: 24px; height: 24px; margin: -12px 0 0 -12px; opacity: 1; }
    50%  { width: 32px; height: 32px; margin: -16px 0 0 -16px; opacity: 0.7; }
    100% { width: 40px; height: 40px; margin: -20px 0 0 -20px; opacity: 0; }
}

/* Projectile dots (missiles/strikes) */
.map-projectile {
    background: none !important;
    border: none !important;
}

.projectile-dot {
    width: 6px; height: 6px;
    background: #ff5533;
    border-radius: 50%;
    box-shadow: 0 0 8px 3px rgba(255, 85, 51, 0.8), 0 0 20px 6px rgba(255, 85, 51, 0.3);
    animation: projectileGlow 0.3s ease-in-out infinite alternate;
}

@keyframes projectileGlow {
    0%   { box-shadow: 0 0 6px 2px rgba(255, 85, 51, 0.8), 0 0 14px 4px rgba(255, 85, 51, 0.3); }
    100% { box-shadow: 0 0 10px 4px rgba(255, 85, 51, 1), 0 0 24px 8px rgba(255, 85, 51, 0.5); }
}

/* Supply dots (troop/logistics movement) */
.map-supply-dot {
    background: none !important;
    border: none !important;
}

.supply-dot {
    width: 5px; height: 5px;
    background: #2aff6a;
    border-radius: 50%;
    box-shadow: 0 0 6px 2px rgba(42, 255, 106, 0.6);
    animation: supplyPulse 0.5s ease-in-out infinite alternate;
}

@keyframes supplyPulse {
    0%   { opacity: 0.6; }
    100% { opacity: 1; }
}

/* Strike trail animated dashes */
.strike-trail {
    animation: dashMove 1.5s linear infinite;
}

.supply-trail {
    animation: dashMove 2s linear infinite;
}

@keyframes dashMove {
    to { stroke-dashoffset: -20; }
}

/* Player radar sweep */
.map-radar {
    background: none !important;
    border: none !important;
}

.radar-sweep {
    position: absolute;
    top: 50%; left: 50%;
    width: 100px; height: 100px;
    margin: -50px 0 0 -50px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(255, 156, 42, 0.15) 30deg,
        rgba(255, 156, 42, 0.05) 60deg,
        transparent 90deg
    );
    animation: radarSpin 3s linear infinite;
}

@keyframes radarSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.radar-ring {
    position: absolute;
    top: 50%; left: 50%;
    width: 60px; height: 60px;
    margin: -30px 0 0 -30px;
    border: 1px solid rgba(255, 156, 42, 0.15);
    border-radius: 50%;
}

.radar-ring.r2 {
    width: 100px; height: 100px;
    margin: -50px 0 0 -50px;
}

/* Ambient blinking dots */
.map-ambient-dot {
    background: none !important;
    border: none !important;
}

.ambient-blink {
    width: 4px; height: 4px;
    border-radius: 50%;
    animation: ambientBlink 2.5s ease-in-out infinite;
    box-shadow: 0 0 4px 1px currentColor;
}

@keyframes ambientBlink {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50%      { opacity: 1; transform: scale(1.2); }
}

/* ── Blitz Timer ─────────────────────────────────────────── */

.blitz-timer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 32px;
    padding: 0 8px;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--hud-text);
    background: rgba(12, 18, 32, 0.9);
    border: 1px solid var(--hud-border);
    border-radius: 4px;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.blitz-timer.blitz-warning {
    color: var(--hud-warning);
    border-color: rgba(255, 208, 42, 0.5);
    background: rgba(255, 208, 42, 0.08);
    animation: blitzPulse 1s ease-in-out infinite;
}

.blitz-timer.blitz-critical {
    color: var(--hud-danger);
    border-color: rgba(255, 58, 58, 0.6);
    background: rgba(255, 58, 58, 0.1);
    font-size: 1.3rem;
    animation: blitzPulse 0.5s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(255, 58, 58, 0.3);
}

@keyframes blitzPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* ── War Mode Explosion Effect ───────────────────────────── */

.warmode-explosion {
    background: none !important;
    border: none !important;
}

.warmode-blast {
    position: absolute;
    top: 50%; left: 50%;
    width: 10px; height: 10px;
    margin: -5px 0 0 -5px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0%, #ffcc00 20%, #ff6600 40%, #ff2200 60%, transparent 80%);
    animation: warmodeBlast 1.8s ease-out forwards;
    box-shadow: 0 0 30px 10px rgba(255, 100, 0, 0.6);
}

@keyframes warmodeBlast {
    0%   { width: 10px; height: 10px; margin: -5px 0 0 -5px; opacity: 1; box-shadow: 0 0 30px 10px rgba(255, 100, 0, 0.8); }
    15%  { width: 60px; height: 60px; margin: -30px 0 0 -30px; opacity: 1; box-shadow: 0 0 60px 20px rgba(255, 80, 0, 0.6); }
    30%  { width: 80px; height: 80px; margin: -40px 0 0 -40px; opacity: 0.9; background: radial-gradient(circle, #ffcc00 0%, #ff4400 40%, rgba(255,0,0,0.3) 70%, transparent 100%); }
    60%  { width: 100px; height: 100px; margin: -50px 0 0 -50px; opacity: 0.5; box-shadow: 0 0 40px 15px rgba(255, 50, 0, 0.3); }
    100% { width: 120px; height: 120px; margin: -60px 0 0 -60px; opacity: 0; box-shadow: none; }
}

/* ── Page-Load Entrance Animations ────────────────────────── */

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideLeft {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes barFill {
    from { width: 0 !important; }
}

@keyframes counterPulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.15); text-shadow: 0 0 10px currentColor; }
    100% { transform: scale(1); }
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 4px rgba(255, 58, 58, 0.2); }
    50%      { box-shadow: 0 0 18px rgba(255, 58, 58, 0.6), 0 0 40px rgba(255, 58, 58, 0.15); }
}

@keyframes scanDown {
    from { background-position: 0 -100%; }
    to   { background-position: 0 200%; }
}

@keyframes borderGlow {
    0%, 100% { border-color: rgba(255, 156, 42, 0.3); }
    50%      { border-color: rgba(255, 156, 42, 0.7); }
}

/* Progress bars animate on load */
.progress-bar {
    animation: barFill 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Stat values count-up flash */
.stat-value.animate-in {
    animation: counterPulse 0.6s ease 0.8s both;
}

/* Intelligence feed entries stagger in */
.intel-event {
    opacity: 0;
    animation: fadeSlideLeft 0.4s ease forwards;
}

/* Combat events get extra glow */
.intel-event.ev-critical {
    animation: fadeSlideLeft 0.4s ease forwards, glowPulse 2s ease-in-out 1s infinite;
}

/* Sidebar sections stagger in */
.sidebar-section {
    opacity: 0;
    animation: fadeSlideUp 0.5s ease forwards;
}

/* Active war badge pulses */
.badge.bg-danger.war-badge {
    animation: glowPulse 2.5s ease-in-out infinite;
}

/* Command bar scan line sweep */
.command-bar {
    position: relative;
    overflow: hidden;
}

.command-bar::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(60, 155, 255, 0.04) 50%, transparent 100%);
    background-size: 100% 200%;
    animation: scanDown 4s linear infinite;
    pointer-events: none;
}

/* Player country border glow on map */
.country-player {
    animation: borderGlow 3s ease-in-out infinite;
}

/* Key number hover interaction */
.key-number {
    transition: transform 0.2s ease, text-shadow 0.2s ease;
    cursor: default;
}

.key-number:hover {
    transform: scale(1.08);
    text-shadow: 0 0 12px currentColor;
}

/* Turn transition flash overlay */
.turn-flash {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(60, 155, 255, 0.08);
    pointer-events: none;
    opacity: 0;
    animation: turnFlash 1.5s ease forwards;
}

@keyframes turnFlash {
    0%   { opacity: 1; }
    100% { opacity: 0; }
}

/* Identity / Auth Pages ────────────────────────────────── */

.auth-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 3rem 1rem;
}

.auth-container.auth-wide {
    max-width: 560px;
}

.auth-title {
    font-family: var(--font-display);
    letter-spacing: 2px;
    text-transform: lowercase;
    color: var(--hud-warning);
}

.auth-subtitle {
    color: var(--hud-text-dim);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: lowercase;
}

.auth-container a:not(.btn) {
    color: var(--hud-accent);
    text-transform: lowercase;
    text-decoration: none;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

.auth-container a:not(.btn):hover {
    color: var(--hud-accent-warm);
    text-shadow: 0 0 8px rgba(60, 155, 255, 0.3);
}

.auth-container .btn {
    text-transform: lowercase;
}

.auth-container .form-label {
    color: var(--hud-text-dim);
}

.auth-container .card-header {
    background: linear-gradient(180deg, rgba(15, 25, 45, 0.9), rgba(10, 18, 35, 0.9));
    border-bottom: 1px solid var(--hud-border);
    font-family: var(--font-hud);
    font-weight: 600;
    text-transform: lowercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    color: var(--hud-accent-warm);
}

/* ── Responsive ───────────────────────────────────────────── */

/* ── Desktop sidebar ─────────────────────────────────────── */

.sidebar-console {
    height: calc(100vh - 60px);
    overflow-y: auto;
}

/* ── Tablet (< 992px) — sidebar stacks below map ────────── */

@media (max-width: 991.98px) {
    #gameMap { height: 55vh !important; }
    body.game-body::before { display: none; }

    .sidebar-console {
        height: auto;
        max-height: none;
        overflow-y: visible;
        border-left: none !important;
        border-top: 1px solid var(--hud-border);
    }

    .map-legend {
        flex-wrap: wrap;
        justify-content: center;
        font-size: 0.6rem;
        gap: 8px;
        padding: 5px 10px;
        bottom: 60px;
    }

    .intel-ticker { font-size: 0.65rem; height: 30px; }

    .toast-container { left: 10px; right: 10px; }
    .game-toast { max-width: 100%; }

    /* Stack overlay controls horizontally at bottom */
    .position-absolute .btn-group-vertical {
        flex-direction: row !important;
    }
    .position-absolute .btn-group-vertical .btn {
        font-size: 0.65rem;
        padding: 2px 8px;
    }
}

/* ── Phone (< 576px) — compact everything ────────────────── */

@media (max-width: 575.98px) {
    #gameMap { height: 45vh !important; }

    .command-bar {
        font-size: 0.75rem;
        padding: 4px 8px !important;
    }

    .command-bar .badge {
        font-size: 0.6rem;
        padding: 2px 5px;
    }

    .command-bar .btn {
        font-size: 0.7rem;
        padding: 3px 10px;
    }

    /* Sidebar sections tighter */
    .sidebar-console .p-3 {
        padding: 0.6rem !important;
    }

    .sidebar-console h6 {
        font-size: 0.8rem;
    }

    .sidebar-console .progress {
        height: 6px !important;
    }

    .sidebar-console .stat-value {
        font-size: 0.7rem;
    }

    /* Quick action buttons smaller */
    .quick-action-btn {
        font-size: 0.72rem;
        padding: 4px 8px;
    }

    /* Map controls compact */
    .map-legend {
        font-size: 0.55rem;
        gap: 6px;
        padding: 4px 8px;
        bottom: 50px;
    }

    .map-legend-swatch {
        width: 10px;
        height: 7px;
    }

    /* Go-to dropdown smaller */
    #gotoCountry {
        width: 150px !important;
        font-size: 0.65rem !important;
    }

    /* Overlay/basemap controls */
    .position-absolute .btn-group-vertical .btn,
    .position-absolute .btn-group-sm .btn {
        font-size: 0.6rem;
        padding: 1px 6px;
    }

    /* Intel ticker smaller */
    .intel-ticker { height: 26px; font-size: 0.6rem; }
    .intel-ticker-label { padding: 0 8px; font-size: 0.6rem; }

    /* Country info panel */
    #countryInfoPanel .country-detail-actions {
        gap: 4px;
    }
    #countryInfoPanel .btn {
        font-size: 0.68rem;
        padding: 3px 8px;
    }

    /* Key numbers */
    .key-number { font-size: 0.8rem; }

    /* Navbar brand smaller */
    .navbar-brand { font-size: 0.9rem !important; letter-spacing: 1px; }
    .nav-link { font-size: 0.75rem; padding: 0.4rem 0.5rem !important; }

    /* Auth pages */
    .auth-container { padding: 1.5rem 0.75rem; }

    /* HUD modal */
    .modal-dialog.modal-sm { margin: 0.5rem; }
}
