/* U9 lessons page — redesign v2 (2026-11-28). Every rule is scoped to .learning-v2 (the lessons screen) or to the
   bookshelf it owns, so no other screen changes. Pictures: img/learning-v2/ (rendered art + the play-button skin);
   surfaces (cards, pills, rings) are CSS so they stay sharp and stretch with long or translated text. */
.learning-v2{
  --lv-ink:#2a1760;--lv-ink2:#6d5fae;--lv-purple:#6c3fe0;--lv-line:#7b55f0;--lv-green:#33b524;
  --lv-gut:10px;--lv-tl:19px;--lv-art:74px;--lv-play:112px;--lv-ctrl:108px;
  background:linear-gradient(180deg,#b6acff 0,#c4c0ff 16%,#d0d4ff 40%,#dbe2ff 70%,#e4ebff 100%)}

/* ---- sky ---- */
.learning-v2 .lv-sky .lv-cloud{position:absolute;top:calc(64px + var(--safe-top));width:min(34%,190px);height:auto;opacity:.95}
.learning-v2 .lv-sky .lv-cloud.l{left:-5%}
.learning-v2 .lv-sky .lv-cloud.r{right:-6%;top:calc(92px + var(--safe-top))}

/* ---- top row (same buttons as before; glossy pictures) ---- */
.learning-v2 .khead{padding:calc(8px + var(--safe-top)) 10px 0;gap:6px;align-items:center}
.learning-v2 .khead .lv-ib{width:42px;height:42px;padding:0;border:0;border-radius:50%;background:none;box-shadow:none;flex:none;display:grid;place-items:center}
.learning-v2 .khead .lv-ib img,.learning-v2 .lv-share img{width:100%;height:100%;display:block;pointer-events:none}
.learning-v2 .khead .lv-ib:active,.learning-v2 .lv-share:active{transform:translateY(1px) scale(.97)}
.learning-v2 .learn-refresh.spin img{animation:spin .8s linear infinite}
.learning-v2 .lv-share{order:3;flex:none;width:42px;height:42px;padding:0;border:0;border-radius:50%;background:none;cursor:pointer}
.learning-v2 .khead .mini-av{width:46px;height:46px}
.learning-v2 .agepill{height:40px}
.learning-v2 .coin-chip{height:40px}

/* ---- subject name: live text, white with a thick purple outline ---- */
.learning-v2 .subj-head{margin:2px 0 0;padding:0 16px;text-align:center;white-space:normal;overflow:visible;
  font-size:clamp(20px,5.92vw,24px);line-height:1.1;font-weight:700;letter-spacing:.3px;color:#fff;   /* 20% smaller (was clamp(25px,7.4vw,30px)) */
  text-shadow:2.1px 0 #5a2fd2,-2.1px 0 #5a2fd2,0 2.1px #5a2fd2,0 -2.1px #5a2fd2,1.5px 1.5px #5a2fd2,-1.5px 1.5px #5a2fd2,1.5px -1.5px #5a2fd2,-1.5px -1.5px #5a2fd2,
    0 3.6px 0 #4320a6,0 5px 8px rgba(40,12,120,.32)}
/* arrival (with the books' hop): the name pops in, sways left-right while the hop runs along the books, then bounces
   as the subject's book stands up, so children look at the shelf and notice the other subjects */
.learning-v2 .subj-head.lv-head-intro{animation:lv-head-in 2.2s cubic-bezier(.3,.7,.4,1) both}
@keyframes lv-head-in{0%{opacity:0;transform:scale(.55)}12%{opacity:1;transform:scale(1.12)}20%{transform:scale(1)}
  32%{transform:rotate(-4deg)}44%{transform:rotate(4deg)}56%{transform:rotate(-3deg)}66%{transform:rotate(0)}
  78%{transform:translateY(0) scale(1)}84%{transform:translateY(-5px) scale(1.08)}92%{transform:translateY(1px) scale(.98)}100%{transform:none}}

/* ---- bookshelf (no owl since 2026-11-28; books 20% bigger: bookH 21.6 in app.js) ---- */
.learning-v2 .bs-scroll{margin-top:-4px;padding:0 6px}
.learning-v2 .bs-stage{max-width:560px;min-width:300px;margin:0 auto}
.bs-stage .bs-decor{position:absolute;z-index:0;left:50%;bottom:46%;width:60%;height:auto;transform:translateX(-50%);pointer-events:none;-webkit-user-select:none;user-select:none}
/* arrival: a hop runs along the books (the `translate` property adds to the book's own lean/stand-up transform) */
.bs-stage.bs-intro .bs-book{animation:bs-hop .52s cubic-bezier(.3,.7,.4,1) both;animation-delay:calc(var(--hop-lead,260ms) + var(--i,0) * var(--hop-gap,90ms))}
@keyframes bs-hop{0%{translate:0 0}38%{translate:0 -17%}68%{translate:0 2%}100%{translate:0 0}}

/* ---- list ---- */
.learning-v2 .lv-scroll{padding:8px var(--lv-gut) 0;scroll-padding-top:12px}
.learning-v2 .lv-sr{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* unit header: pearl card */
.learning-v2 .lv-unit{margin:0 0 12px}
.learning-v2 .lv-unit-h{position:relative;display:flex;align-items:center;gap:9px;width:100%;min-height:78px;padding:9px 12px 9px 6px;margin:0;
  text-align:left;font:inherit;color:var(--lv-ink);cursor:pointer;border:2px solid #fff;border-radius:24px;
  background:linear-gradient(180deg,#fff 0%,#f7f3ff 40%,#ebe3ff 100%);
  box-shadow:0 0 0 1.5px #cdbcff,inset 0 3px 0 rgba(255,255,255,.95),inset 0 -7px 12px rgba(150,118,255,.18),0 8px 18px rgba(88,58,190,.2)}
.learning-v2 .lv-unit-h:focus-visible{outline:3px solid var(--lv-purple);outline-offset:2px}
.learning-v2 .lv-chev{flex:none;display:grid;place-items:center;width:26px;height:44px;color:#5a35c9}
.learning-v2 .lv-chev svg{width:22px;height:22px;transition:transform .2s}
.learning-v2 .lv-unit.closed .lv-chev svg{transform:rotate(-90deg)}
.learning-v2 .lv-uart{flex:none;display:grid;place-items:center;width:50px;height:50px;border-radius:14px;overflow:hidden;filter:drop-shadow(0 3px 4px rgba(80,50,160,.2))}
.learning-v2 .lv-uart img{width:100%;height:100%;object-fit:contain;display:block}
.learning-v2 .lv-uart .emo{font-size:30px}
.learning-v2 .lv-usep{flex:none;width:2px;align-self:stretch;margin:6px 0;border-radius:2px;background:linear-gradient(#e3d9ff,#9f86f5,#e3d9ff)}
.learning-v2 .lv-utxt{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.learning-v2 .lv-utxt b{font-size:17px;font-weight:700;line-height:1.15;color:var(--lv-ink);overflow-wrap:anywhere}
.learning-v2 .lv-utxt small{display:flex;align-items:center;gap:6px;font-size:14px;font-weight:600;color:var(--lv-ink2)}
.learning-v2 .lv-utxt small img{width:20px;height:auto;flex:none}
.learning-v2 .lv-usoon{flex:none;font-size:13px;font-weight:600;color:var(--lv-ink2);background:#ece7fb;border-radius:999px;padding:5px 10px}

/* live progress rings (green arc, readable number) */
.learning-v2 .lv-ring{--p:0;position:relative;flex:none;display:grid;place-items:center;width:42px;height:42px;border-radius:50%;
  background:conic-gradient(var(--lv-green) calc(var(--p) * 1%),#e4ddf7 0);box-shadow:0 2px 5px rgba(80,50,160,.22),0 0 0 2px #fff}
.learning-v2 .lv-ring .lv-rv{display:grid;place-items:center;width:76%;height:76%;border-radius:50%;background:radial-gradient(circle at 50% 30%,#fff,#f3efff);
  box-shadow:inset 0 1px 3px rgba(80,50,160,.18);font-size:12px;font-weight:700;color:var(--lv-ink);letter-spacing:-.2px}
.learning-v2 .lv-uring{width:48px;height:48px}
.learning-v2 .lv-uring .lv-rv{font-size:14px}

/* topics: purple timeline with round nodes */
.learning-v2 .lv-topics{position:relative;padding:10px 0 2px var(--lv-tl)}
.learning-v2 .lv-topics::before{content:"";position:absolute;left:5px;top:-4px;bottom:30px;width:4px;border-radius:2px;background:linear-gradient(#9a7bff,var(--lv-line))}
.learning-v2 .lv-unit.closed .lv-topics{display:none}
.learning-v2 .lv-topic{position:relative;margin:0 0 10px}
.learning-v2 .lv-topic::before{content:"";position:absolute;left:calc(-1 * var(--lv-tl) - 1px);top:8px;width:16px;height:16px;box-sizing:border-box;border-radius:50%;
  background:#fff;border:4px solid var(--lv-line);box-shadow:0 2px 4px rgba(80,50,160,.25)}
.learning-v2 .lv-pill{display:inline-block;max-width:100%;box-sizing:border-box;margin:0 0 7px;padding:5px 16px 6px;border-radius:999px;
  font-size:15.5px;font-weight:700;line-height:1.2;color:#2f1a72;overflow-wrap:anywhere;
  background:linear-gradient(180deg,#f5f0ff,#e3d8ff);border:1.5px solid #fff;box-shadow:0 0 0 1px #d5c5ff,0 3px 7px rgba(100,70,200,.16)}

/* game card: glossy frame, art | name | progress, arrows, play */
.learning-v2 .lv-card{position:relative;display:grid;grid-template-columns:var(--lv-art) minmax(0,1fr) max(var(--lv-play),var(--lv-ctrl));
  grid-template-areas:"art info side";align-items:center;column-gap:8px;min-height:96px;box-sizing:border-box;padding:7px 8px 7px 7px;
  border:2.5px solid #fff;border-radius:22px;background:linear-gradient(115deg,#fff4e6 0%,#fffaf1 52%,#f2f9e8 100%);
  box-shadow:0 0 0 1px rgba(200,184,255,.95),inset 0 2px 0 rgba(255,255,255,.85),0 6px 14px rgba(84,56,170,.17)}
.learning-v2 .lv-card.tone1{background:linear-gradient(115deg,#e3f2ff 0%,#f1f8ff 52%,#ecf8ef 100%)}
.learning-v2 .lv-card.tone2{background:linear-gradient(115deg,#ffe7ef 0%,#fff4f7 52%,#f5f9ec 100%)}
.learning-v2 .lv-art{grid-area:art;align-self:center;display:grid;place-items:center;width:var(--lv-art);aspect-ratio:10/9;border-radius:15px;overflow:hidden;
  background:linear-gradient(135deg,#efe8ff,#fff1dc);box-shadow:0 0 0 2px #fff,0 3px 6px rgba(80,50,160,.14)}
.learning-v2 .lv-art img{width:100%;height:100%;object-fit:cover;display:block}
.learning-v2 .lv-art.emo-art .emo{font-size:40px}
.learning-v2 .lv-info{grid-area:info;min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:3px;padding:2px 0 2px 8px;border-left:2px solid rgba(155,128,240,.42)}
.learning-v2 .lv-badges{display:flex;flex-wrap:wrap;align-items:center;gap:4px 6px}
.learning-v2 .lv-badge{display:inline-flex;align-items:center;gap:3px;padding:1px 7px 1px 4px;border-radius:999px;background:#efe8ff;font-size:12px;font-weight:700;color:#5b34cf;line-height:1.3}
.learning-v2 .lv-badge img{width:17px;height:auto;flex:none}
.learning-v2 .lv-unlocked{padding:0 6px;border:1.8px solid #34b526;border-radius:999px;background:#f4fff1;color:#1d8a12;font-size:10px;font-weight:700;letter-spacing:.4px;text-transform:uppercase;line-height:1.35}
.learning-v2 .lv-gtitle{margin:0;font-size:16.5px;font-weight:700;line-height:1.15;color:var(--lv-ink);overflow-wrap:anywhere}
.learning-v2 .lv-status{margin:0;font-size:13.5px;font-weight:600;line-height:1.3;color:#7744e2}
.learning-v2 .lv-status.new{white-space:nowrap;display:inline-flex;align-items:center;gap:4px;padding:1px 9px 1px 4px;border-radius:999px;background:#fff1c4;color:#6a3dd8}
.learning-v2 .lv-status.new img{width:17px;height:17px;flex:none}
.learning-v2 .lv-side{grid-area:side;min-width:0;display:flex;flex-direction:column;align-items:stretch;gap:8px}
.learning-v2 .lv-ctrl{display:flex;align-items:center;justify-content:space-between;gap:4px}
.learning-v2 .lv-nav{display:flex;gap:6px}
.learning-v2 .lv-arrow{position:relative;flex:none;width:30px;height:30px;padding:0;margin:0;border:0;border-radius:50%;background:none;cursor:pointer;-webkit-tap-highlight-color:transparent}
.learning-v2 .lv-arrow::before{content:"";position:absolute;inset:-7px}                 /* 44 × 44 touch area */
.learning-v2 .lv-arrow img{display:block;width:100%;height:100%;pointer-events:none}
.learning-v2 .lv-arrow:not(:disabled):active img{transform:scale(.92)}
.learning-v2 .lv-arrow:disabled{opacity:.36;filter:grayscale(.55) saturate(.6);cursor:default}
.learning-v2 .lv-arrow:focus-visible{outline:3px solid var(--lv-purple);outline-offset:2px}
/* Play / Play Again: one size everywhere (width set from the longer label, see fitPlay in app.js); blank green skin + live text */
.learning-v2 .lv-play{display:flex;align-items:center;justify-content:center;gap:7px;box-sizing:border-box;width:100%;height:42px;padding:0 11px;margin:0;
  border-style:solid;border-width:0;border-color:transparent;border-image:url(../img/learning-v2/skins/play-green.webp) 0 38 fill / 0 21px / 0 stretch;
  background:transparent;color:#fff;font:inherit;font-size:15.5px;font-weight:700;line-height:1;white-space:nowrap;cursor:pointer;
  text-shadow:0 1.5px 0 rgba(18,92,8,.6);-webkit-tap-highlight-color:transparent}
.learning-v2 .lv-play .lv-tri{width:13px;height:15px;flex:none;fill:#fff;filter:drop-shadow(0 1.5px 0 rgba(18,92,8,.6))}
.learning-v2 .lv-play:active{transform:translateY(2px);filter:brightness(.96)}
.learning-v2 .lv-play:focus-visible{outline:3px solid var(--lv-purple);outline-offset:2px}
.learning-v2 .lv-probe{position:absolute!important;left:-9999px;top:0;width:auto!important;visibility:hidden;pointer-events:none}
.learning-v2 .lv-card.soon .lv-side{align-items:flex-end}
.learning-v2 .lv-soonpill{font-size:12.5px;font-weight:600;color:var(--lv-ink2);background:#ecebf3;border-radius:999px;padding:6px 10px;text-align:center}
/* not enough room beside the name (narrow phone or a long translated label): every card puts the controls on their own row */
.learning-v2.lv-stack .lv-card{grid-template-columns:var(--lv-art) minmax(0,1fr);grid-template-areas:"art info" "side side";row-gap:7px}
.learning-v2.lv-stack .lv-side{flex-direction:row;align-items:center;gap:8px}
.learning-v2.lv-stack .lv-ctrl{gap:8px}
.learning-v2.lv-stack .lv-play{width:var(--lv-play);margin-left:auto}

/* end of list: meadow */
.learning-v2 .lv-footer{margin:6px calc(-1 * var(--lv-gut)) 0;padding-bottom:var(--safe-bot);line-height:0;pointer-events:none}
.learning-v2 .lv-footer img{display:block;width:100%;height:auto;min-height:56px;object-fit:cover;object-position:top}

/* compact phones */
@media (max-width:359px){
  .learning-v2{--lv-gut:8px;--lv-tl:17px;--lv-art:62px}
  .learning-v2 .khead{gap:4px;padding-left:6px;padding-right:6px}
  .learning-v2 .khead .lv-ib,.learning-v2 .lv-share{width:38px;height:38px}
  .learning-v2 .khead .mini-av{width:40px;height:40px}
  .learning-v2 .lv-gtitle{font-size:15.5px}
  .learning-v2 .lv-utxt b{font-size:15.5px}
  .learning-v2 .lv-pill{font-size:14.5px;padding:4px 13px 5px}
  .learning-v2 .lv-unit-h{gap:7px;padding-right:9px}
  .learning-v2 .lv-uart{width:44px;height:44px}
}
@media (min-width:420px){.learning-v2{--lv-art:82px;--lv-gut:12px}}
/* tablets: a centred column, a little bigger */
@media (min-width:700px){
  .learning-v2{--lv-art:104px;--lv-ctrl:116px}
  .learning-v2 .lv-scroll > :not(.lv-footer){max-width:660px;margin-left:auto;margin-right:auto}
  .learning-v2 .lv-scroll > .lv-unit{margin-bottom:16px}
  .learning-v2 .lv-gtitle{font-size:19px}
  .learning-v2 .lv-card{min-height:118px}
}
/* Burmese letters need taller lines */
html[lang=my] .learning-v2 :is(.lv-pill,.lv-gtitle,.lv-utxt b,.lv-utxt small,.lv-status,.lv-badge,.lv-soonpill,.lv-usoon,.subj-head){line-height:1.55}
html[lang=my] .learning-v2 .lv-play{font-size:14.5px;line-height:1.5}
html[lang=my] .learning-v2 .lv-unlocked{letter-spacing:0;font-size:11px;line-height:1.5}
html[lang=my] .learning-v2 .subj-head{font-size:clamp(18px,5.12vw,22px)}   /* 20% smaller, like English */
@media (prefers-reduced-motion:reduce){.bs-stage.bs-intro .bs-book,.learning-v2 .subj-head.lv-head-intro{animation:none}.learning-v2 .lv-chev svg{transition:none}}

/* ---- the same top row on other screens (Fun Games lobby + inside a fun game), 2026-11-29 ----
   kidBar() wraps the row in .learn2.learning-v2.kh-solo so it borrows the rules above without the page background */
.learning-v2.kh-solo{background:none;flex:none;position:relative;z-index:3}
.learning-v2.kh-solo .khead{padding-bottom:6px}
.funplay .learning-v2.kh-solo{background:linear-gradient(180deg,#b6acff,#cdc8ff);border-radius:0 0 18px 18px;box-shadow:0 3px 10px rgba(40,20,110,.25)}
.funplay .fun-frame{min-height:0}
/* Fun Games tile: "10 coins" lock badge until the game is unlocked */
.fun-tile{position:relative}
.fun-tile .fun-lock{position:absolute;top:8px;right:8px;display:flex;align-items:center;gap:3px;padding:3px 9px 3px 4px;border-radius:999px;background:linear-gradient(#ffe27a,#ffc93d);box-shadow:inset 0 -3px 0 #e6a613,0 3px 6px rgba(80,40,0,.25);color:#2a1b5c;font-size:15px;pointer-events:none}
.fun-tile .fun-lock img{width:22px;height:22px}
