/* 월드 맵 (/game/world/) — 게임 안 월드맵(원본 640×470 그림)·지역 쪽 맵 카드·맵 창. 움직임은 js/world.js */

/* 지역 고르기 줄(좁은 화면은 옆으로 밀기 — site.js 가 끝을 흐리게) */
.wm-rnav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.wm-rnav a { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 17px; background: var(--panel);
  color: var(--fg-2); font-size: 14px; white-space: nowrap; box-shadow: inset 0 0 0 1px var(--line); transition: background-color .15s ease, color .15s ease; }
.wm-rnav a span { font-size: 12px; color: var(--fg-3); }
.wm-rnav a:hover { background: var(--hover); color: var(--fg); }
.wm-rnav a[aria-current] { background: var(--brand); color: var(--brand-ink); font-weight: 600; box-shadow: none; }
.wm-rnav a[aria-current] span { color: inherit; opacity: .7; }

/* 위: 월드맵 + 소개·동네 목록 */
/* 넓으면 지도(원본 1배 640) 옆에 목록, 자리가 모자라면 아래로 */
.wm-top { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.wm-top.is-noart { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 12px; }  /* 여러 줄(wrap)이거나 늘이지 않으면 폰에서 한 줄 목록이 글 폭만큼 넓어져 쪽이 옆으로 밀린다 */
.wm-frame { position: relative; flex: 0 1 640px; max-width: 640px; border-radius: 8px; overflow: hidden; background: #05090e; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04); }
.wm-art { position: relative; width: 100%; touch-action: manipulation; }
.wm-art[hidden] { display: none; }
.wm-base { width: 100%; height: auto; }
.wm-link { position: absolute; height: auto; max-width: none; opacity: 0; pointer-events: none; transition: opacity .12s ease; }
.wm-link.is-on { opacity: 1; }
.wm-art.is-link { cursor: pointer; }
.wm-spot { position: absolute; z-index: 1; display: block; }
.wm-spot::before { content: ""; position: absolute; inset: -6px; }  /* 작은 점도 누르기 쉽게 */
.wm-spot img { width: 100%; height: auto; }
.wm-spot:hover img, .wm-spot:focus-visible img, .wm-spot.is-on img { filter: brightness(1.4) drop-shadow(0 0 3px rgba(255, 220, 140, .9)); }
.wm-tip { position: absolute; z-index: 3; pointer-events: none; width: max-content; max-width: 240px; padding: 6px 10px; border-radius: 6px;
  background: rgba(6, 12, 20, .94); box-shadow: 0 0 0 1px var(--line), 0 6px 18px rgba(0, 0, 0, .45); font-size: 13px; line-height: 1.4;
  transform: translate(-50%, calc(-100% - 8px)); }
.wm-tip.is-below { transform: translate(-50%, 8px); }
.wm-tip b { display: block; font-weight: 600; color: var(--fg); }
.wm-tip span { display: block; margin-top: 1px; color: var(--fg-2); font-size: 12px; }
.wm-tip span:empty { display: none; }
.wm-up { position: absolute; left: 8px; top: 8px; z-index: 2; display: inline-flex; align-items: center; gap: 2px; height: 32px; padding: 0 12px 0 6px;
  border: 0; border-radius: 16px; background: rgba(6, 12, 20, .88); color: var(--fg); font-size: 13px; cursor: pointer; box-shadow: 0 0 0 1px var(--line); }
.wm-up:hover { background: var(--hover); }
.wm-up svg { width: 18px; height: 18px; }
.wm-aside { flex: 1 1 260px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.wm-lead { color: var(--fg-2); font-size: 14px; }
.wm-areas { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.wm-areas a { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 10px; border-radius: 6px; background: var(--panel);
  font-size: 14px; transition: background-color .15s ease, color .15s ease; }
.wm-areas a span { color: var(--fg-3); font-size: 12px; }
.wm-areas a:hover { background: var(--hover); color: var(--brand-text); }

/* 찾기 */
.wm-search { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--fg-3); transition: border-color .2s ease; }
.wm-search:focus-within { border-color: var(--brand); }
.wm-search svg { width: 18px; height: 18px; }
.wm-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; color: var(--fg); font: inherit; font-size: 15px; outline: none; }
.wm-search input::placeholder { color: var(--fg-3); }
.wm-filter { max-width: 420px; }
.wm-find { display: flex; flex-direction: column; gap: 12px; }
.wm-find .wm-search { max-width: 420px; }
.wm-find .wm-grid:empty { display: none; }
.wm-none { color: var(--fg-3); font-size: 14px; }

/* 맵 카드 */
.wm-area { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; scroll-margin-top: 16px;
  content-visibility: auto; contain-intrinsic-size: auto 720px; }
.wm-area[hidden] { display: none; }
.wm-list { display: flex; flex-direction: column; gap: 16px; }
.wm-area .sub-title span { margin-left: 8px; font-size: 14px; font-weight: 400; color: var(--fg-3); }
.wm-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.wm-grid li[hidden] { display: none; }
.wm-card, .wm-region { display: flex; flex-direction: column; height: 100%; border-radius: 8px; overflow: hidden; background: var(--panel);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .03); }
.wm-thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #05090e; }
.wm-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.wm-card:hover .wm-thumb img, .wm-region:hover .wm-thumb img { transform: scale(1.05); }
.wm-noimg { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--fg-3); font-size: 12px; }
.wm-thumb .wm-tags { position: absolute; left: 6px; top: 6px; display: flex; gap: 4px; }
.wm-cap { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px 10px; min-width: 0; }
.wm-cap b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .15s ease; }
.wm-cap span { font-size: 12px; color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-card:hover .wm-cap b, .wm-region:hover .wm-region-t b { color: var(--brand-text); }

/* 묶음 카드(대표 맵) — 누르면 그 줄 아래로 맵 목록이 펼쳐진다(world.js) */
.wm-groups { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.wm-g { position: relative; scroll-margin-top: 16px; }
.wm-gcard { position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 10px; overflow: hidden;
  background: var(--panel); color: var(--fg); font: inherit; text-align: left; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .03); transition: box-shadow .15s ease; }
.wm-gcard .wm-thumb img { transition: transform .6s var(--ease); }
.wm-gcard:hover .wm-thumb img { transform: scale(1.05); }
.wm-gcard:hover .wm-gcap b { color: var(--brand-text); }
.wm-g.is-open .wm-gcard { box-shadow: inset 0 0 0 2px var(--brand); }
.wm-gnum { position: absolute; right: 6px; bottom: 6px; padding: 2px 8px; border-radius: 10px; background: rgba(6, 12, 20, .84); color: var(--fg); font-size: 12px; }
.wm-gcap { display: flex; flex-direction: column; gap: 2px; padding: 10px 40px 12px 12px; min-width: 0; }
.wm-gcap b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .15s ease; }
.wm-gcap span { font-size: 12px; color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-gchev { position: absolute; right: 12px; bottom: 15px; width: 20px; height: 20px; color: var(--fg-3); transition: transform .25s var(--ease), color .15s ease; }
.wm-g.is-open .wm-gchev { transform: rotate(180deg); color: var(--brand-text); }
/* 펼친 목록: 줄 전체 폭, 누른 카드 쪽을 가리키는 꼭지 + 카드가 차례로 좌르륵 */
.wm-panel { position: relative; grid-column: 1 / -1; }
.wm-panel[hidden] { display: none; }
.wm-panel .wm-area { margin: 0; padding: 14px 16px 18px; border-radius: 10px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); content-visibility: visible; }
.wm-panel::before { content: ""; position: absolute; top: -7px; left: var(--ax, 50%); width: 14px; height: 14px; background: var(--bg);
  border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: translateX(-50%) rotate(45deg); }
.wm-panel.is-open .wm-area { animation: wm-unfold .3s var(--ease) both; }
.wm-panel.is-open::before { animation: wm-fade .2s ease both; }
.wm-panel.is-open .wm-grid li { animation: wm-pop .36s var(--ease) both; animation-delay: calc(var(--i, 0) * 22ms + 40ms); }
@keyframes wm-unfold { from { opacity: 0; clip-path: inset(0 0 calc(100% - 48px) 0 round 10px); } to { opacity: 1; clip-path: inset(0 0 0 0 round 10px); } }
@keyframes wm-pop { from { opacity: 0; transform: translateY(12px); } }
@keyframes wm-fade { from { opacity: 0; } }
.wm-phead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wm-pclose { display: flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: none; color: var(--fg-3); cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.wm-pclose:hover { background: var(--hover); color: var(--fg); }
.wm-pclose svg { width: 20px; height: 20px; }
/* 찾는 중: 묶음 카드는 숨기고 모든 묶음 목록을 맞는 맵만 */
.wm-groups.is-search .wm-g, .wm-groups.is-search .wm-pclose, .wm-groups.is-search .wm-panel::before { display: none; }
.wm-groups.is-search .wm-panel .wm-area { padding: 0; background: none; box-shadow: none; animation: none; }
.wm-groups.is-search .wm-panel .wm-grid li { animation: none; }

/* 지역 카드(첫 쪽) */
.wm-regions { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.wm-region-t { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px 0; }
.wm-region-t b { font-size: 16px; font-weight: 600; transition: color .15s ease; }
.wm-region-d { padding: 4px 14px 0; font-size: 13px; color: var(--fg-2); }
.wm-region-a { padding: 6px 14px 14px; font-size: 12px; color: var(--fg-3); }

/* 맵 창: 넓은 화면은 그림(16:9) 옆에 정보, 좁은 화면은 그림 아래 */
.wm-dlg { --iw: min(1280px, calc(100vw - 352px), calc((100vh - 32px) * 16 / 9)); width: calc(var(--iw) + 320px); max-width: none; max-height: calc(100vh - 32px);
  padding: 0; border: 0; border-radius: 10px; background: var(--panel); color: var(--fg); overflow: hidden; box-shadow: 0 0 0 1px var(--line), 0 24px 64px rgba(0, 0, 0, .6); }
.wm-dlg::backdrop { background: rgba(3, 7, 12, .82); }
.wm-dlg[open] { animation: wm-in .18s var(--ease) both; }
@keyframes wm-in { from { opacity: 0; transform: translateY(6px); } }
.wm-dlg-in { position: relative; display: flex; }
.wm-shot { position: relative; flex: none; width: var(--iw); aspect-ratio: 16 / 9; background: #05090e center / cover no-repeat; }
.wm-shot img { width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .2s ease; }
.wm-shot img.is-ready { opacity: 1; }
.wm-nav { position: absolute; top: 50%; z-index: 1; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-top: -22px;
  border: 0; border-radius: 50%; background: rgba(6, 12, 20, .7); color: #fff; cursor: pointer; transition: background-color .15s ease; }
.wm-nav:hover { background: rgba(6, 12, 20, .92); }
.wm-nav svg { width: 24px; height: 24px; }
.wm-nav.is-prev { left: 10px; }
.wm-nav.is-next { right: 10px; }
.wm-info { width: 320px; max-height: calc(var(--iw) * 9 / 16); overflow-y: auto; padding: 20px 20px 24px; display: flex; flex-direction: column; gap: 18px; overscroll-behavior: contain; }
.wm-info-head { display: flex; flex-direction: column; gap: 4px; padding-right: 36px; }
.wm-street { font-size: 13px; color: var(--fg-3); }
.wm-info h2 { font-size: 20px; font-weight: 600; }
.wm-info .wm-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.wm-info .wm-tags:empty { display: none; }
.wm-pos { font-size: 12px; color: var(--fg-3); }
.wm-cols { display: flex; flex-direction: column; gap: 18px; }
.wm-cols section[hidden] { display: none; }
.wm-cols h3 { margin-bottom: 8px; font-size: 13px; font-weight: 500; color: var(--fg-3); }
.wm-mobs { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.wm-mob { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 2px 8px 2px 4px; border-radius: 6px; transition: background-color .15s ease; }
a.wm-mob:hover { background: var(--hover); }
a.wm-mob:hover b { color: var(--brand-text); }
.wm-mob-pic { display: flex; align-items: center; justify-content: center; flex: none; width: 48px; height: 48px; }
.wm-mob-pic img { max-width: none; }
.wm-mob-pic img.is-px { image-rendering: pixelated; }
.wm-mob-t { display: flex; flex-direction: column; min-width: 0; }
.wm-mob-t b { font-size: 14px; font-weight: 500; transition: color .15s ease; }
.wm-mob-t span { font-size: 12px; color: var(--fg-3); }
.wm-npcs { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.wm-npcs li { padding: 4px 10px; border-radius: 6px; background: var(--panel-2); font-size: 13px; }
.wm-x { position: absolute; right: 10px; top: 10px; z-index: 2; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border: 0; border-radius: 50%; background: rgba(6, 12, 20, .7); color: #fff; cursor: pointer; }
.wm-x:hover { background: rgba(6, 12, 20, .92); }
.wm-x svg { width: 22px; height: 22px; }

@media (max-width: 1023px) {
  .wm-regions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wm-dlg { --iw: calc(100vw - 16px); width: var(--iw); max-height: calc(100vh - 16px); overflow-y: auto; overscroll-behavior: contain; }
  .wm-dlg-in { flex-direction: column; }
  .wm-info { width: auto; max-height: none; overflow: visible; padding: 16px 16px 24px; }
  .wm-info-head { padding-right: 0; }
}
@media (max-width: 767px) {
  /* 지역·동네 줄은 한 줄로 옆으로 밀기(줄 수가 글꼴에 따라 바뀌어 아래가 밀리지 않게, 폰에서 지도 아래 자리를 덜 차지하게) */
  .wm-rnav ul, .wm-areas { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .wm-rnav ul::-webkit-scrollbar, .wm-areas::-webkit-scrollbar { display: none; }
  .wm-areas a { white-space: nowrap; }
  .wm-aside { flex-basis: 100%; }
  .wm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .wm-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .wm-gcap { padding: 8px 30px 10px 10px; }
  .wm-gcap b { font-size: 14px; }
  .wm-gchev { right: 8px; bottom: 12px; width: 18px; height: 18px; }
  .wm-panel .wm-area { margin: 0 -8px; padding: 12px 8px 14px; }
  .wm-regions { grid-template-columns: minmax(0, 1fr); }
  .wm-cap { padding: 6px 8px 8px; }
  .wm-cap b { font-size: 13px; }
  .wm-nav { width: 36px; height: 36px; margin-top: -18px; }
  .wm-nav.is-prev { left: 6px; }
  .wm-nav.is-next { right: 6px; }
  .wm-x { width: 36px; height: 36px; right: 6px; top: 6px; }
}
@supports (height: 100dvh) {
  .wm-dlg { --iw: min(1280px, calc(100vw - 352px), calc((100dvh - 32px) * 16 / 9)); max-height: calc(100dvh - 32px); }
  @media (max-width: 1023px) { .wm-dlg { --iw: calc(100vw - 16px); max-height: calc(100dvh - 16px); } }
}
@media (pointer: coarse) { .wm-search input { font-size: 16px; } }
@media (prefers-reduced-motion: reduce) { .wm-dlg[open], .wm-panel.is-open .wm-area, .wm-panel.is-open::before, .wm-panel.is-open .wm-grid li { animation: none; } .wm-thumb img, .wm-gcard .wm-thumb img { transition: none; } }
