:root {
  color-scheme: light;
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
  color: #2d504d;
  background: #f7f1df;
  font-synthesis: none;
  --paper: #fffdf7;
  --cream: #fff5d8;
  --green: #3e9273;
  --green-dark: #2f745b;
  --yellow: #f2bd4e;
  --coral: #e97862;
  --blue: #4f9bb7;
  --violet: #8872b4;
  --line: #ded5ba;
  --muted: #6b817d;
  --route-accent: #e97862;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-width: 320px;
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 7%, rgba(255, 255, 255, 0.85) 0 7%, transparent 22%),
    radial-gradient(circle at 92% 22%, rgba(238, 187, 81, 0.17) 0 8%, transparent 24%),
    linear-gradient(135deg, #f8f3e5, #f3ecd8);
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 4px solid #f2bd4e;
  outline-offset: 3px;
}

.app {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 52px;
}

.screen {
  display: none;
}

.screen--active {
  display: block;
}

.topbar {
  min-height: 66px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand-button {
  min-height: 56px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.brand-mark {
  width: 64px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #3e9273;
  box-shadow: 0 6px 0 #2f745b;
  font-size: 31px;
  transform: rotate(-2deg);
}

.brand-button strong,
.brand-button small {
  display: block;
}

.brand-button strong {
  font-size: 18px;
}

.brand-button small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.sound-button,
.back-button,
.secondary-button,
.hint-button {
  min-height: 46px;
  padding: 0 17px;
  border: 2px solid var(--line);
  border-radius: 15px;
  color: #48635f;
  background: rgba(255, 253, 247, 0.9);
  box-shadow: 0 3px 0 rgba(91, 77, 45, 0.12);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.sound-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sound-button:hover,
.back-button:hover,
.secondary-button:hover,
.hint-button:hover {
  background: #fff;
  transform: translateY(-2px);
}

.sound-button:active,
.back-button:active,
.secondary-button:active,
.hint-button:active {
  box-shadow: 0 1px 0 rgba(91, 77, 45, 0.12);
  transform: translateY(1px);
}

.eyebrow {
  margin: 0 0 8px;
  color: #6d827e;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-card {
  min-height: 488px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(430px, 0.95fr);
  overflow: hidden;
  border: 2px solid #e2d8ba;
  border-radius: 38px;
  background: var(--paper);
  box-shadow: 0 18px 40px rgba(68, 78, 57, 0.12);
}

.hero-copy {
  padding: 52px 44px;
  position: relative;
  z-index: 2;
}

.hero-copy h1 {
  max-width: 540px;
  margin: 0;
  color: #294d48;
  font-size: clamp(44px, 5vw, 60px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
}

.hero-lead {
  max-width: 560px;
  margin: 20px 0 26px;
  color: #607772;
  font-size: 18px;
  line-height: 1.55;
}

.mode-picker {
  max-width: 520px;
  padding: 19px 21px 21px;
  border: 2px solid #e8ddbd;
  border-radius: 24px;
  background: #fff8e4;
}

.mode-picker > strong {
  display: block;
  margin-bottom: 12px;
  color: #365955;
  font-size: 14px;
}

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

.mode-button {
  min-height: 58px;
  padding: 8px 12px;
  border: 2px solid #ddd2b6;
  border-radius: 16px;
  color: #536d68;
  background: #fffdf8;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.mode-button span {
  margin-right: 5px;
}

.mode-button:hover {
  border-color: #7ab49d;
  transform: translateY(-1px);
}

.mode-button--active {
  border-color: #3e9273;
  color: #fff;
  background: #3e9273;
  box-shadow: 0 4px 0 #2f745b;
}

.hero-art {
  min-width: 0;
  align-self: center;
  aspect-ratio: 3 / 2;
  margin: 30px 30px 30px 0;
  overflow: hidden;
  border: 6px solid #fff;
  border-radius: 32px;
  background: #f4ead1;
  box-shadow: 0 14px 30px rgba(68, 78, 57, 0.16);
}

.hero-art__image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.how-section {
  padding: 58px 0 34px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.section-heading h2,
.journal-copy h2 {
  margin: 0;
  color: #2d504d;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.how-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.how-grid article {
  min-height: 136px;
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 15px;
  border: 2px solid #e4dbc2;
  border-radius: 24px;
  background: rgba(255, 253, 247, 0.82);
}

.how-grid article > span {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: #3e9273;
  box-shadow: 0 5px 0 #2f745b;
  font-family: Georgia, serif;
  font-size: 26px;
  font-weight: 900;
}

.how-grid article:nth-child(2) > span {
  background: #e97862;
  box-shadow: 0 5px 0 #bb5948;
}

.how-grid article:nth-child(3) > span {
  background: #8872b4;
  box-shadow: 0 5px 0 #65528f;
}

.how-grid strong,
.how-grid small {
  display: block;
}

.how-grid strong {
  font-size: 16px;
}

.how-grid small {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.routes-section {
  padding: 42px 40px 44px;
  border: 2px solid #ded4b8;
  border-radius: 34px;
  background: rgba(255, 250, 236, 0.82);
  box-shadow: 0 16px 42px rgba(75, 65, 38, 0.08);
}

.section-heading--routes > p {
  margin: 0;
  padding: 10px 14px;
  border-radius: 14px;
  color: #57716d;
  background: #fff;
  font-size: 13px;
  font-weight: 800;
}

.route-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.route-card {
  min-height: 335px;
  padding: 21px;
  display: flex;
  flex-direction: column;
  border: 3px solid #fff;
  border-radius: 27px;
  background: color-mix(in srgb, var(--route-card-accent) 11%, #fffdf7);
  box-shadow: 0 8px 0 color-mix(in srgb, var(--route-card-accent) 28%, #d7cdb3);
}

.route-card__visual {
  min-height: 112px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 20px;
  background: color-mix(in srgb, var(--route-card-accent) 19%, #fff);
}

.route-card__visual > span {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border: 5px solid rgba(255, 255, 255, 0.85);
  border-radius: 24px;
  background: #fff8e4;
  box-shadow: 0 6px 0 color-mix(in srgb, var(--route-card-accent) 28%, #c9b993);
  font-size: 38px;
  transform: rotate(-3deg);
}

.route-card small {
  margin-top: 18px;
  color: var(--route-card-accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.route-card h3 {
  margin: 7px 0 0;
  color: #31534f;
  font-size: 25px;
  font-weight: 900;
}

.route-card p {
  margin: 9px 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.route-card__footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.route-progress {
  color: #5c716d;
  font-size: 12px;
  font-weight: 900;
}

.route-button,
.primary-button {
  min-height: 50px;
  padding: 0 19px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: #3e9273;
  box-shadow: 0 5px 0 #2f745b;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.route-button {
  min-width: 116px;
  background: var(--route-card-accent);
  box-shadow: 0 5px 0 color-mix(in srgb, var(--route-card-accent) 70%, #4d4437);
}

.route-button:hover,
.primary-button:hover {
  filter: brightness(1.04);
  transform: translateY(-2px);
}

.route-button:active,
.primary-button:active {
  box-shadow: 0 2px 0 #2f745b;
  transform: translateY(1px);
}

.journal-card {
  margin-top: 24px;
  padding: 28px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border: 2px solid #d9d0b5;
  border-radius: 30px;
  background: #fffdf7;
}

.journal-copy {
  display: flex;
  align-items: center;
  gap: 18px;
}

.journal-icon {
  width: 70px;
  height: 70px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 23px;
  background: #f4e7bd;
  font-size: 36px;
}

.journal-copy h2 {
  font-size: 28px;
}

.journal-copy p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.journal-badges {
  display: flex;
  gap: 9px;
}

.journal-badge {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 3px dashed #d5ccb5;
  border-radius: 50%;
  color: #a29a87;
  background: #f7f3e8;
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 900;
}

.journal-badge--open {
  border-style: solid;
  border-color: var(--badge-color);
  color: #fff;
  background: var(--badge-color);
  box-shadow: 0 5px 0 color-mix(in srgb, var(--badge-color) 68%, #5f5544);
}

.adult-note {
  margin-top: 20px;
  padding: 18px 23px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 2px solid #ddd4ba;
  border-radius: 22px;
  background: rgba(255, 253, 247, 0.72);
}

.adult-note > span {
  font-size: 27px;
}

.adult-note p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.adult-note strong {
  color: #3f615c;
}

.game-shell {
  padding: 28px 34px 36px;
  border: 2px solid #ded4b8;
  border-radius: 34px;
  background: #fffaf0;
  box-shadow: 0 20px 52px rgba(75, 65, 38, 0.11);
}

.game-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.round-count {
  min-width: 88px;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  color: #7d8b86;
}

.round-count strong {
  color: var(--route-accent);
  font-size: 34px;
}

.round-count span {
  font-weight: 900;
}

.progress-track {
  height: 10px;
  margin: 22px 0 28px;
  overflow: hidden;
  border-radius: 20px;
  background: #e8e0cd;
}

.progress-track span {
  width: 10%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--route-accent);
  transition: width 0.3s ease;
}

.task-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 20px;
}

.problem-card,
.answer-panel {
  min-height: 520px;
  border: 3px solid #fff;
  border-radius: 28px;
}

.problem-card {
  padding: 30px;
  overflow: hidden;
  background:
    radial-gradient(circle at 84% 12%, color-mix(in srgb, var(--route-accent) 18%, transparent) 0 8%, transparent 28%),
    #edf5ed;
  box-shadow: inset 0 0 0 2px #d9e6d7;
  text-align: center;
}

.problem-card h1 {
  margin: 0;
  color: #2e504b;
  font-size: 37px;
  font-weight: 900;
}

.equation {
  min-height: 135px;
  margin: 25px auto 22px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border: 5px solid #fff;
  border-radius: 26px;
  background: #fffaf0;
  box-shadow: 0 7px 0 rgba(78, 76, 57, 0.13);
}

.equation-number,
.equation-sign,
.equation-answer {
  display: grid;
  place-items: center;
  font-family: Georgia, serif;
  font-size: 57px;
  font-weight: 900;
}

.equation-number {
  min-width: 76px;
  color: #345852;
}

.equation-sign {
  color: var(--route-accent);
}

.equation-answer {
  width: 76px;
  height: 76px;
  border-radius: 23px;
  color: #fff;
  background: var(--route-accent);
  box-shadow: 0 6px 0 color-mix(in srgb, var(--route-accent) 68%, #544c43);
}

.counting-scene {
  min-height: 180px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border-radius: 23px;
  background: rgba(255, 255, 255, 0.68);
}

.count-group {
  min-width: 120px;
  max-width: 220px;
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: center;
  gap: 5px;
}

.count-dot {
  width: 24px;
  height: 24px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--route-accent);
  box-shadow: 0 3px 0 rgba(69, 61, 45, 0.14);
}

.count-dot:nth-child(3n) {
  background: #f2bd4e;
}

.count-dot:nth-child(4n) {
  background: #4f9bb7;
}

.tens-stack {
  width: 22px;
  height: 92px;
  position: relative;
  border: 3px solid #fff;
  border-radius: 10px;
  background:
    repeating-linear-gradient(
      180deg,
      var(--route-accent) 0 7px,
      color-mix(in srgb, var(--route-accent) 72%, #fff) 7px 9px
    );
  box-shadow: 0 3px 0 rgba(69, 61, 45, 0.14);
}

.count-scene-sign {
  color: #60726e;
  font-family: Georgia, serif;
  font-size: 30px;
  font-weight: 900;
}

.task-instruction {
  margin: 18px 0 0;
  color: #647a75;
  font-weight: 800;
}

.answer-panel {
  padding: 29px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #fff4d6;
  box-shadow: inset 0 0 0 2px #eadfbe;
}

.choice-answers {
  display: grid;
  gap: 14px;
}

.answer-choice {
  min-height: 106px;
  padding: 10px 22px;
  position: relative;
  border: 4px solid #fff;
  border-radius: 25px;
  color: #385b55;
  background: #fffdf7;
  box-shadow: 0 7px 0 #d8caa4;
  font-family: Georgia, serif;
  font-size: 44px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.answer-choice:hover {
  border-color: var(--route-accent);
  transform: translateY(-2px);
}

.answer-choice:active {
  box-shadow: 0 2px 0 #d8caa4;
  transform: translateY(2px);
}

.answer-choice--wrong {
  border-color: #d96d5d;
  background: #ffe8df;
  animation: nudge 0.25s ease;
}

.answer-choice--correct {
  border-color: #3e9273;
  color: #fff;
  background: #58aa85;
  box-shadow: 0 7px 0 #3a7f65;
}

.answer-choice--hint {
  border-color: #e3aa36;
  box-shadow: 0 0 0 5px rgba(242, 189, 78, 0.24), 0 7px 0 #d8caa4;
}

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

.input-answer {
  width: min(330px, 100%);
  margin: 0 auto;
}

.number-display {
  min-height: 94px;
  margin-bottom: 13px;
  display: grid;
  place-items: center;
  border: 5px solid #fff;
  border-radius: 23px;
  color: #365b55;
  background: #fffdf7;
  box-shadow: 0 7px 0 #d8caa4;
  font-family: Georgia, serif;
  font-size: 50px;
  font-weight: 900;
}

.number-display--wrong {
  border-color: #d96d5d;
  background: #ffe8df;
  animation: nudge 0.25s ease;
}

.number-display--correct {
  border-color: #3e9273;
  color: #fff;
  background: #58aa85;
}

.number-pad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.number-pad button {
  min-height: 61px;
  border: 3px solid #fff;
  border-radius: 18px;
  color: #395d56;
  background: #fffdf7;
  box-shadow: 0 4px 0 #d8caa4;
  font-family: Georgia, serif;
  font-size: 25px;
  font-weight: 900;
  cursor: pointer;
}

.number-pad button:hover {
  border-color: var(--route-accent);
  transform: translateY(-1px);
}

.number-pad button:active {
  box-shadow: 0 1px 0 #d8caa4;
  transform: translateY(2px);
}

.number-pad .number-pad__clear {
  color: #a75549;
  background: #fff0e8;
}

.number-pad .number-pad__check {
  color: #fff;
  background: #3e9273;
  box-shadow: 0 4px 0 #2f745b;
}

.number-pad button:disabled {
  opacity: 0.55;
  cursor: default;
}

.hint-button {
  margin: 22px auto 0;
  border-color: #e7c871;
  background: #fff3bd;
}

.hint-button:disabled {
  opacity: 0.55;
  cursor: default;
}

.feedback-card {
  min-height: 96px;
  margin-top: 22px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 2px solid #dbe4d6;
  border-radius: 22px;
  background: #eff5ed;
}

.feedback-card--wrong {
  border-color: #ecc3b6;
  background: #fff0e9;
}

.feedback-card--hint {
  border-color: #e8cf83;
  background: #fff7d8;
}

.feedback-card--correct {
  border-color: #add7bf;
  background: #e4f4e9;
}

.feedback-icon {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: #fff;
  font-size: 25px;
}

.feedback-card > div {
  min-width: 0;
  flex: 1;
}

.feedback-card strong,
.feedback-card small {
  display: block;
}

.feedback-card small {
  margin-top: 4px;
  color: #627772;
  line-height: 1.45;
}

.primary-button--compact {
  min-width: 126px;
  margin-left: auto;
}

.result-scene {
  min-height: 680px;
  padding: 36px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid #d8d5b8;
  border-radius: 36px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.7) 0 5%, transparent 19%),
    linear-gradient(180deg, #c9e8df 0 58%, #85ba82 58% 100%);
  box-shadow: 0 20px 52px rgba(75, 65, 38, 0.11);
}

.result-card {
  width: min(680px, 100%);
  padding: 43px;
  border: 7px solid #fff4d6;
  border-radius: 32px;
  background: #fffaf0;
  box-shadow: 0 15px 0 rgba(61, 82, 66, 0.14);
  text-align: center;
}

.result-badge {
  width: 108px;
  height: 108px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  border: 8px solid #fff;
  border-radius: 34px;
  color: #fff;
  background: var(--route-accent);
  box-shadow: 0 8px 0 color-mix(in srgb, var(--route-accent) 68%, #574c41);
  font-family: Georgia, serif;
  font-size: 44px;
  font-weight: 900;
  transform: rotate(-4deg);
}

.result-card h1 {
  margin: 0;
  color: #2d504d;
  font-size: 48px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.result-card > p:not(.eyebrow) {
  max-width: 520px;
  margin: 15px auto;
  color: var(--muted);
  line-height: 1.5;
}

.result-stars {
  margin: 21px 0;
  color: #efb945;
  font-size: 49px;
  letter-spacing: 5px;
}

.result-stats {
  margin: 22px 0 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.result-stats span {
  padding: 14px 8px;
  border-radius: 17px;
  background: #f3ead4;
}

.result-stats strong,
.result-stats small {
  display: block;
}

.result-stats strong {
  color: #3e695b;
  font-size: 27px;
}

.result-stats small {
  margin-top: 3px;
  color: #807966;
  font-size: 11px;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.qa-report {
  width: min(560px, calc(100% - 24px));
  max-height: 70vh;
  padding: 18px;
  position: fixed;
  z-index: 9999;
  right: 12px;
  bottom: 12px;
  overflow: auto;
  border: 3px solid #3e9273;
  border-radius: 18px;
  color: #294d48;
  background: #fffdf7;
  box-shadow: 0 12px 45px rgba(27, 56, 49, 0.28);
  font-size: 13px;
}

.qa-report h2 {
  margin: 0 0 10px;
  font-size: 19px;
}

.qa-report p {
  margin: 5px 0;
}

.qa-report .qa-pass {
  color: #2f745b;
}

.qa-report .qa-fail {
  color: #b64d42;
}

@keyframes nudge {
  0%,
  100% {
    transform: translateX(0);
  }
  35% {
    transform: translateX(-5px);
  }
  70% {
    transform: translateX(5px);
  }
}

@media (max-width: 940px) {
  .hero-card {
    grid-template-columns: 1fr;
  }

  .hero-art {
    margin: 0 30px 30px;
  }

  .route-grid {
    grid-template-columns: 1fr;
  }

  .route-card {
    min-height: 230px;
    display: grid;
    grid-template-columns: 160px 1fr;
    grid-template-rows: auto auto 1fr auto;
    column-gap: 20px;
  }

  .route-card__visual {
    grid-row: 1 / 5;
  }

  .route-card small {
    margin-top: 4px;
  }

  .route-card p {
    margin-bottom: 10px;
  }

  .task-layout {
    grid-template-columns: 1fr;
  }

  .problem-card,
  .answer-panel {
    min-height: auto;
  }

  .answer-panel {
    padding: 24px;
  }

  .choice-answers {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app {
    width: min(1120px, calc(100% - 20px));
    padding-top: 12px;
  }

  .topbar {
    margin-bottom: 14px;
  }

  .brand-button small,
  .sound-button span:last-child {
    display: none;
  }

  .sound-button {
    width: 48px;
    padding: 0;
    justify-content: center;
  }

  .hero-card {
    border-radius: 28px;
  }

  .hero-copy {
    padding: 40px 26px 34px;
  }

  .hero-copy h1 {
    font-size: 42px;
  }

  .hero-lead {
    margin: 20px 0 24px;
    font-size: 16px;
  }

  .hero-art {
    margin: 0 18px 18px;
    border-width: 4px;
    border-radius: 24px;
  }

  .how-section {
    padding: 44px 0 28px;
  }

  .section-heading {
    display: block;
  }

  .section-heading h2 {
    font-size: 32px;
  }

  .how-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .how-grid article {
    min-height: 102px;
  }

  .routes-section {
    padding: 32px 15px 35px;
    border-radius: 27px;
  }

  .section-heading--routes > p {
    width: fit-content;
    margin-top: 12px;
  }

  .route-card {
    min-height: 330px;
    display: flex;
  }

  .route-card__visual {
    min-height: 118px;
  }

  .route-card small {
    margin-top: 16px;
  }

  .journal-card {
    padding: 25px 20px;
    display: block;
  }

  .journal-copy {
    align-items: flex-start;
  }

  .journal-copy h2 {
    font-size: 25px;
  }

  .journal-badges {
    margin-top: 20px;
    justify-content: center;
  }

  .adult-note {
    align-items: flex-start;
  }

  .game-shell {
    padding: 21px 11px 27px;
    border-radius: 26px;
  }

  .back-button {
    min-height: 44px;
    padding: 0 12px;
    font-size: 13px;
  }

  .progress-track {
    margin: 18px 0 21px;
  }

  .problem-card {
    padding: 24px 12px;
    border-radius: 23px;
  }

  .problem-card h1 {
    font-size: 31px;
  }

  .equation {
    min-height: 112px;
    margin: 19px auto;
    padding: 12px 10px;
    gap: 8px;
  }

  .equation-number,
  .equation-sign,
  .equation-answer {
    font-size: 44px;
  }

  .equation-number {
    min-width: 50px;
  }

  .equation-answer {
    width: 61px;
    height: 61px;
  }

  .counting-scene {
    min-height: 150px;
    padding: 12px 8px;
    gap: 8px;
  }

  .count-group {
    min-width: 90px;
  }

  .count-dot {
    width: 21px;
    height: 21px;
  }

  .answer-panel {
    padding: 19px 10px 22px;
    border-radius: 23px;
  }

  .choice-answers {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .answer-choice {
    min-height: 88px;
    padding: 8px;
    border-radius: 20px;
    font-size: 37px;
  }

  .feedback-card {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .feedback-card > div {
    flex: 1;
  }

  .primary-button--compact {
    width: 100%;
    margin: 8px 0 0;
  }

  .result-scene {
    min-height: 620px;
    padding: 14px;
    border-radius: 26px;
  }

  .result-card {
    padding: 31px 14px;
  }

  .result-card h1 {
    font-size: 40px;
  }

  .result-stars {
    font-size: 40px;
  }

  .result-actions {
    flex-direction: column;
  }

  .result-actions button {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .app {
    width: min(1120px, calc(100% - 16px));
  }

  .brand-mark {
    width: 58px;
  }

  .mode-buttons {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    font-size: 38px;
  }

  .hero-art {
    margin: 0 12px 12px;
  }

  .journal-icon {
    width: 58px;
    height: 58px;
  }

  .journal-badge {
    width: 63px;
    height: 63px;
  }

  .equation-number,
  .equation-sign,
  .equation-answer {
    font-size: 39px;
  }

  .equation-number {
    min-width: 44px;
  }

  .equation-answer {
    width: 56px;
    height: 56px;
  }

  .count-dot {
    width: 18px;
    height: 18px;
    border-width: 2px;
  }

  .count-group {
    min-width: 80px;
  }

  .answer-choice {
    min-height: 82px;
    font-size: 34px;
  }

  .result-stats small {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
