:root {
  color-scheme: dark;
  --ink: #eef3e7;
  --muted: #aab9b4;
  --night: #071623;
  --night-deep: #031018;
  --panel: rgba(6, 23, 31, 0.94);
  --panel-soft: rgba(14, 38, 44, 0.78);
  --amber: #ffb23d;
  --amber-soft: #ffd68a;
  --ghost: #80e6c8;
  --line: rgba(220, 240, 225, 0.16);
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

html, body { width: 100%; min-height: 100%; }
html { scroll-behavior: smooth; background: var(--night-deep); }

body {
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--night-deep);
  color: var(--ink);
  font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
}
.panel-open { overflow: hidden; }

button, a { font: inherit; }
button { color: inherit; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.8rem 1rem;
  background: var(--amber);
  color: #101820;
  border-radius: 0.4rem;
}
.skip-link:focus { top: 1rem; }

.app-shell {
  width: 100vw;
  height: 100dvh;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 10%, rgba(35, 104, 103, 0.22), transparent 32%),
    var(--night);
}

.topbar {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 20;
  min-height: 7.4rem;
  display: grid;
  grid-template-columns: minmax(15rem, 0.9fr) minmax(18rem, 1.5fr) auto;
  align-items: center;
  gap: 2rem;
  padding: 1.2rem 2rem 1.35rem;
  background: linear-gradient(180deg, rgba(3, 16, 24, 0.97), rgba(3, 16, 24, 0.72) 72%, transparent);
  pointer-events: none;
  transition: opacity 180ms ease;
}

.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 0.9rem; color: inherit; text-decoration: none; }
.brand:hover h1, .brand:focus-visible h1 { color: var(--amber-soft); }
.brand:focus-visible { border-radius: 0.5rem; outline: 2px solid var(--ghost); outline-offset: 0.35rem; }
.community-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.8rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(128, 230, 200, 0.38);
  border-radius: 999px;
  background: rgba(7, 30, 35, 0.76);
  color: #dffff5;
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
  backdrop-filter: blur(12px);
  transition: 180ms ease;
}
.community-link:hover, .community-link:focus-visible { background: var(--ghost); color: #092123; border-color: var(--ghost); outline: none; }
.community-icon { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  border: 1px solid rgba(255, 178, 61, 0.45);
  border-radius: 50% 50% 46% 54%;
  background: radial-gradient(circle at 50% 62%, #ffe0a2 0 12%, #ff9e33 14% 35%, rgba(128, 230, 200, 0.5) 38%, rgba(5, 29, 36, 0.9) 65%);
  color: #21140b;
  box-shadow: 0 0 30px rgba(255, 167, 50, 0.32);
}

.eyebrow, .story-label {
  margin: 0 0 0.28rem;
  color: var(--amber-soft);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2, h3 {
  font-family: "MaruBuri", "Nanum Myeongjo", "Batang", serif;
  text-wrap: balance;
}

h1 { margin: 0; font-size: clamp(1.45rem, 2.4vw, 2.2rem); line-height: 1.05; letter-spacing: -0.04em; }
.intro { max-width: 38rem; margin: 0; color: #d0dad4; font-size: 0.95rem; line-height: 1.55; }

.theater-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.8rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 214, 138, 0.34);
  border-radius: 999px;
  background: rgba(7, 30, 35, 0.72);
  color: #fff1c9;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  backdrop-filter: blur(12px);
  transition: 180ms ease;
}
.theater-button:hover, .theater-button:focus-visible {
  background: var(--amber);
  color: #1c1b14;
  border-color: var(--amber);
  outline: none;
}

.map-stage { position: absolute; inset: 0; overflow: hidden; }
.map-viewport {
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  outline: none;
}
.map-viewport:focus-visible { box-shadow: inset 0 0 0 3px var(--ghost); }
.map-viewport.is-dragging { cursor: grabbing; }

.map-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 70rem;
  transform-origin: center center;
  will-change: transform;
  transition: transform 180ms ease-out;
}
.is-dragging .map-canvas { transition: none; }
.map-image { width: 100%; height: 100%; object-fit: cover; user-select: none; }
.map-dusk {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(2, 12, 23, 0.44) 0%, transparent 32%, rgba(2, 12, 20, 0.08) 64%, rgba(2, 12, 20, 0.4) 100%),
    radial-gradient(ellipse at center, transparent 45%, rgba(1, 10, 17, 0.34) 100%);
}

.map-toolbar {
  position: absolute;
  z-index: 18;
  left: 2rem;
  bottom: 2rem;
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: rgba(4, 21, 29, 0.84);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  transition: background 180ms ease, border-color 180ms ease;
}
.tool-button {
  min-width: 2.9rem;
  height: 2.9rem;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  font-size: 1.3rem;
}
.tool-button:last-child { border-right: 0; }
.tool-button:hover, .tool-button:focus-visible { background: rgba(255, 178, 61, 0.18); outline: none; }
.tool-reset { width: auto; padding: 0 0.9rem; font-size: 0.82rem; font-weight: 700; }
.tool-scenery { width: auto; padding: 0 0.9rem; color: var(--amber-soft); font-size: 0.82rem; font-weight: 800; }

.map-hint, .map-count {
  position: absolute;
  z-index: 12;
  bottom: 2.1rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(4, 21, 29, 0.75);
  color: #dce9df;
  font-size: 0.82rem;
  backdrop-filter: blur(10px);
}
.map-hint { color: #dce9df; text-decoration: none; transition: color 180ms ease, border-color 180ms ease, opacity 180ms ease; }
.map-hint span { color: var(--ghost); margin-right: 0.3rem; }
.map-hint:hover, .map-hint:focus-visible { color: var(--amber-soft); border-color: rgba(255,214,138,.55); outline: none; }
.map-count { left: auto; right: 2rem; transform: none; color: var(--muted); }
.map-pins, .village-guide, .map-hint, .map-count { transition: opacity 180ms ease; }

.scenery-mode .topbar,
.scenery-mode .map-pins,
.scenery-mode .village-guide,
.scenery-mode .map-hint,
.scenery-mode .map-count { opacity: 0; pointer-events: none; }
.scenery-mode .map-toolbar { border-color: rgba(255,255,255,.1); background: rgba(4,21,29,.48); }
.scenery-mode .map-toolbar .tool-button:not(.tool-scenery) { display: none; }
.scenery-mode .tool-scenery { color: #fff1c9; }

.theater-intro {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: clamp(5rem, 11vw, 9rem) 1.25rem;
  background:
    radial-gradient(circle at 50% 18%, rgba(128,230,200,.15), transparent 28rem),
    radial-gradient(circle at 18% 78%, rgba(255,178,61,.12), transparent 24rem),
    linear-gradient(180deg, #031018, #082128 56%, #031018);
}
.theater-intro::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.035), transparent);
  mask-image: linear-gradient(180deg, transparent, #000 20%, #000 80%, transparent);
}
.theater-intro-content { position: relative; width: min(46rem, 100%); text-align: center; }
.theater-flame {
  display: grid;
  place-items: center;
  width: 5rem;
  height: 5rem;
  margin: 0 auto 1.5rem;
  border: 1px solid rgba(128,230,200,.45);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,214,138,.95) 0 8%, rgba(255,178,61,.72) 10% 24%, rgba(128,230,200,.28) 27%, transparent 68%);
  color: #fff0bd;
  font-size: 1.65rem;
  box-shadow: 0 0 48px rgba(128,230,200,.24), 0 0 76px rgba(255,178,61,.14);
}
.theater-intro h2 { margin: 0; color: #fff8e6; font-size: clamp(2.7rem, 8vw, 5.8rem); letter-spacing: -.05em; }
.theater-lead { max-width: 42rem; margin: 1.5rem auto 0; color: #c8d7d1; font-size: clamp(1rem, 2vw, 1.15rem); line-height: 1.9; }
.theater-links { display: flex; justify-content: center; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.theater-links a, .back-to-map {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 3rem;
  padding: .8rem 1rem;
  border: 1px solid rgba(255,214,138,.3);
  border-radius: 999px;
  color: #fff4d1;
  font-size: .9rem;
  font-weight: 800;
  text-decoration: none;
}
.theater-primary { background: rgba(255,178,61,.15); }
.theater-secondary { background: rgba(128,230,200,.09); }
.theater-links a:hover, .theater-links a:focus-visible { border-color: var(--amber-soft); background: var(--amber); color: #172020; outline: none; }
.back-to-map { margin-top: 2.5rem; border: 0; color: var(--muted); font-size: .8rem; }
.back-to-map:hover, .back-to-map:focus-visible { color: var(--ghost); outline: none; }

.map-pin {
  --pin-size: 2.9rem;
  position: absolute;
  z-index: 4;
  width: var(--pin-size);
  height: var(--pin-size);
  padding: 0;
  border: 0;
  background: transparent;
  transform: scale(var(--map-inverse-scale, 1)) translate(-50%, -50%);
  transform-origin: top left;
  cursor: pointer;
  animation: pin-arrive 600ms cubic-bezier(.2,.8,.2,1) both;
  animation-delay: var(--delay);
}
.village-guide {
  position: absolute;
  z-index: 5;
  left: 39%;
  top: 73%;
  display: flex;
  align-items: center;
  gap: .55rem;
  color: #172020;
  text-decoration: none;
  transform: scale(var(--map-inverse-scale, 1)) translate(-50%, -50%);
  transform-origin: top left;
  filter: drop-shadow(0 7px 10px rgba(0,0,0,.38));
}
.guide-portrait {
  flex: none;
  width: 3.65rem;
  height: 3.65rem;
  overflow: hidden;
  border: 2px solid #f3e3b4;
  border-radius: 50%;
  background: #dce4d4;
  box-shadow: 0 0 0 3px rgba(7,42,45,.76), 0 0 24px rgba(128,230,200,.5);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.guide-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.guide-label {
  display: grid;
  min-width: 7.6rem;
  padding: .55rem .75rem;
  border: 1px solid rgba(243,227,180,.92);
  border-radius: .8rem;
  background: rgba(231,225,193,.94);
  box-shadow: inset 0 0 0 1px rgba(54,87,76,.2);
}
.guide-label strong { font-family: "Batang", serif; font-size: 1rem; line-height: 1.2; }
.guide-label small { margin-top: .18rem; color: #385c55; font-size: .68rem; font-weight: 800; }
.village-guide:hover .guide-portrait,
.village-guide:focus-visible .guide-portrait { transform: translateY(-2px) scale(1.06); box-shadow: 0 0 0 3px #214f4a, 0 0 30px rgba(128,230,200,.78); }
.village-guide:hover .guide-label,
.village-guide:focus-visible .guide-label { background: #f3e3b4; }
.village-guide:focus-visible { outline: 3px solid #fff4c9; outline-offset: 5px; border-radius: 1rem; }
.pin-core {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255, 238, 183, 0.82);
  border-radius: 54% 46% 58% 42%;
  background: radial-gradient(circle at 50% 44%, #fff1b7 0 14%, #ffb23d 17% 43%, #c65a25 72%);
  color: #17140e;
  font-family: "Batang", serif;
  font-size: 1.05rem;
  font-weight: 900;
  box-shadow: 0 0 10px #ffb23d, 0 0 28px rgba(91, 240, 211, 0.5), 0 8px 18px rgba(0,0,0,.45);
  transition: transform 180ms ease;
}
.pin-pulse {
  position: absolute;
  inset: -0.7rem;
  border: 1px solid rgba(128, 230, 200, 0.45);
  border-radius: 50%;
  animation: ghost-pulse 2.8s ease-out infinite;
}
.pin-count {
  position: absolute;
  z-index: 4;
  top: -0.55rem;
  right: -0.55rem;
  display: grid;
  place-items: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.25rem;
  border: 1px solid #fff0bf;
  border-radius: 999px;
  background: #092d32;
  color: #fff2c8;
  font-size: 0.7rem;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(0,0,0,.45);
}
.pin-label {
  position: absolute;
  top: 50%;
  left: calc(100% + 0.7rem);
  width: max-content;
  max-width: 13rem;
  transform: translateY(-50%);
  padding: 0.5rem 0.7rem;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 0.45rem;
  background: rgba(2, 17, 24, 0.84);
  color: white;
  text-align: left;
  box-shadow: 0 8px 24px rgba(0,0,0,.32);
  backdrop-filter: blur(8px);
  pointer-events: none;
}
.map-pin--left .pin-label { left: auto; right: calc(100% + 0.7rem); text-align: right; }
.pin-label strong { display: block; font-family: "MaruBuri", "Batang", serif; font-size: 0.9rem; line-height: 1.2; }
.pin-label small { display: block; margin-top: 0.18rem; color: #b8c9c2; font-size: 0.68rem; line-height: 1.25; }
.map-pin:hover .pin-core, .map-pin:focus-visible .pin-core, .map-pin.is-active .pin-core { transform: scale(1.2) rotate(-3deg); }
.map-pin:focus-visible { outline: 2px solid var(--ghost); outline-offset: 0.5rem; border-radius: 50%; }

.place-panel {
  position: fixed;
  z-index: 40;
  top: 0;
  right: 0;
  width: min(31rem, 92vw);
  height: 100dvh;
  overflow-y: auto;
  padding: 5.3rem 1.35rem 2rem;
  background: var(--panel);
  border-left: 1px solid rgba(255,255,255,.14);
  box-shadow: -24px 0 70px rgba(0,0,0,.44);
  backdrop-filter: blur(22px);
  transform: translateX(105%);
  transition: transform 320ms cubic-bezier(.2,.8,.2,1);
}
.place-panel.is-open { transform: translateX(0); }
.panel-close {
  position: absolute;
  top: 1.35rem;
  right: 1.35rem;
  width: 2.7rem;
  height: 2.7rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  font-size: 1.5rem;
  cursor: pointer;
}
.panel-close:hover, .panel-close:focus-visible { background: rgba(255,178,61,.18); outline: 2px solid var(--amber); }
.panel-hero { padding: 0.6rem 0.4rem 1.3rem; }
.panel-symbol { display: block; margin-bottom: 1rem; color: var(--amber); font-size: 2.4rem; text-shadow: 0 0 24px rgba(255,178,61,.6); }
.panel-hero h2 { margin: 0 0 0.8rem; font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.05; letter-spacing: -0.05em; }
.panel-hero > p:last-child { margin: 0; color: #c8d4cf; font-size: 1rem; line-height: 1.72; }
.place-view-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  min-height: 3rem;
  margin: 0 0 1.25rem;
  border: 1px solid rgba(128,230,200,.4);
  border-radius: .65rem;
  background: rgba(128,230,200,.09);
  color: #dcfff4;
  font-size: .88rem;
  font-weight: 800;
  cursor: pointer;
}
.place-view-button:hover, .place-view-button:focus-visible { border-color: var(--ghost); background: rgba(128,230,200,.17); outline: 2px solid rgba(128,230,200,.45); outline-offset: 2px; }
.connection-note {
  margin: 0 0 1.25rem;
  padding: 1rem 1.05rem;
  border-left: 2px solid var(--ghost);
  background: rgba(128,230,200,.07);
}
.connection-note span { color: var(--ghost); font-size: 0.76rem; font-weight: 800; letter-spacing: .08em; }
.connection-note p { margin: 0.45rem 0 0; color: #d7e0dc; font-size: 0.92rem; line-height: 1.65; }
.theater-button { width: 100%; margin-bottom: 1.25rem; border-radius: 0.6rem; background: rgba(255,178,61,.1); }
.theater-note { display: flex; gap: 0.75rem; align-items: flex-start; padding: 1rem; border: 1px solid var(--line); border-radius: 0.7rem; color: var(--muted); line-height: 1.55; }
.theater-note span { color: var(--ghost); }
.theater-note p { margin: 0; }

.episode-browser { display: grid; gap: 0.75rem; }
.episode-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.episode-heading > span { color: var(--amber-soft); font-size: 0.86rem; font-weight: 800; }
.episode-heading small { color: var(--muted); font-size: 0.75rem; }
.episode-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.15rem 0 0.45rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,178,61,.45) transparent;
}
.episode-tabs button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  min-height: 2.55rem;
  max-width: 12rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.045);
  color: #c9d4cf;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.episode-tabs button span {
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: rgba(128,230,200,.12);
  color: var(--ghost);
  font-size: 0.7rem;
}
.episode-tabs button:hover,
.episode-tabs button:focus-visible { border-color: rgba(255,214,138,.55); outline: none; }
.episode-tabs button[aria-selected="true"] { background: var(--amber); border-color: var(--amber); color: #1d1a12; }
.episode-tabs button[aria-selected="true"] span { background: rgba(10,25,25,.16); color: #1d1a12; }
.story-viewer { min-height: 19rem; }
.story-card { overflow: hidden; border: 1px solid var(--line); border-radius: 0.85rem; background: rgba(255,255,255,.045); }
.story-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.story-copy { padding: 1rem; }
.story-copy h3 { margin: 0 0 0.5rem; color: #fff8e6; font-size: 1.35rem; }
.story-copy > p:not(.story-label) { margin: 0; color: #becbc6; font-size: 0.9rem; line-height: 1.55; }
.story-copy details { margin-top: 0.8rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.story-copy summary { padding: 0.72rem 0; color: var(--amber-soft); font-size: 0.83rem; font-weight: 700; cursor: pointer; }
.story-copy ul { margin: 0 0 0.75rem; padding-left: 1.2rem; color: #d4dfda; font-size: 0.84rem; line-height: 1.65; }
.story-actions { display: grid; grid-template-columns: 1fr; gap: 0.65rem; margin-top: 0.85rem; }
.story-copy .story-actions a { display: flex; align-items: center; justify-content: space-between; min-height: 2.75rem; margin: 0; padding: 0.65rem 0.75rem; border: 1px solid rgba(255,214,138,.26); border-radius: 0.55rem; background: rgba(255,178,61,.08); color: #fff; font-size: 0.84rem; font-weight: 800; text-decoration: none; }
.story-copy a span { color: var(--amber); }
.story-copy .story-actions a:hover, .story-copy .story-actions a:focus-visible { border-color: rgba(255,214,138,.6); color: var(--amber-soft); outline: none; background: rgba(255,178,61,.14); }
.story-comments { margin-top: 1rem; padding-top: 0.95rem; border-top: 1px solid var(--line); }
.comments-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.comments-heading h4 { margin: 0; color: #fff8e6; font-size: 0.98rem; }
.comments-heading span { color: var(--muted); font-size: 0.72rem; }
.comments-status { margin: 0.8rem 0 0; color: var(--muted); font-size: 0.8rem; }
.comments-list { display: grid; gap: 0.65rem; margin: 0.8rem 0 0; padding: 0; list-style: none; }
.comments-list li { padding: 0.72rem; border: 1px solid rgba(255,255,255,.08); border-radius: 0.55rem; background: rgba(0,0,0,.16); }
.comment-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.comment-meta strong { min-width: 0; overflow: hidden; color: var(--amber-soft); font-size: 0.78rem; text-overflow: ellipsis; white-space: nowrap; }
.comment-meta span { flex: none; color: var(--muted); font-size: 0.68rem; }
.comments-list p { margin: 0.45rem 0 0; color: #d4dfda; font-size: 0.8rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.panel-empty { position: absolute; top: 50%; left: 2rem; right: 2rem; transform: translateY(-50%); text-align: center; color: var(--muted); }
.panel-empty h2 { margin: 0 0 0.7rem; color: var(--ink); font-size: 2rem; }
.panel-empty > p:last-child { max-width: 22rem; margin: auto; line-height: 1.7; }
.empty-flame { margin-bottom: 1rem; color: var(--ghost); font-size: 2.5rem; text-shadow: 0 0 28px var(--ghost); }
.panel-scrim { display: none; position: fixed; inset: 0; z-index: 30; border: 0; background: rgba(0,0,0,.35); }

.place-viewer {
  width: min(72rem, calc(100vw - 2rem));
  max-width: none;
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  padding: 1.1rem 1.1rem 1.3rem;
  border: 1px solid rgba(224,235,215,.24);
  border-radius: 1rem;
  background: #071b22;
  color: var(--ink);
  box-shadow: 0 32px 100px rgba(0,0,0,.7);
}
.place-viewer::backdrop { background: rgba(2,10,14,.88); backdrop-filter: blur(8px); }
.place-viewer[open] { animation: viewer-arrive 220ms ease-out both; }
.place-viewer-close {
  position: sticky;
  z-index: 2;
  top: 0;
  float: right;
  width: 2.7rem;
  height: 2.7rem;
  margin: 0 0 .5rem .75rem;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  background: rgba(3,16,24,.82);
  color: #fff7df;
  font-size: 1.5rem;
  cursor: pointer;
}
.place-viewer-close:hover, .place-viewer-close:focus-visible { border-color: var(--ghost); outline: 2px solid rgba(128,230,200,.5); }
.place-viewer > .eyebrow { margin: .35rem 3.5rem .25rem 0; color: var(--ghost); }
.place-viewer h2 { margin: 0 3.5rem 1rem 0; color: #fff8e6; font-family: "MaruBuri", "Batang", serif; font-size: clamp(1.7rem,4vw,3.2rem); letter-spacing: -.045em; }
.place-viewer-image { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: .65rem; background: #10252a; }
.place-viewer-description { max-width: 58rem; margin: 1rem auto 0; color: #cbd8d2; line-height: 1.75; text-align: center; }

@keyframes viewer-arrive {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: none; }
}

@keyframes ghost-pulse {
  0% { opacity: .8; transform: scale(.65); }
  70%, 100% { opacity: 0; transform: scale(1.45); }
}
@keyframes pin-arrive {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr auto; gap: 1rem; min-height: 6.6rem; padding: 1rem 1rem 1.4rem; }
  .intro { display: none; }
  .community-link { min-height: 2.6rem; padding: 0.65rem 0.8rem; font-size: 0.8rem; }
  .brand-mark { width: 2.7rem; height: 2.7rem; }
  .map-viewport { display: grid; place-items: center; }
  .map-canvas {
    width: min(100%, calc(100dvh * 1.778));
    height: auto;
    min-width: 0;
    aspect-ratio: 1672 / 940;
    margin: 0;
  }
  .map-image { object-fit: contain; }
  .map-toolbar { left: 1rem; bottom: 1rem; }
  .map-count { right: 1rem; bottom: 1.05rem; }
  .map-hint { bottom: 4.7rem; }
  .place-panel {
    top: auto;
    bottom: 0;
    width: 100%;
    height: min(78dvh, 45rem);
    padding: 4.2rem 1rem calc(1rem + env(safe-area-inset-bottom));
    border-left: 0;
    border-top: 1px solid rgba(255,255,255,.15);
    border-radius: 1.3rem 1.3rem 0 0;
    transform: translateY(105%);
  }
  .place-panel.is-open { transform: translateY(0); }
  .panel-scrim.is-visible { display: block; }
  .panel-close { top: .8rem; right: 1rem; }
  .panel-hero h2 { font-size: 2.2rem; }
}

@media (max-width: 560px) {
  .topbar { align-items: start; }
  .brand { gap: .6rem; }
  .eyebrow { font-size: .66rem; }
  h1 { font-size: 1.35rem; }
  .community-link { width: 2.6rem; padding: 0; gap: 0; border-radius: 50%; }
  .community-label { display: none; }
  .community-icon { width: 1.15rem; height: 1.15rem; }
  .pin-label {
    display: block;
    max-width: 7rem;
    padding: 0.36rem 0.48rem;
    border-color: rgba(255,255,255,.24);
    background: rgba(2,17,24,.9);
    white-space: normal;
  }
  .pin-label strong { font-size: 0.72rem; line-height: 1.25; }
  .pin-label small { display: none; }
  .map-pin { --pin-size: 3.25rem; }
  .village-guide { gap: .42rem; }
  .guide-portrait { width: 3.2rem; height: 3.2rem; }
  .guide-label { min-width: auto; padding: .48rem .6rem; }
  .guide-label strong { font-size: .82rem; white-space: nowrap; }
  .guide-label small { display: none; }
  .map-hint { width: max-content; max-width: calc(100vw - 2rem); text-align: center; white-space: normal; }
  .map-count { display: none; }
  .map-toolbar { bottom: 1rem; }
  .episode-heading small { display: none; }
  .episode-tabs button { max-width: 10.5rem; }
  .place-viewer { width: calc(100vw - 1rem); max-height: calc(100dvh - 1rem); padding: .75rem .75rem 1rem; border-radius: .8rem; }
  .place-viewer > .eyebrow { margin-top: .1rem; }
  .place-viewer h2 { margin-bottom: .7rem; font-size: 1.65rem; }
  .place-viewer-description { margin-top: .75rem; font-size: .88rem; text-align: left; }
}

@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; }
}
