/* =========================================
   SEQUENCE 41 - JOURNEY ENGINE CSS (REMASTERED)
   Premium Architecture, Optimized Layers & Mobile-Ready
========================================= */

/* =========================================
   1. CORE & MAP WRAPPER
========================================= */
body:has(#journey-container.active),
body.journey-active {
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overscroll-behavior: none;
}

#journey-container {
    display: none;
    z-index: 5;
    position: fixed;
    top: 113px;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: auto;
    background: #fdfdfd;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: opacity 0.4s ease;
    perspective: 1000px;
    transform-style: preserve-3d;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    contain: layout paint style;
}

#journey-container.active {
    display: block;
    animation: atlasFadeIn 0.8s var(--ease-premium) forwards;
}

@keyframes atlasFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px) translateZ(0);
    }

    to {
        opacity: 1;
        transform: translateY(0) translateZ(0);
    }
}

.map-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    background: transparent;
    transition:
        bottom 0.4s var(--ease-premium),
        transform 900ms var(--ease-premium);
    transform-style: preserve-3d;
    z-index: 10;
    contain: layout paint;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    backface-visibility: hidden;
    touch-action: manipulation;
    will-change: transform;
    isolation: isolate;
}
.map-grid-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    will-change: transform;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    backface-visibility: hidden;
}

.map-content-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    will-change: transform;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    backface-visibility: hidden;
}

.map-path-layer,
.map-node-layer {
    position: absolute;
    inset: 0;
}

.map-path-layer {
    z-index: 1;
    pointer-events: none;
}

.map-node-layer {
    z-index: 2;
}

/* =========================================
   2. ATLAS HUD (Инфо-панель и Управление)
========================================= */
.atlas-hud {
    position: absolute;
    top: 30px;
    left: 30px;
    z-index: 1000;
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    pointer-events: auto;
    -webkit-font-smoothing: antialiased;
    backface-visibility: hidden;
}

.hud-label {
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.3);
    letter-spacing: 2.5px;
    text-transform: uppercase;
    margin-bottom: 6px;
    display: block;
    pointer-events: none;
    user-select: none;
}

/* --- Route Selector --- */
.route-selector-wrapper {
    position: relative;
    z-index: 1100;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.05);
    transition: all 0.3s var(--ease-premium);
}

.route-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 800;
    color: #111;
    letter-spacing: -0.5px;
    cursor: pointer;
}

#route-current {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

.route-trigger svg {
    width: 16px;
    height: 16px;
    margin-left: 10px;
    opacity: 0.6;
    transition: transform 0.4s var(--ease-premium);
}

.route-selector-wrapper.active .route-trigger svg {
    transform: rotate(180deg);
    opacity: 1;
}

.route-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition:
        opacity 0.35s var(--ease-premium),
        visibility 0.35s var(--ease-premium),
        transform 0.35s var(--ease-premium);
    z-index: 2500;
    backface-visibility: hidden;
}

.route-dropdown::-webkit-scrollbar {
    width: 4px;
}

.route-dropdown::-webkit-scrollbar-thumb {
    background: #eee;
    border-radius: 10px;
}

.route-selector-wrapper.active .route-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.route-option {
    padding: 10px 14px;
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    color: #888;
    cursor: pointer;
    border-radius: 6px;
    transition: 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.route-option:hover {
    background: #f4f4f5;
    color: #111;
    padding-left: 18px;
}

.route-option.active {
    background: #111;
    color: #fff;
}

/* --- Stats & Play Button --- */
.atlas-stats {
    padding: 16px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.stat-item {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: rgba(0, 0, 0, 0.4);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.stat-item b {
    color: var(--accent);
    font-weight: 700;
}

.stat-desc {
    margin-top: 12px;
    font-size: 11px;
    color: #888;
    line-height: 1.6;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 12px;
}

.btn-play-route {
    width: 100%;
    margin-top: 16px;
    background: #111;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 50px;
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    letter-spacing: 1.5px;
    transition: 0.4s var(--ease-premium);
}

.btn-play-route:hover {
    background: var(--accent);
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 153, 0, 0.25);
}

.btn-play-route:active {
    transform: translateY(0);
}

/* --- Sonic / Cinematic Toggle --- */
.mode-switch-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
    padding: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
}

.mode-label {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
    transition: 0.3s ease;
}

.mode-label.active {
    color: var(--accent);
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-soft);
    transition: 0.4s;
    border-radius: 22px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-main);
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent);
}

input:checked + .slider:before {
    transform: translateX(22px);
    background-color: #fff;
}

/* =========================================
   3. MAP GEOMETRY & NODES (Optimized)
========================================= */

/* --- Анимированная линия маршрута --- */
.silk-road-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
    overflow: visible;
}

.silk-road-svg path {
    stroke: rgba(0, 0, 0, 0.1);
    stroke-width: 2.5px;
    vector-effect: non-scaling-stroke;
    stroke-dasharray: 5 10 !important;
    stroke-linecap: round;
    animation:
        flowRoute 20s linear infinite,
        routePulse 3s ease-in-out infinite;
    transition: stroke 0.4s ease;
}

@keyframes routePulse {
    0% {
        stroke-width: 2.5px;
        opacity: 0.45;
    }

    50% {
        stroke-width: 3px;
        opacity: 0.9;
    }

    100% {
        stroke-width: 2.5px;
        opacity: 0.45;
    }
}

#journey-container:hover .silk-road-svg path {
    stroke: rgba(0, 0, 0, 0.25);
    opacity: 1;
}

@keyframes flowRoute {
    from {
        stroke-dashoffset: 300;
    }

    to {
        stroke-dashoffset: 0;
    }
}

/* --- Базовые контейнеры точек --- */
.map-node {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    z-index: 50;
    padding: 15px;
    transition:
        z-index 0s,
        transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: transform, opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.map-node:hover {
    z-index: 2005;
}

.map-node.active {
    z-index: 2010;
}

.map-scene {
    --tilt-x: 0deg;
    --tilt-y: 0deg;

    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform-origin: 0 0;
    transition: transform 1.2s var(--ease-premium);
    will-change: transform;
    z-index: 12;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    contain: layout paint style;
}



/* --- Геометрия узлов (Shapes) --- */
.node-dot {
    background: #fff;
    border: 3.5px solid #111;
    box-sizing: border-box;
    transition:
        transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        border-color 0.3s ease,
        background-color 0.3s ease,
        box-shadow 0.3s ease;
    -webkit-font-smoothing: antialiased;
    backface-visibility: hidden;
    transform-origin: center;
}
.node-dot {
    /* PATCH: отдельный композитный слой для shape */
    will-change: transform, box-shadow, filter;
}

.node-type-city .node-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.node-type-ambient .node-dot {
    width: 18px;
    height: 18px;
    transform: rotate(45deg);
    border-width: 3px;
}

.node-type-drive .node-dot {
    width: 0;
    height: 0;
    background: transparent !important;
    border-radius: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 22px solid #111;
    border-right: 0;
    box-shadow: none !important;
}

/* --- Реакции узлов (Hover / Active) --- */
.map-node:not(.node-type-drive):hover .node-dot,
.map-node.active:not(.node-type-drive) .node-dot {
    transform: scale(1.2);
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 15px rgba(255, 153, 0, 0.35);
}

.node-type-ambient:hover .node-dot,
.node-type-ambient.active .node-dot {
    transform: scale(1.2) rotate(135deg) !important;
}

.node-type-drive:hover .node-dot,
.node-type-drive.active .node-dot {
    border-left-color: var(--accent);
    transform: scale(1.2) translateX(3px) !important;
    filter: drop-shadow(0 0 8px rgba(255, 153, 0, 0.5));
}

/* --- Активная пульсация --- */
.map-node.active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    will-change: transform, opacity;
    transform: translate3d(-50%, -50%, 0);
    border: 2px solid var(--accent);
    border-radius: 50%;
    animation: nodePulse 2.4s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes nodePulse {
    0% {
        transform: translate3d(-50%, -50%, 0) scale(0.9);
        opacity: 0.9;
    }

    100% {
        transform: translate3d(-50%, -50%, 0) scale(1.8);
        opacity: 0;
    }
}

/* --- Названия локаций --- */
.node-label {
    position: absolute;
    top: 100%;
    margin-top: 10px;
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.45);
    text-transform: uppercase;
    letter-spacing: 1.8px;
    pointer-events: none;
    white-space: nowrap;
    transition: 0.3s ease;
    text-shadow:
        0 0 10px rgba(255, 255, 255, 0.9),
        0 0 2px rgba(255, 255, 255, 1);
}

.map-node:hover .node-label,
.map-node.active .node-label {
    color: #000;
    letter-spacing: 2.5px;
    text-shadow: 0 0 15px rgba(255, 255, 255, 1);
}

.map-node.active .node-label {
    color: var(--accent) !important;
}

/* --- Всплывающие подсказки (Glass Popups) --- */
.track-popup {
    position: absolute;
    bottom: 45px;
    left: 50%;
    transform: translate(-50%, 10px) scale(0.95);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: #111;
    padding: 8px 16px;
    border-radius: 12px;
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.3s ease,
        transform 0.4s var(--ease-premium),
        visibility 0.3s;
    pointer-events: none;
    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    backface-visibility: hidden;
}

.track-popup::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.95);
    border-right: 1px solid rgba(255, 255, 255, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
    z-index: -1;
}

.map-node:hover .track-popup,
.map-node.active .track-popup {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -7px) scale(1) !important;
    z-index: 2020;
}

/* =========================================
   4. MODALS & CINEMATIC TRANSITIONS
========================================= */
/* --- YouTube Modal --- */
.yt-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.96);
    z-index: 10006;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: 0.5s var(--ease-premium);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 20px;
}

.yt-modal.active {
    opacity: 1;
    visibility: visible;
}

.yt-video-box {
    width: 100%;
    max-width: 1100px;
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    transform: scale(0.9);
    transition: transform 0.6s var(--ease-premium);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
    margin: 0;
}

.yt-modal.active .yt-video-box {
    transform: scale(1);
}

.iframe-wrapper {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    overflow: hidden;
}

.iframe-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.yt-info {
    position: absolute;
    bottom: -65px;
    left: 0;
    width: 100%;
    z-index: 50;
    pointer-events: none;
    text-align: left;
    opacity: 0;
    transform: translateY(10px);
    transition: 0.6s ease 0.3s;
}

.yt-modal.active .yt-info {
    opacity: 1;
    transform: translateY(0);
}

.yt-title {
    color: rgba(255, 255, 255, 0.7);
    font-size: 22px;
    font-weight: 800;
    margin: 5px 0 0 0;
    letter-spacing: -1px;
}

.yt-type {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: var(--accent);
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.8;
}

.yt-close {
    position: absolute;
    top: 40px;
    right: 60px;
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 12px 28px;
    border-radius: 50px;
    cursor: pointer;
    z-index: 10007;
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    backdrop-filter: blur(10px);
    transition: 0.3s ease;
}

.yt-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: #fff;
    transform: scale(1.05);
}

/* --- Cinematic Black Screen (Chapter Overlay) --- */
.journey-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #111;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease;
}

.journey-overlay.active {
    opacity: 1;
    visibility: visible;
}

.journey-overlay-text {
    font-family: 'Space Mono', monospace;
    color: var(--text-muted);
    font-size: 14px;
    letter-spacing: 2px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.journey-overlay-chapter {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    text-align: center;
}

.btn-restart-journey {
    margin-top: 30px;
    border: 1px solid var(--border-soft);
    background: transparent;
    color: #fff;
    padding: 12px 24px;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    cursor: pointer;
    transition: 0.3s;
    border-radius: 4px;
}

.btn-restart-journey:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* --- Global Player Buttons (Video Icon & Complete State) --- */
.gp-vision-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    opacity: 0.5;
    transition: 0.3s;
}

.gp-vision-btn.visible {
    display: flex;
}

.gp-vision-btn:hover {
    opacity: 1;
    color: var(--accent);
}

.gp-vision-btn svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
}

.global-player.journey-complete {
    border-color: rgba(255, 215, 0, 0.3) !important;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.1) !important;
    cursor: pointer !important;
    transition: all 0.6s var(--ease-premium);
}

.global-player.journey-complete #gp-progress-fill {
    width: 100% !important;
    background: linear-gradient(90deg, var(--text-main), #FFD700) !important;
    animation: pulse-glow 2s infinite alternate;
}

@keyframes pulse-glow {
    0% {
        opacity: 0.5;
        box-shadow: 0 0 5px rgba(255, 215, 0, 0);
    }

    100% {
        opacity: 1;
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    }
}

.global-player.journey-complete #gp-time-current,
.global-player.journey-complete #gp-time-total {
    opacity: 0 !important;
}

/* =========================================
   5. MOBILE ADAPTATION (Мастер-блок)
========================================= */
@media (max-width: 768px) {
    /* Контейнер и Карта */
    #journey-container {
        top: 115px !important;
        bottom: 0 !important;
        contain: layout paint;
    }
    .map-scene {
    /* PATCH: на мобильном делаем transform более отзывчивым */
    transition:
        transform 0.9s var(--ease-premium);
}

.map-wrapper.touch-drifting .track-popup {
    /* PATCH: пока карта под пальцем, попап чуть мягче и спокойнее */
    opacity: 0.92;
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
}

.map-wrapper.touch-drifting .node-label {
    /* PATCH: во время движения делаем лейблы чуть чище */
    text-shadow:
        0 0 8px rgba(255, 255, 255, 0.95),
        0 0 2px rgba(255, 255, 255, 1);
}

.map-wrapper .map-scene::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;

    /* PATCH: очень легкая световая вуаль для глубины */
    background:
        radial-gradient(circle at 50% 35%, rgba(255,255,255,0.08), transparent 42%),
        radial-gradient(circle at 50% 70%, rgba(255,255,255,0.05), transparent 48%);
}

/* PATCH: когда палец держит карту, анимация должна быть быстрее и живее */
.map-wrapper.touch-drifting .map-scene {
    transition:
        transform 0.18s ease-out;
}

/* PATCH: после отпускания возвращение делаем более "вязким" */
.map-wrapper.touch-releasing .map-scene {
    transition:
        transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
    
.map-node.popup-below .track-popup {
    bottom: auto;
    top: 42px;
    transform: translate(-50%, -10px) scale(0.95);
}

.map-node.popup-below .track-popup::after {
    bottom: auto;
    top: -6px;
    transform: translateX(-50%) rotate(225deg);
}

.map-node.popup-below:hover .track-popup,
.map-node.popup-below.active .track-popup {
    transform: translate(-50%, 7px) scale(1) !important;
}

.map-wrapper {
        top: 85px;
        bottom: 40px;
        mask-image: none !important;
        -webkit-mask-image: none !important;
    }

.map-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: linear-gradient(to bottom, rgba(253,253,253,0.92) 0%, rgba(253,253,253,0) 100%);
    z-index: 8;
    pointer-events: none;
}

.map-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(
    to top,
    rgba(253,253,253,0.92) 0%,
    rgba(253,253,253,0) 100%
);
    z-index: 8;
    pointer-events: none;
}



    body:has(.global-player.active) .map-wrapper {
        bottom: 65px !important;
    }

    /* 1: ПАНЕЛЬ HUD */
    .atlas-hud {
        top: 6px !important;
        left: 15px !important;
        right: 15px !important;
        width: auto !important;
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 16px !important;
        gap: 12px !important;
        border-radius: 24px !important;
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border: none !important;
        box-shadow: none !important;
        isolation: isolate;
        contain: none !important;
        overflow: visible !important;
        z-index: 1000;
    }

    .atlas-hud::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: -1;
        border-radius: 24px !important;
        background: rgba(255, 255, 255, 0.25);
        backdrop-filter: blur(20px) saturate(160%);
        -webkit-backdrop-filter: blur(20px) saturate(160%);
        border: 1px solid rgba(255, 255, 255, 0.4);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        transform: translateZ(0);
        will-change: backdrop-filter;
    }

    .hud-label,
    .stat-desc,
    .stat-item span {
        display: none !important;
    }

    /* Элементы управления в HUD */
    .route-selector-wrapper {
        align-self: center !important;
        position: relative;
        z-index: 1100;
        width: fit-content !important;
        max-width: min(78vw, 260px);
        margin: 0 auto !important;
        padding: 11px 16px !important;
        box-sizing: border-box !important;
        background: rgba(255, 255, 255, 0.44) !important;
        border: 1px solid rgba(255, 255, 255, 0.5) !important;
        border-radius: 999px !important;
        box-shadow:
            inset 0 1px 0 rgba(255,255,255,0.38),
            0 6px 16px rgba(0, 0, 0, 0.04);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        display: block;
    }

    .route-trigger {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        min-width: 0;
        font-size: 13px;
        font-weight: 800;
        color: #111;
        letter-spacing: -0.2px;
        text-align: center;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
        margin: 0;
    }

    #route-current {
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        text-align: center;
        flex: 0 1 auto;
    }

    .route-trigger svg {
        width: 14px;
        height: 14px;
        flex: 0 0 auto;
        margin: 0;
        opacity: 0.75;
    }

    .route-dropdown {
        position: fixed !important;
        top: 82px !important;
        left: 15px !important;
        right: 15px !important;
        width: auto !important;
        max-height: 260px;
        padding: 8px !important;
        transform: translateY(8px) translateZ(0) !important;
        z-index: 2500 !important;
        backface-visibility: hidden !important;
        border-radius: 18px !important;
        background: rgba(255, 255, 255, 0.96) !important;
        border: 1px solid rgba(0, 0, 0, 0.06) !important;
        box-shadow: 0 18px 40px rgba(0, 0, 0, 0.14) !important;
    }

    .route-selector-wrapper.active .route-dropdown {
        transform: translateY(0) translateZ(0) !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    .route-option {
        padding: 12px 14px;
        border-radius: 12px;
        font-size: 10px;
        letter-spacing: 0.8px;
    }

    .route-option + .route-option {
        margin-top: 4px;
    }

    .route-option:hover {
        padding-left: 14px;
        background: rgba(255, 153, 0, 0.08);
        color: #111;
    }

    .route-option.active {
        background: #111;
        color: #fff;
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
    }

    /* СТАТИСТИКА И КНОПКА PLAY */
    .atlas-stats {
    background: transparent;
    backdrop-filter: none;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
}

.atlas-hud.no-cinema .atlas-stats {
    gap: 16px !important;
}

.atlas-hud.no-cinema .route-selector-wrapper {
    margin-bottom: 2px;
}

.atlas-hud.no-cinema .btn-play-route {
    margin-top: 2px !important;
}

    .stat-item {
        display: none;
    }

    .mode-switch-wrapper {
    margin: 0 !important;
    padding: 7px 10px;
    gap: 10px;
    border-radius: 20px;
    justify-content: center !important;
}

    .mode-label {
        font-size: 9px;
        letter-spacing: 0.5px;
    }

    .switch {
        width: 38px;
        height: 20px;
    }

    .slider:before {
        height: 16px;
        width: 16px;
        left: 2px;
        bottom: 2px;
    }

    input:checked + .slider:before {
        transform: translateX(18px);
    }

    /* Кнопка на всю ширину */
    .btn-play-route {
    width: 100% !important;
    padding: 13px !important;
    margin: 0 !important;
    font-size: 10px;
    letter-spacing: 1.5px;
    text-align: center;
}

    /* Точки на карте (Мобильная версия) */
    .node-type-city .node-dot {
        width: 16px !important;
        height: 16px !important;
        border-width: 2.5px !important;
    }

    .node-type-ambient .node-dot {
        width: 12px !important;
        height: 12px !important;
        border-width: 2px !important;
    }

    .node-type-drive .node-dot {
        border-top-width: 9px !important;
        border-bottom-width: 9px !important;
        border-left-width: 16px !important;
    }

    .node-label {
        font-size: 8px;
        top: 85% !important;
        margin-top: 0 !important;
        letter-spacing: 1.2px;
        color: rgba(0, 0, 0, 0.7);
        text-shadow: 0 0 5px #fff;
    }

    .track-popup {
    background: rgba(255, 255, 255, 0.85) !important;
    font-size: 9px;
    padding: 6px 10px;
    border-radius: 10px;
    letter-spacing: 0.4px;
    max-width: 140px;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
}

.track-popup::after {
    width: 10px;
    height: 10px;
    bottom: -5px;
}

    /* 1: YOUTUBE MODAL */
    .yt-modal {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100dvh !important;
        padding: 0 20px !important;
        box-sizing: border-box !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .yt-video-box {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        aspect-ratio: 16 / 9 !important;
        margin: 0 !important;
        position: relative !important;
        transform: scale(1) !important;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8) !important;
    }

    .yt-close {
        position: absolute !important;
        top: 20px !important;
        right: 20px !important;
        padding: 10px 20px !important;
        background: rgba(255, 255, 255, 0.2) !important;
        font-size: 10px !important;
        z-index: 10007 !important;
    }

    .yt-info {
        position: absolute !important;
        bottom: -70px !important;
        left: 0 !important;
        width: 100% !important;
        text-align: center !important;
    }

    .yt-title {
        font-size: 16px !important;
        line-height: 1.2 !important;
        text-align: center !important;
    }

    .yt-type {
        text-align: center !important;
        margin-bottom: 4px !important;
        font-size: 10px !important;
    }
}

/* Ландшафтная ориентация телефона */
@media (max-height: 500px) {
    .yt-video-box {
        height: 80dvh !important;
        width: auto;
        aspect-ratio: 16 / 9;
        margin: auto !important;
    }

    .yt-info {
        display: none;
    }

    .yt-close {
        top: 10px;
        right: 10px;
        padding: 8px 16px;
    }
}