/* =====================================================================
 *  LIVE WORLD TICKER — стили верхней панели живых событий мира
 * ===================================================================== */

.live-world {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: linear-gradient(90deg,
        rgba(20, 24, 35, 0.96) 0%,
        rgba(28, 33, 48, 0.96) 50%,
        rgba(20, 24, 35, 0.96) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    color: #e8eaf0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    line-height: 1.4;
    overflow: hidden;
    position: sticky;
    top: 0;
    z-index: 9000;
    min-height: 44px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ====== ЛЕВАЯ ЧАСТЬ — LIVE-бейдж + номер тика ====== */
.lw-left {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px 0 12px;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.25);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.lw-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #ff2d2d 0%, #b91414 100%);
    color: #fff;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.08em;
    padding: 3px 8px 3px 7px;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset,
                0 2px 6px rgba(255, 45, 45, 0.4);
    text-transform: uppercase;
    user-select: none;
}

.lw-live-dot {
    width: 7px;
    height: 7px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 4px #fff, 0 0 8px #fff;
    animation: lw-pulse 1.6s ease-in-out infinite;
}

@keyframes lw-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.7); }
}

.lw-total {
    font-family: 'JetBrains Mono', 'Menlo', monospace;
    font-size: 11px;
    color: #9aa3b5;
    white-space: nowrap;
}

/* ====== ЦЕНТР — лента событий ====== */
.lw-feed {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 0;
    overflow: hidden;
    position: relative;
    padding: 0 8px;
    min-width: 0;
}

/* Контейнер прокрутки */
.lw-feed-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    white-space: nowrap;
    animation: lw-marquee 80s linear infinite;
    will-change: transform;
}

.lw-feed:hover .lw-feed-inner {
    animation-play-state: paused;
}

@keyframes lw-marquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Один чип события */
.lw-event {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 10px 4px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 12.5px;
    line-height: 1.3;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.lw-event:hover {
    background: rgba(255, 255, 255, 0.07);
}

.lw-event__icon {
    font-size: 14px;
    line-height: 1;
    filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.5));
}

.lw-event__text {
    color: #d6dae6;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.lw-event__time {
    color: #6b7385;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    margin-left: 4px;
    padding-left: 6px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

/* Severity-цвета левой полоски */
.lw-event--info    { border-left: 2px solid #3aa0ff; }
.lw-event--success { border-left: 2px solid #2ecc71; }
.lw-event--warn    { border-left: 2px solid #f1c40f; }
.lw-event--danger  { border-left: 2px solid #e74c3c; background: rgba(231, 76, 60, 0.06); }

/* Подсветка цветом континента */
.lw-event__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 4px currentColor;
}

/* Анимация появления нового события */
.lw-event--new {
    animation: lw-slide-in 0.5s cubic-bezier(0.2, 0.8, 0.4, 1) both;
}

@keyframes lw-slide-in {
    0%   { opacity: 0; transform: translateX(40px) scale(0.92); }
    100% { opacity: 1; transform: translateX(0)   scale(1);    }
}

/* Состояние "нет событий" */
.lw-empty {
    color: #6b7385;
    font-style: italic;
    padding: 0 16px;
    font-size: 12px;
}

/* ====== ПРАВАЯ ЧАСТЬ — countdown до тика ====== */
.lw-right {
    display: flex;
    align-items: center;
    padding: 0 14px 0 12px;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.25);
    border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.lw-tick {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
}

.lw-tick-clock {
    font-size: 14px;
    animation: lw-tick-pulse 1s ease-in-out infinite;
}

@keyframes lw-tick-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.12); }
}

.lw-tick-label {
    color: #9aa3b5;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 10px;
}

.lw-tick-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: #fff;
    font-size: 13px;
    min-width: 28px;
    text-align: right;
}

/* Когда тик скоро — подсветка */
.lw-tick--soon .lw-tick-value {
    color: #f1c40f;
    text-shadow: 0 0 8px rgba(241, 196, 15, 0.6);
}

.lw-tick--imminent .lw-tick-value {
    color: #ff5252;
    text-shadow: 0 0 10px rgba(255, 82, 82, 0.8);
    animation: lw-tick-blink 0.5s ease-in-out infinite;
}

@keyframes lw-tick-blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

/* ====== АДАПТИВНОСТЬ ====== */
@media (max-width: 720px) {
    .live-world { font-size: 12px; }
    .lw-left    { padding: 0 10px; }
    .lw-right   { padding: 0 10px; }
    .lw-total   { display: none; }
    .lw-tick-label { display: none; }
    .lw-event__time { display: none; }
    .lw-feed-inner  { gap: 14px; }
    .lw-event { font-size: 11.5px; padding: 3px 8px; }
}

@media (max-width: 480px) {
    .lw-tick-clock { font-size: 12px; }
    .lw-tick-value { font-size: 11px; min-width: 22px; }
    .lw-live-text  { display: none; }
}

/* ====== Режим уменьшенной анимации (для accessibility) ====== */
@media (prefers-reduced-motion: reduce) {
    .lw-live-dot,
    .lw-tick-clock,
    .lw-event--new,
    .lw-tick--imminent .lw-tick-value {
        animation: none !important;
    }
    .lw-feed-inner {
        animation: none !important;
        flex-wrap: wrap;
        white-space: normal;
        padding: 4px 0;
    }
}

/* ====== NEWS TICKER — кликабельные новости вместо общего потока ======
 * Заменяет .lw-event чипы на .lw-news ссылки.
 * Сохраняет marquee-прокрутку, цвет континента, hover-эффект. */

.lw-news {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 12px 4px 9px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-left: 3px solid var(--lw-news-color, #3aa0ff);
    font-size: 12.5px;
    line-height: 1.3;
    flex-shrink: 0;
    text-decoration: none;
    color: #d6dae6;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.2s ease, border-color 0.15s ease;
    cursor: pointer;
    position: relative;
}

.lw-news:hover {
    background: rgba(255, 255, 255, 0.09);
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3),
                0 0 0 1px var(--lw-news-color, #3aa0ff),
                0 0 12px -2px var(--lw-news-color, #3aa0ff);
    color: #fff;
}

.lw-news:active {
    transform: translateY(0);
}

/* Цветная точка континента */
.lw-news__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 5px currentColor;
}

/* Имя континента — мелким, окрашенным */
.lw-news__cont {
    font-weight: 700;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-shadow: 0 0 4px currentColor;
    flex-shrink: 0;
}

/* Разделитель · */
.lw-news__sep {
    color: rgba(255, 255, 255, 0.2);
    font-weight: 400;
    flex-shrink: 0;
}

/* Заголовок новости — основной текст */
.lw-news__title {
    color: inherit;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Время справа */
.lw-news__time {
    color: #6b7385;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    margin-left: 4px;
    padding-left: 7px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

/* Анимация появления новой новости */
.lw-news--new {
    animation: lw-news-slide-in 0.55s cubic-bezier(0.2, 0.8, 0.4, 1) both;
}

@keyframes lw-news-slide-in {
    0%   { opacity: 0; transform: translateX(50px) scale(0.92); }
    100% { opacity: 1; transform: translateX(0)    scale(1);    }
}

/* Адаптивность — на мобильных прячем имя континента */
@media (max-width: 720px) {
    .lw-news { font-size: 11.5px; padding: 3px 9px 3px 7px; gap: 5px; }
    .lw-news__cont { display: none; }
    .lw-news__sep { display: none; }
    .lw-news__title { max-width: 220px; }
    .lw-news__time { display: none; }
}

@media (max-width: 480px) {
    .lw-news__title { max-width: 160px; }
}

@media (prefers-color-scheme: light) {
    .lw-news { background: rgba(0, 0, 0, 0.04); border-color: rgba(0, 0, 0, 0.08); color: #2a3142; }
    .lw-news:hover { background: rgba(0, 0, 0, 0.08); color: #1a1f2e; }
    .lw-news__title { text-shadow: none; }
    .lw-news__sep { color: rgba(0, 0, 0, 0.2); }
    .lw-news__time { color: #6b7385; border-left-color: rgba(0, 0, 0, 0.1); }
}

/* ====== Поддержка тёмной/светлой темы ====== */
@media (prefers-color-scheme: light) {
    .live-world {
        background: linear-gradient(90deg,
            rgba(245, 247, 252, 0.97) 0%,
            rgba(238, 241, 248, 0.97) 50%,
            rgba(245, 247, 252, 0.97) 100%);
        color: #2a3142;
        border-bottom-color: rgba(0, 0, 0, 0.08);
    }
    .lw-left, .lw-right {
        background: rgba(0, 0, 0, 0.04);
        border-color: rgba(0, 0, 0, 0.08);
    }
    .lw-event__text { color: #2a3142; }
    .lw-event__time { color: #6b7385; }
    .lw-total { color: #5a6478; }
    .lw-tick-label { color: #5a6478; }
    .lw-tick-value { color: #1a1f2e; }
}
