/* =========================================
   WORLD MAP — TECHNICAL MOCKUP
   Final painted background will replace only
   the technical region layer, not the nodes.
========================================= */

#screen-map {
    padding: 6px;
}

.world-map-shell {
    width: min(100%, 920px);
    margin: 0 auto;
}

.world-map-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
}

.world-map-title {
    margin: 0;
    font-size: 14px;
    color: #f2d596;
    letter-spacing: .04em;
}

.world-map-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.world-map-control {
    min-width: 30px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid rgba(222, 181, 99, .72);
    border-radius: 7px;
    background: linear-gradient(#46331f, #24180f);
    color: #f7dfaa;
    font: inherit;
    font-weight: 800;
    touch-action: manipulation;
}

#world-map-zoom-value {
    min-width: 42px;
    color: #d9c59c;
    font-size: 11px;
    text-align: center;
}

#world-map-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border: 2px solid #76552e;
    border-radius: 10px;
    background:
        radial-gradient(circle at 52% 55%, rgba(80, 103, 73, .32), transparent 43%),
        linear-gradient(145deg, #20291f, #101713 62%, #0b1010);
    box-shadow:
        inset 0 0 0 1px rgba(240, 202, 126, .22),
        inset 0 0 26px rgba(0, 0, 0, .58);
    touch-action: none;
    cursor: grab;
}

#world-map-viewport.is-dragging {
    cursor: grabbing;
}

#world-map-content {
    --world-map-counter-scale: 1;
    position: absolute;
    inset: 0;
    transform-origin: 0 0;
    will-change: transform;
}

.world-map-svg,
#world-map-nodes {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.world-map-svg {
    overflow: visible;
}

#world-map-regions {
    z-index: 1;
}

#world-map-routes {
    z-index: 2;
    pointer-events: none;
}

#world-map-nodes {
    z-index: 3;
    pointer-events: none;
}

.world-map-region-shape {
    stroke: rgba(227, 205, 153, .55);
    stroke-width: .35;
    vector-effect: non-scaling-stroke;
}

.world-map-region-shape[data-region="steppe_wastes"] { fill: rgba(171, 137, 72, .32); }
.world-map-region-shape[data-region="poisonous_thickets"] { fill: rgba(75, 121, 64, .34); }
.world-map-region-shape[data-region="ancient_complex"] { fill: rgba(100, 104, 112, .35); }
.world-map-region-shape[data-region="sacred_forest"] { fill: rgba(48, 113, 72, .38); }
.world-map-region-shape[data-region="lands_of_dead"] { fill: rgba(85, 72, 96, .38); }
.world-map-region-shape[data-region="demonic_breach"] { fill: rgba(132, 52, 39, .36); }
.world-map-region-shape[data-region="elemental_lands"] { fill: rgba(59, 105, 126, .37); }
.world-map-region-shape[data-region="warped_lands"] { fill: rgba(104, 48, 116, .39); }
.world-map-region-shape[data-region="giant_lands"] { fill: rgba(111, 91, 69, .4); }
.world-map-region-shape[data-region="dragon_ridge"] { fill: rgba(91, 80, 76, .46); }

.world-map-region-label,
.world-map-region-number {
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
    paint-order: stroke;
    stroke: rgba(12, 12, 10, .85);
    stroke-width: .45px;
    fill: #ead8ac;
}

.world-map-region-number {
    font-size: 2.6px;
    font-weight: 900;
    fill: #d8aa50;
}

.world-map-region-label {
    font-size: 1.75px;
    font-weight: 800;
    letter-spacing: .03em;
}

.world-map-route {
    stroke: rgba(205, 187, 145, .68);
    stroke-width: .58;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

.world-map-route.is-locked {
    stroke-dasharray: 1.4 1.1;
    stroke: rgba(194, 106, 90, .76);
}

.world-map-node-wrap {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
}

.world-map-node-ui {
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform:
        scale(var(--world-map-counter-scale))
        translate(-50%, -50%);
    transform-origin: 0 0;
    will-change: transform;
}

.world-map-node {
    width: 8px;
    height: 8px;
    border: 1.5px solid #3b2914;
    border-radius: 50%;
    background: #e0aa35;
    box-shadow:
        0 0 0 1px rgba(247, 219, 149, .58),
        0 1px 4px rgba(0, 0, 0, .8);
}

.world-map-node.is-city {
    width: 13px;
    height: 13px;
    border-radius: 3px;
    background: #d3a552;
}

.world-map-node.is-current {
    background: #63d8ff;
    box-shadow:
        0 0 0 2px rgba(112, 222, 255, .42),
        0 0 9px rgba(74, 202, 255, .95);
}

.world-map-node-label {
    max-width: 74px;
    margin-top: 2px;
    padding: 1px 3px;
    border-radius: 3px;
    background: rgba(13, 14, 12, .72);
    color: #f2e3bd;
    font-size: 7px;
    font-weight: 700;
    line-height: 1.08;
    text-align: center;
    text-shadow: 0 1px 2px #000;
    white-space: normal;
}

.world-map-legend {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 5px;
    color: #bfae8b;
    font-size: 10px;
}

.world-map-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.world-map-legend-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #e0aa35;
}

.world-map-legend-dot.current {
    background: #63d8ff;
    box-shadow: 0 0 5px rgba(74, 202, 255, .9);
}

@media (min-width: 700px) {
    .world-map-node {
        width: 10px;
        height: 10px;
    }

    .world-map-node-label {
        max-width: 96px;
        font-size: 9px;
    }

    .world-map-title {
        font-size: 17px;
    }
}
