/* The Lie Detector — forensic audio workstation aesthetic */

:root {
  --bg: #0A0A0B;
  --bg-1: #101013;
  --bg-2: #16161A;
  --line: #26262B;
  --line-2: #3A3A42;
  --fg: #F4F1EA;
  --fg-2: #B8B4AC;
  --fg-3: #6E6A63;
  --fg-4: #3F3D38;
  --accent: #D7263D;
  --grain: 0.18;

  --serif: "Fraunces", "Cormorant Garamond", Georgia, serif;
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "Inter Tight", -apple-system, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.45;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button { font-family: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; }

.app {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}

/* Atmosphere layers ----------------------------------------------------- */
.grain-layer {
  position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  opacity: var(--grain);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
  animation: grain 1.4s steps(5) infinite;
}
@keyframes grain {
  0% { transform: translate(0,0); }
  20% { transform: translate(-8px, 6px); }
  40% { transform: translate(6px, -4px); }
  60% { transform: translate(-3px, -8px); }
  80% { transform: translate(7px, 3px); }
  100% { transform: translate(0,0); }
}
.vignette-layer {
  position: fixed; inset: 0; pointer-events: none; z-index: 9998;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.6) 100%);
}

/* Topbar ---------------------------------------------------------------- */
.topbar {
  flex: 0 0 36px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-2);
  background: linear-gradient(180deg, #0d0d10, var(--bg));
}
.topbar-l { display: flex; align-items: center; gap: 10px; }
.topbar-c { display: flex; align-items: center; gap: 10px; justify-self: center; }
.topbar-r { display: flex; align-items: center; justify-self: end; color: var(--fg-3); }
.dot-sep { color: var(--fg-4); }
.logo-block { width: 12px; height: 12px; background: var(--accent); display: inline-block; }
.logo-text { letter-spacing: 0.22em; color: var(--fg); }
.rec-live { color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
.rec-dot {
  width: 7px; height: 7px; background: var(--accent); border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(215, 38, 61, 0.18);
  animation: pulse 1.4s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* BRIEFING -------------------------------------------------------------- */
.briefing {
  flex: 1; display: grid; place-items: center; padding: 32px;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(215, 38, 61, 0.06), transparent 60%),
    var(--bg);
}
.briefing-frame {
  width: 720px; max-width: 100%;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(255,255,255,0.015), transparent);
  padding: 36px 44px 32px;
  position: relative;
}
.briefing-frame::before, .briefing-frame::after {
  content: ""; position: absolute; width: 12px; height: 12px;
  border: 1px solid var(--accent);
}
.briefing-frame::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.briefing-frame::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.briefing-stamp {
  display: flex; justify-content: space-between;
  font-size: 9px; letter-spacing: 0.34em; color: var(--accent);
  margin-bottom: 22px;
  text-transform: uppercase;
}
.briefing-header { text-align: center; margin-bottom: 28px; }
.briefing-caseno {
  font-size: 10px; letter-spacing: 0.4em; color: var(--fg-3);
  margin-bottom: 14px;
}
.briefing-title {
  font-family: var(--serif);
  font-size: 64px; font-weight: 300; letter-spacing: 0.04em;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  color: var(--fg);
  margin-bottom: 14px;
  line-height: 1;
}
.briefing-meta {
  display: flex; justify-content: center; gap: 28px;
  font-size: 9px; letter-spacing: 0.3em; color: var(--fg-3);
}
.briefing-body {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
  margin-bottom: 28px;
  min-height: 220px;
}
.briefing-line {
  display: flex; gap: 14px;
  font-family: var(--mono);
  font-size: 13px; color: var(--fg);
  line-height: 1.9;
  letter-spacing: 0.04em;
}
.briefing-prompt { color: var(--accent); width: 12px; flex: 0 0 12px; }
.briefing-caret {
  display: inline-block; width: 8px; height: 14px;
  background: var(--fg); margin-left: 2px;
  animation: caret 0.9s steps(1) infinite;
  vertical-align: -2px;
}
@keyframes caret { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }
.briefing-begin {
  width: 100%;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 18px 22px;
  font-size: 12px; letter-spacing: 0.4em;
  text-transform: uppercase;
  display: flex; justify-content: space-between; align-items: center;
  transition: background 0.18s, color 0.18s, opacity 0.2s;
  opacity: 0.4;
}
.briefing-begin.ready { opacity: 1; }
.briefing-begin.ready:hover { background: var(--accent); color: #0A0A0B; }
.briefing-arrow { font-size: 18px; }

/* ROOM ------------------------------------------------------------------ */
.room {
  flex: 1;
  display: grid;
  grid-template-columns: 320px 1fr 340px;
  min-height: 0;
}
.room > * { min-width: 0; min-height: 0; overflow: hidden; }

.col-header {
  display: flex; align-items: baseline; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--fg-2);
  flex: 0 0 auto;
}
.col-header-num { color: var(--accent); font-weight: 600; }
.col-header-label { color: var(--fg); flex: 1; }
.col-header-count { color: var(--fg-3); font-size: 9px; }

/* Roster ---------------------------------------------------------------- */
.roster {
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(255,255,255,0.012), transparent 200px);
}
.roster-list { flex: 1; overflow-y: auto; }
.suspect-card {
  width: 100%;
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 14px;
  padding: 14px 18px 14px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  position: relative;
  transition: background 0.15s;
  border-left: 2px solid transparent;
}
.suspect-card:hover { background: rgba(255,255,255,0.02); }
.suspect-card.active {
  border-left-color: var(--accent);
  background: linear-gradient(90deg, rgba(215, 38, 61, 0.08), transparent 70%);
}
.suspect-card.active::after {
  content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 1px;
  background: var(--accent); opacity: 0.6;
}
.suspect-portrait {
  position: relative; width: 88px; height: 96px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  overflow: hidden;
  color: var(--fg-4);
}
.suspect-card.active .suspect-portrait { color: var(--fg-2); border-color: var(--accent); }
.silhouette { width: 100%; height: 100%; display: block; }
.suspect-portrait-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 12px 12px;
  pointer-events: none;
}
.suspect-meta { display: flex; flex-direction: column; gap: 3px; padding-top: 2px; }
.suspect-num { font-size: 9px; letter-spacing: 0.3em; color: var(--fg-3); }
.suspect-name { font-size: 13px; letter-spacing: 0.06em; color: var(--fg); }
.suspect-role {
  font-family: var(--serif); font-style: italic; font-size: 14px;
  color: var(--fg-2); letter-spacing: 0;
  margin-bottom: 6px;
}
.suspect-status {
  margin-top: auto;
  display: flex; align-items: center; gap: 8px;
  font-size: 9px; letter-spacing: 0.24em;
  color: var(--fg-3);
}
.suspect-status .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--fg-4);
}
.suspect-status .dot.on { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.suspect-card.heard .suspect-status { color: var(--fg); }

/* Player ---------------------------------------------------------------- */
.player {
  display: flex; flex-direction: column;
  background: var(--bg);
  border-right: 1px solid var(--line);
}
.player-titlebar {
  display: flex; justify-content: space-between;
  padding: 10px 22px;
  border-bottom: 1px solid var(--line);
  font-size: 9px; letter-spacing: 0.3em; color: var(--fg-3);
}
.player-titlebar-l { display: flex; align-items: center; gap: 10px; color: var(--accent); }
.player-name {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 22px 22px 18px;
}
.player-suspect-name {
  font-size: 11px; letter-spacing: 0.4em; color: var(--fg-3);
  margin-bottom: 6px;
}
.player-suspect-role {
  font-family: var(--serif); font-style: italic;
  font-size: 28px; color: var(--fg);
}
.timecode {
  font-family: var(--mono);
  font-size: 22px; letter-spacing: 0.06em;
  display: flex; align-items: baseline; gap: 6px;
  font-variant-numeric: tabular-nums;
}
.tc-played { color: var(--fg); }
.tc-sep { color: var(--fg-4); }
.tc-total { color: var(--fg-3); font-size: 14px; }

/* Waveform */
.waveform {
  position: relative;
  margin: 0 22px;
  height: 180px;
  border: 1px solid var(--line);
  border-left-color: var(--line-2);
  border-right-color: var(--line-2);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.01), transparent),
    var(--bg-1);
  cursor: crosshair;
  overflow: hidden;
}
.wave-axis-top {
  position: absolute; top: 0; left: 0; right: 0; height: 14px;
  font-size: 8px; letter-spacing: 0.16em; color: var(--fg-4);
}
.wave-axis-top span {
  position: absolute; transform: translateX(-50%); top: 2px;
  font-variant-numeric: tabular-nums;
}
.wave-axis-top span::before {
  content: ""; position: absolute; left: 50%; top: 12px;
  width: 1px; height: 6px; background: var(--line-2);
}
.wave-bars {
  position: absolute; top: 18px; bottom: 14px; left: 0; right: 0;
  display: flex; align-items: center; gap: 1px;
  padding: 0 4px;
}
.wave-bar {
  flex: 1;
  background: var(--fg-4);
  min-width: 1px;
  transition: background 0.05s, height 0.2s;
  align-self: center;
  display: block;
}
.wave-bar.played { background: var(--fg); }
.wave-bar.in-loop { background: var(--accent) !important; opacity: 0.9; }
.wave-bar.hover { background: var(--accent); }
.wave-loading {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 10px; letter-spacing: 0.3em; color: var(--fg-3);
}
.wave-playhead {
  position: absolute; top: 14px; bottom: 0; width: 0; pointer-events: none;
}
.wave-playhead-line {
  position: absolute; top: 0; bottom: 0; left: 0; width: 1px; background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}
.wave-playhead-tag {
  position: absolute; top: -2px; left: 4px;
  font-size: 9px; letter-spacing: 0.16em; color: var(--accent);
  background: var(--bg-1); padding: 2px 6px;
  border: 1px solid var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.wave-line-markers {
  position: absolute; bottom: 0; left: 0; right: 0; height: 14px;
}
.wave-line-marker {
  position: absolute; bottom: 0; width: 1px; height: 6px; background: var(--line-2);
}

/* Transport */
.transport {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.transport-btn {
  border: 1px solid var(--line-2);
  padding: 10px 14px;
  font-size: 10px; letter-spacing: 0.22em;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background 0.12s, border 0.12s;
  color: var(--fg-2);
  height: 38px;
}
.transport-btn:hover { border-color: var(--fg); color: var(--fg); }
.transport-btn.play {
  border-color: var(--accent); color: var(--accent);
  padding: 10px 22px; min-width: 110px; justify-content: center;
}
.transport-btn.play:hover { background: var(--accent); color: #0A0A0B; }
.transport-rate, .transport-loop {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 10px;
  border: 1px solid var(--line);
}
.transport-label { font-size: 9px; letter-spacing: 0.3em; color: var(--fg-3); margin-right: 4px; }
.rate-btn {
  font-size: 10px; padding: 4px 8px; letter-spacing: 0.1em;
  color: var(--fg-3); border: 1px solid transparent;
}
.rate-btn.on { color: var(--accent); border-color: var(--accent); }
.rate-btn:hover { color: var(--fg); }
.loop-btn { font-size: 10px; letter-spacing: 0.22em; color: var(--fg-3); display: inline-flex; gap: 8px; align-items: center; }
.loop-btn.on { color: var(--accent); }
.loop-glyph { font-size: 14px; }
.transport-loop { margin-left: auto; }

/* Transcript */
.transcript {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  padding: 0 22px 22px;
  overflow: hidden;
}
.transcript-header {
  display: flex; justify-content: space-between;
  font-size: 9px; letter-spacing: 0.3em; color: var(--fg-3);
  padding: 14px 0 10px;
  border-bottom: 1px solid var(--line);
}
.transcript-hint .kbd, .transcript-hint span { color: var(--fg-2); }
.transcript-body {
  flex: 1; overflow-y: auto;
  padding: 6px 0;
}
.line {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.line.active {
  background: linear-gradient(90deg, rgba(215, 38, 61, 0.06), transparent 80%);
}
.line.active::before {
  content: ""; position: absolute; left: -22px; top: 0; bottom: 0; width: 2px;
  background: var(--accent);
}
.line-jump {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em;
  color: var(--fg-3); text-align: right;
  font-variant-numeric: tabular-nums;
  padding-top: 4px;
}
.line-jump:hover { color: var(--accent); }
.line-text {
  font-family: var(--serif); font-size: 19px; line-height: 1.5;
  letter-spacing: 0.005em;
  color: var(--fg-3);
  cursor: pointer;
}
.line.active .line-text { color: var(--fg-2); }
.line .w.spoken { color: var(--fg); }
.line.flagged .line-text {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}
.line-flag {
  align-self: center;
  border: 1px solid var(--line-2);
  padding: 6px 10px;
  font-size: 9px; letter-spacing: 0.22em; color: var(--fg-3);
  display: inline-flex; gap: 6px; align-items: center;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, border 0.15s;
}
.line:hover .line-flag, .line.flagged .line-flag, .line.active .line-flag { opacity: 1; }
.line-flag:hover { color: var(--fg); border-color: var(--fg); }
.line-flag.on { color: var(--accent); border-color: var(--accent); opacity: 1; }
.flag-glyph { font-size: 11px; }

/* Notebook -------------------------------------------------------------- */
.notebook {
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(255,255,255,0.01), transparent 200px);
}
.notebook-meta {
  display: grid; grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
}
.notebook-meta-row {
  padding: 12px 16px;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 9px; letter-spacing: 0.24em; color: var(--fg-3);
  border-right: 1px solid var(--line);
}
.notebook-meta-row:last-child { border-right: 0; }
.notebook-meta-val {
  font-size: 14px; letter-spacing: 0.04em; color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.notebook-list {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 14px 0;
}
.notebook-empty {
  text-align: center; padding: 48px 20px;
  color: var(--fg-3);
}
.notebook-empty-glyph { font-size: 32px; color: var(--fg-4); margin-bottom: 12px; }
.notebook-empty-title { font-size: 10px; letter-spacing: 0.3em; color: var(--fg-2); margin-bottom: 10px; }
.notebook-empty-hint {
  font-family: var(--serif); font-style: italic; font-size: 14px;
  color: var(--fg-3); line-height: 1.6;
  letter-spacing: 0;
}
.notebook-empty-hint .kbd {
  font-family: var(--mono); font-style: normal;
  border: 1px solid var(--line-2); padding: 1px 5px; font-size: 11px;
  color: var(--fg-2);
}
.notebook-group { margin-bottom: 14px; }
.notebook-group-head {
  display: flex; gap: 6px; align-items: baseline;
  padding: 8px 18px;
  font-size: 9px; letter-spacing: 0.3em;
}
.notebook-group-name { color: var(--accent); }
.notebook-group-role {
  font-family: var(--serif); font-style: italic; font-size: 12px;
  color: var(--fg-3); letter-spacing: 0;
}
.notebook-entry {
  margin: 0 14px 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  background: rgba(255,255,255,0.012);
}
.notebook-entry-quote {
  font-family: var(--serif); font-size: 16px; line-height: 1.5;
  color: var(--fg);
  margin-bottom: 10px;
}
.quote-mark { color: var(--accent); }
.notebook-entry-foot {
  display: flex; gap: 10px; align-items: center;
  font-size: 9px; letter-spacing: 0.2em; color: var(--fg-3);
}
.notebook-tc { font-variant-numeric: tabular-nums; flex: 1; }
.notebook-jump, .notebook-remove {
  border: 1px solid var(--line-2);
  padding: 4px 8px;
  font-size: 9px; letter-spacing: 0.18em;
  color: var(--fg-3);
}
.notebook-jump:hover { color: var(--accent); border-color: var(--accent); }
.notebook-remove:hover { color: var(--fg); border-color: var(--fg); }

.accuse-btn {
  flex: 0 0 auto;
  border: 0;
  border-top: 1px solid var(--line-2);
  padding: 22px;
  display: flex; flex-direction: column; gap: 6px; align-items: center;
  background: var(--bg-1);
  color: var(--fg-3);
  letter-spacing: 0.4em;
}
.accuse-btn:disabled { color: var(--fg-3); }
.accuse-btn.ready {
  background: linear-gradient(180deg, rgba(215, 38, 61, 0.1), transparent);
  color: var(--accent); border-top-color: var(--accent);
  animation: accuse-pulse 1.6s ease-in-out infinite;
}
@keyframes accuse-pulse {
  0%, 100% { box-shadow: inset 0 0 0 0 var(--accent); }
  50% { box-shadow: inset 0 -2px 0 0 var(--accent); }
}
.accuse-label { font-size: 14px; }
.accuse-sub { font-size: 9px; letter-spacing: 0.3em; color: var(--fg-3); }
.accuse-btn.ready .accuse-sub { color: var(--accent); opacity: 0.7; }

/* MODAL ----------------------------------------------------------------- */
.modal-bg {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(5,5,7,0.86);
  display: grid; place-items: center;
  backdrop-filter: blur(2px);
  animation: fadein 0.3s ease;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 920px; max-width: 92vw; max-height: 92vh;
  background: var(--bg);
  border: 1px solid var(--accent);
  display: flex; flex-direction: column;
  overflow: hidden;
  position: relative;
}
.modal::before, .modal::after {
  content: ""; position: absolute; width: 14px; height: 14px;
  border: 1px solid var(--accent);
}
.modal::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.modal::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
}
.modal-stamp {
  font-size: 10px; letter-spacing: 0.4em;
  color: var(--accent);
}
.modal-close {
  font-size: 9px; letter-spacing: 0.24em; color: var(--fg-3);
}
.modal-close:hover { color: var(--fg); }
.modal-question {
  font-family: var(--serif);
  font-size: 44px; font-weight: 300;
  text-align: center;
  padding: 36px 24px 28px;
  color: var(--fg);
  letter-spacing: 0.02em;
}

/* Accusation grid */
.acc-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.acc-card {
  display: grid; grid-template-columns: 88px 1fr auto;
  gap: 16px; align-items: center;
  padding: 18px 22px;
  background: var(--bg);
  text-align: left;
  transition: background 0.15s;
  position: relative;
}
.acc-card:hover { background: var(--bg-1); }
.acc-card.on {
  background: linear-gradient(90deg, rgba(215, 38, 61, 0.18), transparent 70%);
}
.acc-card.on::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--accent);
}
.acc-card-portrait {
  width: 80px; height: 90px;
  background: var(--bg-2); border: 1px solid var(--line-2);
  color: var(--fg-3);
  overflow: hidden;
}
.acc-card.on .acc-card-portrait { color: var(--accent); border-color: var(--accent); }
.acc-card-num { font-size: 9px; letter-spacing: 0.3em; color: var(--fg-3); }
.acc-card-name { font-size: 13px; letter-spacing: 0.06em; margin: 4px 0 2px; }
.acc-card-role { font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--fg-2); }
.acc-card-mark {
  font-size: 9px; letter-spacing: 0.3em; color: var(--fg-3);
}
.acc-card.on .acc-card-mark { color: var(--accent); }

.acc-line {
  padding: 22px 24px 8px;
  border-bottom: 1px solid var(--line);
}
.acc-line-q {
  font-size: 10px; letter-spacing: 0.3em; color: var(--accent);
  margin-bottom: 14px;
}
.acc-line-none {
  font-family: var(--serif); font-style: italic; color: var(--fg-3);
  font-size: 14px; line-height: 1.6; padding: 16px;
  border: 1px dashed var(--line-2);
}
.acc-line-list { display: flex; flex-direction: column; gap: 6px; }
.acc-line-row {
  display: grid; grid-template-columns: 70px 1fr 30px;
  gap: 14px; align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  text-align: left;
  background: var(--bg);
  transition: background 0.12s, border 0.12s;
}
.acc-line-row:hover { border-color: var(--line-2); background: var(--bg-1); }
.acc-line-row.on { border-color: var(--accent); background: rgba(215,38,61,0.06); }
.acc-line-tc { font-size: 10px; color: var(--fg-3); letter-spacing: 0.14em; font-variant-numeric: tabular-nums; }
.acc-line-text { font-family: var(--serif); font-size: 15px; color: var(--fg); }
.acc-line-radio { font-size: 18px; color: var(--fg-4); text-align: right; }
.acc-line-row.on .acc-line-radio { color: var(--accent); }

.acc-foot {
  padding: 18px 24px 22px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 24px;
}
.acc-warning {
  font-family: var(--serif); font-style: italic;
  font-size: 13px; color: var(--fg-3); max-width: 480px;
}
.acc-deliver {
  border: 1px solid var(--line-2);
  padding: 16px 28px;
  font-size: 12px; letter-spacing: 0.4em;
  color: var(--fg-3);
  flex-shrink: 0;
}
.acc-deliver.ready {
  border-color: var(--accent); color: var(--accent);
}
.acc-deliver.ready:hover { background: var(--accent); color: #0A0A0B; }

/* VERDICT --------------------------------------------------------------- */
.verdict {
  position: fixed; inset: 0; z-index: 300;
  background: #000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px;
  text-align: center;
  animation: blackin 0.6s ease forwards;
}
@keyframes blackin { from { opacity: 0; } to { opacity: 1; } }
.verdict-grain {
  position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='2' seed='5'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.7 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.12; mix-blend-mode: overlay;
  animation: grain 1.4s steps(5) infinite;
}
.verdict-stamp {
  position: absolute; left: 40px; top: 40px;
  font-size: 9px; letter-spacing: 0.4em; color: var(--accent);
}
.verdict-word {
  font-family: var(--serif);
  font-size: 168px; font-weight: 300;
  letter-spacing: 0.02em;
  color: var(--accent);
  opacity: 0; transform: translateY(20px);
  transition: opacity 1.4s ease, transform 1.4s ease;
  line-height: 1;
}
.verdict.innocent .verdict-word { color: var(--fg); font-size: 96px; line-height: 1.05; }
.verdict.phase-1 .verdict-word, .verdict.phase-2 .verdict-word {
  opacity: 1; transform: translateY(0);
}
.verdict-detail {
  margin-top: 56px; max-width: 620px;
  opacity: 0; transition: opacity 0.9s ease 0.2s;
}
.verdict.phase-2 .verdict-detail { opacity: 1; }
.verdict-detail-label, .verdict-realkiller-label {
  font-size: 9px; letter-spacing: 0.4em; color: var(--fg-3);
  margin-bottom: 12px;
}
.verdict-detail-name {
  font-family: var(--serif);
  font-size: 36px; font-weight: 300;
  letter-spacing: 0.02em; color: var(--fg);
  margin-bottom: 4px;
}
.verdict-detail-role {
  font-family: var(--serif); font-style: italic;
  color: var(--fg-2); font-size: 16px;
  margin-bottom: 32px;
}
.verdict-tell {
  font-size: 9px; letter-spacing: 0.4em; color: var(--accent);
  margin-bottom: 14px;
}
.verdict-line {
  font-family: var(--serif);
  font-size: 22px; line-height: 1.5; color: var(--fg);
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  padding: 22px 0;
  margin-bottom: 30px;
}
.verdict-confession-label {
  font-size: 9px; letter-spacing: 0.3em; color: var(--fg-3);
  margin-bottom: 12px;
}
.verdict-confession {
  font-family: var(--serif); font-style: italic;
  font-size: 15px; line-height: 1.7; color: var(--fg-2);
  margin-bottom: 36px;
  text-align: left;
  border-left: 2px solid var(--accent); padding-left: 18px;
}
.verdict-again {
  border: 1px solid var(--accent); color: var(--accent);
  padding: 14px 28px; font-size: 11px; letter-spacing: 0.4em;
}
.verdict-again:hover { background: var(--accent); color: #000; }
.verdict-again.muted { border-color: var(--fg-3); color: var(--fg-3); }
.verdict-again.muted:hover { background: var(--fg); color: #000; border-color: var(--fg); }

/* Tweaks panel inherits from starter; tweak our chrome a bit */
.tweaks-panel { font-family: var(--mono) !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--fg-3); }

/* Small screens — stack the room (still reads as a single workstation) */
@media (max-width: 1100px) {
  .room { grid-template-columns: 240px 1fr 280px; }
  .player-suspect-role { font-size: 22px; }
  .briefing-title { font-size: 48px; }
}

/* ===== Case picker (briefing) ===== */
.case-picker {
  margin: 0 0 28px;
  padding: 18px 0 22px;
  border-top: 1px solid rgba(244, 241, 234, 0.14);
  border-bottom: 1px solid rgba(244, 241, 234, 0.14);
}
.case-picker-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: rgba(244, 241, 234, 0.45);
  margin-bottom: 12px;
}
.case-picker-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.case-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 12px;
  background: transparent;
  color: #f4f1ea;
  border: 1px solid rgba(244, 241, 234, 0.18);
  font-family: "JetBrains Mono", monospace;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.case-tab:hover { border-color: rgba(244, 241, 234, 0.45); }
.case-tab.on {
  border-color: var(--accent, #d7263d);
  background: rgba(215, 38, 61, 0.08);
}
.case-tab-no {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(244, 241, 234, 0.55);
}
.case-tab.on .case-tab-no { color: var(--accent, #d7263d); }
.case-tab-title {
  font-family: "Fraunces", serif;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.04em;
}
.case-tab-era {
  font-size: 9px;
  letter-spacing: 0.24em;
  color: rgba(244, 241, 234, 0.4);
}
.case-tagline {
  margin-top: 14px;
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 14px;
  color: rgba(244, 241, 234, 0.7);
  line-height: 1.4;
}

/* ===== Evidence tags (inline in transcript) ===== */
.line-tag {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  padding: 1px 5px;
  margin-right: 8px;
  vertical-align: 2px;
  border: 1px solid rgba(244, 241, 234, 0.35);
  color: rgba(244, 241, 234, 0.7);
  background: rgba(244, 241, 234, 0.04);
  text-transform: uppercase;
  font-weight: 500;
}
.tag-alibi      { color: #d7a35a; border-color: rgba(215, 163, 90, 0.5); }
.tag-timestamp  { color: #6ec5d4; border-color: rgba(110, 197, 212, 0.5); }
.tag-witness    { color: #a78bf2; border-color: rgba(167, 139, 242, 0.5); }
.tag-motive     { color: var(--accent, #d7263d); border-color: rgba(215, 38, 61, 0.55); }
.tag-admission  { color: #e0e0c8; border-color: rgba(224, 224, 200, 0.55); }

/* ===== Notebook entry: tag + contradictions ===== */
.notebook-entry-tag {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  padding: 1px 5px;
  margin-bottom: 6px;
  border: 1px solid rgba(244, 241, 234, 0.3);
  color: rgba(244, 241, 234, 0.75);
}
.notebook-entry-contradicts {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(215, 38, 61, 0.4);
  background: rgba(215, 38, 61, 0.06);
}
.contradicts-head {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--accent, #d7263d);
  margin-bottom: 8px;
  font-weight: 600;
}
.contradicts-row {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(244, 241, 234, 0.08);
}
.contradicts-row:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.contradicts-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.contradicts-name {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: rgba(244, 241, 234, 0.75);
}
.contradicts-jump {
  background: transparent;
  border: 1px solid rgba(244, 241, 234, 0.25);
  color: rgba(244, 241, 234, 0.85);
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  padding: 2px 6px;
  cursor: pointer;
}
.contradicts-jump:hover {
  border-color: var(--accent, #d7263d);
  color: var(--accent, #d7263d);
}
.contradicts-quote {
  font-family: "Fraunces", serif;
  font-size: 13px;
  font-style: italic;
  color: rgba(244, 241, 234, 0.92);
  line-height: 1.4;
}
.contradicts-note {
  margin-top: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: rgba(244, 241, 234, 0.55);
  line-height: 1.4;
}

/* ============================================================
   Mobile / tablet — stack the workstation, keep the noir vibe.
   ============================================================ */

/* Tablet & small laptop: 3 columns get tighter */
@media (max-width: 960px) {
  .room { grid-template-columns: 200px 1fr 240px; }
  .player-suspect-name { font-size: 24px; }
  .player-suspect-role { font-size: 18px; }
  .briefing-title { font-size: 40px; }
}

/* True mobile — single column stack */
@media (max-width: 760px) {
  /* App chrome */
  html, body, #root, .app { height: auto; min-height: 100vh; overflow-x: hidden; }
  .app { padding-bottom: 32px; }
  .topbar {
    grid-template-columns: 1fr auto;
    padding: 10px 14px;
    font-size: 10px;
  }
  .topbar-c { display: none; }
  .topbar-r { font-size: 9px; letter-spacing: 0.16em; }
  .logo-text { font-size: 9px; letter-spacing: 0.18em; }

  /* Briefing */
  .briefing { padding: 24px 14px; }
  .briefing-frame { padding: 22px 18px; }
  .briefing-stamp { display: none; }
  .briefing-title { font-size: 28px; line-height: 1.1; }
  .briefing-caseno { font-size: 11px; }
  .briefing-meta { flex-wrap: wrap; gap: 8px; font-size: 9px; }
  .briefing-body { font-size: 12px; }
  .briefing-line span:not(.briefing-prompt) { word-break: break-word; }

  /* Case picker */
  .case-picker-list { grid-template-columns: 1fr; }
  .case-tab { padding: 12px 14px; }
  .case-tab-title { font-size: 16px; }
  .case-tagline { font-size: 13px; }

  /* Begin button */
  .briefing-begin {
    width: 100%;
    justify-content: center;
    padding: 14px 18px;
  }

  /* The room becomes one column */
  .room {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    height: auto;
    gap: 0;
    padding: 0;
  }
  .room > * {
    overflow: visible;
    border: none;
    border-bottom: 1px solid var(--line-1);
    padding: 18px 14px;
  }
  .room > *:last-child { border-bottom: none; }
  .col-header { margin-bottom: 12px; }

  /* Roster — horizontal scroll strip of suspect cards */
  .roster { padding: 14px; }
  .roster-list {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
  }
  .roster-list > * {
    flex: 0 0 220px;
    scroll-snap-align: start;
  }

  /* Player */
  .player { padding: 14px; }
  .player-name { flex-direction: column; align-items: flex-start; gap: 6px; }
  .player-suspect-name { font-size: 22px; line-height: 1.1; }
  .player-suspect-role { font-size: 14px; }
  .timecode { font-size: 14px; }
  .waveform { height: 110px; }
  .wave-axis-top { font-size: 8px; }
  .wave-axis-top span:nth-child(2n) { display: none; }

  /* Transport — wrap & shrink */
  .transport {
    flex-wrap: wrap;
    gap: 8px;
    row-gap: 10px;
    justify-content: flex-start;
  }
  .transport-btn { padding: 8px 10px; font-size: 11px; }
  .transport-btn.play { padding: 10px 16px; }
  .transport-rate, .transport-loop { flex: 0 0 auto; }
  .transport-label { font-size: 9px; }
  .rate-btn { padding: 6px 8px; font-size: 10px; }
  .loop-btn { padding: 8px 10px; font-size: 11px; }

  /* Transcript */
  .transcript-header { font-size: 9px; flex-wrap: wrap; gap: 4px; }
  .transcript-hint { display: none; }
  .line { padding: 10px 8px; gap: 8px; }
  .line-jump { font-size: 9px; padding: 4px 6px; }
  .line-text { font-size: 14px; line-height: 1.45; }
  .line-flag .flag-label { display: none; }
  .line-flag { padding: 6px 8px; }

  /* Inline evidence tags */
  .line-tag { font-size: 8px; padding: 1px 4px; margin-right: 6px; }

  /* Notebook */
  .notebook { padding: 14px; }
  .notebook-meta { flex-direction: row; gap: 18px; margin-bottom: 10px; }
  .notebook-list { max-height: none; }
  .notebook-entry { padding: 10px; }
  .notebook-entry-quote { font-size: 13px; }
  .contradicts-quote { font-size: 12px; }
  .contradicts-note { font-size: 9px; }
  .accuse-btn {
    position: sticky;
    bottom: 12px;
    z-index: 5;
    margin-top: 14px;
  }

  /* Accusation modal */
  .modal.accusation { padding: 18px 14px; }
  .acc-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .acc-card { padding: 14px 10px; }
  .acc-card-name { font-size: 14px; }
  .acc-card-role { font-size: 11px; }
  .acc-line-list { max-height: 240px; }
  .acc-line-text { font-size: 12px; }
  .acc-deliver { padding: 14px 18px; font-size: 13px; }
  .modal-head { flex-direction: column; gap: 8px; align-items: flex-start; }

  /* Verdict */
  .verdict { padding: 24px 18px; }
  .verdict-word { font-size: 56px !important; line-height: 1.05; }
  .verdict-confession { font-size: 16px; line-height: 1.5; }
  .verdict-detail-name { font-size: 20px; }
  .verdict-line { font-size: 14px; }

  /* Tweaks panel — hide on mobile, it's a dev/design tool */
  .twk-panel { display: none !important; }
}

/* Phones — tighter */
@media (max-width: 420px) {
  .briefing-title { font-size: 22px; }
  .player-suspect-name { font-size: 18px; }
  .waveform { height: 90px; }
  .verdict-word { font-size: 44px !important; }
  .roster-list > * { flex: 0 0 200px; }
}
