:root {
  color-scheme: dark;
  --ink: #090a0a;
  --ink-soft: #111313;
  --panel: rgba(14, 15, 15, 0.9);
  --panel-solid: #111312;
  --paper: #eee6d7;
  --muted: #a8a094;
  --faint: #6f6c65;
  --amber: #e99a43;
  --amber-light: #ffc879;
  --amber-deep: #9b5523;
  --silver: #b9d9df;
  --green: #9ab990;
  --line: rgba(234, 215, 181, 0.16);
  --line-strong: rgba(234, 215, 181, 0.29);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--amber-light);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--amber-light);
  transform: translateY(-150%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--amber-light);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 28px;
  border: 1px solid transparent;
  padding: 0 20px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button--primary {
  color: #1b1208;
  background: linear-gradient(135deg, var(--amber-light), var(--amber));
  box-shadow: 0 12px 40px rgba(233, 154, 67, 0.2);
}

/* Entry */
.entry {
  position: fixed;
  z-index: 900;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  overflow: hidden;
  background: #090909;
  transition: opacity 700ms ease, visibility 700ms ease;
}

.entry::before {
  position: absolute;
  inset: -5%;
  background:
    linear-gradient(90deg, rgba(4, 5, 5, 0.88) 0%, rgba(4, 5, 5, 0.68) 38%, rgba(4, 5, 5, 0.06) 76%),
    linear-gradient(0deg, rgba(4, 5, 5, 0.66), rgba(4, 5, 5, 0.06) 55%),
    url("assets/minaya-world-map-v3.png") center / cover no-repeat;
  content: "";
  filter: brightness(1.05) saturate(0.92) contrast(1.04);
  transform: scale(1.06);
  animation: entry-map 12s ease-out both;
}

.entry::after {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 75% 40%, transparent 0 25%, rgba(0, 0, 0, 0.6) 85%);
  content: "";
}

.entry__grain {
  position: absolute;
  z-index: 1;
  inset: 0;
  opacity: 0.09;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.entry__content {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100vw - 48px));
  animation: entry-copy 900ms 200ms ease-out both;
}

.entry h1 {
  max-width: 720px;
  margin: 0;
  color: #f1e9dd;
  font-family: var(--serif);
  font-size: clamp(4.4rem, 9.5vw, 9.2rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.76;
  text-shadow: 0 8px 44px rgba(0, 0, 0, 0.6);
}

.entry h1 em {
  color: var(--amber-light);
  font-weight: 400;
}

.entry__copy {
  max-width: 390px;
  margin: 32px 0 30px;
  color: #cbc1b2;
  font-family: var(--serif);
  font-size: clamp(1rem, 1.7vw, 1.3rem);
  line-height: 1.55;
}

.entry__note {
  margin: 22px 0 0;
  color: #736f68;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.entry.is-gone {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

@keyframes entry-map {
  from { transform: scale(1.13); }
  to { transform: scale(1.03); }
}

@keyframes entry-copy {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Atlas shell */
.atlas {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #080909;
}

.topbar {
  position: absolute;
  z-index: 100;
  top: 0;
  right: 0;
  left: 0;
  display: grid;
  height: calc(78px + var(--safe-top));
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: var(--safe-top) max(24px, var(--safe-right)) 0 max(24px, var(--safe-left));
  background: linear-gradient(180deg, rgba(8, 9, 9, 0.93), rgba(8, 9, 9, 0.7));
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 11px;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
  background: transparent;
}

.brand__mark {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  border: 1px solid rgba(238, 183, 105, 0.4);
  color: var(--amber-light);
  font-family: var(--serif);
  font-size: 1.35rem;
  transform: rotate(45deg);
}

.brand__mark > span {
  display: block;
  transform: rotate(-45deg);
}

.brand > span:last-child {
  display: grid;
  gap: 1px;
}

.brand strong {
  color: #f0e7d8;
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 500;
  letter-spacing: 0.2em;
}

.brand small {
  color: var(--faint);
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topbar__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 13px var(--amber);
}

.topbar__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.tool-button,
.icon-button {
  display: inline-flex;
  height: 38px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 160ms ease, background 160ms ease;
}

.tool-button:hover,
.icon-button:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
}

.tool-button {
  gap: 8px;
  padding: 0 11px;
  color: #c8c0b5;
  font-size: 0.67rem;
}

.tool-button > span:first-child {
  color: var(--amber-light);
  font-size: 1rem;
}

.tool-button kbd {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 2px 5px;
  color: var(--faint);
  font-family: var(--sans);
  font-size: 0.55rem;
}

.icon-button {
  width: 38px;
  justify-content: center;
  color: var(--muted);
}

.spoiler-button[aria-pressed="true"] {
  border-color: rgba(185, 217, 223, 0.3);
  color: var(--silver);
  background: rgba(185, 217, 223, 0.07);
}

.spoiler-button[aria-pressed="true"] > span:first-child {
  color: var(--silver);
}

/* Layer controls */
.layerbar {
  position: absolute;
  z-index: 90;
  top: 104px;
  left: 24px;
  display: flex;
  width: 78px;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  border: 1px solid var(--line);
  padding: 10px 7px;
  background: rgba(10, 11, 11, 0.76);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.layerbar > p {
  margin: 1px 0 8px;
  color: var(--faint);
  font-size: 0.53rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
}

.layer-button {
  display: grid;
  min-height: 55px;
  place-items: center;
  gap: 4px;
  border: 1px solid transparent;
  padding: 5px 2px;
  color: #7f7b74;
  cursor: pointer;
  background: transparent;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.layer-button:hover {
  color: #c7c0b7;
  background: rgba(255, 255, 255, 0.035);
}

.layer-button.is-active {
  border-color: rgba(233, 154, 67, 0.25);
  color: var(--paper);
  background: rgba(233, 154, 67, 0.08);
}

.layer-button > span:last-child {
  font-size: 0.55rem;
  letter-spacing: 0.04em;
}

.layer-icon {
  color: var(--amber-light);
  font-size: 0.95rem;
}

.layer-icon--figures { color: #e1d9cc; }
.layer-icon--peoples { color: var(--green); }
.layer-icon--erathi { color: var(--silver); }
.layer-icon--route { color: var(--amber); }

.layerbar__rule {
  height: 1px;
  margin: 5px 7px;
  background: var(--line);
}

/* Map */
.map-viewport {
  position: absolute;
  inset: calc(78px + var(--safe-top)) 0 var(--safe-bottom);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

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

.map-transform {
  position: absolute;
  top: 0;
  left: 0;
  width: 1586px;
  height: 992px;
  overflow: hidden;
  transform-origin: 0 0;
  will-change: transform;
  background: #090a0a;
}

.world-map,
.map-overlay,
.region-labels,
.map-markers,
.route-stages {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.world-map {
  object-fit: fill;
  filter: brightness(0.92) saturate(1.02) contrast(1.03) sepia(0.04);
  transition: filter 500ms ease, opacity 180ms ease;
}

.world-map.is-switching {
  opacity: 0.18;
}

.map-viewport:hover .world-map {
  filter: brightness(0.97) saturate(1.06) contrast(1.02) sepia(0.03);
}

.map-overlay,
.region-labels,
.route-stages {
  pointer-events: none;
}

.region-glows ellipse {
  fill: url("#regionGlow");
  opacity: 0;
  transition: opacity 350ms ease;
}

.map-transform:has(.region-label:hover) .region-glows ellipse {
  opacity: 0.15;
}

.region-label {
  position: absolute;
  display: grid;
  min-width: 120px;
  gap: 3px;
  border: 0;
  padding: 8px 12px;
  color: rgba(238, 230, 215, 0.72);
  cursor: pointer;
  pointer-events: auto;
  text-align: center;
  text-shadow: 0 2px 10px #000, 0 0 25px #000;
  background: transparent;
  transform: translate(-50%, -50%) scale(var(--region-label-scale, 1));
  transition: color 180ms ease, transform 180ms ease;
}

.region-labels {
  transition: opacity 250ms ease;
}

.region-labels.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.region-label:hover,
.region-label:focus-visible {
  color: #fff3df;
  transform: translate(-50%, -50%) scale(var(--region-label-scale-active, 1.04));
}

.region-label strong {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.region-label small {
  color: rgba(197, 187, 173, 0.56);
  font-size: 0.46rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.route-layer {
  opacity: 1;
  transition: opacity 250ms ease;
}

.route-layer.is-hidden,
.route-stages.is-hidden,
.route-player.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.route {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.route--shadow {
  stroke: rgba(0, 0, 0, 0.75);
  stroke-width: 11;
}

.route--main {
  stroke: rgba(246, 205, 145, 0.52);
  stroke-dasharray: 3 14;
  stroke-width: 3.5;
  animation: route-flow 14s linear infinite;
}

.route--progress {
  stroke: #f2ac59;
  stroke-dasharray: 0 100;
  stroke-width: 4.2;
  filter: url("#routeGlow");
  transition: stroke-dasharray 600ms ease;
}

@keyframes route-flow {
  to { stroke-dashoffset: -68; }
}

.route-stage {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 215, 160, 0.85);
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  background: #28180c;
  box-shadow: 0 0 0 4px rgba(16, 11, 7, 0.75), 0 0 18px rgba(233, 154, 67, 0.32);
  transform: translate(-50%, -50%);
  transition: transform 160ms ease, background 160ms ease;
}

.route-stage:hover,
.route-stage.is-current {
  background: var(--amber-light);
  transform: translate(-50%, -50%) scale(1.35);
}

.map-markers {
  pointer-events: none;
}

.marker {
  position: absolute;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  padding: 0;
  color: #211508;
  cursor: pointer;
  pointer-events: auto;
  background: #e7a04d;
  box-shadow: 0 0 0 3px rgba(11, 9, 7, 0.8), 0 0 0 4px rgba(248, 198, 125, 0.38), 0 8px 20px rgba(0, 0, 0, 0.55);
  transform: translate(-50%, -50%) scale(var(--marker-scale, 1));
  transition: opacity 240ms ease, transform 180ms ease, filter 180ms ease;
}

.marker::after {
  position: absolute;
  inset: -7px;
  border: 1px solid currentColor;
  border-radius: inherit;
  content: "";
  opacity: 0;
  transform: scale(0.75);
  transition: opacity 180ms ease, transform 180ms ease;
}

.marker:hover,
.marker:focus-visible,
.marker.is-selected {
  z-index: 20;
  filter: brightness(1.14);
  transform: translate(-50%, -50%) scale(var(--marker-scale-active, 1.17));
}

.marker:hover::after,
.marker:focus-visible::after,
.marker.is-selected::after {
  opacity: 0.5;
  transform: scale(1);
}

.marker__glyph {
  font-family: var(--serif);
  font-size: 0.7rem;
  font-weight: 800;
}

.marker[data-primary="figuren"] {
  width: 32px;
  height: 32px;
  color: #151412;
  background: #e6ded0;
  box-shadow: 0 0 0 3px rgba(9, 9, 9, 0.82), 0 0 0 4px rgba(230, 222, 208, 0.38), 0 8px 20px rgba(0, 0, 0, 0.55);
}

.marker[data-primary="voelker"] {
  border-radius: 2px;
  color: #0f170e;
  background: #9ab990;
  transform: translate(-50%, -50%) rotate(45deg) scale(var(--marker-scale, 1));
}

.marker[data-primary="voelker"] .marker__glyph {
  transform: rotate(-45deg);
}

.marker[data-primary="voelker"]:hover,
.marker[data-primary="voelker"]:focus-visible,
.marker[data-primary="voelker"].is-selected {
  transform: translate(-50%, -50%) rotate(45deg) scale(var(--marker-scale-active, 1.17));
}

.marker[data-primary="erathi"] {
  color: #0c1518;
  background: var(--silver);
  box-shadow: 0 0 0 3px rgba(6, 10, 11, 0.86), 0 0 0 4px rgba(185, 217, 223, 0.4), 0 0 24px rgba(185, 217, 223, 0.22);
}

.marker--portal {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 205, 133, 0.78);
  box-shadow: 0 0 0 5px rgba(11, 9, 7, 0.82), 0 0 0 7px rgba(248, 198, 125, 0.24), 0 0 30px rgba(233, 154, 67, 0.34);
}

.marker--portal::before {
  position: absolute;
  inset: -13px;
  border: 1px dashed rgba(255, 208, 144, 0.38);
  border-radius: 50%;
  content: "";
  animation: portal-turn 18s linear infinite;
}

@keyframes portal-turn {
  to { transform: rotate(360deg); }
}

.marker.is-layer-hidden,
.marker.is-spoiler-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(var(--marker-scale-hidden, 0.5));
}

.map-vignette {
  position: absolute;
  z-index: 35;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 105px 12px rgba(0, 0, 0, 0.4);
  background:
    radial-gradient(circle at 46% 42%, rgba(255, 210, 139, 0.08), transparent 48%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.12), transparent 16%, transparent 84%, rgba(0, 0, 0, 0.12));
}

.map-hint {
  position: absolute;
  z-index: 40;
  top: 18px;
  left: 50%;
  margin: 0;
  padding: 7px 11px;
  color: rgba(219, 211, 200, 0.57);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  background: rgba(8, 9, 9, 0.55);
  transform: translateX(-50%);
  transition: opacity 500ms ease;
}

.map-hint.is-hidden {
  opacity: 0;
}

.map-hint__mobile {
  display: none;
}

/* Detail panel */
.detail-panel {
  position: absolute;
  z-index: 120;
  top: 98px;
  right: 24px;
  bottom: 24px;
  width: min(390px, calc(100vw - 130px));
  overflow: hidden auto;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(160deg, rgba(36, 27, 17, 0.25), transparent 35%),
    rgba(13, 14, 14, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  transform: translateX(calc(100% + 40px));
  opacity: 0;
  transition: transform 360ms cubic-bezier(.2, .8, .2, 1), opacity 260ms ease;
}

.detail-panel.is-open {
  transform: translateX(0);
  opacity: 1;
}

.detail-panel__close {
  position: sticky;
  z-index: 4;
  top: 14px;
  float: right;
  width: 34px;
  height: 34px;
  margin: 14px 14px -48px 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  background: rgba(10, 11, 11, 0.82);
}

.detail-panel__hero {
  position: relative;
  display: flex;
  min-height: 272px;
  align-items: flex-end;
  padding: 28px 66px 22px 26px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #111210;
}

.detail-panel__hero::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(9, 10, 10, 0.98) 0%, rgba(9, 10, 10, 0.74) 34%, rgba(9, 10, 10, 0.08) 76%),
    linear-gradient(90deg, rgba(9, 10, 10, 0.28), transparent 72%);
  content: "";
  pointer-events: none;
}

.detail-panel__visual {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  filter: brightness(0.94) saturate(0.92) contrast(1.03);
  transform: scale(1.015);
}

.detail-panel__hero-copy {
  position: relative;
  z-index: 2;
  width: 100%;
}

.detail-panel__hero h2 {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #f3eadb;
  font-family: var(--serif);
  font-size: clamp(2rem, 3vw, 2.8rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 0.98;
}

.detail-panel__hero .eyebrow {
  position: relative;
  z-index: 1;
  margin-bottom: 10px;
}

.scope-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 0.54rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.scope-pill--spoiler {
  border-color: rgba(185, 217, 223, 0.25);
  color: var(--silver);
}

.detail-panel__body {
  padding: 22px 26px 32px;
}

.detail-lead {
  margin: 0 0 15px;
  color: #e0d7ca;
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.48;
}

.detail-copy {
  margin: 0;
  color: #a9a299;
  font-size: 0.78rem;
  line-height: 1.75;
}

.facts {
  display: grid;
  margin: 22px 0;
  border-top: 1px solid var(--line);
}

.fact {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.fact dt,
.fact dd {
  margin: 0;
}

.fact dt {
  color: var(--faint);
  font-size: 0.56rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.fact dd {
  color: #cbc3b7;
  font-family: var(--serif);
  font-size: 0.82rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 25px;
}

.tag {
  border: 1px solid var(--line);
  padding: 5px 8px;
  color: #8e8981;
  font-size: 0.53rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.interaction-title {
  margin: 0 0 10px;
  color: var(--amber-light);
  font-size: 0.58rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.interaction-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.interaction-button {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  padding: 7px 10px;
  color: #c9c1b7;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.65rem;
  transition: border-color 160ms ease, background 160ms ease;
}

.interaction-button:hover {
  border-color: rgba(233, 154, 67, 0.5);
  background: rgba(233, 154, 67, 0.08);
}

.interaction-reply {
  position: relative;
  margin: 13px 0 0;
  border-left: 2px solid var(--amber);
  padding: 12px 13px;
  color: #d7cec1;
  font-family: var(--serif);
  font-size: 0.86rem;
  line-height: 1.55;
  background: rgba(233, 154, 67, 0.055);
  animation: reply-in 250ms ease both;
}

@keyframes reply-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Bottom controls */
.zoom-controls {
  position: absolute;
  z-index: 80;
  bottom: 25px;
  left: 24px;
  display: flex;
  height: 38px;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(10, 11, 11, 0.79);
  backdrop-filter: blur(14px);
}

.zoom-controls button {
  width: 38px;
  height: 36px;
  border: 0;
  color: var(--amber-light);
  cursor: pointer;
  background: transparent;
  font-size: 1.1rem;
}

.zoom-controls span {
  display: grid;
  width: 54px;
  height: 22px;
  place-items: center;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.56rem;
}

.route-player {
  position: absolute;
  z-index: 85;
  bottom: 24px;
  left: 50%;
  display: grid;
  width: min(650px, calc(100vw - 300px));
  min-height: 72px;
  grid-template-columns: 42px 150px 1fr auto;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line-strong);
  padding: 10px 16px;
  background: rgba(10, 11, 11, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
  transition: opacity 250ms ease;
}

.route-player__play {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(233, 154, 67, 0.45);
  border-radius: 50%;
  color: var(--amber-light);
  cursor: pointer;
  background: rgba(233, 154, 67, 0.08);
  font-size: 0.7rem;
}

.route-player__copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.route-player__copy small {
  color: var(--faint);
  font-size: 0.51rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.route-player__copy strong {
  overflow: hidden;
  color: #ddd4c8;
  font-family: var(--serif);
  font-size: 0.86rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-player input[type="range"] {
  width: 100%;
  height: 3px;
  accent-color: var(--amber);
  cursor: pointer;
}

.route-player__chapter {
  color: #908a82;
  font-size: 0.55rem;
  white-space: nowrap;
}

/* Tooltips and notifications */
.tooltip {
  position: fixed;
  z-index: 300;
  max-width: 250px;
  visibility: hidden;
  border: 1px solid var(--line-strong);
  padding: 8px 10px;
  color: #ddd6cb;
  pointer-events: none;
  background: rgba(10, 11, 11, 0.94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  font-family: var(--serif);
  font-size: 0.72rem;
  opacity: 0;
  transform: translate(12px, 12px);
  transition: opacity 120ms ease;
}

.tooltip.is-visible {
  visibility: visible;
  opacity: 1;
}

.tooltip small {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-family: var(--sans);
  font-size: 0.48rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.toast {
  position: absolute;
  z-index: 400;
  top: 92px;
  left: 50%;
  visibility: hidden;
  border: 1px solid var(--line-strong);
  padding: 10px 14px;
  color: #dcd4c8;
  background: rgba(12, 13, 13, 0.95);
  box-shadow: var(--shadow);
  font-size: 0.67rem;
  opacity: 0;
  transform: translate(-50%, -8px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.toast.is-visible {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Dialogs */
dialog {
  border: 0;
  padding: 0;
  color: var(--paper);
  background: transparent;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(7px);
}

.dialog-shell {
  width: min(650px, calc(100vw - 32px));
  max-height: min(650px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: rgba(15, 16, 16, 0.98);
  box-shadow: var(--shadow);
}

.search-dialog__top {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
}

.search-dialog__top > span {
  color: var(--amber-light);
  font-size: 1.25rem;
}

.search-dialog input {
  width: 100%;
  border: 0;
  padding: 8px 0;
  color: var(--paper);
  outline: 0;
  background: transparent;
  font-family: var(--serif);
  font-size: 1.1rem;
}

.dialog-close {
  border: 1px solid var(--line);
  padding: 5px 8px;
  color: var(--faint);
  cursor: pointer;
  background: transparent;
  font-size: 0.55rem;
}

.search-results {
  max-height: 500px;
  overflow: auto;
  padding: 7px;
}

.search-result {
  display: grid;
  width: 100%;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  padding: 10px;
  color: inherit;
  cursor: pointer;
  text-align: left;
  background: transparent;
}

.search-result:hover,
.search-result:focus-visible {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.search-result__glyph {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--amber-light);
  font-family: var(--serif);
}

.search-result__copy {
  display: grid;
  gap: 3px;
}

.search-result__copy strong {
  color: #ddd5ca;
  font-family: var(--serif);
  font-size: 0.86rem;
  font-weight: 500;
}

.search-result__copy small,
.search-result > small {
  color: var(--faint);
  font-size: 0.5rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.search-empty {
  margin: 30px;
  color: var(--faint);
  font-family: var(--serif);
  text-align: center;
}

.dialog-shell--help {
  position: relative;
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: clamp(26px, 5vw, 52px);
}

.dialog-shell--help h2 {
  max-width: 500px;
  margin: 0 0 18px;
  color: #eee4d4;
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1;
}

.dialog-shell--help > p:not(.eyebrow) {
  max-width: 590px;
  color: #aaa39a;
  font-size: 0.8rem;
  line-height: 1.75;
}

.dialog-close--corner {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  font-size: 1rem;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 28px 0;
}

.help-grid article {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 2px 10px;
  border: 1px solid var(--line);
  padding: 13px;
}

.help-grid article > span {
  grid-row: 1 / 3;
  color: var(--amber-light);
  font-size: 1.15rem;
  text-align: center;
}

.help-grid strong {
  color: #d8d0c5;
  font-family: var(--serif);
  font-size: 0.86rem;
  font-weight: 500;
}

.help-grid small {
  color: var(--faint);
  font-size: 0.58rem;
}

.help-dialog__spoiler {
  border-left: 2px solid var(--silver);
  padding-left: 14px;
}

/* Hierarchical atlas navigation */
.atlas-breadcrumb {
  position: absolute;
  z-index: 95;
  top: 94px;
  left: 120px;
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  padding: 0 12px;
  color: var(--faint);
  background: rgba(10, 11, 11, 0.8);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(14px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.atlas-breadcrumb.is-world {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
}

.atlas-breadcrumb button {
  border: 0;
  padding: 0;
  color: var(--amber-light);
  cursor: pointer;
  background: transparent;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.atlas-breadcrumb strong {
  color: #d4ccc0;
  font-family: var(--serif);
  font-size: 0.78rem;
  font-weight: 500;
}

.location-heading {
  position: absolute;
  z-index: 42;
  bottom: 25px;
  left: 215px;
  width: min(490px, calc(100vw - 560px));
  padding: 17px 20px 18px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(8, 9, 9, 0.88), rgba(8, 9, 9, 0.52) 72%, transparent);
  text-shadow: 0 2px 16px #000;
}

.location-heading > p:first-child {
  margin: 0 0 4px;
  color: var(--amber-light);
  font-size: 0.53rem;
  font-weight: 750;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.location-heading h1 {
  margin: 0;
  color: #eee5d8;
  font-family: var(--serif);
  font-size: clamp(1.65rem, 3vw, 2.7rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1;
}

.location-heading > p:last-child {
  max-width: 430px;
  margin: 8px 0 0;
  color: #aaa299;
  font-family: var(--serif);
  font-size: 0.72rem;
  line-height: 1.45;
}

/* Responsive */
@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .topbar__status {
    display: none;
  }

  .tool-button__label,
  .tool-button kbd {
    display: none;
  }

  .layerbar {
    top: auto;
    bottom: max(14px, var(--safe-bottom));
    left: 50%;
    width: auto;
    flex-direction: row;
    padding: 6px;
    transform: translateX(-50%);
  }

  .layerbar > p,
  .layerbar__rule {
    display: none;
  }

  .layer-button {
    min-width: 54px;
    min-height: 49px;
  }

  .atlas-breadcrumb {
    top: calc(82px + var(--safe-top));
    left: max(14px, var(--safe-left));
  }

  .location-heading {
    right: max(14px, var(--safe-right));
    bottom: calc(78px + var(--safe-bottom));
    left: max(14px, var(--safe-left));
    width: auto;
    padding: 12px 14px;
  }

  .location-heading > p:last-child {
    display: none;
  }

  .route-player {
    bottom: 80px;
    width: calc(100vw - 28px);
    grid-template-columns: 38px 1fr auto;
  }

  .route-player input {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .zoom-controls {
    z-index: 96;
    top: calc(82px + var(--safe-top));
    right: max(10px, var(--safe-right));
    bottom: auto;
    left: auto;
    height: auto;
    flex-direction: column;
  }

  .zoom-controls button {
    width: 42px;
    height: 42px;
  }

  .zoom-controls span {
    width: 30px;
    height: 34px;
    border-top: 1px solid var(--line);
    border-right: 0;
    border-bottom: 1px solid var(--line);
    border-left: 0;
  }

  .detail-panel {
    top: auto;
    bottom: calc(76px + var(--safe-bottom));
    left: max(10px, var(--safe-left));
    right: max(10px, var(--safe-right));
    width: auto;
    max-height: min(68vh, 620px);
    transform: translateY(calc(100% + 100px));
  }

  .detail-panel.is-open {
    transform: translateY(0);
  }

  .map-hint {
    top: 56px;
    display: block;
    width: max-content;
    max-width: calc(100vw - 118px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .map-hint__desktop {
    display: none;
  }

  .map-hint__mobile {
    display: inline;
  }
}

@media (max-width: 560px) {
  .topbar {
    height: calc(66px + var(--safe-top));
    padding: var(--safe-top) max(12px, var(--safe-right)) 0 max(12px, var(--safe-left));
  }

  .map-viewport {
    top: calc(66px + var(--safe-top));
  }

  .brand__mark {
    width: 31px;
    height: 31px;
    font-size: 1rem;
  }

  .brand strong {
    font-size: 0.88rem;
  }

  .brand small {
    display: none;
  }

  .tool-button {
    padding: 0 9px;
  }

  .icon-button {
    display: none;
  }

  .entry__content {
    width: calc(100vw - 32px);
  }

  .entry h1 {
    font-size: clamp(4rem, 23vw, 6.3rem);
  }

  .entry::before {
    background:
      linear-gradient(0deg, rgba(4, 5, 5, 0.82) 0%, rgba(4, 5, 5, 0.34) 70%, rgba(4, 5, 5, 0.12)),
      url("assets/minaya-world-map-v3.png") center / cover no-repeat;
  }

  .help-grid {
    grid-template-columns: 1fr;
  }

  .route-player {
    min-height: 66px;
    padding: 8px 11px;
  }

  .route-player__chapter {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .detail-panel__hero,
  .detail-panel__body {
    padding-left: 21px;
  }

  .detail-panel__hero {
    min-height: 224px;
    padding-right: 58px;
    padding-bottom: 18px;
  }

  .detail-panel__body,
  .detail-lead,
  .detail-copy,
  .interaction-button {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .fact {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 8px;
  }

  .fact dt {
    font-size: 0.52rem;
    letter-spacing: 0.08em;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
