/* Preset E — Warm Parchment Case Ledger + Polaroids (#e9dfca + #1d1915 + #a3271f) */
:root {
  --bg: #e9dfca;
  --surface: #f3ecdc;
  --surface-2: #ded1b5;
  --border: rgba(35, 28, 21, 0.16);
  --border-strong: rgba(35, 28, 21, 0.32);
  --text: #231c15;
  --text-body: #2e251c;
  --muted: #554738;
  --accent: #a3271f;
  --accent-hover: #8d1f18;
  --accent-ink: #fbf7ee;
  --accent-soft: rgba(163, 39, 31, 0.11);
  --accent-border: rgba(163, 39, 31, 0.36);
  --spoiler-title: #8d1f18;
  --hdr-bg: #1d1915;
  --hdr-text: #e9dfca;
  --hdr-muted: #c2b49a;
  --hdr-border: #6b5a45;
  --mob-nav-bg: #ded1b5;
  --mob-nav-text: #231c15;
  --tape: rgba(236, 226, 190, 0.80);
  --ok: #256f42;
  --err: #a3271f;
  --r-sm: 3px;
  --r-md: 4px;
  --r-lg: 6px;
  --font-head: 'Trebuchet MS', 'Segoe UI', system-ui, Arial, sans-serif;
  --font-body: Georgia, 'Times New Roman', Cambria, serif;
  --font-mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
}

.topbar { border-bottom: 3px double var(--hdr-border); }
.brand { text-transform: uppercase; letter-spacing: 0.05em; }
.topbar .nav-dd-menu { background: #27211c; color: #e9dfca; border-color: #6b5a45; }
.topbar .nav-dd-menu a { color: #dfd4be; }
.topbar .nav-dd-menu a:hover, .topbar .nav-dd-menu a.active { background: #372e26; color: #ffb49e; }
.topbar .nav-dd-menu a small { color: #b5a68b; }
.topbar .btn-continue { background: var(--accent-glow, rgba(163, 39, 31, 0.28)); color: #fce9e5; border-color: var(--accent-border, rgba(226, 73, 61, 0.55)); }

/* Journal Spread 1st Screen */
.spread { padding: 30px 0 26px; display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 36px; align-items: start; }
.spread > * { min-width: 0; }
.spread h1 {
  margin: 0;
  font: 700 clamp(28px, 3.8vw, 44px)/1.05 var(--font-head);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--text);
}
.spread .spread-sub {
  display: block;
  font: 600 clamp(14px, 1.3vw, 17px)/1.35 var(--font-head);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 8px 0 0;
}
.typed {
  font: 14px/1.6 var(--font-mono);
  color: var(--muted);
  display: flex;
  gap: 4px 16px;
  flex-wrap: wrap;
  margin: 12px 0 18px;
}
.typed b { color: var(--text); font-weight: 700; background: var(--surface); padding: 0 5px; border: 1px solid var(--border); }

/* Pinned Taped Video Frame (#player-stage visible on 1st screen) */
.pinned {
  position: relative;
  background: #14110f;
  padding: 10px 10px 0;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08), 0 18px 30px -12px rgba(35, 28, 21, 0.45);
  border-radius: var(--r-sm);
}
.pinned::before, .pinned::after {
  content: '';
  position: absolute;
  width: 100px;
  height: 26px;
  background: var(--tape);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14);
  z-index: 3;
  pointer-events: none;
}
.pinned::before { top: -12px; left: 26px; transform: rotate(-4deg); }
.pinned::after { top: -10px; right: 32px; transform: rotate(3deg); }

.pinned .player-top-bar { background: #1d1915; border-color: #3e342a; padding: 8px 10px; }
.pinned .ptab { background: #2a241e; color: #d6cbb7; border-color: #4a3f33; }
.pinned .ptab.active { background: var(--accent); color: #fbf7ee; border-color: var(--accent); }
.pinned .play-big {
  width: 106px;
  height: 106px;
  border: 4px solid #e2493d;
  color: #ffe9e4;
  background: color-mix(in srgb, var(--accent) 86%, transparent);
  box-shadow: 0 0 0 4px var(--accent-border, rgba(163, 39, 31, 0.35));
  font: 700 13px/1.1 var(--font-head);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: rotate(-5deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.pinned .play-big:hover { background: #b52c22; transform: rotate(-2deg) scale(1.04); }

.film-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 4px 12px;
  color: #cfc3ad;
  font: 13px var(--font-mono);
  flex-wrap: wrap;
}
.film-foot .voices { display: flex; gap: 6px; flex-wrap: wrap; }
.film-foot .voice {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #4a3f33;
  background: #1d1915;
  border-radius: var(--r-sm);
  font: 13px var(--font-mono);
  color: #e9dfca;
}
.film-foot .voice.active, .film-foot .voice[aria-pressed="true"] {
  background: #e9dfca;
  color: #1d1915;
  border-color: #e9dfca;
  font-weight: 700;
}
.film-foot .next {
  min-height: 34px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: #ffffff;
  font: 600 13px var(--font-head);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Case Ledger Card with Vertical Tabs */
.ledger {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 24px -14px rgba(35, 28, 21, 0.42);
  margin-right: 40px;
}
.ledger-head {
  padding: 16px 18px 12px;
  border-bottom: 2px solid var(--text);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;
  flex-wrap: wrap;
}
.ledger-title { margin: 0; font: 700 19px var(--font-head); letter-spacing: 0.05em; text-transform: uppercase; color: var(--text); }
.ledger-head span { font: 13px var(--font-mono); color: var(--muted); white-space: nowrap; }
.ledger-items { max-height: 460px; overflow-y: auto; }
.case {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px dashed var(--border);
  color: var(--text);
}
.case:hover { background: var(--accent-soft); }
.case.watched { background: rgba(37, 111, 66, 0.08); }
.case .no { font: 13px var(--font-mono); color: var(--muted); }
.case b { font-weight: 700; font-size: 15px; display: block; line-height: 1.25; }
.case small { font: 12.5px var(--font-mono); color: var(--muted); display: block; }
.case .tag {
  font: 600 11px var(--font-head);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1.5px solid currentColor;
  padding: 1px 6px;
  border-radius: 2px;
  transform: rotate(-2deg);
  white-space: nowrap;
}
.ledger-foot { padding: 11px 18px; font: 700 14px var(--font-mono); color: var(--accent); border-top: 1px solid var(--border); }

.tabs { position: absolute; top: 14px; right: -40px; display: flex; flex-direction: column; gap: 3px; }
.tab {
  min-width: 38px;
  height: 34px;
  border: 1px solid var(--border-strong);
  border-left: 0;
  border-radius: 0 5px 5px 0;
  background: var(--surface-2);
  font: 600 13px var(--font-mono);
  color: var(--text);
  display: grid;
  place-items: center;
  padding: 0 6px;
}
.tab:hover { background: var(--surface); }
.tab.active { background: var(--text); color: var(--bg); border-color: var(--text); width: 42px; }

/* Polaroids Board */
.board { padding: 24px 0 36px; }
.board-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 22px;
  border-bottom: 2px solid var(--text);
  padding-bottom: 10px;
  flex-wrap: wrap;
}
.board-head h2 { margin: 0; font: 700 26px var(--font-head); text-transform: uppercase; letter-spacing: 0.04em; color: var(--text); }
.board-head p { margin: 0; font: 14px var(--font-mono); color: var(--muted); max-width: 60ch; }
.polaroids { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 20px; }
.pol {
  display: block;
  background: #fbf7ee;
  padding: 10px 10px 14px;
  box-shadow: 0 10px 18px -10px rgba(35, 28, 21, 0.45);
  position: relative;
  transition: transform 0.2s;
  color: var(--text);
}
.pol:nth-child(odd) { transform: rotate(-1.1deg); }
.pol:nth-child(even) { transform: rotate(1deg); }
.pol:hover { transform: rotate(0) translateY(-3px); }
.pol::before { content: ''; position: absolute; top: -10px; left: 50%; width: 70px; height: 22px; margin-left: -35px; background: var(--tape); }
.pol img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; display: block; filter: saturate(0.85); }
.pol .cap { margin-top: 10px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pol b { font: 700 17px/1.2 var(--font-body); font-style: italic; }
.pol small { font: 12px var(--font-mono); color: var(--muted); }
.pol .where { font: 13px var(--font-mono); color: var(--muted); margin-top: 4px; }

@media (max-width: 1080px) {
  .spread { grid-template-columns: 1fr; }
  .ledger { margin-right: 0; }
  .tabs { position: static; flex-direction: row; overflow-x: auto; padding: 10px 16px 0; gap: 4px; scrollbar-width: none; }
  .tab { flex: none; border: 1px solid var(--border-strong); border-bottom: 0; border-radius: 5px 5px 0 0; min-width: 40px; height: 34px; }
  .tab.active { width: auto; min-width: 40px; }
  .polaroids { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .spread { padding-top: 20px; gap: 24px; }
  .spread h1 { font-size: 26px; }
  .typed { font-size: 13px; }
  .pinned .play-big { width: 76px; height: 76px; font-size: 11px; border-width: 3px; }
  .case { grid-template-columns: 42px minmax(0, 1fr); padding: 10px 14px; }
  .case .tag { display: none; }
  .polaroids { gap: 18px 12px; }
  .pol { padding: 7px 7px 10px; }
  .pol .where { display: none; }
}
