/* The Castelain File
   A corkboard you can pan, with clues that open under a desk lamp.
   Fonts: Courier Prime, Caveat, Oswald, Old Standard TT (SIL Open Font License, see /fonts). */

@font-face { font-family: "Courier Prime"; src: url("/case/fonts/courier-prime-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("/case/fonts/courier-prime-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("/case/fonts/courier-prime-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("/case/fonts/caveat-latin-500-normal.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Oswald"; src: url("/case/fonts/oswald-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Oswald"; src: url("/case/fonts/oswald-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Old Standard TT"; src: url("/case/fonts/old-standard-tt-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Old Standard TT"; src: url("/case/fonts/old-standard-tt-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Old Standard TT"; src: url("/case/fonts/old-standard-tt-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

/* Clue positions are registered so that moving one clue does not restyle its children. */
@property --x { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --y { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --r { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

:root {
  color-scheme: light;
  --bar: 56px;
  --desk: #1b130d;
  --ink: #1f1a14;
  --ink-soft: #5b4f40;
  --paper: #f6efdf;
  --paper-white: #fcfaf3;
  --red: #b4232b;
  --red-deep: #8e1118;
  --blue-ink: #22408f;
  --f-type: "Courier Prime", "Courier New", Courier, monospace;
  --f-hand: "Caveat", "Bradley Hand", "Segoe Print", cursive;
  --f-head: "Oswald", "Arial Narrow", "Roboto Condensed", sans-serif;
  --f-news: "Old Standard TT", Georgia, "Times New Roman", serif;

  /* Small tiles of SVG noise: rendered once, then repeated. */
  --grain-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='2' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .26 0 0 0 0 .15 0 0 0 0 .06 0 0 0 2 -.9'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23a)'/%3E%3C/svg%3E");
  --grain-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='230' height='230'%3E%3Cfilter id='b'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='1' seed='8' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .95 0 0 0 0 .82 0 0 0 0 .62 0 0 0 2.6 -1.5'/%3E%3C/filter%3E%3Crect width='230' height='230' filter='url(%23b)'/%3E%3C/svg%3E");
  --paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='5' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .26 0 0 0 0 .18 0 0 0 .5 -.19'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23p)'/%3E%3C/svg%3E");
  --stamp-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -3 2.5'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23m)'/%3E%3C/svg%3E");
  --loupe-cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ccircle cx='12' cy='12' r='8.5' fill='rgba(255,250,235,.35)' stroke='%23111' stroke-width='3'/%3E%3Ccircle cx='12' cy='12' r='8.5' fill='none' stroke='%23f6efdf' stroke-width='1'/%3E%3Cpath d='M18.5 18.5 28 28' stroke='%23111' stroke-width='5' stroke-linecap='round'/%3E%3Cpath d='M18.5 18.5 27 27' stroke='%238a5a2b' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") 12 12;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--desk);
  color: var(--ink);
  font: 16px/1.55 var(--f-type);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body.view-summary { overflow: auto; overflow-x: hidden; }

img { max-width: 100%; }

::selection { background: rgba(255, 214, 74, 0.6); color: inherit; }

.skip {
  position: fixed;
  left: 12px;
  top: 8px;
  z-index: 60;
  padding: 8px 14px;
  background: var(--paper);
  color: var(--ink);
  font: 700 14px/1.2 var(--f-type);
  transform: translateY(-160%);
}
.skip:focus { transform: none; outline: 3px solid #ffd34d; }

/* ---------- Desk bar ---------- */

.deskbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: var(--bar);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  background: linear-gradient(#24190f, #150e09);
  border-bottom: 1px solid #000;
  color: #eadcc2;
}

.deskbar p { margin: 0; }

.deskbar-case { display: flex; align-items: baseline; gap: 12px; min-width: 0; overflow: hidden; white-space: nowrap; }
.case-no { font: 700 15px/1 var(--f-head); letter-spacing: 0.14em; text-transform: uppercase; color: #ffd9a8; }
.case-name { font: 400 14px/1 var(--f-type); color: #bfae92; overflow: hidden; text-overflow: ellipsis; }

.deskbar-progress {
  margin-left: auto !important;
  display: flex;
  align-items: center;
  gap: 4px;
  font: 14px/1 var(--f-type);
  color: #eadcc2;
  white-space: nowrap;
}
.deskbar-progress b { font-weight: 700; color: #fff3df; }
.progress-label { margin-right: 4px; color: #bfae92; }
.progress-bar {
  position: relative;
  display: block;
  width: 70px;
  height: 6px;
  margin-left: 10px;
  overflow: hidden;
  border-radius: 3px;
  background: #3a2a1d;
}
#progress-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #c2242c, #ff5a4f);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.5s ease;
}

.deskbar-tools { display: flex; gap: 6px; }

.tool {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #4a3725;
  border-radius: 6px;
  background: #2b1f15;
  color: #eadcc2;
  cursor: pointer;
}
.tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.tool:hover { background: #3a2a1c; color: #fff; }
.tool:focus-visible,
.summary-link:focus-visible,
.board-link:focus-visible { outline: 3px solid #ffd34d; outline-offset: 2px; }

.summary-link,
.board-link {
  flex: none;
  padding: 9px 14px 8px;
  border-radius: 4px;
  background: var(--red);
  color: #fff4e6;
  font: 700 14px/1 var(--f-head);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18);
}
.summary-link:hover,
.board-link:hover { background: #cf2d35; }
.summary-sub { text-transform: none; letter-spacing: 0.02em; font-weight: 500; }
.board-link { display: none; }

body.view-summary .summary-link,
body.view-summary .deskbar-tools { display: none; }
body.view-summary .board-link { display: inline-block; }

/* ---------- Board ---------- */

.board-view {
  position: fixed;
  top: var(--bar);
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 40%, #2f2116 0%, #1b130d 60%, #120c08 100%);
}

body.view-summary .board-view { visibility: hidden; }

.viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  overflow: clip;
  touch-action: none;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.viewport a,
.viewport img { -webkit-user-drag: none; }
body.is-panning .viewport { cursor: grabbing; }
body.is-dragging .viewport,
body.is-dragging .clue { cursor: grabbing; }

.board {
  position: absolute;
  left: 0;
  top: 0;
  width: 3600px;
  height: 2400px;
  transform-origin: 0 0;
  /* Rough first frame before the script positions the board precisely. */
  transform: translate(calc(50vw - 1050px), calc(50vh - 28px - 680px)) scale(0.7);
  background-color: #b3845a;
  background-image:
    var(--grain-dark),
    var(--grain-light),
    radial-gradient(ellipse 240px 190px at 30% 40%, rgba(255, 214, 160, 0.16), transparent 70%),
    radial-gradient(ellipse 300px 240px at 70% 65%, rgba(80, 45, 15, 0.16), transparent 70%);
  background-size: 180px 180px, 230px 230px, 640px 560px, 860px 720px;
  box-shadow:
    inset 0 0 60px rgba(50, 24, 6, 0.45),
    0 0 0 3px #2a190d,
    0 0 0 22px #6b4526,
    0 0 0 25px #8a5d36,
    0 0 0 28px #2a190d,
    0 30px 70px rgba(0, 0, 0, 0.55);
}
.board.is-moving { will-change: transform; }

.lamp-light {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 75% at 50% 40%, rgba(255, 220, 160, 0.1) 0%, rgba(255, 220, 160, 0) 42%, rgba(12, 7, 3, 0.32) 74%, rgba(8, 5, 2, 0.7) 100%);
}

/* ---------- Strings ---------- */

.strings {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  overflow: visible;
  pointer-events: none;
}
.strings path { fill: none; stroke-linecap: round; }
.string-shadows path { stroke: rgba(40, 18, 4, 0.35); stroke-width: 2.6; }
.string-lines path { stroke: #a5141b; stroke-width: 2.4; transition: stroke-width 0.15s ease; }
.string-twists path { stroke: rgba(255, 175, 160, 0.5); stroke-width: 1; stroke-dasharray: 2 6; }
.string-lines path.lit { stroke: #e3232c; stroke-width: 4.2; }
.string-lines path.travel { stroke: #ff4a3d; stroke-width: 6; }

.tags { position: absolute; left: 0; top: 0; z-index: 12; pointer-events: none; }
.tag {
  position: absolute;
  left: 0;
  top: 0;
  padding: 3px 10px 2px;
  border: 1px solid rgba(142, 17, 24, 0.35);
  border-radius: 3px;
  background: #fff6d8;
  color: var(--red-deep);
  font: 500 21px/1.1 var(--f-hand);
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.tag.show { opacity: 1; }

/* ---------- Decorations on the cork ---------- */

.decor > * { position: absolute; pointer-events: none; }

.tape-label {
  z-index: 1;
  padding: 7px 22px 6px;
  background: rgba(238, 225, 190, 0.94);
  color: #2b2118;
  font: 500 34px/1 var(--f-hand);
  clip-path: polygon(2% 4%, 99% 0, 97% 52%, 100% 100%, 1% 96%, 3% 48%);
}
.tl-company { left: 1360px; top: 34px; transform: rotate(-2deg); }
.tl-school { left: 300px; top: 70px; transform: rotate(1.5deg); }
.tl-code { left: 2560px; top: 26px; transform: rotate(2deg); }
.tl-mountains { left: 1080px; top: 2320px; transform: rotate(-1.5deg); }
.tl-road { left: 2380px; top: 2320px; transform: rotate(2.5deg); }
.tl-ends { left: 3160px; top: 24px; transform: rotate(-2deg); }

.coffee {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 58%, rgba(112, 62, 22, 0.2) 61%, rgba(112, 62, 22, 0.42) 64.5%, rgba(112, 62, 22, 0.14) 67%, transparent 70%),
    radial-gradient(circle at 62% 38%, rgba(120, 70, 30, 0.08), transparent 62%);
}
.coffee::after {
  content: "";
  position: absolute;
  inset: 9px -6px -4px 12px;
  border-radius: 50%;
  background: radial-gradient(circle, transparent 0 63%, rgba(112, 62, 22, 0.22) 66%, transparent 69%);
  clip-path: polygon(0 40%, 60% 0, 100% 0, 100% 100%, 0 100%);
}
.coffee-board { left: 2000px; top: 2160px; transform: rotate(20deg); }

.start-here { left: 1110px; top: 730px; width: 170px; z-index: 1; }
.start-here .hand { display: block; color: #fff3d8; font: 500 30px/1 var(--f-hand); text-align: right; transform: rotate(-6deg); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55); }
.start-here svg { display: block; width: 120px; height: 70px; margin-left: 20px; overflow: visible; }
.start-here path { fill: none; stroke: #fff3d8; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }

.notebook {
  left: 70px;
  top: 1960px;
  width: 300px;
  padding: 26px 18px 18px 46px;
  transform: rotate(-3deg);
  background-color: #fbf9f2;
  background-image:
    radial-gradient(circle at 20px 50%, #6f4a2b 0 5px, transparent 5.5px),
    linear-gradient(90deg, transparent 34px, rgba(214, 90, 96, 0.6) 34px 35.5px, transparent 35.5px),
    repeating-linear-gradient(transparent 0 27px, rgba(90, 130, 200, 0.35) 27px 28px);
  background-size: 100% 40px, auto, auto;
  background-position: 0 6px, 0 0, 0 4px;
  clip-path: polygon(0 3%, 5% 0, 11% 2.5%, 18% 0.5%, 26% 3%, 33% 0, 41% 2%, 50% 0.5%, 58% 3%, 66% 0, 74% 2.2%, 82% 0.4%, 90% 2.6%, 100% 0.5%, 100% 100%, 0 100%);
}
.notebook .hand { display: block; color: #22346e; font: 500 23px/28px var(--f-hand); }
.notebook .hand:first-child { color: var(--red); font-size: 26px; }

.loupe {
  left: 2700px;
  top: 2090px;
  width: 132px;
  height: 132px;
  z-index: 4;
  border-radius: 50%;
  border: 11px solid #2b211a;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.06) 45%, rgba(160, 200, 220, 0.12) 100%);
  box-shadow: 0 0 0 2px #6d5a48, 6px 10px 12px rgba(0, 0, 0, 0.35);
  transform: rotate(-20deg);
}
.loupe::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 22px;
  height: 104px;
  margin: 8px 0 0 -11px;
  border-radius: 6px;
  background: linear-gradient(90deg, #3a2412, #7a4b26 45%, #3a2412);
  box-shadow: 4px 8px 10px rgba(0, 0, 0, 0.3);
}

.loose-pin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0 8%, #2f62c9 20%, #13306b 75%);
  box-shadow: 2px 3px 3px rgba(0, 0, 0, 0.35);
}
.lp1 { left: 470px; top: 1840px; }
.lp2 { left: 505px; top: 1868px; background: radial-gradient(circle at 35% 30%, #fff 0 8%, #e0343a 20%, #7d0e13 75%); }
.lp3 { left: 3500px; top: 2310px; background: radial-gradient(circle at 35% 30%, #fff 0 8%, #f2c230 20%, #8a6406 75%); }

/* ---------- Case card ---------- */

.casecard {
  position: absolute;
  left: 1270px;
  top: 800px;
  z-index: 3;
  width: 460px;
  padding: 30px 32px 26px;
  background: var(--paper) var(--paper-grain);
  border-top: 10px solid var(--red);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.25), 0 14px 26px -10px rgba(25, 12, 0, 0.6);
  transform: rotate(-0.6deg);
  cursor: default;
}
.casecard .pin { top: -16px; }
.casecard p { margin: 0; }
.casecard-no { display: flex; align-items: center; gap: 12px; font: 700 14px/1 var(--f-type); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }
.casecard h1 { margin: 14px 0 10px; font: 700 50px/0.98 var(--f-head); letter-spacing: -0.005em; text-transform: uppercase; color: var(--ink); }
.casecard-hint { font: 500 33px/1.05 var(--f-hand); color: var(--red); }
.casecard-how { margin-top: 14px !important; font: 13.5px/1.5 var(--f-type); color: var(--ink-soft); }
.how-touch { display: none; }
@media (pointer: coarse) {
  .how-mouse { display: none; }
  .how-touch { display: block; }
}
.casecard-out { margin-top: 14px !important; font: 700 15px/1.3 var(--f-type); }
.casecard a { color: var(--red-deep); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.casecard a:hover { color: var(--red); }
.casecard a:focus-visible,
.casecard-reset:focus-visible { outline: 3px solid #ffd34d; outline-offset: 3px; }
.casecard-reset {
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font: 13px/1.3 var(--f-type);
  text-decoration: underline;
  cursor: pointer;
}
.casecard-reset[hidden] { display: none; }
.coffee-card { position: absolute; right: -54px; top: -46px; width: 140px; height: 140px; pointer-events: none; }
.closed-stamp {
  position: absolute;
  right: 22px;
  bottom: 70px;
  padding: 6px 16px 4px;
  border: 5px double rgba(180, 30, 38, 0.9);
  border-radius: 6px;
  color: rgba(180, 30, 38, 0.9);
  font: 700 38px/1 var(--f-head);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: rotate(-14deg);
  -webkit-mask-image: var(--stamp-mask);
  mask-image: var(--stamp-mask);
  opacity: 0;
  pointer-events: none;
}
.casecard.solved .closed-stamp { opacity: 1; }
.casecard.solved .rubber-open { visibility: hidden; }

.rubber {
  display: inline-block;
  padding: 3px 9px 2px;
  border: 3px solid currentColor;
  border-radius: 4px;
  font: 700 14px/1.1 var(--f-head);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transform: rotate(-6deg);
  -webkit-mask-image: var(--stamp-mask);
  mask-image: var(--stamp-mask);
}
.rubber-open { color: rgba(180, 30, 38, 0.92); }
.rubber-active { position: absolute; right: 18px; bottom: 16px; color: rgba(28, 112, 60, 0.9); }

/* ---------- Clues: shared ---------- */

.clue {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: var(--loupe-cursor), zoom-in;
  transform: translate(var(--x), var(--y)) rotate(var(--r));
  transform-origin: 50% 3px;
  transition: transform 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.clue:focus { outline: none; }
.clue:focus-visible { z-index: 7; }
.clue:focus-visible .face { outline: 3px dashed #ffe9a6; outline-offset: 7px; }

@media (hover: hover) {
  .clue:hover { z-index: 7; transform: translate(var(--x), var(--y)) rotate(calc(var(--r) * 0.3)) scale(1.035); }
}
.clue:focus-visible { transform: translate(var(--x), var(--y)) rotate(calc(var(--r) * 0.3)) scale(1.035); }
.clue.lifted { z-index: 9; transition: none; transform: translate(var(--x), var(--y)) rotate(calc(var(--r) * 0.3)) scale(1.05); }
.clue.linked { z-index: 6; }
.clue.linked .face { outline: 3px solid rgba(227, 35, 44, 0.8); outline-offset: 5px; }

.face { position: relative; display: block; }
.face > span,
.face > b { display: block; }

.pin {
  position: absolute;
  left: 50%;
  top: -8px;
  z-index: 6;
  width: 20px;
  height: 20px;
  margin-left: -10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0 8%, var(--pin, #e0343a) 20%, var(--pin-dark, #7d0e13) 74%, #1a0505 100%);
  box-shadow: 2px 5px 4px rgba(0, 0, 0, 0.38);
}
.pin-red { --pin: #e0343a; --pin-dark: #7d0e13; }
.pin-yellow { --pin: #f2c230; --pin-dark: #8a6406; }
.pin-blue { --pin: #3a6fd8; --pin-dark: #13306b; }
.pin-green { --pin: #3aa364; --pin-dark: #145a2e; }
.clue.linked .pin,
.clue.traced .pin { animation: pin-pulse 1.1s ease-in-out infinite; }
@keyframes pin-pulse { 50% { transform: scale(1.35); } }

.stamp {
  position: absolute;
  right: -10px;
  bottom: 12px;
  z-index: 8;
  padding: 4px 10px 3px;
  border: 4px double rgba(190, 24, 34, 0.9);
  border-radius: 5px;
  background: rgba(255, 248, 236, 0.18);
  color: rgba(190, 24, 34, 0.92);
  font: 700 17px/1 var(--f-head);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transform: rotate(-13deg);
  -webkit-mask-image: var(--stamp-mask);
  mask-image: var(--stamp-mask);
  opacity: 0;
  pointer-events: none;
}
.clue.examined .stamp { opacity: 1; }
.clue.just-stamped .stamp { animation: stamp-in 0.42s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
@keyframes stamp-in {
  0% { opacity: 0; transform: rotate(-13deg) scale(2.4); }
  55% { opacity: 1; }
  100% { opacity: 1; transform: rotate(-13deg) scale(1); }
}

.evidence-no {
  position: absolute;
  left: -14px;
  bottom: -14px;
  z-index: 7;
  min-width: 38px;
  padding: 6px 6px 4px;
  background: linear-gradient(#ffd83d, #f2bd12);
  color: #1d1700;
  font: 700 15px/1 var(--f-head);
  text-align: center;
  clip-path: polygon(14% 0, 86% 0, 100% 100%, 0 100%);
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.3);
}

.typed { font: 400 14px/1.45 var(--f-type); color: #2a241c; }
.hand { font: 500 23px/1.12 var(--f-hand); color: var(--blue-ink); }
.big { font-size: 19px; font-weight: 700; }
.nw { white-space: nowrap; }

.ringed { position: relative; display: inline-block !important; padding: 0 8px; }
.ringed::after {
  content: "";
  position: absolute;
  inset: -5px -7px -3px -7px;
  border: 2.5px solid rgba(196, 30, 40, 0.82);
  border-radius: 50%;
  transform: rotate(-4deg);
  pointer-events: none;
}
.hand.ringed { color: var(--red); margin-top: 6px; }

/* Index card */
.t-card .face {
  width: 290px;
  padding: 12px 18px 18px;
  background-color: var(--paper-white);
  background-image:
    linear-gradient(transparent 44px, rgba(214, 90, 96, 0.75) 44px 46px, transparent 46px),
    repeating-linear-gradient(transparent 0 23px, rgba(90, 130, 200, 0.3) 23px 24px);
  background-position: 0 0, 0 46px;
  background-size: auto, 100% 24px;
  background-repeat: no-repeat, repeat;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.22), 0 9px 14px -6px rgba(30, 15, 0, 0.55);
}
.card-label {
  height: 34px;
  margin-bottom: 12px;
  padding-top: 8px;
  font: 700 15px/1.2 var(--f-head);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1d1a16;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.t-card .typed { line-height: 24px; }
.t-card .date { color: #6a5e4e; }
.h2-mark { margin: 2px 0; color: #1f5a8f; font: 700 46px/1 var(--f-head); }
.h2-mark sub { font-size: 24px; vertical-align: -6px; }
.t-card .hand { margin-top: 4px; line-height: 24px; }

/* Subject card */
.t-subject .face { width: 350px; min-height: 230px; padding-right: 150px; }
.t-subject .note { margin-top: 10px; font-size: 22px; }
.mini-polaroid {
  position: absolute;
  right: -16px;
  top: 14px;
  width: 140px;
  padding: 7px 7px 30px;
  background: #fff;
  transform: rotate(5deg);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.25), 3px 8px 10px -4px rgba(0, 0, 0, 0.45);
}
.mini-polaroid img { display: block; width: 126px; height: 158px; object-fit: cover; }
.mini-polaroid .hand { position: absolute; left: 0; right: 0; bottom: 4px; display: block; color: #333; font-size: 18px; text-align: center; }
.mini-polaroid::before {
  content: "";
  position: absolute;
  left: 22px;
  top: -14px;
  width: 16px;
  height: 46px;
  border: 2.5px solid #9aa3ab;
  border-radius: 9px;
  box-shadow: inset 0 0 0 3px transparent, 1px 2px 1px rgba(0, 0, 0, 0.25);
}

/* Folder */
.t-folder .face {
  width: 340px;
  padding: 26px 22px 58px;
  border-radius: 0 6px 6px 6px;
  background: linear-gradient(172deg, #e4c483, #d6b06a 55%, #c99f58);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.25), 0 10px 16px -6px rgba(30, 15, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.folder-tab {
  position: absolute;
  left: 0;
  top: -27px;
  height: 28px;
  padding: 7px 34px 0 16px;
  border-radius: 6px 0 0 0;
  background: #dcbb78;
  font: 700 14px/1 var(--f-head);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #3b2a10;
  clip-path: polygon(0 0, 82% 0, 100% 100%, 0 100%);
}
.t-folder .label { font-weight: 700; font-size: 17px; letter-spacing: 0.04em; margin-bottom: 4px; }
.t-folder .quote { margin-top: 10px; color: #6b1d10; font-size: 25px; }

/* Newspaper clipping */
.t-clip .face {
  width: 250px;
  padding: 16px 16px 22px;
  isolation: isolate;
  color: #1b1814;
}
.t-clip .face::before,
.t-clip .face::after {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(0 1.5%, 4% 0, 9% 1.2%, 15% 0.2%, 22% 1.4%, 28% 0, 35% 1%, 42% 0.1%, 50% 1.3%, 57% 0.2%, 64% 1.1%, 71% 0, 78% 1.4%, 85% 0.3%, 92% 1.2%, 100% 0, 99.2% 8%, 100% 17%, 99.1% 26%, 100% 36%, 99.3% 47%, 100% 58%, 99% 69%, 100% 80%, 99.2% 90%, 100% 100%, 93% 98.8%, 86% 100%, 78% 98.6%, 70% 99.8%, 62% 98.7%, 54% 100%, 46% 98.9%, 38% 99.9%, 30% 98.6%, 22% 99.8%, 14% 98.8%, 7% 100%, 0 98.7%, 0.8% 88%, 0 77%, 0.9% 66%, 0 55%, 0.7% 44%, 0 33%, 0.9% 22%, 0 11%);
}
.t-clip .face::before { z-index: -1; background: #ece5d1 var(--paper-grain); }
.t-clip .face::after { z-index: -2; background: rgba(35, 18, 2, 0.28); transform: translate(3px, 5px); }
.paper-name {
  padding-bottom: 5px;
  margin-bottom: 8px;
  border-bottom: 3px double #2a2520;
  font: 700 13px/1 var(--f-news);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
}
.dateline { margin: -2px 0 6px; font: 11px/1 var(--f-type); color: #5a5248; text-align: center; letter-spacing: 0.08em; }
.headline { font: 700 23px/1.06 var(--f-head); text-transform: uppercase; letter-spacing: 0.01em; }
.dek { margin-top: 8px; font: italic 400 15px/1.3 var(--f-news); color: #2d2822; }
.cols {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #8c8478;
  font: 400 12.5px/1.38 var(--f-news);
  color: #39332c;
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}

/* Sticky note */
.t-sticky .face {
  width: 190px;
  min-height: 176px;
  padding: 24px 14px 18px 16px;
  background: linear-gradient(172deg, #fdf193, #f5de63);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15), 4px 12px 12px -8px rgba(30, 15, 0, 0.55);
}
.t-sticky .face::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, transparent 50%, rgba(0, 0, 0, 0.08) 50%, rgba(255, 255, 255, 0.35) 75%);
}
.s-green .face { background: linear-gradient(172deg, #d1edb0, #b5db8b); }
.t-sticky .hand { color: #1d2c66; font-size: 23px; line-height: 1.08; margin-bottom: 4px; }
.t-sticky .hand.title { margin-bottom: 8px; font-size: 28px; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* Postcard */
.t-postcard .face {
  width: 330px;
  padding: 10px 10px 14px;
  background: #fbf6ea var(--paper-grain);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.22), 0 9px 14px -6px rgba(30, 15, 0, 0.55);
}
.pc-front {
  position: relative;
  height: 128px;
  margin-bottom: 10px;
  overflow: hidden;
  padding: 14px 16px 0;
  background:
    radial-gradient(circle at 80% 62%, #ffd66b 0 26px, rgba(255, 214, 107, 0) 27px),
    linear-gradient(170deg, transparent 72%, #3d7a4a 72.5%),
    linear-gradient(185deg, transparent 66%, #5f9b5a 66.5%),
    linear-gradient(#1f4c9a, #5b8fd4 70%, #a9c9ec);
}
.pc-greet { display: block; color: #fff; font: 500 24px/1 var(--f-hand); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.pc-big {
  display: block;
  color: #fdb515;
  font: 700 56px/0.95 var(--f-head);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 #12306b, -1px -1px 0 #12306b, 1px -1px 0 #12306b, -1px 1px 0 #12306b, 4px 5px 0 rgba(0, 0, 0, 0.25);
}
.t-postcard .typed { padding: 0 6px; font-size: 13.5px; }
.t-postcard .hand { padding: 4px 6px 0; }

/* Polaroid */
.t-polaroid .face {
  width: 180px;
  padding: 10px 10px 42px;
  background: #fdfcf8;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.22), 0 9px 14px -6px rgba(30, 15, 0, 0.55);
}
.t-polaroid img { display: block; width: 160px; height: 200px; object-fit: cover; background: #d8d2c4; }
.t-polaroid .face > .hand { position: absolute; left: 0; right: 0; bottom: 8px; color: #2a2a2a; font-size: 21px; text-align: center; }
.t-polaroid .face::before {
  content: "";
  position: absolute;
  right: -18px;
  top: 14px;
  z-index: 2;
  width: 70px;
  height: 22px;
  background: rgba(238, 228, 196, 0.78);
  transform: rotate(38deg);
  clip-path: polygon(3% 0, 97% 6%, 100% 50%, 96% 100%, 2% 94%, 0 50%);
}

/* Cassette */
.t-cassette .face { width: 280px; }
.cassette-body {
  position: relative;
  height: 172px;
  padding: 12px 14px;
  border-radius: 10px;
  background: linear-gradient(#3d3d42, #242428);
  box-shadow: inset 0 0 0 2px #55555c, 0 10px 16px -6px rgba(0, 0, 0, 0.6);
}
.cassette-label {
  display: block;
  height: 118px;
  padding: 18px 12px 0;
  border-radius: 4px;
  background:
    linear-gradient(transparent 0 8px, #e2552f 8px 12px, #f2a33a 12px 16px, transparent 16px),
    #f3ead2;
}
.cassette-label .hand { display: block; color: #1c2a5e; font-size: 25px; line-height: 1; }
.cassette-label .typed { display: block; font-size: 11.5px; line-height: 1.3; }
.reels {
  position: absolute;
  left: 50%;
  top: 92px;
  display: flex;
  align-items: center;
  width: 176px;
  height: 46px;
  margin-left: -88px;
  padding: 0 7px;
  border-radius: 23px;
  background: #1b1b1e;
}
.reel {
  display: block;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  background:
    radial-gradient(circle, #1b1b1e 0 22%, transparent 23% 56%, #1b1b1e 57%),
    repeating-conic-gradient(#efe8d8 0 22deg, #2a2a2e 22deg 30deg);
}
.tape-window { display: block; flex: 1; height: 24px; margin: 0 8px; border-radius: 3px; background: linear-gradient(90deg, #5a3a22, #2c1a0e 50%, #5a3a22); }
@media (hover: hover) {
  .t-cassette:hover .reel { animation: spin 2.4s linear infinite; }
}
@keyframes spin { to { transform: rotate(360deg); } }
.slip {
  position: relative;
  margin: -12px 10px 0 34px;
  padding: 10px 12px 8px;
  background: #fffdf6;
  transform: rotate(3deg);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2), 2px 7px 9px -5px rgba(0, 0, 0, 0.5);
}
.slip .hand { display: block; color: #6b1d10; font-size: 22px; line-height: 1.05; }
.slip .typed { display: block; margin-top: 4px; font-size: 11.5px; color: #5b4f40; }

/* Document cover */
.t-cover .face {
  width: 220px;
  min-height: 300px;
  padding-bottom: 18px;
  background: #f7f2e6 var(--paper-grain);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.22), 3px 3px 0 #e6dcc6, 6px 6px 0 #d8ccb2, 0 12px 18px -6px rgba(30, 15, 0, 0.55);
}
.cover-band { padding: 12px 14px 10px; background: var(--cv, #23407a); color: #f8f1e1; font: 500 12px/1.3 var(--f-head); letter-spacing: 0.1em; text-transform: uppercase; }
.cv-blue { --cv: #23407a; }
.cv-red { --cv: #8d1d22; }
.cv-green { --cv: #1f5a45; }
.cover-title { padding: 18px 16px 10px; font: 700 21px/1.18 var(--f-news); color: #1d1a16; }
.cover-meta { padding: 0 16px; font: 12px/1.4 var(--f-type); color: #6a5e4e; }
.t-cover .hand { padding: 12px 16px 0; color: var(--red); font-size: 21px; }
.clip-wire {
  position: absolute !important;
  left: 20px;
  top: -16px;
  width: 16px;
  height: 52px;
  border: 2.5px solid #8f989f;
  border-radius: 9px;
  box-shadow: 1px 2px 1px rgba(0, 0, 0, 0.2);
}
.clip-wire::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 6px;
  width: 7px;
  height: 30px;
  border: 2.5px solid #8f989f;
  border-top: 0;
  border-radius: 0 0 6px 6px;
}
.coffee-doc { position: absolute !important; right: -40px; bottom: -36px; width: 120px; height: 120px; }

/* Dot-matrix printout */
.t-printout .face {
  width: 330px;
  padding: 18px 34px 20px;
  background-color: #fbfbf3;
  background-image:
    radial-gradient(circle at 12px 12px, #6f4a2b 0 4px, transparent 4.6px),
    radial-gradient(circle at calc(100% - 12px) 12px, #6f4a2b 0 4px, transparent 4.6px),
    linear-gradient(90deg, transparent 24px, rgba(0, 0, 0, 0.14) 24px 25px, transparent 25px calc(100% - 25px), rgba(0, 0, 0, 0.14) calc(100% - 25px) calc(100% - 24px), transparent calc(100% - 24px)),
    repeating-linear-gradient(transparent 0 24px, rgba(170, 214, 170, 0.45) 24px 48px);
  background-size: 100% 24px, 100% 24px, auto, auto;
  font: 400 13px/1.5 var(--f-type);
  color: #26241f;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2), 0 10px 16px -6px rgba(30, 15, 0, 0.5);
}
.pr-narrow .face { width: 300px; }
.pr-title { font: 700 19px/1.2 var(--f-type); letter-spacing: 0.08em; text-transform: uppercase; }
.pr-line { font-size: 12.5px; }
.pr-rule { height: 0; margin: 8px 0; border-top: 1px dashed #6b675e; }
.pr-fn { display: flex !important; justify-content: space-between; gap: 8px; }
.pr-fn b { font-weight: 700; }
.pr-fn i { color: #6b675e; font-style: italic; }
.pr-diagram { text-align: center; font: 700 14px/1.5 var(--f-type); white-space: pre; }
.pr-diagram span { display: block; }
.pr-branches { font-weight: 400; }
.t-printout .hand { color: var(--red); }

/* Shoebox label */
.t-label .face {
  width: 270px;
  padding: 16px 16px 18px;
  background: linear-gradient(165deg, #e9813f, #d0652d);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.25), 0 10px 16px -6px rgba(30, 15, 0, 0.55), inset 0 0 0 6px rgba(255, 255, 255, 0.08);
}
.label-brand { margin-bottom: 6px; color: #fff7ea; font: 700 33px/1 var(--f-head); letter-spacing: 0.04em; text-transform: uppercase; }
.t-label .typed { color: #2a1305; font-size: 13.5px; }
.barcode {
  width: 132px;
  height: 36px;
  margin-top: 10px;
  border: 5px solid #fff;
  border-bottom-width: 9px;
  background: #fff linear-gradient(90deg, #111 0 2px, transparent 2px 4px, #111 4px 5px, transparent 5px 7px, #111 7px 10px, transparent 10px 11px, #111 11px 12px, transparent 12px 15px, #111 15px 17px, transparent 17px 18px);
  background-size: 18px 100%;
}
.label-row { display: flex !important; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.label-row .barcode { width: 112px; margin-top: 0; }
.t-label .hand.ringed { margin: 0 8px 0 0; color: #fff3d0; white-space: nowrap; }
.t-label .hand.ringed::after { border-color: rgba(255, 243, 208, 0.9); }

/* Race bib */
.t-bib .face {
  width: 220px;
  padding-bottom: 14px;
  border-radius: 6px;
  background: #fdfdfb;
  text-align: center;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.22), 0 10px 16px -6px rgba(30, 15, 0, 0.55);
}
.t-bib .face::before,
.t-bib .face::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 28px;
  background:
    radial-gradient(circle at 15px 14px, #6f4a2b 0 4.5px, #cfcfcf 4.5px 6.5px, transparent 7px),
    radial-gradient(circle at calc(100% - 15px) 14px, #6f4a2b 0 4.5px, #cfcfcf 4.5px 6.5px, transparent 7px);
}
.t-bib .face::before { top: 0; }
.t-bib .face::after { bottom: 0; }
.bib-top { padding: 26px 10px 7px; border-radius: 6px 6px 0 0; background: linear-gradient(#cf1430, #a50d25); color: #fff; font: 700 15px/1 var(--f-head); letter-spacing: 0.18em; text-transform: uppercase; }
.bib-number { margin: 2px 0 -6px; color: #111; font: 700 150px/1 var(--f-head); }
.bib-bottom { padding: 0 10px 14px; font: 700 12px/1.3 var(--f-type); }
.bib-note {
  position: absolute !important;
  right: -118px;
  bottom: -46px;
  width: 128px;
  padding: 10px 10px 12px;
  background: linear-gradient(172deg, #fdf193, #f5de63);
  transform: rotate(7deg);
  text-align: left;
  box-shadow: 2px 8px 10px -6px rgba(0, 0, 0, 0.5);
}
.bib-note .hand { font-size: 20px; line-height: 1.05; color: #1d2c66; }

/* Pennant */
.t-pennant .face { width: 290px; }
.t-pennant .pin { left: 26px; top: 46px; }
.pennant-flag {
  height: 124px;
  padding: 34px 0 0 40px;
  background:
    linear-gradient(90deg, #f4e9cf 0 22px, transparent 22px),
    linear-gradient(#21593a, #173f29);
  color: #f4e9cf;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.pennant-name { display: block; font: 700 32px/1 var(--f-head); letter-spacing: 0.08em; text-transform: uppercase; }
.pennant-sub { display: block; margin-top: 3px; font: 500 10px/1.2 var(--f-head); letter-spacing: 0.12em; text-transform: uppercase; color: #d9cfae; }
.t-pennant .hand { margin: 4px 0 0 30px; color: #fff3d8; font-size: 25px; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }

/* Lift pass */
.t-pass .face {
  display: flex !important;
  gap: 12px;
  width: 290px;
  padding: 24px 14px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #eef4fa, #cddff0 60%, #b2cbe3);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.25), 0 10px 16px -6px rgba(10, 20, 40, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}
.t-pass .face::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 7px;
  width: 44px;
  height: 9px;
  margin-left: -22px;
  border-radius: 5px;
  background: #6f4a2b;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}
.pass-photo { flex: none; width: 88px; padding: 3px; background: #fff; }
.pass-photo img { display: block; width: 82px; height: 102px; object-fit: cover; }
.pass-text { min-width: 0; }
.pass-text > span { display: block; }
.pass-kicker { font: 500 10px/1.2 var(--f-head); letter-spacing: 0.14em; text-transform: uppercase; color: #3a4f6e; }
.pass-place { margin-top: 4px; font: 700 27px/1 var(--f-head); text-transform: uppercase; color: #12335e; }
.pass-year { margin-top: 4px; font: 13px/1.3 var(--f-type); color: #23364f; }
.t-pass .barcode { width: 120px; height: 30px; border-width: 4px 4px 7px; }

/* Envelope */
.t-envelope .face {
  width: 320px;
  height: 228px;
  padding: 134px 22px 18px;
  border-radius: 3px;
  background: linear-gradient(#c4935c, #b4814d) ;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.25), 0 10px 16px -6px rgba(30, 15, 0, 0.55);
}
.env-flap {
  position: absolute !important;
  left: 0;
  right: 0;
  top: 0;
  height: 112px;
  background: linear-gradient(#d4a46a, #bf8c55);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.env-stamp {
  position: absolute !important;
  right: 16px;
  top: 16px;
  padding: 4px 10px 2px;
  border: 3px solid rgba(130, 20, 26, 0.88);
  border-radius: 3px;
  color: rgba(130, 20, 26, 0.92);
  font: 700 26px/1 var(--f-head);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transform: rotate(9deg);
  -webkit-mask-image: var(--stamp-mask);
  mask-image: var(--stamp-mask);
}
.env-line { color: #2a1708; font-weight: 700; }
.env-tie {
  position: absolute !important;
  left: 50%;
  top: 100px;
  width: 24px;
  height: 24px;
  margin-left: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, #5d3f25 0 22%, #8d6440 28% 64%, #4d331d 70%);
  box-shadow: 1px 2px 2px rgba(0, 0, 0, 0.35);
}
.env-tie::after {
  content: "";
  position: absolute;
  left: -14px;
  top: 2px;
  width: 52px;
  height: 18px;
  border: 2px solid #efe5cf;
  border-radius: 50%;
  transform: rotate(-18deg);
}

/* Sealed contact envelope */
.t-sealed .face {
  width: 270px;
  height: 200px;
  padding: 92px 18px 14px;
  background: #efe5cf var(--paper-grain);
  text-align: center;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.25), 0 10px 16px -6px rgba(30, 15, 0, 0.55);
}
.sealed-flap {
  position: absolute !important;
  left: 0;
  right: 0;
  top: 0;
  height: 96px;
  background: linear-gradient(#e2d5b8, #d7c7a5);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.seal {
  position: absolute !important;
  left: 50%;
  top: 68px;
  width: 52px;
  height: 52px;
  margin-left: -26px;
  padding-top: 13px;
  border-radius: 50% 46% 52% 48%;
  background: radial-gradient(circle at 38% 34%, #e04b4b 0, #a1121b 55%, #6d0a10 100%);
  color: #f6c9c3;
  font: 700 19px/1 var(--f-news);
  box-shadow: 0 0 0 4px rgba(161, 18, 27, 0.55), 2px 4px 4px rgba(0, 0, 0, 0.35);
  transform: rotate(-8deg);
}
.sealed-title { margin-top: 30px; font: 700 21px/1.1 var(--f-head); text-transform: uppercase; letter-spacing: 0.04em; }
.t-sealed .typed { font-weight: 700; }
.t-sealed .hand { margin-top: 2px; color: var(--red); font-size: 21px; }
.sealed-open { display: none !important; }
.t-sealed.is-unsealed .sealed-lock { display: none !important; }
.t-sealed.is-unsealed .sealed-open { display: block !important; }
.t-sealed.is-unsealed .seal { background: radial-gradient(circle at 38% 34%, #e04b4b 0, #a1121b 55%, #6d0a10 100%); clip-path: polygon(0 0, 46% 0, 54% 48%, 40% 100%, 0 100%); }
.t-sealed.is-unsealed .face { outline: 3px solid rgba(255, 216, 61, 0.9); outline-offset: 6px; }
.t-sealed.is-unsealed:not(.examined) .face { animation: glow 1.6s ease-in-out infinite; }
@keyframes glow { 50% { outline-color: rgba(255, 216, 61, 0.25); } }

/* Clue positions on the board (top-left corner, rotation around the pin) */
#clue-subject { --x: 860px; --y: 850px; --r: -3deg; }
#clue-casian { --x: 1320px; --y: 440px; --r: -1.5deg; }
#clue-pilots { --x: 1030px; --y: 120px; --r: 2.5deg; }
#clue-julian { --x: 1000px; --y: 520px; --r: -4deg; }
#clue-berkeley { --x: 420px; --y: 520px; --r: 2deg; }
#clue-golden-gate { --x: 100px; --y: 440px; --r: -5deg; }
#clue-tapes { --x: 300px; --y: 170px; --r: -3deg; }
#clue-dissertation { --x: 660px; --y: 130px; --r: 2deg; }
#clue-essec { --x: 290px; --y: 880px; --r: -2deg; }
#clue-treasurer { --x: 140px; --y: 1250px; --r: 3deg; }
#clue-kryptosphere { --x: 620px; --y: 1170px; --r: 5deg; }
#clue-agentescrow { --x: 2560px; --y: 110px; --r: 1.5deg; }
#clue-umip { --x: 2600px; --y: 910px; --r: -2deg; }
#clue-thesis { --x: 2380px; --y: 520px; --r: -3deg; }
#clue-report { --x: 2190px; --y: 1000px; --r: 2.5deg; }
#clue-one-green { --x: 1760px; --y: 480px; --r: 2deg; }
#clue-casian-partners { --x: 1720px; --y: 110px; --r: -2deg; }
#clue-soft-sneakers { --x: 2070px; --y: 200px; --r: 3deg; }
#clue-ski-mojo { --x: 1520px; --y: 1315px; --r: -2deg; }
#clue-esf { --x: 1140px; --y: 1300px; --r: 3deg; }
#clue-killington { --x: 740px; --y: 1520px; --r: -6deg; }
#clue-val-disere { --x: 1440px; --y: 1600px; --r: 4deg; }
#clue-totalenergies { --x: 1880px; --y: 1240px; --r: 2deg; }
#clue-paju { --x: 2440px; --y: 1350px; --r: -4deg; }
#clue-travel { --x: 1960px; --y: 1580px; --r: -2deg; }
#clue-machu-picchu { --x: 2700px; --y: 1350px; --r: 5deg; }
#clue-giza { --x: 2420px; --y: 1660px; --r: 3deg; }
#clue-rio { --x: 2690px; --y: 1680px; --r: -3deg; }
#clue-contact { --x: 1800px; --y: 870px; --r: 3deg; }
#clue-memo { --x: 2080px; --y: 430px; --r: -2deg; }
#clue-investing { --x: 3010px; --y: 110px; --r: 1deg; }
#clue-exam { --x: 3030px; --y: 390px; --r: -3deg; }
#clue-klopp { --x: 3360px; --y: 420px; --r: 5deg; }
#clue-atlas { --x: 2990px; --y: 1110px; --r: -3deg; }
#clue-rshare { --x: 3200px; --y: 1150px; --r: 2deg; }
#clue-shopify { --x: 3400px; --y: 1105px; --r: -2deg; }
#clue-map { --x: 2970px; --y: 1400px; --r: 1.5deg; }
#clue-cyprus { --x: 3090px; --y: 1880px; --r: -2deg; }
#clue-results { --x: 990px; --y: 1890px; --r: 2deg; }
#clue-instructor { --x: 1440px; --y: 1910px; --r: -3deg; }
#clue-alpine { --x: 1760px; --y: 1950px; --r: 4deg; }
#clue-la-plagne { --x: 690px; --y: 1950px; --r: -4deg; }
#clue-sports { --x: 410px; --y: 2010px; --r: 3deg; }


/* Memo with redaction bars */
.t-memo .face {
  width: 250px;
  padding: 14px 16px 16px;
  background: #f4f1e6 var(--paper-grain);
  font: 13px/1.7 var(--f-type);
  color: #26241f;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.22), 0 9px 14px -6px rgba(30, 15, 0, 0.55);
}
.memo-head { margin-bottom: 8px; padding-bottom: 4px; border-bottom: 2px solid #2a241c; font: 700 12px/1.2 var(--f-type); letter-spacing: 0.16em; text-transform: uppercase; color: var(--red-deep); }
.memo-line { margin-bottom: 4px; }
.bar { background: #141210; color: transparent; font-style: normal; border-radius: 1px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.t-memo .hand { margin-top: 6px; color: var(--red); font-size: 21px; }
.t-memo .rubber-declass { position: absolute; right: 10px; bottom: 12px; color: rgba(28, 112, 60, 0.92); opacity: 0; }
.t-memo.declassified .rubber-declass { opacity: 1; }

/* Race results sheet */
.t-results .face {
  width: 350px;
  padding: 14px 18px 16px;
  background: #fbfbf6 var(--paper-grain);
  font: 12.5px/1.4 var(--f-type);
  color: #26241f;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2), 0 10px 16px -6px rgba(30, 15, 0, 0.5);
}
.res-head { margin-bottom: 6px; padding-bottom: 6px; border-bottom: 2px solid #1f1a14; font: 700 14px/1.2 var(--f-head); letter-spacing: 0.12em; text-transform: uppercase; }
.res-row { display: flex !important; flex-wrap: wrap; justify-content: space-between; gap: 0 10px; padding: 3px 0; border-bottom: 1px dotted #a99d86; }
.res-row b { font-weight: 700; }
.res-row i { margin-left: auto; font-style: normal; color: #5b4f40; }
.t-results .hand { margin-top: 8px; color: var(--red); }

/* Instructor badge */
.t-badge .face {
  width: 230px;
  padding: 30px 16px 16px;
  border-radius: 12px;
  background: linear-gradient(160deg, #ffffff, #e6edf6);
  text-align: center;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.25), 0 10px 16px -6px rgba(10, 20, 40, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}
.badge-strap { position: absolute !important; left: 50%; top: 12px; width: 44px; height: 9px; margin-left: -22px; border-radius: 5px; background: #6f4a2b; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5); }
.badge-top { margin: 0 -16px 10px; padding: 6px 4px 5px; background: #b4232b; color: #fff; font: 700 15px/1.1 var(--f-head); letter-spacing: 0.14em; text-transform: uppercase; }
.badge-place { font: 700 30px/1 var(--f-head); text-transform: uppercase; color: #12335e; }
.t-badge .typed { margin-top: 6px; font-size: 12.5px; }
.badge-langs { display: flex !important; justify-content: center; gap: 8px; margin-top: 10px; }
.badge-langs i { padding: 4px 8px 3px; border: 2px solid #12335e; border-radius: 4px; color: #12335e; font: 700 13px/1 var(--f-head); font-style: normal; letter-spacing: 0.08em; }

/* Pink sticky */
.s-pink .face { background: linear-gradient(172deg, #ffd6e2, #f6b3c7); }

/* Folded world map */
.t-map .face {
  width: 580px;
  padding: 14px 14px 12px;
  background: #efe6cf var(--paper-grain);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.22), 0 12px 18px -6px rgba(30, 15, 0, 0.55);
}
.t-map .face::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 33%, rgba(80, 50, 20, 0.12) 33.2%, rgba(255, 255, 255, 0.25) 33.6%, transparent 34%, transparent 66%, rgba(80, 50, 20, 0.12) 66.2%, rgba(255, 255, 255, 0.25) 66.6%, transparent 67%);
}
.map-art { position: relative; height: 256px; overflow: hidden; border: 1px solid #b9a77f; background: #e7dcc1; }
.map-mini { display: block; width: 100%; height: 100%; }
.map-foot { display: flex !important; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 12px; margin-top: 8px; }
.map-foot .hand { color: var(--red); }

/* Ticker tape: investing */
.t-ticker .face {
  width: 540px;
  padding: 12px 0;
  background: #f7f3e6 var(--paper-grain);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2), 0 10px 16px -6px rgba(30, 15, 0, 0.5);
  clip-path: polygon(0 0, 100% 0, 99% 50%, 100% 100%, 0 100%, 1% 50%);
}
.tick-head { padding: 0 22px 8px; font: 12px/1.3 var(--f-type); letter-spacing: 0.08em; text-transform: uppercase; color: #5b4f40; }
.tick-head b { color: var(--red-deep); }
.tick-tape { display: flex !important; gap: 26px; padding: 10px 22px 9px; overflow: hidden; background: #12160f; color: #ffd24a; font: 700 15px/1.2 var(--f-type); letter-spacing: 0.06em; white-space: nowrap; text-transform: uppercase; }
.tick-tape span { flex: none; }
.tick-foot { display: flex !important; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 22px 0; }
.tick-na { font: 11.5px/1.2 var(--f-type); color: #5b4f40; }
@media (hover: hover) {
  .t-ticker:hover .tick-tape span { animation: tick 9s linear infinite; }
}
@keyframes tick { to { transform: translateX(-160px); } }

/* Exam sheet */
.t-exam .face {
  width: 250px;
  min-height: 286px;
  padding: 14px 16px 16px;
  background-color: #fdfdf8;
  background-image: repeating-linear-gradient(transparent 0 21px, rgba(90, 130, 200, 0.28) 21px 22px);
  background-position: 0 64px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.22), 0 9px 14px -6px rgba(30, 15, 0, 0.55);
}
.exam-head { padding-bottom: 6px; border-bottom: 2px solid #1f1a14; font: 700 12.5px/1.2 var(--f-type); letter-spacing: 0.06em; text-transform: uppercase; }
.exam-grade { position: absolute !important; right: 16px; top: 52px; color: var(--red); font: 500 54px/1 var(--f-hand); transform: rotate(-8deg); }
.exam-grade small { font-size: 30px; }
.exam-grade::after { content: ""; position: absolute; inset: -6px -12px -2px -10px; border: 2.5px solid rgba(196, 30, 40, 0.82); border-radius: 50%; transform: rotate(-6deg); }
.exam-lines {
  height: 110px;
  margin: 60px 70px 8px 0;
  background: repeating-linear-gradient(transparent 0 9px, rgba(31, 26, 20, 0.5) 9px 11px, transparent 11px 22px);
  clip-path: polygon(0 0, 92% 0, 78% 20%, 100% 40%, 66% 60%, 95% 80%, 40% 100%, 0 100%);
}
.t-exam .hand { color: var(--blue-ink); font-size: 22px; }

/* Clothing tag */
.t-tag .pin { top: 6px; }
.t-tag .face {
  width: 190px;
  padding: 32px 16px 18px;
  background: linear-gradient(170deg, #ece5d2, #d6cbb0);
  text-align: center;
  clip-path: polygon(18% 0, 82% 0, 100% 14%, 100% 100%, 0 100%, 0 14%);
}
.tag-hole { position: absolute !important; left: 50%; top: 11px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: #7a5a38; box-shadow: inset 0 0 0 3px #f6efdf; }
.tag-kicker { font: 500 11px/1.2 var(--f-head); letter-spacing: 0.22em; text-transform: uppercase; color: #6a5e4e; }
.tag-name { margin: 6px 0 4px; font: 700 30px/1 var(--f-head); text-transform: uppercase; color: #1f1a14; }
.t-tag .typed { font-size: 12.5px; }

/* Closed runs, pinned once the safe is open */
.t-closed .face { width: 200px; padding: 12px 14px 44px; }
.t-closed .card-label { font-size: 14px; }
.t-closed .typed { line-height: 22px; font-size: 12.5px; }
.rubber-closed { position: absolute !important; right: 12px; bottom: 10px; color: rgba(180, 30, 38, 0.9); }
.clue.just-pinned { animation: pin-drop 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
@keyframes pin-drop { from { opacity: 0; transform: translate(var(--x), calc(var(--y) - 80px)) rotate(var(--r)) scale(1.15); } }

/* ---------- Objects on and around the board ---------- */

.obj {
  position: absolute;
  z-index: 3;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.18s ease;
}
.obj:focus { outline: none; }
.obj:focus-visible { outline: 3px dashed #ffe9a6; outline-offset: 8px; z-index: 7; }

/* The safe */
.o-safe { left: 3130px; top: 690px; width: 320px; transform: rotate(-1deg); }
@media (hover: hover) { .o-safe:hover { transform: rotate(-0.4deg) scale(1.02); z-index: 7; } }
.o-safe .pin { top: -10px; }
.safe-box {
  position: relative;
  display: block;
  height: 300px;
  padding: 16px;
  border-radius: 10px;
  background: linear-gradient(145deg, #646b72, #3c4147 60%, #2b2f33);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.25), inset 0 -3px 0 rgba(0, 0, 0, 0.4), 0 18px 26px -8px rgba(0, 0, 0, 0.7);
}
.safe-box::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 16px;
  height: 214px;
  border-radius: 6px;
  background: radial-gradient(ellipse at 50% 40%, #2a2d31, #121417);
}
.safe-door {
  position: relative;
  display: block;
  height: 214px;
  border-radius: 6px;
  background: linear-gradient(145deg, #7a828a, #4a5057);
  box-shadow: inset 0 0 0 3px #2f3337, inset 0 0 0 6px #858d94, 4px 0 8px rgba(0, 0, 0, 0.4);
  transform-origin: 0 50%;
  transition: transform 0.9s cubic-bezier(0.3, 0.8, 0.3, 1);
}
.o-safe.is-open .safe-door { transform: perspective(700px) rotateY(-72deg); }
.safe-dial {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 116px;
  height: 116px;
  margin: -58px 0 0 -58px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #3b4046 0 30%, #9aa1a8 31% 36%, transparent 37%),
    repeating-conic-gradient(#e5e8ea 0 1.5deg, #30353a 1.5deg 9deg);
  box-shadow: 0 0 0 5px #2a2e32, 0 0 0 8px #9aa1a8, 2px 5px 6px rgba(0, 0, 0, 0.5);
  transition: transform 0.6s ease;
}
.o-safe.is-open .safe-dial { transform: rotate(250deg); }
.safe-handle { position: absolute; right: 18px; top: 50%; width: 14px; height: 76px; margin-top: -38px; border-radius: 7px; background: linear-gradient(90deg, #b8bfc5, #6d747b); box-shadow: 2px 3px 4px rgba(0, 0, 0, 0.45); }
.safe-plate { display: block; margin: 16px auto 0; width: max-content; padding: 6px 14px 5px; border-radius: 2px; background: linear-gradient(#e2c06a, #a8822e); color: #2d1f08; font: 700 13px/1 var(--f-head); letter-spacing: 0.16em; text-transform: uppercase; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.4); }
.safe-tag {
  position: absolute;
  left: -46px;
  top: 150px;
  width: 128px;
  padding: 12px 10px 12px;
  background: #fbf6ea;
  transform: rotate(-9deg);
  box-shadow: 2px 8px 10px -6px rgba(0, 0, 0, 0.6);
}
.safe-tag .hand { display: block; color: var(--red); font-size: 21px; line-height: 1.05; }

/* Tape recorder */
.o-recorder { left: 120px; top: 1560px; width: 300px; transform: rotate(-2deg); }
@media (hover: hover) { .o-recorder:hover { transform: rotate(-1deg) scale(1.03); z-index: 7; } .o-recorder:hover .reel { animation: spin 2.4s linear infinite; } }
.rec-body { display: block; padding: 14px 16px 14px; border-radius: 12px; background: linear-gradient(#55555c, #2a2a2e); box-shadow: inset 0 0 0 2px #6a6a72, 0 14px 20px -8px rgba(0, 0, 0, 0.65); }
.rec-reels { display: flex; justify-content: space-around; align-items: center; height: 54px; padding: 0 30px; border-radius: 27px; background: #18181b; box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.7); }
.rec-reels .reel { width: 40px; height: 40px; }
.rec-label { display: block; margin: 12px 0 10px; padding: 5px 8px 4px; background: #f3ead2; color: #2a241c; font: 700 13px/1.1 var(--f-type); letter-spacing: 0.08em; text-align: center; text-transform: uppercase; }
.rec-keys { display: flex; gap: 6px; }
.rec-keys i { flex: 1; height: 18px; border-radius: 2px; background: linear-gradient(#e5e5e5, #a9a9a9); box-shadow: 0 2px 0 #444; }
.rec-keys .rec-play { background: linear-gradient(#ff5a4f, #b4232b); }
.rec-note { position: absolute; right: -36px; top: -30px; color: #fff3d8; font-size: 28px; transform: rotate(8deg); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }

/* The loose cork tile */
.o-tile { left: 2240px; top: 2090px; z-index: 2; width: 150px; height: 150px; }
.o-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 45%, #1b120b, #0b0705);
  box-shadow: inset 0 6px 14px rgba(0, 0, 0, 0.8);
}
.tile-face {
  position: absolute;
  inset: 0;
  background-color: #b3845a;
  background-image: var(--grain-dark), var(--grain-light);
  background-size: 180px 180px, 230px 230px;
  background-position: -80px -110px, -170px -20px;
  box-shadow: inset 0 0 0 1px rgba(70, 36, 10, 0.4), 1px 2px 2px rgba(0, 0, 0, 0.22);
  transform: rotate(1.4deg) translate(2px, -1px);
  transition: transform 0.7s cubic-bezier(0.3, 1.2, 0.4, 1), box-shadow 0.7s ease;
}
.tile-corner { position: absolute; right: -3px; bottom: -3px; width: 30px; height: 30px; background: linear-gradient(135deg, transparent 50%, #c99a6c 50%, #8a5f38); box-shadow: -1px -1px 2px rgba(0, 0, 0, 0.25); transition: opacity 0.3s; }
@media (hover: hover) { .o-tile:hover .tile-face { transform: rotate(3deg) translate(4px, -3px); } }
.o-tile.is-open .tile-face { transform: translate(70px, 96px) rotate(19deg); box-shadow: inset 0 0 0 1px rgba(70, 36, 10, 0.4), 8px 14px 18px rgba(0, 0, 0, 0.45); }
.o-tile.is-open .tile-corner { opacity: 0; }

/* The drawer under the board */
.o-drawer { left: 1500px; top: 2430px; z-index: 1; width: 600px; height: 92px; }
.drawer-front {
  position: relative;
  display: block;
  height: 100%;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(#7c5232, #573620);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.12), inset 0 -4px 0 rgba(0, 0, 0, 0.35), 0 18px 30px rgba(0, 0, 0, 0.55);
  transition: transform 0.5s cubic-bezier(0.3, 0.9, 0.3, 1);
}
.o-drawer.is-open .drawer-front { transform: translateY(26px); }
.drawer-label { position: absolute; left: 50%; top: 12px; width: 150px; margin-left: -75px; padding: 4px 0 3px; border: 2px solid #c79b45; background: #efe2c2; color: #3b2a10; font: 700 12px/1 var(--f-head); letter-spacing: 0.16em; text-align: center; text-transform: uppercase; }
.drawer-pull { position: absolute; left: 50%; top: 46px; width: 120px; height: 16px; margin-left: -60px; border-radius: 8px; background: linear-gradient(#f0cf7a, #9c7424); box-shadow: 0 3px 4px rgba(0, 0, 0, 0.5); }
.drawer-keyhole { position: absolute; left: 50%; top: 68px; width: 10px; height: 14px; margin-left: -5px; background: radial-gradient(circle at 50% 30%, #120b06 0 3px, transparent 3.5px), linear-gradient(#120b06, #120b06) 50% 100% / 3px 8px no-repeat; }
@media (hover: hover) { .o-drawer:hover .drawer-front { transform: translateY(6px); } }
.o-drawer.rattle .drawer-front { animation: rattle 0.4s ease; }
@keyframes rattle { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.o-tile.hinted .tile-face { box-shadow: inset 0 0 0 2px rgba(255, 233, 166, 0.7), 1px 2px 2px rgba(0, 0, 0, 0.22); }

.yeti-step {
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  height: 56px;
  border-radius: 46% 46% 40% 40%;
  background: rgba(244, 248, 255, 0.92);
  box-shadow: 0 0 0 2px rgba(110, 130, 160, 0.45), 0 3px 6px rgba(0, 0, 0, 0.25);
  font-size: 0;
  pointer-events: none;
  animation: step-fade 4.2s ease forwards;
}
.yeti-step::before { content: ""; position: absolute; left: 2px; right: 2px; top: -14px; height: 12px; background: radial-gradient(circle at 15% 60%, rgba(244, 248, 255, 0.92) 0 5px, transparent 5.5px), radial-gradient(circle at 50% 40%, rgba(244, 248, 255, 0.92) 0 5px, transparent 5.5px), radial-gradient(circle at 85% 60%, rgba(244, 248, 255, 0.92) 0 5px, transparent 5.5px); }
@keyframes step-fade { 0% { opacity: 0; transform-origin: center; } 10% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }

/* The wall left of the board: a reference shelf */
.wall { position: absolute; left: -640px; top: 520px; z-index: 1; width: 520px; }
.shelf {
  position: relative;
  padding: 34px 22px 8px;
  border: 12px solid #5a3a22;
  border-radius: 4px;
  background: linear-gradient(#3a2416, #24160c);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), inset 0 0 40px rgba(0, 0, 0, 0.65);
  transform-origin: 100% 50%;
  transition: transform 1s cubic-bezier(0.4, 0.1, 0.3, 1);
}
.shelf.is-open { transform: perspective(1400px) rotateY(32deg); }
.shelf-label { position: absolute; left: 50%; top: 6px; margin: 0 0 0 -70px; width: 140px; padding: 3px 0 2px; background: linear-gradient(#e2c06a, #a8822e); color: #2d1f08; font: 700 11px/1 var(--f-head); letter-spacing: 0.16em; text-align: center; text-transform: uppercase; }
.shelf-row { display: flex; align-items: flex-end; gap: 5px; height: 250px; margin-bottom: 22px; padding: 0 8px; border-bottom: 16px solid #6b4526; box-shadow: 0 10px 12px -6px rgba(0, 0, 0, 0.6); }
.book {
  flex: none;
  width: 58px;
  height: 220px;
  padding: 12px 0;
  border: 0;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.3), transparent 14%, rgba(255, 255, 255, 0.12) 50%, transparent 86%, rgba(0, 0, 0, 0.35)), var(--bk, #7a2a22);
  color: #f3e6c8;
  font: 700 13px/1.1 var(--f-head);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  cursor: pointer;
  transform-origin: 50% 100%;
  transition: transform 0.25s ease;
  box-shadow: inset 0 6px 0 rgba(255, 255, 255, 0.08), inset 0 -10px 0 rgba(0, 0, 0, 0.2);
}
.book span { display: block; max-height: 100%; overflow: hidden; }
.book:focus { outline: none; }
.book:focus-visible { outline: 3px dashed #ffe9a6; outline-offset: 3px; }
@media (hover: hover) { .book:hover { transform: translateY(-10px); } }
.b-pg { --bk: #20456b; height: 228px; }
.b-pg2 { --bk: #2b5a86; height: 214px; }
.b-diss { --bk: #23407a; width: 66px; height: 236px; }
.b-carnegie { --bk: #8d6a1d; width: 64px; height: 232px; color: #1f1505; }
.b-shanghai { --bk: #b84a2a; height: 190px; width: 50px; }
.b-atlas { --bk: #1f5a45; width: 76px; height: 238px; }
.b-bus { --bk: #c49a2e; color: #1f1505; height: 176px; width: 48px; }
.b-rules { --bk: #5a1f1f; height: 206px; }
.b-sol { --bk: #3a3f45; height: 222px; }
.b-thin { --bk: #b4232b; width: 30px; height: 200px; font-size: 10px; }
.book.pulled { transform: translateY(-34px) rotate(-14deg); }
.book.nudge { animation: nudge 0.4s ease; }
@keyframes nudge { 40% { transform: translateY(-14px) rotate(3deg); } }

.frame-plate { left: 1660px; top: -24px; z-index: 2; white-space: nowrap; padding: 4px 16px 3px; border-radius: 2px; background: linear-gradient(#e2c06a, #a8822e); color: #2d1f08; font: 700 11px/1 var(--f-head); letter-spacing: 0.16em; text-transform: uppercase; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }

/* ---------- Invisible ink, darkness and glow ---------- */

.ink { position: absolute; left: 0; top: 0; z-index: 14; width: 3600px; height: 2400px; pointer-events: none; display: none; clip-path: circle(0 at 0 0); }
body.uv-on .ink { display: block; }
.ink-note {
  position: absolute;
  max-width: 280px;
  color: #e2d0ff;
  font: 500 27px/1.08 var(--f-hand);
  text-shadow: 0 0 6px rgba(168, 110, 255, 0.95), 0 0 1px #fff;
  transform: rotate(-3deg);
}
.ink-note.seen { color: #fff2c6; }
[data-ink="coffee"] { left: 1690px; top: 690px; transform: rotate(4deg); }
[data-ink="shanghai"] { left: 2440px; top: 1250px; max-width: 300px; }
[data-ink="walk"] { left: 860px; top: 1410px; max-width: 230px; }
[data-ink="boost"] { left: 720px; top: 1735px; }
[data-ink="runs"] { left: 1760px; top: 1815px; max-width: 210px; transform: rotate(3deg); }
[data-ink="combo"] { left: 3030px; top: 1020px; max-width: 520px; }
[data-ink="tile"] { left: 2200px; top: 2040px; }
[data-ink="events"] { left: 500px; top: 800px; max-width: 320px; }
[data-ink="films"] { left: 400px; top: 1440px; max-width: 230px; transform: rotate(2deg); }
[data-ink="built"] { left: 1350px; top: 345px; max-width: 330px; }
[data-ink="v1"] { left: 2620px; top: 1190px; max-width: 300px; }
[data-ink="scooter"] { left: 3000px; top: 1790px; max-width: 360px; }

.dark {
  position: absolute;
  left: -1400px;
  top: -1000px;
  z-index: 13;
  width: 6400px;
  height: 4600px;
  background: #05070a;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
body.uv-on .dark { opacity: 0.42; }
body.lights-off .dark { opacity: 0.86; }
body.lights-off.uv-on .dark { opacity: 0.9; }

.glow { position: absolute; left: 0; top: 0; z-index: 15; width: 3600px; height: 2400px; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity 0.9s ease 0.25s, visibility 0s linear 1.2s; }
body.lights-off .glow { opacity: 1; visibility: visible; transition: opacity 0.9s ease 0.25s, visibility 0s; }
.glow-note { position: absolute; max-width: 300px; color: #c8ffbe; font: 500 27px/1.08 var(--f-hand); text-shadow: 0 0 7px rgba(110, 255, 140, 0.85); }
.gn-camp { left: 1500px; top: 1475px; transform: rotate(-2deg); }
.gn-exam { left: 2930px; top: 730px; max-width: 190px; transform: rotate(-4deg); }
.gn-joke { left: 110px; top: 2300px; transform: rotate(-3deg); }
.gn-rule { left: 1560px; top: 2330px; transform: rotate(1deg); max-width: 420px; }
.glow-stars { position: absolute; left: 1520px; top: 690px; width: 240px; height: 90px; }
.glow-stars i { position: absolute; width: 20px; height: 20px; background: #c8ffbe; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); box-shadow: 0 0 8px #7dff9c; }
.glow-stars i:nth-child(1) { left: 0; top: 40px; }
.glow-stars i:nth-child(2) { left: 40px; top: 10px; transform: scale(0.7); }
.glow-stars i:nth-child(3) { left: 80px; top: 52px; transform: scale(1.2); }
.glow-stars i:nth-child(4) { left: 130px; top: 20px; transform: scale(0.8); }
.glow-stars i:nth-child(5) { left: 170px; top: 64px; }
.glow-stars i:nth-child(6) { left: 210px; top: 6px; transform: scale(0.6); }
.glow-stars i:nth-child(7) { left: 112px; top: 76px; transform: scale(0.5); }
.glow-outline { position: absolute; border: 3px dashed #9dffb0; border-radius: 4px; box-shadow: 0 0 10px rgba(110, 255, 140, 0.7), inset 0 0 10px rgba(110, 255, 140, 0.5); }
.go-tile { left: 2232px; top: 2082px; width: 166px; height: 166px; }
.go-keyhole { left: 1782px; top: 2486px; width: 36px; height: 36px; border-radius: 50%; }
.go-book { left: 0; top: 0; width: 70px; height: 240px; }

/* ---------- Strings you tie yourself ---------- */

.string-deduced path { fill: none; stroke: #d81e2a; stroke-width: 3.4; stroke-linecap: round; }
.string-deduced path.twist { stroke: rgba(255, 220, 200, 0.75); stroke-width: 1.2; stroke-dasharray: 3 7; }
.string-deduced path.drawing { transition: stroke-dashoffset 0.9s ease; }
.string-live { fill: none; stroke: #e3232c; stroke-width: 3.4; stroke-linecap: round; stroke-dasharray: 9 6; pointer-events: none; }
.dtags { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; }
.dtag {
  position: absolute;
  left: 0;
  top: 0;
  padding: 2px 9px 1px;
  border: 1px solid rgba(142, 17, 24, 0.5);
  border-radius: 3px;
  background: #ffe9a6;
  color: var(--red-deep);
  font: 500 20px/1.1 var(--f-hand);
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}
.clue.string-from .face { outline: 3px solid #ffd34d; outline-offset: 6px; }
.clue.string-from .pin { animation: pin-pulse 0.8s ease-in-out infinite; }
body.string-mode .viewport,
body.string-mode .clue { cursor: crosshair; }
.clue.nope { animation: nope 0.4s ease; }
@keyframes nope { 25% { transform: translate(calc(var(--x) - 8px), var(--y)) rotate(var(--r)); } 75% { transform: translate(calc(var(--x) + 8px), var(--y)) rotate(var(--r)); } }

/* ---------- The detective's tools ---------- */

.tray { position: absolute; left: 14px; bottom: 14px; z-index: 12; display: flex; gap: 8px; }
.tray-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 72px;
  padding: 8px 6px 6px;
  border: 1px solid #5a4330;
  border-radius: 8px;
  background: #2b1f15;
  color: #eadcc2;
  font: 700 11px/1.1 var(--f-head);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
}
.tray-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tray-btn:hover { background: #3a2a1c; color: #fff; }
.tray-btn:focus-visible { outline: 3px solid #ffd34d; outline-offset: 2px; }
#tool-string[aria-pressed="true"] { background: var(--red); border-color: #ff5a4f; color: #fff; }
#tool-uv[aria-pressed="true"] { background: #4a2389; border-color: #a57bff; color: #fff; }
#tool-light[aria-pressed="true"] { background: #0e1a12; border-color: #7dff9c; color: #c8ffbe; }
.tray.hello .tray-btn { animation: hello 1.6s ease 0.8s 2; }
@keyframes hello { 20% { transform: translateY(-6px); } 40% { transform: none; } }

.uv-lens {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 11;
  display: none;
  width: 230px;
  height: 230px;
  margin: -115px 0 0 -115px;
  border: 3px solid rgba(196, 160, 255, 0.9);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(150, 90, 255, 0.08) 0 60%, rgba(150, 90, 255, 0.22) 70%);
  box-shadow: 0 0 0 2px rgba(20, 0, 40, 0.5), 0 0 22px rgba(150, 90, 255, 0.55);
  pointer-events: none;
  will-change: transform;
}
body.uv-on .uv-lens { display: block; }
body.uv-touch .uv-lens { pointer-events: auto; touch-action: none; cursor: grab; }
.uv-lens::after { content: "drag me"; position: absolute; left: 50%; bottom: -30px; transform: translateX(-50%); color: #e2d0ff; font: 500 20px/1 var(--f-hand); white-space: nowrap; text-shadow: 0 0 6px rgba(168, 110, 255, 0.9); opacity: 0; }
body.uv-touch .uv-lens::after { opacity: 1; }

.string-hint {
  position: absolute;
  left: 50%;
  top: 12px;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: calc(100% - 24px);
  margin: 0;
  padding: 8px 10px 8px 14px;
  border-left: 5px solid var(--red);
  background: #fff6d8;
  color: var(--ink);
  font: 14px/1.3 var(--f-type);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  transform: translateX(-50%);
}
.string-hint[hidden] { display: none; }
.string-hint button { flex: none; padding: 5px 9px 4px; border: 2px solid var(--ink); border-radius: 3px; background: transparent; color: var(--ink); font: 700 12px/1 var(--f-head); letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; }

/* Deduction card, filed with a flourish */
.toast.deduction { max-width: min(520px, calc(100% - 32px)); padding: 14px 18px 12px; border-left-color: #d81e2a; background: #fffaf0 var(--paper-grain); }
.toast .t-kicker { display: block; margin-bottom: 4px; color: var(--red-deep); font: 700 11px/1.2 var(--f-type); letter-spacing: 0.14em; text-transform: uppercase; }
.toast .t-title { display: block; margin-bottom: 4px; font: 700 20px/1.1 var(--f-head); text-transform: uppercase; }

/* Leads in the desk bar */
.leads-btn {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px 0 9px;
  border: 1px solid #4a3725;
  border-radius: 6px;
  background: #2b1f15;
  color: #eadcc2;
  font: 14px/1 var(--f-type);
  white-space: nowrap;
  cursor: pointer;
}
.leads-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.leads-btn:hover { background: #3a2a1c; color: #fff; }
.leads-btn:focus-visible { outline: 3px solid #ffd34d; outline-offset: 2px; }
#leads-count { font-weight: 700; color: #fff3df; }
.leads-btn.bump { animation: bump 0.6s ease; }
@keyframes bump { 30% { transform: scale(1.18); background: #6b4a12; } }
.leads-btn.all { border-color: #f2c230; color: #ffe08a; }

.detective-stamp {
  position: absolute;
  right: 14px;
  bottom: 12px;
  padding: 5px 10px 3px;
  border: 4px double rgba(176, 128, 20, 0.95);
  border-radius: 6px;
  color: rgba(176, 128, 20, 0.95);
  font: 700 17px/1 var(--f-head);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: rotate(-7deg);
  -webkit-mask-image: var(--stamp-mask);
  mask-image: var(--stamp-mask);
  opacity: 0;
  pointer-events: none;
}
.casecard.detective .detective-stamp { opacity: 1; }
.casecard-tools { margin-top: 8px !important; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 40;
  width: max-content;
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 11px 16px 10px;
  border-left: 5px solid var(--red);
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.35 var(--f-type);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
/* Below 1200 px a centred toast reaches the tool tray: lift it above the tray. */
@media (max-width: 1200px) { .toast { bottom: 84px; } }

/* ---------- Under the lamp (dialog) ---------- */

.lamp {
  width: min(1000px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}
.lamp::backdrop {
  background: radial-gradient(ellipse 70% 80% at 50% 38%, rgba(48, 32, 14, 0.66), rgba(8, 5, 2, 0.92));
}
.lamp[open] .lamp-sheet { animation: lamp-in 0.28s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
@keyframes lamp-in { from { opacity: 0; transform: translateY(14px) scale(0.985); } }

.lamp-sheet {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  background: #f7f0e1 var(--paper-grain);
  border-radius: 3px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.lamp-top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 14px 10px 38px;
  border-bottom: 1px dashed #c9bb9e;
}
.lamp-exhibit { flex: 1; min-width: 0; margin: 0; font: 700 12px/1.3 var(--f-type); letter-spacing: 0.14em; text-transform: uppercase; color: var(--red-deep); }
.lamp-close {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 7px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  background: transparent;
  color: var(--ink);
  font: 700 14px/1 var(--f-head);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.lamp-x { font: 400 22px/0.6 var(--f-type); }
.lamp-close:hover { background: var(--ink); color: var(--paper); }
.lamp-close:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.lamp-scroll { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 26px 38px 30px; }

.lamp-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 36px; align-items: start; }
.lamp-grid.no-specimen { grid-template-columns: minmax(0, 1fr); }
.lamp-grid.no-specimen .lamp-specimen { display: none; }
.lamp-specimen { position: sticky; top: 0; display: flex; justify-content: center; padding: 26px 0 30px; }
.specimen { position: relative; transform: rotate(-2deg); }
.specimen.t-pennant { padding-top: 40px; }
.specimen .bib-note { right: -56px; bottom: -60px; }

.lamp-text { min-width: 0; }
#lamp-title:focus { outline: none; }
#lamp-title { margin: 0 0 18px; font: 700 40px/1.02 var(--f-head); text-transform: uppercase; letter-spacing: 0.005em; }

.lamp-body { font: 16.5px/1.62 var(--f-type); }
.lamp-body p { margin: 0 0 14px; }
.lamp-body h3 { margin: 4px 0 4px; font: 700 20px/1.3 var(--f-news); }
.lamp-body h3 .title { display: block; font: 400 14px/1.4 var(--f-type); color: var(--ink-soft); }
.lamp-body .meta,
.lamp-body .when,
.lamp-body .role { color: var(--ink-soft); font-size: 14.5px; }
.lamp-body .when { margin: 0 0 4px; font-weight: 700; letter-spacing: 0.04em; }
.lamp-body a { color: var(--red-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.lamp-body a:hover { color: var(--red); }
.lamp-body a:focus-visible,
.lamp-body button:focus-visible,
.lamp-source a:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.lamp-body .file + .file { margin-top: 22px; padding-top: 18px; border-top: 1px dashed #c9bb9e; }
.lamp-body .links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 14px; font-size: 15px; }
.lamp-body .lede { font-size: 17px; }
.lamp-body .emails { font-size: 18px; line-height: 1.9; }
.lamp-body .emails .meta { margin-left: 8px; }
.lamp-body mark {
  padding: 0 2px;
  background: linear-gradient(transparent 10%, rgba(255, 222, 66, 0.9) 10% 90%, transparent 90%);
  color: inherit;
}
.lamp-body .note { margin: 0 0 12px; color: var(--blue-ink); font: 500 26px/1.15 var(--f-hand); }
.excerpt { margin: 0 0 16px; }
.excerpt blockquote { margin: 0; padding: 12px 16px 2px; border-left: 4px solid var(--red); background: rgba(255, 255, 255, 0.6); }
.excerpt figcaption { margin-top: 6px; font-size: 14px; color: var(--ink-soft); }
.excerpt figcaption button { display: inline; text-align: left; }
.excerpt figcaption button,
.lamp-body [data-open] {
  padding: 0;
  border: 0;
  background: none;
  color: var(--red-deep);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.pdf-cta { margin-top: 18px !important; }
.pdf-cta a {
  display: inline-block;
  padding: 11px 16px 10px;
  background: var(--ink);
  color: var(--paper) !important;
  font: 700 15px/1.1 var(--f-head);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}
.pdf-cta a:hover { background: var(--red); }

.lamp-body .photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 14px 12px; margin: 18px 0 0; padding: 0; list-style: none; }
.lamp-body .photos li { padding: 6px 6px 8px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); }
.lamp-body .photos a { display: block; }
.lamp-body .photos img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.lamp-body .photos p { margin: 6px 0 0; font: 500 17px/1.05 var(--f-hand); color: #2a2a2a; }
.lamp-body .photos p span { display: block; font: 12px/1.3 var(--f-type); color: var(--ink-soft); }

.exhibit-photo { margin: 0 0 18px; }
.exhibit-frame { display: block; width: min(380px, 100%); padding: 12px 12px 14px; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); transform: rotate(-1deg); }
.exhibit-frame img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.exhibit-photo figcaption { margin-top: 12px; }
.exhibit-photo figcaption p { margin: 0; font: 500 28px/1.1 var(--f-hand); color: var(--ink); }
.exhibit-photo figcaption p span { display: block; font: 14px/1.4 var(--f-type); color: var(--ink-soft); }
.exhibit-photo .full-link { display: inline-block; margin-top: 6px; font-size: 14px; }
.exhibit-single { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 30px; align-items: end; }
.exhibit-single figcaption { margin: 0 0 8px; }
.exhibit-single .note { margin-top: 18px; }
.exhibit-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.exhibit-pair .exhibit-frame { padding: 8px 8px 10px; }
.exhibit-pair .exhibit-photo figcaption p { font-size: 22px; }

.lamp-strings { margin-top: 26px; padding-top: 18px; border-top: 2px solid var(--ink); }
.lamp-strings[hidden] { display: none; }
.lamp-strings h3 { margin: 0 0 10px; color: var(--red); font: 500 30px/1 var(--f-hand); }
.lamp-strings ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.follow {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 12px;
  width: 100%;
  padding: 10px 12px 9px;
  border: 1px solid #d5c7aa;
  border-left: 5px solid var(--red);
  background: #fffaf0;
  color: var(--ink);
  font: 15px/1.35 var(--f-type);
  text-align: left;
  cursor: pointer;
}
.follow:hover { border-color: var(--red); background: #fff; }
.follow:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.follow-name { font-weight: 700; }
.follow-name::before { content: "\2192\00a0"; color: var(--red); }
.follow-why { color: var(--ink-soft); font: 500 19px/1.1 var(--f-hand); }
.follow-state { margin-left: auto; color: #8a7d68; font: 500 11px/1.4 var(--f-head); letter-spacing: 0.1em; text-transform: uppercase; }
.follow.is-new .follow-state { color: var(--red); }
.lamp-source { margin: 18px 0 0; font-size: 14px; color: var(--ink-soft); }
.lamp-source a { color: var(--red-deep); }


/* ---------- Games and rooms under the lamp ---------- */

.lamp.is-scene .lamp-sheet { background-color: #efe6d2; }
.game { margin: 4px 0 18px; }
.game-note { margin: 10px 0 0; color: var(--blue-ink); font: 500 24px/1.15 var(--f-hand); }
.game-row { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-top: 12px; }
.btn-ink {
  display: inline-block;
  padding: 10px 14px 9px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  background: var(--ink);
  color: var(--paper);
  font: 700 14px/1.1 var(--f-head);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.btn-ink:hover { background: var(--red); border-color: var(--red); }
.btn-ink.ghost { background: transparent; color: var(--ink); }
.btn-ink.ghost:hover { background: var(--ink); color: var(--paper); }
.btn-ink:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.btn-ink[disabled] { opacity: 0.45; cursor: default; }
.rubber-big {
  display: inline-block;
  padding: 6px 16px 4px;
  border: 5px double currentColor;
  border-radius: 6px;
  font: 700 30px/1 var(--f-head);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: rotate(-8deg);
  -webkit-mask-image: var(--stamp-mask);
  mask-image: var(--stamp-mask);
}
.rubber-big.red { color: rgba(180, 30, 38, 0.92); }
.rubber-big.green { color: rgba(28, 112, 60, 0.92); }
.rubber-big.pop { animation: stamp-pop 0.42s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
@keyframes stamp-pop { 0% { opacity: 0; transform: rotate(-8deg) scale(2.2); } 100% { opacity: 1; transform: rotate(-8deg) scale(1); } }

/* Verify the claim */
.fc-deck { padding: 18px 20px 16px; background: #1f2a44; color: #f4f6fb; border-radius: 4px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); }
.fc-deck small { display: block; margin-bottom: 6px; color: #aab6d3; font: 12px/1.3 var(--f-type); letter-spacing: 0.1em; text-transform: uppercase; }
.fc-claim { display: block; font: 700 34px/1.05 var(--f-head); text-transform: uppercase; }
.fc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.fc-doc { width: 100%; height: 100%; padding: 10px 12px 9px; border: 1px solid #c9bb9e; border-left: 5px solid #8a7d68; background: #fffaf0; color: var(--ink); font: 14px/1.35 var(--f-type); text-align: left; cursor: pointer; }
.fc-doc:hover { border-color: var(--red); }
.fc-doc b { display: block; }
.fc-doc .fc-verdict { display: block; margin-top: 4px; color: var(--red); font: 500 19px/1.1 var(--f-hand); }
.fc-doc.checked { background: #f1e9d8; border-left-color: var(--red); }
.fc-result { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 16px; }

/* Declassify the memo */
.memo-doc { position: relative; padding: 22px 24px 20px; background: #f4f1e6 var(--paper-grain); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); font: 16px/2 var(--f-type); }
.memo-doc .memo-head { font-size: 13px; }
.redact {
  position: relative;
  display: inline-block;
  margin: 0 1px;
  padding: 0 3px;
  border: 0;
  border-radius: 2px;
  background: rgba(255, 222, 66, 0.55);
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
  white-space: nowrap;
  cursor: pointer;
}
.redact::after {
  content: "";
  position: absolute;
  inset: 0 -1px;
  border-radius: 2px;
  background: #141210;
  transform-origin: 0 50%;
  transition: transform 0.45s cubic-bezier(0.5, 0, 0.3, 1);
}
.redact.lifted { cursor: default; }
.redact.lifted::after { transform: scaleX(0); }
.redact:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.memo-doc .rubber-big { position: absolute; right: 18px; bottom: 14px; }

/* The safe's lock */
.lock {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px 18px;
  padding: 22px 18px;
  border-radius: 12px;
  background: linear-gradient(145deg, #646b72, #30353a);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), 0 6px 16px rgba(0, 0, 0, 0.35);
}
.lock.shake { animation: shake 0.45s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.wheel { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.wheel label { color: #e2e6ea; font: 700 11px/1.2 var(--f-head); letter-spacing: 0.12em; text-transform: uppercase; }
.wheel input {
  width: 92px;
  height: 64px;
  border: 3px solid #a8822e;
  border-radius: 8px;
  background: linear-gradient(#141414, #3a3a3a 50%, #141414);
  color: #fff3df;
  font: 700 34px/1 var(--f-type);
  text-align: center;
}
.wheel input:focus-visible { outline: 3px solid #ffd34d; outline-offset: 2px; }
.wheel button { width: 48px; height: 30px; border: 0; border-radius: 6px; background: linear-gradient(#e2c06a, #a8822e); color: #2d1f08; font: 700 15px/1 var(--f-type); cursor: pointer; }
.wheel button:focus-visible { outline: 3px solid #ffd34d; outline-offset: 2px; }
.lock-go { align-self: center; }
.lock-msg { min-height: 1.4em; margin: 12px 0 0; color: var(--red-deep); font: 500 24px/1.15 var(--f-hand); }
.safe-inside { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 16px; }
.cr {
  position: relative;
  padding: 26px 14px 14px;
  border: 0;
  border-radius: 0 6px 6px 6px;
  background: linear-gradient(172deg, #e4c483, #cfa65f);
  color: #2d1f08;
  font: 14px/1.35 var(--f-type);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 6px 12px -4px rgba(0, 0, 0, 0.45);
  animation: rise 0.5s cubic-bezier(0.2, 1.2, 0.4, 1) both;
}
.cr:nth-child(2) { animation-delay: 0.12s; }
.cr:nth-child(3) { animation-delay: 0.24s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
.cr b { display: block; font: 700 20px/1.1 var(--f-head); text-transform: uppercase; }
.cr::before { content: "Closed run"; position: absolute; left: 0; top: -20px; padding: 4px 12px 0; height: 20px; border-radius: 6px 6px 0 0; background: #dcbb78; font: 700 10px/1.4 var(--f-head); letter-spacing: 0.14em; text-transform: uppercase; }
.cr.read { background: linear-gradient(172deg, #efdcb2, #dcc08a); }
.cr:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.cr-text { margin-top: 14px; padding: 14px 16px; background: #fffaf0; border-left: 4px solid var(--red); }
.cr-text p { margin: 0 0 10px; }

/* Interrogation tapes */
.recorder-ui { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 20px; align-items: start; }
.rec-machine { padding: 16px; border-radius: 12px; background: linear-gradient(#55555c, #2a2a2e); box-shadow: inset 0 0 0 2px #6a6a72; }
.rec-machine .rec-reels { height: 64px; }
.rec-machine .reel { width: 46px; height: 46px; }
.rec-machine.playing .reel { animation: spin 1.6s linear infinite; }
.rec-counter { margin: 10px 0 0; padding: 4px 8px; background: #111; color: #ff8a3d; font: 700 15px/1.2 var(--f-type); letter-spacing: 0.2em; text-align: center; }
.tape-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tape-btn { width: 100%; padding: 8px 10px 7px; border: 1px solid #d5c7aa; border-left: 5px solid #8a7d68; background: #fffaf0; color: var(--ink); font: 14px/1.3 var(--f-type); text-align: left; cursor: pointer; }
.tape-btn:hover { border-color: var(--red); }
.tape-btn[aria-pressed="true"] { border-left-color: var(--red); background: #fff; font-weight: 700; }
.tape-btn.played::after { content: " ✓"; color: #1c703c; }
.transcript { min-height: 150px; margin-top: 14px; padding: 14px 16px; background: #fff; border: 1px dashed #c9bb9e; font: 15.5px/1.6 var(--f-type); white-space: pre-wrap; }
.transcript .q { display: block; color: var(--ink-soft); }
.transcript .a { display: block; margin-top: 8px; }
.caret { display: inline-block; width: 8px; height: 1.1em; margin-left: 1px; vertical-align: -2px; background: var(--ink); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Hidden compartment and the cipher wheel */
.compartment { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; padding: 18px; border-radius: 6px; background: radial-gradient(ellipse at 50% 40%, #3a2716, #1a110a); box-shadow: inset 0 8px 20px rgba(0, 0, 0, 0.7); }
.comp-item { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; background: #f6efdf var(--paper-grain); box-shadow: 0 6px 12px rgba(0, 0, 0, 0.45); }
.comp-key { width: 120px; height: 46px; background:
  radial-gradient(circle at 20px 23px, transparent 0 8px, #d9b25a 8.5px 19px, transparent 19.5px),
  linear-gradient(#d9b25a, #b88d32) 34px 18px / 76px 10px no-repeat,
  linear-gradient(#d9b25a, #b88d32) 86px 28px / 8px 12px no-repeat,
  linear-gradient(#d9b25a, #b88d32) 100px 28px / 8px 16px no-repeat; transform: rotate(-12deg); }
.comp-key.taken { opacity: 0.25; }
.cipher-msg { margin: 0; font: 700 17px/1.6 var(--f-type); letter-spacing: 0.12em; word-break: break-word; }
.cipher-msg.solved { color: #1c703c; }
.cipher { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cipher svg { width: 100%; max-width: 300px; height: auto; touch-action: none; cursor: grab; }
.cipher .ring-outer text { fill: #1f1a14; font: 700 15px var(--f-type); }
.cipher .ring-inner text { fill: #8e1118; font: 700 14px var(--f-type); }
.cipher .ring-inner { transition: transform 0.25s ease; }
.cipher-shift { font: 700 14px/1 var(--f-type); letter-spacing: 0.1em; text-transform: uppercase; }

/* The cold cases drawer */
.cabinet { padding: 18px 16px 10px; border-radius: 4px; background: linear-gradient(#5e3d24, #3d2615); box-shadow: inset 0 10px 18px rgba(0, 0, 0, 0.55); }
.cf-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 26px 10px; margin: 0; padding: 18px 0 0; list-style: none; }
.cf {
  position: relative;
  width: 100%;
  min-height: 92px;
  padding: 14px 12px 10px;
  border: 0;
  border-radius: 0 6px 4px 4px;
  background: linear-gradient(172deg, #e4c483, #cfa65f);
  color: #2d1f08;
  font: 700 15px/1.2 var(--f-head);
  letter-spacing: 0.02em;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 10px -4px rgba(0, 0, 0, 0.6);
  transition: transform 0.2s ease;
}
.cf::before { content: attr(data-no); position: absolute; left: 0; top: -18px; height: 18px; padding: 3px 10px 0; border-radius: 6px 6px 0 0; background: #dcbb78; font: 700 10px/1.2 var(--f-head); letter-spacing: 0.14em; }
.cf:hover { transform: translateY(-6px); }
.cf:focus-visible { outline: 3px solid #ffd34d; outline-offset: 2px; }
.cf.read { background: linear-gradient(172deg, #efdcb2, #dcc08a); }
.cf.read::after { content: "Read"; position: absolute; right: 8px; bottom: 6px; color: rgba(28, 112, 60, 0.92); font: 700 11px/1 var(--f-head); letter-spacing: 0.14em; }
.cf-open { position: relative; margin-top: 18px; perspective: 1200px; }
.cf-cover { position: absolute; inset: 0; z-index: 2; border-radius: 0 6px 6px 6px; background: linear-gradient(172deg, #e4c483, #cfa65f); transform-origin: 0 50%; animation: cover-open 0.75s cubic-bezier(0.4, 0.1, 0.3, 1) forwards; pointer-events: none; }
@keyframes cover-open { to { transform: rotateY(-178deg); opacity: 0; } }
.cf-page { padding: 18px 20px 14px; background: #fffaf0 var(--paper-grain); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35); }
.cf-page h3 { margin: 0 0 4px !important; font: 700 24px/1.1 var(--f-head) !important; text-transform: uppercase; }
.cf-page .cf-meta { margin: 0 0 12px; color: var(--red-deep); font: 700 12px/1.3 var(--f-type); letter-spacing: 0.12em; text-transform: uppercase; }
.cf-page .file p { margin: 0 0 12px; }
.cf-status { margin: 4px 0 0 !important; color: var(--blue-ink); font: 500 24px/1.15 var(--f-hand) !important; }

/* The archive room */
.room {
  position: relative;
  padding: 20px 18px 18px;
  border-radius: 4px;
  background:
    linear-gradient(transparent 70%, #3b2717 70%),
    repeating-linear-gradient(90deg, #4a3322 0 6px, #523826 6px 120px);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.6);
}
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.room-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 132px;
  padding: 14px 14px 12px;
  border: 0;
  border-radius: 3px;
  background: #f6efdf var(--paper-grain);
  color: var(--ink);
  font: 14px/1.35 var(--f-type);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s ease;
}
.room-item:hover { transform: translateY(-4px) rotate(-0.5deg); }
.room-item:focus-visible { outline: 3px solid #ffd34d; outline-offset: 3px; }
.room-item b { font: 700 19px/1.1 var(--f-head); text-transform: uppercase; }
.room-item .hand { color: var(--blue-ink); font-size: 21px; }
.room-item.ri-trap { background: linear-gradient(#5e3d24, #3d2615); color: #f3e6c8; }
.room-item.ri-trap .hand { color: #ffd9a8; }
.room-item.seen { box-shadow: 0 0 0 3px rgba(28, 112, 60, 0.7), 0 8px 16px rgba(0, 0, 0, 0.45); }
.room-back { margin-bottom: 14px; }
.room-view { padding: 18px 20px; background: #fffaf0 var(--paper-grain); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3); }
.room-view h3 { margin: 0 0 8px !important; font: 700 24px/1.1 var(--f-head) !important; text-transform: uppercase; }
.carry-chart { display: block; width: 100%; height: auto; margin: 6px 0 12px; background: #fbfbf3; border: 1px solid #c9bb9e; }
.carry-chart path { fill: none; stroke: #1f1a14; stroke-width: 2; }
.carry-chart .zero { stroke: #b4232b; stroke-dasharray: 5 5; stroke-width: 1.5; }
.carry-chart text { fill: #5b4f40; font: 12px var(--f-type); }
.ice { padding: 18px; border-radius: 6px; background: linear-gradient(160deg, #e9f6ff, #b8d9ef); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.8), inset 0 0 30px rgba(120, 170, 210, 0.6); }

/* The typewriter */
.typewriter { padding: 18px 16px 16px; border-radius: 10px; background: linear-gradient(#3d3f44, #1f2023); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.15); }
.tw-paper {
  height: 280px;
  margin: 0 auto;
  padding: 18px 22px;
  overflow: auto;
  background: #fbf8ee var(--paper-grain);
  color: #1d1a16;
  font: 15px/1.6 var(--f-type);
  white-space: pre-wrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
}
.tw-paper:focus-visible { outline: 3px solid #ffd34d; outline-offset: 2px; }
.tw-paper.ding { animation: ding 0.25s ease; }
@keyframes ding { 50% { transform: translateX(-6px); } }
.tw-keys { display: flex; justify-content: center; gap: 6px; margin-top: 14px; }
.tw-keys i { width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fbf8ee 0 40%, #9a9a9a 44%, #2b2b2b 70%); box-shadow: 0 3px 0 #111; }
.tw-keys i.hit { transform: translateY(3px); box-shadow: 0 0 0 #111; }

/* The polaroid stack */
.pstack-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pstack { position: relative; width: 280px; height: 380px; }
.pcard { position: absolute; left: 0; top: 0; width: 280px; height: 360px; border: 0; padding: 0; background: none; cursor: pointer; perspective: 1000px; transition: transform 0.45s cubic-bezier(0.3, 0.9, 0.3, 1), opacity 0.45s ease; }
.pcard:focus-visible { outline: 3px solid var(--red); outline-offset: 4px; }
.pcard-inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.55s cubic-bezier(0.4, 0.1, 0.3, 1); }
.pcard.flipped .pcard-inner { transform: rotateY(180deg); }
.pfront, .pback { position: absolute; inset: 0; display: block; padding: 14px 14px 56px; background: #fdfcf8; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35); -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.pfront img { display: block; width: 100%; height: 100%; object-fit: cover; background: #d8d2c4; }
.pback { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 20px; transform: rotateY(180deg); background: #f4efe2 var(--paper-grain); text-align: center; }
.pback .hand { color: var(--blue-ink); font-size: 34px; line-height: 1.05; }
.pback .typed { margin-top: 10px; font-size: 14px; }
.pcard.under-1 { transform: translate(10px, 8px) rotate(4deg); }
.pcard.under-2 { transform: translate(-12px, 12px) rotate(-5deg); }
.pcard.away { transform: translate(120%, 30px) rotate(14deg); opacity: 0; }
.pcount { font: 13px/1.3 var(--f-type); color: var(--ink-soft); }

/* The world map, unfolded */
.map-wrap { position: relative; margin-top: 6px; border: 1px solid #b9a77f; background: #ede3ca; }
.map-canvas { display: block; width: 100%; height: auto; touch-action: manipulation; }
.map-canvas.on-pin { cursor: pointer; }
.map-tip { position: absolute; z-index: 2; margin: 0; padding: 3px 8px 2px; background: #1f1a14; color: #f6efdf; font: 13px/1.3 var(--f-type); white-space: nowrap; transform: translate(-50%, -150%); pointer-events: none; }
.next-run { position: absolute; z-index: 1; border: 2px dashed #b4232b; border-radius: 50%; pointer-events: none; }
.map-zoom { position: absolute; right: 8px; top: 8px; z-index: 2; }
.map-stats { margin: 0 0 6px !important; font: 700 13px/1.3 var(--f-type); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.trips-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.trip-btn { padding: 7px 11px 6px; border: 2px solid var(--trip, #b4232b); border-radius: 3px; background: #fffaf0; color: var(--ink); font: 700 13px/1 var(--f-head); letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; }
.trip-btn[aria-pressed="true"] { background: var(--trip, #b4232b); color: #fff; }
.trip-btn:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.trip-caption { min-height: 1.5em; margin: 10px 0 0 !important; }
.map-panel .photos { margin-top: 10px !important; }
.map-place { margin: 14px 0 0 !important; }

/* ---------- Case notes ---------- */

.notes {
  width: min(760px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}
.notes::backdrop { background: radial-gradient(ellipse 70% 80% at 50% 38%, rgba(48, 32, 14, 0.66), rgba(8, 5, 2, 0.92)); }
.notes[open] .notes-sheet { animation: lamp-in 0.28s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
.notes-sheet {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  background-color: #fbf9f2;
  background-image:
    linear-gradient(90deg, transparent 46px, rgba(214, 90, 96, 0.6) 46px 47.5px, transparent 47.5px),
    repeating-linear-gradient(transparent 0 31px, rgba(90, 130, 200, 0.28) 31px 32px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.notes-top { display: flex; align-items: center; gap: 16px; padding: 14px 14px 10px 62px; border-bottom: 2px solid var(--ink); }
#notes-title { flex: 1; margin: 0; font: 700 30px/1 var(--f-head); text-transform: uppercase; }
#notes-title:focus { outline: none; }
#notes-num { color: var(--red); }
.notes-scroll { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 14px 26px 26px 62px; }
.notes-sub { margin: 0 0 12px; color: var(--ink-soft); font: 14px/1.5 var(--f-type); }
.notes-reward { margin: 0 0 12px; color: #8a6406; font: 500 26px/1.15 var(--f-hand); }
.notes-h { margin: 22px 0 6px; color: var(--red); font: 500 30px/1 var(--f-hand); }
.notes-tip { margin: 0 0 8px; font: 13.5px/1.45 var(--f-type); color: var(--ink-soft); }
.notes-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.notes-list li { position: relative; padding: 6px 0 6px 30px; font: 14.5px/1.45 var(--f-type); }
.notes-list li::before { content: ""; position: absolute; left: 0; top: 9px; width: 16px; height: 16px; border: 2px solid #8a7d68; border-radius: 3px; }
.notes-list li.found::before { border-color: var(--red); background: linear-gradient(45deg, transparent 44%, var(--red) 44% 56%, transparent 56%), linear-gradient(-45deg, transparent 44%, var(--red) 44% 56%, transparent 56%); }
.notes-list strong { display: block; font-weight: 700; }
.notes-list li.unfound strong { color: #8a7d68; letter-spacing: 0.2em; }
.notes-list li.unfound span { color: var(--blue-ink); font: 500 21px/1.15 var(--f-hand); }
.notes-list li.found span { color: var(--ink-soft); }
.notes-foot { margin: 24px 0 0; }
.notes-reset { padding: 0; border: 0; background: none; color: var(--ink-soft); font: 13px/1.3 var(--f-type); text-decoration: underline; cursor: pointer; }

/* ---------- Case summary (read it all) ---------- */

.dossier { display: none; padding: calc(var(--bar) + 28px) 16px 64px; }
body.view-summary .dossier { display: block; }
.dossier:focus { outline: none; }
.dossier [id] { scroll-margin-top: calc(var(--bar) + 20px); }

.sheet {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding: 44px 56px 40px;
  background: var(--paper) var(--paper-grain);
  border-top: 10px solid var(--red);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  color: var(--ink);
}
.dossier-kicker {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 0 0 22px;
  font: 700 13px/1.4 var(--f-type);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.dossier a { color: var(--red-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.dossier a:hover { color: var(--red); }
.dossier a:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.dossier-back { letter-spacing: 0.06em; }
.dossier h1 { margin: 0 0 6px; font: 700 clamp(40px, 7vw, 58px)/1 var(--f-head); text-transform: uppercase; }
.dossier h2 {
  margin: 46px 0 14px;
  padding-top: 16px;
  border-top: 2px solid var(--ink);
  font: 700 26px/1.2 var(--f-head);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.dossier h3 { margin: 0 0 4px; font: 700 20px/1.3 var(--f-news); }
.dossier h3 a { color: var(--ink); }
.dossier p { margin: 0 0 14px; font: 16.5px/1.65 var(--f-type); }
.dossier .role { color: var(--ink-soft); font-size: 17px; }
.dossier .links { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 6px 0 22px; font: 15.5px/1.5 var(--f-type); }
.dossier .lede { font-size: 17.5px; }
.dossier .meta { color: var(--ink-soft); font-size: 14.5px; }
.dossier .item { margin-top: 24px; }
.dossier .timeline { margin: 0; padding: 0; list-style: none; }
.dossier .timeline li { display: grid; grid-template-columns: 9.5rem 1fr; gap: 18px; padding: 14px 0; }
.dossier .timeline li + li { border-top: 1px dashed #c9bb9e; }
.dossier .timeline .when { margin: 3px 0 0; color: var(--ink-soft); font-size: 14px; font-weight: 700; }
.dossier .timeline .title { display: block; font: 400 15px/1.4 var(--f-type); color: var(--ink-soft); }
.dossier .timeline li p:last-child { margin-bottom: 0; }
.dossier .photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 14px; margin: 20px 0 0; padding: 0; list-style: none; }
.dossier .photos li { padding: 7px 7px 9px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transform: rotate(-1deg); }
.dossier .photos li:nth-child(even) { transform: rotate(1.2deg); }
.dossier .photos li:nth-child(3n) { transform: rotate(-0.4deg); }
.dossier .photos a { display: block; }
.dossier .photos img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.dossier .photos p { margin: 7px 0 0; font: 500 18px/1.05 var(--f-hand); color: #2a2a2a; }
.dossier .photos p span { display: block; margin-top: 2px; font: 12px/1.3 var(--f-type); color: var(--ink-soft); }
.dossier .contact .emails { font-size: 18px; line-height: 1.9; }
.dossier .contact .emails .meta { margin-left: 8px; }
.dossier-end { margin: 40px 0 0 !important; padding-top: 16px; border-top: 1px dashed #c9bb9e; text-align: center; font-weight: 700 !important; }


.toc { margin: 4px 0 6px; padding: 12px 16px 10px; border: 1px dashed #b9a77f; background: rgba(255, 255, 255, 0.45); }
.toc-title { margin: 0 0 6px !important; font: 700 12px/1.3 var(--f-type) !important; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
.toc ol { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; padding: 0; list-style: none; font: 15px/1.5 var(--f-type); counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc li::before { content: counter(toc) ". "; color: var(--ink-soft); }
.dossier .closed-list { margin: 8px 0 0; padding: 0; list-style: none; }
.dossier .closed-list li { margin-bottom: 12px; padding: 4px 0 2px 14px; border-left: 4px solid var(--red); }
.dossier .closed-name { margin: 0 0 4px; font-weight: 700; }
.dossier .closed-name .meta { font-weight: 400; margin-left: 6px; }
.ski-trophy { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 8px 14px; border: 3px double var(--red); }
.ski-trophy strong { font: 700 22px/1.1 var(--f-head); text-transform: uppercase; }
.ski-trophy span { color: var(--ink-soft); font-size: 14px; }
.dossier .photo-strip { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.more-photos { margin: 14px 0 0; }
.more-photos summary,
.countries summary,
.appendix summary {
  display: inline-block;
  padding: 9px 14px 8px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  font: 700 14px/1.1 var(--f-head);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}
.more-photos summary::-webkit-details-marker,
.countries summary::-webkit-details-marker,
.appendix summary::-webkit-details-marker { display: none; }
.more-photos summary:hover,
.countries summary:hover,
.appendix summary:hover { background: var(--ink); color: var(--paper); }
.more-photos summary:focus-visible,
.countries summary:focus-visible,
.appendix summary:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.more-photos .less,
.more-photos[open] .more { display: none; }
.more-photos[open] .less { display: inline; }
.trips { margin-top: 26px; }
.trips h3 { margin-bottom: 8px; }
.trip-list { margin: 0 0 12px; padding: 0 0 0 18px; font: 15.5px/1.6 var(--f-type); }
.trip-list li { margin-bottom: 8px; }
.countries { margin-top: 10px; }
.countries dl { margin: 14px 0 0; font: 15px/1.55 var(--f-type); }
.countries dt { font-weight: 700; }
.countries dd { margin: 0 0 10px; }
.appendix { margin-top: 40px; padding-top: 16px; border-top: 2px solid var(--ink); }
.appendix summary span { text-transform: none; letter-spacing: 0.02em; font-weight: 500; }
.appendix-list { margin: 18px 0 0; }
.appendix-list dt { margin-top: 14px; font: 700 18px/1.3 var(--f-news); }
.appendix-list dd { margin: 4px 0 0; }
.appendix-list dd p { margin-bottom: 8px; }
.dossier .photo-solo { grid-template-columns: minmax(0, 180px); margin-top: 10px; }
.print-report { margin: 0 0 0 auto; }
.dossier-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 18px; margin: 30px 0 0; }
.dossier-tools button { padding: 9px 14px 8px; border: 2px solid var(--ink); border-radius: 3px; background: transparent; color: var(--ink); font: 700 14px/1.1 var(--f-head); letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; }
.dossier-tools button:hover { background: var(--ink); color: var(--paper); }
.dossier-tools button:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.print-only { display: none; }

/* ---------- Small screens ---------- */

/* Between phone and desktop the top bar runs out of room: compact it so the
   case number and the "Case summary" link always stay visible. */
@media (max-width: 1000px) {
  .deskbar { gap: 10px; padding: 0 12px; }
  .progress-label { display: none; }
  .progress-bar { width: 40px; margin-left: 6px; }
  .summary-sub { display: none; }
  .deskbar-tools #zoom-in,
  .deskbar-tools #zoom-out { display: none; }
  .deskbar-case { flex: none; }
}

@media (max-width: 860px) {
  .case-name { display: none; }
  .recorder-ui,
  .compartment { grid-template-columns: minmax(0, 1fr); }
  .lamp-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .lamp-specimen { position: static; padding: 18px 0 14px; }
  .specimen { zoom: 0.82; }
}

@media (max-width: 640px) {
  :root { --bar: 52px; }
  .deskbar { gap: 8px; padding: 0 10px; }
  .case-no { font-size: 13px; letter-spacing: 0.1em; }
  .progress-label { display: none; }
  .progress-bar { width: 34px; margin-left: 6px; }
  .deskbar-tools #zoom-in,
  .deskbar-tools #zoom-out { display: none; }
  .tool { width: 34px; height: 34px; }
  .summary-sub { display: none; }
  .summary-link,
  .board-link { padding: 9px 10px 8px; font-size: 13px; }
  .lamp { width: calc(100vw - 16px); max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
  .lamp-sheet { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
  .lamp-top { padding: 10px 10px 8px 18px; }
  .lamp-close { padding: 7px 9px 6px; font-size: 13px; }
  .lamp-scroll { padding: 14px 18px 24px; }
  .specimen { zoom: 0.7; }
  #lamp-title { font-size: 30px; }
  .lamp-body { font-size: 15.5px; }
  .exhibit-pair,
  .exhibit-single { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .follow-state { margin-left: 0; width: 100%; }
  .toast { bottom: 84px; font-size: 14px; }
  .leads-label { display: none; }
  .leads-btn { height: 34px; gap: 4px; padding: 0 8px; }
  .tray { left: 8px; bottom: 8px; gap: 6px; }
  .tray-btn { min-width: 60px; padding: 6px 4px 5px; font-size: 10px; }
  .tray-btn svg { width: 20px; height: 20px; }
  .uv-lens { width: 176px; height: 176px; margin: -88px 0 0 -88px; }
  .string-hint { top: 8px; font-size: 13px; }
  .wheel input { width: 76px; height: 56px; font-size: 28px; }
  .notes-top { padding: 12px 10px 10px 18px; }
  .notes-scroll { padding: 12px 16px 22px 18px; }
  .notes-sheet { background-image: repeating-linear-gradient(transparent 0 31px, rgba(90, 130, 200, 0.28) 31px 32px); }
  #notes-title { font-size: 24px; }
  .fc-claim { font-size: 26px; }
  .pstack, .pcard { width: 240px; }
  .pstack { height: 330px; }
  .pcard { height: 310px; }
  .dossier { padding: calc(var(--bar) + 12px) 8px 40px; }
  .sheet { padding: 28px 18px 28px; }
  .dossier p { font-size: 15.5px; }
  .dossier .timeline li { grid-template-columns: 1fr; gap: 2px; }
  .dossier .photos { grid-template-columns: repeat(2, 1fr); gap: 14px 10px; }
}

@media (max-width: 400px) {
  .deskbar { gap: 5px; padding: 0 6px; }
  .cn-word { display: none; }
  .deskbar-tools .tool { width: 32px; height: 32px; }
  .case-no { font-size: 12px; letter-spacing: 0.04em; }
  .deskbar-progress { font-size: 13px; }
  .progress-bar { display: none; }
  .summary-link,
  .board-link { padding: 8px 9px 7px; letter-spacing: 0.05em; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Print: the case summary only ---------- */

@media print {
  body { background: #fff; overflow: visible; }
  .deskbar,
  .board-view,
  .lamp,
  .notes,
  .toast,
  .skip,
  .toc,
  .dossier-tools,
  .appendix,
  .more-photos,
  .countries summary,
  .dossier .photos,
  .dossier-back { display: none !important; }
  .print-only { display: block; }
  .print-head { margin: 0 0 14pt !important; padding-bottom: 6pt; border-bottom: 3px double #000; font: 700 11pt/1.3 var(--f-type) !important; letter-spacing: 0.14em; text-transform: uppercase; }
  .countries dl { margin-top: 4pt; }
  .dossier { display: block; padding: 0; }
  .sheet { box-shadow: none; background: #fff; border: 0; padding: 0; }
  .dossier a { color: inherit; text-decoration: none; }
}

/* ---------- Case not found (404) ---------- */

body.lost { overflow: auto; }
.lost-main { max-width: 680px; margin: 0 auto; padding: 48px 16px 64px; }
.lost-sheet { position: relative; padding: 40px 36px 34px; background: var(--paper) var(--paper-grain); border-top: 10px solid var(--red); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); }
.lost-sheet .rubber-big { position: absolute; right: 26px; top: 26px; }
.lost-kicker { margin: 0 0 12px; font: 700 13px/1.4 var(--f-type); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }
.lost h1 { margin: 0 0 16px; font: 700 clamp(36px, 8vw, 54px)/1 var(--f-head); text-transform: uppercase; }
.lost p { margin: 0 0 14px; font: 16.5px/1.6 var(--f-type); }
.lost-note { color: var(--blue-ink); font: 500 26px/1.15 var(--f-hand) !important; }
.lost-actions { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 22px !important; }
.lost a { color: var(--red-deep); }
.lost .btn-ink { color: var(--paper); }
@media (max-width: 640px) {
  .lost-sheet { padding: 30px 18px 24px; }
  .lost-sheet .rubber-big { position: static; margin-bottom: 14px; font-size: 22px; }
}

/* ---------- Version switcher (/shared/switch.css) ----------
   From 1280 px it sits in the desk bar. Below, the bar is full: on the board the switch
   joins the tools, as a tile at the bottom right; in the case summary it floats there too. */

:root {
  --vs-ink: #1f1a14;
  --vs-paper: #f6efdf;
  --vs-muted: #5b4f40;
  --vs-accent: #b4232b;
  --vs-here-bg: #b4232b;
  --vs-here-ink: #fff4e6;
  --vs-hover: #efe4cc;
  --vs-font: "Courier Prime", "Courier New", Courier, monospace;
  --vs-name-font: "Oswald", "Arial Narrow", sans-serif;
  --vs-btn-font: "Oswald", "Arial Narrow", sans-serif;
  --vs-btn-bg: #2b1f15;
  --vs-btn-ink: #eadcc2;
  --vs-btn-border: #4a3725;
  --vs-radius: 6px;
  --vs-border: 1px;
  --vs-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
  --vs-btn-shadow: none;
}
.deskbar .vs-slot { display: flex; flex: none; }
.deskbar .vs-btn {
  height: 36px;
  gap: 6px;
  padding: 0 12px 0 9px;
  font: 700 13px/1 var(--f-head);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.deskbar .vs-btn:hover { background: #3a2a1c; color: #fff; }
.deskbar .vs-btn:focus-visible { outline: 3px solid #ffd34d; outline-offset: 2px; }
.deskbar .vs-icon { width: 18px; height: 18px; }
.vs-panel { border-width: 2px; }
.vs-name { font-weight: 500; letter-spacing: 0.03em; text-transform: uppercase; }
.vs-here { font-family: var(--f-head); letter-spacing: 0.08em; text-transform: uppercase; transform: rotate(-3deg); }

@media (max-width: 1279px) {
  body:not(.view-summary) .deskbar .vs { position: fixed; right: 14px; bottom: 14px; }
  body:not(.view-summary) .deskbar .vs-btn {
    flex-direction: column;
    gap: 3px;
    min-width: 72px;
    height: auto;
    padding: 8px 8px 6px;
    border-color: #5a4330;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.1;
    letter-spacing: 0.06em;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
  }
  body:not(.view-summary) .deskbar .vs-icon { width: 24px; height: 24px; }
  body:not(.view-summary) .deskbar .vs-panel { top: auto; bottom: calc(100% + 8px); }
}
@media (max-width: 899px) {
  body.view-summary .deskbar .vs { position: fixed; right: 10px; bottom: 10px; }
  body.view-summary .deskbar .vs-btn { box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45); }
  body.view-summary .deskbar .vs-panel { top: auto; bottom: calc(100% + 8px); }
}
@media (max-width: 640px) {
  body:not(.view-summary) .deskbar .vs { right: 8px; bottom: 8px; }
  body:not(.view-summary) .deskbar .vs-btn { min-width: 60px; padding: 6px 6px 5px; font-size: 10px; }
  body:not(.view-summary) .deskbar .vs-icon { width: 20px; height: 20px; }
}
/* 404 page: room for the switcher in the top right corner on small screens. */
@media (max-width: 700px) { .lost-main { padding-top: 62px; } }
