/* AI-4Kids class player (/lesson). Uses the tokens and thumb colors from assets/styles.css; dark mode via [data-theme="dark"]. */
.cl-head { background: linear-gradient(180deg, var(--tint), transparent); padding: 28px 0 12px; }
.cl-back { display: inline-block; font-weight: 800; text-decoration: none; padding: 10px 0; margin: -10px 0 0; } /* 44px tap height for kids */
.cl-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.cl-tag { background: var(--bg); border: 2px solid var(--line); color: var(--ink-2); font-size: .8rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.cl-tag--free { background: var(--green); border-color: var(--green); color: #fff; }
.cl-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); color: var(--indigo); margin-bottom: 6px; }
.cl-lead { margin: 0; color: var(--ink-2); font-weight: 600; }

.cl-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; padding: 16px 0 56px; align-items: start; }
.cl-player { min-width: 0; }

/* Stage: the "video" */
.cl-stage { position: relative; aspect-ratio: 16 / 9; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); color: #12224a; }
.cl-scene { position: absolute; inset: 0 0 64px; display: grid; place-items: center; padding: 18px 22px 0; }
.cl-s { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; position: relative; }
.cl-s h2 { font-size: clamp(1.05rem, 2.6vw, 1.7rem); margin: 0; color: #12224a; }
.cl-big { width: min(34%, 220px); height: auto; filter: drop-shadow(0 12px 14px rgba(0,0,0,.18)); }
.cl-s--intro .cl-big { width: min(30%, 200px); }
.cl-s--intro h2 { font-size: clamp(1.4rem, 3.6vw, 2.4rem); color: var(--indigo); }
.cl-pop { animation: cl-pop .7s cubic-bezier(.2, 1.6, .4, 1) both, cl-float 3.2s ease-in-out .7s infinite; }
.cl-pulse { animation: cl-pulse 1.2s ease-in-out infinite; }
.cl-fx { position: absolute; width: clamp(40px, 9%, 80px); height: auto; opacity: .95; animation: cl-pop .6s .4s both, cl-float 2.8s ease-in-out 1s infinite; }
.cl-fx--0 { left: 14%; top: 14%; }
.cl-fx--1 { right: 14%; bottom: 14%; animation-delay: .7s, 1.4s; }
/* Backdrop and Pixel, the host (assets/lesson/art.js) */
.cl-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cl-cloud { animation: cl-drift 26s ease-in-out infinite alternate; }
.cl-cloud--b { animation-duration: 34s; animation-direction: alternate-reverse; }
.cl-host { position: absolute; left: 3%; bottom: 66px; width: clamp(70px, 19%, 190px); transition: left .5s, bottom .5s, width .5s; z-index: 1; }
.cl-host svg { display: block; width: 100%; height: auto; overflow: visible; }
.cl-pixel__body { animation: cl-float 3s ease-in-out infinite; }
.cl-pixel__arm { transform-origin: 128px 112px; }
.cl-stage:not([data-kind]) .cl-pixel__arm, .cl-stage[data-kind="intro"] .cl-pixel__arm, .cl-stage.is-cheer .cl-pixel__arm { animation: cl-wave 1.1s ease-in-out infinite; }
.cl-pixel__eyes { transform-origin: 80px 64px; animation: cl-blink 4.2s infinite; }
.cl-pixel__mouth { opacity: 0; transform-origin: 80px 85px; }
.cl-stage.is-talking .cl-pixel__smile { opacity: 0; }
.cl-stage.is-talking .cl-pixel__mouth { opacity: 1; animation: cl-talk .26s ease-in-out infinite alternate; }
.cl-stage.is-cheer .cl-pixel__head { transform-origin: 80px 120px; animation: cl-hop .5s ease-in-out 2; }
.cl-stage[data-kind="list"] .cl-host, .cl-stage[data-kind="check"] .cl-host { left: auto; right: 2%; width: clamp(48px, 9%, 86px); bottom: 64px; }
.cl-stage[data-kind="check"] .cl-host { bottom: auto; top: 10px; }
.cl-stage[data-kind="intro"] .cl-scene, .cl-stage[data-kind="say"] .cl-scene, .cl-stage[data-kind="try"] .cl-scene { padding-left: 20%; }
.cl-s--say::before, .cl-s--intro::before, .cl-s--try::before { content: ""; position: absolute; width: min(48%, 300px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.95) 0 45%, rgba(255,255,255,0) 70%); top: 50%; left: 50%; translate: -50% -56%; }
.cl-s > * { position: relative; }
.cl-s--intro h2 { background: rgba(255,255,255,.85); padding: 6px 18px; border-radius: 16px; }
.cl-stars { position: absolute; left: 12px; top: 10px; z-index: 2; display: flex; gap: 2px; background: rgba(255,255,255,.85); border-radius: 999px; padding: 4px 10px; font-size: 1.1rem; }
.cl-stars b { color: #c3cde6; transition: color .3s, transform .3s; }
.cl-stars b.is-on { color: #ffb020; transform: scale(1.15); }
.cl-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 4; }
.cl-confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 3px; animation: cl-fall 1.5s cubic-bezier(.25, .6, .4, 1) both; }

.cl-items { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(8px, 2vw, 18px); width: 100%; }
.cl-items li { background: rgba(255,255,255,.85); border-radius: 18px; padding: clamp(8px, 1.6vw, 16px); display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 800; font-size: clamp(.8rem, 1.7vw, 1.05rem); line-height: 1.2;
  opacity: 0; transform: translateY(14px) scale(.9); transition: opacity .4s, transform .5s cubic-bezier(.2, 1.6, .4, 1); }
.cl-items li.is-on { opacity: 1; transform: none; }
.cl-items img { width: clamp(40px, 9vw, 96px); height: auto; }

.cl-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(8px, 2vw, 16px); width: 100%; }
.cl-opts--text { grid-template-columns: repeat(2, minmax(0, 220px)); justify-content: center; }
.cl-opt { background: #fff; border: 3px solid transparent; border-radius: 18px; padding: clamp(8px, 1.6vw, 14px); display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer;
  font-weight: 800; font-size: clamp(.78rem, 1.6vw, 1rem); line-height: 1.2; color: #12224a; box-shadow: 0 4px 0 rgba(18,34,74,.15); transition: transform .12s; }
.cl-opts--text .cl-opt { font-size: clamp(1rem, 2.4vw, 1.5rem); padding: 18px; }
.cl-opt:hover:not(:disabled) { transform: translateY(-3px); }
.cl-opt img { width: clamp(36px, 8vw, 84px); height: auto; }
.cl-opt.is-right { border-color: var(--green); background: #e3f7ee; animation: cl-pop .5s both; }
.cl-opt.is-wrong { border-color: var(--red); opacity: .55; animation: cl-shake .4s; }
.cl-opt:disabled { cursor: default; }
.cl-hint { margin: 0; font-weight: 800; color: var(--indigo); }

.cl-turn { margin: 0; font-weight: 900; font-size: clamp(1.1rem, 3vw, 1.8rem); color: var(--magenta); }
.cl-prompt { margin: 0; background: #fff; border-radius: 16px; padding: 10px 18px; font-weight: 800; font-size: clamp(1rem, 2.6vw, 1.6rem); }

.cl-cap { position: absolute; left: 12px; right: 12px; bottom: 10px; margin: 0; min-height: 46px; display: flex; align-items: center; justify-content: center; text-align: center;
  background: rgba(18,34,74,.88); color: #fff; border-radius: 14px; padding: 6px 14px; font-weight: 700; font-size: clamp(.82rem, 1.8vw, 1.12rem); line-height: 1.3; }

.cl-poster, .cl-done { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 16px; }
.cl-poster { cursor: pointer; }
.cl-poster__icon { width: min(30%, 190px); height: auto; filter: drop-shadow(0 12px 14px rgba(0,0,0,.18)); animation: cl-float 3s ease-in-out infinite; }
.cl-poster__play { width: 84px; height: 84px; border-radius: 50%; border: 0; background: var(--green); color: #fff; font-size: 2rem; padding-left: 6px; cursor: pointer; box-shadow: 0 6px 0 var(--green-dark); }
.cl-poster__play:hover { transform: scale(1.06); }
.cl-poster__label { background: rgba(18,34,74,.85); color: #fff; font-weight: 800; padding: 6px 14px; border-radius: 999px; }
.cl-done { z-index: 3; }
.cl-stage[data-same-host]:not([data-kind]) .cl-host { display: none; }
@media (min-width: 641px) { .cl-done { padding-left: 20%; } }
.cl-done__card { background: rgba(255,255,255,.94); border-radius: 22px; padding: 18px 22px; display: grid; justify-items: center; gap: 10px; box-shadow: var(--shadow); }
.cl-done__stars { font-size: 1.5rem; letter-spacing: 2px; }
.cl-done__stars b { color: #c3cde6; }
.cl-done__stars b.is-on { color: #ffb020; }
.cl-stage.is-done .cl-scene, .cl-stage.is-done .cl-cap, .cl-stage.is-done .cl-stars { visibility: hidden; }
.cl-stage.is-done .cl-host { left: 3%; bottom: 20px; width: clamp(70px, 19%, 190px); top: auto; right: auto; }
.cl-cap:empty { visibility: hidden; }
.cl-done h2 { margin: 0; color: var(--indigo); font-size: clamp(1.3rem, 3.4vw, 2.2rem); }
.cl-done p { margin: 0; font-weight: 700; }
.cl-done .cl-big { width: min(22%, 140px); }
.cl-done__row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* Controls */
.cl-bar { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.cl-btn { flex: none; min-width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); font-size: 1rem; font-weight: 900; cursor: pointer; }
.cl-btn:hover { border-color: var(--blue); color: var(--blue-text); }
.cl-btn--main { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 3px 0 var(--blue-dark); }
.cl-btn--main:hover { color: #fff; }
.cl-btn--txt { font-size: .85rem; }
.cl-btn[aria-pressed="false"] { opacity: .55; }
.cl-track { flex: 1 1 160px; display: flex; gap: 3px; height: 44px; align-items: center; min-width: 120px; }
.cl-seg { position: relative; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; min-width: 24px; } /* 24x24 tap area at least (WCAG 2.5.8), 10px bar */
.cl-seg::before, .cl-seg i { position: absolute; left: 0; top: 7px; height: 10px; border-radius: 99px; }
.cl-seg::before { content: ""; right: 0; background: var(--line); }
.cl-seg i { display: block; width: 0; background: var(--magenta); }
.cl-time { font-weight: 800; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cl-novoice { margin: 8px 0 0; }

/* Side */
.cl-side { display: grid; gap: 16px; }
.cl-card { border: 2px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--bg); }
.cl-card ul { margin: 0 0 12px; padding-left: 20px; }
.cl-card li { margin-bottom: 6px; }
.cl-card p { margin: 0 0 10px; }
.cl-privacy { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0 !important; }
.cl-privacy img { flex: none; }
.cl-next { display: grid; gap: 10px; }
.cl-mini { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: center; text-decoration: none; color: var(--ink); }
.cl-mini .thumb { border-radius: 12px; box-shadow: none; }
.cl-mini b { display: block; line-height: 1.2; }
.cl-mini small { color: var(--ink-2); font-weight: 700; }
.cl-mini:hover b { color: var(--blue-text); }

.cl-missing { text-align: center; padding: 64px 0; display: grid; justify-items: center; gap: 8px; }

@keyframes cl-pop { from { opacity: 0; transform: scale(.4) rotate(-8deg); } to { opacity: 1; transform: none; } }
@keyframes cl-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes cl-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes cl-drift { from { translate: -40px 0; } to { translate: 60px 0; } }
@keyframes cl-wave { 0%, 100% { rotate: 0deg; } 50% { rotate: -24deg; } }
@keyframes cl-blink { 0%, 92%, 100% { scale: 1 1; } 95% { scale: 1 .1; } }
@keyframes cl-talk { from { scale: 1 .35; } to { scale: 1 1.1; } }
@keyframes cl-hop { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }
@keyframes cl-fall { from { transform: translate(0, 0) rotate(0); opacity: 1; } to { transform: translate(var(--x), 420px) rotate(var(--r)); opacity: 0; } }
@keyframes cl-shake { 0%, 100% { translate: 0; } 25% { translate: -6px; } 75% { translate: 6px; } }
@media (prefers-reduced-motion: reduce) { .cl-stage *, .cl-poster__icon { animation: none !important; transition: none !important; } }

@media (max-width: 960px) { .cl-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .cl-stage { aspect-ratio: 4 / 5; border-radius: 18px; }
  .cl-scene { inset: 0 0 88px; padding: 14px 12px 0; }
  .cl-items, .cl-opts { grid-template-columns: 1fr; }
  .cl-items li, .cl-opt { flex-direction: row; text-align: left; }
  .cl-opts--text { grid-template-columns: 1fr 1fr; }
  .cl-opts--text .cl-opt { flex-direction: column; text-align: center; }
  .cl-big { width: 46%; }
  .cl-cap { min-height: 72px; }
  .cl-host { bottom: 92px; width: 26%; }
  .cl-stage[data-kind="intro"] .cl-scene, .cl-stage[data-kind="say"] .cl-scene, .cl-stage[data-kind="try"] .cl-scene { padding-left: 12px; padding-bottom: 22%; }
  .cl-time { order: 5; }
}

[data-theme="dark"] .cl-tag { background: var(--surface); }
[data-theme="dark"] .cl-tag--free { background: var(--green); }
[data-theme="dark"] .cl-head h1 { color: #fff; }
[data-theme="dark"] .cl-card { background: var(--surface); }
[data-theme="dark"] .cl-btn { background: var(--surface); }
[data-theme="dark"] .cl-btn--main { background: var(--blue); }
