/* ==========================================================================
   픽셀광장 PixelPlaza — 공통 픽셀 테마
   - Galmuri 폰트(OFL, 자가 호스팅) / 따뜻한 파스텔 + 깊은 남색 패널
   - 테두리는 box-shadow 4방향 기법(모서리가 깎인 픽셀 테두리)
   ========================================================================== */

@font-face { font-family: 'Galmuri11'; src: url('/fonts/Galmuri11.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Galmuri11'; src: url('/fonts/Galmuri11-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Galmuri9'; src: url('/fonts/Galmuri9.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Galmuri14'; src: url('/fonts/Galmuri14.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --px: 4px;
  --ink: #191a33;
  --navy-950: #0f1029;
  --navy-900: #1d1f45;
  --navy-800: #282b5c;
  --navy-700: #363a75;
  --navy-600: #4a4f94;
  --line: #6a70c4;
  --cream: #fff6e3;
  --paper: #fbeed2;
  --text: #f4f1ff;
  --text-dim: #b9b5dd;
  --text-dark: #2a2340;
  --pink: #ff8fab;
  --pink-d: #e0607f;
  --peach: #ffb38a;
  --peach-d: #e48a5c;
  --yellow: #ffd966;
  --yellow-d: #e0ae2f;
  --mint: #7ee0b5;
  --mint-d: #3fae80;
  --sky: #8fd3ff;
  --sky-d: #4f9fd6;
  --lavender: #b9a3ff;
  --lavender-d: #8a6fe0;
  --red: #ff5d73;
  --red-d: #c93a52;
  --shadow: rgba(10, 10, 30, .45);

  --font: 'Galmuri11', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  --font-small: 'Galmuri9', 'Galmuri11', 'Apple SD Gothic Neo', system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  --font-title: 'Galmuri14', 'Galmuri11', 'Apple SD Gothic Neo', system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';

  --dock-h: 0px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--navy-950);
  -webkit-font-smoothing: none;
  font-smooth: never;
  image-rendering: pixelated;
}
img, canvas, video { image-rendering: pixelated; }
video { image-rendering: auto; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--sky); }
a.link { color: var(--sky); text-decoration: underline; text-underline-offset: 3px; word-break: break-all; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
::selection { background: var(--pink); color: var(--ink); }

/* 접근성: 키보드 포커스 */
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 6px; }
.input:focus-visible, textarea:focus-visible, input:focus-visible { outline-offset: 5px; }

/* 스크롤바 */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border: 3px solid var(--navy-900); }
::-webkit-scrollbar-thumb:hover { background: var(--lavender); }
::-webkit-scrollbar-corner { background: transparent; }

/* ---------- 픽셀 테두리 유틸 ---------- */
.pborder {
  box-shadow:
    0 calc(-1 * var(--px)) 0 0 var(--ink), 0 var(--px) 0 0 var(--ink),
    calc(-1 * var(--px)) 0 0 0 var(--ink), var(--px) 0 0 0 var(--ink);
}

/* ---------- 패널 (RPG 대화상자) ---------- */
.panel {
  position: relative;
  background: var(--navy-900);
  color: var(--text);
  padding: 16px 18px;
  margin: var(--px);
  box-shadow:
    0 calc(-1 * var(--px)) 0 0 var(--ink), 0 var(--px) 0 0 var(--ink),
    calc(-1 * var(--px)) 0 0 0 var(--ink), var(--px) 0 0 0 var(--ink),
    inset 0 0 0 3px var(--navy-900), inset 0 0 0 5px var(--line),
    8px 8px 0 0 var(--shadow);
}
.panel-cream {
  background: var(--cream);
  color: var(--text-dark);
  box-shadow:
    0 calc(-1 * var(--px)) 0 0 var(--ink), 0 var(--px) 0 0 var(--ink),
    calc(-1 * var(--px)) 0 0 0 var(--ink), var(--px) 0 0 0 var(--ink),
    inset 0 0 0 3px var(--cream), inset 0 0 0 5px var(--peach),
    8px 8px 0 0 var(--shadow);
}
.panel-title {
  font-family: var(--font-title);
  font-size: 18px;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: .5px;
}
.panel-title .ico { font-size: 20px; }

/* ---------- 버튼 ---------- */
.btn {
  --bg: var(--cream);
  --fg: var(--text-dark);
  --bw: 3px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  margin: var(--bw);
  border: 0;
  border-radius: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  text-decoration: none;
  box-shadow:
    0 calc(-1 * var(--bw)) 0 0 var(--ink), 0 var(--bw) 0 0 var(--ink),
    calc(-1 * var(--bw)) 0 0 0 var(--ink), var(--bw) 0 0 0 var(--ink),
    inset 0 -4px 0 0 rgba(0, 0, 0, .22), inset 0 3px 0 0 rgba(255, 255, 255, .45);
  transition: transform .06s steps(2), filter .1s;
}
.btn:hover:not(:disabled) { filter: brightness(1.06) saturate(1.05); transform: translateY(-1px); }
.btn:active:not(:disabled), .btn.is-pressed {
  transform: translateY(2px);
  box-shadow:
    0 calc(-1 * var(--bw)) 0 0 var(--ink), 0 var(--bw) 0 0 var(--ink),
    calc(-1 * var(--bw)) 0 0 0 var(--ink), var(--bw) 0 0 0 var(--ink),
    inset 0 4px 0 0 rgba(0, 0, 0, .2);
}
.btn:disabled, .btn[aria-disabled='true'] { cursor: not-allowed; filter: grayscale(.7) brightness(.8); opacity: .75; }
.btn-primary { --bg: var(--yellow); }
.btn-pink { --bg: var(--pink); }
.btn-mint { --bg: var(--mint); }
.btn-sky { --bg: var(--sky); }
.btn-lav { --bg: var(--lavender); }
.btn-danger { --bg: var(--red); --fg: #fff; }
.btn-dark { --bg: var(--navy-700); --fg: var(--text); }
.btn-ghost { --bg: transparent; --fg: var(--text); box-shadow: none; }
.btn-ghost:hover { background: rgba(255, 255, 255, .08); }
.btn-big { min-height: 52px; padding: 10px 22px; font-size: 17px; --bw: 4px; }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.btn-xs { min-height: 24px; padding: 2px 8px; font-size: 12px; --bw: 2px; }
.btn-block { display: flex; width: calc(100% - 2 * var(--bw)); }
.btn .kbd, .kbd {
  font-family: var(--font-small);
  font-size: 10px;
  font-weight: 400;
  padding: 1px 4px;
  background: rgba(0, 0, 0, .18);
  color: inherit;
  opacity: .85;
}
.btn-icon {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
}
.btn-icon:hover { background: rgba(255, 255, 255, .12); }
.btn-icon:active { transform: translateY(1px); }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-end { justify-content: flex-end; }
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--text-dim); }
.small { font-family: var(--font-small); font-size: 11px; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* ---------- 입력 ---------- */
.input, .select, textarea.input {
  display: block;
  width: calc(100% - 6px);
  margin: 3px;
  padding: 9px 11px;
  border: 0;
  border-radius: 0;
  background: var(--cream);
  color: var(--text-dark);
  font-family: var(--font);
  font-size: 14px;
  box-shadow:
    0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink),
    inset 0 3px 0 0 rgba(0, 0, 0, .12);
}
.input::placeholder { color: #9c94b3; }
textarea.input { resize: vertical; min-height: 84px; line-height: 1.55; }
.panel .input, .modal .input { background: #fffaf0; }
.field { margin: 0 0 14px; }
.field-label { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 6px; font-weight: 700; font-size: 13px; }
.field-count { font-family: var(--font-small); font-size: 11px; color: var(--text-dim); font-weight: 400; }
.field-count.over { color: var(--red); }
.field-hint { margin: 6px 2px 0; font-family: var(--font-small); font-size: 11px; color: var(--text-dim); }
.panel-cream .field-hint, .panel-cream .field-count { color: #7b6f90; }

/* 픽셀 스위치 */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input {
  appearance: none; -webkit-appearance: none;
  width: 44px; height: 22px; margin: 3px;
  background: var(--navy-600);
  position: relative; cursor: pointer;
  box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink);
}
.switch input::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  background: var(--cream);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2);
  transition: left .12s steps(3);
}
.switch input:checked { background: var(--mint-d); }
.switch input:checked::after { left: 25px; }
.switch input:focus-visible { outline: 3px solid var(--yellow); outline-offset: 5px; }

/* 배지 */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 6px;
  font-family: var(--font-small); font-size: 11px; line-height: 16px;
  background: var(--navy-700); color: var(--text);
  box-shadow: 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink);
  margin: 2px;
  white-space: nowrap;
}
.badge-owner { background: var(--yellow); color: var(--ink); }
.badge-host { background: #5ce1e6; color: var(--ink); }
.badge-member { background: var(--cream); color: var(--ink); }
.badge-guest { background: #b8b8c8; color: var(--ink); }
.badge-online { background: var(--mint); color: var(--ink); }
.count-badge {
  position: absolute; top: -8px; right: -8px;
  min-width: 18px; height: 18px; padding: 0 4px;
  display: grid; place-items: center;
  background: var(--red); color: #fff;
  font-family: var(--font-small); font-size: 10px; line-height: 1;
  box-shadow: 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink);
  pointer-events: none;
  animation: pp-pop .25s steps(3);
}

.portrait { display: block; background: var(--sky); image-rendering: pixelated; flex: none; object-fit: cover; }
.portrait-frame { padding: 3px; background: var(--cream); box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink); margin: 3px; flex: none; }

/* ---------- 토스트 ---------- */
.toasts {
  position: fixed; z-index: 2000;
  left: 50%; transform: translateX(-50%);
  top: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  pointer-events: none;
  width: min(92vw, 460px);
}
.page-space .toasts { top: auto; bottom: calc(112px + var(--safe-b)); }
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  max-width: 100%;
  padding: 9px 14px;
  margin: 4px;
  background: var(--navy-900);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  box-shadow:
    0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink),
    inset 0 0 0 2px var(--navy-900), inset 0 0 0 4px var(--line),
    5px 5px 0 0 var(--shadow);
  animation: pp-toast-in .22s steps(4);
}
.toast-text { white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; }
.toast-success { box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), inset 0 0 0 2px var(--navy-900), inset 0 0 0 4px var(--mint), 5px 5px 0 0 var(--shadow); }
.toast-warn { box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), inset 0 0 0 2px var(--navy-900), inset 0 0 0 4px var(--yellow), 5px 5px 0 0 var(--shadow); }
.toast-error { box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), inset 0 0 0 2px var(--navy-900), inset 0 0 0 4px var(--red), 5px 5px 0 0 var(--shadow); }
.toast-icon { font-size: 16px; }
.toast-out { animation: pp-toast-out .2s steps(3) forwards; }

/* ---------- 모달 ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
  padding: 24px;
  background-color: rgba(15, 16, 41, .62);
  background-image: radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 6px 6px;
  animation: pp-fade .15s steps(3);
  overflow: auto;
}
.modal {
  position: relative;
  display: flex; flex-direction: column;
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  margin: var(--px);
  background: var(--navy-900);
  color: var(--text);
  box-shadow:
    0 calc(-1 * var(--px)) 0 0 var(--ink), 0 var(--px) 0 0 var(--ink),
    calc(-1 * var(--px)) 0 0 0 var(--ink), var(--px) 0 0 0 var(--ink),
    inset 0 0 0 3px var(--navy-900), inset 0 0 0 5px var(--line),
    10px 10px 0 0 var(--shadow);
  animation: pp-modal-in .2s steps(4);
}
.modal-sm { width: min(420px, 100%); }
.modal-lg { width: min(860px, 100%); }
.modal-full { width: calc(100vw - 48px); height: calc(100vh - 48px); height: calc(100dvh - 48px); max-height: none; }
.modal-out { animation: pp-fade-out .16s steps(3) forwards; }
.modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 12px 20px;
  border-bottom: 3px solid var(--ink);
  background: linear-gradient(var(--navy-800), var(--navy-800)) padding-box;
  margin: 5px 5px 0;
}
.modal-icon { font-size: 22px; }
.modal-title { flex: 1; margin: 0; font-family: var(--font-title); font-size: 18px; font-weight: 400; letter-spacing: .5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-close { font-size: 18px; }
.modal-body { padding: 18px 20px; overflow: auto; flex: 1 1 auto; min-height: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 4px 18px 18px; }
.modal-body .modal-foot { padding: 8px 0 0; }
.confirm-text { margin: 0; white-space: pre-wrap; line-height: 1.7; }

/* ==========================================================================
   랜딩 (타이틀 화면)
   ========================================================================== */
.page-landing { min-height: 100vh; min-height: 100dvh; overflow-x: hidden; background: #2a2a6a; }
#sky {
  position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh;
  z-index: 0; image-rendering: pixelated; display: block;
}
.title-wrap {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center;
  padding: 7vh 16px 120px;
}
.title { text-align: center; margin-bottom: 26px; }
.logo { display: inline-flex; flex-direction: column; align-items: center; animation: pp-float 3.2s steps(8) infinite; }
.logo-ko {
  font-family: var(--font-title);
  font-size: clamp(48px, 11vw, 96px);
  line-height: 1.05;
  color: var(--yellow);
  letter-spacing: 4px;
  text-shadow:
    4px 0 0 var(--ink), -4px 0 0 var(--ink), 0 4px 0 var(--ink), 0 -4px 0 var(--ink),
    4px 4px 0 var(--ink), -4px 4px 0 var(--ink), 4px -4px 0 var(--ink), -4px -4px 0 var(--ink),
    8px 8px 0 var(--pink-d), 10px 10px 0 var(--ink), 12px 12px 0 var(--pink-d), 14px 14px 0 var(--ink);
}
.logo-en {
  margin-top: 14px;
  font-family: var(--font-title);
  font-size: clamp(14px, 3vw, 20px);
  letter-spacing: 10px;
  color: var(--cream);
  text-shadow: 3px 3px 0 var(--ink);
  padding-left: 10px;
}
.tagline {
  display: table; margin: 18px auto 0; padding: 4px 12px;
  color: var(--cream); font-size: 15px; text-shadow: 2px 2px 0 var(--ink);
  background: rgba(21, 22, 66, .55);
  word-break: keep-all;
}
@media (max-width: 480px) { .tagline { font-size: 13px; } }
.ai-badge {
  display: table; margin: 8px auto 0; padding: 3px 10px;
  color: var(--cream); font-family: var(--font-small); font-size: 12px; text-shadow: 1px 1px 0 var(--ink);
  background: rgba(21, 22, 66, .55); word-break: keep-all;
}
.ai-badge b { color: var(--yellow); font-weight: inherit; }
.is-home .title { margin-bottom: 18px; }
.is-home .logo-ko { font-size: clamp(40px, 7vw, 64px); text-shadow:
    3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink),
    3px 3px 0 var(--ink), -3px 3px 0 var(--ink), 3px -3px 0 var(--ink), -3px -3px 0 var(--ink),
    6px 6px 0 var(--pink-d), 8px 8px 0 var(--ink); }
.is-home .logo-en { margin-top: 8px; font-size: 14px; }
.is-home .tagline { display: none; }
.press-start {
  font-family: var(--font-title); font-size: 18px; letter-spacing: 3px;
  color: var(--cream); text-shadow: 3px 3px 0 var(--ink);
  animation: pp-blink 1.1s steps(1) infinite;
  margin: 6px 0 18px; text-align: center;
}
.screen { width: min(980px, 100%); display: flex; flex-direction: column; align-items: center; gap: 18px; }
.start-panel { width: min(440px, 100%); text-align: center; padding: 22px 24px 20px; }
.start-panel .btn-big { width: calc(100% - 8px); }
.start-panel .divider { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--text-dim); font-family: var(--font-small); font-size: 11px; }
.start-panel .divider::before, .start-panel .divider::after { content: ''; flex: 1; height: 3px; background: repeating-linear-gradient(90deg, var(--navy-600) 0 6px, transparent 6px 10px); }
.guest-form { display: flex; gap: 8px; align-items: stretch; margin-top: 10px; }
.gsi-slot { display: flex; justify-content: center; min-height: 44px; align-items: center; }
.guest-form .input { flex: 1; }
.g-logo {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; background: #fff; color: #4285f4;
  font-family: var(--font-title); font-size: 15px;
  box-shadow: 0 0 0 2px var(--ink);
}
.notice {
  margin: 12px 0 0; padding: 10px 12px;
  background: rgba(255, 217, 102, .12); color: var(--yellow);
  font-size: 13px; text-align: left; line-height: 1.6;
  box-shadow: inset 0 0 0 2px rgba(255, 217, 102, .5);
}
.notice a { color: var(--yellow); }

.home-grid { display: grid; grid-template-columns: 300px 1fr; gap: 26px; width: 100%; align-items: start; }
.char-card { text-align: center; }
.char-card .portrait-frame { display: inline-block; margin: 4px auto 12px; background: linear-gradient(#bfe7ff, #e6f6ff); }
.char-name { font-family: var(--font-title); font-size: 20px; margin: 0; word-break: break-all; }
.char-meta { margin: 6px 0 14px; display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; }
.char-card .btn { width: calc(100% - 6px); }
.slots-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.continue-box:empty { display: none; }
.continue-box { margin: 0 0 16px; }
.continue-btn { width: calc(100% - 8px); justify-content: flex-start; gap: 12px; font-family: var(--font-title); font-weight: 400; letter-spacing: 1px; }
.continue-btn .continue-name { font-family: var(--font); font-weight: 700; font-size: 15px; letter-spacing: 0; flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; }
.continue-btn .badge { font-family: var(--font-small); letter-spacing: 0; }
.blink { animation: pp-blink 1s steps(1) infinite; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.slot {
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
  min-height: 150px;
  padding: 14px 14px 12px;
  margin: var(--px);
  text-align: left;
  border: 0;
  background: var(--navy-800);
  color: var(--text);
  cursor: pointer;
  box-shadow:
    0 calc(-1 * var(--px)) 0 0 var(--ink), 0 var(--px) 0 0 var(--ink),
    calc(-1 * var(--px)) 0 0 0 var(--ink), var(--px) 0 0 0 var(--ink),
    inset 0 0 0 3px var(--navy-800), inset 0 0 0 5px var(--navy-600),
    6px 6px 0 0 var(--shadow);
  transition: transform .08s steps(2);
}
.slot:hover { transform: translate(-2px, -2px); box-shadow: 0 calc(-1 * var(--px)) 0 0 var(--ink), 0 var(--px) 0 0 var(--ink), calc(-1 * var(--px)) 0 0 0 var(--ink), var(--px) 0 0 0 var(--ink), inset 0 0 0 3px var(--navy-800), inset 0 0 0 5px var(--yellow), 8px 8px 0 0 var(--shadow); }
.slot:active { transform: translate(1px, 1px); }
.slot-no { font-family: var(--font-small); font-size: 10px; color: var(--yellow); letter-spacing: 2px; }
.slot-emoji { position: absolute; right: 14px; top: 10px; font-size: 34px; filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, .35)); }
.slot-name { font-family: var(--font-title); font-size: 17px; margin: 2px 50px 0 0; word-break: break-all; line-height: 1.3; }
.slot-desc { margin: 0; color: var(--text-dim); font-size: 12px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.slot-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.slot-online { color: var(--mint); font-family: var(--font-small); font-size: 11px; }
.slot-online.zero { color: var(--text-dim); }
.slot-new { align-items: center; justify-content: center; text-align: center; background: rgba(40, 43, 92, .55); color: var(--yellow); }
.slot-new .plus { font-family: var(--font-title); font-size: 38px; line-height: 1; }
.slot-new[aria-disabled='true'] { cursor: not-allowed; color: var(--text-dim); }
.slot-empty { grid-column: 1 / -1; text-align: center; padding: 26px 10px; color: var(--text-dim); }
.invite-row { display: flex; gap: 8px; margin-top: 18px; align-items: center; flex-wrap: wrap; }
.invite-row .input { flex: 1; min-width: 160px; }
.invite-row-top { margin: 0 0 16px; }
.start-panel .invite-row { margin-top: 0; }
.creator-note { grid-column: 1 / -1; margin: 0; }
.invite-card { width: min(520px, 100%); text-align: center; }
.invite-card .big-emoji { font-size: 56px; margin: 4px 0 6px; filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, .35)); animation: pp-float 2.4s steps(6) infinite; }
.invite-card h2 { font-family: var(--font-title); font-weight: 400; font-size: 24px; margin: 4px 0 6px; word-break: break-all; }
.invite-card .desc { color: var(--text-dim); margin: 0 0 14px; white-space: pre-wrap; }
.ribbon {
  display: inline-block; padding: 4px 14px; margin-bottom: 10px;
  background: var(--pink); color: var(--ink); font-weight: 700;
  box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink);
}
.credits {
  position: relative; z-index: 1; margin-top: 26px; padding: 3px 10px;
  color: rgba(255, 246, 227, .85); background: rgba(21, 22, 66, .6);
  font-family: var(--font-small); font-size: 11px; text-align: center; text-shadow: 1px 1px 0 var(--ink);
  word-break: keep-all;
}
.loading-text { font-family: var(--font-title); font-size: 18px; letter-spacing: 3px; color: var(--cream); text-shadow: 3px 3px 0 var(--ink); }
.loading-text::after { content: '...'; display: inline-block; width: 2em; text-align: left; animation: pp-dots 1.2s steps(4) infinite; overflow: hidden; vertical-align: bottom; }

/* 템플릿 카드 (공간 만들기) */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 4px 0 18px; }
.tpl-card { position: relative; display: block; cursor: pointer; }
.tpl-card input { position: absolute; opacity: 0; pointer-events: none; }
.tpl-card .tpl-inner {
  display: flex; flex-direction: column; gap: 4px; height: 100%;
  padding: 12px;
  margin: 3px;
  background: var(--navy-800);
  box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), inset 0 0 0 3px var(--navy-600);
  transition: transform .08s steps(2);
}
.tpl-card:hover .tpl-inner { transform: translateY(-2px); }
.tpl-card input:checked + .tpl-inner { background: var(--navy-700); box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), inset 0 0 0 3px var(--yellow); }
.tpl-card input:checked + .tpl-inner::after {
  content: '선택!'; position: absolute; top: 9px; right: 10px; padding: 1px 6px;
  background: var(--yellow); color: var(--ink); font-family: var(--font-small); font-size: 10px;
  box-shadow: 0 0 0 2px var(--ink);
}
.tpl-card input:focus-visible + .tpl-inner { outline: 3px solid var(--yellow); outline-offset: 5px; }
.tpl-emoji { font-size: 30px; }
.tpl-name { font-weight: 700; font-size: 15px; }
.tpl-desc { font-size: 12px; color: var(--text-dim); line-height: 1.5; }

/* ==========================================================================
   공간 화면 (게임 + HUD)
   ========================================================================== */
.page-space { position: fixed; inset: 0; overflow: hidden; background: #1b1c3a; touch-action: none; }
.page-space .stage { position: absolute; inset: 0; bottom: var(--dock-h); }
#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; image-rendering: pixelated; touch-action: none; }
#game-canvas:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--yellow); }
.fx-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; pointer-events: none; z-index: 600; image-rendering: pixelated; }
.hud { position: fixed; inset: 0; pointer-events: none; z-index: 100; }
.hud > * { pointer-events: auto; }
.hud-tl {
  position: absolute; left: 14px; top: 14px;
  display: flex; flex-direction: column; gap: 4px;
  max-width: min(360px, calc(100vw - 260px));
  padding: 10px 14px 10px 12px;
}
.hud-space { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hud-space .tpl { font-size: 22px; flex: none; }
.hud-space-name { font-family: var(--font-title); font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); }
.hud-zone { color: var(--yellow); white-space: nowrap; }
.hud-online { color: var(--mint); white-space: nowrap; }
.hud-ping { font-family: var(--font-small); font-size: 10px; color: var(--text-dim); }
.hud-ping.bad { color: var(--red); }
.hud-tr { position: absolute; right: 14px; top: 14px; display: flex; gap: 4px; align-items: center; }
.hud-tr .btn { min-height: 36px; }

/* 하단 독 */
.dock {
  position: absolute; left: 50%; bottom: calc(14px + var(--safe-b));
  transform: translateX(-50%);
  display: flex; align-items: flex-end; gap: 4px;
  padding: 8px 10px;
  max-width: calc(100vw - 24px);
}
.dock-sep { width: 3px; align-self: stretch; margin: 6px 4px; background: repeating-linear-gradient(var(--navy-600) 0 4px, transparent 4px 8px); flex: none; }
.dock-btn {
  --bg: var(--navy-700);
  --fg: var(--text);
  position: relative;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: 58px; height: 58px;
  margin: 3px;
  padding: 0;
  border: 0;
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
  box-shadow:
    0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink),
    inset 0 -4px 0 0 rgba(0, 0, 0, .3), inset 0 3px 0 0 rgba(255, 255, 255, .14);
  transition: transform .06s steps(2);
  flex: none;
}
.dock-btn .ico { font-size: 22px; line-height: 1; filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, .35)); }
.dock-btn .lbl { font-family: var(--font-small); font-size: 10px; line-height: 1; white-space: nowrap; }
.dock-btn:hover { transform: translateY(-3px); --bg: var(--navy-600); }
.dock-btn:active { transform: translateY(1px); box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), inset 0 4px 0 0 rgba(0, 0, 0, .3); }
.dock-btn[aria-pressed='true'] { --bg: var(--mint); --fg: var(--ink); }
.dock-btn.is-off { --bg: #4a2f52; --fg: #e9c9de; }
.dock-btn.is-off .ico { opacity: .55; filter: grayscale(.6); }
.dock-btn.is-off::after {
  content: '';
  position: absolute; right: 7px; top: 7px; width: 12px; height: 12px;
  background:
    linear-gradient(45deg, transparent 42%, #fff 42% 58%, transparent 58%),
    linear-gradient(-45deg, transparent 42%, #fff 42% 58%, transparent 58%),
    var(--red);
  box-shadow: 0 0 0 2px var(--ink);
}
.dock-btn.is-open { --bg: var(--yellow); --fg: var(--ink); }
.dock-btn[data-tip]:hover::before, .dock-btn[data-tip]:focus-visible::before {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 14px); left: 50%; transform: translateX(-50%);
  padding: 6px 10px;
  background: var(--cream); color: var(--ink);
  font-family: var(--font); font-size: 12px; white-space: pre; text-align: center; line-height: 1.45;
  box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), 4px 4px 0 3px var(--shadow);
  pointer-events: none; z-index: 5;
  animation: pp-fade .12s steps(2);
}

/* 팝오버 (이모트/축하) */
.popover {
  position: fixed; z-index: 300;
  width: min(340px, calc(100vw - 24px));
  animation: pp-pop .16s steps(3);
}
.popover .panel-title { font-size: 15px; margin-bottom: 10px; }
.emote-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.emote-btn {
  position: relative;
  display: grid; place-items: center;
  aspect-ratio: 1; min-width: 32px;
  border: 0; background: var(--navy-800); cursor: pointer;
  font-size: 22px; line-height: 1;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .3);
}
.emote-btn:hover { background: var(--navy-600); transform: translateY(-2px); }
.emote-btn:active { transform: translateY(1px); }
.emote-btn .num { position: absolute; left: 2px; top: 1px; font-family: var(--font-small); font-size: 9px; color: var(--yellow); }
.celebrate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; margin-bottom: 10px; }
.celebrate-grid .btn { width: calc(100% - 6px); font-size: 13px; padding: 6px 4px; }
.pop-note { font-size: 12px; color: var(--text-dim); margin: 8px 0 0; line-height: 1.55; }
.pop-note.warn { color: var(--yellow); }

/* 비디오 스트립 */
.video-strip {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 10px; align-items: flex-start;
  max-width: calc(100vw - 760px);
  min-width: 0;
  overflow-x: auto; overflow-y: hidden;
  padding: 6px 6px 10px;
}
.video-strip:empty { display: none; }
.vtile {
  position: relative; flex: none;
  width: 136px; height: 102px;
  margin: 3px;
  background: var(--navy-800);
  cursor: pointer;
  box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), 4px 4px 0 2px var(--shadow);
  overflow: hidden;
  transition: box-shadow .1s;
}
.vtile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.vtile.self video { transform: scaleX(-1); }
.vtile.screen video { object-fit: contain; }
.vtile .vt-portrait { position: absolute; inset: 0; display: grid; place-items: center; background: repeating-linear-gradient(45deg, var(--navy-800) 0 6px, var(--navy-700) 6px 12px); }
.vtile .vt-portrait img { width: 64px; height: 64px; box-shadow: 0 0 0 3px var(--ink); }
.vtile .vt-name {
  position: absolute; left: 4px; bottom: 4px; max-width: calc(100% - 8px);
  padding: 1px 6px; background: rgba(15, 16, 41, .78); color: var(--text);
  font-family: var(--font-small); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vtile .vt-icons { position: absolute; right: 4px; top: 4px; display: flex; gap: 2px; }
.vtile .vt-icons span { display: grid; place-items: center; width: 20px; height: 20px; background: rgba(15, 16, 41, .78); font-size: 12px; }
.vtile.speaking { box-shadow: 0 -3px 0 0 var(--mint), 0 3px 0 0 var(--mint), -3px 0 0 0 var(--mint), 3px 0 0 0 var(--mint), 0 0 0 6px rgba(126, 224, 181, .35), 4px 4px 0 2px var(--shadow); }
.vtile .vt-state { position: absolute; left: 4px; top: 4px; font-family: var(--font-small); font-size: 10px; padding: 1px 4px; background: rgba(15, 16, 41, .78); color: var(--yellow); }
.vstage {
  position: fixed; z-index: 400; inset: 72px 24px 110px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 16, 41, .9);
  box-shadow: 0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink), -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink), inset 0 0 0 3px var(--line);
}
.vstage video { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; background: #000; }
.vstage .vstage-bar { position: absolute; left: 10px; top: 10px; right: 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px; pointer-events: none; }
.vstage .vstage-bar > * { pointer-events: auto; }
.vstage .vt-name { position: static; font-size: 13px; padding: 4px 10px; background: rgba(15, 16, 41, .85); }

/* 사이드 패널 */
.side-panel {
  position: absolute; z-index: 150;
  top: 78px; right: 14px; bottom: calc(186px + var(--safe-b));
  width: 340px;
  display: flex; flex-direction: column;
  padding: 0;
  margin: var(--px);
  animation: pp-slide-in .18s steps(4);
}
.side-panel.left { right: auto; left: 14px; top: 100px; bottom: calc(108px + var(--safe-b)); }
@media (max-height: 720px) { .side-panel { bottom: calc(108px + var(--safe-b)); } }
.side-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px 16px; }
.side-head h2 { flex: 1; margin: 0; font-family: var(--font-title); font-size: 16px; font-weight: 400; }
.tabs { display: flex; gap: 0; padding: 0 12px; border-bottom: 3px solid var(--ink); }
.tab {
  position: relative;
  flex: 1;
  padding: 7px 4px 6px;
  border: 0; background: transparent; color: var(--text-dim);
  font-family: var(--font); font-size: 13px; font-weight: 700; cursor: pointer;
}
.tab:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.tab[aria-selected='true'] { color: var(--ink); background: var(--yellow); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .45); }
.tab .count-badge { top: -4px; right: 2px; }
.side-body { flex: 1 1 auto; overflow-y: auto; padding: 10px 12px; min-height: 0; overscroll-behavior: contain; }
.side-foot { padding: 8px 12px 14px; border-top: 3px solid var(--ink); }

/* 채팅 */
.chat-list { display: flex; flex-direction: column; gap: 10px; }
.chat-empty { text-align: center; color: var(--text-dim); padding: 36px 8px; font-size: 13px; line-height: 1.8; }
.chat-empty .big { font-size: 34px; display: block; margin-bottom: 6px; }
.msg { display: flex; gap: 8px; align-items: flex-start; animation: pp-pop .18s steps(3); }
.msg .portrait { width: 32px; height: 32px; box-shadow: 0 0 0 2px var(--ink); margin: 2px; }
.msg-main { min-width: 0; flex: 1; }
.msg-head { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.msg-name { font-weight: 700; font-size: 13px; color: var(--cream); cursor: pointer; overflow: hidden; text-overflow: ellipsis; max-width: 160px; white-space: nowrap; }
.msg-name:hover { text-decoration: underline; }
.msg-time { font-family: var(--font-small); font-size: 10px; color: var(--text-dim); }
.msg-scope { font-family: var(--font-small); font-size: 10px; padding: 0 4px; background: var(--navy-600); color: var(--text); }
.msg-scope.nearby { background: var(--mint-d); }
.msg-scope.zone { background: var(--lavender-d); }
.msg-scope.dm { background: var(--pink-d); }
.msg-text {
  margin-top: 3px; padding: 7px 10px;
  background: var(--navy-800); color: var(--text);
  white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word;
  font-size: 14px; line-height: 1.55;
  box-shadow: 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink);
  margin-left: 2px; margin-right: 2px;
}
.msg.mine .msg-text { background: #3c3f86; }
.msg.pending .msg-text { opacity: .65; }
.msg.mention .msg-text { box-shadow: 0 -2px 0 0 var(--yellow), 0 2px 0 0 var(--yellow), -2px 0 0 0 var(--yellow), 2px 0 0 0 var(--yellow); background: #3d3a5e; }
.msg.system { justify-content: center; }
.msg.system .msg-text { background: transparent; box-shadow: none; color: var(--text-dim); font-size: 12px; text-align: center; padding: 2px; }
.chat-form { display: flex; gap: 6px; align-items: flex-end; }
.chat-form textarea {
  flex: 1; min-height: 40px; max-height: 120px; resize: none; padding: 9px 10px;
  font-size: 14px; line-height: 1.4;
}
.chat-meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 12px; color: var(--text-dim); }
.chat-meta select { max-width: 60%; }
.dm-to { display: flex; align-items: center; gap: 6px; }
.select {
  width: auto; padding: 4px 8px; font-size: 13px; min-height: 30px;
  appearance: none; -webkit-appearance: none;
  padding-right: 24px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 13px) 55%, calc(100% - 8px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* 참여자 */
.people-section { margin-bottom: 14px; }
.people-section h3 { margin: 4px 0 8px; font-family: var(--font-small); font-size: 11px; color: var(--yellow); letter-spacing: 1px; font-weight: 400; }
.person {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 6px;
  margin-bottom: 4px;
  cursor: pointer;
}
.person:hover, .person:focus-visible { background: rgba(255, 255, 255, .06); }
.person.offline { opacity: .55; }
.person .portrait { width: 36px; height: 36px; box-shadow: 0 0 0 2px var(--ink); margin: 2px; }
.person-main { flex: 1; min-width: 0; }
.person-name { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.person-sub { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 11px; color: var(--text-dim); }
.person-status { display: flex; gap: 2px; font-size: 13px; }
.status-dot { display: inline-block; width: 8px; height: 8px; background: var(--mint); box-shadow: 0 0 0 2px var(--ink); margin-right: 2px; }
.status-dot.away { background: var(--yellow); }
.status-dot.off { background: #777a99; }
.person-actions { display: flex; gap: 2px; }
.person-actions .btn-icon { width: 28px; height: 28px; font-size: 14px; }

/* 플레이어 컨텍스트 카드 */
.ctx-card {
  position: fixed; z-index: 350;
  width: 240px;
  padding: 14px;
  animation: pp-pop .16s steps(3);
}
.ctx-top { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.ctx-top .portrait { width: 56px; height: 56px; box-shadow: 0 0 0 3px var(--ink); margin: 3px; }
.ctx-name { font-family: var(--font-title); font-size: 16px; word-break: break-all; line-height: 1.3; }
.ctx-actions { display: flex; flex-direction: column; gap: 2px; }
.ctx-actions .btn { width: calc(100% - 6px); justify-content: flex-start; }

/* 공지 배너 */
.announce {
  position: fixed; z-index: 500;
  top: 18px; left: 50%; transform: translateX(-50%);
  width: min(720px, calc(100vw - 32px));
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 18px 14px 16px;
  background: var(--yellow); color: var(--ink);
  box-shadow:
    0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink), -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink),
    inset 0 0 0 3px var(--yellow), inset 0 0 0 5px var(--peach-d),
    8px 8px 0 0 var(--shadow);
  animation: pp-drop .35s steps(6);
}
.announce .mega { font-size: 34px; line-height: 1; animation: pp-wiggle .6s steps(2) 3; }
.announce .ann-main { flex: 1; min-width: 0; }
.announce .ann-from { font-family: var(--font-small); font-size: 11px; opacity: .8; }
.announce .ann-text { font-family: var(--font-title); font-size: 20px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.announce .btn-icon { color: var(--ink); }
.announce-out { animation: pp-fade-out .25s steps(3) forwards; }
body:has(.video-strip .vtile) .announce { top: 138px; }

/* 축하 메시지 배너 */
.celebrate-banner {
  position: fixed; z-index: 650;
  bottom: calc(122px + var(--safe-b)); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  max-width: min(640px, calc(100vw - 32px));
  padding: 12px 20px;
  background: var(--pink); color: var(--ink);
  box-shadow:
    0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink), -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink),
    inset 0 0 0 3px var(--pink), inset 0 0 0 5px #fff1f5,
    8px 8px 0 0 var(--shadow);
  pointer-events: none;
  animation: pp-rise .35s steps(6);
}
.has-celebrate-banner .page-space .toasts, .page-space.has-celebrate-banner .toasts { bottom: calc(214px + var(--safe-b)); }
.celebrate-banner .ico { font-size: 30px; animation: pp-wiggle .5s steps(2) 4; }
.celebrate-banner .cb-main { display: flex; flex-direction: column; min-width: 0; }
.celebrate-banner .cb-from { font-family: var(--font-small); font-size: 11px; }
.celebrate-banner .cb-msg { font-family: var(--font-title); font-size: 20px; line-height: 1.4; overflow-wrap: anywhere; }
.celebrate-banner.out { animation: pp-fade-out .3s steps(3) forwards; }

/* 오버레이 (로딩/재접속/강퇴) */
.overlay {
  position: fixed; inset: 0; z-index: 3000;
  display: grid; place-items: center;
  background: rgba(15, 16, 41, .82);
  padding: 20px;
  animation: pp-fade .2s steps(3);
}
.overlay.soft { background: rgba(15, 16, 41, .5); }
.overlay .panel { width: min(420px, 100%); text-align: center; }
.overlay .big-emoji { font-size: 48px; margin-bottom: 6px; }
.overlay h2 { font-family: var(--font-title); font-weight: 400; font-size: 20px; margin: 0 0 8px; }
.overlay p { color: var(--text-dim); margin: 0 0 14px; white-space: pre-wrap; }
.pbar {
  height: 18px; margin: 10px 3px 4px;
  background: var(--navy-950);
  box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink);
  position: relative; overflow: hidden;
}
.pbar > i {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0%;
  background: repeating-linear-gradient(90deg, var(--mint) 0 10px, var(--mint-d) 10px 12px);
  transition: width .2s steps(4);
}
.pbar.indeterminate > i { width: 30%; animation: pp-indet 1.2s steps(10) infinite; }
.pbar.warn > i { background: repeating-linear-gradient(90deg, var(--yellow) 0 10px, var(--yellow-d) 10px 12px); }
.pbar.danger > i { background: repeating-linear-gradient(90deg, var(--red) 0 10px, var(--red-d) 10px 12px); }

/* ==========================================================================
   게시판 (Padlet 느낌의 코르크보드)
   ========================================================================== */
.board-modal .modal-body { padding: 0; display: flex; flex-direction: column; }
.board-modal { background: #3a2a1f; }
.board-toolbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; flex-wrap: wrap; background: var(--navy-800); margin: 0 5px; border-bottom: 3px solid var(--ink); }
.board-toolbar .desc { flex: 1; color: var(--text-dim); font-size: 12px; min-width: 120px; }
.cork {
  flex: 1 1 auto; min-height: 0; overflow: auto;
  margin: 0 5px 5px;
  padding: 22px 18px 40px;
  background-color: #c99a62;
  background-image:
    radial-gradient(#b4844f 1.5px, transparent 1.6px),
    radial-gradient(#ddb07a 1.2px, transparent 1.3px),
    radial-gradient(#a8783f 1px, transparent 1.1px);
  background-size: 14px 14px, 22px 22px, 9px 9px;
  background-position: 0 0, 7px 11px, 3px 5px;
  box-shadow: inset 0 0 0 6px #8a5a2b, inset 0 0 0 9px #5e3b1a;
}
.masonry { display: flex; gap: 22px; align-items: flex-start; }
.mcol { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.mcol .card { margin-bottom: 22px; }
.columns { display: flex; gap: 20px; align-items: flex-start; min-height: 100%; }
.col {
  flex: 0 0 270px;
  display: flex; flex-direction: column; gap: 14px;
  padding: 10px 10px 16px;
  background: rgba(94, 59, 26, .35);
  box-shadow: inset 0 0 0 3px rgba(94, 59, 26, .6);
  min-height: 200px;
}
.col.drop-on { box-shadow: inset 0 0 0 3px var(--yellow); background: rgba(255, 217, 102, .18); }
.card.dragging { opacity: .5; }
.card[draggable='true'] { cursor: grab; }
.col-head {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 6px 10px;
  background: var(--navy-900); color: var(--cream);
  font-family: var(--font-title); font-size: 15px;
  box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink);
  margin: 3px;
}
.col-head .n { font-family: var(--font-small); font-size: 11px; color: var(--yellow); }
.board-empty { text-align: center; color: #3a2a1f; padding: 60px 20px; font-size: 15px; line-height: 1.8; }
.board-empty .big { font-size: 48px; display: block; }
.card {
  position: relative;
  margin: 3px 3px 22px;
  padding: 18px 14px 10px;
  background: var(--c, #fff7c2);
  color: var(--text-dark);
  box-shadow:
    0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink),
    inset 0 -6px 0 0 rgba(0, 0, 0, .06),
    6px 7px 0 2px rgba(58, 34, 12, .45);
  transform: rotate(var(--rot, 0deg));
  transition: transform .12s steps(3);
}
.columns .card { margin-bottom: 4px; }
.card:hover { transform: rotate(0deg) translateY(-2px); z-index: 2; }
.card.pop { animation: pp-card-pop .38s steps(5); }
.card.flash { animation: pp-flash .6s steps(3); }
.card::before {
  /* 픽셀 압정 */
  content: ''; position: absolute; top: -7px; left: 50%; width: 12px; height: 12px; margin-left: -6px;
  background: var(--pin, var(--red));
  box-shadow: 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink), inset 3px 3px 0 0 rgba(255, 255, 255, .55);
}
.card-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.card-head .portrait { width: 24px; height: 24px; box-shadow: 0 0 0 2px var(--ink); margin: 2px; }
.card-author { font-weight: 700; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.card-time { font-family: var(--font-small); font-size: 10px; color: #7b6f90; white-space: nowrap; }
.card-title { margin: 0 0 6px; font-family: var(--font-title); font-weight: 400; font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.card-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; font-size: 14px; line-height: 1.6; }
.card-link {
  display: flex; align-items: center; gap: 6px; margin-top: 10px; padding: 6px 8px;
  background: rgba(255, 255, 255, .6); color: var(--sky-d); text-decoration: none; font-size: 12px;
  box-shadow: 0 0 0 2px rgba(25, 26, 51, .5);
  overflow: hidden;
}
.card-link .host { flex: 0 1 auto; max-width: 70%; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-link .path { flex: 1 1 0; }
.card-link .path { color: #6c6a88; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.card-link:hover { background: #fff; }
.card-img { display: block; width: 100%; margin-top: 10px; max-height: 260px; object-fit: cover; box-shadow: 0 0 0 2px var(--ink); cursor: zoom-in; background: #eee; }
.file-chip {
  display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 6px 8px;
  background: rgba(255, 255, 255, .65); color: var(--ink); text-decoration: none; font-size: 12px;
  box-shadow: 0 0 0 2px rgba(25, 26, 51, .5);
}
.file-chip .ico { font-size: 18px; }
.file-chip .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.file-chip .sz { font-family: var(--font-small); font-size: 10px; color: #6c6a88; }
.card-foot { display: flex; align-items: center; gap: 4px; margin-top: 10px; padding-top: 8px; border-top: 2px dashed rgba(25, 26, 51, .2); }
.card-foot .sp { flex: 1; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 26px; padding: 2px 8px;
  border: 0; background: rgba(255, 255, 255, .55); color: var(--ink);
  font-family: var(--font); font-size: 12px; font-weight: 700; cursor: pointer;
  box-shadow: 0 0 0 2px rgba(25, 26, 51, .45);
  margin: 2px;
}
.chip-btn:hover { background: #fff; }
.chip-btn:active { transform: translateY(1px); }
.chip-btn.liked { background: var(--pink); }
.chip-btn.liked .heart { animation: pp-heart .4s steps(4); display: inline-block; }
.comments { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.comment { font-size: 12px; line-height: 1.5; padding: 5px 7px; background: rgba(255, 255, 255, .55); overflow-wrap: anywhere; white-space: pre-wrap; }
.comment b { margin-right: 4px; }
.comment .t { font-family: var(--font-small); font-size: 10px; color: #7b6f90; margin-left: 4px; }
.comment { position: relative; }
.comment-del { position: absolute; right: 2px; top: 2px; width: 18px; height: 18px; padding: 0; border: 0; background: transparent; color: #7b6f90; font-size: 11px; cursor: pointer; opacity: 0; }
.comment:hover .comment-del, .comment-del:focus-visible { opacity: 1; }
.comment-del:hover { color: var(--red-d); }
@media (hover: none) { .comment-del { opacity: .7; } }
.comment-form { display: flex; gap: 4px; margin-top: 4px; }
.comment-form .input { font-size: 12px; padding: 6px 8px; margin: 2px; width: auto; flex: 1; min-width: 0; box-shadow: 0 0 0 2px var(--ink); }
.comment-form .btn { min-height: 28px; padding: 2px 10px; font-size: 12px; --bw: 2px; }

.board-list { display: flex; flex-direction: column; gap: 12px; }
.board-item {
  display: flex; align-items: center; gap: 12px;
  width: calc(100% - 6px);
  padding: 12px 14px; margin: 3px;
  border: 0; text-align: left; cursor: pointer;
  background: var(--navy-800); color: var(--text);
  box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), inset 0 0 0 3px var(--navy-700);
}
.board-item:hover { background: var(--navy-700); transform: translateX(2px); }
.board-item .ico { font-size: 26px; }
.board-item .nm { font-weight: 700; font-size: 15px; display: block; }
.board-item .meta { font-size: 12px; color: var(--text-dim); }
.board-item .go { margin-left: auto; color: var(--yellow); font-family: var(--font-title); }

/* 글쓰기 */
.swatches { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch span { display: block; width: 30px; height: 30px; margin: 3px; background: var(--c); box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink); }
.swatch input:checked + span { transform: translateY(-3px); box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), 0 0 0 6px var(--yellow); }
.swatch input:checked + span::after { content: '✔'; display: grid; place-items: center; height: 100%; color: var(--ink); font-size: 14px; }
.swatch input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: 6px; }
.attach-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.attach-box .nm { font-size: 12px; color: var(--text-dim); word-break: break-all; }
.compose-preview { margin: 0 0 14px; }

/* ==========================================================================
   자료실
   ========================================================================== */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 22px 14px;
  margin: 3px 3px 16px;
  text-align: center;
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .03) 0 8px, transparent 8px 16px), var(--navy-800);
  outline: 3px dashed var(--line);
  outline-offset: -8px;
  cursor: pointer;
  transition: background .1s;
}
.dropzone:hover, .dropzone.drag { background: repeating-linear-gradient(45deg, rgba(255, 217, 102, .12) 0 8px, transparent 8px 16px), var(--navy-700); outline-color: var(--yellow); }
.dropzone .big { font-size: 36px; animation: pp-float 2.4s steps(6) infinite; }
.dropzone .t { font-weight: 700; }
.dropzone .s { font-size: 12px; color: var(--text-dim); }
.quota { margin: 0 0 14px; }
.quota .row { justify-content: space-between; font-size: 12px; color: var(--text-dim); }
.uploads { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.upload-item { padding: 8px 10px; background: var(--navy-800); font-size: 13px; }
.upload-item .row { justify-content: space-between; }
.upload-item .pbar { height: 12px; margin-top: 6px; }
.upload-item.error { box-shadow: inset 0 0 0 2px var(--red); }
.files-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.files-toolbar .input { flex: 1; min-width: 140px; padding: 6px 10px; }
.file-list { display: flex; flex-direction: column; gap: 6px; }
.file-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  background: var(--navy-800);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25);
  animation: pp-pop .2s steps(3);
}
.file-row:hover { background: var(--navy-700); }
.file-thumb { width: 48px; height: 48px; flex: none; display: grid; place-items: center; font-size: 26px; background: var(--navy-900); box-shadow: 0 0 0 2px var(--ink); overflow: hidden; border: 0; padding: 0; cursor: default; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
button.file-thumb { cursor: zoom-in; }
.file-info { flex: 1; min-width: 0; }
.file-name { display: block; font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); text-decoration: none; }
.file-name:hover { text-decoration: underline; color: var(--yellow); }
.file-meta { font-size: 11px; color: var(--text-dim); font-family: var(--font-small); }
.file-actions { display: flex; gap: 2px; }
.lightbox {
  position: fixed; inset: 0; z-index: 1500;
  display: grid; place-items: center; padding: 30px;
  background: rgba(15, 16, 41, .9);
  cursor: zoom-out;
  animation: pp-fade .15s steps(3);
}
.lightbox img { max-width: 100%; max-height: calc(100vh - 100px); image-rendering: auto; box-shadow: 0 0 0 4px var(--ink), 0 0 0 8px var(--cream); background: #fff; }
.lightbox .cap { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: var(--cream); font-size: 13px; text-shadow: 2px 2px 0 var(--ink); }

/* 도움말 */
.help-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: center; font-size: 13px; }
.help-grid .k { display: flex; gap: 4px; flex-wrap: wrap; }
.key {
  display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px;
  background: var(--cream); color: var(--ink); font-family: var(--font-small); font-size: 11px;
  box-shadow: 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink), inset 0 -3px 0 rgba(0, 0, 0, .2);
  margin: 2px;
}
.tip-box { margin-top: 14px; padding: 10px 12px; background: var(--navy-800); font-size: 13px; line-height: 1.7; color: var(--text-dim); }
.tip-box b { color: var(--yellow); }

/* 설정 */
.settings-section { padding: 12px 0; border-top: 3px dashed var(--navy-700); }
.settings-section:first-child { border-top: 0; padding-top: 0; }
.settings-section h3 { margin: 0 0 10px; font-size: 14px; color: var(--yellow); }
.danger-zone { box-shadow: inset 0 0 0 2px rgba(255, 93, 115, .5); padding: 12px; margin-top: 6px; }
.code-box {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: var(--navy-950); font-family: var(--font-small); font-size: 12px; word-break: break-all;
  box-shadow: inset 0 0 0 2px var(--navy-600);
}
.code-box .grow { overflow: hidden; text-overflow: ellipsis; }

/* ==========================================================================
   애니메이션 (스텝으로 끊어서 픽셀 느낌)
   ========================================================================== */
@keyframes pp-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pp-fade-out { to { opacity: 0; } }
@keyframes pp-pop { 0% { transform: scale(.85); opacity: 0; } 70% { transform: scale(1.04); opacity: 1; } 100% { transform: scale(1); } }
@keyframes pp-modal-in { 0% { transform: translateY(16px) scale(.96); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes pp-toast-in { 0% { transform: translateY(12px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes pp-toast-out { to { transform: translateY(-8px); opacity: 0; } }
@keyframes pp-slide-in { 0% { transform: translateX(24px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes pp-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pp-blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0; } }
@keyframes pp-dots { 0% { width: 0; } 100% { width: 2em; } }
@keyframes pp-drop { 0% { transform: translate(-50%, -140%); } 70% { transform: translate(-50%, 6px); } 100% { transform: translate(-50%, 0); } }
@keyframes pp-rise { 0% { transform: translate(-50%, 140%); opacity: 0; } 70% { transform: translate(-50%, -6px); opacity: 1; } 100% { transform: translate(-50%, 0); } }
@keyframes pp-wiggle { 0% { transform: rotate(-12deg); } 100% { transform: rotate(12deg); } }
@keyframes pp-card-pop { 0% { transform: scale(.4) rotate(-8deg); opacity: 0; } 60% { transform: scale(1.08) rotate(2deg); opacity: 1; } 100% { transform: rotate(var(--rot, 0deg)); } }
@keyframes pp-flash { 0%, 100% { filter: none; } 50% { filter: brightness(1.15) drop-shadow(0 0 6px var(--yellow)); } }
@keyframes pp-heart { 0% { transform: scale(1); } 50% { transform: scale(1.6); } 100% { transform: scale(1); } }
@keyframes pp-indet { 0% { left: -30%; } 100% { left: 100%; } }

/* ==========================================================================
   반응형 (모바일: 독은 가로 스크롤 바, 패널은 바텀시트, 모달은 전체화면)
   ========================================================================== */
@media (max-width: 900px) {
  .video-strip { max-width: calc(100vw - 24px); top: 92px; }
  .home-grid { grid-template-columns: 1fr; }
  .char-card { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; text-align: left; align-items: center; }
  .char-card .portrait-frame { grid-row: span 3; margin: 4px; }
  .char-card .char-meta { justify-content: flex-start; margin: 2px 0; }
  .char-card .char-actions { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
  .char-card .char-actions .btn { width: auto; flex: 1; }
}

@media (max-width: 720px) {
  body { font-size: 14px; }
  :root { --dock-h: calc(76px + var(--safe-b)); }
  .title-wrap { padding-top: 5vh; }
  .hud-tl { left: 8px; top: 8px; padding: 8px 10px; max-width: calc(100vw - 210px); }
  .hud-help { display: none; }
  .hud-tr .btn { padding: 4px 7px; }
  .hud-space-name { font-size: 14px; }
  .hud-tr { right: 8px; top: 8px; gap: 0; }
  .hud-tr .btn { min-height: 34px; padding: 4px 8px; font-size: 12px; }
  .hud-tr .btn .lbl { display: none; }
  .dock {
    left: 0; right: 0; bottom: 0; transform: none;
    max-width: none; width: 100%;
    height: var(--dock-h);
    margin: 0;
    padding: 6px 10px calc(6px + var(--safe-b));
    overflow-x: auto; overflow-y: hidden;
    justify-content: flex-start;
    scroll-snap-type: x proximity;
    box-shadow: 0 -4px 0 0 var(--ink), inset 0 3px 0 0 var(--line);
  }
  .dock-btn { width: 54px; height: 54px; scroll-snap-align: start; }
  .dock-btn:hover { transform: none; }
  .dock-btn[data-tip]:hover::before, .dock-btn[data-tip]:focus-visible::before { display: none; }
  .dock-sep { display: none; }
  .page-space .toasts { bottom: calc(var(--dock-h) + 18px); }
  .side-panel, .side-panel.left {
    left: 0; right: 0; top: auto; bottom: var(--dock-h);
    width: auto; height: min(64vh, 560px); height: min(64dvh, 560px);
    margin: 0;
    animation: pp-sheet-in .2s steps(4);
  }
  .side-panel::before { content: ''; position: absolute; top: 6px; left: 50%; width: 44px; height: 4px; margin-left: -22px; background: var(--navy-600); }
  .modal-backdrop { padding: 0; place-items: stretch; }
  .modal, .modal-sm, .modal-lg, .modal-full { width: 100%; max-height: none; height: 100vh; height: 100dvh; margin: 0; box-shadow: inset 0 0 0 3px var(--navy-900), inset 0 0 0 5px var(--line); }
  .modal-sm.modal-confirm { height: auto; align-self: end; }
  .popover { left: 12px !important; right: 12px; width: auto; bottom: calc(var(--dock-h) + 16px) !important; top: auto !important; }
  .announce { top: 70px; }
  .celebrate-banner { bottom: calc(var(--dock-h) + 14px); }
  .page-space.has-celebrate-banner .toasts { bottom: calc(var(--dock-h) + 110px); }
  .announce .ann-text { font-size: 16px; }
  .vstage { inset: 60px 6px calc(var(--dock-h) + 8px); }
  .masonry, .columns { gap: 14px; }
  .board-toolbar .desc { display: none; }
  .board-toolbar { justify-content: flex-end; }
  .col { flex-basis: 78vw; }
  .ctx-card { left: 12px !important; right: 12px; width: auto; top: auto !important; bottom: calc(var(--dock-h) + 16px) !important; }
  .slots { grid-template-columns: 1fr 1fr; gap: 12px; }
  .slot { min-height: 128px; padding: 12px 10px 10px; }
  .slot-emoji { font-size: 26px; right: 8px; }
  .slot-name { font-size: 15px; margin-right: 32px; }
}
@media (max-width: 420px) {
  .slots { grid-template-columns: 1fr; }
  .emote-grid { grid-template-columns: repeat(8, 1fr); }
  .vtile { width: 104px; height: 78px; }
}
@keyframes pp-sheet-in { 0% { transform: translateY(40px); opacity: 0; } 100% { transform: none; opacity: 1; } }

@media (hover: none) {
  .dock-btn[data-tip]::before { display: none !important; }
  .kbd-only, .emote-btn .num { display: none; }
}

/* 움직임 줄이기 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .press-start { animation: none; }
}

/* ==========================================================================
   v0.2 — 진행 도구 · 손들기 · 전체 방송 · 투표 · 회의실 잠금 · 단체사진 · 승인 게시판
   ========================================================================== */
:root { --tl-b: 96px; --tr-b: 54px; --tr-w: 220px; --top-stack: 100px; }

/* HUD 상황 줄 (좌상단 패널 안) */
.hud-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; margin-top: 2px; }
.hud-row .btn { margin: 2px; }
.hud-knock { color: var(--yellow); padding: 4px 6px; background: rgba(255, 217, 102, .1); box-shadow: inset 0 0 0 2px rgba(255, 217, 102, .45); }
.hud-follow { color: var(--mint); padding: 4px 6px; background: rgba(126, 224, 181, .1); box-shadow: inset 0 0 0 2px rgba(126, 224, 181, .45); }
.hud-follow .grow, .hud-knock .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-zone.locked { color: var(--peach); }
.hud-zone-wrap { display: inline-flex; align-items: center; gap: 2px; min-width: 0; }
.hud-link.btn-icon { width: 22px; height: 22px; font-size: 12px; margin: -3px 0; }
.hud-tr .btn.is-off { opacity: .6; }

/* 손들기 버튼 */
.dock-btn.hand-up { --bg: var(--yellow); --fg: var(--ink); }
.dock-btn.hand-up .ico { animation: pp-wave .7s steps(2) infinite; display: inline-block; transform-origin: 70% 90%; }
@keyframes pp-wave { 0% { transform: rotate(-14deg); } 100% { transform: rotate(14deg); } }

/* 전체 방송 바 */
.spot-bar {
  position: fixed; z-index: 120; top: 10px; left: 8px; right: 8px; margin: 0 auto; width: max-content;
  display: flex; align-items: center; gap: 10px;
  max-width: min(560px, calc(100vw - 24px));
  padding: 5px 8px 5px 12px;
  background: var(--red); color: #fff;
  font-weight: 700; font-size: 13px;
  box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), inset 0 0 0 2px #ff8f9f, 4px 4px 0 0 var(--shadow);
  animation: pp-spot-in .3s steps(5);
}
@keyframes pp-spot-in { 0% { transform: translateY(-140%); } 70% { transform: translateY(4px); } 100% { transform: none; } }
.spot-bar .sb-ico { font-size: 18px; animation: pp-wiggle .6s steps(2) infinite; }
.spot-bar .sb-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.spot-bar .btn { color: var(--ink); }
body.has-spotlight .video-strip { top: 52px; }
body.has-spotlight .announce { top: 60px; }
body.has-spotlight:has(.video-strip .vtile) .announce { top: 180px; }

/* 진행 도구 팝오버 */
.host-pop { width: min(380px, calc(100vw - 24px)); max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); overflow: auto; }
.host-pop .panel-title { justify-content: space-between; }
.host-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 6px; }
.host-grid .btn { width: calc(100% - 6px); justify-content: flex-start; font-size: 13px; }
.host-sec { margin-top: 12px; padding-top: 10px; border-top: 3px dashed var(--navy-700); }
.host-sec h4 { margin: 0 0 8px; font-size: 13px; color: var(--yellow); }
.hand-queue { display: flex; flex-direction: column; gap: 4px; }
.hand-empty { margin: 0; font-size: 12px; color: var(--text-dim); line-height: 1.6; }
.hand-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px; background: var(--navy-800); }
.hand-row .portrait { width: 28px; height: 28px; box-shadow: 0 0 0 2px var(--ink); margin: 2px; }
.hand-no { display: grid; place-items: center; width: 20px; height: 20px; flex: none; background: var(--yellow); color: var(--ink); font-family: var(--font-small); font-size: 11px; box-shadow: 0 0 0 2px var(--ink); }
.hand-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hand-name { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hand-time { font-family: var(--font-small); font-size: 10px; color: var(--text-dim); }
.pop-sep { height: 3px; margin: 12px 0 8px; background: repeating-linear-gradient(90deg, var(--navy-600) 0 6px, transparent 6px 10px); }
.photo-btn { width: calc(100% - 6px); }

/* 투표 카드 (오른쪽 위, HUD 버튼 아래) */
.poll-card {
  position: fixed; z-index: 140;
  top: calc(var(--tr-b) + 10px); right: 14px;
  width: 300px; max-height: calc(100vh - var(--tr-b) - 200px); overflow: auto;
  padding: 10px 12px 12px;
  animation: pp-pop .2s steps(3);
}
body.chat-open .poll-card { right: 372px; }
.poll-head { display: flex; align-items: center; gap: 6px; }
.poll-head .poll-ico { font-size: 18px; }
.poll-title { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poll-head .btn-icon { width: 26px; height: 26px; font-size: 14px; }
.poll-q { margin: 8px 2px 10px; font-family: var(--font-title); font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.poll-opts { display: flex; flex-direction: column; gap: 6px; }
.poll-opt {
  position: relative; display: flex; align-items: center; gap: 8px;
  width: calc(100% - 4px); min-height: 34px; margin: 2px; padding: 5px 8px;
  border: 0; text-align: left; cursor: pointer; overflow: hidden;
  background: var(--navy-800); color: var(--text); font: inherit; font-size: 13px;
  box-shadow: 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink);
}
div.poll-opt { cursor: default; }
button.poll-opt:hover { background: var(--navy-700); }
.poll-opt .po-bar {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: repeating-linear-gradient(90deg, rgba(143, 211, 255, .38) 0 8px, rgba(143, 211, 255, .26) 8px 10px);
  transition: width .3s steps(6);
  pointer-events: none;
}
.poll-opt.mine .po-bar { background: repeating-linear-gradient(90deg, rgba(255, 217, 102, .55) 0 8px, rgba(255, 217, 102, .4) 8px 10px); }
.poll-opt.win .po-bar { background: repeating-linear-gradient(90deg, rgba(126, 224, 181, .6) 0 8px, rgba(126, 224, 181, .45) 8px 10px); }
.poll-opt.mine { box-shadow: 0 -2px 0 0 var(--yellow), 0 2px 0 0 var(--yellow), -2px 0 0 0 var(--yellow), 2px 0 0 0 var(--yellow); }
.poll-opt > span:not(.po-bar) { position: relative; }
.po-mark { display: grid; place-items: center; flex: none; width: 20px; height: 20px; background: var(--cream); color: var(--ink); font-family: var(--font-small); font-size: 11px; box-shadow: 0 0 0 2px var(--ink); }
.poll-opt.mine .po-mark { background: var(--yellow); }
.poll-opt.win .po-mark { background: var(--mint); }
.po-text { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 700; }
.po-n { flex: none; font-family: var(--font-small); font-size: 11px; color: var(--cream); }
.poll-foot { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.poll-card.closed { box-shadow: 0 calc(-1 * var(--px)) 0 0 var(--ink), 0 var(--px) 0 0 var(--ink), calc(-1 * var(--px)) 0 0 0 var(--ink), var(--px) 0 0 0 var(--ink), inset 0 0 0 3px var(--navy-900), inset 0 0 0 5px var(--mint), 8px 8px 0 0 var(--shadow); }
.poll-card.mini { width: 240px; padding: 6px 10px; }
.poll-compose-opts { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.poll-compose-row { display: flex; align-items: center; gap: 6px; }
.poll-compose-row .input { flex: 1; margin: 3px; }

/* 비디오 타일: 크게 보기 버튼 · LIVE · 음량 */
.vtile .vt-hit { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; }
.vtile .vt-hit:focus-visible { outline: 3px solid var(--yellow); outline-offset: -3px; }
.vtile .vt-name, .vtile .vt-icons, .vtile .vt-live, .vtile .vt-state { z-index: 2; pointer-events: none; }
.vtile .vt-live {
  position: absolute; left: 4px; top: 4px; padding: 1px 5px;
  background: var(--red); color: #fff; font-family: var(--font-small); font-size: 10px; font-weight: 700;
  box-shadow: 0 0 0 2px var(--ink);
  animation: pp-blink 1.6s steps(1) infinite;
}
.vtile.live { box-shadow: 0 -3px 0 0 var(--red), 0 3px 0 0 var(--red), -3px 0 0 0 var(--red), 3px 0 0 0 var(--red), 4px 4px 0 2px var(--shadow); }
.vtile .vt-state { left: 50%; top: 42%; transform: translate(-50%, -50%); white-space: nowrap; font-size: 11px; padding: 2px 6px; }
.vtile.failed .vt-state { color: var(--peach); }
.vtile.failed .vt-hit { cursor: pointer; }
.vtile.failed { box-shadow: 0 -3px 0 0 var(--peach-d), 0 3px 0 0 var(--peach-d), -3px 0 0 0 var(--peach-d), 3px 0 0 0 var(--peach-d), 4px 4px 0 2px var(--shadow); }
.vtile .vt-vol {
  position: absolute; z-index: 3; right: 4px; bottom: 4px; width: 22px; height: 22px; padding: 0; border: 0;
  display: grid; place-items: center; background: rgba(15, 16, 41, .78); color: var(--text); font-size: 12px; cursor: pointer;
  opacity: 0; transition: opacity .1s steps(2);
}
.vtile:hover .vt-vol, .vtile:focus-within .vt-vol, .vtile .vt-vol[aria-expanded='true'] { opacity: 1; }
@media (hover: none) { .vtile .vt-vol { opacity: .9; } }
.vtile .vt-volbox {
  position: absolute; z-index: 4; left: 4px; right: 30px; bottom: 4px; height: 22px;
  display: flex; align-items: center; padding: 0 6px; background: rgba(15, 16, 41, .9);
}
.vtile .vt-volbox input[type='range'] { width: 100%; accent-color: var(--yellow); margin: 0; }
.vtile .vt-name { max-width: calc(100% - 34px); }

/* 참여자 패널: 구역 칩 */
.zone-chips { display: flex; flex-direction: column; gap: 3px; }
.zone-chip { display: flex; align-items: center; gap: 6px; padding: 3px 6px; font-size: 12px; background: rgba(255, 255, 255, .04); }
.zone-chip.empty { opacity: .6; }
.zone-chip.locked { box-shadow: inset 3px 0 0 var(--peach); }
.zone-chip .zc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zone-chip .zc-n { font-family: var(--font-small); font-size: 11px; color: var(--mint); }
.zone-chip.empty .zc-n { color: var(--text-dim); }
.zone-chip .btn-icon { width: 26px; height: 26px; font-size: 13px; }
.zone-more { align-self: flex-start; margin-top: 2px; padding: 3px 6px; border: 0; background: transparent; color: var(--sky); font: inherit; font-size: 12px; cursor: pointer; }
.zone-more:hover { text-decoration: underline; }
.person.hand-up { box-shadow: inset 3px 0 0 var(--yellow); }

/* 내보내기 기간 */
.ban-opts { display: flex; flex-direction: column; gap: 6px; }
.ban-opt { position: relative; display: block; cursor: pointer; }
.ban-opt input { position: absolute; opacity: 0; pointer-events: none; }
.ban-inner { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; margin: 3px; background: var(--navy-800); box-shadow: 0 0 0 3px var(--ink), inset 0 0 0 2px var(--navy-600); }
.ban-inner .small { color: var(--text-dim); }
.ban-opt input:checked + .ban-inner { background: var(--navy-700); box-shadow: 0 0 0 3px var(--ink), inset 0 0 0 3px var(--red); }
.ban-opt input:focus-visible + .ban-inner { outline: 3px solid var(--yellow); outline-offset: 4px; }

/* 출석부 */
.att-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.att-scroll { overflow: auto; max-height: min(56vh, 520px); box-shadow: inset 0 0 0 2px var(--navy-700); }
.att-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.att-table th { position: sticky; top: 0; z-index: 1; background: var(--navy-800); text-align: left; padding: 0; white-space: nowrap; }
.att-sort { display: block; width: 100%; padding: 7px 10px; border: 0; background: transparent; color: var(--yellow); font: inherit; font-size: 12px; font-weight: 700; text-align: left; cursor: pointer; }
.att-sort:hover { background: rgba(255, 255, 255, .06); }
.att-table td { padding: 6px 10px; border-top: 2px solid var(--navy-800); white-space: nowrap; }
.att-table tr.on td:first-child { color: var(--mint); }
.att-table .att-email { max-width: 200px; overflow: hidden; text-overflow: ellipsis; color: var(--text-dim); }

/* 단체사진 */
.photo-count { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; pointer-events: none; }
.photo-count .pc-box { text-align: center; }
.photo-count .pc-num {
  font-family: var(--font-title); font-size: clamp(90px, 22vw, 180px); line-height: 1; color: var(--yellow);
  text-shadow: 6px 0 0 var(--ink), -6px 0 0 var(--ink), 0 6px 0 var(--ink), 0 -6px 0 var(--ink), 6px 6px 0 var(--ink), -6px 6px 0 var(--ink), 6px -6px 0 var(--ink), -6px -6px 0 var(--ink), 12px 12px 0 var(--pink-d);
}
.photo-count .pc-num.tick { animation: pp-count .9s steps(6); }
.photo-count .pc-sub { margin-top: 18px; display: inline-block; padding: 6px 14px; background: rgba(15, 16, 41, .78); color: var(--cream); font-size: 15px; text-shadow: 2px 2px 0 var(--ink); }
.photo-count .pc-sub:empty { display: none; }
.photo-count.flash::after { content: ''; position: fixed; inset: 0; background: #fff; animation: pp-shutter .35s steps(4) forwards; }
.photo-count.out { animation: pp-fade-out .25s steps(3) forwards; }
@keyframes pp-count { 0% { transform: scale(1.6); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 85% { opacity: 1; } 100% { transform: scale(.85); opacity: .2; } }
@keyframes pp-shutter { 0% { opacity: .85; } 100% { opacity: 0; } }
.photo-frame { display: grid; place-items: center; padding: 10px; background: repeating-linear-gradient(45deg, var(--navy-800) 0 8px, var(--navy-700) 8px 16px); }
.photo-preview { display: block; max-width: 100%; max-height: min(60vh, 560px); image-rendering: pixelated; box-shadow: 6px 6px 0 0 var(--shadow); }

/* 승인 대기 게시물 */
.badge-pending { background: var(--peach); color: var(--ink); }
.board-item .badge-pending { margin-left: auto; }
.card.pending { opacity: .9; background-image: repeating-linear-gradient(-45deg, rgba(25, 26, 51, .05) 0 8px, transparent 8px 16px); }
.card-pending { display: flex; align-items: center; gap: 4px 6px; flex-wrap: wrap; margin-top: 10px; padding: 6px 8px; background: rgba(255, 179, 138, .35); box-shadow: 0 0 0 2px rgba(25, 26, 51, .45); font-size: 12px; }
.card-pending .cp-badge { font-weight: 700; flex: 1; }
.card-pending .cp-text { order: 3; flex: 1 1 100%; color: #5a4a6a; font-size: 11px; }

/* 모이기 */
.summon-body { align-items: center; text-align: center; }
.summon-face { display: inline-block; }
.summon-face .portrait { width: 72px; height: 72px; }
.summon-text { margin: 0; font-size: 16px; }
.summon-text b { color: var(--yellow); }

/* 설정 스위치 줄 */
.pref-row .field-hint { margin: 0 0 4px 62px; }

/* 서버 안내 채팅 줄 (투표 결과 등) */
.msg.system.server .msg-text { color: var(--cream); background: rgba(126, 224, 181, .1); box-shadow: inset 0 0 0 2px rgba(126, 224, 181, .35); padding: 6px 10px; text-align: left; }
.msg.system.server b { color: var(--mint); }

/* 움직임 줄이기(사용자 설정) — 시스템 설정과 같은 규칙 */
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
  scroll-behavior: auto !important;
}
html.reduce-motion .press-start, html.reduce-motion .vtile .vt-live { animation: none; }
@media (prefers-reduced-motion: reduce) { .vtile .vt-live, .spot-bar .sb-ico, .dock-btn.hand-up .ico { animation: none; } }

/* ---------- 영상 줄/방송 바/투표 카드 자리 ----------
   넓은 화면: 좌상단 패널과 우상단 버튼 사이 빈칸의 가운데 (space.js 가 --tl-r, --tr-gap 을 잰다)
   좁은 화면(body.strip-below): HUD 아래 줄에 차례로 쌓는다 */
body:not(.strip-below) .video-strip {
  left: calc(var(--tl-r, 380px) + 12px); right: calc(var(--tr-gap, 440px) + 12px);
  width: max-content; max-width: calc(100vw - var(--tl-r, 380px) - var(--tr-gap, 440px) - 24px);
  margin: 0 auto; transform: none;
}
body:not(.strip-below) .spot-bar {
  left: calc(var(--tl-r, 380px) + 12px); right: calc(var(--tr-gap, 440px) + 12px);
  max-width: calc(100vw - var(--tl-r, 380px) - var(--tr-gap, 440px) - 24px);
}
body.strip-below .video-strip { top: calc(max(var(--tl-b), var(--tr-b)) + 6px); max-width: calc(100vw - 16px); left: 8px; right: 8px; transform: none; justify-content: flex-start; padding: 4px 4px 8px; }
body.strip-below .spot-bar { top: calc(max(var(--tl-b), var(--tr-b)) + 8px); }
body.strip-below.has-spotlight .video-strip { top: calc(max(var(--tl-b), var(--tr-b)) + 50px); }
body.strip-below .poll-card { top: calc(max(var(--top-stack), var(--ann-b, 0px)) + 8px); right: 8px; width: min(300px, calc(100vw - 16px)); max-height: calc(100vh - var(--top-stack) - 120px); max-height: calc(100dvh - var(--top-stack) - 120px); }
body.strip-below .announce, body.strip-below:has(.video-strip .vtile) .announce, body.strip-below.has-spotlight .announce, body.strip-below.has-spotlight:has(.video-strip .vtile) .announce { top: calc(var(--top-stack) + 8px); }
@media (max-width: 900px) {
  body.chat-open .poll-card { display: none; }
}
@media (max-width: 720px) {
  .hud-tl { max-width: calc(100vw - var(--tr-w) - 28px); min-width: 150px; }
  .hud-tr .btn { min-height: 32px; padding: 3px 6px; }
  .hud-sub { gap: 4px 6px; }
  .hud-ping { display: none; }
  .vtile { width: 104px; height: 78px; }
  .vtile .vt-portrait img { width: 48px; height: 48px; }
  .poll-card, body.strip-below .poll-card { left: 8px; right: 8px; width: auto; }
  .poll-card.mini, body.strip-below .poll-card.mini { left: auto; width: 220px; }
  .poll-q { font-size: 14px; margin: 6px 2px 8px; }
  .poll-opt { min-height: 30px; padding: 4px 8px; }
  /* 토스트는 화면 위쪽(HUD 아래)으로 → 조이스틱·행동 버튼을 가리지 않는다. 투표 카드가 있으면 그 아래 */
  .page-space .toasts, .page-space.has-celebrate-banner .toasts { top: calc(var(--top-stack) + 8px); bottom: auto; }
  .page-space.has-poll .toasts { top: min(calc(var(--poll-b, var(--top-stack)) + 8px), calc(100vh - var(--dock-h) - 300px)); top: min(calc(var(--poll-b, var(--top-stack)) + 8px), calc(100dvh - var(--dock-h) - 300px)); }
  .page-space .toasts .toast:nth-last-child(n+3) { display: none; }
  .modal-sm.summon-modal { height: auto; align-self: end; }
  .host-pop { max-height: calc(100vh - var(--dock-h) - 40px); max-height: calc(100dvh - var(--dock-h) - 40px); }
  .host-grid .btn { font-size: 12px; padding: 4px 6px; }
  .att-table { font-size: 12px; }
  .spot-bar { font-size: 12px; }
}
@media (max-width: 420px) {
  .hud-space .tpl { font-size: 18px; }
  .hud-space-name { font-size: 13px; }
}

/* 터치 태블릿(721px 이상, 손가락 입력): 독을 화면 아래 가로 바로 → 게임 캔버스가 독 위에서 끝나서 조이스틱·행동 버튼이 가려지지 않는다 */
@media (pointer: coarse) and (min-width: 721px) and (max-width: 1400px) {
  :root { --dock-h: calc(80px + var(--safe-b)); }
  .dock {
    left: 0; right: 0; bottom: 0; transform: none;
    max-width: none; width: 100%;
    height: var(--dock-h);
    margin: 0;
    padding: 6px 12px calc(6px + var(--safe-b));
    overflow-x: auto; overflow-y: hidden;
    justify-content: safe center;
    box-shadow: 0 -4px 0 0 var(--ink), inset 0 3px 0 0 var(--line);
  }
  .dock-btn:hover { transform: none; }
  .page-space .toasts { bottom: calc(var(--dock-h) + 18px); }
  .celebrate-banner { bottom: calc(var(--dock-h) + 14px); }
  .popover { bottom: calc(var(--dock-h) + 16px) !important; }
  .side-panel, .side-panel.left { bottom: calc(var(--dock-h) + 12px); }
  .vstage { bottom: calc(var(--dock-h) + 8px); }
}

/* ---------- 문서 페이지 (개인정보 안내) ---------- */
.page-doc {
  min-height: 100vh;
  background-color: #23255a;
  background-image:
    radial-gradient(rgba(255, 246, 227, .5) 1px, transparent 1.5px),
    radial-gradient(rgba(255, 217, 102, .35) 1px, transparent 1.5px);
  background-size: 64px 64px, 112px 112px;
  background-position: 0 0, 30px 50px;
}
.doc-wrap { width: min(820px, 100%); margin: 0 auto; padding: 28px 16px 60px; display: flex; flex-direction: column; gap: 18px; word-break: keep-all; overflow-wrap: anywhere; }
.doc-head { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.doc-title { margin: 6px 0 0; font-family: var(--font-title); font-weight: 400; font-size: clamp(26px, 6vw, 38px); color: var(--yellow); letter-spacing: 1px; text-shadow: 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink), 5px 5px 0 var(--pink-d); }
.doc-sub { margin: 0; color: var(--cream); font-size: 15px; text-shadow: 2px 2px 0 var(--ink); }
.doc-meta { margin: 0; color: var(--text-dim); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.doc-toc ol { margin: 0; padding-left: 22px; columns: 2; column-gap: 26px; font-size: 14px; line-height: 2; }
.doc-toc a { color: var(--cream); text-decoration: none; }
.doc-toc a:hover { color: var(--yellow); text-decoration: underline; }
.doc-sec h2 { margin: 0 0 12px; font-family: var(--font-title); font-weight: 400; font-size: 19px; color: var(--yellow); display: flex; gap: 8px; align-items: center; }
.panel-cream.doc-sec h2 { color: var(--pink-d); }
.doc-sec p { margin: 0 0 10px; line-height: 1.75; }
.doc-list { margin: 0; padding-left: 20px; line-height: 1.85; }
.doc-list li { margin-bottom: 4px; }
.doc-list li::marker { content: '▸ '; color: var(--pink); }
.doc-note { font-size: 13px; color: var(--text-dim); }
.panel-cream .doc-note { color: #6b5f80; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.6; margin-bottom: 12px; }
.doc-table th { text-align: left; padding: 8px 10px; background: var(--navy-800); color: var(--yellow); font-size: 12px; }
.doc-table td { padding: 8px 10px; border-top: 2px solid var(--navy-800); vertical-align: top; }
.doc-table b { color: var(--cream); }
.doc-contact { font-size: 15px; }
.doc-foot { align-self: center; }
.doc-foot a, .credits a { color: var(--cream); }
@media (max-width: 600px) {
  .doc-toc ol { columns: 1; }
  .doc-table, .doc-table tbody, .doc-table tr, .doc-table td { display: block; width: 100%; }
  .doc-table thead { display: none; }
  .doc-table tr { padding: 8px 0; border-top: 3px dashed var(--navy-700); }
  .doc-table td { border: 0; padding: 2px 4px; }
}

/* ── v0.3 놀이: 보물 스탬프 칩 · OX 퀴즈 배너 ── */
.fun-chip {
  position: fixed; left: 14px; top: 112px; z-index: 120;
  font: 12px/1 "Galmuri11", "Apple SD Gothic Neo", sans-serif; color: #fff3c4;
  background: rgba(34,22,48,0.88); border: 2px solid #ffc31f; box-shadow: 0 3px 0 rgba(0,0,0,0.35);
  padding: 7px 10px; cursor: pointer; image-rendering: pixelated;
}
.fun-chip:hover, .fun-chip:focus-visible { background: rgba(60,38,84,0.95); outline: 2px solid #fff; outline-offset: 1px; }
.fun-chip.done { border-color: #7dff9a; color: #d8ffe2; }
.fun-quiz {
  position: fixed; left: 50%; top: 84px; transform: translateX(-50%); z-index: 130; pointer-events: none;
  width: min(560px, calc(100vw - 24px)); padding: 10px 14px; text-align: center;
  font: 14px/1.45 "Galmuri11", "Apple SD Gothic Neo", sans-serif; color: #fff;
  background: rgba(24,16,44,0.92); border: 3px solid #7cc4ff; box-shadow: 0 4px 0 rgba(0,0,0,0.4);
}
.fun-quiz.done { border-color: #ffd93d; }
.fun-quiz .fq-q b { color: #ffd93d; }
.fun-quiz .fq-sub { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 4px; font-size: 12px; color: #d9d0ff; }
.fun-quiz .fq-time { color: #ffb0bb; font-weight: bold; }
.fun-quiz .fq-ans { color: #ffd93d; font-weight: bold; }
@media (max-width: 600px) {
  .fun-chip { top: auto; bottom: calc(236px + var(--safe-b, 0px)); left: 8px; font-size: 11px; }
  .fun-quiz { top: 64px; font-size: 13px; }
}
