/* Culprit — cartoon noir UI. Mobile first, one column, dark by design. */
:root {
  --ink: #0f0e14; --ink2: #1b1a24; --ink3: #262433; --ink4: #33303f;
  --paper: #efe3c4; --paper-ink: #1f1a14;
  --mustard: #e8b23a; --blood: #c0392b; --smoke: #8d8a9c;
  --line: #14121a; --text: #efe3c4; --muted: #a9a5b8;
  --ok: #7ec27a;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--ink); color: var(--text);
  font-family: Nunito, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.5;
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent;
  background-image:
    radial-gradient(ellipse 80% 40% at 50% -10%, rgba(232, 178, 58, .22), transparent 70%),
    radial-gradient(ellipse 50% 30% at 100% 70%, rgba(192, 57, 43, .10), transparent 70%);
  background-attachment: fixed;
}
.app {
  max-width: 480px; margin-inline: auto; min-height: 100%;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px calc(28px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 16px;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--mustard); outline-offset: 2px; }
[hidden] { display: none !important; }

.display { font-family: Anton, Impact, "Arial Narrow", sans-serif; font-weight: 400; letter-spacing: .03em; text-transform: uppercase; }
.type { font-family: "Special Elite", "Courier New", monospace; }
.eyebrow { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--mustard); font-weight: 800; }
.muted { color: var(--muted); }
.mono { font-family: "Special Elite", monospace; font-size: .78rem; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }

/* top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; }
.topbar .mono { flex: 1; text-align: center; }
.iconbtn {
  width: 40px; height: 40px; border-radius: 12px; border: 2px solid var(--ink3); background: var(--ink2);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.iconbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.spacer { width: 40px; flex: none; }

/* buttons and chips */
.btn {
  font-family: Anton, Impact, sans-serif; letter-spacing: .06em; text-transform: uppercase; font-size: 1.05rem;
  background: var(--mustard); color: #1a1408; border: 0; border-radius: 12px; padding: 13px 18px; width: 100%;
  box-shadow: 4px 4px 0 var(--blood); transition: transform .06s ease, box-shadow .06s ease;
}
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--blood); }
.btn.secondary { background: var(--ink3); color: var(--text); box-shadow: 4px 4px 0 #000; }
.btn.danger { background: var(--blood); color: #fff; box-shadow: 4px 4px 0 #000; }
.btn:disabled { opacity: .5; cursor: default; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { border: 2px solid var(--ink3); background: var(--ink2); border-radius: 999px; padding: 5px 12px; font-size: .84rem; font-weight: 700; white-space: nowrap; }
.chip b { color: var(--mustard); }
.chipbtn {
  border: 2px solid var(--ink3); background: var(--ink2); color: var(--text); border-radius: 999px; padding: 7px 13px;
  font-weight: 700; font-size: .86rem; display: inline-flex; align-items: center; gap: 6px;
}
.chipbtn.on { border-color: var(--mustard); color: var(--mustard); background: #2d2a1c; }
.sw { width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--line); display: inline-block; }

/* home */
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding-block: 8px; }
.logo {
  font-size: clamp(3.4rem, 18vw, 5rem); line-height: .9; color: var(--mustard);
  text-shadow: 0 0 12px rgba(232, 178, 58, .55), 0 0 40px rgba(232, 178, 58, .25), 4px 4px 0 var(--blood);
}
.tag { font-size: 1.05rem; max-width: 26rem; }
.me { width: 200px; height: auto; background: transparent; border: 0; padding: 0; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .6)); }
.me svg, .me img.face, .me canvas.face { width: 100%; height: auto; display: block; }
/* the detective drawn from a photo: a PNG with alpha in place of the parts avatar */
img.face { object-fit: contain; }
.stage img.face, .stage canvas.face { width: 190px; height: auto; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .6)); }
/* the graphic novel: the detective in its panel (a portrait, or its idle clip), cut round the face */
.comicav { display: block; aspect-ratio: 4 / 5; overflow: hidden; border: 3px solid var(--line); border-radius: 14px; background: var(--ink3); box-shadow: 5px 5px 0 var(--blood); }
.comicav img, .comicav video, .comicav canvas { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 36%; }
.me .comicav { width: 100%; }
.me:has(.comicav) { width: min(250px, 66vw); filter: none; }
.stage .comicav { width: 190px; }
/* the stock detectives to pick from */
.detpick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.detopt { padding: 0; border: 3px solid var(--ink4); border-radius: 12px; overflow: hidden; background: var(--ink3); aspect-ratio: 4 / 5; }
.detopt img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 36%; }
.detopt.on { border-color: var(--mustard); box-shadow: 0 0 0 3px rgba(232, 178, 58, .35); }
/* a cast member's face: a square cut from the portrait */
img.cast, svg.cast { object-fit: cover; border: 2px solid var(--line); border-radius: 10px; background: var(--ink3); display: block; aspect-ratio: 1; overflow: hidden; flex: none; }
/* the face of another player: a detective's thumbnail (the parts avatar keeps its own shape) */
.frow .cast { width: 58px; height: 58px; }
.brow .cast { width: 46px; height: 46px; }
.gift .cast { width: 54px; height: 54px; }
/* next to the name of who shows the detective drawn from their photo */
.premium { display: inline-grid; place-items: center; width: 1.25em; height: 1.25em; margin-left: 4px; padding: 0; border: 0; border-radius: 4px; vertical-align: -0.15em;
  background: linear-gradient(135deg, #f6d37a, #c8922b); color: #2a1f08; font-size: .82em; line-height: 1; cursor: pointer; }
/* hats and glasses to put on the detective */
.wearpick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.wearopt { aspect-ratio: 1; padding: 6px; border: 3px solid var(--ink4); border-radius: 12px; background: var(--ink3); color: var(--muted); display: grid; place-items: center; font-size: 1.1rem; }
.wearopt img { width: 100%; height: 100%; object-fit: contain; display: block; }
.wearopt.on { border-color: var(--mustard); box-shadow: 0 0 0 3px rgba(232, 178, 58, .35); }
.wearfit { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: .82rem; }
.wearfit span { display: inline-flex; align-items: center; gap: 4px; }
.wearfit .chipbtn { padding: 4px 11px; min-width: 2.4em; justify-content: center; }
/* how the others see the player */
.shownrow { display: flex; align-items: center; gap: 10px; }
.shownrow .cast { width: 58px; height: 58px; }
.shownrow > svg:not(.cast) { width: 58px; height: auto; flex: none; filter: none; }
/* a portrait over the whole screen */
.portraitmodal figure { margin: 0; position: relative; height: 100%; max-height: 100vh; max-height: 100dvh; aspect-ratio: 9 / 16; max-width: 100vw; }
.portraitmodal figure img { width: 100%; height: 100%; display: block; object-fit: contain; }
.portraitmodal figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 16px calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 2px; text-align: center;
  background: linear-gradient(transparent, rgba(5, 5, 8, .92) 45%); }
.portraitmodal figcaption b { font-size: 1.5rem; color: var(--mustard); }
.portraitmodal figcaption span { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 800; color: var(--muted); }
.facepreview img { width: 120px; height: auto; border-radius: 12px; border: 2px solid var(--ink3); display: block; margin-top: 6px; }
.facebusy { display: flex; align-items: center; gap: 10px; }
.check { display: flex; gap: 8px; align-items: flex-start; }
.check input { margin-top: 3px; }
.pack.face { flex-wrap: wrap; }
.pack.face .pinfo { gap: 2px; }
.promo { width: 100%; max-width: 220px; aspect-ratio: 9 / 16; border-radius: 12px; border: 2px solid var(--ink3); display: block; margin: 0 auto 8px; background: #000; }
/* the promo clip is a button: a tap opens it over the whole screen */
.promobtn { position: relative; display: block; width: 100%; max-width: 220px; margin: 0 auto 8px; padding: 0; border: 0; background: none; cursor: zoom-in; }
.promobtn .promo { max-width: none; margin: 0; }
.promobtn .zoom { position: absolute; right: 8px; top: 8px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(15, 14, 20, .82); border: 2px solid var(--mustard); color: var(--mustard); font-size: 1.1rem; line-height: 1; pointer-events: none; }
.promomodal { z-index: 50; padding: 0; align-items: center; overflow: hidden; background: #000; cursor: zoom-out; }
.promomodal video { display: block; width: auto; height: auto; max-width: 100vw; max-height: 100vh; max-height: 100dvh; aspect-ratio: 9 / 16; }
.promomodal .iconbtn { position: fixed; top: calc(10px + env(safe-area-inset-top, 0px)); right: 12px; background: rgba(15, 14, 20, .82); }
/* leaderboard, milestone bar, nickname dialog */
.brow .rank { width: 2em; text-align: center; font-family: Anton, Impact, sans-serif; font-size: 1.15rem; flex: none; color: var(--mustard); }
.brow .pts { font-family: Anton, Impact, sans-serif; font-size: 1.1rem; color: var(--mustard); white-space: nowrap; }
.brow.mine { background: #2d2a1c; border-radius: 12px; padding-inline: 6px; border-bottom-color: transparent; }
.brow svg { width: 46px; }
.bgap { text-align: center; color: var(--muted); letter-spacing: .3em; }
.btabs { justify-content: center; }
.mstone { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.mstone .track { background: var(--ink3); border-radius: 6px; height: 12px; overflow: hidden; }
.mstone .fill { background: var(--mustard); height: 100%; border-radius: 6px; min-width: 4px; }
.forfree { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--ink3); }
.gift.award { background: #2a1f1c; }
.nickmodal { align-items: center; }
.nickmodal .cbox { gap: 12px; }
.nickmodal .cbox .small { text-align: left; }
button.chip { cursor: pointer; font-family: inherit; color: var(--text); }
details.partsed { display: flex; flex-direction: column; gap: 10px; }
details.partsed[open] summary { margin-bottom: 10px; }
details.partsed .grp { margin-top: 10px; }
.name { font-size: 1.25rem; }
.name small { display: block; font-size: .72rem; letter-spacing: .14em; color: var(--muted); font-family: Nunito, sans-serif; font-weight: 800; }
.countdown { font-size: .8rem; color: var(--muted); }
details.howto { width: 100%; background: var(--ink2); border-radius: var(--radius); padding: 10px 14px; text-align: left; font-size: .92rem; }
details.howto summary { cursor: pointer; font-weight: 800; color: var(--mustard); }
details.howto p { margin-top: 8px; color: var(--muted); }

/* case */
.title { font-size: 1.7rem; color: var(--mustard); line-height: 1.05; }
.paper {
  background: var(--paper); color: var(--paper-ink); border-radius: 6px; padding: 12px 14px;
  background-image: radial-gradient(rgba(31, 26, 20, .10) 1px, transparent 1.4px); background-size: 6px 6px;
  box-shadow: 3px 3px 0 #000; transform: rotate(-.6deg);
}
.paper .type { font-size: .92rem; line-height: 1.5; }
.stamp {
  display: inline-block; font-family: Anton, Impact, sans-serif; color: var(--blood); border: 3px solid var(--blood);
  padding: 1px 8px; font-size: .8rem; letter-spacing: .12em; transform: rotate(-6deg); margin-bottom: 6px;
}
section { display: flex; flex-direction: column; gap: 10px; }
.sechead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.clues { display: flex; flex-direction: column; gap: 8px; }
.clue { display: flex; gap: 10px; align-items: flex-start; background: var(--ink2); border-radius: 12px; padding: 10px 12px; font-size: .95rem; }
.clue .n { font-family: Anton, Impact, sans-serif; color: var(--mustard); font-size: 1.15rem; min-width: 1.2em; line-height: 1.3; }
.clue .txt { flex: 1; }
.clue.open { background: #2d2a1c; }
.clue.open .txt { font-family: "Special Elite", monospace; font-size: .9rem; }
.clue.next { border: 2px dashed var(--smoke); background: transparent; }
.clue.locked { opacity: .45; }
.clue button.reveal {
  background: var(--mustard); color: #1a1408; border: 0; border-radius: 8px; padding: 5px 12px; font-weight: 800; margin-left: auto; white-space: nowrap;
  font-family: Anton, Impact, sans-serif; letter-spacing: .06em; text-transform: uppercase;
}
.suspects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.suspect {
  background: var(--ink2); border: 2px solid transparent; border-radius: 12px; padding: 8px 4px 9px; text-align: center;
  color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 2px; transition: opacity .2s ease;
}
.suspect svg { width: 72px; height: auto; }
.suspect .nm { font-weight: 800; font-size: .76rem; line-height: 1.15; }
.suspect .rl { font-size: .68rem; color: var(--muted); }
.suspect.sel { border-color: var(--mustard); background: #2d2a1c; }
.suspect.out { opacity: .32; }
.suspect.out .nm { text-decoration: line-through; }
.suspect.culprit { border-color: var(--blood); background: #2d1c1c; opacity: 1; }
.suspect.wrong { border-color: var(--smoke); }
.suspect:disabled { cursor: default; }
.confirm { background: var(--blood); color: #fff; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; font-weight: 700;
  position: sticky; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 10px 30px rgba(0, 0, 0, .6); }
.confirm .row { display: flex; gap: 8px; }
.confirm .row .btn { padding: 10px; font-size: .95rem; }
.confirm .row .btn.danger { background: #fff; color: var(--blood); box-shadow: 4px 4px 0 #000; }

/* result overlay */
.overlay {
  position: fixed; inset: 0; background: rgba(15, 14, 20, .94); z-index: 20; overflow: auto;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: flex-start; justify-content: center;
}
/* margin auto centres a short card and lets a tall one scroll from its top (align-items: center would cut it) */
.overlay > * { margin: auto; }
.result { width: min(420px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.result h2 { font-size: 2.4rem; color: var(--mustard); line-height: 1; }
.result.bad h2 { color: var(--blood); }
.result .who { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.result .who svg { width: 120px; height: auto; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .6)); }
.result .who .cast { width: 112px; height: 112px; border-width: 3px; border-radius: 14px; margin-bottom: 6px; filter: none; }
.result .react + .who { margin-top: 6px; }
/* the detective's reaction: the victory or the defeat clip in a panel */
.result video.react, .result canvas.react { width: min(230px, 62vw); aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 34%; border: 3px solid var(--line); border-radius: 14px; background: var(--ink3); box-shadow: 5px 5px 0 var(--blood); }
.grid { font-size: 1.6rem; letter-spacing: .06em; line-height: 1.2; }
.share { background: var(--ink3); border-radius: 10px; padding: 10px 12px; font-size: .9rem; white-space: pre-line; width: 100%;
  font-family: "Special Elite", monospace; border: 0; color: var(--text); resize: none; text-align: center; min-height: 5.2em; }
.result .row { display: flex; gap: 8px; width: 100%; }
.result .row .btn { padding: 11px; font-size: .95rem; }
.toast { font-size: .82rem; color: var(--mustard); min-height: 1.2em; }

/* settings */
.card { background: var(--ink2); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.card h3 { font-size: 1.05rem; }
.grp { display: flex; flex-direction: column; gap: 6px; }
.grp .lbl { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
input.text, select.text {
  width: 100%; background: var(--ink3); border: 2px solid var(--ink4); border-radius: 10px; color: var(--text); padding: 10px 12px; font: inherit;
}
.stage { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px;
  background-image: radial-gradient(ellipse 60% 50% at 50% 30%, rgba(232, 178, 58, .18), transparent 70%); border-radius: var(--radius); }
.stage svg { width: 190px; height: auto; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .6)); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tile { background: var(--ink3); border-radius: 10px; padding: 8px 4px; text-align: center; }
.tile b { display: block; font-family: Anton, Impact, sans-serif; font-size: 1.5rem; color: var(--mustard); font-weight: 400; letter-spacing: .02em; }
.tile span { font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.dist { display: flex; flex-direction: column; gap: 5px; }
.bar { display: grid; grid-template-columns: minmax(9.5em, auto) 1fr 2em; align-items: center; gap: 8px; font-size: .82rem; }
.bar .lbl { color: var(--mustard); text-align: left; white-space: nowrap; letter-spacing: -.05em; }
.bar .lbl em { font-style: normal; letter-spacing: 0; color: var(--text); font-weight: 700; font-size: .78rem; }
.bar .track { background: var(--ink3); border-radius: 6px; height: 14px; overflow: hidden; }
.bar .fill { background: var(--mustard); height: 100%; border-radius: 6px; }
.bar.fail .fill { background: var(--blood); }
.bar .val { text-align: right; font-variant-numeric: tabular-nums; }

/* loading and errors */
.center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; min-height: 60vh; }
.center .logo { font-size: 3rem; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--ink3); border-top-color: var(--mustard); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* avatar animation */
.av .body { animation: bob 3.4s ease-in-out infinite; animation-delay: var(--d, 0s); }
.av .lid { transform: scaleY(0); animation: blink 5s infinite; animation-delay: var(--d, 0s); }
.av .pupil { transition: transform .12s ease-out; }
@keyframes bob { 50% { transform: translateY(-3px); } }
@keyframes blink { 0%, 91% { transform: scaleY(0); } 94% { transform: scaleY(1); } 97%, 100% { transform: scaleY(0); } }
@media (prefers-reduced-motion: reduce) {
  .av .body, .av .lid, .spinner { animation: none; }
  .av .lid { transform: scaleY(0); }
}
@media (min-width: 720px) {
  .app { padding-top: 32px; }
  .suspect svg { width: 84px; }
}

/* v2: testimonies, notebook marks, investigation facts */
.small { font-size: .82rem; }
.rule { font-family: Anton, Impact, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--mustard); text-align: center; font-size: .95rem; }
.trows { display: flex; flex-direction: column; gap: 8px; }
.trow { display: flex; align-items: stretch; gap: 6px; background: var(--ink2); border: 2px solid transparent; border-radius: 14px; transition: opacity .2s ease; }
.trow .tsel { flex: 1; display: flex; align-items: center; gap: 10px; background: transparent; border: 0; padding: 8px 4px 8px 8px; text-align: left; color: var(--text); min-width: 0; }
.trow .tsel svg { width: 62px; height: auto; flex: none; }
.trow .tface { position: relative; flex: none; align-self: center; margin: 6px 0 6px 8px; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.trow .tface .cast { width: 72px; height: 72px; }
.trow .tface .num { left: -5px; top: -5px; }
.trow .tinfo { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.trow .nm { font-weight: 800; font-size: .9rem; line-height: 1.15; }
.trow .rl { font-size: .7rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; font-weight: 800; }
.trow q { font-size: .86rem; line-height: 1.35; color: var(--paper); quotes: "\201C" "\201D"; margin-top: 2px; }
.trow .mark { flex: none; width: 44px; border: 0; border-left: 2px solid var(--ink3); background: var(--ink3); color: var(--muted); font-family: Anton, Impact, sans-serif; font-size: 1.3rem; border-radius: 0 12px 12px 0; }
.trow.sel { border-color: var(--mustard); background: #2d2a1c; }
.trow.out { opacity: .45; }
.trow.out .nm { text-decoration: line-through; }
.trow.out .mark { color: var(--blood); background: #2d1c1c; }
.trow.maybe .mark { color: var(--mustard); background: #2d2a1c; }
.trow.culprit { border-color: var(--blood); background: #2d1c1c; opacity: 1; }
.trow.wrong { border-color: var(--smoke); }
.trow .tsel:disabled, .trow .mark:disabled { cursor: default; }
.facts { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 8px; font-size: .92rem; line-height: 1.45; color: var(--paper); }
.facts li::marker { color: var(--mustard); }
.lie { display: flex; flex-direction: column; gap: 4px; background: var(--ink3); border-radius: 10px; padding: 10px 12px; width: 100%; }
.lie q { font-size: .92rem; quotes: "\201C" "\201D"; }
.result .grid { font-size: 1.9rem; }

/* the arrest comic */
.cmodal { position: fixed; inset: 0; z-index: 40; background: rgba(5, 5, 8, .96); display: flex; align-items: flex-start; justify-content: center; overflow: auto;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 12px calc(10px + env(safe-area-inset-bottom, 0px)); }
.cbox { width: min(100%, 440px); margin: auto; display: flex; flex-direction: column; gap: 8px; }
.ctop { display: flex; align-items: center; justify-content: space-between; }
.cbox canvas { width: 100%; height: auto; aspect-ratio: 9 / 16; max-height: calc(100vh - 230px); max-height: calc(100dvh - 230px); object-fit: contain; border-radius: 14px;
  background: #000; box-shadow: 0 20px 60px rgba(0, 0, 0, .8); display: block; margin-inline: auto; }
.crow { display: flex; gap: 8px; }
.crow .btn { padding: 10px 8px; font-size: .88rem; }
.cbox canvas.fp { aspect-ratio: 4 / 5; background: #efe3c4; }
.ctop > span:last-child { display: flex; gap: 6px; }
.rare { color: var(--mustard); text-shadow: 0 0 12px rgba(232, 178, 58, .6); }
.chip.rare { border-color: var(--mustard); color: var(--mustard); }
.cbox .small { font-size: .78rem; margin: 0; text-align: center; }

/* accusation with evidence */
.confirm.evidence { position: static; background: var(--ink2); color: var(--text); border: 2px solid var(--blood); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.confirm.evidence .row .btn.danger { background: var(--blood); color: #fff; }
.confirm.evidence .row .btn.danger:disabled { opacity: .45; }
.evlist { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow: auto; padding-right: 2px; }
.evitem { display: flex; gap: 10px; align-items: flex-start; background: var(--ink3); border: 2px solid transparent; border-radius: 10px; padding: 8px 10px; font-size: .84rem; font-weight: 400; cursor: pointer; }
.evitem input { margin-top: 4px; accent-color: var(--mustard); width: 18px; height: 18px; flex: none; }
.evitem b { color: var(--mustard); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; display: block; }
.evitem q { quotes: "\201C" "\201D"; font-size: .84rem; line-height: 1.35; }
.evitem.on { border-color: var(--mustard); background: #2d2a1c; }
.evitem:has(input:disabled) { opacity: .45; cursor: default; }

/* account */
#emailForm { gap: 8px; }
.gsi { display: flex; justify-content: center; min-height: 44px; }

/* friends and gifts */
.gifts { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.gift { display: flex; align-items: center; gap: 10px; background: #2d2a1c; border: 2px solid var(--mustard); border-radius: 14px; padding: 8px 10px; text-align: left; }
.gift svg { width: 54px; height: auto; flex: none; }
.gift .ginfo { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: .88rem; min-width: 0; }
.gift q { quotes: "\201C" "\201D"; font-size: .84rem; color: var(--paper); }
.codebox { display: flex; gap: 8px; align-items: center; }
.codebox .code { font-size: 1.5rem; letter-spacing: .2em; color: var(--mustard); flex: 1; }
.codebox .btn { width: auto; padding: 10px 14px; font-size: .9rem; white-space: nowrap; }
.codebox input { flex: 1; text-transform: uppercase; letter-spacing: .12em; }
.frow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--ink3); }
.frow:last-child { border-bottom: 0; }
.frow svg { width: 58px; height: auto; flex: none; }
.frow .finfo { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.frow .finfo b { font-size: .95rem; }
.frow .factions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.frow .factions .chipbtn { justify-content: center; font-size: .78rem; padding: 5px 10px; }
.chip.ok { border-color: var(--ok); color: var(--ok); }
.chip.bad { border-color: var(--blood); color: var(--blood); }
.frow .chip { align-self: flex-start; font-size: .74rem; padding: 3px 9px; }

/* star shop */
.packs { gap: 10px; }
.pack { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--ink3); border-radius: 12px; padding: 12px; }
.pack .pinfo { display: flex; flex-direction: column; gap: 2px; }
.pack .pinfo b { font-size: 1.3rem; color: var(--mustard); }
.pack .pbtns { display: flex; flex-direction: column; gap: 6px; min-width: 130px; }
.pack .pbtns .btn { padding: 9px 10px; font-size: .88rem; }
ul.plain { margin: 0; padding-left: 1.1em; display: flex; flex-direction: column; gap: 4px; }

/* cookie consent */
.consent { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: center; pointer-events: none; }
.cbanner { pointer-events: auto; width: min(100%, 480px); background: var(--ink2); border: 2px solid var(--mustard); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 16px 40px rgba(0, 0, 0, .7); }
.cbanner b.display { font-size: 1.1rem; color: var(--mustard); }
.cbanner .evitem { cursor: default; }
.cbanner .crow .btn { padding: 10px 8px; font-size: .9rem; }

/* the long case: the floor plan and its pawns */
.chip.long { border-color: var(--mustard); color: var(--text); white-space: normal; text-align: center; }
.mapsec { gap: 8px; }
.board { position: relative; width: 100%; background: var(--paper); border-radius: 10px; box-shadow: 4px 4px 0 #000; }
.board svg.plan { display: block; width: 100%; height: 100%; border-radius: 10px; }
.plan .name { font-family: "Special Elite", "Courier New", monospace; font-size: 21px; fill: #1f1a14; }
.plan .crime { font-family: Anton, Impact, sans-serif; font-size: 15px; fill: var(--blood); letter-spacing: .1em; text-transform: uppercase; }
.plan .room { cursor: pointer; outline: none; }
.plan .room.over .floor, .plan .room:focus-visible .floor { fill: rgba(232, 178, 58, .45); }
.pawn {
  position: absolute; aspect-ratio: 1; padding: 0; border: 3px solid var(--ink); border-radius: 50%; background: var(--paper);
  touch-action: none; cursor: grab; box-shadow: 2px 2px 0 rgba(0, 0, 0, .55); display: block; user-select: none; -webkit-user-select: none;
}
.pawn svg, .pawn img { width: 100%; height: 100%; display: block; border-radius: 50%; overflow: hidden; background: var(--paper); }
.pawn img { object-fit: cover; }
.pawn .num, .trow .num {
  position: absolute; left: -4px; bottom: -4px; background: var(--ink); color: var(--mustard); font-family: Anton, Impact, sans-serif;
  font-size: .72rem; line-height: 1; padding: 3px 6px; border-radius: 9px; border: 2px solid var(--mustard);
}
.trow .tsel { position: relative; }
.trow .num { left: 4px; top: 4px; bottom: auto; }
.pawn.picked { outline: 3px solid var(--mustard); outline-offset: 2px; box-shadow: 0 0 0 6px rgba(232, 178, 58, .35); }
.pawn.drag { z-index: 5; cursor: grabbing; box-shadow: 0 14px 22px rgba(0, 0, 0, .65); }
.pawn.locked { border-color: var(--ok); cursor: default; }
.pawn .pin { position: absolute; right: -5px; top: -5px; background: var(--ok); color: #0f0e14; font-size: .7rem; font-weight: 800; width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--ink); }
.pawn.culprit { border-color: var(--blood); box-shadow: 0 0 0 5px rgba(192, 57, 43, .45); }
.pawn:disabled { cursor: default; }
.tray { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 60px; padding: 8px 12px; background: var(--ink2); border-radius: 12px; border: 2px dashed var(--ink4); margin-top: 2px; }
.tray .eyebrow { width: 100%; }
.tray .pawn { position: relative; width: 48px; }
.tray.target { border-color: var(--mustard); }
.pick { text-align: center; color: var(--mustard); }
.backres { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 5; }
.backres .btn { box-shadow: 0 10px 30px rgba(0, 0, 0, .6); }
