.map-shell {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.map-context-card .card__body {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.map-context-actions {
    display: grid;
    gap: var(--spacing-sm);
}

.map-parent-menu__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--spacing-sm);
}

.map-location-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--spacing-sm);
}

.map-submenu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--spacing-sm);
}

.map-submenu-grid > .btn {
    width: 100%;
}

.map-submenu-grid__full {
    grid-column: 1 / -1;
}

.map-shell__topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
}

.map-subarea-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

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

.map-subarea-row--modal {
    padding: var(--spacing-sm) 0;
}

.map-influence-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) 0;
}

.map-events-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.map-event-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.map-event-row {
    border: 1px solid var(--theme-border);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-sm);
    background: rgba(0, 0, 0, 0.18);
}

.map-event-row__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

.map-modal-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.map-modal-section + .map-modal-section {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--theme-border);
}

.map-modal-item {
    width: 100%;
    text-align: left;
    border: 1px solid var(--theme-border);
    border-radius: var(--border-radius-md);
    background: rgba(0, 0, 0, 0.2);
    padding: var(--spacing-sm);
    color: var(--color-text);
    transition: border-color 120ms ease, transform 120ms ease;
}

.map-modal-item:hover,
.map-modal-item:focus {
    border-color: var(--theme-accent);
    transform: translateY(-1px);
}

.map-modal-item__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

.map-viewport {
    position: relative;
    min-height: 360px;
    border: 1px solid var(--theme-border);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    background: #0f1826;
}

.map-3d-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.map-pin-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}

.map-viewport__base {
    position: absolute;
    inset: 0;
    perspective: 920px;
    transform-style: preserve-3d;
}

.map-lowpoly-scene {
    position: absolute;
    inset: 0;
    opacity: 0.95;
    transform: translateY(0) scale(1.03);
    transform-style: preserve-3d;
}

.map-sea-plane {
    position: absolute;
    inset: -5% -6%;
    border-radius: 8% / 10%;
    background:
        radial-gradient(circle at 26% 38%, rgba(126, 167, 199, 0.12), transparent 40%),
        radial-gradient(circle at 74% 58%, rgba(126, 167, 199, 0.12), transparent 40%),
        #102033;
    border: 1px solid rgba(180, 195, 220, 0.12);
    box-shadow:
        inset 0 0 24px rgba(30, 62, 96, 0.18),
        0 22px 34px rgba(0, 0, 0, 0.3);
    transform: translateZ(-24px);
}

.map-continent {
    position: absolute;
    filter: drop-shadow(0 11px 16px rgba(0, 0, 0, 0.42));
    transform-style: preserve-3d;
}

.map-facet {
    position: absolute;
    display: block;
    border: 1px solid rgba(203, 169, 113, 0.62);
    box-shadow:
        inset 0 0 0 1px rgba(244, 222, 181, 0.16),
        0 10px 18px rgba(0, 0, 0, 0.28);
    background:
        linear-gradient(135deg, #8a8f6b 0%, #5f694f 55%, #485342 100%);
    transform: translateZ(14px);
}

.map-continent--na { left: 8%; top: 15%; width: 30%; height: 28%; }
.map-continent--sa { left: 22%; top: 42%; width: 16%; height: 40%; }
.map-continent--eu { left: 44%; top: 20%; width: 13%; height: 14%; }
.map-continent--af { left: 46%; top: 34%; width: 16%; height: 34%; }
.map-continent--as { left: 56%; top: 16%; width: 31%; height: 38%; }
.map-continent--oc { left: 78%; top: 58%; width: 14%; height: 15%; }

.map-facet--na-a {
    left: 0; top: 0; width: 92%; height: 78%;
    clip-path: polygon(8% 18%, 36% 3%, 74% 8%, 98% 28%, 86% 68%, 56% 84%, 18% 76%, 2% 46%);
}
.map-facet--na-b {
    left: 19%; top: 53%; width: 55%; height: 44%;
    clip-path: polygon(7% 0, 72% 12%, 100% 55%, 64% 100%, 12% 76%, 0 34%);
    background: linear-gradient(145deg, #6f7558 0%, #535d45 52%, #3f4b3b 100%);
    transform: translateZ(20px);
}

.map-facet--sa-a {
    left: 3%; top: 0; width: 92%; height: 88%;
    clip-path: polygon(28% 0, 73% 10%, 96% 35%, 75% 72%, 58% 100%, 29% 93%, 5% 62%, 12% 26%);
}
.map-facet--sa-b {
    left: 18%; top: 34%; width: 52%; height: 63%;
    clip-path: polygon(11% 0, 84% 14%, 95% 48%, 58% 100%, 21% 88%, 0 39%);
    background: linear-gradient(140deg, #7a8061 0%, #556046 58%, #414b39 100%);
    transform: translateZ(19px);
}

.map-facet--eu-a {
    left: 0; top: 4%; width: 100%; height: 86%;
    clip-path: polygon(4% 36%, 34% 8%, 82% 16%, 100% 42%, 79% 73%, 38% 81%, 9% 60%);
}
.map-facet--eu-b {
    left: 35%; top: 50%; width: 44%; height: 40%;
    clip-path: polygon(8% 0, 84% 10%, 100% 56%, 62% 100%, 11% 77%, 0 34%);
    background: linear-gradient(145deg, #6f7558 0%, #535d45 52%, #3f4b3b 100%);
    transform: translateZ(19px);
}

.map-facet--af-a {
    left: 5%; top: 0; width: 88%; height: 86%;
    clip-path: polygon(37% 0, 77% 14%, 96% 48%, 82% 78%, 56% 100%, 22% 90%, 0 53%, 10% 20%);
}
.map-facet--af-b {
    left: 32%; top: 42%; width: 44%; height: 54%;
    clip-path: polygon(20% 0, 82% 9%, 100% 52%, 61% 100%, 9% 78%, 0 31%);
    background: linear-gradient(140deg, #7a8061 0%, #556046 58%, #414b39 100%);
    transform: translateZ(18px);
}

.map-facet--as-a {
    left: 0; top: 2%; width: 96%; height: 74%;
    clip-path: polygon(8% 22%, 33% 3%, 70% 7%, 100% 28%, 92% 57%, 69% 73%, 34% 77%, 8% 61%);
}
.map-facet--as-b {
    left: 22%; top: 38%; width: 74%; height: 47%;
    clip-path: polygon(7% 9%, 47% 0, 92% 16%, 100% 55%, 74% 90%, 30% 100%, 0 63%);
    background: linear-gradient(145deg, #6f7558 0%, #535d45 52%, #3f4b3b 100%);
    transform: translateZ(20px);
}
.map-facet--as-c {
    left: 44%; top: 55%; width: 32%; height: 36%;
    clip-path: polygon(14% 0, 81% 14%, 100% 62%, 65% 100%, 16% 88%, 0 36%);
    background: linear-gradient(140deg, #7a8061 0%, #556046 58%, #414b39 100%);
    transform: translateZ(14px);
}

.map-facet--oc-a {
    left: 0; top: 0; width: 100%; height: 100%;
    clip-path: polygon(12% 34%, 40% 8%, 77% 13%, 100% 42%, 83% 79%, 52% 98%, 16% 82%, 0 57%);
}

.map-fog-layer {
    position: absolute;
    inset: -14% -12%;
    pointer-events: none;
    opacity: 0.28;
    mix-blend-mode: screen;
    transform: translateZ(40px);
}

.map-fog-layer--a {
    background:
        radial-gradient(ellipse at 24% 50%, rgba(214, 191, 161, 0.18), transparent 42%),
        radial-gradient(ellipse at 72% 52%, rgba(196, 172, 149, 0.16), transparent 46%),
        radial-gradient(ellipse at 50% 54%, rgba(175, 154, 133, 0.12), transparent 34%);
    animation: map-fog-drift-a 30s linear infinite;
}

.map-fog-layer--b {
    background:
        radial-gradient(ellipse at 24% 56%, rgba(197, 178, 158, 0.16), transparent 44%),
        radial-gradient(ellipse at 80% 56%, rgba(167, 150, 134, 0.14), transparent 42%),
        radial-gradient(ellipse at 48% 58%, rgba(214, 194, 172, 0.1), transparent 40%);
    animation: map-fog-drift-b 42s linear infinite;
}

.map-pin {
    position: absolute;
    transform: translate(-50%, -50%);
    background: transparent;
    border: none;
    padding: 0;
    color: var(--color-text);
    cursor: pointer;
    text-align: center;
    pointer-events: auto;
    z-index: 4;
}

.map-pin__monument {
    position: absolute;
    left: 50%;
    bottom: 34px;
    transform: translateX(-50%);
    display: inline-block;
    pointer-events: none;
    transition: transform 220ms ease, filter 220ms ease;
}

.map-monument {
    position: relative;
    display: inline-block;
    width: 62px;
    height: 62px;
    transform-style: preserve-3d;
    filter: drop-shadow(0 16px 16px rgba(0, 0, 0, 0.62));
    transform: rotateY(-30deg) rotateX(8deg) scale(1.12);
}

.map-monument__part {
    position: absolute;
    display: block;
    background: linear-gradient(155deg, #d9c59f 0%, #9f7f52 55%, #6d583c 100%);
    border: 1px solid rgba(240, 218, 178, 0.35);
    box-shadow: inset 0 0 0 1px rgba(255, 245, 220, 0.12);
    transform-style: preserve-3d;
}

.map-monument__part::before,
.map-monument__part::after {
    content: '';
    position: absolute;
    display: block;
    pointer-events: none;
}

/* Lado direito visível do volume */
.map-monument__part::before {
    top: -1px;
    right: -6px;
    width: 6px;
    height: calc(100% + 2px);
    background: linear-gradient(180deg, #8f7048 0%, #644d33 100%);
    border-top: 1px solid rgba(240, 218, 178, 0.2);
    border-right: 1px solid rgba(240, 218, 178, 0.16);
    transform: rotateY(90deg) translateZ(3px);
    transform-origin: right center;
}

/* Topo visível do volume */
.map-monument__part::after {
    left: -1px;
    top: -5px;
    width: calc(100% + 2px);
    height: 5px;
    background: linear-gradient(90deg, #ebd8b4 0%, #ba9665 100%);
    border-top: 1px solid rgba(255, 243, 214, 0.3);
    transform: rotateX(90deg) translateZ(2px);
    transform-origin: center top;
}

.map-monument--tower .map-monument__part--a {
    left: 22px; bottom: 6px; width: 18px; height: 42px; transform: translateZ(22px);
}
.map-monument--tower .map-monument__part--b {
    left: 18px; bottom: 46px; width: 26px; height: 8px; transform: translateZ(26px);
}
.map-monument--tower .map-monument__part--c {
    left: 25px; bottom: 53px; width: 12px; height: 9px; transform: translateZ(30px);
}

.map-monument--cathedral .map-monument__part--a {
    left: 5px; bottom: 6px; width: 52px; height: 20px; transform: translateZ(20px);
}
.map-monument--cathedral .map-monument__part--b {
    left: 23px; bottom: 24px; width: 16px; height: 26px; transform: translateZ(30px);
}
.map-monument--cathedral .map-monument__part--c {
    left: 27px; bottom: 48px; width: 8px; height: 14px; transform: translateZ(34px);
}

.map-monument--bridge .map-monument__part--a {
    left: 3px; bottom: 14px; width: 54px; height: 10px; transform: skewX(-14deg) translateZ(16px);
}
.map-monument--bridge .map-monument__part--b {
    left: 8px; bottom: 22px; width: 9px; height: 22px; transform: translateZ(20px);
}
.map-monument--bridge .map-monument__part--c {
    left: 43px; bottom: 22px; width: 9px; height: 22px; transform: translateZ(20px);
}

.map-monument--obelisk .map-monument__part--a {
    left: 25px; bottom: 6px; width: 12px; height: 42px; transform: translateZ(22px);
}
.map-monument--obelisk .map-monument__part--b {
    left: 23px; bottom: 46px; width: 16px; height: 14px; clip-path: polygon(50% 0, 100% 100%, 0 100%); transform: translateZ(28px);
}
.map-monument--obelisk .map-monument__part--c {
    left: 19px; bottom: 0; width: 24px; height: 8px; transform: translateZ(14px);
}

.map-monument--fortress .map-monument__part--a {
    left: 3px; bottom: 6px; width: 56px; height: 18px; transform: translateZ(18px);
}
.map-monument--fortress .map-monument__part--b {
    left: 3px; bottom: 22px; width: 14px; height: 22px; transform: translateZ(24px);
}
.map-monument--fortress .map-monument__part--c {
    left: 45px; bottom: 22px; width: 14px; height: 22px; transform: translateZ(24px);
}

.map-monument--clocktower .map-monument__part--a {
    left: 24px; bottom: 6px; width: 14px; height: 36px; transform: translateZ(20px);
}
.map-monument--clocktower .map-monument__part--b {
    left: 20px; bottom: 40px; width: 22px; height: 10px; transform: translateZ(26px);
}
.map-monument--clocktower .map-monument__part--c {
    left: 25px; bottom: 49px; width: 12px; height: 13px; transform: translateZ(32px);
}

.map-monument--temple .map-monument__part--a {
    left: 4px; bottom: 6px; width: 54px; height: 14px; transform: translateZ(18px);
}
.map-monument--temple .map-monument__part--b {
    left: 11px; bottom: 18px; width: 40px; height: 16px; transform: translateZ(24px);
}
.map-monument--temple .map-monument__part--c {
    left: 4px; bottom: 32px; width: 54px; height: 16px; clip-path: polygon(50% 0, 100% 100%, 0 100%); transform: translateZ(30px);
}

.map-pin__dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--theme-accent);
    box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.45);
    animation: map-pin-pulse 2.2s infinite;
}

.map-pin__label {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.2;
    padding: 3px 7px;
    border-radius: 999px;
    border: 1px solid var(--theme-border);
    background: rgba(7, 8, 12, 0.78);
    white-space: nowrap;
}

.map-pin:hover .map-pin__label,
.map-pin:focus .map-pin__label,
.map-pin--active .map-pin__label {
    border-color: var(--theme-accent);
    background: rgba(212, 175, 55, 0.16);
}

.map-pin--active .map-pin__dot {
    background: #ffe79b;
    box-shadow: 0 0 0 6px rgba(212, 175, 55, 0.24);
}

.map-pin:hover .map-pin__monument,
.map-pin:focus .map-pin__monument,
.map-pin--active .map-pin__monument {
    transform: translateX(-50%) translateY(-2px);
    filter: brightness(1.08);
}

.map-pin--hover .map-pin__dot {
    box-shadow: 0 0 0 8px rgba(212, 175, 55, 0.2);
}

.map-focus-hint {
    position: absolute;
    left: var(--spacing-sm);
    right: var(--spacing-sm);
    bottom: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--theme-border);
    border-radius: var(--border-radius-md);
    background: rgba(6, 7, 11, 0.78);
    display: flex;
    justify-content: space-between;
    gap: var(--spacing-sm);
    font-size: var(--font-size-sm);
}

@keyframes map-fog-drift-a {
    0% {
        transform: translate3d(-4%, 0, 0) scale(1.02);
    }
    50% {
        transform: translate3d(3%, -2%, 0) scale(1.06);
    }
    100% {
        transform: translate3d(10%, -4%, 0) scale(1.04);
    }
}

@keyframes map-fog-drift-b {
    0% {
        transform: translate3d(4%, 3%, 0) scale(1.04);
    }
    50% {
        transform: translate3d(-3%, 0, 0) scale(1.09);
    }
    100% {
        transform: translate3d(-10%, -3%, 0) scale(1.05);
    }
}

.map-focus-hint strong,
.map-focus-hint span {
    min-width: 0;
}

.map-focus-hint span {
    text-align: right;
}

@keyframes map-pin-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4);
    }
    70% {
        box-shadow: 0 0 0 11px rgba(212, 175, 55, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
    }
}

@media (max-width: 360px) {
    .map-shell__topline {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .map-viewport {
        min-height: 260px;
    }

    .map-pin__label {
        font-size: 10px;
        padding: 2px 6px;
        max-width: 110px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .map-focus-hint {
        font-size: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .map-subarea-row,
    .map-subarea-row--modal {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .map-subarea-row .btn {
        width: 100%;
    }

    .map-modal-item__head {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
}

@media (min-width: 768px) {
    body.hud-layout-landscape .main-content--map.main-content--scene-focus {
        display: grid;
        grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
        align-items: stretch;
        gap: 12px;
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    body.hud-layout-landscape .main-content--map.main-content--scene-focus .map-scene-card,
    body.hud-layout-landscape .main-content--map.main-content--scene-focus .map-context-card {
        margin-bottom: 0;
        min-height: 0;
        overflow: hidden;
    }

    body.hud-layout-landscape .main-content--map.main-content--scene-focus .map-scene-card > .card__body {
        padding: 0;
        height: 100%;
        min-height: 0;
    }

    body.hud-layout-landscape .main-content--map.main-content--scene-focus .map-shell {
        height: 100%;
        min-height: 0;
        padding: var(--spacing-sm);
    }

    body.hud-layout-landscape .main-content--map.main-content--scene-focus .map-viewport {
        min-height: 0;
        height: 100%;
        flex: 1;
    }
}
