:root {
  color-scheme: light;
  --ink: #17243f;
  --muted: #667085;
  --cream: #f8f3e8;
  --blue: #4263eb;
  --blue-dark: #2947bd;
  --yellow: #ffc857;
  --coral: #ff7b72;
  --mint: #42c2a8;
  --structure: #3f4a63;
  --structure-soft: #f2f4f8;
  --structure-border: #7b8699;
  --role-a: #4263eb;
  --role-a-soft: #e9edff;
  --role-a-border: #5b74e8;
  --role-b: #f5a623;
  --role-b-soft: #fff0d0;
  --role-b-border: #b77b12;
  --role-b-text: #a35f00;
  /* Roles, not operations: blue/orange operands, slate structure, green/red feedback. */
  --shadow: 0 18px 50px rgba(44, 55, 90, 0.12);
  font-family: ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--cream);
}
button,
input {
  font: inherit;
}
button {
  color: inherit;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 4px solid var(--blue-dark);
  outline-offset: 3px;
}
.hidden {
  display: none !important;
}
.app-shell {
  width: min(1120px, 100%);
  min-height: 100vh;
  margin: auto;
  padding: max(clamp(22px, 5vw, 62px), env(safe-area-inset-top, 0px))
    max(clamp(22px, 5vw, 62px), env(safe-area-inset-right, 0px))
    max(clamp(22px, 5vw, 62px), env(safe-area-inset-bottom, 0px))
    max(clamp(22px, 5vw, 62px), env(safe-area-inset-left, 0px));
}
.screen {
  min-height: calc(100vh - clamp(44px, 10vw, 124px));
}
.brand {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 44px;
}
.brand-mark {
  width: 76px;
  height: 76px;
  padding: 13px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  border-radius: 24px;
  background: var(--blue);
  box-shadow: var(--shadow);
}
.brand-mark span {
  border-radius: 50%;
  background: #fff;
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--blue-dark);
  font-size: 0.84rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
h1,
h2 {
  margin: 0;
  line-height: 1.04;
  letter-spacing: -0.035em;
}
h1 {
  font-size: clamp(2.1rem, 5vw, 4rem);
}
.setup-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
}
.choice-panel {
  min-width: 0;
  margin: 0;
  padding: 25px;
  border: 0;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}
.choice-panel legend {
  float: left;
  width: 100%;
  margin-bottom: 18px;
  font-size: 1.15rem;
  font-weight: 800;
}
.operation-options {
  clear: both;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.choice {
  border: 2px solid transparent;
  background: #fff;
  cursor: pointer;
  transition:
    transform 0.15s,
    border-color 0.15s,
    background 0.15s;
}
.choice:hover {
  transform: translateY(-2px);
}
.choice.active {
  border-color: var(--blue);
  background: #eef1ff;
  box-shadow: 0 8px 20px rgba(66, 99, 235, 0.13);
}
.operation {
  min-height: 120px;
  padding: 18px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}
/* Operation identity is the symbol and label; every tile uses the same ink treatment. */
.operation strong {
  display: grid;
  place-items: center;
  flex: 0 0 58px;
  height: 58px;
  border-radius: 18px;
  color: #fff;
  background: var(--ink);
  font-size: 2.25rem;
}
.operation span {
  font-size: 1.05rem;
  font-weight: 800;
}
.table-options {
  clear: both;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 11px;
}
.table-choice {
  aspect-ratio: 1;
  border-radius: 17px;
  font-size: 1.25rem;
  font-weight: 850;
}
.setup-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 30px;
}
.sound-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  cursor: pointer;
}
.sound-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.switch-track {
  width: 56px;
  height: 32px;
  padding: 4px;
  border-radius: 20px;
  background: #b7bdc9;
  transition: background 0.2s;
}
.switch-track span {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.sound-switch input:checked + .switch-track {
  background: var(--blue);
}
.sound-switch input:checked + .switch-track span {
  transform: translateX(24px);
}
.primary-button,
.secondary-button,
.continue-button {
  min-height: 58px;
  padding: 0 26px;
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  font-weight: 850;
}
.primary-button {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 10px 24px rgba(66, 99, 235, 0.24);
}
.primary-button:hover {
  background: var(--blue-dark);
}
.secondary-button {
  background: #fff;
  border: 2px solid #dfe3ec;
}
.privacy-note {
  margin: 22px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.88rem;
}
.practice-screen {
  width: min(900px, 100%);
  margin: auto;
}
.practice-header {
  display: grid;
  grid-template-columns: 54px 1fr 54px;
  align-items: center;
  gap: 22px;
}
.icon-button {
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 7px 20px rgba(44, 55, 90, 0.1);
  cursor: pointer;
  font-size: 1.4rem;
  font-weight: 900;
}
.progress-dots {
  display: flex;
  justify-content: center;
  gap: 9px;
}
.progress-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #d5d9e2;
}
.progress-dots .current {
  transform: scale(1.35);
  background: var(--blue);
}
.progress-dots .correct {
  background: var(--mint);
}
.progress-dots .incorrect {
  background: var(--coral);
}
.practice-content {
  padding: 34px 0 20px;
  text-align: center;
}
.equation {
  margin-top: 4px;
  font-size: clamp(3.2rem, 10vw, 6.7rem);
}
.visual-model {
  min-height: 230px;
  margin: 22px auto 10px;
  padding: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.68);
}
.dot-group {
  display: grid;
  grid-template-columns: repeat(var(--columns), 24px);
  gap: 10px;
  padding: 18px;
  border-radius: 20px;
}
.number-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--structure);
  box-shadow: inset 0 -4px rgba(0, 0, 0, 0.09);
}
.counter-group.group-a .number-dot {
  background: var(--role-a);
}
.counter-group.group-b .number-dot {
  background: var(--role-b);
}
.group-a {
  background: var(--role-a-soft);
}
.group-b {
  background: var(--role-b-soft);
}
.visual-operator {
  font-size: 2.3rem;
  font-weight: 900;
}
.subtraction-model .number-dot {
  width: 28px;
  height: 28px;
}
.dot-array {
  display: grid;
  grid-template-columns: repeat(var(--columns), 25px);
  gap: 11px;
  padding: 22px;
  border-radius: 22px;
  background: var(--structure-soft);
}
.division-model {
  flex-wrap: wrap;
  gap: 12px;
}
.division-group {
  background: var(--structure-soft);
  border: 2px solid var(--structure-border);
}
.visual-hint {
  margin: 0 0 20px;
  color: var(--muted);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.visual-hint .hint-dot {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}
.visual-hint .hint-dot-b {
  background: #f5a623;
}
.answer-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.answer-button {
  min-height: 94px;
  border: 3px solid transparent;
  border-radius: 23px;
  background: #fff;
  box-shadow: 0 9px 24px rgba(44, 55, 90, 0.1);
  cursor: pointer;
  font-size: 2rem;
  font-weight: 900;
}
.answer-button:hover:not(:disabled) {
  border-color: var(--blue);
  transform: translateY(-2px);
}
.answer-button.is-correct {
  color: #126c5b;
  border-color: var(--mint);
  background: #e7faf6;
}
.answer-button.is-incorrect {
  color: #a23535;
  border-color: var(--coral);
  background: #fff0ef;
}
.feedback {
  min-height: 76px;
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.feedback-message {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}
.feedback-message.good {
  color: #14725f;
}
.feedback-message.try-again {
  color: #8e3b39;
}
.continue-button {
  min-height: 50px;
  color: #fff;
  background: var(--ink);
}
.results-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.celebration {
  margin-bottom: 24px;
  color: var(--yellow);
  font-size: 2rem;
  letter-spacing: 0.3em;
}
.results-screen h2 {
  font-size: clamp(2.4rem, 6vw, 4.6rem);
}
.score-ring {
  width: 190px;
  height: 190px;
  margin: 34px;
  display: grid;
  place-content: center;
  border-radius: 50%;
  background: #fff;
  border: 15px solid var(--mint);
  box-shadow: var(--shadow);
}
.score-ring strong {
  font-size: 2.8rem;
}
.score-ring span {
  color: var(--muted);
  font-weight: 700;
}
.result-message {
  max-width: 560px;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.55;
}
.result-actions {
  display: flex;
  gap: 14px;
}
@media (max-width: 720px) {
  .app-shell {
    padding: max(22px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
      max(22px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  }
  .brand {
    margin-bottom: 28px;
  }
  .brand-mark {
    width: 58px;
    height: 58px;
    border-radius: 18px;
  }
  .setup-grid {
    grid-template-columns: 1fr;
  }
  .choice-panel {
    padding: 18px;
  }
  .operation {
    min-height: 86px;
    padding: 12px;
  }
  .operation strong {
    flex-basis: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 1.7rem;
  }
  .operation span {
    font-size: 0.88rem;
  }
  .setup-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }
  .primary-button {
    width: 100%;
  }
  .practice-header {
    grid-template-columns: 48px 1fr 48px;
    gap: 10px;
  }
  .icon-button {
    width: 48px;
    height: 48px;
  }
  .progress-dots {
    gap: 5px;
  }
  .progress-dots span {
    width: 8px;
    height: 8px;
  }
  .practice-content {
    padding-top: 25px;
  }
  .visual-model {
    min-height: 190px;
    padding: 15px 9px;
    gap: 10px;
  }
  .dot-group {
    grid-template-columns: repeat(var(--columns), 17px);
    gap: 7px;
    padding: 10px;
  }
  .number-dot {
    width: 17px;
    height: 17px;
  }
  .dot-array {
    grid-template-columns: repeat(var(--columns), 18px);
    gap: 7px;
    padding: 15px;
  }
  .subtraction-model .number-dot {
    width: 22px;
    height: 22px;
  }
  .answer-options {
    grid-template-columns: repeat(2, 1fr);
  }
  .answer-button {
    min-height: 70px;
  }
  .feedback {
    flex-direction: column;
  }
  .result-actions {
    width: 100%;
    flex-direction: column;
  }
}
/* Narrow phones: keep the symbol and label stacked so neither grid column
   needs more than half of the remaining width. */
@media (max-width: 360px) {
  .operation {
    min-height: 84px;
    padding: 10px;
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
  .operation strong {
    flex-basis: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 1.5rem;
  }
  .operation span {
    font-size: 0.82rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
.practice-screen {
  position: relative;
}
.practice-screen:after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    circle at 50% 42%,
    rgba(255, 200, 87, 0.38),
    rgba(66, 194, 168, 0.2) 32%,
    transparent 66%
  );
}
.practice-screen.correct-flash:after {
  animation: success-flash 0.8s ease-out;
}
.equation-correct {
  color: #137a63;
  animation: answer-pop 0.65s cubic-bezier(0.2, 0.85, 0.25, 1.25);
  text-shadow: 0 12px 30px rgba(66, 194, 168, 0.2);
}
.equation-number.equation-a {
  color: var(--role-a);
}
.equation-number.equation-b {
  color: var(--role-b-text);
}
.equation-number.equation-result {
  color: var(--ink);
}
.equation-correct .equation-number {
  color: inherit;
}
.revealed-answer {
  color: #137a63 !important;
  animation: answer-pop 0.65s cubic-bezier(0.2, 0.85, 0.25, 1.25);
}
.number-bonds-view {
  display: grid;
  justify-items: center;
  gap: 24px;
}
.number-bond-cards {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}
.number-bond-card {
  min-width: 260px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 18px;
  padding: 20px;
  border: 3px solid #d9dff5;
  border-radius: 24px;
  background: #fff;
}
.number-bond-equation {
  color: var(--blue-dark);
  font-size: 1.6rem;
}
.number-bond-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.number-bond-button {
  padding: 12px 20px;
  border: 3px solid #d9dff5;
  border-radius: 16px;
  background: #fff;
  color: var(--blue-dark);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}
.number-bond-button:hover {
  border-color: var(--blue);
}
.number-bond-button:focus-visible {
  border-color: var(--blue);
  outline: 4px solid var(--blue-dark);
  outline-offset: 3px;
}
.number-bond-button:active {
  transform: translateY(2px);
}
@media (max-width: 720px) {
  .number-bond-cards {
    gap: 12px;
  }
  .number-bond-card {
    min-width: 210px;
    padding: 14px;
    gap: 10px;
  }
  .number-bond-equation {
    font-size: 1.25rem;
  }
  .number-bond-visual {
    gap: 8px;
  }
}
.skip-counting-ways {
  width: 100%;
  max-width: 1120px;
}
.skip-number-line {
  width: 100%;
  max-width: 100%;
  justify-content: flex-start;
  overflow-x: auto;
  padding: 24px 10px 14px;
  scrollbar-color: #9cacec transparent;
}
.skip-number-line .number-stop {
  width: 54px;
  height: 54px;
  min-width: 54px;
  font-size: 1.05rem;
}
.skip-number-line .number-jump {
  width: 78px;
  min-width: 78px;
  height: 54px;
}
.skip-number-line .number-jump:before {
  left: 4px;
  right: 59px;
  top: 25px;
}
.skip-number-line .number-jump:after {
  right: 51px;
  top: 17px;
}
.skip-number-line .number-jump small {
  top: -12px;
  left: 20%;
  font-size: 0.82rem;
}
@media (max-width: 720px) {
  .skip-counting-ways {
    gap: 20px;
  }
  .skip-number-line {
    padding-inline: 4px;
  }
  .skip-number-line .number-stop {
    width: 42px;
    height: 42px;
    min-width: 42px;
    font-size: 0.85rem;
  }
  .skip-number-line .number-jump {
    width: 58px;
    min-width: 58px;
    height: 42px;
  }
  .skip-number-line .number-jump:before {
    left: 2px;
    right: 47px;
    top: 19px;
    border-top-width: 4px;
  }
  .skip-number-line .number-jump:after {
    right: 39px;
    top: 11px;
  }
  .skip-number-line .number-jump small {
    top: -14px;
    left: 17%;
    font-size: 0.72rem;
  }
}
.number-jump:before,
.number-jump:after {
  display: none !important;
}
.number-jump {
  height: 105px;
  align-items: flex-end;
}
.jump-curve {
  position: absolute;
  left: 2px;
  bottom: 31px;
  width: calc(100% - 58px);
  height: 62px;
  overflow: visible;
}
.jump-curve-line {
  fill: none;
  stroke: #e3b757;
  stroke-width: 7;
  stroke-linecap: round;
}
.jump-curve-head {
  fill: #e3b757;
}
.number-jump small {
  top: 2px;
  left: calc((100% - 58px) / 2);
  z-index: 2;
}
.number-stop {
  box-sizing: border-box;
  width: auto;
  min-width: 64px;
  padding: 0 10px;
  border-radius: 999px;
}
.skip-number-line {
  padding-top: 52px;
}
.skip-number-line .number-stop {
  width: auto;
  min-width: 54px;
  padding: 0 8px;
}
.skip-number-line .number-jump {
  width: 96px;
  min-width: 96px;
  height: 92px;
}
.skip-number-line .jump-curve {
  bottom: 26px;
  width: calc(100% - 50px);
  height: 55px;
}
.skip-number-line .number-jump small {
  top: 0;
  left: calc((100% - 50px) / 2);
}
@media (max-width: 720px) {
  .number-jump {
    height: 84px;
  }
  .jump-curve {
    bottom: 23px;
    width: calc(100% - 43px);
    height: 50px;
  }
  .number-jump small {
    top: 0;
    left: calc((100% - 43px) / 2);
  }
  .number-stop {
    min-width: 48px;
    padding: 0 7px;
  }
  .skip-number-line {
    padding-top: 46px;
  }
  .skip-number-line .number-stop {
    min-width: 44px;
    padding: 0 6px;
  }
  .skip-number-line .number-jump {
    width: 72px;
    min-width: 72px;
    height: 76px;
  }
  .skip-number-line .jump-curve {
    bottom: 20px;
    width: calc(100% - 40px);
    height: 44px;
  }
  .skip-number-line .number-jump small {
    top: -2px;
    left: calc((100% - 40px) / 2);
  }
}
.addition-number-line {
  align-items: flex-end;
  padding-top: 82px;
}
.number-stop {
  height: 38px;
  min-width: 48px;
  padding: 9px 8px 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  position: relative;
  z-index: 2;
}
.number-stop:before {
  content: '';
  position: absolute;
  top: -7px;
  left: 50%;
  height: 9px;
  border-left: 4px solid #9cacec;
  transform: translateX(-50%);
}
.number-jump {
  width: 112px;
  min-width: 112px;
  height: 38px;
  margin-left: -24px;
  border-top: 4px solid #9cacec;
  align-items: flex-end;
}
.jump-curve {
  left: 0;
  bottom: 38px;
  width: calc(100% - 24px);
  height: 66px;
}
.jump-curve-line {
  stroke: #e3b757;
  stroke-width: 6;
}
.number-jump small {
  top: -72px;
  left: calc((100% - 24px) / 2);
  transform: translateX(-50%);
}
.skip-number-line {
  padding-top: 78px;
}
.skip-number-line .number-stop {
  height: 34px;
  min-width: 46px;
  padding: 8px 6px 0;
}
.skip-number-line .number-jump {
  width: 92px;
  min-width: 92px;
  height: 34px;
  margin-left: -23px;
  border-top: 4px solid #9cacec;
}
.skip-number-line .jump-curve {
  bottom: 34px;
  width: calc(100% - 23px);
  height: 58px;
}
.skip-number-line .number-jump small {
  top: -64px;
  left: calc((100% - 23px) / 2);
}
@media (max-width: 720px) {
  .addition-number-line {
    padding-top: 68px;
  }
  .number-stop {
    height: 32px;
    min-width: 40px;
    padding: 7px 5px 0;
  }
  .number-jump {
    width: 82px;
    min-width: 82px;
    height: 32px;
    margin-left: -20px;
  }
  .jump-curve {
    bottom: 32px;
    width: calc(100% - 20px);
    height: 54px;
  }
  .number-jump small {
    top: -59px;
    left: calc((100% - 20px) / 2);
  }
  .skip-number-line {
    padding-top: 64px;
  }
  .skip-number-line .number-stop {
    height: 30px;
    min-width: 38px;
    padding: 6px 4px 0;
  }
  .skip-number-line .number-jump {
    width: 72px;
    min-width: 72px;
    height: 30px;
    margin-left: -19px;
  }
  .skip-number-line .jump-curve {
    bottom: 30px;
    width: calc(100% - 19px);
    height: 50px;
  }
  .skip-number-line .number-jump small {
    top: -55px;
    left: calc((100% - 19px) / 2);
  }
}
.practice-screen.correct-flash .visual-model {
  animation: model-glow 0.75s ease-out;
}
@keyframes success-flash {
  0% {
    opacity: 0;
  }
  22% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@keyframes answer-pop {
  0% {
    transform: scale(0.9);
  }
  45% {
    transform: scale(1.09);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes model-glow {
  0% {
    box-shadow: 0 0 0 rgba(66, 194, 168, 0);
  }
  35% {
    box-shadow:
      0 0 0 10px rgba(66, 194, 168, 0.2),
      0 18px 55px rgba(66, 194, 168, 0.25);
  }
  100% {
    box-shadow: 0 0 0 rgba(66, 194, 168, 0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .practice-screen.correct-flash:after {
    animation: none;
    opacity: 0.12;
  }
  .equation-correct,
  .practice-screen.correct-flash .visual-model {
    animation: none;
  }
}
.array-frame {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  align-items: stretch;
  gap: 8px 12px;
}
.array-top-label {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.04em;
}
.array-top-label:after {
  content: '';
  width: calc(100% - 20px);
  height: 7px;
  border: 2px solid var(--structure-border);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
}
.array-side-label {
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.04em;
}
.array-side-label:after {
  content: '';
  height: calc(100% - 20px);
  width: 7px;
  border: 2px solid var(--structure-border);
  border-left: 0;
  border-radius: 0 7px 7px 0;
}
.array-frame .dot-array {
  grid-column: 2;
  grid-row: 2;
}
@media (max-width: 720px) {
  .array-frame {
    gap: 5px 7px;
  }
  .array-top-label,
  .array-side-label {
    font-size: 0.68rem;
  }
  .array-top-label:after {
    height: 5px;
  }
  .array-side-label:after {
    width: 5px;
  }
}
.language-picker {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
}
.language-picker select {
  min-height: 44px;
  padding: 0 34px 0 12px;
  border: 2px solid #dfe3ec;
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
  font-weight: 750;
}
.setup-actions .primary-button {
  margin-left: auto;
}
@media (max-width: 720px) {
  .language-picker {
    justify-content: space-between;
  }
  .language-picker select {
    min-width: 150px;
  }
  .setup-actions .primary-button {
    margin-left: 0;
  }
}
.equation-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.equation-sound-button {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border: 3px solid #9cacec;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(44, 55, 90, 0.1);
  cursor: pointer;
  font-size: 1.35rem;
}
.equation-sound-button:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
}
@media (max-width: 720px) {
  .equation-row {
    gap: 9px;
  }
  .equation-sound-button {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
    border-width: 2px;
    border-radius: 14px;
    font-size: 1.1rem;
  }
}
.representation-controls {
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.representation-controls strong {
  color: var(--blue-dark);
  font-size: 0.92rem;
}
.representation-controls .secondary-button {
  min-height: 44px;
  padding: 0 17px;
  border-radius: 14px;
}
.multiplication-array {
  background: var(--structure-soft);
  border: 3px solid var(--structure-border);
  box-shadow: 0 5px 0 rgba(23, 36, 63, 0.12);
}
.strategy-equation {
  max-width: 760px;
  padding: 28px;
  color: var(--blue-dark);
  font-size: clamp(1.65rem, 4vw, 2.8rem);
  font-weight: 900;
  line-height: 1.5;
}
.skip-sequence {
  max-width: 720px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.skip-sequence span {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 3px solid #9cacec;
  border-radius: 50%;
  background: #fff;
  color: var(--blue-dark);
  box-shadow: 0 5px 0 rgba(41, 71, 189, 0.12);
  font-size: 1.35rem;
  font-weight: 900;
}
.skip-sequence span + span:before {
  content: '→';
  position: absolute;
  margin-left: -31px;
  color: #7886b9;
}
.skip-sequence span {
  position: relative;
}
@media (max-width: 720px) {
  .representation-controls {
    flex-direction: column;
    gap: 7px;
  }
  .representation-controls .secondary-button {
    min-height: 40px;
  }
  .strategy-equation {
    padding: 15px;
    font-size: 1.35rem;
  }
  .skip-sequence {
    gap: 9px;
  }
  .skip-sequence span {
    width: 48px;
    height: 48px;
    border-width: 2px;
    font-size: 1rem;
  }
  .skip-sequence span + span:before {
    margin-left: -23px;
  }
}
.skip-counting-ways {
  display: grid;
  gap: 24px;
}
.skip-method {
  display: grid;
  gap: 10px;
}
.skip-method > strong {
  color: var(--blue-dark);
  font-size: 0.9rem;
}
.skip-sequence span + span:before {
  display: none;
}
@media (max-width: 720px) {
  .skip-counting-ways {
    gap: 16px;
  }
}
.times-table-comparison {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 34px;
}
.times-table-example {
  display: grid;
  justify-items: center;
  gap: 10px;
}
.times-table-label {
  color: var(--blue-dark);
  font-size: 0.88rem;
}
.times-table {
  display: grid;
  gap: 7px;
}
.times-table-row {
  min-width: 180px;
  padding: 9px 18px;
  border: 2px solid #d9dff5;
  border-radius: 13px;
  background: #fff;
  color: var(--blue-dark);
  font-size: 1.08rem;
  font-weight: 850;
}
.times-table-row.current {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 6px 16px rgba(66, 99, 235, 0.24);
  transform: scale(1.04);
}
.times-table-row.current.revealed-answer {
  color: #fff !important;
}
@media (max-width: 720px) {
  .times-table-comparison {
    flex-direction: column;
    align-items: center;
    gap: 24px;
  }
  .times-table {
    gap: 5px;
  }
  .times-table-row {
    min-width: 170px;
    padding: 7px 14px;
    font-size: 1rem;
  }
}
.array-comparison {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 34px;
}
.array-example {
  display: grid;
  justify-items: center;
  gap: 10px;
}
.array-example-label {
  color: var(--ink);
  font-size: 0.88rem;
}
.array-comparison .dot-array {
  grid-template-columns: repeat(var(--columns), 18px);
  gap: 7px;
  padding: 16px;
}
.array-comparison .number-dot {
  width: 18px;
  height: 18px;
}
@media (max-width: 720px) {
  .array-comparison {
    flex-direction: column;
    align-items: center;
    gap: 24px;
  }
  .array-comparison .dot-array {
    grid-template-columns: repeat(var(--columns), 14px);
    gap: 5px;
    padding: 12px;
  }
  .array-comparison .number-dot {
    width: 14px;
    height: 14px;
  }
}
.addition-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}
.addition-step {
  min-width: 125px;
  padding: 16px 20px;
  border: 3px solid #e3b757;
  border-radius: 18px;
  background: #fff8e8;
  color: #8a5b00;
  font-size: 1.55rem;
  font-weight: 900;
}
.addition-step + .addition-step:before {
  content: '=';
  position: absolute;
  margin-left: -37px;
  color: var(--muted);
}
.addition-step {
  position: relative;
}
.make-ten-fallback {
  display: grid;
  justify-items: center;
  gap: 18px;
  max-width: 100%;
}
.make-ten-fallback .addition-steps {
  gap: 0;
}
.make-ten-note {
  max-width: 34ch;
  line-height: 1.35;
  text-align: center;
}
.ten-frames {
  display: flex;
  gap: 22px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.ten-frame {
  display: grid;
  grid-template-columns: repeat(5, 42px);
  grid-template-rows: repeat(2, 42px);
  gap: 7px;
  padding: 12px;
  border: 4px solid var(--structure-border);
  border-radius: 18px;
  background: #fff;
}
.ten-cell {
  border: 2px solid #e0e4ed;
  border-radius: 50%;
  background: #f4f5f8;
}
.ten-cell.from-first {
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: inset 0 -5px rgba(0, 0, 0, 0.09);
}
.ten-cell.from-second {
  border-color: #e9a11b;
  background: #f5a623;
  box-shadow: inset 0 -5px rgba(0, 0, 0, 0.09);
}
.addition-number-line {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  padding: 35px 20px 10px;
}
.number-stop {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 3px solid #9cacec;
  border-radius: 50%;
  background: #fff;
  color: var(--blue-dark);
  font-size: 1.35rem;
  font-weight: 900;
  box-shadow: 0 5px 0 rgba(23, 36, 63, 0.12);
}
.number-jump {
  min-width: 105px;
  display: flex;
  align-items: center;
  border-top: 5px solid #e3b757;
  position: relative;
}
.number-jump small {
  position: absolute;
  top: -34px;
  left: 50%;
  color: #8a5b00;
  font-size: 1rem;
  font-weight: 900;
  transform: translateX(-50%);
}
@media (max-width: 720px) {
  .addition-steps {
    flex-direction: column;
    gap: 18px;
  }
  .addition-step {
    min-width: 150px;
    padding: 11px 16px;
    font-size: 1.25rem;
  }
  .addition-step + .addition-step:before {
    content: '=';
    top: -25px;
    left: 50%;
    margin-left: 0;
    transform: translateX(-50%);
  }
  .ten-frame {
    grid-template-columns: repeat(5, 30px);
    grid-template-rows: repeat(2, 30px);
    gap: 5px;
    padding: 9px;
  }
  .addition-number-line {
    padding-inline: 3px;
  }
  .number-stop {
    width: 48px;
    height: 48px;
    font-size: 1rem;
  }
  .number-jump {
    min-width: 65px;
  }
}
.addition-steps {
  gap: 52px;
}
.addition-step {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue-dark);
  box-shadow: none;
}
.ten-frame-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.ten-frame.compact {
  grid-template-columns: repeat(var(--ten-columns), 42px);
  grid-auto-flow: column;
}
.number-line-view {
  display: grid;
  justify-items: center;
  gap: 18px;
}
.commutative-equation {
  color: var(--blue);
  font-size: 1.5rem;
  font-weight: 900;
}
.number-line-method {
  display: grid;
  justify-items: center;
  gap: 7px;
}
.number-line-expression {
  color: var(--blue);
  font-size: 1.25rem;
  font-weight: 900;
}
.number-line-decomposition {
  color: var(--blue-dark);
  font-size: 1.05rem;
  font-weight: 900;
}
.number-jump {
  width: 105px;
  min-width: 105px;
  height: 64px;
  border-top: 0;
  justify-content: flex-end;
  position: relative;
}
.number-jump:before {
  content: '';
  position: absolute;
  left: 5px;
  right: 69px;
  top: 29px;
  border-top: 5px solid #e3b757;
}
.number-jump:after {
  content: '';
  position: absolute;
  right: 61px;
  top: 21px;
  border: 9px solid transparent;
  border-left: 13px solid #e3b757;
}
.number-jump small {
  top: -10px;
  left: 25%;
}
.number-jump .number-stop {
  position: relative;
  z-index: 1;
}
.commutative-visual {
  display: grid;
  justify-items: center;
  gap: 16px;
}
.commutative-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
}
@media (max-width: 720px) {
  .ten-frame.compact {
    grid-template-columns: repeat(var(--ten-columns), 30px);
  }
  .number-line-view {
    gap: 12px;
  }
  .commutative-equation {
    font-size: 1.2rem;
  }
  .number-line-method {
    gap: 4px;
  }
  .number-line-expression {
    font-size: 1.05rem;
  }
  .number-line-decomposition {
    font-size: 0.9rem;
  }
  .number-jump {
    width: 64px;
    min-width: 64px;
    height: 48px;
  }
  .number-jump:before {
    left: 2px;
    right: 45px;
    top: 22px;
  }
  .number-jump:after {
    right: 37px;
    top: 14px;
  }
  .number-jump small {
    top: -12px;
    left: 28%;
  }
  .commutative-row {
    gap: 12px;
  }
}
.addition-number-line .number-stop {
  width: auto;
  min-width: 48px;
  height: 38px;
  padding: 9px 8px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.skip-number-line .number-stop {
  width: auto;
  min-width: 46px;
  height: 34px;
  padding: 8px 6px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
@media (max-width: 720px) {
  .addition-number-line .number-stop {
    min-width: 40px;
    height: 32px;
    padding: 7px 5px 0;
  }
  .skip-number-line .number-stop {
    min-width: 38px;
    height: 30px;
    padding: 6px 4px 0;
  }
}
.skip-number-line .number-jump small {
  display: block;
  top: auto;
  bottom: 88px;
  left: calc((100% - 23px) / 2);
  z-index: 3;
  transform: translateX(-50%);
}
@media (max-width: 720px) {
  .skip-number-line .number-jump small {
    top: auto;
    bottom: 76px;
    left: calc((100% - 19px) / 2);
  }
}
.jump-curve-label {
  fill: #8a5b00;
  font-family: inherit;
  font-size: 14px;
  font-weight: 900;
  text-anchor: middle;
}
.number-jump > .jump-label {
  display: block;
  top: auto;
  bottom: 72px;
  left: calc((100% - 24px) / 2);
  z-index: 4;
  color: #8a5b00;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  transform: translateX(-50%);
  pointer-events: none;
}
.skip-number-line .number-jump > .jump-label {
  top: auto;
  bottom: 64px;
  left: calc((100% - 23px) / 2);
  font-size: 0.82rem;
}
@media (max-width: 720px) {
  .number-jump > .jump-label {
    bottom: 60px;
    left: calc((100% - 20px) / 2);
    font-size: 0.82rem;
  }
  .skip-number-line .number-jump > .jump-label {
    bottom: 55px;
    left: calc((100% - 19px) / 2);
    font-size: 0.72rem;
  }
}
.skip-number-line {
  padding-top: 72px;
}
@media (max-width: 720px) {
  .skip-number-line {
    padding-top: 62px;
  }
}
.skip-number-line .number-jump:last-child {
  border-top-color: transparent;
  background: linear-gradient(#9cacec, #9cacec) left top/calc(100% - 23px) 4px no-repeat;
  background-origin: border-box;
}
@media (max-width: 720px) {
  .skip-number-line .number-jump:last-child {
    background-size: calc(100% - 19px) 4px;
  }
}
.subtraction-number-line .jump-curve-line {
  stroke: #ff9b78;
}
.subtraction-number-line .jump-label {
  color: #a23f28;
}
.subtraction-comparison {
  display: grid;
  gap: 14px;
  justify-items: start;
  max-width: 100%;
  overflow-x: auto;
  padding: 12px;
}
.comparison-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.comparison-row > strong {
  width: 28px;
  color: var(--blue-dark);
  font-size: 1.1rem;
}
.comparison-blocks {
  display: flex;
  gap: 4px;
}
.comparison-blocks span {
  width: 28px;
  height: 38px;
  border: 2px solid var(--role-a-border);
  border-radius: 7px;
  background: var(--role-a-soft);
}
.comparison-blocks.part span {
  background: var(--role-b-soft);
  border-color: var(--role-b-border);
}
.comparison-blocks .difference-block {
  background: #fff;
  border-color: var(--ink);
}
.comparison-difference {
  justify-self: end;
  margin-right: 10px;
  min-width: 58px;
  padding: 6px 14px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 900;
  text-align: center;
}
.subtraction-steps {
  max-width: 100%;
}
.missing-addend {
  padding: 20px 34px;
  border: 3px solid #9cacec;
  border-radius: 20px;
  background: #fff;
}
@media (max-width: 720px) {
  .comparison-blocks span {
    width: 20px;
    height: 30px;
  }
  .comparison-row {
    gap: 8px;
  }
  .subtraction-comparison {
    padding: 6px;
  }
  .missing-addend {
    padding: 15px 22px;
  }
}
.take-away-view {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  max-width: 100%;
  flex-wrap: wrap;
}
.take-away-start,
.take-away-result {
  display: grid;
  justify-items: center;
  gap: 10px;
}
.take-away-result {
  padding: 0;
  border: 0;
  background: transparent;
}
@media (max-width: 720px) {
  .take-away-view {
    gap: 10px;
  }
  .take-away-view > .visual-operator {
    font-size: 1.7rem;
  }
  .take-away-result {
    padding: 0;
  }
}
.division-groups {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.division-groups .division-group {
  flex: 0 1 auto;
  background: var(--structure-soft);
}
.division-array .array-top-label,
.division-array .array-side-label {
  color: var(--ink);
  font-weight: 900;
}
.division-array .dot-array {
  background: var(--structure-soft);
  border-color: var(--structure-border);
}
.division-array-comparison {
  max-width: 100%;
  flex-wrap: wrap;
  align-items: center;
}
.division-shared-whole {
  width: min(100%, calc(var(--share-groups) * 68px));
  display: grid;
  grid-template-columns: repeat(var(--share-groups), minmax(0, 1fr));
  overflow: hidden;
  border: 4px solid var(--structure-border);
  border-radius: 24px;
  background: var(--structure-soft);
  box-shadow: 0 6px 0 rgba(23, 36, 63, 0.12);
}
.division-shared-part {
  min-width: 0;
  padding: 15px 8px;
  display: grid;
  place-items: center;
}
.division-shared-part + .division-shared-part {
  border-left: 4px solid var(--structure-border);
}
.division-shared-dots {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
}
.division-shared-dots .number-dot {
  width: 20px;
  height: 20px;
}
@media (max-width: 720px) {
  .division-shared-whole {
    width: 100%;
    border-width: 3px;
    border-radius: 18px;
  }
  .division-shared-part {
    padding: 10px 3px;
  }
  .division-shared-part + .division-shared-part {
    border-left-width: 3px;
  }
  .division-shared-dots {
    gap: 5px;
  }
  .division-shared-dots .number-dot {
    width: 14px;
    height: 14px;
  }
}

/* A container always represents one mathematical group. */
.counter-group {
  display: grid;
  grid-template-columns: repeat(var(--counter-columns), 20px);
  gap: 9px;
  padding: 16px;
  border: 2px solid var(--structure-border);
  border-radius: 20px;
  background: var(--structure-soft);
  max-width: 100%;
  box-sizing: border-box;
}
.counter-group .number-dot {
  width: 20px;
  height: 20px;
}
.counter-group.group-b {
  background: #fff0d0;
  border-color: #b77b12;
}
.counter-group.group-a {
  background: #e9edff;
}
.multiplication-groups {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  max-width: 100%;
}
.counter-group.division-group {
  background: var(--structure-soft);
  border-color: var(--structure-border);
}
.subtraction-model .counter-group.whole-group {
  background: var(--role-a-soft);
  border-color: var(--role-a-border);
}
.subtraction-model .counter-group.whole-group .number-dot {
  background: var(--role-a);
}
.subtraction-model .counter-group.subtrahend-group {
  background: var(--role-b-soft);
  border-color: var(--role-b-border);
}
.subtraction-model .counter-group.subtrahend-group .number-dot {
  background: var(--role-b);
}
.division-progression {
  display: grid;
  grid-template-rows: minmax(360px, 1fr) 66px;
  align-items: start;
  justify-items: center;
  gap: 16px;
  width: 100%;
  min-width: 0;
  min-height: 445px;
}
.division-scene {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 24px;
  width: 100%;
  min-width: 0;
  min-height: 360px;
}
.division-pool {
  display: grid;
  justify-items: center;
  gap: 8px;
}
.division-pool-label,
.division-share-label {
  color: var(--blue-dark);
  font-size: 1rem;
  font-weight: 900;
}
.division-shared-whole .division-share-label {
  grid-column: 1/-1;
  margin: 0 0 4px;
}
.division-groups > .division-share-label {
  flex-basis: 100%;
  text-align: center;
}
@media (max-width: 720px) {
  .division-progression {
    grid-template-rows: minmax(300px, 1fr) 58px;
    min-height: 380px;
  }
  .division-scene {
    min-height: 300px;
    gap: 16px;
  }
}
.counter-pool {
  grid-template-columns: repeat(10, 20px);
  background: transparent;
  border: 0;
  padding: 8px;
}
.division-shared-dots {
  min-height: 20px;
}
.division-progression button {
  white-space: normal;
}
.addition-model,
.commutative-row,
.number-bond-visual {
  flex-wrap: wrap;
}
.addition-result {
  flex: 1 0 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.number-bond-card {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
@media (max-width: 720px) {
  .counter-group {
    grid-template-columns: repeat(var(--counter-columns), 16px);
    padding: 10px;
    gap: 7px;
  }
  .counter-group .number-dot {
    width: 16px;
    height: 16px;
  }
  .counter-pool {
    grid-template-columns: repeat(10, 16px);
    padding: 0;
    gap: 6px;
  }
  .number-bond-card {
    padding: 12px;
  }
  .commutative-row {
    gap: 10px;
  }
}

/* Keep the lesson action stationary while large dot collections scroll inside the scene. */
.division-progression {
  height: 445px;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) 66px;
  gap: 10px;
}
.division-status {
  min-height: 24px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  color: var(--blue-dark);
  font-size: 0.94rem;
  font-weight: 900;
  text-align: center;
}
.division-scene {
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 2px 4px 12px;
}
.sound-switch input:focus-visible + .switch-track {
  outline: 4px solid var(--blue-dark);
  outline-offset: 3px;
}
@media (max-width: 720px) {
  .division-progression {
    height: 380px;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr) 58px;
    gap: 8px;
  }
  .division-status {
    min-height: 22px;
    font-size: 0.88rem;
  }
  .division-scene {
    min-height: 0;
  }
}

/* Adventure map and reward loop. */
.map-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}
.brand-home {
  margin: 0;
}
.map-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 13px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}
.map-intro {
  max-width: 660px;
  margin: -12px 0 30px;
  color: var(--muted);
  font-size: 1.08rem;
  font-weight: 650;
  line-height: 1.5;
}
.section-title {
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}
.world-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 16px 0 24px;
}
/* Worlds are distinguished by symbol and name, not colour. */
.world-card {
  min-height: 178px;
  padding: 18px;
  border: 3px solid #e1e5ef;
  border-radius: 24px;
  background: linear-gradient(145deg, #fff, #f3f5f9);
  box-shadow: 0 6px 18px rgba(44, 55, 90, 0.06);
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 8px;
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
}
.world-card:hover {
  border-color: #b9c0cf;
  transform: translateY(-3px);
}
.world-card[aria-pressed='true'] {
  border-color: var(--ink);
  box-shadow: 0 12px 26px rgba(44, 55, 90, 0.16);
}
.world-symbol {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: var(--ink);
  font-size: 1.75rem;
}
.world-name {
  font-size: 1.08rem;
  font-weight: 900;
}
.world-progress {
  color: var(--blue-dark);
  font-size: 0.82rem;
  font-weight: 750;
}
.progress-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6e9f0;
}
.progress-fill {
  display: block;
  width: var(--progress);
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}
.star-rating {
  display: inline-flex;
  gap: 2px;
  line-height: 1;
}
.star {
  color: #d4d8e2;
  font-size: 1rem;
}
.star.filled {
  color: #e5a91f;
}
.world-stars {
  margin-top: 2px;
}
.level-panel {
  padding: 24px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
}
.level-panel-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.level-panel-header h2 {
  margin-top: 2px;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
}
.level-kicker {
  margin: 0;
  color: var(--blue-dark);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.level-panel-header > strong {
  color: var(--blue-dark);
  font-size: 0.92rem;
  white-space: nowrap;
}
.level-nodes {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.level-node {
  min-height: 92px;
  padding: 12px;
  border: 3px solid #e1e5ef;
  border-radius: 19px;
  background: #fff;
  cursor: pointer;
  display: grid;
  place-content: center;
  gap: 8px;
  transition:
    transform 0.15s,
    border-color 0.15s;
}
.level-node:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
}
.level-node > strong {
  font-size: 1.45rem;
}
.level-node.completed {
  border-color: #b8dfd7;
  background: #f1fbf8;
}
.boss-node {
  grid-column: 1/-1;
  min-height: 76px;
  padding: 14px 20px;
  border: 3px dashed #9cacec;
  border-radius: 20px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 6px 14px;
  text-align: left;
  background: #f4f6ff;
  cursor: pointer;
}
.boss-node:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}
.boss-node.completed {
  border-style: solid;
  border-color: var(--yellow);
  background: #fff8e8;
}
.boss-icon {
  grid-row: 1/3;
  font-size: 1.8rem;
  color: #d6960e;
}
.boss-copy {
  font-size: 1rem;
  font-weight: 900;
}
.boss-node small {
  color: var(--muted);
  font-weight: 700;
}
.map-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}
.collection-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 26px;
}
.collection-header .eyebrow {
  margin-bottom: 4px;
}
.collection-header h1 {
  font-size: clamp(2rem, 5vw, 3.6rem);
}
.collection-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.collection-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}
.tertiary-button {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--blue-dark);
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}
.tertiary-button:hover {
  color: #8e3b39;
}
.collection-status {
  min-height: 1.4em;
  margin: 8px 0 0;
  color: #14725f;
  font-weight: 800;
  text-align: right;
}
.sticker-card {
  min-height: 220px;
  padding: 22px;
  border: 3px solid #e1e5ef;
  border-radius: 24px;
  display: grid;
  align-content: start;
  gap: 10px;
  background: #fff;
}
.sticker-card.unlocked {
  border-color: #b8dfd7;
  background: linear-gradient(145deg, #fff, #eefbf8);
}
.sticker-card.locked {
  background: #f1f2f5;
  color: var(--muted);
}
.sticker-card.boss-sticker.unlocked {
  border-color: #e5a91f;
  background: linear-gradient(145deg, #fff, #fff5d7);
}
.sticker-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: var(--blue);
  font-size: 1.7rem;
  font-weight: 900;
}
.sticker-card.locked .sticker-icon {
  background: #c7ccd7;
}
.sticker-card strong {
  font-size: 1rem;
}
.sticker-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}
.sticker-card small {
  color: var(--blue-dark);
  font-weight: 850;
}
.sticker-card.locked small {
  color: var(--muted);
}
.earned-stars {
  margin: -16px 0 22px;
}
.earned-stars .star {
  font-size: 2.5rem;
}
.reward-card {
  width: min(520px, 100%);
  margin: 0 0 24px;
  padding: 16px 18px;
  border: 3px solid #e5a91f;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  background: #fff8e8;
}
.reward-icon {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: var(--yellow);
  font-size: 1.45rem;
}
.reward-card p {
  margin: 3px 0 0;
  color: var(--blue-dark);
  font-weight: 750;
}
.result-actions {
  flex-wrap: wrap;
  justify-content: center;
}
@media (max-width: 900px) {
  .world-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .collection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .map-header {
    align-items: stretch;
    flex-direction: column;
    gap: 20px;
  }
  .map-controls {
    justify-content: space-between;
  }
  .world-options {
    gap: 12px;
  }
  .world-card {
    min-height: 158px;
    padding: 14px;
  }
  .level-panel {
    padding: 16px;
  }
  .level-panel-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
  .level-nodes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
  }
  .level-node {
    min-height: 82px;
  }
  .map-actions {
    flex-direction: column;
  }
  .collection-grid {
    grid-template-columns: 1fr;
  }
  .sticker-card {
    min-height: 180px;
  }
  .result-actions {
    width: 100%;
    flex-direction: column;
  }
  .result-actions button {
    width: 100%;
  }
}
[data-screen-focus]:focus {
  outline: none;
}
@media (max-width: 720px) {
  .map-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px 12px;
  }
  .map-controls .language-picker {
    min-width: 0;
    gap: 6px;
  }
  .map-controls .language-picker select {
    width: 100%;
    min-width: 0;
  }
  .map-controls .sound-switch {
    gap: 7px;
  }
}
.commutative-note {
  flex: 1 0 100%;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-items: center;
  gap: 8px 14px;
  color: var(--blue-dark);
  font-size: 1rem;
}
.commutative-note > strong {
  padding: 5px 10px;
  border-radius: 999px;
  background: #eef1ff;
  font-size: 0.82rem;
  text-align: center;
}
.commutative-equation-block {
  display: grid;
  justify-items: end;
  gap: 3px;
}
.commutative-equation-text {
  font-weight: 900;
}
.commutative-action {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}
.commutative-dots {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
  max-width: 100%;
  flex-wrap: wrap;
}
@media (max-width: 720px) {
  .commutative-note {
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 2px;
    font-size: 0.92rem;
  }
  .commutative-equation-block,
  .commutative-dots {
    grid-column: 1;
  }
  .commutative-equation-block {
    justify-items: center;
  }
  .commutative-dots {
    gap: 10px;
  }
}
.parity-group {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 10px;
  min-width: 0;
}
.parity-label {
  display: grid;
  justify-items: center;
  gap: 2px;
  width: max-content;
  max-width: 150px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue-dark);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
}
.parity-name {
  font-size: 0.78rem;
}
.parity-detail {
  color: var(--muted);
  font-size: 0.66rem;
}
.number-dot.parity-remainder,
.ten-cell.parity-remainder {
  outline: 3px dashed #a23f28;
  outline-offset: 2px;
}
@media (max-width: 720px) {
  .parity-group {
    gap: 8px;
  }
  .parity-label {
    max-width: 128px;
    font-size: 0.65rem;
  }
  .parity-name {
    font-size: 0.7rem;
  }
  .parity-detail {
    font-size: 0.6rem;
  }
}
.factor-parity-note {
  flex: 1 0 100%;
  color: var(--blue-dark);
  font-size: 0.86rem;
  text-align: center;
}
.division-shared-dots {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}
.multiplication-model {
  flex-wrap: wrap;
}
.answer-button:hover:not(:disabled) {
  transform: none;
}

/* Both subtraction operands stay visible while the result is unknown. */
.subtraction-unknown {
  font-size: 2.5rem;
  color: var(--ink);
}

/* On phones the two dot frames stack so the plus stays between them. */
@media (max-width: 420px) {
  .ten-frames {
    flex-direction: column;
    gap: 12px;
  }
}

.visual-model .counter-group.result-group {
  background: #fff;
  border-color: var(--ink);
  border-width: 3px;
}
.visual-model .counter-group.result-group .number-dot {
  background: var(--ink);
}
