/* Listening Lab (js/listening.js). Everything on its pages sits under body.ll-mode: a light lilac look with violet accents, so a student
 * never mistakes it for eHomework. The colours are the few variables right below - change them here to try another look. */

/* ---- home tile (orange: no other tile uses it) ---- */
.tile[hidden] { display: none; }
.tile-ll { background: linear-gradient(160deg, #ffb340, #ff7a00); color: #fff; border-color: #e56a00; }
.ll-tile-svg { width: 2.7rem; height: 2.7rem; display: block; }
.tile-ll .tile-icon { color: #ff7a00; background: #fff; border-radius: 50%; width: 84px; height: 84px; display: inline-flex; align-items: center; justify-content: center; }
[data-theme="fun"] .tile-ll { background: #ff9f1c; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .2); }
[data-theme="fun"] .tile-ll .tile-icon i { color: #ff7a00; }

/* ---- the lilac look ---- */
html body.ll-mode {
  --bg: #f1ecff; --card: #ffffff; --line: #d9ccff; --brand: #7c4dff; --brand-dark: #5b34d6; --muted: #6f5fa3;
  --header: #7c4dff; --header-dark: #5b34d6;
  background-color: #f1ecff; background-image: none;
}
body.ll-mode .ll-page { background: transparent; border: 0; box-shadow: none; padding: 4px 0 24px; max-width: 640px; margin: 0 auto; }
.ll-page[hidden], .ll-view[hidden] { display: none; }
body.ll-mode .hw-opt { background: #fff; border-color: #d9ccff; }
body.ll-mode .hw-opt.selected { background: #e0d4ff; border-color: #7c4dff; color: #4a2bb0; font-weight: 700; } /* the chosen answer: stronger lilac */
body.ll-mode .hw-opt.correct { background: #dcfce7; border-color: #16a34a; color: #15803d; }
body.ll-mode .hw-opt.wrong { background: #ffecef; border-color: var(--rec); color: var(--rec); }
body.ll-mode .hw-opt:disabled { opacity: 1; }
body.ll-mode .hw-speak-btn { border-color: #d9ccff; color: #5b34d6; }
body.ll-mode .hw-speak-btn.playing { background: #7c4dff; border-color: #7c4dff; color: #fff; }
body.ll-mode .hw-obj-feedback { margin-top: 14px; }
body.ll-mode .btn.primary { background: #7c4dff; border-color: #7c4dff; }
body.ll-mode .btn.primary:active { background: #5b34d6; }
body.ll-mode .tp-page, body.ll-mode .hw-summary { background: transparent; }

/* ---- header: the journey strip replaces the title, Back stays on the right ---- */
/* the slim header stays at the top while the page scrolls, so the walker is always in view */
body.ll-mode .top-mini { position: sticky; top: 0; z-index: 60; align-items: flex-end; }
body.ll-mode .top-mini .mini-stars { display: none; }
.top-mini .mini-sub { display: none; }
body.ll-mode .top-mini .mini-sub { display: block; margin-top: 2px; font-size: .85rem; font-weight: 700; color: #fff; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.ll-strip-on .top-mini .hw-res-title { display: none; }
/* no Back button while the journey strip is shown (the phone's Back button and the Done / Home buttons do it): the strip uses the whole width */
body.ll-strip-on #mini-back { display: none; }
.ll-strip { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ll-strip[hidden] { display: none; }
.ll-strip-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 4px; }
.ll-strip-label { font-size: .78rem; font-weight: 900; letter-spacing: .3px; color: #efe9ff; line-height: 1.1; }
.ll-strip-count { font-size: .78rem; font-weight: 900; color: #ffd43b; line-height: 1.1; font-variant-numeric: tabular-nums; }

/* The path: a little landscape. Three layers of scenery (clouds, hills, trees) slide past at different speeds while the walker walks, on a road with
   a dashed centre line. A yellow line along the road fills as questions are mastered. --p (0..1) is the share of the level mastered; the walker's
   place follows it. The scenery layers are clipped to the rounded box (.ll-world); the walker and the destination are not, so a hop is never cut off. */
.ll-track { position: relative; height: 76px; --p: 0;
  /* the traveller of the level (css/listening-themes.css changes these for each level): width, height, height above the bottom, how far it climbs, the height of
     the yellow / dotted line, the height of the destination */
  --aw: 36px; --ah: 58px; --abase: 8px; --rise: 0px; --lane: 12px; --goalb: 9px; }
.ll-world { position: absolute; inset: 0; border-radius: 16px; overflow: hidden; background: linear-gradient(#3f9bff 0%, #6cbcff 55%, #bfe6ff 100%);
  border: 3px solid rgba(255, 255, 255, .78); /* the soft frame that makes the strip stand out from the header */
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .2), 0 5px 14px rgba(32, 8, 110, .38), 0 0 18px rgba(255, 255, 255, .22); }
.ll-sc { position: absolute; inset: 0; background-repeat: repeat-x; background-position: 0 0; animation: ll-scroll linear infinite; animation-play-state: paused; }
.ll-sc1 { background-size: 240px 76px; --d: 9.6s; --w: 240px; animation-duration: var(--d);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='76' viewBox='0 0 240 76'><g fill='%23ffffff' fill-opacity='.92'><ellipse cx='36' cy='16' rx='16' ry='6'/><ellipse cx='50' cy='12' rx='11' ry='6'/><ellipse cx='150' cy='27' rx='14' ry='5'/><ellipse cx='162' cy='23' rx='10' ry='5.5'/><ellipse cx='214' cy='11' rx='12' ry='5'/></g><circle cx='104' cy='15' r='7' fill='%23ffd84a'/></svg>"); }
.ll-sc2 { background-size: 200px 76px; --d: 4s; --w: 200px; animation-duration: var(--d);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='76' viewBox='0 0 200 76'><path d='M0 76 L0 50 Q30 28 60 48 Q90 64 120 42 Q150 22 180 44 Q192 52 200 50 L200 76Z' fill='%2395d9a2'/><path d='M0 76 L0 60 Q40 44 80 60 Q120 72 160 56 Q184 48 200 60 L200 76Z' fill='%2368c27d'/></svg>"); }
.ll-sc3 { background-size: 160px 76px; --d: 1.6s; --w: 160px; animation-duration: var(--d);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='76' viewBox='0 0 160 76'><rect x='28' y='38' width='5' height='22' rx='2' fill='%238b5a2b'/><circle cx='30.5' cy='32' r='13' fill='%2330a95c'/><circle cx='24' cy='39' r='8' fill='%23238c4a'/><circle cx='38' cy='38' r='7' fill='%23238c4a'/><rect x='103' y='46' width='4' height='14' rx='2' fill='%238b5a2b'/><circle cx='105' cy='41' r='9' fill='%2330a95c'/><ellipse cx='70' cy='56' rx='11' ry='7' fill='%23238c4a'/><ellipse cx='76' cy='58' rx='7' ry='5' fill='%2330a95c'/><circle cx='134' cy='57' r='2.2' fill='%23ff8fb1'/><circle cx='142' cy='58' r='2.2' fill='%23ffd43b'/><circle cx='150' cy='57' r='2.2' fill='%23ff8fb1'/><circle cx='9' cy='58' r='2.2' fill='%23ffd43b'/></svg>"); }
.ll-track.walking .ll-sc, .ll-track.walking .ll-dash { animation-play-state: running; }
.ll-track.run .ll-dash { animation-duration: .16s; }
.ll-track.run .ll-sc { animation-duration: calc(var(--d) / 2); }
@keyframes ll-scroll { from { background-position-x: 0; } to { background-position-x: calc(var(--w) * -1); } }
.ll-road { position: absolute; left: 0; right: 0; bottom: 0; height: 17px; background: linear-gradient(#2c2c31, #0d0d10); }
.ll-dash { position: absolute; left: 0; right: 0; bottom: 3px; height: 3px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .6) 0 14px, transparent 14px 32px); background-size: 32px 3px; animation: ll-dash .32s linear infinite; animation-play-state: paused; } /* the white road marking, always there */
@keyframes ll-dash { from { background-position-x: 0; } to { background-position-x: -32px; } }
.ll-ground { position: absolute; left: 0; right: 0; bottom: var(--lane); height: 5px; } /* the yellow line: the way already walked */
.ll-ground::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: calc((100% - 64px - var(--aw)) * var(--p) + var(--aw) / 2 + 6px); border-radius: 0 3px 3px 0; background: #ffd43b; box-shadow: 0 0 6px rgba(255, 212, 59, .7); transition: width 1.6s cubic-bezier(.45, .05, .55, .95); }
.ll-goal { position: absolute; right: 6px; bottom: var(--goalb); font-size: 2.3rem; line-height: 1; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .22)); }

.ll-walker { position: absolute; bottom: calc(var(--abase) + var(--rise) * var(--p)); left: calc((100% - 64px - var(--aw)) * var(--p) + 4px); width: var(--aw); height: var(--ah); transition: left 1.6s cubic-bezier(.45, .05, .55, .95), bottom 1.6s cubic-bezier(.45, .05, .55, .95); transform-origin: 50% 100%; --T: .8s; }
.ll-walker.run { --T: .45s; }
.ll-walker svg { width: 100%; height: 100%; display: block; overflow: visible; }
.ll-walker .lm { transform-box: view-box; }
/* standing: everything at rest. Walking: a real stride - thighs swing from the hip, shins bend at the knee on the way forward, the arms swing against the legs,
   the body bobs twice a stride. Legs/arms of the far side run half a stride behind. */
.ll-walker.walking .thigh { animation: ll-hip var(--T) ease-in-out infinite; }
.ll-walker.walking .shin { animation: ll-knee var(--T) ease-in-out infinite; }
.ll-walker.walking .uarm { animation: ll-shoulder var(--T) ease-in-out infinite; }
.ll-walker.walking .farm { animation: ll-elbow var(--T) ease-in-out infinite; }
.ll-walker.walking .far { animation-delay: calc(var(--T) / -2); }
.ll-walker.walking .upper { animation: ll-bob calc(var(--T) / 2) ease-in-out infinite; }
.ll-walker.walking .tail { animation: ll-sway calc(var(--T) / 2) ease-in-out infinite alternate; }
.ll-walker.run svg { transform: rotate(7deg); transform-origin: 50% 100%; }
.ll-walker.run::before { content: ''; position: absolute; right: 100%; top: 14px; width: 18px; height: 14px; margin-right: -2px;
  background: linear-gradient(rgba(255,255,255,.7), rgba(255,255,255,.7)) 0 0 / 100% 2px no-repeat, linear-gradient(rgba(255,255,255,.55), rgba(255,255,255,.55)) 4px 6px / 80% 2px no-repeat, linear-gradient(rgba(255,255,255,.7), rgba(255,255,255,.7)) 0 12px / 100% 2px no-repeat; animation: ll-speed .25s linear infinite; }
@keyframes ll-hip { 0%, 100% { transform: rotate(-30deg); } 50% { transform: rotate(30deg); } }
@keyframes ll-knee { 0% { transform: rotate(6deg); } 50% { transform: rotate(10deg); } 75% { transform: rotate(70deg); } 100% { transform: rotate(6deg); } }
@keyframes ll-shoulder { 0%, 100% { transform: rotate(32deg); } 50% { transform: rotate(-32deg); } }
@keyframes ll-elbow { 0%, 100% { transform: rotate(-18deg); } 50% { transform: rotate(-52deg); } }
@keyframes ll-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.6px); } }
@keyframes ll-sway { from { transform: rotate(-9deg); } to { transform: rotate(11deg); } }
@keyframes ll-speed { from { opacity: 1; transform: translateX(0); } to { opacity: .3; transform: translateX(-6px); } }

/* a wrong answer: the walker stumbles forward, flails, and gets up again (it stays where it is) */
.ll-walker.trip { animation: ll-trip 1.5s ease-in-out; }
.ll-walker.trip .uarm { animation: ll-flail .25s ease-in-out 4 alternate; }
@keyframes ll-trip { 0% { transform: rotate(0); } 22% { transform: rotate(14deg) translateX(3px); } 42% { transform: rotate(78deg) translate(6px, 4px); } 72% { transform: rotate(78deg) translate(6px, 4px); } 90% { transform: rotate(-6deg); } 100% { transform: rotate(0); } }
@keyframes ll-flail { from { transform: rotate(-120deg); } to { transform: rotate(-170deg); } }
.ll-oops { position: absolute; bottom: calc(var(--abase) + var(--rise) * var(--p) + var(--ah) * .6); font-size: 1.15rem; left: calc((100% - 64px - var(--aw)) * var(--p) + var(--aw) + 8px); animation: ll-oops 1.5s ease-out forwards; pointer-events: none; }
@keyframes ll-oops { 0% { opacity: 0; transform: translateY(8px) scale(.5); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px) scale(1.3); } }

/* a right answer ends with a little hop and a wave; at the destination the walker cheers with both arms up */
.ll-walker.hop { animation: ll-hop .55s ease-out; }
@keyframes ll-hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-9px); } 70% { transform: translateY(0); } 85% { transform: translateY(-3px); } }
.ll-walker.hop .uarm.near { animation: ll-wave .55s ease-in-out; }
@keyframes ll-wave { 0%, 100% { transform: rotate(0); } 30%, 70% { transform: rotate(-150deg); } }
.ll-walker.cheer { animation: ll-jump .6s ease-in-out 4; }
.ll-walker.cheer .uarm { transform: rotate(-155deg); animation: none; }
@keyframes ll-jump { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@media (prefers-reduced-motion: reduce) { .ll-walker, .ll-ground::before { transition: none; } .ll-walker .lm, .ll-walker .upper, .ll-sc, .ll-dash { animation: none !important; } }

/* ---- home ---- */
.ll-card { background: #fff; border: 2px solid #d9ccff; border-radius: 18px; padding: 18px 16px; margin: 0 0 16px; text-align: center; box-shadow: 0 3px 10px rgba(91, 52, 214, .08); }
.ll-card h3 { margin: 0 0 4px; font-size: 1.35rem; color: #4a2bb0; }
.ll-card p { margin: 6px 0 12px; color: var(--ink); line-height: 1.45; }
.ll-card .btn { min-width: min(190px, 100%); font-size: 1.1rem; padding: 12px 18px; }
.ll-card .ll-sub { color: #6f5fa3; font-weight: 700; margin: 0 0 10px; }
.ll-card.done { background: #f6f2ff; }
.ll-big { font-size: 2.6rem; line-height: 1; margin-bottom: 6px; }
.ll-h { margin: 18px 4px 8px; font-size: 1.05rem; color: #4a2bb0; }
.ll-levels { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ll-level { display: flex; align-items: center; gap: 12px; background: #fff; border: 2px solid #e5dcff; border-radius: 14px; padding: 10px 14px; }
.ll-level .ll-medal { font-size: 1.8rem; line-height: 1; }
.ll-level b { display: block; font-size: 1.05rem; color: #4a2bb0; }
.ll-level small { color: #6f5fa3; font-weight: 700; }
/* the voice tip: an announcement box with a Later button */
.ll-tip { margin: 0 0 12px; padding: 10px 12px 10px; background: #fff7d6; border: 2px solid #ffd866; border-radius: 14px; }
.ll-tip-head { display: flex; align-items: center; gap: 8px; color: #7a5200; font-size: 1rem; }
.ll-tip-ico { font-size: 1.2rem; }
.ll-tip-text { margin: 6px 0 8px; font-weight: 700; font-size: .95rem; line-height: 1.45; color: #5c3f00; }
.ll-tip-foot { display: flex; justify-content: flex-start; gap: 8px; flex-wrap: nowrap; }
.ll-tip-foot .ll-tip-btn { flex: 1 1 0; min-width: 0; padding: 8px 8px; }
.ll-tip-btn { border: 0; border-radius: 10px; padding: 8px 18px; background: #ffb703; color: #3d2a00; font: inherit; font-weight: 900; box-shadow: 0 3px 0 #c98900; }
.ll-tip-btn { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.2; }
.ll-tip-btn small { font-size: .7rem; font-weight: 700; }
.ll-tip-btn.go { background: #22b95a; color: #fff; box-shadow: 0 3px 0 #168a40; }
.ll-tip-text.ta { margin-top: 0; }
.ll-tip-btn:active { transform: translateY(3px); box-shadow: none; }
.ll-hcount { display: block; font-size: .8rem; font-weight: 700; color: #6f5fa3; margin-top: 2px; }
.ll-map { position: relative; margin: 4px 0 0; background: linear-gradient(#f3eaff, #fff4d6); border: 2px solid #e5dcff; border-radius: 18px; overflow: hidden; }
.ll-trail { position: absolute; inset: 0; width: 100%; height: 100%; }
.ll-trail path { fill: none; stroke: #b79cf5; stroke-width: 5; stroke-dasharray: 2 11; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ll-node { position: absolute; transform: translate(-50%, -34px); display: flex; flex-direction: column; align-items: center; width: 44%; padding: 0; border: 0; background: none; font: inherit; cursor: default; }
.ll-demo-on .ll-node, .ll-node.cur { cursor: pointer; }
.ll-nbadge { position: relative; }
.ll-nmedal { position: absolute; right: -8px; bottom: -8px; font-style: normal; font-size: 1.15rem; line-height: 1; background: #fff; border-radius: 50%; padding: 2px; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.ll-nbadge { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.9rem; line-height: 1; background: #e9e4f5; border: 4px solid #cfc6e6; box-shadow: 0 5px 0 #b8aed6; filter: grayscale(.6); opacity: .85; }
.ll-ntxt { margin-top: 8px; background: rgba(255, 255, 255, .88); border-radius: 10px; padding: 2px 8px; line-height: 1.2; }
.ll-ntxt b { display: block; font-size: .95rem; color: #4a2bb0; }
.ll-ntxt small { display: block; font-size: .72rem; font-weight: 700; color: #6f5fa3; }
.ll-node.done .ll-nbadge { background: #ffe9a8; border-color: #ffc83d; box-shadow: 0 5px 0 #d99a00; filter: none; opacity: 1; }
.ll-node.done.silver .ll-nbadge { background: #eef1f6; border-color: #b9c2d0; box-shadow: 0 5px 0 #8a96a8; }
.ll-node.done.bronze .ll-nbadge { background: #f7dcc3; border-color: #d08a4e; box-shadow: 0 5px 0 #a4672f; }
.ll-node.cur .ll-nbadge { background: #7c4dff; border-color: #fff; box-shadow: 0 5px 0 #4a2bb0, 0 0 0 5px rgba(124, 77, 255, .3); filter: none; opacity: 1; animation: ll-bob 1.4s ease-in-out infinite; }
.ll-node.cur .ll-ntxt b { color: #7c4dff; }
.ll-node.last .ll-nbadge { background: #fff0c2; border-color: #ffc83d; box-shadow: 0 5px 0 #d99a00; filter: none; opacity: 1; }
@keyframes ll-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .ll-node.cur .ll-nbadge { animation: none; } }
.ll-empty { background: #fff; border: 2px dashed #cdbcff; border-radius: 14px; padding: 16px; text-align: center; color: #6f5fa3; font-weight: 700; line-height: 1.45; }
.ll-demo { margin-top: 14px; text-align: center; }
.ll-demo .btn { font-size: .9rem; padding: 8px 12px; background: #fff; }

/* ---- quiz ---- */
.ll-count { margin: 4px 4px 10px; text-align: center; font-weight: 800; color: #6f5fa3; }
.ll-player { background: #fff; border: 2px solid #d9ccff; border-radius: 18px; padding: 12px 14px 12px; margin: 0 0 16px; box-shadow: 0 3px 10px rgba(91, 52, 214, .08); }
.ll-reader { width: 100%; aspect-ratio: 2.2 / 1; margin: 0 auto 10px; border-radius: 14px; overflow: hidden; border: 2px solid #e5dcff; }
.ll-reader svg { width: 100%; height: 100%; display: block; }
.ll-reader .ch { transform-box: fill-box; transform-origin: 50% 100%; }
.ll-reader .mo { display: none; }
.ll-reader[data-m="0"] .mo0, .ll-reader[data-m="1"] .mo1, .ll-reader[data-m="2"] .mo2, .ll-reader[data-m="3"] .mo3 { display: inline; }
.ll-reader .eyes { animation: ll-blink 4.2s infinite; transform-box: fill-box; transform-origin: 50% 50%; }
@keyframes ll-blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
.ll-reader.cheer .ch { animation: ll-jump-s .6s ease-in-out 2; }
.ll-reader.think .ch { transform: rotate(-4deg); }
@keyframes ll-jump-s { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.ll-player-main { display: flex; align-items: center; gap: 12px; }
.ll-play { flex: none; width: 54px; height: 54px; border-radius: 50%; border: 0; background: #7c4dff; color: #fff; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 3px 0 #5b34d6; }
.ll-play:active { transform: translateY(3px); box-shadow: none; }
.ll-play svg { width: 24px; height: 24px; fill: currentColor; display: block; }
.ll-bar { flex: 1; height: 12px; border-radius: 8px; background: #e5dcff; overflow: hidden; }
.ll-bar span { display: block; height: 100%; width: 0; border-radius: 8px; background: linear-gradient(90deg, #a98bff, #7c4dff); transition: width .25s linear; }
.ll-time { flex: none; min-width: 3.4em; text-align: right; font-weight: 900; font-size: 1.15rem; color: #4a2bb0; font-variant-numeric: tabular-nums; }
.ll-hint { margin: 10px 0 0; text-align: center; font-weight: 700; color: #6f5fa3; }
.ll-hint[hidden] { display: none; }
.ll-startq { display: block; width: 100%; margin: 34px 0 8px; padding: 15px 18px; font-size: 1.1rem; background: #22b95a; border-color: #22b95a; color: #fff; box-shadow: 0 4px 0 #168a40; animation: ll-reveal .35s ease-out; }
.ll-startq:active { transform: translateY(4px); box-shadow: none; }
/* the generic purple primary button (body.ll-mode .btn.primary, the fun theme) is more specific than .ll-startq alone, so this repeats it to stay green */
body.ll-mode .btn.primary.ll-startq, [data-theme="fun"] body.ll-mode .btn.primary.ll-startq, body.ll-mode[data-theme="fun"] .btn.primary.ll-startq { background: #22b95a; border-color: #22b95a; color: #fff; }
body.ll-mode .btn.primary.ll-startq:active { background: #168a40; border-color: #168a40; }
.ll-startq[hidden] { display: none; }
.ll-after[hidden] { display: none; }
.ll-after { animation: ll-reveal .35s ease-out; }
@keyframes ll-reveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
#ll-qrow[hidden] { display: none; }
.ll-nav { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }
.ll-nav .btn { min-width: min(150px, 100%); flex: 1 1 auto; font-size: 1.05rem; padding: 12px 18px; }
.ll-nav .btn[hidden] { display: none; }

/* ---- day / level result ---- */
.ll-result .ll-big { font-size: 3.2rem; }
.ll-score-line { font-size: 1.8rem; font-weight: 900; color: #4a2bb0; margin: 4px 0; }
.ll-review { list-style: none; margin: 0 0 12px; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 10px; }
.ll-review li { background: #fff; border: 2px solid #ffd0d8; border-radius: 14px; padding: 10px 12px; }
.ll-review .ll-r-q { margin: 0 0 6px; font-weight: 700; color: var(--ink); line-height: 1.4; }
.ll-review .ll-r-a { margin: 0; color: #15803d; font-weight: 800; line-height: 1.4; }
.ll-review .ll-r-e { margin: 4px 0 0; color: #5b4d86; line-height: 1.4; }
.ll-review .ll-r-play { margin-top: 8px; }
.ll-btns { display: flex; flex-direction: column; gap: 10px; align-items: center; margin-top: 8px; }
.ll-btns .btn { min-width: min(220px, 100%); max-width: 100%; font-size: 1.05rem; padding: 12px 18px; }

/* a little room under the quiz buttons; the page scrolls (js/listening.js: scrollQuestionUp / showButton) only as far as that room allows */
#ll-quiz { padding-bottom: 0; }
body.ll-mode .ll-page { padding-bottom: 8px; } /* with the page's own margin this leaves about two lines of room under the buttons, no more */
.ll-nav { min-height: 56px; }
body.ll-mode .ll-page .status:empty { display: none; } /* the note line under the pages takes no room while it has no text */

/* ---- idle: while the walker stands still it does something now and then (wave, jump, pump the arms, look around, dance) to catch the student's eye.
   js/listening.js adds one of these classes every few seconds; they never run during a walk, a stumble or a hop. ---- */
.ll-walker.idle-wave .uarm.near { animation: ll-idle-wave 1.5s ease-in-out; }
.ll-walker.idle-wave .farm.near { animation: ll-idle-fore .3s ease-in-out 5 alternate; }
@keyframes ll-idle-wave { 0% { transform: rotate(0); } 18% { transform: rotate(-150deg); } 82% { transform: rotate(-150deg); } 100% { transform: rotate(0); } }
@keyframes ll-idle-fore { from { transform: rotate(-5deg); } to { transform: rotate(-55deg); } }
.ll-walker.idle-jump { animation: ll-jump .5s ease-in-out 3; }
.ll-walker.idle-jump .uarm { transform: rotate(-158deg); }
.ll-walker.idle-arms { animation: ll-hop .5s ease-out 3; }
.ll-walker.idle-arms .uarm.near { animation: ll-pump .5s ease-in-out 3 alternate; }
.ll-walker.idle-arms .uarm.far { animation: ll-pump .5s ease-in-out 3 alternate-reverse; }
@keyframes ll-pump { from { transform: rotate(-172deg); } to { transform: rotate(-105deg); } }
.ll-walker.idle-look svg { animation: ll-look 1.9s ease-in-out; transform-origin: 50% 100%; }
@keyframes ll-look { 0%, 100% { transform: scaleX(1); } 22%, 40% { transform: scaleX(-1); } 58%, 76% { transform: scaleX(1); } 84% { transform: scaleX(-1); } 94% { transform: scaleX(1); } }
.ll-walker.idle-dance { animation: ll-dance .8s ease-in-out 2; }
.ll-walker.idle-dance .uarm.near { animation: ll-pump .4s ease-in-out 4 alternate; }
.ll-walker.idle-dance .uarm.far { animation: ll-pump .4s ease-in-out 4 alternate-reverse; }
@keyframes ll-dance { 0%, 100% { transform: rotate(0) translateY(0); } 25% { transform: rotate(-9deg) translateY(-4px); } 50% { transform: rotate(0) translateY(0); } 75% { transform: rotate(9deg) translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .ll-walker[class*="idle-"], .ll-walker[class*="idle-"] * { animation: none !important; } }

/* ---- the path still to walk: white dots on the road from the walker to the destination (the yellow line behind it is what was done). They are NOT shown
   all the time: only while the walker does an idle animation - then they appear, blink and march towards the goal, and the goal pulses, so the
   student sees how far it is to go. ---- */
.ll-remain { position: absolute; bottom: var(--lane); height: 5px; left: calc((100% - 64px - var(--aw)) * var(--p) + var(--aw) / 2 + 8px); right: 54px;
  background-image: radial-gradient(circle at 3px 2.5px, #fff 2.2px, rgba(255, 255, 255, 0) 2.8px); background-size: 12px 5px; background-repeat: repeat-x; opacity: 0;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, .6)); transition: left 1.6s cubic-bezier(.45, .05, .55, .95); pointer-events: none; }
.ll-track.done .ll-remain { opacity: 0; }
.ll-track.idle .ll-remain { animation: ll-remain-show 2.1s ease-in-out both, ll-march .9s linear infinite; } /* appears with the idle animation, blinks, fades out with it */
.ll-track.idle .ll-goal { animation: ll-goal-pulse .5s ease-in-out infinite alternate; transform-origin: 50% 100%; }
@keyframes ll-remain-show { 0% { opacity: 0; } 8% { opacity: 1; } 20% { opacity: .2; } 32% { opacity: 1; } 44% { opacity: .2; } 56% { opacity: 1; } 68% { opacity: .2; } 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes ll-march { from { background-position-x: 0; } to { background-position-x: 12px; } }
@keyframes ll-goal-pulse { from { transform: scale(1); } to { transform: scale(1.2); } }
@media (prefers-reduced-motion: reduce) { .ll-track.idle .ll-remain, .ll-track.idle .ll-goal { animation: none !important; } }

/* the theme of a level on the home card / the level list, and the demo student's tools */
.ll-level small { display: block; }
.ll-demo { background: #fff; border: 2px dashed #cdbcff; border-radius: 14px; padding: 12px; }
.ll-demo-label { display: block; margin: 0 0 6px; font-weight: 800; color: #4a2bb0; }
.ll-pick-row { display: flex; gap: 8px; align-items: stretch; }
.ll-pick-row select { flex: 1; min-width: 0; font: inherit; font-weight: 700; padding: 10px; border-radius: 10px; border: 2px solid #d9ccff; background: #fff; color: #2b2140; }
.ll-pick-row .btn { min-width: 84px; font-size: 1rem; padding: 10px 14px; }
.ll-demo-btns { display: flex; gap: 8px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.ll-demo-btns .btn { font-size: .9rem; padding: 8px 12px; background: #fff; }

/* The "Great job!" box in the Listening Lab: a warm green card, so it stands out from the white options and the lilac page. */
body.ll-mode .hw-cheer-card, body.ll-mode[data-theme] .hw-cheer-card, [data-theme="fun"] body.ll-mode .hw-cheer-card { background: linear-gradient(180deg, #e3fbe9 0%, #b9f0c9 100%); border-color: #1f8a4c; }
body.ll-mode .hw-cheer-msg, [data-theme="fun"] body.ll-mode .hw-cheer-msg { color: #0f6a37; }
