/* ============================================================
   lesson.css —— V2.2 一课3关、挑伙伴、做完页（A 负责）
   类名前缀：ls- 一课3关 / ch- 挑伙伴 / dn- 做完页。样式照原型 proto2/proto3 的 rtop/spanel/opts/fin。
   孩子看到的字一律不小于 14px；点错只变淡、不用红色
   ============================================================ */

.ls { display: flex; flex-direction: column; padding: calc(10px + env(safe-area-inset-top)) 0 16px; animation: slidein .2s ease both; }

/* ---------- 顶栏：✕ ＋ 3颗精灵球 ---------- */
.ls-top { display: flex; align-items: center; justify-content: space-between; height: 44px; margin-bottom: 8px; }
.ls-x {
  position: relative; width: 36px; height: 36px; border-radius: 50%; border: 2px solid #E6DCCB; background: #fff;
  color: #B9AC99; font: inherit; font-size: 16px; font-weight: 800; display: grid; place-items: center; cursor: pointer; padding: 0;
}
.ls-x::after { content: ""; position: absolute; inset: -8px; }
.ls-sp { width: 36px; }
.ls-balls { display: flex; gap: 10px; }
.ls-pb {
  display: block; position: relative; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #4A3728; font-style: normal;
  background: linear-gradient(#fff 0 46%, #4A3728 46% 54%, #fff 54%); opacity: .35; transition: opacity .3s, transform .3s;
}
.ls-pb.on { opacity: 1; background: linear-gradient(#FF6B6B 0 46%, #4A3728 46% 54%, #fff 54%); }
.ls-pb.cur { opacity: 1; }
.ls-pb.cur::before {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  background: conic-gradient(#FFC93C calc(var(--p, 0) * 360deg), transparent 0);
  -webkit-mask: radial-gradient(circle, transparent 58%, #000 60%); mask: radial-gradient(circle, transparent 58%, #000 60%);
}
.ls-pb.gone { opacity: 0; transform: scale(.3); }

/* ---------- 大绿按钮、次按钮 ---------- */
.ls-go {
  display: block; width: 100%; font: inherit; font-weight: 900; font-size: 21px; border: 0; border-radius: 18px; padding: 14px;
  background: #7BC96F; color: #fff; box-shadow: 0 5px 0 #5aa64f; cursor: pointer;
}
.ls-go:active { transform: translateY(3px); box-shadow: 0 2px 0 #5aa64f; }
.ls-btn2 {
  display: block; width: 100%; font: inherit; font-size: 16px; font-weight: 800; padding: 11px; margin-top: 10px;
  border-radius: 14px; border: 2px solid #4A3728; background: #fff; color: #4A3728; cursor: pointer;
}

/* ---------- 第1关·故事 ---------- */
.ls-panel { touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.ls-panel.svg { background: #FFF8EF; }
.ls-pimg { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; user-select: none; }
.ls-bub {
  position: absolute; left: 5%; right: 5%; top: 3%; z-index: 2; background: #fff; border: 2.5px solid #4A3728; border-radius: 14px;
  padding: 6px 10px; text-align: center; cursor: pointer;
}
.ls-bub.low { top: auto; bottom: 3%; }
.ls-bub .en { font-family: var(--en); font-weight: 900; font-size: 17px; line-height: 1.3; }
.ls-bub .zh { font-size: 14px; color: #8B7A63; line-height: 1.35; }
.ls-glow {
  position: absolute; z-index: 1; border: 0; padding: 0; border-radius: 18px; background: rgba(255, 201, 60, .18); cursor: pointer;
  box-shadow: 0 0 0 3px #FFC93C, 0 0 16px 5px rgba(255, 201, 60, .7);
  animation: lsbreathe 1.3s ease-in-out infinite; transition: transform .4s; transform-origin: 50% 0;
}
.ls-glow[hidden] { display: none; }
.ls-glow.big { transform: scale(1.35); }          /* 往下长，不往台词框里长 */
@keyframes lsbreathe {
  0%, 100% { box-shadow: 0 0 0 3px #FFC93C, 0 0 14px 4px rgba(255, 201, 60, .6); }
  50% { box-shadow: 0 0 0 4px #FFD95C, 0 0 28px 10px rgba(255, 201, 60, .95); }
}
.ls-nav { min-height: 76px; margin-top: 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ls-arrow { width: auto; margin-left: auto; padding: 10px 32px; font-size: 26px; line-height: 1.2; }
.ls-wpop {
  background: #fff; border: 3px solid #FFC93C; border-radius: 14px; padding: 4px 14px; text-align: center; min-width: 0;
  animation: lspop .3s ease-out;
}
.ls-wpop b { display: block; font-family: var(--en); font-size: 24px; color: #B5602A; line-height: 1.25; overflow-wrap: anywhere; }
.ls-wpop span { display: block; font-size: 14px; color: #8B7A63; }
.ls-fbcap { text-align: center; font-size: 16px; font-weight: 800; color: #8B7A63; margin-top: 14px; }
@keyframes lspop { 0% { transform: scale(.7); opacity: 0 } 70% { transform: scale(1.06) } 100% { transform: scale(1); opacity: 1 } }

/* ---------- 第2关·听一听 ---------- */
.ls-big { text-align: center; font-size: 64px; margin-top: 120px; }
.ls-itx { text-align: center; font-size: 20px; font-weight: 800; color: #6f6252; margin: 14px 0 0; }   /* 小步开场那句话（妈妈同时读） */
.ls-spk {
  display: block; margin: 0 auto 12px; width: 74px; height: 74px; border-radius: 50%; border: 3px solid #4A3728; background: #fff;
  font-size: 30px; line-height: 1; cursor: pointer; padding: 0;
}
.ls-spk.sm { width: 52px; height: 52px; font-size: 22px; margin: 8px auto 0; border-width: 2.5px; }
.ls-spk:active { transform: translateY(2px); }
.ls-opts { display: flex; flex-direction: column; align-items: center; gap: 10px; transition: opacity .35s; }
.ls-opts.wait { opacity: 0; pointer-events: none; }
.ls-opt {
  position: relative; width: 150px; height: 150px; flex: none; border: 3px solid #4A3728; border-radius: 16px; overflow: hidden;
  background: #fff; cursor: pointer; transition: opacity .25s, box-shadow .25s;
}
.ls-opt > svg, .ls-opt > .wart, .ls-opt > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ls-opt.ok::after {
  content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(123, 201, 111, .55);
  color: #fff; font-size: 48px; font-weight: 900;
}
.ls-opt.dim { opacity: .35; }
.ls-opt.hint { box-shadow: 0 0 0 4px #FFC93C, 0 0 18px 6px rgba(255, 201, 60, .8); }
.ls-opt.nudge { animation: lswiggle .6s 2; }
@keyframes lswiggle { 0%, 100% { transform: rotate(0) } 25% { transform: rotate(-4deg) } 75% { transform: rotate(4deg) } }

/* 老的听音选图：点错变淡（原来是红底） */
.opt.g1-dim { opacity: .4; }

/* 老视图（看完整故事、词卡、补字母、听音选图）里孩子看到的小字补到 14px */
.view .panel .bubble .zh, .view .panel .prop-tag, .view .wordcard .hint, .view .q-prompt .sub { font-size: 14px; }

/* ---------- 第3关·补字母 ---------- */
.ls-fq { text-align: center; margin-bottom: 6px; }
.ls-fart { width: 150px; height: 150px; margin: 0 auto 6px; border-radius: 16px; overflow: hidden; border: 3px solid #4A3728; background: #fff; }
.ls-fart > svg, .ls-fart > .wart, .ls-fart > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ls-fzh { font-size: 26px; font-weight: 800; line-height: 1.3; }
.ls-fill .fill-word { margin-top: 14px; }
.ls-undo { text-align: center; }
.ls-undo .btn { width: auto; display: inline-block; padding: 10px 22px; font-size: 16px; box-shadow: 0 4px 0 #4A3728; }

/* ---------- 第1关·词卡（没有漫画的课） ---------- */
.ls-card {
  background: #fff; border: 3px solid #4A3728; border-radius: 20px; box-shadow: 0 6px 0 #4A3728; padding: 20px 16px 18px;
  text-align: center; margin-top: 8px; animation: lspop .3s ease both;
}
.ls-cart { width: 170px; height: 170px; margin: 0 auto 8px; border-radius: 14px; overflow: hidden; }
.ls-cart > svg, .ls-cart > .wart, .ls-cart > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ls-cen { font-family: var(--en); font-size: 38px; font-weight: 700; line-height: 1.15; }
.ls-czh { font-size: 19px; font-weight: 700; color: #6f6252; margin-top: 2px; }

/* ---------- 休息一下（弹窗） ---------- */
.ls-quit b { display: block; font-size: 18px; font-weight: 900; }
.ls-quit p { font-size: 15px; color: #8B7A63; margin: 6px 0 14px; }

/* ---------- 挑伙伴 ---------- */
.ch-h { display: flex; align-items: center; justify-content: space-between; height: 44px; }
.ch-lv { font-weight: 800; font-size: 15px; background: #FFF1D6; border-radius: 12px; padding: 4px 12px; }
.ch-s { text-align: center; font-size: 15px; color: #8B7A63; margin: 12px 0 0; }
.ch-three { display: flex; justify-content: center; gap: 10px; margin: 28px 0 12px; }
.ch-pick {
  flex: 1 1 0; min-width: 0; max-width: 120px; border: 0; background: transparent; padding: 0; cursor: pointer;
  animation: lsbob 2.4s ease-in-out infinite; transition: transform .25s, opacity .3s;
}
.ch-pick:nth-child(2) { animation-delay: .4s; }
.ch-pick:nth-child(3) { animation-delay: .8s; }
.ch-pick .pc.mini { width: 100%; height: auto; aspect-ratio: 92 / 122; }
.ch-pick.on { animation: none; transform: scale(1.08); }
.ch-pick.off { animation: none; opacity: .3; }
@keyframes lsbob { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-6px) } }

/* ---------- 做完页 ---------- */
.dn { align-items: center; text-align: center; }
.dn-top { align-self: stretch; display: flex; justify-content: space-between; align-items: center; height: 44px; }
.dn-balls { display: flex; gap: 8px; }
.dn-balls .ls-pb { width: 22px; height: 22px; }
.dn-jar { font-style: normal; font-size: 30px; line-height: 1; display: inline-block; }
.dn-cap { position: relative; display: flex; align-items: center; gap: 2px; font-weight: 900; font-size: 18px; padding: 0 4px; }
.dn-ball {
  position: relative; width: 96px; height: 96px; margin-top: 4px; border-radius: 50%; border: 5px solid #4A3728; flex: none;
  background: linear-gradient(#FF6B6B 0 45%, #4A3728 45% 55%, #fff 55%); animation: lswob 1.8s ease-in-out;
  transition: height .5s ease, width .5s ease, margin .5s ease, border-width .5s ease, opacity .35s ease;
}
.dn-ball::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -16px 0 0 -16px; border-radius: 50%;
  background: #fff; border: 5px solid #4A3728;
}
.dn-ball.still { animation: none; }
/* 揭晓背景出来时精灵球收起来：慢慢缩没，下面的字和卡跟着平移上去，不是一下跳上去 */
.dn-ball.gone { width: 0; height: 0; margin-top: 0; border-width: 0; opacity: 0; }
@keyframes lswob {
  0%, 22%, 33%, 55%, 66%, 88%, 100% { transform: rotate(0) }
  6%, 39%, 72% { transform: rotate(-18deg) }
  14%, 47%, 80% { transform: rotate(14deg) }
}
.dn-t { font-size: 22px; font-weight: 900; margin: 12px 0 2px; line-height: 1.3; }
.dn-p { font-size: 15px; color: #6f6252; margin: 0 0 10px; min-height: 22px; }
.dn-card { position: relative; width: 100%; padding: 14px 0; opacity: 0; transition: opacity .6s; }
.dn-card.on { opacity: 1; }
.dn-rv {                                   /* 挑了新叶喵：「第一位伙伴」开场图当揭晓背景 */
  position: absolute; inset: 0; border-radius: 18px; border: 3px solid #4A3728;
  background-size: cover; background-position: center 40%; opacity: 0; transition: opacity 1s;
}
.dn-rv.on { opacity: 1; }
.dn-card .pc { z-index: 1; }
.dn-old { width: 100%; }
.dn-cv { display: block; width: 210px; height: 150px; margin: 40px auto 0; border-radius: 14px; object-fit: cover; border: 3px solid #4A3728; overflow: hidden; background: #fff; }
.dn-cv.art { width: 150px; }
.dn-cv.art > svg, .dn-cv.art > .wart, .dn-cv.art > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dn-cv.emo { display: grid; place-items: center; font-size: 64px; width: 150px; }
.dn-btns { width: 100%; margin-top: 16px; opacity: 0; transition: opacity .4s; }
.dn-btns.on { opacity: 1; }
.dn-home {
  display: block; margin: 8px auto 0; padding: 10px 18px; background: transparent; border: 0; font: inherit; font-size: 15px;
  color: #8B7A63; text-decoration: underline; cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .ls-glow, .ch-pick, .dn-ball, .ls-opt.nudge { animation: none; }
}

/* ---------- 关里的小步（2026-10-04）：消消乐、连线、拼单词进了一课3关 ---------- */
.ls.gpop .pop-target { margin-top: 4px; }
.ls.gspell .spell-slots { flex-wrap: nowrap; gap: 5px; margin-top: 14px; }
.ls.gspell .slot { width: 36px; flex: 0 1 36px; }
