/* ── 「블랙아웃」 ─────────────────────────────────────────
   색: 심야의 남색 · 관제 화면의 청록 · 비상등의 호박. 위험은 붉은색.
   body.theme-blackout 이 붙으면 기본 색을 이 게임의 색으로 바꾼다 (다른 게임의 css 와 같은 방식). */
body.theme-blackout {
  --navy: #101a2a;
  --navy-deep: #070d18;
  --navy-mid: #16243a;
  --navy-light: #2c425c;
  --teal: #2fa89c;
  --teal-light: #7ff0e4;
  --amber: #ffb040;
  --amber-dark: #d08428;
  --cream: #eaf2f6;
  --cream-dim: #9fb0c4;
  --line: rgba(190, 225, 235, 0.18);
  --modal-top: #16243a;
  --font-title: "Do Hyeon", "Noto Sans KR", sans-serif;
  background: radial-gradient(ellipse 90% 520px at 50% 0, rgba(63, 224, 208, 0.12), transparent), #070d18;
}
body.theme-blackout.playing { background: #03060c; }
body.theme-blackout .modal-box { background: linear-gradient(180deg, #16243a, #0b1422); border: 1px solid rgba(127, 240, 228, 0.35); box-shadow: 0 0 0 4px rgba(3, 6, 12, 0.7), 0 18px 60px rgba(0, 0, 0, 0.7); }
body.theme-blackout .pz-layer:empty { display: none; }
body.theme-blackout .scene-svg { animation: bo-in 0.6s ease-out; }
@keyframes bo-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { body.theme-blackout .scene-svg { animation: none; } }

.au-poster.au-blackout { background: linear-gradient(180deg, transparent 45%, rgba(3, 8, 16, 0.94) 78%), url("/img/poster-blackout.svg") center 40% / cover no-repeat, #03060c; }
.game-art.ga-blackout { background: url("/img/poster-blackout.svg") center 40% / cover no-repeat, #03060c; }

/* 더보기: 한서의 교재 한 쪽 */
body.theme-blackout .pz-solved .pz-more-body { background: #efe7d2; color: #2a2620; border-color: #c8bc9c; border-radius: 10px; padding: 14px 16px; }
body.theme-blackout .pz-more-body strong { color: #1a1612; }
.pz-more-gain { color: var(--amber); font-weight: 700; margin-top: 6px; }
.pz-more-gain:empty { display: none; }

/* 문제에 딸린 격자 지도 (number 의 grid) */
.num-grid { display: grid; gap: 3px; max-width: 320px; margin: 0 auto 12px; }
.num-cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 700; color: #06181f; background: rgba(127, 240, 228, 0.22); border-radius: 4px; }
.num-cell.off { background: #2a0e10; box-shadow: inset 0 0 0 2px #7a2a24; }
.num-cell.start { background: #7ff0e4; }
.num-cell.end { background: #ffb040; }

/* ── 2장의 판 ───────────────────────────────────────── */
.rs-board, .pk-board, .lk-board, .bl-board { display: block; width: 100%; height: auto; margin: 0 auto; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); touch-action: none; user-select: none; -webkit-user-select: none; outline: none; }

/* 2-1 찢어진 지도: 누런 종이 위의 격자. 바탕에 지도가 흐리게 */
.rs-board { max-width: 560px; }
.rs-paper { fill: #e9dfc4; }
.rs-back line { stroke: #8a7a5a; stroke-width: 2.4; opacity: 0.45; }
.rs-back circle { fill: #8a7a5a; opacity: 0.4; }
.rs-cell { cursor: pointer; outline: none; }
.rs-box { fill: rgba(255, 255, 255, 0.18); stroke: rgba(90, 70, 40, 0.28); stroke-width: 1; }
.rs-cell:hover .rs-box, .rs-cell:focus-visible .rs-box { fill: rgba(255, 176, 64, 0.32); }
.rs-cell.on .rs-box { fill: rgba(60, 30, 10, 0.28); }
.rs-x { stroke: #3a1a0a; stroke-width: 5; stroke-linecap: round; }
.rs-num { font-size: 11px; font-weight: 700; fill: #4a3a28; pointer-events: none; }

/* 2-5 지하 주차장: 비상등 아래 콘크리트 */
.pk-board { max-width: 460px; background: #0b0e14; }
.pk-floor { fill: #2a2c30; }
.pk-line { stroke: #ffb040; stroke-opacity: 0.16; stroke-width: 1.5; stroke-dasharray: 6 6; }
.pk-exit { fill: #ffb040; opacity: 0.3; }
.pk-arrow { stroke: #ffb040; stroke-width: 4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.pk-car { cursor: grab; }
.pk-car:active { cursor: grabbing; }
.pk-body { fill: #6a7484; stroke: #1a1e26; stroke-width: 2; }
.pk-roof { fill: #000; opacity: 0.22; }
.pk-car.k-mini .pk-body { fill: #ffd23a; }
.pk-car.k-boss .pk-body { fill: #0e1018; stroke: #8a95a8; }
.pk-car.k-van .pk-body { fill: #d8dce2; }
.pk-car.picked .pk-body { stroke: #7ff0e4; stroke-width: 3; }
.pk-tag { font-size: 15px; font-weight: 700; fill: #3a2a00; pointer-events: none; }
.pk-tag.boss { fill: #c8d2e0; font-size: 13px; }

/* 2-10 도시를 켜라: 꺼진 도시. 이어진 구역은 그 색으로 불이 들어온다 */
.lk-board { max-width: 440px; }
.lk-bg { fill: #05080f; }
.lk-cell { fill: #101826; stroke: #1c2a3e; stroke-width: 1; transition: fill 0.4s; }
.lk-cell.lit { fill: color-mix(in srgb, var(--lk) 26%, #101826); }
.lk-cell.blocked { fill: #2a0e10; stroke: #7a2a24; }
.lk-block path { stroke: #ff6a5a; stroke-width: 4; stroke-linecap: round; opacity: 0.8; }
.lk-block text { fill: #ffb0a0; font-size: 11px; font-weight: 700; }
.lk-path { fill: none; stroke-width: 18; stroke-linecap: round; stroke-linejoin: round; opacity: 0.9; pointer-events: none; }
.lk-dot { stroke: #05080f; stroke-width: 3; pointer-events: none; }
.lk-dot.on { filter: drop-shadow(0 0 6px #fff8); }
.lk-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: center; font-size: 0.85rem; color: var(--cream-dim); }
.lk-tag { display: inline-flex; align-items: center; gap: 5px; }
.lk-tag i { width: 10px; height: 10px; border-radius: 50%; background: var(--lk); opacity: 0.4; }
.lk-tag.on { color: var(--cream); }
.lk-tag.on i { opacity: 1; box-shadow: 0 0 8px var(--lk); }

/* 2-4 지연 맞추기: 관제 화면 위의 배전 나무 */
.bl-board { max-width: 640px; }
.bl-bg { fill: #06181f; }
.bl-hit { stroke: transparent; stroke-width: 28; fill: none; cursor: pointer; }
.bl-wire { stroke: #3fe0d0; stroke-width: 3; fill: none; opacity: 0.7; pointer-events: none; }
.bl-edge.added .bl-wire { stroke: #ffb040; }
.bl-edge.picked .bl-wire { stroke-width: 6; opacity: 1; }
.bl-edge { outline: none; }
.bl-pill { fill: #0a2c38; stroke: #3fe0d0; stroke-width: 1.5; cursor: pointer; }
.bl-edge.added .bl-pill { stroke: #ffb040; }
.bl-edge.picked .bl-pill, .bl-edge:focus-visible .bl-pill { fill: #ffb040; }
.bl-w { font-size: 14px; font-weight: 700; fill: #cfe4ec; pointer-events: none; }
.bl-edge.picked .bl-w, .bl-edge:focus-visible .bl-w { fill: #1a1200; }
.bl-node circle { fill: #7ff0e4; }
.bl-node.root circle { fill: #ffb040; }
.bl-name { font-size: 14px; fill: #cfe4ec; }
.bl-sum { font-size: 16px; font-weight: 700; fill: #9fb0c4; }
.bl-node.top .bl-sum { fill: #ffb040; }
.bl-pick { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 6px 12px; border-radius: 12px; background: var(--navy-deep); border: 1px solid var(--line); }
.bl-pick .btn { margin: 0; min-width: 44px; }
.bl-pick.empty { color: var(--cream-dim); }

/* 2-7 호출 부호: 무게 글자 · 2-8 권한 잠금: 관제 화면 색 */
.px-weight { color: var(--cream-dim); font-weight: 400; }
body.theme-blackout .nm-bg { fill: #06181f; }
body.theme-blackout .nm-box { stroke: #2c425c; }
body.theme-blackout .nm-plate { fill: #3fe0d0; stroke: #06181f; opacity: 0.9; }
body.theme-blackout .nm-plate:hover, body.theme-blackout .nm-plate:focus-visible { fill: var(--amber); }
body.theme-blackout .nm-name { fill: #cfe4ec; }
