/* ============================================
   MAP — The Living Cartography
   the map reveals what you have earned
   ============================================ */

/* --- Base --- */
body {
  background: #050505;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

/* --- Container --- */
.map-container {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 32px 40px;
  position: relative;
  z-index: 2;
}

/* --- Title --- */
.map-title {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-dim);
  letter-spacing: 0.5em;
  text-align: center;
  margin-bottom: 4px;
}

.map-subtitle {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  color: var(--text-faint);
  letter-spacing: 0.3em;
  text-align: center;
  margin-bottom: 40px;
}

/* --- ASCII Map --- */
.map-ascii {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  line-height: 1.6;
  color: var(--text-faint);
  text-align: center;
  white-space: pre;
  margin: 0 auto 32px;
  overflow-x: auto;
  padding: 20px 0;
}

/* Node Colors */
.map-node-visited {
  color: var(--text-dim);
  transition: color 0.3s, text-shadow 0.3s;
  cursor: pointer;
  text-decoration: none;
}

.map-node-visited:hover {
  color: var(--text-subtle);
  text-shadow: 0 0 6px rgba(204, 204, 204, 0.2);
}

/* Category-specific visited colors */
.map-node-spine {
  color: var(--text-subtle);
}

.map-node-spine:hover {
  color: var(--white);
  text-shadow: 0 0 8px rgba(204, 204, 204, 0.3);
}

.map-node-digital {
  color: var(--green-terminal);
  text-shadow: 0 0 4px rgba(51, 170, 51, 0.15);
}

.map-node-digital:hover {
  text-shadow: 0 0 8px rgba(51, 170, 51, 0.4);
}

.map-node-archive {
  color: var(--amber-glow, #bb9a2a);
  text-shadow: 0 0 4px rgba(187, 154, 42, 0.15);
}

.map-node-archive:hover {
  text-shadow: 0 0 8px rgba(187, 154, 42, 0.4);
}

.map-node-lore {
  color: var(--burgundy-bright, #7a2a4a);
  text-shadow: 0 0 4px rgba(122, 42, 74, 0.15);
}

.map-node-lore:hover {
  text-shadow: 0 0 8px rgba(122, 42, 74, 0.4);
}

.map-node-infinite {
  color: var(--red-glow);
  text-shadow: 0 0 4px rgba(170, 34, 34, 0.2);
  animation: pulse-dim 4s ease-in-out infinite;
}

.map-node-infinite:hover {
  text-shadow: 0 0 8px rgba(170, 34, 34, 0.5);
}

.map-node-unvisited {
  color: var(--text-faint);
  cursor: default;
}

.map-node-active {
  animation: pulse-glow 3s ease-in-out infinite;
}

/* Connectors */
.map-connector {
  color: var(--text-faint);
}

.map-connector-visited {
  color: var(--muted);
}

/* --- Discovery Message --- */
.map-discovery {
  font-family: var(--font-serif);
  font-size: 0.8rem;
  font-style: italic;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 32px;
  line-height: 1.8;
  min-height: 2em;
}

/* --- Stats --- */
.map-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
  padding: 20px;
  border-top: 1px solid var(--mid-gray);
  border-bottom: 1px solid var(--mid-gray);
}

.map-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 0;
}

.map-stat-label {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  color: var(--text-faint);
  letter-spacing: 0.15em;
}

.map-stat-value {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

.map-stat-value.highlight {
  color: var(--text-subtle);
}

/* --- Legend --- */
.map-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 28px;
}

.map-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.45rem;
  color: var(--text-faint);
  letter-spacing: 0.1em;
}

.map-legend-swatch {
  width: 8px;
  height: 8px;
  display: inline-block;
}

.map-legend-visited {
  background: var(--text-dim);
}

.map-legend-unvisited {
  background: var(--text-faint);
}

.map-legend-infinite {
  background: var(--red-glow);
}

.map-legend-active {
  background: var(--green-terminal);
  animation: pulse-dim 2s ease-in-out infinite;
}

/* --- Footer --- */
.map-footer {
  text-align: center;
  padding-top: 16px;
}

.map-footer-link {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  color: var(--text-faint);
  letter-spacing: 0.2em;
  transition: color 0.4s;
  text-decoration: none;
}

.map-footer-link:hover {
  color: var(--text-dim);
}

/* --- Vignette --- */
.map-vignette {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-shadow: inset 0 0 200px 80px rgba(0, 0, 0, 0.95);
  pointer-events: none;
  z-index: 10;
}

/* --- Mobile --- */
@media (max-width: 768px) {
  .map-container {
    padding: 32px 12px 32px;
  }

  .map-ascii {
    font-size: 0.5rem;
    line-height: 1.4;
    overflow-x: scroll;
  }

  .map-stats {
    grid-template-columns: 1fr;
    padding: 16px 12px;
  }

  .map-legend {
    flex-wrap: wrap;
    gap: 12px;
  }

  .map-title {
    font-size: 0.7rem;
    letter-spacing: 0.3em;
  }
}
