/* Conspiracy Board: night desk. A dark desk under a warm lamp, caution tape,
   a cork board with pushpins and red string, paper cards held on with washi
   tape, typewriter labels on highlighter strips and rubber stamps. */

@font-face {
  font-family: "Alfa Slab One";
  src: url("/alfa-slab-one.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Patrick Hand";
  src: url("/patrick-hand.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --desk: #17182a;
  --text: #f3ead8; /* on the desk */
  --muted: #bdb7cc; /* on the desk */
  --paper: #fffdf6;
  --ink: #2a2320; /* on paper */
  --ink-soft: #6b5d52; /* on paper */
  --rule: #e2d8c6;
  --red: #ff4d5e;
  --red-deep: #c8102e;
  --red-dark: #a01828;
  --yellow: #ffd23f;
  --blue: #3ec1ff;
  --blue-dark: #1a6f99;
  --mint: #9df0c0;
  --mint-dark: #2f8a58;
  --pink: #ff8bd1;
  --cork: #b9864f;
  --manila: #ffc078;

  --display: "Alfa Slab One", "Rockwell", "Roboto Slab", Georgia, serif;
  --hand: "Patrick Hand", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  --type: ui-monospace, "Courier New", Courier, monospace;
  --news: Georgia, "Times New Roman", serif;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tape: repeating-linear-gradient(-45deg, var(--yellow) 0 10px, var(--desk) 10px 20px);
  --radius: 12px;

  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--desk);
}

*, *::before, *::after { box-sizing: inherit; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 400 1rem/1.5 var(--font);
  /* A warm desk lamp above, a blue and a pink glow at the sides */
  background:
    radial-gradient(ellipse 90% 50% at 50% -5%, rgb(255 196 92 / 0.32), transparent 70%),
    radial-gradient(circle at 0% 85%, rgb(62 193 255 / 0.2), transparent 45%),
    radial-gradient(circle at 100% 55%, rgb(255 77 160 / 0.18), transparent 45%),
    var(--desk);
}

.masthead, main {
  width: min(36rem, 100% - 2rem);
  margin-inline: auto;
}
.masthead { display: flex; align-items: center; gap: 0.5rem; padding: 0.9rem 0 0.25rem; }
/* Caution tape after the name */
.masthead::after { content: ""; flex: 1; min-width: 2rem; height: 12px; margin-left: 0.4rem; border-radius: 2px; background: var(--tape); }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: #ffffff;
  text-decoration: none;
  font: 400 1.1rem/1 var(--display);
  letter-spacing: 0.01em;
}
.wordmark img { display: block; border-radius: 6px; }

.back {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-left: -0.35rem;
  border-radius: 50%;
  color: #ffffff;
  flex: none;
}
.back:hover { background: rgb(255 255 255 / 0.1); }
.back:active { background: rgb(255 255 255 / 0.18); }
.chevron {
  width: 0.7rem;
  height: 0.7rem;
  border-left: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  border-radius: 2px;
  transform: translateX(2px) rotate(45deg);
}

main { display: flex; flex-direction: column; gap: 1.25rem; padding: 1.25rem 0 4rem; }

h1, h2 { margin: 0; font-weight: 400; }
h2 { font: 400 1.05rem/1.25 var(--display); }
p { margin: 0; }

/* Big headings: white slab type with a deep red drop shadow. On paper, ink. */
.print {
  font-family: var(--display);
  color: #ffffff;
  text-shadow: 0.06em 0.06em 0 var(--red-deep);
  font-size: clamp(2rem, 8.5vw, 2.8rem);
  line-height: 1.04;
  overflow-wrap: anywhere;
}
.print.giant { font-size: clamp(2.6rem, 13vw, 4.2rem); line-height: 0.98; }
.card .print, .scrap .print { color: var(--ink); text-shadow: 0.05em 0.05em 0 rgb(200 16 46 / 0.45); }

.intro { display: flex; flex-direction: column; gap: 0.7rem; }
.intro p { font-size: 1.05rem; color: var(--muted); max-width: 31rem; }
.intro .tagline { font: 400 1.6rem/1.2 var(--hand); color: var(--text); }
.hint, .note { color: var(--muted); font-size: 0.92rem; }
.card .hint, .card .note { color: var(--ink-soft); }
.center { text-align: center; }
.room-label { font: 400 1rem/1.3 var(--display); color: var(--muted); overflow-wrap: anywhere; }

/* Section labels: typewriter type on a yellow highlighter strip */
.kicker { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; }
.kicker-label, .section-label {
  display: inline-block;
  align-self: flex-start;
  padding: 0.1rem 0.55rem;
  border-radius: 3px;
  background: var(--yellow);
  color: var(--desk);
  font: 700 0.9rem/1.35 var(--type);
  letter-spacing: 0.02em;
  rotate: -1.2deg;
  box-shadow: 2px 2px 0 var(--red-deep);
}
.dots { display: flex; gap: 5px; align-items: center; flex: none; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: #4a4d68; }
.dots i.on { background: var(--red); box-shadow: 0 0 6px var(--red); }

/* Paper boxes on the desk */
.card, .game, .scrap, .theory {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  border-radius: 6px;
  padding: 1.1rem;
  box-shadow: 3px 4px 0 rgb(0 0 0 / 0.35);
}
/* Washi tape holding paper to the desk */
.scrap::before, .theory::before, .case-note::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  width: 52px;
  height: 15px;
  margin-left: -26px;
  background: var(--washi, rgb(255 139 209 / 0.85));
  rotate: -4deg;
}
.theory:nth-of-type(3n + 1) { --washi: rgb(62 193 255 / 0.8); }
.theory:nth-of-type(3n + 2) { --washi: rgb(255 139 209 / 0.85); }
.theory:nth-of-type(3n) { --washi: rgb(255 210 63 / 0.9); }

/* Forms */
.stack { display: flex; flex-direction: column; gap: 1.1rem; }
.stack.tight { gap: 0.6rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.field > label, legend, .label { font-weight: 700; font-size: 0.98rem; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 0.55rem; }

input[type="text"], input[type="number"], input[type="time"], select, textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #ffffff;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
}
textarea { resize: vertical; font-family: var(--hand); font-size: 1.35rem; line-height: 1.3; }
::placeholder { color: #a99d8b; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; box-shadow: 0 0 0 4px rgb(62 193 255 / 0.55); }

.inline { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.inline input[type="number"] { width: 5.5rem; }
.inline select { width: auto; flex: 1; }

.counter-row { display: flex; justify-content: flex-end; margin-top: -0.7rem; }
.stack.tight > .counter-row { margin-top: -0.4rem; }
.counter { font-size: 0.85rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.counter.over { color: var(--red-deep); font-weight: 700; }

.check { display: flex; gap: 0.6rem; align-items: center; font-weight: 700; cursor: pointer; }
.check.light { font-weight: 500; }
.check input { accent-color: var(--red-deep); width: 1.15rem; height: 1.15rem; margin: 0; flex: none; }
.hours-text { font-weight: 500; color: var(--ink-soft); }
.quiet .ghost { padding: 0; }
.hours input[type="time"] { width: auto; flex: 1; min-width: 7rem; }
.hours label { font-weight: 600; font-size: 0.92rem; }

/* Buttons: chunky and pressable. Text is always centered, so two buttons side
   by side line up even when one label wraps and makes both taller. */
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 400 1rem/1.2 var(--display);
  letter-spacing: 0.02em;
  color: var(--desk);
  background: var(--blue);
  border: 0;
  border-radius: 10px;
  padding: 0.8rem 1.15rem;
  box-shadow: 0 5px 0 var(--blue-dark);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: transform 0.08s, box-shadow 0.08s;
}
button:active:not(:disabled), .button:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--blue-dark); }
.primary {
  width: 100%;
  background: var(--red);
  color: #ffffff;
  font-size: 1.15rem;
  padding: 0.95rem 1.2rem;
  box-shadow: 0 5px 0 var(--red-dark);
}
.primary:active:not(:disabled) { box-shadow: 0 1px 0 var(--red-dark); }
a.button.primary { width: auto; align-self: stretch; }
.danger { background: var(--red); color: #ffffff; box-shadow: 0 5px 0 var(--red-dark); align-self: flex-start; }
.ghost {
  display: inline-block;
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0.3rem 0;
  font: 500 0.92rem/1.4 var(--font);
  letter-spacing: 0;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  align-self: flex-start;
}
.card .ghost { color: var(--ink-soft); }
.ghost:active:not(:disabled) { transform: none; box-shadow: none; }
.center-link { align-self: center; }
.ghost.delete { color: var(--red); margin-top: 0.5rem; }
button:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
button:focus-visible, .button:focus-visible, a:focus-visible, [role="button"]:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.button-row { display: flex; gap: 0.8rem; align-items: stretch; }
.button-row > * { flex: 1 1 0; width: auto; min-width: 0; }

/* Avatars */
.avatar {
  --size: 2.6rem;
  width: var(--size);
  height: var(--size);
  flex: none;
  display: inline-block;
  border: 2px solid var(--ink);
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
}
.avatar.small { --size: 1.6rem; border-width: 1.5px; border-radius: 4px; }
.avatar.empty { background: transparent; border: 2px dashed rgb(42 35 32 / 0.35); }
.px {
  display: block;
  width: 100%;
  height: 100%;
  background-image: url("/avatars.png");
  background-size: 500% 500%;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.55rem; }
.pick { position: relative; cursor: pointer; display: block; }
.pick input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.pick .avatar { width: 100%; height: auto; aspect-ratio: 1; display: block; transition: transform 0.12s, box-shadow 0.12s; }
.pick:hover .avatar { transform: translateY(-2px); }
.pick:has(input:checked) .avatar { transform: translateY(-3px) rotate(-4deg); box-shadow: 3px 3px 0 var(--red-deep), 0 0 0 3px var(--blue); }
.pick:has(input:focus-visible) .avatar { outline: 3px solid var(--blue); outline-offset: 2px; }
.pick:has(input:disabled) { cursor: not-allowed; }
.pick:has(input:disabled) .avatar { opacity: 0.3; filter: grayscale(1); }

.seats { display: flex; flex-wrap: wrap; padding-left: 0.4rem; }
.seats .avatar { margin-left: -0.4rem; box-shadow: 0 0 0 3px var(--paper); }
.small-seats .avatar { --size: 1.9rem; }

/* People */
.players { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.players li { display: flex; gap: 0.65rem; align-items: center; padding: 0.45rem 0.6rem; border-radius: 10px; }
.pname { font-weight: 700; overflow-wrap: anywhere; min-width: 0; }
.tag { font-size: 0.75rem; font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 999px; border: 1.5px solid var(--rule); color: var(--ink-soft); white-space: nowrap; }
.tag.done { border-color: var(--mint-dark); background: var(--mint); color: #12402a; margin-left: auto; }
.ghost.remove { margin-left: auto; padding: 0.2rem 0; font-size: 0.85rem; color: var(--red-deep); align-self: center; }
.players li .tag.done + .ghost.remove { margin-left: 0.5rem; }
.players li.kick-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  align-items: start;
  margin: -0.1rem 0 0.4rem;
  padding: 0.75rem;
  border: 2px dashed rgb(42 35 32 / 0.4);
}
.kick-option { display: flex; flex-direction: column; gap: 0.35rem; }
.kick-option button { width: 100%; padding: 0.6rem 0.8rem; font-size: 0.92rem; }
.kick-option .hint { font-size: 0.8rem; }

.invite input { font-size: 0.9rem; }

.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin: 0; }
.settings dt { font-size: 0.8rem; color: var(--ink-soft); }
.settings dd { margin: 0.1rem 0 0; font-weight: 700; font-size: 0.95rem; line-height: 1.3; }

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  align-self: flex-start;
  padding: 0.4rem 0.9rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pill .dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--red); animation: pulse 1.6s ease-in-out infinite; }
.pill.wait { align-self: stretch; justify-content: center; }
.pill.on { background: var(--mint); }
.pill.paused { background: #e3e9f6; }
@keyframes pulse { 50% { transform: scale(0.55); opacity: 0.5; } }

/* Your move */
.hero { display: flex; flex-direction: column; gap: 0.8rem; padding: 0.25rem 0; }
.hero-label { font-weight: 700; color: var(--muted); }
.card .hero-label { color: var(--ink-soft); }
.pause-button { align-self: flex-start; padding: 0.55rem 1rem; font-size: 0.92rem; }

/* The mystery, pinned to the desk */
.case-note {
  position: relative;
  align-self: center;
  width: min(100%, 24rem);
  padding: 1.2rem 1.1rem 1rem;
  background: #ffffff;
  color: var(--ink);
  text-align: center;
  box-shadow: 3px 4px 0 rgb(0 0 0 / 0.35);
  rotate: -1deg;
  --washi: rgb(126 224 129 / 0.8);
}
.case-label { font: 700 0.72rem/1 var(--font); letter-spacing: 0.14em; text-transform: uppercase; color: var(--red-deep); margin-bottom: 0.4rem; }
.case-text { font: 400 1.2rem/1.25 var(--display); overflow-wrap: anywhere; }

/* --- The corkboard ------------------------------------------------------ */
.wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: inset 0 0 0 6px #6b4a2b, inset 0 0 0 8px #3d2a18, 0 0 40px rgb(255 210 63 / 0.15), 0 10px 24px rgb(0 0 0 / 0.5);
  background: var(--cork);
}
.wrap.glide, .wrap.glide .board { transition: height 0.7s ease, transform 0.8s ease; }
.board {
  position: absolute;
  left: 0;
  top: 0;
  width: 360px;
  transform-origin: 0 0;
  background:
    radial-gradient(circle at 20% 30%, rgb(0 0 0 / 0.08) 0 1px, transparent 2px) 0 0 / 9px 11px,
    radial-gradient(circle at 70% 60%, rgb(255 255 255 / 0.1) 0 1px, transparent 2px) 0 0 / 13px 7px,
    radial-gradient(circle at 50% 50%, rgb(80 40 10 / 0.12) 0 1.5px, transparent 2.5px) 0 0 / 17px 19px,
    var(--cork);
}
/* The board's frame stays on top of everything pinned to it */
.wrap::after { content: ""; position: absolute; inset: 0; border-radius: 12px; box-shadow: inset 0 0 0 6px #6b4a2b, inset 0 0 0 8px #3d2a18; pointer-events: none; }

.mystery {
  position: absolute;
  left: 121px;
  width: 118px;
  padding: 0.75rem 0.55rem 0.6rem;
  text-align: center;
  background: #ffffff;
  color: var(--ink);
  font-family: var(--display);
  line-height: 1.22;
  overflow-wrap: anywhere;
  box-shadow: 2px 3px 8px rgb(0 0 0 / 0.35);
  rotate: -1.5deg;
  transition: opacity 0.5s;
}
.mystery small { display: block; font: 700 9px/1 var(--font); letter-spacing: 0.14em; text-transform: uppercase; color: var(--red-deep); margin-bottom: 5px; }
.mystery.dim { opacity: 0.35; }

/* Clue cards. On the board they're 116 board-pixels wide. */
.clue {
  position: relative;
  display: block;
  padding: 14px 9px 9px;
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  box-shadow: 2px 3px 6px rgb(0 0 0 / 0.3);
}
.board .clue { position: absolute; width: 116px; transition: opacity 0.5s, box-shadow 0.3s; }
.board .clue-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 7; line-clamp: 7; overflow: hidden; }
.clue.index { background: #fffdf6 repeating-linear-gradient(transparent 0 15px, #b9d3ea 15px 16px); background-position: 0 6px; border-top: 2px solid var(--blue); font-family: var(--type); }
.clue.polaroid { background: #fdfdfb; padding: 8px 8px 10px; font: 15px/1.12 var(--hand); }
.clue.polaroid .photo { display: grid; place-items: center; height: 54px; margin-bottom: 6px; font-size: 24px; background: radial-gradient(circle at 30% 30%, #5a6b78, #20262c); }
.clue.clip {
  background: #f2ecdd;
  font: 700 13px/1.25 var(--news);
  clip-path: polygon(0 4%, 9% 0, 20% 3%, 33% 0, 47% 4%, 60% 0, 74% 3%, 88% 0, 100% 4%, 98% 30%, 100% 55%, 97% 80%, 100% 100%, 85% 96%, 70% 100%, 55% 96%, 40% 100%, 25% 96%, 10% 100%, 0 96%, 3% 70%, 0 45%, 2% 20%);
}
.clue.clip small { display: block; font: 700 8px/1.2 var(--news); letter-spacing: 0.08em; border-bottom: 1px solid #8a8070; margin-bottom: 4px; padding-bottom: 2px; }
.clue.sticky { background: #ffe36e; font: 15px/1.15 var(--hand); }
.clue.sticky.mint { background: var(--mint); }
.clue.sticky.pink { background: #ffb3dc; }
.clue.sticky::before { content: ""; position: absolute; top: -7px; left: 50%; width: 44px; height: 14px; margin-left: -22px; background: rgb(126 224 129 / 0.75); rotate: -4deg; }
.clue.dim { opacity: 0.35; }
.clue.hot { box-shadow: 0 0 0 3px var(--yellow), 2px 3px 10px rgb(0 0 0 / 0.4); }
.clue.gone { visibility: hidden; }
.board .clue[role="button"] { cursor: pointer; }

svg.strings { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.string { fill: none; stroke: var(--red-deep); stroke-width: 2.4; stroke-linecap: round; filter: drop-shadow(1px 2px 1px rgb(0 0 0 / 0.35)); transition: opacity 0.5s; }
.string.bold { stroke-width: 3.4; }
.string.faded { opacity: 0.32; }
.string.pull { transition: stroke-dashoffset 0.9s ease 0.5s; }
.glow { fill: none; stroke: #ffd54a; stroke-width: 11; stroke-linecap: round; opacity: 0.85; }
.hit { fill: none; stroke: transparent; stroke-width: 22; pointer-events: stroke; cursor: pointer; }
.pin circle:first-child { stroke: rgb(0 0 0 / 0.45); stroke-width: 1; }
.pin .shine { fill: rgb(255 255 255 / 0.6); }
.pin.dim { opacity: 0.45; }

/* Rubber stamps that thud onto the board */
.stamp-mark {
  position: absolute;
  left: 50%;
  translate: -50% 0;
  rotate: -14deg;
  padding: 2px 12px;
  border: 4px double var(--red-deep);
  color: var(--red-deep);
  font: 400 30px/1.2 var(--display);
  letter-spacing: 0.06em;
  white-space: nowrap;
  opacity: 0.9;
  mix-blend-mode: multiply;
  pointer-events: none;
}
.thud { animation: thud 0.45s cubic-bezier(0.3, 1.4, 0.6, 1) 0.4s both; }
@keyframes thud { from { scale: 2.4; opacity: 0; } to { scale: 1; opacity: 0.9; } }
.drop { animation: drop 0.5s cubic-bezier(0.3, 1.3, 0.6, 1) both; }
@keyframes drop { from { opacity: 0; translate: 0 -28px; scale: 1.1; } to { opacity: 1; translate: 0 0; scale: 1; } }
.pin.drop { animation-name: fade-in; animation-duration: 0.3s; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.tap { text-align: center; font-size: 0.92rem; color: var(--muted); font-weight: 600; }

/* Torn paper scraps for theories */
.scrap {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1.1rem 1.1rem 1rem;
  border-radius: 0;
  clip-path: polygon(0 0, 100% 1.5%, 99.4% 40%, 100% 100%, 60% 98.5%, 30% 100%, 0 98.5%, 0.6% 50%);
  rotate: -0.6deg;
}
.scrap::before { top: 4px; }
.scrap-label { font: 700 0.75rem/1.2 var(--font); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.scrap-pair { font-size: 0.86rem; line-height: 1.35; color: var(--ink-soft); overflow-wrap: anywhere; }
.scrap-pair .link { color: var(--red-deep); font-weight: 800; }
.theory-text { font: 400 1.4rem/1.22 var(--hand); overflow-wrap: anywhere; }
.scrap-votes { font-weight: 800; color: var(--red-deep); }
.by {
  display: table;
  margin: 0.4rem 0 0 auto;
  padding: 0 0.5rem;
  border: 3px double var(--red-deep);
  color: var(--red-deep);
  font: 400 0.95rem/1.5 var(--display);
  text-transform: uppercase;
  rotate: -4deg;
}
.by.small { margin: 0.35rem 0 0; font-size: 0.72rem; border-width: 2px; rotate: -2deg; }
.redact { display: inline-block; min-width: 4.5em; margin-left: 0.2em; background: #111111; color: transparent; border-radius: 2px; rotate: -1deg; user-select: none; -webkit-user-select: none; }
.quote { font-family: var(--hand); font-size: 1.1rem; }

/* Connecting two clues */
.pair { gap: 0.8rem; }
.pair-label { font: 700 0.85rem/1.3 var(--type); color: var(--yellow); }
.pair-board {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
  align-items: start;
  padding: 1.4rem 0.9rem 1rem;
  border-radius: 12px;
  background:
    radial-gradient(circle at 20% 30%, rgb(0 0 0 / 0.08) 0 1px, transparent 2px) 0 0 / 9px 11px,
    radial-gradient(circle at 50% 50%, rgb(80 40 10 / 0.12) 0 1.5px, transparent 2.5px) 0 0 / 17px 19px,
    var(--cork);
  box-shadow: inset 0 0 0 5px #6b4a2b, 0 6px 16px rgb(0 0 0 / 0.4);
}
.pair-board .clue { font-size: 14px; padding-top: 24px; }
.pair-board .clue.polaroid { padding-top: 22px; }
.pair-board .clue.sticky { font-size: 17px; }
.pair-board .clue:first-child { rotate: -2deg; }
.pair-board .clue:nth-child(2) { rotate: 2deg; }
.pair-board .clue.pinned::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 50%;
  width: 11px;
  height: 11px;
  margin-left: -5.5px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: inset -2px -2px 0 rgb(0 0 0 / 0.25), 0 1px 2px rgb(0 0 0 / 0.4);
  z-index: 2;
}
.pair-board .clue.sticky::before { display: none; }
.pair-string { position: absolute; left: 0; top: 1.55rem; width: 100%; height: 2.2rem; overflow: visible; pointer-events: none; }
.pair-string .string { vector-effect: non-scaling-stroke; stroke-width: 2.6; }

/* Unexplained evidence: a manila folder */
.folder { display: flex; flex-direction: column; }
.folder-tab {
  align-self: flex-start;
  margin-left: 0.9rem;
  padding: 0.35rem 0.9rem 0.25rem;
  border-radius: 8px 8px 0 0;
  background: #f2a65a;
  color: #4d2c0a;
  font: 700 0.8rem/1.2 var(--type);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.folder-body { display: flex; flex-direction: column; gap: 0.8rem; padding: 1rem; border-radius: 6px 10px 10px 10px; background: var(--manila); color: #4d2c0a; box-shadow: 0 6px 14px rgb(0 0 0 / 0.35); }
.folder-cards, .cold-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 1rem; }
.folder-card { display: flex; flex-direction: column; align-items: flex-start; }
.folder-card .clue { width: 100%; font-size: 14px; rotate: -1.5deg; }
.folder-card:nth-child(even) .clue { rotate: 1.5deg; }
.folder-card .by.small { align-self: flex-start; }
.cold-cards .by.small { color: var(--yellow); border-color: var(--yellow); }
.folder-note { font-weight: 700; }

/* A card zoomed in, at reading size */
.evidence-big { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.evidence-big .clue { width: min(100%, 18rem); font-size: 17px; rotate: -1deg; }
.evidence-big .clue.polaroid, .evidence-big .clue.sticky { font-size: 21px; }
.evidence-big .clue.clip { font-size: 18px; }
.evidence-big .by { margin: 0; color: var(--yellow); border-color: var(--yellow); }

/* Voting */
.theory { display: flex; flex-direction: column; gap: 0.45rem; }
.theory.mine { background: #e8e2d6; }
.theory.chosen { box-shadow: 0 0 0 3px var(--red), 3px 4px 0 rgb(0 0 0 / 0.35); }
.theory-foot { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; }
.theory-foot .by { margin: 0.2rem 0 0; white-space: nowrap; }
.vote { padding: 0.5rem 1.1rem; font-size: 0.95rem; background: var(--mint); color: var(--desk); box-shadow: 0 4px 0 var(--mint-dark); flex: none; }
.vote:active:not(:disabled) { box-shadow: 0 1px 0 var(--mint-dark); }
span.vote { display: inline-flex; align-items: center; border-radius: 10px; font: 400 0.95rem/1.2 var(--display); }
.vote.on { background: var(--red); color: #ffffff; box-shadow: 0 4px 0 var(--red-dark); }
.button-row .pill.on { justify-content: center; align-self: center; }

/* The winner */
.winner {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.1rem;
  border: 3px solid #e3b21b;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 0 0 5px rgb(227 178 27 / 0.25), 0 0 30px rgb(255 213 74 / 0.25);
}
.winner.none { border-color: var(--rule); box-shadow: 3px 4px 0 rgb(0 0 0 / 0.35); }
.winner-label { font: 400 1.05rem/1.25 var(--display); color: #a77b00; }
.winner.none .winner-label { color: var(--ink); }
.winner-one { display: flex; flex-direction: column; gap: 0.3rem; }
.winner-one + .winner-one { padding-top: 0.7rem; border-top: 1.5px dashed var(--rule); }
.winner-meta { font-weight: 700; color: var(--ink-soft); }

/* Room codes: a dashed "cut here" slip inside the invite card */
.code-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1rem;
  padding: 0.9rem 1rem;
  border: 2px dashed var(--ink);
  border-radius: 10px;
  background: #fff3c4;
}
.code-card .label { flex-basis: 100%; font-size: 0.85rem; color: var(--ink-soft); }
.code {
  font: 400 clamp(1.6rem, 8vw, 2.3rem)/1 var(--display);
  letter-spacing: 0.04em;
  color: var(--red-deep);
  white-space: nowrap;
  user-select: all;
  -webkit-user-select: all;
}
.code-card button { margin-left: auto; }

.join-row { display: flex; gap: 0.6rem; }
.join-row input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: 0.04em; }
.join-row input::placeholder { text-transform: none; letter-spacing: 0; }

.steps { margin: 0; padding-left: 1.4rem; display: flex; flex-direction: column; gap: 0.55rem; }
.steps li { padding-left: 0.25rem; }
.steps li::marker { font-family: var(--display); color: var(--red-deep); }

/* Your games */
.home .tagline { color: var(--yellow); }
.demo { width: min(100%, 21rem); align-self: center; rotate: 1deg; }
.game {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  text-decoration: none;
  transition: transform 0.08s;
}
.game:active { transform: translateY(2px); }
.game.mine { box-shadow: 0 0 0 3px var(--yellow), 3px 4px 0 rgb(0 0 0 / 0.35); }
.game-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 0.6rem; }
.game-title { flex: 1 1 9rem; min-width: 0; font: 400 1.15rem/1.25 var(--display); overflow-wrap: break-word; }
.game-status { color: var(--ink-soft); font-size: 0.92rem; font-weight: 500; }
.game-status.hot { color: var(--red-deep); font-weight: 800; font-size: 1rem; }
.game .pill { padding: 0.2rem 0.6rem; font-size: 0.8rem; flex: 0 1 auto; max-width: 100%; }

.notify:empty { display: none; }
.notify { display: flex; flex-direction: column; gap: 0.4rem; }
.notify .inline .pill, .notify .inline .ghost { align-self: center; }

.message { display: flex; flex-direction: column; gap: 1rem; }
.message p { color: var(--muted); font-size: 1.05rem; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 1rem);
  width: max-content;
  max-width: calc(100% - 2rem);
  background: var(--paper);
  color: var(--ink);
  padding: 0.7rem 1.1rem;
  border-radius: 10px;
  font-weight: 600;
  box-shadow: 3px 3px 0 var(--red-deep);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 10;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast:empty { display: none; }

.noscript { padding: 2rem; text-align: center; }
[hidden] { display: none !important; }

@media (max-width: 380px) {
  .settings, .players li.kick-choices { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.countdown-me { font-size: clamp(2rem, 10vw, 3rem); line-height: 1.02; }
.manage .recovery { grid-column: 1 / -1; }
.manage .code { font-size: clamp(1.5rem, 7.5vw, 2rem); }

/* Finished games fold away under their heading on "Your games". */
.finished > summary { display: inline-flex; width: max-content; align-items: center; gap: 0.45rem; padding: 0.5rem 0; cursor: pointer; list-style: none; }
.finished > summary::-webkit-details-marker { display: none; }
.finished > summary::after { content: '▸'; display: inline-block; color: var(--yellow); transition: transform 0.15s; }
.finished[open] > summary::after { transform: rotate(90deg); }

/* A recovery code typed into the home page's room-code box gets a quiet nod. */
#join-code.found { border-color: var(--blue-dark); box-shadow: 0 0 0 2px var(--blue); }
.code-detected { font-size: 0.88rem; font-weight: 600; color: var(--blue-dark); }

/* The room page while waiting: a status box, the players, the creator's tools
   and your settings, each as a box with a small heading. */
.status-card { gap: 0.75rem; }
.status-card .pill.clock { align-self: stretch; }
.status-count { font-weight: 700; }
.status-foot { display: flex; flex-direction: column; gap: 0.35rem; padding-top: 0.75rem; border-top: 1.5px dashed var(--rule); }
.status-foot p { margin: 0; font-size: 0.92rem; color: var(--ink-soft); }
.group-label { margin: 0.6rem 0 -0.35rem; }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin: 0.6rem 0 -0.35rem; }
.group-head .group-label { margin: 0; }
.only-you { font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.players-card { padding: 0.5rem 0.75rem; }
.rows { padding: 0.2rem 1rem; display: flex; flex-direction: column; }
.mrow { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; padding: 0.8rem 0; }
.mrow[hidden] { display: none; }
.mrow + .mrow { border-top: 1.5px solid var(--rule); }
.mrow-text { min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.mrow-title { margin: 0; font-weight: 700; display: flex; align-items: center; gap: 0.45rem; }
.mrow-icon { width: 1.4rem; text-align: center; flex: none; }
.mrow-sub { margin: 0 0 0 1.85rem; font-size: 0.82rem; color: var(--ink-soft); }
.mrow-control:empty { display: none; }
.mini { padding: 0.45rem 1rem; font-size: 0.92rem; flex: none; min-width: 5.2rem; align-self: center; }
.mini-link { flex: none; padding: 0.45rem 0.4rem; font-size: 0.95rem; font-weight: 700; text-decoration: underline; }
.danger-text, .danger-row .mrow-title { color: var(--red-deep); }
.switch {
  flex: none; position: relative; width: 4.1rem; height: 2.1rem; padding: 0 0.55rem;
  display: flex; align-items: center; justify-content: flex-end;
  border-radius: 999px; border: 2px solid var(--ink); background: var(--rule); box-shadow: none;
  font: 800 0.8rem/1 var(--font); color: var(--ink);
}
.switch:active:not(:disabled) { transform: none; box-shadow: none; }
.switch::before {
  content: ""; position: absolute; left: 0.2rem; top: 50%; width: 1.45rem; height: 1.45rem; margin-top: -0.725rem;
  border-radius: 50%; border: 2px solid var(--ink); box-sizing: border-box; background: var(--paper);
}
.switch[aria-checked="true"] { justify-content: flex-start; background: var(--mint-dark); color: #ffffff; }
.switch[aria-checked="true"]::before { left: auto; right: 0.2rem; }

/* The lobby: game settings as label/value rows, and the rename form opens
   across the whole Creator tools row. */
.lobby-status .seats { margin: 0.2rem 0 0.4rem; }
.settings-card { padding: 0.2rem 1rem; }
.settings-card .settings { display: flex; flex-direction: column; gap: 0; }
.settings-card .settings div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.7rem 0; }
.settings-card .settings div + div { border-top: 1.5px solid var(--rule); }
.settings-card .settings dt { font-size: 0.9rem; flex: none; }
.settings-card .settings dd { margin: 0; text-align: right; }
.mrow.editing { flex-wrap: wrap; }
.mrow.editing > :last-child { flex-basis: 100%; display: flex; flex-direction: column; gap: 0.4rem; }
