:root{font-family:'Segoe UI',system-ui,sans-serif;color:#253d45;background:#faf8f1;font-synthesis:none}*{box-sizing:border-box}body{margin:0;padding:22px 32px}button,input{font:inherit;color:inherit}button{cursor:pointer;background:#fffefa;border:1.5px solid #cbd5cf;border-radius:12px;padding:13px 18px;font-weight:700;min-height:46px}button:hover{filter:brightness(.96)}button:disabled{opacity:.5;cursor:default}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #b88019;outline-offset:4px}[hidden]{display:none!important}header{display:flex;align-items:center;justify-content:space-between;gap:20px;border-bottom:2px solid #d6ded6;padding-bottom:22px;max-width:1460px;margin:auto}.brand{display:flex;align-items:center;gap:14px;font-size:39px;font-weight:800;text-decoration:none;color:#005748}.logo{display:grid;place-items:center;width:51px;height:55px;background:#005e49;color:#ffe290;border-radius:12px;transform:rotate(-13deg);font-size:52.5px}nav{display:flex;flex-wrap:wrap;gap:8px}main{max-width:1460px;margin:auto}.heading{display:flex;align-items:baseline;gap:24px;margin:25px 0 23px}h1{font-size:72px;letter-spacing:-1.8px;margin:0}h1 span{color:#87a69b}.heading p{font-size:34.5px;font-weight:650;margin:0}.game{max-width:1200px;margin:auto;background:#fffefa;border:2px solid #30464b;border-radius:26px;box-shadow:7px 8px 0 #d7e4dc;padding:24px}.game-head{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:20px}h2{font-size:37.5px;margin:0 0 5px}.game-head p{margin:0;color:#647881}.lavender{background:#e8e1f4;border-color:#52636d}.layout{display:grid;grid-template-columns:minmax(0,1.8fr) minmax(260px,1fr);gap:24px}.play{min-width:0}.stats{display:flex;justify-content:space-between;color:#657977;font-size:21px;margin:0 8px 15px}#equation{display:flex;align-items:center;justify-content:center;gap:13px;min-height:82px;font-size:57px;font-weight:750;background:#f4f5ee;border-radius:17px}.blank{display:inline-grid;place-items:center;border:2px dashed #8c80a8;background:#eae2f5;border-radius:9px;min-width:57px;min-height:55px;color:#655486}.scales{width:100%;height:auto;display:block;margin-top:4px}.scales text{font-size:48px;fill:#253d45;font-weight:750}#beam{transform-origin:380px 150px;transition:transform .65s ease}#leftPan{transform-origin:130px 150px;transition:transform .65s ease}#rightPan{transform-origin:630px 150px;transition:transform .65s ease}#feedback{background:#edf3e7;border:1px solid #d9e3cc;border-radius:12px;padding:17px;min-height:64px;font-weight:600;line-height:1.5}#feedback.try{background:#fff0df;border-color:#edca9a}#feedback.success{background:#e4f1e6;border-color:#7aa683}#dots{display:flex;gap:7px;margin-top:16px}#dots span{height:9px;flex:1;background:#eceee8;border-radius:6px}#dots .done{background:#83a18b}#dots .current{background:#b7a3d3}aside{background:#f3f5f1;padding:22px;border-radius:22px}h3{font-size:34.5px;margin:0}.muted{color:#657980;font-size:21px;margin:8px 0 18px}label{display:block;font-size:21px;font-weight:600;margin-bottom:7px}input{width:100%;height:67px;text-align:center;background:#fffefa;border:2px solid #889c9b;border-radius:12px;font-size:52.5px;font-weight:750}#keypad{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin:15px 0}#keypad button{background:#dfedf6;border:1.5px solid #536973;box-shadow:0 3px 0 #c8d9df;font-size:36px;padding:10px}#keypad .erase{background:#ffe5cf;font-size:25.5px}.primary{background:#253d45;color:white;border-color:#253d45;width:100%;font-size:27px}.wide{width:100%;margin-top:12px}.quiet{background:transparent;border-color:transparent;font-size:21px}.tip{margin-top:18px;border-top:1px solid #d6dfd7;padding-top:19px;font-size:21px;line-height:1.5}.tip p{margin:6px 0 0;color:#64797b}footer{display:flex;justify-content:space-between;color:#748585;margin:26px 0;font-size:21px}dialog{border:2px solid #344c51;border-radius:22px;padding:25px;width:min(620px,92vw);color:inherit;background:#fffefa}dialog::backdrop{background:#1e37365c}.modal-head{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:18px}.modal-head button{font-size:36px;padding:5px 15px}.levels{display:grid;grid-template-columns:1fr 1fr;gap:12px}.levels button{text-align:left;background:#eee8f6}.levels small{display:block;font-weight:400;margin-top:7px;line-height:1.5}#modalBody p{line-height:1.7}@media(prefers-reduced-motion:reduce){*{transition:none!important}}
.brand img{width:270px;height:54px;object-fit:contain}.game-tools{display:flex;gap:8px;align-items:center}#demoInside{display:none}.checkbox{display:flex;align-items:center;gap:9px;font-size:21px;line-height:1.4;margin:16px 0}.checkbox input{width:19px;height:19px;accent-color:#5b7865}.block-example{color:#bca4d8;font-size:72px;line-height:1;text-align:center;margin:16px}.arm-scale{width:100%;height:100%;min-height:230px;max-height:420px}.arm-scale text{font-size:30px;fill:#29434a;font-weight:650}.mark.active{cursor:pointer}.mark.active:hover rect,.mark.active:focus rect{fill:#d8caee66}.mark.active:focus{outline:none}.mark.active:focus rect{stroke:#8e72b1;stroke-width:2}#scene{min-height:250px;display:flex;align-items:center;justify-content:center;flex:1}.history-title{font-size:18px;margin-top:17px;display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap}.history-title span{color:#60716f;font-size:16.5px}#dots{margin-top:8px}#dots span{height:26px;text-align:center;font-size:25.5px;font-weight:bold;color:#253d45}#dots .green{background:#9fc89d}#dots .amber{background:#f1cb7d}#dots .pink{background:#ecb1c6}#feedback.miss{background:#f8e1e9;border-color:#d99cb0}#equation{font-size:52.5px;padding:12px;text-align:center}.removal{display:grid;gap:9px;margin-bottom:18px}#given{background:#fff1bf;border-radius:10px;padding:12px;font-weight:700}.pan-scale{width:100%;height:300px;position:relative}.pan{position:absolute;top:40px;width:40%;height:128px;display:flex;flex-wrap:wrap;align-content:flex-end;justify-content:center;gap:7px;padding:12px 5px;border-bottom:9px solid #29434a;border-radius:0 0 32px 32px;background:linear-gradient(transparent,#edf1e7)}.left-pan{left:2%}.right-pan{right:2%}.weight{width:38px;height:38px;border:2px solid #52676c;border-radius:6px;display:grid;place-items:center;font-weight:bold}.yellow{background:#f5d36e}.blue{background:#a7d7ed}.pan-beam{position:absolute;top:181px;left:20%;right:20%;height:8px;background:#29434a}.pan-pillar{position:absolute;top:181px;left:calc(50% - 28px);width:56px;height:90px;background:#a1b9ae;clip-path:polygon(50% 0,100% 100%,0 100%)}.game:fullscreen,.game.focus-mode{width:100vw;max-width:none;height:100dvh;overflow:auto;padding:20px;border-radius:0;box-shadow:none;background:#fffefa}.game.focus-mode{position:fixed;inset:0;z-index:20}.game:fullscreen #demoInside,.game.focus-mode #demoInside{display:block}.game:fullscreen,.game.focus-mode{display:flex;flex-direction:column}.game:fullscreen .layout,.game.focus-mode .layout{flex:1;min-height:0}.game:fullscreen .play,.game.focus-mode .play{display:flex;flex-direction:column;min-height:0}.game:fullscreen #scene,.game.focus-mode #scene{min-height:150px}.game:fullscreen aside,.game.focus-mode aside{overflow:auto}.game:fullscreen #equation,.game.focus-mode #equation{min-height:55px}.game:fullscreen .game-head,.game.focus-mode .game-head{flex-shrink:0}.game:fullscreen .arm-scale,.game.focus-mode .arm-scale{min-height:120px;max-height:100%}#demoScene svg{width:100%;display:block}
/* Full-width balance and compact controls underneath. */
header,main{max-width:none}.game{max-width:none;width:100%}.layout{display:flex;flex-direction:column;gap:16px}.play{width:100%}#scene{position:relative;width:100%;min-height:240px}#scene,.arm-scale,.mark,.movable,.pan-scale,#equation,#blockTray{user-select:none;-webkit-user-select:none;-webkit-user-drag:none}#scene,#blockTray{touch-action:none}.arm-scale{display:block;width:100%;height:auto;max-height:none;min-height:0}.mark{cursor:pointer}.mark rect,.mark:hover rect,.mark:focus rect,.mark.active:hover rect,.mark.active:focus rect{fill:transparent;stroke:none}.mark:focus-visible path{stroke:#987414;stroke-width:5}.movable{cursor:grab;touch-action:none}.movable:focus-visible rect{stroke:#987414;stroke-width:3}.movable:active{cursor:grabbing}#movingBeam,#panAssembly{transition:transform .7s cubic-bezier(.25,.75,.3,1);transform-box:view-box}#blockTray{display:block;border:0;background:transparent;color:#a9c7ab;font-size:72px;line-height:1;margin:0;padding:0 10px;cursor:grab;min-height:44px;text-shadow:1px 1px #334b50}.drag-ghost{position:fixed;width:35px;height:38px;transform:translate(-50%,-50%);background:#a9c7ab;border:2px solid #334b50;border-radius:5px;pointer-events:none;z-index:1000;display:grid;place-items:center;font-weight:bold}.drag-ghost.yellow{background:#f5d36e}.drag-ghost.blue{background:#a7d7ed}.success-tick{display:none;position:absolute;top:5%;left:50%;transform:translateX(-50%);color:#168348;font-size:165px;font-weight:900;line-height:1;text-shadow:0 3px 0 #fff,0 0 15px #fff;pointer-events:none}.correct .success-tick{display:block}aside{display:flex;align-items:center;flex-wrap:wrap;gap:10px 18px;padding:14px 18px;border-radius:15px}aside h3{font-size:27px}aside .muted{margin:0;font-size:19.5px}#instruction{flex:1;min-width:180px}#numberOption{margin:0}#blockControls{display:flex;align-items:center;gap:12px;flex-wrap:wrap}#remaining{font-size:19.5px;margin:0}aside .wide{width:auto;margin:0;min-height:42px;padding:9px 15px}aside .tip{display:none}#weightControls{display:flex;align-items:center;gap:12px;flex-wrap:wrap}#weightControls label{margin:0}#weightControls input{width:100px;height:45px;font-size:36px}#given{margin:0;padding:9px}.removal{display:flex;gap:8px;margin:0}.removal button{font-size:19.5px;padding:8px;min-height:40px}.pan-scale{height:310px;max-width:1000px}#panAssembly{position:absolute;top:0;width:100%;height:190px}.weight{padding:0;min-height:38px;cursor:grab;touch-action:none;user-select:none}.pan{height:145px;top:20px}.pan-pillar{height:110px}.game:fullscreen .layout,.game.focus-mode .layout{display:flex;flex-direction:column;min-height:0}.game:fullscreen .play,.game.focus-mode .play{flex:1;min-height:230px}.game:fullscreen #scene,.game.focus-mode #scene{min-height:120px;flex:1;overflow:hidden}.game:fullscreen .arm-scale,.game.focus-mode .arm-scale{height:100%;width:100%;max-height:none;min-height:0}.game:fullscreen aside,.game.focus-mode aside{flex-shrink:0;overflow:visible;padding:10px 14px}.game:fullscreen .game-head,.game.focus-mode .game-head{margin-bottom:8px}.game:fullscreen #equation,.game.focus-mode #equation{min-height:40px;padding:5px;font-size:40.5px}.game:fullscreen #feedback,.game.focus-mode #feedback{min-height:0;padding:9px;font-size:21px}.game:fullscreen .history-title,.game.focus-mode .history-title{margin-top:7px}.game:fullscreen .stats,.game.focus-mode .stats{margin-bottom:5px}.game:fullscreen #dots,.game.focus-mode #dots{margin-top:5px}.game:fullscreen .pan-scale,.game.focus-mode .pan-scale{height:100%;min-height:230px}@media(prefers-reduced-motion:reduce){#movingBeam,#panAssembly{transition:none}}
/* Centre supply, pivot comparison and nearby check button. */
#sceneWrap{position:relative;display:flex;flex-direction:column;flex:1;min-height:250px;padding-bottom:48px}#sceneWrap #scene{flex:1;width:100%}#sceneWrap #check{position:absolute;bottom:6px;left:calc(50% + 65px);width:auto;min-width:150px;min-height:38px;padding:9px 16px;font-size:22.5px}.game:fullscreen #sceneWrap,.game.focus-mode #sceneWrap{min-height:185px;flex:1}.game:fullscreen #sceneWrap #scene,.game.focus-mode #sceneWrap #scene{height:100%;min-height:120px}.given-block{cursor:default;pointer-events:none}#blockTray{cursor:grab;touch-action:none;user-select:none}#blockTray:focus-visible>rect{stroke:#96751c;stroke-width:3}.removed-pile{position:absolute;top:225px;width:37%;min-height:60px;display:flex;flex-wrap:wrap;align-content:flex-start;justify-content:center;gap:5px;padding:4px;border-bottom:5px solid #a1b9ae;border-radius:6px;z-index:2}.left-pile{left:3%}.right-pile{right:3%}.removed-pile small{width:100%;text-align:center;font-size:16.5px;color:#647874}.removed-pile .weight{width:32px;height:32px;min-height:32px;font-size:21px;cursor:pointer}.pan-scale{min-height:325px}.comparison-badge{position:absolute;left:50%;top:43%;transform:translate(-50%,-50%);display:grid;place-items:center;width:65px;height:48px;border:2px solid #54746a;background:#fffdf2;border-radius:11px;color:#21473c;font-size:58.5px;line-height:1;font-weight:800;box-shadow:0 3px 0 #dce6d9;pointer-events:none;user-select:none}.pan-scale~.comparison-badge{top:39%}.success-tick{z-index:4}.game:fullscreen #sceneWrap:has(.pan-scale),.game.focus-mode #sceneWrap:has(.pan-scale){min-height:365px}

.success-tick{color:#7540b5;text-shadow:0 3px 0 #fff,0 0 15px #fff}


/* Keep CSS geometry stable while browser zoom scales the complete game. */
body{padding:22px 24px;overflow-anchor:none}header,main{width:var(--game-layout-width);max-width:none;margin-left:0;margin-right:0}header{flex-wrap:wrap}h1{font-size:72px}#equation{font-size:52.5px}.game{overflow-anchor:none}#sceneWrap{padding-bottom:0}#sceneWrap.weight-mode{padding-bottom:48px}.arm-scale{aspect-ratio:800 / 350;height:auto;width:100%}#sceneWrap.level-three .arm-scale .mark text{font-size:22.5px;font-weight:500}#feedback{background:transparent;border:0;border-radius:0;padding:8px 0;min-height:0;font-size:21px}#feedback.quiet-status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);padding:0;margin:0;white-space:nowrap}#next[hidden]{display:inline-block!important;visibility:hidden;pointer-events:none}#next{min-width:155px}.game:fullscreen,.game.focus-mode{display:block;overflow:auto}.game:fullscreen .game-head,.game.focus-mode .game-head,.game:fullscreen .layout,.game.focus-mode .layout{width:calc(var(--game-layout-width) - 48px);min-width:312px}.game:fullscreen .play,.game.focus-mode .play{display:block}.game:fullscreen #sceneWrap,.game.focus-mode #sceneWrap{display:block;min-height:0}.game:fullscreen #sceneWrap #scene,.game.focus-mode #sceneWrap #scene{height:auto;min-height:0;overflow:visible}.game:fullscreen .arm-scale,.game.focus-mode .arm-scale{height:auto;aspect-ratio:800 / 350}.game:fullscreen #equation,.game.focus-mode #equation{font-size:52.5px;padding:12px;min-height:82px}.game:fullscreen .pan-scale,.game.focus-mode .pan-scale{height:325px}.game:fullscreen aside,.game.focus-mode aside{padding:14px 18px}.success-tick{font-size:165px;color:#7540b5}
.question-tools{display:flex;align-items:center;gap:9px;min-height:46px;padding:8px 0 0}.question-tools button{font-size:19.5px;min-height:34px;padding:7px 11px}.question-tools #pause{margin-left:8px;background:#eee6f6}#reviewLabel{font-size:19.5px;color:#66517b}.arm-scale .mark text,#sceneWrap.level-three .arm-scale .mark text{font-size:22.5px;font-weight:500}.comparison-badge{top:82%;width:56px;height:42px;font-size:49.5px;z-index:3}.pan-scale~.comparison-badge{top:39%}.question-tools [hidden]{display:none!important}#scene[inert]{cursor:default}.drag-ghost{transition:none!important;flex:none;max-width:none;max-height:none}
/* Mystery weights: large labels, supply shelf and one answer row. */
.equation-sign.equal{color:#2263b5}.equation-sign.unequal{color:#bb353c}.mystery-mode #gameControls{display:none}.mystery-mode #feedback{font-size:21px}.mystery-mode #scene{display:block;min-height:470px}.mystery-mode #sceneWrap.weight-mode{padding-bottom:0}.weight-bank{position:absolute;left:0;top:20px;width:110px;display:grid;grid-template-columns:1fr 1fr;gap:8px;align-content:start;padding:8px;background:#f1f3e9;border-radius:12px}.weight-bank strong,.weight-bank small{grid-column:1/-1;text-align:center}.weight-bank small{font-size:16.5px;line-height:1.4}.weight-bank .weight{width:43px;height:52px;min-height:52px;font-size:22.5px}.weight-bank [aria-pressed=true]{outline:3px solid #7540b5;outline-offset:2px}.mystery-mode .pan-scale{margin-left:125px;width:calc(100% - 125px);max-width:none;height:465px;min-height:465px;position:relative}.mystery-mode #panAssembly{height:260px}.mystery-mode .pan{top:15px;height:235px;padding:10px;gap:7px;overflow:auto}.mystery-mode .pan-beam{top:260px}.mystery-mode .pan-pillar{top:260px;height:120px}.mystery-mode .weight{width:62px;height:60px;min-height:60px;font-size:27px;font-weight:750;white-space:nowrap;border-radius:8px;flex-shrink:0}.mystery-mode .weight-bank .weight{width:43px;height:52px;min-height:52px;font-size:22.5px}.mystery-mode .removed-pile{top:330px;min-height:95px;padding-bottom:8px}.mystery-mode .removed-pile .weight{width:56px;height:54px;min-height:54px;font-size:24px}.mystery-mode .comparison-badge{top:290px;left:50%;z-index:4}.mystery-mode .success-tick{left:calc(50% + 62px)}#answerRow{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:12px 0;margin:0;min-height:64px}#answerRow label{font-size:27px;margin:0}#answerRow input{width:95px;height:48px;font-size:39px}#sceneWrap #answerRow #check{position:static;width:auto;min-width:150px;margin-left:12px;padding:12px 18px}#answerRow #next{margin:0;width:auto}#answerRow #next[hidden]{display:none!important}.drag-ghost.yellow,.drag-ghost.blue{font-size:27px;white-space:nowrap}.game:fullscreen.mystery-mode .pan-scale,.game.focus-mode.mystery-mode .pan-scale{height:465px;min-height:465px}.game:fullscreen.mystery-mode #sceneWrap,.game.focus-mode.mystery-mode #sceneWrap{min-height:0}@media(max-device-width:700px){.mystery-mode .weight-bank{position:relative;width:100%;display:flex;flex-wrap:wrap;justify-content:center;margin-bottom:10px}.weight-bank strong,.weight-bank small{width:100%}.mystery-mode .pan-scale{margin-left:0;width:100%}.mystery-mode .pan{padding:5px;gap:5px}.mystery-mode .pan .weight{width:48px;font-size:22.5px}.mystery-mode .removed-pile .weight{width:45px;font-size:21px}.mystery-mode .success-tick{left:50%}#answerRow label{font-size:24px}#sceneWrap #answerRow #check{margin-left:0}}
.mark,.mark:focus,.mark:focus-visible,.mark.active:focus{outline:none!important}.mark rect,.mark:focus rect,.mark:focus-visible rect{fill:transparent!important;stroke:none!important}.mark .fraction-tick text{font-size:22.5px;font-weight:500}.fraction{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;vertical-align:middle;font-size:.8em;line-height:1.1;min-width:.8em;margin:0 .12em}.fraction>span:first-child{border-bottom:1.5px solid currentColor;padding:0 .15em 2px}.fraction>span:last-child{padding:2px .15em 0}#equation{align-items:center}#feedback .fraction{font-size:1em}.fraction-note{position:absolute;bottom:5px;left:8%;width:190px;z-index:5;background:#fffdf4;border:1px solid #cad5c2;border-radius:12px;padding:9px 12px;box-shadow:0 3px 9px #253d4514;user-select:none}.fraction-note-title{display:flex;align-items:center;justify-content:center;gap:10px;font-size:30px;font-weight:700;margin-bottom:7px}.fraction-strip{display:grid;height:14px;border:1px solid #607b6c;margin-top:5px}.fraction-strip span{background:#fffefa;border-right:1px solid #607b6c}.fraction-strip span:last-child{border-right:0}.fraction-strip .shaded{background:#a9c7ab}#sceneWrap:not(.weight-mode){padding-bottom:110px}
/* Match the supplied, removed and placed weights on touch screens. */
.mystery-mode .weight-bank{width:142px;gap:8px}.mystery-mode .pan-scale{margin-left:157px;width:calc(100% - 157px)}.mystery-mode .weight-bank .weight,.mystery-mode .removed-pile .weight{width:58px;height:60px;min-height:60px;font-size:25.5px}.mystery-mode .pan .weight{width:58px;height:60px;min-height:60px;font-size:25.5px}.mystery-mode .success-tick{left:calc(50% + 78px)}@media(max-device-width:700px){.mystery-mode .weight-bank{width:100%}.mystery-mode .pan-scale{margin-left:0;width:100%}.mystery-mode .weight-bank .weight,.mystery-mode .removed-pile .weight,.mystery-mode .pan .weight{width:48px;height:54px;min-height:54px;font-size:22.5px}.mystery-mode .success-tick{left:50%}}
#questionActions{position:absolute;right:3%;top:12%;display:flex;gap:10px;z-index:6;align-items:center}#sceneWrap #questionActions #check{position:static;margin:0;min-width:145px;font-size:27px;padding:13px 18px;box-shadow:0 3px 0 #a6b9b1}#questionActions #next{margin:0;width:auto;min-width:100px;font-size:27px;padding:13px 20px}#questionActions #next[hidden]{display:none!important}.success-tick{top:28%;font-size:135px}.mystery-mode #questionActions{top:0;right:0}.mystery-mode #scene{padding-top:62px}.mystery-mode .weight-bank{top:82px}.mystery-mode .success-tick{top:32%}.mystery-mode #feedback.success{display:none}#sceneWrap.weight-mode{padding-bottom:0}.game:fullscreen .layout,.game.focus-mode .layout{width:100%;flex:1;min-height:0}.game:fullscreen,.game.focus-mode{display:flex;flex-direction:column}.game:fullscreen .game-head,.game.focus-mode .game-head{width:100%;flex:none}.game:fullscreen .play,.game.focus-mode .play{display:flex;flex-direction:column;flex:1;min-height:0}.game:fullscreen #sceneWrap:not(.weight-mode),.game.focus-mode #sceneWrap:not(.weight-mode){display:flex;flex:1;min-height:120px;padding-bottom:20px}.game:fullscreen #sceneWrap:not(.weight-mode) #scene,.game.focus-mode #sceneWrap:not(.weight-mode) #scene{flex:1;min-height:100px;height:100%}.game:fullscreen .arm-scale,.game.focus-mode .arm-scale{height:100%;width:100%;aspect-ratio:auto}.game:fullscreen aside,.game.focus-mode aside{flex:none;padding:8px 12px;gap:8px}.game:fullscreen #equation,.game.focus-mode #equation{min-height:50px;padding:5px;font-size:42px}.game:fullscreen .heading,.game.focus-mode .heading{display:none}.game:fullscreen .fraction-note,.game.focus-mode .fraction-note{bottom:5px}.game:fullscreen .question-tools,.game.focus-mode .question-tools{min-height:38px;padding-top:3px}.game:fullscreen .game-head,.game.focus-mode .game-head{margin-bottom:5px}.game:fullscreen .stats,.game.focus-mode .stats{margin-bottom:4px}.game:fullscreen #instruction,.game.focus-mode #instruction{min-width:0}.game:fullscreen .success-tick,.game.focus-mode .success-tick{font-size:105px}.game:fullscreen #questionActions button,.game.focus-mode #questionActions button{min-height:38px;padding:8px 13px;font-size:24px}@media(max-height:550px){.game:fullscreen,.game.focus-mode{overflow:auto}.game:fullscreen #sceneWrap:not(.weight-mode),.game.focus-mode #sceneWrap:not(.weight-mode){min-height:190px}}
#activity{padding:10px 14px;border:1px solid #d7cce5;background:#f5f0fa;border-radius:12px;font-size:24px;line-height:1.5}#activity p{margin:0 0 8px}#activity button{font-size:37.5px;min-width:65px;margin-right:10px;background:#fffefa}.question-tools [id*=pause],button[id=pause]{display:none!important}

/* Comparison sign placement and saved level achievements. */
#equation .prediction-slot{display:inline-flex;vertical-align:middle;align-items:center;justify-content:center;width:68px;height:62px;min-height:50px;padding:0;margin:0 10px;border:3px dashed #665080;border-radius:12px;background:#fffefa;font-size:54px;line-height:1;touch-action:manipulation}#equation .prediction-slot:focus-visible{outline:4px solid #b294d3;outline-offset:3px}#activity .prediction-sign{touch-action:none;cursor:grab;user-select:none}#activity .prediction-sign[aria-pressed="true"]{outline:3px solid #665080;background:#e9e1f7}.prediction-ghost{position:fixed;transform:translate(-50%,-50%);z-index:10000;pointer-events:none;display:grid;place-items:center;width:64px;height:58px;background:#e9e1f7;border:2px solid #665080;border-radius:12px;font-size:54px;font-weight:750;color:#29434a}.levels{gap:16px;padding:6px}.levels button{position:relative}.levels button.current-level{outline:4px solid #665080;outline-offset:3px;background:#f2ecfa}.current-level-tag{display:block;font-size:21px;font-weight:750;color:#665080;margin:5px 0}.level-tick{display:inline-block;font-size:48px;line-height:1;color:#168348;font-weight:900;margin-right:10px}.level-streak{color:#286343!important;font-weight:700}
.equation-sign[role=button],.comparison-badge[role=button]{cursor:pointer}.equation-sign[role=button]:hover{background:#e5edf6;border-radius:6px}.equation-sign[role=button]:focus-visible,.comparison-badge[role=button]:focus-visible{outline:3px solid #9e7b28;outline-offset:3px}

.game-tools{flex-wrap:wrap}#nextLevel{background:#e6efdf;border-color:#8ca17d;white-space:nowrap}.game:fullscreen #nextLevel,.game.focus-mode #nextLevel{display:inline-block}


#clearData,#confirmClear{background:#fff0ed;border-color:#d9b9b1}#cancelClear{margin-right:8px}

#freeModes{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:0 0 14px;padding:10px 14px;background:#f0f3e9;border-radius:12px}#freeModes label{margin:0;font-weight:700}#freeModes select{font:inherit;color:#253d45;background:#fffefa;border:1px solid #a5b59d;border-radius:8px;padding:10px;min-height:42px}#freeModes span{font-size:19.5px;color:#607467}.game:fullscreen #freeModes,.game.focus-mode #freeModes{flex:none;margin-bottom:5px;padding:6px 10px}

/* Prominent mistake guidance and centred comparison choices. */
#activity.mistake-instruction{font-size:34.5px;font-weight:750;line-height:1.45;padding:16px 20px;text-align:center;border:2px solid #b39cc9}
#activity.prediction-activity{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:12px;text-align:center;padding:14px 20px}
#activity.prediction-activity p{flex-basis:100%;margin:0;font-size:30px;font-weight:600}
#activity.prediction-activity button{margin:0;min-width:70px;font-size:45px}
.game:fullscreen #activity.mistake-instruction,.game.focus-mode #activity.mistake-instruction{font-size:34.5px}
.fraction-note{width:150px;pointer-events:none}.fraction-circle{width:112px;margin:0 auto}.fraction-circle svg{display:block;width:100%;height:auto}.fraction-note-title{margin-bottom:2px}

#fractionAnswer{display:flex;align-items:center;flex-wrap:wrap;gap:22px}#fractionAnswer .fraction-answer-option{display:flex;align-items:center;gap:10px}#fractionAnswer .stacked-input{display:flex;flex-direction:column;gap:5px;padding:3px}#answerRow #fractionAnswer input{width:74px;height:48px;text-align:center;font-size:37.5px;margin:0}#fractionAnswer .stacked-input input:first-child{border-radius:7px 7px 0 0}#fractionAnswer .stacked-input input:last-child{border-top:3px solid #29434a;border-radius:0 0 7px 7px}#fractionAnswer strong{font-size:27px;color:#665080}

/* Readable controls and stable geometry during browser zoom. */
body{font-size:28.5px}button,select{font-size:28.5px}h2{font-size:43.5px}
#freeModes{width:100%;padding:18px 22px;gap:16px}#freeModes label,#freeModes select{font-size:37.5px}#freeModes span{font-size:28.5px}
#activity,#activity.mistake-instruction,#activity.prediction-activity p{font-size:36px;font-weight:700;line-height:1.45}#activity{padding:18px 22px}#activity.prediction-activity button{font-size:54px;min-width:80px;min-height:60px}
#instruction,aside .muted,#remaining,.checkbox,label,.stats,.history-title,.history-title span,#feedback,.question-tools button,#reviewLabel,aside .wide,footer,.levels small{font-size:27px}#feedback{padding:12px 0}.weight-bank small,.removed-pile small{font-size:22.5px}
.game:fullscreen,.game.focus-mode{display:block;overflow:auto}.game:fullscreen .layout,.game.focus-mode .layout,.game:fullscreen .game-head,.game.focus-mode .game-head,.game:fullscreen #freeModes,.game.focus-mode #freeModes{width:calc(var(--game-layout-width) - 48px);flex:none}
.game:fullscreen .play,.game.focus-mode .play{display:block}.game:fullscreen #sceneWrap:not(.weight-mode),.game.focus-mode #sceneWrap:not(.weight-mode){display:block;min-height:0;padding-bottom:110px}.game:fullscreen #sceneWrap:not(.weight-mode) #scene,.game.focus-mode #sceneWrap:not(.weight-mode) #scene{height:auto;min-height:0;overflow:visible}
.game:fullscreen .arm-scale,.game.focus-mode .arm-scale{height:auto;aspect-ratio:800 / 350;width:100%;min-height:0}.game:fullscreen #equation,.game.focus-mode #equation{font-size:52.5px;min-height:82px;padding:12px}.game:fullscreen #activity,.game.focus-mode #activity,.game:fullscreen #activity.mistake-instruction,.game.focus-mode #activity.mistake-instruction{font-size:36px}.game:fullscreen #feedback,.game.focus-mode #feedback{font-size:27px}.game:fullscreen #questionActions button,.game.focus-mode #questionActions button{font-size:28.5px;padding:13px 20px}.game:fullscreen .success-tick,.game.focus-mode .success-tick{font-size:135px}

/* Keep free-play actions beside the mode choices, including full screen. */
#freeModes #undo,#freeModes #startNew{width:auto;margin:0;font-size:28.5px;min-height:46px;padding:10px 15px}#freeModes #undo{margin-left:auto}#clearData{background:#eef1e9;border-color:#b8c6b2}#modalBody li{font-size:28.5px;line-height:1.6;margin:12px 0}

/* Allow the larger text to fit without clipping controls. */
.game-head{flex-wrap:wrap}.game-tools{flex-wrap:wrap}#equation{flex-wrap:wrap}.equation-side{display:inline-flex;align-items:center;gap:.15em;padding:7px 12px;border:4px solid transparent;border-radius:10px}.equation-side.answer-side{background:#fffefa}#equation .prediction-slot{width:90px;height:84px}#answerRow input,#answerRow #fractionAnswer input{height:68px;width:110px}.mystery-mode .pan .weight,.mystery-mode .removed-pile .weight,.mystery-mode .weight-bank .weight{min-width:78px;width:auto;min-height:74px;padding:5px}.mystery-mode .weight-bank{width:182px}.mystery-mode .pan-scale{margin-left:197px;width:calc(100% - 197px)}.comparison-badge{width:80px;height:68px}#sceneWrap:not(.weight-mode){padding-bottom:145px}#questionActions{max-width:43%;flex-wrap:wrap;justify-content:flex-end}#freeModes #undo{margin-left:0}.question-tools{flex-wrap:wrap}.fraction-note{width:180px}

/* Fit the whole game, including all controls, into the full-screen viewport. */
.game:fullscreen,.game.focus-mode{padding:0;overflow:hidden;display:block;height:100dvh;width:100vw;border:0}
.game:fullscreen #gameSurface,.game.focus-mode #gameSurface{position:absolute;transform-origin:top left;padding:16px;box-sizing:border-box}
.game:fullscreen .game-head,.game.focus-mode .game-head,.game:fullscreen .layout,.game.focus-mode .layout,.game:fullscreen #freeModes,.game.focus-mode #freeModes{width:100%;min-width:0}
.game:fullscreen .game-head,.game.focus-mode .game-head{margin-bottom:8px}.game:fullscreen .layout,.game.focus-mode .layout{gap:8px}
.game:fullscreen #freeModes,.game.focus-mode #freeModes{padding:8px 12px;margin-bottom:8px;gap:10px}
.game:fullscreen #sceneWrap:not(.weight-mode),.game.focus-mode #sceneWrap:not(.weight-mode){padding-bottom:12px}
.game:fullscreen #scene,.game.focus-mode #scene{min-height:0}.game:fullscreen #sceneWrap,.game.focus-mode #sceneWrap{min-height:0}
.game:fullscreen .arm-scale,.game.focus-mode .arm-scale{display:block;width:100%;height:auto;aspect-ratio:800 / 350;max-height:none}
.game:fullscreen .history-title,.game.focus-mode .history-title{margin-top:5px}.game:fullscreen #dots,.game.focus-mode #dots{margin-top:5px}
.game:fullscreen .question-tools:not(:has(button:not([hidden]))),.game.focus-mode .question-tools:not(:has(button:not([hidden]))){display:none}

/* Free play keeps its guidance next to the supply, with no lower control panel. */
#numberOption{display:none!important}.free-play-mode #gameControls,.free-play-mode #feedback{display:none!important}.arm-scale .supply-instruction{font-size:16px;font-weight:600;fill:#526976;pointer-events:none}.free-play-mode #sceneWrap:not(.weight-mode){padding-bottom:0}

/* Simplified free-play heading and two-line credit. */
#freeModes label,#freeModes select{font-size:28.5px}#freeModes #undo,#freeModes #startNew{font-size:28.5px}#progress:empty{display:none}.game:fullscreen #demoInside,.game.focus-mode #demoInside{display:none}footer{display:block;text-align:left;line-height:1.6}

.game:fullscreen .history-title,.game.focus-mode .history-title{display:none}

#workingLines{display:flex;flex-direction:column;align-items:center;gap:7px;padding:8px 12px;background:#f4f5ee;border-radius:0 0 14px 14px}.working-line{font-size:38px;font-weight:700;line-height:1.3}.working-line .equation-sign{margin:0 .3em}

.levels button{background:#dfedf7;border-color:#92b1c5;display:flex;flex-direction:column;justify-content:space-between;gap:14px}.levels button.current-level{background:#cce3f3;outline-color:#527d9b}.level-recent{display:flex;gap:6px;width:100%;margin-top:auto}.level-recent>span{height:9px;flex:1;border-radius:5px;background:#edf0f1}.level-recent .green{background:#9fc89d}.level-recent .amber{background:#f1cb7d}.level-recent .pink{background:#ecb1c6}

#score,#progress{display:none!important}.stats{justify-content:flex-end}.stats:not(:has(#clock:not([hidden]))){display:none}#bottomNavigation{display:none}.game:fullscreen #bottomNavigation,.game.focus-mode #bottomNavigation{display:flex;justify-content:space-between;align-items:center;gap:14px;margin:8px 0}.game:fullscreen #bottomNavigation:empty,.game.focus-mode #bottomNavigation:empty{display:none}#bottomNavigation #next{width:auto;margin:0}#bottomNavigation #next[hidden]{display:none!important}#equation,.game:fullscreen #equation,.game.focus-mode #equation{font-size:68px}.working-line{font-size:48px}

#modal.demo-modal{width:min(1000px,96vw);max-height:94dvh;overflow:auto}#demoScene h3{text-align:center;font-size:30px;margin:0 0 6px}#demoScene svg{width:100%;max-height:44dvh}#demoCaption{font-size:25px;line-height:1.45;min-height:3em}.demo-controls{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.demo-controls button{font-size:20px}.demo-controls #demoProgress{margin-right:auto;font-size:18px}.demo-moving-block{animation:demo-drop 1.5s ease-out both}@keyframes demo-drop{from{transform:translate(-130px,-110px)}to{transform:translate(0,0)}}@media(prefers-reduced-motion:reduce){.demo-moving-block{animation:none}}

/* Match the logo lettering to the main navigation text. */
.brand{flex-shrink:0}.brand img{width:400px;height:80px;object-fit:contain}header{flex-wrap:wrap}


#demoScene{position:relative}#demoScene .arm-scale{aspect-ratio:800 / 350;height:auto;max-height:none}#demoScene .success-tick{top:28%}

/* The supply and pans participate in layout, so navigation cannot overlap them. */
.mystery-mode #scene,.game:fullscreen.mystery-mode #scene,.game.focus-mode.mystery-mode #scene{display:grid;grid-template-columns:190px minmax(0,1fr);align-items:start;gap:16px;padding-top:0;min-height:0}
.mystery-mode .weight-bank{position:static;width:190px;margin:0;grid-column:1;display:grid;grid-template-columns:1fr 1fr}
.mystery-mode .pan-scale,.game:fullscreen.mystery-mode .pan-scale,.game.focus-mode.mystery-mode .pan-scale{grid-column:2;margin:0;width:100%;height:510px;min-height:510px}
.mystery-mode .weight-bank .weight{width:100%;min-width:0}.mystery-mode #sceneWrap{height:auto}.mystery-mode #answerRow{position:relative;display:flex;padding:14px 18px;background:#eef1f7;border:2px solid #b0b9cf;border-radius:12px;margin-top:14px}.mystery-mode #answerRow label{font-size:28px}.mystery-mode #answerRow #check{position:static;margin-left:auto;font-size:27px}.mystery-mode #feedback:not(.try):not(.miss){display:none}.mystery-mode #bottomNavigation{position:relative;clear:both}.mystery-mode #gameControls{display:none}
/* Touch play: keep the drag visible and prevent page gestures within the game. */
body.game-focus-active{overflow:hidden;overscroll-behavior:none;position:fixed;inset:0}
.touch-device #game,.touch-device #scene,.touch-device #blockTray,.touch-device .movable,.touch-device .weight{touch-action:none;overscroll-behavior:none;-webkit-touch-callout:none}
#landscapeHint{font-size:18px;line-height:1.4;background:#fff0cd;border:1px solid #e0bc6c;border-radius:10px;padding:10px 14px;margin:0 0 10px}
.game.focus-mode>#landscapeHint{position:absolute;left:8px;right:8px;top:4px;z-index:10}
#modal{max-height:calc(100dvh - 20px);overflow:auto;overscroll-behavior:contain}
@media(max-width:600px){#modal{padding:14px;width:calc(100vw - 16px)}.levels{grid-template-columns:1fr;gap:8px}.levels button{font-size:18px;padding:12px;min-height:62px}}
.phone-layout .game.focus-mode #gameSurface{position:relative;left:0;top:0;transform:none;width:100%;height:100%;padding:6px 10px;display:flex;flex-direction:column}
.phone-layout .game.focus-mode .game-head{flex:0 0 auto;flex-wrap:nowrap;gap:8px;margin-bottom:4px}
.phone-layout .game.focus-mode #levelTitle{font-size:20px;line-height:1.15;margin:0}
.phone-layout .game.focus-mode .game-tools{flex-wrap:nowrap;gap:5px;flex-shrink:0}
.phone-layout .game.focus-mode .game-tools button{font-size:16px;padding:8px;min-height:38px;border-radius:8px}
.phone-layout .game.focus-mode #freeModes{padding:4px 6px;margin:0 0 4px;gap:6px;flex-wrap:nowrap}
.phone-layout .game.focus-mode #freeModes label,.phone-layout .game.focus-mode #freeModes select,.phone-layout .game.focus-mode #freeModes #undo,.phone-layout .game.focus-mode #freeModes #startNew{font-size:16px;min-height:34px;padding:5px}
.phone-layout .game.focus-mode .layout{flex:1;min-height:0;display:flex}
.phone-layout .game.focus-mode .play{flex:1;min-height:0;display:flex;flex-direction:column}
.phone-layout .game.focus-mode #equation{flex-shrink:0;font-size:36px;min-height:42px;padding:2px;gap:5px}
.phone-layout .game.focus-mode .equation-side{padding:2px 5px;border-width:2px}
.phone-layout .game.focus-mode #sceneWrap{flex:1;min-height:0;padding:0;display:flex}
.phone-layout .game.focus-mode #scene{flex:1;min-height:0;height:100%;display:flex}
.phone-layout .game.focus-mode .arm-scale{width:100%;height:100%;min-height:0;aspect-ratio:auto}
.phone-layout .game.focus-mode #bottomNavigation{margin:3px 0;gap:8px;flex-shrink:0}
.phone-layout .game.focus-mode #bottomNavigation button{font-size:16px;min-height:34px;padding:6px 10px}
.phone-layout .game.focus-mode #dots span{height:14px;font-size:13px}
.phone-layout .game.focus-mode .history-title{display:none}
.phone-layout .game.focus-mode .working-line{font-size:24px}
.phone-layout .game.focus-mode #workingLines{gap:2px;padding:2px}
.phone-layout .game.focus-mode.mystery-mode #scene{display:grid;grid-template-columns:95px minmax(0,1fr);gap:5px}
.phone-layout .game.focus-mode.mystery-mode .weight-bank{width:95px;font-size:13px}
.phone-layout .game.focus-mode.mystery-mode .weight-bank .weight{min-height:32px;min-width:0;font-size:13px}
.phone-layout .game.focus-mode.mystery-mode .pan-scale{min-height:220px;height:220px}
@media(orientation:portrait){.phone-layout .game.focus-mode #gameSurface{padding-top:78px}.phone-layout .game.focus-mode .game-head,.phone-layout .game.focus-mode #freeModes{flex-wrap:wrap}.phone-layout .game.focus-mode .game-tools{flex-wrap:wrap}}
.phone-layout .game.focus-mode #scene:not(:has(.pan-scale)) .comparison-badge{top:55%}
#buildBadge{display:block;text-align:right;font-size:12px;color:#61757a;padding:3px 8px;pointer-events:none}
.game.focus-mode>#buildBadge,.game:fullscreen>#buildBadge{position:absolute;bottom:1px;right:4px;z-index:5;background:#fffefa;font-size:11px;padding:1px 4px}
/* Clearer touch instructions, without changing desktop typography. */
#activity.mystery-guidance{white-space:pre-line;text-align:center;font-size:42px;line-height:1.25;padding:12px 16px}
.game.focus-mode #activity.mystery-guidance,.game:fullscreen #activity.mystery-guidance{font-size:42px}
#feedback.guidance{background:#eaf2fa;color:#294c71;border:1px solid #a9c4dc;border-radius:10px;padding:10px 14px}
.phone-layout .game.focus-mode #activity.mystery-guidance{font-size:23px;line-height:1.2;padding:6px 10px}
/* Touch layouts use readable text directly, instead of shrinking the whole page. */
.touch-device #game{touch-action:pan-y}
.touch-device .game.focus-mode{overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior-y:contain}
.touch-device .game.focus-mode #gameSurface{position:relative;left:0;top:0;transform:none;width:100%;height:auto;min-height:100%;padding:12px 16px;display:flex;flex-direction:column}
.touch-device .game.focus-mode .game-head,.touch-device .game.focus-mode .game-tools,.touch-device .game.focus-mode #freeModes{flex-wrap:wrap}
.touch-device .game.focus-mode #freeModes{flex-shrink:0}
.touch-device .game.focus-mode #sceneWrap{flex-shrink:0}
.touch-device .game.focus-mode>#buildBadge{position:fixed}
.touch-device:not(.phone-layout) .game #levelTitle{font-size:26px;line-height:1.1}
.touch-device:not(.phone-layout) .game button,.touch-device:not(.phone-layout) .game label,.touch-device:not(.phone-layout) .game select,.touch-device:not(.phone-layout) .game input{font-size:26px}
.touch-device:not(.phone-layout) .game #freeModes label,.touch-device:not(.phone-layout) .game #freeModes select,.touch-device:not(.phone-layout) .game #freeModes #undo,.touch-device:not(.phone-layout) .game #freeModes #startNew{font-size:26px}
.touch-device:not(.phone-layout) .game #equation{font-size:68px}
.touch-device:not(.phone-layout) .game #activity,.touch-device:not(.phone-layout) .game #activity.mistake-instruction,.touch-device:not(.phone-layout) .game #activity.mystery-guidance,.touch-device:not(.phone-layout) .game #activity.prediction-activity p{font-size:30px;line-height:1.2}
.touch-device:not(.phone-layout) .game #feedback,.touch-device:not(.phone-layout) .game #instruction,.touch-device:not(.phone-layout) .game #remaining{font-size:26px}
.touch-device:not(.phone-layout) .game .working-line{font-size:26px}
.touch-device:not(.phone-layout) .game .arm-scale .mark text{font-size:26px}
.touch-device:not(.phone-layout) .game.focus-mode .layout,.touch-device:not(.phone-layout) .game.focus-mode .play{display:block;flex:none}
.touch-device:not(.phone-layout) .game.focus-mode #scene,.touch-device:not(.phone-layout) .game.focus-mode #sceneWrap{height:auto;min-height:0}
.touch-device:not(.phone-layout) .game.focus-mode .arm-scale{height:auto;width:100%;aspect-ratio:800 / 350}
.touch-device:not(.phone-layout) .game.focus-mode #bottomNavigation button{font-size:26px}
.phone-layout .game.focus-mode #gameSurface{padding:6px 10px;min-height:100%;height:auto}
.phone-layout .game.focus-mode #levelTitle,.phone-layout .game.focus-mode.mistake-mode #levelTitle{font-size:20px}
.phone-layout .game.focus-mode .game-tools button,.phone-layout .game.focus-mode.mistake-mode .game-tools button,.phone-layout .game.focus-mode #bottomNavigation button,.phone-layout .game.focus-mode.mistake-mode #bottomNavigation button{font-size:16px}
.phone-layout .game.focus-mode #freeModes{flex-wrap:wrap}
.phone-layout .game.focus-mode #freeModes label,.phone-layout .game.focus-mode #freeModes select,.phone-layout .game.focus-mode #freeModes #undo,.phone-layout .game.focus-mode #freeModes #startNew{font-size:16px}
.phone-layout .game.focus-mode #activity,.phone-layout .game.focus-mode #activity.mistake-instruction,.phone-layout .game.focus-mode #activity.mystery-guidance,.phone-layout .game.focus-mode #activity.prediction-activity p{font-size:18px;line-height:1.2;padding:5px 8px}
.phone-layout .game.focus-mode #equation,.phone-layout .game.focus-mode.mistake-mode #equation{font-size:34px}
.phone-layout .game.focus-mode #feedback,.phone-layout .game.focus-mode.mistake-mode #feedback,.phone-layout .game.focus-mode #instruction,.phone-layout .game.focus-mode #remaining{font-size:16px}
.phone-layout .game.focus-mode .arm-scale .mark text,.phone-layout .game.focus-mode.mistake-mode .arm-scale .mark text{font-size:22.5px}
.phone-layout .game.focus-mode .layout,.phone-layout .game.focus-mode .play{display:block;flex:none}
.phone-layout .game.focus-mode #sceneWrap{display:block;min-height:0;flex:none}
.phone-layout .game.focus-mode #scene{height:auto;min-height:0}
.phone-layout .game.focus-mode .arm-scale{height:auto;width:100%;aspect-ratio:800 / 300}
@media(orientation:portrait){.touch-device .game.focus-mode #gameSurface{padding-top:84px}}


/* Keep number-line digits independent from instruction text sizing. */
.touch-device:not(.phone-layout) .game #levelTitle{font-size:38px}
.touch-device:not(.phone-layout) .game .arm-scale .mark text{font-size:22.5px;font-weight:500}
.touch-device:not(.phone-layout) .game .working-line{font-size:40px}
.touch-device:not(.phone-layout) .game .weight{font-size:27px}
/* Background swipes scroll; only the draggable blocks reserve touch gestures. */
body.game-focus-active{position:static;inset:auto;overflow:hidden;overscroll-behavior:auto}
.touch-device #game,.touch-device #scene,.touch-device #sceneWrap,.touch-device .arm-scale,.touch-device .mark,.touch-device .pan-scale,.touch-device #panAssembly,.touch-device .pan,.touch-device .removed-pile{touch-action:pan-y}
.touch-device #blockTray,.touch-device .movable,.touch-device .weight,.touch-device .prediction-sign{touch-action:none}
.touch-device .game.focus-mode{position:fixed;inset:0;height:100dvh;overflow-y:auto;touch-action:pan-y;overscroll-behavior:auto}
.touch-device .game.focus-mode .game-head{position:sticky;top:0;z-index:15;background:#fffefa;padding:6px 0}
/* A compact calculation dock leaves more vertical space for the balance. */
#equationDock:empty{display:none}
.touch-device .game .game-head{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:4px 10px;position:relative}
.touch-device .game .game-head>div:first-child{grid-column:1;grid-row:1}
.touch-device .game .game-tools{grid-column:2;grid-row:1;justify-content:flex-end}
.touch-device .game #equationDock{grid-column:2;grid-row:2;min-width:0;max-width:100%}
.touch-device:not(.phone-layout) .game #equation{font-size:54.4px;min-height:0;padding:3px 8px;background:transparent}
.touch-device:not(.phone-layout) .game.focus-mode:not(.mystery-mode) #gameSurface{height:100dvh;min-height:0}
.touch-device:not(.phone-layout) .game.focus-mode:not(.mystery-mode) .layout{display:flex;flex-direction:column;flex:1;min-height:0}
.touch-device:not(.phone-layout) .game.focus-mode:not(.mystery-mode) .play{display:flex;flex-direction:column;flex:1;min-height:0}
.touch-device:not(.phone-layout) .game.focus-mode:not(.mystery-mode) #sceneWrap,.touch-device:not(.phone-layout) .game.focus-mode:not(.mystery-mode) #scene{display:flex;flex:1;min-height:130px;height:auto}
.touch-device:not(.phone-layout) .game.focus-mode:not(.mystery-mode) .arm-scale{height:100%;width:100%;aspect-ratio:auto;min-height:0}
/* Phone text is half its previous size; scale digits and blocks stay unchanged. */
.phone-layout h1{font-size:25.2px}.phone-layout .heading p{font-size:12.075px}
.phone-layout nav button{font-size:9.975px}
.phone-layout .game #levelTitle,.phone-layout .game.focus-mode #levelTitle{font-size:7px}
.phone-layout .game button,.phone-layout .game label,.phone-layout .game select,.phone-layout .game #freeModes label,.phone-layout .game #freeModes select,.phone-layout .game #freeModes #undo,.phone-layout .game #freeModes #startNew,.phone-layout .game.focus-mode .game-tools button,.phone-layout .game.focus-mode #bottomNavigation button{font-size:5.6px}
.phone-layout .game #equation,.phone-layout .game.focus-mode #equation,.phone-layout .game.focus-mode.mistake-mode #equation{font-size:11.9px;min-height:0;padding:2px}
.phone-layout .game #activity,.phone-layout .game #activity.mistake-instruction,.phone-layout .game #activity.mystery-guidance,.phone-layout .game #activity.prediction-activity p,.phone-layout .game.focus-mode #activity,.phone-layout .game.focus-mode #activity.mistake-instruction,.phone-layout .game.focus-mode #activity.mystery-guidance,.phone-layout .game.focus-mode #activity.prediction-activity p{font-size:6.3px}
.phone-layout .game #feedback,.phone-layout .game #instruction,.phone-layout .game #remaining,.phone-layout .game.focus-mode #feedback,.phone-layout .game.focus-mode #instruction,.phone-layout .game.focus-mode #remaining{font-size:5.6px}
.phone-layout .game .working-line,.phone-layout .game.focus-mode .working-line{font-size:8.4px}
.phone-layout .game .question-tools button,.phone-layout .game #resetWeights,.phone-layout .game #hint{font-size:5.6px}
.phone-layout .game #clock,.phone-layout footer{font-size:7.35px}
.phone-layout #modalTitle{font-size:15.225px}.phone-layout #modal button,.phone-layout #modal p,.phone-layout #modal li{font-size:9.975px}
.phone-layout .game .arm-scale,.phone-layout .game.focus-mode .arm-scale{width:90%;margin-left:auto;margin-right:auto}
.phone-layout .game .arm-scale .mark text,.phone-layout .game.focus-mode .arm-scale .mark text,.phone-layout .game.focus-mode.mistake-mode .arm-scale .mark text{font-size:25px}
.phone-layout .game .comparison-badge{width:40px;height:34px;min-width:0;min-height:0;font-size:52.65px;line-height:.7;border-radius:6px}
.phone-layout .game #dots span,.phone-layout .game.focus-mode #dots span{height:12.6px;font-size:11.7px}
.phone-layout .game #dots{gap:6.3px}
.phone-layout .game .game-head{grid-template-columns:minmax(0,1fr) minmax(0,1.4fr)}
.phone-layout .game .game-tools{gap:4px;flex-wrap:wrap}
.phone-layout .game #equationDock{grid-column:1;grid-row:2}
.phone-layout .game #freeModes{gap:5px;padding:4px 6px}
.phone-layout .game.focus-mode:not(.mystery-mode) #gameSurface{height:100dvh;min-height:0}
.phone-layout .game.focus-mode:not(.mystery-mode) .layout,.phone-layout .game.focus-mode:not(.mystery-mode) .play{display:flex;flex:1;min-height:0}
.phone-layout .game.focus-mode:not(.mystery-mode) #sceneWrap,.phone-layout .game.focus-mode:not(.mystery-mode) #scene{display:flex;flex:1;min-height:100px;height:auto}
.phone-layout .game.focus-mode:not(.mystery-mode) .arm-scale{height:100%;aspect-ratio:auto}
.phone-layout .game.focus-mode #freeModes label,.phone-layout .game.focus-mode #freeModes select,.phone-layout .game.focus-mode #freeModes #undo,.phone-layout .game.focus-mode #freeModes #startNew{font-size:5.6px}
.phone-layout .game.focus-mode.mistake-mode #feedback{font-size:5.6px}
.phone-layout .game #dots{width:90%;margin-left:auto;margin-right:auto}

/* Desktop typography is separate from touch layouts and scale numerals. */
body:not(.touch-device){font-size:21.375px}
body:not(.touch-device) button,body:not(.touch-device) select{font-size:21.375px}
body:not(.touch-device) h1{font-size:43.2px}
body:not(.touch-device) h2{font-size:32.625px}
body:not(.touch-device) h3{font-size:25.875px}
body:not(.touch-device) label{font-size:15.75px}
body:not(.touch-device) input{font-size:39.375px}
body:not(.touch-device) .game #equation{font-size:51px}
body:not(.touch-device) .game #activity,body:not(.touch-device) .game #activity.mistake-instruction,body:not(.touch-device) .game #activity.prediction-activity p{font-size:27px}
body:not(.touch-device) .game #activity.mystery-guidance{font-size:31.5px}
body:not(.touch-device) .game #activity.prediction-activity button{font-size:40.5px}
body:not(.touch-device) .game #feedback{font-size:20.25px}
body:not(.touch-device) .game #freeModes label,body:not(.touch-device) .game #freeModes select,body:not(.touch-device) .game #freeModes #undo,body:not(.touch-device) .game #freeModes #startNew{font-size:21.375px}
body:not(.touch-device) .game #instruction,body:not(.touch-device) .game #remaining{font-size:14.625px}
body:not(.touch-device) .game #actionTitle{font-size:20.25px}
body:not(.touch-device) .game .working-line{font-size:36px}
body:not(.touch-device) .game .comparison-badge{font-size:43.875px}
body:not(.touch-device) .game #questionActions button{font-size:20.25px}
body:not(.touch-device) .game .weight{font-size:20.25px}
body:not(.touch-device) .game .weight-bank small{font-size:12.375px}
body:not(.touch-device) .game #answerRow label,body:not(.touch-device) .game #answerRow #check{font-size:20.25px}
body:not(.touch-device) .game #answerRow input{font-size:29.25px}
body:not(.touch-device) #modalBody li{font-size:21.375px}
body:not(.touch-device) #demoCaption{font-size:18.75px}
body:not(.touch-device) .demo-controls button{font-size:15px}
body:not(.touch-device) .game .history-title{font-size:13.5px}
body:not(.touch-device) .game .history-title span{font-size:12.375px}
body:not(.touch-device) footer{font-size:15.75px}
/* Instructions occupy a full row instead of competing with buttons for a narrow column. */
.touch-device .game #gameControls{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 12px;width:100%;min-width:0;align-items:center;flex:none}
.touch-device .game #gameControls #actionTitle{display:none}
.touch-device .game #gameControls #instruction{grid-column:1/-1;width:100%;min-width:0;margin:0;white-space:normal;word-break:normal;overflow-wrap:normal}
.touch-device .game #gameControls #blockControls{grid-column:1;min-width:0;display:flex;flex-wrap:wrap;gap:8px}
.touch-device .game #gameControls #remaining{flex-basis:100%;min-width:0}
.touch-device .game #gameControls #hint{grid-column:2;align-self:end;max-width:100%;white-space:normal}
.touch-device .game.focus-mode #gameControls{padding:6px 10px}
.touch-device:not(.phone-layout) .game #gameControls #instruction{font-size:22px;line-height:1.25}
.phone-layout .game #gameControls #instruction{font-size:5.6px;line-height:1.25}
body:not(.touch-device) .stats,body:not(.touch-device) .muted,body:not(.touch-device) .tip{font-size:15.75px}
body:not(.touch-device) .fraction-note-title{font-size:22.5px}
body:not(.touch-device) .removal button{font-size:14.625px}
/* Computer number-scale digits: 20% smaller, with touch sizes unchanged. */
body:not(.touch-device) .arm-scale .mark text,body:not(.touch-device) #sceneWrap .arm-scale .mark text,body:not(.touch-device) #sceneWrap.level-three .arm-scale .mark text{font-size:18px}
/* Laptop fullscreen keeps typography at its normal size; only the scene flexes. */
body:not(.touch-device) .game:fullscreen,body:not(.touch-device) .game.focus-mode{overflow-y:auto;overflow-x:hidden}
body:not(.touch-device) .game:fullscreen #gameSurface,body:not(.touch-device) .game.focus-mode #gameSurface{position:relative;left:0;top:0;width:100%;height:100dvh;min-height:0;transform:none;padding:12px 16px;display:flex;flex-direction:column}
body:not(.touch-device) .game:fullscreen .game-head,body:not(.touch-device) .game.focus-mode .game-head{flex:none;margin-bottom:6px}
body:not(.touch-device) .game:fullscreen .layout,body:not(.touch-device) .game.focus-mode .layout{display:flex;flex-direction:column;flex:1;min-height:0;gap:6px}
body:not(.touch-device) .game:fullscreen .play,body:not(.touch-device) .game.focus-mode .play{display:flex;flex-direction:column;flex:1;min-height:0}
body:not(.touch-device) .game #sceneWrap:not(.weight-mode){padding-bottom:0;min-height:0}
body:not(.touch-device) .game #scene{min-height:0}
body:not(.touch-device) .game:fullscreen #sceneWrap:not(.weight-mode),body:not(.touch-device) .game.focus-mode #sceneWrap:not(.weight-mode){display:flex;flex:1;min-height:140px;padding-bottom:0}
body:not(.touch-device) .game:fullscreen #sceneWrap:not(.weight-mode) #scene,body:not(.touch-device) .game.focus-mode #sceneWrap:not(.weight-mode) #scene{display:flex;flex:1;min-height:0;height:auto}
body:not(.touch-device) .game:fullscreen .arm-scale,body:not(.touch-device) .game.focus-mode .arm-scale{height:100%;width:100%;aspect-ratio:auto;min-height:0;max-height:none}
body:not(.touch-device) .game #gameControls{gap:6px 12px;padding:8px 12px;margin-top:0;flex:none}
body:not(.touch-device) .game #gameControls #instruction,body:not(.touch-device) .game #gameControls #remaining,body:not(.touch-device) .game #feedback{font-size:14.625px;line-height:1.3}
body:not(.touch-device) .game #gameControls #actionTitle{font-size:20.25px}
body:not(.touch-device) .game #gameControls button,body:not(.touch-device) .game #bottomNavigation button,body:not(.touch-device) .game .question-tools button{font-size:21.375px}
body:not(.touch-device) .game #bottomNavigation{gap:8px;margin:3px 0}
body:not(.touch-device) .game #feedback{margin:0;padding:4px 0;min-height:0}
body:not(.touch-device) .game .history-title{margin-top:5px}
body:not(.touch-device) .game #dots{gap:5px;margin-top:4px;max-width:100%;flex:none}
body:not(.touch-device) .game #dots span{height:20px;min-width:0}
body:not(.touch-device) .game .question-tools{min-height:0;padding-top:3px}
/* The same explicit laptop control sizes apply in normal and fullscreen views. */
body:not(.touch-device) nav button,body:not(.touch-device) .game .game-tools button{font-size:28.5px}
body:not(.touch-device) .game #levelTitle{font-size:43.5px}
body:not(.touch-device) .game #freeModes label,body:not(.touch-device) .game #freeModes select,body:not(.touch-device) .game #freeModes #undo,body:not(.touch-device) .game #freeModes #startNew{font-size:28.5px}
body:not(.touch-device) .game #equation{font-size:68px}
/* Laptop game headings and controls: same sizes inside and outside fullscreen. */
body:not(.touch-device) .game #levelTitle{font-size:52.2px}
body:not(.touch-device) .game .game-tools button,body:not(.touch-device) .game #freeModes label,body:not(.touch-device) .game #freeModes select,body:not(.touch-device) .game #freeModes #undo,body:not(.touch-device) .game #freeModes #startNew{font-size:34.2px}
body:not(.touch-device) .game .comparison-badge{font-size:57.0375px}
body:not(.touch-device) .game #activity,body:not(.touch-device) .game #activity.mistake-instruction,body:not(.touch-device) .game #activity.prediction-activity p{font-size:40.5px}
body:not(.touch-device) .game #activity.mystery-guidance{font-size:47.25px}
body:not(.touch-device) .game #activity.prediction-activity button{font-size:60.75px}
/* Opened menus have their own typography, independent of game-screen text. */
body:not(.touch-device) nav button{font-size:34.2px}
body:not(.touch-device) #modal{font-size:28.5px;width:min(850px,94vw)}
body:not(.touch-device) #modalTitle{font-size:43.5px}
body:not(.touch-device) #modalBody p,body:not(.touch-device) #modalBody li,body:not(.touch-device) #modalBody .levels button,body:not(.touch-device) #modalBody>button{font-size:28.5px}
body:not(.touch-device) #modalBody .levels button{line-height:1.25}
body:not(.touch-device) #modal #close{font-size:36px}
body:not(.touch-device) #modal.demo-modal{width:min(1400px,96vw);max-height:96dvh}
body:not(.touch-device) #demoScene .arm-scale{width:100%;height:auto;max-height:64dvh}
body:not(.touch-device) #modalBody #demoCaption{font-size:25px}
body:not(.touch-device) #modalBody .demo-controls button{font-size:20px}
body:not(.touch-device) #modalBody #demoProgress{font-size:18px}
/* Laptop upper game text +10%; scale labels and blocks are independent. */
body:not(.touch-device) h1{font-size:47.52px}
body:not(.touch-device) .game #levelTitle{font-size:57.42px}
body:not(.touch-device) .game .game-tools button,body:not(.touch-device) .game #freeModes label,body:not(.touch-device) .game #freeModes select,body:not(.touch-device) .game #freeModes #undo,body:not(.touch-device) .game #freeModes #startNew{font-size:37.62px}
body:not(.touch-device) .game #equation{font-size:74.8px}
body:not(.touch-device) .game .working-line{font-size:39.6px}
body:not(.touch-device) .game #activity,body:not(.touch-device) .game #activity.mistake-instruction,body:not(.touch-device) .game #activity.mystery-guidance,body:not(.touch-device) .game #activity.prediction-activity p{font-size:44.55px}
body:not(.touch-device) .game #activity.prediction-activity button{font-size:66.825px}
/* Site navigation and demo text +20%; logo +30%. */
body:not(.touch-device) nav button{font-size:41.04px}
body:not(.touch-device) .brand img{width:520px;height:104px}
body:not(.touch-device) #modalBody #demoCaption{font-size:30px}
body:not(.touch-device) #modalBody .demo-controls button{font-size:24px}
body:not(.touch-device) #modalBody #demoProgress{font-size:21.6px}
body:not(.touch-device) #modalBody p,body:not(.touch-device) #modalBody li{font-size:34.2px}
/* Laptop lower instructions and navigation +50%. */
body:not(.touch-device) .game #gameControls #instruction,body:not(.touch-device) .game #gameControls #remaining,body:not(.touch-device) .game #feedback{font-size:21.9375px}
body:not(.touch-device) .game #gameControls #actionTitle{font-size:30.375px}
body:not(.touch-device) .game #gameControls button,body:not(.touch-device) .game #bottomNavigation button,body:not(.touch-device) .game .question-tools button{font-size:32.0625px}
body:not(.touch-device) .game .history-title{font-size:20.25px}
body:not(.touch-device) .game .history-title span{font-size:18.5625px}
body:not(.touch-device) .game #answerRow label,body:not(.touch-device) .game #answerRow #check{font-size:30.375px}
body:not(.touch-device) .game #answerRow input{font-size:43.875px}
body:not(.touch-device) .game.compact-scale-mode .arm-scale{aspect-ratio:800 / 265}
/* Mystery Weights uses compact stacked trays and fills the available fullscreen height. */
body:not(.touch-device) .game.mystery-mode #scene{grid-template-columns:190px minmax(0,1fr);align-items:stretch;gap:18px;min-height:400px}
body:not(.touch-device) .game.mystery-mode .weight-bank{align-self:center;min-width:0;font-size:26px}
body:not(.touch-device) .game.mystery-mode .weight-bank small{font-size:18px}
body:not(.touch-device) .game.mystery-mode .weight-bank .weight{font-size:20.25px}
body:not(.touch-device) .game.mystery-mode .pan-scale{height:450px;min-height:400px}
body:not(.touch-device) .game.mystery-mode #panAssembly{height:100%;top:0}
body:not(.touch-device) .game.mystery-mode .pan{width:30%;max-width:360px;top:3%;height:50%;display:grid;grid-template-columns:repeat(3,minmax(0,78px));justify-content:center;align-content:end;gap:6px;padding:10px;overflow-y:auto}
body:not(.touch-device) .game.mystery-mode .left-pan{left:8%}
body:not(.touch-device) .game.mystery-mode .right-pan{right:8%}
body:not(.touch-device) .game.mystery-mode .pan .weight{width:100%;min-width:0;height:68px;min-height:68px;font-size:20.25px}
body:not(.touch-device) .game.mystery-mode .pan-beam{top:55%;left:calc(8% + min(15%,180px));right:calc(8% + min(15%,180px))}
body:not(.touch-device) .game.mystery-mode .pan-pillar{top:55%;height:24%}
body:not(.touch-device) .game.mystery-mode .comparison-badge{top:calc(55% + 20px)}
body:not(.touch-device) .game.mystery-mode .removed-pile{top:81%;width:30%;max-width:360px;min-height:60px;display:grid;grid-template-columns:repeat(3,minmax(0,72px));justify-content:center;gap:5px;align-content:start}
body:not(.touch-device) .game.mystery-mode .left-pile{left:8%}
body:not(.touch-device) .game.mystery-mode .right-pile{right:8%}
body:not(.touch-device) .game.mystery-mode .removed-pile .weight{width:100%;min-width:0;height:58px;min-height:58px;font-size:20.25px}
body:not(.touch-device) .game.mystery-mode #answerRow{margin-top:8px;padding:8px 12px}
body:not(.touch-device) .game:fullscreen.mystery-mode #sceneWrap,body:not(.touch-device) .game.focus-mode.mystery-mode #sceneWrap{display:flex;flex-direction:column;flex:1;min-height:420px}
body:not(.touch-device) .game:fullscreen.mystery-mode #scene,body:not(.touch-device) .game.focus-mode.mystery-mode #scene{flex:1;min-height:360px}
body:not(.touch-device) .game:fullscreen.mystery-mode .pan-scale,body:not(.touch-device) .game.focus-mode.mystery-mode .pan-scale{height:100%;min-height:360px}
body:not(.touch-device) .game:fullscreen.mystery-mode #answerRow,body:not(.touch-device) .game.focus-mode.mystery-mode #answerRow{flex:none}
body:not(.touch-device) .game.mystery-mode .removed-pile{top:75%;max-height:25%;min-height:0;overflow-y:auto}
body:not(.touch-device) .game.mystery-mode .removed-pile .weight{height:50px;min-height:50px}
body:not(.touch-device) .game #answerUnit{font-size:32.0625px}
body:not(.touch-device) #modalTitle{font-size:52.2px}
body:not(.touch-device) #modalBody h3{font-size:31.05px}
/* Do not compress text rows when a laptop viewport is shorter than the content. */
body:not(.touch-device) .game #equation,body:not(.touch-device) .game #workingLines,body:not(.touch-device) .game #activity,body:not(.touch-device) .game .question-tools,body:not(.touch-device) .game #bottomNavigation,body:not(.touch-device) .game #dots{flex-shrink:0}
body:not(.touch-device) .game:fullscreen.mystery-mode #gameSurface,body:not(.touch-device) .game.focus-mode.mystery-mode #gameSurface{height:auto;min-height:100dvh}
body:not(.touch-device) .game:fullscreen.mystery-mode #sceneWrap,body:not(.touch-device) .game.focus-mode.mystery-mode #sceneWrap{flex:none;min-height:0}
body:not(.touch-device) .game:fullscreen.mystery-mode #scene,body:not(.touch-device) .game.focus-mode.mystery-mode #scene{flex:none;min-height:0}
body:not(.touch-device) .game:fullscreen.mystery-mode .pan-scale,body:not(.touch-device) .game.focus-mode.mystery-mode .pan-scale{height:clamp(360px,44dvh,700px);min-height:360px}


/* Keep comparison signs optically centered in their badge on every device. */
.comparison-badge{display:grid;place-items:center;padding:0;line-height:0}
.comparison-badge .tablet-comparison-symbol{display:block;width:95%;height:95%;max-width:32px;max-height:26px;overflow:visible;margin:auto}
