/* village.css — 마을형 인터랙티브 홈페이지 (풀스크린) */

/* ─── 마을 컨테이너: 뷰포트 전체 ─── */
.village-wrap {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 600px;
  overflow: hidden;
  /* T012: 줌인 전환 */
  transition: transform 0.6s ease-out;
  transform-origin: center center;
  /* T011: 낮/밤 CSS 변수 기본값 (낮) */
  --sky-top:    oklch(0.72 0.08 230);
  --sky-upper:  oklch(0.82 0.06 215);
  --sky-mid:    oklch(0.90 0.04 200);
  --sky-lower:  oklch(0.93 0.03 90);
  --sky-bottom: oklch(0.82 0.08 140);
  --ground-brightness: 1;
}

/* 하늘 그라데이션 — 화면 전체 */
.village-sky {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg,
    var(--sky-top)    0%,
    var(--sky-upper)  20%,
    var(--sky-mid)    40%,
    var(--sky-lower)  65%,
    var(--sky-bottom) 100%
  );
  transition: background 2s ease;
}

/* ─── 시간대별 하늘 색상 ─── */

/* 아침 06~11 */
.village-wrap[data-time="morning"] {
  --sky-top:    oklch(0.75 0.06 220);
  --sky-upper:  oklch(0.85 0.05 200);
  --sky-mid:    oklch(0.92 0.04 80);
  --sky-lower:  oklch(0.95 0.04 70);
  --sky-bottom: oklch(0.85 0.07 130);
}

/* 노을 17~20 */
.village-wrap[data-time="sunset"] {
  --sky-top:    oklch(0.50 0.10 260);
  --sky-upper:  oklch(0.60 0.12 300);
  --sky-mid:    oklch(0.70 0.15 30);
  --sky-lower:  oklch(0.80 0.14 50);
  --sky-bottom: oklch(0.75 0.08 130);
}

/* 밤 20~06 */
.village-wrap[data-time="night"] {
  --sky-top:    oklch(0.15 0.04 260);
  --sky-upper:  oklch(0.18 0.05 270);
  --sky-mid:    oklch(0.22 0.04 260);
  --sky-lower:  oklch(0.28 0.03 250);
  --sky-bottom: oklch(0.35 0.05 200);
  --ground-brightness: 0.7;
}

/* ─── 별 ─── */
.village-stars {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.5s ease;
}

.village-wrap[data-time="night"] .village-stars { opacity: 1; }

.village-star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: oklch(0.95 0.02 90);
  border-radius: 50%;
  animation: star-twinkle 3s ease-in-out infinite;
}

@keyframes star-twinkle {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 1; }
}

.village-star:nth-child(1)  { left:  5%; top:  8%; animation-delay:    0s; }
.village-star:nth-child(2)  { left: 12%; top:  3%; animation-delay: -0.5s; }
.village-star:nth-child(3)  { left: 22%; top: 12%; animation-delay: -1.2s; }
.village-star:nth-child(4)  { left: 30%; top:  5%; animation-delay: -0.3s; }
.village-star:nth-child(5)  { left: 38%; top: 15%; animation-delay: -2.1s; }
.village-star:nth-child(6)  { left: 45%; top:  7%; animation-delay: -1.8s; }
.village-star:nth-child(7)  { left: 55%; top:  4%; animation-delay: -0.7s; }
.village-star:nth-child(8)  { left: 62%; top: 11%; animation-delay: -1.4s; }
.village-star:nth-child(9)  { left: 70%; top:  6%; animation-delay: -2.5s; }
.village-star:nth-child(10) { left: 78%; top: 13%; animation-delay: -0.9s; }
.village-star:nth-child(11) { left: 85%; top:  3%; animation-delay: -1.1s; }
.village-star:nth-child(12) { left: 92%; top:  9%; animation-delay: -2.0s; }
.village-star:nth-child(13) { left:  8%; top: 18%; animation-delay: -1.6s; }
.village-star:nth-child(14) { left: 18%; top: 22%; animation-delay: -0.4s; }
.village-star:nth-child(15) { left: 35%; top: 20%; animation-delay: -2.3s; }
.village-star:nth-child(16) { left: 48%; top: 18%; animation-delay: -1.0s; }
.village-star:nth-child(17) { left: 58%; top: 22%; animation-delay: -0.2s; }
.village-star:nth-child(18) { left: 68%; top: 19%; animation-delay: -1.7s; }
.village-star:nth-child(19) { left: 82%; top: 20%; animation-delay: -2.8s; }
.village-star:nth-child(20) { left: 95%; top: 16%; animation-delay: -0.6s; }

/* ─── 달 ─── */
.village-moon {
  position: absolute;
  top: 6%;
  right: 10%;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: oklch(0.92 0.04 90);
  box-shadow: 0 0 20px 8px oklch(0.92 0.04 90 / 0.3);
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.5s ease;
}

.village-wrap[data-time="night"] .village-moon { opacity: 1; }

/* ─── 밤 모드 — 전체 어두워짐 ─── */
.village-wrap[data-time="night"] .village-ground {
  filter: brightness(0.65) saturate(0.8);
}

.village-wrap[data-time="night"] .village-trees {
  filter: brightness(0.5);
}

.village-wrap[data-time="night"] .village-npc img {
  filter: brightness(0.7) saturate(0.85);
}

.village-wrap[data-time="night"] .village-building img {
  filter: brightness(0.55) saturate(0.8);
}

/* 건물 창문 불빛 (밤) */
.village-wrap[data-time="night"] .village-building::before {
  content: '';
  position: absolute;
  top: 30%;
  left: 30%;
  width: 15%;
  height: 10%;
  background: oklch(0.85 0.12 80 / 0.7);
  border-radius: 1px;
  box-shadow: 0 0 8px 3px oklch(0.80 0.10 80 / 0.4);
  pointer-events: none;
  z-index: 1;
}

.village-building-glow {
  position: absolute;
  width: 8px;
  height: 6px;
  background: oklch(0.85 0.12 80);
  border-radius: 1px;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 0 6px 2px oklch(0.85 0.12 80 / 0.5);
  transition: opacity 1.5s ease;
}

.village-wrap[data-time="night"] .village-building-glow { opacity: 0.9; }

/* 산 배경 (뒤쪽) */
.village-mountains {
  position: absolute;
  bottom: 42%;
  left: 0;
  right: 0;
  height: 18%;
  z-index: 1;
  pointer-events: none;
}

.village-mountain {
  position: absolute;
  bottom: 0;
  border-radius: 50% 50% 0 0;
}

.village-mountain:nth-child(1) {
  left: -5%;  width: 35%; height: 100%;
  background: oklch(0.68 0.07 145 / 0.5);
}
.village-mountain:nth-child(2) {
  left: 20%; width: 40%; height: 85%;
  background: oklch(0.65 0.08 140 / 0.55);
}
.village-mountain:nth-child(3) {
  right: -5%; width: 38%; height: 95%;
  background: oklch(0.62 0.07 142 / 0.5);
}

/* 구름 */
.village-clouds {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.village-cloud {
  position: absolute;
  background: oklch(0.98 0.005 90 / 0.7);
  border-radius: 50px;
  animation: cloud-drift linear infinite;
  box-shadow:
     20px  -5px 0 8px oklch(0.98 0.005 90 / 0.5),
    -15px  -3px 0 5px oklch(0.98 0.005 90 / 0.4),
     40px   0px 0 4px oklch(0.98 0.005 90 / 0.3);
}

.village-cloud:nth-child(1) {
  width: 160px; height: 36px; top: 10px; left: -160px;
  animation-duration: 60s;
}
.village-cloud:nth-child(2) {
  width: 100px; height: 26px; top: 50px; left: -100px;
  animation-duration: 75s; animation-delay: -25s;
}
.village-cloud:nth-child(3) {
  width: 130px; height: 30px; top: 80px; left: -130px;
  animation-duration: 65s; animation-delay: -40s;
}

@keyframes cloud-drift {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(100vw + 250px)); }
}

/* 땅 / 잔디 — 화면 하반부 전체 */
.village-ground {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 52%;
  z-index: 3;
  background: linear-gradient(180deg,
    oklch(0.72 0.11 138)  0%,
    oklch(0.69 0.10 137) 15%,
    oklch(0.67 0.10 136) 30%,
    oklch(0.64 0.09 135) 50%,
    oklch(0.60 0.09 133) 70%,
    oklch(0.55 0.08 130) 100%
  );
}

/* 나무 장식 (CSS 전용) */
.village-trees {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 52%;
  z-index: 4;
  pointer-events: none;
}

.village-tree {
  position: absolute;
  bottom: 0;
  width: 30px;
}

.village-tree::before {
  content: '';
  display: block;
  width: 100%;
  aspect-ratio: 1;
  background: oklch(0.52 0.12 140);
  border-radius: 50%;
  margin-bottom: -6px;
}

.village-tree::after {
  content: '';
  display: block;
  width: 6px;
  height: 16px;
  background: oklch(0.45 0.06 60);
  border-radius: 2px;
  margin: 0 auto;
}

.village-tree:nth-child(1) { left: 3%; bottom: 55%; width: 24px; opacity: 0.6; }
.village-tree:nth-child(2) { left: 8%; bottom: 50%; width: 28px; opacity: 0.7; }
.village-tree:nth-child(3) { right: 5%; bottom: 52%; width: 26px; opacity: 0.65; }
.village-tree:nth-child(4) { right: 12%; bottom: 48%; width: 22px; opacity: 0.55; }
.village-tree:nth-child(5) { left: 92%; bottom: 42%; width: 20px; opacity: 0.5; }
.village-tree:nth-child(6) { left: 30%; bottom: 8%; width: 18px; opacity: 0.4; }

/* 길 (가로 — 화면 폭 전체) */
.village-road {
  position: absolute;
  bottom: 25%;
  left: 0;
  right: 0;
  height: 28px;
  z-index: 5;
  background: oklch(0.60 0.04 70);
  border-top: 3px solid oklch(0.52 0.04 65);
  border-bottom: 3px solid oklch(0.52 0.04 65);
}

.village-road::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: repeating-linear-gradient(90deg,
    oklch(0.80 0.03 80) 0px, oklch(0.80 0.03 80) 20px,
    transparent 20px, transparent 36px
  );
  transform: translateY(-50%);
}

/* 세로 길 (마을 중앙) */
.village-road-v {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 25%;
  z-index: 4;
  background: oklch(0.60 0.04 70);
  border-left: 2px solid oklch(0.52 0.04 65);
  border-right: 2px solid oklch(0.52 0.04 65);
}

/* ─── 마을 타이틀 — 상단 중앙 ─── */
.village-title-area {
  position: absolute;
  top: 80px;
  left: 0;
  right: 0;
  z-index: 12;
  text-align: center;
  padding: 0 20px;
}

.village-title {
  font-family: var(--font-serif);
  font-size: clamp(24px, 4vw, 42px);
  font-weight: 700;
  color: oklch(0.98 0.01 90);
  text-shadow:
    0 2px 8px oklch(0.30 0.08 230 / 0.4),
    0 0 20px oklch(0.50 0.06 230 / 0.2);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.village-subtitle {
  font-size: 14px;
  color: oklch(0.92 0.02 90);
  text-shadow: 0 1px 4px oklch(0.30 0.05 230 / 0.3);
  margin: 0;
}

.village-subtitle-hint {
  font-size: 12px;
  color: oklch(0.80 0.02 90);
  margin: 6px 0 0;
  text-shadow: 0 1px 3px oklch(0.20 0.04 230 / 0.3);
}

/* ─── 히어로 CTA 버튼 ─── */
.village-cta-group {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 14px;
}

.village-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--radius, 10px);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}

.village-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px oklch(0.2 0.04 50 / 0.3);
}

.village-cta-books {
  background: oklch(0.45 0.12 270);
  color: #fff;
}

.village-cta-tools {
  background: oklch(0.50 0.14 145);
  color: #fff;
}

/* ─── 건물 신간 배지 ─── */
.village-building-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: oklch(0.60 0.22 25);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 8px;
  z-index: 3;
  animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ─── 건물 레이어 ─── */
.village-buildings {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.village-building {
  position: absolute;
  cursor: pointer;
  pointer-events: all;
  transform-origin: bottom center;
  transition: transform 0.25s ease, filter 0.25s ease;
  user-select: none;
}

.village-building:hover {
  transform: scale(1.06) translateY(-3px);
  filter: drop-shadow(0 6px 16px oklch(0.3 0.05 50 / 0.3))
          brightness(1.05);
  z-index: 20;
}

.village-building:active {
  transform: scale(1.02) translateY(-1px);
}

.village-building.highlight {
  animation: bld-pulse 0.6s ease-in-out 2;
}

@keyframes bld-pulse {
  0%, 100% { filter: drop-shadow(0 0 0 transparent); }
  50%      { filter: drop-shadow(0 0 18px oklch(0.75 0.15 60 / 0.6)); }
}

.village-building img,
.village-building svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

/* 건물 접지 그림자 */
.village-building::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 10%;
  width: 80%;
  height: 8px;
  background: oklch(0.40 0.06 135 / 0.25);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}

/* 건물 라벨 — 항상 표시 */
.village-building-label {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  color: oklch(0.98 0.01 90);
  white-space: nowrap;
  text-shadow:
    0 1px 3px oklch(0.20 0.05 50 / 0.7),
    0 0 6px oklch(0.20 0.05 50 / 0.3);
  pointer-events: none;
  opacity: 1;
  letter-spacing: 0.02em;
}

/* ─── NPC 레이어 ─── */
.village-npcs {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.village-npc {
  position: absolute;
  cursor: pointer;
  pointer-events: all;
  transform-origin: bottom center;
  user-select: none;
  transition: filter 0.2s;
}

.village-npc.main-npc {
  width: 96px;
  height: 96px;
  z-index: 9;
}

.village-npc.extra-npc {
  width: 96px;
  height: 96px;
  z-index: 7;
}

.village-npc:hover {
  filter: drop-shadow(0 0 10px oklch(0.65 0.15 50 / 0.5));
  z-index: 15;
}

.village-npc.speaking {
  z-index: 25;
  filter: drop-shadow(0 0 14px oklch(0.65 0.15 50 / 0.6));
}

.village-npc img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

/* NPC 부동 애니메이션 */
@keyframes npc-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

/* 걷기 상태 — JS가 컨테이너 바운싱 담당, CSS 애니메이션 불필요 */

/* 립싱크 애니메이션 */
.village-npc.speaking-anim img {
  animation: npc-talk 0.3s ease-in-out infinite;
}

@keyframes npc-talk {
  0%, 100% { transform: scaleY(1); }
  50%      { transform: scaleY(1.03) translateY(-1px); }
}

/* ─── 말풍선 (NPC용) ─── */
.village-bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(8px) scale(0.95);
  background: var(--panel, #fff);
  border: 1px solid oklch(0.86 0.015 75);
  border-radius: 14px;
  padding: 12px 14px;
  min-width: 150px;
  max-width: 220px;
  width: max-content;
  box-shadow: 0 4px 20px oklch(0.2 0.02 50 / 0.12);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.village-npc.speaking .village-bubble {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* 말풍선 꼬리 */
.village-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: var(--panel, #fff);
}

.village-bubble-name {
  font-size: 11px;
  font-weight: 700;
  color: oklch(0.55 0.14 45);
  margin: 0 0 4px;
}

.village-bubble-job {
  font-size: 9px;
  font-weight: 500;
  color: oklch(0.55 0.06 140);
  margin-left: 4px;
}

.village-bubble-text {
  font-size: 12px;
  color: oklch(0.30 0.02 50);
  line-height: 1.5;
  margin: 0 0 8px;
}

.village-bubble-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.village-bubble-btn {
  font-size: 11px;
  font-weight: 600;
  color: oklch(0.55 0.14 45);
  background: oklch(0.93 0.04 60);
  border: 0;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: filter 0.12s;
}

.village-bubble-btn:hover {
  filter: brightness(0.94);
}

.village-bubble-btn-bld {
  background: oklch(0.90 0.05 140);
  color: oklch(0.30 0.08 140);
}

.village-bubble-audio {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: oklch(0.55 0.14 45);
  background: none;
  border: 1px solid oklch(0.86 0.015 75);
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
}

/* ─── 제품 소개 패널 ─── */
.village-panel-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0.12 0.01 50 / 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.village-panel-overlay.open {
  display: flex;
}

.village-panel {
  position: relative;
  background: var(--panel, #fff);
  border: 1px solid oklch(0.86 0.015 75);
  border-radius: 20px;
  max-width: 560px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px oklch(0.1 0.01 50 / 0.25);
  animation: panel-enter 0.3s ease;
}

@keyframes panel-enter {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.village-panel-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  background: oklch(0.95 0.01 80);
  border: 1px solid oklch(0.86 0.015 75);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: oklch(0.45 0.02 50);
  font-size: 16px;
  transition: background 0.12s;
}

.village-panel-close:hover {
  background: oklch(0.90 0.015 75);
  color: oklch(0.20 0.02 50);
}

.village-panel-body {
  padding: 24px;
}

.village-panel-npc {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid oklch(0.90 0.01 80);
}

.village-panel-npc img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
  animation: npc-float 3s ease-in-out infinite;
}

.village-panel-npc-info {
  flex: 1;
}

.village-panel-npc-name {
  font-size: 14px;
  font-weight: 700;
  color: oklch(0.55 0.14 45);
  margin: 0 0 2px;
}

.village-panel-npc-role {
  font-size: 12px;
  color: oklch(0.50 0.02 50);
}

.village-panel-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  margin-bottom: 16px;
  background: oklch(0.95 0.01 80);
}

.village-panel-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  background: oklch(0.93 0.04 60);
  color: oklch(0.35 0.10 45);
  margin-bottom: 8px;
}

.village-panel-title {
  font-family: var(--font-serif, Georgia, serif);
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 10px;
  color: oklch(0.20 0.02 50);
}

.village-panel-desc {
  font-size: 14px;
  color: oklch(0.35 0.02 50);
  line-height: 1.65;
  margin: 0 0 20px;
}

.village-panel-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.village-panel-audio {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid oklch(0.90 0.01 80);
}

.village-panel-audio button {
  background: var(--panel, #fff);
  border: 1px solid oklch(0.86 0.015 75);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: oklch(0.55 0.14 45);
  flex-shrink: 0;
  transition: background 0.12s;
}

.village-panel-audio button:hover {
  background: oklch(0.93 0.04 60);
}

.village-panel-audio span {
  font-size: 12px;
  color: oklch(0.55 0.02 50);
}

/* ─── 마을 표지판 (도로 교차점 오브젝트) ─── */
.village-signpost {
  position: absolute;
  bottom: 18%;
  left: 16%;
  transform: rotate(-1.5deg);
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

/* 표지판 지붕 */
.village-signpost-roof {
  width: calc(100% + 16px);
  height: 10px;
  background: linear-gradient(180deg, oklch(0.40 0.06 45), oklch(0.35 0.05 40));
  border-radius: 4px 4px 0 0;
  box-shadow: 0 -1px 3px oklch(0.2 0.02 50 / 0.2);
}

.village-signpost-board {
  background:
    repeating-linear-gradient(90deg,
      oklch(0.52 0.06 58) 0px, oklch(0.52 0.06 58) 1px,
      transparent 1px, transparent 18px),
    linear-gradient(180deg, oklch(0.55 0.06 60), oklch(0.45 0.05 55));
  border: 3px solid oklch(0.38 0.05 50);
  border-top: none;
  border-radius: 0 0 6px 6px;
  padding: 10px 14px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  box-shadow: 0 4px 12px oklch(0.2 0.02 50 / 0.3),
              inset 0 1px 0 oklch(0.62 0.05 60 / 0.3);
  pointer-events: all;
  max-width: 360px;
}

.village-signpost-item {
  text-align: center;
  min-width: 48px;
}

.village-signpost-value {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: oklch(0.95 0.02 80);
  text-shadow: 0 1px 2px oklch(0.2 0.04 50 / 0.5);
}

.village-signpost-label {
  display: block;
  font-size: 8px;
  color: oklch(0.78 0.03 75);
  letter-spacing: 0.03em;
}

.village-signpost-pole {
  width: 10px;
  height: 50px;
  background:
    linear-gradient(90deg,
      oklch(0.38 0.05 50), oklch(0.48 0.05 55) 40%,
      oklch(0.50 0.05 58) 50%,
      oklch(0.48 0.05 55) 60%, oklch(0.38 0.05 50));
  border-radius: 0 0 3px 3px;
  margin-top: -2px;
}

/* 기둥 그림자 (땅 위) */
.village-signpost-pole::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 6px;
  background: oklch(0.35 0.06 130 / 0.3);
  border-radius: 50%;
}

/* ─── 건물 줌인 씬 전환 ─── */
.village-wrap.zooming {
  pointer-events: none;
}

/* 실내 씬 오버레이 */
.village-scene-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: oklch(0.97 0.01 85);
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  overflow-y: auto;
}

.village-scene-overlay.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

/* 마을로 돌아가기 버튼 */
.village-scene-back {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 110;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: oklch(0.97 0.02 90);
  border: 1px solid oklch(0.82 0.04 100);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: oklch(0.35 0.06 140);
  box-shadow: 0 2px 8px oklch(0.2 0.02 50 / 0.15);
  transition: background 0.15s;
}

.village-scene-back:hover {
  background: oklch(0.93 0.03 100);
}

.village-scene-overlay.active ~ .village-scene-back,
.village-scene-back.visible { display: flex; }

/* 실내 콘텐츠 컨테이너 */
.village-scene-content {
  max-width: 800px;
  margin: 60px auto 40px;
  padding: 0 20px;
}

.village-scene-title {
  font-family: var(--font-serif, Georgia, serif);
  font-size: clamp(20px, 3vw, 32px);
  font-weight: 700;
  color: oklch(0.20 0.02 50);
  margin: 0 0 20px;
}

/* ─── 반응형 ─── */
@media (max-width: 768px) {
  .village-wrap {
    height: 100svh;
    min-height: 500px;
  }

  .village-title-area { top: 60px; }
  .village-title { font-size: clamp(20px, 5.5vw, 28px); }
  .village-subtitle { font-size: 12px; }

  .village-building {
    transform: translateX(-50%) scale(0.65);
  }

  .village-building:hover {
    transform: translateX(-50%) scale(0.72) translateY(-2px);
  }

  .village-building-label {
    font-size: 9px;
  }

  .village-npc.main-npc {
    width: 64px;
    height: 64px;
  }

  .village-npc.extra-npc {
    width: 64px;
    height: 64px;
  }

  .village-bubble {
    min-width: 120px;
    max-width: 160px;
    padding: 8px 10px;
  }

  .village-signpost {
    bottom: 6%;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
  }

  .village-signpost-board {
    padding: 6px 10px;
    gap: 8px;
    max-width: 280px;
  }

  .village-signpost-value { font-size: 11px; }
  .village-signpost-label { font-size: 7px; }
  .village-signpost-pole  { height: 28px; }
  .village-signpost-roof  { height: 7px; }

  .village-road { height: 20px; }

  .village-clouds { display: none; }
  .village-mountains { display: none; }
  .village-trees { display: none; }

  .village-npc.extra-npc { width: 56px; height: 56px; }
}

/* ─── 음소거 토글 버튼 (T016) ─── */
.village-mute-toggle {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 15;
  background: oklch(0.15 0.02 50 / 0.5);
  backdrop-filter: blur(6px);
  border: 1px solid oklch(0.5 0.02 50 / 0.3);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: oklch(0.90 0.02 90);
  transition: background 0.15s;
}
.village-mute-toggle:hover {
  background: oklch(0.25 0.02 50 / 0.6);
}

/* ─── 투어 건너뛰기 버튼 (T017) ─── */
.village-tour-skip {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: oklch(0.15 0.02 50 / 0.6);
  backdrop-filter: blur(6px);
  border: 1px solid oklch(0.5 0.02 50 / 0.3);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  color: oklch(0.90 0.02 90);
}

/* ─── 광장 피드 말풍선 (T018) ─── */
.plaza-feed-bubble {
  position: absolute;
  bottom: calc(100% + 24px);
  left: 50%;
  transform: translateX(-50%);
  background: oklch(0.97 0.02 90);
  border: 1px solid oklch(0.82 0.04 100);
  border-radius: 10px;
  padding: 8px 12px;
  min-width: 120px;
  max-width: 200px;
  box-shadow: 0 4px 12px oklch(0.2 0.02 50 / 0.15);
  z-index: 20;
  animation: feed-in 0.3s ease;
  pointer-events: none;
}
.plaza-feed-bubble.fading {
  opacity: 0;
  transition: opacity 0.5s ease;
}
@keyframes feed-in {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.plaza-feed-title {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: oklch(0.25 0.02 50);
  line-height: 1.4;
}
.plaza-feed-author {
  display: block;
  font-size: 9px;
  color: oklch(0.55 0.02 50);
  margin-top: 2px;
}

/* ─── 씬 오버레이 콘텐츠 ─── */
.village-scene-header {
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid oklch(0.85 0.04 100);
}

.village-scene-header h2 {
  font-family: var(--font-serif, Georgia, serif);
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  color: oklch(0.25 0.03 50);
  margin: 0 0 4px;
}

.village-scene-header p {
  font-size: 13px;
  color: oklch(0.50 0.02 50);
  margin: 0;
}

/* 씬 대표 캐릭터 */
.village-scene-npc {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: oklch(0.95 0.03 100);
  border-radius: 10px;
  margin-bottom: 20px;
}

.village-scene-npc img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.village-scene-npc span {
  font-size: 13px;
  font-weight: 600;
  color: oklch(0.35 0.04 50);
}

.village-scene-products {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.village-scene-product-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: oklch(0.96 0.02 90);
  border: 1px solid oklch(0.88 0.03 100);
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.village-scene-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px oklch(0.3 0.04 50 / 0.12);
}

.village-scene-product-icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.village-scene-product-icon img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.village-scene-product-info { flex: 1; }

.village-scene-product-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  background: oklch(0.90 0.05 140);
  color: oklch(0.30 0.08 140);
  margin-bottom: 4px;
}

.village-scene-product-title {
  font-size: 15px;
  font-weight: 600;
  color: oklch(0.20 0.02 50);
  margin: 0 0 4px;
}

.village-scene-product-desc {
  font-size: 13px;
  color: oklch(0.45 0.02 50);
  line-height: 1.5;
  margin: 0 0 8px;
}

.village-scene-product-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.village-scene-forum {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.village-scene-forum-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: oklch(0.96 0.02 90);
  border: 1px solid oklch(0.88 0.03 100);
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.12s;
}

.village-scene-forum-row:hover {
  background: oklch(0.93 0.03 110);
}

.village-scene-forum-title {
  font-size: 14px;
  font-weight: 500;
  color: oklch(0.20 0.02 50);
}

.village-scene-forum-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: oklch(0.50 0.02 50);
}

.village-scene-forum-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: oklch(0.88 0.04 140);
  color: oklch(0.35 0.06 140);
}

.village-scene-more {
  display: block;
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: oklch(0.45 0.10 140);
  text-decoration: none;
}

.village-scene-more:hover { text-decoration: underline; }

/* ─── 헤더 — 마을 세계관 통합 ─── */
.topbar {
  background: oklch(0.15 0.03 230 / 0.6) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid oklch(0.4 0.03 230 / 0.3) !important;
  transition: background 1s ease;
}

body:has(.village-wrap[data-time="day"]) .topbar,
body:has(.village-wrap[data-time="morning"]) .topbar {
  background: oklch(0.20 0.03 220 / 0.4) !important;
}

.topbar .nav-link,
.topbar .brand-name {
  color: oklch(0.90 0.02 90) !important;
  text-shadow: 0 1px 2px oklch(0.1 0.02 50 / 0.3);
}

.topbar .brand-mark {
  color: oklch(0.95 0.03 80) !important;
}

/* ─── 타이틀 텍스트 가독성 ─── */
.village-title {
  text-shadow:
    0 2px 12px oklch(0.15 0.05 230 / 0.6),
    0 0 30px oklch(0.20 0.04 230 / 0.3);
}

.village-subtitle {
  text-shadow: 0 1px 6px oklch(0.15 0.05 230 / 0.5);
}

/* ─── 건물 씬: 책 카드 ─── */
.village-scene-book-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.village-scene-book-cover {
  position: relative;
  flex-shrink: 0;
  width: 100px;
  aspect-ratio: 3/4;
  background: oklch(0.95 0.01 80);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.village-scene-book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.village-scene-book-placeholder {
  font-size: 32px;
}

.village-scene-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: oklch(0.60 0.22 25);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
}

.village-scene-product-sub {
  font-size: 13px;
  color: oklch(0.50 0.02 50);
  margin-top: 2px;
}

.village-scene-toc {
  margin-top: 8px;
  font-size: 13px;
}

.village-scene-toc summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent, oklch(0.55 0.15 145));
}

.village-scene-toc ul {
  margin: 6px 0 0;
  padding-left: 18px;
  list-style: disc;
  color: oklch(0.45 0.02 50);
}

.village-scene-toc li {
  margin: 3px 0;
}

/* ─── 건물 씬: 툴 카드 ─── */
.village-scene-features {
  margin: 8px 0;
  padding-left: 18px;
  list-style: none;
  font-size: 13px;
  color: oklch(0.40 0.02 50);
}

.village-scene-features li {
  margin: 3px 0;
}

.village-scene-features li::before {
  content: '✓ ';
  color: var(--accent, oklch(0.55 0.15 145));
  font-weight: 700;
}

/* ─── 모바일 제품 폴백 ─── */
.mobile-products-fallback {
  display: none;
}

@media (max-width: 768px) {
  .mobile-products-fallback {
    display: block;
    padding: 32px 16px;
    background: var(--bg, #faf9f6);
  }

  .mobile-section-title {
    font-family: var(--font-serif, serif);
    font-size: 20px;
    font-weight: 700;
    color: var(--ink, #333);
    margin: 0 0 14px;
  }

  .mobile-product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 28px;
  }

  .mobile-product-card {
    display: flex;
    gap: 12px;
    background: var(--panel, #fff);
    border: 1px solid oklch(0.88 0.01 80);
    border-radius: var(--radius, 10px);
    padding: 12px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s;
  }

  .mobile-product-card:hover {
    box-shadow: var(--shadow-1, 0 2px 8px rgba(0,0,0,0.08));
  }

  .mobile-product-cover {
    position: relative;
    flex-shrink: 0;
    width: 64px;
    aspect-ratio: 3/4;
    background: oklch(0.95 0.01 80);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-product-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .mobile-product-placeholder {
    font-size: 24px;
  }

  .mobile-product-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: oklch(0.60 0.22 25);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
  }

  .mobile-product-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink, #333);
  }

  .mobile-product-sub {
    font-size: 12px;
    color: oklch(0.50 0.02 50);
    margin-top: 2px;
  }

  .mobile-product-features {
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
    font-size: 11px;
    color: oklch(0.45 0.02 50);
  }

  .mobile-product-features li::before {
    content: '✓ ';
    color: var(--accent, oklch(0.55 0.15 145));
  }

  /* 히어로 CTA 모바일 조정 */
  .village-cta-group {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
  }

  .village-cta-btn {
    font-size: 13px;
    padding: 8px 18px;
  }
}

/* ─── 모션 감소 ─── */
@media (prefers-reduced-motion: reduce) {
  .village-cloud { animation: none !important; display: none; }
  .village-npc { animation: none !important; }
  .village-building { transition: none !important; }
  .village-bubble { transition: none !important; }
  .village-panel { animation: none !important; }
  @keyframes bld-pulse { 0%, 100% { filter: none; } }
  /* T014 추가 */
  .village-stars { display: none; }
  .village-sky { transition: none !important; }
  .village-wrap { transition: none !important; }
  .village-scene-overlay { transition: none !important; }
  .village-npc.speaking-anim img { animation: none !important; }
  .village-npc.walking img { animation: none !important; }
}
