/* Reclaim the footer and helper-caption space for the game itself. */
.shell{grid-template-rows:66px minmax(0,1fr);padding-bottom:14px}.screen-game{gap:12px}.workarea{grid-template-rows:30px minmax(0,1fr) 56px}.board-head .text-button{font-size:11px;min-height:30px;padding:4px 8px;gap:6px}.board-head .text-button .icon{width:16px;height:16px}.btn.tool{max-width:65px;min-height:42px}.btn.tool .icon{width:21px;height:21px}.btn.tool span{font-size:8px}.board-head>span:last-child{display:none}.nav-center{display:none}.panel-footnote,.board-watermark{display:none}
/* A reusable board: its printed exercise is never part of the erasable ink. */
.scratch-widget{display:grid;grid-template-rows:auto minmax(0,1fr);gap:10px;min-height:0;min-width:0;height:100%}.math-dialog .scratch-panel{grid-template-rows:28px minmax(0,1fr);gap:12px}.scratch-host{min-height:0}.scratch-widget .scratch-tools{margin:0;gap:8px;min-height:32px}.scratch-widget .scratch-tools .btn{display:inline-flex;gap:5px;align-items:center;min-height:32px;font-size:10px;padding:6px 9px}.scratch-widget .scratch-tools .icon{width:14px;height:14px}.scratch-surface{position:relative;min-height:0;overflow:hidden;border:2px solid #4b618c;border-radius:12px;background-color:#111c34;background-image:linear-gradient(#708ac51e 1px,transparent 1px),linear-gradient(90deg,#708ac51e 1px,transparent 1px);background-size:27px 27px;container-type:size}.drawing-canvas{display:block;position:absolute;inset:0;width:100%;height:100%;touch-action:none;user-select:none;cursor:crosshair;z-index:2}.drawing-canvas.erasing{cursor:cell}.operation-guide{position:absolute;left:50%;top:8%;transform:translateX(-50%);color:#acbde2bd;pointer-events:none;z-index:1;font-family:"Consolas","Courier New",monospace;font-weight:800;text-align:right;font-size:clamp(20px,12cqh,54px);line-height:1.15;width:clamp(94px,35cqw,205px)}.operand{padding:2px 12px;position:relative;white-space:nowrap}.second-operand{border-bottom:3px solid #92afd7b3;padding-bottom:5px}.second-operand>span{position:absolute;left:4px;bottom:5px;color:#86d0e2c4}.result-writing-row{height:1.5em;border-bottom:1px dashed #7993b57a;margin:0 8px}.operation-guide>small{display:block;color:#7390b8;font-family:system-ui,sans-serif;font-size:clamp(6px,2cqh,10px);letter-spacing:1px;text-align:center;margin-top:6px;font-weight:600}.expression-guide{width:90%;max-width:520px;font-size:clamp(17px,8cqh,36px);text-align:center}.expression-guide>.result-writing-row{height:1.7em;margin:8px 22% 0}.working-rule{border-bottom:2px solid #91abd480;margin:12px 15% 0}.race-ready{display:grid;grid-template-columns:1fr 1.05fr;gap:35px;padding:28px;background:#121d35;border:1px solid #6a518b;border-radius:24px;flex:1;min-height:0}.race-ready-art{position:relative;min-height:0;background:radial-gradient(circle,#342652,#14233e);border:1px solid #71558e;border-radius:20px;overflow:hidden}.race-ready-art img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 10px 7px #05091b80)}.race-ready-art .versus-symbol{left:auto;right:8%;top:15%;transform:rotate(10deg)}.race-ready-copy{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;min-width:0}.race-ready-copy h1{font-size:clamp(30px,4vw,60px);line-height:1.08;margin:14px 0 18px;color:#f0eeff}.race-ready-copy p{font-size:13px;color:#a2b5db;line-height:1.9;max-width:520px}.race-ready-copy ul{color:#b5c5e5;font-size:12px;line-height:2;padding-left:20px;margin:18px 0 24px}.race-name-pills{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:18px}.race-name-pills span{background:#183c51;color:#9feaf3;border:1px solid #438ca4;padding:8px 12px;border-radius:8px;font-size:13px;font-weight:800}.race-name-pills span+span{background:#352449;color:#d9b2fa;border-color:#8c5cb3}.race-ready-actions{display:flex;gap:12px;align-items:center}
/* Both workspaces remain live; only one side is covered by its own exercise. */
.screen-race{gap:12px}.race-title{display:flex;justify-content:space-between;align-items:center;gap:20px;min-height:36px;flex-shrink:0}.race-title h1{font-size:23px;color:#e7edff;display:flex;align-items:baseline;gap:18px}.race-title h1 span{font-family:system-ui,sans-serif;font-size:10px;color:#8da6cf;font-weight:600;letter-spacing:0}.race-title .btn{min-height:32px;font-size:10px}.race-grid{display:grid;grid-template-columns:minmax(0,1fr) 310px minmax(0,1fr);gap:14px;min-height:0;flex:1}.race-player{display:flex;flex-direction:column;gap:9px;min-height:0;min-width:0;padding:10px;background:#101d35;border:1px solid #426f93;border-radius:18px;box-shadow:0 0 18px #3386bc16}.race-player.player-2{background:#191b35;border-color:#80599c;box-shadow:0 0 18px #a65cc416}.race-player-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:34px;flex-shrink:0}.race-player-heading>div{display:flex;align-items:center;gap:8px;min-width:0;flex:1}.race-player-heading h2{font-size:17px;letter-spacing:-.3px;color:#b4edf7;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.player-2 .race-player-heading h2{color:#dfbaff}.race-player-number{width:25px;height:25px;display:grid;place-items:center;border-radius:7px;background:#194559;border:1px solid #4d9bb3;color:#9ae3f0;font-size:12px;font-weight:900;flex-shrink:0}.player-2 .race-player-number{background:#412953;border-color:#a36cc3;color:#e8c5ff}.race-player-timer{display:flex;align-items:center;gap:5px;font-size:13px;color:#a6c1e3;white-space:nowrap}.race-player-timer .icon{width:15px;height:15px}.race-layers-toggle{display:flex;align-items:center;gap:4px;background:#21334f;border:1px solid #3e6385;border-radius:7px;color:#adcde9;font-size:10px;padding:7px}.race-layers-toggle .icon{width:14px;height:14px}.player-2 .race-layers-toggle{background:#302449;border-color:#73508c;color:#d0b7ea}.race-workspace{position:relative;min-height:0;flex:1;isolation:isolate}.race-board{position:absolute;inset:0;width:100%;height:100%;border-radius:14px}.player-2 .race-board{background:radial-gradient(ellipse,#282746,#181f3b);border-color:#9270af}.race-player-tools{display:grid;grid-template-columns:repeat(9,minmax(0,1fr));gap:4px;padding:5px 0;flex-shrink:0}.race-player-tools .btn.tool{max-width:none;min-width:0;min-height:40px;padding:4px 1px;border:1px solid #304c6e;gap:4px}.race-player-tools .btn.tool .icon{width:18px;height:18px}.race-player-tools .btn.tool span{font-size:7px;white-space:nowrap;display:block}.race-player-tools .btn.tool:hover:after{display:none}.race-check{width:100%;min-height:42px;font-size:12px;flex-shrink:0}.player-1 .race-check{background:linear-gradient(135deg,#227b92,#31549c);border-color:#6ed9e9;box-shadow:0 3px 0 #14365c}.player-2 .race-check{background:linear-gradient(135deg,#9052b1,#6645ab);border-color:#c590e8}.race-player-notice{position:absolute;left:8px;right:8px;top:9px;padding:11px 14px;border:1px solid #8b77bb;border-radius:9px;color:#ebddff;background:#2a2444f5;font-size:12px;line-height:1.7;z-index:20;pointer-events:none}.race-shared{min-width:0;gap:7px;padding:10px}.race-shared-title{display:flex;align-items:center;justify-content:center;gap:8px;font-size:14px;font-weight:800;color:#cbd8f5;min-height:24px;flex-shrink:0}.race-shared-title .icon{width:18px;height:18px;color:#9eaeed}.race-shared-reference{display:flex;align-items:center;gap:8px;min-height:88px;flex-shrink:0;background:radial-gradient(ellipse at 20% 50%,#33264f,#1c2640);border:1px solid #625080;border-radius:12px;padding:5px}.race-shared-reference img{width:94px;height:88px;object-fit:contain;flex-shrink:0}.race-shared-reference h2{font-size:14px;line-height:1.2;margin-bottom:8px;letter-spacing:-.3px;color:#deddf9}.race-shared-reference>div{min-width:0}.race-shared-reference span{display:block;font-size:10px;line-height:1.8}.race-progress-one{color:#8bdfef}.race-progress-two{color:#d6a9f1}.race-needed-heading{display:flex;align-items:center;justify-content:space-between;gap:5px;font-size:10px;color:#b1c2e4;font-weight:800;flex-shrink:0}.race-needed-heading small{font-size:8px;color:#8299c0;font-weight:500}.race-needed{height:clamp(90px,16vh,140px);min-height:65px;overflow:auto;display:flex;flex-direction:column;gap:4px;flex-shrink:0}.race-needed-item{display:flex;align-items:center;gap:5px;min-height:32px;background:#1b2942;border:1px solid #354d72;border-radius:7px;padding:4px;text-align:left;flex-shrink:0}.race-needed-item>.sprite{width:23px;height:23px;flex-shrink:0}.race-needed-item>span{font-size:9px;color:#b4c8e8;flex:1;line-height:1.3}.race-needed-item>b{font-size:8px;white-space:nowrap;padding:3px;background:#142a40;border-radius:4px}.player-count-0{color:#85dcec}.race-needed-item>b.player-count-1{color:#d6a6f0;background:#302140}.race-shared-categories{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;flex-shrink:0;border-top:1px solid #344566;padding-top:7px}.race-shared-categories .category{height:42px;gap:3px;font-size:8px}.race-shared-categories .category>.icon{width:18px;height:18px}.race-inventory-heading{display:flex;align-items:center;gap:5px;color:#b6d0ec;font-size:10px;min-height:18px;flex-shrink:0}.race-inventory-heading>.icon{width:14px;height:14px}.race-inventory-heading>small{margin-left:auto;font-size:8px;color:#8ea9cf}.race-inventory{display:grid;grid-template-columns:1fr 1fr;gap:7px;overflow:auto;align-content:start;flex:1;min-height:0}.race-piece-tile{display:flex;flex-direction:column;align-items:center;gap:5px;padding:7px 5px;border:1px solid #3c4b74;border-radius:10px;background:#18243c;min-width:0}.race-piece-preview{height:49px;width:90%;display:grid;place-items:center}.race-piece-preview>.sprite{width:95%;height:47px}.race-piece-tile>b{font-size:9px;color:#c0d2ef;text-align:center;line-height:1.3;min-height:22px;display:flex;align-items:center}.race-piece-actions{display:grid;grid-template-columns:1fr 1fr;gap:5px;width:100%}.race-add{display:flex;align-items:center;justify-content:center;gap:3px;min-height:33px;background:#174058;border:1px solid #4a93ae;color:#a2ecf6;border-radius:6px;font-size:12px;font-weight:900;padding:4px}.race-add.player-2{background:#3b2751;border-color:#9364b3;color:#dfb7fc}.race-add .icon{width:11px;height:11px}.race-add small{font-size:8px;opacity:.7}.race-add:disabled{opacity:.25}.race-layer-panel{position:absolute;inset:0;z-index:10;padding:14px;border:1px solid #7573a4;border-radius:13px;background:#151f39;display:flex;flex-direction:column;gap:14px;min-height:0}.race-layer-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}.race-layer-heading h3{font-size:15px}.race-layer-heading .btn{font-size:9px;min-height:28px;padding:6px 8px}.race-layer-list{display:flex;flex-direction:column;gap:6px;min-height:0;overflow:auto;flex:1}.race-layer-list .placed-row{min-height:42px}.race-layer-list .placed-row>span{font-size:10px}.race-layer-list .placed-row>small{font-size:8px;color:#9bb1d9}.race-layer-list .body-layer{font-size:10px}.race-player-math{position:absolute;inset:0;z-index:12;background:#14213a;border:1px solid #6b9ac6;border-radius:14px;padding:10px;display:grid;grid-template-rows:auto minmax(0,1fr) auto auto;gap:8px;min-height:0;box-shadow:0 0 20px #040b2299}.player-2 .race-player-math{background:#201e3b;border-color:#a077bd}.race-math-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}.race-math-heading>div{min-width:0}.race-math-heading small{font-size:8px;font-weight:800;letter-spacing:.6px;color:#8fb2da;display:block;line-height:1.4}.race-math-heading b{font-size:12px;color:#d7e8ff;display:block;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.race-math-heading .btn{min-height:28px;padding:6px;font-size:9px}.race-math-heading .btn .icon{width:12px;height:12px}.race-scratch-host{min-height:0}.compact-scratch{gap:6px}.compact-scratch .scratch-tools{min-height:26px;gap:5px}.compact-scratch .scratch-tools .btn{min-height:26px;font-size:8px;padding:4px 6px;border-radius:7px}.compact-scratch .scratch-tools .btn .icon{width:12px;height:12px}.compact-scratch .pen-color{width:24px;height:24px;border-width:3px}.compact-scratch .scratch-surface{border-radius:9px}.compact-scratch .operation-guide{font-size:clamp(16px,12cqh,40px)}.compact-scratch .operation-guide>small{font-size:6px;margin-top:4px}.race-math-answers{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px}.race-math-answers .answer{font:inherit;font-size:22px;font-weight:900;min-height:43px;background:#233756;border:1px solid #6385b5;border-radius:10px;color:#e3f2ff;box-shadow:0 3px 0 #0b1530}.race-math-answers .answer:disabled{opacity:.3}.race-math-answers .answer.correct{background:#1c5460;border-color:#83e3ed;color:#b6f3f6;opacity:1}.race-math-answers .answer.wrong{background:#5b284b;border-color:#c778a1}.race-math-bottom{display:flex;align-items:center;gap:8px;min-height:31px}.race-math-feedback{flex:1;font-size:10px;color:#acd4df;line-height:1.5}.race-math-bottom .btn{font-size:9px;min-height:28px;padding:6px 10px}.race-player-win{position:absolute;inset:0;z-index:15;display:flex;flex-direction:column;align-items:center;gap:9px;background:#152641;border:1px solid #67bed5;border-radius:14px;padding:16px;text-align:center;overflow:hidden}.player-2 .race-player-win{background:#281f42;border-color:#be8bdd}.race-win-heading{flex-shrink:0}.race-win-heading .eyebrow{font-size:8px;letter-spacing:1.3px}.race-win-heading h2{font-size:31px;color:#eaf6ff;margin:5px 0}.race-win-heading>b{font-size:12px;color:#9adeef}.player-2 .race-win-heading>b{color:#d6aff4}.race-win-preview{position:relative;container-type:size;isolation:isolate;flex:1;min-height:30px;width:100%;background:radial-gradient(ellipse,#263e5a,#182943);border-radius:12px;overflow:hidden}.player-2 .race-win-preview{background:radial-gradient(ellipse,#44305c,#2b2448)}.race-win-preview .placed{outline:none!important}.race-win-score{display:flex;align-items:baseline;justify-content:center;gap:7px;font-size:30px;font-weight:1000;color:#b4f4fa;flex-shrink:0}.player-2 .race-win-score{color:#e3baff}.race-win-score small{font-size:10px;font-weight:500;color:#aac0df}.race-win-metrics{display:grid;grid-template-columns:1fr 1fr;gap:7px 16px;font-size:11px;color:#a9c4df;flex-shrink:0}.race-win-metrics span{display:flex;align-items:center;justify-content:center;gap:6px}.race-win-metrics .icon{width:13px;height:13px}.race-player-win>p{font-size:10px;color:#9db8d8;flex-shrink:0}.race-end-actions{display:flex;gap:7px;flex-shrink:0;padding-top:5px}.race-end-actions .btn{font-size:10px;flex:1;min-height:38px;padding:8px 9px}
@media(min-width:1280px) and (min-height:600px){.nav .btn{font-size:12px;min-height:42px;padding:10px 15px}.game-top-actions .btn{font-size:12px;min-height:40px}.category{height:57px}.category .icon{width:24px;height:24px}.category small{font-size:11px}.categories{gap:7px}.piece-btn{min-height:128px;padding:8px 4px;gap:5px}.piece-preview{height:67px}.piece-preview>.sprite{height:64px}.piece-btn>span{font-size:12px;max-width:115px}.piece-btn small{font-size:10px}.panel-heading{font-size:14px}.panel-heading small{font-size:10px}.inventory-title{font-size:12px;padding:12px}.side-tabs button{font-size:13px;min-height:42px}.side-tabs .icon{width:18px;height:18px}.side-action .btn{min-height:45px;font-size:13px}.check-piece{min-height:44px}.check-piece>span{font-size:12px}.check-piece>b{font-size:11px}.check-piece>.sprite{width:29px;height:29px}.unlock-stop{min-height:39px}.unlock-stop>b{font-size:12px}.unlock-stop small{font-size:9px}.free-progress{font-size:12px}.side-content>#next-challenge{min-height:44px;font-size:12px}.mission-heading h3{font-size:20px}.race-grid{grid-template-columns:minmax(0,1fr) 320px minmax(0,1fr)}.race-player-heading h2{font-size:19px}.race-player-heading{min-height:40px}.race-layers-toggle{font-size:11px;min-height:34px}.race-player-tools .btn.tool{min-height:44px}.race-player-tools .btn.tool .icon{width:21px;height:21px}.race-player-tools .btn.tool span{font-size:8px}.race-check{min-height:46px;font-size:14px}.race-add{min-height:37px;font-size:13px}.race-add .icon{width:13px;height:13px}.race-piece-preview{height:55px}.race-piece-preview>.sprite{height:53px}.race-piece-tile>b{font-size:10px}.race-needed-item>span{font-size:10px}.race-needed-item>b{font-size:9px}.race-shared-categories .category{height:46px}.race-shared-categories .category span{font-size:10px}.race-player-math .btn{min-height:32px}.race-math-heading b{font-size:14px}.race-math-heading small{font-size:9px}.race-math-answers .answer{min-height:47px;font-size:25px}.race-math-feedback{font-size:11px}}
@media(min-width:1600px){.shell{grid-template-rows:78px minmax(0,1fr);padding-bottom:20px}.workarea{grid-template-rows:34px minmax(0,1fr) 64px}.btn.tool{min-height:48px;max-width:78px}.btn.tool .icon{width:25px;height:25px}.btn.tool span{font-size:10px}.race-grid{grid-template-columns:minmax(0,1fr) 370px minmax(0,1fr);gap:20px}.race-player{padding:14px;gap:12px}.race-player-heading h2{font-size:23px}.race-player-number{width:32px;height:32px;font-size:16px}.race-player-heading{min-height:44px}.race-layers-toggle{font-size:13px;padding:9px}.race-player-timer{font-size:17px}.race-player-tools .btn.tool{min-height:51px}.race-player-tools .btn.tool .icon{width:24px;height:24px}.race-player-tools .btn.tool span{font-size:9px}.race-check{min-height:51px;font-size:16px}.race-shared{padding:14px;gap:10px}.race-shared-reference img{width:114px;height:110px}.race-shared-reference h2{font-size:18px}.race-shared-reference span{font-size:12px}.race-needed-item{min-height:39px}.race-needed-item>span{font-size:12px}.race-needed-item>b{font-size:11px}.race-piece-tile>b{font-size:12px}.race-piece-preview{height:67px}.race-piece-preview>.sprite{height:64px}.race-add{min-height:43px;font-size:15px}.race-shared-categories .category{height:56px}.race-shared-categories .category span{font-size:12px}.race-shared-categories .category>.icon{width:23px;height:23px}.race-math-answers .answer{min-height:57px;font-size:30px}.race-math-heading b{font-size:18px}.race-math-heading small{font-size:11px}.race-player-math{padding:15px;gap:12px}.compact-scratch .scratch-tools .btn{font-size:11px;min-height:34px}.compact-scratch .pen-color{width:31px;height:31px}.race-math-feedback{font-size:13px}.race-win-heading h2{font-size:42px}.race-win-metrics{font-size:15px}.race-win-score{font-size:39px}.race-win-heading>b{font-size:16px}}
@media(max-width:1150px) and (orientation:landscape){.shell{grid-template-rows:56px minmax(0,1fr);padding-bottom:10px}.race-grid{grid-template-columns:minmax(0,1fr) 260px minmax(0,1fr);gap:9px}.race-player{padding:7px;gap:7px}.race-player-heading h2{font-size:14px}.race-player-heading{gap:5px}.race-player-number{width:21px;height:21px;font-size:10px}.race-player-heading>div{gap:5px}.race-layers-toggle{padding:6px;font-size:8px}.race-layers-toggle span{display:none}.race-player-timer{font-size:11px;gap:4px}.race-player-timer .icon{width:12px;height:12px}.race-player-tools{gap:3px}.race-player-tools .btn.tool{min-height:34px}.race-player-tools .btn.tool .icon{width:15px;height:15px}.race-player-tools .btn.tool span{font-size:6px}.race-check{font-size:11px;min-height:37px}.race-shared{padding:7px;gap:6px}.race-shared-title{font-size:12px}.race-shared-reference img{width:75px;height:75px}.race-shared-reference{min-height:78px}.race-shared-reference h2{font-size:12px}.race-shared-reference span{font-size:9px}.race-shared-categories{gap:4px}.race-shared-categories .category{height:37px;font-size:7px;gap:2px}.race-shared-categories .category>.icon{width:16px;height:16px}.race-needed-item{min-height:30px}.race-needed-item>span{font-size:8px}.race-needed-item>b{font-size:7px}.race-needed-item>.sprite{width:20px;height:20px}.race-inventory-heading{font-size:9px}.race-inventory-heading>small{font-size:6px}.race-piece-preview{height:39px}.race-piece-preview>.sprite{height:37px}.race-piece-tile>b{font-size:8px;min-height:20px}.race-add{font-size:10px;min-height:29px}.race-add .icon{width:10px;height:10px}.race-add small{font-size:6px}.race-piece-tile{padding:5px;gap:4px}.race-title h1{font-size:19px;gap:12px}.race-title h1 span{font-size:8px}.race-player-math{padding:7px;gap:6px}.race-math-heading b{font-size:11px}.race-math-heading small{font-size:6px}.race-math-heading .btn{font-size:8px;min-height:25px}.compact-scratch .scratch-tools{gap:4px}.compact-scratch .scratch-tools .btn{min-height:23px;font-size:7px;padding:4px}.compact-scratch .scratch-tools .btn .icon{width:10px;height:10px}.compact-scratch .pen-color{width:21px;height:21px}.race-math-answers .answer{min-height:36px;font-size:20px}.race-math-feedback{font-size:9px}.race-math-bottom .btn{font-size:8px;padding:5px 6px;min-height:25px}.race-math-bottom{min-height:28px}.race-win-heading h2{font-size:25px}.race-player-win{padding:12px;gap:7px}.race-win-heading .eyebrow{font-size:7px}.race-win-metrics{font-size:10px;gap:5px 10px}.race-win-score{font-size:25px}.race-player-win>p{font-size:9px}}
@media(max-height:670px) and (orientation:landscape){.shell{grid-template-rows:48px minmax(0,1fr);padding-bottom:8px}.workarea{grid-template-rows:24px minmax(0,1fr) 45px}.btn.tool{min-height:32px;max-width:60px}.btn.tool .icon{width:17px;height:17px}.btn.tool span{font-size:7px}.race-title{min-height:29px}.race-title h1{font-size:18px}.screen-race{gap:8px}.race-needed{height:88px;min-height:60px}.race-math-answers .answer{min-height:35px}.race-ready{padding:20px;gap:25px}.race-ready-copy h1{font-size:36px;margin:10px 0 13px}.race-ready-copy p{font-size:11px}.race-ready-copy ul{font-size:10px;line-height:1.9;margin:12px 0 18px}.race-name-pills{margin-bottom:12px}.race-name-pills span{font-size:11px;padding:7px 9px}}
@media(max-height:470px) and (orientation:landscape){.shell{grid-template-rows:40px minmax(0,1fr);padding-bottom:6px}.workarea{grid-template-rows:18px minmax(0,1fr) 36px}.board-head .text-button{font-size:7px;min-height:18px;padding:2px 4px}.board-head .text-button .icon{width:10px;height:10px}.btn.tool{min-height:26px}.btn.tool .icon{width:13px;height:13px}.btn.tool span{display:none}.race-grid{grid-template-columns:minmax(0,1fr) 235px minmax(0,1fr);gap:7px}.race-title{min-height:24px}.race-title h1{font-size:14px}.race-title h1 span{font-size:7px}.race-title .btn{min-height:25px;font-size:8px;padding:5px 8px}.race-player{padding:5px;gap:5px}.race-player-heading{min-height:24px}.race-player-heading h2{font-size:11px}.race-player-number{width:18px;height:18px;font-size:8px}.race-player-timer{font-size:9px}.race-player-tools{gap:2px;padding:2px 0}.race-player-tools .btn.tool{min-height:25px}.race-player-tools .btn.tool .icon{width:12px;height:12px}.race-player-tools .btn.tool span{display:none}.race-check{min-height:27px;font-size:9px;padding:6px}.race-check .icon{width:12px;height:12px}.race-shared{padding:5px;gap:4px}.race-shared-title{font-size:10px;min-height:18px}.race-shared-title .icon{width:13px;height:13px}.race-shared-reference{min-height:48px;padding:2px;gap:5px;border-radius:8px}.race-shared-reference img{width:50px;height:45px}.race-shared-reference h2{font-size:9px;margin-bottom:3px}.race-shared-reference span{font-size:7px;line-height:1.5}.race-needed-heading{font-size:8px}.race-needed-heading small{font-size:6px}.race-needed{height:48px;min-height:40px}.race-needed-item{min-height:24px;padding:2px}.race-needed-item>.sprite{width:16px;height:16px}.race-needed-item>span{font-size:7px}.race-needed-item>b{font-size:6px}.race-shared-categories{gap:3px;padding-top:4px}.race-shared-categories .category{height:28px;flex-direction:row;font-size:6px;gap:3px}.race-shared-categories .category>.icon{width:12px;height:12px}.race-inventory-heading{font-size:7px;min-height:13px}.race-inventory-heading>.icon{width:11px;height:11px}.race-inventory-heading>small{font-size:6px}.race-piece-preview{height:24px}.race-piece-preview>.sprite{height:23px}.race-piece-tile{gap:2px;padding:3px}.race-piece-tile>b{font-size:6px;min-height:14px}.race-inventory{gap:4px}.race-add{min-height:23px;font-size:9px;padding:2px}.race-add .icon{width:9px;height:9px}.race-math-heading small{font-size:5px}.race-math-heading b{font-size:9px}.race-math-heading .btn{min-height:21px;font-size:6px;padding:3px}.race-player-math{padding:5px;gap:4px}.compact-scratch{gap:4px}.compact-scratch .scratch-tools{gap:3px;min-height:21px}.compact-scratch .pen-color{width:18px;height:18px;border-width:2px}.compact-scratch .scratch-tools .btn{min-height:20px;padding:3px;font-size:6px;gap:3px}.compact-scratch .scratch-tools .btn .icon{width:9px;height:9px}.compact-scratch .operation-guide{font-size:clamp(13px,12cqh,24px);top:4%}.compact-scratch .operation-guide>small{font-size:4px;margin-top:2px}.compact-scratch .result-writing-row{height:1.3em}.race-math-answers{gap:4px}.race-math-answers .answer{min-height:26px;font-size:15px;border-radius:6px}.race-math-bottom{min-height:24px;gap:4px}.race-math-feedback{font-size:7px;line-height:1.4}.race-math-bottom .btn{font-size:6px;min-height:21px;padding:3px 4px}.race-win-heading h2{font-size:20px;margin:3px 0}.race-win-heading>b{font-size:9px}.race-win-heading .eyebrow{font-size:5px}.race-player-win{padding:7px;gap:5px}.race-win-score{font-size:20px}.race-win-score small{font-size:7px}.race-win-metrics{font-size:7px;gap:3px 8px}.race-win-metrics .icon{width:9px;height:9px}.race-player-win>p{font-size:6px}.race-end-actions .btn{font-size:7px;min-height:24px;padding:5px}.race-ready{padding:15px;gap:20px}.race-ready-copy h1{font-size:28px;margin:7px 0 10px}.race-ready-copy p{font-size:8px;line-height:1.7}.race-ready-copy ul{font-size:8px;line-height:1.7;margin:9px 0 12px}.race-ready-copy .eyebrow{font-size:6px}.race-name-pills{gap:7px;margin-bottom:10px}.race-name-pills span{font-size:9px;padding:5px 7px}.race-ready-actions .btn{min-height:28px;padding:7px 10px;font-size:9px}}
@media(orientation:portrait) and (max-width:900px){.shell{grid-template-rows:62px minmax(0,1fr);padding-bottom:14px}.workarea{grid-template-rows:26px minmax(0,1fr) 48px;height:440px}.screen-race:before{content:"Gira la pantalla en horizontal para jugar uno a cada lado.";display:block;padding:10px;background:#282343;border:1px solid #675185;border-radius:8px;color:#c9b6ea;font-size:10px}.race-title{align-items:flex-start}.race-title h1{font-size:19px;display:block}.race-title h1 span{display:block;font-size:8px;margin-top:6px;line-height:1.7}.race-title .btn{font-size:8px;padding:7px;min-height:29px}.race-grid{grid-template-columns:1fr;flex:none;gap:15px}.race-player{height:580px}.race-shared{height:650px}.race-player.player-2{grid-row:3}.race-player-heading h2{font-size:19px}.race-player-tools .btn.tool{min-height:41px}.race-player-tools .btn.tool .icon{width:19px;height:19px}.race-player-tools .btn.tool span{font-size:7px}.race-check{min-height:43px;font-size:13px}.race-player-math{padding:10px;gap:8px}.compact-scratch .operation-guide{font-size:clamp(18px,12cqh,40px)}.race-math-answers .answer{min-height:43px;font-size:24px}.race-math-feedback{font-size:10px}.race-ready{grid-template-columns:1fr;flex:none;padding:18px;gap:20px}.race-ready-art{height:270px}.race-ready-copy h1{font-size:36px}.race-ready-copy p{font-size:12px}.race-ready-copy ul{font-size:11px}.race-name-pills span{font-size:11px}.race-ready-actions .btn{font-size:11px;min-height:40px}.math-dialog .scratch-panel{display:grid;grid-template-rows:26px 390px;gap:12px}.scratch-host{min-height:390px}.scratch-surface{min-height:0}.scratch-widget .scratch-tools .btn{font-size:8px;min-height:32px;padding:6px}.scratch-widget .scratch-tools{gap:6px}.scratch-widget .pen-color{width:27px;height:27px}}
/* Match options and explicit score rules before entering the shared arena. */
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.configurable-duel{grid-template-columns:1fr 1fr}.match-config{justify-content:center;gap:10px;padding:24px}.match-config h2{font-size:27px;margin:0 0 5px}.duel-variants{border:0;padding:0;margin:0;display:flex;flex-direction:column;gap:8px}.variant-option{display:flex;align-items:flex-start;gap:10px;background:#192743;border:1px solid #425983;border-radius:11px;padding:11px 13px;cursor:pointer}.variant-option:has(input:checked){background:linear-gradient(120deg,#293b5a,#30264f);border-color:#a58be9;box-shadow:0 0 12px #9171e51a}.variant-option input{margin-top:3px;accent-color:#ab85f4;width:16px;height:16px;flex-shrink:0}.variant-option>span{display:grid;grid-template-columns:20px 1fr;gap:4px 8px}.variant-option b{font-size:13px;color:#dce8ff}.variant-option small{grid-column:2;font-size:10px;color:#9eb4d8;line-height:1.5}.variant-option .icon{width:17px;height:17px;color:#b7b7ee}.duel-clock-settings{display:flex;align-items:center;gap:17px;padding:10px 0}.duration-inputs{display:flex;align-items:center;gap:7px}.duration-inputs label{font-size:9px;color:#9aafd2;display:flex;flex-direction:column;gap:4px}.duration-inputs input{width:80px;min-height:39px;border:1px solid #5c6f9e;border-radius:9px;color:#def3ff;background:#15223e;text-align:center;font:inherit;font-size:20px;padding:7px}.duration-inputs>span{font-size:21px;font-weight:900;color:#b2b5e4;padding-top:13px}.duration-presets{display:flex;gap:6px;flex-wrap:wrap;padding-top:14px}.duration-presets button{border:1px solid #65518c;background:#292042;color:#cdb1ed;border-radius:7px;font-size:10px;padding:8px}.duel-rules-summary{font-size:11px;color:#bacbec;line-height:1.8;background:#111c35;border:1px solid #3c4d74;border-radius:10px;padding:10px 12px}.match-config>p.duel-config-error{min-height:14px;font-size:10px;line-height:1.5;color:#ffafcb;margin:0}.match-config>#duel-pick{align-self:stretch;min-height:41px;font-size:12px}.race-countdown{display:flex;align-items:center;justify-content:center;gap:7px;background:#2c2448;border:1px solid #9575bf;border-radius:9px;color:#d8c1fb;padding:7px 13px;min-width:102px;box-shadow:0 0 14px #a278e51a}.race-countdown .icon{width:17px;height:17px}.race-countdown b{font-size:21px;letter-spacing:1px;font-variant-numeric:tabular-nums}.race-countdown.last-seconds{border-color:#cea477;color:#ffdaa0;background:#463047}.race-countdown.time-over{border-color:#be789d;color:#ffbdd8;background:#442b47}.race-title h1{flex:1}.race-live-rule{font-size:10px;line-height:1.6;color:#a7bcde;background:#17233b;border:1px solid #364b6e;padding:8px;border-radius:8px;flex-shrink:0}.race-needed.direct-pieces{height:auto;flex:1;flex-shrink:1;min-height:0;gap:8px;padding:2px 2px 5px}.race-direct-piece{border:1px solid #3b5078;border-radius:9px;background:#172841;overflow:hidden;flex-shrink:0}.race-direct-piece.is-picked{border-color:#86b5e0;background:#213754;box-shadow:inset 0 0 0 1px #4c769c}.race-direct-piece>.race-needed-item{width:100%;border:0;border-radius:0;min-height:44px;padding:8px 6px;background:transparent}.race-needed-item>b{display:flex;align-items:center;gap:3px}.race-needed-item>b .icon{width:10px;height:10px}.race-direct-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px;padding:7px;border-top:1px solid #4a6488;background:#182c45}.race-direct-actions .race-add{min-height:40px;gap:6px;flex-wrap:wrap}.race-direct-actions .race-add>span{font-size:16px}.race-direct-actions .race-add>small{font-size:9px;font-weight:500;opacity:1}.race-direct-actions .race-add>.icon{width:15px;height:15px}.race-verdict{display:flex;flex-direction:column;align-items:center;gap:5px;background:#342c46;border:1px solid #b29770;border-radius:10px;padding:10px;flex-shrink:0;text-align:center}.race-verdict b{font-size:16px;color:#f9d7a3;line-height:1.3;overflow-wrap:anywhere}.race-verdict span{font-size:9px;color:#cab2d9;line-height:1.6}.race-player-win.waiting-result{justify-content:center;gap:18px;padding:25px;background:radial-gradient(circle,#1b3c52,#17243e)}.player-2 .race-player-win.waiting-result{background:radial-gradient(circle,#432d59,#251e40)}.waiting-result h2{font-size:27px;color:#dcf5ff;line-height:1.3}.waiting-result p{font-size:16px;line-height:1.7;color:#b6d7f1}.waiting-result small{font-size:11px;line-height:1.8;max-width:280px;color:#9fb2d5}.race-wait-icon{width:90px;height:90px;display:grid;place-items:center;background:#214662;border:1px solid #5a99bc;border-radius:28px;box-shadow:0 0 25px #6bd9f21a;color:#a0e4ef}.race-wait-icon .icon{width:45px;height:45px}.player-2 .race-wait-icon{background:#503065;border-color:#af7acb;color:#dab9f6}.race-win-metrics span{font-size:11px;line-height:1.5}
@media(min-width:1600px){.match-config{gap:16px;padding:34px}.match-config h2{font-size:36px}.variant-option{padding:16px}.variant-option b{font-size:17px}.variant-option small{font-size:13px}.variant-option input{width:20px;height:20px}.duel-rules-summary{font-size:14px;padding:16px}.duration-inputs label{font-size:12px}.duration-inputs input{width:95px;min-height:48px;font-size:25px}.duration-presets button{font-size:13px;padding:10px 13px}.match-config>#duel-pick{min-height:48px;font-size:15px}.race-live-rule{font-size:12px;padding:11px}.race-direct-piece>.race-needed-item{min-height:51px}.race-direct-actions .race-add{min-height:46px}.race-direct-actions .race-add>small{font-size:11px}.race-verdict b{font-size:21px}.race-verdict span{font-size:12px}.race-countdown b{font-size:27px}.waiting-result h2{font-size:35px}.waiting-result p{font-size:20px}.waiting-result small{font-size:14px;max-width:350px}.race-win-metrics span{font-size:14px}}
@media(max-width:1150px) and (orientation:landscape){.match-config{gap:8px;padding:18px}.match-config h2{font-size:23px}.variant-option{padding:9px 10px;gap:8px}.variant-option b{font-size:11px}.variant-option small{font-size:8px}.duel-rules-summary{font-size:9px;padding:8px 10px}.duration-inputs input{width:65px;font-size:17px;min-height:34px}.duration-presets{gap:4px}.duration-presets button{font-size:8px;padding:7px}.duel-clock-settings{gap:12px;padding:5px 0}.race-countdown{min-width:83px;padding:6px 9px}.race-countdown b{font-size:17px}.race-countdown .icon{width:14px;height:14px}.race-title{gap:10px}.race-title h1{font-size:17px}.race-title h1 span{font-size:7px}.race-live-rule{font-size:8px;line-height:1.5;padding:6px}.race-direct-piece>.race-needed-item{min-height:37px;padding:6px}.race-direct-actions{gap:5px;padding:5px}.race-direct-actions .race-add{min-height:33px;gap:4px}.race-direct-actions .race-add>span{font-size:13px}.race-direct-actions .race-add>small{font-size:7px}.race-direct-actions .race-add>.icon{width:11px;height:11px}.race-verdict b{font-size:13px}.race-verdict span{font-size:8px}.waiting-result h2{font-size:23px}.waiting-result p{font-size:13px}.waiting-result small{font-size:9px}.race-wait-icon{width:70px;height:70px;border-radius:22px}.race-wait-icon .icon{width:34px;height:34px}.race-win-metrics span{font-size:9px}}
@media(max-height:670px) and (orientation:landscape){.match-config{gap:7px;padding:18px}.match-config h2{font-size:23px;margin:0}.variant-option{padding:8px 10px}.variant-option b{font-size:11px}.variant-option small{font-size:9px}.duel-variants{gap:6px}.duel-clock-settings{padding:3px 0}.duration-inputs input{min-height:32px;font-size:17px;padding:5px}.duel-rules-summary{font-size:9px;line-height:1.6;padding:8px 10px}.match-config>#duel-pick{min-height:34px;font-size:10px}.match-config>p.duel-config-error{min-height:8px;font-size:8px}}
@media(max-height:470px) and (orientation:landscape){.match-config{padding:11px 14px;gap:5px}.match-config>.eyebrow{font-size:5px}.match-config h2{font-size:16px}.duel-variants{gap:4px}.variant-option{padding:5px 7px;gap:6px;border-radius:7px}.variant-option input{width:11px;height:11px;margin-top:1px}.variant-option>span{grid-template-columns:13px 1fr;gap:2px 5px}.variant-option .icon{width:12px;height:12px}.variant-option b{font-size:9px}.variant-option small{font-size:6px;line-height:1.4}.duel-clock-settings{gap:9px;padding:0}.duration-inputs{gap:5px}.duration-inputs label{font-size:6px;gap:2px}.duration-inputs input{width:48px;min-height:25px;font-size:13px;padding:3px;border-radius:6px}.duration-inputs>span{font-size:13px;padding-top:8px}.duration-presets{padding-top:8px;gap:4px}.duration-presets button{font-size:6px;padding:5px}.duel-rules-summary{font-size:6px;line-height:1.5;padding:5px 7px;border-radius:6px}.match-config>p.duel-config-error{font-size:6px;min-height:5px}.match-config>#duel-pick{min-height:25px;font-size:8px;padding:5px 8px}.race-countdown{min-width:66px;padding:4px 7px;gap:5px}.race-countdown b{font-size:13px}.race-countdown .icon{width:11px;height:11px}.race-title h1{font-size:13px}.race-title h1 span{display:none}.race-live-rule{font-size:6px;padding:4px;border-radius:5px}.race-direct-piece>.race-needed-item{min-height:29px;padding:4px}.race-needed-item>b .icon{width:7px;height:7px}.race-direct-actions{padding:4px;gap:4px}.race-direct-actions .race-add{min-height:25px;gap:3px}.race-direct-actions .race-add>span{font-size:10px}.race-direct-actions .race-add>small{font-size:6px}.race-direct-actions .race-add>.icon{width:9px;height:9px}.race-verdict{padding:6px;gap:3px}.race-verdict b{font-size:11px}.race-verdict span{font-size:6px}.race-player-win.waiting-result{padding:15px;gap:12px}.waiting-result h2{font-size:20px}.waiting-result p{font-size:10px}.waiting-result small{font-size:8px}.race-wait-icon{width:54px;height:54px;border-radius:16px}.race-wait-icon .icon{width:27px;height:27px}.race-win-metrics span{font-size:7px}}
@media(orientation:portrait) and (max-width:900px){.configurable-duel{grid-template-columns:1fr}.match-config{padding:23px;gap:12px}.match-config h2{font-size:25px}.variant-option{padding:12px;gap:9px}.variant-option b{font-size:12px}.variant-option small{font-size:9px}.duel-rules-summary{font-size:10px}.duel-clock-settings{gap:14px}.duration-inputs input{width:69px;min-height:40px;font-size:19px}.duration-presets button{font-size:8px}.race-title h1{font-size:17px}.race-title h1 span{font-size:7px}.race-countdown{min-width:76px;align-self:flex-start;padding:7px}.race-countdown b{font-size:17px}.race-title .btn{font-size:7px;padding:7px}.race-direct-piece>.race-needed-item{min-height:42px}.race-direct-actions .race-add{min-height:40px}.race-direct-actions .race-add>small{font-size:9px}.race-player-win.waiting-result h2{font-size:26px}.race-player-win.waiting-result p{font-size:15px}.race-win-metrics span{font-size:11px}}
