:root {
  --ink: #17324d;
  --muted: #65758a;
  --paper: #fffdf7;
  --surface: #ffffff;
  --line: #d9e0e8;
  --green: #2f7d6b;
  --green-dark: #206454;
  --blue: #133b5c;
  --yellow: #f4c95d;
  --red: #c95050;
  --shadow: 0 18px 45px rgba(23, 50, 77, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #f6f9fb 0%, var(--paper) 48%, #eef6f2 100%);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.55;
}

button {
  font: inherit;
}

.game-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 32px;
  align-items: center;
  padding: 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero h1,
.age-selector h2,
.question-panel h2,
.result-panel h2 {
  margin: 0;
  line-height: 1.1;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 780px;
  font-size: clamp(2rem, 7vw, 4.4rem);
}

.hero__lead {
  max-width: 760px;
  margin: 18px 0 0;
  color: #36536c;
  font-size: 1.25rem;
}

.hero__mark {
  width: 100%;
  max-width: 220px;
}

.hero__mark svg {
  display: block;
  width: 100%;
  height: auto;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.intro-copy {
  display: grid;
  gap: 16px;
  margin: 32px 0;
  padding: 0 8px;
}

.intro-copy p {
  max-width: 900px;
  margin: 0;
  color: #34495e;
}

.age-selector {
  display: grid;
  gap: 20px;
  margin-top: 34px;
}

.age-selector h2 {
  font-size: clamp(1.6rem, 4vw, 2.35rem);
}

.age-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.age-card {
  display: grid;
  min-height: 176px;
  padding: 22px;
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(23, 50, 77, 0.09);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.age-card:hover,
.age-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--green);
  box-shadow: var(--shadow);
  outline: none;
}

.age-card__title {
  font-size: 1.35rem;
  font-weight: 800;
}

.age-card__subtitle {
  margin-top: 10px;
  color: var(--muted);
}

.age-card__meta {
  align-self: end;
  margin-top: 24px;
  color: var(--green-dark);
  font-weight: 700;
}

.quiz-view,
.result-view {
  width: min(880px, 100%);
  margin: 0 auto;
}

.quiz-topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.score-pill {
  min-width: 120px;
  padding: 10px 14px;
  color: var(--blue);
  background: #eef6f2;
  border: 1px solid #c8ded6;
  border-radius: 999px;
  text-align: center;
  font-weight: 800;
}

.progress {
  height: 10px;
  overflow: hidden;
  margin-bottom: 18px;
  background: #dce5ed;
  border-radius: 999px;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--yellow), var(--green));
  transition: width 220ms ease;
}

.question-panel,
.result-panel {
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.question-count {
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 700;
}

.question-panel h2 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
}

.statement {
  margin: 30px 0;
  font-size: clamp(1.35rem, 4.5vw, 2.25rem);
  font-weight: 800;
  line-height: 1.24;
}

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

.answer-button,
.primary-button,
.text-button {
  min-height: 48px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.answer-button {
  padding: 18px;
  color: var(--ink);
  background: #f8fafb;
  border: 2px solid var(--line);
  font-size: 1.25rem;
}

.answer-button:hover,
.answer-button:focus-visible {
  border-color: var(--blue);
  outline: none;
}

.answer-button.is-correct {
  color: #ffffff;
  background: var(--green);
  border-color: var(--green);
}

.answer-button.is-wrong {
  color: #ffffff;
  background: var(--red);
  border-color: var(--red);
}

.answer-button.is-muted {
  opacity: 0.55;
}

.feedback {
  margin-top: 22px;
  padding: 18px;
  border-radius: 8px;
}

.feedback strong,
.feedback span {
  display: block;
}

.feedback p {
  margin: 10px 0 0;
}

.feedback--correct {
  background: #eef8f3;
  border: 1px solid #b9dbc9;
}

.feedback--wrong {
  background: #fff3f0;
  border: 1px solid #ecc5bf;
}

.primary-button {
  margin-top: 22px;
  padding: 0 22px;
  color: #ffffff;
  background: var(--blue);
  border: 0;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: #0d2c45;
  outline: none;
}

.text-button {
  padding: 0 14px;
  color: var(--blue);
  background: transparent;
  border: 1px solid var(--line);
}

.text-button:hover,
.text-button:focus-visible {
  border-color: var(--blue);
  outline: none;
}

.result-panel {
  text-align: center;
}

.result-panel h2 {
  font-size: clamp(2rem, 6vw, 3.4rem);
}

.result-score {
  margin: 22px 0 8px;
  color: var(--green-dark);
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-weight: 900;
}

.result-copy {
  max-width: 620px;
  margin: 0 auto;
  color: var(--muted);
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 820px) {
  .game-shell {
    width: min(100% - 22px, 720px);
    padding-top: 16px;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 26px;
  }

  .hero__mark {
    max-width: 150px;
  }

  .age-list {
    grid-template-columns: 1fr;
  }

  .quiz-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .score-pill {
    width: 100%;
  }

  .question-panel,
  .result-panel {
    padding: 24px;
  }
}

@media (max-width: 560px) {
  .answer-grid {
    grid-template-columns: 1fr;
  }

  .statement {
    margin: 24px 0;
  }

  .result-actions {
    display: grid;
  }
}
