
.map-page { padding-block: 2rem 3rem; }
.map-page h1 { margin: .3rem 0 .6rem; font-size: clamp(2rem, 4vw, 3rem); color: var(--heading); }
.map-lede { max-width: 60ch; margin: 0 0 1.4rem; color: var(--muted); font-size: 1.05rem; }
.map-figure { margin: 0 0 2rem; }
.world-map { display: block; width: 100%; height: auto; border: 1px solid color-mix(in srgb, var(--copper) 50%, transparent); border-radius: 18px; background: var(--bg); }

.map-sea { fill: color-mix(in srgb, var(--planet) 7%, var(--bg)); }
.map-sea-lines path { fill: none; stroke: color-mix(in srgb, var(--planet) 22%, transparent); stroke-width: 2; }
.map-land { fill: color-mix(in srgb, var(--parchment) 16%, var(--bg)); stroke: color-mix(in srgb, var(--copper) 55%, transparent); stroke-width: 3; }
.lit-in { stop-color: var(--parchment); stop-opacity: .16; }
.lit-out { stop-color: var(--parchment); stop-opacity: 0; }
.map-relief .ridge { fill: none; stroke: color-mix(in srgb, var(--copper) 60%, transparent); stroke-width: 2.4; stroke-linejoin: round; }
.map-relief .river { fill: none; stroke: color-mix(in srgb, var(--planet) 45%, transparent); stroke-width: 3; }
.map-relief .forest circle { fill: color-mix(in srgb, var(--planet) 25%, var(--bg)); stroke: color-mix(in srgb, var(--planet) 45%, transparent); }
.map-relief .region-border { fill: none; stroke: color-mix(in srgb, var(--solar) 45%, transparent); stroke-width: 2; stroke-dasharray: 3 9; }

.map-road { fill: none; stroke: var(--copper); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 2 13; }
.map-road-hidden { stroke: var(--line); }
.place circle { fill: var(--surface); stroke: var(--line); stroke-width: 3; }
.place .place-num { fill: var(--muted); font: 700 15px var(--mono); text-anchor: middle; }
.place .place-name { fill: var(--heading); font: 600 18px var(--serif); text-anchor: middle; paint-order: stroke; stroke: var(--bg); stroke-width: 5px; stroke-linejoin: round; }
.place.is-hidden .place-name { opacity: 0; }
.place.is-open circle, .place.is-next circle { stroke: var(--copper); }
.place.is-next circle { stroke: var(--planet); stroke-width: 4; }
.place.is-solved circle { fill: var(--planet); stroke: var(--planet); }
.place.is-solved .place-num { fill: var(--bg); }
.place.is-solved .place-name { fill: var(--planet); }
.map-gate path { fill: none; stroke: var(--solar); stroke-width: 4; }
.lamp-in { stop-color: var(--solar); stop-opacity: .5; }
.lamp-out { stop-color: var(--solar); stop-opacity: 0; }

.fog ellipse { fill: color-mix(in srgb, var(--parchment) 55%, var(--bg)); opacity: .92; }
.fog { transition: opacity 1.4s ease; }
.fog.is-clear { opacity: 0; }
.cloud-bank ellipse { fill: color-mix(in srgb, var(--parchment) 62%, var(--bg)); }
.map-grain { fill: none; pointer-events: none; }
.vig-in { stop-color: var(--bg); stop-opacity: 0; }
.vig-out { stop-color: var(--bg); stop-opacity: .75; }
.map-compass circle { fill: none; stroke: color-mix(in srgb, var(--copper) 55%, transparent); stroke-width: 2; }
.map-compass path { fill: color-mix(in srgb, var(--copper) 45%, transparent); }
.map-compass text { fill: var(--copper); font: 700 16px var(--serif); text-anchor: middle; }
.map-status { margin-top: .7rem; color: var(--muted); font-size: .92rem; }


.map-list { display: grid; gap: .7rem; margin: 0 0 2rem; padding: 0; list-style: none; }
.place-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; padding: .9rem 1.1rem; border: 1px solid var(--line); border-radius: .6rem; background: var(--surface); }
.place-item h2 { margin: 0; font-size: 1.1rem; color: var(--text); }
.place-item p { margin: .15rem 0 0; color: var(--muted); font-size: .88rem; }
.place-item > .place-num { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border: 2px solid var(--line); border-radius: 50%; font: 700 .95rem var(--mono); color: var(--muted); }
.place-item.is-fogged { border-style: dashed; opacity: .7; }
.place-item.is-fogged h2 { font-family: var(--serif); font-style: italic; color: var(--muted); }
.place-item.is-solved { border-color: var(--planet); }
.place-item.is-solved > .place-num { border-color: var(--planet); background: var(--planet); color: var(--bg); }
.place-item.is-next { border-color: var(--copper); }
.place-item .solved-tag { color: var(--planet); font-weight: 700; font-size: .82rem; }

.map-titles h2 { margin: 0 0 .3rem; font-size: 1.35rem; color: var(--heading); }
.map-titles > p { margin: 0 0 1rem; color: var(--muted); max-width: 62ch; }
.title-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; margin: 0; padding: 0; list-style: none; }
.title-item { display: flex; flex-direction: column; gap: .2rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: .6rem; background: var(--surface); }
.title-item.is-current { border-color: var(--solar); }
.title-item.is-clouded { border-style: dashed; opacity: .6; }
.title-item.is-clouded strong { font-style: italic; color: var(--muted); }
.title-tier { color: var(--muted); font: 600 .7rem var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.title-item strong { color: var(--heading); font-family: var(--serif); font-size: 1.15rem; }
.title-state { color: var(--muted); font-size: .82rem; }

@media (max-width: 760px) {
  .title-list { grid-template-columns: 1fr 1fr; }
  .place .place-name { font-size: 24px; }
}
@media (max-width: 600px) {
  .place-item { grid-template-columns: auto 1fr; }
  .place-item .button { grid-column: 1 / -1; justify-self: start; }
}


.map-stage { position: relative; aspect-ratio: 1280 / 704; overflow: hidden; border: 1px solid color-mix(in srgb, var(--copper) 50%, transparent); border-radius: 18px; background: var(--bg); }
.map-stage .map-art, .map-stage .map-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.map-stage .world-map { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; background: none; }
.map-stage.has-art .map-sea, .map-stage.has-art .map-sea-lines, .map-stage.has-art .map-land, .map-stage.has-art .map-lit,
.map-stage.has-art .map-relief, .map-stage.has-art .map-grain, .map-stage.has-art .map-road-hidden { display: none; }
.map-stage.has-art .fog ellipse { fill: color-mix(in srgb, var(--parchment) 35%, var(--bg)); opacity: .9; }
.map-stage.has-art .map-road { stroke: var(--solar); }


.map-stage.has-art .cloud-bank ellipse { fill: color-mix(in srgb, var(--parchment) 40%, var(--bg)); opacity: .38; }
.map-stage.has-art .cloud-bank[data-depth="26"] ellipse { opacity: .5; }
.fog { transition: opacity .6s ease; }


.hero-shadow { fill: color-mix(in srgb, var(--bg) 70%, transparent); }
.hero-cloak { fill: color-mix(in srgb, var(--bg) 55%, var(--copper)); stroke: var(--parchment); stroke-width: 1.4; }
.hero-cape { fill: color-mix(in srgb, var(--bg) 70%, var(--copper)); }
.hero-hood { fill: var(--bg); }
.hero-satchel { fill: color-mix(in srgb, var(--copper) 70%, var(--bg)); stroke: var(--parchment); stroke-width: .8; }
.hero-arm { stroke: var(--parchment); stroke-width: 2.4; stroke-linecap: round; }
.hero-lantern { fill: color-mix(in srgb, var(--bg) 40%, var(--copper)); stroke: var(--parchment); stroke-width: .9; }
.hero-flame { fill: var(--solar); }
.lamp-in { stop-color: var(--solar); stop-opacity: .65; }

.map-dragon { opacity: .9; }
.map-dragon.far { opacity: .55; }
.map-keeper { opacity: .95; }


.map-gate.is-open path { stroke: var(--planet); stroke-width: 5; }
.place-item > .place-num-gate { border-style: dashed; }
.place-num-gate svg { width: 1.15rem; height: 1.35rem; }
.place-num-gate path { fill: none; stroke: currentColor; stroke-width: 3.5; stroke-linejoin: round; }
.place-item.place-gate.is-next { border-color: var(--solar); }
.place-item.place-gate.is-solved > .place-num { border-style: solid; }
.title-item.is-earned { border-color: var(--planet); background: color-mix(in srgb, var(--planet) 8%, var(--surface)); }
.title-item.is-earned .title-state { color: var(--planet); font-weight: 650; }
.place .place-name.is-left { text-anchor: end; }


.map-legend { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; margin: .5rem 0 0; color: var(--muted); font-size: .85rem; }
.lg { display: inline-flex; align-items: center; gap: .45rem; }
.lg::before { content: ""; width: .8rem; height: .8rem; border-radius: 50%; }
.lg-lit::before { background: var(--solar); box-shadow: 0 0 8px var(--solar); }
.lg-fog::before { background: color-mix(in srgb, var(--parchment) 40%, var(--bg)); }
.lg-gate::before { border: 2px solid var(--copper); border-bottom: 0; border-radius: .5rem .5rem 0 0; background: none; }
.map-next { position: sticky; bottom: 16px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin: 1.2rem 0 2.4rem; padding: .75rem .9rem .75rem 1.1rem; border: 1px solid var(--line); border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px);
  box-shadow: 0 10px 32px color-mix(in srgb, var(--bg) 70%, transparent); }
.map-next[hidden] { display: none; }
@media (min-width: 601px) { .map-next { width: min(24rem, 100%); margin-left: auto; } }
.map-next-text { display: grid; gap: .1rem; min-width: 0; }
.map-next-label { color: var(--solar); font-size: .8rem; }
.map-next strong { color: var(--heading); font-size: 1.05rem; }
.map-next-text > span:last-child { color: var(--muted); font-size: .85rem; }
.map-next .button { flex: 0 0 auto; gap: .5rem; min-height: 44px; }
.map-next .button:active { transform: scale(.97); }
.map-next .button { transition: transform 160ms cubic-bezier(.2, .8, .2, 1), background-color 150ms ease; }
@media (max-width: 600px) {
  .place-item { grid-template-columns: auto 1fr; padding: .8rem .9rem; }
  .place-item > .button { grid-column: 1 / -1; justify-self: stretch; justify-content: center; }
  .place-item.is-fogged { padding-block: .55rem; }
  .place-item.is-fogged p { display: none; }
}
@media (prefers-reduced-motion: reduce) { .map-next .button { transition: none; } .map-next .button:active { transform: none; } }
