/* 3D 지도 공통 모양. 시안마다 --cm-* 값만 바꿔 쓴다.
   2026-11-14 사장님 의견 "약간 조잡" → 쾌적하게: 흰 판(둥글기 14px, 옅은 그림자), 알약 버튼, 이름표는 작고 옅게, 한 번에 적게. */
.cm {
  --cm-ink: #17201b; --cm-muted: #5d6a63; --cm-paper: rgba(255,255,255,.94); --cm-line: rgba(23,32,27,.1); --cm-accent: #1f5a44; --cm-on: #fff;
  --cm-r: 14px; --cm-font: 'Pretendard Variable', Pretendard, system-ui, -apple-system, 'Malgun Gothic', sans-serif; --cm-shadow: 0 6px 24px rgba(16,40,28,.12);
  position: relative; overflow: hidden; background: #cfdfe8; font-family: var(--cm-font); color: var(--cm-ink);
  word-break: keep-all; overflow-wrap: anywhere; isolation: isolate; -webkit-font-smoothing: antialiased;
}
.cm-stage { position: absolute; inset: 0; outline: none; }
.cm-stage:focus-visible { box-shadow: inset 0 0 0 3px var(--cm-accent); }
.cm-canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.cm-canvas:active { cursor: grabbing; }
.cm-fade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .28s; }
.cm-fade.on { opacity: 1; }
.cm-loading { position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; justify-items: center; font-weight: 600; font-size: 15px; color: var(--cm-muted); background: inherit; z-index: 9; }
.cm-loading span { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--cm-line); border-top-color: var(--cm-accent); animation: cm-spin 0.9s linear infinite; }
@keyframes cm-spin { to { transform: rotate(360deg); } }
/* 휴대폰에서 3D 그림 판이 끊긴 동안(glguard.js): 빈 바탕에 이름표만 떠 있지 않게 감추고 안내를 보인다 */
.cm--lost .cm-labels, .cm--lost .cm-hint { opacity: 0 !important; }
.cm--lost::before { content: "지도를 다시 그리는 중"; position: absolute; inset: 0; display: grid; place-content: center; font: 600 15px/1.4 var(--cm-font); color: var(--cm-muted); z-index: 2; pointer-events: none; }

/* 글자표: 나타나고 사라질 때 천천히(깜빡임 대신 스르르) */
.cm-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
/* 꺼진 이름표는 사라진 뒤 visibility:hidden — 예전 will-change 는 이름표 96개가 저마다 그래픽 층을 잡아(층 100여 개) 무거웠다 */
.cm-lb { position: absolute; left: 0; top: 0; opacity: 0; visibility: hidden; transition: opacity .45s ease, visibility 0s linear .45s; white-space: nowrap; }
.cm-lb.on { opacity: 1; visibility: visible; transition: opacity .45s ease, visibility 0s; }
.cm-lb--zone { display: grid; justify-items: center; }
.cm-lb--zone b { display: inline-flex; align-items: center; gap: 6px; font: 650 13px/1 var(--cm-font); letter-spacing: -.01em; padding: 7px 11px; border-radius: 999px; background: var(--cm-paper); color: var(--cm-ink); box-shadow: 0 2px 10px rgba(16,40,28,.13); }
.cm-lb--zone b[style*="--zc"]::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--zc); flex: none; }
.cm-lb--zone.dim.on { opacity: .4; }
.cm-lb--minor b { font-size: 11.5px; font-weight: 600; padding: 4px 8px; color: var(--cm-muted); background: rgba(255,255,255,.82); box-shadow: 0 1px 6px rgba(16,40,28,.1); }
.cm-lb--minor b::before { display: none; }
.cm-lb--site { font: 650 11px/1 var(--cm-font); padding: 4px 6px; border-radius: 7px; background: rgba(255,255,255,.9); color: var(--cm-ink); box-shadow: 0 1px 6px rgba(16,40,28,.12); }
.cm-lb--place span { display: block; font: 600 12px/1.2 var(--cm-font); color: #3c4a42; letter-spacing: -.01em; text-shadow: 0 0 3px rgba(255,255,255,.95), 0 0 8px rgba(255,255,255,.8); }
.cm-badge { display: block; margin: 3px auto 0; width: max-content; font: 650 11px/1 var(--cm-font); font-style: normal; padding: 4px 8px; border-radius: 999px; background: rgba(31,90,68,.92); color: #fff; box-shadow: 0 2px 8px rgba(16,40,28,.12); }
.cm-badge:empty, .cm-badge[hidden] { display: none; }
.cm-badge.off { background: rgba(255,255,255,.88); color: var(--cm-muted); }
.cm[data-time="night"] .cm-lb--zone b, .cm[data-time="night"] .cm-lb--site { background: rgba(20,26,40,.82); color: #fff; }
.cm[data-time="night"] .cm-lb--minor b { background: rgba(20,26,40,.7); color: rgba(255,255,255,.85); }
.cm[data-time="night"] .cm-lb--place span { color: rgba(255,255,255,.88); text-shadow: 0 0 4px rgba(0,0,0,.7); }

/* 버튼 줄 */
.cm-top { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; z-index: 3; pointer-events: none; }
.cm-top > * { pointer-events: auto; }
.cm-seg { display: inline-flex; background: var(--cm-paper); border-radius: 999px; padding: 4px; box-shadow: var(--cm-shadow); backdrop-filter: blur(8px); }
.cm-seg button, .cm-fs, .cm-zones button, .cm-starts button { font: 600 14px/1 var(--cm-font); border: 0; background: transparent; color: var(--cm-ink); min-height: 38px; padding: 0 14px; border-radius: 999px; cursor: pointer; transition: background .2s, color .2s; }
.cm-seg button:hover, .cm-zones button:hover { background: rgba(31,90,68,.07); }
.cm-seg button[aria-pressed="true"] { background: var(--cm-accent); color: var(--cm-on); }
.cm-fs { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; background: var(--cm-paper); box-shadow: var(--cm-shadow); min-height: 46px; padding: 0 16px; }
.cm-fs svg { width: 17px; height: 17px; fill: currentColor; }
.cm button:focus-visible, .cm a:focus-visible { outline: 3px solid var(--cm-accent); outline-offset: 2px; }
/* 구역 바로 가기: 가운데 한 줄의 흰 판 안에 옅은 알약 */
.cm-zones { position: absolute; left: 12px; right: 12px; bottom: 22px; margin: 0 auto; width: max-content; max-width: calc(100% - 24px); display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; z-index: 3; padding: 4px; border-radius: 999px; background: rgba(255,255,255,.86); box-shadow: var(--cm-shadow); backdrop-filter: blur(8px); }
.cm-zones::-webkit-scrollbar { display: none; }
.cm-zones button { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; min-height: 36px; padding: 0 12px; color: var(--cm-ink); }
.cm-zones button i { width: 7px; height: 7px; border-radius: 50%; }
.cm-zones button[aria-pressed="true"] { background: var(--cm-accent); color: #fff; }
.cm-zones button[aria-pressed="true"] i { box-shadow: 0 0 0 2px rgba(255,255,255,.85); }
.cm-hint { position: absolute; left: 50%; top: 70px; transform: translateX(-50%); margin: 0; font: 500 13px/1.3 var(--cm-font); color: var(--cm-muted); background: rgba(255,255,255,.86); padding: 8px 14px; border-radius: 999px; box-shadow: 0 2px 10px rgba(16,40,28,.1); pointer-events: none; transition: opacity .6s; z-index: 2; white-space: nowrap; }
.cm--touched .cm-hint { opacity: 0; }
.cm--walk .cm-hint { opacity: 1; animation: cm-hintout 0s 6s forwards; }
@keyframes cm-hintout { to { opacity: 0; } }
.cm--wheelhint::after { content: "지도를 한 번 누른 뒤 휠을 쓰면 확대됩니다"; position: absolute; inset: 0; display: grid; place-content: center; background: rgba(23,32,27,.35); color: #fff; font: 600 16px/1.4 var(--cm-font); z-index: 5; pointer-events: none; }
/* 지도 출처(OpenStreetMap, ODbL) */
.cm-attr { position: absolute; right: 6px; bottom: 4px; margin: 0; padding: 2px 7px; border-radius: 7px; background: rgba(255,255,255,.72); font: 500 10.5px/1.2 var(--cm-font); color: rgba(23,32,27,.66); z-index: 2; pointer-events: auto; }
.cm-attr a { color: inherit; }
.cm[data-time="night"] .cm-attr { color: rgba(255,255,255,.7); background: rgba(20,26,40,.55); }

/* 걷기 */
.cm-walkpad { position: absolute; right: 14px; bottom: 26px; display: grid; grid-template-columns: repeat(3, 48px); grid-template-rows: 48px 48px; gap: 6px; z-index: 3; }
.cm-walkpad[hidden], .cm-starts[hidden], .cm-mini[hidden], .cm-card[hidden] { display: none; }
.cm-walkpad button { width: 48px; height: 48px; border-radius: 14px; border: 0; background: var(--cm-paper); box-shadow: var(--cm-shadow); cursor: pointer; display: grid; place-items: center; touch-action: none; }
.cm-walkpad button svg { width: 22px; height: 22px; fill: var(--cm-ink); }
.cm-walkpad [data-w="left"] { grid-column: 1; grid-row: 1; }
.cm-walkpad [data-w="fwd"] { grid-column: 2; grid-row: 1; }
.cm-walkpad [data-w="right"] { grid-column: 3; grid-row: 1; }
.cm-walkpad [data-w="back"] { grid-column: 2; grid-row: 2; }
.cm-starts { position: absolute; left: 12px; top: 66px; display: flex; flex-wrap: wrap; gap: 4px; z-index: 3; max-width: calc(100% - 24px); padding: 4px; border-radius: 999px; background: rgba(255,255,255,.86); box-shadow: var(--cm-shadow); width: max-content; }
.cm-starts button { min-height: 34px; font-size: 13px; padding: 0 12px; }
.cm-starts button:hover { background: rgba(31,90,68,.07); }
/* 작은 지도: 데스크톱 440×220(예전의 4배 넓이), 휴대폰은 화면 폭의 절반 */
.cm-mini { position: absolute; left: 14px; bottom: 26px; width: 440px; height: 220px; max-width: calc(100% - 200px); border-radius: var(--cm-r); border: 0; box-shadow: var(--cm-shadow), 0 0 0 3px rgba(255,255,255,.92); z-index: 3; cursor: pointer; background: #e9eee2; }
.cm--walk .cm-zones { display: none; }

/* 정보 카드 */
.cm-card { position: absolute; right: 12px; top: 66px; width: min(340px, calc(100% - 24px)); max-height: calc(100% - 140px); overflow: auto; background: var(--cm-paper); border-radius: var(--cm-r); box-shadow: var(--cm-shadow); z-index: 4; backdrop-filter: blur(8px); }
.cm-card img { display: block; width: 100%; height: 150px; object-fit: cover; border-radius: var(--cm-r) var(--cm-r) 0 0; }
.cm-x { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: var(--cm-ink); font-size: 20px; line-height: 1; cursor: pointer; z-index: 1; box-shadow: 0 2px 8px rgba(16,40,28,.15); }
.cm-cb { padding: 14px 16px 16px; }
.cm-k { margin: 0 0 4px; font-size: 12.5px; font-weight: 700; color: var(--zc); letter-spacing: .01em; }
.cm-card h3 { margin: 0; font-size: 20px; font-weight: 750; line-height: 1.25; letter-spacing: -.015em; }
.cm-sub { margin: 4px 0 0; font-size: 14.5px; color: var(--cm-muted); }
.cm-card ul { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14.5px; line-height: 1.5; color: #2b3631; }
.cm-card li { padding-left: 14px; position: relative; }
.cm-card li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .35; }
.cm-guess { margin: 10px 0 0; font-size: 13px; line-height: 1.5; padding: 8px 10px; border-radius: 10px; background: rgba(240,170,40,.13); color: #5c4512; }
.cm-extra:empty { display: none; }
.cm-extra { margin-top: 12px; }
.cm-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.cm-acts > * { flex: 1 1 auto; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; border-radius: 999px; font: 700 14.5px/1 var(--cm-font); text-decoration: none; cursor: pointer; }
.cm-walkhere { border: 1.5px solid rgba(23,32,27,.22); background: #fff; color: var(--cm-ink); }
.cm-rsv { background: var(--cm-accent); color: var(--cm-on); border: 0; }

/* 크게 보기(전체 화면) */
.cm.cm--fs { position: fixed !important; inset: 0 !important; width: auto !important; height: auto !important; z-index: 9999; border-radius: 0 !important; margin: 0 !important; }
html.cm-lock, html.cm-lock body { overflow: hidden; }

@media (max-width: 640px) {
  .cm-seg button, .cm-fs { padding: 0 11px; font-size: 13.5px; }
  .cm-fs span { display: none; }
  .cm-card { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; max-height: 62%; }
  .cm-card img { height: 120px; }
  .cm-mini { width: 50vw; height: 25vw; max-width: none; left: 10px; bottom: 22px; }
  .cm-walkpad { grid-template-columns: repeat(3, 44px); grid-template-rows: 44px 44px; right: 10px; bottom: 22px; }
  .cm-walkpad button { width: 44px; height: 44px; }
  .cm-hint { top: auto; bottom: 74px; font-size: 12.5px; }
  .cm--walk .cm-hint { top: 118px; bottom: auto; }
  .cm-zones { left: 8px; right: 8px; width: auto; max-width: none; bottom: 20px; }
  .cm-zones button { font-size: 13px; padding: 0 10px; }
  .cm-starts { border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) { .cm-lb, .cm-fade, .cm-hint { transition: none; } }

/* 서바이벌 경기장: arena.css 에서 따로 그린다 (2026-11-14) */

/* 지도 카드: 앞으로 7일 */
.cm-av-h { margin: 0 0 6px; font-size: 13px; font-weight: 700; }
.cm-av { display: grid; gap: 3px; font-size: 12.5px; }
.cm-av-r { display: grid; grid-template-columns: minmax(72px, 1.4fr) repeat(7, 1fr); gap: 3px; align-items: center; }
.cm-av-r > span:first-child { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-av-d span { text-align: center; font-size: 11px; line-height: 1.2; color: var(--cm-muted); }
.cm-av-d .we { color: #c8473c; }
.cm-av-c { text-align: center; font-weight: 700; border-radius: 7px; padding: 5px 0; font-variant-numeric: tabular-nums; }
.cm-av-c.open { background: #e2f1e7; color: #1f5a44; }
.cm-av-c.few { background: #fdeedd; color: #9a4a12; }
.cm-av-c.full { background: #efede8; color: #9a978f; }
.cm-av-c.wait, .cm-av-c.check, .cm-av-c.none { background: transparent; color: #9a978f; }
.cm-fail { display: grid; place-items: center; background: #eee; }
.cm-fail img { max-width: 100%; height: auto; display: block; }
.cm-failmsg { margin: 12px; font-weight: 700; text-align: center; }
@media (max-width: 640px) {
  .cm-lb--zone b { font-size: 11.5px; padding: 5px 8px; gap: 5px; }
  .cm-badge { font-size: 10.5px; padding: 3px 6px; margin-top: 2px; }
  .cm-lb--site { font-size: 10px; }
  .cm-lb--place span { font-size: 11px; }
}
