:root {
  color-scheme: dark;
  --ink: #050505;
  --paper: #f2efe6;
  --panel: #f3f0e8;
  --muted: #8c887f;
  --line: rgba(242, 239, 230, 0.14);
  --line-strong: rgba(242, 239, 230, 0.28);
  --red: #ef5a48;
  --blue: #6f9cff;
  --gold: #d1b77d;
  --gray: #a6a8ad;
  --mono: "DM Mono", monospace;
  --sans: "Manrope", sans-serif;
  --display: "Anton", "Manrope", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
}

body.modal-open {
  overflow: hidden;
}

button,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 19;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 42%, transparent 52%, rgba(0, 0, 0, 0.5) 100%);
}

.topbar {
  position: sticky;
  z-index: 12;
  top: 0;
  min-height: 72px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 5, 5, 0.84);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  color: var(--paper);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.brand-mark {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-mark svg {
  width: 28px;
  height: 28px;
  display: block;
}

.brand-mark path {
  fill: none;
  stroke: var(--paper);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.help-button {
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  padding: 9px 12px;
  color: #c8c4ba;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.help-button:hover,
.help-button:focus-visible {
  border-color: var(--line-strong);
  color: var(--paper);
}

.model-status {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #b7b4ab;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(209, 183, 125, 0.7);
}

.kicker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #77736b;
}

/* ----- full-bleed courtroom stage ---------------------------------------- */

.app-shell {
  background: var(--ink);
}

.court-stage {
  position: relative;
  min-width: 0;
  min-height: calc(100vh - 72px);
  color: var(--paper);
  background: #030303;
}

.scene-shell {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 72px);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 24%, rgba(209, 183, 125, 0.07), transparent 30%),
    #030303;
}

.three-scene {
  position: absolute;
  inset: 0;
}

.three-scene canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.scene-error {
  min-height: 560px;
  display: grid;
  place-items: center;
  padding: 28px;
  color: #c9c4ba;
  text-align: center;
}

.label-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.agent-label {
  position: absolute;
  left: 0;
  top: 0;
  padding: 7px 10px;
  border: 1px solid rgba(242, 239, 230, 0.22);
  background: rgba(8, 8, 7, 0.64);
  color: #f4f1e8;
  backdrop-filter: blur(10px);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity 220ms ease, border-color 160ms ease, color 160ms ease;
}

.agent-label.active {
  border-color: rgba(209, 183, 125, 0.72);
  background: rgba(13, 13, 12, 0.88);
  color: var(--gold);
}

/* ----- lobby ------------------------------------------------------------- */

.lobby-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px 48px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(3, 3, 3, 0.42), transparent 32%, transparent 64%, rgba(3, 3, 3, 0.6));
}

.lobby-copy {
  max-width: 480px;
  animation: rise 700ms ease both;
  transition: opacity 600ms ease;
}

.lobby-overlay.convening .lobby-copy {
  animation: none;
  opacity: 0;
}

.lobby-copy h1 {
  margin: 12px 0 14px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(54px, 8vw, 110px);
  line-height: 0.92;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--paper);
  text-shadow: 0 18px 60px rgba(0, 0, 0, 0.8);
}

.lobby-copy p {
  margin: 0;
  max-width: 380px;
  color: #b8b3aa;
  font-size: 13px;
  line-height: 1.75;
}

.start-button {
  pointer-events: auto;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  border: 1px solid rgba(209, 183, 125, 0.55);
  background: rgba(8, 8, 7, 0.72);
  backdrop-filter: blur(12px);
  color: var(--paper);
  padding: 18px 34px 16px 22px;
  cursor: pointer;
  animation: rise 700ms 180ms ease both;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.start-button:hover:not(:disabled),
.start-button:focus-visible {
  border-color: var(--gold);
  background: rgba(20, 17, 10, 0.88);
  transform: translateY(-2px);
}

.start-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.start-word {
  font-family: var(--display);
  font-size: 44px;
  line-height: 1;
  letter-spacing: 0.06em;
  color: var(--gold);
}

.start-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #b7b2a8;
}

.lobby-error {
  pointer-events: auto;
  position: absolute;
  left: 48px;
  bottom: 14px;
  margin: 0;
  color: var(--red);
  font-family: var(--mono);
  font-size: 11px;
}

/* ----- trial HUD: charge -------------------------------------------------- */
/* Docked top-left so the Shikigami's face owns the center-left of the frame. */

.charge-banner {
  position: absolute;
  z-index: 4;
  top: 22px;
  left: 22px;
  width: min(320px, calc(100% - 44px));
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-left: 2px solid var(--gold);
  background: rgba(8, 8, 7, 0.78);
  backdrop-filter: blur(14px);
  text-align: left;
  animation: rise 500ms ease both;
}

.charge-banner strong {
  display: block;
  margin-top: 6px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 19px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--paper);
}

.charge-banner p {
  margin: 8px 0 0;
  color: #b3aea4;
  font-size: 12px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.charge-banner:hover p,
.charge-banner:focus-within p {
  -webkit-line-clamp: unset;
}

/* ----- trial HUD: truth scales ------------------------------------------- */

.truth-meter {
  position: absolute;
  z-index: 4;
  bottom: 22px;
  left: 22px;
  width: 224px;
  padding: 13px 14px;
  border: 1px solid var(--line-strong);
  background: rgba(8, 8, 7, 0.78);
  backdrop-filter: blur(14px);
  animation: rise 500ms 120ms ease both;
  transition: box-shadow 500ms ease, border-color 500ms ease;
}

.truth-meter.pulse-up {
  border-color: rgba(209, 183, 125, 0.85);
  box-shadow: 0 0 28px rgba(209, 183, 125, 0.45);
}

.truth-meter.pulse-down {
  border-color: rgba(239, 90, 72, 0.85);
  box-shadow: 0 0 28px rgba(239, 90, 72, 0.45);
}

/* ----- trial HUD: cast strip ---------------------------------------------- */

.cast-strip {
  position: absolute;
  z-index: 4;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  pointer-events: none;
  animation: rise 500ms 320ms ease both;
}

.cast-chip {
  padding: 7px 11px;
  border: 1px solid var(--line);
  background: rgba(8, 8, 7, 0.7);
  backdrop-filter: blur(10px);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.cast-shikigami {
  color: #f0998c;
  border-color: rgba(239, 90, 72, 0.45);
}

.cast-you {
  color: #a7c2ff;
  border-color: rgba(111, 156, 255, 0.45);
}

.cast-judge {
  color: var(--gold);
  border-color: rgba(209, 183, 125, 0.45);
}

.meter-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #b7b2a8;
}

.meter-glyph {
  width: 16px;
  height: 16px;
  flex: none;
}

.meter-glyph path {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.meter-top b {
  margin-left: auto;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 13px;
}

.meter-track {
  position: relative;
  margin-top: 11px;
  height: 7px;
  border: 1px solid var(--line);
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(242, 239, 230, 0.18) calc(10% - 1px) 10%),
    rgba(242, 239, 230, 0.04);
}

.meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 50%;
  background: linear-gradient(90deg, rgba(239, 90, 72, 0.85), rgba(209, 183, 125, 0.9));
  transition: width 700ms cubic-bezier(0.25, 1, 0.4, 1);
}

.meter-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: var(--paper);
  box-shadow: 0 0 10px rgba(242, 239, 230, 0.7);
  transition: left 700ms cubic-bezier(0.25, 1, 0.4, 1);
}

.meter-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #77736b;
}

.meter-caption {
  margin: 9px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: #c7c2b8;
}

.truth-meter[data-zone="danger"] .meter-caption {
  color: var(--red);
}

.truth-meter[data-zone="good"] .meter-caption {
  color: var(--gold);
}

/* ----- trial HUD: cross-examination panel -------------------------------- */

.interrogation-panel {
  position: absolute;
  z-index: 4;
  top: 96px;
  right: 22px;
  width: min(400px, calc(100% - 44px));
  max-height: calc(100% - 126px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-top: 2px solid rgba(239, 90, 72, 0.6);
  background: rgba(8, 8, 7, 0.84);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32), 0 0 46px rgba(239, 90, 72, 0.06);
  animation: rise 500ms 220ms ease both;
}

.panel-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.q-count {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--gold);
  border: 1px solid rgba(209, 183, 125, 0.4);
  padding: 5px 8px;
}

.jm-reaction {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-left: 2px solid var(--red);
  background: rgba(239, 90, 72, 0.07);
  color: #d6c4bd;
  font-size: 12px;
  line-height: 1.65;
  font-style: italic;
}

.q-block {
  margin-top: 14px;
}

.q-speaker {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--red);
}

.q-text {
  margin: 7px 0 0;
  min-height: 44px;
  color: var(--paper);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.55;
}

/* ----- answer modes -------------------------------------------------------- */

.respond-config {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.config-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.config-label {
  flex: none;
  width: 62px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #77736b;
}

.seg {
  flex: 1;
  display: flex;
  border: 1px solid var(--line);
  background: rgba(242, 239, 230, 0.03);
}

.seg-option {
  flex: 1;
  padding: 8px 6px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #97938a;
  transition: color 140ms ease, background 140ms ease;
}

.seg-option:last-child {
  border-right: 0;
}

.seg-option i {
  font-style: italic;
  text-transform: none;
  opacity: 0.7;
}

.seg-option:hover:not(.active),
.seg-option:focus-visible {
  color: var(--paper);
}

.seg-option.active {
  background: rgba(209, 183, 125, 0.12);
  color: var(--gold);
}

.choice-list {
  display: none;
  gap: 8px;
}

#answerForm[data-mode="mcq"] .choice-list {
  display: grid;
  animation: rise 240ms ease both;
}

#answerForm[data-mode="mcq"] #answerInput {
  display: none;
}

#answerForm[data-mode="text"] #answerInput {
  animation: rise 240ms ease both;
}

.choice {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(242, 239, 230, 0.035);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.choice:hover:not(:disabled):not(.selected) {
  border-color: var(--line-strong);
  background: rgba(242, 239, 230, 0.06);
}

.choice.selected {
  border-color: rgba(209, 183, 125, 0.75);
  background: rgba(209, 183, 125, 0.08);
  box-shadow: inset 2px 0 0 var(--gold);
}

.choice:disabled {
  opacity: 0.55;
  cursor: wait;
}

.choice-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.choice-text {
  font-size: 12.5px;
  line-height: 1.55;
  color: #d8d4ca;
}

#answerForm {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

#answerInput {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  outline: none;
  background: rgba(242, 239, 230, 0.045);
  color: var(--paper);
  padding: 12px;
  font-size: 13px;
  line-height: 1.6;
}

#answerInput:focus {
  border-color: rgba(209, 183, 125, 0.65);
  background: rgba(242, 239, 230, 0.07);
}

#answerInput::placeholder {
  color: #6e6a62;
}

#answerInput:disabled {
  opacity: 0.5;
}

.answer-button {
  border: 0;
  background: var(--paper);
  color: var(--ink);
  padding: 12px 12px 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.answer-button:disabled {
  opacity: 0.45;
  cursor: wait;
}

.button-mark {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  background: #171714;
  color: #f4f1e8;
  border-radius: 50%;
}

.weighing {
  margin: 12px 0 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

.weighing i {
  font-style: normal;
  animation: blink 1.1s steps(4, end) infinite;
}

/* ----- the sentence ------------------------------------------------------- */

.verdict-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 3, 3, 0.82);
  backdrop-filter: blur(10px);
}

.verdict-inner {
  width: min(640px, 100%);
  padding: 38px 40px;
  border: 1px solid var(--line-strong);
  background: #0b0b0a;
  text-align: center;
  box-shadow: 0 40px 110px rgba(0, 0, 0, 0.6);
  animation: stamp 460ms cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.verdict-inner h2 {
  margin: 10px 0 4px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(64px, 11vw, 124px);
  line-height: 0.95;
  letter-spacing: 0.02em;
  color: var(--paper);
}

.verdict-overlay[data-verdict="innocent"] .verdict-inner h2 {
  color: var(--paper);
}

.verdict-overlay[data-verdict="innocent"] .verdict-inner {
  border-top: 3px solid var(--paper);
}

.verdict-overlay[data-verdict="guilty_confiscation"] .verdict-inner h2 {
  color: var(--gold);
}

.verdict-overlay[data-verdict="guilty_confiscation"] .verdict-inner {
  border-top: 3px solid var(--gold);
}

.verdict-overlay[data-verdict="guilty_death_penalty"] .verdict-inner h2 {
  color: var(--red);
}

.verdict-overlay[data-verdict="guilty_death_penalty"] .verdict-inner {
  border-top: 3px solid var(--red);
}

.verdict-sub {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c7c2b8;
}

.verdict-reasoning {
  margin: 22px auto 0;
  max-width: 480px;
  color: #b3aea4;
  font-size: 13px;
  line-height: 1.75;
}

.verdict-meta {
  margin: 22px 0 26px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.verdict-meta span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.hidden {
  display: none !important;
}

footer {
  min-height: 74px;
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  color: #66635e;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

/* ----- intro modal --------------------------------------------------------- */

.intro-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.intro-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 5, 0.76);
  backdrop-filter: blur(14px);
}

.intro-panel {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid var(--line-strong);
  background: #11110f;
  color: var(--paper);
  padding: 34px;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.45);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: transparent;
  color: #c7c2b8;
  cursor: pointer;
  font-family: var(--mono);
  text-transform: uppercase;
}

.intro-panel h2 {
  margin: 9px 42px 16px 0;
  font-size: clamp(40px, 7vw, 76px);
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-weight: 500;
}

.intro-panel > p {
  max-width: 660px;
  margin: 0;
  color: #b8b3aa;
  font-size: 14px;
  line-height: 1.75;
}

.intro-grid {
  margin: 26px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.intro-grid article {
  min-height: 178px;
  padding: 22px;
  border-right: 1px solid var(--line);
}

.intro-grid article:last-child {
  border-right: 0;
}

.intro-grid h3 {
  margin: 28px 0 9px;
  font-size: 21px;
  font-weight: 600;
}

.intro-grid p {
  margin: 0;
  color: #8e8980;
  font-size: 12px;
  line-height: 1.6;
}

.intro-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.judge-dot {
  background: var(--gray);
}

.judge-man-dot {
  background: var(--red);
}

.defense-dot {
  background: var(--blue);
}

.intro-steps {
  margin: 0 0 26px;
  padding-left: 20px;
  color: #c7c2b8;
  font-size: 13px;
  line-height: 1.8;
}

.intro-start {
  border: 0;
  background: var(--paper);
  color: var(--ink);
  padding: 13px 18px;
  cursor: pointer;
  font-weight: 700;
}

/* ----- customizer modal ----------------------------------------------------- */

.customizer-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
}

.customizer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 5, 0.76);
  backdrop-filter: blur(14px);
}

.customizer-panel {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid var(--line-strong);
  background: #11110f;
  color: var(--paper);
  padding: 30px 34px;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.45);
}

.customizer-header h2 {
  margin: 9px 42px 16px 0;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-weight: 500;
}

.customizer-header p {
  max-width: 660px;
  margin: 0;
  color: #b8b3aa;
  font-size: 14px;
  line-height: 1.75;
}

.customizer-body {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 26px;
  margin: 24px 0;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.customizer-preview {
  position: relative;
}

#customizerPreview {
  height: 420px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 30%, rgba(209, 183, 125, 0.07), transparent 40%),
    #080807;
}

#customizerPreview canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.preview-hint {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  color: #66635e;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  pointer-events: none;
}

.option-group {
  margin-bottom: 18px;
}

.option-heading {
  display: block;
  margin-bottom: 8px;
  color: #858179;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.option-pill {
  border: 1px solid var(--line);
  background: transparent;
  color: #c8c4ba;
  padding: 8px 12px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.option-pill:hover,
.option-pill:focus-visible {
  border-color: var(--line-strong);
  color: var(--paper);
}

.option-pill.active {
  border-color: rgba(209, 183, 125, 0.72);
  color: var(--gold);
  background: rgba(209, 183, 125, 0.06);
}

.swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(242, 239, 230, 0.25);
  padding: 0;
  cursor: pointer;
  transition: transform 120ms ease;
}

.swatch:hover {
  transform: scale(1.08);
}

.swatch.active {
  box-shadow: 0 0 0 2px #11110f, 0 0 0 4px var(--gold);
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slider-row input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
  cursor: pointer;
}

#heightValue {
  min-width: 36px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 10px;
}

.customizer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.customizer-reset {
  border: 1px solid var(--line);
  background: transparent;
  color: #c8c4ba;
  padding: 12px 16px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.customizer-reset:hover,
.customizer-reset:focus-visible {
  border-color: var(--line-strong);
  color: var(--paper);
}

.customizer-confirm {
  border: 0;
  background: var(--paper);
  color: var(--ink);
  padding: 13px 18px;
  cursor: pointer;
  font-weight: 700;
}

/* ----- motion ---------------------------------------------------------------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drop {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes stamp {
  from {
    opacity: 0;
    transform: scale(1.18);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes blink {
  50% {
    opacity: 0.15;
  }
}

@media (max-width: 820px) {
  .topbar {
    min-height: 62px;
    padding: 0 18px;
  }

  .model-status span:last-child {
    display: none;
  }

  .court-stage,
  .scene-shell {
    min-height: calc(100vh - 62px);
  }

  .lobby-overlay {
    padding: 24px 18px;
  }

  .lobby-error {
    left: 18px;
  }

  .charge-banner {
    top: 16px;
    left: 16px;
    width: min(300px, calc(100% - 32px));
  }

  .charge-banner p {
    -webkit-line-clamp: 2;
  }

  .truth-meter {
    bottom: 16px;
    left: 16px;
    width: 188px;
  }

  .cast-strip {
    display: none;
  }

  .interrogation-panel {
    top: auto;
    right: 16px;
    bottom: 16px;
    left: 220px;
    width: auto;
    max-height: 60%;
  }

  .intro-panel {
    padding: 28px 22px;
  }

  .intro-grid {
    grid-template-columns: 1fr;
  }

  .intro-grid article {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .intro-grid article:last-child {
    border-bottom: 0;
  }

  .customizer-panel {
    padding: 24px 18px;
  }

  .customizer-body {
    grid-template-columns: 1fr;
  }

  #customizerPreview {
    height: 320px;
  }

  .customizer-footer {
    flex-wrap: wrap;
  }

  footer {
    padding: 24px 18px;
    align-items: start;
    flex-direction: column;
    gap: 10px;
  }
}

@media (max-width: 640px) {
  .truth-meter {
    bottom: auto;
    top: 160px;
    left: 16px;
  }

  .interrogation-panel {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-height: 56%;
  }

  .charge-banner strong {
    font-size: 17px;
  }

  .config-row {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .config-label {
    width: auto;
  }
}

@media (max-width: 540px) {
  .brand {
    font-size: 11px;
  }

  .help-button {
    display: none;
  }

  .lobby-copy p {
    display: none;
  }

  .start-word {
    font-size: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
