/* play-lab tokens (design/styles/play-lab/meta.md). No radius, hard 2px ink borders, flat offset shadows. */
:root {
  --paper: #F5F0E5;
  --card-paper: #F8F4E9;
  --ink: #151515;
  --blue: #1557D6;
  --red: #E94B35;
  --yellow: #F3CF55;
  --muted: #675F53;
  --footer-muted: #CFC9BB;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 18px/1.5 Inter, system-ui, sans-serif;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
           max(28px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.shell { max-width: 640px; margin: 0 auto; }
.shell.tv { max-width: 1450px; }

h1, h2, h3 {
  font-family: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  text-transform: uppercase;
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}
h1 { font-size: clamp(3.2rem, 14vw, 5.5rem); }
h2 { font-size: 2.2rem; }
h3 { font-size: 1.5rem; font-weight: 800; }
.tv h1 { font-size: clamp(4rem, 8vw, 8rem); }
.tv h2 { font-size: clamp(2.4rem, 4vw, 4rem); }

.eyebrow, .num, .btn, legend, .chip, .label {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
  font-weight: 600;
}
.muted { color: var(--muted); }

.card {
  background: var(--card-paper);
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  padding: 20px;
  margin: 0 0 24px;
}
.card.blue { background: var(--blue); color: #fff; }
.card.yellow { background: var(--yellow); color: var(--ink); }
.card.ink { background: var(--ink); color: var(--paper); box-shadow: 6px 6px 0 var(--yellow); }
.tape {
  display: inline-block;
  background: var(--yellow);
  border: 2px solid var(--ink);
  padding: 2px 10px;
  transform: rotate(-2deg);
  margin-bottom: 14px;
}

.btn {
  display: inline-block;
  min-height: 48px;
  padding: 12px 20px;
  background: var(--blue);
  color: #fff;
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  font-size: 1rem;
}
.btn.red { background: var(--red); color: var(--ink); }
.btn.yellow { background: var(--yellow); color: var(--ink); }
.btn.ghost { background: var(--card-paper); color: var(--ink); }
.btn:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { background: var(--footer-muted); color: var(--ink); box-shadow: none; cursor: not-allowed; }
.btn.block { width: 100%; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.card.blue :focus-visible, .card.ink :focus-visible { outline-color: var(--yellow); }

input[type="text"] {
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--ink);
  font: 600 1.2rem "IBM Plex Mono", ui-monospace, monospace;
  border-radius: 0;
}
label.field { display: block; margin-bottom: 8px; }

.err { color: #A3200F; font-weight: 600; min-height: 1.5em; margin: 8px 0 0; }

/* clue cards */
.clue .num { display: block; margin-bottom: 6px; color: var(--muted); }
.clue .evidence { display: inline-block; margin: 0 0 10px; padding: 3px 8px; border: 2px solid var(--ink); background: var(--yellow); font: 700 0.85rem "IBM Plex Mono", monospace; text-transform: uppercase; letter-spacing: 0.05em; }
.clue p { margin: 0; font-size: 1.15rem; }
.cipher-text {
  font: 700 1.4rem/1.5 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.08em;
  word-break: break-word;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 14px;
  margin: 8px 0 14px;
}
.decoded { color: var(--yellow); }
.tool { border-top: 2px dashed var(--ink); padding-top: 12px; margin-top: 4px; }
input[type="range"] { width: 100%; height: 40px; accent-color: var(--blue); }
.hintbox { background: var(--yellow); border: 2px solid var(--ink); padding: 10px 12px; margin-top: 12px; }

/* accusation choices: real radios, visually a bordered tile */
fieldset { border: 0; padding: 0; margin: 0 0 20px; }
legend { padding: 0; margin-bottom: 8px; color: var(--ink); }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice span {
  display: block;
  min-height: 52px;
  padding: 12px;
  border: 2px solid var(--ink);
  background: var(--card-paper);
  font-weight: 600;
  line-height: 1.2;
}
.choice input:checked + span { background: var(--yellow); box-shadow: 4px 4px 0 var(--ink); font-weight: 700; }
/* cleared by one of my clues: struck text plus a label, never colour alone */
.choice .cname { font-weight: inherit; }
.choice span.cleared .cname { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--muted); }
.choice input:checked + span.cleared .cname { color: var(--ink); } /* muted on yellow is 4.15:1; ink is 12:1 */
.choice span.cleared .clabel { display: block; margin-top: 4px; font: 600 0.7rem "IBM Plex Mono", ui-monospace, monospace; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink); }
.choice input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 3px; }
.choice input:disabled { cursor: default; }
.choice input:disabled + span { color: var(--muted); }
.choice input:disabled:checked + span { color: var(--ink); }

/* lists and chips */
ol.rank { list-style: none; margin: 0; padding: 0; }
ol.rank li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 2px solid var(--ink); }
ol.rank li:last-child { border-bottom: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; list-style: none; }
.chip { border: 2px solid var(--ink); padding: 8px 12px; background: var(--card-paper); }
.chip.done { background: var(--ink); color: var(--paper); }
.chip.out { color: var(--muted); border-style: dashed; }

/* TV */
.tv .board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.tv .board ol { margin: 0; padding: 0; list-style: none; font-size: clamp(1.3rem, 2.2vw, 2rem); font-weight: 600; }
.tv .board li { border-bottom: 2px solid var(--ink); padding: 8px 0; }
.strike {
  display: block; width: 100%; text-align: left; cursor: pointer;
  font: inherit; color: var(--ink); background: transparent; border: 0; padding: 0;
}
.strike:hover:not(.on) { background: var(--yellow); }
.strike.on:hover { outline: 2px dashed var(--ink); outline-offset: 2px; }
.strike.on { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 3px; }
.strike.on::after { content: " (crossed off)"; font: 600 0.5em "IBM Plex Mono", monospace; text-transform: uppercase; letter-spacing: 0.06em; text-decoration: none; display: inline-block; }
.hint { margin: 16px 0 0; }
.tv .join-url { font: 700 clamp(1.6rem, 4vw, 3.4rem)/1.1 "IBM Plex Mono", monospace; word-break: break-all; }
.tv .chip { font-size: clamp(1rem, 1.6vw, 1.5rem); }
.tv .answer { font: 900 clamp(2.4rem, 5vw, 5rem)/1 "Barlow Condensed", Impact, sans-serif; text-transform: uppercase; }
.tv ol.rank { font-size: clamp(1.2rem, 2vw, 1.8rem); }
.case-title { font: 900 1.5rem/1.1 "Barlow Condensed", Impact, sans-serif; text-transform: uppercase; margin: 0 0 14px; }
.stage .beat { margin-top: 18px; }
.stage .beat .label { color: var(--paper); margin: 0 0 4px; }
.stage .culprit-lead { margin-top: 28px; color: var(--yellow); }
.stage .answer { margin: 0 0 8px; }
.stage .chips { margin-top: 12px; }
.chip.yes { background: var(--yellow); }
.chip.no { color: var(--muted); border-style: dashed; }
.hostbar { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

@media (max-width: 720px) { .tv .board { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .btn:hover:not(:disabled), .btn:active:not(:disabled) { transform: none; }
}
