/*
 * v4-map.css — "how romka.cc runs": a dark night panel with the isometric map.
 */

.v4-map {
    position: relative;
    margin: 40px 0 0;
    padding: 90px 24px 110px;
    border-radius: 34px 34px 0 0;
    background: #0d1220;
    color: #eef2f7;
    overflow: hidden;
    isolation: isolate;
}

/* the night painting, dimmed so the map glows on top of it */
.v4-map-bg img {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 30%;
    opacity: .95;
}

.v4-map::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(55% 40% at 50% 64%, rgba(13, 18, 32, .45), rgba(13, 18, 32, 0) 75%),
        linear-gradient(180deg, rgba(13, 18, 32, .55), rgba(13, 18, 32, .05) 34%, rgba(13, 18, 32, .3) 70%, rgba(13, 18, 32, .9));
}

.v4-map-inner { max-width: 1240px; margin: 0 auto; }

/* ---------- head ---------- */

.v4-map-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 28px 40px; }
.v4-map-head > div { max-width: 600px; }

.v4-map-kicker {
    display: inline-block;
    margin: 0;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .16) inset;
    font: 500 .82rem var(--v4-mono);
    color: #c9d2e0;
}

.v4-map-head h2 { margin: 16px 0 12px; font-size: clamp(2.3rem, 5.4vw, 4.2rem); font-weight: 600; line-height: 1.02; letter-spacing: -.02em; }
.v4-map-head p { margin: 0; color: #aab4c4; font-size: 1.12rem; line-height: 1.6; }
.v4-map .v4-mark { box-shadow: 0 0 .5em rgba(255, 194, 71, .45); }

.v4-map-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    gap: 10px;
    margin: 0;
}

.v4-map-stats div {
    padding: 11px 14px;
    border-radius: 14px;
    background: rgba(16, 21, 34, .72);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .1) inset;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.v4-map-stats dt { color: #8d98aa; font: 500 .74rem var(--v4-mono); }
.v4-map-stats dd { margin: 3px 0 0; font: 600 1.35rem var(--v4-mono); color: #fff; }
.v4-map-stats dd.is-good { color: #7fe2a8; }

/* ---------- stage ---------- */

.v4-map-stage { position: relative; margin-top: 30px; }

.v4-map-svg { display: block; width: 100%; height: auto; overflow: visible; }

.v4-map-grid { stroke: rgba(255, 255, 255, .05); stroke-width: 1; }
.v4-map-zone-name { font: 600 12px var(--v4-mono); letter-spacing: .08em; text-transform: uppercase; opacity: .85; }

.v4-map-trace-line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.v4-map-trace-glow { fill: none; stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; opacity: .35; filter: url(#mapGlow); }
.v4-map-packet { filter: drop-shadow(0 0 5px var(--packet)) drop-shadow(0 0 2px #fff); }

.v4-map-block { transition: filter .25s ease, opacity .25s ease; }
.v4-map-tag-text { font: 600 13px var(--v4-mono); fill: #fff; }
.v4-map-tag { transition: opacity .25s ease; }

/* hovering a note lights its part of the map and dims the rest */
.v4-map-stage.is-focus .v4-map-block:not(.is-lit) { filter: saturate(.25) brightness(.5); }
.v4-map-stage.is-focus .v4-map-tag:not(.is-lit) { opacity: .4; }
.v4-map-stage.is-focus .v4-map-trace:not(.is-lit) { opacity: .25; }
.v4-map-block.is-lit { filter: drop-shadow(0 0 12px rgba(255, 220, 130, .7)) brightness(1.15); }

/* ---------- numbered notes ---------- */

.v4-map-notes { margin: 0; padding: 0; list-style: none; }

.v4-map-notes li {
    position: absolute;
    left: var(--nx);
    top: var(--ny);
    display: flex;
    gap: 10px;
    width: min(270px, 26%);
    padding: 11px 14px 12px 11px;
    border-radius: 14px;
    background: rgba(16, 21, 34, .82);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .12) inset, 0 18px 30px -18px rgba(0, 0, 0, .8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: default;
    transition: box-shadow .2s ease, transform .2s ease;
}

.v4-map-notes li:hover,
.v4-map-notes li:focus-within { transform: translateY(-2px); box-shadow: 0 0 0 1.5px var(--v4-yellow) inset, 0 18px 30px -18px rgba(0, 0, 0, .8); }

.v4-map-notes span {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--v4-yellow);
    color: var(--v4-ink);
    font: 600 .75rem var(--v4-mono);
}

.v4-map-notes p { margin: 0; color: #c3ccd9; font-size: .92rem; line-height: 1.45; }
.v4-map-notes strong { color: #fff; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
    .v4-map-packet { display: none; }
}

/* ---------- smaller screens: notes go under the map ---------- */

@media (max-width: 980px) {
    .v4-map { padding: 70px 18px 80px; border-radius: 26px 26px 0 0; }
    .v4-map-stats { width: 100%; }
    .v4-map-svg { margin: 0 -8%; width: 116%; }
    .v4-map-notes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 10px; }
    .v4-map-notes li { position: static; width: auto; }
}

@media (max-width: 560px) {
    .v4-map-svg { margin: -6% -20% -2%; width: 140%; }
    /* labels would be ~6px at this size; grow them from their pin */
    .v4-map-tag { transform-box: fill-box; transform-origin: 50% 100%; scale: 1.7; }
    .v4-map-zone-name { font-size: 16px; }
    .v4-map-notes { grid-template-columns: 1fr; }
    .v4-map-stats dd { font-size: 1.15rem; }
}
