:root {
  --parchment: #f0ebe0;
  --ocean: #9bbdd4;
  --land-a: #c8b888;
  --land-b: #bfae7c;
  --india-a: #d4956a;
  --india-b: #c8825a;
  --blue: #2563b0;
  --teal: #0f6e56;
  --ink: #2a2a2a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  background: var(--parchment);
  color: var(--ink);
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace, system-ui;
  font-size: 13px;
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }

#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 100;
  background: rgba(240, 235, 224, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.nav-logo {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.nav-logo .wandering {
  color: var(--blue);
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink);
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--blue);
}

#map-wrap {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 52px;
}

#map-stage {
  position: relative;
  width: min(100vw, calc((100vh - 52px) * 2));
  aspect-ratio: 2 / 1;
  max-height: calc(100vh - 52px);
}

#map-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  -ms-interpolation-mode: nearest-neighbor;
}

#pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.pin {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid var(--parchment);
  transform: translate(-50%, -50%);
  cursor: pointer;
  padding: 0;
  pointer-events: auto;
  transition: transform 0.15s ease;
  z-index: 10;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.pin:hover {
  transform: translate(-50%, -50%) scale(1.5);
  z-index: 11;
}

.pin.visited {
  background: var(--teal);
}

.pin::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--blue);
  opacity: 0.6;
  animation: pulse 2s ease-out infinite;
  pointer-events: none;
}

.pin.visited::after {
  display: none;
}

@keyframes pulse {
  0%   { transform: scale(0.7); opacity: 0.8; }
  100% { transform: scale(2.0); opacity: 0; }
}

.counter {
  position: fixed;
  top: 68px;
  right: 28px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #5a5a5a;
  z-index: 20;
  font-variant-numeric: tabular-nums;
}

.readout {
  position: fixed;
  bottom: 16px;
  right: 28px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #5a5a5a;
  z-index: 20;
  font-variant-numeric: tabular-nums;
}

#story-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(240, 235, 224, 0.97);
  border-top: 1px solid rgba(37, 99, 176, 0.18);
  padding: 28px 40px 32px;
  transform: translateY(105%);
  transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
  z-index: 50;
  max-height: 48vh;
  overflow-y: auto;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.06);
}

#story-panel.open {
  transform: translateY(0);
}

.story-close {
  position: absolute;
  top: 14px;
  right: 22px;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
}

.story-close:hover { color: var(--blue); }

.story-place {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.story-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #777;
  margin-bottom: 16px;
}

.story-tag {
  padding: 3px 9px;
  border: 1px solid rgba(37, 99, 176, 0.4);
  color: var(--blue);
  border-radius: 2px;
  letter-spacing: 0.06em;
}

.story-body {
  font-size: 13px;
  line-height: 1.7;
  max-width: 640px;
  margin-bottom: 18px;
  color: #333;
}

.story-link {
  font-size: 12px;
  color: var(--blue);
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(37, 99, 176, 0.3);
  padding-bottom: 1px;
}

.story-link:hover { border-bottom-color: var(--blue); }
