:root{--paper:#fff;--ink:#172a55;--muted:#52627c;--surface:#eef3fb;--line:#dce4ee;--accent:#245bdc;--good:#146541;--goodbg:#e1f6e9;--bad:#aa2637;--badbg:#ffedf0;--space:normal}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font-family:Arial,Helvetica,sans-serif;letter-spacing:var(--space);height:100dvh;display:flex;flex-direction:column}body[data-palette=blue]{--good:#075bb0;--goodbg:#e0efff;--bad:#963c00;--badbg:#fff0dd}button,input,select{font:inherit}button{cursor:pointer;color:inherit;border:1px solid var(--line);background:var(--paper);border-radius:13px;padding:11px 16px;font-weight:700;min-height:44px}button:hover:not(:disabled){border-color:var(--accent);box-shadow:0 3px 12px #172a5515}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #e99c00;outline-offset:3px}button:disabled{opacity:.5;cursor:default}button.primary{background:var(--accent);color:white;border-color:var(--accent)}button.subtle{background:var(--surface)}header{height:82px;flex:none;display:flex;justify-content:space-between;align-items:center;padding:12px 3vw;border-bottom:1px solid var(--line);gap:10px}.brand{display:flex;align-items:center;text-align:left;font-size:13px;line-height:1.3;border:0;padding:0;background:transparent;letter-spacing:.07em}.brand b{display:block;font-size:18px;letter-spacing:0}.bolt{font-size:46px;margin-right:12px;color:#f5b600}.header-right{display:flex;align-items:center;gap:10px}.header-right button{font-size:13px}#pupilLabel{font-size:13px;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}main{flex:1;min-height:0;padding:22px 3vw 14px;display:flex;flex-direction:column;gap:16px}footer{height:31px;flex:none;padding:0 3vw;display:flex;justify-content:space-between;font-size:10px;letter-spacing:.08em;color:var(--muted)}h1,h2,h3,p{margin:0}h1{font-size:clamp(25px,3vw,40px);letter-spacing:-.025em}h2{font-size:26px}h3{font-size:19px}p{line-height:1.55}.eyebrow{font-size:11px;font-weight:800;letter-spacing:.13em;color:var(--accent);text-transform:uppercase;margin-bottom:8px}.muted{color:var(--muted)}.topline{display:flex;justify-content:space-between;gap:20px;align-items:center}.hero-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));flex:1;min-height:0;gap:13px}.hero-card{overflow:hidden;text-align:left;padding:0;display:flex;flex-direction:column;position:relative;background:var(--paper);min-height:0}.hero-card img{width:100%;height:calc(100% - 57px);object-fit:contain;background:white}.hero-card .caption{padding:8px 13px;display:flex;justify-content:space-between;align-items:center;font-size:13px;gap:8px;min-height:57px}.hero-card .caption small{display:block;font-size:11px;color:var(--muted);margin-top:3px}.hero-card.locked{filter:saturate(.35);opacity:.72}.pill{font-size:11px;background:var(--surface);padding:7px 10px;border-radius:99px;white-space:nowrap}.paging{display:flex;justify-content:center;align-items:center;gap:18px}.paging button{padding:7px 18px}.split{display:grid;grid-template-columns:minmax(0,.95fr) minmax(0,1.25fr);gap:25px;flex:1;min-height:0}.hero-panel{border-radius:24px;background:var(--surface);padding:22px;display:flex;flex-direction:column;justify-content:center;gap:16px;min-height:0}.hero-art{width:100%;max-height:46%;object-fit:contain;background:white;border-radius:17px}.mission-list{display:flex;flex-direction:column;justify-content:center;gap:11px;min-height:0}.mission-row{padding:12px 15px;border:1px solid var(--line);border-radius:16px;display:flex;justify-content:space-between;align-items:center;gap:10px}.mission-row small{display:block;margin-top:5px;font-size:12px;color:var(--muted)}.mission-row button{font-size:13px}.row-actions{display:flex;gap:6px}.back{padding:8px 13px;min-height:40px}.challenge-top{display:flex;justify-content:space-between;align-items:center;gap:15px}.stats{display:flex;gap:14px}.stat{min-width:92px;border-left:1px solid var(--line);padding-left:15px}.stat small{display:block;font-size:11px;color:var(--muted);margin-bottom:5px}.stat strong{font-size:25px;font-variant-numeric:tabular-nums}.play-area{display:grid;grid-template-columns:minmax(0,1fr) 285px;gap:25px;flex:1;min-height:0}.question-panel{border:1px solid var(--line);border-radius:25px;padding:24px;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;gap:19px;position:relative;background:var(--paper)}.question-panel .mini-art{position:absolute;top:10px;left:12px;width:145px;height:70px;object-fit:contain;background:white;border-radius:8px}.equation{font-size:clamp(42px,5.5vw,72px);font-weight:800;letter-spacing:.02em}.answer{display:inline-flex;align-items:center;justify-content:center;min-width:110px;min-height:88px;background:var(--surface);border:3px solid var(--accent);border-radius:16px;font-variant-numeric:tabular-nums;padding:6px 13px}.answer.good{border-color:var(--good);background:var(--goodbg)}.answer.bad{border-color:var(--bad);background:var(--badbg)}.feedback{font-size:18px;font-weight:700;min-height:29px;max-width:90%}.feedback.good{color:var(--good)}.feedback.bad{color:var(--bad)}.keypad{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;align-content:center}.keypad button{height:63px;font-size:26px;background:var(--surface);border:0;border-radius:16px}.keypad button.enter{grid-column:1/-1;background:var(--accent);color:white;font-size:18px}.progress-track{height:6px;background:var(--surface);border-radius:8px;overflow:hidden}.progress-track div{height:100%;background:var(--accent);transition:width .2s}.support{max-width:560px;font-size:17px;line-height:1.65;color:var(--muted)}.number-dots{display:flex;gap:5px;justify-content:center;flex-wrap:wrap;max-width:330px}.dot{width:18px;height:18px;border-radius:50%;background:var(--accent)}.result{max-width:800px;margin:auto;text-align:center;display:flex;flex-direction:column;gap:22px;align-items:center}.medal{font-size:60px;color:#d38a00}.result-stats{display:flex;gap:40px}.result-stats strong{font-size:35px;display:block}.result-stats small{font-size:13px;color:var(--muted)}.actions{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}dialog{border:1px solid var(--line);border-radius:23px;background:var(--paper);color:var(--ink);padding:28px;width:min(640px,93vw);max-height:85dvh;box-shadow:0 20px 100px #101a4244}dialog::backdrop{background:#101c3e80}dialog h2{margin-bottom:12px}dialog p{margin-bottom:14px}dialog form{display:flex;flex-direction:column;gap:15px}label{display:flex;flex-direction:column;gap:8px;font-size:14px;font-weight:700}input,select{padding:12px;border:1px solid #a7b5c8;border-radius:10px;background:var(--paper);color:var(--ink);min-width:0}input[type=checkbox]{width:20px;height:20px}.check{flex-direction:row;align-items:center}.dialog-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:15px}.dialog-head h2{margin:0}.swatches{display:flex;gap:9px;flex-wrap:wrap}.swatches button[aria-pressed=true]{outline:3px solid var(--accent);outline-offset:2px}.notice{background:var(--surface);border-radius:12px;padding:12px;font-size:13px;margin:10px 0}.error{color:var(--bad);min-height:20px;font-size:14px}.teacher-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.teacher-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:15px 0}.teacher-summary div{padding:12px;background:var(--surface);border-radius:12px;font-size:12px}.teacher-summary strong{display:block;font-size:25px;margin:5px 0}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}.hint-line{display:flex;align-items:center;gap:8px;justify-content:center}.empty{font-size:15px}.wide{grid-column:1/-1}body.motion-off *,body.motion-off *::before{animation:none!important;transition:none!important}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}@media(max-height:700px) and (min-width:800px){header{height:66px}main{padding-top:13px;gap:11px}.hero-panel{padding:16px;gap:11px}.mission-row{padding:9px 12px}.mission-row small{margin-top:3px}.keypad button{height:52px}.question-panel{padding:17px;gap:12px}.answer{min-height:70px}.hero-art{max-height:43%}.topline p{font-size:13px}}@media(max-width:799px){body{height:auto;min-height:100dvh}header{height:auto;flex-wrap:wrap;padding:10px 4vw}.header-right{flex-wrap:wrap}.header-right button{padding:8px}main{min-height:75vh;padding:18px 4vw}.hero-grid{min-height:550px;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,1fr)}.split{grid-template-columns:1fr}.hero-panel{min-height:200px}.hero-art{max-height:150px}.mission-row{flex-wrap:wrap}.play-area{grid-template-columns:1fr}.question-panel{min-height:300px}.keypad{grid-template-columns:repeat(3,1fr)}.keypad button{height:50px}.stats{gap:8px}.stat{min-width:65px;padding-left:8px}.stat strong{font-size:19px}.challenge-top h2{font-size:20px}footer{margin-top:15px}.topline{align-items:flex-start}.teacher-grid{grid-template-columns:1fr}.equation{font-size:40px}}@media print{header,footer,dialog,main{display:none}}
.equation.compare{font-size:clamp(26px,3.4vw,44px)}.equation.compare .answer{min-width:70px;min-height:70px}.question-panel:has(.compare){padding-left:12px;padding-right:12px}
/* Landscape support layout: the tool shares the question panel, never the keypad. */
header .header-right{gap:7px}#pupilLabel{max-width:95px}.header-right button{padding:10px 12px}.play-panel{padding:12px;gap:10px}.play-instructions{display:flex;align-items:center;justify-content:center;gap:7px;width:100%;flex:none}.play-instructions>span{font-size:12px;color:var(--muted)}.play-instructions button{font-size:12px;padding:8px 11px;white-space:nowrap}.play-panel .equation{font-size:58px}.play-panel .equation.compare{font-size:34px}.play-panel .answer{min-height:74px;min-width:92px}.play-panel.with-tools{justify-content:flex-start;gap:7px}.play-panel.with-tools .equation{font-size:46px;line-height:1.15;flex:none}.play-panel.with-tools .equation.compare{font-size:29px}.play-panel.with-tools .answer{min-height:61px;min-width:81px;padding:4px 10px}.feedback-row{display:flex;align-items:center;justify-content:center;gap:7px;flex:none;min-height:27px}.feedback-row .feedback{font-size:15px;min-height:22px;max-width:100%}.feedback-row button{min-height:28px;padding:3px 10px}.worked-hint{font-size:16px;line-height:1.5;max-width:550px}.tool-dock{display:flex;flex:1;min-height:0;flex-direction:column;width:100%;gap:6px;border-top:1px solid var(--line);padding-top:6px}.tool-dock[hidden]{display:none}.tool-heading{display:flex;justify-content:center;align-items:center;gap:8px;flex:none}.tool-heading select{max-width:260px;font-size:13px;padding:8px;min-height:44px}.tool-heading button{font-size:12px;padding:8px 10px}.tool-content{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px}.math-svg{width:100%;height:130px;max-height:150px;flex:1;min-height:0}.tool-caption{font-size:12px;line-height:1.3;flex:none}.tool-controls{display:flex;align-items:center;justify-content:center;gap:9px;flex:none;font-size:13px}.tool-controls button{min-width:44px;min-height:44px;padding:7px 12px;font-size:15px}.frames{display:flex;justify-content:center;gap:10px}.ten-frame{display:grid;grid-template-columns:repeat(5,42px);border:2px solid var(--ink)}.counter-cell{border:1px solid #a7b5c8;border-radius:0;width:42px;height:42px;min-height:42px;padding:4px;position:relative;background:var(--paper)}.counter-cell.filled span{display:block;border-radius:50%;height:28px;width:28px;background:#245bdc;margin:auto}.counter-cell.second span{background:#c47712;border-radius:5px}.counter-cell.marked{outline:3px solid var(--ink);outline-offset:-4px}.counter-cell.marked::after{content:'✓';position:absolute;inset:7px;color:white;text-shadow:1px 1px 2px #000;font-size:21px}.counter-cell.crossed::before{content:'';position:absolute;inset:19px 2px;transform:rotate(-40deg);height:3px;background:var(--ink);z-index:1}.shape-layout{display:flex;align-items:center;width:100%;min-height:0;flex:1}.shape-layout .math-svg{width:70%;flex:1}.shape-layout label{font-size:12px;width:145px;flex:none}.hundred-layout{display:flex;gap:22px;align-items:center;justify-content:center;min-height:0}.hundred-grid{display:grid;grid-template-columns:repeat(10,20px);grid-auto-rows:20px;border:1px solid var(--ink);flex:none}.hundred-grid span{border:.5px solid #a7b5c8;display:flex;align-items:center;justify-content:center;font-size:10px}.hundred-grid .starting{outline:2px solid var(--ink);outline-offset:-2px;font-weight:bold}.hundred-grid .selected{background:#245bdc;color:#fff;font-weight:bold}.hundred-controls{display:flex;flex-direction:column;gap:12px;width:190px;font-size:13px}.hundred-controls .tool-controls{display:grid;grid-template-columns:repeat(2,1fr)}.hundred-controls small{font-size:12px;line-height:1.4}.award{display:flex;flex-direction:column;align-items:center;gap:5px;font-size:13px;max-width:160px}.award svg{width:67px;height:77px}.awards{display:flex;gap:30px;justify-content:center}.access-result{gap:15px}.access-result .result-stats strong{font-size:30px}.access-result .support{font-size:16px}.access-result .result-heading p{margin-top:7px}.tabs{display:flex;gap:8px;margin:8px 0 12px}.tabs button{flex:1;font-size:13px;padding:8px}.tabs button[aria-pressed=true]{background:var(--ink);color:white}.read-controls{display:flex;justify-content:flex-end;gap:7px;margin-bottom:5px}.read-controls button{font-size:12px;padding:8px 12px}.choice-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.speed-fields{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.speed-fields label{font-size:12px}.speed-fields input{width:100%}.route-options{display:flex;flex-direction:column;gap:10px;margin:14px 0}.route-options button{display:flex;flex-direction:column;align-items:center;gap:6px;min-height:68px}.route-options small{font-size:12px;font-weight:normal}.admin-note{font-size:12px;color:var(--muted);margin-top:10px!important;line-height:1.35}.teacher-summary{margin:10px 0}.teacher-summary strong{font-size:23px}.teacher-summary div{padding:9px}.teacher-grid{gap:8px;margin-top:10px}.teacher-grid button{font-size:13px}.report-lens{margin:8px 0}.large-text .play-panel .equation{font-size:66px}.large-text .play-panel.with-tools .equation{font-size:54px}.large-text .play-panel .equation.compare{font-size:38px}.large-text .play-panel.with-tools .equation.compare{font-size:33px}dialog{width:min(760px,95vw);padding:16px;max-height:calc(100dvh - 20px)}dialog form{gap:10px}dialog p{margin-bottom:10px}dialog .dialog-head{margin-bottom:8px}dialog label{font-size:13px}dialog .notice{font-size:12px;padding:10px;margin:6px 0;line-height:1.4}dialog .check input{flex:none}dialog .check{min-height:28px}.mission-row small{font-size:11px}.mission-row h3{font-size:18px}.mission-row button{font-size:12px;padding:9px 10px}.hero-panel .hero-art{max-height:34%}
@media(min-width:800px) and (max-height:700px){.play-panel{padding:9px;gap:6px}.play-panel.with-tools{gap:5px}.play-panel.with-tools .equation{font-size:42px}.large-text .play-panel.with-tools .equation{font-size:49px}.play-panel.with-tools .answer{min-height:56px}.play-panel.with-tools .equation.compare{font-size:28px}.large-text .play-panel.with-tools .equation.compare{font-size:31px}.play-instructions>span{display:none}.play-instructions button{padding:7px 10px}.tool-dock{padding-top:4px;gap:4px}.tool-heading{gap:6px}.tool-heading select{max-width:230px}.hundred-grid{grid-template-columns:repeat(10,18px);grid-auto-rows:18px}.hundred-controls{gap:7px}.math-svg{height:110px}.mission-list{gap:8px}.mission-row{padding:8px 10px}.result.access-result{gap:10px}.award svg{height:65px;width:57px}.access-result .support{font-size:15px}}
@media(max-width:799px){.choice-grid{grid-template-columns:1fr}.play-instructions{flex-wrap:wrap}.hundred-layout{gap:8px}.hundred-controls{width:140px}.frames{flex-wrap:wrap}.header-right{gap:4px}.speed-fields{gap:7px}}
.ten-frame{grid-template-columns:repeat(5,44px)}.counter-cell{width:44px;height:44px;min-height:44px}
.worksheet-original{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:12px;border:1px solid var(--line);border-radius:14px;margin-bottom:14px}.worksheet-original h3,#worksheetForm h3{font-size:18px}.worksheet-original p{font-size:12px;margin:5px 0 0;color:var(--muted)}.worksheet-original button{font-size:13px;flex:none}#worksheetForm>div>p{font-size:13px;margin:5px 0 0}.worksheet-note{font-size:12px;line-height:1.4;color:var(--muted)}.worksheet-status{font-size:13px;min-height:38px;line-height:1.4;margin:12px 0 0!important}#worksheetForm input[name=code]{text-transform:uppercase}#worksheetForm input[name=code]::placeholder{text-transform:none;font-size:12px}
.adventure-launch{background:linear-gradient(115deg,#172a55,#3559a2);color:#fff;border:0;font-weight:800;min-height:44px}.adventure-active #app{padding:0;max-width:none;flex:1;min-height:0;display:flex}.adventure-active #app iframe{width:100%;height:100%;border:0;flex:1;min-height:0}.adventure-active footer{display:none}.adventure-active header{display:none}#modal:has(#adventureToolQuestion){width:min(820px,96vw);max-height:calc(100dvh - 24px);padding:18px}#modal:has(#adventureToolQuestion) .tool-dock{max-height:420px}#adventureToolQuestion{font-size:26px;text-align:center;font-weight:800;margin:8px}
