/* 「기억의 법정」 화면 스타일
   --u : 장면 그림(1536×1024)의 1픽셀이 화면에서 차지하는 크기. 가로 화면의 대사창과 버튼은 이 단위로 놓는다.
   가로 화면(.land): 대사창과 버튼이 3:2 장면 위에 겹친다.
   세로 화면(.port): 위에 3:2 장면, 아래에 대사창과 버튼 (DS 방식). */

/* 글꼴: 리디바탕. game/fonts/RIDIBatang.(woff2, woff, otf, ttf 중 하나)가 있으면 그 파일을 쓰고(인터넷 없이도 됨),
   없으면 인터넷(눈누 CDN)에서 받는다. 둘 다 안 되면 기기 기본 글꼴로 보인다. */
@font-face {
  font-family: "RIDIBatang";
  src: local("RIDIBatang"), local("리디바탕"),
       url("../fonts/RIDIBatang.woff2") format("woff2"),
       url("../fonts/RIDIBatang.woff") format("woff"),
       url("../fonts/RIDIBatang.otf") format("opentype"),
       url("../fonts/RIDIBatang.ttf") format("truetype"),
       url("https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_twelve@1.0/RIDIBatang.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #13224a;
  --navy-deep: #0b1430;
  --gold: #e8b84a;
  --gold-light: #ffe29a;
  --red: #b3342f;
  --blue: #3563c9;
  --green: #3fa45b;
  --cross: #a6f0a0;      /* 반대 심문 증언 글자 */
  --point: #ffb13b;      /* 〔추궁 단어〕 */
  --hl: #ffd76a;         /* **강조** */
  --thought: #9fd6ff;    /* (속마음) */
  --font: "RIDIBatang", "Noto Serif KR", "AppleMyungjo", "Batang", "바탕", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", "Nanum Gothic", "Noto Sans CJK KR", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; background: #000; color: #fff;
  font-family: var(--font);
  overflow: hidden;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior: none;
}
button { font-family: inherit; touch-action: manipulation; }
img { -webkit-user-drag: none; }
/* 어디서 열어도 같게: 그림 크기 제한 규칙(img{max-width:100%})을 게임 안에서는 쓰지 않는다 */
#app img { max-width: none; }
[hidden] { display: none !important; }

#app { position: fixed; inset: 0; overflow: hidden; background: #000; --u: 0.5px; --k: 0.42; }

/* ─────────────── 장면 ─────────────── */
#stage { position: absolute; overflow: hidden; background: #000; }
.layer { position: absolute; inset: 0; width: 100%; height: 100%; }
#scene { position: absolute; inset: 0; transition: filter 1.2s; }
#bg { object-fit: cover; z-index: 1; transition: filter .8s; }
#cut { object-fit: cover; z-index: 2; }
#char {
  position: absolute; z-index: 3;
  left: 16.667%; width: 66.667%; top: 0; height: 100%;
  object-fit: contain; object-position: 50% 100%;
  transition: opacity .6s, filter .8s;
}
#char.back { top: 14%; height: 86%; }
/* 법정 자리별 인물 크기: 몸 아래쪽이 책상·난간 뒤에 숨도록 */
#stage[data-seat="증언대"] #char { left: 23.333%; width: 53.333%; top: 16.6%; height: 80%; }
#stage[data-seat="증언대"] #char.back { left: 30%; width: 40%; top: 34%; height: 62%; }
#stage[data-seat="피고석"] #char { left: 21.667%; width: 56.667%; top: 11.2%; height: 85%; }
#stage[data-seat="변호인석"] #char { left: 16%; width: 58.667%; top: 12%; height: 88%; }
#stage[data-seat="검사석"] #char { left: 25.333%; width: 58.667%; top: 12%; height: 88%; }
#stage[data-seat="재판장석"] #char { left: 20%; width: 60%; top: 10%; height: 90%; }
/* 면회실: 유리창 바로 뒤에 앉은 모습. 그림 아래 끝(허리)이 유리창 아래 틀(y≈790) 뒤로 들어가 앞그림에 가려진다. 유리 반사를 인물 위에 겹친다 */
#stage[data-bg="면회실"] #char { left: 29.35%; width: 41.3%; top: 16%; height: 62%; clip-path: inset(0 0 7.5% 0); } /* 유리창 아랫단의 밝은 선(y≈752) 바로 위에서 잘라, 유리 안쪽에 있으면서 아랫단과 틈이 없게 */
#glass { z-index: 3; pointer-events: none; display: none;
  background:
    linear-gradient(118deg, transparent 18%, rgba(210, 232, 255, .18) 22%, rgba(210, 232, 255, .07) 27%, transparent 31%,
      transparent 58%, rgba(210, 232, 255, .14) 63%, transparent 69%),
    rgba(150, 185, 215, .11); }
#stage[data-bg="면회실"] #glass { display: block; }
#desk { object-fit: cover; z-index: 4; transition: filter .8s; }

#scene.calm { filter: saturate(.25) brightness(.72); }
#scene.dark #bg, #scene.dark #desk { filter: brightness(.22) saturate(.5); }
#scene.dim #bg { filter: brightness(.42) saturate(.55); }
#scene.lowlight #bg, #scene.lowlight #desk { filter: brightness(.48) saturate(.6); } /* 6화: 법정의 조명이 어두워진다 (인물은 그대로) */
#scene.dark #char { filter: drop-shadow(0 0 calc(var(--u) * 40) rgba(255, 240, 200, .25)); }

#photo { z-index: 10; background: #000; opacity: 0; transition: opacity 2.2s; }
#photo.on { opacity: 1; }
#photo-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.caption { position: absolute; inset: 0; pointer-events: none; }
.caption-band { position: absolute; inset: 0; width: 100%; height: 100%; }
.caption-text {
  position: absolute; left: 8.7%; top: 89.9%; height: 5.9%; width: 88%;
  display: flex; align-items: center;
  font-size: max(11px, calc(var(--u) * 26)); color: #f3e3b8; white-space: nowrap; overflow: hidden;
}
/* 가로 화면에서는 대사창에 가리지 않게 출처 띠를 대사창 바로 위로 올린다 */
.land #photo.with-box .caption { transform: translateY(calc(var(--u) * -236)); }
/* 사진 위에 말하는 사람 얼굴이 나올 때는 얼굴(대사창 왼쪽 위의 동그라미)에 "출처" 글자가 가리지 않게, 띠를 같은 높이에 두고 얼굴 오른쪽에서 시작한다
   (예전에는 띠를 화면 가운데까지 올려서 어색했다). 띠 그림이 눌려 보이지 않게, 오른쪽 끝을 기준으로 가로세로 같은 비율로 줄인다 */
.land #photo.with-box.faces .caption { transform-origin: 100% 92.85%; transform: translateY(calc(var(--u) * -236)) scale(.86); }

/* 2화: 비, 확대 화면, 🟩 초록빛 */
#rain { z-index: 2; pointer-events: none; opacity: 0; transition: opacity 1s;
  background: repeating-linear-gradient(104deg, transparent 0 22px, rgba(200, 220, 255, .22) 22px 24px, transparent 24px 60px);
  background-size: 120px 240px; animation: rainfall .45s linear infinite; }
#rain.on { opacity: 1; }
@keyframes rainfall { from { background-position: 0 0; } to { background-position: -40px 240px; } }
#closeup { z-index: 10; background: #000; opacity: 0; transition: opacity .8s; }
#closeup.on { opacity: 1; }
#closeup img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
#greenglow { z-index: 9; pointer-events: none; opacity: 0; transition: opacity 1.6s;
  background: radial-gradient(ellipse at 50% 45%, rgba(120, 255, 150, .38), rgba(40, 170, 80, .18) 45%, rgba(0, 60, 20, .05) 75%); }
#greenglow.on { opacity: 1; }
#popup .thumb.green { left: 6.5%; top: 40%; width: 14.45%; height: 20%; background: #06231a; }
#popup .upd-stamp { position: absolute; left: 14%; top: 30%; width: 14%; height: auto; animation: stampIn .5s cubic-bezier(.2, 1.4, .5, 1) both; }
@keyframes stampIn { from { opacity: 0; transform: rotate(-12deg) scale(1.8); } to { opacity: 1; transform: rotate(-12deg) scale(1); } }
.quote { color: #f3e3b8; font-style: italic; }
#cards { z-index: 11; pointer-events: none; }
#cards .shown {
  position: absolute; top: calc(var(--u) * 100);
  width: max(84px, calc(var(--u) * 250));
  animation: cardIn .35s ease-out both;
}
#cards .shown.slow { animation: cardIn 1.8s ease-out both; }
#cards .shown.center { width: max(120px, calc(var(--u) * 360)); right: calc(var(--u) * 110); top: calc(var(--u) * 110); }
#cards .shown.left { top: max(calc(var(--u) * 200), 50px); } /* 왼쪽 카드: 신뢰도 촛불(왼쪽 위) 아래에 */
@keyframes cardIn { from { opacity: 0; transform: translateY(-10px) scale(.92); } to { opacity: 1; transform: none; } }
#big img.stamp { inset: auto; right: calc(var(--u) * 60); top: calc(var(--u) * 520); width: max(70px, calc(var(--u) * 190)); height: auto; animation: shoutPop 1.2s both; }

#hotspots { z-index: 12; pointer-events: none; }
.hotspot {
  position: absolute; pointer-events: auto; cursor: pointer;
  border: none; background: transparent; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.hotspot .mag {
  width: max(52px, calc(var(--u) * 150)); height: max(52px, calc(var(--u) * 150));
  border-radius: 50%; background: rgba(0, 0, 0, .35);
  box-shadow: 0 0 0 3px rgba(255, 226, 154, .85), 0 0 18px rgba(255, 210, 110, .8);
  display: flex; align-items: center; justify-content: center;
  animation: pulse 1.6s ease-in-out infinite;
}
.hotspot .mag img { width: 82%; height: 82%; object-fit: contain; }
.hotspot.done .mag { animation: none; opacity: .6; box-shadow: 0 0 0 3px rgba(160, 160, 160, .8); }
.hotspot.done .mag::after { content: "✓"; position: absolute; font-size: max(20px, calc(var(--u) * 60)); color: #aef0a9; font-weight: 900; text-shadow: 0 0 4px #000; }
.hotspot .label {
  position: absolute; bottom: -4px; transform: translateY(100%);
  background: rgba(8, 14, 34, .88); border: 1px solid var(--gold); border-radius: 8px;
  padding: 2px 8px; font-size: max(12px, calc(var(--u) * 26)); color: var(--gold-light); white-space: nowrap;
}
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

#popup { z-index: 18; pointer-events: none; }
#popup .band { position: absolute; inset: 0; width: 100%; height: 100%; animation: popIn .4s ease-out both; }
#popup .thumb {
  position: absolute; left: 6.3%; top: 39.1%; width: 14.4%; height: 20.2%; background: #07102a;
  clip-path: polygon(6% 0, 94% 0, 100% 7%, 100% 93%, 94% 100%, 6% 100%, 0 93%, 0 7%);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  animation: popIn .4s ease-out both;
}
#popup .thumb img { width: 100%; height: 100%; object-fit: contain; }
#popup .thumb.photo img { object-fit: contain; }
/* 실제 사진과 칸을 꽉 채우는 세로 사진(채움)은 칸 끝까지 차서 테두리를 덮으므로, 칸을 사방으로 조금 줄여 테두리 안쪽에 남색 여백을 둔다 */
#popup .thumb.photo, #popup .thumb.fill { left: 7.1%; top: 40.3%; width: 12.8%; height: 17.8%; } /* 빨강·파랑 테두리(popup_evidence_get)의 칸 안쪽: 가로 100~315, 세로 403~603 */
#popup .thumb.green.photo, #popup .thumb.green.fill { left: 7.49%; top: 42.19%; width: 12.57%; height: 16.41%; } /* 초록 테두리(popup_green_get)의 칸 안쪽: 가로 106~317, 세로 423~608 (빨간 테두리보다 아래에 있다) */
#popup .source { position: absolute; inset: 0; transform: translateY(calc(var(--u) * -262)); }
#popup .source .caption-band { position: absolute; inset: 0; width: 100%; height: 100%; }
#popup .thumb .face { height: 100%; aspect-ratio: 1; } /* 얼굴은 정사각형으로 가운데에 (칸이 옆으로 조금 길어서 늘이면 턱이 잘린다) */
#popup .thumb .word { font-size: max(12px, calc(var(--u) * 34)); color: var(--gold-light); font-weight: 800; text-align: center; line-height: 1.2; padding: 4px; word-break: keep-all; } /* 낱말 중간에서 줄이 나뉘지 않게 (일본군/'위안부', BC급/전범 재판) */
@keyframes popIn { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }

#black { z-index: 13; background: #000; opacity: 0; pointer-events: none; transition: opacity .7s; display: flex; align-items: center; justify-content: center; }
#black.on { opacity: 1; }
#subtitle { text-align: center; font-size: max(17px, calc(var(--u) * 50)); line-height: 1.8; color: #eee; padding: 0 6%; word-break: keep-all; }
#subtitle div { opacity: 0; transition: opacity 1.2s; }
#subtitle div.on { opacity: 1; }
#subtitle b { color: var(--gold-light); font-weight: 800; }
/* 겹쳐: 사진이나 컷을 어둡게 비친 채 글을 띄운다 */
#black.veil { background: rgba(0, 0, 0, .66); }
#subtitle.big { font-size: max(20px, calc(var(--u) * 60)); line-height: 1.6; }
#subtitle.long { font-size: max(15px, calc(var(--u) * 40)); line-height: 1.7; text-align: left; max-width: 88%; }
#subtitle.long div + div { margin-top: .8em; }
/* 3화 숫자 화면: 큰 숫자 하나가 줄어들고, 아래에 연도와 설명 */
#subtitle.numbers .num { font-size: max(64px, calc(var(--u) * 260)); font-weight: 900; line-height: 1.1; color: #fff; text-shadow: 0 0 calc(var(--u) * 30) rgba(255, 226, 154, .45); }
#subtitle.numbers .label { font-size: max(17px, calc(var(--u) * 46)); color: #e8dcc0; min-height: 1.8em; }
#subtitle.numbers .label b { color: var(--gold-light); }
#subtitle.numbers .after { font-size: max(16px, calc(var(--u) * 42)); }
/* 3화 위안소 분포도의 표시점 */
#closeup .dots { position: absolute; inset: 0; pointer-events: none; }
#closeup .dots span {
  position: absolute; width: max(5px, calc(var(--u) * 13)); height: max(5px, calc(var(--u) * 13)); margin: calc(var(--u) * -6.5) 0 0 calc(var(--u) * -6.5);
  border-radius: 50%; background: #d8261b; border: max(1px, calc(var(--u) * 2)) solid #ffe0d0;
  box-shadow: 0 0 calc(var(--u) * 10) rgba(255, 60, 40, .8); opacity: 0; transform: scale(2.2); transition: opacity .35s, transform .35s;
}
#closeup .dots span.on { opacity: 1; transform: scale(1); }
/* 3화 1부 마무리: 뒷모습이 법정 문 쪽(안쪽)으로 걸어가며 작아지고 흐려진다 */
/* 법정 문 쪽 배경(증언대 너머 문): 증언대 윗면(y≈68%) 아래는 잘라서 인물이 증언대 뒤에 있게 한다 */
#big .walk-lane { position: absolute; inset: 0; clip-path: inset(0 0 32% 0); }
#big .walk-lane img.walker { position: absolute; inset: auto; left: 50%; bottom: 14%; top: auto; width: auto; height: 62%; object-fit: contain; transform-origin: 50% 100%; filter: brightness(.7); animation: walkAway 3s ease-in both; }
@keyframes walkAway {
  0% { opacity: 0; transform: translateX(-50%) translateY(0) scale(1); }
  15% { opacity: 1; }
  80% { opacity: .9; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-68%) scale(.34); }
}
#big .walk-cap { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: calc(var(--u) * 60) 6% calc(var(--u) * 44); background: linear-gradient(transparent, rgba(0, 0, 0, .78) 45%); text-align: center; font-size: max(15px, calc(var(--u) * 38)); line-height: 1.7; color: #eee; text-shadow: 0 2px 6px #000; transition: opacity .7s; }
#big .walk-cap div { opacity: 0; transition: opacity 1s; }
#big .walk-cap div.on { opacity: 1; }
#big .walk-cap.out { opacity: 0; }

#flash { z-index: 14; background: #fff; opacity: 0; pointer-events: none; }
#flash.go { animation: flash .35s ease-out; }
@keyframes flash { from { opacity: .85; } to { opacity: 0; } }

#big { z-index: 20; pointer-events: none; }
#big img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
#big .pop { animation: shoutPop .9s ease-out both; }
#big .slide { animation: slideIn 1.9s ease-in-out both; }
#big .fadehold { animation: fadeHold 1.6s ease-in-out both; }
#big .verdict-l { left: -22%; transform: scale(.62); animation: slam .45s cubic-bezier(.2, 1.6, .5, 1) both; }
#big .verdict-r { left: 22%; transform: scale(.62); animation: slam .45s cubic-bezier(.2, 1.6, .5, 1) both; }
#big .verdict-all { animation: fadeIn .5s ease-out both; }
@keyframes shoutPop { 0% { opacity: 0; transform: scale(1.35); } 12% { opacity: 1; transform: scale(.96); } 20% { transform: scale(1); } 85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes slideIn { 0% { opacity: 0; transform: translateX(-30%); } 18% { opacity: 1; transform: none; } 82% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateX(30%); } }
@keyframes fadeHold { 0% { opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes slam { from { opacity: 0; scale: 1.8; } to { opacity: 1; scale: 1; } }

#gauge {
  position: absolute; z-index: 15; left: calc(var(--u) * 14); top: calc(var(--u) * 6);
  width: max(130px, calc(var(--u) * 430)); aspect-ratio: 1536 / 500;
  overflow: hidden; pointer-events: none;
}
#gauge .frame { position: absolute; left: 0; width: 100%; top: -40%; height: auto; }
#gauge .candle { position: absolute; width: 22%; top: -3.4%; transition: opacity .6s; }
#gauge .candle.lost { animation: candleOut 1s ease-in both; }
@keyframes candleOut { 0% { filter: brightness(2); } 100% { filter: none; } }

#scene.shake { animation: shake .45s linear; }
#scene.shake-big { animation: shakeBig .8s linear; }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translate(-1.2%, .6%); } 40% { transform: translate(1.2%, -.8%); } 60% { transform: translate(-.8%, .4%); } 80% { transform: translate(.6%, -.2%); } }
@keyframes shakeBig { 0%, 100% { transform: none; } 10% { transform: translate(-2.5%, 1.5%); } 25% { transform: translate(2.5%, -2%); } 40% { transform: translate(-2%, 1%); } 55% { transform: translate(2%, -1%); } 70% { transform: translate(-1.2%, .6%); } 85% { transform: translate(.8%, -.4%); } }
#char.wobble { animation: wobble .9s ease-in-out; }
@keyframes wobble { 0%, 100% { transform: none; } 20% { transform: rotate(-3deg) translateX(-2%); } 45% { transform: rotate(2.5deg) translateX(2%); } 70% { transform: rotate(-1.5deg); } }
#char.fade-in { animation: fadeIn 1.6s ease-out both; }
#char.fade-out { opacity: 0; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ─────────────── 대사창과 버튼 (공통) ─────────────── */
#hud { position: absolute; z-index: 30; pointer-events: none; }
#hud > * { pointer-events: auto; }
#box { position: relative; cursor: pointer; }
#name { font-weight: 800; color: var(--gold-light); white-space: nowrap; overflow: hidden; text-overflow: clip; display: flex; align-items: center; justify-content: center; letter-spacing: .02em; }
#text, #text-measure { line-height: 1.45; word-break: keep-all; overflow-wrap: anywhere; white-space: pre-line; }
#text-measure { position: absolute; visibility: hidden; pointer-events: none; }
#text .ch { opacity: 0; }
#text .ch.on { opacity: 1; }
.cross-text { color: var(--cross); }
.thought { color: var(--thought); }
.hl { color: var(--hl); font-weight: 700; }
.pt, .cross-text.pt { color: var(--point); font-weight: 800; }
.name-line { color: var(--gold-light); font-weight: 800; }
.gem { display: inline-block; width: 1em; height: 1em; vertical-align: -0.04em; margin-right: .2em; background-image: var(--gem-img); background-repeat: no-repeat; background-size: 3.657em auto; }
.gem-r { background-position: -0.257em -1.333em; }
.gem-b { background-position: -1.31em -1.333em; }
.gem-g { background-position: -2.41em -1.333em; }
#text.glow { animation: glowText 1.1s ease-in-out infinite; }
@keyframes glowText { 0%, 100% { text-shadow: 0 0 0 transparent; } 50% { text-shadow: 0 0 10px #fff6b0, 0 0 18px #ffd24a; } }
#next-icon { position: absolute; opacity: 0; pointer-events: none; }
#next-icon.on { opacity: 1; animation: nudge .8s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(5px); } }
#face { border-radius: 50%; background-color: var(--navy-deep); background-repeat: no-repeat; box-shadow: 0 0 0 3px var(--gold), 0 0 0 5px #3a2a0a; display: none; }
#box.has-face #face { display: block; }

.round-btn {
  width: 48px; height: 48px; border-radius: 50%;
  border: 2px solid var(--gold); background: rgba(11, 20, 48, .85); color: var(--gold-light);
  font-size: 22px; line-height: 1; cursor: pointer; padding: 0;
}
.img-btn { border: none; background: transparent; padding: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.img-btn img { width: 100%; height: 100%; object-fit: contain; }
/* 버튼 그림(384×384) 가운데 띠만 보이게 */
.pill { height: 48px; width: calc(48px * 4.49); }
/* 버튼 그림은 가운데 띠(가로:세로 = 4.49:1)만 잘라 보인다 */
.pill img, #btn-record img, #controls .act-btn img { width: 100%; height: auto; aspect-ratio: 364 / 81; object-fit: cover; object-position: 50% 51%; }
.img-btn:active, .round-btn:active, .ui-btn:active { transform: scale(.96); }
.img-btn:disabled { opacity: .4; }

.ui-btn {
  word-break: keep-all; line-height: 1.25;
  min-height: 48px; padding: 8px 18px; border-radius: 12px;
  border: 2px solid var(--gold); background: linear-gradient(#1c3068, var(--navy-deep));
  color: var(--gold-light); font-size: 18px; font-weight: 800; cursor: pointer;
  box-shadow: 0 3px 0 #000, inset 0 1px 0 rgba(255, 255, 255, .15);
}
.ui-btn.sub { border-color: #8a7a55; color: #e6dcc0; background: linear-gradient(#26314f, #121a30); }
.ui-btn:disabled { opacity: .45; }
.ui-btn .done { color: #aef0a9; margin-left: .4em; font-weight: 700; }

#topbar { position: absolute; display: flex; gap: 10px; align-items: center; }
#btn-record { height: 48px; width: calc(48px * 4.49); }

#controls { display: flex; align-items: center; gap: 10px; }
#controls .grow { flex: 1; }
#controls .act-btn { height: 52px; width: calc(52px * 4.49); }
#controls .arrow { width: 52px; height: 52px; border-radius: 12px; border: 2px solid var(--gold); background: rgba(11, 20, 48, .88); color: var(--gold-light); font-size: 22px; cursor: pointer; }
#controls .count { min-width: 64px; text-align: center; font-weight: 800; color: var(--gold-light); font-size: 16px; text-shadow: 0 1px 3px #000; }
#controls .count small { display: block; font-size: 12px; color: #cfc2a0; font-weight: 600; }
#controls .help { color: #f3e3b8; font-size: 15px; text-shadow: 0 1px 3px #000; }

#choices { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
#choices .ui-btn { font-size: 19px; text-align: left; }
#choices .ui-btn::before { content: "▶ "; color: var(--gold); }

/* ─────────────── 가로 화면: 장면 위에 겹치기 ─────────────── */
.land #box { position: absolute; inset: 0; pointer-events: none; }
.land #box > * { pointer-events: auto; }
.land #box-img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; opacity: .85; pointer-events: none; }
.land #box::before { content: none; }
.land #name { position: absolute; left: calc(var(--u) * 82); top: calc(var(--u) * 768); width: calc(var(--u) * 318); height: calc(var(--u) * 48); font-size: max(13px, calc(var(--u) * 31)); }
/* 대사창 글: 한 쪽에 두 줄까지 (세 줄이면 창 아래 테두리에 붙는다). 넘치면 screen.js가 문장 → 쉼표 → 띄어쓰기에서 다음 쪽으로 나눈다.
   두 줄 묶음의 가운데가 창 안쪽(남색, 세로 809~998)의 가운데(904)에 오게 둔다. 한 줄이면 같은 자리에서 시작한다.
   높이와 위치는 글자 크기(em) 기준이라, 작은 화면에서 글자가 15px에 걸려도 두 줄이 그대로 들어간다. 증거 알림도 같은 규칙이다 */
.land #text, .land #text-measure {
  position: absolute; left: calc(var(--u) * 100); top: calc(var(--u) * 904 - 1.42em); width: calc(var(--u) * 1336); height: 2.92em; line-height: 1.42;
  font-size: max(15px, calc(var(--u) * 37)); overflow: hidden;
}
/* 쪽을 나눌 수 없는 글(레테의 반격 주장)이 두 줄을 넘을 때만 (screen.js showStatic):
   static2 = 글자 90%로 두 줄 칸에 (위치와 높이가 em 기준이라 그대로 가운데), 그래도 넘치면 static3 = 글자 90%, 촘촘한 줄 간격으로 세 줄을 창 가운데에 */
.land #text.static2, .land #text.static3 { font-size: calc(max(15px, calc(var(--u) * 37)) * .9); }
.land #text.static3 { line-height: 1.3; top: calc(var(--u) * 904 - 1.95em); height: 3.98em; }
.land #next-icon { right: calc(var(--u) * 50); bottom: calc(var(--u) * 24); width: max(26px, calc(var(--u) * 70)); }
.land #face { position: absolute; left: calc(var(--u) * 34); top: calc(var(--u) * 598); width: max(56px, calc(var(--u) * 150)); height: max(56px, calc(var(--u) * 150)); }
.land #box.skin-hint #box-img { transform: translateY(calc(var(--u) * 339)); }
.land #box.skin-tutorial #box-img { transform: translateY(calc(var(--u) * 353)); }
.land #box.skin-hint #name, .land #box.skin-tutorial #name { display: none; }
.land #box.skin-hint #text, .land #box.skin-hint #text-measure,
.land #box.skin-tutorial #text, .land #box.skin-tutorial #text-measure { left: calc(var(--u) * 385); top: calc(var(--u) * 806); width: calc(var(--u) * 1020); height: calc(var(--u) * 172); line-height: 1.45; }
.land #box.skin-hint #next-icon, .land #box.skin-tutorial #next-icon { right: calc(var(--u) * 115); bottom: calc(var(--u) * 58); }
.land.tight #text, .land.tight #text-measure { left: calc(var(--u) * 74); top: calc(var(--u) * 904 - 1.45em); width: calc(var(--u) * 1392); height: 2.98em; line-height: 1.45; }
.land.tight #text.static3 { top: calc(var(--u) * 904 - 1.95em); height: 3.98em; line-height: 1.3; }
.land.tight #box.skin-hint #text, .land.tight #box.skin-hint #text-measure,
.land.tight #box.skin-tutorial #text, .land.tight #box.skin-tutorial #text-measure { left: calc(var(--u) * 370); top: calc(var(--u) * 796); width: calc(var(--u) * 1050); height: calc(var(--u) * 190); }
.land #box.skin-hint #face { display: block; left: calc(var(--u) * 92); top: calc(var(--u) * 776); width: calc(var(--u) * 216); height: calc(var(--u) * 216); box-shadow: none; } /* window_hint 그림의 동그란 칸 안쪽(가로 92~307, 세로 437~651)에 아래로 339 내린 만큼 맞춘다 */
.land #box.skin-tutorial #face { display: none; }

.land #topbar { right: calc(var(--u) * 16); top: calc(var(--u) * 14); }
.land #topbar .round-btn { width: max(40px, calc(var(--u) * 66)); height: max(40px, calc(var(--u) * 66)); font-size: max(18px, calc(var(--u) * 32)); }
.land #btn-record { height: max(40px, calc(var(--u) * 66)); width: calc(max(40px, calc(var(--u) * 66)) * 4.49); }
.land #controls { position: absolute; left: calc(var(--u) * 30); right: calc(var(--u) * 30); bottom: calc(var(--u) * 270 + 6px); height: max(48px, calc(var(--u) * 84)); }
.land #controls .act-btn { height: max(44px, calc(var(--u) * 80)); width: calc(max(44px, calc(var(--u) * 80)) * 4.49); }
.land #controls .arrow { width: max(44px, calc(var(--u) * 80)); height: max(44px, calc(var(--u) * 80)); font-size: max(18px, calc(var(--u) * 36)); }
.land #controls .count { font-size: max(14px, calc(var(--u) * 30)); }
.land #controls .count small { font-size: max(11px, calc(var(--u) * 22)); }
.land #controls .help { font-size: max(13px, calc(var(--u) * 28)); }
.land #controls.low { bottom: calc(var(--u) * 20); }
.land #choices { position: absolute; left: 50%; top: calc(var(--u) * 400); transform: translateX(-50%); width: min(92%, max(280px, calc(var(--u) * 900))); }
.land #choices .ui-btn { font-size: max(16px, calc(var(--u) * 38)); min-height: max(48px, calc(var(--u) * 96)); }

/* ─────────────── 세로 화면: 장면 아래에 대사창과 버튼 ─────────────── */
.port #hud {
  display: flex; flex-direction: column; gap: 10px;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom)) 12px;
  background: linear-gradient(#0a0f1f, #05070d);
}
.port #topbar { position: static; order: 0; justify-content: flex-start; }
.port #btn-record { margin-left: auto; height: 46px; width: calc(46px * 4.49); }
.port #box { order: 1; flex: 1 1 auto; min-height: 150px; max-height: 420px; }
.port #box::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .85;
  border-style: solid; border-color: transparent;
  border-image-source: var(--tb-img);
  border-image-slice: 836 82 49 440 fill;
  border-image-width: calc(var(--k) * 836px) calc(var(--k) * 82px) calc(var(--k) * 49px) calc(var(--k) * 440px);
  border-image-outset: calc(var(--k) * 756px) 0 0 0;
}
.port #box-img { display: none; }
.port #name { position: absolute; left: calc(var(--k) * 82px); top: calc(var(--k) * 12px); width: calc(var(--k) * 318px); height: calc(var(--k) * 48px); font-size: 15px; }
.port #text, .port #text-measure {
  position: absolute; left: calc(var(--k) * 70px + 8px); right: calc(var(--k) * 70px + 8px); top: calc(var(--k) * 80px + 10px); bottom: calc(var(--k) * 40px + 10px);
  font-size: 18px; overflow: hidden;
}
.port #box.has-face #text, .port #box.has-face #text-measure { left: calc(var(--k) * 70px + 84px); }
.port #face { position: absolute; left: calc(var(--k) * 70px + 6px); top: calc(var(--k) * 80px + 12px); width: 64px; height: 64px; }
@media (min-width: 700px) {
  .port #text, .port #text-measure { font-size: 22px; }
  .port #name { font-size: 18px; }
  .port #face { width: 84px; height: 84px; }
  .port #box.has-face #text, .port #box.has-face #text-measure { left: calc(var(--k) * 70px + 108px); }
}
.port #next-icon { right: 16px; bottom: 10px; width: 28px; }
.port #box.skin-hint #name, .port #box.skin-tutorial #name { color: #fff3c4; }
.port #box.skin-hint #face { display: block; }
.port #controls { order: 3; display: grid; grid-template-columns: 64px 1fr 1fr 64px; gap: 10px 12px; align-items: center; }
.port #controls .grow { display: none; }
.port #controls .act-btn { height: auto; width: 100%; max-width: 300px; justify-self: center; padding: 4px 0; }
.port #controls .press { grid-column: 1 / 3; grid-row: 2; }
.port #controls .present { grid-column: 3 / 5; grid-row: 2; }
.port #controls .prev { grid-column: 1; grid-row: 1; }
.port #controls .count { grid-column: 2 / 4; grid-row: 1; }
.port #controls .next { grid-column: 4; grid-row: 1; }
.port #controls .arrow { width: 64px; height: 50px; }
.port #controls .help { grid-column: 1 / 5; text-align: center; }
.port #controls .move, .port #controls .only { grid-column: 1 / 5; }
.port #choices { order: 2; }

/* ─────────────── 전체 화면을 덮는 창 (처음 화면, 법정 기록, 설정 등) ─────────────── */
#overlay { position: absolute; inset: 0; z-index: 100; pointer-events: none; }
#overlay > * { pointer-events: auto; }
.screen {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .78);
  animation: fadeIn .25s ease-out both;
}
.screen.solid { background: #000; }
.screen .art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.screen .art.cover { object-fit: cover; filter: brightness(.45); }
.panel {
  position: relative; max-width: min(640px, 94vw); max-height: 92vh; overflow: auto;
  background: linear-gradient(#162757, #0a1330); border: 3px solid var(--gold); border-radius: 16px;
  box-shadow: 0 0 0 3px #2c1d05, 0 10px 40px rgba(0, 0, 0, .7);
  padding: 22px; color: #f2ead4;
}
.panel h2 { margin: 0 0 14px; color: var(--gold-light); font-size: 22px; text-align: center; }
.panel p { line-height: 1.6; margin: 8px 0; }
.panel .row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.panel .row .ui-btn { flex: 1 1 140px; }
.panel label { display: block; margin: 12px 0 4px; font-weight: 700; color: var(--gold-light); }
.panel input[type=range] { width: 100%; height: 32px; accent-color: var(--gold); }
.seg { display: flex; gap: 6px; }
.seg .ui-btn { flex: 1; font-size: 16px; padding: 6px; }
.seg .ui-btn.on { background: linear-gradient(#e8b84a, #a57a1d); color: #1a1204; }

/* 처음 화면 */
.title-screen { flex-direction: column; background: #000; }
.title-screen .logo { position: relative; width: min(92vw, 150vh); max-height: 58vh; object-fit: contain; margin-top: -4vh; }
.title-screen .menu { position: relative; display: flex; flex-direction: column; gap: 12px; width: min(360px, 86vw); margin-top: 1vh; }
.title-screen .menu .ui-btn { font-size: 20px; }
.title-screen .corner { position: absolute; right: 14px; top: 14px; display: flex; gap: 10px; }
.title-screen .loading { position: relative; color: #cdbf9a; margin-top: 12px; font-size: 15px; min-height: 1.5em; }
.land .title-screen .logo { max-height: 52vh; }

/* 화 제목 */
.episode-title .inner { position: relative; text-align: center; color: var(--gold-light); text-shadow: 0 2px 8px #000; }
.episode-title .no { font-size: clamp(22px, 5vmin, 54px); letter-spacing: .3em; margin-bottom: .4em; }
.episode-title .ttl { font-size: clamp(32px, 9vmin, 96px); font-weight: 900; }
.code-input.text { font-size: 24px; letter-spacing: .05em; }
.art-frame .bottom { gap: 12px; }
.code-input { font-size: 34px; letter-spacing: .4em; text-align: center; width: 100%; padding: 10px; border-radius: 10px; border: 2px solid var(--gold); background: #050a18; color: #fff; font-family: inherit; -webkit-user-select: text; user-select: text; }
.msg { min-height: 1.5em; color: #ffb4a8; text-align: center; margin-top: 8px; }

/* 재판 연기, 다음 화 예고 */
.art-screen .bottom { position: absolute; left: 0; right: 0; bottom: 6%; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.art-screen .next-title { font-size: clamp(22px, 6vmin, 60px); font-weight: 900; color: var(--gold-light); text-shadow: 0 2px 10px #000; }
/* 그림(3:2) 안에서 위치를 잡는 틀 */
.art-frame { position: relative; width: min(100vw, 150vh); aspect-ratio: 3 / 2; }
.art-frame > .art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art-frame .next-title { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; font-size: clamp(22px, 5.5vw, 64px); }
.art-frame .bottom { position: absolute; left: 0; right: 0; bottom: 5%; display: flex; justify-content: center; }
.art-frame .bottom .ui-btn { min-height: 40px; padding: 4px 16px; font-size: clamp(14px, 2.4vw, 20px); }

/* 실제 역사 기록 카드 */
.history-card .panel { max-width: min(760px, 94vw); }
.history-card .panel p { font-size: clamp(16px, 2.4vmin, 21px); }

/* 법정 기록: 역전재판처럼 위에 큰 증거 칸, 아래에 작은 칸 8개.
   가로 화면은 장면 위(대사창 윗부분)에 겹쳐서 아래 대사창이 그대로 보인다. 세로 화면은 화면 전체를 덮는다. */
.screen.record { display: block; background: transparent; }
.rec { position: absolute; display: flex; flex-direction: column; color: #f2ead4; }
.rec .rhead { display: flex; align-items: center; }
.rec .rhead h2 { margin: 0; color: var(--gold-light); white-space: nowrap; }
.rec .tabs { display: flex; flex: 1; min-width: 0; }
.rec .tabs .ui-btn, .rec .close { min-height: 0; padding: 0 1em; }
.rec .tabs .ui-btn.on { background: linear-gradient(#e8b84a, #a57a1d); color: #1a1204; }
/* 기록 색: --kc 테두리, --kbg 설명 칸 바탕, --kline 설명 칸 줄 */
.rinfo, .slot { --kc: #e8b84a; --kbg: #f4e9c8; --kline: rgba(140, 100, 30, .28); }
.rinfo[data-kind="red"], .slot.k-red { --kc: #c9412f; --kbg: #f8e1db; --kline: rgba(160, 45, 30, .26); }
.rinfo[data-kind="blue"], .slot.k-blue { --kc: #3d6fd6; --kbg: #dfe8f7; --kline: rgba(40, 80, 170, .26); }
.rinfo[data-kind="green"], .slot.k-green { --kc: #3fa45b; --kbg: #dcf0dd; --kline: rgba(40, 120, 60, .28); }
.rinfo[data-kind="prosecution"], .slot.k-prosecution { --kc: #8d8a9c; --kbg: #e6e4ea; --kline: rgba(80, 76, 100, .26); }
.rinfo {
  position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: minmax(0, 1fr) auto;
  background: linear-gradient(#1a2a5c, #0b1430); border: 3px solid var(--gold);
  box-shadow: 0 0 0 2px #2c1d05, 0 8px 30px rgba(0, 0, 0, .6);
}
.rinfo > .empty { grid-column: 1 / -1; grid-row: 1 / -1; align-self: center; text-align: center; color: #a99f86; }
.rinfo .pic {
  position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: radial-gradient(#9a958a, #6b675f); border: solid #f6f2e6;
}
.rinfo .pic.card-pic { background: radial-gradient(#22346a, #0b1430); }
.rinfo .pic.can-zoom { cursor: zoom-in; }
.rinfo .pic > img { width: 100%; height: 100%; object-fit: contain; }
.rinfo .pic > .face { height: 100%; aspect-ratio: 1; }
.rinfo .pic > .card { height: 96%; width: auto; }
.rinfo .rside { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.rinfo .rname { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: .8em; background: linear-gradient(#2c2c36, #121218); border-bottom: solid var(--kc); }
.rinfo .rname .nm { font-weight: 800; color: #fff; line-height: 1.25; word-break: keep-all; }
.rinfo .rname .kd { margin-left: auto; color: #e0d4b0; white-space: nowrap; }
.rinfo .rdesc {
  --lh: 1.5em; flex: 1; min-height: 0; overflow-y: auto; line-height: var(--lh);
  color: #2a1d0e; word-break: keep-all;
  background-color: var(--kbg); background-attachment: local;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--lh) - 2px), var(--kline) calc(var(--lh) - 2px), var(--kline) var(--lh));
}
.rinfo .rdesc p { margin: 0; }
.rinfo .rdesc .hl { color: #9a2410; font-weight: 800; }
/* 실제 사진의 출처 띠: caption_source.png 의 띠 부분(x 21~1515, y 921~981)만 잘라 보인다 */
.rinfo .src { grid-column: 1 / -1; position: relative; aspect-ratio: 1494 / 60; overflow: hidden; }
.rinfo .src .band { position: absolute; left: -1.406%; top: -1535%; width: 102.81%; height: auto; }
.rinfo .src span { position: absolute; left: 7.6%; right: 2%; top: 0; bottom: 0; display: flex; align-items: center; color: #f3e3b8; white-space: nowrap; overflow: hidden; }
.rstrip { position: relative; display: flex; align-items: center; justify-content: center; }
.rstrip .slots { display: flex; }
.rstrip .arrow { border: 2px solid var(--gold); background: rgba(11, 20, 48, .9); color: var(--gold-light); cursor: pointer; padding: 0; }
.rstrip .arrow:disabled { opacity: .3; cursor: default; }
.rstrip .pg { color: var(--gold-light); font-weight: 800; text-align: center; text-shadow: 0 1px 3px #000; }
.slot {
  position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 0;
  background: radial-gradient(#9a958a, #6b675f); border: solid var(--kc); cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.slot img { width: 100%; height: 100%; object-fit: contain; }
.slot .face { height: 100%; aspect-ratio: 1; }
.slot .word { font-weight: 800; color: var(--gold-light); text-align: center; line-height: 1.2; word-break: keep-all; padding: 4%; }
.slot.k-concept, .slot.item:not(:has(img)):not(:has(.face)) { background: radial-gradient(#22346a, #0b1430); }
.slot.on { z-index: 1; transform: scale(1.07); box-shadow: 0 0 0 3px var(--gold-light), 0 0 18px 5px rgba(255, 215, 110, .85); }
.slot.empty { background: rgba(150, 150, 150, .5); border-color: rgba(200, 200, 200, .45); cursor: default; }
#app:has(.screen.record) #topbar { visibility: hidden; } /* 법정 기록이 열리면 위쪽 버튼(설정·법정 기록)은 숨긴다 */
.rbtns { display: flex; justify-content: center; align-items: center; }
.rbtns .bb img { width: 100%; height: auto; aspect-ratio: 364 / 81; object-fit: cover; object-position: 50% 51%; }

/* 가로 화면: 장면 1536×1024 기준 단위(--u)로 놓는다. 대사창 이름표(y≈760) 위까지만 쓴다 */
.land .rec {
  left: var(--sx); top: var(--sy); width: var(--sw); height: calc(var(--sh) * .735);
  padding: calc(var(--u) * 16) calc(var(--u) * 40); gap: calc(var(--u) * 14);
  background: rgba(3, 6, 16, .8); border-radius: 0 0 calc(var(--u) * 24) calc(var(--u) * 24);
}
.land.tight .rec { height: var(--sh); border-radius: 0; background: rgba(3, 6, 16, .94); } /* 휴대폰 가로: 자리가 좁아 장면 전체를 쓴다 */
.land .rhead { flex: 0 0 auto; min-height: calc(var(--u) * 66); gap: calc(var(--u) * 16); }
.land .rhead h2 { font-size: max(15px, calc(var(--u) * 36)); }
.land .rec .tabs { gap: calc(var(--u) * 12); }
.land .rec .tabs .ui-btn, .land .rec .close { height: max(34px, calc(var(--u) * 62)); font-size: max(13px, calc(var(--u) * 28)); border-radius: calc(var(--u) * 14); }
.land .rinfo { flex: 1 1 auto; min-height: 0; padding: calc(var(--u) * 16); column-gap: calc(var(--u) * 22); row-gap: calc(var(--u) * 12); border-radius: calc(var(--u) * 16); }
.land .rinfo .pic { width: calc(var(--u) * 330); height: 100%; border-width: calc(var(--u) * 7); border-radius: calc(var(--u) * 6); }
.land .rinfo .rside { gap: calc(var(--u) * 10); }
.land .rinfo .rname { padding: calc(var(--u) * 8) calc(var(--u) * 22); border-bottom-width: calc(var(--u) * 5); border-radius: calc(var(--u) * 6); }
.land .rinfo .rname .nm { font-size: max(16px, calc(var(--u) * 44)); }
.land .rinfo .rname .kd { font-size: max(11px, calc(var(--u) * 24)); }
.land .rinfo .rdesc { font-size: max(13px, calc(var(--u) * 33)); padding: 0 calc(var(--u) * 22); border-radius: calc(var(--u) * 6); }
.land .rinfo .src span { font-size: max(10px, calc(var(--u) * 22)); }
.land .rstrip { flex: 0 0 auto; gap: calc(var(--u) * 14); }
.land .rstrip .slots { gap: calc(var(--u) * 12); }
.land .slot { width: max(40px, calc(var(--u) * 126)); height: max(40px, calc(var(--u) * 126)); border-width: max(2px, calc(var(--u) * 5)); border-radius: calc(var(--u) * 10); }
.land .slot .word { font-size: max(9px, calc(var(--u) * 20)); }
.land .rstrip .arrow { width: max(30px, calc(var(--u) * 56)); height: max(40px, calc(var(--u) * 110)); border-radius: calc(var(--u) * 12); font-size: max(14px, calc(var(--u) * 28)); }
.land .rstrip .pg { width: calc(var(--u) * 80); font-size: max(12px, calc(var(--u) * 26)); }
.land .rbtns { flex: 0 0 auto; height: max(38px, calc(var(--u) * 80)); gap: calc(var(--u) * 30); }
.land .rbtns .bb { height: max(38px, calc(var(--u) * 80)); width: calc(max(38px, calc(var(--u) * 80)) * 4.49); }

/* 세로 화면: 화면 전체를 덮고 위에서 아래로 쌓는다 */
.port .rec {
  inset: 0; overflow-y: auto; gap: 10px; background: rgba(4, 8, 20, .96);
  padding: calc(10px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));
}
.port .rhead { flex-wrap: wrap; gap: 8px; }
.port .rhead h2 { flex: 1; font-size: 19px; }
.port .rec .close { order: 2; height: 42px; font-size: 16px; border-radius: 10px; }
.port .rec .tabs { order: 3; flex: 0 0 100%; gap: 8px; }
.port .rec .tabs .ui-btn { flex: 1; height: 42px; font-size: 15px; border-radius: 10px; }
.port .rinfo {
  flex: none; grid-template-columns: min(38vw, 230px) minmax(0, 1fr); grid-template-rows: auto auto auto;
  grid-template-areas: "pic name" "desc desc" "src src"; gap: 10px; padding: 10px; border-radius: 12px;
}
.port .rinfo .rside { display: contents; }
.port .rinfo .pic { grid-area: pic; width: 100%; aspect-ratio: 1; border-width: 5px; border-radius: 6px; }
.port .rinfo .rname { grid-area: name; flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; padding: 10px 12px; border-bottom-width: 4px; border-radius: 6px; }
.port .rinfo .rname .nm { font-size: 20px; }
.port .rinfo .rname .kd { margin-left: 0; font-size: 13px; white-space: normal; }
.port .rinfo .rdesc { grid-area: desc; font-size: 16px; padding: 0 12px; border-radius: 6px; max-height: 34vh; }
.port .rinfo .src { grid-area: src; }
.port .rinfo .src span { font-size: 11px; }
.port .rstrip { flex: none; flex-wrap: wrap; gap: 10px 14px; }
.port .rstrip .slots { order: -1; flex: 0 0 100%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 auto; max-width: 440px; }
.port .slot { width: auto; aspect-ratio: 1; border-width: 3px; border-radius: 8px; }
.port .slot .word { font-size: 12px; }
.port .rstrip .arrow { width: 56px; height: 42px; border-radius: 10px; font-size: 18px; }
.port .rstrip .pg { min-width: 56px; font-size: 16px; }
.port .rbtns { flex: none; gap: 12px; flex-wrap: wrap; }
.port .rbtns .bb { height: 48px; width: calc(48px * 4.49); max-width: 46vw; }
.port .rbtns .bb img { height: 100%; }

/* 증거 카드 (카드 틀 그림 위에 증거 그림과 이름을 얹는다) */
.card { position: relative; aspect-ratio: 480 / 640; overflow: hidden; container-type: inline-size; }
.card > .frame { position: absolute; left: -16.667%; top: 0; width: 133.333%; height: 100%; }
.card .win { position: absolute; left: 9.4%; width: 81.2%; top: 25%; height: 38.3%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.card.card-green .win { left: 12.04%; width: 76.02%; top: 20.65%; height: 40.83%; } /* 초록 테두리(card_green)는 그림 창이 빨간 테두리보다 조금 위에 있고 좁다 (창: 가로 270~984, 세로 259~771 / 1254) */
.card .win img { width: 100%; height: 100%; object-fit: contain; }
/* 겹친 증거 그림 (지도 + 점): 두 장을 같은 자리에 포갠다 */
.ev-stack { position: relative; width: 100%; height: 100%; }
/* 사진 여러 장을 함께 (5화 신발과 가방 더미): 칸이 넓으면 옆으로, 좁으면 위아래로 나란히 */
.ev-duo { width: 100%; height: 100%; container-type: size; }
.ev-duo .duo-in { width: 100%; height: 100%; display: flex; flex-direction: column; gap: 3px; background: #000; }
@container (min-aspect-ratio: 3 / 2) { .ev-duo .duo-in { flex-direction: row; } }
.ev-duo .duo-in > img { flex: 1 1 0; min-width: 0; min-height: 0; width: 100%; height: 100%; object-fit: cover !important; }
.ev-stack > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.card .win.photo img { object-fit: cover; }
.card .win .face { width: auto; height: 100%; aspect-ratio: 1; } /* 얼굴은 정사각형으로 가운데에 (칸이 옆으로 길어서 늘이면 얼굴이 반만 보인다) */
.card .win.text { align-items: flex-start; }
.card .win .mini { font-size: 10px; font-size: 5.8cqw; line-height: 1.35; color: #3b2a0e; padding: 7% 8% 0; text-align: left; word-break: keep-all; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.card.card-concept .win .mini, .card.card-red .win .mini, .card.card-green .win .mini { color: #f2ead4; }
.card .win .word { font-size: 14px; font-size: 10cqw; font-weight: 900; color: #3b2a0e; text-align: center; line-height: 1.2; padding: 4%; word-break: keep-all; }
.card.card-concept .win .word, .card.card-red .win .word, .card.card-green .win .word { color: var(--gold-light); }
.card .nm { position: absolute; left: 9.4%; width: 81.2%; top: 69.5%; height: 20.3%; display: flex; align-items: center; justify-content: center; text-align: center; font-weight: 800; line-height: 1.2; font-size: 13px; font-size: 8.4cqw; padding: 0 4%; word-break: keep-all; }
.card.card-blue .nm { color: #2a2410; }
.card.card-red .nm, .card.card-concept .nm, .card.card-green .nm, .card.card-prosecution .nm { color: #fff; } /* 남색·짙은 이름 칸은 흰 글씨 */

.zoom { background: #000; flex-direction: column; z-index: 5; } /* 법정 기록에서 고른 작은 칸(.slot.on, z-index 1)이 확대 그림 위에 비치지 않게 */
.zoom .wrap { position: relative; flex: 1; width: 100%; overflow: auto; display: flex; align-items: center; justify-content: center; }
/* #app img { max-width: none } 보다 앞서도록 #app 을 붙인다 (없으면 휴대폰 세로 화면에서 확대 그림이 화면보다 커져 잘린다) */
#app .zoom .wrap img { max-width: 100%; max-height: 100%; object-fit: contain; }
#app .zoom .wrap.big img { max-width: none; max-height: none; width: 200%; }
.zoom .photo-box { position: relative; width: min(100vw, 150vh - 150px); aspect-ratio: 3 / 2; }
.zoom .photo-box > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.zoom .bar { display: flex; gap: 10px; padding: 10px; justify-content: center; width: 100%; }

.log .panel { width: min(760px, 96vw); max-height: 86vh; }
.log .lines { max-height: 62vh; overflow: auto; }
.log .line { padding: 8px 4px; border-bottom: 1px solid rgba(255, 255, 255, .08); line-height: 1.55; }
.log .line b { color: var(--gold-light); margin-right: .5em; }

.toast { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); background: rgba(8, 14, 34, .92); border: 2px solid var(--gold); border-radius: 12px; padding: 8px 16px; color: var(--gold-light); font-weight: 700; pointer-events: none; animation: fadeHold 2.6s both; }

/* ─────────────── 4화에서 더한 연출 ─────────────── */
/* 안내창의 [건너뛰기] (조작 복습) */
.skip-btn { font-size: 15px; min-height: 36px; padding: 4px 14px; }
.land .skip-btn { position: absolute; right: calc(var(--u) * 110); top: calc(var(--u) * 690); font-size: max(13px, calc(var(--u) * 26)); min-height: max(32px, calc(var(--u) * 58)); padding: 2px max(10px, calc(var(--u) * 24)); }
.port .skip-btn { order: 2; align-self: flex-end; margin-right: 12px; }

/* 이름표: 한글 이름 + 알파벳 (독일 인물이 처음 나올 때) */
.name-tag {
  position: absolute; z-index: 16; left: calc(var(--u) * 40); top: calc(var(--u) * 40); pointer-events: none;
  display: flex; flex-direction: column; align-items: flex-start; gap: calc(var(--u) * 4);
  padding: max(6px, calc(var(--u) * 14)) max(14px, calc(var(--u) * 36));
  background: linear-gradient(#1b2d63, #0a1330); border: max(2px, calc(var(--u) * 4)) solid var(--gold); border-radius: max(8px, calc(var(--u) * 14));
  box-shadow: 0 0 0 max(1px, calc(var(--u) * 3)) #2c1d05, 0 6px 18px rgba(0, 0, 0, .6); color: var(--gold-light);
  opacity: 0; transform: translateX(-20%); transition: opacity .5s, transform .6s cubic-bezier(.2, 1.2, .4, 1);
}
.name-tag.on { opacity: 1; transform: none; }
.name-tag b { font-size: max(16px, calc(var(--u) * 48)); font-weight: 900; line-height: 1.15; }
.name-tag small { font-size: max(12px, calc(var(--u) * 30)); color: #e6dcc0; letter-spacing: .06em; font-family: Georgia, 'Times New Roman', serif; font-style: italic; }

/* 오프닝 창문 그림자 (컷 위에 그림자 그림 네 장) */
#scene .shadows { z-index: 2; pointer-events: none; opacity: 0; transition: opacity 1.6s; }
#scene .shadows.on { opacity: 1; }
#scene .shadows img { object-fit: cover; transition: opacity 1.1s; }
#scene .shadows img.gone { opacity: 0; }

/* 회상: 가장자리가 흐려지고, 얼굴이 스쳐 간다 */
.recall-veil {
  z-index: 8; pointer-events: none; opacity: 0; transition: opacity 1.2s;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(24, 16, 6, .55) 76%, rgba(0, 0, 0, .88) 100%);
  -webkit-backdrop-filter: blur(6px) sepia(.55); backdrop-filter: blur(6px) sepia(.55);
  -webkit-mask-image: radial-gradient(ellipse at center, transparent 36%, #000 74%); mask-image: radial-gradient(ellipse at center, transparent 36%, #000 74%);
}
.recall-veil.on { opacity: 1; }
.recall-faces { z-index: 9; pointer-events: none; }
.recall-faces .rf {
  position: absolute; bottom: 0; height: 92%; width: auto; opacity: 0;
  filter: sepia(.7) grayscale(.3) brightness(.9);
  -webkit-mask-image: radial-gradient(ellipse at 50% 38%, #000 38%, transparent 70%); mask-image: radial-gradient(ellipse at 50% 38%, #000 38%, transparent 70%);
  animation: recallFace 2.8s ease-in-out both;
}
@keyframes recallFace { 0% { opacity: 0; transform: translateX(-5%) scale(1.05); } 30% { opacity: .85; } 65% { opacity: .85; } 100% { opacity: 0; transform: translateX(5%) scale(1); } }
/* 마지막 얼굴: 나타난 뒤 그대로 남는다. 자막이 사라질 때 .out 으로 천천히 지운다 */
.recall-faces .rf.hold { animation: recallFaceHold 1.8s ease-out both; }
@keyframes recallFaceHold { 0% { opacity: 0; transform: translateX(-3%) scale(1.05); } 100% { opacity: .85; transform: none; } }
.recall-faces { transition: opacity 1.4s; }
.recall-faces.out { opacity: 0; }

/* 세계 지도: 동아시아에서 세계로 넓어진다, 두 불길 */
#closeup img.map-zoom { transform-origin: 0 0; opacity: 0; transition: opacity .6s; }
#closeup img.map-zoom.on { opacity: 1; }
#closeup img.map-zoom.out { transition: opacity .6s, transform 3.2s cubic-bezier(.45, 0, .3, 1); }
#closeup .fires { position: absolute; inset: 0; pointer-events: none; }
.fires .fire {
  position: absolute; width: 20%; aspect-ratio: 1; border-radius: 50%; opacity: 0; transform: translate(-50%, -50%) scale(0);
  background: radial-gradient(circle, rgba(255, 214, 96, .95) 0%, rgba(240, 112, 30, .85) 28%, rgba(190, 32, 10, .5) 55%, transparent 72%);
  mix-blend-mode: multiply; transition: transform 1.8s ease-out, opacity 1.2s;
}
.fires .fire.on { opacity: 1; transform: translate(-50%, -50%) scale(1); animation: flicker 1.3s ease-in-out 1.8s infinite; }
.fires .fire.eu { left: 52%; top: 29%; }
.fires .fire.as { left: 80%; top: 37%; }
.fires .fire-band {
  position: absolute; left: 52%; top: 24%; width: 28.5%; height: 10%; border-radius: 50%; opacity: 0;
  transform-origin: 0 50%; transform: rotate(10.8deg) scaleX(0);
  background: radial-gradient(ellipse, rgba(240, 112, 30, .75) 0%, rgba(190, 32, 10, .4) 55%, transparent 72%);
  mix-blend-mode: multiply; transition: transform 2s ease-in-out, opacity 1s;
}
.fires .fire-band.on { opacity: 1; transform: rotate(10.8deg) scaleX(1); }
@keyframes flicker { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.18); } }

/* 손에 든 사진 (레비 가족사진) */
.held-photo {
  position: absolute; z-index: 11; left: 3%; top: 4%; width: 40%; aspect-ratio: 3 / 2; pointer-events: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .7); opacity: 0; transform: rotate(-4deg) translateY(-8%); transition: opacity .7s, transform .7s;
}
.held-photo.on { opacity: 1; transform: rotate(-4deg); }
.held-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* S 겹치기: 반쪽씩 잘라 가운데로 모은다 */
#closeup .halves { position: absolute; inset: 0; isolation: isolate; }
#closeup .half { position: absolute; top: 0; width: 50%; height: 100%; background-size: 200% 100%; background-repeat: no-repeat; transition: transform 2.8s cubic-bezier(.45, 0, .3, 1); }
#closeup .half.left { left: 0; background-position: 0 0; }
#closeup .half.right { left: 50%; background-position: 100% 0; mix-blend-mode: multiply; }

/* 종이 한 장 (레아의 마지막 일기, 적십자 편지) */
#subtitle.paper-mode { padding: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
#subtitle .paper {
  width: 62%; height: 84%; box-sizing: border-box; padding: 4.5% 6%; overflow: hidden; border-radius: 4px;
  background: #efe3c4; box-shadow: 0 8px 30px rgba(0, 0, 0, .7), inset 0 0 40px rgba(150, 110, 60, .25);
  color: #3a2a14; text-align: left; font-size: max(13px, calc(var(--u) * 38)); line-height: 1.75; opacity: 0; transition: opacity .8s;
}
#subtitle .paper.on { opacity: 1; }
#subtitle .paper div { opacity: 0; transition: opacity 1.2s; }
#subtitle .paper div.on { opacity: 1; }
#subtitle .paper div + div { margin-top: .35em; }
#subtitle .paper .head { font-weight: 800; text-align: center; margin-bottom: .6em; }
#subtitle .paper b { color: #7a1c10; }
.port #subtitle .paper { width: 86%; height: 90%; }

/* 초록 서랍: 🟩 카드가 오른쪽 서랍장으로 들어간다 */
.drawer-cards {
  position: absolute; z-index: 11; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6%; pointer-events: none;
  opacity: 0; transform-origin: 94% 58%; transition: opacity .8s, transform 1.7s cubic-bezier(.55, 0, .85, .4);
}
.drawer-cards.in { opacity: 1; }
.drawer-cards.go { opacity: 0; transform: scale(.04); transition: opacity 1.7s ease-in, transform 1.7s cubic-bezier(.55, 0, .85, .4); }
.drawer-cards .card { width: max(96px, calc(var(--u) * 330)); }
.drawer-cards.takeout { transform-origin: 90% 3%; } /* 6화 꺼내기: [법정 기록] 버튼 쪽으로 */
.drawer-spot {
  position: absolute; z-index: 10; left: 94%; top: 58%; width: 18%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(150, 255, 180, .85), rgba(60, 200, 110, .4) 45%, transparent 70%); mix-blend-mode: screen; opacity: 0; transition: opacity .8s;
}
.drawer-spot.on { opacity: 1; }

/* 지난 기록 카드 (게임 2 시작) */
.past-records { flex-direction: column; gap: 10px; }
.pc-count { color: #cdbf9a; font-size: 14px; }
.past-card { width: min(640px, 94vw); animation: flipIn .5s ease-out both; }
@keyframes flipIn { from { opacity: 0; transform: perspective(800px) rotateY(-25deg) translateX(-20px); } to { opacity: 1; transform: none; } }
.past-card .people { display: flex; justify-content: center; gap: 28px; align-items: flex-end; margin-bottom: 8px; }
.past-card .who { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.past-card .who small { color: #cdbf9a; font-size: 13px; }
.past-card .face { width: 96px; height: 96px; border-radius: 50%; border: 3px solid var(--gold); background-color: #1c2a55; }
.past-card .culprits { display: flex; gap: 8px; align-items: flex-end; }
/* 진범 얼굴: 피고처럼 둥근 칸에 색으로. 최종 진범(맨 마지막)은 크게, 금색 테두리 */
.past-card .cface { width: clamp(48px, 10vmin, 68px); height: clamp(48px, 10vmin, 68px); border-radius: 50%; border: 2px solid #8a7550; background-color: #1c2a55; }
.past-card .cface.final { width: clamp(64px, 14vmin, 96px); height: clamp(64px, 14vmin, 96px); border: 3px solid var(--gold); }
.past-card p { font-size: clamp(15px, 2.4vmin, 19px); line-height: 1.6; margin: 6px 0; word-break: keep-all; }
.past-card p.ttl { text-align: center; font-size: clamp(18px, 3vmin, 24px); color: var(--gold-light); font-weight: 800; }
.past-card .hl { color: var(--gold-light); font-weight: 800; }

/* 부 제목 (게임 2 타이틀, 제2부) */
.part-title .art-frame { animation: fadeIn 1.2s ease-out both; }
.part-title .part-text { position: absolute; left: 6%; right: 6%; top: 41%; height: 33%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--gold-light); text-shadow: 0 2px 8px #000; }
.part-title .small { font-size: clamp(16px, 3.4vw, 38px); letter-spacing: .12em; margin-bottom: .45em; color: #f2e2b0; }
.part-title .big { font-size: clamp(22px, 5.4vw, 64px); font-weight: 900; }
.title-screen .part-badge { position: relative; margin: -2vh 0 1vh; color: var(--gold-light); font-weight: 800; font-size: clamp(15px, 2.6vmin, 22px); text-shadow: 0 2px 6px #000; }

/* 확대해서 알게 된 것: [자세히 보기] 화면 아래에 신중한의 생각 */
.zoom-thought { display: flex; align-items: center; gap: 12px; width: min(900px, 96vw); margin: 0 auto; padding: 10px 14px; box-sizing: border-box; background: rgba(11, 20, 48, .92); border: 2px solid var(--gold); border-radius: 12px; opacity: 0; transform: translateY(10px); transition: opacity .6s, transform .6s; }
.zoom-thought.on { opacity: 1; transform: none; }
.zoom-thought .face { flex: none; width: 56px; height: 56px; border-radius: 50%; box-shadow: 0 0 0 2px var(--gold); background-color: var(--navy-deep); }
.zoom-thought .tx { color: var(--thought); font-size: clamp(15px, 2.4vmin, 20px); line-height: 1.5; word-break: keep-all; }

/* ─────────────── 5화 ─────────────── */
/* 증언 듣기: 어두운 피고석 (법정 밖 배경이라 재판장은 얼굴로만 나온다). 인물은 피고석 자리 크기 그대로 */
#stage[data-bg="피고석 (어둡게)"] #char { left: 21.667%; width: 56.667%; top: 11.2%; height: 85%; }

/* 실제 사진: 같은 증거의 다른 사진으로 천천히 바뀌고(신발 → 가방), 사진에 천천히 다가간다 */
#photo .photo-next { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; opacity: 0; transition: opacity 1.2s; } /* 바탕을 검게: 비율이 다른 사진(가로로 긴 가방 사진)이어도 아래 사진이 위아래로 비치지 않게 */
#photo .photo-next.on { opacity: 1; }
#photo-img.push, #photo .photo-next.push { animation: photoPush 9s ease-out both; }
@keyframes photoPush { from { transform: scale(1); } to { transform: scale(1.22); } }

/* 물건만 띄우기 (천에 싼 은식기): 액자 없이 그림자만 */
.held-photo.object { width: 30%; aspect-ratio: 1; box-shadow: none; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .75)); }
.held-photo.object img { object-fit: contain; }

/* 수용소 분포도: 마지막에 크게 켜지는 한 곳, 이름이 적힌 점 그림으로 바뀜 */
#closeup .dots span.big { width: max(9px, calc(var(--u) * 30)); height: max(9px, calc(var(--u) * 30)); margin: calc(var(--u) * -15) 0 0 calc(var(--u) * -15); transform: scale(3); animation: dotPulse 1.4s ease-in-out .4s 2; }
#closeup .dots span.big.on { transform: scale(1); }
@keyframes dotPulse { 50% { box-shadow: 0 0 calc(var(--u) * 40) calc(var(--u) * 10) rgba(255, 60, 40, .9); } }
#closeup .dots { transition: opacity .9s; }
#closeup .dots.fade { opacity: 0; }
#closeup img.dots-art { opacity: 0; transition: opacity .9s; }
#closeup img.dots-art.on { opacity: 1; }

/* 번호 겹치기: 두 칸(4:3)이 나란히 나타났다가 가운데로 모여 겹친다 */
#closeup .sbs { position: absolute; inset: 0; pointer-events: none; isolation: isolate; }
.sbs-panel {
  position: absolute; top: 27.5%; width: 40%; aspect-ratio: 4 / 3; overflow: hidden; background: #000;
  border: max(2px, calc(var(--u) * 5)) solid var(--gold); border-radius: max(6px, calc(var(--u) * 14));
  box-shadow: 0 8px 30px rgba(0, 0, 0, .8); opacity: 0; transform: translateY(6%);
  transition: opacity .9s, transform .9s, left 2.6s cubic-bezier(.45, 0, .3, 1), box-shadow .9s;
}
.sbs-panel.left { left: 6%; }
.sbs-panel.right { left: 54%; }
.sbs-panel.on { opacity: 1; transform: none; }
.sbs-panel img { position: absolute; height: auto; max-width: none; }
.sbs.meet .sbs-panel { left: 30%; }
.sbs.meet .sbs-panel.right { opacity: .9; mix-blend-mode: multiply; border-color: transparent; background: transparent; box-shadow: none; } /* 종이와 팔이 함께 비쳐 두 번호가 한 자리에 겹친다 */
.sbs.glow .sbs-panel.left { box-shadow: 0 0 0 max(2px, calc(var(--u) * 5)) var(--gold-light), 0 0 calc(var(--u) * 70) rgba(255, 226, 154, .8); }

/* 희생 기록: 지도 위 사람 아이콘 셋 (아이콘 그림 한 장을 셋으로 나눠 쓴다) */
#closeup .icon-row { position: absolute; left: 20%; width: 60%; top: 30%; aspect-ratio: 3 / 1; display: flex; pointer-events: none; }
#closeup .icon-row .icon { flex: 1; background-size: 300% 100%; background-repeat: no-repeat; opacity: 0; transform: translateY(8%); transition: opacity .9s, transform .9s; filter: drop-shadow(0 0 calc(var(--u) * 14) rgba(255, 255, 255, .35)); }
#closeup .icon-row .icon.on { opacity: 1; transform: none; }
#closeup .icon-row .icon.gone { opacity: 0; transition: opacity 3s ease-in; }

/* [자세히 보기]의 뒤집기 (금시계 앞면 ↔ 뒷면), 뒷면을 보면 그림 아래에 나오는 글 */
#app .zoom .wrap img.flip-face { transition: transform .26s ease-in; }
#app .zoom .wrap img.flip-face.turn { transform: scaleX(0); }
.zoom-caption { width: min(900px, 96vw); margin: 0 auto 8px; text-align: center; color: var(--gold-light); font-size: clamp(16px, 2.8vmin, 24px); line-height: 1.5; opacity: 0; transition: opacity .6s; }
.zoom-caption.on { opacity: 1; }
.zoom-caption b { font-weight: 900; font-size: 1.2em; }
#closeup .sbs-panel img { right: auto; bottom: auto; height: auto; object-fit: fill; } /* #closeup img(화면 가득)보다 앞서게 */
/* 회색 외투의 남자 (전신 실루엣): 다른 인물보다 멀리, 수용소 안쪽에 선 것처럼 조금 작게 */
#char[data-key="characters/greycoat_silhouette"] { top: 20%; height: 72%; filter: brightness(.85); }
/* 실제 역사 기록 카드: 휴대폰 가로처럼 낮은 화면에서는 글을 줄여 [계속]까지 한 화면에 보이게 (5화는 문단이 6개) */
@media (max-height: 500px) {
  .history-card .panel { max-width: 96vw; padding: 12px 18px; }
  .history-card .panel h2 { font-size: 18px; margin-bottom: 6px; }
  .history-card .panel p { font-size: 13px; line-height: 1.45; margin: 4px 0; }
  .history-card .panel .row { margin-top: 8px; }
}

/* ─────────── 6화 ─────────── */
/* 하야시: 변호인석에서 신중한 옆에 설 때 그림을 좌우로 뒤집는다 (transform을 쓰는 등장·흔들림 효과와 겹치지 않게 scale로) */
#char.flip { scale: -1 1; }
/* 방탄유리 부스 (아이히만): 증언대 배경 앞에 부스 앞틀(유리는 반투명, cut_ep6_glass_booth_front)을 겹친다.
   유리 칸(y 7%~58%) 너머로 머리부터 서류를 든 손까지 보이게 조금 작게 세운다 */
#stage[data-seat="방탄유리 부스"] #char { left: 26.667%; width: 46.667%; top: 13.5%; height: 70%; }
/* 부스 앞틀은 그림 안에서 y 977에서 끝나서, 그대로 두면 그 아래로 배경(증언대 배경)의 증언대 받침이 보인다.
   앞틀(켜짐·꺼짐 모두)을 46점(4.5%) 내려 받침이 화면 아래 끝에 닿게 하고, 아이히만도 같은 만큼 내렸다 (위 top 9% → 13.5%) */
#stage[data-seat="방탄유리 부스"] #desk { transform: translateY(4.5%); }
/* 깨진 증언 문장: 붉은 줄 (절반만 깨졌을 때는 점선) */
.cross-text.struck { text-decoration: line-through; text-decoration-color: #e0413a; text-decoration-thickness: .14em; }
.cross-text.struck.half { text-decoration-style: dashed; }
/* 유죄 (6화 히틀러): 나누지 않고 한 번에 조용히 */
#big .verdict-quiet { animation: fadeIn 2.4s ease-out both; }
/* 이름표 아래 한 줄 더 */
.name-tag small.note { font-family: inherit; font-style: normal; letter-spacing: 0; }

/* 몽타주: 어두운 화면에 얼굴과 글이 한 줄씩 */
.montage { z-index: 12; background: rgba(0, 0, 0, .86); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .8s; pointer-events: none; }
.montage.on { opacity: 1; }
.montage .m-row { position: absolute; display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 36); opacity: 0; transform: translateY(2%); transition: opacity .9s, transform .9s; width: 100%; }
.montage .m-row.on { opacity: 1; transform: none; }
.montage .m-faces { display: flex; gap: calc(var(--u) * 40); justify-content: center; }
.montage .m-face { width: calc(var(--u) * 300); height: calc(var(--u) * 300); border-radius: 50%; filter: sepia(.6) grayscale(.35); box-shadow: 0 0 calc(var(--u) * 40) rgba(0, 0, 0, .6); }
.montage .m-cap { color: #eee; font-size: max(16px, calc(var(--u) * 48)); text-align: center; padding: 0 6%; word-break: keep-all; line-height: 1.5; }
.montage .m-cap b { color: var(--gold-light); font-weight: 800; }

/* 기억의 벽: 이름이 새겨진 벽돌 (cut_ep6_wall_bricks, 1024×512 안에 벽돌 하나) */
.bricks { z-index: 6; display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: center; gap: calc(var(--u) * 6) calc(var(--u) * 10); padding: 4% 6% 0; pointer-events: none; }
.bricks .brick { width: calc(var(--u) * 380); aspect-ratio: 2 / 1; background: center / 100% 100% no-repeat; display: flex; align-items: center; justify-content: center; opacity: 0; transform: translateY(-40%) scale(1.2); transition: opacity .6s, transform .6s cubic-bezier(.2, 1.3, .5, 1); }
.bricks .brick.on { opacity: 1; transform: none; }
.bricks .brick span { color: #2e1c10; font-weight: 800; font-size: max(11px, calc(var(--u) * 36)); text-shadow: 0 1px 0 rgba(255, 230, 200, .35); text-align: center; padding: 0 12%; word-break: keep-all; line-height: 1.2; }
.bricks .brick.long span { font-size: max(10px, calc(var(--u) * 28)); }

/* 표 화면 (두 나라의 결말) */
.table-screen .panel { max-width: min(920px, 96vw); }
.table-screen .tbl-wrap { overflow-x: auto; }
.table-screen table { border-collapse: collapse; width: 100%; font-size: clamp(13px, 2.1vmin, 18px); line-height: 1.5; }
.table-screen th, .table-screen td { border: 1px solid rgba(255, 226, 154, .35); padding: .55em .7em; vertical-align: top; text-align: left; }
.table-screen thead th { text-align: center; color: var(--gold-light); }
.table-screen tbody th { color: var(--gold-light); white-space: nowrap; }
.table-screen .hl { color: var(--gold-light); font-weight: 800; }

/* ─────────────── 선생님 창 (game/js/teacher.js): 비밀번호 → 재판 공략 가이드 ─────────────── */
.teacher-btn {
  height: 48px; padding: 0 16px; border-radius: 24px;
  border: 2px solid #8a7a55; background: rgba(11, 20, 48, .85); color: #e6dcc0;
  font-size: 16px; font-weight: 800; cursor: pointer;
}
.teacher-btn:active { transform: scale(.96); }
.teacher-login .panel { width: min(440px, 94vw); }
.screen.teacher-view {
  flex-direction: column; align-items: stretch; justify-content: flex-start;
  background: #0a1330;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
.teacher-view .t-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 8px 12px; border-bottom: 3px solid var(--gold); background: linear-gradient(#162757, #0a1330);
}
.teacher-view .t-title { flex: 1 1 220px; color: var(--gold-light); font-size: 18px; font-weight: 800; word-break: keep-all; }
.teacher-view .t-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.teacher-view .t-btns .ui-btn, .teacher-view .seg .ui-btn { min-height: 40px; padding: 4px 14px; font-size: 15px; }
.teacher-view .seg { flex: 0 1 auto; }
.teacher-view .t-msg { color: #ffd9a0; font-size: 14px; padding: 0 12px; background: #0a1330; }
.teacher-view .t-msg:empty { display: none; }
.teacher-view .t-msg:not(:empty) { padding: 6px 12px; }
.teacher-view .guide-frame { flex: 1 1 auto; width: 100%; min-height: 0; border: 0; background: #f2f3f6; }
.teacher-login .t-what { text-align: center; color: var(--gold-light); font-weight: 800; word-break: keep-all; }
.teacher-login .t-how { text-align: center; word-break: keep-all; }
