/* ==========================================================================
   数学小岛：数一数 / 比大小
   ========================================================================== */
.math-game {
  gap: clamp(10px, 1.8vh, 18px);
}
.math-top {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: none;
}
.math-heading {
  display: grid;
  gap: 1px;
}
.math-heading h1 {
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.1;
}
.math-heading span {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
}
.math-top .learn__dots {
  flex: 1;
}

.math-prompt {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-s);
  flex: none;
}
.math-prompt img {
  width: 52px;
  height: 52px;
  flex: none;
}
.math-prompt__text {
  display: grid;
  gap: 1px;
  flex: 1;
  min-width: 0;
}
.math-prompt__text b {
  font-size: clamp(20px, 2.4vw, 28px);
}
.math-prompt__text span {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
}
.math-prompt .icon-btn {
  width: 54px;
  height: 54px;
  flex: none;
}

.math-stage {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
}
.math-card-stage {
  width: min(680px, 92vw);
  min-height: clamp(220px, 34vh, 340px);
  display: grid;
  place-items: center;
  padding: clamp(16px, 2.4vw, 30px);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-l);
}
.math-count-group {
  display: grid;
  grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr));
  gap: clamp(6px, 1.2vw, 14px);
  justify-items: center;
  align-items: center;
  width: 100%;
  max-width: 540px;
}
.math-count-group img {
  width: 100%;
  max-width: clamp(46px, 7.4vh, 86px);
  height: auto;
  filter: drop-shadow(0 5px 7px rgba(90, 74, 60, 0.16));
  animation: pop-in 0.4s var(--ease-out) both;
}

.math-num-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 1.6vw, 18px);
  width: min(760px, 94vw);
  margin: 0 auto;
}
.math-num {
  min-height: clamp(78px, 11vh, 108px);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: 0 5px 0 rgba(94, 78, 110, 0.09), 0 14px 26px rgba(94, 78, 110, 0.09);
  font-family: "Nunito", sans-serif;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 900;
  color: var(--ink);
  transition: transform var(--fast) var(--ease), background var(--fast);
}
.math-num:active { transform: translateY(4px); }
.math-num.is-right {
  background: linear-gradient(180deg, #d8f5e6, #b6e9cf);
  box-shadow: 0 5px 0 #7cc3a1, 0 14px 26px rgba(94, 78, 110, 0.1);
}
.math-num.is-wrong {
  background: #fdf1ee;
  animation: wobble 0.5s var(--ease);
}

.math-options {
  flex: none;
  display: grid;
  place-items: center;
  min-height: 90px;
}
.math-compare-hint {
  font-size: var(--f-body);
  color: var(--muted);
  font-weight: 700;
}

.math-compare {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: clamp(8px, 1.6vw, 20px);
  align-items: center;
  width: min(880px, 94vw);
}
.math-side {
  min-height: clamp(220px, 34vh, 320px);
  padding: clamp(12px, 2vw, 22px);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-l);
  display: grid;
  place-items: center;
  transition: transform var(--fast), background var(--fast);
}
.math-side:active { transform: scale(0.98); }
.math-side.is-right {
  background: linear-gradient(180deg, #e5f8ee, #cdf0dd);
  box-shadow: 0 0 0 5px rgba(110, 199, 159, 0.35), var(--shadow-l);
}
.math-side.is-wrong {
  background: #fdf1ee;
  animation: wobble 0.5s var(--ease);
}
.math-side .math-count-group {
  max-width: 300px;
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  gap: clamp(4px, 0.8vw, 9px);
}
.math-side .math-count-group img {
  max-width: clamp(34px, 5.4vh, 58px);
}
.math-vs-badge {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-s);
  font-family: "Nunito", sans-serif;
  font-size: 26px;
  font-weight: 900;
  color: var(--muted);
}

.math-feedback {
  position: fixed;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-m);
  animation: pop-in 0.3s var(--ease-out) both;
}
.math-feedback b { font-size: 19px; }
.math-feedback.is-good { color: var(--green-deep); background: #e7f8ef; }
.math-feedback.is-soft { color: #8a6a1d; background: #fff7e4; }

/* 首页数学卡里的图形 */
.math-dots {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}
.math-dots i {
  width: clamp(10px, 1.3vw, 14px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ef8c7c;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}
.math-dots--few i { background: #7cc1e8; }
.math-vs {
  font-family: "Nunito", sans-serif;
  font-size: 20px;
  font-weight: 900;
  color: var(--muted);
  margin: 0 4px;
}

@media (orientation: portrait) {
  .math-num-options { grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(520px, 94vw); }
  .math-compare { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .math-side { min-height: 190px; padding: 10px; }
  .math-side .math-count-group { gap: 4px; }
  .math-side .math-count-group img { max-width: 38px; }
  .math-card-stage { min-height: 260px; }
}
