:root {
  --bg: #0f1420;
  --wood: #2a1f18;
  --gold: #d4af37;
  --paper: #f5e9d0;
  --stamp: #b3261e;

  --ink: #e8e3d6;
  --ink-dim: #9a927f;
  --line: rgba(212, 175, 55, 0.28);
  --serif: "Nanum Myeongjo", "Apple SD Gothic Neo", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo",
    "Malgun Gothic", sans-serif;
  --radius: 14px;
  --col: 480px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* 법정 배경: 뷰포트 고정 레이어. body에 attachment:fixed로 걸면 iOS Safari가
   무시하고 문서 높이만큼 늘려 그려서(긴 판결문 스크롤 시 판사석이 거대해짐) 분리했다.
   가로폭 비율 유지 + 바닥 정렬 — 위 여백은 딥네이비로 자연스럽게 채워진다. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  /* 어두운 오버레이(맨 앞 레이어) + 법정 배경 이미지 + 딥네이비 폴백.
     오버레이로 배경 명도를 낮춰 카드·글씨 대비를 올린다(배경은 알아볼 정도로 남긴다). */
  background:
    linear-gradient(rgba(8, 10, 16, 0.45), rgba(8, 10, 16, 0.45)),
    url("/static/assets/bg.svg") center bottom / cover no-repeat,
    var(--bg);
  pointer-events: none;
}

.serif { font-family: var(--serif); letter-spacing: -0.01em; }
.muted { color: var(--ink-dim); }
.small { font-size: 0.82rem; }

/* ── 헤더 문패 ───────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: var(--col);
  margin: 0 auto;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0));
  padding-top: calc(12px + env(safe-area-inset-top, 0));
  background: linear-gradient(180deg, rgba(42, 31, 24, 0.96), rgba(42, 31, 24, 0.82));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.brand {
  flex: 1;
  margin: 0;
  font-family: var(--serif);
  font-size: 1.25rem;
  color: var(--gold);
  text-align: center;
  letter-spacing: 0.06em;
}
.topbar-right { display: flex; gap: 4px; }
.icon-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--gold);
  font-size: 1.2rem;
  line-height: 1;
  padding: 6px 8px;
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--line); }
.icon-btn:active { transform: scale(0.94); }

/* ── 무대(화면 컨테이너) ─────────────────────────────── */
.stage {
  max-width: var(--col);
  margin: 0 auto;
  padding: 18px 16px 48px;
}
.screen { animation: fade 0.28s ease; }
.screen[hidden] { display: none; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── 카드 ────────────────────────────────────────────── */
.card {
  background: rgba(18, 14, 10, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
}
.notice { margin: 8px 0 0; color: var(--gold); }
.eyebrow {
  margin: 0 0 4px;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}
h2.serif { margin: 0 0 6px; font-size: 1.4rem; }

/* ── 폼·입력 ─────────────────────────────────────────── */
input, select, button, textarea { font: inherit; }
input[type="email"],
input[type="text"],
input[type="number"],
input[type="date"],
select {
  width: 100%;
  padding: 12px 14px;
  margin-top: 6px;
  background: rgba(245, 233, 208, 0.06);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  outline: none;
}
input:focus, select:focus { border-color: var(--gold); }
.dossier-form label,
#summon-form label { display: block; margin-bottom: 12px; font-size: 0.9rem; color: var(--ink-dim); }
#summon-form { margin-top: 14px; }

/* ── 버튼 ────────────────────────────────────────────── */
.btn-primary, .btn-ghost {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
}
.btn-primary {
  background: linear-gradient(180deg, var(--gold), #b8952c);
  color: #241a06;
  border: none;
}
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary:not(:disabled):active { transform: translateY(1px); }
.btn-ghost {
  background: var(--wood);
  color: var(--gold);
  border: 1.5px solid var(--gold);
}
.btn-ghost:active { transform: translateY(1px); }
.btn-skip {
  display: block;
  margin: 0 0 10px auto;
  background: var(--wood);
  border: 1.5px solid var(--gold);
  color: var(--gold);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

/* ── 업로드 ──────────────────────────────────────────── */
.upload-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 16px;
  margin: 14px 0;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
}
.upload-drop:hover { border-color: var(--gold); }
.upload-icon { font-size: 2rem; }
.upload-preview {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  margin-bottom: 8px;
}
/* 보조 파괴 액션: 작은 알약, 우측 정렬, 우드 배경 + 도장색 테두리·붉은 글씨 */
.btn-remove {
  display: block;
  margin: 0 0 12px auto;
  padding: 6px 14px;
  background: var(--wood);
  color: #ff9a90;
  border: 1.5px solid var(--stamp);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-remove:active { transform: translateY(1px); }

/* ── 법정 ────────────────────────────────────────────── */
/* 판사 가운데·크게, 증거물 액자는 오른쪽에 크게 (겹치지 않게 세로 스택 기반) */
.courtroom-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.judge { width: 68%; max-width: 260px; display: block; margin: 0 auto; }
.evidence-frame {
  margin: 0 0 0 auto;   /* 오른쪽 배치 */
  width: 52%;
  max-width: 220px;
  text-align: center;
}
.evidence-frame img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 7px solid var(--wood);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}
.evidence-frame figcaption {
  margin-top: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}
/* 데스크톱·발표 화면: 판사 가운데, 증거물 우측 나란히 */
@media (min-width: 481px) {
  .courtroom-top { flex-direction: row; align-items: flex-end; justify-content: center; gap: 24px; }
  .judge { width: 48%; margin: 0; }
  .evidence-frame { margin: 0; width: 44%; }
}

/* 심증 게이지 */
.gauge-wrap { margin: 6px 0 14px; }
.gauge-track {
  height: 10px;
  background: rgba(245, 233, 208, 0.1);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.gauge-fill {
  height: 100%;
  background: linear-gradient(90deg, #7a1d16, var(--stamp));
  transition: width 0.5s ease;
}
/* 게이지 라벨·유력 유형: 어두운 반투명 칩 + 키운 글씨 */
.gauge-label {
  display: inline-block;
  margin: 10px 0 0;
  padding: 5px 12px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--paper);
  background: rgba(10, 8, 6, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.gauge-suspect {
  display: inline-block;
  margin: 8px 0 0;
  padding: 5px 12px;
  font-size: 1rem;
  color: var(--gold);
  background: rgba(10, 8, 6, 0.72);
  border: 1px solid var(--gold);
  border-radius: 999px;
}

/* 판사 말풍선 */
.judge-bubble {
  position: relative;
  font-size: 1.35rem;
  line-height: 1.65;
  color: var(--paper);
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 0 0 16px;
}
.judge-bubble::before {
  content: "⚖ 판사";
  display: block;
  font-family: var(--sans);
  font-size: 0.82rem;
  letter-spacing: 0.15em;
  color: var(--gold);
  margin-bottom: 8px;
}
.reaction { margin: 12px 0 0; font-size: 1.02rem; color: var(--gold); font-style: italic; }
.choice.selected { border-color: var(--gold); background: rgba(212, 175, 55, 0.18); }
.choice:disabled { opacity: 0.55; cursor: default; }

.opening { font-size: 1.02rem; color: var(--gold); margin: 0 0 14px; }
.question-text { font-size: 1.12rem; margin: 0 0 14px; }

/* 최후 변론 */
textarea#plea-text {
  width: 100%;
  padding: 12px 14px;
  margin-top: 8px;
  background: rgba(245, 233, 208, 0.06);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  outline: none;
  resize: vertical;
  font-family: var(--sans);
}
textarea#plea-text:focus { border-color: var(--gold); }
.counter { text-align: right; margin: 4px 0 0; }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice {
  text-align: left;
  padding: 16px;
  font-size: 1.08rem;
  background: rgba(245, 233, 208, 0.05);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  cursor: pointer;
}
.choice:hover { border-color: var(--gold); background: rgba(212, 175, 55, 0.08); }
.choice:active { transform: scale(0.99); }

/* 후보 선택 리스트 (조서 양피지 위) */
.candidate-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 4px; }
.choice.candidate {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(90, 61, 18, 0.4);
  color: #2a2117;
}
.choice.candidate .muted { color: #7a5a2a; }
.choice.candidate:hover { background: rgba(212, 175, 55, 0.22); }
.choice.candidate.selected { border-color: #8a5a1c; background: rgba(212, 175, 55, 0.3); }
#candidate-picker > .muted { color: #7a5a2a; }
.progress { margin-top: 14px; text-align: right; }

/* ── 판결 ────────────────────────────────────────────── */
.verdict-stage { text-align: center; margin: 10px 0 18px; position: relative; min-height: 170px; display: grid; place-items: center; }
.gavel-knock { width: 96px; }
.gavel-knock.go { animation: knock3 1.1s ease-in-out; transform-origin: 70% 70%; }
@keyframes knock3 {
  0%, 100% { transform: rotate(-16deg); }
  15% { transform: rotate(8deg); }
  30% { transform: rotate(-16deg); }
  45% { transform: rotate(8deg); }
  60% { transform: rotate(-16deg); }
  75% { transform: rotate(8deg); }
}
.stamp { width: 170px; }
.stamp.go { animation: slam 0.42s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes slam {
  0% { transform: scale(2.4) rotate(-14deg); opacity: 0; }
  60% { transform: scale(0.92) rotate(-6deg); opacity: 1; }
  100% { transform: scale(1) rotate(-6deg); }
}
.verdict-label { font-size: 1.6rem; color: var(--gold); margin: 8px 0 0; }

.reveal { animation: fade 0.45s ease; }

/* 유형 카드 프레임 — SVG(360x520)의 원형 홀·텍스트 자리에 HTML을 겹친다 */
.type-frame {
  width: min(440px, 92%);
  aspect-ratio: 360 / 520;
  margin: 0 auto 8px;
  position: relative;
  background: url("/static/assets/type-card-frame.svg?v=3") center / contain no-repeat;
}
.type-frame .type-emoji {
  position: absolute;
  left: 50%;
  top: 42.3%;
  transform: translate(-50%, -50%);
  font-size: 4.6rem;
  line-height: 1;
}
/* 유형명 한 줄 — 코드가 있던 자리(67.7%)에 크게. axisCode 표기 없음. */
.type-frame .type-name {
  position: absolute;
  left: 50%;
  top: 67.7%;
  transform: translate(-50%, -50%);
  width: 90%;
  text-align: center;
  white-space: nowrap;      /* 줄바꿈 금지 (폰트는 JS가 길이 기반 축소) */
  font-weight: 800;
  line-height: 1.1;
  color: #2a1f18;
  /* font-size는 JS(typeNameFontSize)가 지정 */
}

/* 형량 박스 + 회당 단가 딱지 */
/* 판결문 라벨 섹션 (양피지 안) — 발표장 뒷자리 가독성 */
.verdict-doc h2 { text-align: center; }
.vsec { margin: 0 0 16px; }
.vsec:last-child { margin-bottom: 0; }
.vlabel {
  margin: 0 0 4px;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #8a5a1c;
}
.vval { margin: 0; font-size: 1.15rem; color: #241a10; line-height: 1.6; }
.crime-headline { font-size: 2rem; font-weight: 800; color: var(--stamp); line-height: 1.2; }
.evidence-list { margin: 0; padding-left: 1.2em; }
.evidence-list li { font-size: 1.1rem; color: #241a10; margin-bottom: 4px; }
.guilt-emph { font-size: 1.3rem; color: var(--stamp); }

/* 회당 단가 딱지 */
.cost-strip { text-align: center; margin-bottom: 14px; }
.cost-tag {
  display: inline-block;
  padding: 8px 16px;
  background: var(--stamp);
  color: #fff;
  border-radius: 999px;
  font-size: 1.05rem;
  font-weight: 700;
  transform: rotate(-3deg);
}
.verdict-actions { display: flex; flex-direction: column; }

.paper {
  background: var(--paper);
  color: #2a2117;
  border-radius: 8px;
  padding: 22px 20px;
  margin-bottom: 14px;
  font-family: var(--serif);
  line-height: 1.8;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  background-image: linear-gradient(rgba(120, 90, 40, 0.05) 1px, transparent 1px);
  background-size: 100% 1.8em;
}
.paper h2 { margin: 0 0 12px; color: #5a3d12; font-size: 1.2rem; }
.paper .sentence { font-weight: 700; margin-top: 14px; }

/* ── 조서(양피지 폼) ─────────────────────────────────── */
.dossier-paper h2 { color: #3b2a12; }
.eyebrow.dark { color: #8a5a1c; }
.dossier-evidence { position: relative; display: flex; justify-content: center; margin: 8px 0 14px; }
.dossier-evidence img {
  width: auto;
  max-width: min(440px, 100%);
  max-height: 48vh;
  aspect-ratio: auto;
  object-fit: contain;
  border: 5px solid var(--wood);
  border-radius: 6px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}
.thumb-emoji {
  width: 42%;
  max-width: 160px;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  font-size: 3rem;
  border: 5px solid var(--wood);
  border-radius: 6px;
  background: rgba(90, 61, 18, 0.12);
}
.dossier-form label { color: #5a3d12; }
.dossier-form input,
.dossier-form select {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(90, 61, 18, 0.4);
  color: #2a2117;
}
.dossier-form input:focus,
.dossier-form select:focus { border-color: #8a5a1c; }

.type-card { text-align: center; }
/* 유형 카드의 이모지·이름은 .type-frame 안에서만 스타일링한다 (axisCode 표기 없음) */
.type-source { margin-top: 12px; }

/* ── 전과 기록 ───────────────────────────────────────── */
.records-summary { margin: 2px 0 6px; color: var(--gold); }
.record-list { list-style: none; margin: 12px 0 0; padding: 0; }
.record-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
}
.r-thumb {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.r-thumb-emoji {
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  background: rgba(245, 233, 208, 0.06);
}
.record-item .r-main { flex: 1; min-width: 0; }
.record-item .r-item { font-weight: 600; }
.record-item .r-sub { font-size: 0.8rem; color: var(--ink-dim); }
.mini-stamp {
  font-size: 0.72rem;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1.5px solid var(--line);
  white-space: nowrap;
  transform: rotate(-4deg);
  font-weight: 700;
}
.mini-stamp.GUILTY { color: #ff9a90; border-color: rgba(179, 38, 30, 0.7); }
.mini-stamp.PROBATION { color: var(--gold); border-color: rgba(212, 175, 55, 0.6); }
.mini-stamp.INNOCENT { color: #9fd6a0; border-color: rgba(120, 190, 120, 0.6); }
.records-empty-box { text-align: center; padding: 18px 0; }
.records-empty-box .btn-primary { max-width: 220px; margin: 12px auto 0; }

/* ── 전과 상세 모달 ──────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 60; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(6, 8, 12, 0.72); }
.modal-sheet {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--col);
  max-height: 86vh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
  padding: 22px 18px calc(28px + env(safe-area-inset-bottom, 0));
  animation: rise 0.28s ease;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--ink-dim);
  font-size: 1.1rem;
  cursor: pointer;
}
.modal-stamp-row { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.modal-stamp { width: 64px; transform: rotate(-6deg); }
.modal-item { font-size: 1.15rem; }
.modal-type { color: var(--gold); margin-bottom: 12px; }
.modal-paper { font-size: 0.95rem; }
.modal-plea { margin-top: 12px; font-style: italic; }

/* 심문 기록 (접이식) */
.interrogation {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.interrogation summary {
  cursor: pointer;
  color: var(--gold);
  font-family: var(--serif);
  list-style: none;
}
.interrogation summary::-webkit-details-marker { display: none; }
.interrogation summary::before { content: "▸ "; }
.interrogation[open] summary::before { content: "▾ "; }
.qa-list { list-style: none; margin: 12px 0 0; padding: 0; }
.qa-item { padding: 10px 0; border-top: 1px dashed var(--line); }
.qa-item:first-child { border-top: none; }
.qa-q { color: var(--ink); font-family: var(--serif); }
.qa-a { color: var(--gold); margin-top: 4px; font-size: 0.9rem; }
.qa-a::before { content: "— "; color: var(--ink-dim); }

/* ── 로딩 오버레이 ───────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(8, 10, 16, 0.82);
  backdrop-filter: blur(3px);
}
.overlay[hidden] { display: none; }
.overlay-inner { text-align: center; color: var(--gold); }
.overlay-inner p { font-size: 1.5rem; font-weight: 600; margin-top: 16px; }
.gavel-spin {
  width: 140px;
  animation: knock 0.9s ease-in-out infinite;
  transform-origin: 70% 70%;
}
@keyframes knock {
  0%, 100% { transform: rotate(-18deg); }
  50% { transform: rotate(6deg); }
}

/* ── 토스트 ──────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 50;
  max-width: calc(var(--col) - 32px);
  width: max-content;
  padding: 12px 18px;
  background: var(--stamp);
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  font-size: 0.9rem;
  animation: rise 0.24s ease;
}
.toast[hidden] { display: none; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (min-width: 481px) {
  .stage { padding-top: 28px; }
}

/* ── 발표·데스크톱 확대 (팀 피드백 8/29 심야: 큰 화면에서 글씨가 너무 작음) ──
   전 컴포넌트가 rem 기반이라 루트 폰트만 키우면 함께 스케일된다. 칼럼도 넓힘. */
@media (min-width: 900px) {
  html { font-size: 19px; }
  :root { --col: 760px; }
  .judge { max-width: 340px; }
  .evidence-frame { max-width: 300px; }
  .gavel-spin { width: 190px; }
  .type-frame { width: min(480px, 92%); }
}
@media (min-width: 1400px) {
  html { font-size: 21px; }
  :root { --col: 840px; }
}

/* ── 증거물: 골드 액자 SVG에 사진을 끼워 오른쪽에 건다 (팀 피드백 8/29, 직접 수정) ──
   액자 내부 투명창 = viewBox(300x380)의 x38..262 / y38..342 → 12.6%/10%, 74.7%x80% */
.evidence-frame {
  position: relative;
  width: 56%;
  max-width: 270px;
  aspect-ratio: 300 / 380;
}
/* 액자를 사진 "앞" 레이어로 — 리본(증거물 제1호)·금테가 사진 가장자리를 덮는다 */
.evidence-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/static/assets/evidence-frame.svg") center / contain no-repeat;
  pointer-events: none;
}
.evidence-frame img {
  position: absolute;
  left: 12.6%;
  top: 10%;
  width: 74.7%;
  height: 80%;
  object-fit: cover;
  aspect-ratio: auto;
  border: none;
  border-radius: 2px;
  box-shadow: none;
  background: rgba(0, 0, 0, 0.25);
}
.evidence-frame figcaption { display: none; } /* 리본("증거물 제1호")이 SVG에 있음 */
/* 넓은 화면: 오른쪽 벽에 고정으로 건다 (스크롤해도 벽에 걸려 있음) */
@media (min-width: 1350px) {
  .evidence-frame {
    position: fixed;
    right: 1.5vw;
    top: 96px;
    width: clamp(340px, 24vw, 460px);
    max-width: none;
    margin: 0;
    z-index: 5;
  }
  .courtroom-top { justify-content: center; }
}


/* ── 배경 2단계: 재판 시작부터 판사가 판사석에 앉은 배경으로 전환 ── */
body.with-judge::before {
  background:
    linear-gradient(rgba(8, 10, 16, 0.35), rgba(8, 10, 16, 0.35)),
    url("/static/assets/bg-judge.svg") center bottom / cover no-repeat,
    var(--bg);
}
body.with-judge .judge { display: none; } /* 판사는 배경에 있음 — 콘텐츠 판사 숨김 */
body.with-judge .stage { padding-top: clamp(280px, 44vh, 430px); } /* 판사가 보이게 내용은 아래부터 */
body.with-judge .courtroom-top { justify-content: flex-end; }

/* hidden 속성이 display:grid/flex 지정에 지지 않게 (조서 이모지 타일 이중 표시 버그) */
.thumb-emoji[hidden], .dossier-evidence img[hidden] { display: none !important; }


/* 연출 건너뛰기: 도장·연출 레이어가 클릭을 막지 않게 최상단 고정 */
.btn-skip {
  position: relative;
  z-index: 40;
  pointer-events: auto;
}
.verdict-stage { pointer-events: none; }
.verdict-stage img, .verdict-stage p { pointer-events: none; }


/* 기소 대상 도장 오버레이 — 선택한 거래를 사진 위에 쾅 (좌표 추정 없이 안전) */
.accuse-stamp {
  position: absolute;
  left: 50%;
  bottom: 10%;
  transform: translateX(-50%) rotate(-7deg);
  max-width: 92%;
  padding: 8px 16px;
  border: 3px solid var(--stamp);
  border-radius: 10px;
  background: rgba(245, 233, 208, 0.88);
  color: var(--stamp);
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.accuse-stamp[hidden] { display: none !important; }


/* 판결문 접힌 프리뷰 — 클릭하면 전문 */
.verdict-doc { cursor: pointer; }
.verdict-doc.collapsed {
  max-height: 330px;
  overflow: hidden;
  position: relative;
}
.verdict-doc.collapsed::after {
  content: "판결문 전문 보기 ▼";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 44px 0 12px;
  text-align: center;
  font-weight: 700;
  color: var(--stamp);
  background: linear-gradient(rgba(245, 233, 208, 0), #f5e9d0 62%);
}

/* AI 생성 유형 이미지 — 카드 원형 홀 안 (이모지 대체) */
.type-frame .type-img {
  position: absolute;
  left: 50%;
  top: 42.3%;
  transform: translate(-50%, -50%);
  width: 38%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
}


/* 전과 상세 모달의 미니 유형 카드 */
.modal-type-frame {
  width: min(280px, 82%) !important;
  margin: 10px auto 14px;
}


/* 펼친 상태에도 접기 안내를 보여준다 */
.verdict-doc:not(.collapsed)::after {
  content: "\25B2  접기";
  display: block;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed rgba(61, 43, 31, 0.35);
  text-align: center;
  font-weight: 700;
  color: var(--stamp);
}
