/* Noir "evidence board" look of the app: charcoal + oxblood background, ivory paper cards, gold accents. */
:root {
  --charcoal: #160F0F;
  --oxblood: #7A1A22;
  --case-red: #7A1620;
  --gold: #E2B24E;
  --gold-deep: #B8862B;
  --ivory: #FAF6ED;
  --paper: #F3EAD7;
  --ink: #1A1A17;
  --muted: #6B5E52;
  --green: #1F5B3A;
  --line: #CDBFA6;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "Courier Prime", "Courier New", monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: radial-gradient(ellipse at top, #3a1418 0%, var(--charcoal) 60%) fixed, var(--charcoal);
  line-height: 1.45;
}
img { max-width: 100%; display: block; }
button { font: inherit; }

.hero { position: relative; max-width: 720px; margin: 0 auto; color: var(--ivory); }
.hero-art { width: 100%; height: 300px; object-fit: cover; object-position: 30% 30%; mask-image: linear-gradient(#000 55%, transparent); -webkit-mask-image: linear-gradient(#000 55%, transparent); }
.hero-text { padding: 0 16px; margin-top: -88px; position: relative; text-align: center; }
.kicker { font-family: var(--mono); color: var(--gold); margin: 0 0 4px; letter-spacing: .04em; text-shadow: 0 1px 6px #000, 0 0 2px #000; }
h1, .lede { text-shadow: 0 2px 10px rgba(0,0,0,.8); }
h1 { font-family: var(--serif); font-size: 34px; line-height: 1.1; margin: 0 0 8px; }
.lede { margin: 0 auto 16px; max-width: 520px; color: #E9DFCC; }

main { max-width: 720px; margin: 0 auto; padding: 0 12px 24px; }
.card { min-width: 0; overflow-wrap: break-word; }
.card {
  background: var(--paper);
  border-radius: 14px;
  padding: 16px;
  margin: 12px 0;
  box-shadow: 0 8px 24px rgba(0,0,0,.35), inset 0 0 0 1px rgba(122,26,34,.12);
}
.card h2 { font-family: var(--serif); font-size: 22px; line-height: 1.2; margin: 0 0 8px; color: var(--case-red); }
.section-title { font-size: 19px !important; }
.intro { margin: 0; }
.case-meta { font-family: var(--mono); color: var(--muted); margin: 8px 0 0; font-size: 14px; }
.hint-text { color: var(--muted); font-size: 14px; margin: 0 0 10px; }

/* Cast */
.cast { display: grid; gap: 14px; }
.cast-group h3 { font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 6px; }
.cast-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.item { background: var(--ivory); border: 1px solid var(--line); border-radius: 10px; padding: 6px; text-align: center; }
.item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 7px; background: #e8dcc4; }
.item .name { font-family: var(--serif); font-weight: 700; font-size: 14px; line-height: 1.15; margin: 6px 0 2px; }
.item .traits { font-size: 11.5px; color: var(--muted); line-height: 1.3; }

/* Clues */
.clues { margin: 0; padding-left: 22px; }
.clues li { padding: 8px 4px; border-bottom: 1px dashed var(--line); cursor: pointer; font-family: var(--mono); font-size: 15.5px; }
.clues li:last-child { border-bottom: 0; }
.clues li.struck { text-decoration: line-through; color: #9A8C7C; }

/* Grid */
.grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.grid { border-collapse: collapse; margin: 0 auto; }
.grid th, .grid td { padding: 0; }
.grid .head-img { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; display: block; margin: 2px auto; }
.grid .row-head { padding-right: 4px; }
.grid .row-head .head-img { width: 46px; height: 46px; }
.grid .group-label { font-family: var(--mono); font-size: 10px; text-transform: uppercase; color: var(--muted); letter-spacing: .06em; }
.cell {
  width: 46px; height: 46px;
  border: 1px solid var(--line);
  background: var(--ivory);
  font-size: 24px; line-height: 44px; text-align: center;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
}
.cell.block-r { border-right: 2px solid var(--ink); }
.cell.block-b { border-bottom: 2px solid var(--ink); }
.cell.cross { color: var(--case-red); }
.cell.auto { color: #C9A9A0; }
.cell.check { color: var(--green); font-weight: 700; background: #E5F0E4; }
.cell.mistake { background: #F6D3CF; }
.cell:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.blank { border: 0; }
.grid-actions { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }

/* Accusation */
.pick h3 { font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 10px 0 6px; }
.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.chip { border: 2px solid var(--line); background: var(--ivory); border-radius: 10px; padding: 4px; cursor: pointer; text-align: center; font-size: 12.5px; font-weight: 600; line-height: 1.2; color: var(--ink); }
.chip img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; margin-bottom: 4px; }
.chip[aria-pressed="true"] { border-color: var(--case-red); box-shadow: 0 0 0 2px var(--case-red); }

/* Buttons */
.btn { border: 0; border-radius: 999px; padding: 12px 22px; font-weight: 700; cursor: pointer; }
.btn.gold { display: block; width: 100%; margin-top: 16px; background: linear-gradient(#F0CB73, var(--gold) 45%, var(--gold-deep)); color: #2A1A08; font-family: var(--serif); font-size: 19px; box-shadow: 0 3px 0 #8F6620; }
.btn.gold:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: transparent; border: 1.5px solid var(--case-red); color: var(--case-red); padding: 8px 16px; font-size: 14px; }
.note { margin: 10px 0 0; font-size: 14.5px; }
.note.wrong { color: var(--case-red); font-weight: 600; }

/* Solved */
.solved { text-align: center; }
.stamp { display: inline-block; font-family: var(--mono); font-weight: 700; color: var(--case-red); border: 3px solid var(--case-red); padding: 2px 10px; transform: rotate(-4deg); letter-spacing: .1em; text-transform: uppercase; margin: 0 0 10px; }
blockquote { font-family: var(--serif); font-style: italic; margin: 12px 0; color: #3b2a22; }
.next { color: var(--muted); font-size: 14px; }

/* Promo */
.promo { background: linear-gradient(160deg, #2a1215, var(--charcoal)); color: var(--ivory); box-shadow: 0 8px 24px rgba(0,0,0,.4), inset 0 0 0 1px rgba(226,178,78,.35); }
.promo h2 { color: var(--gold); }
.promo-list { margin: 0 0 14px; padding-left: 20px; }
.promo-list li { margin: 4px 0; }
.stores { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.store { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: #000; color: #fff; text-decoration: none; border: 1px solid #666; }
.store-ico { width: 26px; height: 26px; flex-shrink: 0; }
.store-text { display: flex; flex-direction: column; line-height: 1.1; }
.app-row { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.app-row h2 { margin: 0; }
.app-row > div { min-width: 0; }
.store-text { min-width: 0; }
.app-icon { width: 64px; height: 64px; border-radius: 15px; box-shadow: 0 2px 8px rgba(0,0,0,.5); flex-shrink: 0; }
.app-sub { margin: 2px 0 0; font-size: 13px; color: #CDBFA6; }
.shots { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -4px 14px; padding: 0 4px 6px; }
.shots img { width: 46%; max-width: 220px; flex-shrink: 0; height: auto; border-radius: 12px; scroll-snap-align: start; box-shadow: 0 4px 14px rgba(0,0,0,.5); }
.store-small { font-size: 10.5px; opacity: .85; }
.store-big { font-size: 16px; font-weight: 700; white-space: nowrap; }

/* Guide, FAQ */
.guide ol { padding-left: 20px; }
.guide li { margin: 6px 0; }
.faq details { border-bottom: 1px dashed var(--line); padding: 8px 0; }
.faq summary { cursor: pointer; font-weight: 600; }

.footer { text-align: center; color: #B9A98F; font-size: 13px; padding: 8px 0 32px; }
.footer a { color: #E9DFCC; }

.consent { position: fixed; left: 12px; right: 12px; bottom: 12px; max-width: 560px; margin: 0 auto; background: var(--ivory); border-radius: 12px; padding: 12px 14px; box-shadow: 0 8px 30px rgba(0,0,0,.5); display: flex; gap: 10px; align-items: center; justify-content: space-between; font-size: 14px; z-index: 10; }
.consent p { margin: 0; }
.consent div { display: flex; gap: 8px; flex-shrink: 0; }
.consent .btn.gold { width: auto; margin: 0; font-size: 15px; padding: 8px 16px; }

[hidden] { display: none !important; }

@media (max-width: 380px) {
  .cell, .grid .head-img, .grid .row-head .head-img { width: 40px; height: 40px; }
  .cell { line-height: 38px; font-size: 21px; }
  h1 { font-size: 29px; }
}
@media (min-width: 640px) {
  .cell, .grid .head-img, .grid .row-head .head-img { width: 56px; height: 56px; }
  .cell { line-height: 54px; }
  .hero-art { height: 380px; }
}
