/**
 * === JOURNEY-MAP.CSS ===
 * /assets/css/journey-map.css
 * НАЗНАЧЕНИЕ: Стили для визуальной карты путешествия с ландшафтом
 * СВЯЗИ: style.css, journey.css
 * РАЗМЕР: ~500 строк
 */

/* ============================================
   VISUAL MAP CONTAINER
   ============================================ */

.journey-map {
    position: relative;
    min-height: 600px;
    background: linear-gradient(180deg,
        #1a1a2e 0%,
        #16213e 30%,
        #1a1a2e 60%,
        #0f0f1a 100%
    );
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: var(--spacing-xl);
}

/* Звездное небо */
.journey-map::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background-image:
        radial-gradient(2px 2px at 20px 30px, #fff, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(255,215,0,0.8), transparent),
        radial-gradient(1px 1px at 160px 120px, #fff, transparent),
        radial-gradient(2px 2px at 200px 50px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 250px 90px, #fff, transparent),
        radial-gradient(2px 2px at 300px 60px, rgba(255,215,0,0.6), transparent);
    background-size: 350px 150px;
    animation: twinkle 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Горы на заднем плане */
.journey-map__mountains {
    position: absolute;
    bottom: 30%;
    left: 0;
    right: 0;
    height: 200px;
    pointer-events: none;
}

.journey-map__mountains::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    background:
        linear-gradient(135deg, transparent 40%, #2d3a5a 40%, #2d3a5a 42%, transparent 42%),
        linear-gradient(225deg, transparent 40%, #3d4a6a 40%, #3d4a6a 42%, transparent 42%),
        linear-gradient(145deg, transparent 35%, #252f4a 35%, #252f4a 38%, transparent 38%);
    background-size: 300px 200px, 250px 180px, 400px 220px;
    background-position: 0 100%, 150px 100%, 50px 100%;
    background-repeat: repeat-x;
}

/* Путь/дорога */
.journey-map__path {
    position: absolute;
    bottom: 10%;
    left: 5%;
    right: 5%;
    height: 80%;
    pointer-events: none;
}

.journey-map__path svg {
    width: 100%;
    height: 100%;
}

.journey-map__path-line {
    fill: none;
    stroke: url(#pathGradient);
    stroke-width: 4;
    stroke-dasharray: 12, 8;
    stroke-linecap: round;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.3));
}

/* ============================================
   LOCATION NODES
   ============================================ */

.journey-map__locations {
    position: absolute;
    inset: 0;
    padding: 5%;
}

.location-node {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 10;
}

.location-node:hover {
    transform: scale(1.1);
}

.location-node.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.location-node.locked:hover {
    transform: none;
}

/* Позиции локаций на карте */
.location-node[data-position="1"] { left: 5%; bottom: 15%; }
.location-node[data-position="2"] { left: 15%; bottom: 25%; }
.location-node[data-position="3"] { left: 28%; bottom: 20%; }
.location-node[data-position="4"] { left: 40%; bottom: 30%; }
.location-node[data-position="5"] { left: 50%; bottom: 25%; }
.location-node[data-position="6"] { left: 60%; bottom: 35%; }
.location-node[data-position="7"] { left: 55%; bottom: 45%; }
.location-node[data-position="8"] { left: 45%; bottom: 50%; }
.location-node[data-position="9"] { left: 35%; bottom: 55%; }
.location-node[data-position="10"] { left: 25%; bottom: 50%; }
.location-node[data-position="11"] { left: 20%; bottom: 60%; }
.location-node[data-position="12"] { left: 30%; bottom: 68%; }
.location-node[data-position="13"] { left: 42%; bottom: 65%; }
.location-node[data-position="14"] { left: 55%; bottom: 60%; }
.location-node[data-position="15"] { left: 68%; bottom: 55%; }
.location-node[data-position="16"] { left: 75%; bottom: 65%; }
.location-node[data-position="17"] { left: 82%; bottom: 58%; }
.location-node[data-position="18"] { left: 88%; bottom: 70%; }

/* Иконка локации */
.location-node__icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    position: relative;
    transition: all 0.3s ease;
}

/* Типы локаций */
.location-node[data-type="field"] .location-node__icon {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    box-shadow: 0 4px 15px rgba(74, 222, 128, 0.4);
}

.location-node[data-type="forest"] .location-node__icon {
    background: linear-gradient(135deg, #166534 0%, #14532d 100%);
    box-shadow: 0 4px 15px rgba(22, 101, 52, 0.4);
}

.location-node[data-type="lake"] .location-node__icon {
    background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
}

.location-node[data-type="mountain"] .location-node__icon {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    box-shadow: 0 4px 15px rgba(148, 163, 184, 0.4);
}

.location-node[data-type="temple"] .location-node__icon {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.5);
}

.location-node[data-type="cave"] .location-node__icon {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* Статусы */
.location-node.status-not-started .location-node__icon {
    filter: grayscale(0.5);
}

.location-node.status-in-progress .location-node__icon {
    animation: pulse-glow 2s ease-in-out infinite;
}

.location-node.status-completed .location-node__icon {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.location-node.status-completed::after {
    content: '✓';
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: var(--color-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    font-weight: bold;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    }
    50% {
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
    }
}

/* Название локации */
.location-node__name {
    margin-top: 8px;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.location-node__number {
    font-size: 0.65rem;
    color: var(--color-gold);
    margin-top: 2px;
}

/* ============================================
   MAP LEGEND
   ============================================ */

.journey-map__legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    z-index: 20;
}

.legend-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-gold);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.legend-item__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-item__dot.field { background: #4ade80; }
.legend-item__dot.forest { background: #166534; }
.legend-item__dot.lake { background: #38bdf8; }
.legend-item__dot.mountain { background: #94a3b8; }
.legend-item__dot.temple { background: #fbbf24; }
.legend-item__dot.cave { background: #6366f1; }

/* ============================================
   PLAYER AVATAR
   ============================================ */

.journey-map__player {
    position: absolute;
    width: 50px;
    height: 50px;
    z-index: 15;
    transition: all 1s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.player-avatar {
    width: 100%;
    height: 100%;
    background: var(--gradient-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow:
        0 0 20px rgba(255, 215, 0, 0.6),
        0 4px 15px rgba(0, 0, 0, 0.3);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ============================================
   STATS PANEL
   ============================================ */

.journey-map__stats {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    z-index: 20;
    min-width: 180px;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-row:last-child {
    border-bottom: none;
}

.stats-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.stats-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-gold);
}

.stats-value.points {
    color: var(--color-success);
}

.stats-value.streak {
    color: #f59e0b;
}

/* ============================================
   TOGGLE VIEW BUTTON
   ============================================ */

.journey-view-toggle {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-toggle-btn:hover {
    border-color: var(--color-gold-dark);
}

.view-toggle-btn.active {
    background: var(--gradient-gold);
    border-color: var(--color-gold);
    color: var(--text-dark);
}

.view-toggle-btn svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   LOCATION POPUP
   ============================================ */

.location-popup {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.location-popup.active {
    opacity: 1;
    visibility: visible;
}

.location-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.location-popup__content {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.location-popup.active .location-popup__content {
    transform: scale(1);
}

.location-popup__close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.location-popup__close:hover {
    background: var(--color-error);
    color: white;
}

.location-popup__icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.location-popup__title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: var(--spacing-xs);
}

.location-popup__subtitle {
    font-size: 0.9rem;
    color: var(--color-blue);
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.location-popup__description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-lg);
}

.location-popup__lessons {
    margin-bottom: var(--spacing-lg);
}

.location-popup__lessons-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.location-popup__progress {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.progress-circle {
    width: 60px;
    height: 60px;
    position: relative;
}

.progress-circle svg {
    transform: rotate(-90deg);
}

.progress-circle__bg {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 6;
}

.progress-circle__fill {
    fill: none;
    stroke: var(--color-gold);
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-circle__text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-gold);
}

.progress-info {
    flex: 1;
}

.progress-info__text {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.progress-info__subtext {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.location-popup__actions {
    display: flex;
    gap: var(--spacing-sm);
}

.location-popup__actions .btn {
    flex: 1;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .journey-map {
        min-height: 450px;
    }

    .location-node__icon {
        width: 45px;
        height: 45px;
        font-size: 1.4rem;
    }

    .location-node__name {
        font-size: 0.65rem;
        padding: 3px 8px;
        max-width: 80px;
    }

    /* Stats - compact and semi-transparent */
    .journey-map__stats {
        top: 8px;
        right: 8px;
        padding: 6px 10px;
        min-width: 120px;
        opacity: 0.85;
        font-size: 0.75rem;
    }

    .journey-map__stats .stats-value {
        font-size: 0.9rem;
    }

    /* Legend - compact */
    .journey-map__legend {
        bottom: 8px;
        left: 8px;
        padding: 6px 10px;
        max-width: 280px;
        opacity: 0.85;
    }

    .player-avatar {
        font-size: 1.2rem;
    }
}

/* ============================================
   MANDALA MAP CONTAINER
   ============================================ */

.journey-map-container {
    position: relative;
    width: 100%;
    min-height: 700px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: var(--spacing-xl);
}

/* ============================================
   THREE MAP STYLES
   ============================================ */

/* STYLE 1: NIGHT SKY (DEFAULT) */
.journey-map-container.style-night {
    background: linear-gradient(180deg,
        #0a0a1a 0%,
        #1a1a3e 30%,
        #0d0d2a 60%,
        #050510 100%
    );
}

.journey-map-container.style-night::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(2px 2px at 10% 15%, #fff, transparent),
        radial-gradient(2px 2px at 25% 8%, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 35% 20%, #fff, transparent),
        radial-gradient(3px 3px at 45% 12%, rgba(255,215,0,0.8), transparent),
        radial-gradient(1px 1px at 55% 18%, #fff, transparent),
        radial-gradient(2px 2px at 65% 10%, rgba(255,255,255,0.7), transparent),
        radial-gradient(2px 2px at 75% 22%, #fff, transparent),
        radial-gradient(1px 1px at 85% 15%, rgba(255,215,0,0.6), transparent),
        radial-gradient(2px 2px at 90% 25%, #fff, transparent),
        radial-gradient(1px 1px at 15% 35%, rgba(255,255,255,0.8), transparent),
        radial-gradient(2px 2px at 30% 40%, #fff, transparent),
        radial-gradient(1px 1px at 50% 38%, rgba(255,215,0,0.7), transparent),
        radial-gradient(2px 2px at 70% 42%, #fff, transparent),
        radial-gradient(1px 1px at 80% 35%, rgba(255,255,255,0.6), transparent);
    animation: twinkle-stars 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes twinkle-stars {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Spiral path glow for night */
.journey-map-container.style-night .mandala-spiral-path {
    stroke: url(#goldGradient);
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.5));
}

/* STYLE 2: FANTASY RPG */
.journey-map-container.style-fantasy {
    background:
        linear-gradient(180deg,
            #2d4a3e 0%,
            #3d5a4e 20%,
            #4a6a5a 40%,
            #5a7a6a 60%,
            #6a8a7a 80%,
            #7a9a8a 100%
        );
}

.journey-map-container.style-fantasy::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 50 Q25 30 50 50 T100 50' stroke='%23ffffff10' fill='none' stroke-width='1'/%3E%3C/svg%3E") repeat,
        radial-gradient(circle at 20% 80%, rgba(139, 69, 19, 0.3) 0%, transparent 30%),
        radial-gradient(circle at 80% 70%, rgba(34, 139, 34, 0.2) 0%, transparent 25%);
    pointer-events: none;
    z-index: 1;
}

.journey-map-container.style-fantasy::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, rgba(139, 90, 43, 0.4), transparent);
    pointer-events: none;
    z-index: 1;
}

.journey-map-container.style-fantasy .mandala-spiral-path {
    stroke: #8B4513;
    stroke-dasharray: 8, 4;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* STYLE 3: TIBETAN THANGKA */
.journey-map-container.style-thangka {
    background:
        radial-gradient(ellipse at center, #8B0000 0%, #4a0000 50%, #1a0000 100%);
}

.journey-map-container.style-thangka::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-radial-gradient(circle at 50% 50%, transparent, transparent 80px, rgba(255, 215, 0, 0.05) 80px, rgba(255, 215, 0, 0.05) 82px),
        repeating-radial-gradient(circle at 50% 50%, transparent, transparent 160px, rgba(255, 215, 0, 0.03) 160px, rgba(255, 215, 0, 0.03) 164px);
    pointer-events: none;
    z-index: 1;
}

.journey-map-container.style-thangka::after {
    content: '';
    position: absolute;
    inset: 10px;
    border: 3px solid rgba(255, 215, 0, 0.3);
    border-radius: var(--radius-lg);
    pointer-events: none;
    z-index: 1;
}

.journey-map-container.style-thangka .mandala-spiral-path {
    stroke: #FFD700;
    stroke-width: 3;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
}

/* ============================================
   STYLE SWITCHER
   ============================================ */

.style-switcher {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 8px;
    z-index: 30;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    padding: 8px;
    border-radius: var(--radius-lg);
}

.style-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.style-btn:hover {
    transform: scale(1.1);
}

.style-btn.active {
    border-color: var(--color-gold);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.style-btn[data-style="night"] {
    background: linear-gradient(135deg, #0a0a2a, #1a1a4a);
}

.style-btn[data-style="fantasy"] {
    background: linear-gradient(135deg, #2d4a3e, #4a6a5a);
}

.style-btn[data-style="thangka"] {
    background: linear-gradient(135deg, #8B0000, #4a0000);
}

/* ============================================
   MANDALA MAP INNER
   ============================================ */

.mandala-map {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 700px;
    z-index: 5;
}

.mandala-map svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.mandala-spiral-path {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ============================================
   NEW LOCATION TYPES (18 unique)
   ============================================ */

/* Gateway - Врата */
.location-node[data-type="gateway"] .location-node__icon {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.5);
}

/* Lake - Озеро */
.location-node[data-type="lake"] .location-node__icon {
    background: linear-gradient(135deg, #4A90D9 0%, #2563EB 100%);
    box-shadow: 0 4px 15px rgba(74, 144, 217, 0.5);
}

/* Cave - Пещера */
.location-node[data-type="cave"] .location-node__icon {
    background: linear-gradient(135deg, #4B0082 0%, #2E0854 100%);
    box-shadow: 0 4px 15px rgba(75, 0, 130, 0.5);
}

/* Tower - Башня */
.location-node[data-type="tower"] .location-node__icon {
    background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.5);
}

/* Garden - Сад */
.location-node[data-type="garden"] .location-node__icon {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.5);
}

/* Mountain - Гора */
.location-node[data-type="mountain"] .location-node__icon {
    background: linear-gradient(135deg, #00BFFF 0%, #0099CC 100%);
    box-shadow: 0 4px 15px rgba(0, 191, 255, 0.5);
}

/* Temple - Храм */
.location-node[data-type="temple"] .location-node__icon {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.6);
}

/* Portal - Портал */
.location-node[data-type="portal"] .location-node__icon {
    background: linear-gradient(135deg, #EC4899 0%, #BE185D 100%);
    box-shadow: 0 4px 20px rgba(236, 72, 153, 0.5);
    animation: portal-glow 2s ease-in-out infinite;
}

@keyframes portal-glow {
    0%, 100% { box-shadow: 0 4px 20px rgba(236, 72, 153, 0.5); }
    50% { box-shadow: 0 4px 30px rgba(236, 72, 153, 0.8), 0 0 40px rgba(236, 72, 153, 0.4); }
}

/* Monastery - Монастырь */
.location-node[data-type="monastery"] .location-node__icon {
    background: linear-gradient(135deg, #78716C 0%, #57534E 100%);
    box-shadow: 0 4px 15px rgba(120, 113, 108, 0.5);
}

/* Forest - Лес */
.location-node[data-type="forest"] .location-node__icon {
    background: linear-gradient(135deg, #22C55E 0%, #166534 100%);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.5);
}

/* Field - Поле */
.location-node[data-type="field"] .location-node__icon {
    background: linear-gradient(135deg, #EAB308 0%, #CA8A04 100%);
    box-shadow: 0 4px 15px rgba(234, 179, 8, 0.5);
}

/* Peak - Вершина */
.location-node[data-type="peak"] .location-node__icon {
    background: linear-gradient(135deg, #E5E7EB 0%, #9CA3AF 100%);
    box-shadow: 0 4px 20px rgba(229, 231, 235, 0.6);
}

/* Arena - Арена */
.location-node[data-type="arena"] .location-node__icon {
    background: linear-gradient(135deg, #EF4444 0%, #B91C1C 100%);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.5);
}

/* Meadow - Поляна */
.location-node[data-type="meadow"] .location-node__icon {
    background: linear-gradient(135deg, #F472B6 0%, #DB2777 100%);
    box-shadow: 0 4px 15px rgba(244, 114, 182, 0.5);
}

/* Library - Библиотека */
.location-node[data-type="library"] .location-node__icon {
    background: linear-gradient(135deg, #6366F1 0%, #4338CA 100%);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.5);
}

/* Camp - Привал */
.location-node[data-type="camp"] .location-node__icon {
    background: linear-gradient(135deg, #F97316 0%, #C2410C 100%);
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.5);
}

/* Gate - Врата (финальные) */
.location-node[data-type="gate"] .location-node__icon {
    background: linear-gradient(135deg, #FFD700 0%, #FFFFFF 50%, #FFD700 100%);
    box-shadow: 0 4px 30px rgba(255, 215, 0, 0.7);
    animation: gate-shine 3s ease-in-out infinite;
}

@keyframes gate-shine {
    0%, 100% {
        box-shadow: 0 4px 30px rgba(255, 215, 0, 0.7);
        filter: brightness(1);
    }
    50% {
        box-shadow: 0 4px 40px rgba(255, 215, 0, 1), 0 0 60px rgba(255, 255, 255, 0.5);
        filter: brightness(1.2);
    }
}

/* ============================================
   MANDALA LOCATION NODES
   ============================================ */

.mandala-map .location-node {
    transform: translate(-50%, -50%);
}

/* Базовый размер иконки */
.mandala-map .location-node__icon {
    width: 60px;
    height: 60px;
    font-size: 1.6rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.4),
        inset 0 -2px 10px rgba(0, 0, 0, 0.2);
}

/* === РАЗМЕРЫ ИКОНОК ПО КОЛЬЦАМ === */

/* Внешнее кольцо - большие иконки */
.mandala-map .location-node.size-outer .location-node__icon {
    width: 70px;
    height: 70px;
    font-size: 1.9rem;
}

/* Среднее кольцо - средние иконки */
.mandala-map .location-node.size-middle .location-node__icon {
    width: 55px;
    height: 55px;
    font-size: 1.5rem;
}

/* Внутреннее кольцо - маленькие иконки */
.mandala-map .location-node.size-inner .location-node__icon {
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
}

/* Центр мандалы - самая большая иконка */
.mandala-map .location-node.size-center .location-node__icon {
    width: 90px;
    height: 90px;
    font-size: 2.5rem;
    border-width: 4px;
}

.mandala-map .location-node:hover .location-node__icon {
    border-color: rgba(255, 215, 0, 0.9);
    transform: scale(1.15);
    box-shadow:
        0 6px 30px rgba(255, 215, 0, 0.5),
        inset 0 -2px 10px rgba(0, 0, 0, 0.2);
}

/* Locked location style */
.mandala-map .location-node.locked .location-node__icon {
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Center location - теперь управляется через класс size-center */

/* ============================================
   AVATAR SELECTOR
   ============================================ */

.avatar-selector {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 30;
}

.avatar-selector__trigger {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    cursor: pointer;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
    transition: all 0.3s ease;
}

.avatar-selector__trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 30px rgba(255, 215, 0, 0.6);
}

.avatar-selector__trigger img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* Avatar Modal */
.avatar-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.avatar-modal.active {
    opacity: 1;
    visibility: visible;
}

.avatar-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.avatar-modal__content {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    max-width: 400px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.avatar-modal.active .avatar-modal__content {
    transform: scale(1);
}

.avatar-modal__title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.avatar-option {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.avatar-option:hover {
    transform: scale(1.1);
    border-color: var(--color-gold);
}

.avatar-option.selected {
    border-color: var(--color-gold);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.avatar-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 2px dashed var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.avatar-upload:hover {
    border-color: var(--color-gold);
    background: rgba(255, 215, 0, 0.05);
}

.avatar-upload input {
    display: none;
}

.avatar-upload__icon {
    font-size: 2rem;
    color: var(--text-muted);
}

.avatar-upload__text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ============================================
   UPDATED STATS PANEL
   ============================================ */

.journey-map-container .journey-map__stats {
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.stats-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-gold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-xs);
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

/* ============================================
   UPDATED LEGEND FOR THEMES
   ============================================ */

.journey-map-container .journey-map__legend {
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.journey-map-container.style-fantasy .journey-map__legend,
.journey-map-container.style-fantasy .journey-map__stats {
    background: rgba(45, 74, 62, 0.9);
    border-color: rgba(139, 69, 19, 0.3);
}

.journey-map-container.style-thangka .journey-map__legend,
.journey-map-container.style-thangka .journey-map__stats {
    background: rgba(74, 0, 0, 0.9);
    border-color: rgba(255, 215, 0, 0.3);
}

/* ============================================
   MAP STYLE SWITCHER (JS class names)
   ============================================ */

.map-style-switcher {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 8px;
    z-index: 30;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    padding: 8px;
    border-radius: var(--radius-lg);
}

.map-style-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.1);
}

.map-style-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
}

.map-style-btn.active {
    border-color: var(--color-gold);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* ============================================
   JOURNEY MAP HEADER
   ============================================ */

.journey-map__header {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: var(--spacing-lg) var(--spacing-md);
}

.journey-map__title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--spacing-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.title-icon {
    font-size: 2rem;
}

.journey-map__subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0;
}

/* ============================================
   MANDALA LOCATIONS CONTAINER
   ============================================ */

.mandala-locations {
    position: absolute;
    inset: 0;
    z-index: 10;
}

/* ============================================
   MANDALA BACKGROUND
   ============================================ */

.mandala-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle-star 3s ease-in-out infinite;
}

@keyframes twinkle-star {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* ============================================
   MANDALA PATH SVG
   ============================================ */

.mandala-path {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.spiral-path-bg {
    stroke-linecap: round;
}

.spiral-path-active {
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

/* ============================================
   JOURNEY STATS PANEL (JS class names)
   ============================================ */

.journey-stats-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    z-index: 30;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--spacing-xs) 0;
}

.stat-icon {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-gold);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   JOURNEY LEGEND (JS class names)
   ============================================ */

.journey-legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    z-index: 30;
}

.legend-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-gold);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.legend-emoji {
    font-size: 1rem;
}

/* ============================================
   PLAYER AVATAR CONTAINER
   ============================================ */

.player-avatar-container {
    position: absolute;
    z-index: 25;
    cursor: pointer;
    transition: all 0.5s ease;
    transform: translate(-50%, -50%);
}

.player-avatar-container .player-avatar {
    width: 50px;
    height: 50px;
    background: var(--gradient-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow:
        0 0 20px rgba(255, 215, 0, 0.6),
        0 4px 15px rgba(0, 0, 0, 0.3);
    animation: float 3s ease-in-out infinite;
    border: 3px solid rgba(255, 255, 255, 0.5);
}

.player-glow {
    position: absolute;
    inset: -10px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse-glow 2s ease-in-out infinite;
    pointer-events: none;
}

/* ============================================
   AVATAR SELECTOR MODAL
   ============================================ */

.avatar-selector-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.avatar-selector-modal.active {
    opacity: 1;
    visibility: visible;
}

.avatar-selector-modal .avatar-selector__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.avatar-selector-modal .avatar-selector__content {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    max-width: 400px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.avatar-selector-modal.active .avatar-selector__content {
    transform: scale(1);
}

.avatar-selector-modal h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.avatar-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.avatar-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.avatar-close {
    width: 100%;
}

/* ============================================
   LOCATION NODE LABEL
   ============================================ */

/* === НОМЕР ACI - ВСЕГДА ВИДЕН === */
.location-number {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: var(--color-gold);
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    background: rgba(0, 0, 0, 0.85);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 16;
}

/* === TOOLTIP - ПОЯВЛЯЕТСЯ ПРИ HOVER === */
.location-node__tooltip {
    position: absolute;
    bottom: -75px;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    text-align: center;
    pointer-events: none;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    background: rgba(0, 0, 0, 0.95);
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 215, 0, 0.4);
    min-width: 140px;
    max-width: 200px;
}

/* Показываем tooltip при hover на локацию */
.location-node:hover .location-node__tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

/* Стрелка tooltip */
.location-node__tooltip::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 8px 8px 8px;
    border-style: solid;
    border-color: transparent transparent rgba(0, 0, 0, 0.95) transparent;
}

.tooltip-title {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
    white-space: normal;
    line-height: 1.3;
}

.tooltip-course {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: normal;
    line-height: 1.3;
}

/* ============================================
   LOCATION NODE GLOW
   ============================================ */

.location-node__glow {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--location-color, rgba(255, 215, 0, 0.3)) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.location-node:hover .location-node__glow {
    opacity: 1;
}

.location-node.status-in-progress .location-node__glow {
    opacity: 0.5;
    animation: pulse-glow 2s ease-in-out infinite;
}

/* ============================================
   LOCATION CHECKMARK
   ============================================ */

.location-node__checkmark {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: var(--color-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    font-weight: bold;
    z-index: 5;
}

/* ============================================
   LOCATION PROGRESS RING
   ============================================ */

.location-node__progress-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--color-gold);
    animation: spin 2s linear infinite;
    pointer-events: none;
}

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

/* ============================================
   FANTASY STYLE ELEMENTS
   ============================================ */

.fantasy-compass {
    position: absolute;
    top: 70px;
    right: 30px;
    width: 60px;
    height: 60px;
    opacity: 0.3;
}

.fantasy-border {
    position: absolute;
    inset: 5px;
    border: 2px solid rgba(139, 69, 19, 0.3);
    border-radius: var(--radius-lg);
    pointer-events: none;
}

/* ============================================
   THANGKA STYLE ELEMENTS
   ============================================ */

.thangka-border {
    position: absolute;
    inset: 15px;
    border: 2px solid rgba(255, 215, 0, 0.2);
    border-radius: var(--radius-lg);
    pointer-events: none;
}

.thangka-lotus {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform: translate(-50%, 50%);
    width: 100px;
    height: 100px;
    opacity: 0.1;
}

/* ============================================
   THEME-SPECIFIC OVERRIDES
   ============================================ */

.journey-map-container.style-fantasy .journey-stats-panel,
.journey-map-container.style-fantasy .journey-legend {
    background: rgba(45, 74, 62, 0.9);
    border-color: rgba(139, 69, 19, 0.3);
}

.journey-map-container.style-thangka .journey-stats-panel,
.journey-map-container.style-thangka .journey-legend {
    background: rgba(74, 0, 0, 0.9);
    border-color: rgba(255, 215, 0, 0.3);
}

.journey-map-container.style-fantasy .location-name {
    background: rgba(45, 74, 62, 0.9);
}

.journey-map-container.style-thangka .location-name {
    background: rgba(74, 0, 0, 0.9);
}

/* ============================================
   ANIMATION FOR LOCATION NODES
   ============================================ */

.location-node {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
}

.location-node.animate-in {
    animation: location-appear 0.5s ease-out forwards;
}

@keyframes location-appear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.location-node.locked.animate-in {
    animation: location-appear-locked 0.5s ease-out forwards;
}

@keyframes location-appear-locked {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    to {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ============================================
   RESPONSIVE FOR MANDALA
   ============================================ */

@media (max-width: 768px) {
    .journey-map-container {
        min-height: 500px;
    }

    .mandala-map {
        min-height: 500px;
    }

    .mandala-map .location-node__icon {
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
    }

    .mandala-map .location-node[data-position="18"] .location-node__icon {
        width: 65px;
        height: 65px;
        font-size: 1.8rem;
    }

    .style-switcher {
        top: 10px;
        left: 10px;
        padding: 6px;
    }

    .style-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .avatar-selector__trigger {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
}

/* ============================================
   TOOLTIP ВВЕРХ (для нижних локаций)
   ============================================ */

.location-node.tooltip-up .location-node__tooltip {
    bottom: auto;
    top: -80px;
}

/* Стрелка tooltip вниз */
.location-node.tooltip-up .location-node__tooltip::before {
    top: auto;
    bottom: -8px;
    border-width: 8px 8px 0 8px;
    border-color: rgba(0, 0, 0, 0.95) transparent transparent transparent;
}

/* ============================================
   LOCKED MESSAGE (всплывающая подсказка)
   ============================================ */

.locked-msg {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(239, 68, 68, 0.95);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
    z-index: 200;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
    animation: locked-appear 0.2s ease-out;
    max-width: 220px;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
}

.locked-msg::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0 6px;
    border-style: solid;
    border-color: rgba(239, 68, 68, 0.95) transparent transparent transparent;
}

@keyframes locked-appear {
    from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================
   JM-POPUP (попап информации о локации)
   ============================================ */

.jm-popup {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.jm-popup.active {
    opacity: 1;
    visibility: visible;
}

.jm-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
}

.jm-popup__content {
    position: relative;
    background: var(--bg-card, #1a1a2e);
    border: 1px solid rgba(255, 215, 0, 0.25);
    border-radius: 20px;
    padding: 32px;
    max-width: 480px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.92);
    transition: transform 0.25s ease;
    text-align: center;
}

.jm-popup.active .jm-popup__content {
    transform: scale(1);
}

.jm-popup__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-muted, #9ca3af);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.jm-popup__close:hover {
    background: rgba(239, 68, 68, 0.8);
    color: #fff;
}

.jm-popup__icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin: 0 auto 16px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.4);
}

.jm-popup__title {
    font-family: var(--font-heading, serif);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
    margin: 0 0 6px;
}

.jm-popup__subtitle {
    font-size: 0.85rem;
    color: #4A90D9;
    margin: 0 0 14px;
    font-weight: 500;
}

.jm-popup__description {
    font-size: 0.9rem;
    color: var(--text-muted, #9ca3af);
    line-height: 1.6;
    margin: 0 0 20px;
}

/* Прогресс в popup */
.jm-popup__progress {
    margin: 0 0 20px;
    text-align: left;
}

.jm-popup__progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.jm-popup__progress-fill {
    height: 100%;
    background: linear-gradient(to right, #FFD700, #4A90D9);
    border-radius: 3px;
    transition: width 0.6s ease;
}

.jm-popup__progress-text {
    font-size: 0.8rem;
    color: var(--text-muted, #9ca3af);
    text-align: center;
}

.jm-popup__progress-new {
    font-size: 0.8rem;
    color: var(--text-muted, #9ca3af);
    text-align: center;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
}

.jm-popup__actions {
    margin-top: 4px;
}

.jm-popup__enter-btn {
    width: 100%;
    padding: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Блокировка прокрутки при открытом popup */
body.jm-popup-open {
    overflow: hidden;
}

/* ============================================
   MOBILE FIXES (375px)
   ============================================ */

/* ============================================
   MOBILE: Stats + Legend outside map (no overlap)
   ============================================ */

@media (max-width: 768px) {
    /* Header - compact, enough room for style switcher */
    .journey-map__header {
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .journey-map__title {
        font-size: 1.1rem;
        gap: 4px;
    }

    .title-icon {
        font-size: 1.1rem;
    }

    .journey-map__subtitle {
        font-size: 0.7rem;
    }

    /* Style switcher - horizontal under header, not overlapping map */
    .map-style-switcher {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        justify-content: center;
        margin: 4px auto 0;
        padding: 4px;
        gap: 4px;
    }

    .map-style-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    /* Stats - horizontal compact strip ABOVE map area */
    .journey-stats-panel {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        flex-direction: row !important;
        justify-content: space-around;
        min-width: auto;
        padding: 8px 12px;
        margin-bottom: 8px;
        border-radius: var(--radius-md);
    }

    .journey-stats-panel .stat-item {
        flex-direction: row;
        gap: 6px;
        padding: 0;
    }

    .journey-stats-panel .stat-icon {
        font-size: 1rem;
        margin-bottom: 0;
    }

    .journey-stats-panel .stat-value {
        font-size: 0.9rem;
    }

    .journey-stats-panel .stat-label {
        display: none;
    }

    /* Legend - collapsed by default on mobile, toggle with CSS */
    .journey-legend {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        padding: 8px 12px;
        margin-top: 8px;
        border-radius: var(--radius-md);
        max-height: 36px;
        overflow: hidden;
        transition: max-height 0.3s ease;
        cursor: pointer;
    }

    .journey-legend.expanded {
        max-height: 200px;
    }

    .journey-legend .legend-title::after {
        content: ' (tap)';
        font-size: 0.6rem;
        opacity: 0.5;
        font-weight: 400;
    }

    .journey-legend.expanded .legend-title::after {
        content: ' (hide)';
    }

    .legend-items {
        gap: 4px 8px;
    }

    .legend-item {
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .journey-map {
        min-height: 380px;
    }

    .journey-map-container {
        min-height: 380px;
    }

    .mandala-map {
        min-height: 380px;
    }

    /* Nodes smaller */
    .mandala-map .location-node__icon {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }

    .mandala-map .location-node[data-position="18"] .location-node__icon {
        width: 55px;
        height: 55px;
        font-size: 1.5rem;
    }

    .location-node__name {
        font-size: 0.6rem;
        padding: 2px 5px;
        max-width: 65px;
    }

    /* Style switcher */
    .map-style-switcher {
        top: 6px;
        left: 6px;
        padding: 4px;
        gap: 2px;
    }

    .map-style-btn {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }

    /* Avatar selector */
    .avatar-selector__trigger {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    /* Popup on mobile */
    .jm-popup__content {
        padding: 20px;
        width: 95%;
    }

    .jm-popup__icon {
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
    }

    .jm-popup__title {
        font-size: 1.2rem;
    }
}
