:root{font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#182820;background:#faf7ff;font-size:16px;line-height:1.45;--ink:#192b23;--muted:#58675f;--accent:#6435c5;--line:#eae1f5;--white:#fff}
*{box-sizing:border-box}
body{margin:0}
button,input{font:inherit}
button,a,input,summary{-webkit-tap-highlight-color:transparent}
button{cursor:pointer}
a{color:inherit;text-decoration:none}
button:disabled{cursor:default;opacity:.55}
[hidden]{display:none!important}
:focus-visible{outline:3px solid #62a17f;outline-offset:4px}
svg{width:22px;height:22px;flex:none;vertical-align:middle}
.shell{display:grid;grid-template-columns:228px minmax(0,1fr);min-height:100dvh}
.sidebar{background:#fff;border-right:1px solid var(--line);position:sticky;top:0;height:100dvh;display:flex;flex-direction:column;padding:30px 20px 22px}
.brand,.mobile-brand{display:flex;align-items:center;gap:9px;white-space:nowrap;font-size:21px;line-height:1.15;font-weight:850;letter-spacing:-.065em;color:#30224f}
.brand{width:fit-content;padding:5px 9px 5px 5px;border-radius:14px;background:#f6efff;border:1px solid #eee3fb}
.brand:hover{background:#efe2ff}
.brand img,.mobile-brand img{flex:none;width:34px;height:34px}
.brand-accent{color:#7045c5}
nav{display:grid;gap:8px;margin-top:42px}
nav a{padding:12px 14px;border-radius:12px;display:flex;align-items:center;gap:13px;font-weight:700;color:#52625a}
nav a.active{background:#eee4ff;color:var(--accent)}
nav a:hover{background:#f3ebff}
.workspace{min-width:0}
.topbar{max-width:1280px;margin:auto;min-height:62px;display:flex;align-items:center;padding:8px clamp(24px,4vw,58px)}
.eyebrow{font-size:11px;font-weight:850;letter-spacing:1.35px}
.top-stats{display:flex;align-items:center;gap:8px;margin-left:auto}
.header-stat{display:flex;align-items:center;gap:4px;padding:5px 9px;min-height:36px;border-radius:20px;font-size:13px;font-weight:750;white-space:nowrap}
.header-stat svg{width:17px;height:17px}
.header-stat:hover{filter:brightness(.94)}
.streak-stat{background:#ffefd9;color:#8c4a13}
.xp-stat{background:#ede1ff;color:#582ba8}
.header-controls{display:flex;align-items:center;gap:4px;padding:3px;border-radius:25px;background:#fff;border:1px solid var(--line);box-shadow:0 2px 5px #3e245408}
.topbar .sfx-toggle{width:35px;height:35px;border:0;border-radius:50%;background:transparent;color:#684b94}
.topbar .sfx-toggle:hover{background:#f0e7fd}
.topbar .sfx-toggle svg{width:17px;height:17px}
.mobile-brand{display:none}
.main{max-width:1280px;margin:auto;padding:34px clamp(24px,4vw,58px) 52px}
.section-head{margin-bottom:23px}
.eyebrow{color:var(--accent)}
h1,h2,h3,p{margin:0}
h1{font-size:clamp(31px,4.1vw,55px);line-height:1.09;letter-spacing:-.05em;margin:9px 0 10px;font-weight:850;text-wrap:balance}
.section-head p{color:var(--muted);font-size:15px}
.button{display:inline-flex;justify-content:center;align-items:center;gap:8px;font-size:14px;font-weight:800;border:1px solid transparent;border-radius:11px;min-height:43px;padding:9px 14px;line-height:1.2}
.button:not(:disabled):hover{filter:brightness(.94)}
.button svg{width:18px;height:18px}
.primary{background:var(--accent);color:white}
.light{background:#f0e9ff;border-color:#e6d8f8;color:var(--accent)}
.subhead{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:13px}
.subhead h2,.panel h2{font-size:19px;letter-spacing:-.025em}
.subhead span,.muted,.panel p{color:var(--muted);font-size:13px}
.subhead svg{color:var(--accent)}
.unit-icon{width:47px;height:47px;border-radius:13px;display:grid;place-items:center;flex:none}
.color-0{background:#e3f1e7;color:#25694c}
.color-1{background:#e9edfa;color:#445b9b}
.color-2{background:#fbedd7;color:#955b1b}
.color-3{background:#f1e9fb;color:#79519e}
.panel{padding:18px;border:1px solid var(--line);border-radius:16px;background:white}
.panel p{margin-top:8px}
.progress-value{font-size:27px;font-weight:850;letter-spacing:-.04em}
.progress-value span{font-size:13px;font-weight:650;letter-spacing:0;color:var(--muted)}
progress{appearance:none;border:0;width:100%;height:10px;border-radius:10px;overflow:hidden;background:#eee4fa;color:#8550df}
progress::-webkit-progress-bar{background:#eee4fa;border-radius:10px}
progress::-webkit-progress-value{background:#8550df;border-radius:10px}
progress::-moz-progress-bar{background:#8550df;border-radius:10px}
.review-panel{background:#f1f7e9;border-color:#e5ebdc}
.review-panel .unit-icon{margin-bottom:11px}
.review-panel .button{margin-top:12px}
.practice-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px}
.skill-card .unit-icon{margin-bottom:10px}
.mode-list{margin-top:8px}
.mode-button{width:100%;min-height:43px;text-align:left;background:transparent;border:0;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:6px;font-size:13px;color:var(--ink);padding:8px 2px}
.mode-button:last-child{border-bottom:0}
.mode-button:hover{color:var(--accent);background:#f3f8f4}
.mode-button svg{width:16px;height:16px}
label{display:block;font-weight:750;margin:10px 0 5px}
.search,.answer-input{background:white;border:1px solid #b8c9bf;border-radius:11px;min-height:50px;width:100%;padding:10px 13px;color:var(--ink);font-size:16px}
.search{max-width:540px;margin-bottom:17px}
blockquote{margin:8px 0 0;padding-left:12px;border-left:3px solid #9ac6ae;color:#344b40;font-size:14px}
.lesson{max-width:900px;margin:auto;overflow-x:clip;min-height:100dvh;display:flex;flex-direction:column;padding:0 25px}
.lesson-bar{min-height:80px;display:flex;align-items:center;gap:14px}
.close{background:transparent;color:var(--muted);border:0;font-size:30px;width:43px;height:43px}
.lesson-counter,#clock{white-space:nowrap;font-weight:780;font-size:13px;color:var(--muted)}
#clock{min-width:34px;color:var(--accent)}
.exercise{width:min(100%,650px);margin:12px auto 28px;flex:1}
.exercise h1{font-size:clamp(28px,4vw,44px);margin:8px 0 17px}
.context,.transcript{background:#f0e9fb;border-radius:12px;padding:14px;margin:0 0 14px;overflow-wrap:anywhere}
.transcript{margin-top:10px}
.transcript p+p{margin-top:8px}
.picture{font-size:73px;text-align:center}
.sound-row{display:flex;gap:8px;margin-bottom:13px;flex-wrap:wrap}
.sound{background:#eee4ff;color:var(--accent)}
.choices{display:grid;gap:8px}
.choice{border:1px solid #dbe4de;background:white;color:var(--ink);text-align:left;padding:11px 13px;min-height:49px;border-radius:11px;font-weight:680;width:100%;overflow-wrap:anywhere}
.choice span{display:inline-grid;place-items:center;min-width:24px;height:24px;border-radius:6px;background:#edf1ee;margin-right:9px;font-size:12px}
.choice:hover,.word:hover{border-color:#86b297}
.choice.selected,.word.selected{background:#eee3ff;border-color:#9b73e2;color:#52299f}
.choice.paired{background:#e9eff9;color:#36537d}
.visual-choices{grid-template-columns:1fr 1fr}
.visual-choices .choice{font-size:40px}
.word-zone{border:1px dashed #8eae9d;background:white;border-radius:12px;min-height:68px;padding:8px;margin-bottom:11px;display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.word-zone>span{font-size:13px;color:var(--muted)}
.word-options{display:flex;gap:6px;flex-wrap:wrap}
.word{min-height:42px;padding:6px 9px;border-radius:9px;background:white;border:1px solid #dbe4de;color:var(--ink);font-weight:700}
.match{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.match>div{display:flex;flex-direction:column;gap:8px}
.match-item{display:flex;gap:4px}
.flash,.trace{text-align:center;margin-top:12px}
.trace canvas{display:block;width:min(320px,100%);height:auto;background:#fff;border:1px solid var(--line);border-radius:14px;margin:0 auto 7px;touch-action:none}
.character{min-height:154px;background:#5129a4;color:white;border-radius:17px;display:grid;place-content:center;justify-items:center;gap:3px;margin-bottom:11px}
.character>span{color:#e9dcfd;font-size:12px}
.maya-avatar{position:relative;isolation:isolate;overflow:hidden;width:78px;height:78px;border-radius:26px;background:radial-gradient(circle at 31% 26%,#fff1a2,#ffb774);box-shadow:0 4px 0 #392175}
.maya-avatar i{position:absolute;display:block}
.maya-hair{inset:12% 19% 13%;border-radius:48% 52% 31% 28%;background:#442745;transform:rotate(-8deg)}
.maya-shirt{inset:73% 13% -11%;border-radius:50% 47% 0 0;background:#77d9c5}
.maya-face{inset:27% 28% 24%;border-radius:39% 41% 48% 46%;background:#b56f59;box-shadow:inset -3px -2px #9c534e}
.maya-face b{position:absolute;top:42%;left:25%;width:9%;height:13%;border-radius:50%;background:#281b34}
.maya-face b+b{left:66%}
.maya-face span{position:absolute;left:39%;top:67%;width:25%;height:11%;border-radius:0 0 10px 10px;background:#ffe5da}
.maya-fringe{inset:16% 26% 58% 23%;border-radius:57% 54% 62% 16%;background:#442745;transform:rotate(-19deg)}
.maya-headset{left:65%;top:45%;width:12%;height:23%;border-radius:6px;background:#8954e9;box-shadow:inset 2px 0 #b890ff}
.maya-headset::after{content:"";position:absolute;right:19%;bottom:-19%;width:18px;height:8px;border-bottom:2px solid #8954e9;border-right:2px solid #8954e9;border-radius:0 0 7px 0}
.feedback,.notification{border-radius:12px;padding:11px 14px;margin-top:13px;color:#234839;background:#e5efe8}
.notification{background:#f4ebd7;color:#704c11;margin-bottom:11px}
.feedback.wrong{background:#f7e7e5;color:#8c352c}
.feedback p{margin-top:4px;font-size:14px}
.lesson-footer{position:sticky;bottom:0;background:#faf7ffec;border-top:1px solid var(--line);padding:11px 0 max(12px,env(safe-area-inset-bottom));backdrop-filter:blur(8px)}
.lesson-footer>div{width:min(100%,650px);margin:auto;display:flex;justify-content:space-between;gap:8px}
.lesson-footer .primary{margin-left:auto}
.result-screen{display:grid;place-items:center}
.summary{width:min(100%,460px);text-align:center;padding:31px}
.summary .unit-icon{margin:0 auto 13px}
.summary-score{font-size:58px;font-weight:850;color:var(--accent);letter-spacing:-.06em}
.summary .button{margin-top:17px}
.loading{max-width:600px;margin:60px auto;padding:22px}
@media(max-width:1050px){.shell{grid-template-columns:180px minmax(0,1fr)}.sidebar{padding-inline:14px}.main{padding-inline:26px}.practice-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:740px){
 .shell{display:block}.sidebar{display:contents}.brand{display:none}
 .mobile-brand{display:flex;font-size:18px}.mobile-brand img{width:30px;height:30px}
 .topbar{min-height:56px;padding:6px 15px}.top-stats{gap:5px}.header-stat{padding-inline:7px}
 nav{margin:0;position:fixed;z-index:10;inset:auto 0 0;background:white;border-top:1px solid var(--line);grid-template-columns:repeat(4,minmax(0,1fr));gap:3px;padding:5px 8px max(5px,env(safe-area-inset-bottom))}
 nav a{flex-direction:column;justify-content:center;gap:3px;padding:5px;font-size:11px;min-height:49px}nav a svg{width:20px;height:20px}
 .main{padding:23px 15px 78px}
 .panel{padding:13px}.lesson{padding:0 14px}.lesson-bar{min-height:59px}.exercise{margin-top:8px}.section-head{margin-bottom:17px}
}
@media(max-width:400px){.practice-grid{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

/* Course map and quiz */
.guide{--size:70px;position:relative;display:grid;justify-items:center;align-content:center;flex:none;width:var(--size);height:var(--size);isolation:isolate}
.guide::after{content:"";position:absolute;left:21%;right:19%;bottom:6%;height:10%;border-radius:50%;background:#32156b24;z-index:-1}
.guide-head{position:relative;z-index:1;display:grid;place-items:center;width:79%;height:calc(var(--size)*.53);border:calc(var(--size)*.027) solid #422584;border-radius:32% 35% 30% 29%;background:linear-gradient(145deg,#f9ebff 8%,#f3baff 48%,#bd8cf6 90%);box-shadow:inset 0 calc(var(--size)*-.06) #a16be367}
.guide-head::before,.guide-head::after{content:"";position:absolute;top:31%;width:17%;height:49%;border-radius:38%;background:linear-gradient(110deg,#ffe181,#ffae5f);border:calc(var(--size)*.021) solid #422584;z-index:-1}
.guide-head::before{left:-13%;transform:rotate(-9deg)}
.guide-head::after{right:-13%;transform:rotate(9deg)}
.guide-visor{width:76%;height:69%;position:relative;border-radius:25% 25% 31% 31%;background:linear-gradient(155deg,#432676,#261848);box-shadow:0 calc(var(--size)*.025) #ffffff4f,inset 0 0 0 1px #8856ba;display:flex;align-items:center;justify-content:center;gap:23%}
.guide-visor>i{margin-top:-10%;width:13%;height:29%;border-radius:6px;background:#9df5df;box-shadow:0 0 calc(var(--size)*.07) #75edcf9c;transform-origin:center}
.guide-visor>span{position:absolute;top:65%;width:17%;height:10%;border-radius:0 0 8px 8px;background:#fbb0de}
.guide-body{position:relative;width:50%;height:calc(var(--size)*.2);border:calc(var(--size)*.022) solid #422584;border-radius:17% 18% 43% 39%;background:linear-gradient(145deg,#b4fbef,#77d9de);display:grid;place-items:center;margin-top:calc(var(--size)*-.025);box-shadow:inset 0 calc(var(--size)*-.037) #5d9cc352}
.guide-body b{width:19%;aspect-ratio:1;background:#7045df;transform:rotate(45deg);border-radius:26%;box-shadow:inset -1px -1px #4e2c9c}
.happy .guide-visor>i{height:18%;background:transparent;border-top:calc(var(--size)*.027) solid #9df5df;box-shadow:none}
.happy .guide-visor>span{height:17%;width:22%}
.thinking .guide-visor>i:nth-child(2){height:13%}
.thinking .guide-visor>span{height:10%;width:11%;border-radius:6px;left:56%}
@media(prefers-reduced-motion:no-preference){
 .trail-guide .guide-visor>i,.wordbook-guide .guide-visor>i{animation:visor-blink 4s ease-in-out 3}
}
@keyframes visor-blink{0%,43%,50%,100%{transform:scaleY(1)}46%,47%{transform:scaleY(.12)}}
.journey-step{--map:#7045df;--map-shadow:#4f2ca9;--map-tint:#eee5ff;--map-ink:#401e88;position:relative}
.map-1{--map:#127bbd;--map-shadow:#07598c;--map-tint:#e1f5ff;--map-ink:#114b78}
.map-2{--map:#d44e68;--map-shadow:#a6324d;--map-tint:#ffe8ee;--map-ink:#872b46}
.map-3{--map:#137f72;--map-shadow:#095e55;--map-tint:#daf8ef;--map-ink:#125950}
.map-banner{display:flex;align-items:center;gap:14px;min-height:76px;margin:18px 0 15px;padding:12px 17px;border-radius:17px;background:var(--map-tint);color:var(--map-ink);box-shadow:0 4px 0 color-mix(in srgb,var(--map) 24%,white)}
.map-banner .unit-icon{background:var(--map);color:white;width:46px;height:46px}
.map-banner .eyebrow{color:var(--map-ink);font-size:10px}
.map-banner h3{font-size:clamp(17px,3vw,24px);line-height:1.16;margin:2px 0}
.map-banner p{font-size:12px;color:var(--map-ink)}
.level-trail{display:grid;list-style:none;padding:0 0 22px;margin:0}
.level-stop{position:relative;height:132px;display:grid;place-items:start}
.level-stop .level-node{position:absolute;left:var(--lane);top:8px;translate:-50% 0;width:88px;height:70px;font-size:34px}
.level-stop .level-label{position:absolute;top:91px;left:var(--lane);translate:-50% 0;text-align:center;width:max-content;max-width:48%}
.level-stop .level-label b{font-size:15px;color:var(--ink)}
.level-stop .level-label small{margin-top:3px}
.level-node.next + .level-label small{display:inline-block;margin-top:2px;padding:1px 8px;border-radius:6px;background:var(--map-tint);color:var(--map-ink);font-weight:800}
.level-node.checkpoint.next + .level-label small{background:#fff1c7;color:#694709}
.level-stop .checkpoint{--map:#ffd45d;--map-shadow:#d19826;--map-tint:#fff1c7;color:#56345c}
.level-stop .checkpoint.cleared,.level-stop .checkpoint.next{color:#51304f}
.trail-scene{--scene-size:115px;position:absolute;pointer-events:none;left:76%;top:0;width:var(--scene-size);height:var(--scene-size);translate:-50% 0;display:grid;justify-items:center;align-content:center;isolation:isolate}
.trail-scene.scene-left{left:24%}
.trail-scene::before{content:"";position:absolute;inset:11px 4px 5px;border-radius:42% 52% 49% 43%;background:var(--map-tint);z-index:-1;rotate:-13deg}
.trail-guide{--size:78px;transform:rotate(9deg);margin-top:-13px}
.scene-console{display:grid;place-items:center;width:48px;height:25px;margin-top:-10px;z-index:2;border-radius:7px;background:var(--map);color:white;rotate:-6deg;box-shadow:0 3px 0 var(--map-shadow)}
.scene-console svg{width:17px;height:17px}
.scene-spark{position:absolute;top:3px;right:4px;font-style:normal;color:var(--map);font-size:20px}
@media(max-width:540px){
 .level-stop{height:117px}
 .level-stop .level-node{width:75px;height:62px;font-size:28px}
 .level-stop .level-label{top:83px}
 .trail-scene{--scene-size:93px}
 .trail-guide{--size:65px}
 .map-banner{gap:9px;padding:10px}
}
.practice-empty{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:17px;max-width:650px;padding:clamp(18px,4vw,32px);border-radius:20px;background:#eee4ff;border:1px solid #e4d3fb}
.practice-empty h1{color:#43248b;margin:0 0 9px;font-size:clamp(25px,4vw,41px);text-wrap:pretty}
.practice-empty p{color:#594671;max-width:36ch;margin-bottom:17px}
.practice-empty-art{display:grid;place-items:center;width:117px;height:117px;border-radius:47% 44% 46% 48%;background:#e2cffc}
.practice-empty-art .guide{--size:86px}
@media(max-width:460px){.practice-empty{gap:10px}.practice-empty-art{width:65px;height:70px}.practice-empty-art .guide{--size:55px}}
.sfx-toggle{background:#f0e8ff;border:1px solid #e6d8f8;color:var(--accent);box-sizing:border-box;border-radius:10px;width:41px;height:41px;display:grid;place-items:center;flex:none}
.sfx-toggle[aria-pressed=false]{opacity:.65;text-decoration:line-through;position:relative}
.sfx-toggle[aria-pressed=false]::after{position:absolute;content:'';width:21px;height:2px;background:currentColor;transform:rotate(-43deg)}
.sfx-toggle svg{width:19px;height:19px}
.level-node{width:61px;height:52px;border:1px solid #0001;border-radius:50%;background:var(--map-tint);color:var(--map);display:grid;place-items:center;box-shadow:0 7px 0 color-mix(in srgb,var(--map) 24%,white);font-size:25px;line-height:1;transition:transform .15s,box-shadow .15s}
.level-node.cleared,.level-node.next{background:var(--map);color:white;box-shadow:0 7px 0 var(--map-shadow)}
.level-node:not(:disabled):hover{transform:translateY(-2px)}
.level-node:not(:disabled):active{transform:translateY(3px);box-shadow:0 2px 0 var(--map-shadow)}
.level-node.locked:disabled{opacity:1;background:#eeeaf3;color:#716980;box-shadow:0 6px 0 #ddd6e8;cursor:not-allowed}
.level-node:focus-visible{outline:3px solid #11271d;outline-offset:5px}
.level-label{font-size:14px;line-height:1.25}
.level-label b,.level-label small{display:block}
.level-label small{font-size:11px;color:var(--muted);margin-top:2px}
.lesson-bar progress{height:16px}
.quiz-chain{display:flex;align-items:center;gap:4px;color:#995207;background:#fff1d8;padding:5px 8px;border-radius:20px;font-weight:850;font-size:13px}
.quiz-chain svg{width:17px;height:17px}
.question-banner{display:flex;align-items:center;gap:13px;padding:14px 16px;border-radius:17px;background:white;border:1px solid #dbe8df;box-shadow:0 4px 0 #e5ebe7;margin-bottom:19px}
.question-banner h1{margin:4px 0 0;line-height:1.12;text-wrap:pretty;overflow-wrap:anywhere}
.exercise .choice,.exercise .word{box-shadow:0 3px 0 #e2e9e4}
.exercise .choice.selected,.exercise .word.selected{box-shadow:0 3px 0 #ceb9f3}
.exercise .choices{gap:11px}
.exercise .word-options{gap:9px}
.lesson-footer .primary{box-shadow:0 4px 0 #472391;margin-bottom:4px}
.feedback{display:flex;gap:10px;align-items:center;font-size:19px;border:1px solid #cce3d3}
.feedback.wrong{border-color:#ebcfcb}
.feedback p{margin-top:0}
.feedback-symbol{width:35px;height:35px;border-radius:50%;display:grid;place-items:center;flex:none;background:#fff}
.game-summary .guide{--size:105px;margin:0 auto 5px}
.result-stars{font-size:42px;letter-spacing:3px;line-height:1.2;color:#d6ded8;margin-bottom:9px}
.result-stars .lit{color:#c87912;text-shadow:0 2px #ffe4a2}
.result-stars span:nth-child(2){font-size:1.2em}
.scorecards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:16px 0 0}
.scorecards>div{display:grid;gap:2px;border-radius:10px;background:#eef5ef;padding:8px 3px}
.scorecards strong{font-size:23px;color:#155b49}
.scorecards span{font-size:11px;color:var(--muted)}
@media(max-width:740px){
 .question-banner{padding:10px 8px;gap:7px}
 .question-banner .guide{--size:51px}
}
@media(prefers-reduced-motion:no-preference){
 .feedback{animation:feedback-rise .22s ease-out both}
 .result-stars .lit{display:inline-block;animation:star-pop .32s cubic-bezier(.2,.8,.45,1.25) both}
 .result-stars .lit:nth-child(2){animation-delay:.07s}
 .result-stars .lit:nth-child(3){animation-delay:.14s}
}
@keyframes feedback-rise{from{transform:translateY(6px);opacity:0}to{transform:translateY(0);opacity:1}}
@keyframes star-pop{from{transform:scale(.55);opacity:0}to{transform:scale(1);opacity:1}}

.daily-goal{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:10px;background:#fff8e9;border-color:#f0dfbb}
.daily-goal .unit-icon{background:#ffe4a3;color:#7a4a07}
.daily-goal h2{font-size:16px}
.daily-goal p{margin:1px 0 0}
.daily-goal progress{grid-column:1/-1;color:#d78a22}
.daily-goal progress::-webkit-progress-value{background:#d78a22}
.daily-goal progress::-moz-progress-bar{background:#d78a22}
.daily-goal.goal-cleared{background:#eaf6e7;border-color:#cae5c6}
.daily-goal.goal-cleared .unit-icon{background:#ccecc6;color:#225f38}
.reward-guide,.feedback{position:relative}
.reward-guide{isolation:isolate}
.particle-burst{position:absolute;left:50%;top:45%;pointer-events:none;z-index:2}
.feedback .particle-burst{left:32px;top:50%}
.particle-burst i{width:8px;height:8px;border-radius:2px;background:#edab3b;position:absolute;opacity:0}
.particle-burst i:nth-child(3n){background:#44a877;border-radius:50%}
.particle-burst i:nth-child(3n+1){background:#9a75de;width:6px;height:10px}
.summary-actions{display:flex;justify-content:center;gap:8px;flex-wrap:wrap;margin-top:16px}
.summary-actions .button{margin:0}
.goal-toast{display:flex;justify-content:center;align-items:center;gap:5px;color:#155b49!important;font-weight:800}
.question-banner h1:focus:not(:focus-visible){outline:none}
@media(prefers-reduced-motion:no-preference){
 .particle-burst i{animation:confetti-fly .85s var(--delay) cubic-bezier(.12,.63,.39,1) both}
 .scorecards>div{animation:score-rise .32s .13s ease-out both}
 .scorecards>div:nth-child(2){animation-delay:.21s}
 .scorecards>div:nth-child(3){animation-delay:.29s}
 .goal-cleared .unit-icon,.goal-toast svg{animation:star-pop .48s cubic-bezier(.2,.8,.45,1.25) both}
}
@keyframes mission-twinkle{from{opacity:.4;transform:rotate(-14deg) scale(.8)}to{opacity:1;transform:rotate(12deg) scale(1.18)}}
@keyframes confetti-fly{0%{opacity:0;transform:scale(.4)}18%{opacity:1}65%{opacity:1}100%{opacity:0;transform:translate(var(--x),var(--y)) rotate(var(--spin))}}
@keyframes score-rise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}

.course-path h1{font-size:clamp(27px,4.1vw,43px);margin:0}
.progress-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:start;max-width:760px}
.quick-practice{display:flex;align-items:center;gap:12px;margin-bottom:15px;flex-wrap:wrap}
.quick-practice .unit-icon,.quick-practice .button,.quick-practice p{margin:0}
.quick-practice .button{margin-left:auto}
@media(max-width:540px){.progress-grid{grid-template-columns:1fr}}

@media(prefers-reduced-motion:no-preference){
 .trail-scene .trail-guide{animation:scene-bob 2.7s ease-in-out 3}
 .trail-scene .scene-spark{animation:mission-twinkle 1.8s ease-in-out 4 alternate}
}
@keyframes scene-bob{0%,100%{transform:translateY(0) rotate(9deg)}50%{transform:translateY(-5px) rotate(2deg)}}

.wordbook-banner{display:flex;align-items:center;justify-content:space-between;gap:12px;background:#eee4ff;border:1px solid #e4d3fb;border-radius:21px;padding:16px 23px;margin-bottom:20px;overflow:hidden}
.wordbook-banner h1{color:#43248b;margin-top:0}
.wordbook-banner p{color:#5c3d8d;font-size:14px;font-weight:750}
.wordbook-art{width:132px;display:flex;align-items:center;justify-content:center;gap:2px;flex:none;color:#7c49cd;font-size:26px}
.wordbook-art span:last-child{align-self:flex-start;color:#a05592;font-size:19px}
.wordbook-guide{--size:83px;transform:rotate(9deg)}
.vocab-search{max-width:620px;margin-bottom:17px}
.vocab-search>div{position:relative}
.vocab-search svg{position:absolute;top:14px;left:13px;color:var(--accent);pointer-events:none}
.vocab-search .search{padding-left:44px;margin:0;max-width:none;border-color:#d7c9e9}
.word-shelf{--shelf-tint:#f1e8ff;--shelf-accent:#6338ae;--shelf-border:#e5d6f6;margin-bottom:21px}
.shelf-1{--shelf-tint:#e6f6ff;--shelf-accent:#1c6490;--shelf-border:#cce6f6}
.shelf-2{--shelf-tint:#ffeaf0;--shelf-accent:#963d60;--shelf-border:#f6d5e2}
.shelf-3{--shelf-tint:#e1f8ee;--shelf-accent:#216c57;--shelf-border:#caecdc}
.shelf-heading{display:flex;align-items:center;gap:9px;margin-bottom:9px;color:var(--shelf-accent)}
.shelf-heading .unit-icon{width:35px;height:35px;border-radius:10px;background:var(--shelf-tint);color:inherit}
.shelf-heading h2{font-size:18px;line-height:1.2}
.vocab-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px;align-items:start}
.vocab-card{background:white;border:1px solid var(--shelf-border);border-radius:14px;box-shadow:0 3px 0 var(--shelf-border)}
.vocab-card summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:11px 12px;border-radius:13px;min-height:69px;cursor:pointer}
.vocab-card summary::-webkit-details-marker{display:none}
.vocab-card summary:hover,.vocab-card[open] summary{background:var(--shelf-tint)}
.vocab-entry{display:grid;gap:2px;min-width:0;overflow-wrap:anywhere}
.vocab-entry b{color:var(--shelf-accent)}
.vocab-entry span{color:var(--muted);font-size:13px}
.vocab-opening{display:grid;place-items:center;width:27px;height:27px;border-radius:8px;background:var(--shelf-tint);color:var(--shelf-accent);flex:none}
.vocab-opening::before{content:"+";font-size:19px;font-weight:750;line-height:1}
.vocab-card[open] .vocab-opening::before{content:"−"}
.vocab-detail{padding:12px;font-size:14px}
.vocab-detail blockquote{border-left-color:var(--shelf-border)}
.vocab-no-results{margin:0}
@media(max-width:540px){
 .wordbook-banner{padding:13px}
 .wordbook-art{width:90px}
 .wordbook-guide{--size:62px}
 .vocab-grid{grid-template-columns:1fr}
}
@media(prefers-reduced-motion:no-preference){
 .wordbook-guide{animation:scene-bob 2.7s ease-in-out 3}
 .vocab-card[open] .vocab-detail{animation:score-rise .22s ease-out both}
}
.account-control{display:grid;place-items:center;min-width:36px;min-height:36px}
.account-gate{min-height:100dvh;display:grid;align-content:center;justify-items:center;gap:20px;padding:22px}
.account-welcome{text-align:center}
.account-welcome img{width:56px;height:56px}
.account-welcome p{color:var(--muted)}
#sign-in{max-width:100%;display:grid;justify-items:center}
.level-loader{min-height:100dvh;display:grid;place-items:center;padding:22px;background:radial-gradient(ellipse at 50% 37%,#eee0ff,transparent 70%)}
.level-load-card{display:grid;justify-items:center;text-align:center;width:min(100%,390px)}
.level-load-art{position:relative;display:grid;place-items:center;width:176px;height:150px;margin-bottom:9px;border-radius:46% 54% 51% 42%;background:#e7d6ff}
.loading-guide{--size:119px;transform:rotate(-7deg)}
.level-load-art>i{position:absolute;top:23%;left:8%;font-style:normal;color:#7950c6;font-size:23px}
.level-load-art>i:last-child{left:auto;right:9%;top:63%;color:#9a4d84}
.level-load-card h1{font-size:clamp(25px,5vw,36px);line-height:1.12;color:#43248b}
.level-load-card h1:focus:not(:focus-visible){outline:none}
.level-load-card p{font-weight:750;color:var(--muted)}
.level-load-dots{display:flex;align-items:center;justify-content:center;gap:8px;height:27px;margin-top:16px}
.level-load-dots i{width:10px;height:10px;border-radius:50%;background:#8653df}
.level-load-dots i:nth-child(2){background:#198979}
.level-load-dots i:nth-child(3){background:#e3a232}
@media(prefers-reduced-motion:no-preference){
 .loading-guide{animation:scene-bob 1.9s ease-in-out infinite}
 .level-load-art>i{animation:mission-twinkle .9s ease-in-out infinite alternate}
 .level-load-art>i:last-child{animation-delay:.35s}
 .level-load-dots i{animation:lesson-dot 1.35s ease-in-out infinite}
 .level-load-dots i:nth-child(2){animation-delay:.14s}
 .level-load-dots i:nth-child(3){animation-delay:.28s}
}
@keyframes lesson-dot{0%,58%,100%{transform:translateY(0);opacity:.65}29%{transform:translateY(-6px);opacity:1}}
.check-pending:disabled{position:relative;opacity:1;cursor:wait}
.check-pending .check-label{opacity:0}
.check-spinner{position:absolute;width:18px;height:18px;border:2px solid #ffffff66;border-top-color:#fff;border-radius:50%}
@media(prefers-reduced-motion:no-preference){.check-spinner{animation:check-spin .75s linear infinite}}
@keyframes check-spin{to{transform:rotate(360deg)}}

.speaking-control{display:flex;align-items:center;gap:13px;flex-wrap:wrap;padding:15px;border:1px solid #dfcff4;border-radius:16px;background:#f1e8ff}
.speaking-control strong{display:block;color:#4e3090}
.speaking-control p{color:#675882;font-size:13px;margin-top:3px}
.mic-button{width:57px;height:57px;flex:none;display:grid;place-items:center;position:relative;border:0;border-radius:50%;background:#693fc5;color:white;box-shadow:0 4px 0 #4d279a}
.mic-button:not(:disabled):hover{background:#5832aa}
.mic-button:disabled{opacity:1;cursor:wait}
.mic-button svg{width:25px;height:25px}
.mic-live .mic-button{background:#a82e5c;box-shadow:0 4px 0 #79213f}
.mic-live strong{color:#8c294d}
.mic-stop-square{width:16px;height:16px;border-radius:4px;background:currentColor}
.speaking-control>.light{margin-left:auto}
@media(prefers-reduced-motion:no-preference){
 .mic-live .mic-button{animation:mic-live-pulse 1.25s ease-in-out infinite}
}
@keyframes mic-live-pulse{0%,100%{box-shadow:0 4px 0 #79213f,0 0 0 0 #b9386a50}65%{box-shadow:0 4px 0 #79213f,0 0 0 8px #b9386a00}}
.question-banner>div:nth-child(2){flex:1;min-width:0}
.task-audio{flex:none;width:42px;min-height:42px;padding:0;color:var(--accent);background:#f2eaff}
@media(max-width:540px){.task-audio{width:37px;min-height:37px}}

/* Appearance */
:root{
 color-scheme:light;
 --surface:#fff;
 --trace-guide:#e1e8e3;
 --trace-ink:#155b49;
}
#theme{
 min-height:35px;padding:3px 5px;border:1px solid var(--line);border-radius:12px;
 background:var(--surface);color:var(--ink);font:700 12px Inter,system-ui,sans-serif;
}
.topbar #theme{border-color:transparent}
@media(max-width:480px){
 .topbar{flex-wrap:wrap;gap:4px 8px}
 .top-stats{max-width:100%;justify-content:flex-end;flex-wrap:wrap}
}

:root[data-theme="dark"]{
 color-scheme:dark;
 background:#161320;
 color:#f1edf7;
 --ink:#f1edf7;
 --muted:#bdb4cb;
 --accent:#cfb4ff;
 --line:#453b56;
 --surface:#231e30;
 --raised:#30273f;
 --accent-bg:#382951;
 --accent-border:#594279;
 --accent-button:#7544c7;
 --green-bg:#23382f;
 --green-ink:#a0e8c3;
 --gold-bg:#42311e;
 --gold-ink:#ffd28d;
 --focus:#91dbb6;
 --trace-guide:#655c73;
 --trace-ink:var(--green-ink);
 --clerk-color-background:var(--surface);
 --clerk-color-foreground:var(--ink);
 --clerk-color-muted:var(--raised);
 --clerk-color-muted-foreground:var(--muted);
 --clerk-color-input:var(--raised);
 --clerk-color-input-foreground:var(--ink);
 --clerk-color-border:var(--line);
 --clerk-color-neutral:var(--ink);
 --clerk-color-primary:var(--accent-button);
 --clerk-color-primary-foreground:#fff;
 --clerk-color-danger:#ff9eaa;

 :focus-visible,.level-node:focus-visible{outline-color:var(--focus)}
 .sidebar,nav,.header-controls,.panel,.vocab-card,.question-banner,
 .search,.answer-input,.choice,.word,.word-zone,.trace canvas,.feedback-symbol{background:var(--surface)}
 .brand,.mobile-brand,.practice-empty h1,.wordbook-banner h1,.level-load-card h1{color:var(--ink)}
 .brand,.light,.sfx-toggle,.practice-empty,.wordbook-banner,.speaking-control{
  background:var(--accent-bg);border-color:var(--accent-border)
 }
 .brand-accent,.wordbook-art,.speaking-control strong{color:var(--accent)}
 nav a,.practice-empty p,.wordbook-banner p,.speaking-control p{color:var(--muted)}
 nav a.active,.xp-stat,.sound,.task-audio,.choice.selected,.word.selected{
  background:var(--accent-bg);color:var(--accent)
 }
 .context,.transcript,.choice span{background:var(--raised)}
 .brand:hover,nav a:hover,.topbar .sfx-toggle:hover,#theme:hover,.mode-button:hover{background:var(--raised)}
 .topbar .sfx-toggle{background:transparent;color:var(--accent)}
 .streak-stat,.quiz-chain,.notification{background:var(--gold-bg);color:var(--gold-ink)}
 .primary{background:var(--accent-button)}
 progress{background:var(--raised)}
 progress::-webkit-progress-bar{background:var(--raised)}
 .color-0,.scorecards>div{background:var(--green-bg);color:var(--green-ink)}
 .color-1,.choice.paired{background:#273654;color:#b8d1ff}
 .color-2{background:var(--gold-bg);color:var(--gold-ink)}
 .color-3{background:var(--accent-bg);color:var(--accent)}
 .review-panel,.daily-goal.goal-cleared,.feedback{background:var(--green-bg);border-color:#456453}
 .feedback,.scorecards strong{color:var(--green-ink)}
 .goal-toast{color:var(--green-ink)!important}
 .feedback.wrong{background:#44262d;border-color:#754651;color:#ffb8be}
 .daily-goal{background:#322719;border-color:#624826}
 .daily-goal .unit-icon{background:#523c22;color:var(--gold-ink)}
 .daily-goal.goal-cleared .unit-icon{background:#2f5140;color:var(--green-ink)}
 .search,.answer-input,.choice,.word,.word-zone,.vocab-search .search{border-color:#716180}
 .search::placeholder,.answer-input::placeholder{color:var(--muted)}
 .choice:hover,.word:hover{border-color:var(--focus)}
 .choice.selected,.word.selected{border-color:#aa85e6}
 blockquote{color:#dbd2e7;border-left-color:#639a80}
 .lesson-footer{background:#161320ed}
 .question-banner{border-color:var(--line);box-shadow:0 4px 0 #110e18}
 .exercise .choice,.exercise .word{box-shadow:0 3px 0 #110e18}
 .exercise .choice.selected,.exercise .word.selected{box-shadow:0 3px 0 var(--accent-border)}
 .result-stars{color:#716780}
 .result-stars .lit{color:#ffc76a;text-shadow:0 2px #604424}
 .practice-empty-art,.level-load-art{background:var(--accent-bg)}
 .level-loader{background:radial-gradient(ellipse at 50% 37%,var(--accent-bg),transparent 70%)}
 .level-load-art>i{color:var(--accent)}
 .wordbook-art span:last-child,.level-load-art>i:last-child,.mic-live strong{color:#f1a6cb}
 .journey-step{--map-tint:#35274e;--map-ink:#e0caff}
 .map-1{--map-tint:#1d3449;--map-ink:#b5e2ff}
 .map-2{--map-tint:#472735;--map-ink:#ffc1d2}
 .map-3{--map-tint:#1c3a35;--map-ink:#aaf0df}
 .map-banner{box-shadow:0 4px 0 color-mix(in srgb,var(--map) 45%,#161320)}
 .level-node.locked:disabled{background:#30283c;color:#c5b9d4;box-shadow:0 6px 0 #211a2c}
 .level-node.checkpoint.next + .level-label small{background:var(--gold-bg);color:var(--gold-ink)}
 .word-shelf{--shelf-tint:var(--accent-bg);--shelf-accent:var(--accent);--shelf-border:var(--accent-border)}
 .shelf-1{--shelf-tint:#1d3449;--shelf-accent:#b5e2ff;--shelf-border:#365970}
 .shelf-2{--shelf-tint:#472735;--shelf-accent:#ffc1d2;--shelf-border:#754651}
 .shelf-3{--shelf-tint:#1c3a35;--shelf-accent:#aaf0df;--shelf-border:#39675c}
}
