/* Progression map — DOM nodes + SVG edges + tap-open popover. Rendered
   inside the Collection overlay (see collection.css for the outer panel).
   Depends on tokens from base.css (--gold, --cream, --panel-line). */

.map-viewport {
  position: relative;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  border-radius: 14px;
  background:
    radial-gradient(1200px 480px at 30% 20%, rgba(60, 30, 100, 0.28), transparent 70%),
    linear-gradient(160deg, rgba(20, 10, 44, 0.55), rgba(8, 3, 20, 0.55));
  border: 1px solid var(--panel-line);
  max-height: min(62vh, 560px);
}

.map-canvas {
  position: relative;
}

.map-edges {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.map-edge {
  stroke: rgba(255, 243, 224, 0.14);
  stroke-width: 2.2;
  stroke-dasharray: 5 6;
  stroke-linecap: round;
  transition: stroke 0.25s;
}

.map-edge.unlocked {
  stroke: var(--gold);
  stroke-width: 2.8;
  stroke-dasharray: none;
  filter: drop-shadow(0 0 4px rgba(255, 209, 102, 0.5));
}

/* --- Nodes ----------------------------------------------------------- */

.map-node {
  position: absolute;
  padding: 0;
  border-radius: 50%;
  background: rgba(28, 14, 54, 0.72);
  border: 2px solid rgba(255, 243, 224, 0.22);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.14s, background 0.2s, border-color 0.2s,
              box-shadow 0.2s;
  overflow: visible;
  pointer-events: auto;
  z-index: 2;
}

.map-node .node-emoji {
  font-size: 26px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(8, 3, 20, 0.45));
}

.map-node .node-name {
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--cream);
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(6, 2, 20, 0.7);
  opacity: 0.88;
  pointer-events: none;
  letter-spacing: 0.02em;
}

.map-node .node-hint {
  position: absolute;
  top: calc(100% + 20px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 9.5px;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
  opacity: 0.85;
  pointer-events: none;
  letter-spacing: 0.02em;
}

.map-node.hidden { display: none; }

.map-node.locked {
  opacity: 0.42;
  filter: grayscale(0.85);
  cursor: pointer;
}

.map-node.available {
  border-color: rgba(255, 243, 224, 0.7);
  background: linear-gradient(160deg,
    rgba(255, 243, 224, 0.14), rgba(255, 209, 102, 0.05));
  box-shadow: 0 0 0 2px rgba(255, 243, 224, 0.07);
}

.map-node.unlocked {
  border-color: var(--gold);
  background: linear-gradient(160deg,
    rgba(255, 209, 102, 0.42), rgba(255, 159, 67, 0.22));
  box-shadow: 0 4px 14px rgba(255, 159, 67, 0.32),
              0 0 0 2px rgba(255, 209, 102, 0.18);
}

.map-node.unlocked .node-name {
  color: var(--gold);
  opacity: 1;
}

.map-node:hover { transform: scale(1.06); }
.map-node:active { transform: scale(0.96); }
.map-node:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .map-node, .map-edge { transition: none; }
  .map-node:hover, .map-node:active { transform: none; }
}

/* --- Popover --------------------------------------------------------- */

.map-popover {
  position: absolute;
  min-width: 200px;
  max-width: 240px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(20, 8, 40, 0.96);
  border: 1px solid rgba(255, 209, 102, 0.55);
  color: var(--cream);
  z-index: 20;
  box-shadow: 0 14px 34px rgba(4, 2, 12, 0.6),
              0 0 0 1px rgba(255, 209, 102, 0.14) inset;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: auto;
}

.map-popover .pop-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 14px;
  color: var(--cream);
}

.map-popover .pop-emoji {
  font-size: 22px;
  line-height: 1;
}

.map-popover .pop-desc {
  margin-top: 5px;
  font-size: 12.5px;
  opacity: 0.85;
  line-height: 1.4;
}

.map-popover .pop-req {
  margin-top: 8px;
  font-size: 11px;
  color: var(--gold);
  opacity: 0.95;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

/* --- Section frame in the Collection overlay ------------------------- */

.collection-section.map-section {
  min-width: 0;
}

@media (max-width: 640px) {
  .map-viewport { max-height: 62vh; }
  .map-node .node-name { font-size: 10px; }
  .map-node .node-hint { font-size: 9px; }
  .map-popover { min-width: 170px; max-width: 200px; padding: 10px 12px; }
  .map-popover .pop-title { font-size: 13px; }
  .map-popover .pop-desc { font-size: 12px; }
}
