/* ── 「수심 400미터」 ─────────────────────────────────────────
   색: 바다 밑 400미터. 검푸른 바다, 녹슨 쇠의 회색, 비상등의 붉은빛, 야광 분필의 연두, 발광 생물의 청록.
   body.theme-deep 이 붙으면 기본 색을 이 게임의 색으로 바꾼다 (다른 게임의 css 와 같은 방식).
   소리가 없어도 몰입되게: 어둠(손전등), 흔들림, 장면 위의 큰 소리 글자, 산소계 바늘은 모두 화면으로 보인다. */
body.theme-deep {
  --navy: #0e1a24;
  --navy-deep: #060c12;
  --navy-mid: #16242f;
  --navy-light: #2a4050;
  --teal: #3a9a96;
  --teal-light: #8fd8d0;
  --amber: #f2b84a;
  --amber-dark: #d08a2a;
  --cream: #e8eef2;
  --cream-dim: #9aaab4;
  --line: rgba(200, 220, 230, 0.18);
  --modal-top: #16242f;
  --font-title: "Do Hyeon", "Noto Sans KR", sans-serif;
  background: radial-gradient(ellipse 90% 520px at 50% 0, rgba(80, 160, 180, 0.12), transparent), #060c12;
}
body.theme-deep.playing { background: #02060a; }
body.theme-deep .modal-box { background: linear-gradient(180deg, #16242f, #0b141c); border: 1px solid rgba(143, 216, 208, 0.35); box-shadow: 0 0 0 4px rgba(2, 6, 10, 0.7), 0 18px 60px rgba(0, 0, 0, 0.7); }
body.theme-deep .pz-layer:empty { display: none; }
body.theme-deep .scene-svg { animation: dp-in 0.9s ease-out; }
@keyframes dp-in { from { opacity: 0; } to { opacity: 1; } }

.au-poster.au-deep { background: linear-gradient(180deg, transparent 45%, rgba(2, 8, 12, 0.94) 78%), url("/img/poster-deep.svg") center 40% / cover no-repeat, #02060a; }
.game-art.ga-deep { background: url("/img/poster-deep.svg") center 40% / cover no-repeat, #02060a; }

/* ── 캄캄한 장면 ── */
.scene.is-dark .scene-label { background: rgba(2, 6, 10, 0.85); }
.scene [data-glow] { opacity: 0; transition: opacity 0.25s; pointer-events: none; }
.scene.torch-off [data-glow] { opacity: 1; transition: opacity 1.6s ease-in; }
.scene.is-dark .scene-hotspot:hover, .scene.is-dark .scene-hotspot:focus-visible { fill: #fff6dc; fill-opacity: 0.06; stroke: #fff6dc; stroke-width: 1.5; stroke-opacity: 0.5; filter: none; }

/* 손전등 단추 (무대 왼쪽 아래) */
.torch-btn { position: absolute; left: 12px; bottom: 12px; z-index: 4; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px 10px 12px; border-radius: 999px; border: 1px solid rgba(200, 220, 230, 0.3); background: rgba(6, 12, 18, 0.85); color: var(--cream); font: inherit; font-size: 0.95rem; font-weight: 700; cursor: pointer; }
.torch-btn::before { content: ""; width: 22px; height: 12px; border-radius: 4px; background: #5a5040; box-shadow: inset -6px 0 0 #2a2a2a; }
.torch-btn.on { border-color: rgba(242, 184, 74, 0.7); }
.torch-btn.on::before { background: #f2c050; box-shadow: inset -6px 0 0 #2a2a2a, 8px 0 14px rgba(255, 240, 190, 0.9); }
.torch-btn[hidden] { display: none; }
.stage.busy .torch-btn { pointer-events: none; opacity: 0.6; }

/* 손목 산소계 (무대 오른쪽 위) */
.stage-gauge { position: absolute; right: 12px; top: 10px; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; }
.stage-gauge[hidden] { display: none; }
.stage-gauge small { color: var(--cream-dim); font-size: 0.72rem; }
.gauge-dial { position: relative; width: 58px; height: 34px; border-radius: 58px 58px 6px 6px; background: conic-gradient(from -90deg at 50% 100%, #c8463a 0 60deg, #e0b040 60deg 120deg, #3aa86a 120deg 180deg, transparent 180deg); box-shadow: inset 0 0 0 4px #1a2228, 0 2px 8px rgba(0, 0, 0, 0.6); }
.gauge-needle { position: absolute; left: 50%; bottom: 2px; width: 3px; height: 26px; margin-left: -1.5px; background: #f4f4f4; border-radius: 2px; transform-origin: 50% 100%; transform: rotate(-70deg); transition: transform 2.2s cubic-bezier(.3, 1.4, .5, 1); }
.stage-gauge[data-level="yellow"] .gauge-needle { transform: rotate(0deg); }
.stage-gauge[data-level="green"] .gauge-needle { transform: rotate(62deg); }
.stage-gauge[data-level="red"] .gauge-dial { animation: dp-warn 1.6s ease-in-out infinite; }
@keyframes dp-warn { 50% { box-shadow: inset 0 0 0 4px #1a2228, 0 0 14px rgba(220, 70, 58, 0.9); } }

/* 흔들림 · 소리 글자 */
.stage.shake { animation: dp-shake 0.6s cubic-bezier(.36, .07, .19, .97); }
.stage.bump { animation: dp-bump 0.35s ease-out; }
@keyframes dp-shake { 10%, 90% { transform: translate(-3px, 1px); } 20%, 80% { transform: translate(8px, -3px); } 30%, 50%, 70% { transform: translate(-14px, 5px) rotate(-0.4deg); } 40%, 60% { transform: translate(14px, -4px) rotate(0.4deg); } }
@keyframes dp-bump { 30% { transform: translateY(5px); } 60% { transform: translateY(-2px); } }
.stage-word { position: absolute; left: 50%; top: 34%; z-index: 4; transform: translate(-50%, -50%) rotate(-6deg); font-family: "Do Hyeon", sans-serif; font-size: clamp(56px, 12vw, 150px); color: #eef4f8; letter-spacing: 0.08em; opacity: 0; pointer-events: none; text-shadow: 0 0 24px rgba(0, 0, 0, 0.9), 0 4px 0 rgba(0, 0, 0, 0.6); white-space: nowrap; }
.stage-word.show { animation: dp-word 1.6s ease-out; }
@keyframes dp-word { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(-6deg) scale(1.5); } 12% { opacity: 0.95; transform: translate(-50%, -50%) rotate(-6deg) scale(1); } 70% { opacity: 0.8; } 100% { opacity: 0; transform: translate(-50%, -50%) rotate(-6deg) scale(0.97); } }
@media (prefers-reduced-motion: reduce) {
  .stage.shake, .stage.bump { animation: none; }
  .stage-word.show { animation: dp-word-still 1.6s linear; }
  @keyframes dp-word-still { 0%, 80% { opacity: 0.9; } 100% { opacity: 0; } }
  body.theme-deep .scene-svg { animation: none; }
}

/* 힌트 = 야광 분필 글씨 */
body.theme-deep .pz-hint { background: #04100a; border: 1px solid rgba(184, 245, 196, 0.25); }
body.theme-deep .pz-hint p { color: #c8ffd0; text-shadow: 0 0 8px rgba(120, 240, 160, 0.55); font-size: 1.04rem; }
body.theme-deep .pz-hint small { color: #7ab88a; }
body.theme-deep .dialogue[data-who="chalk"] .dlg-text { color: #c8ffd0; text-shadow: 0 0 8px rgba(120, 240, 160, 0.5); }

/* ── 판 공통 ── */
.dp-board { display: block; width: 100%; max-width: 560px; margin: 0 auto; height: auto; touch-action: none; user-select: none; border-radius: 12px; }
.dp .bd-status { color: var(--cream); }
.tl-glow { opacity: 0; transition: opacity 0.25s; pointer-events: none; }
.tl-off .tl-glow { opacity: 1; transition: opacity 1.4s ease-in; }

/* 어둠 속에서 찾기 */
.sr-shelf { fill: #3a4650; }
.sr-water { fill: #1a3a4a; }
.sr-wave { fill: none; stroke: #6a9ab0; stroke-width: 2; opacity: 0.4; }
.sr-item { cursor: pointer; outline: none; }
.sr-hit { fill: transparent; }
.sr-ring { fill: none; stroke: transparent; stroke-width: 3; }
.sr-item:focus-visible .sr-ring, .sr-item.picked .sr-ring { stroke: #f2c050; }
.sr-dark { fill: #01030a; }
.sr-hole { fill: #000; animation: sr-fade 1.4s ease-in forwards; }
@keyframes sr-fade { 0% { fill-opacity: 0.85; } 100% { fill-opacity: 0; } }
.sr-line { min-height: 1.6em; margin: 8px 0 0; text-align: center; color: var(--cream); }

/* 사물함 배정표 */
.hl-rule { color: var(--cream-dim); font-size: 0.85rem; text-align: center; margin-bottom: 4px; }
.hl-queue { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 8px; }
.hl-card { display: inline-flex; flex-direction: column; align-items: center; padding: 4px 10px; border-radius: 8px; background: var(--navy-mid); border: 1px solid var(--line); font-size: 0.85rem; line-height: 1.2; }
.hl-card small { color: var(--cream-dim); font-variant-numeric: tabular-nums; }
.hl-card.now { border-color: var(--amber); box-shadow: 0 0 0 2px rgba(242, 184, 74, 0.35); }
.hl-card.done { opacity: 0.45; }
.hl-card.me b { color: var(--amber); }
.hl-bg { fill: #1a242c; }
.hl-door { fill: #5a6e64; stroke: #2a3632; stroke-width: 2; }
.hl-slot { cursor: pointer; outline: none; }
.hl-slot:hover .hl-door, .hl-slot:focus-visible .hl-door { fill: #6a8274; }
.hl-slot.full .hl-door { fill: #3e4c46; }
.hl-slot.mine .hl-door { stroke: #f2c050; stroke-width: 4; }
.hl-slot.bounce { animation: hl-bounce 0.4s; }
@keyframes hl-bounce { 30% { transform: translateX(-5px); } 60% { transform: translateX(5px); } }
.hl-vent { stroke: #2a3632; stroke-width: 3; }
.hl-num { fill: #e8e0c8; }
.hl-numtext { font: 700 14px sans-serif; text-anchor: middle; fill: #2a2a2a; }
.hl-tag { fill: #f4ecd8; }
.hl-tagname { font: 700 13px sans-serif; text-anchor: middle; fill: #2a2a2a; }
.hl-tagid { font: 11px sans-serif; text-anchor: middle; fill: #5a5a5a; }
.hl-me { font: 700 14px sans-serif; text-anchor: middle; fill: #f2c050; }

/* 번진 쪽지 */
.dn-bg { fill: #2a2420; }
.dn-paper { fill: #f2ecdc; }
.dn-ink { font-family: "Gowun Batang", serif; font-size: 44px; font-weight: 700; fill: #1a2440; }
.dn-smear { fill: none; stroke: #5a6a9a; stroke-width: 14; stroke-linecap: round; opacity: 0.45; filter: blur(4px); }
.dn-wet { fill: #4a6a8a; pointer-events: none; }

/* 비밀함 */
.gr-bg { fill: #2a2418; }
.gr-lid { fill: #5a4c34; stroke: #3a3020; stroke-width: 3; }
.gr-sw { cursor: pointer; outline: none; }
.gr-slot { fill: #1a1610; }
.gr-knob { fill: #9aa4aa; stroke: #4a545c; stroke-width: 2; transition: y 0.15s; }
.gr-sw.up .gr-knob { fill: #d8e0e4; }
.gr-sw:focus-visible .gr-slot { stroke: #f2c050; stroke-width: 3; }
.gr-label { font: 700 14px sans-serif; fill: #c8b890; text-anchor: middle; }
.gr-lamp { fill: #2a2a20; stroke: #1a1a10; stroke-width: 2; }
.gr-lamp.on { fill: #ffd860; filter: drop-shadow(0 0 6px rgba(255, 216, 96, 0.9)); }
.gr-lamp.flash { fill: #c8463a; filter: none; }
.gr-pat { font: 12px sans-serif; fill: #e8dcb0; dominant-baseline: middle; }

/* 카트리지 */
.ct-bg { fill: #1a242c; }
.ct-rack { fill: #2a343c; stroke: #3e4a54; stroke-width: 2; }
.ct-tube { cursor: pointer; outline: none; }
.ct-tube.out { cursor: default; opacity: 0.5; }
.ct-body { fill: #5aa0b8; stroke: #2a5a6a; stroke-width: 2; transition: y 0.3s; }
.ct-tube.bad:not(.out) .ct-body { fill: #c8705a; stroke: #7a2a1a; }
.ct-tube:focus-visible .ct-body { stroke: #f2c050; stroke-width: 3; }
.ct-shine { fill: #fff; opacity: 0.3; pointer-events: none; }
.ct-label { fill: #f4ecd8; }
.ct-month { font: 8px sans-serif; text-anchor: middle; fill: #5a5a5a; }
.ct-day { font: 700 11px sans-serif; text-anchor: middle; fill: #1a1a1a; }

/* 고이는 바닥 */
.dr-bg { fill: #141c22; }
.dr-face { fill: #4a5660; }
.dr-tile.low .dr-face { fill: #3a464e; cursor: pointer; }
.dr-tile.wet .dr-face { fill: #2f6a86; }
.dr-tile.gone .dr-face { fill: #2e3a42; transition: fill 0.8s; }
.dr-tile:focus-visible .dr-face { stroke: #f2c050; stroke-width: 3; }
.dr-tile { outline: none; }
.dr-ripple { fill: none; stroke: #9ad0e8; stroke-width: 2; opacity: 0.6; pointer-events: none; }
.dr-plug { fill: #c8d0d4; stroke: #4a545c; stroke-width: 3; pointer-events: none; }
.dr-plug-x { stroke: #4a545c; stroke-width: 3; pointer-events: none; }

/* 격벽 핸들 */
.wh-bg { fill: #1e2830; }
.wh-door { fill: #4a5a66; }
.wh-door-in { fill: #3a4854; }
.wh-wheel { transition: transform 0.9s cubic-bezier(.4, 0, .2, 1); }
.wh-rim { fill: none; stroke: #9aaab4; stroke-width: 9; }
.wh-spoke { stroke: #8a9aa4; stroke-width: 7; stroke-linecap: round; }
.wh-hub { fill: #b8c4cc; }
.wh-pin { fill: #6a7680; }
.wh-dot { font: 700 22px sans-serif; text-anchor: middle; fill: #f2c050; }
.wh-chalk { fill: none; stroke: #c8ffd0; stroke-width: 5; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(120, 240, 160, 0.9)); }
.wh-chalk-text { font-family: "Gowun Batang", serif; font-size: 22px; font-weight: 700; text-anchor: middle; fill: #c8ffd0; filter: drop-shadow(0 0 6px rgba(120, 240, 160, 0.9)); }
@media (prefers-reduced-motion: reduce) { .wh-wheel, .gauge-needle { transition: none; } .sr-hole { animation-duration: 2.4s; } }

/* 휴대폰: 무대가 작으니 손전등 단추와 산소계를 줄인다 */
@media (max-width: 600px) {
  .torch-btn { left: 6px; bottom: 6px; padding: 5px 10px 5px 8px; gap: 6px; font-size: 0.74rem; }
  .torch-btn::before { width: 16px; height: 9px; }
  .stage-gauge { right: 6px; top: 6px; transform: scale(0.72); transform-origin: top right; }
}
