/* =========================================================
   CoCo 数学英语奇幻岛 - Storybook Animated Styles
   ========================================================= */

:root {
  --sky-top: #76d4ff;
  --sky-bottom: #d9f4ff;
  --cream: #fffdf7;
  --card-border: #ffe5b4;
  --text-dark: #2c2a4a;
  --text-muted: #5c5f7a;

  --coral: #ff6b6b;
  --coral-dark: #d94b4b;
  --sunny: #ffd166;
  --sunny-dark: #e0a82e;
  --mint: #06d6a0;
  --mint-dark: #05a87d;
  --sky: #4cc9f0;
  --sky-dark: #2a9ec4;
  --purple: #9b72ff;
  --purple-dark: #7449e0;
  --orange: #ff9f43;
  --orange-dark: #dc781c;

  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --shadow-soft: 0 12px 32px rgba(44, 42, 74, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Fredoka', 'Nunito', 'PingFang SC', 'Hiragino Maru Gothic ProN', 'Microsoft YaHei', sans-serif;
  color: var(--text-dark);
  min-height: 100vh;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 65%, #b8f2c8 100%);
  overflow-x: hidden;
  position: relative;
}

/* ---------- Animated Background Scenery ---------- */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.sun {
  position: absolute;
  top: 24px;
  right: 48px;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff3a1 0%, #ffd166 70%, #ffb703 100%);
  box-shadow: 0 0 40px rgba(255, 209, 102, 0.85);
  animation: sunPulse 4s ease-in-out infinite;
}

.sun-rays {
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  border: 6px dashed rgba(255, 233, 140, 0.7);
  animation: spinSlow 24s linear infinite;
}

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  filter: drop-shadow(0 6px 10px rgba(76, 150, 200, 0.12));
}

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

.cloud-1 {
  width: 130px;
  height: 44px;
  top: 64px;
  left: -150px;
  animation: cloudFloat 36s linear infinite;
}
.cloud-1::before { width: 58px; height: 58px; top: -26px; left: 22px; }
.cloud-1::after { width: 44px; height: 44px; top: -18px; left: 66px; }

.cloud-2 {
  width: 100px;
  height: 36px;
  top: 135px;
  left: -120px;
  opacity: 0.8;
  animation: cloudFloat 48s linear infinite 14s;
}
.cloud-2::before { width: 46px; height: 46px; top: -20px; left: 16px; }
.cloud-2::after { width: 34px; height: 34px; top: -14px; left: 50px; }

.cloud-3 {
  width: 150px;
  height: 48px;
  top: 40px;
  left: -180px;
  opacity: 0.7;
  animation: cloudFloat 56s linear infinite 26s;
}
.cloud-3::before { width: 64px; height: 64px; top: -28px; left: 26px; }
.cloud-3::after { width: 50px; height: 50px; top: -20px; left: 74px; }

.hill {
  position: absolute;
  bottom: -90px;
  border-radius: 50% 50% 0 0;
}

.hill-back {
  width: 120vw;
  height: 220px;
  left: -10vw;
  background: #8ee4af;
}

.hill-front {
  width: 110vw;
  height: 170px;
  right: -18vw;
  background: #6cd696;
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

/* ---------- Main Shell Layout ---------- */
.app-shell {
  position: relative;
  z-index: 2;
  max-width: 1020px;
  margin: 0 auto;
  padding: 18px 18px 34px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- Top Header Bar ---------- */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.88);
  padding: 8px 18px 8px 12px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(44, 42, 74, 0.1);
  border: 3px solid #ffffff;
  cursor: pointer;
  transition: transform 0.18s ease;
}

.brand:hover {
  transform: scale(1.02);
}

.brand-badge {
  font-size: 2rem;
  line-height: 1;
  animation: gentleBob 2.8s ease-in-out infinite;
}

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.15;
}

.brand-text .subtitle {
  font-size: 0.78rem;
  font-weight: 700;
  color: #4d7ea8;
  letter-spacing: 0.3px;
}

.hud-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1.05rem;
  border: 3px solid #ffe5b4;
  box-shadow: 0 4px 0 #f2c97d;
  user-select: none;
}

.star-pill {
  cursor: pointer;
  background: #fff9e6;
  transition: transform 0.15s ease;
}

.star-pill:hover {
  transform: translateY(-2px);
}

.star-pill:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #f2c97d;
}

.pill-label {
  font-size: 0.82rem;
  background: var(--sunny);
  color: #6b4400;
  padding: 2px 8px;
  border-radius: 999px;
}

.streak-pill {
  border-color: #ffd0c7;
  box-shadow: 0 4px 0 #f5a091;
  color: #d94b4b;
}

.icon-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  background: var(--sky);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--sky-dark);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.icon-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--sky-dark);
}

.icon-btn.muted {
  background: #adb5bd;
  box-shadow: 0 4px 0 #868e96;
}

/* ---------- Navigation Tabs ---------- */
.mode-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 12px 10px;
  border-radius: var(--radius-md);
  border: 3px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 5px 0 rgba(44, 42, 74, 0.14);
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.15s ease;
}

.nav-tab:hover {
  transform: translateY(-3px);
  background: #ffffff;
}

.nav-tab:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(44, 42, 74, 0.14);
}

.nav-tab.active {
  background: linear-gradient(180deg, #fff6d6 0%, #ffe394 100%);
  border-color: #ffb703;
  box-shadow: 0 5px 0 #e09f1f;
  transform: translateY(-2px);
}

.tab-emoji {
  font-size: 1.8rem;
  line-height: 1.1;
}

.tab-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-dark);
}

.tab-en {
  font-size: 0.78rem;
  font-weight: 700;
  color: #5c5f7a;
}

/* ---------- Mascot Companion Bar ---------- */
.mascot-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-lg);
  padding: 12px 20px;
  border: 3px solid #ffffff;
  box-shadow: var(--shadow-soft);
}

.mascot-avatar {
  width: 84px;
  height: 84px;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.mascot-avatar:hover {
  transform: scale(1.08) rotate(-4deg);
}

.coco-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.coco-eyes {
  transform-origin: 60px 56px;
  animation: blink 4.5s infinite;
}

.mascot-avatar.cheer {
  animation: mascotCheer 0.65s ease;
}

.mascot-avatar.encourage {
  animation: mascotWiggle 0.55s ease;
}

.speech-bubble {
  flex: 1;
  background: #f4fbff;
  border: 2px solid #cbeeff;
  border-radius: 20px;
  padding: 12px 16px;
  position: relative;
}

.speech-bubble::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 9px 10px 9px 0;
  border-style: solid;
  border-color: transparent #cbeeff transparent transparent;
}

.speech-zh {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.speech-en-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.speech-en {
  font-size: 0.98rem;
  font-weight: 700;
  color: #2b7a9e;
}

.speak-mini-btn {
  background: var(--sky);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.85rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--sky-dark);
  transition: transform 0.12s ease;
}

.speak-mini-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--sky-dark);
}

/* ---------- Main Learning Stage Card ---------- */
.stage-card {
  background: var(--cream);
  border-radius: var(--radius-lg);
  border: 4px solid #ffffff;
  box-shadow: var(--shadow-soft);
  padding: 24px;
  min-height: 430px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.stage-title-group h2 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-dark);
}

.stage-title-group p {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
}

.sub-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- Tactile 3D Toy Buttons ---------- */
.toy-btn {
  font-family: inherit;
  font-weight: 800;
  font-size: 1rem;
  padding: 10px 18px;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  color: #fff;
  background: var(--purple);
  box-shadow: 0 5px 0 var(--purple-dark);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.toy-btn:hover {
  filter: brightness(1.05);
}

.toy-btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--purple-dark);
}

.toy-btn.mint { background: var(--mint); box-shadow: 0 5px 0 var(--mint-dark); }
.toy-btn.mint:active { box-shadow: 0 1px 0 var(--mint-dark); }

.toy-btn.coral { background: var(--coral); box-shadow: 0 5px 0 var(--coral-dark); }
.toy-btn.coral:active { box-shadow: 0 1px 0 var(--coral-dark); }

.toy-btn.sunny { background: var(--sunny); color: #5c3a00; box-shadow: 0 5px 0 var(--sunny-dark); }
.toy-btn.sunny:active { box-shadow: 0 1px 0 var(--sunny-dark); }

.toy-btn.sky { background: var(--sky); box-shadow: 0 5px 0 var(--sky-dark); }
.toy-btn.sky:active { box-shadow: 0 1px 0 var(--sky-dark); }

.toy-btn.outline {
  background: #ffffff;
  color: var(--text-dark);
  border: 2.5px solid #d7dce8;
  box-shadow: 0 4px 0 #d7dce8;
}
.toy-btn.outline.active {
  background: #eef8ff;
  border-color: var(--sky);
  color: #166a8c;
  box-shadow: 0 4px 0 var(--sky);
}

/* ---------- Module 1: Counting Playground ---------- */
.count-arena {
  background: linear-gradient(180deg, #f3fbff 0%, #fffdf2 100%);
  border: 3px dashed #bfe6ff;
  border-radius: var(--radius-md);
  padding: 22px;
  min-height: 190px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.count-item {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: #ffffff;
  border: 3px solid #ffe8b6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  cursor: pointer;
  position: relative;
  box-shadow: 0 5px 0 #f2d394;
  transition: transform 0.15s ease, background 0.2s ease;
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.count-item:hover {
  transform: scale(1.1) rotate(-4deg);
}

.count-item.counted {
  background: #e3fcf4;
  border-color: var(--mint);
  box-shadow: 0 5px 0 var(--mint-dark);
  transform: scale(1.06);
}

.count-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  min-width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--coral);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  animation: popIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.number-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
}

.num-card {
  background: #ffffff;
  border: 3px solid #e7ecff;
  border-radius: 18px;
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 4px 0 #d5defa;
  transition: transform 0.15s ease, border-color 0.2s ease;
}

.num-card:hover {
  transform: translateY(-4px);
  border-color: var(--purple);
}

.num-card.speaking {
  background: #fff4d6;
  border-color: var(--sunny-dark);
  transform: scale(1.08);
}

.num-card .big-num {
  font-size: 1.85rem;
  font-weight: 900;
  color: var(--purple-dark);
  line-height: 1.1;
}

.num-card .en-word {
  font-size: 0.88rem;
  font-weight: 800;
  color: #4a5568;
}

/* ---------- Answer Choice Grid ---------- */
.choices-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.choice-btn {
  min-width: 110px;
  padding: 14px 20px;
  border-radius: 20px;
  border: 3px solid #e2e8f0;
  background: #ffffff;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 6px 0 #cbd5e1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: transform 0.14s ease, background 0.2s ease;
}

.choice-btn:hover {
  transform: translateY(-3px);
  border-color: var(--sky);
}

.choice-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #cbd5e1;
}

.choice-btn .choice-main {
  font-size: 1.9rem;
  font-weight: 900;
  color: var(--text-dark);
  line-height: 1.1;
}

.choice-btn .choice-sub {
  font-size: 0.88rem;
  font-weight: 700;
  color: #5c5f7a;
}

.choice-btn.correct {
  background: var(--mint);
  border-color: var(--mint-dark);
  box-shadow: 0 6px 0 var(--mint-dark);
  animation: popBounce 0.45s ease;
}
.choice-btn.correct .choice-main,
.choice-btn.correct .choice-sub {
  color: #ffffff;
}

.choice-btn.wrong {
  background: #ffe3e3;
  border-color: var(--coral);
  box-shadow: 0 6px 0 var(--coral-dark);
  animation: shake 0.4s ease;
}

/* ---------- Module 2: Magic Addition & Subtraction ---------- */
.equation-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 2.6rem;
  font-weight: 900;
  color: var(--text-dark);
  flex-wrap: wrap;
}

.eq-box {
  min-width: 68px;
  height: 68px;
  padding: 0 14px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff5d6;
  border: 3px solid var(--sunny);
}

.eq-box.op {
  background: #e9e0ff;
  border-color: var(--purple);
  color: var(--purple-dark);
}

.eq-box.answer-slot {
  background: #e6f9ff;
  border: 3px dashed var(--sky-dark);
  color: var(--sky-dark);
}

.eq-box.answer-slot.solved {
  background: var(--mint);
  border-style: solid;
  border-color: var(--mint-dark);
  color: #ffffff;
  animation: popBounce 0.45s ease;
}

.eq-english {
  text-align: center;
  font-size: 1.08rem;
  font-weight: 800;
  color: #3a7ca5;
  cursor: pointer;
}

.calc-visual-stage {
  background: linear-gradient(180deg, #f9f6ff 0%, #fffef8 100%);
  border: 3px solid #e7ddff;
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.calc-groups {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  width: 100%;
}

.calc-group {
  background: #ffffff;
  border: 3px solid #ffe4b5;
  border-radius: 18px;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 340px;
  justify-content: center;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}

.calc-group.group-b {
  border-color: #bde8ff;
}

.calc-group.merging-left {
  transform: translateX(26px);
}
.calc-group.merging-right {
  transform: translateX(-26px);
}

.calc-emoji {
  font-size: 2rem;
  display: inline-block;
  transition: transform 0.55s ease, opacity 0.55s ease;
  animation: popIn 0.3s ease backwards;
}

.calc-emoji.fly-away {
  transform: translateY(-38px) scale(0.4) rotate(25deg);
  opacity: 0.22;
  filter: grayscale(0.7);
}

.calc-op-badge {
  font-size: 2rem;
  font-weight: 900;
  color: var(--purple-dark);
}

/* Ten-Frame Helper (十格阵) */
.ten-frames-wrap {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.ten-frame {
  display: grid;
  grid-template-columns: repeat(5, 36px);
  grid-template-rows: repeat(2, 36px);
  gap: 5px;
  background: #ffffff;
  padding: 8px;
  border-radius: 14px;
  border: 3px solid #cad5e2;
}

.tf-cell {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tf-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  animation: popIn 0.3s ease;
}

.tf-dot.dot-a { background: var(--coral); }
.tf-dot.dot-b { background: var(--sky); }
.tf-dot.dot-removed {
  background: var(--coral);
  opacity: 0.25;
  position: relative;
}

/* ---------- Module 3: Compare Seesaw (跷跷板) ---------- */
.seesaw-arena {
  background: linear-gradient(180deg, #effaff 0%, #e9fce8 100%);
  border: 3px solid #c5eccb;
  border-radius: var(--radius-md);
  padding: 28px 18px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  overflow: hidden;
}

.seesaw-wrapper {
  position: relative;
  width: min(560px, 100%);
  height: 235px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.seesaw-beam {
  width: 92%;
  height: 18px;
  background: linear-gradient(90deg, #ff9f43 0%, #ffd166 50%, #ff9f43 100%);
  border-radius: 999px;
  border: 3px solid #c97218;
  position: relative;
  transform-origin: center center;
  transition: transform 0.75s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin-bottom: 42px;
}

.seesaw-beam.tilt-left {
  transform: rotate(-11deg);
}
.seesaw-beam.tilt-right {
  transform: rotate(11deg);
}
.seesaw-beam.tilt-even {
  transform: rotate(0deg);
}

.seesaw-side {
  position: absolute;
  bottom: 16px;
  width: 140px;
  background: rgba(255, 255, 255, 0.95);
  border: 3px solid #ffd166;
  border-radius: 18px;
  padding: 10px 8px;
  text-align: center;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.seesaw-side.left { left: 8px; }
.seesaw-side.right { right: 8px; }

.seesaw-num {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--text-dark);
  line-height: 1;
}

.seesaw-en {
  font-size: 0.85rem;
  font-weight: 800;
  color: #4a6b82;
}

.seesaw-icons {
  font-size: 0.95rem;
  line-height: 1.25;
  margin-top: 4px;
  word-break: break-all;
}

.seesaw-fulcrum {
  width: 0;
  height: 0;
  border-left: 34px solid transparent;
  border-right: 34px solid transparent;
  border-bottom: 48px solid #ff6b6b;
  position: absolute;
  bottom: 0;
}

.gator-hint {
  background: #e6fff3;
  border: 2px solid var(--mint);
  color: #0b6e52;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 800;
}

/* ---------- Module 4: Shapes & Colors ---------- */
.shapes-prompt {
  text-align: center;
  background: #fff6e5;
  border: 3px solid #ffd996;
  border-radius: 18px;
  padding: 14px 18px;
}

.shapes-prompt .prompt-zh {
  font-size: 1.3rem;
  font-weight: 900;
}

.shapes-prompt .prompt-en {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--purple-dark);
  margin-top: 4px;
}

.shapes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.shape-card {
  background: #ffffff;
  border: 3px solid #e6ecf5;
  border-radius: 22px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 6px 0 #d4deec;
  transition: transform 0.18s ease, border-color 0.2s ease;
}

.shape-card:hover {
  transform: translateY(-5px) scale(1.03);
  border-color: var(--purple);
}

.shape-card.dance {
  animation: shapeDance 0.6s ease;
  border-color: var(--mint);
  background: #ebfff8;
}

.shape-card.wrong {
  animation: shake 0.4s ease;
  border-color: var(--coral);
  background: #fff0f0;
}

.shape-svg {
  width: 96px;
  height: 96px;
  filter: drop-shadow(0 5px 8px rgba(44, 42, 74, 0.14));
}

.shape-label-zh {
  font-size: 1.05rem;
  font-weight: 800;
}

.shape-label-en {
  font-size: 0.9rem;
  font-weight: 800;
  color: #5c5f7a;
}

/* ---------- Footer Word Bank ---------- */
.word-tip-bar {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  padding: 12px 16px;
  border: 3px solid #ffffff;
  box-shadow: 0 8px 20px rgba(44, 42, 74, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tip-badge {
  font-size: 0.88rem;
  font-weight: 800;
  color: #6b4400;
  background: #fff0bf;
  padding: 5px 12px;
  border-radius: 999px;
}

.word-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.word-chip {
  background: #f0f7ff;
  border: 2px solid #c5e2ff;
  color: #1d5b8c;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}

.word-chip:hover {
  background: #d9eeff;
  transform: translateY(-2px);
}

/* ---------- Sticker Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(34, 38, 66, 0.52);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  background: #fffdf7;
  border: 4px solid #ffd166;
  border-radius: 28px;
  max-width: 560px;
  width: 100%;
  padding: 22px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
  animation: popIn 0.3s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.modal-header h2 {
  font-size: 1.3rem;
}

.close-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: #ffe3e3;
  color: var(--coral-dark);
  font-size: 1.15rem;
  font-weight: 900;
  cursor: pointer;
}

.modal-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
  gap: 12px;
}

.sticker-slot {
  background: #ffffff;
  border: 3px solid #ffe4a3;
  border-radius: 18px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.sticker-slot:hover {
  transform: scale(1.05);
}

.sticker-slot.locked {
  background: #f1f5f9;
  border-color: #cbd5e1;
  filter: grayscale(1);
  opacity: 0.65;
  cursor: default;
}

.sticker-emoji {
  font-size: 2.3rem;
  line-height: 1.2;
}

.sticker-name {
  font-size: 0.82rem;
  font-weight: 800;
  margin-top: 4px;
}

.sticker-req {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
}

/* ---------- Keyframe Animations ---------- */
@keyframes cloudFloat {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(100vw + 360px)); }
}

@keyframes sunPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@keyframes spinSlow {
  to { transform: rotate(360deg); }
}

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

@keyframes blink {
  0%, 92%, 100% { transform: scaleY(1); }
  96% { transform: scaleY(0.1); }
}

@keyframes mascotCheer {
  0% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-14px) scale(1.12) rotate(-6deg); }
  60% { transform: translateY(-8px) scale(1.1) rotate(6deg); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes mascotWiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-10deg); }
  75% { transform: rotate(10deg); }
}

@keyframes popIn {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes popBounce {
  0% { transform: scale(1); }
  40% { transform: scale(1.14); }
  70% { transform: scale(0.96); }
  100% { transform: scale(1); }
}

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

@keyframes shapeDance {
  0%, 100% { transform: scale(1) rotate(0); }
  25% { transform: scale(1.1) rotate(-8deg); }
  50% { transform: scale(1.12) rotate(8deg); }
  75% { transform: scale(1.06) rotate(-4deg); }
}

/* ---------- Responsive Tweaks ---------- */
@media (max-width: 720px) {
  .mode-nav {
    grid-template-columns: repeat(2, 1fr);
  }
  .mascot-bar {
    flex-direction: column;
    text-align: center;
  }
  .speech-bubble::before {
    display: none;
  }
  .speech-en-row {
    justify-content: center;
  }
  .seesaw-side {
    width: 112px;
  }
  .equation-banner {
    font-size: 2rem;
  }
}


/* =========================================================
   Adventure Map & 12-Level Grade 1 Progression Styles
   ========================================================= */

.hidden {
  display: none !important;
}

.map-pill {
  cursor: pointer;
  background: #eef9ff;
  border-color: #9be0ff;
  box-shadow: 0 4px 0 #66c2eb;
  color: #126180;
  font-family: inherit;
}

.map-pill:hover {
  transform: translateY(-2px);
}

/* Map Top Bar & Term Sections */
.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 2px dashed #ffe5b4;
}

.map-progress-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.progress-badge {
  background: #fff5d6;
  border: 2px solid #ffd166;
  color: #6b4400;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.92rem;
}

.unlock-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f4f1ff;
  border: 2px solid #d5c7ff;
  color: #4f2da8;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.14s ease, background 0.15s ease;
}

.unlock-toggle.active {
  background: #e3fcf4;
  border-color: var(--mint);
  color: #0b6e52;
}

.term-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.term-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 16px;
  font-weight: 800;
}

.term-header.term-1 {
  background: linear-gradient(90deg, #e0f5ff 0%, #f4fbff 100%);
  border-left: 6px solid var(--sky);
  color: #165d7a;
}

.term-header.term-2 {
  background: linear-gradient(90deg, #e4fcf1 0%, #f3fff9 100%);
  border-left: 6px solid var(--mint);
  color: #0b6e52;
}

.term-header span.term-sub {
  font-size: 0.85rem;
  opacity: 0.85;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 14px;
}

.level-card {
  position: relative;
  background: #ffffff;
  border: 3px solid #e6ecf5;
  border-radius: 22px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  box-shadow: 0 6px 0 #d4deec;
  transition: transform 0.16s ease, border-color 0.18s ease, box-shadow 0.16s ease;
}

.level-card:hover:not(.locked) {
  transform: translateY(-4px);
  border-color: var(--sky);
}

.level-card:active:not(.locked) {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #d4deec;
}

.level-card.current {
  background: linear-gradient(180deg, #fffdf2 0%, #fff4cc 100%);
  border-color: #ffb703;
  box-shadow: 0 6px 0 #e09f1f;
}

.level-card.cleared {
  background: #f5fffb;
  border-color: var(--mint);
  box-shadow: 0 6px 0 var(--mint-dark);
}

.level-card.locked {
  background: #f1f5f9;
  border-color: #cbd5e1;
  box-shadow: 0 4px 0 #cbd5e1;
  opacity: 0.72;
  cursor: not-allowed;
}

.level-num-badge {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: #f0f7ff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.7rem;
  line-height: 1;
  position: relative;
}

.level-card.current .level-num-badge {
  background: #ffe184;
}

.level-card.cleared .level-num-badge {
  background: #ccf7e8;
}

.level-idx-tag {
  position: absolute;
  top: -7px;
  left: -7px;
  background: var(--purple);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
}

.level-card.locked .level-idx-tag {
  background: #94a3b8;
}

.level-info {
  flex: 1;
  min-width: 0;
}

.level-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.25;
}

.level-en {
  font-size: 0.78rem;
  font-weight: 700;
  color: #4a6b82;
  margin-top: 2px;
}

.level-stars-row {
  margin-top: 6px;
  font-size: 0.95rem;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.level-status-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0;
}

.level-status-pill.play { background: #ffbe0b; color: #5c3a00; }
.level-status-pill.done { background: #06d6a0; color: #ffffff; }
.level-status-pill.lock { background: #cbd5e1; color: #475569; }

/* ---------- Active Level Progress Bar ---------- */
.level-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: #f6fbff;
  border: 2px solid #d5eeff;
  border-radius: 18px;
  padding: 10px 16px;
}

.level-progress-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.q-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, background 0.25s ease;
}

.q-dot.active {
  background: var(--sunny);
  color: #5c3a00;
  transform: scale(1.15);
  box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.5);
}

.q-dot.done-ok {
  background: var(--mint);
  color: #ffffff;
}

.q-dot.done-retry {
  background: var(--orange);
  color: #ffffff;
}

/* ---------- Level 2: Positions 3x3 Treehouse Grid ---------- */
.pos-grid {
  display: grid;
  grid-template-columns: repeat(3, 102px);
  grid-template-rows: repeat(3, 92px);
  gap: 10px;
  margin: 0 auto;
  background: #f3fbff;
  padding: 14px;
  border-radius: 24px;
  border: 3px solid #bce4ff;
}

.pos-cell {
  background: #ffffff;
  border: 3px solid #e2ecfa;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 2.35rem;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, border-color 0.2s ease;
  box-shadow: 0 4px 0 #d5e2f2;
}

.pos-cell:hover {
  transform: scale(1.06);
  border-color: var(--purple);
}

.pos-cell.anchor {
  background: #fff8d9;
  border-color: #ffbe0b;
  box-shadow: 0 4px 0 #e0a82e;
}

.pos-cell.correct {
  background: #d7fff1;
  border-color: var(--mint);
  animation: popBounce 0.45s ease;
}

.pos-cell.wrong {
  background: #ffe5e5;
  border-color: var(--coral);
  animation: shake 0.4s ease;
}

.pos-cell-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
}

/* ---------- Level 6: Interactive Clock SVG ---------- */
.clock-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: linear-gradient(180deg, #fff9ec 0%, #f5fbff 100%);
  border: 3px solid #ffe4a8;
  border-radius: 22px;
  padding: 20px;
}

.clock-svg {
  width: 210px;
  height: 210px;
  filter: drop-shadow(0 8px 16px rgba(44, 42, 74, 0.14));
}

.clock-hint-pill {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-muted);
}

/* ---------- Level 9: Sorting & Classification ---------- */
.sort-arena {
  background: linear-gradient(180deg, #f6f4ff 0%, #fffef8 100%);
  border: 3px dashed #cbb8ff;
  border-radius: 22px;
  padding: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.sort-item {
  width: 66px;
  height: 66px;
  border-radius: 18px;
  background: #ffffff;
  border: 3px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.15rem;
  cursor: pointer;
  box-shadow: 0 4px 0 #cbd5e1;
  transition: transform 0.15s ease, border-color 0.2s ease;
  animation: popIn 0.3s ease backwards;
}

.sort-item.marked {
  background: #e3fcf4;
  border-color: var(--mint);
  transform: scale(1.08);
}

/* ---------- Level 10: 100以内 Tens & Ones Bundles (小棒) ---------- */
.bundles-arena {
  background: linear-gradient(180deg, #fff9ee 0%, #f4fbff 100%);
  border: 3px solid #ffdca0;
  border-radius: 22px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.bundles-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.bundles-label {
  font-size: 0.88rem;
  font-weight: 800;
  color: #5c5f7a;
  background: #ffffff;
  padding: 3px 12px;
  border-radius: 999px;
  border: 2px solid #e2e8f0;
}

.tens-row, .ones-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.ten-bundle {
  width: 44px;
  height: 76px;
  border-radius: 12px;
  background: repeating-linear-gradient(
    90deg,
    #ff9f43 0px,
    #ff9f43 4px,
    #ffd166 4px,
    #ffd166 7px
  );
  border: 2.5px solid #c97218;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 0 #c97218;
  animation: popIn 0.35s ease backwards;
}

.ten-bundle::after {
  content: '10';
  background: #ff595e;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.one-stick {
  width: 11px;
  height: 62px;
  border-radius: 6px;
  background: linear-gradient(180deg, #4cc9f0 0%, #2a9ec4 100%);
  border: 2px solid #166a8c;
  animation: popIn 0.35s ease backwards;
}

/* ---------- Level 11: RMB Money Shop ---------- */
.shop-arena {
  background: linear-gradient(180deg, #fff5f5 0%, #fffdf5 100%);
  border: 3px solid #ffc9c9;
  border-radius: 22px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.shop-items-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.shop-tag-card {
  background: #ffffff;
  border: 3px solid #ffd166;
  border-radius: 20px;
  padding: 12px 18px;
  text-align: center;
  box-shadow: 0 5px 0 #f2c97d;
  min-width: 125px;
}

.shop-tag-emoji {
  font-size: 2.6rem;
  line-height: 1.1;
}

.shop-tag-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-top: 4px;
}

.shop-price-pill {
  display: inline-block;
  margin-top: 6px;
  background: #ff6b6b;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 900;
  padding: 3px 12px;
  border-radius: 999px;
}

.rmb-wallet {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.rmb-bill {
  min-width: 84px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.05rem;
  color: #ffffff;
  border: 2.5px solid rgba(255,255,255,0.85);
  box-shadow: 0 4px 8px rgba(0,0,0,0.12);
  padding: 0 12px;
  animation: popIn 0.3s ease backwards;
}

.rmb-bill.v10 { background: linear-gradient(135deg, #3a86ff 0%, #2667cc 100%); }
.rmb-bill.v5  { background: linear-gradient(135deg, #9b5de5 0%, #7236bd 100%); }
.rmb-bill.v1  { background: linear-gradient(135deg, #2ec4b6 0%, #1d968a 100%); }

.rmb-coin {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff3b0, #ffbe0b);
  border: 3px solid #d49400;
  color: #6b4400;
  font-weight: 900;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.14);
  animation: popIn 0.3s ease backwards;
}

/* ---------- Level 12: Pattern Sequence ---------- */
.pattern-track {
  background: linear-gradient(180deg, #f3f7ff 0%, #ffffff 100%);
  border: 3px solid #c7dcff;
  border-radius: 22px;
  padding: 20px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pattern-slot {
  width: 66px;
  height: 66px;
  border-radius: 18px;
  background: #ffffff;
  border: 3px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.15rem;
  font-weight: 900;
  box-shadow: 0 4px 0 #cbd5e1;
  animation: popIn 0.3s ease backwards;
}

.pattern-slot.mystery {
  background: #e6f9ff;
  border: 3px dashed var(--sky-dark);
  color: var(--sky-dark);
}

.pattern-slot.mystery.solved {
  background: #d7fff1;
  border-style: solid;
  border-color: var(--mint);
  animation: popBounce 0.45s ease;
}

/* ---------- Level Complete Modal ---------- */
.level-complete-card {
  text-align: center;
  max-width: 440px;
}

.lc-trophy {
  font-size: 4rem;
  line-height: 1.1;
  animation: mascotCheer 0.8s ease infinite alternate;
}

.lc-en {
  font-size: 1rem;
  font-weight: 800;
  color: #2b7a9e;
  margin-top: 4px;
}

.lc-stars {
  font-size: 2.6rem;
  letter-spacing: 6px;
  margin: 12px 0 6px;
}

.lc-score {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.lc-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}


/* =========================================================
   40-Lesson Term Tabs, Number Bonds, Composite Puzzle & Story
   ========================================================= */

.term-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.term-tab-btn {
  font-family: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 9px 18px;
  border-radius: 999px;
  border: 2.5px solid #d7dce8;
  background: #ffffff;
  color: var(--text-dark);
  cursor: pointer;
  box-shadow: 0 4px 0 #d7dce8;
  transition: transform 0.14s ease, background 0.15s ease;
}

.term-tab-btn:hover {
  transform: translateY(-2px);
}

.term-tab-btn.active {
  background: linear-gradient(180deg, #fff6d6 0%, #ffe394 100%);
  border-color: #ffb703;
  color: #5c3a00;
  box-shadow: 0 4px 0 #e09f1f;
}

/* Number Bonds (樱桃分解图) */
.bond-stage {
  background: linear-gradient(180deg, #fff7fb 0%, #fffdf5 100%);
  border: 3px solid #ffd4e5;
  border-radius: 22px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.bond-svg-wrap {
  position: relative;
  width: 260px;
  height: 170px;
}

.bond-node {
  position: absolute;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 900;
  box-shadow: 0 6px 0 rgba(44, 42, 74, 0.14);
}

.bond-node.whole {
  top: 4px;
  left: 94px;
  background: #ffd166;
  border: 4px solid #e0a82e;
  color: #5c3a00;
}

.bond-node.part-a {
  bottom: 6px;
  left: 20px;
  background: #ff8fa3;
  border: 4px solid #e05773;
  color: #ffffff;
}

.bond-node.part-b {
  bottom: 6px;
  right: 20px;
  background: #e6f9ff;
  border: 4px dashed var(--sky-dark);
  color: var(--sky-dark);
}

.bond-node.part-b.solved {
  background: var(--mint);
  border-style: solid;
  border-color: var(--mint-dark);
  color: #ffffff;
  animation: popBounce 0.45s ease;
}

/* Composite Shape Picture Puzzle */
.puzzle-arena {
  background: linear-gradient(180deg, #effaff 0%, #f5fff7 100%);
  border: 3px solid #bce4ff;
  border-radius: 22px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.puzzle-svg {
  width: 240px;
  height: 210px;
  filter: drop-shadow(0 6px 12px rgba(44, 42, 74, 0.14));
}

/* Illustrated Math Story Card */
.story-card {
  background: linear-gradient(180deg, #fffdf2 0%, #f6fbff 100%);
  border: 3px solid #ffd996;
  border-radius: 22px;
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.story-text-zh {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.5;
}

.story-text-en {
  font-size: 0.98rem;
  font-weight: 700;
  color: #3a7ca5;
}

.story-icons {
  font-size: 1.85rem;
  letter-spacing: 3px;
  background: #ffffff;
  padding: 10px 18px;
  border-radius: 16px;
  border: 2px dashed #cbeeff;
}


/* =========================================================
   PEP Textbook Additions: Queue, Hundred Chart Cross, Parens
   ========================================================= */

.queue-track {
  background: linear-gradient(180deg, #effaff 0%, #f5fff7 100%);
  border: 3px solid #bce4ff;
  border-radius: 22px;
  padding: 20px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.queue-card {
  width: 82px;
  height: 90px;
  border-radius: 18px;
  background: #ffffff;
  border: 3px solid #e2ecfa;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 2.35rem;
  cursor: pointer;
  box-shadow: 0 5px 0 #d5e2f2;
  transition: transform 0.15s ease, border-color 0.2s ease;
}

.queue-card:hover { transform: translateY(-4px); border-color: var(--purple); }
.queue-card.anchor { background: #fff8d9; border-color: #ffbe0b; box-shadow: 0 5px 0 #e0a82e; }
.queue-card.correct { background: #d7fff1; border-color: var(--mint); animation: popBounce 0.45s ease; }
.queue-card.wrong { background: #ffe5e5; border-color: var(--coral); animation: shake 0.4s ease; }

.hundred-cross {
  display: grid;
  grid-template-columns: repeat(3, 76px);
  grid-template-rows: repeat(3, 68px);
  gap: 8px;
  margin: 0 auto;
  padding: 14px;
  background: #f5f9ff;
  border: 3px solid #c7dcff;
  border-radius: 22px;
}

.hc-cell {
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.65rem;
  font-weight: 900;
  background: #ffffff;
  border: 3px solid #dbe6f7;
  color: var(--text-dark);
}

.hc-cell.empty {
  background: transparent;
  border-color: transparent;
}

.hc-cell.center {
  background: #fff5d6;
  border-color: #ffd166;
  color: #5c3a00;
}

.hc-cell.missing {
  background: #e6f9ff;
  border: 3px dashed var(--sky-dark);
  color: var(--sky-dark);
}

.hc-cell.missing.solved {
  background: var(--mint);
  border-style: solid;
  border-color: var(--mint-dark);
  color: #ffffff;
  animation: popBounce 0.45s ease;
}

.parens-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff0f6;
  border: 3px solid #ff8fa3;
  border-radius: 22px;
  padding: 6px 14px;
}
