.map-page {
  padding-bottom: clamp(3.5rem, 8vw, 6rem);
}

.map-heading {
  padding-top: clamp(3.25rem, 7vw, 5.75rem);
  padding-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.map-heading h1,
.map-guide h2,
.map-detail h2 {
  margin: 0;
  font-family: var(--display, Impact, sans-serif);
  font-weight: 400;
  line-height: 1.05;
}

.map-heading h1 {
  font-size: clamp(2.5rem, 6vw, 5.5rem);
}

.map-heading p {
  max-width: 39rem;
  margin: 1rem 0 0;
  color: var(--muted, #b7b2c7);
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.65;
}

.map-explorer {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line, #30303c);
  border-radius: 1rem;
  background: var(--panel, #16161f);
}

.map-explorer.map-is-interactive {
  grid-template-columns: minmax(0, 2.15fr) minmax(0, 1fr);
}

.map-figure {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
}

.map-stage {
  position: relative;
  isolation: isolate;
  aspect-ratio: 20 / 13;
  background: #171d31;
}

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

.map-figure figcaption {
  align-content: center;
  flex-grow: 1;
  padding: .85rem 1.1rem;
  border-top: 1px solid var(--line, #30303c);
  color: var(--muted, #b7b2c7);
  font-size: .875rem;
  line-height: 1.55;
}

.map-compass {
  position: absolute;
  top: 6%;
  right: 5%;
  display: grid;
  justify-items: center;
  gap: .25rem;
  color: #e5d9fc;
  font-size: .75rem;
  font-weight: 700;
}

.map-compass i {
  width: .7rem;
  height: 1rem;
  background: #e5d9fc;
  clip-path: polygon(50% 0, 100% 100%, 50% 70%, 0 100%);
}

.map-marker {
  --marker-color: #e0bcff;
  position: absolute;
  top: var(--marker-y);
  left: var(--marker-x);
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  padding: 0;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #faf8ff;
  font: inherit;
  cursor: pointer;
}

.map-marker i {
  display: block;
  width: .8rem;
  height: .8rem;
  border: 2px solid var(--marker-color);
  border-radius: 50%;
  background: #141625;
  box-shadow: 0 0 0 .25rem #151825aa;
}

.map-marker span {
  position: absolute;
  top: 50%;
  left: calc(50% + .75rem);
  padding: .22rem .48rem;
  transform: translateY(-50%);
  border: 1px solid #aab1d14b;
  border-radius: .35rem;
  background: #121322f5;
  font-size: clamp(.75rem, 1.4vw, .95rem);
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
}

.map-marker:hover,
.map-marker[aria-pressed="true"] {
  z-index: 1;
}

.map-marker:hover i,
.map-marker[aria-pressed="true"] i {
  background: var(--marker-color);
  box-shadow: 0 0 0 .3rem #1c1639bb, 0 0 1.25rem var(--marker-color);
}

.map-marker:hover span,
.map-marker[aria-pressed="true"] span {
  border-color: var(--marker-color);
  color: var(--marker-color);
}

.map-marker:focus-visible {
  z-index: 2;
  outline: 2px solid #fff;
  outline-offset: 1px;
}

.marker-kalaga {
  --marker-x: 42%;
  --marker-y: 20%;
}

.marker-gellhorn {
  --marker-color: #f6b386;
  --marker-x: 26%;
  --marker-y: 42%;
}

.marker-ambrosia {
  --marker-color: #fce29f;
  --marker-x: 51%;
  --marker-y: 39%;
}

.marker-vice {
  --marker-color: #ff9dca;
  --marker-x: 78%;
  --marker-y: 65%;
}

.marker-grassrivers {
  --marker-color: #a6e5c5;
  --marker-x: 48%;
  --marker-y: 66%;
}

.marker-keys {
  --marker-color: #a4d5ff;
  --marker-x: 68%;
  --marker-y: 91%;
}

.map-detail {
  min-width: 0;
  padding: clamp(1.25rem, 3vw, 2.1rem);
  border-left: 1px solid var(--line, #30303c);
  background: radial-gradient(ellipse at 100% 0, #321c35 0, transparent 60%);
}

.map-explorer:not(.map-is-interactive) .map-detail {
  border-top: 1px solid var(--line, #30303c);
  border-left: 0;
}

.map-detail h2 {
  margin-top: .65rem;
  font-size: clamp(1.95rem, 3.2vw, 3rem);
}

.map-detail h3 {
  margin: 1.3rem 0 .35rem;
  color: var(--text, #faf8ff);
  font-size: .95rem;
}

.map-detail p,
.map-guide p {
  color: var(--muted, #b7b2c7);
  line-height: 1.6;
}

.map-detail p {
  margin: .5rem 0 0;
}

.map-category {
  color: var(--accent, #fa6caa);
  font-size: .875rem;
  font-weight: 700;
}

.map-detail-link {
  display: inline-block;
  margin-top: 1.2rem;
  font-weight: 700;
}

.map-page a {
  color: #ff9dca;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.map-page a:hover {
  color: #ffd5e9;
}

.map-guide {
  margin-top: clamp(3rem, 7vw, 5rem);
}

.map-guide-heading {
  margin-bottom: 1.3rem;
}

.map-guide h2 {
  font-size: clamp(1.9rem, 4vw, 3.2rem);
}

.map-guide-heading p {
  margin: .5rem 0 0;
}

.map-region-overview {
  margin: 0 0 1.25rem;
}

.map-region-overview img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: .75rem;
}

.map-region-overview figcaption {
  margin-top: .5rem;
  color: var(--muted, #b7b2c7);
  font-size: .875rem;
}

.map-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.map-region {
  padding: clamp(1.2rem, 3vw, 1.75rem);
  scroll-margin-top: 6rem;
  border: 1px solid var(--line, #30303c);
  border-radius: .75rem;
  background: var(--panel, #16161f);
}

.map-region:target {
  border-color: var(--accent, #fa6caa);
}

.map-region h3 {
  margin: .25rem 0 .6rem;
  font-size: 1.25rem;
}

.map-region p {
  margin: .85rem 0 0;
}

.map-region p strong {
  display: block;
  margin-bottom: .2rem;
  color: var(--text, #faf8ff);
  font-size: .9rem;
}

.map-sources,
.map-back,
.map-no-script {
  margin: 1.15rem 0 0;
  font-size: .875rem;
}

.map-no-script {
  color: var(--muted, #b7b2c7);
}

@media (max-width: 830px) {
  .map-explorer.map-is-interactive {
    grid-template-columns: minmax(0, 1fr);
  }

  .map-detail {
    border-top: 1px solid var(--line, #30303c);
    border-left: 0;
  }
}

@media (max-width: 650px) {
  .map-guide-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 540px) {
  .map-marker span {
    top: calc(50% + .65rem);
    left: 50%;
    padding: .18rem .33rem;
    transform: translateX(-50%);
  }

  .marker-gellhorn span {
    transform: translateX(-70%);
  }

  .marker-keys span {
    top: 50%;
    transform: translate(calc(-100% - .7rem), -50%);
  }
}
