:root {
  color-scheme: light;
  --blue: #244f8f;
  --blue-dark: #173866;
  --yellow: #f7c948;
  --paper: #fff9e8;
  --white: #ffffff;
  --ink: #202a37;
  --muted: #64748b;
  --line: #dbe5f4;
  --shadow: 0 20px 55px rgba(36, 79, 143, .14);
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif;
  color: var(--ink);
  background: #eaf4ff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 12%, rgba(247,201,72,.35), transparent 25%),
    radial-gradient(circle at 90% 5%, rgba(255,143,171,.30), transparent 28%),
    linear-gradient(180deg, #eaf4ff, #fff9e8);
}
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 4px solid var(--yellow); outline-offset: 3px; }
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  min-height: 72px;
  padding: 12px clamp(16px, 5vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: rgba(255,255,255,.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--blue-dark);
  font-family: Fredoka, system-ui, sans-serif;
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 700;
}
.brand-badge, .poster-mark {
  display: grid;
  place-items: center;
  background: var(--yellow);
  color: var(--blue-dark);
  border: 3px solid var(--blue-dark);
  border-radius: 50%;
  font-family: Fredoka, sans-serif;
  font-weight: 700;
}
.brand-badge { width: 38px; height: 38px; }
.age-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--blue);
  color: white;
  font-size: 13px;
  font-weight: 700;
}
main {
  width: min(1120px, 100%);
  margin: 0 auto;
  flex: 1;
  padding: clamp(24px, 5vw, 58px) clamp(16px, 4vw, 30px);
}
.screen { display: none; animation: pop .28s ease both; }
.screen.is-active { display: block; }
@keyframes pop {
  from { opacity: 0; transform: translateY(8px) scale(.99); }
  to { opacity: 1; transform: none; }
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, .65fr);
  gap: 28px;
  align-items: center;
  margin-bottom: 24px;
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 13px;
  font-weight: 800;
}
h1, h2, h3 {
  margin: 0;
  font-family: Fredoka, system-ui, sans-serif;
  line-height: 1.02;
  color: var(--blue-dark);
}
h1 { max-width: 740px; font-size: clamp(48px, 8vw, 86px); }
h2 { font-size: clamp(38px, 6vw, 64px); }
h3 { font-size: 30px; }
.lede, .big-story {
  max-width: 680px;
  color: #41546c;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.55;
}
.dark { color: #41546c; }
.poster {
  min-height: 280px;
  padding: 24px;
  display: grid;
  place-items: center;
  gap: 12px;
  border: 4px solid var(--blue-dark);
  border-radius: 26px;
  background: var(--paper);
  box-shadow: var(--shadow);
  transform: rotate(1.5deg);
}
.poster-mark { width: 84px; height: 84px; font-size: 54px; }
.poster strong {
  width: min(260px, 100%);
  padding: 12px;
  border-radius: 16px;
  background: white;
  color: var(--blue-dark);
  text-align: center;
  font-family: Fredoka, sans-serif;
  font-size: 24px;
  box-shadow: 0 8px 20px rgba(36,79,143,.10);
}
.panel {
  padding: clamp(18px, 4vw, 32px);
  border: 3px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow);
}
.start-panel { display: grid; gap: 18px; }
.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.steps div {
  min-height: 90px;
  padding: 14px;
  display: grid;
  gap: 8px;
  justify-items: center;
  align-content: center;
  border-radius: 20px;
  background: #f0f7ff;
  text-align: center;
  font-weight: 800;
}
.steps strong {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  font-family: Fredoka, sans-serif;
  font-size: 22px;
}
.name-field {
  display: grid;
  gap: 8px;
  color: var(--blue-dark);
  font-size: 15px;
  font-weight: 800;
}
.mode-select {
  margin: 0;
  padding: 14px;
  display: grid;
  gap: 10px;
  border: 3px solid var(--line);
  border-radius: 20px;
  background: #f0f7ff;
}
.mode-select legend {
  padding: 0 8px;
  color: var(--blue-dark);
  font-family: Fredoka, sans-serif;
  font-size: 20px;
  font-weight: 700;
}
.mode-select label {
  min-height: 58px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 16px;
  background: white;
  cursor: pointer;
}
.mode-select input { width: 20px; min-height: 20px; accent-color: var(--blue); }
.mode-select span { line-height: 1.35; }
.mode-select strong { color: var(--blue-dark); }
input {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border: 3px solid var(--line);
  border-radius: 18px;
  background: white;
  color: var(--ink);
  font-size: 18px;
}
.button {
  min-height: 58px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-family: Fredoka, system-ui, sans-serif;
  font-size: 20px;
  font-weight: 700;
  transition: transform .16s, box-shadow .16s;
}
.button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 18px rgba(36,79,143,.16); }
.button:disabled { cursor: not-allowed; opacity: .55; }
.primary { background: var(--blue); color: white; }
.secondary { background: var(--yellow); color: var(--blue-dark); }
.ghost { background: white; color: var(--blue-dark); border: 3px solid var(--line); }
.error { min-height: 22px; margin: 0; color: #b42318; font-weight: 800; }
.case-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .9fr);
  gap: 18px;
  align-items: start;
}
.story-panel { grid-column: 1 / -1; display: grid; gap: 16px; }
.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.facts div { padding: 14px; border-radius: 18px; background: #f0f7ff; }
.facts span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.facts strong {
  display: block;
  margin-top: 4px;
  color: var(--blue-dark);
  font-size: 18px;
  overflow-wrap: anywhere;
}
.case-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.hint-box {
  margin: 0;
  padding: 14px 16px;
  border: 3px dashed #f4df9a;
  border-radius: 18px;
  background: var(--paper);
  color: #41546c;
  font-weight: 800;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 14px;
  margin-bottom: 14px;
}
.section-heading p { margin: 0; color: var(--muted); font-weight: 700; }
.clue-list, .suspect-list, .vote-suspects { display: grid; gap: 12px; }
.clue-card, .suspect-card, .vote-card {
  padding: 16px;
  border-radius: 20px;
  background: var(--paper);
  border: 3px solid #f4df9a;
}
.clue-card strong {
  display: block;
  color: var(--blue-dark);
  font-family: Fredoka, sans-serif;
  font-size: 24px;
}
.clue-card span {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #e7f1ff;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.clue-card p, .suspect-card p { margin: 8px 0 0; color: #41546c; line-height: 1.45; }
.empty-note {
  margin: 0;
  padding: 18px;
  border-radius: 20px;
  background: #f0f7ff;
  color: var(--muted);
  font-weight: 800;
}
.suspect-card {
  display: flex;
  gap: 14px;
  align-items: start;
  background: white;
  border-color: var(--line);
}
.suspect-card span, .vote-card span {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--suspect-color);
  color: var(--blue-dark);
  font-family: Fredoka, sans-serif;
  font-size: 24px;
  font-weight: 700;
}
.suspect-card strong { color: var(--blue-dark); font-size: 20px; }
.vote-panel, .result-panel {
  max-width: 820px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
  text-align: center;
}
.vote-suspects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vote-card {
  min-height: 128px;
  display: grid;
  place-items: center;
  gap: 8px;
  cursor: pointer;
  background: white;
  border-color: var(--line);
  color: var(--blue-dark);
  font-size: 24px;
}
.vote-card.is-selected {
  border-color: var(--blue);
  background: #e7f1ff;
  box-shadow: inset 0 0 0 3px var(--blue);
}
.answer {
  margin: 0;
  color: var(--blue);
  font-family: Fredoka, sans-serif;
  font-size: 32px;
  font-weight: 700;
}
.score-line { margin: 0; color: var(--blue-dark); font-size: 20px; font-weight: 800; }
footer {
  min-height: 54px;
  padding: 14px clamp(16px, 5vw, 64px);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 700;
}
@media (max-width: 760px) {
  .topbar, footer, .hero, .section-heading { align-items: stretch; flex-direction: column; }
  .hero, .case-layout { grid-template-columns: 1fr; }
  .steps, .facts, .vote-suspects { grid-template-columns: 1fr; }
  .case-actions { flex-direction: column; }
  h1 { font-size: clamp(44px, 15vw, 68px); }
}
