:root {
  color-scheme: dark;
  --bg: #05070c;
  --bg-deep: #020307;
  --ink: #eef5ff;
  --muted: #8e9bb0;
  --line: rgba(180, 202, 231, .22);
  --line-strong: rgba(180, 202, 231, .5);
  --cyan: #68e4f0;
  --cyan-soft: rgba(104, 228, 240, .14);
  --red: #ff5e72;
  --red-soft: rgba(255, 94, 114, .14);
  --gold: #e4c176;
  --green: #7ee0af;
  --glass: rgba(5, 10, 18, .88);
  --glass-strong: rgba(4, 8, 15, .96);
  --shadow: 0 28px 90px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  letter-spacing: .012em;
  overflow-x: hidden;
}
button { font: inherit; }
button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
strong { color: #fff; }

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}
body::before {
  z-index: 0;
  background:
    radial-gradient(circle at 52% 20%, rgba(66, 112, 158, .16), transparent 33%),
    linear-gradient(180deg, rgba(11, 17, 29, .35), rgba(2, 3, 7, .86)),
    linear-gradient(110deg, transparent 0 47%, rgba(255,255,255,.015) 48%, transparent 49% 100%);
  background-size: auto, auto, 52px 52px;
}
body::after {
  z-index: 1000;
  opacity: .07;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.08) 0, rgba(255,255,255,.08) 1px, transparent 1px, transparent 4px);
  mix-blend-mode: soft-light;
}

#app { min-height: 100vh; position: relative; z-index: 1; }
.game-shell {
  min-height: 100svh;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 36%, rgba(48, 78, 112, .18), transparent 48%),
    linear-gradient(180deg, #0a0e17 0%, #05070d 58%, #020307 100%);
}
.game-shell::before,
.game-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.game-shell::before {
  z-index: -2;
  opacity: .55;
  background:
    linear-gradient(90deg, transparent 0 10%, rgba(170,195,225,.035) 10.1% 10.3%, transparent 10.4% 89.6%, rgba(170,195,225,.035) 89.7% 89.9%, transparent 90%),
    linear-gradient(180deg, transparent 0 16%, rgba(170,195,225,.025) 16.1% 16.25%, transparent 16.4% 100%);
}
.game-shell::after {
  z-index: -1;
  background: linear-gradient(180deg, transparent 62%, rgba(0,0,0,.48) 100%);
}
.game-shell.court {
  background:
    radial-gradient(circle at 50% 12%, rgba(112, 28, 42, .22), transparent 28%),
    linear-gradient(180deg, #151017 0%, #090a10 50%, #030407 100%);
}
.game-shell.court::before {
  opacity: .75;
  background:
    linear-gradient(90deg, transparent 0 7%, rgba(131,72,55,.12) 7.2% 7.6%, transparent 7.8% 92.2%, rgba(131,72,55,.12) 92.4% 92.8%, transparent 93%),
    linear-gradient(180deg, transparent 0 17%, rgba(180,144,103,.06) 17.2% 17.5%, transparent 17.7% 74%, rgba(180,144,103,.035) 74.2% 74.5%, transparent 74.7%);
}
.game-shell.ending { background: radial-gradient(circle at 50% 18%, rgba(228,193,118,.15), transparent 38%), #05070c; }
.game-shell.gameover { background: radial-gradient(circle at 50% 18%, rgba(255,94,114,.18), transparent 40%), #05070c; }

.screen {
  width: min(1180px, calc(100% - 40px));
  min-height: 100svh;
  margin: 0 auto;
  padding: 94px 0 48px;
  position: relative;
  z-index: 1;
}

/* ADV HUD: information floats over the scene instead of living in a dashboard. */
.topbar {
  position: absolute;
  z-index: 30;
  inset: 18px 20px auto;
  min-height: 44px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: start;
  gap: 16px;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand { font-weight: 900; font-size: 11px; letter-spacing: .22em; opacity: .72; }
.phase, .eyebrow, .counter, .case-stamp {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 10px;
  font-weight: 850;
}
.phase { margin-top: 4px; opacity: .72; }
.top-actions, .meters, .action-row, .menu-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.meters { justify-content: center; }
.meter {
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  padding: 6px 4px 5px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  background: transparent;
  text-shadow: 0 2px 12px #000;
}
.trust { color: #ffd7dd; }
.interrogation { color: var(--cyan); }
.top-actions .btn.small {
  min-height: 30px;
  padding: 5px 8px;
  border-color: transparent;
  background: rgba(0,0,0,.24);
  font-size: 10px;
  opacity: .62;
}
.top-actions .btn.small:hover { opacity: 1; border-color: var(--line-strong); }

/* The generic panel is intentionally neutral. Specialized screens decide whether a surface is needed. */
.panel {
  position: relative;
  border: 0;
  background: transparent;
  box-shadow: none;
  clip-path: none;
}
.panel::before { display: none; }

.btn {
  min-height: 44px;
  border: 1px solid var(--line-strong);
  background: rgba(6, 11, 19, .74);
  color: var(--ink);
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: .045em;
  transition: transform .12s ease, border-color .12s ease, background .12s ease, box-shadow .12s ease, opacity .12s ease;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
.btn:hover:not(:disabled) { transform: translateX(2px); border-color: var(--cyan); background: rgba(16, 31, 44, .9); }
.btn:active:not(:disabled) { transform: translateX(4px); }
.btn:disabled { opacity: .28; cursor: not-allowed; }
.btn.accent {
  border-color: rgba(104,228,240,.7);
  background: linear-gradient(90deg, rgba(17, 94, 112, .84), rgba(7, 20, 31, .88));
  box-shadow: inset 4px 0 0 var(--cyan);
}
.btn.accent:hover { box-shadow: inset 7px 0 0 var(--cyan), 0 0 28px rgba(104,228,240,.12); }
.btn.wide { width: 100%; min-height: 52px; }
.btn.small { min-height: 34px; padding: 7px 10px; font-size: 11px; }
.btn.choice {
  width: min(760px, 100%);
  min-height: 58px;
  text-align: left;
  padding: 14px 22px;
  border-left: 3px solid transparent;
  background: linear-gradient(90deg, rgba(8,14,23,.86), rgba(8,14,23,.32));
  clip-path: polygon(14px 0, 100% 0, calc(100% - 20px) 100%, 0 100%);
}
.btn.choice:hover { border-left-color: var(--cyan); background: linear-gradient(90deg, rgba(20,75,88,.76), rgba(8,14,23,.28)); }

.heading-row {
  position: absolute;
  top: 82px;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  pointer-events: none;
}
.counter { color: #d4dfef; }
.body-copy { color: #d7e2f2; line-height: 1.9; margin: 18px 0; }
.muted { color: var(--muted); line-height: 1.65; }
.note { border-left: 2px solid var(--gold); padding: 8px 12px; color: #d8cda9; line-height: 1.7; }
.status {
  position: fixed;
  z-index: 50;
  left: 50%;
  top: 68px;
  transform: translateX(-50%);
  width: min(680px, calc(100% - 36px));
  padding: 7px 12px;
  color: #d3deec;
  text-align: center;
  font-size: 10px;
  letter-spacing: .08em;
  background: rgba(2,5,10,.72);
  border-bottom: 1px solid rgba(104,228,240,.25);
  box-shadow: 0 10px 36px rgba(0,0,0,.24);
  backdrop-filter: blur(8px);
}

/* Title: one composition, not two cards. */
.title-screen { display: grid; align-content: center; min-height: 100svh; padding-top: 54px; }
.hero { position: relative; z-index: 2; max-width: 820px; padding: 0 0 24px; }
.hero::before {
  content: "01";
  position: absolute;
  left: -12px;
  top: -84px;
  font-size: clamp(160px, 28vw, 330px);
  line-height: 1;
  font-weight: 1000;
  letter-spacing: -.09em;
  color: rgba(255,255,255,.018);
  z-index: -1;
}
.hero h1 {
  margin: 8px 0 8px;
  font-size: clamp(62px, 11vw, 136px);
  line-height: .77;
  letter-spacing: -.075em;
  font-weight: 1000;
  text-shadow: 10px 10px 0 rgba(104,228,240,.045);
}
.hero.compact h1 { font-size: clamp(54px, 8vw, 92px); }
.case-stamp { display: inline-block; color: var(--red); padding: 0 0 5px; border-bottom: 1px solid rgba(255,94,114,.6); }
.case { color: var(--cyan); font-size: clamp(18px, 3vw, 30px); font-weight: 900; letter-spacing: .08em; margin: 18px 0 4px; }
.tagline { color: var(--muted); font-size: 10px; letter-spacing: .12em; }
.grid-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  align-items: end;
  gap: 40px;
}
.case-card {
  align-self: end;
  max-width: 620px;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
}
.menu { display: flex; flex-direction: column; gap: 8px; padding: 0; }
.menu .eyebrow { margin-bottom: 7px; }
.menu .btn { text-align: left; justify-content: flex-start; background: rgba(5,10,18,.38); }
.menu-row > * { flex: 1; }

/* Conversation: character lives in the scene, dialogue window sits at the bottom. */
.dialogue-grid {
  position: relative;
  min-height: calc(100svh - 112px);
  display: block;
  overflow: visible;
}
.character-card {
  position: absolute;
  inset: 4% auto 164px 0;
  width: min(44vw, 430px);
  min-height: 0;
  padding: 0;
  overflow: visible;
  display: block;
  background: transparent;
  z-index: 1;
}
.character-card::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 10px;
  width: 120px;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 50%, transparent);
}
.portrait-silhouette {
  position: absolute;
  inset: -2% -12% 2% -4%;
  opacity: .82;
  filter: drop-shadow(0 10px 42px rgba(0,0,0,.55)) drop-shadow(0 0 30px color-mix(in srgb, var(--accent) 16%, transparent));
}
.portrait-silhouette::before {
  content: "";
  position: absolute;
  width: clamp(130px, 17vw, 190px);
  aspect-ratio: 1;
  border-radius: 50%;
  left: 50%;
  top: 8%;
  transform: translateX(-50%);
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 42%, #151c28), #070a10 72%);
}
.portrait-silhouette::after {
  content: "";
  position: absolute;
  width: 94%;
  height: 62%;
  left: 3%;
  bottom: -5%;
  border-radius: 46% 46% 4% 4%;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 24%, #1a2230), #06080d 78%);
}
.portrait-silhouette span::before,
.portrait-silhouette span::after {
  content: "";
  position: absolute;
  top: 4%;
  width: clamp(50px, 7vw, 72px);
  height: clamp(78px, 10vw, 110px);
  background: color-mix(in srgb, var(--accent) 30%, #10151d);
  clip-path: polygon(50% 0, 100% 100%, 0 76%);
  z-index: 2;
}
.portrait-silhouette span::before { left: 16%; transform: rotate(-16deg); }
.portrait-silhouette span::after { right: 16%; transform: rotate(16deg); }
.character-name {
  position: absolute;
  z-index: 4;
  left: 0;
  bottom: 38px;
  font-size: clamp(20px, 2.5vw, 30px);
  font-weight: 950;
  text-shadow: 0 3px 20px #000;
}
.character-role {
  position: absolute;
  z-index: 4;
  left: 0;
  bottom: 19px;
  color: var(--accent);
  font-size: 10px;
  letter-spacing: .14em;
  text-shadow: 0 3px 18px #000;
}
.character-expression {
  position: absolute;
  z-index: 4;
  left: 130px;
  bottom: 18px;
  color: var(--muted);
  font-size: 10px;
}
.dialogue-panel {
  position: absolute;
  z-index: 6;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 188px;
  padding: 26px 84px 28px 32px;
  display: block;
  background:
    linear-gradient(90deg, rgba(4,8,14,.97), rgba(6,12,21,.93) 72%, rgba(4,8,14,.97)),
    linear-gradient(180deg, rgba(104,228,240,.03), transparent);
  border-top: 1px solid rgba(154,187,222,.45);
  box-shadow: 0 -18px 64px rgba(0,0,0,.34);
  backdrop-filter: blur(12px);
}
.dialogue-panel::after {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 170px;
  height: 2px;
  background: var(--cyan);
  box-shadow: 0 0 22px rgba(104,228,240,.35);
}
.dialogue-speaker {
  display: inline-block;
  color: var(--cyan);
  font-size: 12px;
  letter-spacing: .12em;
  margin: 0 0 9px;
  font-weight: 900;
}
.dialogue-text {
  max-width: 980px;
  font-size: clamp(17px, 2vw, 23px);
  line-height: 1.82;
  font-weight: 620;
  min-height: 74px;
  text-wrap: pretty;
}
.dialogue-actions {
  position: absolute;
  right: 22px;
  bottom: 20px;
  display: flex;
  justify-content: flex-end;
  margin: 0;
}
.dialogue-actions .btn {
  min-width: 54px;
  min-height: 42px;
  padding: 8px 11px;
  overflow: hidden;
  color: transparent;
  border: 0;
  background: transparent;
  clip-path: none;
  box-shadow: none;
}
.dialogue-actions .btn::after {
  content: "▼";
  color: var(--cyan);
  position: absolute;
  inset: 8px;
  display: grid;
  place-items: center;
  font-size: 17px;
  animation: advancePulse 1.15s ease-in-out infinite;
}
.dialogue-actions .btn:hover { transform: none; background: transparent; }

/* Court intro / verdict are stage cards only in the theatrical sense, not dashboard cards. */
.court-card, .verdict-card, .gameover-card, .config-card {
  max-width: 900px;
  margin: 10vh auto 0;
  padding: clamp(28px, 5vw, 56px) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.court-card h2, .verdict-card h2, .gameover-card h2 { font-size: clamp(30px, 5.5vw, 58px); margin: 10px 0; letter-spacing: -.035em; }
.court-seal, .verdict-stamp { display: inline-block; padding: 0 0 6px; border-bottom: 1px solid rgba(255,94,114,.6); color: var(--red); letter-spacing: .16em; font-size: 10px; font-weight: 950; }
.rule-grid, .result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 30px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rule-grid > div, .result-stats > div { padding: 18px 18px 18px 0; border-right: 1px solid var(--line); background: transparent; }
.rule-grid > div + div, .result-stats > div + div { padding-left: 18px; }
.rule-grid > div:last-child, .result-stats > div:last-child { border-right: 0; }
.rule-grid span, .result-stats span { display: block; color: var(--muted); font-size: 9px; letter-spacing: .15em; font-weight: 900; }
.rule-grid strong, .result-stats strong { display: block; font-size: 30px; margin: 5px 0 2px; }
.rule-grid small { color: var(--muted); }

/* Testimony: statement itself dominates the scene. */
.testimony-layout { min-height: calc(100svh - 112px); position: relative; display: block; }
.testimony-layout .character-card {
  left: auto;
  right: 0;
  width: min(40vw, 410px);
  inset: 5% 0 130px auto;
  opacity: .72;
}
.testimony-layout > div:last-child {
  position: relative;
  z-index: 4;
  min-height: calc(100svh - 140px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: min(34vw, 340px);
}
.testimony-box {
  position: relative;
  overflow: visible;
  min-height: 0;
  padding: 0;
}
.testimony-box::before {
  content: "TESTIMONY";
  display: block;
  color: var(--red);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .22em;
  margin-bottom: 18px;
}
.testimony-box blockquote {
  margin: 0;
  max-width: 760px;
  font-size: clamp(26px, 4.3vw, 52px);
  line-height: 1.42;
  font-weight: 900;
  letter-spacing: -.02em;
  text-shadow: 0 5px 34px rgba(0,0,0,.7);
}
.testimony-box blockquote::before { content: "“"; color: var(--red); margin-right: .05em; }
.testimony-box blockquote::after { content: "”"; color: var(--red); margin-left: .05em; }
.testimony-box .eyebrow { display: none; }
.statement-index {
  position: absolute;
  left: -12px;
  top: -92px;
  font-size: clamp(120px, 19vw, 230px);
  font-weight: 1000;
  line-height: 1;
  color: rgba(255,255,255,.025);
  letter-spacing: -.09em;
  z-index: -1;
}
.feedback {
  margin: 28px 0 18px;
  max-width: 760px;
  min-height: 52px;
  padding: 11px 0 11px 16px;
  border-left: 2px solid var(--cyan);
  background: transparent;
  color: #cbd7e8;
  line-height: 1.7;
}
.testimony-layout .action-row { gap: 10px; }
.testimony-layout .action-row .btn { min-width: 180px; }
.testimony-layout .action-row .btn.accent {
  color: #fff;
  border-color: rgba(255,94,114,.66);
  background: linear-gradient(90deg, rgba(126,25,44,.82), rgba(20,10,15,.76));
  box-shadow: inset 4px 0 0 var(--red);
}

/* Evidence: temporary dedicated screen, like opening a court record. */
.evidence-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: calc(100svh - 190px);
  gap: 18px;
  margin-top: 20px;
}
.evidence-index {
  order: 2;
  min-height: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.evidence-detail {
  order: 1;
  min-height: 0;
  max-width: 900px;
  padding: 4vh 0 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.evidence-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 2px 6px;
  scrollbar-width: thin;
}
.evidence-button {
  flex: 0 0 clamp(160px, 19vw, 220px);
  min-height: 78px;
  text-align: left;
  border: 0;
  border-top: 2px solid rgba(180,202,231,.16);
  background: rgba(5,9,16,.22);
  color: var(--ink);
  padding: 12px 12px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  transition: background .12s ease, border-color .12s ease, transform .12s ease;
}
.evidence-button span { color: var(--cyan); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; letter-spacing: .1em; }
.evidence-button strong { font-size: 12px; line-height: 1.35; }
.evidence-button:hover, .evidence-button.selected { border-top-color: var(--cyan); background: rgba(104,228,240,.08); transform: translateY(-3px); }
.evidence-id {
  color: var(--cyan);
  font-size: clamp(72px, 15vw, 170px);
  font-weight: 1000;
  line-height: .8;
  letter-spacing: -.075em;
  opacity: .08;
  position: absolute;
  top: 0;
  right: 0;
  pointer-events: none;
}
.evidence-detail h2 { position: relative; margin: 0 0 8px; font-size: clamp(34px, 6vw, 64px); letter-spacing: -.045em; }
.evidence-detail h3 { color: #c1cee0; font-size: 14px; line-height: 1.65; max-width: 720px; }
.evidence-detail .body-copy { max-width: 760px; font-size: 16px; }
.screen > .action-row { margin-top: 14px; }

/* Questions: choice strips live in the scene rather than inside a form card. */
.question-card {
  max-width: 960px;
  min-height: calc(100svh - 170px);
  margin: 0 auto;
  padding: 12vh 0 30px;
  overflow: visible;
}
.question-number {
  position: absolute;
  right: -10px;
  top: 4vh;
  font-size: clamp(150px, 25vw, 300px);
  font-weight: 1000;
  color: rgba(255,255,255,.025);
  line-height: .8;
  letter-spacing: -.09em;
  z-index: -1;
}
.question-card h2 {
  position: relative;
  z-index: 1;
  max-width: 780px;
  font-size: clamp(28px, 4.8vw, 52px);
  line-height: 1.38;
  margin: 0 0 34px;
  letter-spacing: -.025em;
}
.choices { display: grid; gap: 8px; }
.question-card .feedback { margin-top: 22px; }

/* Contradiction cut-in: intentionally loud because it punctuates otherwise quiet screens. */
.cutin-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(1, 2, 5, .9);
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
}
.cutin-backdrop::before,
.cutin-backdrop::after {
  content: "";
  position: absolute;
  inset: -20%;
  background: linear-gradient(110deg, transparent 41%, rgba(255,94,114,.18) 42% 45%, transparent 46%);
  animation: slashMove .8s ease both;
}
.cutin-backdrop::after { transform: scaleX(-1); opacity: .5; }
.cutin {
  width: min(1040px, calc(100% - 28px));
  padding: clamp(30px, 6vw, 72px) clamp(20px, 6vw, 76px);
  border-top: 2px solid var(--red);
  border-bottom: 2px solid var(--cyan);
  background: linear-gradient(90deg, rgba(78,10,27,.88), rgba(5,9,16,.98) 45%, rgba(5,36,43,.86));
  box-shadow: 0 0 90px rgba(255,94,114,.14);
  position: relative;
  animation: cutinIn .26s cubic-bezier(.2,.8,.2,1) both;
}
.cutin::before {
  content: "";
  position: absolute;
  left: -10%; right: -10%; top: 50%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--red), var(--cyan), transparent);
  opacity: .52;
}
.cutin-eyebrow { color: var(--red); font-size: 11px; font-weight: 1000; letter-spacing: .26em; }
.cutin h2 { margin: 8px 0 12px; font-size: clamp(36px, 7.5vw, 82px); line-height: .98; letter-spacing: -.045em; text-transform: uppercase; text-shadow: 4px 4px 0 rgba(104,228,240,.09); }
.cutin p { max-width: 720px; color: #dce7f5; line-height: 1.7; font-size: 15px; }
.cutin > span { display: inline-block; margin-top: 18px; color: var(--muted); font-size: 9px; letter-spacing: .18em; }

/* Result / ending: poster-like composition instead of dashboard statistics. */
.result-screen { display: grid; align-content: center; }
.result-card {
  max-width: 980px;
  margin: 0 auto;
  padding: 20px 0;
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 34px;
  align-items: center;
}
.rank-block {
  min-height: 260px;
  border-top: 1px solid rgba(228,193,118,.42);
  border-bottom: 1px solid rgba(228,193,118,.42);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.rank-block span { color: var(--gold); font-size: 10px; letter-spacing: .2em; font-weight: 900; }
.rank-block strong { font-size: 138px; line-height: .82; color: #fff0c3; text-shadow: 0 0 42px rgba(228,193,118,.16); }
.rank-block em { font-style: normal; color: #d7c69d; font-size: 10px; letter-spacing: .11em; margin-top: 13px; }
.result-copy h2 { font-size: clamp(30px, 5.4vw, 56px); margin: 0 0 10px; letter-spacing: -.04em; }
.result-copy p { color: var(--muted); line-height: 1.7; }
.result-stats { grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr); margin: 6px 0 0; }
.result-stats strong { font-size: 21px; }
.achievement {
  grid-column: 1 / -1;
  color: var(--green);
  border-top: 1px solid rgba(126,224,175,.34);
  border-bottom: 1px solid rgba(126,224,175,.34);
  padding: 12px 0;
  text-align: center;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .1em;
}
.result-card .action-row { grid-column: 1 / -1; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.setting-row p { font-size: 28px; font-weight: 900; margin: 7px 0; }

@keyframes cutinIn { from { opacity: 0; transform: scale(1.05) skewX(-2deg); } to { opacity: 1; transform: scale(1) skewX(0); } }
@keyframes slashMove { from { transform: translateX(-24%); opacity: 0; } to { transform: translateX(12%); opacity: 1; } }
@keyframes advancePulse { 0%, 100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(4px); opacity: 1; } }

@media (max-width: 820px) {
  .topbar { inset-inline: 12px; grid-template-columns: 1fr auto; }
  .topbar > div:first-child { display: none; }
  .meters { justify-content: flex-start; }
  .top-actions { justify-content: flex-end; }
  .screen { width: min(100% - 24px, 1180px); padding-top: 82px; }
  .heading-row { top: 70px; }

  .grid-title { grid-template-columns: 1fr; gap: 26px; }
  .case-card { display: none; }
  .menu { max-width: 520px; }

  .dialogue-grid { min-height: calc(100svh - 92px); }
  .character-card {
    inset: 3% auto 190px 2%;
    width: min(66vw, 420px);
  }
  .portrait-silhouette { inset: 0 -4% 2%; }
  .character-name { bottom: 40px; }
  .dialogue-panel { min-height: 196px; padding: 22px 58px 24px 20px; }
  .dialogue-text { font-size: 17px; line-height: 1.72; }
  .dialogue-actions { right: 10px; bottom: 15px; }

  .testimony-layout > div:last-child { padding-right: 0; justify-content: center; }
  .testimony-layout .character-card {
    right: -12%;
    width: 58vw;
    opacity: .22;
    inset: 7% -10% 140px auto;
  }
  .testimony-box blockquote { max-width: 92%; }

  .court-card, .verdict-card, .gameover-card, .config-card { margin-top: 8vh; }
  .rule-grid { grid-template-columns: 1fr; border-bottom: 0; }
  .rule-grid > div { border-right: 0; border-bottom: 1px solid var(--line); padding-left: 0 !important; }

  .question-card { padding-top: 10vh; }
  .result-card { grid-template-columns: 1fr; gap: 20px; }
  .rank-block { min-height: 190px; }
  .rank-block strong { font-size: 112px; }
  .result-stats { grid-column: 1; grid-template-columns: repeat(2, 1fr); }
  .achievement, .result-card .action-row { grid-column: 1; }
}

@media (max-width: 520px) {
  .game-shell { overflow-y: auto; }
  .screen { width: min(100% - 18px, 1180px); padding-top: 76px; padding-bottom: 24px; }
  .topbar { top: 10px; }
  .top-actions .btn.small { padding-inline: 6px; }
  .meter { font-size: 9px; }
  .status { top: 56px; }

  .title-screen { align-content: end; padding-bottom: 30px; }
  .hero { padding-bottom: 16px; }
  .hero h1 { font-size: clamp(54px, 19vw, 76px); }
  .case { font-size: 18px; }
  .tagline { font-size: 9px; }
  .menu-row { gap: 6px; }

  .heading-row { top: 61px; }
  .dialogue-grid { min-height: calc(100svh - 82px); }
  .character-card {
    inset: 5% auto 208px 2%;
    width: 76vw;
  }
  .portrait-silhouette { opacity: .68; }
  .character-name { font-size: 20px; }
  .character-expression { left: 0; bottom: 3px; }
  .character-role { bottom: 21px; }
  .dialogue-panel { min-height: 208px; padding: 20px 46px 22px 16px; }
  .dialogue-text { font-size: 16px; line-height: 1.67; }
  .dialogue-speaker { font-size: 11px; }

  .testimony-layout { min-height: calc(100svh - 90px); }
  .testimony-layout > div:last-child { min-height: calc(100svh - 110px); }
  .testimony-box blockquote { max-width: 100%; font-size: clamp(25px, 8vw, 38px); }
  .feedback { font-size: 13px; margin-top: 20px; }
  .testimony-layout .action-row { align-items: stretch; flex-direction: column; }
  .testimony-layout .action-row .btn { width: 100%; min-width: 0; }

  .evidence-grid { min-height: calc(100svh - 170px); }
  .evidence-detail { padding-top: 7vh; }
  .evidence-detail h2 { font-size: 34px; }
  .evidence-button { flex-basis: 150px; }

  .question-card { min-height: calc(100svh - 120px); padding-top: 10vh; }
  .question-card h2 { font-size: 26px; margin-bottom: 24px; }
  .btn.choice { min-height: 54px; padding: 12px 15px; }

  .court-card, .verdict-card, .gameover-card, .config-card { margin-top: 5vh; padding-block: 28px; }
  .result-stats { grid-template-columns: 1fr 1fr; }
  .result-stats > div { padding: 12px 8px 12px 0; }
  .result-stats > div + div { padding-left: 8px; }
  .cutin { padding: 28px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
