/* ============================================================
 * Touch-режим v4 для большого интерактивного дисплея.
 * Подключается ПОСЛЕ map.css — переопределяет ключевые стили.
 *
 * Цели:
 *   - все интерактивные элементы ≥ 56×56 px (комфортно для пальца);
 *   - крупные шрифты, чтобы текст читался с расстояния 1.5–2 м;
 *   - анимации появления, плавные переходы, эффекты тапа;
 *   - idle-overlay при простое > 90 секунд;
 *   - отключение пользовательского zoom через жесты, чтобы не
 *     мешать панорамированию карты;
 *   - кнопка fullscreen и большая кнопка «к обзору».
 * ============================================================ */

:root {
    --tap-min: 56px;
    --gold: #c99a3f;
    --gold-bright: #ffd784;
    --navy: #1a3a5c;
    --navy-deep: #0e2440;
}

/* Запретим выделение текста на UI (мешает на сенсорной поверхности) */
html, body {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    overscroll-behavior: none;
    touch-action: pan-x pan-y;
}
/* Но оставим выделение в попапах и в основной части описания, на случай копирования */
.popup-desc, #idle-overlay { -webkit-user-select: text; user-select: text; }

body {
    background: #0e2440;
    font-size: 16px;
}

/* ============================================================
 *  ШАПКА
 * ============================================================ */
#header {
    padding: 18px 32px !important;
    font-size: 22px !important;
    letter-spacing: 1.5px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.35);
    border-bottom-width: 4px !important;
    background:
        radial-gradient(1200px 220px at 50% -50%, rgba(255,215,132,0.18), transparent 60%),
        linear-gradient(135deg, #1a3a5c 0%, #2c5684 60%, #1a3a5c 100%) !important;
    position: relative;
    overflow: hidden;
}
#header::after {
    /* тонкая золотая «искра» бегущая под нижней границей */
    content: ''; position: absolute; left: 0; right: 0; bottom: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent 0%, var(--gold) 30%, var(--gold-bright) 50%, var(--gold) 70%, transparent 100%);
    animation: shimmer 6s linear infinite;
    background-size: 200% 100%;
}
@keyframes shimmer {
    from { background-position: -200% 0; }
    to   { background-position: 200% 0; }
}
#header .header-title {
    display: block;
    font-size: 26px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}
#header small { font-size: 14px !important; margin-top: 4px !important; }

.header-actions {
    display: flex; align-items: center; gap: 12px;
    flex-shrink: 0;
}

/* ============================================================
 *  ПЕРЕКЛЮЧАТЕЛЬ ЯЗЫКА
 * ============================================================ */
.lang-switch { border-radius: 12px !important; }
.lang-switch .lang-btn {
    min-width: 64px !important;
    padding: 14px 18px !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    letter-spacing: 1px !important;
    transition: all 0.2s ease !important;
}
.lang-switch .lang-btn:active { transform: scale(0.94); }
.lang-switch .lang-btn.active {
    background: linear-gradient(135deg, #11243a 0%, #1a3a5c 100%) !important;
    box-shadow: inset 0 0 0 2px var(--gold), 0 0 18px rgba(201, 154, 63, 0.55) !important;
}

/* Кнопка fullscreen */
.hdr-btn {
    background: rgba(0,0,0,0.18);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.hdr-btn:hover, .hdr-btn:active {
    background: rgba(201,154,63,0.25);
    border-color: var(--gold);
    transform: scale(1.05);
}

/* ============================================================
 *  БОКОВАЯ ПАНЕЛЬ
 * ============================================================ */
#sidebar {
    width: 460px !important;
    padding: 22px !important;
    background: linear-gradient(180deg, #fafafa 0%, #f0f0f3 100%) !important;
    box-shadow: 6px 0 24px -10px rgba(0,0,0,0.15);
    scrollbar-width: thin;
}
#sidebar::-webkit-scrollbar { width: 10px; }
#sidebar::-webkit-scrollbar-thumb { background: rgba(26,58,92,0.3); border-radius: 5px; }
#sidebar::-webkit-scrollbar-track { background: transparent; }

/* Поиск */
#search {
    width: 100% !important;
    padding: 16px 20px !important;
    font-size: 17px !important;
    border-radius: 12px !important;
    border: 2px solid #d8d8dc !important;
    box-sizing: border-box !important;
    margin-bottom: 16px !important;
    transition: all 0.2s;
    background: #fff;
}
#search:focus {
    border-color: var(--navy) !important;
    box-shadow: 0 0 0 4px rgba(26, 58, 92, 0.15) !important;
    outline: none !important;
}

/* Кнопки фильтра по типу */
.type-filter { gap: 10px !important; margin-bottom: 18px !important; }
.type-btn {
    min-height: var(--tap-min) !important;
    padding: 14px 12px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-radius: 12px !important;
    border-width: 2px !important;
    transition: all 0.18s !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    position: relative;
    overflow: hidden;
}
.type-btn:active { transform: scale(0.96); }
.type-btn .dot { width: 14px !important; height: 14px !important; }
.type-btn.active {
    background: linear-gradient(135deg, var(--navy) 0%, #2c5684 100%) !important;
    border-color: var(--navy) !important;
    box-shadow: 0 4px 12px rgba(26, 58, 92, 0.3);
    color: #fff !important;
}

/* Временной фильтр */
.time-filter {
    padding: 18px 18px 38px !important;
    border-radius: 12px !important;
    border: 2px solid #e0e0e0 !important;
    margin-bottom: 18px !important;
    background: #fff !important;
}
.time-filter-header { font-size: 14px !important; }
.time-filter-header .tf-title { font-size: 13px !important; }
.tf-reset {
    min-width: 48px; min-height: 36px;
    padding: 6px 12px !important;
    border-radius: 8px;
    font-size: 12px !important;
}

/* Слайдер */
#time-slider, #border-slider { height: 8px !important; }
.noUi-handle {
    width: 28px !important; height: 28px !important;
    right: -14px !important; top: -10px !important;
    border-width: 2px !important;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2) !important;
}
.noUi-tooltip {
    font-size: 14px !important;
    padding: 4px 10px !important;
    font-weight: 600;
}

/* Слой государств */
.state-overlay-box { padding: 14px 16px 26px !important; border-radius: 12px !important; }
.state-overlay-head { font-size: 14px !important; gap: 12px !important; }
#state-overlay-toggle {
    width: 24px; height: 24px;
    accent-color: var(--gold);
    cursor: pointer;
}
.border-year { font-size: 16px !important; }

/* Счётчик */
.counter {
    font-size: 14px !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    margin: 14px 0 10px;
    font-weight: 700;
}

/* ============================================================
 *  КАРТОЧКИ ОБЪЕКТОВ В СПИСКЕ
 * ============================================================ */
#list .obj-card {
    background: #fff;
    border: 2px solid transparent;
    border-radius: 14px;
    padding: 16px 18px !important;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    animation: cardSlideIn 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
}
/* шахматная задержка появления */
#list .obj-card:nth-child(1) { animation-delay: 0.02s; }
#list .obj-card:nth-child(2) { animation-delay: 0.05s; }
#list .obj-card:nth-child(3) { animation-delay: 0.08s; }
#list .obj-card:nth-child(4) { animation-delay: 0.11s; }
#list .obj-card:nth-child(5) { animation-delay: 0.14s; }
#list .obj-card:nth-child(6) { animation-delay: 0.17s; }
#list .obj-card:nth-child(7) { animation-delay: 0.20s; }
#list .obj-card:nth-child(8) { animation-delay: 0.23s; }
#list .obj-card:nth-child(n+9) { animation-delay: 0.26s; }

@keyframes cardSlideIn {
    from { opacity: 0; transform: translateX(-20px) scale(0.96); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

#list .obj-card:hover, #list .obj-card.tap-active {
    border-color: var(--gold);
    transform: translateX(4px);
    box-shadow: 0 6px 20px rgba(201,154,63,0.25);
}
#list .obj-card:active { transform: scale(0.98); }
#list .obj-card .title {
    font-size: 17px !important;
    font-weight: 700 !important;
    color: #1f2a44;
    line-height: 1.3;
}
#list .obj-card .period {
    font-size: 13px !important;
    margin-top: 4px;
    font-weight: 600;
}
#list .obj-card .card-3d-badge {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-bright) 100%);
    color: #2b1d11;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: 800;
    letter-spacing: 0.5px;
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
/* Бейдж YouTube — рядом с 3D-бейджем, фирменный красный */
.card-yt-badge {
    display: inline-flex;
    align-items: center; justify-content: center;
    min-width: 22px; height: 18px;
    background: linear-gradient(135deg, #ff1f1f 0%, #c0181b 100%);
    color: #fff;
    font-size: 10px;
    padding: 2px 7px 2px 6px;
    border-radius: 10px;
    margin-left: 6px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1;
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(200,30,30,0.35);
}
.popup-title .card-yt-badge { font-size: 12px; min-width: 26px; height: 22px; }

/* Ripple-эффект на тап */
#list .obj-card::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(201, 154, 63, 0.25);
    width: 0; height: 0;
    top: var(--ry, 50%); left: var(--rx, 50%);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
    pointer-events: none;
}
#list .obj-card.rippling::after {
    width: 600px; height: 600px;
    transition: width 0.6s ease-out, height 0.6s ease-out, opacity 0.6s 0.3s;
    opacity: 0;
}

/* ============================================================
 *  МАРКЕРЫ НА КАРТЕ
 * ============================================================ */
.altyn-marker {
    transform-origin: 50% 100%;
    transition: transform 0.18s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35));
}
.altyn-marker:hover { transform: scale(1.18); }
.altyn-marker svg { width: 48px !important; height: 64px !important; }
/* Активный маркер пульсирует */
.altyn-marker.active {
    animation: pulseMarker 1.5s ease-in-out infinite;
    z-index: 1000 !important;
}
@keyframes pulseMarker {
    0%, 100% { transform: scale(1.05); filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35)); }
    50%      { transform: scale(1.25); filter: drop-shadow(0 4px 14px rgba(255,215,132,0.7)); }
}

/* ============================================================
 *  ПОПАПЫ
 * ============================================================ */
.leaflet-popup-content-wrapper {
    border-radius: 16px !important;
    box-shadow: 0 14px 50px rgba(0,0,0,0.45) !important;
    animation: popupRise 0.4s cubic-bezier(0.2, 0.7, 0.3, 1.1);
    max-height: 78vh !important;          /* высота попапа ограничена ~3/4 экрана */
    overflow-y: auto !important;          /* лишний контент прокручивается внутри */
    overflow-x: hidden !important;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}
.leaflet-popup-content-wrapper::-webkit-scrollbar { width: 8px; }
.leaflet-popup-content-wrapper::-webkit-scrollbar-thumb { background: rgba(26,58,92,0.35); border-radius: 4px; }
.leaflet-popup-content-wrapper::-webkit-scrollbar-track { background: transparent; }
@keyframes popupRise {
    from { opacity: 0; transform: translateY(20px) scale(0.92); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.leaflet-popup-content {
    font-size: 15px !important;
    min-width: 380px !important;
    width: 480px !important;              /* фиксированная ширина попапа = шире, чем 380 */
    margin: 16px 18px !important;
}
/* popup-desc уже скроллится сам, но раз контейнер тоже скроллится,
   уберём его внутреннюю прокрутку, чтобы не было двух скроллов */
.popup-desc { max-height: none !important; overflow: visible !important; }
.popup-title { font-size: 22px !important; line-height: 1.25; padding-right: 30px; }
.popup-period { font-size: 14px !important; }
.popup-type, .popup-status { font-size: 13px !important; }
.popup-key-fact { padding: 12px 14px !important; font-size: 14px !important; border-radius: 10px; }
.popup-photos img {
    border-radius: 10px;
    transition: transform 0.25s, box-shadow 0.25s;
}
.popup-photos img:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}
.popup-desc {
    font-size: 14px !important;
    max-height: 320px !important;
    line-height: 1.55;
}
.popup-links a {
    display: inline-block;
    min-height: 44px;
    padding: 10px 16px !important;
    border-radius: 10px;
    font-size: 14px !important;
    font-weight: 600;
    margin: 4px 6px 4px 0;
    transition: all 0.18s;
    text-decoration: none;
    background: #f0f4fa;
    color: var(--navy);
}
.popup-links a:hover, .popup-links a:active {
    background: var(--navy); color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(26,58,92,0.3);
}
/* YouTube — lite-превью; по тапу открывается модалка #youtube-modal */
.popup-yt-wrap {
    margin: 14px 0 12px;
}
.popup-yt-lite {
    border: 0;
    padding: 0;
    font-family: inherit;
    /* остальные правила .popup-yt-lite ниже сработают одинаково для <a> и <button> */
}
.popup-yt-label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: #5b4628;
    margin-bottom: 8px;
    text-transform: uppercase;
}
.popup-yt-lite {
    position: relative;
    display: block;
    width: 100%;
    padding-top: 56.25%;            /* 16:9 */
    border-radius: 12px;
    overflow: hidden;
    background: #111;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.popup-yt-lite:hover { transform: scale(1.02); box-shadow: 0 8px 22px rgba(0,0,0,0.35); }
.popup-yt-lite:active { transform: scale(0.98); }
.popup-yt-thumb {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: filter 0.2s;
}
.popup-yt-lite:hover .popup-yt-thumb { filter: brightness(0.78); }
.popup-yt-play {
    position: absolute; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: 80px; height: 56px;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.45));
    transition: transform 0.2s;
}
.popup-yt-lite:hover .popup-yt-play { transform: translate(-50%, -50%) scale(1.1); }
.leaflet-popup-close-button {
    width: 36px !important; height: 36px !important;
    font-size: 24px !important;
    line-height: 36px !important;
    color: #666 !important;
    transition: all 0.15s;
}
.leaflet-popup-close-button:hover {
    color: #fff !important;
    background: var(--navy) !important;
    border-radius: 18px !important;
}

/* ============================================================
 *  ЛЕГЕНДА
 * ============================================================ */
.map-legend {
    padding: 14px 18px !important;
    border-radius: 14px !important;
    font-size: 14px !important;
    backdrop-filter: blur(6px);
    background: rgba(255,255,255,0.92) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.18) !important;
}
.map-legend .lg-title { font-size: 12px !important; font-weight: 800 !important; }
.map-legend .lg-label { font-size: 14px !important; font-weight: 700 !important; }
.map-legend .lg-sub { font-size: 11px !important; }

/* ============================================================
 *  КНОПКА «АНИМАЦИЯ ГРАНИЦ» (видеомодалка)
 * ============================================================ */
#video-play-btn {
    bottom: 28px !important; right: 28px !important;
    padding: 16px 28px !important;
    font-size: 16px !important;
    border-radius: 50px !important;
    box-shadow: 0 8px 24px rgba(164,69,59,0.5) !important;
    animation: gentleBounce 2.4s ease-in-out infinite;
    z-index: 1100;
}
@keyframes gentleBounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}
#video-play-btn:active { animation: none; transform: scale(0.96); }

#video-modal { backdrop-filter: blur(8px); }
#video-modal.on .video-modal-content { animation: popupRise 0.45s cubic-bezier(0.2,0.7,0.3,1.1); }
.video-close {
    width: 56px !important; height: 56px !important;
    font-size: 36px !important;
    border-radius: 28px;
}

/* ============================================================
 *  МОДАЛКА YOUTUBE (встроенный iframe-плеер)
 *  Логика идентична #video-modal — те же z-index, blur, анимация.
 * ============================================================ */
#youtube-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.94);
    backdrop-filter: blur(8px);
    z-index: 20000;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}
#youtube-modal.on { display: flex; }
.youtube-modal-content {
    position: relative;
    width: min(92vw, 1280px);
    cursor: default;
    animation: popupRise 0.45s cubic-bezier(0.2,0.7,0.3,1.1);
}
.youtube-frame-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%;            /* 16:9 */
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 14px 50px rgba(0,0,0,0.65);
}
#youtube-frame,
#youtube-player {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #000;
    object-fit: contain;             /* видео с другим соотношением сторон — letterbox, не растягиваем */
}
.youtube-close {
    position: absolute;
    top: -64px;
    right: -6px;
    background: transparent;
    border: 0;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    font-weight: 300;
}
.youtube-caption {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    color: #ddd;
    font-size: 14px;
}
.youtube-caption-title {
    font-weight: 600;
    color: #fff;
    flex: 1;
    min-width: 200px;
}
.youtube-fallback-link {
    color: #ffd784;
    text-decoration: none;
    font-size: 13px;
    padding: 8px 14px;
    border: 1px solid rgba(255,215,132,0.45);
    border-radius: 999px;
    transition: all 0.18s;
    flex-shrink: 0;
}
.youtube-fallback-link:hover,
.youtube-fallback-link:active {
    background: var(--gold);
    color: var(--navy-deep);
    border-color: var(--gold);
}
@media (max-width: 720px) {
    .youtube-modal-content { width: 96vw; }
    .youtube-close { top: -56px; }
    .youtube-caption { font-size: 13px; }
}

/* ============================================================
 *  КНОПКА «ВЕРНУТЬСЯ К ОБЗОРУ»
 *  Стоит в правом нижнем углу, ВЫШЕ кнопки «Анимация границ»,
 *  чтобы не перекрывать легенду карты.
 * ============================================================ */
#reset-view-btn {
    position: fixed;
    right: 28px;
    bottom: 100px;
    z-index: 1100;
    background: linear-gradient(135deg, var(--navy) 0%, #2c5684 100%);
    color: #fff;
    border: 0;
    padding: 14px 20px;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(26,58,92,0.5);
    transition: all 0.2s;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}
#reset-view-btn.on {
    opacity: 1; visibility: visible;
    transform: translateY(0);
}
#reset-view-btn:active { transform: scale(0.95); }
#reset-view-btn:hover { box-shadow: 0 12px 30px rgba(26,58,92,0.6); }

/* ============================================================
 *  ПОДПИСИ ГОСУДАРСТВ — крупнее
 * ============================================================ */
.state-label {
    font-size: 16px !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    background: rgba(255, 252, 240, 0.96) !important;
    border-width: 2px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.18) !important;
    animation: labelFade 0.6s ease-out;
}
.state-label .sl-sub { font-size: 12px !important; }
@keyframes labelFade {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

/* Полигоны государств — плавно появляются */
.leaflet-overlay-pane svg path {
    animation: polyDraw 0.7s ease-out;
}
@keyframes polyDraw {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ============================================================
 *  LIGHTBOX (увеличение фото)
 * ============================================================ */
#lightbox {
    backdrop-filter: blur(8px);
    background: rgba(8,16,30,0.92) !important;
}
#lightbox.on img {
    animation: zoomIn 0.4s cubic-bezier(0.2, 0.7, 0.3, 1.1);
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.7);
}
@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.6); }
    to   { opacity: 1; transform: scale(1); }
}
#lightbox .close {
    font-size: 60px !important;
    width: 80px; height: 80px;
    line-height: 80px;
    border-radius: 40px;
    text-align: center;
    background: rgba(255,255,255,0.15);
    color: #fff;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
}
#lightbox .close:hover, #lightbox .close:active {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

/* ============================================================
 *  IDLE-OVERLAY: показывается при простое
 * ============================================================ */
#idle-overlay {
    position: fixed; inset: 0;
    background:
        radial-gradient(ellipse at center, rgba(26,58,92,0.85) 0%, rgba(8,16,30,0.97) 80%);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center; justify-content: center;
    z-index: 5000;
    cursor: pointer;
    animation: overlayFade 0.6s ease-out;
}
#idle-overlay.on { display: flex; }
@keyframes overlayFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.idle-content { text-align: center; color: #fff; }
.idle-pulse {
    width: 180px; height: 180px;
    margin: 0 auto 28px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,215,132,0.6) 0%, rgba(201,154,63,0.0) 70%);
    position: relative;
    animation: idlePulse 2s ease-in-out infinite;
}
.idle-pulse::before {
    content: ''; position: absolute; inset: 56px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 40px rgba(255,215,132,0.8);
}
@keyframes idlePulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50%      { transform: scale(1.18); opacity: 1; }
}
.idle-title {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: 1px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
    margin-bottom: 12px;
}
.idle-sub {
    font-size: 22px;
    opacity: 0.85;
    letter-spacing: 0.5px;
    color: var(--gold-bright);
}

/* ============================================================
 *  АДАПТИВ для разных разрешений
 *   - 1920×1080 (FullHD) — базовый
 *   - 2160×1440 / 4K — увеличиваем кегль
 * ============================================================ */
@media (min-width: 2200px) {
    body { font-size: 19px; }
    #header { padding: 24px 40px !important; }
    #header .header-title { font-size: 32px; }
    #header small { font-size: 17px !important; }
    #sidebar { width: 540px !important; padding: 28px !important; }
    #search { font-size: 19px !important; padding: 18px 22px !important; }
    .type-btn { font-size: 17px !important; min-height: 64px !important; }
    #list .obj-card .title { font-size: 19px !important; }
    .leaflet-popup-content { min-width: 460px !important; font-size: 17px !important; }
    .popup-title { font-size: 26px !important; }
    .popup-desc { font-size: 16px !important; max-height: 380px !important; }
    .altyn-marker svg { width: 56px !important; height: 75px !important; }
    .map-legend { font-size: 16px !important; }
    .state-label { font-size: 18px !important; padding: 10px 20px !important; }
    .lang-switch .lang-btn { padding: 16px 22px !important; font-size: 17px !important; }
    .idle-title { font-size: 56px; }
    .idle-sub { font-size: 28px; }
    #reset-view-btn { right: 36px; bottom: 116px; font-size: 17px; padding: 16px 24px; }
    #video-play-btn { padding: 18px 32px !important; font-size: 18px !important; }
}

/* Скрываем «вынужденно ненужное» на маленьких экранах (<800px) */
@media (max-width: 800px) {
    #sidebar { width: 100% !important; max-height: 40vh; }
    #app { flex-direction: column; }
    .header-actions { gap: 6px; }
    .lang-switch .lang-btn { min-width: 50px !important; padding: 10px 12px !important; }
    .hdr-btn { width: 44px; height: 44px; }
    #reset-view-btn { right: 16px; bottom: 80px; padding: 12px 18px; font-size: 14px; }
    .reset-label { display: none; }
    #video-play-btn { padding: 12px 18px !important; font-size: 14px !important; }
}

/* ============================================================
 *  МОУШН: уважение системной настройки prefers-reduced-motion
 * ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01s !important;
        transition-duration: 0.01s !important;
    }
}
