/* css/village.css — 첫 화면 위쪽의 「정치아틀라스 마을」 (2026-10).
   css/style.css 의 색 토큰을 그대로 쓴다. 조간·석간(html.dusk)을 따라 낮과 밤이 바뀐다.
   마을 안은 그림(힉스필드로 뽑은 건물·나무·사람 조각) + 코드로 그린 바닥판이고,
   간판과 건물 안 목록은 글자라 검색·화면낭독기가 읽을 수 있다. */

.village {
  --v-sky: #d7e4de;
  --v-sky-deep: #b9cfc6;
  --v-sign: #fffdf6;
  --v-sign-ink: #2a2620;
  --v-sign-line: #3a352b;
  --v-shade: rgba(28, 34, 30, .18);
  position: relative; z-index: 3;
  height: clamp(460px, 70vh, 760px);
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 40%, var(--v-sky) 0%, var(--v-sky-deep) 100%);
}
html.dusk .village {
  --v-sky: #131c2b;
  --v-sky-deep: #0c1320;
  --v-sign: #fff3d4;
  --v-sign-ink: #2a2318;
  --v-sign-line: #f5d58e;
  --v-shade: rgba(0, 0, 0, .45);
}
/* 마을 아래가 무대(사진) 쪽으로 부드럽게 이어지게 */
.village::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 56px; z-index: 6;
  background: linear-gradient(180deg, rgba(0,0,0,0), var(--paper));
  pointer-events: none;
}
.village.full { position: fixed; inset: 0; height: auto; z-index: 70; }
.village.full::after { display: none; }

.v-vp {
  position: absolute; inset: 0; overflow: hidden; cursor: grab;
  touch-action: pan-y;            /* 폰: 위아래로 쓸면 페이지가 내려가고, 옆으로 끌면 마을이 움직인다 */
}
.village.full .v-vp { touch-action: none; }
.v-vp.dragging { cursor: grabbing; }
.v-world { position: absolute; left: 0; top: 0; width: 2400px; height: 1580px; transform-origin: 0 0; }
.v-ground { position: absolute; inset: 0; }
.v-dim { transition: filter .6s ease; }
html.dusk .v-dim { filter: brightness(.58) saturate(.8) hue-rotate(-8deg); }

.v-bld {
  position: absolute; padding: 0; border: 0; background: none; cursor: pointer;
  transform-origin: 50% 100%;
}
.v-bld img { display: block; width: 100%; height: auto; pointer-events: none; -webkit-user-drag: none; user-select: none; }
.v-bld:focus-visible { outline: 3px solid var(--gold-deep); outline-offset: 6px; border-radius: 12px; }
.v-bld.hop { animation: v-hop .55s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes v-hop {
  0% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-26px) scale(1.04, .97); }
  70% { transform: translateY(0) scale(.98, 1.03); }
  100% { transform: none; }
}
.v-tree, .v-walker { position: absolute; pointer-events: none; user-select: none; }
.v-tree img, .v-walker img { display: block; width: 100%; -webkit-user-drag: none; }
.v-walker.left img { transform: scaleX(-1); }

.v-glow {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 196, 110, .55), rgba(255, 196, 110, 0));
  mix-blend-mode: screen; opacity: 0; transition: opacity .6s ease;
}
html.dusk .v-glow { opacity: 1; }

.v-signs { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.v-sign {
  position: absolute; left: 0; top: 0;
  background: var(--v-sign); color: var(--v-sign-ink); border: 2px solid var(--v-sign-line);
  border-radius: 9px; padding: 4px 10px 5px; text-align: center; white-space: nowrap;
  box-shadow: 0 3px 0 var(--v-shade); font-family: var(--sans);
}
.v-sign b { display: block; font-size: 14px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
.v-sign small { display: block; font-size: 10.5px; opacity: .72; line-height: 1.2; }
.v-sign::after {
  content: ""; position: absolute; left: 50%; bottom: -7px; width: 10px; height: 10px; margin-left: -5px;
  background: var(--v-sign); border-right: 2px solid var(--v-sign-line); border-bottom: 2px solid var(--v-sign-line);
  transform: rotate(45deg);
}
.v-sign.plaza { background: var(--gold-deep); color: var(--paper); border-color: var(--gold-deep); }
.v-sign.plaza::after { background: var(--gold-deep); border-color: var(--gold-deep); }

/* 마을 안의 작은 단추들 — 오른쪽 아래 */
.v-tools {
  position: absolute; right: 14px; bottom: 22px; z-index: 7;
  display: flex; gap: 6px;
}
.v-btn {
  font: 600 13px/1 var(--sans); color: var(--ink); background: var(--paper-card);
  border: 1px solid var(--line-strong); border-radius: 10px; height: 38px; min-width: 38px; padding: 0 12px;
  cursor: pointer; box-shadow: 0 6px 18px var(--v-shade);
}
.v-btn:focus-visible { outline: 3px solid var(--gold-deep); outline-offset: 2px; }
.village.full .v-tools { bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); }

.v-hint {
  position: absolute; left: 16px; bottom: 22px; z-index: 7; max-width: calc(100% - 180px);
  background: var(--paper-card); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 9px 14px; font: 13px/1.35 var(--sans); box-shadow: 0 8px 22px var(--v-shade);
  transition: opacity .5s ease, transform .5s ease; pointer-events: none;
}
.v-hint.gone { opacity: 0; transform: translateY(10px); }

/* 마을 안내도 — 마을 바로 아래, 글자로 된 일곱 칸. 누르면 그 건물이 열린다 */
.v-index {
  position: relative; z-index: 3; background: var(--paper);
  padding-block: 18px 6px; padding-inline: 16px;
}
.v-index-in { max-width: 1180px; margin: 0 auto; }
.v-index h2 {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .18em; color: var(--gold);
  font-weight: 500; margin: 0 0 10px;
}
.v-index ul {
  list-style: none; margin: 0; padding: 0 0 6px;
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px;
}
.v-index a {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-card);
  color: var(--ink); cursor: pointer; font-family: var(--sans); text-align: center; text-decoration: none;
  transition: border-color .18s, transform .18s;
}
.v-index a:hover { border-color: var(--gold); transform: translateY(-2px); }
.v-index a:focus-visible { outline: 3px solid var(--gold-deep); outline-offset: 2px; }
.v-index img { width: 70px; height: 52px; object-fit: contain; }
.v-index b { font-size: 13.5px; font-weight: 700; }
.v-index small { font-size: 11.5px; color: var(--ink-dim); line-height: 1.35; word-break: keep-all; }
@media (max-width: 860px) {
  .v-index ul { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 108px; overflow-x: auto;
                scroll-snap-type: x mandatory; padding-bottom: 10px; }
  .v-index li { scroll-snap-align: start; }
}

/* 건물 안 — 그림 위로 올라오는 판 */
.v-sheet {
  position: fixed; z-index: 90; left: 0; right: 0; bottom: 0; max-height: 64%;
  display: flex; flex-direction: column;
  background: var(--paper-card); color: var(--ink); border-top: 1px solid var(--line-strong);
  border-radius: 20px 20px 0 0; box-shadow: 0 -12px 40px rgba(0,0,0,.22);
  transform: translateY(105%); transition: transform .38s cubic-bezier(.2, .9, .25, 1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.v-sheet.open { transform: none; }
@media (min-width: 860px) {
  .v-sheet { left: auto; right: 16px; bottom: 16px; top: 74px; width: 380px; max-height: none;
             border-radius: 16px; border: 1px solid var(--line-strong); transform: translateX(calc(100% + 24px)); }
  .v-sheet.open { transform: none; }
}
.v-sheet-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 18px 10px; }
.v-sheet-head > div { flex: 1; min-width: 0; }
.v-kicker { margin: 0; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: var(--gold); }
.v-sheet h2 { margin: 4px 0 4px; font-family: var(--serif); font-size: 24px; line-height: 1.2; letter-spacing: -.02em; }
.v-role { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink-dim); word-break: keep-all; }
.v-close {
  flex: none; font: 600 13px/1 var(--sans); color: var(--ink); background: transparent;
  border: 1px solid var(--line-strong); border-radius: 10px; height: 36px; padding: 0 12px; cursor: pointer;
}
.v-rooms { list-style: none; margin: 0; padding: 4px 10px 16px; overflow-y: auto; display: grid; gap: 2px; }
.v-rooms a {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px;
  padding: 11px 10px; border-radius: 12px; color: var(--ink); text-decoration: none;
}
.v-rooms a:hover, .v-rooms a:focus-visible { background: var(--gold-soft); outline: none; }
.v-rooms .t { font-size: 15px; font-weight: 600; line-height: 1.35; min-width: 0; }
.v-rooms .s { grid-column: 1; font-size: 12.5px; color: var(--ink-dim); line-height: 1.4; }
.v-rooms .go { grid-row: 1 / span 2; grid-column: 2; font-size: 13px; color: var(--gold-deep); font-weight: 600; }
.v-note { margin: 0 18px 16px; font-size: 12.5px; color: var(--ink-dim); line-height: 1.55; }

/* 마을이 위에 있으니 무대 글은 화면 한가운데 대신 마을 바로 아래에서 시작 */
.village ~ .stage-inner { padding-top: 34px; justify-content: flex-start; }

@media (prefers-reduced-motion: reduce) {
  .v-bld.hop { animation: none; }
  .v-sheet, .v-hint, .v-dim, .v-glow { transition: none; }
}
