:root {
  --bg: #1b1b1d; --panel: #26262a; --line: #3a3a40; --manila: #e6cf9c; --manila-d: #c9ad6e;
  --ink: #231c18; --red: #b3261e; --red-l: #e0463c; --paper: #f4ecd8; --dim: #a39d90; --fg: #f1ece0;
  --ok: #3f8f56; --type: "Special Elite", "Courier New", Courier, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg) radial-gradient(ellipse at 50% -10%, #2c2c31 0%, var(--bg) 60%) fixed;
  color: var(--fg); font: 16px/1.45 var(--sans); -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
h1, h2, h3, .type { font-family: var(--type); font-weight: 400; letter-spacing: .02em; margin: 0; }
button, input, select { font: inherit; }
.boot { text-align: center; margin-top: 40vh; color: var(--dim); font-family: var(--type); }
.dim { color: var(--dim); }
.center { text-align: center; }

.btn {
  min-height: 52px; padding: 12px 20px; border-radius: 10px; border: 2px solid var(--line);
  background: var(--panel); color: var(--fg); font-weight: 600; cursor: pointer; touch-action: manipulation;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.manila { background: var(--manila); border-color: var(--manila-d); color: var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.small { min-height: 48px; padding: 8px 14px; font-size: .9rem; }
.btn.block { display: block; width: 100%; }

.card {
  position: relative; background: var(--manila); color: var(--ink); border-radius: 6px 14px 14px 14px;
  padding: 22px; box-shadow: 0 10px 30px rgba(0,0,0,.45), inset 0 0 0 1px var(--manila-d);
}
.card::before {
  content: ""; position: absolute; left: 0; top: -14px; width: 38%; height: 16px; background: var(--manila);
  border-radius: 8px 14px 0 0; box-shadow: inset 0 1px 0 var(--manila-d), inset 1px 0 0 var(--manila-d), inset -1px 0 0 var(--manila-d);
}
.stamp {
  display: inline-block; font-family: var(--type); color: var(--red); border: 4px solid var(--red); border-radius: 8px;
  padding: 4px 12px 0; transform: rotate(-7deg); letter-spacing: .12em; text-transform: uppercase; opacity: .88;
  font-size: 1.1rem; background: rgba(179,38,30,.05);
}
.stamp.ok { color: var(--ok); border-color: var(--ok); background: rgba(63,143,86,.06); }
.face { display: block; width: 100%; height: auto; border-radius: 10px; }
.sw { display: inline-block; width: 1.5em; height: 1.5em; border-radius: 50%; border: 2px solid rgba(0,0,0,.55); vertical-align: middle; }
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #000; color: #fff; padding: 12px 18px;
  border-radius: 10px; border: 1px solid var(--red-l); z-index: 50; max-width: 90vw;
}
.overlay {
  position: fixed; inset: 0; background: rgba(10,10,12,.86); z-index: 40; display: grid; place-content: center; gap: 18px;
  text-align: center; padding: 24px;
}

/* ── landing ─────────────────────────────────────────── */
.landing { min-height: 100dvh; display: grid; place-content: center; gap: 28px; padding: 28px; text-align: center; }
.landing h1 { font-size: clamp(2.6rem, 11vw, 6rem); line-height: 1; }
.landing h1 span { color: var(--red-l); }
.landing .tag { color: var(--dim); max-width: 34rem; margin: 0 auto; }
.landing .row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.landing .btn { min-width: 220px; font-size: 1.15rem; min-height: 64px; }
.landing .how { max-width: 40rem; text-align: left; margin: 0 auto; }
.landing .how li { margin: 6px 0; }

/* ── host / TV ───────────────────────────────────────── */
body.host { font-size: clamp(16px, 1.35vw, 26px); }
.host header {
  display: flex; align-items: center; gap: 1em; padding: .6em 1.2em; border-bottom: 1px solid var(--line);
}
.host header .brand { font-family: var(--type); font-size: 1.4em; letter-spacing: .1em; }
.host header .brand span { color: var(--red-l); }
.host header .grow { flex: 1; }
.host header .code { font-family: var(--type); font-size: 1.3em; background: var(--manila); color: var(--ink); padding: .1em .5em 0; border-radius: 6px; letter-spacing: .15em; }
.host main { padding: 1.6em 2em 2.4em; max-width: 1700px; margin: 0 auto; }
.host h1 { font-size: 2.6em; line-height: 1.1; }
.host h2 { font-size: 1.5em; }
.huge { font-family: var(--type); font-size: clamp(4rem, 16vw, 14rem); text-align: center; line-height: 1; margin: .2em 0; }
.stage { min-height: 70vh; display: grid; place-content: center; gap: 1.2em; text-align: center; justify-items: center; }
.cd { font-family: var(--type); color: var(--manila); }
.lobby { display: grid; grid-template-columns: minmax(280px, 1fr) 1.3fr; gap: 2em; align-items: start; }
.lobby .join { text-align: center; }
.lobby .qr { background: #fff; padding: .6em; border-radius: 10px; width: min(100%, 17em); margin: .8em auto; }
.lobby .qr svg { display: block; width: 100%; height: auto; }
.lobby .bigcode { font-family: var(--type); font-size: 4.2em; letter-spacing: .2em; line-height: 1; margin-top: .2em; }
.lobby .url { font-weight: 600; word-break: break-all; }
.lobby .col { display: grid; gap: 1.6em; }
.players { list-style: none; padding: 0; margin: .6em 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: .4em .8em; }
.players li { background: rgba(0,0,0,.08); border-radius: 8px; padding: .35em .7em; font-weight: 600; }
.players li.off { opacity: .45; text-decoration: line-through; }
.players li.empty { background: none; border: 2px dashed rgba(0,0,0,.2); color: rgba(0,0,0,.4); font-weight: 400; }
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: .6em 1.2em; margin-top: .6em; }
.settings label { display: flex; justify-content: space-between; align-items: center; gap: .6em; font-weight: 600; }
.settings select { min-height: 44px; border-radius: 8px; border: 2px solid var(--manila-d); background: var(--paper); color: var(--ink); padding: 0 .5em; font-size: .9em; }
.host .btn { font-size: 1em; }
.host .btn.big { font-size: 1.4em; min-height: 2.6em; font-family: var(--type); letter-spacing: .06em; }
.split { display: grid; grid-template-columns: 1.25fr 1fr; gap: 2em; align-items: start; }
.sketchbox { background: var(--paper); border-radius: 12px; padding: .5em; box-shadow: 0 10px 30px rgba(0,0,0,.45); max-width: 62vh; margin: 0 auto; width: 100%; }
.sketchbox canvas, .sketchbox img { display: block; width: 100%; height: auto; border-radius: 8px; aspect-ratio: 1; }
.sketchbox .ph { aspect-ratio: 1; display: grid; place-content: center; color: #8a8068; font-family: var(--type); font-size: 1.4em; text-align: center; padding: 1em; }
.sketchbox .cap { text-align: center; color: #6d6450; font-family: var(--type); padding-top: .3em; }
.qcard h1 { font-size: 2.2em; }
.answers { list-style: none; padding: 0; margin: 1em 0 0; display: grid; gap: .5em; }
.answers li {
  display: flex; justify-content: space-between; gap: 1em; background: rgba(0,0,0,.08); border-radius: 8px; padding: .45em .8em;
  font-size: 1.25em; opacity: 0; animation: typein .25s forwards;
}
.answers li b { font-family: var(--type); font-weight: 400; }
@keyframes typein { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
.lineup { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1em; }
.lineup.with-sketch { grid-template-columns: repeat(3, 1fr); }
.suspect { position: relative; background: var(--panel); border-radius: 14px; padding: .5em; border: 3px solid transparent; }
.suspect .n { font-family: var(--type); font-size: 1.6em; text-align: center; padding-top: .2em; }
.suspect.hit { border-color: var(--red-l); }
.suspect.true { border-color: var(--ok); }
.suspect .tag { position: absolute; left: 50%; top: 42%; transform: translate(-50%,-50%) rotate(-12deg); white-space: nowrap; }
.slam { opacity: 0; animation: slam .35s cubic-bezier(.2,1.6,.4,1) forwards; }
.suspect .tag.slam { animation-name: slam2; }
@keyframes slam { from { opacity: 0; transform: scale(3.5) rotate(-18deg); } to { opacity: .95; transform: scale(1) rotate(-12deg); } }
@keyframes slam2 { from { opacity: 0; transform: translate(-50%,-50%) scale(3.5) rotate(-20deg); } to { opacity: .95; transform: translate(-50%,-50%) scale(1) rotate(-12deg); } }
.fadein { opacity: 0; animation: fade .6s forwards; }
@keyframes fade { to { opacity: 1; } }
.slidein { opacity: 0; animation: slide .7s cubic-bezier(.2,.9,.3,1) forwards; }
@keyframes slide { from { opacity: 0; transform: translateX(60%); } to { opacity: 1; transform: none; } }
.stamp.big { font-size: 2.2em; border-width: 6px; background: rgba(27,27,29,.72); }
.duo { display: flex; gap: 2.5em; justify-content: center; align-items: flex-start; flex-wrap: wrap; }
.duo > div { width: min(34vh, 40vw); }
.duo .cap { font-family: var(--type); text-align: center; margin-top: .4em; font-size: 1.2em; }
.viewgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9em, 1fr)); gap: 1em; max-width: 70em; margin: 0 auto; width: 100%; }
.viewgrid .cap { text-align: center; margin-top: .3em; }
.viewgrid .cap b { display: block; font-family: var(--type); font-weight: 400; font-size: 1.15em; }
table.ans { border-collapse: collapse; margin: 0 auto; font-size: .82em; background: var(--manila); color: var(--ink); border-radius: 10px; overflow: hidden; }
table.ans th, table.ans td { padding: .35em .6em; border-bottom: 1px solid var(--manila-d); text-align: left; vertical-align: middle; }
table.ans th { font-family: var(--type); font-weight: 400; background: var(--manila-d); }
table.ans .y { color: #1f6b35; font-weight: 800; }
table.ans .n { color: var(--red); font-weight: 800; }
table.ans small { opacity: .6; }
.points { list-style: none; padding: 0; margin: 0 auto; display: grid; gap: .45em; max-width: 34em; text-align: left; }
.points li { display: flex; gap: 1em; justify-content: space-between; background: var(--panel); border-radius: 10px; padding: .5em .9em; }
.points li b { color: var(--manila); font-family: var(--type); font-weight: 400; }
.scores { margin: 0 auto; border-collapse: collapse; font-size: 1.3em; min-width: 22em; }
.scores td { padding: .35em .8em; border-bottom: 1px solid var(--line); }
.scores td:nth-child(2) { color: var(--ok); text-align: right; }
.scores td:last-child { font-family: var(--type); font-size: 1.3em; text-align: right; color: var(--manila); }
.rvnav { display: flex; gap: 1em; justify-content: center; margin-top: 1.6em; }
.banner { background: var(--red); color: #fff; padding: .6em 1em; border-radius: 10px; display: flex; gap: 1em; align-items: center; justify-content: center; margin-bottom: 1em; }
@media (max-width: 900px) {
  .lobby, .split { grid-template-columns: 1fr; }
  .lineup { grid-template-columns: repeat(3, 1fr); }
  .host main { padding: 1em; }
}

/* ── phone ───────────────────────────────────────────── */
.phone { max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; padding: 0 16px calc(20px + env(safe-area-inset-bottom)); }
.pbar { display: flex; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.pbar .grow { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbar .role { font-family: var(--type); background: var(--manila); color: var(--ink); padding: 3px 10px 0; border-radius: 6px; font-weight: 400; font-size: .9rem; }
.pbar .off { color: var(--red-l); font-size: .8rem; }
.pmain { flex: 1; display: flex; flex-direction: column; gap: 16px; padding-top: 18px; }
.pmain.mid { justify-content: center; text-align: center; }
.pmain h1 { font-size: 2rem; line-height: 1.15; }
.pmain h2 { font-size: 1.35rem; }
.pmain .bignum { font-family: var(--type); font-size: 9rem; line-height: 1; }
.field { display: grid; gap: 6px; text-align: left; font-weight: 600; }
.field input {
  min-height: 56px; border-radius: 10px; border: 2px solid var(--line); background: #111; color: var(--fg); padding: 0 14px;
  font-size: 1.3rem; width: 100%;
}
.field input.code { font-family: var(--type); letter-spacing: .3em; text-transform: uppercase; font-size: 1.8rem; text-align: center; }
.err { color: var(--red-l); font-weight: 600; min-height: 1.4em; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opts.sw6 { grid-template-columns: repeat(3, 1fr); }
.opt {
  position: relative; min-height: 60px; border-radius: 12px; border: 3px solid var(--line); background: var(--panel); color: var(--fg);
  font-weight: 600; padding: 8px 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  touch-action: manipulation;
}
.opt.sel { border-color: var(--manila); background: #3a3524; }
.opt .sw { width: 38px; height: 38px; }
.opt .hint { position: absolute; top: -9px; right: 6px; font-size: .68rem; background: var(--red); color: #fff; border-radius: 6px; padding: 1px 6px; }
.opt .hint.real { right: auto; left: 6px; background: var(--ok); }
.opt.wide { grid-column: 1 / -1; }
.qbtn { text-align: left; min-height: 64px; font-size: 1.1rem; }
.facebox { width: min(100%, 46dvh); margin: 0 auto; }
.nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.nums .opt { font-family: var(--type); font-size: 2rem; min-height: 72px; }
.pad { background: var(--paper); border-radius: 12px; padding: 6px; }
.pad canvas { display: block; width: 100%; aspect-ratio: 1; border-radius: 8px; touch-action: none; background: var(--paper); cursor: crosshair; }
.pad .tools { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 2px 2px; align-items: center; }
.pad .tool {
  min-width: 48px; min-height: 48px; border-radius: 10px; border: 3px solid transparent; background: #ddd2b6; color: var(--ink);
  font-weight: 700; display: grid; place-content: center; cursor: pointer; padding: 0 8px; touch-action: manipulation;
}
.pad .tool.on { border-color: var(--red); }
.pad .tool i { display: block; border-radius: 50%; background: var(--ink); }
.pad .tool.col { min-width: 48px; padding: 0; }
.pad .tool.col i { width: 26px; height: 26px; border: 2px solid rgba(0,0,0,.4); }
.note { background: var(--panel); border-radius: 10px; padding: 12px 14px; color: var(--dim); }

/* ── fit and finish ──────────────────────────────────── */
.pmain .stamp { align-self: center; }
.pad { max-width: 54dvh; width: 100%; margin: 0 auto; }
.lineup.with-sketch { justify-items: center; }
.lineup.with-sketch .suspect { width: 100%; max-width: 23vh; }
.duo > div { width: min(44vh, 40vw); }
table.ans { font-size: 1em; }
.points { font-size: 1.2em; }
.lobby .qr { width: min(100%, 15em); }
.lobby .col { gap: 1.3em; }

.botrow { display: flex; flex-wrap: wrap; gap: .6em; align-items: center; margin-top: .8em; font-size: .8em; color: #6d6450; }
.botrow .btn { background: var(--paper); color: var(--ink); border-color: var(--manila-d); }

/* ── hints ───────────────────────────────────────────── */
.coach { max-width: 60em; margin: 1.6em auto 0; text-align: center; color: var(--dim); font-size: .85em; border-top: 1px dashed var(--line); padding-top: .9em; }
.coach b { color: var(--manila); }
.said { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.said li { display: flex; justify-content: space-between; gap: 12px; background: var(--panel); border-radius: 8px; padding: 8px 12px; }
.said li b { color: var(--manila); }

/* ── the TV screen on a phone ────────────────────────── */
.lobby > *, .split > *, .lobby .col > * { min-width: 0; }
@media (max-width: 700px) {
  body.host { font-size: 15px; }
  .host header { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .host header .brand { font-size: 1.15em; }
  .host header .grow { flex-basis: 0; }
  .host header .dim { display: none; }
  .host header .btn.small { min-height: 44px; padding: 6px 10px; font-size: .8rem; }
  .host main { padding: 20px 12px 28px; }
  .host h1 { font-size: 1.6em; }
  .host h2 { font-size: 1.25em; }
  .card { padding: 16px; }
  .lobby, .split { grid-template-columns: minmax(0, 1fr) !important; gap: 26px; }
  .lobby .bigcode { font-size: 3em; letter-spacing: .12em; }
  .lobby .qr { width: min(70%, 13em); }
  .lobby .url { font-size: .85em; }
  .settings { grid-template-columns: 1fr; }
  .players { grid-template-columns: 1fr 1fr; }
  .host .btn.big { font-size: 1.15em; width: 100%; }
  .stage { min-height: 50vh; }
  .huge { font-size: 5rem; }
  .lineup, .lineup.with-sketch { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .lineup.with-sketch .suspect { max-width: none; }
  .suspect { padding: 4px; }
  .suspect .n { font-size: 1.1em; }
  .sketchbox { max-width: 70vw; }
  .duo { gap: 14px; }
  .duo > div { width: 42vw; }
  .stamp.big { font-size: 1.3em; border-width: 4px; }
  .viewgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  table.ans { display: block; overflow-x: auto; font-size: .8em; max-width: 100%; }
  .scores { font-size: 1.05em; min-width: 0; width: 100%; }
  .answers li { font-size: 1.05em; }
  .qcard h1 { font-size: 1.5em; }
}

/* ── practice mode: TV + phone on one device ─────────── */
body.solo { height: 100dvh; overflow: hidden; }
body.solo #app { height: 100dvh; display: flex; flex-direction: column; }
.solobar { display: flex; gap: 8px; align-items: center; padding: 8px; background: #101012; border-bottom: 1px solid var(--line); }
.solobar button { flex: 1; min-height: 48px; border-radius: 10px; border: 2px solid var(--line); background: var(--panel); color: var(--fg); font-weight: 700; }
.solobar button.on { background: var(--manila); color: var(--ink); border-color: var(--manila-d); }
.solobar button.ping { border-color: var(--red-l); animation: ping 1s infinite alternate; }
@keyframes ping { to { background: var(--red); } }
.solobar a { color: var(--dim); padding: 0 10px; }
.solobar .wide { display: none; flex: 1; color: var(--dim); padding-left: 8px; }
.soloviews { flex: 1; display: flex; min-height: 0; }
.soloviews iframe { border: 0; flex: 1; width: 100%; height: 100%; background: var(--bg); }
@media (max-width: 899px) {
  .soloviews[data-show="tv"] #solo-me, .soloviews[data-show="me"] #solo-tv { display: none; }
}
@media (min-width: 900px) {
  .solobar button { display: none; }
  .solobar .wide { display: block; }
  #solo-me { flex: 0 0 400px; border-left: 3px solid var(--manila-d); }
}

/* ── roles ───────────────────────────────────────────── */
.roster { display: flex; flex-wrap: wrap; gap: .4em 1.6em; justify-content: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: .5em 1em; margin: 0 auto 1.2em; font-size: .9em; max-width: 70em; }
.roster b { color: var(--manila); }
.roster .warn { color: var(--red-l); }
.blackout { position: fixed; inset: 0; z-index: 30; background: #000; display: grid; place-content: center; gap: 18px; text-align: center; padding: 24px; }
.blackout h1 { font-size: 2.4rem; color: var(--red-l); letter-spacing: .08em; animation: blink 1.1s steps(2) infinite; }
.blackout p { color: #777; }
@keyframes blink { 50% { opacity: .35; } }

/* ── phone-only play ─────────────────────────────────── */
.phone .bigcode { font-family: var(--type); font-size: 3.4rem; letter-spacing: .2em; line-height: 1.1; margin: .1em 0 .2em; }
.phone .card { padding: 16px; }
.phone .card h2 { font-size: 1.2rem; }
.phone details summary { cursor: pointer; padding: 10px 0 2px; font-weight: 600; min-height: 44px; display: flex; align-items: center; justify-content: center; }
.phone details.card summary { justify-content: flex-start; font-size: 1.2rem; padding: 0; }
.phone .qr { background: #fff; padding: 10px; border-radius: 10px; width: min(80%, 15rem); margin: 8px auto 0; }
.phone .qr svg { display: block; width: 100%; height: auto; }
.phone .players { grid-template-columns: 1fr 1fr; }
.phone .settings { grid-template-columns: 1fr; margin-top: 10px; }
.phone .btn.share { background: var(--ink); color: var(--manila); border-color: var(--ink); }
.phone .btn.start { min-height: 64px; font-family: var(--type); font-size: 1.3rem; letter-spacing: .05em; }
.phone .roster { font-size: .8rem; margin: 12px 0 0; padding: 8px 10px; gap: 2px 12px; justify-content: flex-start; }
.phone .roster + .pmain { padding-top: 12px; }
.stamp.sm { font-size: .8rem; border-width: 3px; padding: 2px 8px 0; align-self: flex-start !important; }
.pstage { text-align: center; align-items: stretch; }
.pstage h1 { font-size: 1.6rem; }
.pstage .stamp { align-self: center; }
.phone .lineup { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.phone .suspect { padding: 4px; font: inherit; color: inherit; }
button.suspect { cursor: pointer; touch-action: manipulation; }
.suspect.sel { border-color: var(--manila); background: #3a3524; }
.phone .sketchbox { max-width: min(100%, 44dvh); }
.phone .duo { gap: 12px; flex-wrap: nowrap; }
.phone .duo > div { width: 46%; }
.phone .duo > .fadein, .phone .duo > div:only-child { width: 62%; }
.phone .viewgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.phone table.ans { display: block; overflow-x: auto; font-size: .8rem; max-width: 100%; text-align: left; }
.phone .scores { font-size: 1.05rem; min-width: 0; width: 100%; }
.phone .points { font-size: 1rem; }
.phone .rvnav { margin-top: 8px; }
.phone .banner { margin-top: 10px; }
.linkbtn { background: none; border: 0; color: var(--dim); text-decoration: underline; padding: 18px 0 0; min-height: 48px; align-self: center; cursor: pointer; }

/* ── picture answers and own questions ───────────────── */
.thumb { display: block; width: 84px; max-width: 100%; height: auto; border-radius: 8px; }
.opt .thumb { margin-bottom: 2px; }
.said li b { display: flex; align-items: center; gap: 8px; text-align: right; }
.said .thumb { width: 44px; flex: none; }
.ownq { display: flex; gap: 8px; }
.ownq input { flex: 1; min-width: 0; min-height: 52px; border-radius: 10px; border: 2px solid var(--line); background: #111; color: var(--fg); padding: 0 12px; font-size: 1.05rem; }
.ownq .btn { flex: none; min-height: 52px; }

/* ── statements ──────────────────────────────────────── */
.stmts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.stmts li { background: var(--panel); border-left: 4px solid var(--manila-d); border-radius: 8px; padding: 10px 12px; }
.stmts li b { color: var(--manila); display: block; font-size: .85rem; }
.acchelp { display: flex; gap: 12px; align-items: center; background: #2a1917; border: 1px solid var(--red); border-radius: 10px; padding: 10px; text-align: left; }
.acchelp > div { flex: 0 0 96px; }
.acchelp p { margin: 0; font-size: .88rem; }

/* ── clarity and fun ─────────────────────────────────── */
.steps { list-style: none; display: flex; gap: 4px; margin: 10px 0 0; padding: 0; font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; }
.steps li { flex: 1; text-align: center; padding: 6px 2px 4px; border-top: 4px solid var(--line); color: #77736a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps li.done { border-color: var(--manila-d); color: var(--dim); }
.steps li.now { border-color: var(--red-l); color: var(--fg); font-weight: 700; }
.twist { background: var(--manila); color: var(--ink); border-radius: 10px; padding: 10px 12px; font-family: var(--type); text-align: center; transform: rotate(-1deg); box-shadow: 0 6px 16px rgba(0,0,0,.4); }
.twist b { display: block; font-weight: 400; font-size: 1.25rem; color: var(--red); }
.reacts { display: flex; gap: 6px; align-items: center; justify-content: center; color: var(--dim); font-size: .85rem; }
.reacts button { min-width: 52px; min-height: 52px; font-size: 1.6rem; border-radius: 50%; border: 2px solid var(--line); background: var(--panel); cursor: pointer; touch-action: manipulation; }
.reacts button:active { transform: scale(1.25); }
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
#fx .float { position: absolute; bottom: 12%; display: grid; justify-items: center; animation: floatup 2.3s ease-out forwards; }
#fx .float span { font-size: 3rem; }
#fx .float small { background: rgba(0,0,0,.7); color: #fff; border-radius: 6px; padding: 1px 6px; font-size: .7rem; }
@keyframes floatup { 0% { transform: translateY(0) scale(.4); opacity: 0; } 15% { transform: translateY(-40px) scale(1.2); opacity: 1; } 100% { transform: translateY(-58vh) scale(1); opacity: 0; } }
.suspect .n small { font-family: var(--sans); font-size: .62em; color: var(--dim); display: block; line-height: 1.1; }
.awards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; text-align: left; }
.awards li { background: var(--manila); color: var(--ink); border-radius: 10px; padding: 10px 12px; display: grid; }
.awards li b { font-family: var(--type); font-weight: 400; font-size: 1.1rem; }
.gallery { display: grid; gap: 18px; }
.gitem .cap { font-family: var(--type); margin-top: 6px; }
.howto { place-content: center; overflow: auto; }
.howto .card { max-width: 30rem; text-align: left; }
.howto ol { padding-left: 1.2em; display: grid; gap: 8px; }
@media (prefers-reduced-motion: reduce) { #fx .float, .slam, .fadein, .slidein, .blackout h1, .answers li { animation-duration: .01s !important; } }
.steps { font-size: .6rem; letter-spacing: 0; }
.steps li { text-overflow: clip; }

/* ── the Detective's drawing screen: pad first ───────── */
.pmain.det { padding-top: 10px; gap: 10px; }
.detline { background: var(--panel); border-radius: 8px; padding: 8px 10px; font-size: .88rem; line-height: 1.3; }
.detline b { color: var(--manila); }
.pmain.det .pad { max-width: min(100%, calc(100dvh - 250px)); }
.pad .tools { flex-wrap: nowrap; overflow-x: auto; gap: 5px; padding: 6px 0 0; -webkit-overflow-scrolling: touch; }
.pad .tool { flex: none; min-width: 42px; min-height: 42px; padding: 0 6px; font-size: .8rem; }
.pad .tool.col { min-width: 42px; }
.linkbtn.tight { padding: 0; min-height: 40px; font-size: .85rem; }
/* two tidy tool rows: colors and pen sizes, then eraser / undo / clear — nothing hidden off-screen */
.pad .tools { flex-wrap: wrap; overflow: visible; gap: 4px; justify-content: space-between; }
.pad .tool, .pad .tool.col { min-width: 0; width: calc((100% - 32px) / 9); min-height: 36px; padding: 0; }
.pad .tool.col i { width: 22px; height: 22px; }
.pad .tool[data-tool] { width: calc((100% - 8px) / 3); min-height: 40px; }

/* ── any-color picker on the pad ─────────────────────── */
.pad .tool, .pad .tool.col { width: calc((100% - 36px) / 10); }
.pad .tool[data-tool] { width: calc((100% - 8px) / 3); }
.pad .tool.pick { position: relative; overflow: hidden; }
.pad .tool.pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.pad .tool.pick i { border: 2px solid rgba(0,0,0,.4); }

/* ── the clock ───────────────────────────────────────── */
.clock { position: relative; height: 38px; border-radius: 10px; background: #111; border: 2px solid var(--line); overflow: hidden; flex: none; }
.clock i { position: absolute; inset: 0 auto 0 0; background: var(--manila-d); transition: width .2s linear; }
.clock b { position: absolute; inset: 0; display: grid; place-content: center; font-family: var(--type); font-weight: 400; font-size: 1.35rem; color: #fff; text-shadow: 0 1px 3px #000; letter-spacing: .06em; }
.clock.hot { border-color: var(--red-l); }
.clock.hot i { background: var(--red); animation: blink .6s steps(2) infinite; }
.pmain.mid .clock { width: 100%; }
.pmain.det .clock { height: 30px; }
.pmain.det .clock b { font-size: 1.1rem; }
.pmain.det .pad { max-width: min(100%, calc(100dvh - 290px)); }
/* four tools on the second row now: fill, eraser, undo, clear */
.pad .tool[data-tool] { width: calc((100% - 12px) / 4); font-size: .78rem; }

/* ── polish pass ─────────────────────────────────────── */
.roster.one { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 6px 10px; font-size: .8rem; margin-top: 8px; text-align: left; }
.steps { font-size: .64rem; }
.pmain.tight { gap: 12px; padding-top: 12px; }
.pmain.tight h1 { font-size: 1.5rem; }
.pmain.tight h2 { font-size: 1.2rem; }
.pmain.tight h2 small, .pmain h2 small { font-family: var(--sans); font-size: .8rem; }
.pmain.tight .sketchbox { max-width: min(100%, 36dvh); padding: 4px; }
.pmain.tight .sketchbox .cap { font-size: .8rem; }
.twist { padding: 7px 10px; font-size: .9rem; }
.twist b { display: inline; font-size: 1.05rem; }
.facebox.sm { width: min(70%, 34dvh); }
.acchelp > div { flex: 0 0 76px; }
.acchelp p { font-size: .82rem; }
.lhead { display: flex; gap: 10px; align-items: center; }
.lhead > div:first-child { flex: 1; }
.lhead .sketchbox { flex: 0 0 34%; max-width: 34%; padding: 3px; margin: 0; }
.lhead h2 { font-size: 1.3rem; }
.lhead p { margin: 4px 0 0; font-size: .85rem; }
.suspect .tgt { position: absolute; top: 2px; right: 4px; font-size: 1.3rem; filter: drop-shadow(0 1px 2px #000); }
.btn.sticky { position: sticky; bottom: 10px; z-index: 5; box-shadow: 0 0 0 6px var(--bg), 0 -10px 24px 6px var(--bg); }
.endbtn { background: none; border: 1px solid var(--line); color: var(--dim); border-radius: 8px; font-size: .75rem; padding: 6px 8px; min-height: 32px; cursor: pointer; }
.reacts button { min-width: 48px; min-height: 48px; font-size: 1.45rem; }

.btn.sticky:disabled { opacity: 1; background: #4a2320; border-color: #4a2320; color: #c9a9a4; }
.steps li { flex: 1 1 auto; padding: 6px 4px 4px; overflow: visible; }
.facebox.sm { width: min(64%, 30dvh); }

/* ── the crime, and written statements ───────────────── */
h1.crime { font-size: clamp(1.9rem, 8.5vw, 2.7rem); line-height: 1.15; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.5); }
#stmt { width: 100%; min-height: 7.5em; border-radius: 10px; border: 2px solid var(--line); background: #111; color: var(--fg); padding: 10px 12px; font: inherit; font-size: 1.05rem; resize: none; }
#stmt:focus { outline: none; border-color: var(--manila); }
.stabs { display: flex; gap: 6px; overflow-x: auto; }
.stabs button { flex: 1 0 auto; min-height: 36px; padding: 0 12px; border-radius: 8px 8px 0 0; border: 2px solid var(--line); border-bottom: 0; background: var(--panel); color: var(--dim); font-weight: 600; cursor: pointer; }
.stabs button.on { background: var(--manila); color: var(--ink); border-color: var(--manila-d); }
.stext { background: var(--manila); color: var(--ink); border-radius: 0 0 10px 10px; padding: 8px 12px; margin-top: -10px; max-height: 5.6em; overflow-y: auto; font-size: .95rem; line-height: 1.35; }
.stext small { display: block; color: var(--red); font-family: var(--type); }
.pmain.det.wtabs .pad { max-width: min(100%, calc(100dvh - 420px)); min-width: 220px; }
.stmts li small { font-weight: 400; color: var(--dim); font-family: var(--type); }
.stmts li.liar { border-left-color: var(--red-l); background: #2a1917; }

/* ── voting ──────────────────────────────────────────── */
.votes { display: grid; gap: 10px; }
.vcard { text-align: left; background: var(--manila); color: var(--ink); border: 3px solid var(--manila-d); border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 1rem; line-height: 1.35; cursor: pointer; touch-action: manipulation; }
.vcard b { display: block; font-family: var(--type); font-weight: 400; margin-bottom: 4px; }
.vcard b small { color: var(--red); }
.vcard i { display: block; font-style: normal; font-weight: 700; color: var(--ok); margin-top: 6px; }
.vcard.sel { border-color: var(--ok); box-shadow: 0 0 0 3px var(--ok); }
.vcard:disabled { opacity: .5; cursor: default; }
.gitem .btn { margin-top: 8px; }
