:root {
  color-scheme: light;
  --ink: #101640;
  --muted: #617087;
  --paper: #ffffff;
  --line: #dce8f0;
  --sky: #bdeeff;
  --aqua: #08aaa6;
  --aqua-dark: #067d79;
  --lime: #74d51c;
  --coral: #ff4f5f;
  --orange: #ff9f1c;
  --yellow: #ffd33d;
  --blue: #208df3;
  --violet: #7d56dd;
  --pink: #ff6fa8;
  --shadow: 0 18px 42px rgba(35, 70, 102, 0.16);
  --lift: 0 8px 0 rgba(16, 22, 64, 0.1), 0 18px 30px rgba(35, 70, 102, 0.14);
  --radius: 8px;
  --focus: 0 0 0 4px rgba(8, 170, 166, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 16% -10%, rgba(255, 255, 255, 0.92) 0 12rem, transparent 12.1rem),
    linear-gradient(180deg, var(--sky) 0 28rem, #f7fcff 28rem 100%);
  color: var(--ink);
  font-family:
    ui-rounded, "SF Pro Rounded", "Nunito", "Avenir Next Rounded", "Segoe UI", system-ui,
    -apple-system, BlinkMacSystemFont, sans-serif;
}

body,
button {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.academy-topbar,
.academy-shell,
.site-footer {
  width: min(1510px, calc(100vw - 32px));
  margin-inline: auto;
}

.academy-topbar {
  position: sticky;
  top: 16px;
  z-index: 30;
  margin-top: 16px;
  min-height: 94px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(300px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 14px 20px;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand,
.top-nav,
.player-stats,
.stat {
  display: flex;
  align-items: center;
}

.brand {
  gap: 14px;
  width: fit-content;
}

.brand-cubes {
  width: 52px;
  height: 52px;
  display: grid;
  grid-template-columns: repeat(2, 23px);
  gap: 5px;
}

.brand-cubes span {
  border-radius: 7px;
  box-shadow: inset 0 5px 0 rgba(255, 255, 255, 0.26), inset 0 -4px 0 rgba(0, 0, 0, 0.16);
}

.brand-cubes span:nth-child(1) {
  background: var(--coral);
}

.brand-cubes span:nth-child(2) {
  background: var(--aqua);
  transform: translateY(14px);
}

.brand-cubes span:nth-child(3) {
  background: var(--yellow);
}

.brand-cubes span:nth-child(4) {
  background: var(--violet);
  transform: translateY(-14px);
}

.brand strong,
.brand em {
  display: block;
  font-style: normal;
  font-weight: 950;
  line-height: 0.98;
}

.brand strong {
  font-size: clamp(1.2rem, 2vw, 1.9rem);
}

.brand em {
  color: var(--aqua);
  font-size: clamp(1.1rem, 1.7vw, 1.6rem);
}

.top-nav {
  justify-content: center;
  gap: 14px;
}

.top-nav a,
.stat,
.sound-button,
.small-cta {
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--lift);
}

.top-nav a {
  min-width: 128px;
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--ink);
  font-size: 1.03rem;
  font-weight: 950;
}

.top-nav a svg {
  width: 25px;
  height: 25px;
}

.top-nav a.is-active {
  background: linear-gradient(180deg, #18c7c2, var(--aqua));
  color: #fff;
}

.player-stats {
  justify-content: end;
  gap: 12px;
}

.stat {
  min-height: 46px;
  gap: 8px;
  padding: 0 14px;
  color: var(--blue);
  font-weight: 900;
  white-space: nowrap;
}

.stat.flame {
  color: #ff5a1f;
}

.sound-button {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: #f7fbff;
  color: var(--ink);
}

.sound-button.is-muted {
  color: var(--muted);
  opacity: 0.68;
}

.sound-button svg {
  width: 25px;
  height: 25px;
}

.academy-shell {
  display: grid;
  grid-template-columns: minmax(230px, 284px) minmax(520px, 1fr) minmax(260px, 342px);
  gap: 14px;
  align-items: stretch;
  padding-top: 14px;
}

.path-panel,
.play-panel,
.reward-rail > section,
.activity-dock,
.site-footer {
  border: 1px solid rgba(220, 232, 240, 0.88);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.path-panel {
  position: relative;
  overflow: hidden;
  min-height: 760px;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.5)),
    radial-gradient(circle at 50% 24%, #e6ffcf 0 5rem, transparent 5.1rem),
    linear-gradient(180deg, #dff7ff, #c7f5ae 70%, #91df79);
}

.path-panel::before {
  position: absolute;
  inset: 116px 42% 80px 42%;
  content: "";
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.28);
}

.path-panel h2,
.jar-card h2,
.dock-heading h2 {
  margin: 0;
  font-size: 1.16rem;
  font-weight: 950;
}

.path-map {
  position: relative;
  z-index: 1;
  margin-top: 24px;
  display: grid;
  justify-items: center;
  gap: 14px;
}

.path-node {
  position: relative;
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border: 6px solid #fff;
  border-radius: 50%;
  background: #d8e7f0;
  color: #617087;
  font-size: 2rem;
  font-weight: 950;
  box-shadow: var(--lift);
}

.path-node:nth-child(even) {
  transform: translateX(36px);
}

.path-node:nth-child(odd) {
  transform: translateX(-22px);
}

.path-node.complete {
  background: linear-gradient(180deg, #8ee247, var(--lime));
  color: #fff;
}

.path-node.current {
  background: linear-gradient(180deg, #45a5ff, var(--blue));
  color: #fff;
  animation: pulse-node 1600ms ease-in-out infinite;
}

.path-node.locked::after,
.path-node.complete::after {
  position: absolute;
  right: -12px;
  bottom: 6px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #8fdc52;
  color: #fff;
  content: "✓";
  font-size: 0.9rem;
}

.path-node.locked::after {
  background: #98a9b8;
  content: "🔒";
  font-size: 0.78rem;
}

.node-stars {
  position: absolute;
  bottom: -16px;
  display: flex;
  gap: 2px;
  color: var(--yellow);
  font-size: 1rem;
  text-shadow: 0 2px 0 #fff;
}

.small-cta {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 44px;
  margin-top: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--aqua-dark);
  font-weight: 950;
}

.small-cta svg {
  width: 20px;
  height: 20px;
}

.play-panel {
  position: relative;
  min-height: 760px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 24px;
  isolation: isolate;
}

.play-sky {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: linear-gradient(180deg, #d7f7ff 0 46%, #e4facf 46% 100%);
}

.cloud,
.hill {
  position: absolute;
  display: block;
}

.cloud {
  width: 128px;
  height: 44px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
}

.cloud::before,
.cloud::after {
  position: absolute;
  content: "";
  border-radius: 50%;
  background: inherit;
}

.cloud::before {
  width: 58px;
  height: 58px;
  left: 20px;
  bottom: 10px;
}

.cloud::after {
  width: 46px;
  height: 46px;
  right: 22px;
  bottom: 8px;
}

.c1 {
  left: 7%;
  top: 44%;
}

.c2 {
  right: 7%;
  top: 27%;
}

.hill {
  bottom: -84px;
  width: 70%;
  height: 220px;
  border-radius: 50% 50% 0 0;
  background: rgba(8, 170, 166, 0.16);
}

.h1 {
  left: -18%;
  background: rgba(116, 213, 28, 0.18);
}

.h2 {
  right: -16%;
}

.play-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 48px;
}

.mascot-name {
  min-width: 118px;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #19c7c0, var(--aqua));
  color: #fff;
  font-size: 1.05rem;
  font-weight: 950;
  text-align: center;
  box-shadow: var(--lift);
}

.play-toolbar p {
  margin: 0;
  max-width: 310px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  color: #344057;
  font-weight: 850;
  box-shadow: var(--shadow);
}

.task-card {
  justify-self: center;
  width: min(460px, 100%);
  min-height: 142px;
  display: grid;
  place-items: center;
  padding: 18px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  text-align: center;
}

.task-card span {
  color: var(--ink);
  font-size: 1.48rem;
  font-weight: 950;
}

.task-card strong {
  color: var(--aqua);
  font-size: clamp(4.4rem, 9vw, 6.6rem);
  font-weight: 950;
  line-height: 0.9;
  text-shadow: 0 6px 0 rgba(8, 170, 166, 0.1);
}

.playground {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(270px, 0.58fr);
  align-items: center;
  gap: 20px;
}

.number-buddy-wrap {
  position: relative;
  min-height: 410px;
  display: grid;
  place-items: center;
  padding-top: 54px;
}

.floating-number {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 5;
  color: #101640;
  font-size: clamp(2.8rem, 7vw, 4.8rem);
  font-weight: 950;
  line-height: 1;
  transform: translateX(-50%) rotate(-4deg);
  text-shadow: 0 5px 0 rgba(255, 255, 255, 0.9);
}

.number-buddy {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--buddy-cols), var(--buddy-cell));
  grid-template-rows: repeat(var(--buddy-rows), var(--buddy-cell));
  gap: 7px;
  align-content: center;
  justify-content: center;
  padding: 10px;
  animation: mascot-idle 2200ms ease-in-out infinite;
}

.number-buddy::before,
.number-buddy::after {
  position: absolute;
  top: calc(var(--buddy-cell) * 0.44);
  z-index: 4;
  width: calc(var(--buddy-cell) * 0.58);
  height: calc(var(--buddy-cell) * 0.58);
  content: "";
  border: max(4px, calc(var(--buddy-cell) * 0.07)) solid #12234d;
  border-radius: 50%;
  background: #fff;
  pointer-events: none;
}

.number-buddy::before {
  left: calc(50% - var(--buddy-cell) * 0.62);
}

.number-buddy::after {
  right: calc(50% - var(--buddy-cell) * 0.62);
}

.buddy-eye {
  position: absolute;
  top: calc(var(--buddy-cell) * 0.65);
  z-index: 5;
  width: calc(var(--buddy-cell) * 0.2);
  height: calc(var(--buddy-cell) * 0.2);
  border-radius: 50%;
  background: #101640;
  pointer-events: none;
}

.buddy-eye.left {
  left: calc(50% - var(--buddy-cell) * 0.26);
}

.buddy-eye.right {
  right: calc(50% - var(--buddy-cell) * 0.26);
}

.buddy-mouth {
  position: absolute;
  left: 50%;
  top: calc(var(--buddy-cell) * 1.18);
  z-index: 5;
  width: calc(var(--buddy-cell) * 0.86);
  height: calc(var(--buddy-cell) * 0.42);
  border: max(4px, calc(var(--buddy-cell) * 0.07)) solid #12234d;
  border-top: 0;
  border-radius: 0 0 999px 999px;
  background: #ff7392;
  transform: translateX(-50%);
  pointer-events: none;
}

.buddy-arm,
.buddy-foot {
  position: absolute;
  display: block;
  border-radius: 999px;
  background: color-mix(in srgb, var(--buddy-color), #10234d 42%);
  pointer-events: none;
}

.buddy-arm {
  top: calc(50% - var(--buddy-cell) * 0.5);
  width: calc(var(--buddy-cell) * 0.27);
  height: calc(var(--buddy-cell) * 1.15);
}

.buddy-arm.left {
  left: calc(var(--buddy-cell) * -0.35);
  transform: rotate(28deg);
}

.buddy-arm.right {
  right: calc(var(--buddy-cell) * -0.35);
  transform: rotate(-28deg);
}

.buddy-foot {
  bottom: calc(var(--buddy-cell) * -0.36);
  width: calc(var(--buddy-cell) * 0.32);
  height: calc(var(--buddy-cell) * 0.62);
}

.buddy-foot.left {
  left: 32px;
}

.buddy-foot.right {
  right: 32px;
}

.count-workspace {
  align-self: stretch;
  display: grid;
  align-content: end;
  gap: 16px;
}

.count-slots {
  display: none;
}

.slot {
  width: 58px;
  height: 58px;
  border: 3px dashed #28a9db;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.28);
}

.slot.is-filled {
  border-style: solid;
  border-color: var(--aqua);
  background: rgba(8, 170, 166, 0.16);
  animation: pop-in 220ms ease both;
}

.body-cell {
  position: relative;
  width: var(--buddy-cell);
  height: var(--buddy-cell);
  border-radius: 14px;
  background: var(--cell-color);
  color: rgba(0, 0, 0, 0.28);
  box-shadow:
    inset 0 8px 0 rgba(255, 255, 255, 0.26),
    inset 0 -8px 0 rgba(0, 0, 0, 0.14),
    0 10px 0 rgba(16, 22, 64, 0.1),
    0 18px 22px rgba(35, 70, 102, 0.12);
  font-size: 1.3rem;
  font-weight: 950;
  transition:
    transform 160ms ease,
    filter 160ms ease;
}

.body-cell::after {
  position: absolute;
  inset: 24%;
  content: "";
  border: 2px solid rgba(0, 0, 0, 0.16);
  border-radius: 8px;
}

.body-cell.is-counted {
  color: #fff;
  filter: saturate(1.16);
  transform: translateY(-12px) scale(1.05);
}

.body-cell.is-hidden-cell {
  opacity: 0;
  pointer-events: none;
}

.body-cell.part-a {
  background: var(--aqua);
}

.body-cell.part-b {
  background: var(--violet);
}

.challenge-zone {
  min-height: 88px;
  display: grid;
  place-items: center;
}

.answer-row,
.split-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.answer-button,
.split-choice {
  min-width: 82px;
  min-height: 56px;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 950;
  box-shadow: var(--lift);
}

.answer-button.is-right,
.split-choice.is-right {
  background: var(--lime);
  color: #fff;
}

.answer-button.is-wrong,
.split-choice.is-wrong {
  background: var(--coral);
  color: #fff;
  animation: nope 280ms ease both;
}

.mode-controls {
  justify-content: center;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.mode-cta {
  min-width: 168px;
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  font-size: 1.06rem;
  font-weight: 950;
  box-shadow: var(--lift);
}

.mode-cta svg {
  width: 25px;
  height: 25px;
}

.mode-cta.is-active {
  background: linear-gradient(180deg, #19c7c0, var(--aqua));
  color: #fff;
}

.reward-rail {
  display: grid;
  gap: 14px;
}

.feedback-card {
  min-height: 360px;
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
}

.ribbon {
  width: 100%;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #8bdc39, #58bd13);
  color: #fff;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  font-weight: 950;
  box-shadow: var(--lift);
  transform: rotate(-2deg);
}

.mini-mascot {
  position: relative;
  width: 126px;
  height: 126px;
  border-radius: 22px;
  background: linear-gradient(180deg, #19c7c0, var(--aqua));
  box-shadow: inset 0 8px 0 rgba(255, 255, 255, 0.24), inset 0 -9px 0 rgba(0, 0, 0, 0.14), var(--shadow);
}

.mini-mascot::before,
.mini-mascot::after {
  position: absolute;
  top: 34px;
  width: 32px;
  height: 32px;
  content: "";
  border: 4px solid #12234d;
  border-radius: 50%;
  background: #fff;
}

.mini-mascot::before {
  left: 24px;
}

.mini-mascot::after {
  right: 24px;
}

.mini-mascot span {
  position: absolute;
  left: 50%;
  bottom: 28px;
  width: 52px;
  height: 26px;
  border: 5px solid #12234d;
  border-top: 0;
  border-radius: 0 0 999px 999px;
  background: #ff7392;
  transform: translateX(-50%);
}

.xp-pop {
  min-width: 156px;
  padding: 12px 18px;
  border-radius: var(--radius);
  background: #fff;
  color: var(--blue);
  font-size: 1.45rem;
  font-weight: 950;
  box-shadow: var(--lift);
}

.xp-pop.is-gaining {
  animation: xp-bump 520ms ease both;
}

.jar-card {
  padding: 24px;
}

.jar-layout {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 96px;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
}

.star-jar {
  min-height: 150px;
  display: flex;
  flex-wrap: wrap-reverse;
  align-content: end;
  justify-content: center;
  gap: 4px;
  padding: 20px 16px 14px;
  border: 7px solid #57d4df;
  border-top-width: 18px;
  border-radius: 26px 26px 34px 34px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 -12px 0 rgba(49, 187, 199, 0.12), var(--shadow);
}

.jar-star {
  color: var(--yellow);
  font-size: 1.35rem;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.12));
}

.jar-star.new {
  animation: star-drop 680ms ease both;
}

.ring {
  width: 94px;
  height: 94px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 58%, transparent 59%),
    conic-gradient(var(--aqua) calc(var(--progress, 60) * 1%), #edf3f7 0);
  color: var(--ink);
  font-weight: 950;
  text-align: center;
  box-shadow: var(--shadow);
}

.ring span,
.ring small {
  grid-area: 1 / 1;
}

.ring span {
  transform: translateY(-8px);
  font-size: 1.7rem;
}

.ring small {
  transform: translateY(16px);
  color: var(--muted);
  font-size: 0.8rem;
}

.jar-card p {
  margin: 14px 0 0;
  color: var(--ink);
  font-weight: 850;
  text-align: center;
}

.activity-dock {
  grid-column: 2 / 4;
  padding: 20px;
}

.dock-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.dock-heading span {
  color: var(--aqua-dark);
  font-weight: 850;
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.activity-card {
  min-height: 126px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  gap: 6px 12px;
  padding: 16px;
  border: 3px solid transparent;
  border-radius: var(--radius);
  background: #fff6d5;
  color: #9a4b00;
  text-align: left;
  box-shadow: var(--lift);
}

.activity-card.match {
  background: #f3e9ff;
  color: #5b2ec2;
}

.activity-card.make {
  background: #edffde;
  color: #197512;
}

.activity-card.party {
  background: #fff0f6;
  color: #b72062;
}

.activity-card strong {
  align-self: end;
  font-size: 1.22rem;
  font-weight: 950;
}

.activity-card small {
  color: currentColor;
  font-size: 0.9rem;
  font-weight: 850;
  opacity: 0.78;
}

.activity-face {
  grid-row: 1 / 3;
  width: 54px;
  height: 54px;
  align-self: center;
  border-radius: 13px;
  background: var(--orange);
  box-shadow: inset 0 6px 0 rgba(255, 255, 255, 0.24), inset 0 -6px 0 rgba(0, 0, 0, 0.16);
}

.match .activity-face {
  background: var(--violet);
}

.make .activity-face {
  background: var(--lime);
}

.party .activity-face {
  background: var(--pink);
}

.site-footer {
  margin-top: 14px;
  margin-bottom: 24px;
  padding: 16px 20px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 760;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.spark-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  pointer-events: none;
}

.spark {
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 4px;
  background: var(--spark-color);
  animation: spark-fly 780ms ease-out forwards;
}

.tap-pop {
  animation: tap-pop 280ms ease both;
}

.success-wave .number-buddy,
.success-wave .mini-mascot {
  animation: success-dance 620ms ease both;
}

@keyframes tap-pop {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  45% {
    transform: translateY(-6px) scale(1.04);
  }
}

@keyframes mascot-idle {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-8px) rotate(1deg);
  }
}

@keyframes success-dance {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  30% {
    transform: translateY(-18px) rotate(-6deg);
  }
  68% {
    transform: translateY(-6px) rotate(5deg);
  }
}

@keyframes pulse-node {
  0%,
  100% {
    box-shadow: var(--lift), 0 0 0 0 rgba(32, 141, 243, 0.34);
  }
  50% {
    box-shadow: var(--lift), 0 0 0 12px rgba(32, 141, 243, 0);
  }
}

@keyframes pop-in {
  from {
    transform: scale(0.62);
    opacity: 0.3;
  }
}

@keyframes nope {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-7px);
  }
  75% {
    transform: translateX(7px);
  }
}

@keyframes xp-bump {
  0%,
  100% {
    transform: scale(1);
  }
  38% {
    transform: scale(1.18) rotate(-2deg);
  }
}

@keyframes star-drop {
  from {
    opacity: 0;
    transform: translateY(-44px) scale(1.8) rotate(-18deg);
  }
}

@keyframes spark-fly {
  from {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  to {
    opacity: 0;
    transform: translate(var(--spark-x), var(--spark-y)) scale(0.7) rotate(260deg);
  }
}

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

@media (max-width: 1240px) {
  .academy-topbar {
    grid-template-columns: 1fr;
  }

  .top-nav,
  .player-stats {
    justify-content: start;
  }

  .academy-shell {
    grid-template-columns: minmax(220px, 280px) minmax(460px, 1fr);
  }

  .reward-rail {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .activity-dock {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .academy-topbar,
  .academy-shell,
  .site-footer {
    width: min(100vw - 20px, 680px);
  }

  .academy-topbar {
    position: static;
    margin-top: 10px;
  }

  .top-nav,
  .player-stats {
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .academy-shell {
    grid-template-columns: 1fr;
  }

  .path-panel {
    min-height: auto;
  }

  .path-panel::before {
    display: none;
  }

  .path-map {
    grid-template-columns: repeat(3, minmax(62px, 1fr));
    align-items: center;
    overflow-x: visible;
  }

  .path-node,
  .path-node:nth-child(even),
  .path-node:nth-child(odd) {
    width: 68px;
    height: 68px;
    transform: none;
    font-size: 1.55rem;
  }

  .play-panel {
    min-height: 740px;
  }

  .playground {
    grid-template-columns: 1fr;
    align-items: center;
  }

  .number-buddy-wrap {
    width: 100%;
    min-height: 410px;
  }

  .reward-rail {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .academy-topbar,
  .academy-shell,
  .site-footer {
    width: min(100vw - 14px, 430px);
  }

  .academy-topbar {
    padding: 12px;
    gap: 12px;
  }

  .brand-cubes {
    width: 42px;
    height: 42px;
    grid-template-columns: repeat(2, 18px);
    gap: 4px;
  }

  .brand strong {
    font-size: 1.08rem;
  }

  .brand em {
    font-size: 1rem;
  }

  .top-nav a {
    min-width: 106px;
    min-height: 48px;
  }

  .path-panel,
  .play-panel,
  .jar-card,
  .feedback-card,
  .activity-dock {
    padding: 16px;
  }

  .task-card {
    min-height: 116px;
  }

  .task-card span {
    font-size: 1.15rem;
  }

  .play-panel {
    min-height: 700px;
  }

  .slot {
    width: 44px;
    height: 44px;
  }

  .mode-cta {
    width: 100%;
  }

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

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

  .ring {
    justify-self: center;
  }
}
