/* The corkboard, pinned papers, clue slots, and the rail of tools along the bottom. */

.board {
  position: absolute;
  inset: 0 0 116px 0;
  border: 18px solid var(--frame);
  border-radius: 6px;
  background-image:
    var(--noise),
    radial-gradient(circle at 20% 30%, rgba(0, 0, 0, 0.12) 0 1px, transparent 2px),
    radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.05) 0 1px, transparent 2px);
  background-size: 220px 220px, 9px 9px, 13px 13px;
  background-color: var(--cork);
  box-shadow:
    inset 0 0 0 2px var(--frame-light),
    inset 0 0 80px rgba(10, 6, 16, 0.7),
    0 24px 60px rgba(0, 0, 0, 0.7);
}

/* The desk lamp: a pool of light in the middle, falling off to dark edges. */
.lamp {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background:
    radial-gradient(ellipse 50% 55% at 50% 38%, var(--lamp), transparent 70%),
    radial-gradient(ellipse 75% 80% at 50% 42%, transparent 55%, rgba(8, 5, 14, 0.62) 100%);
}

/* ---- Pinned items ---- */

.pin-item {
  position: absolute;
  transform: rotate(var(--rot, 0deg));
  filter: drop-shadow(2px 7px 6px rgba(0, 0, 0, 0.55));
}

.pushpin {
  position: absolute;
  top: -7px;
  left: 50%;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f2b8c2 0 2px, var(--red) 5px, var(--red-dark) 100%);
  box-shadow: 1px 3px 3px rgba(0, 0, 0, 0.5);
  z-index: 2;
}

.card-label {
  font-family: var(--font-type);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
}

/* Newspaper clipping */
.clipping {
  width: 548px;
  padding: 18px 24px 26px;
  color: #29272d;
  background-image:
    var(--news-grain),
    var(--news-mottle),
    radial-gradient(rgba(31, 27, 38, 0.07) 0.6px, transparent 0.9px),
    linear-gradient(175deg, #d9d7d3, #c5c2bd);
  background-size: 160px 160px, 400px 400px, 3px 3px, auto;
  clip-path: polygon(
    0 1%, 8% 0, 17% 1.2%, 29% 0.2%, 41% 1%, 55% 0, 68% 1.1%, 80% 0.3%, 92% 1%, 100% 0,
    99.4% 30%, 100% 62%, 99.5% 100%, 88% 99%, 75% 100%, 63% 98.8%, 50% 99.8%, 37% 98.9%,
    24% 100%, 12% 99%, 0 100%, 0.5% 60%, 0 25%
  );
}
.masthead {
  font-family: var(--font-news);
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
  padding-bottom: 6px;
  border-bottom: 3px double var(--ink);
}
.headline {
  margin: 10px 0 6px;
  font-family: var(--font-news);
  font-weight: 900;
  font-size: 31px;
  line-height: 1.05;
  text-transform: uppercase;
  text-align: center;
}
.dateline {
  font-family: var(--font-type);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-align: center;
  color: var(--ink-soft);
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(31, 27, 38, 0.4);
}
.story {
  columns: 2;
  column-gap: 22px;
  column-rule: 1px solid rgba(31, 27, 38, 0.25);
  font-size: 12.5px;
  line-height: 1.55;
  text-align: justify;
  hyphens: auto;
}
.story p { margin: 0 0 6px; text-indent: 1.2em; }
.story p:first-child { text-indent: 0; }
.story p:first-child::first-letter {
  float: left;
  font-family: var(--font-news);
  font-weight: 900;
  font-size: 40px;
  line-height: 0.85;
  padding: 4px 6px 0 0;
}

/* Suspect cards: portrait beside the name, then the description and their typed statement. */
.suspect {
  width: 236px;
  padding: 10px 12px 12px;
  border-radius: 2px;
}
.suspect-top { display: flex; gap: 10px; align-items: flex-end; }
.portrait {
  flex: none;
  width: 52px;
  height: 62px;
  border: 3px solid #f6f2ea;
  outline: 1px solid rgba(31, 27, 38, 0.3);
  background: radial-gradient(ellipse at 50% 30%, #8e8899, #3b3742 70%);
  filter: contrast(1.1);
}
.portrait svg { display: block; width: 100%; height: 100%; }
.suspect-heading .card-label { font-size: 10px; letter-spacing: 0.16em; }
.suspect-name {
  margin: 3px 0 0;
  font-family: var(--font-news);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.1;
}
.suspect-role {
  margin-top: 3px;
  font-family: var(--font-type);
  font-size: 10.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--purple);
}
.suspect-desc {
  margin: 7px 0 0;
  font-family: var(--font-type);
  font-size: 11px;
  line-height: 1.3;
}
/* The statement, typed on a slip clipped to the card. */
.suspect-statement {
  margin: 8px -4px 0;
  padding: 6px 8px 7px;
  background: #f6f2ea;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  border-left: 3px solid var(--purple);
  font-family: var(--font-type);
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink);
}

/* Motive index cards: ruled lines with a red header rule. */
.motive {
  width: 172px;
  min-height: 74px;
  padding: 9px 14px 10px;
  background-image:
    linear-gradient(to bottom, transparent 22px, var(--red) 22px, var(--red) 23.5px, transparent 23.5px),
    repeating-linear-gradient(to bottom, transparent 0 21px, rgba(47, 90, 168, 0.28) 21px 22px),
    var(--noise),
    linear-gradient(170deg, #f4f0e8, var(--paper-shade));
}
.motive-text {
  margin: 8px 0 0;
  font-family: var(--font-type);
  font-size: 14px;
  line-height: 22px;
}

/* Each suspect card lifts on hover; clicking it brings the statement up close. */
.pin-suspect { cursor: pointer; transition: transform 0.15s; }
.pin-suspect:hover { transform: rotate(var(--rot, 0deg)) translateY(-3px); }

.suspect { position: relative; }

/* Weapon cards: evidence tags with a punched hole. */
.weapon {
  position: relative;
  width: 232px;
  padding: 10px 14px 12px 40px;
  border-radius: 3px 14px 14px 3px;
  background-image: var(--noise), linear-gradient(170deg, #e8e2ec, #d3ccd8);
}
.tag-hole {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--cork-dark);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6), 0 0 0 3px rgba(239, 233, 221, 0.9);
}
.weapon-name {
  margin: 3px 0 2px;
  font-family: var(--font-news);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.1;
}
.weapon-detail {
  font-family: var(--font-type);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--purple);
}

/* The photograph, with the pencil scrawl in its margin. */
.photo {
  margin: 0;
  width: 224px;
  padding: 11px 11px 10px;
  background: #f3f0ea;
}
.photo-image {
  height: 150px;
  border: 1px solid rgba(31, 27, 38, 0.4);
  filter: grayscale(1) contrast(1.15);
}
.photo-image svg { display: block; width: 100%; height: 100%; }
.photo-caption {
  margin-top: 6px;
  font-family: var(--font-type);
  font-size: 12px;
  color: var(--ink-soft);
}
/* Pencil handwriting, shared by the scrawl and every decoy note so none of them stands out. */
.hand {
  font-family: var(--font-hand);
  font-size: 19px;
  line-height: 1;
  letter-spacing: 0.06em;
  color: var(--pencil);
  white-space: nowrap;
}
.scrawl {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  overflow: hidden;
}
/* Pencil on a photo or a handwritten scrap: slanted, like everything else written by hand. */
.scrawl.hand { transform: rotate(-2.5deg); transform-origin: left center; }
/* Typed or printed: one more straight line of the document, in the same ink. */
.scrawl.typed,
.scrawl.print { margin-top: 3px; white-space: nowrap; font: inherit; color: inherit; letter-spacing: inherit; }
.scrawl.typed .doodle,
.scrawl.print .doodle { width: 10px; height: 12px; stroke-width: 2; }
.doodle {
  flex: none;
  width: 12px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

/* Decoy scraps of evidence. */
.evidence { position: relative; padding: 8px 12px 10px; }
.evidence-label {
  font-family: var(--font-type);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.evidence-note { margin-top: 6px; white-space: normal; transform: rotate(-1.5deg); transform-origin: left center; }

.evidence-matchbook {
  width: 176px;
  padding-top: 0;
  border-radius: 3px;
}
.evidence-matchbook .evidence-label {
  margin: 0 -12px;
  padding: 10px 12px 9px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(160deg, var(--red), var(--red-dark));
  color: var(--paper);
  font-family: var(--font-news);
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-align: center;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25);
}

.evidence-ticket {
  width: 218px;
  border-left: 3px dotted rgba(31, 27, 38, 0.45);
  background-image: var(--noise), linear-gradient(170deg, #e9e3ec, #d4cdd8);
}

.evidence-prescription { width: 196px; padding-left: 40px; }

/* Typed notes (telegrams, receipts) sit straight; handwritten ones keep their slant. */
.evidence-note.typed {
  transform: none;
  font-family: var(--font-type);
  font-size: 12.5px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--ink);
}

/* A telegram: a pale form with a printed band and pasted-on typed strips. */
.evidence-telegram {
  width: 224px;
  padding-top: 0;
  background-image: var(--noise), linear-gradient(170deg, #e7e4ec, #d2cdd9);
}
.evidence-telegram .evidence-label {
  margin: 0 -12px 6px;
  padding: 6px 12px;
  border-bottom: 2px solid var(--purple);
  font-family: var(--font-news);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--purple);
}
.evidence-telegram .evidence-note { text-transform: uppercase; background: rgba(255, 255, 255, 0.45); padding: 3px 5px; }

/* A letter: ruled writing paper, ink instead of pencil. */
.evidence-letter {
  width: 220px;
  background-image:
    repeating-linear-gradient(to bottom, transparent 0 19px, rgba(47, 90, 168, 0.22) 19px 20px),
    var(--noise),
    linear-gradient(170deg, #f3efe7, var(--paper-shade));
}
.evidence-letter .evidence-note { color: #2b2850; font-size: 20px; line-height: 20px; }

/* A calling card: small, white, with an engraved name. */
.evidence-card {
  width: 196px;
  padding: 12px 14px;
  border-radius: 2px;
  background-image: var(--noise), linear-gradient(170deg, #fbf8f2, #e9e4da);
  text-align: center;
}
.evidence-card .evidence-label {
  font-family: var(--font-news);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--ink);
  border-bottom: 1px solid rgba(31, 27, 38, 0.3);
  padding-bottom: 6px;
}

/* A receipt: narrow, with a torn bottom edge and a dotted rule. */
.evidence-receipt {
  width: 176px;
  padding-bottom: 14px;
  background-image: var(--noise), linear-gradient(175deg, #f1eee8, #dcd7cf);
  clip-path: polygon(0 0, 100% 0, 100% 94%, 92% 100%, 84% 95%, 76% 100%, 68% 95%, 60% 100%, 52% 95%, 44% 100%, 36% 95%, 28% 100%, 20% 95%, 12% 100%, 4% 95%, 0 100%);
}
.evidence-receipt .evidence-label { text-align: center; padding-bottom: 5px; border-bottom: 1px dashed rgba(31, 27, 38, 0.45); }

/* A tag: a card with a punched, reinforced hole. */
.evidence-tag {
  width: 196px;
  padding-left: 36px;
  border-radius: 3px 12px 12px 3px;
  background-image: var(--noise), linear-gradient(170deg, #dcd6e2, #c4bccd);
}
.rx {
  position: absolute;
  left: 10px;
  top: 6px;
  font-family: var(--font-news);
  font-size: 26px;
  color: var(--ink);
}

/* Things worth a closer look. The scrawl and the decoys share one cursor, so none stands out. */
.scrawl,
.pin-evidence { cursor: zoom-in; }
.scrawl .blot { font-size: 15px; }

/* The blank card: a ruled index card waiting for a decoded message. */
.blank-card {
  width: 270px;
  min-height: 110px;
  padding: 10px 14px 12px;
  cursor: pointer;
  background-image:
    linear-gradient(to bottom, transparent 24px, var(--red) 24px, var(--red) 25.5px, transparent 25.5px),
    repeating-linear-gradient(to bottom, transparent 0 20px, rgba(47, 90, 168, 0.28) 20px 21px),
    var(--noise),
    linear-gradient(170deg, #f4f0e8, var(--paper-shade));
}
.blank-card .card-label { color: var(--purple); }
.blank-card-hint {
  margin: 10px 0 0;
  font-family: var(--font-hand);
  font-size: 21px;
  line-height: 21px;
  color: var(--pencil);
}
.decoded-text {
  margin: 8px 0 0;
  font-family: var(--font-type);
  font-size: 13px;
  line-height: 21px;
}
.decoded-text .blot { font-size: 11px; }
.just-pinned { animation: pin-up 0.45s cubic-bezier(0.2, 0.8, 0.3, 1.2); }
@keyframes pin-up { from { transform: translateY(-30px) rotate(-12deg) scale(1.15); opacity: 0; } }

/* Clues pinned after wrong guesses. */
.clue { width: 212px; min-height: 118px; padding: 9px 12px 10px; }
.pin-clue { cursor: zoom-in; }
.clue-text {
  margin: 5px 0 0;
  font-family: var(--font-type);
  font-size: 11.5px;
  line-height: 1.35;
}

/* Empty spots where clues will be pinned. */
.clue-slot {
  position: absolute;
  width: 212px;
  height: 118px;
  display: grid;
  place-items: center;
  transform: rotate(var(--rot, 0deg));
  border: 2px dashed rgba(239, 233, 221, 0.22);
  border-radius: 3px;
  font-family: var(--font-type);
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(239, 233, 221, 0.3);
}
/* An empty slot is only an outline on the cork: it sits under every card and never takes the
   pointer, so a card moved over it can still be hovered, clicked, and dragged. */
.clue-slot { z-index: 0; pointer-events: none; }
.pin-item { z-index: 1; }

/* ---- The rail: tools at the bottom edge ---- */

.rail {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 104px;
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 0 36px;
  border-radius: 6px;
  background: linear-gradient(#2c2232, #18121c);
  border-top: 2px solid var(--frame-light);
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.5);
}

.rail-group { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rail-label {
  font-family: var(--font-type);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(239, 233, 221, 0.55);
}

.help-button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid rgba(239, 233, 221, 0.5);
  background: transparent;
  color: var(--paper);
  font-family: var(--font-news);
  font-weight: 900;
  font-size: 26px;
  cursor: pointer;
}
.help-button:hover { border-color: var(--paper); background: rgba(107, 63, 160, 0.35); }

.tray {
  display: flex;
  gap: 18px;
  padding: 6px 16px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.7);
}

/* Rubber stamps: knob, block, and an inked face. */
.stamp {
  position: relative;
  width: 112px;
  height: 64px;
}
.stamp-knob {
  position: absolute;
  left: 50%;
  top: 0;
  width: 28px;
  height: 26px;
  margin-left: -14px;
  border-radius: 50% 50% 40% 40%;
  background: radial-gradient(circle at 40% 30%, #6a5a70, #251c29 75%);
}
.stamp-block {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 22px;
  height: 14px;
  border-radius: 3px;
  background: linear-gradient(#4b3c50, #2a202e);
}
.stamp-face {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 0;
  height: 26px;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 2px;
  background: var(--paper);
  font-family: var(--font-type);
  font-size: 15px;
  letter-spacing: 0.18em;
}
.stamp-guilty .stamp-face { color: var(--red); }
.stamp-liar .stamp-face { color: var(--purple); }


/* Guesses left: five cartridge bases. */
.guess-row { display: flex; gap: 6px; }
.guess { display: flex; flex-direction: column; align-items: center; width: 34px; }
.detective { width: 34px; height: 34px; }
.detective-hat,
.detective-face { fill: var(--paper); }
.detective-shadow { fill: #3a3342; }
.detective-band { fill: var(--red); }
.guess-count {
  min-height: 13px;
  font-family: var(--font-type);
  font-size: 11px;
  line-height: 13px;
  color: var(--paper);
}
/* A spent guess fades to a faint outline, its count of right parts underneath. */
.guess.spent .detective { opacity: 0.28; }
.guess.spent .detective-band { fill: var(--paper); }

.case-tag { margin-left: auto; text-align: right; }
.case-number {
  font-family: var(--font-type);
  font-size: 13px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #ec8d9c;
}
.case-title {
  font-family: var(--font-news);
  font-weight: 900;
  font-size: 26px;
  line-height: 1.1;
  color: var(--paper);
  white-space: nowrap;
}

/* Red string: over the cards, under the lamp's shading. Only the string itself takes clicks. */
.string-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 40;
  overflow: visible;
  pointer-events: none;
  /* Its own compositing layer, so a moving string never makes the cards underneath repaint. */
  will-change: transform;
}
.string { pointer-events: stroke; cursor: pointer; }
.string-hit { fill: none; stroke: transparent; stroke-width: 14; }
.string-shadow {
  fill: none;
  stroke: rgba(8, 5, 14, 0.45);
  stroke-width: 3;
  stroke-linecap: round;
  transform: translate(1.5px, 3.5px);
}
.string-line {
  fill: none;
  stroke: var(--red);
  stroke-width: 2.5;
  stroke-linecap: round;
}
.string:hover .string-line { stroke: var(--red-dark); stroke-dasharray: 6 4; }
.stage.drawing-string .string { pointer-events: none; }

.pin-item.string-first > .pushpin { box-shadow: 0 0 0 4px var(--paper), 0 0 12px 4px var(--red); }

/* Drawing a string by dragging: a dashed thread follows the pointer, and the card under it lights up. */
.string-line.string-preview { stroke-dasharray: 7 5; }
.stage.drawing-string,
.stage.drawing-string .pin-item { cursor: crosshair; }
.pin-item.string-target > .pushpin { box-shadow: 0 0 0 4px var(--paper), 0 0 12px 4px var(--red); }
.pin-item { user-select: none; -webkit-user-select: none; }

/* Hovering a pin shows a loose end of red thread on it: pull from here to tie string. A wider,
   invisible ring round the pin makes it easier to catch. */
.pushpin { cursor: crosshair; }
.pushpin::before { content: ""; position: absolute; inset: -11px; border-radius: 50%; }
.pin-item > .pushpin::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  width: 44px;
  height: 58px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 46'><path d='M6 4 C 14 10, 6 18, 16 24 S 30 30, 26 40' fill='none' stroke='%23b3263a' stroke-width='2.6' stroke-linecap='round'/></svg>") no-repeat center / contain;
  opacity: 0;
  transform: rotate(-10deg) scale(0.6);
  transform-origin: top left;
  transition: opacity 0.15s, transform 0.2s;
  pointer-events: none;
}
.pushpin:hover::after,
.pin-item.string-first > .pushpin::after {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
.stage.holding .pushpin:hover::after,
.stage.marking .pushpin:hover::after,
.stage.drawing-string .pin-item:not(.string-first) > .pushpin::after { opacity: 0; }

/* At the cap, a short note says why no new string was tied. */
.string-note {
  position: absolute;
  left: 50%;
  bottom: 124px;
  z-index: 95;
  padding: 8px 16px;
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-type);
  font-size: 15px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.string-note.shown { opacity: 1; transform: translate(-50%, 0); }


/* ---- More kinds of evidence ---- */

/* A classified ad clipped from the paper: small print in a ruled box. */
.evidence-classified {
  width: 200px;
  padding: 8px 10px;
  border: 1px solid rgba(31, 27, 38, 0.55);
  background-image: var(--news-grain), linear-gradient(175deg, #d9d7d3, #c5c2bd);
  background-size: 160px 160px, auto;
}
.evidence-classified .evidence-label {
  font-family: var(--font-news);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-align: center;
  color: var(--ink);
  border-bottom: 1px solid rgba(31, 27, 38, 0.5);
  padding-bottom: 4px;
}
.evidence-classified .evidence-note.typed { font-family: var(--font-story); font-size: 11.5px; letter-spacing: 0; text-align: justify; }

/* An envelope: address in ink, a stamp and a round postmark in the corner. */
.evidence-envelope {
  width: 230px;
  min-height: 104px;
  padding: 12px 14px 12px;
  background-image: var(--noise), linear-gradient(170deg, #ece6dc, #d8d1c5);
}
.evidence-envelope .evidence-label { width: 120px; font-size: 10px; }
.evidence-envelope .evidence-note { margin-top: 20px; padding-left: 26px; color: #2b2850; }
.postage {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 26px;
  height: 32px;
  background: var(--purple);
  outline: 2px dotted #ece6dc;
  outline-offset: -3px;
}
.postmark {
  position: absolute;
  top: 12px;
  right: 30px;
  width: 38px;
  height: 38px;
  border: 2px solid rgba(31, 27, 38, 0.45);
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px transparent, 18px 0 0 -16px rgba(31, 27, 38, 0.45);
}

/* A typed report or memo: carbon-copy blue type under a heading rule. */
.evidence-report {
  width: 240px;
  background-image: var(--noise), linear-gradient(175deg, #eceaf0, #d7d3de);
}
.evidence-report .evidence-label { border-bottom: 2px solid rgba(31, 27, 38, 0.6); padding-bottom: 4px; color: var(--ink); }
.evidence-report .evidence-note.typed { color: #2c3f74; }

/* A ledger or register page: ruled rows. */
.evidence-ledger {
  width: 236px;
  background-image: var(--noise), linear-gradient(170deg, #efe9dd, #dcd4c6);
}
.evidence-ledger .evidence-label { color: var(--red); }
.ledger-row { padding: 2px 0; border-bottom: 1px solid rgba(47, 90, 168, 0.35); }

/* A bank slip: a printed form with a tinted band. */
.evidence-slip {
  width: 214px;
  padding-top: 0;
  background-image: var(--noise), linear-gradient(170deg, #e4e6ef, #cdd1df);
}
.evidence-slip .evidence-label {
  margin: 0 -12px 6px;
  padding: 5px 12px;
  background: rgba(47, 90, 168, 0.18);
  color: var(--blue);
  letter-spacing: 0.16em;
}

/* A punched stub: perforated left edge and two punch holes. */
.evidence-stub {
  width: 196px;
  padding-left: 22px;
  padding-right: 44px;
  border-left: 3px dotted rgba(31, 27, 38, 0.5);
  background-image: var(--noise), linear-gradient(170deg, #e6e1ea, #cfc8d6);
}
.stub-holes { position: absolute; right: 10px; top: 8px; display: flex; gap: 6px; }
.stub-holes span { width: 9px; height: 9px; border-radius: 50%; background: var(--cork-dark); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6); }

/* A fingerprint card: two inked prints above a typed caption. */
.evidence-fingerprint { width: 200px; background-image: var(--noise), linear-gradient(170deg, #f4f1ea, #e1dbd0); }
.prints { display: flex; justify-content: center; gap: 16px; color: #26222e; margin-bottom: 4px; }
.prints svg { width: 34px; height: 42px; }
.evidence-fingerprint .evidence-label { text-align: center; }

/* A key on a tag: an iron key drawn beside the tag's hole. */
.evidence-key {
  width: 200px;
  padding-left: 36px;
  border-radius: 3px 12px 12px 3px;
  background-image: var(--noise), linear-gradient(170deg, #dcd6e2, #c4bccd);
}
.key-art { display: block; width: 80px; height: 24px; margin: 0 0 4px; fill: none; stroke: #3b3742; stroke-width: 3; stroke-linecap: round; }

/* The newspaper's personals line, where a code can hide in the clipping itself. */
.personals {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(31, 27, 38, 0.4);
  font-family: var(--font-story);
  font-size: 12px;
}
.personals-label {
  flex: none;
  font-family: var(--font-news);
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* The case's mark, tucked in a corner of the paper that hides the code. */
.paper-doodle { position: absolute; z-index: 1; color: var(--pencil); opacity: 0.85; pointer-events: none; }
.paper-doodle .doodle { width: 16px; height: 18px; }
.paper-doodle.top-right { top: 6px; right: 8px; transform: rotate(8deg); }
.paper-doodle.bottom-right { bottom: 5px; right: 8px; transform: rotate(-6deg); }
.paper-doodle.bottom-left { bottom: 5px; left: 8px; transform: rotate(5deg); }
.evidence-telegram .paper-doodle, .evidence-report .paper-doodle, .evidence-ledger .paper-doodle,
.evidence-classified .paper-doodle, .evidence-slip .paper-doodle, .evidence-stub .paper-doodle,
.evidence-receipt .paper-doodle, .evidence-fingerprint .paper-doodle { color: var(--ink); opacity: 0.7; }
.photo-image { position: relative; }
.photo-image .paper-doodle { color: rgba(239, 233, 221, 0.75); }
.dateline .paper-doodle { position: static; display: inline-block; margin-left: 8px; vertical-align: middle; color: var(--ink); }
.dateline .paper-doodle .doodle { width: 12px; height: 13px; }

/* ---- Moving cards ---- */

/* Cards without their own click can be picked up and moved by their paper. */
.pin-clipping, .pin-motive, .pin-weapon, .pin-photo { cursor: grab; }
.pin-item.moving {
  transform: rotate(var(--rot, 0deg)) scale(1.03);
  filter: drop-shadow(5px 18px 12px rgba(0, 0, 0, 0.6));
}
.stage.moving-card,
.stage.moving-card * { cursor: grabbing !important; }
.pin-item.lifting { transform: rotate(var(--rot, 0deg)) scale(1.03); }

/* ---- The player's notes: index cards, the notepad, and the rail tools ---- */

.index-card {
  width: 170px;
  min-height: 104px;
  padding: 18px 12px 10px;
  background:
    linear-gradient(var(--red) 0 0) 0 16px / 100% 1px no-repeat,
    repeating-linear-gradient(transparent 0 21px, rgba(47, 90, 168, 0.35) 21px 22px) 0 16px / 100% calc(100% - 16px) no-repeat,
    #f6f2ea;
}
.pin-note { cursor: grab; }
.index-text {
  margin: 0;
  font-family: var(--font-hand);
  font-size: 23px;
  line-height: 22px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.desk-tools { display: flex; align-items: flex-end; gap: 14px; height: 52px; margin-bottom: 8px; }

/* A short stack of blank index cards; the top one lifts on hover. */
.card-stack {
  position: relative;
  width: 58px;
  height: 40px;
  border: 0;
  background: #f6f2ea;
  box-shadow: 2px 2px 0 #d9d2c4, 4px 4px 0 #c9c1b2, 0 6px 10px rgba(0, 0, 0, 0.45);
  border-top: 3px solid var(--red);
  cursor: pointer;
  transition: transform 0.15s;
}
.card-stack::after {
  content: "+";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-hand);
  font-size: 30px;
  color: var(--ink-soft);
}
.card-stack:hover:not(:disabled) { transform: translateY(-4px) rotate(-3deg); }
.card-stack:disabled { opacity: 0.35; cursor: default; }

.notepad-button {
  position: relative;
  width: 40px;
  height: 52px;
  border: 0;
  border-top: 7px solid #2a2232;
  background: var(--paper);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: transform 0.15s;
}
.notepad-button:hover { transform: translateY(-4px) rotate(2deg); }
.notepad-lines {
  position: absolute;
  inset: 8px 6px 6px;
  background: repeating-linear-gradient(transparent 0 6px, rgba(47, 90, 168, 0.45) 6px 7px);
}

/* Two grease pencils standing in a cup; the one in hand rises. */
/* The pencils stay in reach above an open card, so the player can mark what they're reading. */
.rail-group.pencils { position: relative; }
.rail-group.desk { position: relative; }
.stage:has(.overlay :is(.statement-open, .close-look, .clue-open, .blank-card-open)) :is(.rail-group.pencils, .rail-group.desk) { z-index: 101; }
.notepad-button.open { transform: translateY(-6px); box-shadow: 0 0 0 3px var(--paper), 0 6px 10px rgba(0, 0, 0, 0.45); }
.pencil-cup { display: flex; align-items: flex-end; gap: 8px; height: 52px; }
.pencil {
  position: relative;
  width: 12px;
  height: 50px;
  border: 0;
  padding: 0;
  border-radius: 2px 2px 3px 3px;
  cursor: pointer;
  transition: transform 0.15s;
}
.pencil::before {
  content: "";
  position: absolute;
  left: 0;
  top: -9px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 10px solid var(--tip);
}
.pencil-red { background: var(--red); --tip: var(--red-dark); }
.pencil-blue { background: var(--blue); --tip: #1d3c74; }
.pencil:hover { transform: translateY(-4px); }
.pencil.lifted { transform: translateY(-14px) rotate(-8deg); box-shadow: 0 0 0 3px var(--paper); }

/* ---- Pencil marks ---- */

.stage.marking :is(.story, .suspect-desc, .suspect-statement, .clue-text, .decoded-text, .revealed, .evidence-note, .statement-desc, .statement-quote, .close-look-note:not(.close-look-code)) {
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
}
/* With a pencil in hand, the pointer is that pencil, tip at the point. */
.stage.marking-red, .stage.marking-red * { cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'><path d='M7 21 L21 7 L25 11 L11 25 Z' fill='%23b3263a' stroke='%231f1b26' stroke-width='1.2'/><path d='M7 21 L11 25 L3 27 Z' fill='%23efe9dd' stroke='%231f1b26' stroke-width='1.2'/><path d='M3 27 L4.6 23.2 L6.8 25.4 Z' fill='%23b3263a'/><path d='M21 7 L23 5 L27 9 L25 11 Z' fill='%23efe9dd' stroke='%231f1b26' stroke-width='1.2'/></svg>") 3 27, crosshair !important; }
.stage.marking-blue, .stage.marking-blue * { cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'><path d='M7 21 L21 7 L25 11 L11 25 Z' fill='%232f5aa8' stroke='%231f1b26' stroke-width='1.2'/><path d='M7 21 L11 25 L3 27 Z' fill='%23efe9dd' stroke='%231f1b26' stroke-width='1.2'/><path d='M3 27 L4.6 23.2 L6.8 25.4 Z' fill='%232f5aa8'/><path d='M21 7 L23 5 L27 9 L25 11 Z' fill='%23efe9dd' stroke='%231f1b26' stroke-width='1.2'/></svg>") 3 27, crosshair !important; }
.stage.marking-red ::selection { background: rgba(179, 38, 58, 0.3); }
.stage.marking-blue ::selection { background: rgba(47, 90, 168, 0.3); }
.pencil-mark {
  color: inherit;
  background: linear-gradient(transparent 60%, var(--mark) 60% 90%, transparent 90%);
  border-radius: 2px;
}
.pencil-mark.mark-red { --mark: rgba(179, 38, 58, 0.45); }
.pencil-mark.mark-blue { --mark: rgba(47, 90, 168, 0.42); }
.stage.marking .pencil-mark { cursor: pointer; }
