:root {
  color-scheme: light;
  --bg: #f6fbff;
  --ink: #19314d;
  --muted: #61738a;
  --panel: #ffffff;
  --line: #d8e5f2;
  --blue: #2878d9;
  --blue-dark: #195db0;
  --green: #23a36b;
  --yellow: #ffd45a;
  --orange: #f29d38;
  --pink: #e85d87;
  --shadow: 0 18px 42px rgba(25, 49, 77, 0.14);
  --radius: 8px;
  font-family:
    "Trebuchet MS",
    "Avenir Next",
    system-ui,
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 212, 90, 0.38), transparent 28rem),
    radial-gradient(circle at 85% 20%, rgba(40, 120, 217, 0.14), transparent 22rem),
    linear-gradient(180deg, #eef8ff 0%, #f8fff7 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.hero-panel,
.map-screen,
.play-screen,
.round-card {
  min-height: calc(100vh - 56px);
  border: 1px solid rgba(216, 229, 242, 0.85);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 420px);
  align-items: end;
  gap: 28px;
  padding: clamp(24px, 5vw, 58px);
}

.sky-scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #bfe8ff 0%, #e9f8ff 52%, #dff7d5 52%, #bfe889 100%);
  z-index: 0;
}

.sky-scene > * {
  position: absolute;
  display: block;
}

.sun {
  top: 8%;
  right: 10%;
  width: 112px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 18px rgba(255, 212, 90, 0.24);
  animation: float 5s ease-in-out infinite;
}

.cloud {
  width: 150px;
  height: 54px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    42px -18px 0 8px rgba(255, 255, 255, 0.9),
    86px 0 0 4px rgba(255, 255, 255, 0.9);
}

.cloud-one {
  top: 18%;
  left: 8%;
  animation: drift 18s linear infinite;
}

.cloud-two {
  top: 32%;
  right: 26%;
  transform: scale(0.72);
  animation: drift 23s linear infinite reverse;
}

.hill {
  left: 8%;
  bottom: -88px;
  width: 72%;
  height: 260px;
  border-radius: 50% 50% 0 0;
  background:
    linear-gradient(135deg, transparent 44%, rgba(255, 255, 255, 0.55) 45% 49%, transparent 50%) 62% 16% /
      88px 88px no-repeat,
    linear-gradient(135deg, #8b5f3c 0 50%, #6f4a30 50% 100%);
  clip-path: polygon(0 36%, 88% 8%, 100% 100%, 5% 100%);
}

.hero-copy,
.start-card {
  position: relative;
  z-index: 1;
}

.hero-copy {
  align-self: center;
  max-width: 590px;
  color: #102d4d;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.44);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue-dark);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(3rem, 8vw, 6.8rem);
  line-height: 0.95;
}

.hero-copy p:last-child {
  max-width: 45rem;
  margin-bottom: 0;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.5;
  font-weight: 700;
}

.start-card,
.challenge-card,
.mascot-card,
.path-panel,
.round-card,
.stats-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
}

.start-card {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.profile-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-chip {
  min-height: 38px;
  border: 2px solid #bed2e7;
  border-radius: 999px;
  padding: 0 12px;
  background: #f8fbff;
  color: var(--ink);
  font-weight: 900;
}

label,
legend,
.stats-grid span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

input[type="text"],
#number-answer {
  width: 100%;
  min-height: 54px;
  border: 2px solid #bed2e7;
  border-radius: var(--radius);
  padding: 0 14px;
  color: var(--ink);
  background: #fbfdff;
  font-size: 1.12rem;
  font-weight: 800;
  outline: none;
}

input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(40, 120, 217, 0.15);
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.mode-grid,
.practice-grid {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.mode-grid {
  grid-template-columns: repeat(3, 1fr);
}

.practice-grid {
  grid-template-columns: repeat(3, 1fr);
}

.mode-grid label,
.practice-grid label {
  display: grid;
  min-height: 50px;
}

.mode-grid input,
.practice-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-grid span,
.practice-grid span {
  display: grid;
  place-items: center;
  border: 2px solid #bed2e7;
  border-radius: var(--radius);
  background: #f8fbff;
  color: var(--ink);
  text-align: center;
}

.mode-grid input:checked + span,
.practice-grid input:checked + span {
  border-color: var(--blue);
  background: #e7f2ff;
}

.access-row {
  display: grid;
  gap: 8px;
}

.access-row label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.access-row input {
  width: 20px;
  height: 20px;
}

.primary-button,
.secondary-button,
.quiet-button,
.icon-button,
.answer-button {
  min-height: 52px;
  border: 0;
  border-radius: var(--radius);
  font-weight: 900;
}

.primary-button {
  padding: 0 22px;
  color: #fff;
  background: linear-gradient(180deg, var(--blue), var(--blue-dark));
  box-shadow: 0 8px 0 #134a8a;
}

.primary-button:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 #134a8a;
}

.secondary-button {
  padding: 0 18px;
  color: #fff;
  background: var(--green);
}

.quiet-button {
  padding: 0 18px;
  color: var(--blue-dark);
  background: #e7f2ff;
}

.icon-button {
  width: 52px;
  color: #fff;
  background: var(--pink);
}

.play-screen {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: clamp(16px, 3vw, 28px);
}

.map-screen {
  display: grid;
  gap: 18px;
  align-content: start;
  padding: clamp(18px, 3vw, 34px);
}

.top-bar,
.adventure-row,
.round-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.world-pill {
  max-width: min(100%, 260px);
  border: 2px solid #bed2e7;
  border-radius: 999px;
  padding: 10px 14px;
  background: #fff7d8;
  color: #744b00;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-bar h2 {
  margin: 0;
  font-size: clamp(1.55rem, 4vw, 2.3rem);
}

.stats-grid,
.learning-dashboard {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.stats-grid article,
.learning-dashboard article {
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 12px;
}

.stats-grid strong,
.learning-dashboard strong {
  font-size: clamp(1.35rem, 4vw, 2rem);
}

.learning-dashboard article,
.subject-card,
.chapter-panel,
.parent-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
}

.learning-dashboard span,
.subject-card span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.subject-card {
  position: relative;
  display: grid;
  min-height: 230px;
  gap: 12px;
  align-content: space-between;
  padding: 16px;
  overflow: hidden;
  text-align: left;
}

.subject-card.selected {
  outline: 3px solid var(--subject-ink);
  outline-offset: -3px;
}

.subject-card::before {
  content: "";
  position: absolute;
  inset: auto -10% -24% 24%;
  height: 130px;
  border-radius: 50% 50% 0 0;
  background: var(--subject-soft);
  transform: rotate(-7deg);
}

.subject-card > * {
  position: relative;
  z-index: 1;
}

.subject-icon {
  display: grid;
  place-items: center;
  width: 72px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--subject-soft);
  color: var(--subject-ink);
  font-size: 2.1rem;
  font-weight: 900;
}

.subject-card h3 {
  margin-bottom: 6px;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.subject-progress {
  display: grid;
  gap: 7px;
}

.subject-progress-bar {
  height: 12px;
  border-radius: 999px;
  background: #e8f0f8;
  overflow: hidden;
}

.subject-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--subject-ink);
}

.subject-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.subject-button,
.subject-link-button {
  min-height: 48px;
  border: 0;
  border-radius: var(--radius);
  font-weight: 900;
}

.subject-button {
  background: var(--subject-ink);
  color: #fff;
}

.subject-link-button {
  border: 2px solid var(--subject-ink);
  background: #fff;
  color: var(--subject-ink);
}

.chapter-panel,
.parent-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.chapter-path {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.chapter-node {
  display: grid;
  gap: 6px;
  min-height: 94px;
  align-content: center;
  border: 2px solid #bed2e7;
  border-radius: var(--radius);
  padding: 10px;
  background: #f8fbff;
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}

.chapter-node.active {
  border-color: var(--blue);
  background: #e7f2ff;
  color: var(--blue-dark);
}

.chapter-node.done {
  border-color: #ffc02e;
  background: #fff7d8;
  color: #744b00;
}

.chapter-node.locked {
  border-style: dashed;
  opacity: 0.72;
  cursor: not-allowed;
}

.parent-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.parent-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fbfdff;
}

.parent-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1.1rem;
}

.parent-card span {
  color: var(--muted);
  font-weight: 800;
}

.adventure-row {
  align-items: stretch;
}

.mascot-card {
  flex: 1 1 360px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 126px;
  padding: 16px;
}

.mascot-card h3 {
  margin-bottom: 4px;
}

.mascot-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.mascot {
  position: relative;
  flex: 0 0 82px;
  width: 82px;
  aspect-ratio: 1;
  border: 3px solid rgba(255, 255, 255, 0.78);
  border-radius: 48% 48% 42% 42%;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.95) 0 7%, transparent 8%),
    radial-gradient(circle at 25% 58%, rgba(255, 139, 176, 0.45) 0 9%, transparent 10%),
    radial-gradient(circle at 75% 58%, rgba(255, 139, 176, 0.45) 0 9%, transparent 10%),
    linear-gradient(180deg, #69c7f0, #2878d9);
  box-shadow:
    inset 0 -9px 0 rgba(0, 0, 0, 0.08),
    0 10px 22px rgba(25, 49, 77, 0.16);
  animation: bob 2.4s ease-in-out infinite;
}

.mascot::before,
.mascot::after {
  content: "";
  position: absolute;
  top: 30%;
  width: 13px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 32%, #ffffff 0 20%, transparent 22%),
    #14345a;
}

.mascot::before {
  left: 25%;
}

.mascot::after {
  right: 25%;
}

.antenna {
  position: absolute;
  top: -14px;
  left: 50%;
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: #2878d9;
  transform: translateX(-50%);
}

.antenna::after {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  width: 14px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--yellow);
  transform: translateX(-50%);
}

.face {
  position: absolute;
  left: 50%;
  bottom: 23%;
  width: 18px;
  height: 8px;
  border-bottom: 4px solid #123052;
  border-radius: 0 0 40px 40px;
  transform: translateX(-50%);
  transition:
    width 0.25s ease,
    height 0.25s ease,
    bottom 0.25s ease,
    border-radius 0.25s ease;
}

.mascot.smile-1 .face {
  width: 24px;
  height: 11px;
}

.mascot.smile-2 .face {
  width: 31px;
  height: 15px;
  border-bottom-width: 5px;
}

.mascot.smile-3 .face {
  width: 38px;
  height: 19px;
  border-bottom-width: 5px;
}

.mascot.smile-4 .face {
  bottom: 22%;
  width: 46px;
  height: 25px;
  border-bottom-width: 6px;
}

.mascot.happy {
  animation: cheer 0.62s ease both;
}

.mascot.happy::after {
  animation: wink 0.62s ease both;
}

.mascot.proud {
  box-shadow:
    inset 0 -8px 0 rgba(0, 0, 0, 0.08),
    0 0 0 8px rgba(255, 212, 90, 0.34);
  animation: cheer 0.78s ease both;
}

.mascot.thinking {
  animation: wobble 0.56s ease both;
}

.mascot.tired {
  animation: wobble 0.72s ease both;
}

.mascot.tired::before,
.mascot.tired::after {
  height: 4px;
  aspect-ratio: auto;
  border-radius: 999px;
}

.mascot.surprised .face {
  width: 18px;
  height: 18px;
  border: 4px solid #14345a;
  border-radius: 50%;
}

.mascot.thinking .face {
  bottom: 22%;
  width: 24px;
  height: 10px;
  border-top: 4px solid #14345a;
  border-bottom: 0;
  border-radius: 40px 40px 0 0;
}

.path-panel {
  flex: 1 1 300px;
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 16px;
}

.world-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.world-tile {
  min-height: 42px;
  border: 2px solid #bed2e7;
  border-radius: var(--radius);
  padding: 8px;
  background: #f8fbff;
  color: #61738a;
  font-size: 0.86rem;
  font-weight: 900;
  text-align: center;
}

.world-tile.active {
  border-color: var(--green);
  background: #ddf7ea;
  color: #146345;
}

.world-tile.locked {
  opacity: 0.56;
}

.path {
  display: grid;
  grid-template-columns: repeat(8, minmax(24px, 1fr));
  gap: 8px;
}

.step {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 2px solid #bed2e7;
  border-radius: 50%;
  background: #f8fbff;
  color: #7c8fa4;
  font-weight: 900;
}

.step.done {
  border-color: #ffc02e;
  background: var(--yellow);
  color: #744b00;
}

.step.correct {
  border-color: #23a36b;
  background: #ddf7ea;
  color: #146345;
}

.step.wrong {
  border-color: #e85d87;
  background: #ffe7ef;
  color: #8a2545;
}

.challenge-card {
  display: grid;
  gap: 16px;
  padding: clamp(18px, 4vw, 30px);
}

.visual-stage {
  display: grid;
  min-height: 0;
  place-items: center;
}

.visual-stage:not(:empty) {
  min-height: clamp(96px, 17vw, 170px);
  border: 2px dashed #bed2e7;
  border-radius: var(--radius);
  padding: 12px;
  background: #fbfdff;
}

.interaction-stage {
  display: grid;
  gap: 10px;
  border: 2px solid #bed2e7;
  border-radius: var(--radius);
  padding: 12px;
  background: #fbfdff;
}

.interaction-stage p {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 900;
}

.tile-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.mini-tile {
  min-height: 52px;
  border: 2px solid #bed2e7;
  border-radius: var(--radius);
  padding: 8px 12px;
  background: #fffaf0;
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 900;
}

.visual-flag {
  display: grid;
  place-items: center;
  min-width: 140px;
  min-height: 92px;
  border: 2px solid #bed2e7;
  border-radius: var(--radius);
  background: #fff;
  font-size: clamp(3.5rem, 9vw, 6rem);
  box-shadow: 0 12px 28px rgba(25, 49, 77, 0.12);
}

.visual-shapes,
.visual-letters,
.visual-map,
.visual-logic {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: center;
}

.shape-token,
.letter-token {
  display: grid;
  place-items: center;
  width: clamp(46px, 8vw, 72px);
  aspect-ratio: 1;
  border-radius: var(--radius);
  background: #fff7d8;
  color: #744b00;
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 900;
}

.shape-token.circle {
  border-radius: 50%;
  background: #ddf7ea;
  color: #146345;
}

.shape-token.triangle {
  clip-path: polygon(50% 5%, 96% 92%, 4% 92%);
  border-radius: 0;
  background: #ffe7ef;
  color: #8a2545;
}

.country-shape {
  width: clamp(120px, 18vw, 220px);
  height: clamp(94px, 14vw, 170px);
}

.country-shape path {
  fill: #ddf7ea;
  stroke: #146345;
  stroke-width: 4;
  stroke-linejoin: round;
}

#question-title {
  min-height: 2.2em;
  margin: 0;
  font-size: clamp(2rem, 6vw, 4.2rem);
  line-height: 1.1;
  text-align: center;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.answer-button {
  min-height: clamp(68px, 14vw, 96px);
  border: 3px solid #bed2e7;
  background: #fffaf0;
  color: var(--ink);
  font-size: clamp(1.35rem, 5vw, 2.25rem);
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}

.answer-button:hover,
.answer-button:focus-visible {
  border-color: var(--orange);
  transform: translateY(-2px);
}

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

.answer-button.wrong {
  border-color: var(--pink);
  background: #ffe7ef;
}

.answer-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.number-form {
  display: grid;
  gap: 8px;
}

.number-form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.helper-panel {
  display: grid;
  gap: 10px;
  border: 2px solid #bed2e7;
  border-radius: var(--radius);
  padding: 14px;
  background: #fbfdff;
}

.helper-title {
  margin: 0;
  color: var(--blue-dark);
  font-weight: 900;
}

.hint-ladder {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 24px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.hint-visual {
  display: grid;
  place-items: center;
}

.helper-dots,
.helper-groups,
.helper-sequence,
.helper-compare {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.helper-dot,
.helper-block {
  display: grid;
  place-items: center;
  width: 28px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--yellow);
  color: #744b00;
  font-size: 0.8rem;
  font-weight: 900;
}

.helper-block {
  border-radius: 6px;
  background: #dff8ec;
  color: #146345;
}

.helper-sign {
  color: var(--pink);
  font-size: 1.35rem;
  font-weight: 900;
}

.number-line {
  display: grid;
  grid-template-columns: repeat(var(--line-count), minmax(20px, 1fr));
  gap: 4px;
}

.number-line span {
  border-top: 3px solid #bed2e7;
  padding-top: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  text-align: center;
}

.number-line .active {
  border-color: var(--orange);
  color: #744b00;
}

.feedback {
  min-height: 58px;
  border-radius: var(--radius);
  padding: 14px 16px;
  background: #f3f8ff;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.4;
}

.feedback.good {
  background: #ddf7ea;
  color: #146345;
}

.feedback.help {
  background: #fff1d2;
  color: #7a5200;
}

.cooldown {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #ffe7ef;
  color: #8a2545;
  font-weight: 900;
  text-align: center;
}

.round-screen {
  display: grid;
  min-height: calc(100vh - 56px);
  place-items: center;
}

.round-card {
  display: grid;
  width: min(560px, 100%);
  min-height: auto;
  gap: 12px;
  padding: clamp(22px, 5vw, 36px);
  text-align: center;
}

.round-card h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 6vw, 3.8rem);
}

.round-card p {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.45;
}

.big-stars {
  min-height: 54px;
  color: #ffbd24;
  font-size: clamp(2.4rem, 8vw, 4.5rem);
  letter-spacing: 0;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
}

.badge {
  border: 2px solid #ffd45a;
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff7d8;
  color: #744b00;
  font-weight: 900;
}

.round-insight {
  display: flex;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: #f3f8ff;
  color: var(--muted);
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}

.celebration-layer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.spark {
  position: absolute;
  width: 12px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--yellow);
  animation: pop 0.9s ease-out forwards;
}

@keyframes float {
  50% {
    transform: translateY(12px);
  }
}

@keyframes drift {
  50% {
    transform: translateX(32px);
  }
}

@keyframes bob {
  50% {
    transform: translateY(-8px);
  }
}

@keyframes cheer {
  35% {
    transform: translateY(-16px) scale(1.08);
  }
  70% {
    transform: translateY(2px) scale(0.98);
  }
}

@keyframes wobble {
  25% {
    transform: rotate(-5deg);
  }
  65% {
    transform: rotate(5deg);
  }
}

@keyframes pop {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(0.4);
  }
  100% {
    opacity: 0;
    transform: translate(var(--x), var(--y)) scale(1.1);
  }
}

@keyframes wink {
  45% {
    height: 4px;
    aspect-ratio: auto;
    border-radius: 999px;
  }
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 20px, 720px);
    padding: 10px 0;
  }

  .hero-panel {
    grid-template-columns: 1fr;
    align-items: center;
    min-height: calc(100vh - 20px);
  }

  .start-card {
    align-self: end;
  }

  .stats-grid,
  .learning-dashboard,
  .subject-grid,
  .chapter-path,
  .parent-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .adventure-row {
    flex-direction: column;
  }

  .mascot-card,
  .path-panel {
    flex: none;
  }

  .answer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .hero-panel,
  .play-screen,
  .round-card {
    border-radius: 0;
  }

  .top-bar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .practice-grid,
  .world-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .number-form > div {
    grid-template-columns: 1fr;
  }

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

  .subject-grid,
  .learning-dashboard,
  .chapter-path,
  .parent-grid {
    grid-template-columns: 1fr;
  }

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

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