:root {
  --ink: #18324a;
  --muted: #5a7188;
  --paper: #ffffff;
  --line: rgba(24, 50, 74, .16);
  --shadow: 0 18px 38px rgba(24, 50, 74, .16);
  --blue: #2878ff;
  --green: #16a36a;
  --sun: #ffba3a;
  --rose: #ff6b8a;
  --violet: #805ad5;
  --radius: 8px;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, .94) 0 4%, transparent 5%),
    radial-gradient(circle at 88% 9%, rgba(255, 255, 255, .86) 0 3%, transparent 4%),
    linear-gradient(180deg, #bfeeff 0%, #fff3b8 100%);
  overflow-x: hidden;
}

button, input { font: inherit; }

a { color: inherit; }

summary { cursor: pointer; }

.theme-plus { background: linear-gradient(180deg, #c8f7d6 0%, #fff6c8 100%); }
.theme-times { background: linear-gradient(180deg, #d7ecff 0%, #fff1d7 100%); }
.theme-divide { background: linear-gradient(180deg, #cdefff 0%, #e6f8d8 100%); }
.theme-mix { background: linear-gradient(180deg, #ffe0ed 0%, #dff3ff 100%); }

.theme-plus.animated-page {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(circle at 16% 10%, rgba(255, 242, 168, .62) 0 8rem, transparent 8.5rem),
    radial-gradient(circle at 86% 8%, rgba(255, 255, 255, .58) 0 6rem, transparent 6.5rem),
    linear-gradient(180deg, #f6fff7 0%, #ddfbdf 46%, #c9f1c2 100%);
}

.theme-plus.animated-page::before,
.theme-plus.animated-page::after {
  content: "";
  position: fixed;
  left: -8vw;
  right: -8vw;
  bottom: 0;
  pointer-events: none;
  z-index: -1;
}

.theme-plus.animated-page::before {
  height: 34vh;
  background:
    radial-gradient(ellipse at 18% 100%, rgba(94, 190, 105, .28) 0 30%, transparent 31%),
    radial-gradient(ellipse at 58% 100%, rgba(77, 171, 93, .24) 0 34%, transparent 35%),
    radial-gradient(ellipse at 92% 100%, rgba(116, 207, 128, .22) 0 28%, transparent 29%);
  animation: meadowBreathe 9s ease-in-out infinite;
  transform-origin: bottom center;
}

.theme-plus.animated-page::after {
  height: 16vh;
  background-image:
    linear-gradient(105deg, transparent 0 48%, rgba(55, 134, 69, .2) 49% 51%, transparent 52% 100%),
    linear-gradient(78deg, transparent 0 47%, rgba(55, 134, 69, .16) 48% 50%, transparent 51% 100%);
  background-size: 38px 100%, 52px 100%;
  opacity: .38;
  animation: grassSway 5.5s ease-in-out infinite alternate;
}

.sky-shape {
  position: fixed;
  width: 180px;
  height: 54px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  pointer-events: none;
  animation: drift 24s linear infinite;
  z-index: 0;
}

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

.sky-shape::before { width: 72px; height: 72px; left: 28px; top: -34px; }
.sky-shape::after { width: 58px; height: 58px; right: 28px; top: -24px; }
.sky-shape.one { left: -220px; top: 110px; }
.sky-shape.two { left: -280px; top: 280px; animation-duration: 32s; animation-delay: 6s; }

@keyframes drift {
  to { transform: translateX(calc(100vw + 320px)); }
}

@keyframes meadowBreathe {
  0%, 100% { transform: scaleY(1) translateY(0); }
  50% { transform: scaleY(1.04) translateY(4px); }
}

@keyframes grassSway {
  from { transform: translateX(-8px) skewX(-1.5deg); }
  to { transform: translateX(8px) skewX(1.5deg); }
}

@keyframes rippleOut {
  to { opacity: 0; transform: translate(-50%, -50%) scale(18); }
}

@keyframes cardShine {
  0% { opacity: 0; transform: translateX(-45%) rotate(0deg); }
  35% { opacity: .42; }
  100% { opacity: 0; transform: translateX(45%) rotate(12deg); }
}

@keyframes shadowBreathe {
  0%, 100% { opacity: .5; transform: translateX(-50%) scaleX(1); }
  50% { opacity: .32; transform: translateX(-50%) scaleX(.86); }
}

@keyframes problemPop {
  0% { opacity: 0; transform: translateY(14px) scale(.84) rotate(-1deg); }
  62% { opacity: 1; transform: translateY(-4px) scale(1.06) rotate(1deg); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}

@keyframes feedbackPop {
  from { opacity: .55; transform: translateY(8px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes visualTwinkle {
  from { transform: translateY(0); opacity: .34; }
  to { transform: translateY(-7px); opacity: .66; }
}

@keyframes softRise {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes hintOpen {
  from { opacity: 0; transform: translateY(-8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes floatSymbol {
  from { transform: translate3d(0, 0, 0) rotate(-6deg); }
  to { transform: translate3d(var(--dx), var(--dy), 0) rotate(6deg); }
}

@keyframes burstDot {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(.35); }
  34% { opacity: 1; transform: translate(calc(-50% + var(--tx-mid)), calc(-50% + var(--ty-mid))) scale(1.25); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(.6); }
}

@keyframes burstStar {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.35) rotate(0deg); }
  22% { opacity: 1; transform: translate(calc(-50% + var(--tx-star)), calc(-50% + var(--ty-star))) scale(1.18) rotate(var(--rot)); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(.72) rotate(var(--rot)); }
}

@keyframes heroStar {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.28) rotate(-18deg); }
  34% { opacity: 1; transform: translate(-50%, -50%) scale(1.22) rotate(8deg); }
  58% { opacity: 1; transform: translate(-50%, -50%) scale(.96) rotate(-4deg); }
  82% { opacity: .92; transform: translate(-50%, -62%) scale(1.04) rotate(4deg); }
  100% { opacity: 0; transform: translate(-50%, -92%) scale(.62) rotate(18deg); }
}

@keyframes statPulse {
  0% { transform: scale(1); }
  42% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: min(1120px, 94vw);
  margin: 0 auto;
  padding: 18px 0 0;
}

.home-link,
.icon-btn {
  display: inline-grid;
  place-items: center;
  min-width: 76px;
  height: 48px;
  padding: 0 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 5px 0 rgba(24, 50, 74, .16);
  text-decoration: none;
  font-weight: 900;
}

.icon-btn {
  cursor: pointer;
  font-size: 1rem;
}

.map-hero,
.world-header {
  position: relative;
  z-index: 1;
}

.hero-grid {
  width: min(1120px, 94vw);
  margin: 0 auto;
  padding: 26px 0 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 10px;
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  border: 2px solid rgba(24, 50, 74, .12);
  font-weight: 900;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 5.4rem);
  line-height: .95;
  letter-spacing: 0;
  text-shadow: 3px 3px 0 rgba(255, 255, 255, .84);
}

.hero-copy {
  max-width: 720px;
  margin: 14px 0 0;
  font-size: clamp(1.05rem, 2.2vw, 1.32rem);
  line-height: 1.45;
  color: #28445d;
}

.profile-panel,
.game-panel,
.result-panel {
  background: rgba(255, 255, 255, .9);
  border: 2px solid rgba(255, 255, 255, .8);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.profile-panel {
  padding: 18px;
}

.profile-panel label,
.field label {
  display: block;
  margin-bottom: 7px;
  font-weight: 900;
}

.profile-panel input,
.answer-input,
.field input {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 13px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.profile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.profile-stats div,
.stat-box {
  padding: 12px;
  border-radius: var(--radius);
  background: #fff7d6;
  border: 2px solid rgba(24, 50, 74, .12);
  text-align: center;
}

.profile-stats strong,
.stat-box strong {
  display: block;
  font-size: 1.6rem;
}

.profile-stats span,
.stat-box span {
  display: block;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 800;
}

.world-map {
  position: relative;
  z-index: 1;
  width: min(1120px, 94vw);
  margin: 8px auto 42px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.world-card {
  position: relative;
  min-height: 310px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border-radius: var(--radius);
  border: 3px solid rgba(255, 255, 255, .86);
  box-shadow: 0 12px 0 rgba(24, 50, 74, .12), var(--shadow);
  text-decoration: none;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}

.world-card:hover,
.world-card:focus-visible {
  transform: translateY(-7px);
  box-shadow: 0 18px 0 rgba(24, 50, 74, .12), 0 24px 42px rgba(24, 50, 74, .18);
  outline: none;
}

.world-card::after {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  right: -52px;
  bottom: -62px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .34);
}

.world-card.plus { background: linear-gradient(135deg, #7ee6a7, #fff0a8); }
.world-card.times { background: linear-gradient(135deg, #9fd6ff, #ffd59a); }
.world-card.divide { background: linear-gradient(135deg, #94e6ff, #b6f0a8); }
.world-card.mix { background: linear-gradient(135deg, #ff9fc0, #a9d8ff); }
.world-card.geometry { background: linear-gradient(135deg, #b7f7ff, #d8ffad); }

.world-symbol {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .86);
  border: 3px solid rgba(24, 50, 74, .12);
  font-size: 3.3rem;
  font-weight: 950;
  animation: bob 2.3s ease-in-out infinite;
}

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

.world-card h2 {
  margin: 0;
  font-size: 1.55rem;
}

.world-card p {
  margin: 0;
  line-height: 1.35;
  font-weight: 700;
}

.world-pill,
.world-progress,
.mode-pill {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  border-radius: 999px;
  padding: 8px 11px;
  background: rgba(255, 255, 255, .75);
  border: 2px solid rgba(24, 50, 74, .12);
  font-weight: 900;
}

.world-progress {
  margin-top: auto;
  color: #25435b;
}

.world-actions,
.path-switch {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.path-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 13px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 950;
  box-shadow: 0 5px 0 rgba(24, 50, 74, .14);
}

.path-btn.learn { background: #fff; }
.path-btn.practice { background: var(--blue); color: #fff; }

.world-page {
  position: relative;
  z-index: 1;
  width: min(1120px, 94vw);
  margin: 14px auto 42px;
  display: grid;
  gap: 16px;
}

.world-title {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  width: min(1120px, 94vw);
  margin: 0 auto;
  padding: 24px 0 10px;
}

.title-mark {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: #fff;
  border: 3px solid rgba(24, 50, 74, .14);
  font-size: 3.7rem;
  font-weight: 950;
  box-shadow: var(--shadow);
}

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

.field {
  background: rgba(255, 255, 255, .72);
  border: 2px solid rgba(255, 255, 255, .84);
  border-radius: var(--radius);
  padding: 12px;
}

.game-panel {
  padding: 18px;
}

.teacher-panel {
  background: rgba(255, 255, 255, .62);
  border: 2px dashed rgba(24, 50, 74, .18);
  border-radius: var(--radius);
  padding: 9px 11px;
}

.teacher-panel summary {
  font-weight: 900;
  color: #314f68;
}

.teacher-panel .control-grid {
  margin-top: 10px;
}

.learn-board {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 16px;
  align-items: stretch;
}

.explain-card {
  background: rgba(255, 255, 255, .9);
  border: 2px solid rgba(255, 255, 255, .84);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.explain-card h2 {
  margin: 0 0 10px;
  font-size: 1.45rem;
}

.explain-card p {
  margin: 8px 0;
  line-height: 1.45;
  font-weight: 750;
}

.example-controls {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.operation-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.operation-btn {
  min-height: 74px;
  border: 2px solid rgba(24, 50, 74, .14);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 6px 0 rgba(24, 50, 74, .12);
  cursor: pointer;
  text-align: left;
}

.operation-btn strong,
.operation-btn span {
  display: block;
}

.operation-btn strong {
  font-size: 1.18rem;
  line-height: 1.1;
}

.operation-btn span {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 900;
}

.operation-btn.active {
  background: #1f2d3d;
  color: #fff;
}

.operation-btn.active span {
  color: #dceeff;
}

.mix-sign-choice {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mix-sign-choice .operation-btn {
  text-align: center;
  min-height: 112px;
  display: grid;
  place-items: center;
  gap: 4px;
  align-content: center;
}

.mix-sign-choice .operation-btn strong {
  font-size: clamp(2.6rem, 6vw, 4.5rem);
  line-height: .85;
}

.mix-sign-choice .operation-btn span {
  font-size: .92rem;
}

.mix-rule-card {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #fff7fb, #eef8ff);
  border: 2px solid rgba(120, 159, 255, .34);
  color: #284866;
  font-weight: 850;
  box-shadow: 0 10px 24px rgba(47, 75, 128, .08);
}

.mix-rule-card strong,
.mix-rule-card span {
  display: block;
}

.mix-rule-card strong {
  color: #7b3fc9;
  font-weight: 950;
}

.mix-rule-card span {
  margin-top: 4px;
  line-height: 1.38;
}

.mix-lab-visual {
  min-height: 430px;
}

.number-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field label span {
  float: right;
  min-width: 34px;
  border-radius: 999px;
  padding: 2px 8px;
  background: #fff;
  color: #1d4ed8;
  text-align: center;
}

.big-example {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  align-items: baseline;
  font-size: clamp(2.5rem, 8vw, 5.6rem);
  font-weight: 950;
  line-height: 1;
  padding: 20px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #f3fbff);
  border: 2px dashed rgba(24, 50, 74, .18);
}

.teacher-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .88rem;
}

.teacher-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.teacher-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.teacher-field {
  display: grid;
  gap: 6px;
  padding: 8px 9px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .78);
  border: 2px solid rgba(24, 50, 74, .12);
  font-weight: 900;
}

.teacher-field > span {
  font-size: .92rem;
}

.option-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.option-buttons button {
  min-height: 34px;
  border: 2px solid rgba(24, 50, 74, .12);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  padding: 7px 9px;
  font-size: .9rem;
}

.option-buttons button.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.kid-options button {
  min-height: 42px;
}

.practice-controls .field {
  display: grid;
  align-content: start;
  gap: 8px;
}

.animated-page .home-link,
.animated-page .icon-btn,
.animated-page .path-btn,
.animated-page .btn,
.animated-page .choice-btn,
.animated-page .avatar-buttons button,
.animated-page .option-buttons button {
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.animated-page .home-link:hover,
.animated-page .icon-btn:hover,
.animated-page .path-btn:hover,
.animated-page .btn:hover,
.animated-page .choice-btn:hover,
.animated-page .avatar-buttons button:hover,
.animated-page .option-buttons button:hover {
  filter: saturate(1.06);
}

.animated-page .answer-input {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.animated-page .answer-input:focus {
  transform: scale(1.02);
  box-shadow: 0 0 0 4px rgba(47, 158, 68, .16), 0 12px 26px rgba(24, 50, 74, .12);
  outline: none;
}

.animated-page .pm-ripple {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .58);
  transform: translate(-50%, -50%) scale(0);
  animation: rippleOut .52s ease-out forwards;
  pointer-events: none;
}

.teacher-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .78);
  border: 2px solid rgba(24, 50, 74, .12);
  font-weight: 900;
}

.teacher-check input {
  width: 20px;
  height: 20px;
  accent-color: var(--blue);
}

.task-board {
  min-height: 320px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: stretch;
}

.animated-page .task-board {
  position: relative;
  overflow: hidden;
}

.animated-page .task-board::before {
  content: "";
  position: absolute;
  inset: -42%;
  background: conic-gradient(from 180deg, transparent, rgba(255, 255, 255, .48), transparent 28%);
  opacity: 0;
  pointer-events: none;
}

.animated-page .task-board.board-glow::before {
  animation: cardShine .85s ease-out both;
}

.problem-zone {
  display: grid;
  place-items: center;
  min-height: 280px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #f2fbff);
  border: 2px dashed rgba(24, 50, 74, .18);
  padding: 18px;
}

.animated-page .problem-zone {
  position: relative;
}

.animated-page .problem-zone::after {
  content: "";
  position: absolute;
  width: min(18rem, 70%);
  height: 2rem;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(40, 120, 52, .14), transparent 70%);
  filter: blur(5px);
  pointer-events: none;
  animation: shadowBreathe 3s ease-in-out infinite;
}

.problem {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: clamp(3rem, 10vw, 6.4rem);
  font-weight: 950;
  line-height: 1;
}

.animated-page .problem {
  position: relative;
  z-index: 1;
  text-shadow: 0 4px 0 rgba(255, 255, 255, .55);
  transform-origin: center;
}

.animated-page .problem.problem-pop {
  animation: problemPop .52s cubic-bezier(.2, .9, .28, 1.2) both;
}

.answer-box {
  display: grid;
  gap: 12px;
  align-content: center;
}

.answer-input {
  min-height: 64px;
  text-align: center;
  font-size: 2rem;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  min-height: 48px;
  border: 0;
  border-radius: var(--radius);
  padding: 12px 15px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 5px 0 rgba(24, 50, 74, .14);
  cursor: pointer;
  font-weight: 950;
}

.btn.primary { background: var(--blue); color: #fff; }
.btn.good { background: var(--green); color: #fff; }
.btn.warm { background: var(--sun); color: #392400; }

.btn:hover,
.icon-btn:hover {
  transform: translateY(-2px);
}

.btn:active,
.icon-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(24, 50, 74, .14);
}

.feedback {
  min-height: 72px;
  border-radius: var(--radius);
  padding: 14px;
  background: #f3f8ff;
  border: 2px solid rgba(24, 50, 74, .12);
  font-weight: 900;
}

.feedback.good { background: #e9fff2; color: #0f6b3e; }
.feedback.bad { background: #fff0f0; color: #a32424; }

.animated-page .feedback {
  transform-origin: center;
  transition: background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.animated-page .feedback.feedback-pop {
  animation: feedbackPop .42s ease both;
}

.animated-page .feedback.feedback-ok {
  background: linear-gradient(135deg, rgba(213, 250, 221, .96), rgba(184, 243, 199, .9));
  box-shadow: 0 12px 24px rgba(47, 179, 68, .16);
}

.animated-page .feedback.feedback-warn {
  background: linear-gradient(135deg, rgba(255, 244, 219, .96), rgba(255, 230, 156, .88));
  box-shadow: 0 12px 24px rgba(255, 183, 3, .14);
}

.visual-area {
  min-height: 180px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .74);
  border: 2px solid rgba(24, 50, 74, .12);
  padding: 14px;
  overflow: auto;
}

.practice-visual,
.hint-panel {
  overflow: hidden;
}

.animated-page .practice-visual,
.animated-page .hint-panel {
  position: relative;
}

.animated-page .practice-visual::before,
.animated-page .hint-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 25%, rgba(255, 255, 255, .5) 0 3px, transparent 4px),
    radial-gradient(circle at 72% 18%, rgba(255, 255, 255, .45) 0 2px, transparent 4px),
    radial-gradient(circle at 88% 72%, rgba(255, 255, 255, .42) 0 3px, transparent 5px);
  opacity: .48;
  pointer-events: none;
  animation: visualTwinkle 4s ease-in-out infinite alternate;
}

.animated-page .practice-visual > *,
.animated-page .hint-panel > * {
  animation: softRise .38s ease both;
}

.animated-page .hint-panel:not([hidden]) {
  animation: hintOpen .36s ease both;
}

.hint-panel {
  border-color: rgba(22, 163, 106, .32);
  background: linear-gradient(180deg, #f1fff6, #ffffff);
}

.practice-picture {
  min-height: 190px;
  display: grid;
  align-content: center;
  gap: 14px;
}

.practice-token-row {
  justify-content: center;
  gap: 8px;
}

.practice-token-frame {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  display: grid;
  gap: 12px;
  padding: 12px;
  box-sizing: border-box;
  border: 4px solid transparent;
  border-radius: var(--radius);
  position: relative;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.practice-token-frame.show-frame {
  border-color: #16a36a;
  background: rgba(233, 255, 242, .68);
  box-shadow: 0 0 0 8px rgba(22, 163, 106, .1);
}

.practice-token-frame.show-frame::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  bottom: -20px;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 999px;
  background: #e9fff2;
  border: 2px solid rgba(22, 163, 106, .3);
  color: #0f6b3e;
  font-size: .88rem;
  font-weight: 950;
  white-space: nowrap;
}

.practice-equation {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 8px;
  color: #29445c;
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 950;
}

.practice-answer {
  min-width: 42px;
  display: inline-grid;
  place-items: center;
  padding: 5px 10px;
  border-radius: var(--radius);
  background: #fff7d6;
  border: 2px solid rgba(255, 186, 58, .44);
}

.hidden-answer {
  color: #6b7f91;
  background: #f3f8ff;
  border-color: rgba(24, 50, 74, .14);
}

.visual-heading {
  margin-top: 18px;
}

.visual-heading h2 {
  margin-bottom: 12px;
}

.visual-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.visual-tabs button {
  min-height: 48px;
  border: 0;
  border-radius: var(--radius);
  padding: 11px 15px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(24, 50, 74, .09);
  cursor: pointer;
  font-weight: 950;
}

.visual-tabs button.active {
  background: #1f2d3d;
  color: #fff;
}

.big-visual-area {
  min-height: 370px;
  background: linear-gradient(180deg, #f8fbff, #fff);
  border: 2px dashed #c8d8e8;
  position: relative;
  overflow: hidden;
}

.dot-grid {
  display: grid;
  --dot-size: clamp(24px, 6.5vw, 30px);
  --dot-gap: clamp(5px, 1.4vw, 8px);
  gap: var(--dot-gap);
  justify-content: center;
  align-content: center;
  min-height: 150px;
  max-width: 100%;
}

.math-dot {
  width: var(--dot-size);
  height: var(--dot-size);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #55a8ff, #2878ff);
  box-shadow: 0 4px 0 rgba(40, 120, 255, .18);
  animation: pop .24s both;
}

.math-dot.subtracted {
  background: linear-gradient(135deg, #ff9aa8, #e84d64);
  opacity: .52;
  transform: scale(.82);
  box-shadow: none;
}

.group-line {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: center;
  align-items: center;
  min-height: 150px;
}

.group-chip {
  min-width: 42px;
  padding: 10px;
  border-radius: var(--radius);
  text-align: center;
  background: #fff7d6;
  border: 2px solid rgba(255, 186, 58, .4);
  font-weight: 950;
  animation: pop .24s both;
}

.pm-token-board {
  min-height: 300px;
  display: grid;
  align-content: center;
  gap: 22px;
  position: relative;
}

.pm-token-row {
  --token-size: clamp(30px, 7vw, 40px);
  --token-gap: clamp(6px, 1.6vw, 10px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--token-gap);
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.pm-token-row.structured {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--token-size), var(--token-size)));
  gap: var(--token-gap);
  justify-content: center;
  width: 100%;
}

.pm-token-row.structured .pm-break {
  display: none;
}

.pm-result-frame {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 14px;
  box-sizing: border-box;
  border: 4px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  box-shadow: 0 0 0 0 rgba(22, 163, 106, 0);
  position: relative;
  animation: remainingFrame 3.4s ease-in-out infinite both;
}

.pm-result-frame.addition-frame {
  display: grid;
  gap: 14px;
  justify-items: center;
}

.pm-result-frame::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  bottom: -20px;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 999px;
  background: #e9fff2;
  border: 2px solid rgba(22, 163, 106, .3);
  color: #0f6b3e;
  font-size: .88rem;
  font-weight: 950;
  white-space: nowrap;
  opacity: 0;
  animation: remainingLabel 3.4s ease-in-out infinite both;
}

.pm-token {
  width: var(--token-size);
  height: var(--token-size);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #57b7ff, #2878ff);
  color: #fff;
  font-weight: 950;
  box-shadow: 0 6px 0 rgba(40, 120, 255, .16);
  animation: pop .24s both;
}

.pm-token.base {
  animation: tokenSettle 2.8s ease-in-out infinite both;
}

.pm-token.add {
  background: linear-gradient(135deg, #6ee7a8, #16a36a);
  animation: tokenAddIn 3.4s ease-in-out infinite both;
}

.pm-token.take {
  background: linear-gradient(135deg, #ff9aa8, #e84d64);
  opacity: .92;
  text-decoration: line-through;
  animation: tokenTakeAway 3.4s ease-in-out infinite both;
}

.pm-visual-caption {
  text-align: center;
  color: #526b82;
  font-weight: 950;
  font-size: 1.08rem;
}

.pm-chain {
  min-height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pm-chain .chain-card {
  min-width: 78px;
  padding: 18px 16px;
  border-radius: var(--radius);
  background: #fff;
  border: 2px solid #d7e5f2;
  box-shadow: 0 8px 18px rgba(24, 50, 74, .08);
  text-align: center;
  font-size: 1.8rem;
  font-weight: 950;
  animation: pop .24s both;
}

.pm-chain .chain-card.mover {
  animation: chainMove 2.7s ease-in-out infinite both;
}

.pm-chain.minus .chain-card.mover {
  animation-name: chainMoveBack;
}

.pm-chain .chain-card.result {
  animation: cardPulse 2.7s ease-in-out infinite both;
}

.pm-chain .chain-op {
  font-size: 2rem;
  font-weight: 950;
  color: #2f5f91;
}

.pm-line {
  min-width: 560px;
  min-height: 300px;
  position: relative;
  padding: 92px 28px 42px;
}

.pm-line-base {
  position: absolute;
  left: 32px;
  right: 32px;
  top: 168px;
  height: 6px;
  border-radius: 999px;
  background: #cbd5e1;
}

.pm-line-base::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 50%;
  width: 14px;
  height: 14px;
  border-right: 6px solid #cbd5e1;
  border-top: 6px solid #cbd5e1;
  transform: translateY(-50%) rotate(45deg);
}

.pm-tick {
  position: absolute;
  top: 154px;
  width: 2px;
  height: 34px;
  background: #5c6f82;
}

.pm-tick span {
  position: absolute;
  top: 38px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 950;
  color: #334e68;
}

.pm-jump {
  position: absolute;
  top: 96px;
  height: 76px;
  border-top: 6px solid #2878ff;
  border-left: 6px solid #2878ff;
  border-right: 6px solid #2878ff;
  border-radius: 80px 80px 0 0;
  transform-origin: left bottom;
  animation: growJumpRight 2.8s ease-in-out infinite both;
}

.pm-jump.minus {
  border-color: #e84d64;
  transform-origin: right bottom;
  animation-name: growJumpLeft;
}

.pm-jump::after {
  content: "";
  position: absolute;
  right: -12px;
  bottom: -8px;
  width: 18px;
  height: 18px;
  border-right: 6px solid #2878ff;
  border-bottom: 6px solid #2878ff;
  transform: rotate(-45deg);
}

.pm-jump.minus::after {
  right: auto;
  left: -12px;
  border-color: #e84d64;
  transform: rotate(135deg);
}

.pm-jump span {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
  padding: 5px 10px;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 950;
}

.pm-jump.minus span {
  background: #ffe1e7;
  color: #bb2942;
}

.pm-line-start,
.pm-line-finish {
  position: absolute;
  top: 208px;
  transform: translateX(-50%);
  min-width: 34px;
  padding: 4px 8px;
  border-radius: 999px;
  text-align: center;
  font-weight: 950;
  background: #fff;
  border: 2px solid #cbd5e1;
}

.pm-line-start {
  color: #28445d;
}

.pm-line-finish {
  color: #0f7a4d;
  animation: resultPulse 2.8s ease-in-out infinite both;
}

.pm-line.minus .pm-line-finish {
  color: #bb2942;
}

@keyframes growJumpRight {
  0%, 12% { opacity: .08; transform: scaleX(.04); }
  45%, 78% { opacity: 1; transform: scaleX(1); }
  100% { opacity: .08; transform: scaleX(.04); }
}

@keyframes growJumpLeft {
  0%, 12% { opacity: .08; transform: scaleX(.04); }
  45%, 78% { opacity: 1; transform: scaleX(1); }
  100% { opacity: .08; transform: scaleX(.04); }
}

@keyframes pop {
  from { opacity: 0; transform: scale(.72); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes tokenSettle {
  0%, 100% { transform: translateY(0) scale(1); }
  45% { transform: translateY(-3px) scale(1.03); }
}

@keyframes tokenFlyIn {
  0%, 12% {
    opacity: 0;
    transform: translate(calc((var(--drift) * 28px) + 72px), -54px) scale(.66) rotate(8deg);
  }
  42%, 78% {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0);
  }
  100% {
    opacity: 0;
    transform: translate(calc(var(--drift) * 10px), 8px) scale(.92);
  }
}

@keyframes tokenAddIn {
  0%, 16% {
    opacity: 0;
    transform: translate(calc((var(--drift) * 28px) + 72px), -54px) scale(.66) rotate(8deg);
  }
  42%, 82% {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0);
  }
  83%, 100% {
    opacity: 0;
    transform: translate(0, 0) scale(1) rotate(0);
  }
}

@keyframes tokenTakeAway {
  0%, 34% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  62%, 82% {
    opacity: 0;
    transform: translate(calc((var(--drift) * 34px) - 92px), -58px) scale(.55) rotate(-18deg);
  }
  83%, 100% {
    opacity: 0;
    transform: translate(0, 0) scale(1);
  }
}

@keyframes remainingFrame {
  0%, 44% {
    border-color: transparent;
    background: transparent;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(22, 163, 106, 0);
  }
  58%, 82% {
    border-color: #16a36a;
    background: rgba(233, 255, 242, .58);
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(22, 163, 106, .1);
  }
  100% {
    border-color: transparent;
    background: transparent;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(22, 163, 106, 0);
  }
}

@keyframes remainingLabel {
  0%, 48% { opacity: 0; transform: translateX(-50%) translateY(4px); }
  60%, 82% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(4px); }
}

@keyframes chainMove {
  0%, 18% { transform: translateX(-32px) scale(.86); opacity: .35; }
  48%, 78% { transform: translateX(0) scale(1); opacity: 1; }
  100% { transform: translateX(18px) scale(.94); opacity: .35; }
}

@keyframes chainMoveBack {
  0%, 18% { transform: translateX(32px) scale(1); opacity: 1; }
  48%, 78% { transform: translateX(0) scale(.9); opacity: .45; }
  100% { transform: translateX(-34px) scale(.74); opacity: .12; }
}

@keyframes resultPulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  45%, 70% { transform: translateX(-50%) scale(1.12); }
}

@keyframes cardPulse {
  0%, 100% { transform: scale(1); }
  45%, 70% { transform: scale(1.12); }
}

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

.sparkle-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

.pm-floater {
  position: absolute;
  left: var(--x);
  top: var(--y);
  color: rgba(32, 117, 55, var(--o));
  font-size: var(--s);
  font-weight: 950;
  text-shadow: 0 2px 0 rgba(255, 255, 255, .45);
  user-select: none;
  animation: floatSymbol var(--d) ease-in-out var(--delay) infinite alternate;
}

.pm-burst-dot {
  position: fixed;
  left: var(--bx);
  top: var(--by);
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--bc);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .45);
  animation: burstDot 1.02s ease-out forwards;
  pointer-events: none;
  z-index: 21;
}

.pm-burst-star {
  position: fixed;
  left: var(--bx);
  top: var(--by);
  color: var(--bc);
  font-size: 1.35rem;
  font-weight: 950;
  text-shadow: 0 2px 0 rgba(255, 255, 255, .75), 0 0 18px rgba(255, 212, 59, .62);
  animation: burstStar 1.08s ease-out forwards;
  pointer-events: none;
  z-index: 22;
}

.pm-star-hero {
  position: fixed;
  color: #ffd43b;
  font-size: clamp(3.6rem, 9vw, 5.4rem);
  line-height: 1;
  text-shadow:
    0 4px 0 rgba(111, 74, 0, .18),
    0 0 18px rgba(255, 212, 59, .86),
    0 0 34px rgba(255, 183, 3, .46);
  transform: translate(-50%, -50%);
  animation: heroStar 1.08s cubic-bezier(.18, .9, .22, 1.25) forwards;
  pointer-events: none;
  z-index: 23;
}

.pm-star-hero.big {
  font-size: clamp(4.6rem, 12vw, 7rem);
  animation-duration: 1.38s;
}

.animated-page .stat-box.pm-stat-pulse {
  animation: statPulse .48s ease both;
}

.sparkle {
  position: absolute;
  font-size: 1.8rem;
  animation: sparkleFly .9s ease-out forwards;
}

@keyframes sparkleFly {
  from { opacity: 0; transform: translate(-50%, -10%) scale(.55); }
  35% { opacity: 1; transform: translate(-50%, -80%) scale(1.15); }
  to { opacity: 0; transform: translate(-50%, -170%) scale(.9); }
}

.times-fact-card {
  margin-top: 14px;
  padding: 13px;
  border-radius: var(--radius);
  background: #f8fafc;
  border: 2px solid rgba(24, 50, 74, .1);
  color: #2d4861;
  font-weight: 800;
  line-height: 1.45;
}

.times-array {
  display: grid;
  --times-dot-size: clamp(24px, 6.5vw, 38px);
  --times-dot-gap: clamp(5px, 1.4vw, 8px);
  grid-template-columns: repeat(var(--times-cols, 3), var(--times-dot-size));
  gap: var(--times-dot-gap);
  justify-content: center;
  align-content: center;
  min-height: 250px;
  padding: 12px;
  max-width: 100%;
}

.times-dot {
  width: var(--times-dot-size);
  height: var(--times-dot-size);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #60a5fa, #2878ff);
  border: 2px solid rgba(255, 255, 255, .72);
  box-shadow: 0 8px 15px rgba(40, 120, 255, .18);
  animation: timesDotPop .34s cubic-bezier(.18, .9, .22, 1.25) both;
}

.times-dot.alt {
  background: linear-gradient(135deg, #6ee7a8, #16a36a);
  box-shadow: 0 8px 15px rgba(22, 163, 106, .18);
}

.times-dot.quiet {
  background: linear-gradient(135deg, #b8c7d8, #6e8399);
  box-shadow: 0 8px 15px rgba(49, 79, 104, .14);
}

.times-dot.small {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.times-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  align-items: flex-start;
  min-height: 250px;
  padding: 8px;
}

.times-group {
  min-width: 98px;
  padding: 12px;
  border-radius: var(--radius);
  background: #fff8e8;
  border: 2px solid #fed7aa;
  box-shadow: 0 12px 20px rgba(92, 63, 0, .08);
  animation: timesGroupRise .38s ease both;
}

.times-group-title {
  margin-bottom: 8px;
  color: #6b4a00;
  font-size: .84rem;
  font-weight: 950;
  text-align: center;
}

.times-group-dots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(28px, 1fr));
  gap: 6px;
  justify-items: center;
}

.times-addition {
  min-height: 250px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.45rem, 4vw, 2.25rem);
  font-weight: 950;
  color: #2d4861;
}

.times-add-chip {
  padding: 10px 14px;
  border-radius: var(--radius);
  background: #eef6ff;
  border: 2px solid #bfdbfe;
  color: #1d4ed8;
  box-shadow: 0 8px 15px rgba(29, 78, 216, .1);
  animation: timesDotPop .3s cubic-bezier(.18, .9, .22, 1.25) both;
}

.times-add-chip.result {
  background: #fff7d6;
  border-color: rgba(255, 186, 58, .55);
  color: #5b3a00;
  box-shadow: 0 10px 20px rgba(255, 186, 58, .16);
}

.times-line {
  position: relative;
  width: min(100%, 560px);
  min-width: 0;
  height: 210px;
  margin: 28px auto 0;
}

.times-line-base {
  position: absolute;
  left: 0;
  right: 0;
  top: 108px;
  height: 6px;
  border-radius: 999px;
  background: #cbd5e1;
}

.times-line-tick {
  position: absolute;
  top: 92px;
  width: 2px;
  height: 32px;
  background: #64748b;
}

.times-line-tick span {
  position: absolute;
  top: 34px;
  left: 50%;
  transform: translateX(-50%);
  color: #2d4861;
  font-size: .9rem;
  font-weight: 900;
}

.times-line-jump {
  position: absolute;
  top: 42px;
  height: 70px;
  border-top: 5px solid #2878ff;
  border-left: 5px solid #2878ff;
  border-right: 5px solid #2878ff;
  border-radius: 60px 60px 0 0;
  transform-origin: left bottom;
  animation: timesJumpDraw .58s ease both;
}

.times-line-jump span {
  position: absolute;
  left: 50%;
  top: -28px;
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 950;
}

.times-swap {
  width: max-content;
  max-width: 100%;
  margin: 12px auto 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: #eef6ff;
  border: 2px solid #bfdbfe;
  color: #1d4ed8;
  font-weight: 950;
}

.times-control-grid {
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
}

.compact-options {
  gap: 6px;
}

.compact-options button {
  min-width: 42px;
  padding-inline: 10px;
}

.avatar-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.avatar-group {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .72);
  border: 2px solid rgba(255, 255, 255, .84);
}

.avatar-label {
  color: #314f68;
  font-weight: 950;
}

.avatar-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.avatar-buttons button {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  border: 2px solid rgba(24, 50, 74, .12);
  background: #fff;
  font-size: 1.7rem;
  box-shadow: 0 5px 0 rgba(24, 50, 74, .12);
  cursor: pointer;
}

.avatar-buttons button.active {
  border-color: #2878ff;
  background: #eef6ff;
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(24, 50, 74, .12);
}

.star-field {
  margin: 0;
}

.player-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.player-card {
  padding: 13px;
  border-radius: var(--radius);
  background: #f8fafc;
  border: 2px solid rgba(24, 50, 74, .1);
  display: grid;
  gap: 6px;
  color: #314f68;
}

.player-card.active {
  background: #eef6ff;
  border-color: #93c5fd;
  box-shadow: 0 10px 22px rgba(40, 120, 255, .12);
}

.mini-progress {
  height: 10px;
  border-radius: 999px;
  background: #dbe6f1;
  overflow: hidden;
}

.mini-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa, #2878ff);
  transition: width .28s ease;
}

.round-label {
  margin-bottom: 10px;
  color: #5a7188;
  font-weight: 950;
  text-align: center;
}

.current-player {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #2878ff;
  color: #fff;
  font-weight: 950;
  box-shadow: 0 8px 16px rgba(40, 120, 255, .18);
}

.current-player.player-two {
  background: #ff7a59;
  box-shadow: 0 8px 16px rgba(255, 122, 89, .18);
}

.choice-area {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 10px;
}

.choice-btn {
  min-height: 72px;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(145deg, #60a5fa, #2878ff);
  color: #fff;
  font-size: 1.8rem;
  font-weight: 950;
  box-shadow: 0 6px 0 #1d5fd1;
  cursor: pointer;
  transition: transform .1s ease, box-shadow .1s ease, filter .18s ease;
}

.choice-btn:hover {
  filter: saturate(1.06);
  transform: translateY(-2px);
}

.choice-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #1d5fd1;
}

.practice-times-grid {
  grid-template-columns: repeat(var(--times-cols, 5), var(--dot-size));
  min-height: 170px;
}

.result-view {
  display: grid;
  gap: 14px;
}

.result-view[hidden] {
  display: none;
}

.winner-box {
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 16px;
  border-radius: var(--radius);
  background: #fff7d6;
  border: 2px solid rgba(255, 186, 58, .55);
  color: #5b3a00;
  text-align: center;
}

.winner-box strong {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
}

.award-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.award-card {
  padding: 14px;
  border-radius: var(--radius);
  background: #f8fafc;
  border: 2px solid rgba(24, 50, 74, .1);
  text-align: center;
  font-weight: 850;
}

.award-avatar {
  font-size: 2.5rem;
}

.award-stars {
  margin: 6px 0;
  color: #ffb703;
  font-size: 1.6rem;
}

.result-table-wrap {
  overflow: auto;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: var(--radius);
  background: #fff;
  font-weight: 800;
}

.result-table th,
.result-table td {
  padding: 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: center;
}

.result-table th {
  background: #eef6ff;
}

.result-table .correct-row td {
  background: #ecfff4;
}

.result-table .wrong-row td {
  background: #fff3f3;
}

.division-story {
  max-width: 620px;
  margin: 0 auto 12px;
  color: #43637c;
  font-size: clamp(1rem, 2vw, 1.18rem);
  font-weight: 850;
  line-height: 1.4;
  text-align: center;
}

.division-story .story-icon {
  display: inline-grid;
  width: 44px;
  height: 44px;
  margin-right: 10px;
  place-items: center;
  border-radius: 50%;
  background: #efe8ff;
  box-shadow: 0 8px 18px rgba(80, 58, 180, .14);
  vertical-align: middle;
}

.mix-strategy-card {
  max-width: 720px;
  margin: 0 auto 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #fff7fb, #eef8ff);
  border: 2px solid rgba(120, 159, 255, .34);
  color: #284866;
  font-weight: 850;
  text-align: center;
  box-shadow: 0 10px 24px rgba(47, 75, 128, .08);
}

.mix-strategy-card strong,
.mix-strategy-card span {
  display: block;
}

.mix-strategy-card strong {
  color: #7b3fc9;
  font-weight: 950;
}

.mix-strategy-card span {
  margin-top: 4px;
  line-height: 1.35;
}

.rest-field {
  margin: 0;
}

.rest-field span {
  display: block;
  margin-bottom: 7px;
  font-weight: 900;
}

.division-visual {
  min-height: 330px;
  background:
    linear-gradient(rgba(255, 255, 255, .72), rgba(255, 255, 255, .72)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(46, 121, 255, .06) 32px),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(46, 121, 255, .06) 32px);
}

.division-picture {
  display: grid;
  gap: 14px;
}

.division-meaning-card {
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: #eef6ff;
  border: 2px solid #bfdbfe;
  color: #1d4ed8;
  text-align: center;
  font-weight: 850;
}

.division-meaning-card strong,
.division-meaning-card span {
  display: block;
}

.division-picture.pack-mode .division-meaning-card {
  background: #fff7e8;
  border-color: #ffc76d;
  color: #6b4a00;
}

.division-pool,
.division-rest-box {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  min-height: 56px;
  padding: 10px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .82);
  border: 2px solid rgba(24, 50, 74, .08);
}

.division-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
}

.division-group {
  min-height: 105px;
  padding: 10px;
  border-radius: var(--radius);
  background: #ffffff;
  border: 2px solid #dceaff;
  box-shadow: 0 8px 18px rgba(24, 50, 74, .07);
  animation: timesGroupRise .34s ease both;
}

.division-group.share {
  background: #eef6ff;
  border-color: #bfdbfe;
}

.division-group.share .division-group-title::before {
  content: "Kind";
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-right: 6px;
  border-radius: 999px;
  background: #2878ff;
  color: #fff;
  font-size: .68rem;
  font-weight: 950;
}

.division-group.pack {
  background: #fffaf0;
  border-color: #ffc76d;
}

.division-group.pack .division-group-title::before {
  content: "Pack";
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-right: 6px;
  border-radius: var(--radius);
  background: #ff9f1c;
  color: #3e2a00;
  font-size: .68rem;
  font-weight: 950;
}

.division-group-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: #40607a;
  font-size: .92rem;
  font-weight: 950;
}

.division-group-items {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.division-chip {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #ffd275;
  box-shadow: 0 5px 10px rgba(24, 50, 74, .1);
  animation: timesDotPop .26s ease both;
  font-size: 1rem;
}

.division-picture.distributing .division-pool .division-chip {
  animation: divisionPoolFloat 1.8s ease-in-out both;
}

.division-chip.fly-in {
  opacity: 0;
  animation: divisionFlyIn .82s cubic-bezier(.18, .86, .18, 1.08) both;
}

.division-chip.rest-fly {
  animation-duration: .9s;
}

.division-chip.small {
  width: 24px;
  height: 24px;
  font-size: .86rem;
}

.division-chip.compact {
  width: 18px;
  height: 18px;
  border-width: 1px;
  font-size: .68rem;
}

.division-rest-box {
  background: #fff7e8;
  border: 2px dashed #ffc76d;
  color: #6b4a00;
  font-weight: 950;
}

.division-placeholder {
  width: 100%;
  min-height: 118px;
  display: grid;
  place-items: center;
  padding: 18px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .84);
  border: 2px dashed #bfd7ff;
  color: #456178;
  font-weight: 900;
  text-align: center;
}

.division-placeholder span {
  display: block;
  color: #2878ff;
  font-size: 2.2rem;
  line-height: 1;
}

.division-rule-card,
.division-fact-card,
.division-rest-hint {
  margin-top: 14px;
  padding: 13px;
  border-radius: var(--radius);
  background: #fff7e8;
  border: 2px dashed #ffc76d;
  color: #6b4a00;
  font-weight: 850;
  line-height: 1.45;
}

.division-rule-card strong,
.division-fact-card strong,
.division-rest-hint strong {
  font-weight: 950;
}

.division-rule-card span,
.division-rest-hint span {
  display: block;
  margin-top: 4px;
}

.division-rest-hint {
  background: #f0fbff;
  border-color: #8bd9f5;
  color: #23536a;
}

.division-rest-hint.has-rest {
  background: #fff7e8;
  border-color: #ffbd59;
  color: #6b4a00;
}

.division-rest-hint.no-rest {
  background: #ecfff4;
  border-color: #76d99a;
  color: #23613e;
}

.division-rule-card.in-visual {
  width: max-content;
  max-width: 100%;
  margin: 10px auto;
  text-align: center;
}

.division-probe {
  min-height: 220px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  color: #2d4861;
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 950;
}

.division-probe span {
  padding: 10px 14px;
  border-radius: var(--radius);
  background: #eef6ff;
  border: 2px solid #bfdbfe;
  box-shadow: 0 8px 15px rgba(29, 78, 216, .1);
}

.division-probe .result {
  background: #fff7d6;
  border-color: rgba(255, 186, 58, .55);
  color: #5b3a00;
}

@keyframes timesDotPop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.58);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes divisionPoolFloat {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(.72);
  }
  18%, 54% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  75% {
    opacity: .55;
    transform: translateY(-8px) scale(.9);
  }
  100% {
    opacity: .32;
    transform: translateY(-14px) scale(.82);
  }
}

@keyframes divisionFlyIn {
  0%, 18% {
    opacity: 0;
    transform: translate(var(--fly-x), var(--fly-y)) scale(.62) rotate(-8deg);
  }
  42% {
    opacity: 1;
    transform: translate(calc(var(--fly-x) * .38), calc(var(--fly-y) * .38)) scale(1.08) rotate(4deg);
  }
  76%, 100% {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0);
  }
}

@keyframes timesGroupRise {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes timesJumpDraw {
  from {
    opacity: 0;
    transform: scaleX(.12) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scaleX(1) translateY(0);
  }
}

@media (max-width: 920px) {
  .hero-grid,
  .task-board,
  .learn-board {
    grid-template-columns: 1fr;
  }

  .times-control-grid,
  .avatar-panel {
    grid-template-columns: 1fr 1fr;
  }

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

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

@media (max-width: 560px) {
  .world-map,
  .control-grid,
  .operation-choice,
  .number-row,
  .teacher-stack,
  .times-control-grid,
  .avatar-panel,
  .player-strip,
  .stats-row {
    grid-template-columns: 1fr;
  }

  .world-title {
    grid-template-columns: 1fr;
  }

  .title-mark {
    width: 72px;
    height: 72px;
    font-size: 3rem;
  }

  .times-array {
    --times-dot-size: clamp(22px, 6.2vw, 32px);
    --times-dot-gap: 5px;
  }

  .dot-grid {
    --dot-size: clamp(22px, 6.2vw, 30px);
    --dot-gap: 5px;
  }

  .pm-token-row {
    --token-size: clamp(26px, 7vw, 34px);
    --token-gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
