/* THE CASE OF THE DRIFTING MODEL
 * Styling: 1940s noir, sepia highlights on a near-black ground, typewriter
 * body, dramatic display serif for case titles. Grain + vignette + smoke +
 * scanlines are layered overlays driven by SVG + CSS keyframes.
 */

:root {
  --ink: #0d0a07;
  --paper: #d8c8a8;
  --paper-dim: #b8a988;
  --sepia: #c9a063;
  --sepia-bright: #e0b977;
  --blood: #8a2a1f;
  --rule: rgba(216, 200, 168, 0.25);
  --shadow: 0 0 30px rgba(0, 0, 0, 0.9);
  --font-body: "Special Elite", "Courier New", monospace;
  --font-display: "Old Standard TT", "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.55;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

body.noir {
  background:
    radial-gradient(ellipse at top, #1a1410 0%, #050302 75%) fixed,
    var(--ink);
}

/* ============================================================ overlays */

.grain-svg {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  opacity: 0.18;
  z-index: 100;
  mix-blend-mode: overlay;
}

.vignette {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 101;
  background: radial-gradient(
    ellipse at center,
    transparent 40%,
    rgba(0, 0, 0, 0.75) 100%
  );
}

.scanlines {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 102;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 3px
  );
  opacity: 0.5;
}

.smoke {
  position: fixed;
  bottom: -10vh;
  left: 0;
  width: 100vw;
  height: 60vh;
  pointer-events: none;
  z-index: 99;
  overflow: hidden;
}

.smoke-puff {
  position: absolute;
  bottom: 0;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(220, 210, 190, 0.06) 0%,
    rgba(220, 210, 190, 0) 70%
  );
  filter: blur(20px);
  animation: drift 22s ease-in-out infinite;
}

.smoke-puff-a { left: 10%;  animation-delay: 0s;   }
.smoke-puff-b { left: 45%;  animation-delay: -7s;  width: 360px; height: 360px; }
.smoke-puff-c { left: 78%;  animation-delay: -14s; }

@keyframes drift {
  0%   { transform: translate(0, 20vh) scale(0.8); opacity: 0; }
  25%  { opacity: 1; }
  50%  { transform: translate(-30px, -10vh) scale(1.2); opacity: 0.7; }
  100% { transform: translate(40px, -50vh) scale(1.6); opacity: 0; }
}

/* ============================================================ stage / cards */

.stage {
  position: relative;
  z-index: 10;
  max-width: 880px;
  margin: 0 auto;
  padding: 60px 32px 80px;
  min-height: 100vh;
}

.audio-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
  background: transparent;
  color: var(--sepia);
  border: 1px solid var(--rule);
  font-family: var(--font-body);
  font-size: 12px;
  padding: 6px 12px;
  cursor: pointer;
  letter-spacing: 0.1em;
}

.audio-toggle:hover {
  color: var(--sepia-bright);
  border-color: var(--sepia);
}

.audio-toggle.on {
  color: var(--paper);
  border-color: var(--paper-dim);
}

/* ============================================================ title view */

.title-screen {
  text-align: center;
  padding-top: 8vh;
}

.title-screen h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 7vw, 5rem);
  letter-spacing: 0.04em;
  margin: 0 0 0.2em;
  color: var(--paper);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.6), 0 0 20px rgba(201, 160, 99, 0.15);
  line-height: 1.05;
}

.title-screen h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1rem, 2.2vw, 1.4rem);
  color: var(--sepia);
  margin: 0 0 2em;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.title-screen .by-line {
  color: var(--paper-dim);
  font-size: 14px;
  margin-bottom: 3em;
  letter-spacing: 0.1em;
}

.title-screen .narrator-block {
  max-width: 580px;
  margin: 0 auto 3em;
  font-size: 17px;
  color: var(--paper);
  text-align: left;
  min-height: 9em;
}

/* ============================================================ case file */

.case-cover {
  background: var(--paper);
  color: var(--ink);
  padding: 40px 44px 48px;
  margin: 40px 0;
  box-shadow: var(--shadow), inset 0 0 60px rgba(110, 80, 40, 0.25);
  position: relative;
  font-family: var(--font-body);
  transform: rotate(-0.5deg);
}

.case-cover::before {
  /* manila folder tab */
  content: "";
  position: absolute;
  top: -22px;
  left: 40px;
  width: 140px;
  height: 24px;
  background: var(--paper);
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  box-shadow: 0 -2px 6px rgba(0,0,0,0.4);
}

.case-cover::after {
  /* CONFIDENTIAL stamp */
  content: "CONFIDENTIAL";
  position: absolute;
  top: 24px;
  right: 28px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--blood);
  border: 2px solid var(--blood);
  padding: 4px 12px;
  letter-spacing: 0.2em;
  transform: rotate(8deg);
  opacity: 0.7;
}

.case-cover h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 0.4em;
  opacity: 0.7;
}

.case-cover h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin: 0 0 1em;
  letter-spacing: 0.02em;
}

.case-cover .case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  font-size: 14px;
  border-top: 1px solid rgba(13, 10, 7, 0.25);
  border-bottom: 1px solid rgba(13, 10, 7, 0.25);
  padding: 12px 0;
  margin: 1.2em 0;
}

.case-cover .case-meta span { opacity: 0.75; }

.case-cover .teaser {
  font-size: 17px;
  line-height: 1.6;
  min-height: 8em;
  font-style: italic;
}

.case-cover .evidence-frame {
  margin-top: 24px;
  border: 1px solid rgba(13, 10, 7, 0.4);
  background: #1a1410;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.case-cover .evidence-frame::before {
  content: "EVIDENCE";
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 10px;
  color: var(--sepia);
  letter-spacing: 0.2em;
  z-index: 2;
}

.case-cover .evidence-frame img {
  max-width: 100%;
  max-height: 100%;
  filter: grayscale(1) contrast(1.15) brightness(0.85) sepia(0.25);
}

.case-cover .evidence-frame .placeholder {
  /* CSS-only silhouette: the lit-up doorway look */
  width: 60%;
  height: 70%;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(255, 220, 160, 0.35) 0%, transparent 60%),
    linear-gradient(180deg, rgba(255, 220, 160, 0.18) 0%, transparent 100%);
  border: 1px solid rgba(255, 220, 160, 0.15);
  position: relative;
}

.case-cover .evidence-frame .placeholder::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 22%;
  height: 65%;
  background: rgba(13, 10, 7, 0.95);
  border-radius: 50% 50% 0 0 / 30% 30% 0 0;
}

/* ============================================================ clue view */

.clue-view {
  padding: 20px 0;
}

.clue-header {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 16px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--sepia);
  text-transform: uppercase;
}

.narrator {
  font-style: italic;
  color: var(--paper);
  margin: 12px 0 32px;
  font-size: 17px;
  line-height: 1.6;
  min-height: 3.5em;
  border-left: 2px solid var(--sepia);
  padding-left: 18px;
}

.narrator::before {
  content: "\201C";
  font-family: var(--font-display);
  font-size: 1.5em;
  color: var(--sepia);
  line-height: 0;
  position: relative;
  top: 0.15em;
  margin-right: 4px;
}

.narrator::after {
  content: "\201D";
  font-family: var(--font-display);
  font-size: 1.5em;
  color: var(--sepia);
  line-height: 0;
  position: relative;
  top: 0.4em;
  margin-left: 4px;
}

.cursor::after {
  content: "_";
  animation: blink 0.9s steps(1) infinite;
  color: var(--sepia);
  margin-left: 2px;
}

@keyframes blink {
  50% { opacity: 0; }
}

.prompt {
  font-size: 19px;
  line-height: 1.55;
  margin: 0 0 32px;
  color: var(--paper);
  white-space: pre-wrap;
}

.leads {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 0 32px;
}

.lead {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--paper);
  padding: 16px 20px;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.lead:hover:not(:disabled) {
  border-color: var(--sepia);
  background: rgba(201, 160, 99, 0.06);
}

.lead:disabled {
  cursor: default;
  opacity: 0.55;
}

.lead.chosen {
  border-color: var(--sepia-bright);
  background: rgba(201, 160, 99, 0.12);
  color: var(--sepia-bright);
  opacity: 1;
}

.lead .letter {
  display: inline-block;
  width: 28px;
  color: var(--sepia);
  font-weight: bold;
  margin-right: 6px;
}

.reveal {
  margin-top: 24px;
  padding: 18px 20px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-size: 17px;
  min-height: 4em;
  color: var(--paper);
  font-style: italic;
}

.reveal.right { color: var(--sepia-bright); }
.reveal.wrong { color: #c47a6a; }

.continue {
  display: block;
  margin: 32px auto 0;
  background: transparent;
  border: 1px solid var(--sepia);
  color: var(--sepia);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 10px 28px;
  letter-spacing: 0.2em;
  cursor: pointer;
  text-transform: uppercase;
}

.continue:hover {
  background: rgba(201, 160, 99, 0.1);
  color: var(--sepia-bright);
  border-color: var(--sepia-bright);
}

/* ============================================================ verdict / suspect */

.verdict {
  text-align: center;
  padding: 40px 0;
}

.verdict h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.2rem;
  letter-spacing: 0.08em;
  color: var(--paper);
  margin: 0 0 0.4em;
  text-transform: uppercase;
}

.verdict .verdict-line {
  font-style: italic;
  color: var(--sepia);
  margin: 0 0 2em;
  font-size: 18px;
}

.suspect-card {
  display: inline-block;
  margin: 24px auto;
  padding: 24px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
  max-width: 420px;
  transform: rotate(0.6deg);
}

.suspect-card .mugshot {
  width: 220px;
  height: 220px;
  background: #1a1410;
  margin: 0 auto 16px;
  border: 4px solid var(--ink);
  position: relative;
  overflow: hidden;
}

.suspect-card .mugshot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.15);
}

.suspect-card .mugshot .silhouette {
  /* fallback noir silhouette */
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 75%;
  background: var(--paper-dim);
  border-radius: 50% 50% 8% 8% / 40% 40% 5% 5%;
  opacity: 0.6;
}

.suspect-card .mugshot .silhouette::before {
  content: "";
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  width: 40%;
  height: 40%;
  background: var(--ink);
  border-radius: 50%;
}

.suspect-card .mugshot::after {
  /* height marks behind the suspect */
  content: "6'2\"   6'0\"   5'10\"   5'8\"";
  position: absolute;
  top: 4px;
  left: 0;
  right: 0;
  color: var(--paper);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-align: center;
  opacity: 0.35;
}

.suspect-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0 0 4px;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
}

.suspect-card .alias {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blood);
  margin-bottom: 12px;
}

.suspect-card .crime {
  font-style: italic;
  font-size: 15px;
  line-height: 1.5;
}

/* ============================================================ final report */

.final-report {
  text-align: center;
  padding: 40px 0;
}

.final-report h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.4rem;
  letter-spacing: 0.06em;
  color: var(--paper);
  margin: 0 0 0.4em;
  text-transform: uppercase;
}

.final-report .score-block {
  margin: 32px auto;
  font-size: 1.4rem;
  color: var(--sepia-bright);
  letter-spacing: 0.08em;
}

.final-report .score-block .big {
  font-family: var(--font-display);
  font-size: 4rem;
  display: block;
  line-height: 1;
  margin-bottom: 8px;
}

.final-report .per-week {
  max-width: 480px;
  margin: 24px auto;
  text-align: left;
  font-size: 14px;
  border-top: 1px solid var(--rule);
}

.final-report .per-week .row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  color: var(--paper);
}

.final-report .per-week .row .case-name {
  color: var(--paper-dim);
}

.final-report .narrator-block {
  font-style: italic;
  color: var(--sepia);
  max-width: 580px;
  margin: 32px auto;
  min-height: 4em;
  font-size: 17px;
}

.export-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* ============================================================ utility */

.fade-in {
  animation: fadein 0.6s ease-in;
}

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