/* Interactive lesson: path, stations, pizza playground, questions */

.lesson-page { padding-bottom: 130px; background: #fff8ec; }

.lesson-hero {
  background: linear-gradient(180deg, #ffb547, #ffd27a);
  padding: 18px 0 64px; text-align: center; position: relative;
}
.lesson-hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 40px;
  background: #fff8ec; border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.lesson-hero h1 { margin: 0; font-size: clamp(2rem, 5vw, 3rem); color: #5a2d00; line-height: 1.3; }
.lesson-hero p { margin: 0 0 18px; font-size: 1.15rem; color: #7a4300; }
.lesson-hero .spin { display: inline-block; animation: spin 10s linear infinite; }
.back-home {
  position: absolute; right: 16px; top: 16px;
  background: rgba(255, 255, 255, 0.7); padding: 4px 14px; border-radius: 999px;
  font-weight: 700; color: #7a4300;
}

/* path of stations */
.path {
  position: relative; z-index: 2;
  display: flex; justify-content: center; align-items: center; gap: 0;
  max-width: 640px; margin: 0 auto;
}
.path .road { flex: 1; height: 8px; background: rgba(255, 255, 255, 0.6); border-radius: 8px; min-width: 20px; }
.path .road.done { background: var(--green); }
.node {
  position: relative; flex-shrink: 0;
  width: 74px; height: 74px; border-radius: 50%;
  border: 5px solid var(--white); background: #f3e3c8;
  font-size: 2rem; display: grid; place-items: center;
  box-shadow: 0 6px 0 rgba(122, 67, 0, 0.25);
  transition: transform 0.3s var(--bounce);
}
.node .lbl {
  position: absolute; top: 100%; margin-top: 8px; white-space: nowrap;
  font-size: 0.85rem; font-weight: 800; color: #7a4300;
}
.node.locked { filter: grayscale(1); opacity: 0.7; }
.node.locked::after {
  content: "🔒"; position: absolute; bottom: -6px; left: -6px; font-size: 1.1rem;
  background: var(--white); border-radius: 50%; width: 28px; height: 28px; display: grid; place-items: center;
}
.node.done { background: var(--green-soft); }
.node.done::after {
  content: "✓"; position: absolute; bottom: -6px; left: -6px; font-size: 1rem; font-weight: 800; color: var(--white);
  background: var(--green); border-radius: 50%; width: 28px; height: 28px; display: grid; place-items: center;
}
.node.current { background: var(--white); transform: scale(1.18); border-color: var(--blue-500); animation: pulse 1.6s ease-in-out infinite; }
.node:hover:not(.locked) { transform: scale(1.12); }
.node.unlocking { animation: jump 0.7s var(--bounce); }

/* station */
.stage { margin-top: 20px; }
.station { animation: slide-up 0.5s var(--bounce); }
.station-tag {
  display: inline-block; font-weight: 800; color: var(--blue-800);
  background: var(--blue-100); padding: 2px 14px; border-radius: 999px; margin-bottom: 12px;
}

.teach { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 22px; }
.teach-buddy {
  width: 110px; height: 110px; border-radius: 50%; flex-shrink: 0;
  object-fit: cover; object-position: top;
  border: 5px solid var(--white); box-shadow: var(--shadow-soft);
  animation: floaty 4s ease-in-out infinite;
}
.teach-bubble {
  position: relative; flex: 1;
  background: var(--white); border-radius: 8px var(--radius-lg) var(--radius-lg) var(--radius-lg);
  padding: 18px 22px; box-shadow: var(--shadow-soft);
  font-size: 1.25rem;
}
.teach-bubble h2 { margin: 0 0 6px; color: var(--blue-900); font-size: 1.7rem; }
.teach-bubble p, .teach-text { margin: 0 0 10px; }
.listen {
  border: 0; background: var(--blue-100); color: var(--blue-800);
  border-radius: 999px; padding: 6px 16px; font-weight: 800; font-size: 1rem;
}
.listen.on { background: var(--blue-500); color: var(--white); animation: pulse 1s infinite; }

.cols { display: grid; grid-template-columns: 1.1fr 1fr; gap: 22px; align-items: start; }

.card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 22px; box-shadow: var(--shadow-soft);
}
.card-title { font-size: 1.35rem; font-weight: 800; margin: 0 0 12px; color: var(--blue-900); }

/* pizza */
.pizza-wrap { display: grid; place-items: center; padding: 6px 0; }
.pizza { width: min(300px, 100%); height: auto; overflow: visible; }
.pizza.sm { width: min(170px, 100%); }
.pizza .slice { cursor: default; transition: transform 0.25s var(--bounce), opacity 0.3s; transform-origin: 0 0; }
.pizza.tappable .slice { cursor: pointer; }
.pizza.tappable .slice:hover { transform: scale(1.04); }
.pizza .slice.eaten { opacity: 0; transform: scale(0.5) rotate(20deg); pointer-events: none; }
.pizza .slice.pop { animation: slice-pop 0.35s var(--bounce); }

.cut-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; margin-bottom: 8px; font-weight: 800; }
.cut-row button {
  width: 46px; height: 46px; border-radius: 14px; font-weight: 800; font-size: 1.2rem;
  border: 3px solid #f3d9ae; background: #fff6e6; color: #7a4300;
  transition: transform 0.2s var(--bounce);
}
.cut-row button.on { background: var(--orange); border-color: var(--orange); color: var(--white); transform: scale(1.1); }

.readout {
  text-align: center; font-size: 1.25rem; font-weight: 700; min-height: 3.6em;
  display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap;
  color: var(--ink);
}
.readout .frac { color: var(--orange-dark); font-size: 1.8rem; }
.play-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

/* fraction anatomy */
.anatomy { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 10px 0 4px; }
.anatomy .frac { font-size: 3.6rem; color: var(--blue-900); }
.anatomy .frac .n { color: var(--orange-dark); }
.anatomy .frac .d { color: var(--blue-600); }
.anatomy .labels { display: flex; flex-direction: column; gap: 26px; font-size: 1.05rem; font-weight: 700; }
.anatomy .labels span { padding: 4px 12px; border-radius: 12px; }
.anatomy .labels .ln { background: #fff1df; color: var(--orange-dark); }
.anatomy .labels .ld { background: var(--blue-100); color: var(--blue-600); }

/* question */
.q-title { font-size: 1.35rem; font-weight: 800; margin-bottom: 12px; color: var(--blue-900); }
.q-visual { display: grid; place-items: center; margin-bottom: 12px; }
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; }
.opt {
  min-height: 92px; border-radius: var(--radius);
  border: 4px solid #e3eaf6; background: var(--white);
  font-size: 1.4rem; font-weight: 800; color: var(--blue-900);
  box-shadow: 0 6px 0 #e3eaf6;
  transition: transform 0.2s var(--bounce), border-color 0.2s, background 0.2s;
  display: grid; place-items: center; padding: 8px;
}
.opt .frac { font-size: 2rem; }
.opt:hover:not(:disabled) { transform: translateY(-4px); border-color: var(--blue-300); }
.opt.right { background: var(--green-soft); border-color: var(--green); box-shadow: 0 6px 0 #86efac; transform: scale(1.06); }
.opt.wrong { background: #fee2e2; border-color: #fca5a5; box-shadow: 0 6px 0 #fecaca; opacity: 0.75; }
.opt:disabled { cursor: default; }
.feedback { min-height: 2em; margin-top: 12px; font-weight: 800; font-size: 1.15rem; text-align: center; }
.feedback.good { color: #15803d; }
.feedback.bad { color: #b91c1c; }

.round-chip {
  display: inline-block; background: var(--purple-soft); color: var(--purple);
  font-weight: 800; padding: 2px 12px; border-radius: 999px; margin-bottom: 8px; font-size: 0.95rem;
}

/* compare */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.compare-card {
  border: 5px solid #e3eaf6; background: var(--white); border-radius: var(--radius-lg);
  padding: 14px 8px 10px; display: grid; place-items: center; gap: 6px;
  box-shadow: 0 6px 0 #e3eaf6;
  transition: transform 0.25s var(--bounce), border-color 0.2s;
}
.compare-card .frac { font-size: 2.4rem; color: var(--blue-900); }
.compare-card:hover:not(:disabled) { transform: translateY(-6px) rotate(-1deg); border-color: var(--blue-300); }
.compare-card.right { border-color: var(--green); background: var(--green-soft); }
.compare-card.wrong { border-color: #fca5a5; background: #fee2e2; }

.vs-row { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.vs-row figure { margin: 0; display: grid; place-items: center; gap: 4px; }
.vs-row figure .frac { font-size: 1.8rem; }
.vs-row .gt {
  font-size: 1.2rem; font-weight: 800; color: var(--white);
  background: var(--green); padding: 4px 14px; border-radius: 999px;
}

/* quiz progress */
.quiz-bar { height: 16px; background: #eef2f9; border-radius: 999px; overflow: hidden; margin-bottom: 16px; }
.quiz-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green), #86efac); border-radius: 999px; transition: width 0.5s var(--bounce); }

.next-bar { text-align: center; margin-top: 26px; animation: pop-in 0.5s var(--bounce); }

.remember {
  background: var(--yellow-soft); border: 3px dashed var(--yellow);
  border-radius: var(--radius); padding: 14px 18px; font-weight: 700;
}
.remember b { color: var(--orange-dark); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slice-pop { 0% { transform: scale(1); } 50% { transform: scale(1.12); } 100% { transform: scale(1); } }

@media (max-width: 860px) {
  .cols { grid-template-columns: 1fr; }
  .teach-buddy { display: none; }
  .teach-bubble { font-size: 1.1rem; padding: 14px 16px; }
  .teach-bubble h2 { font-size: 1.4rem; }
  .node { width: 58px; height: 58px; font-size: 1.5rem; }
  .node .lbl { font-size: 0.72rem; }
  .back-home { position: static; display: inline-block; margin-bottom: 8px; }
}
@media (max-width: 480px) {
  .node .lbl { display: none; }
  .card { padding: 16px; }
}
