/* ═══════════════════════════════════════════════════════
   GeoDominium — Global Strategy Game Stylesheet
   ═══════════════════════════════════════════════════════ */

/* Twemoji: ensure flag emoji images display inline at proper size */
img.emoji { height: 1.1em; width: 1.1em; margin: 0 .05em 0 .1em; vertical-align: -0.15em; display: inline; }

:root {
    --bg-dark: #0a0e17;
    --bg-panel: #111827;
    --bg-panel-alt: #1a2332;
    --bg-elevated: #162033;
    --accent: #00e5ff;
    --accent2: #ff3d71;
    --accent3: #ffaa00;
    --gold: #ffd700;
    --green: #00e676;
    --red: #ff1744;
    --text: #e0e6ed;
    --text-dim: #6b7b8d;
    --text-muted: #4a5568;
    --border: #1e2d3d;
    --border-subtle: #172236;
    --glow: 0 0 20px rgba(0, 229, 255, 0.3);
    --shadow-panel: 0 4px 24px rgba(0,0,0,0.45), 0 0 1px rgba(0,229,255,0.08);
    --shadow-popup: 0 12px 48px rgba(0,0,0,0.65), 0 0 1px rgba(0,229,255,0.12);
    --font-title: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
    /* Spacing scale (4px base) */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    /* Type scale */
    --fs-xs: 0.6rem;
    --fs-sm: 0.72rem;
    --fs-base: 0.8rem;
    --fs-md: 0.9rem;
    --fs-lg: 1rem;
    --fs-xl: 1.15rem;
    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--bg-dark); color: var(--text); font-family: var(--font-body); }
.hidden { display: none !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* Thin scrollbar for HUD resources row */
.hud-resources { scrollbar-width: thin; scrollbar-color: var(--accent) transparent; }
.hud-resources::-webkit-scrollbar { height: 3px; }
.hud-resources::-webkit-scrollbar-track { background: transparent; }
.hud-resources::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

/* ═══════════════ BUTTONS ═══════════════ */
.btn-main {
    font-family: var(--font-title);
    font-size: 1rem;
    padding: 12px 32px;
    background: linear-gradient(135deg, var(--accent), #0088cc);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s;
    box-shadow: var(--glow);
}
.btn-main:hover { transform: translateY(-2px); box-shadow: 0 0 40px rgba(0,229,255,0.5); }
.btn-secondary {
    font-family: var(--font-title);
    font-size: 0.85rem;
    padding: 10px 24px;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s;
}
.btn-secondary:hover { background: rgba(0,229,255,0.1); }
.btn-hud {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.8rem;
    padding: 6px 14px;
    background: var(--bg-panel-alt);
    color: var(--accent);
    border: 1px solid var(--border);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-hud:hover { background: var(--accent); color: var(--bg-dark); }

/* ═══════════════ INTRO SCREEN ═══════════════ */
#intro-screen {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    background: var(--bg-dark);
}
.intro-bg-canvas {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 50% 50%, #0d1b2a 0%, #0a0e17 70%);
}
.intro-content {
    position: relative; z-index: 10;
    text-align: center;
}
.game-title {
    font-family: var(--font-title);
    font-size: 4.5rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: 8px;
    text-shadow: 0 0 60px rgba(0,229,255,0.4);
    margin-bottom: 8px;
}
.game-title span { color: var(--accent); }
.game-subtitle {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--accent);
    letter-spacing: 6px;
    margin-bottom: 40px;
    opacity: 0.8;
}
.intro-buttons { display: flex; gap: 20px; justify-content: center; margin-bottom: 30px; }
.disclaimer { font-size: 0.75rem; color: var(--text-dim); font-style: italic; }

/* ═══════════════ NATION SELECT ═══════════════ */
#nation-select-screen {
    position: fixed; inset: 0;
    background: var(--bg-dark);
    z-index: 999;
    display: flex; flex-direction: column;
    padding: 30px 40px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: var(--accent) transparent;
}
#nation-select-screen::-webkit-scrollbar { width: 5px; }
#nation-select-screen::-webkit-scrollbar-track { background: transparent; }
#nation-select-screen::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }
.nation-select-header { text-align: center; margin-bottom: 24px; position: relative; }
.nation-select-header h2 { font-family: var(--font-title); font-size: 2rem; color: var(--accent); letter-spacing: 4px; }
.nation-select-header p { color: var(--text-dim); }
.btn-back {
    position: absolute; left: 0; top: 0;
    background: none; border: 1px solid var(--border);
    color: var(--text-dim); font-family: var(--font-ui);
    font-size: 0.8rem; padding: 6px 14px; border-radius: 4px;
    cursor: pointer; transition: all 0.2s; letter-spacing: 1px;
}
.btn-back:hover { color: var(--accent); border-color: var(--accent); }
.nation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--sp-3);
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding-bottom: 20px;
    /* No inner scroll — parent #nation-select-screen scrolls vertically */
    overflow: visible;
}
.nation-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: var(--sp-4) var(--sp-3);
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
    text-align: center;
}
.nation-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,229,255,0.15); }
.nation-card.selected { border-color: var(--accent); background: rgba(0,229,255,0.08); box-shadow: 0 0 20px rgba(0,229,255,0.2), inset 0 0 12px rgba(0,229,255,0.04); }
.nation-card .flag {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    margin-bottom: 8px;
}
.nation-card .nation-flag-img {
    width: 36px;
    height: 36px;
    display: block;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.18));
}
.nation-card .flag-img-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(0,229,255,0.22);
    background: rgba(0,229,255,0.08);
    color: var(--accent);
    font-family: var(--font-title);
    font-size: 0.95rem;
    letter-spacing: 1.4px;
}
.nation-card .name { font-family: var(--font-title); font-size: 0.75rem; letter-spacing: 1px; color: var(--text); }
.nation-card .power-bar { height: 3px; background: var(--border); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.nation-card .power-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.5s; }

/* Nation Preview */
.nation-preview {
    position: fixed;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: linear-gradient(180deg, var(--bg-panel), rgba(13,18,30,0.99));
    border: 1px solid rgba(0,229,255,0.4);
    border-radius: 14px;
    padding: var(--sp-5) 30px;
    min-width: 500px;
    z-index: 1001;
    box-shadow: 0 12px 60px rgba(0,229,255,0.15), 0 0 1px rgba(0,229,255,0.3);
}
.preview-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.preview-flag { font-size: 2.5rem; }
.preview-header h3 { font-family: var(--font-title); font-size: 1.3rem; color: var(--accent); }
.preview-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.preview-stat { background: var(--bg-panel-alt); border-radius: 4px; padding: 8px; text-align: center; }
.preview-stat .label { font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
.preview-stat .value { font-family: var(--font-mono); font-size: 1.1rem; color: var(--gold); margin-top: 2px; }
.nation-preview .btn-main {
    display: block; margin: 0 auto;
}

/* ═══════════════ TUTORIAL ═══════════════ */
#tutorial-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 2000;
    display: flex; align-items: center; justify-content: center;
}
.tutorial-content {
    background: var(--bg-panel);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 30px 40px;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
}
.tutorial-content h2 { font-family: var(--font-title); color: var(--accent); margin-bottom: 20px; text-align: center; }
.tutorial-steps { display: grid; gap: 16px; margin-bottom: 24px; }
.tut-step {
    display: grid; grid-template-columns: 50px 1fr; grid-template-rows: auto auto;
    gap: 2px 12px; background: var(--bg-panel-alt); border-radius: 6px; padding: 14px;
}
.tut-icon { grid-row: 1/3; font-size: 2rem; display: flex; align-items: center; justify-content: center; }
.tut-step h4 { font-family: var(--font-title); font-size: 0.9rem; color: var(--accent); }
.tut-step p { font-size: 0.85rem; color: var(--text-dim); line-height: 1.4; }
.tutorial-content .btn-main { display: block; margin: 0 auto; }

/* ═══════════════ GAME SCREEN ═══════════════ */
#game-screen { position: fixed; inset: 0; display: flex; flex-direction: column; }

/* TOP HUD */
#top-hud {
    display: flex; align-items: center;
    background: linear-gradient(180deg, var(--bg-panel) 0%, rgba(17,24,39,0.97) 100%);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 12px rgba(0,0,0,0.35);
    padding: 0 var(--sp-3);
    position: relative;
    z-index: 400;
    height: 46px;
    flex-shrink: 0;
    gap: 0;
}

/* ─ Identity group ─ */
.hud-identity { display: flex; align-items: center; gap: var(--sp-2); flex-shrink: 0; padding-right: var(--sp-3); }
.hud-identity-text { display: flex; flex-direction: column; line-height: 1.2; gap: 1px; }
.hud-flag { font-size: 1.5rem; filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4)); }
.hud-name { font-family: var(--font-title); font-size: 0.75rem; color: var(--accent); letter-spacing: 1.5px; white-space: nowrap; font-weight: 700; }
.hud-turn { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--gold); white-space: nowrap; opacity: 0.85; }

/* ─ Divider ─ */
.hud-divider { width: 1px; height: 26px; background: linear-gradient(180deg, transparent, var(--border), transparent); flex-shrink: 0; margin: 0 var(--sp-3); opacity: 0.7; }

/* ─ Resources ─ */
.hud-resources { display: flex; align-items: center; gap: var(--sp-1); flex: 1; min-width: 0; overflow-x: auto; padding: 2px 0; }
.hud-res {
    display: flex; align-items: center; gap: 4px;
    font-family: var(--font-mono); font-size: var(--fs-sm);
    background: var(--bg-panel-alt);
    border: 1px solid var(--border-subtle);
    padding: 3px 8px; border-radius: 6px;
    white-space: nowrap; flex-shrink: 0;
    transition: border-color 0.2s;
}
.hud-res:hover { border-color: var(--border); }
.hud-res .res-icon { font-size: 0.85rem; }
.hud-res .res-val { color: var(--gold); font-weight: 700; min-width: 18px; text-align: right; }

/* ─ Action buttons ─ */
.hud-actions { display: flex; align-items: center; gap: 5px; flex-shrink: 0; padding-left: var(--sp-3); }
.hud-actions-sep { width: 1px; height: 20px; background: linear-gradient(180deg, transparent, var(--border), transparent); margin: 0 3px; opacity: 0.5; }
.btn-hud {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    width: 36px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-panel-alt);
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    padding: 0;
    position: relative;
}
.btn-hud:hover { background: rgba(0,229,255,0.12); color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.btn-hud:active { transform: translateY(0); }
.btn-hud-primary {
    width: auto; padding: 0 14px; gap: 4px;
    font-size: 0.7rem; letter-spacing: 0.5px;
    color: var(--bg-dark); background: var(--accent);
    border-color: var(--accent);
    font-weight: 700;
    box-shadow: 0 0 8px rgba(0,229,255,0.2);
}
.btn-hud-primary:hover { background: #33ecff; color: var(--bg-dark); box-shadow: 0 0 16px rgba(0,229,255,0.4); transform: translateY(-1px); }

/* MAP */
#map-container {
    flex: 1; position: relative; overflow: hidden;
    background: #0a1628;  /* matches ocean fill for seamless look */
    cursor: grab;
}
#map-container:active { cursor: grabbing; }
#svg-wrapper {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    transform-origin: 0 0;
    contain: layout style;
}
#svg-wrapper svg {
    width: 100%; height: 100%;
    display: block;
}
#fx-canvas {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none; z-index: 10;
}

/* TOOLTIP */
.map-tooltip {
    position: absolute;
    background: linear-gradient(180deg, rgba(17,24,39,0.98), rgba(13,18,30,0.98));
    border: 1px solid rgba(0,229,255,0.35);
    border-radius: 8px;
    padding: var(--sp-3) var(--sp-4);
    font-size: var(--fs-base);
    pointer-events: none;
    z-index: 50;
    max-width: min(260px, calc(100vw - 24px));
    box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 1px rgba(0,229,255,0.15);
    backdrop-filter: blur(8px);
}
/* When tooltip is interactive (mobile tap), enable pointer events */
.map-tooltip.tt-interactive {
    pointer-events: auto;
    cursor: pointer;
}
.map-tooltip .tt-name { font-family: var(--font-title); color: var(--accent); font-size: var(--fs-md); margin-bottom: 2px; font-weight: 700; letter-spacing: 0.5px; }
.map-tooltip .tt-owner { color: var(--text-dim); font-size: var(--fs-sm); }

/* Flag images in tooltips, legend, and nation detail */
.tt-flag-img { width: 1.1em; height: 1.1em; vertical-align: -0.15em; object-fit: contain; }
.legend-flag-img { width: 1em; height: 1em; vertical-align: -0.1em; object-fit: contain; }
.legend-minor { opacity: 0.5; font-style: italic; border-top: 1px solid var(--border-subtle); padding-top: 4px; margin-top: 4px; }
.nation-flag-img { width: 36px; height: 36px; object-fit: contain; }
.map-tooltip .tt-res { margin-top: var(--sp-2); font-family: var(--font-mono); font-size: var(--fs-sm); line-height: 1.6; }

/* Tooltip close button (mobile only) */
.map-tooltip .tt-close {
    position: absolute;
    top: 4px; right: 4px;
    width: 22px; height: 22px;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-dim);
    font-size: 0.7rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    padding: 0;
    line-height: 1;
    z-index: 2;
    transition: background 0.15s, color 0.15s;
}
.map-tooltip .tt-close:hover,
.map-tooltip .tt-close:active {
    background: rgba(255,61,113,0.2);
    color: var(--accent2);
}

/* Tooltip body (clickable area for opening sidebar on mobile) */
.map-tooltip .tt-body {
    cursor: pointer;
}

/* Hint text for mobile */
.map-tooltip .tt-hint {
    margin-top: 8px;
    font-size: 0.65rem;
    color: var(--accent);
    text-align: center;
    opacity: 0.8;
    letter-spacing: 0.5px;
}

/* SIDE PANELS */
.side-panel {
    position: absolute;
    top: 46px; bottom: 40px;
    width: 300px;
    background: linear-gradient(180deg, var(--bg-panel) 0%, rgba(17,24,39,0.98) 100%);
    border: 1px solid var(--border);
    z-index: 310;
    display: flex; flex-direction: column;
    overflow-y: auto;
    box-shadow: var(--shadow-panel);
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.side-panel::-webkit-scrollbar { width: 5px; }
.side-panel::-webkit-scrollbar-track { background: transparent; }
.side-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.side-panel::-webkit-scrollbar-thumb:hover { background: var(--accent); }
#left-panel { left: 0; border-left: none; border-radius: 0 10px 10px 0; }
#right-panel { right: 0; border-right: none; border-radius: 10px 0 0 10px; width: 265px; }
.panel-header {
    display: flex; flex-direction: column;
    padding: var(--sp-3) var(--sp-4);
    padding-right: 40px; /* room for close button */
    border-bottom: 1px solid var(--border);
    background: rgba(0,229,255,0.02);
    flex-shrink: 0;
    gap: var(--sp-1);
    min-height: 48px;
    position: relative;
}
.panel-header h3 {
    font-family: var(--font-title); font-size: var(--fs-base); color: var(--accent);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    line-height: 1.3;
}
.panel-owner {
    font-size: var(--fs-sm); color: var(--text-dim);
    display: flex; align-items: center; gap: var(--sp-1); flex-wrap: wrap;
}
.panel-close {
    position: absolute; top: var(--sp-3); right: var(--sp-3);
    background: none; border: 1px solid transparent; color: var(--text-dim); cursor: pointer;
    font-size: var(--fs-lg); padding: 2px 6px; border-radius: 4px;
    transition: all 0.15s;
    flex-shrink: 0;
    z-index: 1;
}
.panel-close:hover { color: var(--accent); background: var(--bg-panel-alt); border-color: var(--border); }
/* Right panel header stays horizontal (short fixed title) */
#right-panel > .panel-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-right: var(--sp-4);
    gap: var(--sp-2);
}
#right-panel > .panel-header .panel-close {
    position: static;
}
.panel-section { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border-subtle); }
.panel-section h4 {
    font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 1.5px; margin-bottom: var(--sp-2); padding-top: var(--sp-1);
    font-family: var(--font-title); font-weight: 400;
    display: flex; align-items: center; gap: var(--sp-1);
}
.panel-section .res-row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: var(--fs-base); margin-bottom: var(--sp-1);
    padding: 2px 0; min-height: 24px;
}
.panel-section .res-row .val {
    font-family: var(--font-mono); color: var(--gold); font-weight: 600;
    font-size: var(--fs-sm); min-width: 48px; text-align: right;
}
.panel-section .res-row.reachability {
    margin-bottom: 0;
    min-height: none;
;
}
.panel-actions {
    padding: var(--sp-3) var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2);
    border-top: 1px solid var(--border);
}
.btn-action {
    font-family: var(--font-body); font-weight: 600;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    font-size: var(--fs-base);
    text-align: center;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}
.btn-action::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent);
    pointer-events: none;
}
.btn-action:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.btn-action:active { transform: translateY(0); }
.btn-action:disabled, .btn-action.act-disabled {
    opacity: 0.3 !important; cursor: not-allowed !important; pointer-events: none;
    filter: grayscale(0.8); color: var(--text-dim) !important; border-color: var(--border) !important;
    background: var(--bg-panel-alt) !important;
    transform: none !important; box-shadow: none !important;
}
.btn-attack { background: rgba(255,23,68,0.12); color: var(--red); border-color: rgba(255,23,68,0.5); }
.btn-attack:hover { background: var(--red); color: #fff; box-shadow: 0 4px 16px rgba(255,23,68,0.3); }
.btn-build { background: rgba(0,230,118,0.08); color: var(--green); border-color: rgba(0,230,118,0.4); }
.btn-build:hover { background: var(--green); color: var(--bg-dark); box-shadow: 0 4px 16px rgba(0,230,118,0.3); }
.btn-move { background: rgba(0,229,255,0.08); color: var(--accent); border-color: rgba(0,229,255,0.4); }
.btn-move:hover { background: var(--accent); color: var(--bg-dark); box-shadow: 0 4px 16px rgba(0,229,255,0.3); }

/* EVENT LOG */
.event-log { flex: 1; overflow-y: auto; padding: var(--sp-2) var(--sp-3); contain: layout style; }
.event-item {
    padding: 6px 10px;
    border-left: 3px solid var(--border);
    margin-bottom: var(--sp-1);
    font-size: var(--fs-sm);
    line-height: 1.5;
    background: var(--bg-panel-alt);
    border-radius: 0 6px 6px 0;
    word-break: break-word;
    transition: background 0.15s;
}
.event-item:hover { background: var(--bg-elevated); }
.event-item.evt-battle { border-color: var(--red); }
.event-item.evt-resource { border-color: var(--green); }
.event-item.evt-diplomacy { border-color: var(--accent); }
.event-item.evt-tech { border-color: var(--gold); }
.event-item.evt-nuke { border-color: #ff00ff; }
/* My events — highlighted in gold/yellow */
.event-item.evt-mine { background: rgba(255,215,0,0.1); border-left-width: 4px; border-left-color: var(--gold) !important; }
.event-item.evt-mine:hover { background: rgba(255,215,0,0.15); }
/* Ally events — slightly highlighted */
.event-item.evt-ally { background: rgba(0,230,118,0.05); }
.event-item .evt-turn {
    font-family: var(--font-mono); color: var(--text-muted); font-size: var(--fs-xs);
    background: rgba(255,255,255,0.05); padding: 1px 5px; border-radius: 3px;
    margin-right: 5px; vertical-align: middle;
}
.evt-flag {
    display: inline-block; width: 10px; height: 10px; border-radius: 50%;
    vertical-align: middle; margin: 0 5px 0 1px;
    border: 1.5px solid rgba(255,255,255,0.2);
    flex-shrink: 0;
    box-shadow: 0 0 3px rgba(0,0,0,0.3);
}
.evt-nation {
    font-weight: 600; color: var(--text); vertical-align: middle;
}
.evt-action { color: var(--text-dim); vertical-align: middle; }
.evt-result { font-weight: 700; letter-spacing: 0.3px; }
.evt-result.win { color: var(--green); }
.evt-result.lose { color: var(--red); }

/* Fullscreen expand button */
.panel-btn {
    background: none; border: 1px solid var(--border); color: var(--text-dim);
    cursor: pointer; font-size: 0.8rem; padding: 2px 6px; border-radius: 3px;
    transition: all 0.2s;
}
.panel-btn:hover { color: var(--accent); border-color: var(--accent); }

/* Fullscreen mode for right panel */
#right-panel.evt-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    z-index: 600 !important;
}
#right-panel.evt-fullscreen .event-log { font-size: 0.85rem; padding: 12px 16px; }
#right-panel.evt-fullscreen .event-item { padding: 6px 10px; margin-bottom: 6px; font-size: 0.85rem; }
#right-panel.evt-fullscreen .evt-flag { width: 12px; height: 12px; }

/* LIVE button */
.btn-live {
    position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
    background: rgba(255,23,68,0.85); color: #fff;
    border: none; border-radius: 16px;
    padding: 4px 14px; font-family: var(--font-title);
    font-size: 0.7rem; letter-spacing: 2px; cursor: pointer;
    box-shadow: 0 2px 12px rgba(255,23,68,0.4);
    transition: all 0.2s; z-index: 10;
    animation: livePulse 1.5s ease-in-out infinite;
}
.btn-live:hover { background: rgba(255,23,68,1); transform: translateX(-50%) scale(1.05); }
@keyframes livePulse { 0%,100%{opacity:1;} 50%{opacity:0.7;} }

/* BOTTOM PANEL */
#bottom-panel {
    background: linear-gradient(0deg, var(--bg-panel) 0%, rgba(17,24,39,0.97) 100%);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.3);
    padding: var(--sp-1) var(--sp-4);
    z-index: 400;
    position: relative;
    height: 40px;
    flex-shrink: 0;
    display: flex; align-items: center;
}
.military-bar { display: flex; gap: var(--sp-2); width: 100%; overflow-x: auto; padding: 2px 0; }
.mil-unit {
    display: flex; align-items: center; gap: 5px;
    font-family: var(--font-mono); font-size: var(--fs-sm);
    background: var(--bg-panel-alt);
    border: 1px solid var(--border-subtle);
    padding: 3px 10px; border-radius: 5px;
    white-space: nowrap;
    transition: border-color 0.15s;
}
.mil-unit:hover { border-color: var(--border); }
.mil-unit .mil-icon { font-size: 1rem; }
.mil-unit .mil-count { color: var(--gold); font-weight: 600; }

/* ═══════════════ POPUPS ═══════════════ */
.popup {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(4px);
    z-index: 500;
    display: flex; align-items: center; justify-content: center;
    animation: popupFadeIn 0.2s ease-out;
}
@keyframes popupFadeIn { from { opacity: 0; } to { opacity: 1; } }
.popup-content {
    position: relative;
    background: linear-gradient(180deg, var(--bg-panel) 0%, rgba(13,18,30,0.99) 100%);
    border: 1px solid rgba(0,229,255,0.3);
    border-radius: 14px;
    padding: var(--sp-6) 30px;
    max-width: 700px;
    width: 90%;
    max-height: 82vh;
    overflow-y: auto;
    box-shadow: var(--shadow-popup);
    animation: popupSlideUp 0.25s var(--ease-out);
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
@keyframes popupSlideUp {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.popup-content::-webkit-scrollbar { width: 5px; }
.popup-content::-webkit-scrollbar-track { background: transparent; }
.popup-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.popup-close-x {
    position: absolute; top: var(--sp-3); right: var(--sp-4);
    background: none; border: 1px solid transparent; color: var(--text-dim);
    font-size: 1.3rem; cursor: pointer; padding: 2px 8px;
    border-radius: 6px; line-height: 1; z-index: 1;
    transition: all .15s;
}
.popup-close-x:hover { color: var(--accent); background: rgba(255,255,255,0.06); border-color: var(--border); }
.popup-content h3, .popup-content h2 {
    font-family: var(--font-title);
    color: var(--accent);
    margin-bottom: var(--sp-4);
    text-align: center;
    letter-spacing: 1px;
}
/* Close button spacing — detach from card content */
.popup-content > .btn-main:last-child {
    margin-top: var(--sp-4);
    margin-bottom: 0;
    padding-top: 14px;
    padding-bottom: 14px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    line-height: 1;
    box-sizing: border-box;
}

/* ═══════════════ SETTINGS POPUP ═══════════════ */
.settings-content { text-align: center; }
.settings-group {
    margin: var(--sp-5) 0;
    padding: var(--sp-4) var(--sp-5);
    background: var(--bg-panel-alt);
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
}
.settings-label {
    display: block;
    font-family: var(--font-title);
    font-size: var(--fs-sm);
    color: var(--text-dim);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: var(--sp-3);
}
.settings-lang-btns {
    display: flex; gap: var(--sp-2); justify-content: center;
}
.settings-lang-btn {
    padding: 8px 18px;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
    font-family: var(--font-body);
    font-size: var(--fs-base);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.settings-lang-btn:hover {
    border-color: var(--accent);
    background: rgba(0,229,255,0.08);
}
.settings-lang-btn.active {
    border-color: var(--accent);
    background: rgba(0,229,255,0.15);
    color: var(--accent);
    box-shadow: 0 0 12px rgba(0,229,255,0.2);
}
.lang-flag {
    width: 22px; height: 22px;
    vertical-align: middle;
    margin-right: 4px;
    border-radius: 3px;
}

/* ═══ BATTLE MODAL — polished UX ═══ */
.battle-content {
    max-width: 540px;
    /**padding: 0 !important;
    border: none !important;*/
    overflow-y: auto;
    border-radius: 14px !important;
    background: linear-gradient(180deg, #0d1a2e 0%, var(--bg-panel) 20%) !important;
    max-height: 90vh;
}
.btl-header {
    text-align: center;
    padding: 10px 20px 4px;
    /**background: linear-gradient(180deg, rgba(0,229,255,0.08) 0%, transparent 100%);*/
}
.btl-header h3 {
    font-family: var(--font-title);
    color: var(--accent);
    font-size: 1rem;
    margin: 0 0 1px;
    letter-spacing: 3px;
}
.btl-body { padding: 0 14px 0; }
.btl-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 6px;
    align-items: stretch;
    margin-bottom: 6px;
}
.btl-col {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 6px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.btl-nation {
    font-family: var(--font-title);
    font-size: 0.75rem;
    text-align: center;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}
.btl-atk .btl-nation { color: var(--accent2, #ff6e40); }
.btl-def .btl-nation { color: var(--accent3, #40c4ff); }
.btl-units {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 4px;
    justify-content: center;
    margin-bottom: 4px;
    flex: 1;
}
.btl-u {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--gold);
    white-space: nowrap;
}
.btl-u em {
    font-style: normal;
    color: var(--red);
    font-size: 0.65rem;
    margin-left: 1px;
    font-weight: 700;
}
.btl-pow {
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-dim);
    border-top: 1px solid rgba(255,255,255,0.07);
    padding-top: 4px;
    width: 100%;
    margin-top: auto;
}
.btl-dead { color: var(--red); font-size: 0.65rem; font-weight: 700; }
.btl-vs {
    font-family: var(--font-title);
    font-size: 0.75rem;
    color: rgba(255,255,255,0.15);
    align-self: center;
    text-align: center;
    letter-spacing: 3px;
    text-transform: uppercase;
    min-width: 28px;
}
.battle-result {
    text-align: center;
    font-family: var(--font-title);
    font-size: 0.82rem;
    margin: 0 0 6px;
    padding: 6px 10px;
    border-radius: 6px;
    letter-spacing: 1px;
}
.battle-result.win {
    background: linear-gradient(135deg, rgba(0,230,118,0.18) 0%, rgba(0,230,118,0.06) 100%);
    color: var(--green);
    border: 1px solid rgba(0,230,118,0.25);
}
.battle-result.lose {
    background: linear-gradient(135deg, rgba(255,23,68,0.18) 0%, rgba(255,23,68,0.06) 100%);
    color: var(--red);
    border: 1px solid rgba(255,23,68,0.25);
}

/* Battle loot section */
.btl-loot {
    background: rgba(255,215,0,0.06);
    border: 1px solid rgba(255,215,0,0.2);
    border-radius: 6px;
    padding: 6px 10px;
    margin-bottom: 2px;
}
.btl-loot-title {
    font-family: var(--font-title);
    font-size: 0.7rem;
    color: var(--gold);
    text-align: center;
    margin-bottom: 4px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.btl-loot-items { display: flex; flex-wrap: wrap; gap: 3px 6px; justify-content: center; }
.btl-loot-item {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--green);
    white-space: nowrap;
    background: rgba(0,230,118,0.08);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(0,230,118,0.15);
}
.btl-loot-cap .btl-loot-item {
    color: var(--accent);
    background: rgba(0,229,255,0.08);
    border-color: rgba(0,229,255,0.15);
}

/* ── Combat Modifier 4-Box Grid ── */
.btl-mod-box {
    padding: 4px 7px; border-radius: 5px;
    background: rgba(255,255,255,0.035); border: 1px solid rgba(255,255,255,0.07);
    font-size: 0.58rem; line-height: 1.55; color: #90a4ae;
}
.btl-mod-box .btl-mod-item { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btl-mod-box .btl-mod-item strong { font-weight: 700; color: #cfd8dc; }
.btl-mod-result-box {
    padding: 3px 6px; border-radius: 5px; text-align: center;
    font-size: 0.68rem; font-weight: 700; line-height: 1.4;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.10);
}
.btl-mod-result-box strong { font-size: 0.78rem; }

/* Close button inside battle modal — inherit standard popup style */

/* ── Peace Negotiation ── */
.peace-content { max-width: 500px; }
.peace-content h3 { color: #80cbc4; }
.peace-header {
    display: flex; align-items: center; justify-content: center; gap: 16px;
    margin-bottom: 8px; font-size: 2rem;
}
.peace-vs { font-size: 1.2rem; color: var(--text-dim); }
.peace-mood {
    text-align: center; font-size: 0.85rem; font-weight: 700; letter-spacing: 1px;
    padding: 6px 14px; border-radius: 20px; margin: 0 auto 14px; width: fit-content;
}
.peace-mood-generous    { background: rgba(0,230,118,0.12); color: #00e676; border: 1px solid rgba(0,230,118,0.3); }
.peace-mood-fair        { background: rgba(100,181,246,0.12); color: #64b5f6; border: 1px solid rgba(100,181,246,0.3); }
.peace-mood-harsh       { background: rgba(255,145,0,0.12); color: #ff9100; border: 1px solid rgba(255,145,0,0.3); }
.peace-mood-humiliating { background: rgba(255,23,68,0.12); color: #ff1744; border: 1px solid rgba(255,23,68,0.3); }
.peace-info-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
    margin-bottom: 14px; font-size: 0.72rem;
}
.peace-info-item {
    display: flex; flex-direction: column; gap: 2px;
    padding: 6px 10px; border-radius: 8px; background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
}
.peace-info-label { color: var(--text-dim); font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.5px; }
.peace-info-val { font-weight: 600; }
.peace-demands-header {
    font-size: 0.8rem; font-weight: 700; color: #ffab91; margin-bottom: 8px;
    letter-spacing: 0.5px;
}
.peace-demands-list { margin-bottom: 14px; }
.peace-demand-row {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px;
    margin: 4px 0; border-radius: 8px;
    background: rgba(255,171,145,0.06); border: 1px solid rgba(255,171,145,0.15);
}
.peace-demand-lacking { border-color: rgba(255,23,68,0.4); background: rgba(255,23,68,0.08); }
.peace-demand-res { flex: 1; font-weight: 600; font-size: 0.8rem; }
.peace-demand-amt { font-weight: 700; font-size: 0.95rem; color: #ffab91; min-width: 40px; text-align: right; }
.peace-demand-have { font-size: 0.65rem; min-width: 60px; text-align: right; }
.peace-warning {
    text-align: center; font-size: 0.7rem; color: #ff1744; padding: 6px 10px;
    border-radius: 6px; background: rgba(255,23,68,0.08); margin-bottom: 10px;
}
.peace-actions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.peace-btn {
    padding: 10px 16px; border-radius: 8px; border: 1px solid; cursor: pointer;
    font-weight: 700; font-size: 0.8rem; text-align: center; transition: all 0.2s;
}
.peace-btn-accept {
    border-color: #00e676; color: #00e676; background: rgba(0,230,118,0.1);
}
.peace-btn-accept:hover:not(:disabled) { background: rgba(0,230,118,0.25); }
.peace-btn-accept:disabled, .peace-btn-accept.disabled {
    opacity: 0.4; cursor: not-allowed; pointer-events: none;
}
.peace-btn-reject {
    border-color: #ff6e40; color: #ff6e40; background: rgba(255,110,64,0.08);
}
.peace-btn-reject:hover { background: rgba(255,110,64,0.2); }
.peace-flavour {
    font-size: 0.7rem; color: var(--text-dim); font-style: italic;
    text-align: center; padding: 8px 12px; border-radius: 8px;
    background: rgba(255,255,255,0.03); border: 1px solid var(--border);
}

/* ── Colony Overview ── */
.colonies-content { max-width: 560px; }
.colonies-content h3 { color: #80cbc4; }
.colony-summary {
    display: flex; gap: 16px; justify-content: center; align-items: center;
    padding: 8px 12px; margin-bottom: 12px; border-radius: 8px;
    background: rgba(255,255,255,0.04); border: 1px solid var(--border);
    font-size: 0.75rem; font-weight: 600;
}
.colony-row {
    display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3);
    margin: var(--sp-2) 0; border-radius: 8px;
    background: rgba(128,203,196,0.06); border: 1px solid rgba(128,203,196,0.18);
    transition: all 0.2s;
}
.colony-row:hover { border-color: rgba(128,203,196,0.35); }
.colony-row.colony-critical { background: rgba(255,23,68,0.08); border-color: rgba(255,23,68,0.3); }
.colony-row.colony-high     { background: rgba(255,145,0,0.08); border-color: rgba(255,145,0,0.25); }
.colony-row.colony-warning   { background: rgba(255,215,64,0.06); border-color: rgba(255,215,64,0.2); }
.colony-info { flex: 1; min-width: 0; }
.colony-name { font-weight: 700; font-size: 0.85rem; }
.colony-meta { font-size: 0.65rem; color: var(--text-dim); margin-top: 2px; }
.colony-stable-label { font-size: 0.7rem; color: #00e676; margin-top: 4px; }
.colony-actions { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.colony-btn-view {
    padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border);
    background: rgba(255,255,255,0.05); color: var(--text); cursor: pointer;
    font-size: 0.7rem; transition: background 0.2s;
}
.colony-btn-view:hover { background: rgba(255,255,255,0.12); }

/* ── Turn Notice (sidebar flash) ── */
.turn-notice {
    text-align: center; padding: 8px 12px; margin-bottom: 10px;
    border-radius: 8px; font-weight: 700; font-size: 0.8rem; letter-spacing: 0.5px;
    color: #00e676; background: rgba(0,230,118,0.12); border: 1px solid rgba(0,230,118,0.35);
    animation: turnNoticeIn 0.4s ease-out;
    transition: opacity 0.8s ease;
}
.turn-notice-out { opacity: 0; }
@keyframes turnNoticeIn {
    0%   { opacity: 0; transform: translateY(-8px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Revolt Alert ── */
.revolt-alert-content { max-width: 520px; }
.revolt-alert-content h3 { color: #ff6e40; animation: revoltShake 0.5s ease-out; }
.revolt-territory {
    display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3);
    margin: var(--sp-2) 0; border-radius: 8px;
    background: rgba(255,110,64,0.08); border: 1px solid rgba(255,110,64,0.25);
    transition: border-color 0.15s;
}
.revolt-territory:hover { border-color: rgba(255,110,64,0.4); }
@keyframes revoltShake {
    0%, 100% { transform: translateX(0); }
    10%, 50%, 90% { transform: translateX(-4px); }
    30%, 70% { transform: translateX(4px); }
}
.revolt-territory .revolt-info { flex: 1; min-width: 0; }
.revolt-territory .revolt-name { font-weight: 700; font-size: 0.85rem; }
.revolt-territory .revolt-gain { font-size: 0.65rem; color: #ff9100; margin-top: 2px; }
.revolt-unrest-bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,0.1); overflow: hidden; margin: 4px 0; width: 100%; }
.revolt-unrest-fill { height: 100%; border-radius: 4px; transition: width 0.4s ease; }
.revolt-unrest-label { font-size: 0.65rem; font-family: var(--font-mono); }
.revolt-btn-suppress {
    padding: 5px 12px; border-radius: 6px; border: 1px solid #00e676;
    background: rgba(0,230,118,0.12); color: #00e676; cursor: pointer;
    font-weight: 700; font-size: 0.7rem; white-space: nowrap; transition: background 0.2s;
}
.revolt-btn-suppress:hover { background: rgba(0,230,118,0.25); }
.revolt-btn-suppress:disabled { opacity: 0.4; cursor: not-allowed; }
.revolt-cost { font-size: 0.6rem; color: var(--text-dim); margin-top: 2px; text-align: center; }

/* ── Garrison Card (territory sidebar) ── */
.gar-card {
    border-radius: 10px; overflow: hidden;
    background: linear-gradient(135deg, rgba(255,255,255,0.035) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid rgba(255,255,255,0.07);
    margin-top: var(--sp-2);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.gar-header {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.gar-strength-dot {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
    box-shadow: 0 0 6px currentColor;
}
.gar-strength-label { font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; }
.gar-troops { margin-left: auto; font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-dim); }
.gar-meter {
    height: 3px; background: rgba(255,255,255,0.06);
}
.gar-meter-fill {
    height: 100%; transition: width 0.4s ease;
}
.gar-stats {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0;
}
.gar-stat {
    display: flex; flex-direction: column; align-items: center;
    padding: 6px 4px;
    border-right: 1px solid rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.gar-stat:nth-child(2n) { border-right: none; }
.gar-stat:nth-last-child(-n+2) { border-bottom: none; }
.gar-stat-val { font-weight: 700; font-size: 0.8rem; font-family: var(--font-mono); }
.gar-stat-lbl { font-size: 0.55rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 1px; }
.gar-unrest {
    padding: 6px 10px;
    border-top: 1px solid rgba(255,255,255,0.05);
    background: rgba(255,255,255,0.02);
}
.gar-unrest-row {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.7rem; margin-bottom: 4px;
}
.gar-unrest-label { color: var(--text-dim); }
.gar-unrest-val { font-weight: 700; font-family: var(--font-mono); }
.gar-empty {
    display: flex; align-items: center; gap: 6px;
    padding: 10px; font-size: 0.7rem; color: #ff1744;
}
.gar-empty-icon { font-size: 1.1rem; }

/* Unrest bar in tooltip */
.unrest-bar-mini { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.08); overflow: hidden; margin: 3px 0; }
.unrest-bar-mini-fill { height: 100%; border-radius: 3px; }

/* HUD resource income indicator */
.hud-res .res-inc { color: var(--green); font-size: 0.68rem; margin-left: 3px; font-weight: 600; opacity: 0.85; }

/* Military bar summary */
.mil-summary { background: rgba(0,229,255,0.06) !important; border: 1px solid rgba(0,229,255,0.25) !important; gap: var(--sp-3) !important; font-weight: 700; border-radius: 6px !important; }
.mil-summary span { color: var(--accent); letter-spacing: 0.3px; }

/* Tech tree */
.tech-content { max-width: 760px; }
.tech-tier { margin-bottom: 16px; }
.tech-tier-label {
    font-family: var(--font-title); font-size: 0.6rem; color: var(--text-dim);
    text-transform: uppercase; letter-spacing: 2px;
    padding-bottom: 6px; margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.tech-tier-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.tech-card {
    display: flex; gap: var(--sp-3); align-items: flex-start;
    background: var(--bg-panel-alt); border: 1px solid var(--border); border-radius: 8px;
    padding: var(--sp-3); transition: all 0.2s var(--ease-out);
}
.tech-card:hover { border-color: var(--accent); background: rgba(0,229,255,0.04); transform: translateY(-1px); }
.tech-card.researched { border-color: var(--green); background: rgba(0,230,118,0.06); opacity: 0.8; }
.tech-card.available { border-color: var(--gold); cursor: pointer; }
.tech-card.available:hover { border-color: var(--gold); background: rgba(255,215,0,0.08); box-shadow: 0 4px 16px rgba(255,215,0,0.15); transform: translateY(-2px); }
.tech-card.locked { border-color: #1e2d3d; opacity: 0.4; cursor: not-allowed; }
.tech-card-icon { font-size: 1.6rem; flex-shrink: 0; width: 32px; text-align: center; padding-top: 2px; }
.tech-card-body { flex: 1; min-width: 0; }
.tech-card-header { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 2px; }
.tech-card .tech-name { font-family: var(--font-title); font-size: 0.72rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tech-card .tech-cost { font-family: var(--font-mono); font-size: 0.62rem; color: var(--gold); margin-bottom: 3px; }
.tech-card .tech-desc { font-size: 0.6rem; color: var(--accent); font-weight: 600; margin-bottom: 1px; }
.tech-card .tech-tip { font-size: 0.55rem; color: #78909c; line-height: 1.3; font-style: italic; }
.tech-card .tech-lock { font-size: 0.52rem; color: #ff6e40; margin-top: 3px; }
.tech-card .tech-lock-res { color: #ffa726; }
.tech-status { font-size: 0.7rem; flex-shrink: 0; }
.tech-done { color: var(--green); }
.tech-ready { color: var(--gold); font-size: 0.55rem; }
.tech-no { font-size: 0.6rem; opacity: 0.4; }

/* Diplomacy — redesigned card layout */
.diplomacy-content { max-width: 800px; width: 95%; max-height: 85vh; }
.diplomacy-content h3 { margin-bottom: 8px; }

.diplo-player-summary {
    display: flex; align-items: center; gap: 12px;
    background: rgba(0,229,255,0.08); border: 1px solid rgba(0,229,255,0.2);
    border-radius: 6px; padding: 10px 14px; margin-bottom: 14px;
}
.diplo-section-title {
    font-family: var(--font-title); font-size: 0.8rem; color: var(--text);
    padding: 6px 12px; margin: 12px 0 8px; letter-spacing: 1px;
    background: var(--bg-panel-alt); border-radius: 0 4px 4px 0;
}

.diplo-card {
    background: var(--bg-panel-alt); border: 1px solid var(--border);
    border-radius: 10px; padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-2);
    transition: all 0.2s var(--ease-out);
}
.diplo-card:hover { border-color: rgba(0,229,255,0.4); box-shadow: 0 2px 12px rgba(0,0,0,0.2); }
.diplo-card-war { border-left: 3px solid var(--red); }
.diplo-card-ally { border-left: 3px solid var(--green); }

.diplo-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.diplo-card-flag {
    font-size: 0.9rem; width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--border); border-radius: 50%;
    background: var(--bg-dark); flex-shrink: 0;
    color: var(--accent);
    font-family: var(--font-title);
    letter-spacing: 1px;
}
.diplo-player-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg-dark);
    color: var(--accent);
    font-family: var(--font-title);
    font-size: 1rem;
    letter-spacing: 1px;
}
.diplo-card-info { flex: 1; }
.diplo-card-name { font-family: var(--font-title); font-size: 0.9rem; color: var(--text); font-weight: 700; }
.diplo-card-stats { font-size: 0.7rem; color: var(--text-dim); font-family: var(--font-mono); }

.diplo-badge {
    font-family: var(--font-title); font-size: 0.7rem; font-weight: 700;
    padding: 4px 10px; border-radius: 4px; white-space: nowrap;
    letter-spacing: 0.5px;
}
.diplo-badge-war { background: rgba(255,23,68,0.2); color: var(--red); border: 1px solid rgba(255,23,68,0.3); }
.diplo-badge-ally { background: rgba(0,230,118,0.2); color: var(--green); border: 1px solid rgba(0,230,118,0.3); }
.diplo-badge-neutral { background: var(--bg-dark); border: 1px solid var(--border); }

.diplo-rel-bar {
    height: 6px; background: var(--bg-dark); border-radius: 3px;
    margin-bottom: 10px; position: relative; overflow: visible;
}
.diplo-rel-fill { height: 100%; border-radius: 3px; transition: width 0.3s, background 0.3s; }
.diplo-rel-marker {
    position: absolute; top: -2px; width: 2px; height: 10px;
    background: rgba(255,255,255,0.3); transform: translateX(-50%);
}

.diplo-card-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.diplo-row { /* legacy compat — keep for old references */ }
.diplo-nation { display: flex; align-items: center; gap: 8px; }
.diplo-status { font-size: 0.75rem; padding: 3px 8px; border-radius: 3px; }
.diplo-status.neutral { background: var(--bg-panel-alt); color: var(--text-dim); }
.diplo-status.ally { background: rgba(0,230,118,0.15); color: var(--green); }
.diplo-status.war { background: rgba(255,23,68,0.15); color: var(--red); }
.diplo-status.sanctions { background: rgba(255,170,0,0.15); color: var(--accent3); }

/* Production */
.production-content { max-width: 750px; }
.production-content .prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-2); }
.prod-card {
    background: var(--bg-panel-alt); border: 1px solid var(--border); border-radius: 8px;
    padding: var(--sp-3) var(--sp-3) var(--sp-2); text-align: center; cursor: pointer;
    transition: all 0.2s var(--ease-out);
}
.prod-card:hover { border-color: var(--green); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,230,118,0.15); }
.prod-card .prod-icon { font-size: 2rem; margin-bottom: 2px; }
.prod-card .prod-name { font-family: var(--font-title); font-size: 0.7rem; margin-top: var(--sp-1); letter-spacing: 0.5px; }
.prod-card .prod-cost { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--gold); margin-top: var(--sp-1); }
.prod-card.disabled { opacity: 0.35; cursor: not-allowed; filter: grayscale(0.5); }

/* Production army summary */
.prod-army-summary { background: var(--bg-panel-alt); border-radius: 6px; padding: 12px; margin-bottom: 12px; border: 1px solid var(--border); }
.prod-army-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.prod-army-item { font-family: var(--font-mono); font-size: 0.8rem; background: var(--bg-dark); padding: 3px 8px; border-radius: 3px; color: var(--gold); }

/* Economy panel */
.economy-content { max-width: 820px; }
.econ-section { margin-bottom: var(--sp-4); padding-bottom: var(--sp-3); border-bottom: 1px solid var(--border-subtle); }
.econ-section:last-child { border-bottom: none; }
.econ-section h4 { font-family: var(--font-title); font-size: var(--fs-base); color: var(--accent); margin-bottom: var(--sp-2); letter-spacing: 1px; }
.econ-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--sp-2); }
.econ-item {
    display: flex; align-items: center; gap: var(--sp-2);
    background: var(--bg-panel-alt); border: 1px solid var(--border-subtle);
    padding: var(--sp-2) var(--sp-3); border-radius: 6px; font-size: var(--fs-base);
    transition: border-color 0.15s;
}
.econ-item:hover { border-color: var(--border); }
.econ-icon { font-size: var(--fs-xl); flex-shrink: 0; }
.econ-name { flex: 1; color: var(--text); }
.econ-val { font-family: var(--font-mono); color: var(--gold); font-weight: 700; min-width: 40px; text-align: right; }
.econ-val.econ-pos { color: var(--green); }

.econ-section-army { border-bottom: none; padding-bottom: 0; }
.army-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--sp-2);
    margin-bottom: var(--sp-3);
}
.army-summary-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(14,21,33,0.92) 100%);
}
.army-summary-card-atk { box-shadow: inset 0 1px 0 rgba(255,23,68,0.12); }
.army-summary-card-def { box-shadow: inset 0 1px 0 rgba(0,229,255,0.12); }
.army-summary-card-units { box-shadow: inset 0 1px 0 rgba(255,215,64,0.14); }
.army-summary-label {
    font-size: 0.58rem;
    letter-spacing: 1.2px;
    color: var(--text-dim);
    text-transform: uppercase;
}
.army-summary-value {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 700;
}
.army-summary-card-atk .army-summary-value { color: var(--red); }
.army-summary-card-def .army-summary-value { color: var(--accent); }
.army-summary-card-units .army-summary-value { color: var(--gold); }

.army-unit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--sp-2);
}
.army-unit-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    background: linear-gradient(180deg, rgba(28,39,57,0.95) 0%, rgba(18,26,40,0.96) 100%);
    transition: transform 0.18s var(--ease-out), border-color 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
}
.army-unit-card:hover {
    border-color: rgba(0,229,255,0.25);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.18);
}
.army-unit-head {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.army-unit-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 10px;
    background: rgba(8,13,23,0.85);
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 1.35rem;
}
.army-unit-copy {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    width: 100%;
}
.army-unit-name {
    min-width: 0;
    font-family: var(--font-title);
    font-size: 0.72rem;
    line-height: 1.3;
    letter-spacing: 0.6px;
    color: var(--text);
    text-transform: uppercase;
}
.army-unit-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 38px;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(255,215,64,0.12);
    border: 1px solid rgba(255,215,64,0.25);
    color: var(--gold);
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 700;
}
.army-unit-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.army-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(8,13,23,0.62);
    border: 1px solid rgba(255,255,255,0.06);
}
.army-stat-k {
    font-size: 0.56rem;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: var(--text-dim);
}
.army-stat-v {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
}
.army-stat-atk .army-stat-v { color: var(--red); }
.army-stat-def .army-stat-v { color: var(--accent); }

/* Game over */
.gameover-content { text-align: center; max-width: 480px; }
.gameover-content h2 { font-size: 1.6rem; margin-bottom: 4px; letter-spacing: 1px; }
.gameover-content p { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 8px; }

/* Hero flag */
.go-hero-flag {
    display: flex; justify-content: center; margin: 12px 0 14px;
}
.go-flag-img {
    width: 120px; height: 80px; object-fit: contain;
    border-radius: 8px; border: 2px solid rgba(255,255,255,0.12);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

/* Victory type badge */
.go-victory-badge {
    display: flex; flex-direction: column; align-items: center;
    background: rgba(255,215,0,0.06); border: 1px solid rgba(255,215,0,0.2);
    border-radius: 8px; padding: 8px 16px; margin-bottom: 14px;
}
.go-vb-icon { font-size: 1.2rem; }
.go-vb-label { font-family: var(--font-mono); font-size: 0.95rem; color: var(--gold); font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.go-vb-desc { font-size: 0.65rem; color: #78909c; margin-top: 2px; }

/* Stat grid */
.go-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.go-stat {
    background: var(--bg-panel-alt); border: 1px solid var(--border-subtle);
    border-radius: 8px; padding: 8px 6px;
}
.go-stat .label { font-size: 0.6rem; color: var(--text-dim); margin-bottom: 2px; text-transform: uppercase; letter-spacing: 0.5px; }
.go-stat .val { font-family: var(--font-mono); font-size: 0.9rem; color: var(--gold); font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 4px; }
.go-stat-flag { width: 1.1em; height: 1.1em; object-fit: contain; vertical-align: -0.1em; }
.go-buttons {
    display: flex; gap: 10px; justify-content: center; margin-top: 14px;
    padding-bottom: 0;
}
.go-buttons .btn-main { flex: 0 1 180px; margin: 0; padding: 10px 14px; line-height: 1; font-size: 0.8rem; }
.btn-view-map {
    background: transparent !important;
    border: 2px solid var(--accent) !important;
    color: var(--accent) !important;
}
.btn-view-map:hover { background: rgba(0,229,255,0.15) !important; }

/* ── Victory Banner (persistent after modal close) ── */
.victory-banner {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 600;
    display: flex; align-items: center; justify-content: center; gap: 16px;
    padding: 8px 16px;
    background: linear-gradient(90deg, #0d3a5c 0%, #0a4a7a 30%, #0d3a5c 100%);
    border-bottom: 2px solid var(--accent);
    box-shadow: 0 2px 16px rgba(0,229,255,0.25);
    font-family: var(--font-title);
    animation: victoryBannerIn 0.4s ease;
}
.victory-banner.hidden { display: none; }
.victory-banner-text {
    font-size: 0.9rem; font-weight: 700; color: var(--gold);
    letter-spacing: 1px; text-shadow: 0 0 8px rgba(255,215,0,0.4);
}
.victory-banner .btn-sm {
    padding: 4px 14px; border-radius: 6px; font-size: 0.7rem;
    font-weight: 700; cursor: pointer; border: 1px solid;
    text-transform: uppercase; letter-spacing: 0.5px;
    transition: background 0.2s, transform 0.1s;
}
.victory-banner .btn-sm:hover { transform: scale(1.05); }
.victory-banner .btn-restart-sm {
    background: rgba(0,229,255,0.15); border-color: var(--accent); color: var(--accent);
}
.victory-banner .btn-restart-sm:hover { background: rgba(0,229,255,0.3); }
.victory-banner .btn-details-sm {
    background: rgba(255,215,0,0.1); border-color: var(--gold); color: var(--gold);
}
.victory-banner .btn-details-sm:hover { background: rgba(255,215,0,0.25); }
@keyframes victoryBannerIn {
    from { transform: translateY(-100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* ═══════════════ ANIMATIONS ═══════════════ */
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }
@keyframes slideUp { from{transform:translateY(20px);opacity:0} to{transform:translateY(0);opacity:1} }
@keyframes playerGlow { 0%,100%{box-shadow:0 0 8px rgba(0,229,255,0.4)} 50%{box-shadow:0 0 20px rgba(0,229,255,0.7)} }
.anim-pulse { animation: pulse 2s infinite; }
.anim-slideUp { animation: slideUp 0.4s ease-out; }

/* ═══════════════ AI OVERLAY ═══════════════ */
.ai-overlay {
    position: fixed; top: 60px; right: 270px;
    width: 400px; max-height: 55vh;
    background: rgba(10,14,23,0.97);
    border: 1px solid var(--accent);
    border-radius: 10px;
    z-index: 200;
    overflow: hidden;
    box-shadow: 0 4px 40px rgba(0,229,255,0.25), inset 0 0 30px rgba(0,229,255,0.03);
    backdrop-filter: blur(8px);
}
.ai-overlay.hidden { display: none; }
.ai-overlay-content h3 {
    font-family: var(--font-title);
    color: var(--accent);
    font-size: 0.9rem;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    text-align: center;
    letter-spacing: 3px;
    background: linear-gradient(180deg, rgba(0,229,255,0.08), transparent);
    animation: pulse 2s infinite;
}
.ai-progress-bar {
    height: 3px; background: var(--bg-dark); margin: 0;
}
.ai-progress-fill {
    height: 100%; background: var(--accent); width: 0;
    animation: aiProgressAnim 4s ease-out forwards;
}
@keyframes aiProgressAnim { 0%{width:0} 100%{width:100%} }
.ai-feed {
    max-height: 44vh;
    overflow-y: auto;
    padding: 8px 12px;
}
.ai-action-item {
    font-size: 0.75rem;
    padding: 6px 10px;
    margin-bottom: 4px;
    background: var(--bg-panel-alt);
    border-radius: 4px;
    border-left: 3px solid var(--accent);
    line-height: 1.4;
    animation: slideUp 0.25s ease-out;
}
/* Color-coded AI action types */
.ai-act-attack { border-left-color: var(--red); background: rgba(255,23,68,0.06); }
.ai-act-war { border-left-color: #ff6600; background: rgba(255,102,0,0.06); }
.ai-act-nuke { border-left-color: #ff00ff; background: rgba(255,0,255,0.08); }
.ai-act-ally { border-left-color: var(--green); background: rgba(0,230,118,0.06); }
.ai-act-peace { border-left-color: var(--accent); background: rgba(0,229,255,0.06); }
.ai-act-diplo { border-left-color: var(--accent3); background: rgba(255,170,0,0.04); }
.ai-act-build { border-left-color: #78909c; background: rgba(120,144,156,0.04); }
.ai-act-tech { border-left-color: var(--gold); background: rgba(255,215,0,0.05); }
/* FROM → TO styling inside action items */
.ai-from { font-weight: 700; color: #fff; }
.ai-to { font-weight: 700; color: #fff; }
.ai-arrow { color: var(--accent3); font-weight: 900; font-size: 0.85rem; margin: 0 3px; }
.ai-terr { color: var(--text-dim); font-size: 0.65rem; font-family: var(--font-mono); }
/* AI summary */
.ai-action-summary {
    font-size: 0.75rem;
    padding: 10px 12px;
    margin-top: 6px;
    background: rgba(0,229,255,0.08);
    border: 1px solid rgba(0,229,255,0.2);
    border-radius: 6px;
    color: var(--accent);
    text-align: center;
    line-height: 1.6;
}

/* ═══════════════ SPECTATOR / AUTOPLAY BANNER ═══════════════ */
#spectator-banner {
    position: fixed;
    top: 46px; left: 0; right: 0;
    z-index: 300;
    height: 36px;
    display: flex; align-items: center; justify-content: center; gap: var(--sp-3);
    font-family: var(--font-title);
    font-size: var(--fs-sm);
    letter-spacing: 1px;
    padding: 0 var(--sp-4);
    animation: specSlideDown 0.4s var(--ease-out);
    pointer-events: auto;
    box-shadow: 0 2px 16px rgba(0,0,0,0.4);
}
/* When banner is visible, push side panels below it */
#spectator-banner:not(.hidden) ~ #map-container .side-panel,
#spectator-banner:not(.hidden) ~ .side-panel {
    top: 82px;
}
/* Also handle via body class for robustness */
body.spectator-active .side-panel {
    top: 82px !important;
}
#spectator-banner.banner-dead {
    background: linear-gradient(90deg, rgba(255,23,68,0.92), rgba(180,10,40,0.92));
    border-bottom: 2px solid var(--red);
}
#spectator-banner.banner-auto {
    background: linear-gradient(90deg, rgba(0,229,255,0.15), rgba(0,136,204,0.2));
    border-bottom: 2px solid var(--accent);
}
#spectator-banner.hidden { display: none !important; }
@keyframes specSlideDown {
    from { transform: translateY(-40px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
.spectator-label {
    color: #fff; font-weight: 700; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
    flex: 1; min-width: 0;
}
.spectator-btns {
    display: flex; gap: 6px; flex-shrink: 0;
}
.spectator-btns .btn-sm {
    font-family: var(--font-title);
    font-size: 0.6rem;
    padding: 3px 8px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 3px;
    background: rgba(0,0,0,0.3);
    color: #fff;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.2s;
}
.spectator-btns .btn-sm:hover { background: rgba(255,255,255,0.15); }
.spectator-btns .btn-sm.btn-stop { border-color: var(--red); color: var(--red); }
.spectator-btns .btn-sm.btn-stop:hover { background: var(--red); color: #fff; }

/* ═══════════════ REOPEN EVENT LOG BUTTON ═══════════════ */
.btn-reopen-events {
    position: fixed;
    right: 12px;
    top: 58px;
    z-index: 320;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-panel);
    color: var(--text);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.5);
    transition: all 0.25s ease;
    animation: fadeInRight 0.3s ease-out;
}
.btn-reopen-events:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    transform: scale(1.08);
}
.btn-reopen-events.hidden { display: none !important; }
body.spectator-active .btn-reopen-events { top: 86px; }

.btn-reopen-nations {
    position: fixed;
    left: 12px;
    top: 58px;
    z-index: 1;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-panel);
    color: var(--text);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.5);
    transition: all 0.25s ease;
    animation: fadeInLeft 0.3s ease-out;
}
.btn-reopen-nations:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    transform: scale(1.08);
}
.btn-reopen-nations.hidden { display: none !important; }
body.spectator-active .btn-reopen-nations { top: 86px; }
@keyframes fadeInRight {
    from { transform: translateX(30px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}
@keyframes fadeInLeft {
    from { transform: translateX(-30px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* ═══════════════ DIPLOMACY BUTTONS ═══════════════ */
.diplo-btn {
    font-family: var(--font-body); font-weight: 600;
    font-size: 0.72rem;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.2s;
    white-space: nowrap;
}
.diplo-btn:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.diplo-btn.ally { background: rgba(0,230,118,0.1); color: var(--green); border-color: var(--green); }
.diplo-btn.ally:hover { background: var(--green); color: var(--bg-dark); }
.diplo-btn.war { background: rgba(255,23,68,0.1); color: var(--red); border-color: var(--red); }
.diplo-btn.war:hover { background: var(--red); color: #fff; }
.diplo-btn.peace { background: rgba(0,229,255,0.1); color: var(--accent); border-color: var(--accent); }
.diplo-btn.peace:hover { background: var(--accent); color: var(--bg-dark); }
.diplo-btn.sanction { background: rgba(255,170,0,0.1); color: var(--accent3); border-color: var(--accent3); }
.diplo-btn.sanction:hover { background: var(--accent3); color: var(--bg-dark); }
.diplo-btn.trade { background: rgba(0,229,255,0.05); color: var(--text); border-color: var(--border); }
.diplo-btn.trade:hover { border-color: var(--accent); color: var(--accent); }
.diplo-btn.tribute { background: rgba(255,215,0,0.1); color: var(--gold); border-color: var(--gold); }
.diplo-btn.tribute:hover { background: var(--gold); color: var(--bg-dark); }
.diplo-btn.spy { background: rgba(156,39,176,0.1); color: #ce93d8; border-color: #ce93d8; }
.diplo-btn.spy:hover { background: #ce93d8; color: var(--bg-dark); }
.diplo-btn.betray { background: rgba(255,0,255,0.1); color: #ff00ff; border-color: #ff00ff; }
.diplo-btn.betray:hover { background: #ff00ff; color: #fff; }

/* ═══════════════ TRADE POPUP ═══════════════ */
.trade-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}
.trade-option {
    background: var(--bg-panel-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    transition: all 0.2s;
}
.trade-option:hover { border-color: var(--accent); background: rgba(0,229,255,0.08); }
.trade-option.disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }
.trade-feedback {
    display: none; text-align: center; padding: 6px 12px; border-radius: 6px;
    font-size: 0.78rem; font-weight: 600; margin-bottom: 10px;
    animation: tradeFeedbackIn 0.3s ease;
}
@keyframes tradeFeedbackIn {
    0% { opacity: 0; transform: translateY(-6px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ═══════════════ ACTION TOAST ═══════════════ */
.action-toast {
    position: fixed;
    top: 64px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 600;
    min-width: 280px;
    max-width: 420px;
    padding: 14px 22px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(17,24,39,0.97) 0%, rgba(13,18,30,0.98) 100%);
    border: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0,0,0,0.55), 0 0 1px rgba(0,229,255,0.15);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    gap: 14px;
    pointer-events: none;
    animation: toastIn 0.35s var(--ease-out) forwards;
}
.action-toast.hiding {
    animation: toastOut 0.4s var(--ease-out) forwards;
}
.action-toast .toast-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    line-height: 1;
    filter: drop-shadow(0 0 6px currentColor);
}
.action-toast .toast-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.action-toast .toast-title {
    font-family: var(--font-title);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.action-toast .toast-sub {
    font-size: 0.72rem;
    color: var(--text-dim);
    line-height: 1.3;
}
/* Border-glow color variants */
.action-toast.toast-warn    { border-color: rgba(255,152,0,0.5);  }
.action-toast.toast-warn .toast-icon  { color: #ff9800; }
.action-toast.toast-warn .toast-title { color: #ffcc80; }

.action-toast.toast-danger  { border-color: rgba(255,23,68,0.5);  }
.action-toast.toast-danger .toast-icon  { color: #ff1744; }
.action-toast.toast-danger .toast-title { color: #ff8a80; }

.action-toast.toast-success { border-color: rgba(0,230,118,0.45); }
.action-toast.toast-success .toast-icon  { color: #00e676; }
.action-toast.toast-success .toast-title { color: #b9f6ca; }

.action-toast.toast-info    { border-color: rgba(0,229,255,0.45); }
.action-toast.toast-info .toast-icon  { color: var(--accent); }
.action-toast.toast-info .toast-title { color: #b2ebf2; }

.action-toast.toast-gold    { border-color: rgba(255,215,0,0.45); }
.action-toast.toast-gold .toast-icon  { color: var(--gold); }
.action-toast.toast-gold .toast-title { color: #fff8e1; }

/* Progress bar (auto-dismiss indicator) */
.action-toast .toast-progress {
    position: absolute;
    bottom: 0; left: 0;
    height: 3px;
    border-radius: 0 0 12px 12px;
    background: currentColor;
    opacity: 0.4;
    animation: toastProgress var(--toast-dur, 2.5s) linear forwards;
}
@keyframes toastIn {
    0%   { opacity: 0; transform: translateX(-50%) translateY(-18px) scale(0.95); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes toastOut {
    0%   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-14px) scale(0.96); }
}
@keyframes toastProgress {
    0%   { width: 100%; }
    100% { width: 0%; }
}

/* ═══════════════ IMPROVED TOOLTIP ═══════════════ */
.map-tooltip .tt-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: var(--fs-xs);
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: var(--sp-1);
    font-weight: 700;
    letter-spacing: 0.5px;
}
.map-tooltip .tt-badge.mine { background: rgba(0,229,255,0.15); color: #00e5ff; border: 1px solid rgba(0,229,255,0.2); }
.map-tooltip .tt-badge.enemy { background: rgba(255,23,68,0.15); color: #ff1744; border: 1px solid rgba(255,23,68,0.2); }
.map-tooltip .tt-badge.ally-badge { background: rgba(0,230,118,0.15); color: #00e676; border: 1px solid rgba(0,230,118,0.2); }

/* ═══════════════ RESPONSIVE ═══════════════ */

/* ── Tablet ── */
@media (max-width: 1024px) {
    .hud-resources { gap: 4px; }
    .hud-res { font-size: 0.65rem; padding: 2px 6px; }
    .hud-res .res-inc { display: none; }
    .btn-hud { width: 32px; height: 28px; font-size: 0.9rem; }
    .btn-hud-primary { font-size: 0.65rem; padding: 0 8px; }
    .hud-divider { margin: 0 6px; }
    .side-panel { width: 240px; }
    #right-panel { width: 200px; }
    .popup-content { width: 95%; max-width: 600px; padding: 18px 20px; }
    .diplomacy-content { max-width: 95%; }
}

/* ── Mobile ── */
@media (max-width: 768px) {
    /* Intro */
    .game-title { font-size: 2.2rem; letter-spacing: 4px; }
    .game-subtitle { font-size: 0.8rem; letter-spacing: 3px; margin-bottom: 24px; }
    .intro-buttons { flex-direction: column; gap: 12px; align-items: center; }
    .btn-main { font-size: 0.85rem; padding: 10px 24px; }
    .btn-secondary { font-size: 0.75rem; padding: 8px 18px; }

    /* Nation select */
    #nation-select-screen { padding: 16px 12px; }
    .nation-select-header h2 { font-size: 1.3rem; }
    .btn-back { position: static; margin-bottom: 10px; font-size: 0.75rem; padding: 6px 12px; }
    .nation-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: var(--sp-2); padding-bottom: 12px; }
    .nation-card { padding: 10px 6px; }
    .nation-card .flag { min-height: 30px; margin-bottom: 6px; }
    .nation-card .nation-flag-img { width: 28px; height: 28px; }
    .nation-card .flag-img-fallback { min-width: 42px; height: 28px; font-size: 0.78rem; letter-spacing: 1px; }
    .nation-card .name { font-size: 0.6rem; }
    #nation-select-screen.preview-open { overflow: hidden; }
    #nation-select-screen.preview-open::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(4, 10, 18, 0.76);
        backdrop-filter: blur(4px);
        z-index: 1000;
    }
    .nation-preview {
        position: fixed !important;
        top: 50%;
        left: 50%;
        right: auto;
        bottom: auto;
        transform: translate(-50%, -50%);
        min-width: unset;
        width: min(92vw, 420px);
        max-height: min(78dvh, 620px);
        overflow-y: auto;
        padding: 14px 16px;
        border-radius: 12px;
        border: 1px solid var(--accent);
        margin-top: 0;
        flex-shrink: 0;
        z-index: 1001;
        box-shadow: 0 18px 60px rgba(0, 229, 255, 0.2);
    }
    .preview-stats { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .nation-grid { padding-bottom: 10px; }

    /* HUD */
    #top-hud { height: 38px; padding: 0 6px; }
    .hud-identity { gap: 5px; padding-right: 6px; }
    .hud-flag { font-size: 1.1rem; }
    .hud-name { font-size: 0.6rem; letter-spacing: 0.5px; max-width: 60px; overflow: hidden; text-overflow: ellipsis; }
    .hud-turn { font-size: 0.5rem; }
    .hud-divider { margin: 0 4px; height: 18px; }
    .hud-resources { gap: 3px; -webkit-overflow-scrolling: touch; }
    .hud-res { font-size: 0.55rem; padding: 2px 4px; gap: 2px; }
    .hud-res .res-icon { font-size: 0.6rem; }
    .hud-res .res-inc { display: none; }
    .hud-actions { gap: 3px; padding-left: 6px; }
    .hud-actions-sep { display: none; }
    .btn-hud { width: 28px; height: 26px; font-size: 0.8rem; border-radius: 4px; }
    .btn-hud-primary { font-size: 0.55rem; padding: 0 6px; width: auto; }

    /* Side panels */
    .side-panel {
        top: 38px; bottom: 36px;
        border-radius: 0; max-height: none;
    }
    #left-panel {
        width: min(52%, 260px) !important;
        top: 38px; bottom: 36px;
        border-radius: 0 8px 8px 0;
        max-height: none;
    }
    #right-panel {
        width: min(48%, 240px) !important;
        top: 38px; bottom: 36px;
        max-height: none; border-radius: 8px 0 0 0;
    }

    /* Bottom bar */
    #bottom-panel { height: 36px; padding: 4px 8px; }
    .mil-unit { font-size: 0.65rem; padding: 3px 6px; }
    .mil-unit .mil-icon { font-size: 0.85rem; }

    /* Map */
    #map-container { touch-action: none; }
    .map-tooltip { font-size: 0.7rem; padding: 8px 12px; max-width: min(220px, calc(100vw - 24px)); }
    .map-tooltip.tt-interactive { padding: 10px 14px; padding-top: 28px; }
    .map-tooltip .tt-hint { font-size: 0.6rem; }
    /* Popups */
    .popup-content { width: 95%; max-width: 95vw; padding: 14px 16px; max-height: 85vh; }
    .popup-content h3, .popup-content h2 { font-size: 1rem; margin-bottom: 10px; }
    .btl-grid { gap: 4px; }
    .btl-col { padding: 6px 5px; }
    .btl-nation { font-size: 0.68rem; }
    .btl-u { font-size: 0.6rem; }
    .btl-pow { font-size: 0.58rem; }
    .btl-body { padding: 0 8px 0; }
    .btl-header { padding: 10px 12px 4px; }
    .btl-header h3 { font-size: 0.9rem; letter-spacing: 2px; }
    .battle-result { font-size: 0.75rem; padding: 5px 8px; }
    .btl-mod-box { padding: 3px 5px; font-size: 0.52rem; line-height: 1.5; }
    .btl-mod-result-box { padding: 2px 4px; font-size: 0.6rem; }
    .btl-mod-result-box strong { font-size: 0.68rem; }
    .tech-tier-grid { grid-template-columns: 1fr; gap: 6px; }
    .tech-card { padding: 8px 10px; gap: 8px; }
    .tech-card-icon { font-size: 1.3rem; width: 26px; }
    .tech-card .tech-name { font-size: 0.65rem; }
    .tech-card .tech-name { font-size: 0.6rem; }
    .production-content .prod-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
    .economy-content { max-width: 100%; }
    .army-summary-grid { gap: 6px; margin-bottom: 10px; }
    .army-summary-card { padding: 10px 8px; gap: 4px; }
    .army-summary-label { font-size: 0.5rem; letter-spacing: 0.8px; }
    .army-summary-value { font-size: 0.76rem; gap: 4px; }
    .army-unit-grid { grid-template-columns: 1fr; gap: 8px; }
    .army-unit-card { padding: 10px; gap: 10px; }
    .army-unit-head { gap: 10px; }
    .army-unit-icon { width: 36px; height: 36px; font-size: 1.15rem; border-radius: 8px; }
    .army-unit-name { font-size: 0.64rem; letter-spacing: 0.45px; }
    .army-unit-count { min-width: 34px; padding: 4px 7px; font-size: 0.68rem; }
    .army-stat { padding: 7px 8px; }
    .army-stat-k { font-size: 0.5rem; }
    .army-stat-v { font-size: 0.72rem; }
    .diplomacy-content { max-width: 100%; width: 100%; }
    .diplo-card-flag { width: 36px; height: 36px; font-size: 0.72rem; letter-spacing: 0.7px; }
    .diplo-player-mark { width: 42px; height: 42px; font-size: 0.72rem; letter-spacing: 0.7px; }
    .diplo-card-name { font-size: 0.75rem; }
    .diplo-card-actions { gap: 4px; }
    .diplo-btn { font-size: 0.6rem; padding: 4px 7px; }
    .go-stats-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
    .go-flag-img { width: 80px; height: 54px; }
    .gameover-content { max-width: 95vw; }
    .gameover-content h2 { font-size: 1.1rem; margin-bottom: 2px; }
    .gameover-content p { font-size: 0.75rem; margin-bottom: 4px; }
    .go-hero-flag { margin: 6px 0 8px; }
    .go-victory-badge { padding: 5px 12px; margin-bottom: 8px; }
    .go-vb-icon { font-size: 1rem; }
    .go-vb-label { font-size: 0.8rem; }
    .go-vb-desc { font-size: 0.58rem; }
    .go-stat .label { font-size: 0.52rem; }
    .go-stat .val { font-size: 0.8rem; }
    .go-stat { padding: 5px 4px; }
    .go-buttons { margin-top: 10px; gap: 8px; }
    .go-buttons .btn-main { font-size: 0.7rem; padding: 8px 10px; }

    /* Spectator / autoplay banner */
    #spectator-banner { top: 40px; height: 32px; font-size: 0.62rem; gap: 6px; }
    .spectator-label { font-size: 0.6rem; }
    .spectator-btns .btn-sm { font-size: 0.55rem; padding: 3px 8px; }
    body.spectator-active .side-panel { top: 74px !important; }

    /* Event log */
    .event-item { font-size: 0.78rem; padding: 3px 5px; margin-bottom: 4px; line-height: 1.3; }
    .event-item .evt-turn { font-size: 0.58rem; padding: 1px 4px; margin-right: 4px; }
    .evt-flag { width: 8px; height: 8px; margin: 0 3px 0 0; }
    .event-item img.emoji { height: 1em; width: 1em; margin: 0 .03em 0 .03em; vertical-align: -0.12em; }
    .btn-live { font-size: 0.6rem; padding: 3px 10px; }
    #right-panel.evt-fullscreen .event-item { font-size: 0.78rem; padding: 4px 6px; }

    /* Action toast */
    .action-toast { min-width: 220px; max-width: 88vw; padding: 10px 16px; gap: 10px; top: 46px; }
    .action-toast .toast-icon { font-size: 1.4rem; }
    .action-toast .toast-title { font-size: 0.72rem; }
    .action-toast .toast-sub { font-size: 0.64rem; }
}

/* ── Small phones ── */
@media (max-width: 480px) {
    .game-title { font-size: 1.8rem; }
    #top-hud { height: 36px; }
    .hud-name { display: none; }
    .hud-resources { gap: 2px; }
    .hud-res { font-size: 0.55rem; padding: 1px 4px; }
    .btn-hud { font-size: 0.5rem; padding: 3px 5px; }
    #bottom-panel { height: 32px; }
    .mil-unit { font-size: 0.55rem; padding: 2px 4px; }
    .side-panel { max-height: none; top: 36px; bottom: 32px; }
    #left-panel { width: min(65%, 230px) !important; top: 36px; bottom: 32px; }
    #right-panel { width: min(55%, 200px) !important; }
    .popup-content { padding: 10px 12px; }
    .army-summary-grid { grid-template-columns: 1fr; }
    .army-unit-stats { grid-template-columns: 1fr 1fr; }
}

@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-height: 500px) {
    /* Gameover popup — compact horizontal layout */
    .gameover-content {
        max-width: 90vw;
        max-height: 92vh;
        padding: 10px 16px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .gameover-content h2 { font-size: 1rem; margin-bottom: 0; }
    .gameover-content p { font-size: 0.7rem; margin-bottom: 2px; }
    .go-hero-flag { margin: 4px 0 6px; }
    .go-flag-img { width: 60px; height: 40px; border-radius: 6px; }
    .go-victory-badge { padding: 3px 10px; margin-bottom: 6px; flex-direction: row; gap: 6px; }
    .go-vb-icon { font-size: 0.85rem; }
    .go-vb-label { font-size: 0.72rem; }
    .go-vb-desc { display: none; }
    .go-stats-grid { grid-template-columns: repeat(4, 1fr); gap: 4px; width: 100%; }
    .go-stat { padding: 4px 3px; }
    .go-stat .label { font-size: 0.48rem; }
    .go-stat .val { font-size: 0.7rem; }
    .go-buttons { margin-top: 6px; gap: 6px; }
    .go-buttons .btn-main { font-size: 0.65rem; padding: 6px 10px; flex: 0 1 140px; }

    #left-panel {
        width: min(30vw, 220px) !important;
        top: 38px; bottom: 36px;
        max-height: none;
    }
    #right-panel {
        top: 38px;
        right: 0;
        bottom: 36px;
        left: auto;
        width: min(28vw, 260px) !important;
        max-height: none;
        border-radius: 12px 0 0 12px;
        border-right: none;
        border-left: 1px solid var(--border);
        box-shadow: -8px 0 28px rgba(0,0,0,0.28);
        z-index: 315;
    }
    #right-panel > .panel-header {
        min-height: 52px;
        padding: 10px 12px;
        gap: 10px;
    }
    #right-panel > .panel-header h3 {
        /**font-size: 0.95rem;*/
        letter-spacing: 1px;
    }
    #right-panel .panel-btn,
    #right-panel .panel-close {
        width: 34px;
        height: 34px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        font-size: 0.95rem;
        border-radius: 8px;
    }
    #right-panel .event-log {
        padding: 10px;
    }
    #right-panel .event-item {
        padding: 6px 8px;
        margin-bottom: 6px;
        font-size: 0.78rem;
        line-height: 1.35;
        border-left-width: 3px;
        border-radius: 0 8px 8px 0;
    }
    #right-panel .event-item .evt-turn {
        display: inline-flex;
        align-items: center;
        margin-bottom: 4px;
    }
    #right-panel .btn-live {
        left: 10px;
        right: 10px;
        bottom: 8px;
        transform: none;
        text-align: center;
    }
    #right-panel .btn-live:hover {
        transform: scale(1.03);
    }

    .btn-reopen-events {
        top: 92px;
        right: 0px;
        width: 30px;
        height: 72px;
        border-radius: 12px 0 0 12px;
        writing-mode: vertical-rl;
        text-orientation: mixed;
        padding: 8px 0;
        font-size: 1rem;
        letter-spacing: 2px;
    }
    body.spectator-active .btn-reopen-events {
        top: 118px;
    }

    .btn-reopen-nations {
        top: 92px;
        left: 0px;
        width: 30px;
        height: 72px;
        border-radius: 0 12px 12px 0;
        writing-mode: vertical-rl;
        text-orientation: mixed;
        padding: 8px 0;
        font-size: 1rem;
        letter-spacing: 2px;
    }
    body.spectator-active .btn-reopen-nations {
        top: 118px;
    }

}

/* ═══════════ BADGE SYSTEM (replaces scattered inline badge styles) ═══════════ */
.ui-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 4px;
    font-size: var(--fs-sm); font-weight: 600;
    letter-spacing: 0.3px; white-space: nowrap;
}
.ui-badge-mine { background: rgba(0,229,255,0.15); color: #00e5ff; }
.ui-badge-war { background: rgba(255,23,68,0.15); color: #ff1744; }
.ui-badge-ally { background: rgba(0,230,118,0.15); color: #00e676; }
.ui-badge-dead { background: rgba(255,110,64,0.15); color: #ff6e40; }
.ui-badge-neutral { background: rgba(255,255,255,0.06); color: var(--text-dim); }
.ui-badge-spectator { background: rgba(255,23,68,0.2); color: #ff6e40; font-weight: 700; }

/* Panel slide-in animation */
#left-panel { animation: panelSlideInLeft 0.25s var(--ease-out); }
@keyframes panelSlideInLeft {
    from { opacity: 0; transform: translateX(-16px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ═══════════ SPY INTEL POPUP ═══════════ */
.spy-content { max-width: 480px; }
.spy-content h3 { margin-bottom: 12px; }
.spy-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.spy-section { margin-bottom: 14px; }
.spy-section h4 { font-family: 'Rajdhani', sans-serif; font-size: 0.9rem; color: var(--accent, #00e5ff); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.spy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.spy-res, .spy-unit { font-size: 0.85rem; color: #cfd8dc; padding: 2px 0; }
.spy-res strong, .spy-unit strong { color: #fff; }
.spy-tech { display: inline-block; font-size: 0.78rem; background: rgba(0,229,255,0.1); border: 1px solid rgba(0,229,255,0.2); border-radius: 4px; padding: 2px 8px; margin: 2px; color: #80deea; }

/* ═══════════ NAP INFO OVERLAY ═══════════ */
.nap-info-overlay {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    animation: napFadeIn 0.25s ease-out;
}
@keyframes napFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.nap-info-card {
    background: var(--bg-card, #1a1a2e);
    border: 1px solid rgba(0,229,255,0.25);
    border-radius: 14px;
    padding: 28px 32px 22px;
    max-width: 360px; width: 90%;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 80px rgba(0,229,255,0.08);
    animation: napSlideUp 0.3s ease-out;
}
@keyframes napSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.nap-info-icon {
    font-size: 2.4rem; margin-bottom: 6px;
}
.nap-info-title {
    font-family: var(--font-title, 'Rajdhani', sans-serif);
    font-size: 1.1rem; font-weight: 700;
    color: var(--accent, #00e5ff);
    text-transform: uppercase; letter-spacing: 2px;
    margin-bottom: 8px;
}
.nap-info-nation {
    font-size: 1rem; color: #eceff1;
    margin-bottom: 14px;
}
.nap-info-detail {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
}
.nap-info-row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.82rem; color: #b0bec5;
    padding: 4px 0;
}
.nap-info-row + .nap-info-row {
    border-top: 1px solid rgba(255,255,255,0.04);
}
.nap-info-hint {
    font-size: 0.72rem; color: var(--text-dim, #78909c);
    line-height: 1.45; margin-bottom: 16px;
    padding: 0 8px;
}
.nap-info-close {
    background: rgba(0,229,255,0.12);
    border: 1px solid rgba(0,229,255,0.3);
    color: var(--accent, #00e5ff);
    font-family: var(--font-title, 'Rajdhani', sans-serif);
    font-size: 0.85rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1.5px;
    padding: 8px 32px; border-radius: 6px;
    cursor: pointer; transition: all 0.2s;
}
.nap-info-close:hover {
    background: rgba(0,229,255,0.22);
    border-color: rgba(0,229,255,0.5);
}
