:root {
  color-scheme: light;
  --ink: #254b3b;
  --sky: #edf8ff;
  --grass: #d9edb5;
  --orange: #ed8b40;
  --paper: #fffef7;
  --red: #d34d50;
  font-family:
    'Arial Rounded MT Bold', 'Hiragino Maru Gothic ProN', 'PingFang SC', 'Microsoft YaHei',
    sans-serif;
  color: var(--ink);
  background: var(--sky);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 280px;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
}
button:disabled {
  cursor: default;
}
button:focus-visible,
a:focus-visible {
  outline: 4px solid #375cbb;
  outline-offset: 5px;
}
[hidden] {
  display: none !important;
}
h1,
h2,
p {
  margin: 0;
}
h1:focus {
  outline: none;
}
.topbar {
  max-width: 1100px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 20px 26px;
}
.home-link {
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
}
.brand {
  font-weight: 800;
  font-size: 19px;
}
.quiet {
  padding: 10px 16px;
  min-height: 48px;
  border: 1px solid #254b3b30;
  border-radius: 24px;
  background: #ffffffb3;
  font-weight: 600;
}
main {
  max-width: 1040px;
  padding: 0 26px;
  margin: auto;
}
.intro {
  text-align: center;
  position: relative;
  padding: 34px 0 22px;
}
.invitation {
  color: #557644;
  font-size: 17px;
  margin-bottom: 12px;
}
h1 {
  font-size: clamp(28px, 4.5vw, 44px);
  line-height: 1.3;
  font-weight: 900;
  letter-spacing: 1px;
}
.intro > p:last-child {
  margin-top: 16px;
  line-height: 1.7;
}
.little-cloud {
  position: absolute;
  color: white;
  font-size: 80px;
  z-index: -1;
}
.cloud-one {
  left: 0;
  top: 0;
}
.cloud-two {
  right: 5px;
  top: 80px;
  font-size: 64px;
}
.adventure-map {
  position: relative;
  background: var(--grass);
  border-radius: 70px 70px 35px 35px;
  margin-top: 36px;
  padding: 25px 26px 52px;
  min-height: 330px;
  border-bottom: 8px solid #badb91;
}
.trail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.trail path {
  stroke: #fffef7;
  stroke-width: 34;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 2 46;
}
.stages {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 22px;
  z-index: 1;
}
.stage-group {
  min-width: 0;
  padding: 16px;
  background: #ffffff66;
  border: 2px solid #a9ca88;
  border-radius: 30px;
}
.stage-group h2 {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 12px;
  margin-bottom: 16px;
  font-size: 24px;
}
.stage-group h2 span {
  font-size: 14px;
  font-weight: 600;
}
.stage-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.stage {
  width: 100%;
  min-width: 0;
  min-height: 230px;
  background: var(--paper);
  border: 3px solid #254b3b;
  border-bottom-width: 7px;
  border-radius: 90px 90px 28px 28px;
  padding: 20px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  transition: transform 0.15s;
}
.stage:not(:disabled):hover {
  transform: translateY(-5px);
}
.stage:disabled {
  border-color: #7b9574;
  background: #eff5e4;
  color: #506447;
}
.stage-icon {
  font-size: 52px;
  line-height: 1.2;
}
.stage strong {
  font-size: 22px;
}
.stage-number {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  color: #557644;
}
.stage small {
  font-size: 14px;
}
.stage-state {
  background: #e4edda;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 14px;
}
.stage:not(:disabled) .stage-state {
  background: #ffe6a3;
}
.scenery {
  position: absolute;
  pointer-events: none;
}
.tree {
  left: -16px;
  top: -29px;
  font-size: 74px;
  transform: rotate(-12deg);
}
.rabbit {
  font-size: 56px;
  left: 26%;
  bottom: 1px;
  transform: rotate(-8deg);
}
.picnic {
  font-size: 55px;
  right: 26%;
  bottom: 12px;
}
.map-bottom {
  text-align: center;
  padding-top: 24px;
}
.collection {
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 14px;
}
.grownup-note {
  font-size: 14px;
  line-height: 1.6;
  color: #547063;
  margin-top: 20px;
}
.primary {
  background: var(--ink);
  color: white;
  font-size: 20px;
  font-weight: 750;
  border-radius: 18px;
  padding: 16px 32px;
  min-height: 56px;
  box-shadow: 0 5px 0 #142e22;
}
.primary:hover {
  background: #356449;
}
.primary:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #142e22;
}
#play {
  max-width: 780px;
  margin: 16px auto 0;
}
.play-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 16px;
}
#stage-name {
  font-weight: 800;
  text-align: center;
  line-height: 1.6;
}
#progress-label {
  flex-shrink: 0;
}
.steps {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin: 20px 0;
}
.step {
  height: 9px;
  width: 48px;
  border-radius: 8px;
  background: #cfdfd9;
}
.step.done {
  background: #568750;
}
.step.current {
  background: var(--orange);
}
.question-heading {
  text-align: center;
  position: relative;
}
#story {
  font-size: 16px;
  margin-bottom: 7px;
}
.question-heading h1 {
  font-size: clamp(25px, 4vw, 34px);
}
#read {
  margin-top: 12px;
  font-size: 14px;
}
.equation {
  text-align: center;
  font-size: 34px;
  font-weight: 800;
  margin: 14px 0;
  letter-spacing: 3px;
}
.objects {
  background: var(--paper);
  border: 2px solid #cbdcc4;
  border-bottom: 6px solid #cbdcc4;
  border-radius: 28px;
  padding: 20px;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 18px;
  min-height: 142px;
}
.pile {
  flex: 1;
  max-width: 100%;
  min-width: 0;
}
.pile-label {
  text-align: center;
  color: #547063;
  font-size: 15px;
  margin-bottom: 12px;
}
.tokens {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  align-content: center;
}
.token {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: #edf3dd;
  border-radius: 16px;
  width: 58px;
  height: 58px;
  padding: 0;
  font-size: 32px;
  border: 2px solid transparent;
}
.token.counted {
  border-color: #528840;
  background: #dceeca;
}
.count-badge {
  position: absolute;
  top: -6px;
  right: -5px;
  min-width: 23px;
  height: 23px;
  padding: 0 4px;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-size: 14px;
  line-height: 23px;
}
.operator {
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 800;
}
.pile.given {
  border-right: 2px dashed #bdceae;
  padding-right: 16px;
  flex: 0.85;
}
.given .token {
  opacity: 0.6;
  background: #eee9e2;
  cursor: default;
}
.given .token::after {
  content: '送走';
  position: absolute;
  font-size: 11px;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff8ed;
  color: #4e5447;
  border-radius: 8px;
}
.zero {
  padding: 14px;
  border: 2px dashed #a8be9b;
  border-radius: 16px;
  font-size: 17px;
  line-height: 1.7;
  text-align: center;
}
.objects.missing {
  background: linear-gradient(145deg, #fff9ed, #f3f6ff 65%, #eff8e7);
}
.part-whole {
  width: 100%;
  min-width: 0;
}
.whole,
.parts {
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.whole > .pile,
.parts > .pile {
  padding: 14px 10px;
  border: 2px solid #d9dfca;
  border-radius: 20px;
  background: #fffef7;
}
.whole > .pile {
  flex: 0 1 430px;
  border-color: #b6c9de;
}
.part-relation {
  padding: 12px 0;
  text-align: center;
  font-size: 14px;
  color: #547063;
}
.parts {
  gap: 12px;
}
.part-join {
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 800;
}
.mystery-pile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 134px;
}
.hidden-number {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border: 3px dashed #a284bf;
  border-radius: 20px;
  background: #f3eafc;
  color: #755199;
  font-size: 44px;
  font-weight: 900;
}
.hidden-number.revealed {
  background: #e3efcf;
  border-style: solid;
  border-color: #7b9c59;
  color: var(--ink);
}
.count-help {
  text-align: center;
  min-height: 26px;
  margin: 12px 0;
  font-size: 15px;
  line-height: 1.6;
}
.answers {
  display: flex;
  justify-content: center;
  gap: 18px;
}
.answer {
  background: white;
  border: 3px solid var(--ink);
  border-bottom-width: 7px;
  border-radius: 22px;
  min-height: 82px;
  width: 120px;
  font-size: 39px;
  font-weight: 900;
}
.answer:hover:not(:disabled) {
  background: #fff2bd;
}
.answer.retry {
  border-color: #9b6726;
  background: #fff0d4;
}
.answer.correct {
  background: #d9edb5;
}
.answer:disabled:not(.correct) {
  opacity: 0.5;
}
.feedback {
  text-align: center;
  min-height: 30px;
  margin: 16px 0 8px;
  font-weight: 700;
  line-height: 1.6;
}
.next {
  display: block;
  margin: 0 auto 16px;
}
.celebrate {
  text-align: center;
  padding: 48px 0;
}
.reward-art {
  font-size: 94px;
  margin-bottom: 18px;
  animation: arrive 0.4s ease-out;
}
.celebrate h1 {
  margin: 12px 0 20px;
}
.celebrate > p {
  line-height: 1.8;
}
.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  max-width: 600px;
  margin: 28px auto;
}
.badge {
  flex: 0 0 100px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fff2bd;
  border: 2px solid #e1c15b;
  border-radius: 50%;
  width: 100px;
  height: 100px;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.badge span {
  font-size: 33px;
}
#reward-map {
  display: block;
  margin: 22px auto 0;
}
.storage-note {
  text-align: center;
  line-height: 1.6;
  color: #845328;
  margin-top: 16px;
  font-size: 14px;
}
footer {
  text-align: center;
  padding: 28px 16px;
  font-size: 13px;
  color: #547063;
}
@keyframes arrive {
  from {
    transform: scale(0.8);
  }
  to {
    transform: scale(1);
  }
}
@media (min-width: 601px) and (max-width: 900px) {
  .stages {
    grid-template-columns: minmax(0, 1fr);
  }
  .stage {
    min-height: 205px;
  }
  .stage-pair {
    max-width: 570px;
    margin: auto;
  }
}
@media (max-width: 600px) {
  .topbar {
    padding: 10px 14px;
    gap: 6px;
  }
  .brand {
    font-size: 16px;
  }
  .home-link {
    font-size: 13px;
  }
  .quiet {
    padding: 8px 12px;
    font-size: 13px;
  }
  main {
    padding: 0 14px;
  }
  .intro {
    padding-top: 18px;
  }
  .intro > p:last-child {
    font-size: 14px;
    max-width: 270px;
    margin: 12px auto 0;
  }
  .adventure-map {
    padding: 18px 12px 22px;
    border-radius: 90px 90px 30px 30px;
    margin-top: 15px;
  }
  .stages {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .stage-group {
    padding: 12px 10px;
    border-radius: 28px;
  }
  .stage-group h2 {
    font-size: 22px;
    margin-bottom: 12px;
  }
  .stage-pair {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .stage {
    min-height: 125px;
    border-radius: 28px;
    padding: 13px 12px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 4px 8px;
    text-align: left;
  }
  .stage-icon {
    grid-row: span 4;
    font-size: 43px;
  }
  .stage strong {
    font-size: 21px;
  }
  .stage-state {
    font-size: 12px;
    padding: 5px 10px;
    justify-self: start;
  }
  .tree {
    font-size: 48px;
    left: -7px;
    top: -23px;
  }
  .rabbit {
    left: 1%;
    bottom: 24px;
    font-size: 40px;
  }
  .picnic {
    right: 1%;
    top: 84px;
    bottom: auto;
    font-size: 35px;
  }
  .collection {
    font-size: 16px;
  }
  .play-top {
    font-size: 14px;
    gap: 5px;
  }
  .steps {
    margin: 16px 0;
  }
  .objects {
    padding: 14px 10px;
    gap: 8px;
  }
  .token {
    width: 48px;
    height: 48px;
    font-size: 29px;
    border-radius: 12px;
  }
  .tokens {
    gap: 7px;
  }
  .pile.given {
    padding-right: 9px;
  }
  .pile-label {
    font-size: 13px;
  }
  .operator {
    font-size: 25px;
  }
  .answers {
    gap: 12px;
  }
  .answer {
    width: 29%;
    max-width: 108px;
    min-height: 72px;
    font-size: 34px;
  }
  .equation {
    font-size: 29px;
  }
  .badge {
    flex-basis: 83px;
    width: 83px;
    height: 83px;
    font-size: 12px;
  }
  .badges {
    max-width: 390px;
    gap: 12px;
  }
  .reward-art {
    font-size: 70px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.ten-groups {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.ten-group {
  display: grid;
  grid-template-columns: repeat(5, 48px);
  gap: 6px;
  padding: 8px;
  border: 2px solid #d5b766;
  border-radius: 16px;
  background: #fff8db;
}
.ten-group .token {
  width: 48px;
  height: 48px;
  font-size: 28px;
}
@media (max-width: 740px) {
  .objects.advanced {
    flex-direction: column;
    align-items: stretch;
  }
  .advanced .pile.given {
    padding: 0 0 14px;
    border-right: 0;
    border-bottom: 2px dashed #bdceae;
  }
  .advanced .operator {
    font-size: 24px;
  }
  .parts {
    flex-direction: column;
    gap: 8px;
  }
}
@media (max-width: 380px) {
  .ten-group {
    gap: 2px;
    padding: 4px;
  }
  .missing .whole > .pile,
  .missing .parts > .pile {
    padding: 12px 0;
  }
  .equation {
    letter-spacing: 3px;
  }
}

.place-value {
  display: grid;
  gap: 12px;
}
.value-section {
  padding: 10px 8px;
  border: 2px solid #d5b766;
  border-radius: 18px;
  background: #fff8db;
}
.value-label {
  margin-bottom: 10px;
  text-align: center;
  color: #6f6036;
  font-size: 13px;
  font-weight: 700;
}
.value-tokens {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
}
.ten-token {
  border: 2px solid #c49c3f;
  border-radius: 10px;
  background: repeating-linear-gradient(90deg, #f9dc79 0 9px, #efd070 9px 11px);
  font-size: 25px;
  font-weight: 900;
  color: #57431d;
  text-shadow: 0 1px #fffbe7;
}
.ten-token.counted {
  background: #dceeca;
  border-color: #528840;
}
.grouped .pile-label {
  font-weight: 700;
}
.grouped .parts > .pile {
  flex-basis: 0;
}
@media (max-width: 600px) {
  .value-section {
    padding: 10px 6px;
  }
  .value-tokens {
    gap: 8px;
  }
  .ten-token {
    font-size: 23px;
  }
}
