/* ──────────────────────────────────────────────
   命柱 : 명주시 — 위성지도 레이더 HUD
   ────────────────────────────────────────────── */
:root {
  --bg:      #06110F;
  --glow:    #5BF0B4;   /* 레이더 녹색 */
  --glow-2:  #1F9C77;
  --amber:   #F2B134;   /* 경고·선택 */
  --ink:     #D9F3E8;
  --ink-dim: #7FA896;
  --panel:   rgba(6, 22, 19, .86);
  --line:    rgba(91, 240, 180, .35);
  --mono: 'Share Tech Mono', 'SF Mono', Menlo, Consolas, monospace;
  --sans: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.55; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
a { color: var(--glow); }
:focus-visible { outline: 1px solid var(--amber); outline-offset: 2px; }

/* ── 지도 무대 ───────────────────────────── */
.stage { position: fixed; inset: 0; overflow: hidden; background: var(--bg); touch-action: none; }
.map { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.map-img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none;
  filter: saturate(.7) contrast(1.04) brightness(.95); }
.map::after { content: ""; position: absolute; inset: 0; background: rgba(91,240,180,.06); mix-blend-mode: multiply; pointer-events: none; }
.grid { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 128px 128px, linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 128px 128px; opacity: .35; }
.sweep { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.sweep::before { content: ""; position: absolute; left: 0; right: 0; height: 180px; top: -180px;
  background: linear-gradient(180deg, transparent, rgba(91,240,180,.05) 70%, rgba(91,240,180,.16)); }
@media (prefers-reduced-motion: no-preference) { .sweep::before { animation: sweep 7s linear infinite; } @keyframes sweep { to { transform: translateY(calc(100% + 180px + 100vh)); } } }
.scanlines { position: fixed; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0,0,0,.12) 0 1px, transparent 1px 3px); opacity: .35; }
.vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 50%, transparent 60%, rgba(0,0,0,.4)); }

/* 핀 */
.pins { position: absolute; inset: 0; }
.pin { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 8px; padding: 0; color: var(--ink); white-space: nowrap; pointer-events: auto; }
.pin-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--glow); background: rgba(91,240,180,.25); position: relative; flex: none; }
.pin-dot::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 1px solid var(--glow); opacity: .6; }
@media (prefers-reduced-motion: no-preference) { .pin.work .pin-dot::after { animation: ping 2.4s ease-out infinite; } @keyframes ping { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(2.2); opacity: 0; } } }
.pin-label { font-family: var(--sans); font-weight: 800; font-size: 19px; letter-spacing: .02em; color: #fff; text-shadow: 0 0 6px rgba(0,0,0,.9), 0 1px 2px rgba(0,0,0,.9), 0 0 14px rgba(0,0,0,.6); }
.pin:not(.baked) .pin-dot { width: 22px; height: 22px; background: rgba(91,240,180,.18); box-shadow: 0 0 0 2px rgba(0,0,0,.55); }
.pin.left { flex-direction: row-reverse; }
.pin.place .pin-dot { border-color: #BFD9CC; background: rgba(255,255,255,.12); }
.pin.place .pin-dot::after { display: none; }
.pin.place .pin-label { font-weight: 600; font-size: 16px; color: #E6F2EC; }
.pin:hover .pin-label, .pin.on .pin-label { color: var(--amber); }
.pin.on .pin-dot { border-color: var(--amber); background: rgba(242,177,52,.35); }
.pin.baked .pin-dot { width: 22px; height: 22px; background: rgba(91,240,180,.12); }
.pin.baked.place .pin-dot { width: 16px; height: 16px; border-color: rgba(127,168,150,.6); }

/* ── HUD ─────────────────────────────────── */
.hud { position: fixed; left: 0; right: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px 18px; pointer-events: none; font-family: var(--mono); }
.hud > * { pointer-events: auto; }
.hud-top { top: 0; background: linear-gradient(180deg, rgba(6,17,15,.9), transparent); }
.hud-bottom { bottom: 0; background: linear-gradient(0deg, rgba(6,17,15,.9), transparent); justify-content: flex-start; }
.hud-id { display: flex; align-items: baseline; gap: 10px; }
.hud-tag { font-size: 10px; letter-spacing: .25em; color: var(--glow); padding: 2px 6px; border: 1px solid var(--line); }
.hud-title { font-family: var(--sans); font-weight: 700; font-size: 18px; letter-spacing: .04em; }
.hud-nav { display: flex; gap: 2px; margin-left: auto; }
.hud-nav button { padding: 5px 11px; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; color: var(--ink-dim); border: 1px solid transparent; }
.hud-nav button:hover, .hud-nav button[aria-current="true"] { color: var(--glow); border-color: var(--line); }
.hud-meta { display: flex; gap: 14px; font-size: 12px; color: var(--ink-dim); }
.hud-legend { font-size: 11px; color: var(--ink-dim); letter-spacing: .06em; }
.hud-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--glow); margin: 0 5px 0 12px; vertical-align: 0; }
.hud-legend i.p { border-color: var(--ink-dim); }

.pa-btn { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line); font-family: var(--mono); font-size: 12px; letter-spacing: .1em; background: rgba(6,17,15,.7); max-width: 60vw; }
.pa-btn[aria-expanded="true"] { border-color: var(--amber); }
.pa-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px var(--amber); flex: none; }
.pa-now { font-family: var(--sans); color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── 패널 ────────────────────────────────── */
.panel { position: fixed; top: 56px; right: 16px; bottom: 94px; width: min(460px, calc(100vw - 32px)); z-index: 30;
  background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(6px); display: flex; flex-direction: column;
  box-shadow: 0 0 0 1px rgba(0,0,0,.4), 0 0 40px rgba(91,240,180,.08); }
.panel[hidden] { display: none; }
.panel::before, .panel::after { content: ""; position: absolute; width: 14px; height: 14px; border-color: var(--glow); border-style: solid; pointer-events: none; }
.panel::before { left: -1px; top: -1px; border-width: 2px 0 0 2px; } .panel::after { right: -1px; bottom: -1px; border-width: 0 2px 2px 0; }
@media (prefers-reduced-motion: no-preference) { .panel { animation: open .18s ease-out; } @keyframes open { from { transform: translateX(12px); opacity: 0; } } }
.panel-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 11px; letter-spacing: .2em; color: var(--glow); }
.panel-close { font-size: 13px; color: var(--ink-dim); padding: 2px 6px; }
.panel-close:hover { color: var(--amber); }
.panel-body { padding: 16px 18px 20px; overflow: auto; flex: 1; }
.panel-body h1 { font-size: 24px; margin: 0 0 2px; line-height: 1.2; }
.panel-body h2 { font-family: var(--mono); font-size: 11px; letter-spacing: .2em; color: var(--glow); margin: 20px 0 8px; font-weight: 400; display: flex; align-items: center; gap: 10px; }
.panel-body h2::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.panel-body p { margin: 0 0 10px; }
.sub { font-family: var(--mono); font-size: 12px; color: var(--ink-dim); letter-spacing: .06em; margin-bottom: 10px; }
.muted { color: var(--ink-dim); }
.small { font-size: 12.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
.chip { display: inline-block; padding: 1px 8px; border: 1px solid var(--line); font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-decoration: none; color: var(--ink); }
a.chip:hover { border-color: var(--amber); color: #fff; }
.btn { display: inline-block; padding: 7px 14px; border: 1px solid var(--glow); color: var(--glow); font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-decoration: none; }
.btn:hover { background: var(--glow); color: var(--bg); }
.links { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.empty { padding: 18px; text-align: center; color: var(--ink-dim); border: 1px dashed var(--line); font-size: 12.5px; }

/* 인물 */
.cast { display: grid; gap: 8px; }
.who { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; padding: 8px; border: 1px solid rgba(91,240,180,.18); background: rgba(0,0,0,.2); }
.who-photo { width: 56px; height: 70px; object-fit: cover; object-position: top; border: 1px solid var(--line); background: rgba(0,0,0,.3); display: grid; place-items: center; color: var(--ink-dim); font-family: var(--mono); }
img.who-photo { cursor: zoom-in; filter: saturate(.9); }
.who-name { font-weight: 700; font-size: 16px; padding: 0; text-align: left; }
button.who-name { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
button.who-name:hover { text-decoration-color: var(--amber); }
.who-role { font-size: 12px; color: var(--ink-dim); margin: 1px 0 6px; }
.who-go { display: flex; flex-wrap: wrap; gap: 4px; }
.who-go a, .who-go span { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; padding: 2px 8px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.who-go a:hover { border-color: var(--amber); color: #fff; }
.who-go span { color: var(--ink-dim); border-style: dashed; }
.who-n { font-family: var(--mono); font-size: 10px; color: var(--ink-dim); margin-left: 6px; }

/* 공지 */
.notice { padding: 10px 0 12px; border-bottom: 1px solid rgba(91,240,180,.18); }
.notice-date { font-family: var(--mono); font-size: 11px; color: var(--glow); letter-spacing: .1em; }
.notice-title { font-weight: 700; font-size: 15px; margin: 2px 0 4px; }
.notice p { margin: 0; }

/* ── BGM ─────────────────────────────────── */
.dock { position: fixed; left: 16px; bottom: 94px; z-index: 30; display: flex; gap: 12px; align-items: flex-end; max-width: calc(100vw - 32px); }
.pa { width: min(420px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(6px); max-height: 70vh; overflow: auto; }
.promo { width: 240px; background: var(--panel); border: 1px solid var(--glow); backdrop-filter: blur(6px); box-shadow: 0 0 24px rgba(91,240,180,.15); }
.promo[hidden] { display: none; }
.promo-bar { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: var(--glow); }
.promo video { display: block; width: 100%; aspect-ratio: 9/16; background: #000; }
.hud-bottom { gap: 8px; align-items: flex-end; }
.hud-btns { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.hud-bottom .hud-legend { margin-left: auto; }
.pa[hidden] { display: none; }
.pa-body { padding: 10px; }
.yt { aspect-ratio: 16/9; background: #000; margin-bottom: 8px; }
.yt iframe { width: 100%; height: 100%; border: 0; display: block; }
.tracks { list-style: none; margin: 0; padding: 0; }
.tracks button { width: 100%; text-align: left; padding: 4px 6px; font-size: 12.5px; display: flex; gap: 8px; color: var(--ink); }
.tracks button:hover { background: rgba(91,240,180,.08); }
.tracks li.on button { color: #fff; background: rgba(242,177,52,.18); }
.tno { font-family: var(--mono); font-size: 11px; color: var(--glow); flex: none; }

/* ── 라이트박스 ──────────────────────────── */
.lightbox { position: fixed; inset: 0; background: rgba(3,8,7,.9); display: grid; place-items: center; z-index: 100; padding: 20px; }
.lightbox figure { margin: 0; border: 1px solid var(--line); padding: 6px; background: var(--bg); max-width: 100%; }
.lightbox img { max-width: 100%; max-height: 80vh; display: block; }
.lightbox figcaption { font-size: 12px; padding: 8px 4px 2px; display: flex; justify-content: space-between; gap: 12px; color: var(--ink-dim); }
.lb-stage { position: relative; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 1px solid var(--line); background: var(--panel); color: var(--glow); font-size: 12px; }
.lb-prev { left: 8px; } .lb-next { right: 8px; } .lb-nav[hidden] { display: none; }

/* ── 반응형 ──────────────────────────────── */
@media (max-width: 720px) {
  .hud { padding: 8px 10px; gap: 8px; }
  .hud-title { font-size: 15px; }
  .hud-tag, .hud-meta, .hud-legend { display: none; }
  .hud-nav button { padding: 4px 8px; font-size: 11px; }
  .hud-bottom .pa-btn { max-width: 70vw; }
  .panel { top: auto; left: 8px; right: 8px; bottom: 86px; width: auto; max-height: 62vh; }
  .dock { left: 8px; right: 8px; bottom: 86px; flex-direction: column; align-items: stretch; }
  .pa { width: auto; }
  .promo { width: auto; }
  .promo video { aspect-ratio: auto; max-height: 50vh; }
  .pin-label { font-size: 11px; }
}

.pin.static { cursor: default; pointer-events: none; }
.who-go a.ens { border-style: dashed; color: var(--glow); }
.who-go a.ens:hover { border-style: solid; border-color: var(--amber); color: #fff; }

.tl { min-height: 80px; border: 1px solid var(--line); padding: 4px; margin-bottom: 8px; }
.tl a.twitter-timeline { display: block; padding: 20px; text-align: center; color: var(--ink-dim); font-size: 12.5px; }

.tl-fail { margin: 0; padding: 16px; font-size: 12.5px; color: var(--ink-dim); text-align: center; }
