/* Whodunit - Crimson Noir Glass Theme */
/* Designed for 9:16 portrait mobile aspect ratio */

/* ====== 1. RESET & BASE ====== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

html, body {
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0A0A0F;
  color: #D4C5A9;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  margin: 0;
}

/* ====== 2. 9:16 ASPECT RATIO CONTAINER ====== */
#game-root {
  width: 100%;
  height: 100dvh;
  max-width: calc(100dvh * 9 / 16);
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #0A0A0F;
  overflow: hidden;
  padding-top: var(--sat, env(safe-area-inset-top, 0px));
  padding-bottom: var(--sab, env(safe-area-inset-bottom, 0px));
}

@media (min-aspect-ratio: 9/16) {
  #game-root {
    border-left: 1px solid rgba(139, 0, 0, 0.15);
    border-right: 1px solid rgba(139, 0, 0, 0.15);
    box-shadow: 0 0 60px rgba(139, 0, 0, 0.05);
  }
}

/* ====== 3. BACKGROUND ====== */
.game-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at 30% 20%, rgba(139, 0, 0, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Ensure all content sits above the background */
#game-root > *:not(.game-bg) {
  position: relative;
  z-index: 1;
}

/* ====== 4. TITLE SCREEN ====== */
.title-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 16px;
  padding-bottom: 24px;
  gap: 20px;
  animation: fadeIn 0.5s ease;
}

.title-card-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 24px;
  gap: 12px;
}

.title-card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  border-radius: 24px;
}

.title-heading {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #8B0000, #CD5C5C, #D4A574);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
}

.title-subtitle {
  font-size: 15px;
  color: #8B7355;
  text-transform: uppercase;
  letter-spacing: 3px;
  text-align: center;
}

/* ====== 5. GLASSY BUTTON — Frosted glass with crimson gradient border + inner shine ====== */
.btn-glass {
  position: relative;
  background: rgba(139, 0, 0, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fff;
  font-weight: 700;
  border: 1px solid rgba(205, 92, 92, 0.4);
  border-top-color: rgba(240, 140, 140, 0.5);
  border-radius: 14px;
  cursor: pointer;
  flex-shrink: 0;
  letter-spacing: 1px;
  text-transform: uppercase;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.25s, background 0.25s;
  box-shadow:
    0 6px 24px rgba(139, 0, 0, 0.35),
    0 0 40px rgba(139, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* Inner glass shine */
.btn-glass::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
  pointer-events: none;
  border-radius: 14px 14px 0 0;
}

/* Subtle gradient glow on bottom edge */
.btn-glass::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(205, 92, 92, 0.6), transparent);
  pointer-events: none;
}

.btn-glass:active,
.btn-glass.pressed {
  transform: scale(0.96);
  background: rgba(139, 0, 0, 0.22);
  box-shadow:
    0 2px 12px rgba(139, 0, 0, 0.5),
    0 0 30px rgba(139, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-play {
  font-size: 20px;
  padding: 16px 64px;
  margin-bottom: 12px;
}

.btn-play:active,
.btn-play.pressed {
  transform: scale(0.96);
}

/* ====== 6. GRADIENT TEXT UTILITY ====== */
.gradient-text {
  background: linear-gradient(135deg, #8B0000, #CD5C5C);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ====== 7. HEADER — Glass ====== */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 16px;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(139, 0, 0, 0.2);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  z-index: 100;
  flex-shrink: 0;
  position: relative;
}

/* Safe area top is handled by #game-root padding-top */

.game-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.game-stats {
  display: flex;
  gap: 16px;
  align-items: center;
}

.stat {
  font-size: 13px;
  color: #8B7355;
}

.stat-value {
  color: #D4C5A9;
  font-weight: 600;
}

/* ====== 8. HEADER RIGHT GROUP ====== */
.header-right-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ====== VOLUME CONTROL BUTTON ====== */
.volume-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(30, 26, 22, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(139, 0, 0, 0.25);
  color: #D4C5A9;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  padding: 0;
  line-height: 1;
}

.volume-btn:active {
  background: rgba(139, 0, 0, 0.2);
  border-color: rgba(139, 0, 0, 0.5);
}

.volume-btn.muted {
  color: #EF4444;
  border-color: rgba(239, 68, 68, 0.3);
}

/* ====== NOTEBOOK (Evidence Board) BUTTON ====== */
.notebook-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(139, 0, 0, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(205, 92, 92, 0.4);
  color: #fff;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.25s, background 0.25s;
  box-shadow:
    0 4px 16px rgba(139, 0, 0, 0.3),
    0 0 20px rgba(139, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  padding: 0;
  line-height: 1;
}

.notebook-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
  pointer-events: none;
  border-radius: 50% 50% 0 0;
}

.notebook-btn:active {
  transform: scale(0.88);
  background: rgba(139, 0, 0, 0.22);
  box-shadow:
    0 2px 8px rgba(139, 0, 0, 0.5),
    0 0 20px rgba(139, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.notebook-btn.has-entries {
  border-color: rgba(139, 0, 0, 0.5);
  color: #CD5C5C;
}

/* ====== EXIT BUTTON ====== */
.btn-exit {
  position: relative;
  background: rgba(139, 0, 0, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 14px;
  border: 1px solid rgba(205, 92, 92, 0.4);
  border-top-color: rgba(240, 140, 140, 0.5);
  border-radius: 10px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.25s, background 0.25s;
  box-shadow:
    0 4px 16px rgba(139, 0, 0, 0.3),
    0 0 20px rgba(139, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-exit::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
  pointer-events: none;
  border-radius: 10px 10px 0 0;
}

.btn-exit:active,
.btn-exit.pressed {
  transform: scale(0.92);
  background: rgba(139, 0, 0, 0.22);
  box-shadow:
    0 2px 8px rgba(139, 0, 0, 0.5),
    0 0 20px rgba(139, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* ====== 9. ROUND INTRO — Glass Card ====== */
.round-intro {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 32px 24px;
  text-align: center;
  animation: fadeIn 0.5s ease;
}

.round-number {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #8B0000, #CD5C5C);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.round-setting {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.round-setting-desc {
  font-size: 13px;
  color: #8B7355;
  margin-bottom: 12px;
  max-width: 320px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Backstory lore card */
.backstory-card {
  background: rgba(22, 18, 14, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(139, 0, 0, 0.15);
  border-left: 2px solid rgba(139, 0, 0, 0.4);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
  max-width: 340px;
  font-size: 12px;
  color: #8B7355;
  line-height: 1.6;
  font-style: italic;
  text-align: left;
  animation: fadeIn 0.6s ease 0.2s both;
}

.round-topic-hint {
  font-size: 15px;
  color: #D4C5A9;
  background: rgba(30, 26, 22, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid rgba(139, 0, 0, 0.25);
  border-left: 3px solid #8B0000;
  margin-bottom: 32px;
  max-width: 340px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.btn-start {
  font-size: 16px;
  padding: 14px 40px;
}

.btn-start:active,
.btn-start.pressed {
  transform: scale(0.96);
}

/* ====== 10. CHARACTER MONTAGE — Meet the Suspects ====== */
.montage-screen {
  position: absolute !important;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 15, 0.55);
  z-index: 50 !important;
  padding: 24px;
  padding-top: max(24px, var(--sat, env(safe-area-inset-top, 24px)));
  padding-bottom: max(24px, var(--sab, env(safe-area-inset-bottom, 24px)));
}

.montage-fade-out {
  animation: montage-fade-out 0.5s ease forwards;
  pointer-events: none;
}

.montage-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.montage-counter {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #8B7355;
  margin-bottom: 16px;
}

.montage-card-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 340px;
}

.montage-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  width: 100%;
}

.montage-video-wrap {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(139, 0, 0, 0.5);
  box-shadow: 0 0 30px rgba(139, 0, 0, 0.25), 0 0 60px rgba(139, 0, 0, 0.1);
  flex-shrink: 0;
}

.montage-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  display: block;
}

.montage-name {
  font-size: 28px;
  font-weight: 700;
}

.montage-archetype {
  font-size: 15px;
  color: #CD5C5C;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.montage-desc {
  font-size: 13px;
  color: #8B7355;
  line-height: 1.5;
  max-width: 280px;
}

.montage-rumor {
  font-size: 13px;
  color: #8B7355;
  font-style: italic;
  line-height: 1.5;
  max-width: 300px;
  text-align: center;
  padding: 10px 16px;
  background: rgba(22, 18, 14, 0.6);
  border-radius: 10px;
  border-left: 2px solid rgba(139, 0, 0, 0.3);
  margin-top: 14px;
  margin-bottom: 0;
}

.btn-skip-intro {
  margin-top: 12px;
  padding: 14px 40px;
  font-size: 15px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.btn-skip-intro:hover,
.btn-skip-intro:active,
.btn-skip-intro.pressed {
  opacity: 1;
}

/* Montage fade animations */
.montage-fade-in {
  animation: montage-fade-in 0.5s ease both;
}

@keyframes montage-fade-in {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes montage-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ====== 11. INVESTIGATION AREA ====== */
.investigation-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 2px 12px 0;
  overflow: hidden;
  min-height: 0;
}

.instruction-bar {
  text-align: center;
  font-size: 13px;
  color: #8B7355;
  padding: 2px 0;
  margin-bottom: 2px;
  flex-shrink: 0;
}

/* ====== 12. CHARACTER GRID — Glass Cards with Thumbnails ====== */
.character-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 6px;
  flex: 1;
  min-height: 0;
}

.character-card {
  background: rgba(30, 26, 22, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(139, 0, 0, 0.25);
  border-top-color: rgba(205, 92, 92, 0.4);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 6px 10px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  min-height: 240px;
}

/* Inner glass shine */
.character-card .card-shine {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, transparent 100%);
  pointer-events: none;
  border-radius: 14px 14px 0 0;
  z-index: 1;
}

.character-card:active {
  transform: scale(0.95);
}

.character-card.talked {
  border-color: rgba(139, 0, 0, 0.6);
  background: rgba(139, 0, 0, 0.12);
  box-shadow: 0 0 20px rgba(139, 0, 0, 0.2), 0 8px 32px rgba(0, 0, 0, 0.3);
}

.character-card.active {
  border-color: #8B0000;
  box-shadow: 0 0 24px rgba(139, 0, 0, 0.4);
}

.character-card.highlighted {
  border-color: #F5A623;
  animation: pulse 1.5s infinite;
}

/* Character thumbnail */
.character-thumb-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 10px 10px 0 0;
  min-height: 0;
  padding-top: 8px;
}

.character-thumb {
  width: 125%;
  height: 125%;
  object-fit: contain;
  pointer-events: none;
  border-radius: 12px;
}

/* Emoji avatar fallback */
.character-avatar {
  font-size: 32px;
  margin-bottom: 6px;
}

.character-name {
  font-size: 20px;
  font-weight: 600;
  color: #D4C5A9;
  text-align: center;
  line-height: 1.2;
  margin-top: 4px;
  flex-shrink: 0;
  z-index: 2;
}

.character-archetype-label {
  font-size: 15px;
  color: #CD5C5C;
  text-align: center;
  line-height: 1.2;
  margin-top: 1px;
  flex-shrink: 0;
  z-index: 2;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.character-desc {
  font-size: 14px;
  color: #8B7355;
  text-align: center;
  line-height: 1.2;
  margin-top: 1px;
  flex-shrink: 0;
  z-index: 2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.character-role {
  font-size: 10px;
  color: #8B0000;
  margin-top: 2px;
}

/* Interaction counter badge (top-left) */
.interaction-counter {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: rgba(139, 0, 0, 0.25);
  border: 1px solid rgba(139, 0, 0, 0.5);
  color: #D4C5A9;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

/* Talked badge — animated crimson ring */
.talked-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #8B0000;
  box-shadow: 0 0 0 0 rgba(139, 0, 0, 0.5);
  animation: pulseRing 2s infinite;
  z-index: 3;
}

@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(139, 0, 0, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(139, 0, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(139, 0, 0, 0); }
}

/* Character mood indicator */
.character-mood {
  position: absolute;
  bottom: 6px;
  right: 6px;
  font-size: 12px;
  z-index: 3;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

/* Pinned suspect indicator */
.suspect-pin {
  position: absolute;
  top: 6px;
  right: 26px;
  font-size: 11px;
  z-index: 3;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

/* Trust bar */
.trust-bar-wrap {
  width: 100%;
  height: 3px;
  background: rgba(58, 50, 42, 0.4);
  border-radius: 2px;
  margin-top: 3px;
  overflow: hidden;
  flex-shrink: 0;
  z-index: 2;
}

.trust-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease, background 0.3s ease;
}

/* Depleted character card */
.character-card.depleted {
  opacity: 0.4;
  pointer-events: none;
  filter: grayscale(0.6);
}

.character-card.depleted .interaction-counter {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #EF4444;
}

/* Eliminated character card */
.character-card.eliminated {
  filter: grayscale(1);
  opacity: 0.4;
  pointer-events: none;
}

/* Cleared character card */
.character-card.cleared {
  border-color: rgba(34, 197, 94, 0.5);
  opacity: 0.5;
  pointer-events: none;
}

/* Skull overlay for eliminated characters */
.skull-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2em;
  z-index: 5;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8));
  pointer-events: none;
}

/* Dead label replacing archetype */
.dead-label {
  font-size: 15px;
  color: #EF4444;
  text-align: center;
  line-height: 1.2;
  margin-top: 1px;
  flex-shrink: 0;
  z-index: 2;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
}

/* Cleared overlay */
.cleared-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2em;
  z-index: 5;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8));
  pointer-events: none;
}

/* Cleared label */
.cleared-label {
  font-size: 15px;
  color: #22C55E;
  text-align: center;
  line-height: 1.2;
  margin-top: 1px;
  flex-shrink: 0;
  z-index: 2;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
}

/* ====== 13. DIALOGUE BOX — iMessage Chat Thread ====== */
.dialogue-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 15, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 200;
  padding: 4px;
  padding-top: 30px;
  padding-bottom: 0;
  overflow: hidden;
}

.dialogue-box {
  background: rgba(22, 18, 14, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(139, 0, 0, 0.25);
  border-top-color: rgba(205, 92, 92, 0.4);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: calc(100vh * 9 / 16);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -8px 48px rgba(0, 0, 0, 0.5), 0 0 30px rgba(139, 0, 0, 0.1);
}

/* Character portrait above chat */
.dialogue-portrait-wrap {
  width: 100%;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(139, 0, 0, 0.08) 0%, transparent 100%);
  flex-shrink: 0;
  overflow: hidden;
  border-bottom: 1px solid rgba(139, 0, 0, 0.1);
}

.dialogue-portrait {
  height: 125%;
  width: auto;
  object-fit: contain;
  pointer-events: none;
}

/* Chat thread header */
.dialogue-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(139, 0, 0, 0.15);
  background: rgba(10, 10, 15, 0.5);
  flex-shrink: 0;
}

.dialogue-char-thumb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(139, 0, 0, 0.3);
}

.dialogue-avatar {
  font-size: 36px;
}

.dialogue-speaker,
.dialogue-name {
  font-size: 16px;
  font-weight: 700;
}

.dialogue-archetype {
  font-size: 11px;
  color: #CD5C5C;
}

/* Scrollable chat thread */
.chat-thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 12px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-thread * {
  touch-action: pan-y;
}

/* Bubble container */
.bubble-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Bubble rows */
.bubble-row {
  display: flex;
  flex-direction: column;
  animation: slideInBubble 0.25s ease;
}

.bubble-row.sent {
  align-items: flex-end;
}

.bubble-row.received {
  align-items: flex-start;
}

/* Circle thumbnail next to option bubbles */
.option-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  pointer-events: none;
  border: 1px solid rgba(139, 0, 0, 0.3);
}

.bubble-row.received:has(.option-thumb) {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.bubble-name {
  font-size: 11px;
  color: #CD5C5C;
  margin-bottom: 2px;
  padding: 0 8px;
}

.bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.4;
  position: relative;
  margin: 2px 0;
}

/* Speaker bubbles — dark crimson glass */
.bubble.speaker,
.bubble.received {
  background: rgba(58, 38, 32, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #D4C5A9;
  border-bottom-left-radius: 6px;
}

.bubble.received::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -6px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 8px 8px 0;
  border-color: transparent rgba(58, 38, 32, 0.6) transparent transparent;
}

/* Player bubbles — slightly lighter crimson */
.bubble.player,
.bubble.sent {
  background: linear-gradient(135deg, #8B0000, #6B0000);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.bubble.sent::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: -6px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 8px 8px;
  border-color: transparent transparent transparent #6B0000;
}

/* Tappable follow-up pill */
.bubble.received.tappable {
  cursor: pointer;
  border: 1px solid rgba(139, 0, 0, 0.3);
  transition: background 0.15s, border-color 0.15s;
}

.bubble.received.tappable:active {
  background: rgba(139, 0, 0, 0.2);
  border-color: rgba(139, 0, 0, 0.5);
}

.bubble.received.locked {
  opacity: 0.35;
  pointer-events: none;
}

/* Cross-reference bubble */
.bubble.received.tappable.cross-ref {
  border-color: rgba(205, 92, 92, 0.4);
  background: rgba(139, 0, 0, 0.08);
}

.bubble.received.tappable.cross-ref:active {
  background: rgba(139, 0, 0, 0.2);
  border-color: rgba(205, 92, 92, 0.6);
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  align-items: center;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8B7355;
  animation: typingDot 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

/* Probe pills */
.probe-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0;
}

.probe-pill {
  background: transparent;
  border: 1px solid rgba(139, 0, 0, 0.4);
  color: #CD5C5C;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.15s;
}

.probe-pill:active,
.probe-pill.pressed {
  background: rgba(139, 0, 0, 0.15);
}

.probe-pill.used {
  opacity: 0.3;
  pointer-events: none;
}

/* Follow-up row */
.follow-up-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: slideInBubble 0.25s ease;
}

.follow-up-btn {
  background: rgba(30, 26, 22, 0.6);
  border: 1px solid rgba(139, 0, 0, 0.25);
  color: #D4C5A9;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}

.follow-up-btn:active {
  background: rgba(139, 0, 0, 0.15);
  border-color: rgba(139, 0, 0, 0.4);
}

/* Cross-reference row */
.cross-ref-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: slideInBubble 0.25s ease;
}

.cross-ref-btn {
  background: rgba(139, 0, 0, 0.06);
  border: 1px solid rgba(205, 92, 92, 0.3);
  color: #CD5C5C;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}

.cross-ref-btn:active {
  background: rgba(139, 0, 0, 0.15);
  border-color: rgba(205, 92, 92, 0.5);
}

/* Options container */
.options-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: slideInBubble 0.25s ease;
}

/* Typewriter cursor */
.dialogue-cursor {
  display: inline-block;
  width: 2px;
  height: 16px;
  background: rgba(255, 255, 255, 0.8);
  margin-left: 2px;
  animation: blink 0.8s infinite;
  vertical-align: text-bottom;
}

/* Dialogue actions */
.dialogue-actions {
  padding: 8px 12px;
  border-top: 1px solid rgba(139, 0, 0, 0.1);
  flex-shrink: 0;
}

.btn-dismiss {
  position: relative;
  background: rgba(139, 0, 0, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 10px;
  border: 1px solid rgba(205, 92, 92, 0.4);
  border-top-color: rgba(240, 140, 140, 0.5);
  border-radius: 12px;
  cursor: pointer;
  width: 100%;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.25s, background 0.25s;
  box-shadow:
    0 6px 24px rgba(139, 0, 0, 0.35),
    0 0 40px rgba(139, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-dismiss::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
  pointer-events: none;
  border-radius: 12px 12px 0 0;
}

.btn-dismiss::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(205, 92, 92, 0.6), transparent);
  pointer-events: none;
}

.btn-dismiss:active,
.btn-dismiss.pressed {
  transform: scale(0.92);
  background: rgba(139, 0, 0, 0.22);
  box-shadow:
    0 2px 12px rgba(139, 0, 0, 0.5),
    0 0 30px rgba(139, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-followup {
  background: #161210;
  border: 1px solid #3A3028;
  color: #D4C5A9;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.btn-followup:active {
  background: #2A2420;
}

.btn-followup.locked {
  opacity: 0.4;
  pointer-events: none;
}

/* ====== 14. SOLVE PANEL ====== */
.solve-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 15, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 300;
  animation: fadeIn 0.25s ease;
  padding: 24px;
}

.solve-panel {
  background: rgba(22, 18, 14, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(139, 0, 0, 0.3);
  border-top-color: rgba(205, 92, 92, 0.5);
  border-radius: 20px;
  padding: 24px 20px;
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 24px rgba(139, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  position: relative;
}

.solve-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(205, 92, 92, 0.5), transparent);
}

.solve-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #8B0000, #CD5C5C);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.solve-subtitle {
  font-size: 14px;
  color: #8B7355;
  margin-bottom: 20px;
}

.solve-character-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  width: 100%;
  max-width: 400px;
  margin-bottom: 20px;
}

.solve-character-btn {
  background: rgba(30, 26, 22, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(139, 0, 0, 0.25);
  border-top-color: rgba(205, 92, 92, 0.4);
  border-radius: 14px;
  padding: 12px 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  position: relative;
}

.solve-character-btn:active,
.solve-character-btn.pressed {
  border-color: #8B0000;
  background: rgba(139, 0, 0, 0.15);
  box-shadow: 0 0 20px rgba(139, 0, 0, 0.25);
}

.solve-character-btn .character-avatar {
  font-size: 42px;
}

.solve-character-btn .character-name {
  font-size: 13px;
}

.solve-thumb-wrap {
  width: 100%;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 10px;
}

.solve-thumb {
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  pointer-events: none;
  border-radius: 10px;
}

/* Highlighted suspect in solve panel */
.solve-character-btn.solve-highlighted {
  border-color: #8B0000;
  background: rgba(139, 0, 0, 0.2);
  box-shadow: 0 0 20px rgba(139, 0, 0, 0.35);
}

.solve-character-btn.solve-dimmed {
  opacity: 0.35;
}

/* Eliminated suspect in solve panel */
.solve-character-btn.solve-eliminated {
  filter: grayscale(1);
  opacity: 0.35;
  pointer-events: none;
  cursor: not-allowed;
}

/* Cleared suspect in solve panel */
.solve-character-btn.solve-cleared {
  border-color: rgba(34, 197, 94, 0.4);
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

/* Solve panel skull and check overlays */
.solve-skull {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2em;
  z-index: 5;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8));
  pointer-events: none;
}

.solve-check {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2em;
  z-index: 5;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8));
  pointer-events: none;
}

/* Wrong guess flash */
.solve-character-btn.solve-wrong-flash {
  border-color: #EF4444 !important;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4) !important;
  background: rgba(239, 68, 68, 0.15) !important;
  animation: wrongFlash 0.6s ease;
}

@keyframes wrongFlash {
  0%, 100% { border-color: rgba(239, 68, 68, 0.6); }
  50% { border-color: rgba(239, 68, 68, 1); box-shadow: 0 0 30px rgba(239, 68, 68, 0.5); }
}

/* Wrong guess card */
.solve-wrong-card {
  background: rgba(239, 68, 68, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  animation: fadeIn 0.2s ease;
  box-shadow:
    0 4px 16px rgba(239, 68, 68, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.solve-wrong-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid rgba(239, 68, 68, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #EF4444;
}

.solve-wrong-msg {
  font-size: 14px;
  color: #F8B4B4;
  text-align: center;
  font-weight: 500;
}

.btn-back-investigate {
  font-size: 13px;
  padding: 10px 24px;
  margin-top: 12px;
}

/* ====== 15. RESULT SCREEN ====== */
.result-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 16px 24px 24px;
  text-align: center;
  animation: fadeIn 0.5s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.result-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.result-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.result-title.win {
  background: linear-gradient(135deg, #22C55E, #4ADE80);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.result-title.lose {
  color: #EF4444;
}

/* Killer reveal video */
.result-video-wrap {
  margin-bottom: 16px;
  position: relative;
}

.result-video-name {
  position: absolute;
  bottom: 6px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.result-explanation {
  font-size: 14px;
  color: #D4C5A9;
  max-width: 440px;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* Eliminated casualties list */
.result-eliminated {
  width: 100%;
  max-width: 440px;
  margin-bottom: 20px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: 12px;
  padding: 12px 16px;
}

.result-eliminated-title {
  font-size: 14px;
  font-weight: 700;
  color: #EF4444;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.result-eliminated-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result-eliminated-item {
  font-size: 13px;
  color: #8B7355;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Murder Timeline chain */
.result-chain {
  background: rgba(30, 26, 22, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(139, 0, 0, 0.25);
  border-top-color: rgba(205, 92, 92, 0.4);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 24px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 20px rgba(139, 0, 0, 0.08);
}

.result-chain-title {
  font-size: 15px;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #8B0000, #CD5C5C);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.chain-path {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.chain-node {
  font-size: 14px;
  background: rgba(58, 50, 42, 0.5);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(139, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 4px;
}

.chain-node.originator {
  background: linear-gradient(135deg, #8B0000, #6B0000);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 12px rgba(139, 0, 0, 0.3);
}

.chain-node.eliminated {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #EF4444;
}

.chain-node-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  pointer-events: none;
}

.chain-arrow {
  color: #8B0000;
  font-size: 16px;
}

/* Alibi Analysis (Deception Report) */
.deception-report {
  width: 100%;
  max-width: 440px;
  margin-bottom: 24px;
}

.deception-report-title {
  font-size: 15px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #EF4444, #F59E0B);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
}

.deception-card {
  background: rgba(30, 26, 22, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(139, 0, 0, 0.2);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
}

.deception-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.deception-card-thumb {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.deception-card-name {
  font-size: 15px;
  font-weight: 600;
  color: #D4C5A9;
}

.deception-card-archetype {
  font-size: 13px;
  color: #CD5C5C;
  margin-left: auto;
}

.deception-card-summary {
  font-size: 13px;
  color: #8B7355;
  margin-left: auto;
}

.deception-probes {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.deception-probe-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 14px;
}

.probe-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
}

.probe-dot.truth {
  background: #22C55E;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

.probe-dot.lie {
  background: #EF4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

.probe-label-text {
  color: #D4C5A9;
  min-width: 36px;
}

.probe-truth {
  color: #22C55E;
}

.probe-lie {
  color: #EF4444;
}

.deception-correction {
  font-style: italic;
  color: #8B7355;
  font-size: 13px;
  margin-left: 14px;
  margin-top: 1px;
}

/* Wrongly accused list */
.result-accusations {
  width: 100%;
  max-width: 440px;
  margin-bottom: 20px;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: 12px;
  padding: 12px 16px;
}

.result-accusations-title {
  font-size: 14px;
  font-weight: 700;
  color: #F59E0B;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.result-accusation-item {
  font-size: 13px;
  color: #8B7355;
  padding: 3px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.result-score {
  font-size: 15px;
  color: #8B7355;
  margin-bottom: 24px;
}

.result-score strong {
  color: #F5A623;
}

.btn-next-round {
  font-size: 16px;
  padding: 14px 40px;
}

/* ====== 16. EVIDENCE BOARD (Notebook) PANEL ====== */
.notebook-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 15, 0.7);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 550;
  padding: 16px;
  padding-top: 14px;
}

.notebook-panel {
  background: rgba(22, 18, 14, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(139, 0, 0, 0.25);
  border-top-color: rgba(205, 92, 92, 0.4);
  border-radius: 20px;
  width: 100%;
  max-width: calc(100vh * 9 / 16);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -8px 48px rgba(0, 0, 0, 0.5), 0 0 30px rgba(139, 0, 0, 0.1);
}

.notebook-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(139, 0, 0, 0.15);
  flex-shrink: 0;
}

.notebook-title {
  font-size: 18px;
  font-weight: 700;
}

.notebook-close {
  background: none;
  border: none;
  color: #8B7355;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
}

.notebook-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  padding-bottom: 80px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.notebook-empty {
  text-align: center;
  color: #8B7355;
  font-size: 13px;
  padding: 40px 20px;
  line-height: 1.5;
}

.notebook-char-section {
  background: rgba(30, 26, 22, 0.5);
  border: 1px solid rgba(139, 0, 0, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
}

.notebook-char-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(139, 0, 0, 0.1);
}

.notebook-char-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.notebook-char-name {
  font-size: 13px;
  font-weight: 600;
  color: #D4C5A9;
}

.notebook-trust {
  font-size: 11px;
  font-weight: 600;
  margin-left: auto;
}

.notebook-pin {
  font-size: 12px;
}

/* Dead indicator in notebook */
.notebook-dead {
  font-size: 11px;
  font-weight: 700;
  color: #EF4444;
  margin-left: auto;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Cleared indicator in notebook */
.notebook-cleared {
  font-size: 11px;
  font-weight: 700;
  color: #22C55E;
  margin-left: auto;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.notebook-entry {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  font-size: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.notebook-entry.contradicted {
  background: rgba(239, 68, 68, 0.06);
  border-radius: 6px;
  padding: 6px;
  border-bottom: none;
}

.notebook-probe-label {
  color: #CD5C5C;
  font-weight: 600;
  min-width: 36px;
  flex-shrink: 0;
}

.notebook-entry-text {
  color: #D4C5A9;
  line-height: 1.4;
}

.notebook-flag {
  color: #F59E0B;
  font-size: 14px;
  flex-shrink: 0;
  margin-left: auto;
}

/* ====== 17. CRIME SCENE (NEW) ====== */
.crime-scene-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 250;
  animation: fadeIn 0.3s ease;
  padding: 24px;
}

.crime-scene-panel {
  background: rgba(22, 18, 14, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(139, 0, 0, 0.3);
  border-top-color: rgba(205, 92, 92, 0.5);
  border-radius: 20px;
  padding: 24px 20px;
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(139, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.crime-scene-title {
  font-size: 22px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #8B0000, #CD5C5C, #D4A574);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.crime-scene-desc {
  font-size: 14px;
  color: #D4C5A9;
  line-height: 1.6;
  text-align: center;
  max-width: 360px;
}

.victim-card {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.victim-name {
  font-size: 18px;
  font-weight: 700;
  color: #D4C5A9;
}

.victim-cause {
  font-size: 13px;
  color: #EF4444;
  font-style: italic;
}

.evidence-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.evidence-item {
  background: rgba(30, 26, 22, 0.6);
  border: 1px solid rgba(139, 0, 0, 0.2);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.evidence-icon {
  font-size: 24px;
}

.evidence-text {
  font-size: 12px;
  color: #8B7355;
  line-height: 1.4;
}

.btn-begin {
  font-size: 16px;
  padding: 14px 40px;
  margin-top: 8px;
}

/* ====== 18. KILL EVENT (NEW) ====== */
.kill-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(80, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  animation: killFlash 0.6s ease;
  padding: 24px;
}

.kill-card {
  background: rgba(22, 18, 14, 0.95);
  border: 2px solid rgba(239, 68, 68, 0.5);
  border-radius: 20px;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 340px;
  width: 100%;
  box-shadow:
    0 0 40px rgba(239, 68, 68, 0.2),
    0 8px 32px rgba(0, 0, 0, 0.6);
  animation: scaleIn 0.4s ease 0.3s both;
}

.kill-victim-thumb {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  filter: grayscale(1);
  border: 3px solid rgba(239, 68, 68, 0.4);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

.kill-skull {
  font-size: 48px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.8));
}

.kill-victim-name {
  font-size: 20px;
  font-weight: 700;
  color: #EF4444;
  text-align: center;
}

.kill-text {
  font-size: 14px;
  color: #8B7355;
  text-align: center;
  font-style: italic;
  line-height: 1.5;
}

.kill-remaining {
  font-size: 13px;
  color: #D4C5A9;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 8px;
}

/* ====== 19. FINAL TWO (NEW) ====== */
.final-two-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 350;
  animation: fadeIn 0.3s ease;
  padding: 24px;
}

.final-two-panel {
  background: rgba(22, 18, 14, 0.95);
  border: 1px solid rgba(139, 0, 0, 0.4);
  border-radius: 20px;
  padding: 28px 20px;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  box-shadow:
    0 8px 48px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(139, 0, 0, 0.15);
}

.final-two-title {
  font-size: 32px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 4px;
  background: linear-gradient(135deg, #8B0000, #CD5C5C, #D4A574);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
}

.final-two-text {
  font-size: 14px;
  color: #D4C5A9;
  text-align: center;
  line-height: 1.6;
  max-width: 340px;
}

.final-two-portraits {
  display: flex;
  gap: 24px;
  justify-content: center;
  align-items: center;
}

.final-two-portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.final-two-portrait-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(139, 0, 0, 0.5);
  box-shadow: 0 0 20px rgba(139, 0, 0, 0.2);
}

.final-two-portrait-name {
  font-size: 14px;
  font-weight: 600;
  color: #D4C5A9;
  text-align: center;
}

.final-two-portrait:active,
.final-two-portrait.pressed {
  transform: scale(0.94);
  box-shadow: 0 0 24px rgba(139, 0, 0, 0.4);
}

.final-two-prompt {
  font-size: 16px;
  font-weight: 700;
  color: #CD5C5C;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.door-container {
  display: flex;
  gap: 20px;
  justify-content: center;
  width: 100%;
}

.door {
  flex: 1;
  max-width: 140px;
  height: 180px;
  background: rgba(30, 26, 22, 0.8);
  border: 2px solid rgba(139, 0, 0, 0.4);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 800;
  color: #CD5C5C;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.3s, border-color 0.3s;
  animation: doorPulse 2s infinite;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(139, 0, 0, 0.1);
}

.door:active {
  transform: scale(0.95);
}

.door-left {
  border-top-color: rgba(205, 92, 92, 0.6);
}

.door-right {
  border-top-color: rgba(205, 92, 92, 0.6);
}

@keyframes doorPulse {
  0%, 100% { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(139, 0, 0, 0.1); }
  50% { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 40px rgba(139, 0, 0, 0.25); }
}

/* Fate reveal */
.fate-reveal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: scaleIn 0.4s ease;
}

.fate-text {
  font-size: 28px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 3px;
}

.fate-text.live {
  color: #22C55E;
  text-shadow: 0 0 20px #22C55E;
}

.fate-text.die {
  color: #EF4444;
  text-shadow: 0 0 20px #EF4444;
}

.fate-icon {
  font-size: 48px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
}

.fate-desc {
  font-size: 14px;
  color: #8B7355;
  text-align: center;
  max-width: 300px;
  line-height: 1.5;
  font-style: italic;
}

/* ====== 20. KILL CLOCK DISPLAY (NEW) ====== */
.kill-clock {
  font-size: 12px;
  font-weight: 700;
  color: #EF4444;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
}

.kill-clock.pulsing {
  animation: pulse 1s infinite;
}

/* ====== 21. SOLVE BAR ====== */
.solve-bar {
  background: rgba(22, 18, 14, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(139, 0, 0, 0.2);
  padding: 2px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.solve-hint {
  font-size: 12px;
  color: #8B7355;
  flex: 1;
  text-align: left;
}

.solve-btn-wrap {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

/* Round countdown timer */
.round-timer {
  position: relative;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
  color: #fff;
  background: rgba(139, 0, 0, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(205, 92, 92, 0.4);
  border-top-color: rgba(240, 140, 140, 0.5);
  border-radius: 14px;
  padding: 8px 20px;
  min-width: 72px;
  text-align: center;
  overflow: hidden;
  box-shadow:
    0 6px 24px rgba(139, 0, 0, 0.35),
    0 0 40px rgba(139, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.round-timer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
  pointer-events: none;
  border-radius: 14px 14px 0 0;
}

.round-timer::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(205, 92, 92, 0.6), transparent);
  pointer-events: none;
}

.round-timer.warning {
  color: #F59E0B;
  border-color: rgba(245, 158, 11, 0.4);
  border-top-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.12);
  box-shadow:
    0 6px 24px rgba(245, 158, 11, 0.3),
    0 0 40px rgba(245, 158, 11, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  animation: pulse 1.5s infinite;
}

.round-timer.critical {
  color: #EF4444;
  border-color: rgba(239, 68, 68, 0.4);
  border-top-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.12);
  box-shadow:
    0 6px 24px rgba(239, 68, 68, 0.3),
    0 0 40px rgba(239, 68, 68, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  animation: pulse 0.8s infinite;
}

/* Solve button */
.btn-solve {
  font-size: 13px;
  font-weight: 700;
  padding: 8px 18px;
  letter-spacing: 1px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.btn-solve:disabled {
  background: rgba(58, 50, 42, 0.4);
  border-color: rgba(58, 50, 42, 0.3);
  color: #6A5A48;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-solve:disabled::before,
.btn-solve:disabled::after {
  display: none;
}

.btn-solve:active:not(:disabled),
.btn-solve.pressed:not(:disabled) {
  transform: scale(0.96);
}

/* ====== 22. GAME OVER / RANKING SCREEN ====== */
.game-over-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  text-align: center;
  animation: fadeIn 0.6s ease;
  background: linear-gradient(180deg, #0A0A0F 0%, #1A0A0A 40%, #0A0A0F 100%);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.game-over-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #8B7355;
  margin-bottom: 8px;
}

.game-over-video-wrap {
  width: 160px;
  height: 160px;
  margin-bottom: 12px;
}

.ranking-badge {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  margin-bottom: 16px;
  border: 3px solid rgba(139, 0, 0, 0.4);
  box-shadow: 0 0 40px rgba(139, 0, 0, 0.2);
  animation: scaleIn 0.5s ease 0.2s both;
}

.ranking-badge.tier-s {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.2), rgba(245, 158, 11, 0.15));
  border-color: #EAB308;
  box-shadow: 0 0 50px rgba(234, 179, 8, 0.3);
}

.ranking-badge.tier-a {
  background: linear-gradient(135deg, rgba(139, 0, 0, 0.2), rgba(205, 92, 92, 0.15));
  border-color: #CD5C5C;
  box-shadow: 0 0 40px rgba(139, 0, 0, 0.3);
}

.ranking-badge.tier-b {
  background: linear-gradient(135deg, rgba(192, 192, 192, 0.15), rgba(220, 220, 220, 0.1));
  border-color: #C0C0C0;
  box-shadow: 0 0 30px rgba(192, 192, 192, 0.2);
}

.ranking-badge.tier-c {
  background: linear-gradient(135deg, rgba(205, 127, 50, 0.15), rgba(205, 127, 50, 0.1));
  border-color: #CD7F32;
  box-shadow: 0 0 30px rgba(205, 127, 50, 0.2);
}

.ranking-badge.tier-d {
  background: linear-gradient(135deg, rgba(128, 128, 128, 0.15), rgba(160, 160, 160, 0.1));
  border-color: #808080;
  box-shadow: 0 0 30px rgba(128, 128, 128, 0.2);
}

.ranking-tier-label {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 4px;
  animation: fadeIn 0.5s ease 0.3s both;
}

.ranking-tier-label.tier-s { color: #EAB308; }
.ranking-tier-label.tier-a { color: #CD5C5C; }
.ranking-tier-label.tier-b { color: #C0C0C0; }
.ranking-tier-label.tier-c { color: #CD7F32; }
.ranking-tier-label.tier-d { color: #808080; }

.ranking-tier-name {
  font-size: 22px;
  font-weight: 700;
  color: #D4C5A9;
  margin-bottom: 16px;
  animation: fadeIn 0.5s ease 0.4s both;
}

.ranking-score-summary {
  font-size: 15px;
  color: #8B7355;
  margin-bottom: 8px;
}

.ranking-score-summary strong {
  color: #F5A623;
}

.ranking-blurb {
  font-size: 14px;
  color: #D4C5A9;
  max-width: 320px;
  line-height: 1.6;
  margin-bottom: 32px;
  font-style: italic;
  background: rgba(30, 26, 22, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid rgba(139, 0, 0, 0.15);
  animation: fadeIn 0.5s ease 0.5s both;
}

.btn-play-again {
  background: linear-gradient(135deg, #8B0000, #CD5C5C);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  padding: 16px 48px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(139, 0, 0, 0.35);
  transition: transform 0.1s;
  letter-spacing: 0.5px;
  animation: fadeIn 0.5s ease 0.6s both;
}

.btn-play-again:active {
  transform: scale(0.96);
}

/* ====== 23. LEADERBOARD ====== */
.leaderboard-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  gap: 16px;
  overflow: hidden;
  animation: fadeIn 0.3s ease;
  background: linear-gradient(180deg, #0A0A0F 0%, #1A0A0A 40%, #0A0A0F 100%);
}

.leaderboard-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.leaderboard-spinner {
  color: #8B7355;
  font-size: 14px;
  padding: 40px 0;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  width: 100%;
  max-width: 475px;
  flex: 1;
  min-height: 0;
  padding-bottom: 8px;
}

.leaderboard-empty {
  text-align: center;
  color: #8B7355;
  font-size: 14px;
  padding: 40px 20px;
  line-height: 1.5;
}

.leaderboard-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  background: rgba(22, 18, 14, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(139, 0, 0, 0.2);
  border-radius: 12px;
  padding: 12px;
  animation: fadeIn 0.3s ease;
}

.leaderboard-rank {
  font-size: 24px;
  font-weight: 600;
  color: rgba(139, 0, 0, 0.7);
  min-width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.leaderboard-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(139, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(139, 0, 0, 0.25);
}

.leaderboard-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.leaderboard-avatar-initials {
  font-size: 14px;
  font-weight: 700;
  color: rgba(139, 0, 0, 0.7);
}

.leaderboard-info {
  flex: 1;
  min-width: 0;
}

.leaderboard-name {
  font-size: 15px;
  font-weight: 600;
  color: #D4C5A9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-stats {
  font-size: 12px;
  color: #8B7355;
  margin-top: 2px;
}

.btn-scores {
  font-size: 16px;
  padding: 12px 40px;
  flex-shrink: 0;
}

/* ====== 24. RULES SCREEN ====== */
.rules-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.3s ease;
}

.rules-box {
  background: rgba(22, 18, 14, 0.95);
  border: 1px solid rgba(139, 0, 0, 0.3);
  border-top-color: rgba(205, 92, 92, 0.5);
  border-radius: 20px;
  padding: 28px 24px;
  max-width: 475px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.5), 0 0 40px rgba(139, 0, 0, 0.1);
  animation: scaleIn 0.3s ease;
}

.rules-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.rules-item {
  font-size: 14px;
  color: #D4C5A9;
  line-height: 1.4;
  padding-left: 16px;
  position: relative;
}

.rules-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8B0000, #CD5C5C);
}

/* ====== 25. ANIMATIONS ====== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139, 0, 0, 0.4); }
  50% { box-shadow: 0 0 12px 4px rgba(139, 0, 0, 0.2); }
}

@keyframes scaleIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes killFlash {
  0% { background: rgba(180, 0, 0, 0.95); }
  30% { background: rgba(120, 0, 0, 0.9); }
  60% { background: rgba(80, 0, 0, 0.85); }
  100% { background: rgba(80, 0, 0, 0.85); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

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

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

/* ====== 26. SCROLLBAR ====== */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: rgba(10, 10, 15, 0.3);
}

::-webkit-scrollbar-thumb {
  background: rgba(139, 0, 0, 0.4);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 0, 0, 0.6);
}

/* ====== MISC ====== */

/* Wrong guess toast */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #EF4444, #DC2626);
  color: #fff;
  padding: 10px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  z-index: 400;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 1.5s forwards;
}

/* Screen shake */
.screen-shake {
  animation: shake 0.4s ease;
}

/* Relationship badge */
.relationship-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  font-size: 10px;
  background: rgba(139, 0, 0, 0.2);
  border: 1px solid rgba(139, 0, 0, 0.3);
  border-radius: 8px;
  padding: 1px 5px;
  color: #CD5C5C;
  z-index: 3;
  white-space: nowrap;
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Confrontation hint */
.confrontation-hint {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 10px;
  padding: 8px 12px;
  margin: 8px 0;
  font-size: 12px;
  color: #F59E0B;
  text-align: center;
  animation: slideInBubble 0.3s ease;
}

.btn-confront {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  color: #fff;
  border: none;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
  transition: transform 0.1s;
}

.btn-confront:active {
  transform: scale(0.96);
}

/* Truth prompt */
.truth-prompt {
  text-align: center;
  margin-bottom: 16px;
  margin-top: 4px;
}

.truth-question {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #8B0000, #CD5C5C);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.truth-rumor {
  font-size: 14px;
  color: #D4C5A9;
  font-style: italic;
  max-width: 320px;
  margin: 0 auto 16px;
  background: rgba(30, 26, 22, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(139, 0, 0, 0.15);
}

.truth-buttons {
  display: flex;
  gap: 16px;
}

/* Glass-styled truth buttons */
.btn-truth {
  padding: 14px 36px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
  color: #fff;
  letter-spacing: 0.5px;
}

.btn-truth.true-btn {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.5), rgba(22, 163, 74, 0.4));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(34, 197, 94, 0.4);
  border-top-color: rgba(74, 222, 128, 0.6);
  box-shadow:
    0 4px 16px rgba(34, 197, 94, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-truth.false-btn {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.5), rgba(220, 38, 38, 0.4));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-top-color: rgba(252, 129, 129, 0.6);
  box-shadow:
    0 4px 16px rgba(239, 68, 68, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-truth:active {
  transform: scale(0.95);
}

/* Solve feedback slot */
.solve-feedback-slot {
  width: 100%;
}

.solve-wrong-dismiss {
  font-size: 12px;
  padding: 8px 24px;
  margin-top: 4px;
}

/* Dialogue char thumb in header */
.dialogue-char-thumb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(139, 0, 0, 0.3);
}

/* ====== DEPTH OVERHAUL — Contradiction System ====== */

.contradiction-alert {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-left: 3px solid #EF4444;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 8px 0;
  animation: contradictionPulse 0.4s ease;
}

.contradiction-title {
  font-size: 13px;
  font-weight: 700;
  color: #EF4444;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.contradiction-comparison {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.contradiction-quote {
  font-size: 12px;
  color: #D4C5A9;
  background: rgba(10, 10, 15, 0.4);
  padding: 8px 10px;
  border-radius: 8px;
  line-height: 1.4;
  font-style: italic;
}

.contradiction-vs {
  font-size: 11px;
  color: #EF4444;
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.contradiction-choices {
  display: flex;
  gap: 8px;
}

.contradiction-confront {
  flex: 1;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.contradiction-confront:active,
.contradiction-confront.pressed {
  background: rgba(239, 68, 68, 0.3);
}

.contradiction-note {
  flex: 1;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(139, 115, 85, 0.3);
  background: rgba(30, 26, 22, 0.5);
  color: #8B7355;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.contradiction-note:active,
.contradiction-note.pressed {
  background: rgba(30, 26, 22, 0.8);
}

@keyframes contradictionPulse {
  0% { transform: scale(0.95); opacity: 0; }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}

/* ====== DEPTH OVERHAUL — Breaking / Confession System ====== */

.breaking-banner {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.4);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 8px 0;
  font-size: 13px;
  font-weight: 700;
  color: #22C55E;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  animation: breakingFlash 0.5s ease;
}

.confession-bubble {
  background: linear-gradient(135deg, #065F46, #064E3B) !important;
  border: 1px solid rgba(34, 197, 94, 0.3) !important;
}

.confession-bubble::after {
  border-color: transparent transparent transparent #064E3B !important;
}

.defiance-bubble {
  background: linear-gradient(135deg, #7C2D12, #6B2106) !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

.defiance-bubble::after {
  border-color: transparent transparent transparent #6B2106 !important;
}

.broken-label {
  font-size: 10px;
  color: #22C55E;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(34, 197, 94, 0.1);
}

.mood-breaking {
  color: #22C55E;
}

@keyframes breakingFlash {
  0% { box-shadow: 0 0 0 rgba(34, 197, 94, 0); transform: scale(0.95); }
  50% { box-shadow: 0 0 20px rgba(34, 197, 94, 0.3); transform: scale(1.02); }
  100% { box-shadow: 0 0 0 rgba(34, 197, 94, 0); transform: scale(1); }
}

/* ====== DEPTH OVERHAUL — Pressure Bar ====== */

.pressure-bar-wrap {
  width: 100%;
  height: 3px;
  background: rgba(30, 26, 22, 0.5);
  border-radius: 2px;
  margin-top: 2px;
  overflow: hidden;
}

.pressure-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
  background: #8B7355;
}

.notebook-pressure {
  font-size: 10px;
  font-weight: 600;
  margin-left: 6px;
  letter-spacing: 0.5px;
}

/* ====== DEPTH OVERHAUL — Evidence-Highlighted Probe Pills ====== */

.probe-pill.evidence-highlighted {
  border: 1.5px solid #F59E0B !important;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.2);
  position: relative;
}

.probe-pill.evidence-highlighted::after {
  content: '★';
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 10px;
  color: #F59E0B;
  line-height: 1;
}

/* ====== DEPTH OVERHAUL — Evidence ConnectsTo Tags ====== */

.evidence-connects-tag {
  display: inline-block;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 6px;
  margin-top: 4px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.evidence-connects-tag.connects-weapon {
  background: rgba(239, 68, 68, 0.12);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.evidence-connects-tag.connects-alibi {
  background: rgba(59, 130, 246, 0.12);
  color: #60A5FA;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.evidence-connects-tag.connects-motive {
  background: rgba(168, 85, 247, 0.12);
  color: #A855F7;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.evidence-connects-tag.connects-witness {
  background: rgba(245, 158, 11, 0.12);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.evidence-connects-tag.connects-secret {
  background: rgba(139, 115, 85, 0.12);
  color: #D4C5A9;
  border: 1px solid rgba(139, 115, 85, 0.3);
}

/* Crime scene revisit button */
.crime-scene-btn {
  border-color: rgba(245, 158, 11, 0.3) !important;
  color: #F59E0B !important;
}

.crime-scene-btn:active {
  background: rgba(245, 158, 11, 0.15) !important;
}

/* ====== DEPTH OVERHAUL — Score Breakdown ====== */

.score-breakdown {
  background: rgba(22, 18, 14, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(139, 0, 0, 0.2);
  border-radius: 14px;
  padding: 16px 20px;
  margin: 12px 0;
  text-align: center;
  max-width: 320px;
  width: 100%;
}

.grade-badge {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -1px;
  border: 2px solid;
}

.grade-badge.grade-s {
  background: rgba(245, 158, 11, 0.15);
  color: #F59E0B;
  border-color: #F59E0B;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.grade-badge.grade-a {
  background: rgba(34, 197, 94, 0.15);
  color: #22C55E;
  border-color: #22C55E;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.2);
}

.grade-badge.grade-b {
  background: rgba(59, 130, 246, 0.15);
  color: #60A5FA;
  border-color: #60A5FA;
}

.grade-badge.grade-c {
  background: rgba(139, 115, 85, 0.15);
  color: #D4C5A9;
  border-color: #8B7355;
}

.grade-badge.grade-d {
  background: rgba(107, 114, 128, 0.15);
  color: #9CA3AF;
  border-color: #6B7280;
}

.grade-label {
  font-size: 14px;
  font-weight: 700;
  color: #D4C5A9;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.score-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.score-line {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #8B7355;
  padding: 2px 0;
}

.score-line span:last-child {
  color: #D4C5A9;
  font-weight: 600;
}

.score-total {
  font-size: 16px;
  color: #D4C5A9;
  font-weight: 700;
  padding-top: 8px;
  border-top: 1px solid rgba(139, 0, 0, 0.2);
}

/* ====== DEPTH OVERHAUL — Evidence Board: Crime Scene Section ====== */

.notebook-crime-scene-section {
  background: rgba(139, 0, 0, 0.06);
  border: 1px solid rgba(139, 0, 0, 0.15);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.notebook-crime-scene-title {
  font-size: 13px;
  font-weight: 700;
  color: #D4C5A9;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.notebook-crime-clue {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  font-size: 11px;
  color: #8B7355;
  padding: 4px 0;
  line-height: 1.4;
  border-bottom: 1px solid rgba(139, 0, 0, 0.08);
}

.notebook-crime-clue:last-child {
  border-bottom: none;
}

.notebook-crime-clue-tag {
  flex-shrink: 0;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.notebook-crime-clue-tag.connects-weapon {
  background: rgba(239, 68, 68, 0.12);
  color: #EF4444;
}

.notebook-crime-clue-tag.connects-alibi {
  background: rgba(59, 130, 246, 0.12);
  color: #60A5FA;
}

.notebook-crime-clue-tag.connects-motive {
  background: rgba(168, 85, 247, 0.12);
  color: #A855F7;
}

.notebook-crime-clue-tag.connects-witness {
  background: rgba(245, 158, 11, 0.12);
  color: #F59E0B;
}

.notebook-crime-clue-tag.connects-secret {
  background: rgba(139, 115, 85, 0.12);
  color: #D4C5A9;
}

/* Evidence section (generic) */
.evidence-section {
  padding: 8px 12px;
  margin-bottom: 8px;
}

.evidence-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #D4C5A9;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

/* Relationship rows */
.relationship-row {
  font-size: 0.82em;
  color: rgba(255, 255, 255, 0.7);
  padding: 4px 8px;
  margin: 2px 0;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
}

/* Corrected entry in evidence board */
.notebook-entry.notebook-corrected {
  background: rgba(34, 197, 94, 0.06);
  border-left: 2px solid rgba(34, 197, 94, 0.4);
}

.notebook-corrected-label {
  font-size: 10px;
  color: #22C55E;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ==========================================================================
   CONNECTION WEB — Visual who-told-who web
   ========================================================================== */

.connection-web {
  position: relative;
  width: 100%;
  height: 220px;
  min-height: 200px;
  margin: 8px 0;
  border-radius: 12px;
  background: rgba(139, 0, 0, 0.08);
  border: 1px solid rgba(139, 0, 0, 0.15);
  overflow: hidden;
}

.web-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Edge line styles */
.web-edge {
  stroke-width: 2;
}

.web-edge.unverified {
  stroke: #666;
  stroke-opacity: 0.6;
}

.web-edge.verified {
  stroke: #22C55E;
  stroke-opacity: 0.9;
}

.web-edge.contradicted {
  stroke: #EF4444;
  stroke-opacity: 0.9;
  stroke-dasharray: 6, 4;
}

.web-edge.eliminated {
  stroke: #444;
  stroke-opacity: 0.4;
  stroke-dasharray: 3, 6;
}

/* Character node */
.web-node {
  position: absolute;
  width: 48px;
  height: 48px;
  transform: translate(-50%, -50%);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
  transition: transform 0.2s ease;
}

.web-node:active {
  transform: translate(-50%, -50%) scale(0.92);
}

.web-node-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(212, 197, 169, 0.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.web-node.selected .web-node-img {
  border-color: #CD5C5C;
  box-shadow: 0 0 12px rgba(205, 92, 92, 0.6);
}

.web-node.eliminated .web-node-img {
  opacity: 0.35;
  filter: grayscale(1);
  border-color: #444;
}

.web-node-skull {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 20px;
  pointer-events: none;
}

.web-node-name {
  margin-top: 2px;
  font-size: 9px;
  color: #D4C5A9;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.web-node.eliminated .web-node-name {
  opacity: 0.4;
}

/* Evidence board web container */
.notebook-web-container {
  margin: 4px 0 8px;
}

/* Detail panel in evidence board */
.notebook-detail-container {
  margin-top: 4px;
}

.notebook-char-detail {
  background: rgba(10, 10, 15, 0.5);
  border-radius: 10px;
  padding: 10px;
  border: 1px solid rgba(212, 197, 169, 0.1);
}

.notebook-detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.notebook-detail-thumb {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(212, 197, 169, 0.3);
}

.notebook-detail-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notebook-detail-name {
  font-size: 15px;
  font-weight: 700;
  color: #D4C5A9;
}

.notebook-detail-archetype {
  font-size: 11px;
  color: #8B7355;
}

.notebook-detail-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(139, 0, 0, 0.15);
}

.notebook-mood {
  font-size: 11px;
  color: #D4C5A9;
}

.notebook-hint {
  text-align: center;
  color: #8B7355;
  font-size: 12px;
  padding: 16px 8px;
  font-style: italic;
}

/* Denial bubble in dialogue */
.bubble.denial {
  border-color: rgba(239, 68, 68, 0.3) !important;
}

.bubble.denial-bubble {
  background: rgba(239, 68, 68, 0.15) !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

/* ==========================================================================
   EVIDENCE METER — Final Two survival indicator
   ========================================================================== */

.evidence-meter {
  margin: 12px 0;
  padding: 10px 14px;
  background: rgba(10, 10, 15, 0.6);
  border-radius: 10px;
  border: 1px solid rgba(212, 197, 169, 0.15);
}

.evidence-meter-label {
  font-size: 13px;
  font-weight: 600;
  color: #D4C5A9;
  margin-bottom: 6px;
  text-align: center;
}

.evidence-meter-bar {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 6px;
}

.evidence-meter-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.evidence-meter-fill.low {
  background: linear-gradient(90deg, #EF4444, #F97316);
}

.evidence-meter-fill.medium {
  background: linear-gradient(90deg, #F59E0B, #EAB308);
}

.evidence-meter-fill.high {
  background: linear-gradient(90deg, #22C55E, #16A34A);
}

.evidence-meter-survival {
  font-size: 14px;
  font-weight: 700;
  color: #D4C5A9;
  text-align: center;
  margin-bottom: 2px;
}

.evidence-meter-hint {
  font-size: 10px;
  color: #8B7355;
  text-align: center;
  font-style: italic;
}

/* Fate reveal evidence info */
.fate-evidence-info {
  font-size: 11px;
  color: #8B7355;
  text-align: center;
  margin-top: 8px;
}

/* Trust score indicator in dialogue header */
.trust-indicator {
  display: inline-block;
  margin-left: 4px;
  font-weight: 500;
  letter-spacing: 0.03em;
}
