/* Laptop geometry stays in CSS pixels while browser zoom scales the entire page. */
body:not(.touch-device) main>.heading{display:none}
body:not(.touch-device) .brand img{width:650px;height:130px}
body:not(.touch-device) header{gap:16px;padding-bottom:12px;margin-bottom:16px}
body:not(.touch-device) .game{margin-top:0}
body:not(.touch-device) .game #sceneWrap:not(.weight-mode){display:block;flex:none;padding:0;min-height:0}
body:not(.touch-device) .game #scene{display:flex;align-items:center;justify-content:center;flex:none;height:auto;min-height:0;overflow:visible}
body:not(.touch-device) .game .arm-scale,body:not(.touch-device) .game:fullscreen .arm-scale,body:not(.touch-device) .game.focus-mode .arm-scale{display:block;flex:none;width:var(--laptop-balance-width);height:auto;min-width:var(--laptop-balance-width);min-height:0;max-width:none;max-height:none;aspect-ratio:800 / 350;margin:0 auto}
body:not(.touch-device) .game.compact-scale-mode .arm-scale{aspect-ratio:800 / 265}
body:not(.touch-device) .game:fullscreen #gameSurface,body:not(.touch-device) .game.focus-mode #gameSurface{height:auto;min-height:100dvh;width:var(--game-layout-width);transform:none}
body:not(.touch-device) .game:fullscreen .layout,body:not(.touch-device) .game.focus-mode .layout,body:not(.touch-device) .game:fullscreen .play,body:not(.touch-device) .game.focus-mode .play{display:block;flex:none}
body:not(.touch-device) .game:fullscreen #sceneWrap:not(.weight-mode),body:not(.touch-device) .game.focus-mode #sceneWrap:not(.weight-mode),body:not(.touch-device) .game:fullscreen #sceneWrap:not(.weight-mode) #scene,body:not(.touch-device) .game.focus-mode #sceneWrap:not(.weight-mode) #scene{display:block;flex:none;height:auto;min-height:0}
body:not(.touch-device) .game #gameControls button,body:not(.touch-device) .game #bottomNavigation button,body:not(.touch-device) .game .question-tools button{font-size:36.936px}
body:not(.touch-device) .game #gameControls #instruction,body:not(.touch-device) .game #gameControls #remaining,body:not(.touch-device) .game #feedback{font-size:43.875px;line-height:1.25}
body:not(.touch-device) .game #gameControls{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 16px}
body:not(.touch-device) .game #gameControls #actionTitle{grid-column:1/-1}
body:not(.touch-device) .game #gameControls #instruction{grid-column:1/-1;width:100%;min-width:0;margin:0}
body:not(.touch-device) .game #blockControls{display:flex;flex-wrap:wrap;gap:12px;grid-column:1}
body:not(.touch-device) .game #remaining{flex-basis:100%}
body:not(.touch-device) .game #hint{grid-column:2;align-self:end}
body:not(.touch-device) .game .history-title{font-size:40.5px;line-height:1.25;margin-top:8px}
body:not(.touch-device) .game .history-title span{font-size:37.125px}
body:not(.touch-device) footer{font-size:31.5px}
body:not(.touch-device) #buildBadge{font-size:20px}
body:not(.touch-device) #modal.demo-modal{width:calc(var(--laptop-balance-width) + 100px);max-width:none;max-height:94dvh}
body:not(.touch-device) #demoScene .arm-scale{width:var(--laptop-balance-width);height:auto;max-height:none;max-width:none;margin:auto}
body:not(.touch-device) #modalBody #demoCaption{font-size:41.04px;line-height:1.3}
body:not(.touch-device) #modalBody .demo-controls button{font-size:36.936px}
body:not(.touch-device) #modalBody #demoProgress{font-size:30px}
body:not(.touch-device) .game.mystery-mode #scene{display:grid;grid-template-columns:190px var(--laptop-balance-width);justify-content:center;min-height:0}
body:not(.touch-device) .game.mystery-mode .pan-scale{width:var(--laptop-balance-width);max-width:none}
body:not(.touch-device) .game:fullscreen.mystery-mode #scene,body:not(.touch-device) .game.focus-mode.mystery-mode #scene{display:grid;flex:none;min-height:0}
/* Enlarge laptop balance graphics only; surrounding typography is unchanged. */
body:not(.touch-device) #hint{display:none!important}
body:not(.touch-device) .game.mystery-mode #scene{grid-template-columns:228px var(--laptop-balance-width);gap:21.6px}
body:not(.touch-device) .game.mystery-mode .weight-bank{width:228px;padding:9.6px;gap:9.6px;font-size:31.2px}
body:not(.touch-device) .game.mystery-mode .weight-bank small{font-size:21.6px}
body:not(.touch-device) .game.mystery-mode .weight-bank .weight{font-size:24.3px;min-height:88.8px;height:88.8px}
body:not(.touch-device) .game.mystery-mode .pan-scale{height:540px;min-height:480px}
body:not(.touch-device) .game.mystery-mode .pan{max-width:432px;grid-template-columns:repeat(3,minmax(0,93.6px));gap:7.2px;padding:12px}
body:not(.touch-device) .game.mystery-mode .pan .weight{height:81.6px;min-height:81.6px;font-size:24.3px}
body:not(.touch-device) .game.mystery-mode .pan-beam{left:calc(8% + min(15%,216px));right:calc(8% + min(15%,216px))}
body:not(.touch-device) .game.mystery-mode .pan-pillar{width:67.2px;left:calc(50% - 33.6px)}
body:not(.touch-device) .game.mystery-mode .comparison-badge{top:calc(55% + 8px)}
body:not(.touch-device) .game.mystery-mode .removed-pile{max-width:432px;grid-template-columns:repeat(3,minmax(0,86.4px));gap:6px}
body:not(.touch-device) .game.mystery-mode .removed-pile .weight{height:60px;min-height:60px;font-size:24.3px}
body:not(.touch-device) .game:fullscreen.mystery-mode .pan-scale,body:not(.touch-device) .game.focus-mode.mystery-mode .pan-scale{height:clamp(432px,52.8dvh,840px);min-height:432px}
/* Laptop level cards: twice the previous text, padding, and result-strip size. */
body:not(.touch-device) #modal.level-picker-modal{width:min(1700px,96vw);max-height:calc(100dvh - 24px);overflow-y:auto;padding:28px}
body:not(.touch-device) #modalBody .levels{grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}
body:not(.touch-device) #modalBody .levels button{font-size:57px;line-height:1.2;padding:26px 36px;min-height:210px;border-width:3px;border-radius:20px;gap:28px;overflow-wrap:break-word}
body:not(.touch-device) #modalBody .levels .level-recent{gap:12px}
body:not(.touch-device) #modalBody .levels .level-recent>span{height:18px}
body:not(.touch-device) .game.mystery-mode #gameControls{display:none}
/* Level picker reduced by 20% from update 21. */
body:not(.touch-device) #modal.level-picker-modal{width:min(1360px,76.8vw);padding:22.4px}
body:not(.touch-device) #modalBody .levels{gap:19.2px}
body:not(.touch-device) #modalBody .levels button{font-size:45.6px;padding:20.8px 28.8px;min-height:168px;border-width:2.4px;border-radius:16px;gap:22.4px}
body:not(.touch-device) #modalBody .levels .level-recent{gap:9.6px}
body:not(.touch-device) #modalBody .levels .level-recent>span{height:14.4px}
/* Mystery balance graphics grow with the number-line balances by a further 15%. */
body:not(.touch-device) .game.mystery-mode .pan-scale{height:621px;min-height:552px}
body:not(.touch-device) .game.mystery-mode .pan{max-width:496.8px;grid-template-columns:repeat(3,minmax(0,107.64px));gap:8.28px;padding:13.8px}
body:not(.touch-device) .game.mystery-mode .pan .weight{height:93.84px;min-height:93.84px;font-size:27.945px}
body:not(.touch-device) .game.mystery-mode .pan-beam{left:calc(8% + min(15%,248.4px));right:calc(8% + min(15%,248.4px))}
body:not(.touch-device) .game.mystery-mode .pan-pillar{width:77.28px;left:calc(50% - 38.64px)}
body:not(.touch-device) .game.mystery-mode .removed-pile{max-width:496.8px;grid-template-columns:repeat(3,minmax(0,99.36px));gap:6.9px}
body:not(.touch-device) .game.mystery-mode .removed-pile .weight{height:69px;min-height:69px;font-size:27.945px}
body:not(.touch-device) .game:fullscreen.mystery-mode .pan-scale,body:not(.touch-device) .game.focus-mode.mystery-mode .pan-scale{height:clamp(496.8px,60.72dvh,966px);min-height:496.8px}
/* At narrower laptop widths, trim only the empty side gutters of the mystery canvas. */
@media(max-width:1800px){
body:not(.touch-device) .game.mystery-mode #scene{grid-template-columns:228px minmax(0,1fr);justify-content:start;overflow-x:clip;overflow-y:visible}
body:not(.touch-device) .game.mystery-mode .pan-scale{transform:translateX(-8%)}
}
/* Laptop level cards reduced a further 5%; lower controls retain just the action buttons. */
body:not(.touch-device) #modal.level-picker-modal{width:min(1292px,72.96vw);padding:21.28px}
body:not(.touch-device) #modalBody .levels{gap:18.24px}
body:not(.touch-device) #modalBody .levels button{font-size:43.32px;padding:19.76px 27.36px;min-height:159.6px;border-width:2.28px;border-radius:15.2px;gap:21.28px}
body:not(.touch-device) #modalBody .levels .level-recent{gap:9.12px}
body:not(.touch-device) #modalBody .levels .level-recent>span{height:13.68px}
body:not(.touch-device) .game #gameControls #actionTitle,body:not(.touch-device) .game #gameControls #instruction,body:not(.touch-device) .game #gameControls #remaining{display:none}
body:not(.touch-device) .game #gameControls{display:block;padding:8px 12px}
body:not(.touch-device) .game #gameControls #blockControls{display:flex;flex-wrap:wrap;justify-content:flex-start;gap:12px}
body:not(.touch-device) .game.mystery-mode #gameControls{display:none}
/* One physical weight size in the supply, on the pans, and in removed piles. */
body:not(.touch-device) .game.mystery-mode .weight-bank .weight,body:not(.touch-device) .game.mystery-mode .pan .weight,body:not(.touch-device) .game.mystery-mode .removed-pile .weight{width:107.64px;min-width:107.64px;max-width:107.64px;height:93.84px;min-height:93.84px;max-height:93.84px;font-size:27.945px;box-sizing:border-box;padding:5px;line-height:1;border-radius:8px}
body:not(.touch-device) .game.mystery-mode .weight-bank{width:244.08px;grid-template-columns:repeat(2,107.64px)}
body:not(.touch-device) .game.mystery-mode #scene{grid-template-columns:244.08px var(--laptop-balance-width)}
body:not(.touch-device) .game.mystery-mode .removed-pile{grid-template-columns:repeat(3,107.64px);top:calc(100% - 205px);height:205px;max-height:205px;min-height:0;overflow-y:auto}
@media(max-width:1800px){
body:not(.touch-device) .game.mystery-mode #scene{grid-template-columns:244.08px minmax(0,1fr)}
body:not(.touch-device) .game.mystery-mode .pan-scale{transform:translateX(calc(-8% - 16.08px))}
}
/* The entire laptop demo is uniformly 10% smaller. */
body:not(.touch-device) #modal.demo-modal{transform:scale(.9);transform-origin:center}
/* Removed weights rest directly on their line instead of floating above a fixed-height box. */
body:not(.touch-device) .game.mystery-mode .removed-pile{height:auto;min-height:0;max-height:236px;align-content:start;padding-bottom:4px}
body:not(.touch-device) .game.mystery-mode .weight-bank{position:relative;top:0}

/* Keep the complete demo visible: the illustration uses the space left by its text and controls. */
body #modal.demo-modal[open]{display:flex;flex-direction:column;width:min(1400px,96vw);max-width:96vw;height:94dvh;max-height:94dvh;overflow:hidden;box-sizing:border-box}
body #modal.demo-modal .modal-head{flex:0 0 auto}
body #modal.demo-modal #modalBody{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;overflow:hidden;gap:10px}
body #modal.demo-modal #demoScene{flex:1 1 auto;min-height:0;overflow:hidden}
body #modal.demo-modal #demoScene .arm-scale{width:100%;min-width:0;max-width:100%;height:100%;min-height:0;max-height:100%;aspect-ratio:auto;margin:0}
body #modal.demo-modal #demoCaption{flex:0 0 auto;min-height:0;margin:0}
body #modal.demo-modal .demo-controls{flex:0 0 auto}

/* Version 38: use readable laptop text at normal browser zoom. Touch layouts remain separate. */
body:not(.touch-device) .brand img{width:360px;height:72px}
body:not(.touch-device) nav button{font-size:22px;line-height:1.25;padding:10px 12px}
body:not(.touch-device) header{gap:10px 18px}
body:not(.touch-device) .game #levelTitle{font-size:32px;line-height:1.2}
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:20px;line-height:1.25}
body:not(.touch-device) .game #equation{font-size:48px;line-height:1.2;min-height:74px;padding:10px 14px}
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:24px;line-height:1.3}
body:not(.touch-device) .game #activity.prediction-activity button{font-size:36px}
body:not(.touch-device) .game #questionActions #next,
body:not(.touch-device) .game #next,
body:not(.touch-device) .game #gameControls button,
body:not(.touch-device) .game #bottomNavigation button,
body:not(.touch-device) .game .question-tools button{font-size:20px;line-height:1.25}
body:not(.touch-device) .game #feedback{font-size:22px;line-height:1.3}
body:not(.touch-device) .game .history-title{font-size:18px;line-height:1.3}
body:not(.touch-device) .game .history-title span{font-size:16px}
body:not(.touch-device) footer{font-size:16px}
body:not(.touch-device) #buildBadge{font-size:12px}
body:not(.touch-device) #modalTitle{font-size:30px}
body:not(.touch-device) #modalBody p,
body:not(.touch-device) #modalBody li{font-size:22px;line-height:1.4}
body:not(.touch-device) #modalBody h3{font-size:24px}
body:not(.touch-device) #modalBody #demoCaption{font-size:24px;line-height:1.3}
body:not(.touch-device) #modalBody .demo-controls button{font-size:20px}
body:not(.touch-device) #modalBody #demoProgress{font-size:18px}
body:not(.touch-device) #modal.level-picker-modal{width:min(1050px,94vw);padding:22px}
body:not(.touch-device) #modalBody .levels{gap:14px}
body:not(.touch-device) #modalBody .levels button{font-size:24px;line-height:1.25;min-height:105px;padding:16px 20px;gap:14px}
/* Fit the laptop fullscreen illustration into the space left by the unchanged text sizes. */
body:not(.touch-device) .game:fullscreen #gameSurface,
body:not(.touch-device) .game.focus-mode #gameSurface{height:100dvh;min-height:0;display:flex;flex-direction:column}
body:not(.touch-device) .game:fullscreen .layout,
body:not(.touch-device) .game.focus-mode .layout,
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:fullscreen #sceneWrap:not(.weight-mode),
body:not(.touch-device) .game.focus-mode #sceneWrap:not(.weight-mode),
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{width:100%;min-width:0;height:100%;max-height:100%;aspect-ratio:auto}
