/* EPITAPH — The Millhaven Observer */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,900;1,400;1,600&family=EB+Garamond:ital,wght@0,400;0,500;1,400&family=Special+Elite&display=swap');

/* ============================================================
   RESET & BASE
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --paper:       #f5edd8;
  --paper-dark:  #ede0c4;
  --paper-mid:   #e8d9b8;
  --ink:         #1a1008;
  --ink-light:   #3d2e1a;
  --ink-faint:   #6b5740;
  --red:         #8b1a1a;
  --red-light:   #b52828;
  --rule:        #c4a882;
  --rule-dark:   #a08060;
  --highlight:   rgba(255, 220, 50, 0.55);
  --highlight-border: rgba(210, 160, 0, 0.4);
  --clipped:     #fffbe8;
  --board-bg:    #d4c4a0;
  --evidence-bg: #faf5e8;
  --pin-red:     #cc2222;
  --shadow:      rgba(26, 16, 8, 0.15);
  --shadow-deep: rgba(26, 16, 8, 0.3);

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'EB Garamond', Georgia, serif;
  --font-stamp:   'Special Elite', 'Courier New', monospace;

  --tag-0: #9b2020;
  --tag-1: #a06020;
  --tag-2: #1d7060;
  --tag-3: #1e4a80;
  --tag-4: #5c2878;
}

html, body {
  height: 100%;
  background: var(--board-bg);
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ============================================================
   LAYOUT SHELL
   ============================================================ */

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============================================================
   SCREEN SYSTEM
   ============================================================ */

.screen {
  display: none;
  flex-direction: column;
  flex: 1;
}

.screen.active {
  display: flex;
}

/* ============================================================
   TITLE SCREEN
   ============================================================ */

#screen-title {
  background: var(--paper);
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
  position: relative;
}

#screen-title::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 27px, var(--rule) 27px, var(--rule) 28px),
    repeating-linear-gradient(90deg, transparent, transparent 27px, rgba(196,168,130,0.2) 27px, rgba(196,168,130,0.2) 28px);
  opacity: 0.18;
  pointer-events: none;
}

.title-paper {
  position: relative;
  max-width: 680px;
  width: 100%;
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: 48px 52px 44px;
  box-shadow: 4px 4px 0 var(--rule-dark), 8px 8px 0 rgba(0,0,0,0.1);
}

.title-paper::before {
  content: '';
  position: absolute;
  top: 8px; left: 8px; right: 8px; bottom: 8px;
  border: 1px solid var(--rule);
  pointer-events: none;
}

.masthead-city {
  font-family: var(--font-stamp);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
  margin-bottom: 6px;
}

.masthead-rule-top {
  height: 3px;
  background: var(--ink);
  margin-bottom: 4px;
}

.masthead-rule-thin {
  height: 1px;
  background: var(--ink);
  margin-bottom: 14px;
}

.masthead-title {
  font-family: var(--font-display);
  font-size: clamp(52px, 10vw, 82px);
  font-weight: 900;
  letter-spacing: -1px;
  text-align: center;
  line-height: 0.9;
  color: var(--ink);
  margin-bottom: 10px;
}

.masthead-sub {
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink-faint);
  margin-bottom: 10px;
}

.masthead-rule-thick {
  height: 6px;
  background: var(--ink);
  margin-bottom: 2px;
}

.masthead-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  text-align: center;
  color: var(--ink-faint);
  letter-spacing: 0.5px;
  margin-bottom: 32px;
}

.title-intro {
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink-light);
  text-align: center;
  margin-bottom: 28px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 18px 0;
}

.title-intro em {
  font-style: italic;
  color: var(--ink);
}

.btn-primary {
  display: block;
  width: 100%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 1px;
  color: var(--paper);
  background: var(--ink);
  border: none;
  padding: 14px 24px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  text-transform: uppercase;
}

.btn-primary:hover {
  background: var(--ink-light);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.title-date {
  font-family: var(--font-stamp);
  font-size: 11px;
  text-align: center;
  color: var(--ink-faint);
  margin-top: 16px;
  letter-spacing: 1px;
}

/* ============================================================
   MAIN GAME — THREE PANEL LAYOUT
   ============================================================ */

#screen-game {
  flex-direction: row;
  height: 100vh;
  overflow: hidden;
}

/* LEFT PANEL — Archive list */
.panel-archive {
  width: 280px;
  min-width: 240px;
  flex-shrink: 0;
  background: var(--paper-dark);
  border-right: 2px solid var(--rule-dark);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  padding: 14px 16px 10px;
  border-bottom: 2px solid var(--rule-dark);
  background: var(--ink);
  color: var(--paper);
  flex-shrink: 0;
}

.panel-header h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.5px;
}

.panel-header p {
  font-family: var(--font-stamp);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: rgba(245,237,216,0.7);
  margin-top: 3px;
  text-transform: uppercase;
}

.archive-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.archive-list::-webkit-scrollbar { width: 5px; }
.archive-list::-webkit-scrollbar-track { background: var(--paper-mid); }
.archive-list::-webkit-scrollbar-thumb { background: var(--rule-dark); border-radius: 2px; }

.archive-item {
  padding: 10px 16px;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
}

.archive-item:hover {
  background: var(--paper);
}

.archive-item.active {
  background: var(--paper);
  border-left: 4px solid var(--red);
  padding-left: 12px;
}

.archive-item.read::after {
  content: '';
  position: absolute;
  top: 12px; right: 12px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ink-faint);
  opacity: 0.5;
}

.archive-item.clipped::after {
  background: var(--red);
  opacity: 1;
}

.archive-name {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.archive-meta {
  font-family: var(--font-stamp);
  font-size: 10px;
  color: var(--ink-faint);
  margin-top: 3px;
  letter-spacing: 0.5px;
}

.archive-progress {
  padding: 10px 16px;
  border-top: 1px solid var(--rule-dark);
  background: var(--paper-mid);
  flex-shrink: 0;
}

.progress-label {
  font-family: var(--font-stamp);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--ink-faint);
  margin-bottom: 5px;
  text-transform: uppercase;
}

.progress-bar-bg {
  height: 4px;
  background: var(--rule);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--red);
  border-radius: 2px;
  transition: width 0.4s ease;
  width: 0%;
}

.progress-count {
  font-family: var(--font-stamp);
  font-size: 11px;
  color: var(--ink-faint);
  text-align: right;
  margin-top: 4px;
}

/* MIDDLE PANEL — Obituary reader */
.panel-reader {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--paper);
  border-right: 2px solid var(--rule);
}

.reader-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-bottom: 2px solid var(--rule);
  background: var(--paper-dark);
  flex-shrink: 0;
}

.reader-toolbar-label {
  font-family: var(--font-stamp);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.btn-clip {
  margin-left: auto;
  font-family: var(--font-stamp);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--red);
  border: none;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.12s;
}

.btn-clip:hover { background: var(--red-light); }

.btn-clip.clipped {
  background: var(--ink-faint);
}

.reader-nav {
  display: flex;
  gap: 6px;
}

.btn-nav {
  font-family: var(--font-stamp);
  font-size: 12px;
  color: var(--ink-faint);
  background: transparent;
  border: 1px solid var(--rule);
  padding: 5px 11px;
  cursor: pointer;
  transition: all 0.12s;
}

.btn-nav:hover:not(:disabled) {
  background: var(--paper);
  border-color: var(--ink);
  color: var(--ink);
}

.btn-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.reader-body {
  flex: 1;
  overflow-y: auto;
  padding: 32px 48px 40px;
}

.reader-body::-webkit-scrollbar { width: 5px; }
.reader-body::-webkit-scrollbar-track { background: var(--paper); }
.reader-body::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 2px; }

.obit-date-line {
  font-family: var(--font-stamp);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--ink-faint);
  margin-bottom: 12px;
  text-transform: uppercase;
}

.obit-headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 3vw, 26px);
  line-height: 1.25;
  color: var(--ink);
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 3px double var(--rule-dark);
}

.obit-body {
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--ink-light);
}

.obit-body p {
  margin-bottom: 14px;
  text-align: justify;
  hyphens: auto;
}

.obit-body p:first-child::first-letter {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 900;
  float: left;
  line-height: 0.8;
  margin: 5px 6px 0 0;
  color: var(--ink);
}

/* All sentences are clickable — none are pre-labeled */
.obit-body .sentence-clip {
  background: transparent;
  border-bottom: 1px dotted var(--rule-dark);
  cursor: pointer;
  transition: background 0.15s;
  padding: 0 1px;
}

.obit-body .sentence-clip:hover {
  background: var(--highlight);
}

.obit-body .sentence-clip.clipped {
  background: rgba(0,0,0,0.05);
  border-bottom: 2px solid var(--ink);
}

.key-passage-tooltip {
  position: fixed;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-stamp);
  font-size: 11px;
  letter-spacing: 0.5px;
  padding: 6px 10px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 1000;
  max-width: 220px;
  line-height: 1.4;
  opacity: 0;
  transition: opacity 0.15s;
  transform: translateY(-8px);
}

.key-passage-tooltip.visible {
  opacity: 1;
}

.reader-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--ink-faint);
  padding: 40px;
}

.reader-empty .empty-icon {
  font-size: 48px;
  opacity: 0.3;
}

.reader-empty p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  text-align: center;
  opacity: 0.6;
}

.reader-empty small {
  font-family: var(--font-stamp);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.4;
}

/* RIGHT PANEL — Evidence locker */
.panel-evidence {
  width: 300px;
  min-width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--evidence-bg);
  overflow: hidden;
}

.evidence-header {
  padding: 14px 16px 10px;
  border-bottom: 2px solid var(--rule-dark);
  background: var(--ink);
  color: var(--paper);
  flex-shrink: 0;
}

.evidence-header h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
}

.evidence-header p {
  font-family: var(--font-stamp);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: rgba(245,237,216,0.7);
  margin-top: 3px;
  text-transform: uppercase;
}

.evidence-tabs {
  display: flex;
  border-bottom: 2px solid var(--rule);
  background: var(--paper-mid);
  flex-shrink: 0;
}

.evidence-tab {
  flex: 1;
  padding: 8px 4px;
  font-family: var(--font-stamp);
  font-size: 10px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.12s;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.evidence-tab:hover { color: var(--ink); }

.evidence-tab.active {
  color: var(--red);
  border-bottom-color: var(--red);
  background: var(--evidence-bg);
}

.evidence-panel-body {
  flex: 1;
  overflow-y: auto;
  display: none;
}

.evidence-panel-body.active { display: block; }

.evidence-panel-body::-webkit-scrollbar { width: 4px; }
.evidence-panel-body::-webkit-scrollbar-track { background: var(--evidence-bg); }
.evidence-panel-body::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 2px; }

/* Evidence clippings list */
.evidence-empty {
  padding: 24px 16px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13.5px;
  color: var(--ink-faint);
  text-align: center;
  line-height: 1.6;
}

.evidence-clipping {
  margin: 8px 10px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--red);
  padding: 8px 10px;
  position: relative;
}

.evidence-clipping-source {
  font-family: var(--font-stamp);
  font-size: 10px;
  letter-spacing: 0.8px;
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.evidence-clipping-text {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-light);
}

.evidence-clipping-label {
  font-family: var(--font-stamp);
  font-size: 10px;
  color: var(--ink-faint);
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px dotted var(--rule);
}

.evidence-clipping-remove {
  position: absolute;
  top: 5px; right: 7px;
  background: none;
  border: none;
  font-size: 14px;
  color: var(--ink-faint);
  cursor: pointer;
  line-height: 1;
  opacity: 0.4;
  transition: opacity 0.12s;
}

.evidence-clipping-remove:hover { opacity: 1; color: var(--red); }

/* Evidence tag row */
.evidence-tag-row {
  display: flex;
  gap: 5px;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px dotted var(--rule);
  align-items: center;
}

.tag-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.1s, box-shadow 0.1s;
}

.tag-dot:hover {
  transform: scale(1.35);
}

.tag-dot.tag-active {
  box-shadow: 0 0 0 2px rgba(0,0,0,0.12);
}

/* Notes panel */
.notes-area {
  padding: 12px 12px 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#notes-textarea {
  width: 100%;
  flex: 1;
  min-height: 200px;
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 10px;
  font-family: var(--font-stamp);
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink);
  resize: none;
  outline: none;
  transition: border-color 0.12s;
}

#notes-textarea:focus { border-color: var(--ink); }

#notes-textarea::placeholder {
  color: var(--ink-faint);
  opacity: 0.5;
}

/* Connections panel */
.connections-list {
  padding: 8px 0;
}

.connection-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--paper-mid);
  animation: fadeInConnection 0.3s ease;
}

@keyframes fadeInConnection {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
  margin-top: 5px;
}

.connection-dot.level-2 { background: #c87020; }
.connection-dot.level-3 { background: #2060a8; }

.connection-text {
  font-family: var(--font-stamp);
  font-size: 11px;
  letter-spacing: 0.3px;
  line-height: 1.4;
  color: var(--ink-faint);
}

.connection-text strong {
  color: var(--ink);
  font-weight: normal;
}

.connection-hint {
  margin-top: 4px;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 11.5px;
  color: var(--ink-faint);
  padding: 4px 8px;
  border-left: 2px solid var(--rule);
}

.connections-empty {
  padding: 24px 16px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13.5px;
  color: var(--ink-faint);
  text-align: center;
  line-height: 1.6;
}

/* File Report button */
.report-btn-area {
  padding: 12px;
  border-top: 2px solid var(--rule);
  background: var(--paper-mid);
  flex-shrink: 0;
}

.report-status {
  font-family: var(--font-stamp);
  font-size: 10px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
  margin-bottom: 8px;
}

.report-status span {
  color: var(--red);
  font-weight: bold;
}

.btn-report {
  width: 100%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
  color: var(--paper);
  background: var(--ink);
  border: none;
  padding: 11px 16px;
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
}

.btn-report:hover:not(:disabled) {
  background: var(--red);
}

.btn-report:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================================
   DEDUCTION SCREEN
   ============================================================ */

#screen-deduction {
  background: var(--paper);
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  padding: 40px 20px 60px;
}

.deduction-container {
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
}

.deduction-masthead {
  text-align: center;
  margin-bottom: 36px;
  padding-bottom: 20px;
  border-bottom: 4px double var(--rule-dark);
}

.deduction-masthead .sheet-label {
  font-family: var(--font-stamp);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 8px;
}

.deduction-masthead h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(28px, 5vw, 42px);
  color: var(--ink);
  line-height: 1.1;
}

.deduction-masthead p {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-faint);
  margin-top: 8px;
}

.deduction-form {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.deduction-question {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}

.q-number {
  font-family: var(--font-stamp);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--red);
}

.q-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.35;
  color: var(--ink);
}

.q-hint {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 13.5px;
  color: var(--ink-faint);
  padding: 6px 10px;
  border-left: 2px solid var(--rule);
}

.q-input {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--rule);
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.q-input:focus { border-color: var(--ink); }

.q-number-input {
  width: 120px;
}

.choice-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.choice-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border: 2px solid var(--rule);
  cursor: pointer;
  transition: all 0.12s;
  background: var(--paper);
}

.choice-option:hover {
  border-color: var(--ink);
  background: var(--paper-dark);
}

.choice-option.selected {
  border-color: var(--red);
  background: rgba(139, 26, 26, 0.05);
}

.choice-letter {
  font-family: var(--font-stamp);
  font-size: 13px;
  font-weight: bold;
  color: var(--red);
  width: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.choice-text {
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink-light);
}

.deduction-submit {
  margin-top: 8px;
  padding-top: 20px;
  border-top: 4px double var(--rule-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.deduction-submit .btn-primary {
  max-width: 320px;
}

.btn-back {
  font-family: var(--font-stamp);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: none;
  border: 1px solid var(--rule);
  padding: 7px 16px;
  cursor: pointer;
  transition: all 0.12s;
}

.btn-back:hover {
  border-color: var(--ink);
  color: var(--ink);
}

/* ============================================================
   REVELATION SCREEN
   ============================================================ */

#screen-revelation {
  background: var(--ink);
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  padding: 60px 20px 80px;
  min-height: 100vh;
}

.revelation-container {
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
}

.revelation-score {
  text-align: center;
  margin-bottom: 50px;
}

.score-badge {
  display: inline-block;
  background: transparent;
  border: 2px solid var(--paper);
  padding: 6px 20px;
  font-family: var(--font-stamp);
  font-size: 12px;
  letter-spacing: 3px;
  color: rgba(245,237,216,0.6);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.score-verdict {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(18px, 3vw, 24px);
  color: var(--paper);
  line-height: 1.3;
  margin-bottom: 12px;
}

.score-detail {
  font-family: var(--font-stamp);
  font-size: 13px;
  color: rgba(245,237,216,0.5);
  letter-spacing: 1px;
}

.score-pips {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.score-pip {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid rgba(245,237,216,0.3);
  background: transparent;
}

.score-pip.filled {
  background: var(--paper);
  border-color: var(--paper);
}

.revelation-rule {
  height: 1px;
  background: rgba(245,237,216,0.2);
  margin-bottom: 50px;
}

.revelation-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(28px, 5vw, 44px);
  color: var(--paper);
  text-align: center;
  line-height: 1.2;
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(245,237,216,0.2);
}

.revelation-section {
  margin-bottom: 44px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.revelation-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.revelation-section-heading {
  font-family: var(--font-stamp);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(245,237,216,0.4);
  margin-bottom: 12px;
}

.revelation-section-text {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.85;
  color: rgba(245,237,216,0.88);
}

.revelation-section-text p { margin-bottom: 14px; }

.revelation-coda {
  text-align: center;
  padding-top: 48px;
  border-top: 1px solid rgba(245,237,216,0.15);
}

.revelation-coda p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 20px;
  color: rgba(245,237,216,0.5);
  line-height: 1.5;
  margin-bottom: 12px;
}

.revelation-coda small {
  font-family: var(--font-stamp);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: rgba(245,237,216,0.25);
  text-transform: uppercase;
}

.revelation-end-btns {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 36px;
}

.btn-return-archive {
  font-family: var(--font-stamp);
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(245,237,216,0.85);
  background: transparent;
  border: 1px solid rgba(245,237,216,0.5);
  padding: 11px 32px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-return-archive:hover {
  color: var(--paper);
  border-color: var(--paper);
  background: rgba(245,237,216,0.08);
}

.btn-play-again {
  display: inline-block;
  font-family: var(--font-stamp);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(245,237,216,0.35);
  background: transparent;
  border: none;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(245,237,216,0.2);
}

.btn-play-again:hover {
  color: rgba(245,237,216,0.6);
}

/* ============================================================
   TOOLTIP
   ============================================================ */

#tooltip {
  position: fixed;
  z-index: 9999;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-stamp);
  font-size: 11px;
  letter-spacing: 0.3px;
  padding: 7px 11px;
  max-width: 240px;
  line-height: 1.45;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  border-left: 3px solid var(--red);
}

#tooltip.show { opacity: 1; }

/* ============================================================
   NOTIFICATION TOAST
   ============================================================ */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9998;
  pointer-events: none;
}

.toast {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-stamp);
  font-size: 12px;
  letter-spacing: 0.5px;
  padding: 10px 16px;
  border-left: 3px solid var(--red);
  box-shadow: 2px 2px 8px var(--shadow-deep);
  animation: toastIn 0.25s ease, toastOut 0.3s ease 2.5s forwards;
  max-width: 280px;
  line-height: 1.45;
}

.toast.connection-toast {
  border-left-color: #2060a8;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(20px); }
}

/* ============================================================
   HOW TO PLAY MODAL
   ============================================================ */

/* Trigger button in evidence header */
.htp-trigger-btn {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid rgba(245,237,216,0.4);
  color: rgba(245,237,216,0.6);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  line-height: 1;
}

.htp-trigger-btn:hover {
  background: rgba(245,237,216,0.12);
  border-color: rgba(245,237,216,0.8);
  color: var(--paper);
}

/* Title screen "how to play" link */
.title-htp-link {
  display: block;
  margin: 14px auto 0;
  background: none;
  border: none;
  font-family: var(--font-stamp);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-faint);
  cursor: pointer;
  transition: color 0.12s;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--rule);
}

.title-htp-link:hover { color: var(--red); }

/* Overlay backdrop */
.htp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 16, 8, 0.72);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
  animation: overlayIn 0.2s ease;
}

.htp-overlay.hidden {
  display: none !important;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Modal paper */
.htp-modal {
  background: var(--paper);
  max-width: 580px;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 6px 6px 0 rgba(26,16,8,0.4);
  animation: modalIn 0.22s ease;
  overflow: hidden;
}

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

.htp-header {
  background: var(--ink);
  color: var(--paper);
  padding: 18px 22px 14px;
  position: relative;
  flex-shrink: 0;
}

.htp-masthead-sub {
  font-family: var(--font-stamp);
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(245,237,216,0.5);
  margin-bottom: 5px;
}

.htp-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 26px;
  color: var(--paper);
  line-height: 1;
}

.htp-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: 1px solid rgba(245,237,216,0.3);
  color: rgba(245,237,216,0.6);
  font-size: 20px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s;
  line-height: 1;
  padding: 0;
}

.htp-close:hover {
  background: rgba(245,237,216,0.1);
  color: var(--paper);
  border-color: rgba(245,237,216,0.6);
}

.htp-body {
  overflow-y: auto;
  padding: 22px 26px 18px;
  flex: 1;
}

.htp-body::-webkit-scrollbar { width: 4px; }
.htp-body::-webkit-scrollbar-track { background: var(--paper-dark); }
.htp-body::-webkit-scrollbar-thumb { background: var(--rule-dark); }

.htp-step {
  display: flex;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--rule);
}

.htp-step:last-of-type {
  border-bottom: none;
  margin-bottom: 8px;
}

.htp-step-num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 28px;
  color: var(--rule);
  line-height: 1;
  width: 36px;
  flex-shrink: 0;
  padding-top: 2px;
}

.htp-step-content h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 6px;
}

.htp-step-content p {
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-light);
}

.htp-step-content p strong {
  color: var(--ink);
  font-weight: 500;
}

.htp-note {
  background: var(--paper-dark);
  border-left: 3px solid var(--rule-dark);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-faint);
  margin-top: 6px;
}

.htp-note strong {
  color: var(--ink);
  font-style: normal;
}

.htp-footer {
  padding: 14px 26px 18px;
  border-top: 2px solid var(--rule);
  background: var(--paper-dark);
  flex-shrink: 0;
}

.htp-btn-start {
  width: 100%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  border: none;
  padding: 12px 24px;
  cursor: pointer;
  transition: background 0.15s;
}

.htp-btn-start:hover { background: var(--red); }

/* evidence-header needs position: relative for the ? button */
.evidence-header { position: relative; }

/* ============================================================
   UTILITY
   ============================================================ */

.hidden { display: none !important; }

/* ============================================================
   MUSIC BUTTON
   ============================================================ */

.music-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9990;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ink);
  border: 1px solid rgba(245,237,216,0.18);
  color: rgba(245,237,216,0.4);
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, opacity 0.2s;
  opacity: 0.55;
  padding: 0;
}

.music-btn:hover {
  opacity: 1;
  color: var(--paper);
  border-color: rgba(245,237,216,0.45);
}

.music-btn.music-active {
  opacity: 0.85;
  color: var(--paper);
  border-color: rgba(245,237,216,0.4);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  #screen-game {
    flex-direction: column;
    height: auto;
    overflow: auto;
  }

  .panel-archive {
    width: 100%;
    min-width: unset;
    max-height: 200px;
    border-right: none;
    border-bottom: 2px solid var(--rule-dark);
  }

  .panel-evidence {
    width: 100%;
    min-width: unset;
    border-left: none;
    border-top: 2px solid var(--rule);
    min-height: 300px;
  }

  .panel-reader {
    border-right: none;
  }

  .reader-body {
    padding: 20px 24px 28px;
  }
}
