:root {
  color-scheme: light;
  --bg-top: #e6f4ff;
  --bg-bottom: #fff6df;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-strong: #ffffff;
  --ink: #16324f;
  --muted: #5e7188;
  --primary: #2274f0;
  --primary-strong: #0f5ed8;
  --success: #12966f;
  --danger: #d84d6a;
  --border: rgba(22, 50, 79, 0.12);
  --shadow: 0 18px 45px rgba(36, 77, 123, 0.16);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --content-width: min(100%, 34rem);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(34, 116, 240, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255, 171, 43, 0.24), transparent 30%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

button,
h1,
h2,
h3,
p {
  margin: 0;
}

button {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.app-frame {
  width: var(--content-width);
}

.screen {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  animation: rise-in 220ms ease-out;
}

.screen::before {
  content: "";
  position: absolute;
  inset: auto -30px -40px auto;
  width: 140px;
  height: 140px;
  border-radius: 999px;
  background: rgba(34, 116, 240, 0.08);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(34, 116, 240, 0.1);
  color: var(--primary-strong);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-title,
.countdown-value,
.summary-score {
  font-family: "Trebuchet MS", "Avenir Next", sans-serif;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.hero-title {
  font-size: clamp(2.3rem, 10vw, 4.2rem);
  line-height: 0.95;
}

.hero-copy,
.muted,
.summary-copy,
.feedback-copy {
  color: var(--muted);
  line-height: 1.5;
}

.stat-row,
.summary-stats,
.quiz-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.pill,
.score-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  font-weight: 700;
}

.progress-card {
  display: grid;
  gap: 8px;
}

.progress-label-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.95rem;
  font-weight: 700;
}

.progress-track {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: rgba(34, 116, 240, 0.12);
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #32b8ff, var(--primary));
  transition: width 180ms ease-out;
}

.question-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  border: 1px solid var(--border);
}

.question-text {
  font-size: clamp(1.5rem, 6vw, 2.2rem);
  font-weight: 800;
  line-height: 1.1;
}

.question-hint {
  color: var(--muted);
  font-weight: 600;
}

.answer-list {
  display: grid;
  gap: 12px;
}

.answer-button,
.primary-button,
.secondary-button {
  min-height: 58px;
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  transition:
    transform 140ms ease,
    background-color 140ms ease,
    box-shadow 140ms ease,
    opacity 140ms ease;
}

.answer-button {
  width: 100%;
  padding: 16px 18px;
  text-align: left;
  color: var(--ink);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  box-shadow: 0 8px 18px rgba(26, 58, 97, 0.06);
  font-weight: 700;
}

.answer-button:hover,
.answer-button:focus-visible,
.primary-button:hover,
.primary-button:focus-visible,
.secondary-button:hover,
.secondary-button:focus-visible {
  transform: translateY(-1px);
}

.answer-button.correct {
  color: #fff;
  background: var(--success);
}

.answer-button.wrong {
  color: #fff;
  background: var(--danger);
}

.answer-button.reveal {
  border-color: rgba(18, 150, 111, 0.35);
}

.answer-button:disabled {
  cursor: default;
}

.primary-button,
.secondary-button {
  padding: 16px 18px;
  font-weight: 800;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #31a7ff);
  box-shadow: 0 12px 24px rgba(34, 116, 240, 0.28);
}

.secondary-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
}

.button-group {
  display: grid;
  gap: 12px;
}

.countdown-screen,
.feedback-screen,
.summary-screen {
  text-align: center;
}

.countdown-value {
  font-size: clamp(4rem, 24vw, 7rem);
  line-height: 1;
}

.feedback-badge {
  justify-self: center;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 800;
}

.feedback-badge.correct {
  color: #fff;
  background: var(--success);
}

.feedback-badge.wrong {
  color: #fff;
  background: var(--danger);
}

.summary-score {
  font-size: clamp(3rem, 16vw, 5rem);
  line-height: 1;
}

.summary-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  border: 1px solid var(--border);
}

.footer-note {
  font-size: 0.92rem;
  color: var(--muted);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 768px) {
  .page-shell {
    padding: 40px 24px;
  }

  .screen {
    gap: 22px;
    padding: 30px;
  }

  .button-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  :root {
    --content-width: min(100%, 42rem);
  }

  .screen {
    padding: 34px;
  }
}

