:root{--ink:#183446;--muted:#526c78;--mint:#6bd8bd;--darkmint:#116852;--pink:#ffd4e2;--purple:#6453ad;--paper:#fff;--line:#d9e8e8;--shadow:0 9px 0 #dcebea;--radius:28px;font-family:ui-rounded,"Arial Rounded MT Bold","PingFang TC","Noto Sans TC",system-ui,sans-serif;color:var(--ink);background:#eff8f7;font-size:16px}*{box-sizing:border-box}body{margin:0;min-height:100dvh;background-image:radial-gradient(#b9dcd980 .9px,transparent .9px);background-size:22px 22px}button,select,input{font:inherit}button{cursor:pointer;touch-action:manipulation;min-height:48px;border:0;color:inherit;font-weight:750;-webkit-tap-highlight-color:transparent}button:focus-visible,select:focus-visible{outline:3px solid #7b55db;outline-offset:3px}button:disabled{cursor:default;opacity:.45}button:not(:disabled):active{transform:translateY(2px)}[hidden]{display:none!important}.topbar{height:72px;padding:0 max(20px,calc((100vw - 1120px)/2));display:flex;align-items:center;justify-content:space-between;gap:12px;background:#152d40;color:white}.brand{display:flex;align-items:center;gap:16px;min-width:0}.brand img{width:116px;height:46px;object-fit:contain}.brand span{font-size:16px;font-weight:700}.tools{display:flex;gap:10px;align-items:center}.lang{display:flex;border:1px solid #4a6370;border-radius:15px;padding:3px}.lang button{min-width:48px;min-height:44px;border-radius:11px;background:transparent;color:#dae8eb;font-size:14px}.lang button[aria-pressed=true]{background:#6bd8bd;color:#153e38}.sound{background:#294659;color:white;border-radius:14px;min-width:48px;padding:0 12px;font-size:15px}.sound svg{width:20px;height:20px;vertical-align:middle}.sound .sound-label{margin-left:7px}.shell{max-width:1060px;margin:0 auto;padding:30px 24px 24px}.chapter{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:18px}.eyebrow{font-size:13px;letter-spacing:.12em;font-weight:800;color:var(--darkmint);margin:0 0 7px}.chapter h1{font-size:clamp(24px,3.5vw,34px);letter-spacing:-.04em;margin:0;line-height:1.25}.unit-badge{font-size:14px;background:#e1edfb;border:1px solid #cadff0;padding:8px 14px;border-radius:30px;white-space:nowrap}.setup-grid{display:grid;grid-template-columns:.9fr 1.25fr;gap:22px}.welcome{background:#e9faf5;border:2px solid #c7eadf;border-radius:var(--radius);padding:28px;display:flex;flex-direction:column;justify-content:center;position:relative;overflow:hidden}.welcome .symbol{font-size:50px;color:var(--darkmint);line-height:1;font-weight:900;letter-spacing:10px}.welcome h2{font-size:30px;line-height:1.3;margin:18px 0 12px;letter-spacing:-.03em}.welcome p{line-height:1.8;color:var(--muted);margin:0;max-width:310px}.mascot{width:190px;height:190px;object-fit:cover;border-radius:35px;margin:12px auto 0;mix-blend-mode:multiply}.setup-card{background:white;border:2px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:28px}.step-label{font-size:18px;font-weight:850;display:flex;align-items:center;gap:10px;margin:0 0 16px}.step-number{width:30px;height:30px;background:var(--pink);display:grid;place-items:center;border-radius:50%;font-size:14px}.choices{display:grid;gap:10px;margin-bottom:25px}.time-choices{grid-template-columns:repeat(4,1fr)}.count-choices{grid-template-columns:repeat(5,1fr)}.choice{background:#f4f7fa;border:2px solid #e3eaf0;border-radius:15px;min-height:57px;font-size:23px;white-space:nowrap}.choice small{font-size:14px;font-weight:600;margin-left:4px}.choice[aria-pressed=true]{background:#def7ee;border-color:#248b71;color:#0f614d;box-shadow:0 3px 0 #bee1d6}.setup-note{font-size:14px;color:var(--muted);margin:0 0 18px;line-height:1.65}.primary{display:flex;justify-content:center;align-items:center;gap:12px;width:100%;background:#183f48;color:white;border-radius:17px;min-height:60px;font-size:20px;box-shadow:0 5px 0 #0b2730}.primary .arrow{font-size:25px}.footnote{text-align:center;color:var(--muted);font-size:13px;margin:24px 0 0;line-height:1.6}.session-bar{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:16px}.progress-group{flex:1;min-width:0}.progress-copy{display:flex;justify-content:space-between;gap:10px;font-size:15px;font-weight:800;margin-bottom:9px}.progress-track{height:10px;background:#dceae9;border-radius:20px;overflow:hidden}.progress-track i{display:block;background:#29977a;height:100%;transition:width .25s;border-radius:20px}.quiet-button{border:2px solid #c9dddf;border-radius:14px;background:#fff;padding:0 15px;font-size:15px;white-space:nowrap}.play-grid{display:grid;grid-template-columns:1.2fr 1fr;gap:22px;align-items:stretch}.question-card{background:white;border:2px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:25px;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;min-width:0}.timer-row{display:flex;align-items:center;justify-content:space-between;font-size:14px;color:var(--muted);gap:10px}.timer{font-size:22px;font-weight:850;color:var(--darkmint);min-width:75px;text-align:right;font-variant-numeric:tabular-nums}.timer.urgent{color:#ad3d57}.time-track{height:8px;background:#e3f0eb;border-radius:15px;margin:10px 0 18px;overflow:hidden}.time-track i{display:block;height:100%;width:100%;background:#65cfae;transform-origin:left;border-radius:15px}.time-track.urgent i{background:#e68498}.problem-wrap{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:12px 0}.equation{font-size:clamp(44px,6vw,68px);font-weight:900;letter-spacing:.015em;display:flex;align-items:center;justify-content:center;gap:18px;white-space:nowrap;font-variant-numeric:tabular-nums}.operator{color:#8a77be;font-size:.7em}.answer-line{display:flex;gap:15px;align-items:center;justify-content:center;margin-top:20px}.equals{font-size:38px;color:#84979e}.answer{min-width:140px;height:88px;border:3px dashed #81b9aa;border-radius:21px;background:#f0faf6;display:grid;place-items:center;font-size:50px;font-weight:850;color:#12624b;letter-spacing:.04em}.answer.empty{color:#769b91}.feedback{font-size:17px;font-weight:750;line-height:1.6;min-height:56px;display:flex;align-items:center;justify-content:center;text-align:center;margin:16px 0 0;border-radius:14px;padding:5px 10px;background:#f4f3fb;color:#625490}.feedback.correct{background:#def7eb;color:#12624b}.feedback.incorrect{background:#fff1dc;color:#86541e}.keypad-panel{background:#e5e7f8;border:2px solid #d8dcf1;border-radius:var(--radius);padding:21px;display:flex;flex-direction:column;gap:13px}.keypad-title{font-size:15px;margin:0;text-align:center;color:#5b5b79;font-weight:700}.keypad{display:grid;grid-template-columns:repeat(3,1fr);gap:11px}.key{min-height:66px;border-radius:16px;background:#fff;box-shadow:0 4px 0 #c6c9e2;font-size:30px;font-variant-numeric:tabular-nums}.key.utility{font-size:15px;background:#f3f2fb;color:#575271}.key svg{width:25px;height:25px;vertical-align:middle}.submit{min-height:58px;background:#6753ac;box-shadow:0 5px 0 #4e3b89;font-size:19px}.next{background:#196951;box-shadow:0 5px 0 #10503c}.keyboard-note{font-size:13px;color:#697888;text-align:center;margin:18px 0 0}.result-card{background:#fff;border:2px solid var(--line);border-radius:28px;box-shadow:var(--shadow);padding:30px;text-align:center}.result-top{display:flex;justify-content:center;align-items:center;gap:28px}.result-mascot{width:130px;height:130px;object-fit:cover;border-radius:30px}.result-card h2{font-size:28px;margin:0 0 8px}.score{font-size:72px;font-weight:900;color:#14664f;line-height:1.1}.score span{font-size:20px;color:var(--muted);margin-left:8px}.result-note{color:var(--muted);margin:10px 0 0;line-height:1.6}.stat-row{display:flex;justify-content:center;gap:25px;flex-wrap:wrap;margin:24px 0;font-size:17px}.stat-row strong{font-size:23px}.result-actions{display:flex;gap:13px;max-width:560px;margin:0 auto}.result-actions>*{flex:1}.review{margin-top:28px;text-align:left}.review h3{font-size:18px;margin:0 0 12px}.review-list{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.review-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 15px;background:#f4faf7;border:1px solid #d5eade;border-radius:14px;min-height:65px}.review-item.wrong{background:#fff6e9;border-color:#f0dfbe}.review-equation{font-size:20px;font-weight:850;white-space:nowrap}.review-detail{font-size:14px;color:var(--muted);text-align:right;line-height:1.5}dialog{border:2px solid #d4e8e3;border-radius:26px;box-shadow:0 25px 80px #122d4040;width:min(410px,calc(100% - 32px));padding:30px;color:var(--ink);text-align:center}dialog::backdrop{background:#152d408a;backdrop-filter:blur(5px)}dialog h2{font-size:26px;margin:0 0 12px}dialog p{line-height:1.7;color:var(--muted);margin:0 0 24px}dialog .quiet-button{margin-top:15px;width:100%}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}button{transition:background .15s,transform .1s} @media(hover:hover){.choice:hover,.key:hover{background:#e3faf0}.primary:hover{filter:brightness(1.08)}}
@media(min-width:760px) and (min-height:950px){.shell{padding-top:45px}.key{min-height:86px}.question-card{padding:32px}.setup-card{padding:35px}.choices{margin-bottom:32px}.choice{min-height:67px}}
@media(max-width:700px){.topbar{height:62px;padding:0 12px;gap:8px}.brand img{width:92px;height:37px}.brand span,.sound-label{display:none}.tools{gap:6px}.sound{padding:0;width:44px;min-width:44px;min-height:44px}.lang{padding:2px;border-radius:12px}.lang button{min-width:44px;padding:0 6px}.shell{padding:20px 16px}.chapter{margin-bottom:14px}.chapter h1{font-size:25px}.unit-badge{padding:7px 10px;font-size:13px}.setup-grid{grid-template-columns:1fr;gap:14px}.welcome{padding:18px 20px;min-height:130px;display:block}.welcome .symbol{display:none}.welcome h2{font-size:24px;margin:0 0 8px;max-width:70%}.welcome p{font-size:14px;line-height:1.6;max-width:68%}.mascot{position:absolute;right:8px;bottom:7px;width:110px;height:110px;margin:0}.setup-card{padding:21px}.step-label{font-size:17px;margin-bottom:12px}.choices{margin-bottom:20px;gap:8px}.choice{font-size:22px;min-height:52px}.setup-note{margin-bottom:14px}.footnote{margin-top:18px}.play-grid{grid-template-columns:1fr;gap:14px}.question-card{padding:15px 18px}.time-track{margin:7px 0 7px}.problem-wrap{flex-direction:row;gap:12px;padding:8px 0}.equation{font-size:42px;gap:10px}.answer-line{margin:0;gap:10px}.answer{min-width:78px;height:66px;font-size:35px;border-radius:15px}.equals{font-size:27px}.feedback{margin-top:8px;min-height:42px;font-size:15px;padding:6px 8px}.keypad-panel{padding:15px;gap:12px}.keypad-title{font-size:14px}.key{min-height:60px}.keypad{gap:10px}.session-bar{margin-bottom:12px}.keyboard-note{display:none}.result-card{padding:22px 16px}.result-top{gap:15px}.result-mascot{width:85px;height:85px}.score{font-size:58px}.result-card h2{font-size:24px}.stat-row{gap:16px;font-size:15px}.review-list{grid-template-columns:1fr}.result-actions{flex-direction:column}.result-actions .quiet-button{min-height:52px}}
@media(max-width:360px){.shell{padding:14px 10px}.chapter{margin-bottom:10px}.eyebrow{font-size:12px;margin-bottom:4px}.chapter h1{font-size:23px}.unit-badge{font-size:12px;padding:6px 8px}.welcome{padding:15px;min-height:118px}.welcome h2{font-size:21px}.mascot{width:90px;height:90px}.setup-card{padding:17px}.choice{min-height:49px;font-size:20px}.choices{gap:6px;margin-bottom:16px}.session-bar{gap:8px;margin-bottom:8px}.progress-copy{font-size:13px}.quiet-button{padding:0 11px}.question-card{padding:10px 13px}.equation{font-size:38px;gap:8px}.problem-wrap{gap:9px;padding:4px 0}.answer-line{gap:8px}.answer{min-width:72px;height:57px;font-size:32px}.timer{font-size:20px}.feedback{min-height:36px;font-size:14px;margin-top:5px}.play-grid{gap:10px}.keypad-panel{padding:11px;gap:9px}.keypad-title{display:none}.keypad{gap:8px}.key{min-height:48px;font-size:26px;border-radius:12px}.submit{min-height:49px;font-size:17px}.footnote{font-size:12px}.session-bar .quiet-button{min-height:44px}}
@media(max-height:540px) and (min-width:600px){.topbar{height:56px;padding:0 18px}.brand img{width:92px;height:37px}.brand span{font-size:14px}.shell{padding:12px 18px}.chapter{margin-bottom:10px}.chapter h1{font-size:23px}.eyebrow,.unit-badge,.footnote,.keyboard-note{display:none}.setup-grid{grid-template-columns:.8fr 1.4fr;gap:16px}.welcome{padding:18px}.welcome h2{font-size:23px;margin:0 0 10px}.welcome .symbol{display:none}.welcome p{font-size:14px}.mascot{width:110px;height:110px;margin:0 auto}.setup-card{padding:16px}.step-label{font-size:16px;margin-bottom:8px}.choices{margin-bottom:12px;gap:6px}.time-choices{grid-template-columns:repeat(8,1fr)}.choice{font-size:18px;min-height:45px;border-radius:11px}.choice small{font-size:12px;margin-left:2px}.setup-note{display:none}.primary{min-height:48px;font-size:18px}.play-grid{grid-template-columns:1.15fr 1fr;gap:16px}.session-bar{margin-bottom:10px}.question-card{padding:12px 18px}.problem-wrap{padding:5px 0;flex-direction:column;gap:0}.equation{font-size:44px}.answer-line{margin-top:7px}.answer{height:59px;min-width:100px;font-size:37px}.time-track{margin:6px 0}.feedback{font-size:14px;min-height:34px;margin-top:9px}.keypad-panel{padding:11px;gap:9px}.keypad-title{display:none}.keypad{gap:8px}.key{min-height:44px;font-size:24px;border-radius:11px}.submit{min-height:44px}.timer{font-size:18px}.session-bar .quiet-button{min-height:44px}.progress-copy{font-size:14px;margin-bottom:6px}.result-card{padding:20px}.result-top{gap:18px}.result-mascot{width:85px;height:85px}.score{font-size:54px}.stat-row{margin:16px 0}}
@media(max-width:360px){body:has(#play:not([hidden])) .chapter{display:none}body:has(#play:not([hidden])) .shell{padding-top:10px}.key{min-height:46px}.count-choices .choice{font-size:18px;padding:0 3px}.count-choices .choice small{font-size:12px}}
html[lang="en"] .chapter h1{font-size:clamp(21px,3vw,32px)}
@media(max-width:700px){html[lang="en"] .chapter{align-items:flex-start}html[lang="en"] .chapter h1{font-size:23px}}
@media(max-width:700px){body:has(#play:not([hidden])) .eyebrow{display:none}}
@media(max-width:360px){.question-card{padding:8px 12px}.timer-row{line-height:1.2}.time-track{margin:4px 0;height:6px}.problem-wrap{padding:0}.answer{height:52px}.feedback{min-height:30px;padding:4px 0;line-height:1.4;margin-top:4px}.keypad-panel{padding:8px;gap:8px}.key{min-height:44px}.submit,.next{min-height:44px;font-size:17px}.keypad{gap:7px}.shell{padding-bottom:10px}}
@media(max-height:540px) and (min-width:600px){body:has(#play:not([hidden])) .chapter{display:none}body:has(#play:not([hidden])) .shell{padding-top:8px;padding-bottom:8px}.session-bar{margin-bottom:8px}.keypad-panel{padding:6px;gap:6px}.keypad{gap:6px}.submit,.next{min-height:44px}.question-card{padding:10px 16px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important;animation:none!important}}

/* Compact setup and a complete, scroll-free keypad at normal mobile text size. */
.setup-note{margin:18px 0 0}
.next:disabled{opacity:1;background:#46786b;box-shadow:0 5px 0 #325d52}
@media(max-width:700px){
  .topbar{height:56px;padding-left:max(10px,env(safe-area-inset-left));padding-right:max(10px,env(safe-area-inset-right))}
  .shell{padding:10px 12px max(10px,env(safe-area-inset-bottom))}
  .eyebrow,.footnote{display:none}
  .chapter{margin-bottom:8px;align-items:center}
  .chapter h1,html[lang="en"] .chapter h1{font-size:23px}
  .setup-grid{gap:10px}
  .welcome{display:grid;grid-template-columns:minmax(0,1fr) 62px;gap:3px 8px;padding:10px 12px;min-height:0;border-radius:20px;align-items:center}
  .welcome h2{grid-column:1;max-width:none;font-size:18px;line-height:1.3;margin:0}
  .welcome h2 br{display:none}
  .welcome p{grid-column:1;max-width:none;font-size:14px;line-height:1.4;margin:0}
  .mascot{position:static;grid-column:2;grid-row:1/3;width:62px;height:62px;margin:0;border-radius:18px}
  .setup-card{padding:14px;border-radius:22px}
  .step-label{font-size:16px;gap:8px;margin-bottom:8px;line-height:1.4}
  .step-number{width:24px;height:24px;flex-shrink:0}
  .choices{gap:6px;margin-bottom:12px}
  .choice{min-height:44px;font-size:20px;border-radius:12px}
  .count-choices .choice{font-size:18px;padding:0 3px}
  .count-choices .choice small{font-size:12px}
  #start{min-height:48px;font-size:18px}
  .setup-note{font-size:14px;line-height:1.45;margin:14px 0 0}
  body:has(#play:not([hidden])) .chapter{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;display:block}
  body:has(#play:not([hidden])) .shell{padding:8px 10px max(8px,env(safe-area-inset-bottom))}
  .session-bar{gap:8px;margin-bottom:8px}
  .session-bar .quiet-button{min-height:44px}
  .progress-copy{font-size:14px;margin-bottom:6px}
  .play-grid{gap:10px}
  .question-card{padding:10px 12px;border-radius:21px}
  .timer-row{line-height:1.2}.timer{font-size:20px}
  .time-track{height:6px;margin:5px 0}
  .problem-wrap{padding:4px 0;gap:10px}
  .equation{font-size:40px;gap:8px}
  .answer-line{gap:8px}
  .answer{height:clamp(50px,8svh,66px);min-width:76px;font-size:36px}
  .feedback{margin-top:4px;min-height:32px;padding:4px 2px;font-size:14px;line-height:1.4}
  .keypad-panel{padding:10px;gap:9px;border-radius:21px}
  .keypad-title{display:none}
  .keypad{gap:8px}
  .key{min-height:clamp(44px,7.5svh,60px);font-size:28px;border-radius:13px}
  .submit,.next{min-height:46px;font-size:18px}
}
@media(max-width:360px){
  .shell{padding-left:10px;padding-right:10px}
  .welcome{padding:8px 10px;grid-template-columns:minmax(0,1fr) 52px}
  .welcome h2{font-size:17px}.mascot{width:52px;height:52px}
  .setup-card{padding:12px}.setup-note{font-size:13px}
  .progress-copy{font-size:13px}
  .question-card{padding:8px 12px}.problem-wrap{padding:0;gap:8px}
  .equation{font-size:38px}.answer{min-width:72px;font-size:32px}
  .keypad-panel{padding:8px;gap:8px}.keypad{gap:7px}
  .submit,.next{min-height:44px;font-size:17px}
}
