* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --iran: #009b3a;
    --iran-glow: rgba(0, 155, 58, 0.4);
    --hez: #ffd700;
    --hez-glow: rgba(255, 215, 0, 0.4);
    --houthi: #c0492c;
    --houthi-glow: rgba(192, 73, 44, 0.45);
    --missiles: #ff4444;
    --drones: #8b5cf6;
    --bg: #0a0a0f;
    --card-bg: #131320;
    --card-border: #1e1e30;
    --text: #e0e0e0;
    --muted: #777;
    --accent: #ff3b3b;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: scroll;
}

/* Header */
header {
    text-align: center;
    padding: 0.8rem 1rem 0.4rem;
    background: linear-gradient(180deg, #1a0a0a 0%, var(--bg) 100%);
    position: relative;
}

/* Live indicator */
.live-indicator {
    position: absolute;
    top: 0.6rem;
    left: 0.8rem;
    font-size: 0.6rem;
    font-weight: 700;
    color: #555;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    letter-spacing: 0.05em;
}
.live-indicator .live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #555;
}
.live-indicator.connected {
    color: #4caf50;
}
.live-indicator.connected .live-dot {
    background: #4caf50;
}
.live-indicator.live-active {
    color: #e53935;
}
.live-indicator.live-active .live-dot {
    background: #e53935;
    animation: pulse-live 1s ease-in-out infinite;
}
.live-indicator.live-pre {
    color: #ff8c00;
}
.live-indicator.live-pre .live-dot {
    background: #ff8c00;
    animation: pulse-live 1.5s ease-in-out infinite;
}
@keyframes pulse-live {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(229,57,53,0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 0 4px rgba(229,57,53,0); }
}


header h1 { font-size: 1.4rem; color: var(--accent); margin-bottom: 0.1rem; }
header h2 { font-size: 0.8rem; color: var(--muted); font-weight: 400; margin-bottom: 0.1rem; }
header .seo-desc { font-size: 0.65rem; color: #444; max-width: 500px; margin: 0 auto; line-height: 1.4; }

/* Control bar */
.top-section {
    max-width: 580px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.control-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0;
}

.control-bar select,
.control-bar input {
    height: 2.5em;
    box-sizing: border-box;
}

.control-bar-right {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.control-bar-center {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.control-bar-left {
    flex-shrink: 0;
}

.control-range-select {
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    border: 1px solid #333;
    background: var(--card-bg);
    color: var(--text);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 70px;
    direction: rtl;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%23777'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 0.4rem center;
    padding-left: 1.2rem;
}
.control-range-select:hover { border-color: #555; }

.control-date-input {
    padding: 0.45rem 0.5rem;
    border-radius: 8px;
    border: 1px solid #333;
    background: var(--card-bg);
    color: var(--text);
    font-size: 0.8rem;
    width: 120px;
    -webkit-appearance: none;
    appearance: none;
}

.control-view-select {
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    border: 1px solid #333;
    background: var(--card-bg);
    color: var(--text);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 70px;
    direction: rtl;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%23777'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 0.4rem center;
    padding-left: 1.2rem;
}
.control-view-select:hover { border-color: #555; }

.search-wrapper { position: relative; flex: 1; min-width: 0; }

.search-wrapper input {
    width: 100%;
    padding: 0.45rem 0.6rem;
    padding-left: 1.5rem;
    border-radius: 8px;
    border: 1px solid #333;
    background: var(--card-bg);
    color: var(--text);
    font-size: 0.8rem;
    direction: rtl;
    text-align: right;
}

.search-clear {
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    display: none;
}
.search-clear:hover { color: var(--text); }

.search-results {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: #1a1a28;
    border: 1px solid #333;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
}

.search-item {
    padding: 0.45rem 0.7rem;
    cursor: pointer;
    direction: rtl;
    text-align: right;
    font-size: 0.85rem;
    transition: background 0.1s;
}

.search-item:hover { background: #252535; }
.search-item.dim { color: #666; }
.search-item .search-count { color: #666; font-size: 0.75rem; }

.city-controls-bar {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.4rem 1rem;
    max-width: 540px;
    margin: 0 auto;
}

#back-btn {
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s;
    flex-shrink: 0;
}
#back-btn:hover { background: rgba(255,59,59,0.1); }

/* ===== OVERVIEW PAGE ===== */

/* Summary stats row */
.overview-stats {
    display: flex;
    gap: 0.5rem;
    padding: 0.8rem 0;
}

.overview-stat {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.5rem 0.3rem;
    text-align: center;
    flex: 1;
    min-width: 0;
}
.overview-stat {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.overview-stat:hover {
    transform: scale(1.05);
}
.overview-stat.active-filter {
    background: rgba(255,255,255,0.08);
    transform: scale(1.05);
}
.overview-stat.iran.active-filter { box-shadow: 0 0 12px rgba(0, 155, 58, 0.4); }
.overview-stat.hezbollah.active-filter { box-shadow: 0 0 12px rgba(255, 215, 0, 0.4); }
.overview-stat.missiles.active-filter { box-shadow: 0 0 12px rgba(255, 68, 68, 0.4); }
.overview-stat.drones.active-filter { box-shadow: 0 0 12px rgba(139, 92, 246, 0.4); }

.overview-stat .value { font-size: clamp(0.95rem, 4vw, 1.4rem); font-weight: 700; color: var(--accent); white-space: nowrap; line-height: 1.15; }
.overview-stat .label { font-size: 0.65rem; color: var(--muted); margin-top: 0.1rem; }
.overview-stat.iran { border-color: var(--iran); }
.overview-stat.iran .value { color: var(--iran); }
.overview-stat.hezbollah { border-color: var(--hez); }
.overview-stat.hezbollah .value { color: var(--hez); }

.overview-stat.iran .label { color: var(--iran); }
.overview-stat.hezbollah .label { color: var(--hez); }
.overview-stat.missiles { border-color: var(--missiles); }
.overview-stat.missiles .value { color: var(--missiles); }
.overview-stat.missiles .label { color: var(--missiles); }
.overview-stat.drones { border-color: var(--drones); }
.overview-stat.drones .value { color: var(--drones); }
.overview-stat.drones .label { color: var(--drones); }

/* ===== MAP ===== */
.map-section {
    margin: 0.5rem 0;
}

/* --- Live card (click to pop the unified map up in the modal) --- */
.live-map-section {
    margin: 0.6rem 0 0.4rem;
}
.salvo-card.live-card {
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.salvo-card.live-card:hover {
    transform: translateY(-2px);
}
.salvo-card.live-card.iran {
    border-color: var(--iran);
    box-shadow: 0 0 16px var(--iran-glow), 0 4px 18px rgba(0, 0, 0, 0.4);
}
.salvo-card.live-card.hezbollah {
    border-color: var(--hez);
    box-shadow: 0 0 16px var(--hez-glow), 0 4px 18px rgba(0, 0, 0, 0.4);
}

.map-perspective {
    display: flex;
    justify-content: center;
}

.map-svg-wrap {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.6rem;
    position: relative;
    width: 100%;
    max-width: 240px;
    overflow: hidden;
}

.map-svg-wrap svg.map-svg {
    width: 100%;
    height: auto;
    display: block;
    position: relative;
    z-index: 2;
}

.map-svg-wrap .heatmap-layer {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    width: calc(100% - 1.2rem);
    height: calc(100% - 1.2rem);
    z-index: 1;
    pointer-events: none;
    opacity: 0.65;
    border-radius: 6px;
}

.map-svg-wrap .israel-outline {
    fill: none;
    stroke: rgba(255,255,255,0.35);
    stroke-width: 4;
}

.map-svg-wrap .region-outline {
    fill: none;
    stroke: rgba(255,255,255,0.2);
    stroke-width: 3;
    stroke-dasharray: 12 8;
}

.map-svg-wrap .map-label {
    fill: rgba(255,255,255,0.9);
    font-size: 34px;
    font-weight: 500;
    font-family: inherit;
    pointer-events: none;
}

.map-svg-wrap .map-dot {
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.map-svg-wrap .map-dot:hover {
    filter: brightness(1.3);
}

.map-svg-wrap .map-dot.dimmed {
    opacity: 0.15;
}

.map-svg-wrap .map-dot.highlighted {
    opacity: 1;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 0.5; }
}

.map-svg-wrap .map-dot.pulse {
    animation: pulse-dot 2s ease-in-out infinite;
}

.map-tooltip {
    position: absolute;
    background: rgba(19, 19, 32, 0.95);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    color: var(--text);
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
    direction: rtl;
    transform: translate(-50%, -100%);
    margin-top: -8px;
}

.map-tooltip .tooltip-name { font-weight: 600; }
.map-tooltip .tooltip-count { color: var(--muted); font-size: 0.65rem; }

/* Salvo browser strip */
.salvo-browser {
    margin-top: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.4rem;
    direction: rtl;
}

.salvo-browser-inner {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}

.salvo-browser-inner::-webkit-scrollbar { height: 4px; }
.salvo-browser-inner::-webkit-scrollbar-track { background: transparent; }
.salvo-browser-inner::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

.salvo-chip {
    flex-shrink: 0;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    border: 1px solid #333;
    background: transparent;
    color: var(--muted);
    font-size: 0.65rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.salvo-chip:hover { border-color: #555; color: var(--text); }
.salvo-chip.active { background: #2a2a40; border-color: #555; color: var(--text); }
.salvo-chip.iran { border-color: var(--iran); }
.salvo-chip.iran.active { background: rgba(0,155,58,0.15); color: var(--iran); }
.salvo-chip.hezbollah { border-color: var(--hez); }
.salvo-chip.hezbollah.active { background: rgba(255,215,0,0.15); color: var(--hez); }

.salvo-nav-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.2rem;
    line-height: 1;
}
.salvo-nav-btn:hover { color: var(--text); }

.salvo-back-btn {
    flex-shrink: 0;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
    font-size: 0.65rem;
    cursor: pointer;
    white-space: nowrap;
}
.salvo-back-btn:hover { background: rgba(255,59,59,0.1); }

.salvo-info-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(19,19,32,0.9);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    font-size: 0.65rem;
    color: var(--text);
    direction: rtl;
    z-index: 5;
}

/* Salvo list (data view) */
.salvo-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.salvo-list h3 {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.3rem;
    font-weight: 400;
    text-align: center;
}

/* --- Salvo card --- */
.salvo-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    direction: rtl;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.salvo-card:hover {
    border-color: rgba(255,255,255,0.12);
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
    transform: translateY(-1px);
}

.salvo-card:active {
    transform: scale(0.99);
}

.salvo-card-content {
    flex: 1;
    min-width: 0;
}

.card-mini-map {
    width: 32px;
    height: 76px;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.salvo-card:hover .card-mini-map {
    opacity: 0.9;
}

@media (max-width: 600px) {
    .card-mini-map {
        width: 28px;
        height: 66px;
        opacity: 0.75;
    }
}

/* Origin accent — left border */
.salvo-card.iran { border-right: 3px solid var(--iran); }
.salvo-card.hezbollah { border-right: 3px solid var(--hez); }

/* Active salvo glow */
.salvo-card.state-active {
    border-color: #e53935;
    box-shadow: 0 0 12px rgba(229, 57, 53, 0.25);
}
.salvo-card.state-active:hover {
    box-shadow: 0 0 18px rgba(229, 57, 53, 0.35);
}

/* Pre-alert glow */
.salvo-card.state-pre {
    border-color: #ff8c00;
    box-shadow: 0 0 10px rgba(255, 140, 0, 0.2);
}

/* Top row: state + time */
.salvo-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.salvo-card-time {
    font-size: 0.7rem;
    color: var(--muted);
    font-weight: 500;
}

/* State badge */
.salvo-card-state {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.salvo-card-state.state-ended {
    background: rgba(255,255,255,0.05);
    color: var(--muted);
}

.salvo-card-state.state-active {
    background: rgba(229, 57, 53, 0.15);
    color: #ff5252;
}
.salvo-card-state.state-active .state-icon {
    animation: pulse-icon 1s ease-in-out infinite;
}

.salvo-card-state.state-pre {
    background: rgba(255, 140, 0, 0.15);
    color: #ff8c00;
}
.salvo-card-state.state-pre .state-icon {
    animation: pulse-icon 1.5s ease-in-out infinite;
}

@keyframes pulse-icon {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Main row: origin, threat, city count */
.salvo-card-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.salvo-card-origin {
    font-size: 0.75rem;
    font-weight: 700;
}
.salvo-card-origin.iran { color: var(--iran); }
.salvo-card-origin.hezbollah { color: var(--hez); }

.salvo-card-threat {
    font-size: 0.7rem;
    color: var(--text);
    opacity: 0.7;
}

.salvo-card-cities-count {
    font-size: 0.7rem;
    color: var(--text);
    font-weight: 500;
}

.salvo-card-pre {
    font-size: 0.6rem;
    color: #ff8c00;
    font-weight: 500;
}

/* Live card — pulsing border */
.salvo-card.live-card {
    animation: live-card-pulse 2s ease-in-out infinite;
}
@keyframes live-card-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(229, 57, 53, 0.2); }
    50% { box-shadow: 0 0 20px rgba(229, 57, 53, 0.4); }
}
.salvo-card.live-card.state-pre {
    animation: live-card-pulse-pre 2s ease-in-out infinite;
}
@keyframes live-card-pulse-pre {
    0%, 100% { box-shadow: 0 0 8px rgba(255, 140, 0, 0.2); }
    50% { box-shadow: 0 0 20px rgba(255, 140, 0, 0.4); }
}

/* Areas row */
.salvo-card-areas {
    font-size: 0.65rem;
    color: var(--muted);
    margin-top: 0.3rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.salvo-card-map-hint {
    font-size: 0.55rem;
    color: var(--muted);
    opacity: 0.45;
    margin-top: 0.25rem;
    transition: opacity 0.2s;
}
.salvo-card:hover .salvo-card-map-hint { opacity: 1; }

/* Salvo modal */
.salvo-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.salvo-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
}

.salvo-modal-content {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.2rem;
    padding-top: 2.8rem;
    max-width: 420px;
    width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
    touch-action: pan-y;
}

.salvo-modal-close {
    position: sticky;
    top: 0;
    left: 0;
    float: left;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    color: var(--text);
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    margin-top: -2.4rem;
    margin-bottom: -32px;
}
.salvo-modal-close:hover { background: #2a2a40; }

.salvo-modal-header {
    text-align: center;
    margin-bottom: 0.8rem;
    direction: rtl;
}

.salvo-modal-header .salvo-modal-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.salvo-modal-header .salvo-modal-subtitle {
    font-size: 0.7rem;
    color: var(--muted);
    margin-top: 0.2rem;
}

.salvo-modal-map {
    margin-bottom: 0.8rem;
    overflow: hidden;
    touch-action: none;
    position: relative;
}

.salvo-modal-map .map-svg-wrap {
    max-width: 240px;
    margin: 0 auto;
}

.salvo-modal-map .map-svg-wrap svg {
    will-change: transform;
    transition: none;
}


.salvo-modal-cities {
    direction: rtl;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    justify-content: center;
}

.salvo-modal-cities .city-tag {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--card-border);
    color: var(--muted);
}

.salvo-modal-cities .iran-tag {
    border-color: #00c853;
    color: #00c853;
}

.salvo-modal-cities .hez-tag {
    border-color: #ffd700;
    color: #ffd700;
}

.salvo-modal-cities .pre-alert-tag {
    border-color: #ff8c00;
    color: #ff8c00;
}

/* Filter buttons */
.filter-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 0 1rem;
}

.filter-row,
.toggle-row,
.city-data-toggle {
    display: flex;
    justify-content: center;
    padding: 0.3rem 0 0.1rem;
}

.city-graph-toggle,
.data-view-toggle,
.graph-controls {
    display: flex;
    justify-content: center;
    padding: 0.15rem 0;
}

/* Segmented toggle (shared pill style) */
.seg-toggle {
    display: inline-flex;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    overflow: hidden;
}

.seg-toggle .view-btn,
.seg-toggle .graph-toggle-btn {
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex: 1;
    text-align: center;
}

.seg-toggle .view-btn:hover,
.seg-toggle .graph-toggle-btn:hover {
    color: var(--text);
}

.seg-toggle .view-btn + .view-btn,
.seg-toggle .graph-toggle-btn + .graph-toggle-btn {
    border-right: 1px solid var(--card-border);
}

.seg-toggle .view-btn.active,
.seg-toggle .graph-toggle-btn.active {
    background: #2a2a40;
    color: var(--text);
}

.filter-bar.disabled .seg-toggle {
    opacity: 0.35;
    pointer-events: none;
}



/* ===== CITY DETAIL PAGE ===== */

.stats {
    padding: 0.8rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.stats-grid:has(.stat-card:only-child) {
    grid-template-columns: 1fr;
    max-width: 200px;
    margin: 0 auto;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.7rem;
    text-align: center;
}
.stat-card.iran-card, .stat-card.hez-card, .stat-card.houthi-card {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card.iran-card:hover, .stat-card.hez-card:hover, .stat-card.houthi-card:hover {
    transform: scale(1.05);
}
.stat-card.active-filter {
    background: rgba(255,255,255,0.08);
    transform: scale(1.05);
}
.stat-card.iran-card.active-filter { box-shadow: 0 0 12px var(--iran-glow); }
.stat-card.hez-card.active-filter { box-shadow: 0 0 12px var(--hez-glow); }

.stat-card .value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-card .label {
    font-size: 0.65rem;
    color: var(--muted);
    margin-top: 0.1rem;
}

.stat-card.city-card {
    border-color: var(--card-border);
}

.stat-card.city-card .value {
    color: var(--text);
    direction: rtl;
}

.stat-card.iran-card {
    border-color: var(--iran);
}

.stat-card.iran-card .value {
    color: var(--iran);
}

.stat-card.iran-card .label {
    color: var(--iran);
}

.stat-card.hez-card {
    border-color: var(--hez);
}

.stat-card.hez-card .value {
    color: var(--hez);
}

.stat-card.hez-card .label {
    color: var(--hez);
}

/* ===== TIMELINE ===== */

/* Origin dot & tag colors */
.dot-iran {
    background: var(--iran) !important;
    box-shadow: 0 0 8px var(--iran-glow) !important;
}

.dot-hezbollah {
    background: var(--hez) !important;
    box-shadow: 0 0 8px var(--hez-glow) !important;
}

.tags-row { display: flex; gap: 0.4rem; align-items: center; margin-top: 0.1rem; }
.origin-tag { font-size: 0.65rem; font-weight: 600; }
.origin-tag.iran { color: var(--iran); }
.origin-tag.hezbollah { color: var(--hez); }
.threat-tag { font-size: 0.6rem; font-weight: 600; }
.threat-tag.missile { color: var(--missiles); }
.threat-tag.drone { color: var(--drones); }

.timeline-container {
    margin: 0.5rem 0 2rem;
    padding: 0 0.5rem 3rem;
    position: relative;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #1a1a2a;
    transform: translateX(-50%);
}

.timeline-empty {
    text-align: center;
    color: #666;
    padding: 2rem 1rem;
    font-size: 1rem;
}

.alert-dot {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.alert-dot .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    box-shadow: 0 0 8px rgba(255, 59, 59, 0.5);
    transition: transform 0.15s;
}

.alert-dot:hover .dot { transform: translateX(-50%) scale(1.4); }

.alert-dot .info {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
}

.alert-dot .info .alert-date {
    font-size: 0.65rem;
    color: var(--muted);
    font-weight: 600;
}

.alert-dot .info .time {
    color: #ff6b6b;
    font-weight: 600;
    font-size: 0.85rem;
}

.alert-dot .info .city-name {
    color: #aaa;
    direction: rtl;
    font-size: 0.8rem;
}

.alert-dot .info .map-hint {
    font-size: 0.55rem;
    color: var(--muted);
    opacity: 0.5;
    transition: opacity 0.2s;
    margin-top: 2px;
}
.alert-dot:hover .info .map-hint { opacity: 1; }

.alert-dot.side-right .info { margin-right: auto; margin-left: 55%; }
.alert-dot.side-left .info { margin-left: auto; margin-right: 55%; text-align: right; }

.date-separator {
    position: relative;
    text-align: center;
    padding: 1rem 0 0.4rem;
    z-index: 3;
}

.date-separator span {
    background: var(--accent);
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    position: relative;
    z-index: 3;
}

.hour-marker {
    position: relative;
    text-align: center;
    color: #444;
    font-size: 0.7rem;
    padding: 0.6rem 0 0.2rem;
    font-weight: 600;
}

.hour-marker::before {
    content: '';
    position: absolute;
    left: 30%;
    right: 30%;
    top: 50%;
    height: 1px;
    background: #1a1a2a;
}

.hour-marker span {
    background: var(--bg);
    padding: 0 0.5rem;
    position: relative;
    z-index: 1;
}

/* ===== TOP CITIES BAR CHART ===== */

#content-area {
    min-width: 0;
    overflow-x: hidden;
}


.top-cities {
    max-width: 100%;
    box-sizing: border-box;
}

.salvo-list {
    box-sizing: border-box;
}

.top-cities h3 {
    color: var(--muted);
    font-size: 0.8rem;
    margin-bottom: 0.6rem;
    text-align: center;
}

.city-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
    cursor: pointer;
    padding: 0.3rem 0;
    border-radius: 6px;
    transition: background 0.15s;
    max-width: 100%;
}

.city-bar:hover { background: var(--card-bg); }

.city-bar .name {
    min-width: 70px;
    max-width: 120px;
    text-align: right;
    direction: rtl;
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}

.city-bar .bar-container {
    flex: 1;
    min-width: 0;
    display: flex;
    height: 18px;
    border-radius: 4px;
    overflow: hidden;
    transition: width 0.4s ease;
}

.city-bar .bar-iran {
    height: 100%;
    background: var(--iran);
    transition: width 0.4s ease;
}

.city-bar .bar-hezbollah {
    height: 100%;
    background: var(--hez);
    transition: width 0.4s ease;
}

.city-bar .bar {
    height: 18px;
    background: linear-gradient(90deg, #cc2222, #ff3b3b);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.city-bar .count {
    font-size: 0.75rem;
    color: var(--muted);
    min-width: 0;
    flex-shrink: 0;
}


.bar-pre-alert {
    height: 100%;
    background: #ff8c00;
    border-radius: 4px;
    transition: width 0.4s ease;
}

/* ===== GRAPH ===== */

.graph-section {
}

.graph-controls {
    min-height: 1.6rem;
}

.graph-toggle-btn {
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    border: 1px solid #333;
    background: var(--card-bg);
    color: var(--muted);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s;
}

.graph-toggle-btn:hover { border-color: #555; color: var(--text); }
.graph-toggle-btn.active { background: #333; border-color: #555; color: var(--text); }


.city-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.graph-container {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 2rem 0.5rem 0.5rem;
    margin-top: 0.3rem;
    margin-bottom: 1rem;
    position: relative;
}

.graph-chart {
    display: flex;
    direction: ltr;
    align-items: flex-end;
    gap: 2px;
    height: 160px;
    padding: 0 0.3rem;
}

.graph-bar {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    min-width: 0;
}

.graph-bar .bar-stack {
    width: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 2px 2px 0 0;
    overflow: hidden;
}

.graph-bar .bar-iran {
    background: var(--iran);
    width: 100%;
    transition: height 0.4s ease, background 0.3s ease;
}

.graph-bar .bar-hez {
    background: var(--hez);
    width: 100%;
    transition: height 0.4s ease, background 0.3s ease;
}

.graph-bar .bar-false-alarm {
    background: #ff8c00;
    width: 100%;
    transition: height 0.4s ease;
}

.graph-bar .bar-label {
    font-size: 0.55rem;
    color: var(--muted);
    margin-top: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
}
.graph-chart.compact-labels .bar-label .label-month {
    display: none;
}

.graph-bar .bar-count {
    font-size: 0.5rem;
    color: var(--muted);
    margin-bottom: 0.15rem;
    text-align: center;
}

.graph-legend {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.7rem;
    color: var(--muted);
}

.graph-legend span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.graph-legend .dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    display: inline-block;
}

.graph-legend .dot.iran { background: var(--iran); }
.graph-legend .dot.hez { background: var(--hez); }
.graph-legend .dot.houthi { background: var(--houthi); }
.salvo-show-more {
    display: block;
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    color: var(--text);
    font-size: 0.8rem;
    cursor: pointer;
}
.salvo-show-more:hover { background: rgba(255,255,255,0.06); }

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.loading .spinner {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 3px solid #333;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

footer {
    font-size: 0.7rem;
    color: var(--muted);
    text-align: center;
    padding: 2rem 0 1.5rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    line-height: 1.6;
    max-width: 540px;
    margin-inline: auto;
    margin-left: auto;
    margin-right: auto;
}
footer p { margin-bottom: 0.5rem; }
footer strong { color: var(--accent); }
footer a { color: #818cf8; text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* --- Houthi (third origin, red/brown) — parity with iran/hezbollah classes --- */
.overview-stat.houthi { border-color: var(--houthi); }
.overview-stat.houthi .value { color: var(--houthi); }
.overview-stat.houthi .label { color: var(--houthi); }
.overview-stat.houthi.active-filter { box-shadow: 0 0 12px var(--houthi-glow); }
.salvo-card.houthi { border-right: 3px solid var(--houthi); }
.salvo-card.live-card.houthi { border-color: var(--houthi); box-shadow: 0 0 16px var(--houthi-glow), 0 4px 18px rgba(0,0,0,0.4); }
.salvo-card-origin.houthi { color: var(--houthi); }
.salvo-chip.houthi { border-color: var(--houthi); }
.salvo-chip.houthi.active { background: rgba(192,73,44,0.15); color: var(--houthi); }
.stat-card.houthi-card { border-color: var(--houthi); }
.stat-card.houthi-card .value { color: var(--houthi); }
.stat-card.houthi-card .label { color: var(--houthi); }
.stat-card.houthi-card.active-filter { box-shadow: 0 0 12px var(--houthi-glow); }
.dot-houthi { background: var(--houthi) !important; box-shadow: 0 0 8px var(--houthi-glow) !important; }
.origin-tag.houthi { color: var(--houthi); }
.salvo-modal-cities .houthi-tag { background: rgba(192,73,44,0.18); color: var(--houthi); border: 1px solid var(--houthi); }
.city-bar .bar-houthi { background: var(--houthi); }
.graph-bar .bar-houthi { background: var(--houthi); }
