@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Cormorant+Garamond:ital,wght@0,400;0,700;1,400&family=IM+Fell+English:ital@0;1&display=swap');

:root {
  /* Victorian HSL Palette */
  --color-bg-h: 220;
  --color-bg-s: 15%;
  --color-bg-l: 7%;
  --color-bg: hsl(var(--color-bg-h), var(--color-bg-s), var(--color-bg-l));
  
  --color-surface-h: 220;
  --color-surface-s: 12%;
  --color-surface-l: 12%;
  --color-surface: hsla(var(--color-surface-h), var(--color-surface-s), var(--color-surface-l), 0.75);
  
  --color-blood-h: 0;
  --color-blood-s: 65%;
  --color-blood-l: 22%;
  --color-blood: hsl(var(--color-blood-h), var(--color-blood-s), var(--color-blood-l));
  
  --color-parchment-h: 40;
  --color-parchment-s: 35%;
  --color-parchment-l: 72%;
  --color-parchment: hsl(var(--color-parchment-h), var(--color-parchment-s), var(--color-parchment-l));
  
  --color-accent-h: 38;
  --color-accent-s: 55%;
  --color-accent-l: 45%;
  --color-accent: hsl(var(--color-accent-h), var(--color-accent-s), var(--color-accent-l));
  
  --color-sanity-h: 175;
  --color-sanity-s: 20%;
  --color-sanity-l: 48%;
  --color-sanity: hsl(var(--color-sanity-h), var(--color-sanity-s), var(--color-sanity-l));

  --color-gold: #c5a059;
  --color-dark-glass: rgba(10, 11, 15, 0.85);

  /* Hotspot Design System */
  --color-hotspot-clean: #ff3b30;       /* Bright glowing crimson red */


  --font-title: 'Cinzel', Georgia, serif;
  --font-body: 'Cormorant Garamond', Garamond, serif;
  --font-writing: 'IM Fell English', cursive, serif;

  --transition-speed: 0.3s;
  --left-panel-width: 320px;
}

/* Base resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

button:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

body {
  background-color: var(--color-bg);
  color: var(--color-parchment);
  font-family: var(--font-body);
  font-size: 1.15rem;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
}

/* Atmospheric Gaslight Vignette & Flicker Animation */
@keyframes gaslight-flicker {
  0%, 100% { opacity: 0.96; }
  23% { opacity: 0.93; }
  25% { opacity: 0.88; }
  26% { opacity: 0.94; }
  42% { opacity: 0.96; }
  44% { opacity: 0.90; }
  45% { opacity: 0.98; }
  78% { opacity: 0.95; }
  80% { opacity: 0.84; }
  81% { opacity: 0.94; }
}

.gaslight-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 10;
  background: radial-gradient(circle at 50% 50%, transparent 20%, rgba(5, 5, 8, 0.65) 60%, rgba(2, 2, 4, 0.97) 95%);
  transition: opacity 0.5s ease, background 0.5s ease;
  mix-blend-mode: multiply;
  animation: gaslight-flicker 5s infinite alternate;
}

/* Master Game Layout */
.game-container {
  display: grid;
  grid-template-columns: var(--left-panel-width) 1fr 340px;
  height: 100vh;
  width: 100vw;
  max-width: 100vw;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

/* Glassmorphism Panel Template */
.panel {
  background: var(--color-dark-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(197, 160, 89, 0.2);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6), 0 10px 30px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  transition: transform var(--transition-speed) cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Left Panel: Cabinet & Tool Tray */
#left-panel {
  border-right: 2px solid var(--color-accent);
  padding: 1.5rem;
  z-index: 5;
}

.panel-header {
  font-family: var(--font-title);
  font-size: 1.4rem;
  text-align: center;
  color: var(--color-gold);
  border-bottom: 1px solid rgba(197, 160, 89, 0.3);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

#tool-tray {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  flex-grow: 1;
}

.tool-button {
  background: rgba(20, 22, 28, 0.6);
  border: 1px solid rgba(197, 160, 89, 0.25);
  color: var(--color-parchment);
  border-radius: 4px;
  padding: 1rem 0.5rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-title);
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-align: center;
  overflow-wrap: break-word;
  hyphens: auto;
}

.tool-button:hover {
  background: rgba(197, 160, 89, 0.15);
  border-color: var(--color-gold);
  box-shadow: 0 0 10px rgba(197, 160, 89, 0.2);
}

.tool-button.active {
  background: rgba(197, 160, 89, 0.25);
  border-color: var(--color-gold);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.8), 0 0 15px rgba(197, 160, 89, 0.35);
  color: var(--color-gold);
}

.tool-icon {
  width: 32px;
  height: 32px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}

.tool-button--journal {
  grid-column: span 2;
  margin-top: 1rem;
  background: rgba(197, 160, 89, 0.1);
  border-color: var(--color-gold);
}

/* Notebook Drawer Component */
#notebook-drawer {
  position: absolute;
  left: var(--left-panel-width);
  top: 0;
  width: 450px;
  height: 100vh;
  z-index: 6;
  border-right: 2px solid var(--color-accent);
  transform: translateX(-105%);
  visibility: hidden;
  opacity: 0;
  transition: transform var(--transition-speed) ease, opacity var(--transition-speed) ease, visibility var(--transition-speed) ease;
}

#notebook-drawer.open {
  transform: translateX(0);
  visibility: visible;
  opacity: 1;
}

/* Center Panel: Autopsy Table */
#center-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: auto;
  background: radial-gradient(circle at center, rgba(15, 17, 22, 0.8) 0%, rgba(7, 8, 10, 0.95) 100%);
}

#autopsy-table {
  width: 90%;
  max-width: 700px;
  aspect-ratio: 1 / 1.5;
  background: rgba(22, 24, 30, 0.9);
  border: 4px solid var(--color-accent);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), inset 0 0 40px rgba(0, 0, 0, 0.9);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

/* Right Panel: Detective Status Info */
#right-panel {
  border-left: 2px solid var(--color-accent);
  padding: 1.5rem;
  z-index: 5;
  gap: 1.5rem;
}

/* Mechanical Stopwatch Widget */
.stopwatch-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.5rem;
}

#stopwatch {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 6px solid var(--color-accent);
  background: radial-gradient(circle, var(--color-parchment) 60%, #b29456 100%);
  color: #1a150c;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: bold;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6), inset 0 4px 10px rgba(0, 0, 0, 0.3);
  position: relative;
}

/* Sanity Bar Widget */
.status-bar-container {
  width: 100%;
}

.status-label {
  font-family: var(--font-title);
  font-size: 0.9rem;
  color: var(--color-gold);
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  letter-spacing: 1px;
}

.progress-bar-bg {
  width: 100%;
  height: 12px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(197, 160, 89, 0.3);
  border-radius: 6px;
  overflow: hidden;
}

#sanity-meter {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--color-sanity) 0%, #308078 100%);
  box-shadow: 0 0 8px var(--color-sanity);
  transition: width 0.3s ease;
}

/* Responsive / Mobile Adjustments */
@media (max-width: 1024px) {
  :root {
    --left-panel-width: 240px;
  }
  .game-container {
    grid-template-columns: var(--left-panel-width) 1fr 260px;
  }
  #stopwatch {
    width: 110px;
    height: 110px;
    font-size: 1.3rem;
  }
  .tool-button {
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    padding: 0.75rem 0.35rem;
  }
  .tool-icon {
    width: 26px;
    height: 26px;
  }
}

/* Mobile-only cabinet collapse toggle: irrelevant at desktop widths, so the
   button stays hidden until the 768px query below turns it on. */
.cabinet-toggle-btn {
  display: none;
}

/* Mobile-only "Next Steps" floating trigger. Reuses #objective-panel's
   existing markup as its popup content instead of duplicating the list. */
.objective-fab {
  display: none;
}
#objective-panel #btn-close-objective {
  display: none;
}

@media (max-width: 768px) {
  body {
    overflow: auto;
  }
  .game-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    height: auto;
    min-height: 100vh;
  }
  #left-panel, #right-panel {
    border: none;
    height: auto;
    padding: 1rem;
  }
  #notebook-drawer {
    width: 100%;
    left: 0;
    /* Above the floating cabinet (20/21) and Next Steps popup (22): when the
       journal is open it's the primary surface and must win the stack, not
       be covered by the persistent mobile widgets. */
    z-index: 25;
  }
  #autopsy-table {
    margin: 1.5rem auto;
    width: 95%;
  }

  /* Cabinet becomes a floating vertical strip of icon-only buttons pinned
     to the left edge, instead of a full-width block pushing the autopsy
     table down the page. */
  #left-panel {
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 72px;
    max-height: 88vh;
    overflow-y: auto;
    z-index: 20;
    border-radius: 0 8px 8px 0;
    padding: 2.5rem 0.5rem 0.75rem;
    transition: transform var(--transition-speed) ease;
  }
  #left-panel.collapsed {
    transform: translateY(-50%) translateX(-100%);
  }
  #left-panel .panel-header {
    display: none;
  }
  #tool-tray {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .tool-button {
    padding: 0.6rem 0.25rem;
  }
  .tool-button span {
    display: none;
  }
  .tool-icon {
    width: 24px;
    height: 24px;
  }

  .cabinet-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: calc(50% - 44px);
    left: 0;
    width: 32px;
    height: 32px;
    background: var(--color-dark-glass);
    border: 1px solid rgba(197, 160, 89, 0.3);
    border-left: none;
    border-radius: 0 6px 6px 0;
    color: var(--color-gold);
    z-index: 21;
    padding: 0;
  }
  .cabinet-toggle-btn .tool-icon {
    width: 18px;
    height: 18px;
  }

  /* Next Steps: a small pill showing the current step, expanding into a
     bottom-sheet popup with the full checklist on tap. */
  .objective-fab {
    display: block;
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    max-width: 90vw;
    z-index: 20;
    background: var(--color-dark-glass);
    border: 1px solid var(--color-gold);
    border-radius: 20px;
    color: var(--color-gold);
    font-family: var(--font-title);
    font-size: 0.78rem;
    letter-spacing: 0.5px;
    padding: 0.6rem 1.1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #objective-panel {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 60vh;
    overflow-y: auto;
    background: var(--color-dark-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--color-gold);
    border-radius: 12px 12px 0 0;
    padding: 1rem 1.25rem 1.5rem;
    z-index: 22;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.7);
  }
  #objective-panel.active {
    display: block;
  }
  #objective-panel #btn-close-objective {
    display: flex;
  }
  .objective-fab.fab-hidden {
    display: none;
  }
}

/* Custom tool cursors */
.active-tool-scalpel { cursor: crosshair; }
.active-tool-forceps { cursor: grab; }
.active-tool-magnifier { cursor: zoom-in; }
.active-tool-reagent { cursor: copy; }
.active-tool-stethoscope { cursor: help; }
.active-tool-caliper { cursor: ew-resize; }

/* Interactive SVG Hotspots and Elements */
.body-hotspot {
  cursor: pointer;
  opacity: 0.82;
  transition: opacity var(--transition-speed), transform var(--transition-speed);
}
.body-hotspot:hover {
  opacity: 1;
  transform: scale(1.06);
}
.hotspot-trigger {
  transition: fill var(--transition-speed), stroke var(--transition-speed);
}
.hotspot-center {
  transform-origin: center;
  transform-box: fill-box;
}

/* Hotspot Active State: Bright glowing crimson red (always accessible) */
.body-hotspot .hotspot-trigger {
  fill: rgba(255, 59, 48, 0.16) !important;
  stroke: var(--color-hotspot-clean) !important;
  stroke-width: 2;
}
.body-hotspot:hover .hotspot-trigger {
  fill: rgba(255, 59, 48, 0.3) !important;
  stroke: #ff453a !important;
}
.body-hotspot .hotspot-center {
  fill: var(--color-hotspot-clean) !important;
  filter: drop-shadow(0 0 6px rgba(255, 59, 48, 0.95)) !important;
  animation: hotspotPulseClean 1.5s ease-in-out infinite;
}

/* Decorative blood-spatter tint on the body outline (ambient, non-interactive) */
#body-outline {
  filter: drop-shadow(0 0 8px rgba(100, 18, 18, 0.18));
}

@keyframes hotspotPulseClean {
  0%, 100% { opacity: 1; transform: scale(1); filter: drop-shadow(0 0 6px rgba(255, 59, 48, 0.95)); }
  50% { opacity: 0.6; transform: scale(1.08); filter: drop-shadow(0 0 10px rgba(255, 59, 48, 1)); }
}

.target-path {
  stroke: rgba(255, 59, 48, 0.35) !important; /* Matches the new hotspot color */
  stroke-width: 12;
  filter: drop-shadow(0 0 3px rgba(255, 59, 48, 0.25));
  transition: stroke var(--transition-speed), filter var(--transition-speed);
}
.target-path.complete {
  stroke: var(--color-blood) !important;
  stroke-dasharray: none !important;
  filter: drop-shadow(0 0 5px var(--color-blood));
}
@keyframes incisionCharge {
  0% { stroke: rgba(255, 59, 48, 0.5); stroke-width: 12; filter: drop-shadow(0 0 3px rgba(255, 59, 48, 0.25)); }
  100% { stroke: var(--color-blood); stroke-width: 22; filter: drop-shadow(0 0 8px var(--color-blood)); }
}
.target-path.charging {
  animation: incisionCharge 1.6s linear forwards;
}
#body-plate {
  opacity: 0.82;
  transition: opacity 0.3s;
  pointer-events: none;
}
/* The SVG hotspot/incision graphics are decorative only — real
   interaction happens on the HTML button overlays below. */
#hotspots-group {
  pointer-events: none;
}

.hotspot-hit-area,
.incision-hit-area {
  position: absolute;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  /* Let the active tool's themed cursor (crosshair/grab/cell/etc, set via
     .active-tool-* on #autopsy-table) show through instead of a generic
     pointer overriding it. */
  cursor: inherit;
  -webkit-tap-highlight-color: transparent;
}
.hotspot-hit-area {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}
.incision-hit-area {
  left: 50%;
  top: 26.67%;
  width: 56px;
  height: 40%;
  border-radius: 28px;
  transform: translateX(-50%);
  z-index: 1;
}

/* Flash highlight animation for correct tools */
@keyframes hotspotFlash {
  0%, 100% {
    background-color: rgba(255, 59, 48, 0.45);
    box-shadow: 0 0 0 2px rgba(255, 59, 48, 0.9), 0 0 20px rgba(255, 59, 48, 0.9), inset 0 0 10px rgba(255, 59, 48, 0.7);
  }
  50% {
    background-color: rgba(255, 59, 48, 0.05);
    box-shadow: 0 0 0 1px rgba(255, 59, 48, 0.2), 0 0 5px rgba(255, 59, 48, 0.2);
  }
}
.hotspot-hit-area.flash-highlight,
.incision-hit-area.flash-highlight {
  animation: hotspotFlash 1.2s ease-in-out infinite;
}
#body-outline {
  fill: url(#skin-gradient);
  fill-opacity: 0.6;
  stroke: rgba(197, 160, 89, 0.4);
  stroke-width: 1.5;
  transition: fill-opacity 0.75s ease, stroke-opacity 0.75s ease;
}
#body-outline.sliced {
  fill-opacity: 0;
  stroke-opacity: 0.12;
}

/* Notebook Tabs and Content */
.notebook-tabs {
  display: flex;
  background: rgba(10, 11, 15, 0.5);
  border-bottom: 1px solid rgba(197, 160, 89, 0.25);
}
.notebook-tab {
  flex: 1;
  min-height: 44px;
  background: transparent;
  border: none;
  color: #8c8270;
  padding: 0.75rem 0.5rem;
  font-family: var(--font-title);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.notebook-tab:hover {
  color: var(--color-parchment);
}
.notebook-tab.active {
  color: var(--color-gold);
  border-bottom-color: var(--color-gold);
  background: rgba(197, 160, 89, 0.05);
}
.notebook-content {
  display: none;
  padding: 1.5rem;
  flex-grow: 1;
  overflow-y: auto;
}
.notebook-content.active {
  display: flex;
  flex-direction: column;
}

/* Handwritten Cursive Style for Notes */
.handwritten-notes {
  font-family: var(--font-writing);
  line-height: 1.6;
  color: #c4b69c;
  font-size: 1.25rem;
}
.journal-date {
  font-weight: bold;
  border-bottom: 1px dashed rgba(197, 160, 89, 0.2);
  margin-bottom: 0.75rem;
  color: var(--color-gold);
}
.journal-entry {
  margin-bottom: 1.5rem;
  text-indent: 1.5rem;
}

/* Evidence Locker */
.evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.evidence-card {
  background: rgba(15, 17, 22, 0.75);
  border: 1px dashed rgba(197, 160, 89, 0.3);
  padding: 1rem;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  cursor: pointer;
  transition: border-color 0.2s;
}
.evidence-card:hover {
  border-color: var(--color-gold);
}
.evidence-title {
  font-family: var(--font-title);
  font-size: 0.9rem;
  color: var(--color-gold);
}
.evidence-desc {
  font-size: 0.8rem;
  color: #a49680;
}

/* Deduction Board */
.deduction-board {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.board-desc {
  font-size: 0.95rem;
  color: #b8ac95;
  line-height: 1.4;
}
.deduction-linkers {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.select-container {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.select-container label {
  font-family: var(--font-title);
  font-size: 0.8rem;
  color: var(--color-gold);
}
.brass-select {
  background: #111317;
  border: 1px solid rgba(197, 160, 89, 0.3);
  color: var(--color-parchment);
  padding: 0.6rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
}
.brass-select:focus {
  border-color: var(--color-gold);
}
.brass-button {
  background: linear-gradient(180deg, #d3b16c 0%, #a27b38 100%);
  border: 1px solid #7c5c24;
  color: #1a1409;
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: bold;
  padding: 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.2s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}
.brass-button:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 15px rgba(197, 160, 89, 0.25);
}
.deductions-list {
  border-top: 1px solid rgba(197, 160, 89, 0.2);
  padding-top: 1rem;
  margin-top: 0.5rem;
}
.deductions-heading {
  color: var(--color-gold);
  font-family: var(--font-title);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}
.deductions-list ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.deduction-item {
  background: rgba(197, 160, 89, 0.05);
  border: 1px solid rgba(197, 160, 89, 0.15);
  padding: 0.75rem;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #c4b8a2;
  border-left: 3px solid var(--color-gold);
}

/* Modal / Overlay Structure */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 5, 8, 0.85);
  z-index: 100;
  display: none; /* Controlled via JS */
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(8px);
}
.modal-overlay.active {
  display: flex;
}
.modal-content {
  background: var(--color-dark-glass);
  border: 2px solid var(--color-accent);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
  width: 90%;
  max-width: 460px;
  border-radius: 8px;
  padding: 2rem;
  position: relative;
  animation: modalFadeIn 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
.close-modal-btn {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #8c8270;
  font-size: 1.75rem;
  cursor: pointer;
  transition: color 0.2s;
}

.close-modal-btn--notebook {
  top: 0.25rem;
  right: 0.5rem;
  font-size: 1.6rem;
}
.close-modal-btn:hover {
  color: var(--color-blood);
}
.modal-title {
  font-family: var(--font-title);
  color: var(--color-gold);
  border-bottom: 1px solid rgba(197, 160, 89, 0.25);
  padding-bottom: 0.75rem;
  padding-right: 3rem; /* space for the close × button */
  margin-bottom: 1.25rem;
  font-size: 1.3rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.tool-desc {
  font-size: 0.95rem;
  color: #b8ac95;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

/* Caliper Mockup Visual */
.caliper-visual {
  height: 80px;
  border: 1px solid rgba(197, 160, 89, 0.2);
  background: rgba(10, 12, 16, 0.6);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.caliper-ruler {
  position: absolute;
  left: 0;
  right: 0;
  top: 35px;
  height: 10px;
  background: #2a251e;
  border-top: 1px solid var(--color-accent);
  border-bottom: 1px solid var(--color-accent);
}
.caliper-jaw {
  position: absolute;
  top: 10px;
  width: 8px;
  height: 60px;
  background: var(--color-accent);
  box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}
.jaw-left {
  left: 60px;
}
.jaw-right {
  left: 60px; /* slider updates this dynamically */
  transition: left 0.1s ease;
}

/* Scale Mockup Visual */
.scale-visual {
  height: 140px;
  position: relative;
  margin: 1rem 0;
}
.scale-base {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 20px;
  background: #332b1e;
  border: 1px solid var(--color-accent);
  border-radius: 3px;
}
.scale-beam {
  position: absolute;
  top: 40px;
  left: 10%;
  right: 10%;
  height: 6px;
  background: var(--color-accent);
  transform-origin: center center;
  transition: transform 0.35s ease-out;
}
.scale-pan {
  position: absolute;
  top: 43px;
  width: 60px;
  height: 60px;
  border: 2px solid rgba(197,160,89,0.5);
  border-radius: 50%;
  background: rgba(22, 24, 30, 0.8);
  transition: transform 0.35s ease-out;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px;
  padding: 4px;
}
.pan-left {
  left: 10%;
}
.pan-right {
  right: 10%;
}
.pan-label {
  font-family: var(--font-title);
  font-size: 0.65rem;
  color: rgba(197, 160, 89, 0.7);
  letter-spacing: 0.5px;
}
#scale-pan-left {
  border: none;
  background: transparent;
  box-shadow: none;
  width: 75px;
  height: 75px;
  top: 36px;
}
.pan-organ-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid rgba(197, 160, 89, 0.45);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.6);
  opacity: 0.95;
  filter: sepia(0.2) contrast(1.15) brightness(0.9);
  transition: transform 0.25s ease, opacity 0.3s ease;
}
.scale-pan:hover .pan-organ-image {
  transform: scale(1.05);
  opacity: 1;
}
.weight-disc {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(180deg, #d3b16c 0%, #a27b38 100%);
  border: 1px solid #7c5c24;
}
.weight-disc-count {
  font-family: var(--font-title);
  font-size: 0.75rem;
  color: var(--color-gold);
}

/* Weight tray + placed weights (balance-scale assessment) */
.weight-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  justify-content: center;
}
.weight-piece {
  background: linear-gradient(180deg, #d3b16c 0%, #a27b38 100%);
  border: 1px solid #7c5c24;
  color: #1a1409;
  font-family: var(--font-title);
  font-size: 0.8rem;
  font-weight: bold;
  padding: 0.5rem 0.7rem;
  border-radius: 4px;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  transition: all 0.15s ease;
}
.weight-piece:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 8px rgba(197, 160, 89, 0.35);
}
.weight-piece:active {
  transform: scale(0.95);
}
.placed-weights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-height: 32px;
  margin-top: 0.5rem;
  justify-content: center;
}
.weight-chip {
  background: rgba(197, 160, 89, 0.12);
  border: 1px dashed rgba(197, 160, 89, 0.5);
  color: var(--color-parchment);
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.weight-chip:hover {
  border-color: var(--color-blood);
  color: var(--color-blood);
}
.brass-slider {
  width: 100%;
  accent-color: var(--color-gold);
  background: #222;
  height: 6px;
  border-radius: 3px;
  outline: none;
}

/* Case Dossier */
#case-info {
  margin-top: 1rem;
  flex-grow: 1;
}
.dossier-title {
  font-family: var(--font-title);
  font-size: 1.2rem;
  color: var(--color-gold);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}
.dossier-meta {
  font-size: 0.85rem;
  color: #8c8270;
  margin-bottom: 0.75rem;
}
.dossier-intro {
  font-size: 0.9rem;
  line-height: 1.4;
  color: #c4b8a2;
}
.dossier-placeholder {
  font-style: italic;
  color: #b0a085;
}

/* Investigation Checklist */
#objective-panel {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(197, 160, 89, 0.25);
}
.objective-title {
  font-family: var(--font-title);
  font-size: 0.8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 0.5rem;
}
#objective-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
#objective-list li {
  font-size: 0.82rem;
  line-height: 1.35;
  color: #c4b8a2;
  padding-left: 1.3rem;
  position: relative;
}
#objective-list li::before {
  content: '\25CB';
  position: absolute;
  left: 0;
  color: var(--color-gold);
}
#objective-list li.objective-done {
  color: #6f6656;
  text-decoration: line-through;
}
#objective-list li.objective-done::before {
  content: '\2713';
  color: #4caf50;
}
#objective-list li.objective-current::before {
  color: var(--color-blood);
}

/* Empty-state placeholders */
.empty-state {
  text-align: center;
  font-style: italic;
  color: #8c8270;
}
.empty-note {
  font-style: italic;
  color: #8c8270;
  font-size: 0.9rem;
}

/* Measurement modal panels */
.modal-tool-panel {
  display: none;
}
.slider-container {
  margin-top: 2rem;
  position: relative; /* anchors the target-zone marker */
}

/* Forensic note shown inside the caliper modal */
.caliper-hint {
  font-size: 0.82rem;
  color: var(--color-muted, #8c8270);
  font-style: italic;
  margin-top: 0.25rem;
  line-height: 1.45;
}
.caliper-hint strong {
  color: var(--color-gold);
  font-style: normal;
}

/* Target-zone marker: shows acceptable measurement range on slider track.
   Positioned absolutely over the slider. The slider thumb is inset ~8px
   on each side in most browsers, so we account for that with padding-inline. */
.caliper-target-zone {
  position: absolute;
  top: 0;
  /* 71.7% to 78.3% of the 0–150 slider = 4.3–4.7 inches */
  left: calc(71.7% + 8px);
  width: calc(6.6% - 4px);
  height: 6px;
  background: rgba(197, 160, 89, 0.55);
  border: 1px solid var(--color-gold);
  border-radius: 3px;
  pointer-events: none;
  z-index: 1;
}
/* Tooltip label above the zone */
.caliper-target-zone::after {
  content: 'target';
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  color: var(--color-gold);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}

.measurement-display {
  margin-top: 1rem;
  font-family: var(--font-title);
  font-size: 1.2rem;
  text-align: center;
}
.scale-visual + .measurement-display {
  margin-top: 1.5rem;
}
#caliper-value,
#scale-value {
  color: var(--color-gold);
}
.brass-button--block {
  margin-top: 1rem;
  width: 100%;
}

/* Win / Loss Outcome Screens */
.outcome-modal {
  text-align: center;
}
.outcome-modal--loss {
  border-color: var(--color-blood);
}
.outcome-modal--win {
  border-color: var(--color-gold);
}
.outcome-title {
  font-family: var(--font-title);
  font-size: 1.8rem;
  margin-bottom: 1rem;
  letter-spacing: 2px;
}
.outcome-title--loss {
  color: var(--color-blood);
  text-shadow: 0 0 10px rgba(139, 0, 0, 0.5);
}
.outcome-title--win {
  color: var(--color-gold);
}
.outcome-message {
  margin-bottom: 2rem;
  color: #b8ac95;
  font-size: 1.1rem;
  line-height: 1.5;
}

/* Settings */
.settings-fab {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 20;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-dark-glass);
  border: 1px solid rgba(197, 160, 89, 0.3);
  border-radius: 50%;
  color: var(--color-parchment);
  cursor: pointer;
  transition: all 0.2s ease;
}
.settings-fab:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
  box-shadow: 0 0 10px rgba(197, 160, 89, 0.25);
}
.settings-fab .tool-icon {
  width: 22px;
  height: 22px;
}
@media (max-width: 768px) {
  /* On mobile the page itself scrolls (body { overflow: auto }) — a
     viewport-fixed settings button would stay parked over whatever
     content is currently underneath as the player scrolls, occluding
     hotspot taps. Let it scroll away with the page instead. */
  .settings-fab {
    position: absolute;
  }
}
#btn-mute {
  right: 4.5rem;
}
.settings-row {
  margin-bottom: 1.5rem;
}
.settings-row:last-child {
  margin-bottom: 0;
}
.settings-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-title);
  font-size: 0.85rem;
  color: var(--color-gold);
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

/* ORGAN IMAGE LIGHTBOX ZOOM */
#scale-pan-left .pan-organ-image {
  cursor: zoom-in;
}
.lightbox-content {
  position: relative;
  background: rgba(12, 14, 18, 0.96);
  border: 2px solid var(--color-accent);
  padding: 1.5rem;
  border-radius: 6px;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.95);
  animation: modal-fade-in 0.25s ease-out;
}
#lightbox-img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid rgba(197, 160, 89, 0.35);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
  background: #1a1409;
}
#lightbox-caption {
  font-family: var(--font-title);
  font-size: 1.15rem;
  color: var(--color-gold);
  margin-top: 1rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-align: center;
}

/* Notebook Evidence Thumbnails */
.evidence-thumbnail {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid rgba(197, 160, 89, 0.25);
  box-shadow: 0 2px 5px rgba(0,0,0,0.5);
  cursor: zoom-in;
  transition: transform 0.2s ease, filter 0.2s ease;
  background: #1a1409;
  margin-bottom: 0.25rem;
}
.evidence-thumbnail:hover {
  transform: scale(1.02);
  filter: brightness(1.1);
}

/* Screen Overlays (Title, Intro, Credits) */
.screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 5, 8, 0.96);
  z-index: 1000;
  display: none;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  padding: 1.5rem;
  box-sizing: border-box;
}

.screen-overlay.active {
  display: flex;
}

.screen-content {
  background: var(--color-dark-glass);
  border: 2px solid var(--color-accent);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.95);
  border-radius: 8px;
  padding: 2.5rem;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  animation: screenFadeIn 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes screenFadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Title Screen Styling */
#title-screen {
  background: linear-gradient(to bottom, rgba(4, 5, 8, 0.4) 0%, rgba(4, 5, 8, 0.85) 100%), url('../assets/title_bg.jpg') no-repeat center center;
  background-size: cover;
}

.title-content {
  max-width: 500px;
  align-items: center;
  text-align: center;
  background: rgba(10, 11, 15, 0.65) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(197, 160, 89, 0.35);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.95);
  padding: 3rem;
  border-radius: 8px;
}

.gaslight-lamp {
  position: relative;
  width: 60px;
  height: 90px;
  margin-bottom: 1.5rem;
  background: radial-gradient(circle, var(--color-gold) 0%, transparent 70%);
  animation: titleGaslightFlicker 3s infinite alternate;
}

@keyframes titleGaslightFlicker {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  30% { opacity: 0.6; transform: scale(0.95); }
  35% { opacity: 0.9; transform: scale(1.05); }
  70% { opacity: 0.7; transform: scale(0.98); }
}

.game-title {
  font-family: var(--font-title);
  font-size: 3rem;
  color: var(--color-gold);
  margin: 0 0 0.5rem 0;
  text-transform: uppercase;
  letter-spacing: 4px;
  text-shadow: 0 0 15px rgba(197, 160, 89, 0.4);
}

.game-subtitle {
  font-family: var(--font-title);
  font-size: 1rem;
  color: var(--color-parchment);
  opacity: 0.85;
  margin: 0 0 2rem 0;
  letter-spacing: 2px;
}

.title-actions {
  width: 100%;
  margin-bottom: 2rem;
}

.title-footer {
  font-size: 0.85rem;
  opacity: 0.6;
  font-style: italic;
  border-top: 1px solid rgba(197, 160, 89, 0.15);
  width: 100%;
  padding-top: 1rem;
}

/* Newspaper Style Case Intro */
.newspaper-page {
  background: #ecdcb9; /* aged newspaper color */
  color: #1a1712;
  border: 10px double #4a3e31;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.15), 0 20px 50px rgba(0,0,0,0.9);
}

.newspaper-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.newspaper-meta-top {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-title);
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 1px;
}

.newspaper-line {
  height: 2px;
  background: #1a1712;
  margin: 0.35rem 0;
}

.newspaper-line-double {
  height: 5px;
  border-top: 1px solid #1a1712;
  border-bottom: 1px solid #1a1712;
  margin: 0.35rem 0;
}

.newspaper-title {
  font-family: var(--font-title);
  font-size: 2.2rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin: 0.25rem 0;
  font-weight: 900;
}

.newspaper-meta-bottom {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-title);
  font-size: 0.8rem;
  font-weight: bold;
}

.newspaper-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  font-family: Garamond, Georgia, serif;
  line-height: 1.45;
  font-size: 1.05rem;
}

.newspaper-col {
  display: flex;
  flex-direction: column;
}

.newspaper-col.col-left {
  border-right: 1px solid rgba(74, 62, 49, 0.35);
  padding-right: 1rem;
}

.newspaper-headline {
  font-family: var(--font-title);
  font-size: 1.25rem;
  text-transform: uppercase;
  color: #7b1e1e; /* dark blood red on print */
  margin: 0 0 0.75rem 0;
  letter-spacing: 1px;
  font-weight: 900;
  line-height: 1.2;
}

.case-card-dossier {
  background: rgba(74, 62, 49, 0.1);
  border: 1px dashed #4a3e31;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  border-radius: 4px;
  font-size: 0.95rem;
}

.case-card-dossier p {
  margin: 0.25rem 0;
}

.newspaper-snippet {
  font-style: italic;
  position: relative;
  padding-left: 0.75rem;
  border-left: 3px solid #7b1e1e;
  margin: 0.5rem 0;
}

.case-details-text {
  margin-bottom: 1rem;
  text-align: justify;
}

.newspaper-illustration-box {
  border: 1px solid #4a3e31;
  padding: 4px;
  background: #fdfaf2;
  margin-top: auto;
}

.newspaper-illustration {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border: 1px solid rgba(74, 62, 49, 0.4);
  filter: grayscale(1) sepia(0.2) contrast(1.15);
  display: block;
}

.newspaper-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(74, 62, 49, 0.2);
}

/* Epilogue / Credits Page */
.epilogue-page {
  max-width: 580px;
  text-align: center;
}

.epilogue-title {
  font-family: var(--font-title);
  font-size: 2.5rem;
  color: var(--color-gold);
  text-transform: uppercase;
  margin: 0 0 0.5rem 0;
  letter-spacing: 2px;
}

.epilogue-subtitle {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--color-parchment);
  opacity: 0.8;
  margin: 0 0 2rem 0;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.epilogue-body {
  font-family: Garamond, Georgia, serif;
  font-size: 1.15rem;
  line-height: 1.6;
  text-align: justify;
  margin-bottom: 2rem;
}

.credits-section-title {
  font-family: var(--font-title);
  font-size: 1.2rem;
  color: var(--color-gold);
  margin: 1.5rem 0 0.75rem 0;
  text-transform: uppercase;
  text-align: center;
}

.memorial-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
  text-align: center;
}

.memorial-list li {
  margin: 0.5rem 0;
  font-size: 1.05rem;
}

.credits-box {
  border-top: 1px solid rgba(197, 160, 89, 0.2);
  padding-top: 1.25rem;
  margin-top: 1.5rem;
  font-size: 0.95rem;
  opacity: 0.75;
  text-align: center;
}

.credits-box p {
  margin: 0.25rem 0;
}

/* Responsive Overrides for Newspaper Column */
@media (max-width: 600px) {
  .newspaper-columns {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .newspaper-col.col-left {
    border-right: none;
    border-bottom: 1px solid rgba(74, 62, 49, 0.25);
    padding-right: 0;
    padding-bottom: 1rem;
  }
  .game-title {
    font-size: 2.2rem;
  }
  .screen-content {
    padding: 1.5rem;
    max-height: 95vh;
  }
  .newspaper-title {
    font-size: 1.6rem;
  }
}

/* Clue Board Card Layout */
.clue-cards-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  margin-top: 1rem;
}

.clue-card {
  background: var(--color-parchment);
  color: #2b2318;
  border: 1px solid rgba(197, 160, 89, 0.4);
  box-shadow: 0 4px 10px rgba(0,0,0,0.5), inset 0 0 15px rgba(0,0,0,0.08);
  border-radius: 4px;
  padding: 0.85rem;
  cursor: pointer;
  font-family: Garamond, Georgia, serif;
  font-size: 0.95rem;
  text-align: left;
  transition: all 0.2s ease;
  position: relative;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  user-select: none;
}

.clue-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-gold);
  box-shadow: 0 6px 15px rgba(197, 160, 89, 0.2);
}

.clue-card.selected {
  border: 2px solid #8b1a1a; /* deep red thread color */
  background: #f5edd6;
  box-shadow: 0 0 12px rgba(139, 26, 26, 0.4);
  transform: scale(0.98);
}

.clue-card.linkable-candidate {
  border: 2px dashed var(--color-gold);
  background: rgba(197, 160, 89, 0.08);
  box-shadow: 0 0 10px rgba(197, 160, 89, 0.35);
  animation: cardPulse 1.6s ease-in-out infinite;
}

@keyframes cardPulse {
  0%, 100% {
    opacity: 0.9;
    border-color: rgba(197, 160, 89, 0.6);
  }
  50% {
    opacity: 1;
    border-color: var(--color-gold);
    background: rgba(197, 160, 89, 0.16);
    box-shadow: 0 0 14px rgba(197, 160, 89, 0.5);
  }
}

.clue-card.selected::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 10px;
  height: 10px;
  background: #c5a059; /* copper pin */
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Shake animation for mismatch */
.clue-card.shake {
  animation: cardShake 0.4s ease-in-out;
}

@keyframes cardShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

@media (max-width: 600px) {
  .clue-cards-container {
    grid-template-columns: 1fr;
  }
}

/* ================================================================
   PHASE 7+: New Forensic Feature Styles
   ================================================================ */

/* Suture hit buttons — positioned within #autopsy-table */
.suture-hit-button {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: crosshair;
  transform: translate(-50%, -50%);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease;
}
.suture-hit-button:hover {
  background: rgba(197, 160, 89, 0.15);
}
.suture-hit-button.stitched {
  cursor: default;
  pointer-events: none;
}

/* Post-mortem phase timer — distinct amber styling on the stopwatch */
#stopwatch.postmortem-phase {
  color: var(--color-gold);
  text-shadow: 0 0 8px rgba(197, 160, 89, 0.6);
  animation: pmTimerPulse 1s ease-in-out infinite;
}
@keyframes pmTimerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Post-mortem phase banner above stopwatch */
.postmortem-banner {
  font-family: var(--font-title);
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-gold);
  text-align: center;
  margin-bottom: 0.25rem;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.postmortem-banner.visible {
  opacity: 1;
}

/* ToD Sentence Builder in Deductions tab */
.tod-builder {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(197, 160, 89, 0.2);
  border-radius: 6px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.tod-summary-box {
  background: rgba(197, 160, 89, 0.05);
  border: 1px solid rgba(197, 160, 89, 0.15);
  border-radius: 4px;
  padding: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #d8c39e;
}
.tod-summary-box p {
  margin: 0.25rem 0;
}
.tod-summary-box strong {
  color: var(--color-gold);
}
.tod-builder-title {
  font-family: var(--font-title);
  font-size: 0.9rem;
  color: var(--color-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.75rem;
}
.tod-sentence {
  font-family: var(--font-writing);
  font-size: 1.15rem;
  color: var(--color-parchment);
  line-height: 1.6;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.tod-select {
  background: rgba(10, 11, 15, 0.8);
  border: 1px solid rgba(197, 160, 89, 0.4);
  color: var(--color-parchment);
  font-family: var(--font-writing);
  font-size: 1.05rem;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  min-height: 44px;
}
.tod-select:focus {
  border-color: var(--color-gold);
  outline: none;
}
#btn-confirm-tod {
  margin-top: 1rem;
  width: 100%;
}

/* Inquest card item inside the inquest modal shelf */
.inquest-card-item {
  background: rgba(197, 160, 89, 0.06);
  border: 1px solid rgba(197, 160, 89, 0.2);
  border-radius: 4px;
  padding: 0.6rem 0.75rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-parchment);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  width: 100%;
  border-left: 3px solid transparent;
}
.inquest-card-item:hover {
  border-color: var(--color-gold);
  background: rgba(197, 160, 89, 0.12);
}
.inquest-card-item.selected {
  border-left-color: var(--color-gold);
  background: rgba(197, 160, 89, 0.18);
  color: #fff;
}
.inquest-card-item.correct {
  border-left-color: #4caf50;
  background: rgba(76, 175, 80, 0.12);
}
.inquest-card-item.wrong {
  border-left-color: var(--color-blood);
  background: rgba(139, 26, 26, 0.15);
  animation: cardShake 0.4s ease-in-out;
}

/* Low-sanity phantom flicker on scale organ image */
@keyframes phantomBeat {
  0%, 100% { transform: scale(1); filter: sepia(0.2) contrast(1.15) brightness(0.9); }
  50% { transform: scale(1.06); filter: sepia(0.5) contrast(1.3) brightness(1.1) hue-rotate(10deg); }
}
.pan-organ-image.phantom-beat {
  animation: phantomBeat 1.2s ease-in-out infinite;
}

/* Low-sanity vignette intensification */
.gaslight-overlay.sanity-critical {
  animation: gaslight-flicker 1.2s infinite alternate, criticalFlash 3.5s infinite;
}
@keyframes criticalFlash {
  0%, 90%, 100% { opacity: 1; }
  93% { opacity: 0.55; }
  96% { opacity: 0.9; }
}

@media (max-width: 600px) {
  .tod-sentence {
    flex-direction: column;
    align-items: flex-start;
  }
  .tod-select {
    width: 100%;
  }
}

/* Autopsy Hint Bar */
.autopsy-hint-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(90deg, rgba(15, 17, 22, 0.98) 0%, rgba(45, 36, 22, 0.98) 50%, rgba(15, 17, 22, 0.98) 100%);
  border-bottom: 2px solid var(--color-gold-muted);
  color: var(--color-gold);
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  padding: 0.6rem 1rem;
  z-index: 10;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .autopsy-hint-bar {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
  }
}

