/* DEMO 10.108.01 — roadmap connector, real imitate recording, richer pass celebration. */

/* When a chapter detail is open, the main roadmap's center connector must not
   continue behind the lesson-unit cards. */
#kidsCourse .pinyin-roadmap.is-stage-detail-open:before{display:none!important}

/* Keep the floating Home control as a quick escape, but tuck it farther into
   the lower-right edge so it covers less lesson content on narrow iPhones. */
body.app-kids-mode .kids-back-home{
  right:-3px!important;
  bottom:max(8px,calc(env(safe-area-inset-bottom) + 4px))!important;
  width:50px!important;height:50px!important;min-width:50px!important;min-height:50px!important;
}
body.app-kids-mode .kids-back-home svg{width:22px!important;height:22px!important}

/* Step 3: make imitation an actual listen-record-playback exercise. */
.kids-a-imitate-target{display:flex;align-items:center;justify-content:center;gap:10px;margin:2px 0 10px;padding:9px 10px;border-radius:15px;background:linear-gradient(145deg,#f0f8eb,#fff8e9);color:#3d6858}
.kids-a-imitate-target span{font-size:32px;font-weight:950;line-height:1}
.kids-a-imitate-target small{font-size:10px;font-weight:850;color:#74877d}
.kids-a-record-row{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}
.kids-a-record-button,.kids-a-playback-button{border:0;border-radius:15px;min-height:43px;padding:9px 8px;font-size:11px;font-weight:900;touch-action:manipulation}
.kids-a-record-button{background:#fff0ed;color:#a6534f;box-shadow:0 5px 12px rgba(130,74,67,.07)}
.kids-a-record-button.is-recording{background:#dc6c63;color:#fff;animation:kpRecordPulse 1.05s ease-in-out infinite}
.kids-a-playback-button{background:#edf5ef;color:#3d705e;box-shadow:0 5px 12px rgba(60,91,70,.06)}
.kids-a-playback-button:disabled,.kids-a-confirm-button:disabled{opacity:.42;box-shadow:none}
@keyframes kpRecordPulse{50%{transform:scale(.985);box-shadow:0 0 0 5px rgba(220,108,99,.12)}}

/* A pass should feel like clearing a game checkpoint, not just a status line. */
.kids-vowel-celebration{position:fixed;inset:0;z-index:5000;display:grid;place-items:center;padding:24px;background:rgba(35,65,51,0);pointer-events:none;opacity:0;transition:opacity .24s ease,background .24s ease}
.kids-vowel-celebration.is-show{opacity:1;background:rgba(35,65,51,.20)}
.kids-vowel-celebration.is-leaving{opacity:0}
.kids-vowel-celebration-card{position:relative;z-index:2;width:min(300px,84vw);padding:20px 18px 19px;border-radius:28px;background:linear-gradient(160deg,#fffdf4,#ecf8df);border:1px solid rgba(255,255,255,.9);box-shadow:0 22px 58px rgba(47,83,60,.25);text-align:center;transform:scale(.72) translateY(20px);transition:transform .42s cubic-bezier(.2,.9,.25,1.3)}
.kids-vowel-celebration.is-show .kids-vowel-celebration-card{transform:scale(1) translateY(0)}
.kids-vowel-celebration-mascot{font-size:55px;line-height:1;margin-bottom:4px;animation:kpMascotBounce .72s ease both}
.kids-vowel-celebration-card b{display:block;font-size:24px;letter-spacing:.04em;color:#d8992e}
.kids-vowel-celebration-card strong{display:block;margin-top:2px;font-size:20px;color:#356b58}
.kids-vowel-celebration-card span{display:block;margin-top:7px;font-size:12px;font-weight:850;color:#718276}
.kids-vowel-celebration.is-perfect .kids-vowel-celebration-card{background:linear-gradient(155deg,#fff8cf,#e4f7d8)}
.kids-vowel-celebration-burst{position:absolute;inset:0;z-index:1;overflow:hidden}
.kids-vowel-celebration-burst i{position:absolute;left:50%;top:48%;font-style:normal;font-size:22px;color:#f0b73f;opacity:0;animation:kpBurst 1.15s ease-out forwards}
.kids-vowel-celebration-burst i:nth-child(1){--x:-132px;--y:-145px;animation-delay:.05s}.kids-vowel-celebration-burst i:nth-child(2){--x:-72px;--y:-190px;animation-delay:.12s}.kids-vowel-celebration-burst i:nth-child(3){--x:5px;--y:-178px;animation-delay:.02s}.kids-vowel-celebration-burst i:nth-child(4){--x:103px;--y:-134px;animation-delay:.15s}.kids-vowel-celebration-burst i:nth-child(5){--x:140px;--y:20px;animation-delay:.08s}.kids-vowel-celebration-burst i:nth-child(6){--x:-140px;--y:28px;animation-delay:.18s}.kids-vowel-celebration-burst i:nth-child(7){--x:85px;--y:130px;animation-delay:.04s}.kids-vowel-celebration-burst i:nth-child(8){--x:-96px;--y:128px;animation-delay:.11s}
@keyframes kpBurst{0%{opacity:0;transform:translate(-50%,-50%) scale(.3) rotate(0)}25%{opacity:1}100%{opacity:0;transform:translate(calc(-50% + var(--x)),calc(-50% + var(--y))) scale(1.15) rotate(210deg)}}
@keyframes kpMascotBounce{0%{transform:translateY(16px) scale(.72)}55%{transform:translateY(-9px) scale(1.1)}100%{transform:translateY(0) scale(1)}}

@media(max-width:360px){.kids-a-record-row{grid-template-columns:1fr}.kids-vowel-celebration-card{width:min(280px,88vw)}}

/* 10.108.03 — free imitation tone choice + stronger tactile feedback */
.kids-a-imitate-prompt{margin:2px 0 7px;text-align:center;font-size:11px;font-weight:900;color:#58776b}
.kids-a-imitate-choices{margin-top:0;margin-bottom:10px}
.kids-a-imitate-choices .kids-a-tone-choice.is-selected{background:#e2f5e7;box-shadow:inset 0 0 0 2px #7fbc92,0 4px 10px rgba(60,112,79,.08)}
.kids-a-listen-button,.kids-a-record-button,.kids-a-playback-button,.kids-a-confirm-button,.kids-a-tone-choice{transition:transform .10s ease,box-shadow .10s ease,filter .10s ease;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
.kids-a-listen-button:active:not(:disabled),.kids-a-record-button:active:not(:disabled),.kids-a-playback-button:active:not(:disabled),.kids-a-confirm-button:active:not(:disabled),.kids-a-tone-choice:active:not(:disabled),
.kids-a-listen-button.is-pressed,.kids-a-record-button.is-pressed,.kids-a-playback-button.is-pressed,.kids-a-confirm-button.is-pressed,.kids-a-tone-choice.is-pressed{transform:translateY(2px) scale(.98);filter:brightness(.96);box-shadow:inset 0 2px 5px rgba(54,82,64,.12)}
.kids-a-playback-button.is-playing{background:#dff1e5;color:#2f6954;box-shadow:inset 0 0 0 2px rgba(94,166,121,.35)}
