/* === Global Rage Index === */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-black: #0a0a12;
    --bg-panel: #10101a;
    --bg-panel-2: #141420;
    --green-dim: #1a2a3a;
    --green-mid: #2d5b8d;
    --green-bright: #4af0ff;
    --green-text: #33bbcc;
    --amber: #ffaa00;
    --amber-dim: #996600;
    --red: #ff2020;
    --red-dim: #661010;
    --red-glow: rgba(255,32,32,0.5);
    --white-flash: rgba(255,255,255,0.9);
    --border: #1a2a3a;
    --text-dim: #556688;
    --fun-pink: #ff6b9d;
    --fun-purple: #c471ed;
    --fun-orange: #ffa62b;
    --font-mono: 'Share Tech Mono','Courier New',monospace;
    --font-display: 'Orbitron','Share Tech Mono',monospace;
    --font-cn: 'Noto Sans SC','PingFang SC','Microsoft YaHei',sans-serif;
}

body {
    font-family: var(--font-cn);
    background: var(--bg-black);
    color: var(--green-text);
    overflow: hidden;
    height: 100vh;
}

/* Scanline */
#scanline-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 9999;
    background: repeating-linear-gradient(0deg,transparent,transparent 3px,rgba(0,0,0,0.04) 3px,rgba(0,0,0,0.04) 6px);
}
#screen-flash {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 9998; opacity: 0;
}
#screen-flash.flash { animation: flash-decay 0.6s ease-out forwards; }
@keyframes flash-decay {
    0% { opacity: 0.8; background: rgba(255,200,100,0.8); }
    10% { opacity: 0.6; background: rgba(255,150,50,0.5); }
    100% { opacity: 0; }
}

/* === Header === */
#header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 16px;
    background: linear-gradient(180deg,var(--bg-panel-2),var(--bg-panel));
    border-bottom: 1px solid var(--green-dim);
    height: 54px; z-index: 100; position: relative;
}
#header::after {
    content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg,transparent,var(--fun-purple),var(--fun-pink),var(--fun-orange),transparent);
}
.system-title {
    font-family: var(--font-cn); font-size: 18px; font-weight: 900; letter-spacing: 3px;
    background: linear-gradient(135deg,var(--fun-orange),var(--fun-pink),var(--fun-purple));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.system-subtitle {
    font-family: var(--font-mono); font-size: 9px; color: var(--text-dim); letter-spacing: 1px; margin-top: 1px;
}
.header-stats { display: flex; align-items: center; gap: 16px; }
.stat-block { text-align: center; }
.stat-label { display: block; font-size: 9px; color: var(--text-dim); letter-spacing: 1px; }
.stat-value {
    display: block; font-family: var(--font-display); font-size: 18px; font-weight: 700;
    color: var(--amber); text-shadow: 0 0 6px rgba(255,170,0,0.3); font-variant-numeric: tabular-nums;
}
.stat-divider { width: 1px; height: 28px; background: var(--green-dim); }
.combo-block.hidden { display: none !important; }
.combo-value { color: var(--fun-pink) !important; text-shadow: 0 0 10px rgba(255,107,157,0.5) !important; }
.combo-pulse { animation: combo-pop 0.4s ease-out; }
@keyframes combo-pop { 0% { transform: scale(1.4); } 100% { transform: scale(1); } }

/* Language selector */
.header-center { display: flex; align-items: center; }
.lang-selector { display: flex; gap: 3px; }
.lang-btn {
    padding: 3px 8px; border: 1px solid var(--green-dim); background: transparent;
    color: var(--text-dim); font-size: 11px; cursor: pointer; border-radius: 3px;
    font-family: var(--font-cn); transition: all 0.15s;
}
.lang-btn:hover { border-color: var(--fun-purple); color: var(--fun-purple); }
.lang-btn.active {
    background: linear-gradient(135deg,rgba(196,113,237,0.2),rgba(255,107,157,0.2));
    border-color: var(--fun-pink); color: #fff;
}

.header-right { display: flex; gap: 5px; }
.tab-btn {
    padding: 6px 14px; border: 1px solid var(--green-dim); background: transparent;
    color: var(--text-dim); font-family: var(--font-cn); font-size: 12px; font-weight: 700;
    letter-spacing: 1px; cursor: pointer; border-radius: 4px; transition: all 0.15s;
}
.tab-btn:hover { border-color: var(--fun-purple); color: var(--fun-purple); }
.tab-btn.active {
    background: linear-gradient(135deg,rgba(196,113,237,0.2),rgba(255,107,157,0.2));
    border-color: var(--fun-purple); color: #fff;
}
.blink-slow { color: var(--fun-orange); animation: blink 2s step-end infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

/* === Views === */
.view { display: none; }
.view.active { display: flex; }
#stats-view.active { display: block; }

/* === Map View === */
#map-view { height: calc(100vh - 54px); }
#map-wrapper { flex: 1; position: relative; overflow: hidden; }
#leaflet-map { width: 100%; height: 100%; cursor: crosshair; z-index: 1; }
.leaflet-container { cursor: crosshair !important; }
.leaflet-interactive { cursor: crosshair !important; }
.leaflet-control-attribution { font-size: 9px !important; opacity: 0.5; }
#coord-display, #zoom-display {
    position: absolute; bottom: 10px; padding: 3px 8px;
    background: rgba(10,10,18,0.9); border: 1px solid var(--green-dim);
    font-family: var(--font-mono); font-size: 11px; z-index: 1000;
    pointer-events: none; border-radius: 3px;
}
#coord-display { left: 10px; color: var(--green-text); }
#zoom-display { left: 190px; color: var(--text-dim); }

/* Floating reactions */
#floating-reactions {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 850; overflow: hidden;
}
.floating-reaction {
    position: absolute; font-size: 22px; pointer-events: none;
    animation: float-up 2s ease-out forwards;
}
@keyframes float-up {
    0% { opacity: 1; transform: translateY(0) scale(0.5); }
    30% { opacity: 1; transform: translateY(-40px) translateX(var(--drift-x,0)) scale(1.2); }
    100% { opacity: 0; transform: translateY(-120px) translateX(var(--drift-x,0)) scale(0.8); }
}

/* Target marker */
.target-marker {
    position: absolute; width: 64px; height: 64px;
    transform: translate(-50%,-50%); pointer-events: none; z-index: 850;
}
.target-marker .crosshair-ring {
    position: absolute; width: 100%; height: 100%;
    border: 1.5px solid var(--red); border-radius: 50%;
    animation: xhair-rot 4s linear infinite; opacity: 0.8;
}
.target-marker .crosshair-ring::before, .target-marker .crosshair-ring::after {
    content: ''; position: absolute; background: var(--red);
}
.target-marker .crosshair-ring::before { width: 100%; height: 1px; top: 50%; }
.target-marker .crosshair-ring::after { width: 1px; height: 100%; left: 50%; }
.target-marker .crosshair-inner {
    position: absolute; width: 50%; height: 50%; top: 25%; left: 25%;
    border: 1px solid var(--red); border-radius: 50%;
    animation: xhair-pulse 1.5s ease-in-out infinite;
}
.target-marker .crosshair-dot {
    position: absolute; width: 4px; height: 4px; top: 50%; left: 50%;
    transform: translate(-50%,-50%); background: var(--red); border-radius: 50%;
    box-shadow: 0 0 6px var(--red), 0 0 12px var(--red-glow);
}
@keyframes xhair-rot { to { transform: rotate(360deg); } }
@keyframes xhair-pulse { 50% { opacity: 0.4; transform: scale(0.85); } }

/* Missiles */
#rockets-layer {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 800; overflow: hidden;
}
.missile { position: absolute; width: 8px; height: 20px; pointer-events: none; z-index: 810; }
.missile-body {
    width: 4px; height: 16px;
    background: linear-gradient(to bottom,#ccc,#888);
    border-radius: 2px 2px 0 0; margin: 0 auto; position: relative;
}
.missile-body::after {
    content: ''; position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
    border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 6px solid #666;
}
.missile-exhaust {
    position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
    width: 3px; height: 12px;
    background: linear-gradient(to bottom,#ff6600,#ff3300,#ff0000,transparent);
    animation: exhaust 0.1s infinite alternate; filter: blur(0.5px);
}
@keyframes exhaust { to { height: 16px; opacity: 0.8; } }
.smoke-puff {
    position: absolute; width: 6px; height: 6px; border-radius: 50%;
    background: rgba(180,180,180,0.3); pointer-events: none;
    animation: smoke 1.5s ease-out forwards;
}
@keyframes smoke { to { opacity: 0; transform: scale(4) translateY(-10px); } }

/* ============================================================
   EXPLOSIONS — "整活风" emoji burst + text splash + sparks
   ============================================================ */
#explosions-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 900; }
.explosion-container { position: absolute; transform: translate(-50%,-50%); pointer-events: none; }

/* 1. Flash ring — fast white→orange pulse */
.exp-flash-ring {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
    width: 10px; height: 10px; border-radius: 50%;
    background: radial-gradient(circle, #fff, #ffcc00, #ff6600, transparent);
    animation: flash-ring 0.5s ease-out forwards;
    box-shadow: 0 0 40px 20px rgba(255,200,50,0.6), 0 0 80px 40px rgba(255,100,0,0.3);
}
@keyframes flash-ring {
    0%   { width: 10px; height: 10px; opacity: 1; }
    30%  { width: calc(120px * var(--s,1)); height: calc(120px * var(--s,1)); opacity: 1; }
    100% { width: calc(180px * var(--s,1)); height: calc(180px * var(--s,1)); opacity: 0; box-shadow: none; }
}

/* 2. Center emoji — appear, scale up, then shrink away */
.exp-emoji-center {
    position: absolute; left: 50%; top: 50%;
    transform: translate(-50%,-50%) scale(0);
    animation: emoji-center-pop 0.6s cubic-bezier(0.17,0.67,0.21,1.2) forwards;
    filter: drop-shadow(0 0 8px rgba(255,100,0,0.8));
    z-index: 10;
}
.exp-emoji-center.exp-emoji-shrink {
    animation: emoji-center-shrink 0.8s ease-out forwards;
}
@keyframes emoji-center-pop {
    0%   { transform: translate(-50%,-50%) scale(0) rotate(-20deg); opacity: 0; }
    50%  { transform: translate(-50%,-50%) scale(1.3) rotate(10deg); opacity: 1; }
    100% { transform: translate(-50%,-50%) scale(1) rotate(0deg); opacity: 1; }
}
@keyframes emoji-center-shrink {
    0%   { transform: translate(-50%,-50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%,-70%) scale(0.3); opacity: 0; }
}

/* 3. Emoji burst — fly outward in a ring */
.exp-emoji-burst {
    position: absolute; left: 50%; top: 50%;
    transform: translate(-50%,-50%);
    animation: emoji-burst 0.8s cubic-bezier(0.2,0.8,0.3,1) forwards;
    filter: drop-shadow(0 0 4px rgba(255,200,0,0.5));
}
@keyframes emoji-burst {
    0%   { transform: translate(-50%,-50%) scale(0.3) rotate(0deg); opacity: 1; }
    60%  { opacity: 1; }
    100% { transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0.8) rotate(var(--rot)); opacity: 0; }
}

/* 4. Text splash — "BOOM!", "砰!" flying outward */
.exp-text-splash {
    position: absolute; left: 50%; top: 50%;
    transform: translate(-50%,-50%);
    font-family: 'Orbitron','Noto Sans SC',sans-serif;
    font-weight: 900; font-size: 16px;
    text-shadow: 0 0 6px currentColor, 0 2px 4px rgba(0,0,0,0.5);
    white-space: nowrap; letter-spacing: 1px;
    animation: text-splash 1s cubic-bezier(0.2,0.8,0.3,1) forwards;
    z-index: 5;
}
@keyframes text-splash {
    0%   { transform: translate(-50%,-50%) scale(0.5) rotate(0deg); opacity: 0; }
    15%  { opacity: 1; transform: translate(-50%,-50%) scale(1.2) rotate(var(--rot)); }
    100% { transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0.6) rotate(var(--rot)); opacity: 0; }
}

/* 5. Spark trails — colored streaks radiating outward */
.exp-spark {
    position: absolute; left: 50%; top: 50%;
    width: 3px; height: 12px; border-radius: 2px;
    transform: translate(-50%,-50%);
    animation: spark-fly 0.6s ease-out forwards;
    box-shadow: 0 0 4px currentColor;
}
@keyframes spark-fly {
    0%   { transform: translate(-50%,-50%) rotate(var(--rot)) scaleY(0.3); opacity: 1; }
    40%  { opacity: 1; }
    100% { transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) rotate(var(--rot)) scaleY(2); opacity: 0; }
}

/* 6. Shockwave ring */
.exp-ring {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
    width: 20px; height: 20px; border-radius: 50%;
    border: 3px solid rgba(255,150,50,0.8);
    box-shadow: 0 0 10px rgba(255,100,0,0.4), inset 0 0 10px rgba(255,200,100,0.2);
    animation: ring-expand 1s ease-out forwards;
}
.exp-ring-big {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
    width: 20px; height: 20px; border-radius: 50%;
    border: 4px solid rgba(255,50,50,0.9);
    box-shadow: 0 0 20px rgba(255,0,0,0.5), 0 0 40px rgba(255,100,0,0.3), inset 0 0 15px rgba(255,200,100,0.3);
    animation: ring-expand-big 1.2s ease-out forwards;
}
@keyframes ring-expand {
    0%   { width: 20px; height: 20px; opacity: 1; border-width: 3px; }
    100% { width: 200px; height: 200px; opacity: 0; border-width: 1px; margin-left: -90px; margin-top: -90px; }
}
@keyframes ring-expand-big {
    0%   { width: 20px; height: 20px; opacity: 1; border-width: 4px; }
    50%  { opacity: 0.8; }
    100% { width: 350px; height: 350px; opacity: 0; border-width: 1px; margin-left: -165px; margin-top: -165px; }
}

/* 7. Smoke puffs drifting upward */
.exp-smoke-puff {
    position: absolute; top: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(100,100,100,0.4), rgba(60,60,60,0.2), transparent);
    animation: smoke-rise 1.8s ease-out forwards;
}
@keyframes smoke-rise {
    0%   { transform: translateY(0) translateX(0) scale(0.3); opacity: 0.6; }
    100% { transform: translateY(-80px) translateX(var(--drift,0px)) scale(2); opacity: 0; }
}

/* 8. Ground crater — pulsing red ring */
.exp-crater {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
    width: calc(30px * var(--s,1)); height: calc(30px * var(--s,1));
    border-radius: 50%;
    border: 2px solid rgba(255,60,0,0.6);
    box-shadow: 0 0 12px rgba(255,60,0,0.3), inset 0 0 8px rgba(255,100,0,0.2);
    animation: crater-pulse 3s ease-out forwards;
}
@keyframes crater-pulse {
    0%   { transform: translate(-50%,-50%) scale(0); opacity: 0; }
    15%  { transform: translate(-50%,-50%) scale(1); opacity: 1; }
    30%  { transform: translate(-50%,-50%) scale(1.1); opacity: 0.8; }
    50%  { transform: translate(-50%,-50%) scale(1); opacity: 0.6; }
    70%  { transform: translate(-50%,-50%) scale(1.05); opacity: 0.3; }
    100% { transform: translate(-50%,-50%) scale(1.2); opacity: 0; }
}

/* 9. Mushroom emoji rising (big explosions only) */
.exp-mushroom-rise {
    position: absolute; left: 50%; top: 50%;
    font-size: 36px;
    transform: translate(-50%,-50%);
    animation: mushroom-rise 2s ease-out forwards;
    filter: drop-shadow(0 0 10px rgba(255,100,0,0.6));
}
@keyframes mushroom-rise {
    0%   { transform: translate(-50%,-50%) scale(0.3); opacity: 0; }
    20%  { transform: translate(-50%, calc(-50% - 30px)) scale(1.2); opacity: 1; }
    50%  { transform: translate(-50%, calc(-50% - 80px)) scale(1.5); opacity: 0.8; }
    100% { transform: translate(-50%, calc(-50% - 120px)) scale(1); opacity: 0; }
}
@keyframes screen-shake {
    0%,100% { transform: translate(0) rotate(0); }
    4% { transform: translate(-10px,-8px) rotate(-0.5deg); }
    8% { transform: translate(10px,6px) rotate(0.5deg); }
    12% { transform: translate(-8px,10px) rotate(-0.3deg); }
    16% { transform: translate(8px,-8px) rotate(0.3deg); }
    22% { transform: translate(-6px,5px); }
    30% { transform: translate(5px,-4px); }
    40% { transform: translate(-3px,3px); }
    55% { transform: translate(2px,-2px); }
    70% { transform: translate(-1px,1px); }
}
.shaking { animation: screen-shake 1s ease-out; }

/* === Live Feed === */
#live-feed {
    width: 280px; background: var(--bg-panel); border-left: 1px solid var(--green-dim);
    display: flex; flex-direction: column; overflow: hidden;
}
.feed-header {
    padding: 10px 12px; border-bottom: 1px solid var(--green-dim); background: var(--bg-panel-2);
}
.feed-status {
    font-size: 12px; font-weight: 700; letter-spacing: 1px; color: var(--text-dim);
    display: flex; align-items: center; gap: 6px;
}
.status-dot {
    width: 7px; height: 7px; border-radius: 50%; background: #44ff44;
    box-shadow: 0 0 6px #44ff44; animation: status-blink 2s ease-in-out infinite;
}
@keyframes status-blink { 50% { opacity: 0.3; } }
#feed-list { flex: 1; overflow-y: auto; padding: 4px; }
.feed-item {
    padding: 6px 8px; margin-bottom: 2px; font-size: 11px; line-height: 1.5;
    border-left: 3px solid var(--green-dim); background: rgba(10,10,18,0.5);
    animation: feed-in 0.3s ease-out; border-radius: 0 3px 3px 0;
}
.feed-item.new { border-left-color: var(--fun-pink); background: rgba(255,107,157,0.05); }
.feed-badge { font-size: 10px; margin-right: 3px; }
.feed-item .feed-name { color: var(--fun-orange); font-weight: 700; }
.feed-item .feed-target { color: var(--red); font-weight: 700; }
.feed-item .feed-loc { color: var(--text-dim); font-size: 10px; }
.feed-item .feed-time {
    display: block; font-family: var(--font-mono); font-size: 9px;
    color: var(--text-dim); margin-top: 2px;
}
@keyframes feed-in { from { opacity: 0; transform: translateX(10px); } }

/* === Modal === */
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); display: flex; align-items: center;
    justify-content: center; z-index: 200; backdrop-filter: blur(4px);
}
.modal.hidden { display: none; }
.modal-content {
    background: var(--bg-panel); border: 1px solid var(--green-dim);
    width: 420px; max-width: 90vw; border-radius: 8px; overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; background: var(--bg-panel-2); border-bottom: 1px solid var(--green-dim);
}
.modal-title { font-size: 15px; font-weight: 900; letter-spacing: 2px; color: var(--fun-orange); }
.modal-close {
    background: none; border: 1px solid var(--green-dim); color: var(--text-dim);
    font-family: var(--font-mono); font-size: 12px; padding: 3px 8px; cursor: pointer; border-radius: 3px;
}
.modal-close:hover { border-color: var(--red); color: var(--red); }
.modal-body { padding: 16px; }
.target-info {
    padding: 12px; background: var(--bg-black); border: 1px solid var(--green-dim);
    margin-bottom: 14px; border-radius: 6px;
}
.target-row { display: flex; gap: 8px; padding: 3px 0; font-size: 13px; }
.target-label { color: var(--text-dim); min-width: 70px; flex-shrink: 0; }
.target-value { color: var(--fun-orange); font-weight: 700; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 11px; color: var(--text-dim); margin-bottom: 6px; }
.form-group input {
    width: 100%; padding: 8px 12px; background: var(--bg-black);
    border: 1px solid var(--green-dim); color: var(--green-text);
    font-family: var(--font-cn); font-size: 14px; outline: none; border-radius: 4px;
}
.form-group input:focus { border-color: var(--fun-purple); box-shadow: 0 0 6px rgba(196,113,237,0.2); }
.form-group input::placeholder { color: var(--text-dim); }
.rocket-selector { display: flex; gap: 5px; flex-wrap: wrap; }
.rocket-btn {
    padding: 6px 14px; border: 1px solid var(--green-dim); background: var(--bg-black);
    color: var(--green-text); font-family: var(--font-mono); font-size: 13px;
    cursor: pointer; border-radius: 4px; transition: all 0.15s;
}
.rocket-btn:hover { border-color: var(--fun-purple); color: var(--fun-purple); }
.rocket-btn.active {
    background: linear-gradient(135deg,rgba(196,113,237,0.2),rgba(255,107,157,0.2));
    border-color: var(--fun-pink); color: #fff;
}
.launch-btn {
    width: 100%; padding: 12px; margin-top: 8px;
    background: linear-gradient(135deg,#cc2200,#ff4400,#ff6600);
    border: none; color: #fff; font-family: var(--font-cn);
    font-size: 15px; font-weight: 900; letter-spacing: 2px;
    cursor: pointer; border-radius: 6px; transition: all 0.2s;
}
.launch-btn:hover { box-shadow: 0 0 24px rgba(255,68,0,0.4); transform: translateY(-1px); }
.launch-btn:active { transform: scale(0.98); }
.launch-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* === Stats View === */
#stats-view {
    padding: 16px; height: calc(100vh - 54px); overflow-y: auto; background: var(--bg-black);
}
.stats-container {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
    max-width: 1200px; margin: 0 auto;
}
.stats-section {
    background: var(--bg-panel); border: 1px solid var(--green-dim);
    border-radius: 8px; overflow: hidden;
}
.stats-section.full-width { grid-column: 1 / -1; }
.stats-section.hidden { display: none; }

/* Search bar */
.search-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; border-bottom: 1px solid var(--green-dim); background: var(--bg-panel-2);
}
.search-bar input {
    flex: 1; padding: 8px 14px; background: var(--bg-black);
    border: 1px solid var(--green-dim); color: var(--green-text);
    font-family: var(--font-cn); font-size: 14px; outline: none; border-radius: 6px;
}
.search-bar input:focus { border-color: var(--fun-purple); box-shadow: 0 0 8px rgba(196,113,237,0.15); }
.search-bar input::placeholder { color: var(--text-dim); }
.search-count { font-size: 11px; color: var(--text-dim); white-space: nowrap; }

/* Scrollable ranking list */
.ranking-scroll { /* no height limit — parent scrolls */ }

/* Country detail */
.detail-close {
    margin-left: auto; background: none; border: 1px solid var(--green-dim);
    color: var(--text-dim); font-size: 14px; padding: 2px 10px; cursor: pointer;
    border-radius: 4px; transition: all 0.15s;
}
.detail-close:hover { border-color: var(--red); color: var(--red); }
.country-detail { padding: 16px; }
.detail-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.detail-card {
    background: var(--bg-black); border: 1px solid var(--green-dim);
    border-radius: 8px; padding: 14px; text-align: center;
}
.detail-card-label { font-size: 11px; color: var(--text-dim); letter-spacing: 1px; margin-bottom: 6px; }
.detail-card-value { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--fun-orange); }
.detail-card-sub { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.detail-recent-header {
    font-size: 13px; font-weight: 700; color: #aaa; margin-bottom: 8px;
    padding-bottom: 6px; border-bottom: 1px solid var(--green-dim);
}
.detail-recent-list { max-height: 250px; overflow-y: auto; }
.detail-recent-item {
    display: flex; align-items: center; gap: 10px; padding: 6px 0;
    font-size: 12px; border-bottom: 1px solid rgba(26,42,58,0.15);
}
.detail-recent-who { color: var(--fun-orange); font-weight: 700; min-width: 80px; }
.detail-recent-val { color: var(--red); font-weight: 700; min-width: 40px; }
.detail-recent-loc { color: var(--text-dim); flex: 1; }
.detail-recent-time { color: var(--text-dim); font-family: var(--font-mono); font-size: 10px; }

.section-header {
    padding: 12px 16px; font-size: 14px; font-weight: 900;
    color: #ddd; background: var(--bg-panel-2);
    border-bottom: 1px solid var(--green-dim);
    display: flex; align-items: center; gap: 8px;
}
.section-icon { font-size: 16px; }

/* Hatred Top 5 */
.hatred-top { padding: 12px 16px; }
.hatred-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0; border-bottom: 1px solid rgba(26,42,58,0.3);
}
.hatred-item:last-child { border-bottom: none; }
.hatred-item.hatred-1 .hatred-name { color: var(--fun-orange); font-size: 16px; }
.hatred-item.hatred-2 .hatred-name { color: #ddd; }
.hatred-rank {
    width: 36px; text-align: center; font-size: 18px; flex-shrink: 0;
}
.hatred-info { flex: 1; min-width: 0; }
.hatred-name { font-weight: 700; color: #bbb; font-size: 14px; margin-bottom: 4px; }
.hatred-bar-wrap {
    height: 10px; background: var(--bg-black); border-radius: 5px; overflow: hidden;
}
.hatred-bar {
    height: 100%; border-radius: 5px;
    background: linear-gradient(90deg,var(--fun-purple),var(--fun-pink),var(--red));
    transition: width 0.5s;
}
.hatred-stats { text-align: right; flex-shrink: 0; }
.hatred-rockets { font-weight: 700; color: var(--fun-orange); font-size: 14px; }
.hatred-pct { font-size: 10px; color: var(--text-dim); margin-top: 2px; }

/* Trending */
.trending-item {
    display: flex; align-items: center; padding: 8px 14px;
    border-bottom: 1px solid rgba(26,42,58,0.2); font-size: 13px;
}
.trending-item:hover { background: rgba(196,113,237,0.03); }
.trending-name { flex: 1; color: #ccc; font-weight: 700; }
.trending-val { color: var(--fun-orange); margin-right: 10px; font-size: 12px; }
.trending-badge {
    font-size: 11px; padding: 2px 8px; border-radius: 10px;
    background: rgba(85,102,136,0.2); color: var(--text-dim);
}
.trending-badge.trend-up { background: rgba(255,32,32,0.15); color: var(--red); }
.trending-badge.trend-down { background: rgba(68,255,68,0.1); color: #44ff44; }
.trending-badge.trend-new { background: rgba(255,166,43,0.15); color: var(--fun-orange); }

/* Hot 24h */
.hot-item {
    display: flex; align-items: center; padding: 8px 14px;
    border-bottom: 1px solid rgba(26,42,58,0.2); font-size: 13px;
}
.hot-rank {
    width: 24px; font-weight: 700; color: var(--text-dim); flex-shrink: 0;
}
.hot-name { flex: 1; color: #ccc; font-weight: 700; }
.hot-val { color: var(--text-dim); font-size: 11px; }

/* Monthly summary */
.section-summary { padding: 0 16px; }
.summary-stats {
    display: flex; gap: 16px; padding: 14px 0;
    border-bottom: 1px solid var(--green-dim);
}
.summary-item { text-align: center; flex: 1; }
.summary-num {
    display: block; font-family: var(--font-display); font-size: 24px; font-weight: 900;
    color: var(--fun-orange); text-shadow: 0 0 10px rgba(255,166,43,0.2);
}
.summary-label { display: block; font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.summary-empty { text-align: center; padding: 14px; color: var(--text-dim); font-size: 13px; border-bottom: 1px solid var(--green-dim); }

/* Rankings */
.ranking-item {
    display: flex; align-items: center; padding: 8px 12px;
    border-bottom: 1px solid rgba(26,42,58,0.2); font-size: 13px;
    transition: background 0.15s;
}
.ranking-item:hover { background: rgba(196,113,237,0.04); }
.ranking-rank {
    width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; margin-right: 10px; flex-shrink: 0;
    border: 1px solid var(--green-dim); border-radius: 5px;
}
.ranking-rank.gold { border: none; font-size: 17px; }
.ranking-rank.silver { border: none; font-size: 17px; }
.ranking-rank.bronze { border: none; font-size: 17px; }
.ranking-rank.normal { color: var(--text-dim); }
.ranking-info { flex: 1; }
.ranking-name { color: #ddd; font-weight: 700; }
.ranking-comment { font-size: 10px; color: var(--fun-pink); margin-left: 5px; }
.ranking-count { font-size: 10px; color: var(--text-dim); margin-top: 1px; }
.ranking-bar-container {
    width: 80px; height: 7px; background: var(--bg-black);
    margin-left: 10px; overflow: hidden; border-radius: 4px;
}
.ranking-bar {
    height: 100%; background: linear-gradient(90deg,var(--fun-purple),var(--fun-pink));
    border-radius: 4px; transition: width 0.5s;
}
.ranking-rockets { min-width: 55px; text-align: right; font-weight: 700; color: var(--fun-orange); margin-left: 10px; font-size: 12px; }
.no-data { text-align: center; color: var(--text-dim); padding: 30px 16px; font-size: 13px; }

/* === Toast === */
#toast-container {
    position: fixed; top: 60px; right: 12px; z-index: 300;
    display: flex; flex-direction: column; gap: 6px; max-width: 340px;
}
.toast {
    padding: 8px 14px; background: var(--bg-panel); border: 1px solid var(--green-dim);
    border-left: 4px solid var(--fun-purple); font-size: 12px; color: #ddd;
    animation: toast-in 0.3s ease-out, toast-out 0.4s ease-in 3.6s forwards;
    border-radius: 0 5px 5px 0; box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.toast-attack { border-left-color: var(--red); }
.toast-combo { border-left-color: var(--fun-pink); color: var(--fun-pink); font-weight: 700; font-size: 14px; }
.toast-news { border-left-color: var(--fun-orange); color: var(--fun-orange); font-style: italic; }
.toast-error { border-left-color: var(--red); color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateX(30px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px); } }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-black); }
::-webkit-scrollbar-thumb { background: var(--green-dim); border-radius: 2px; }

/* Responsive */
@media (max-width: 768px) {
    #header { flex-wrap: wrap; gap: 6px; height: auto; padding: 6px 10px; }
    .header-stats { gap: 10px; }
    .stat-value { font-size: 15px; }
    .lang-selector { gap: 2px; }
    .lang-btn { padding: 2px 5px; font-size: 10px; }
    #map-view { flex-direction: column; height: auto; }
    #map-wrapper { height: 55vh; }
    #live-feed { width: 100%; height: 200px; border-left: none; border-top: 1px solid var(--green-dim); }
    .stats-container { grid-template-columns: 1fr; }
    .hatred-item { flex-wrap: wrap; }
    .detail-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-recent-item { flex-wrap: wrap; gap: 4px; }
}
