:root {
  font-family: Inter, ui-rounded, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f5f7fb;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background: linear-gradient(180deg, #eef6ff 0%, #f7f8fc 55%, #ffffff 100%);
}

button { font: inherit; }

.app-shell {
  width: min(100%, 560px);
  margin: 0 auto;
  min-height: 100dvh;
  padding: max(20px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
}

.screen { display: none; width: 100%; }
.screen.active { display: block; animation: fadeIn .22s ease-out; }

.hero-card, .result-card, .question-card {
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(23,32,51,.08);
  border-radius: 28px;
  box-shadow: 0 18px 50px rgba(37, 62, 103, .12);
}

.hero-card, .result-card {
  padding: 30px 22px;
  text-align: center;
}

.badge, .eyebrow, .question-label {
  display: inline-block;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #5f6f89;
}

.badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: #edf4ff;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  font-size: clamp(2.5rem, 13vw, 4rem);
  line-height: .98;
  margin: 22px 0 8px;
}

.subtitle {
  font-weight: 800;
  color: #4b74d7;
  font-size: 1.2rem;
  margin-bottom: 24px;
}

.lead {
  color: #5f6f89;
  font-size: 1.05rem;
  line-height: 1.55;
}

.mini-pills {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 24px 0;
}

.mini-pills span {
  padding: 9px 12px;
  border-radius: 999px;
  background: #f2f4f8;
  font-weight: 700;
  font-size: .9rem;
}

.primary-btn, .secondary-btn, .answer-btn {
  width: 100%;
  border: 0;
  border-radius: 18px;
  min-height: 58px;
  font-weight: 850;
  cursor: pointer;
  transition: transform .12s ease, opacity .12s ease, box-shadow .12s ease;
  -webkit-tap-highlight-color: transparent;
}

.primary-btn {
  background: #246bfd;
  color: white;
  box-shadow: 0 12px 24px rgba(36,107,253,.22);
}

.secondary-btn {
  background: #172033;
  color: white;
}

.primary-btn:active, .secondary-btn:active, .answer-btn:active { transform: scale(.985); }

.topbar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.stat-card {
  background: #fff;
  border-radius: 18px;
  padding: 12px 8px;
  text-align: center;
  border: 1px solid rgba(23,32,51,.07);
}

.stat-card span { display: block; color: #6d778a; font-size: .78rem; font-weight: 750; }
.stat-card strong { display: block; margin-top: 3px; font-size: 1.3rem; }

.timer-track {
  height: 10px;
  background: #e7ebf2;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 18px;
}

.timer-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #246bfd, #6e8fff);
  transform-origin: left center;
}

.question-card {
  min-height: 220px;
  padding: 28px 18px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  margin-bottom: 16px;
}

.question {
  font-size: clamp(3rem, 18vw, 5.8rem);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -.04em;
  margin: 10px 0;
}

.feedback {
  min-height: 26px;
  font-weight: 850;
  margin-top: 8px;
}

.answers-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.answer-btn {
  background: #fff;
  color: #172033;
  min-height: 76px;
  font-size: 1.45rem;
  border: 2px solid transparent;
  box-shadow: 0 8px 20px rgba(37,62,103,.08);
}

.answer-btn.correct { background: #e9f8ef; border-color: #43b66d; }
.answer-btn.wrong { background: #fff0f0; border-color: #e05a5a; }
.answer-btn:disabled { cursor: default; opacity: .9; }

.shake { animation: shake .28s ease; }

.rank {
  display: inline-block;
  margin: 8px 0 20px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #edf4ff;
  color: #315ba8;
  font-weight: 850;
}

.final-score { margin-bottom: 22px; }
.final-score span { display: block; color: #6d778a; font-size: .85rem; }
.final-score strong { font-size: 3.4rem; line-height: 1; }

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.result-grid > div {
  padding: 14px 10px;
  background: #f5f7fb;
  border-radius: 16px;
}

.result-grid span { display: block; color: #6d778a; font-size: .8rem; }
.result-grid strong { display: block; margin-top: 3px; font-size: 1.15rem; }

.unlock-card {
  margin-top: 22px;
  padding: 18px;
  border-radius: 22px;
  background: #fff7e8;
  border: 1px solid #f3dfb9;
  text-align: left;
}

.unlock-icon { font-size: 1.8rem; margin-bottom: 8px; }
.unlock-card h3 { margin-bottom: 6px; }
.unlock-card p { color: #6d6253; line-height: 1.45; }
.unlock-card .secondary-btn { margin-top: 8px; }
.unlock-message { min-height: 22px; margin: 12px 0 0; font-weight: 750; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }

@media (min-width: 700px) {
  .app-shell { padding-inline: 24px; }
  .hero-card, .result-card { padding: 38px 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
