:root{--orange:#ff690b;--blue:#03a9f4;--ink:#222;--icon:42px;color-scheme:light;font-family:Arial,Helvetica,sans-serif;background:white;color:var(--ink)}
*{box-sizing:border-box}body{margin:0}button,select,input{font:inherit}button,a,select,input[type=color]{cursor:pointer}button{border:0}button:disabled{cursor:default;opacity:.35}button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible{outline:3px solid #237de0;outline-offset:4px}button img{width:100%;height:100%;object-fit:contain;pointer-events:none}img{-webkit-user-drag:none;user-select:none}button{touch-action:manipulation;-webkit-tap-highlight-color:transparent}button[aria-pressed=true]:not(.plain):not(.palette-object){outline:2px solid var(--orange);outline-offset:4px}.plain{padding:0;background:transparent}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}[hidden]{display:none!important}
#app{height:100vh;height:100dvh;min-height:340px;display:flex;flex-direction:column;padding:12px 14px;gap:12px;width:100%;margin:auto}
header{display:grid;grid-template-columns:110px 1fr 30px;align-items:start;gap:20px;min-height:100px;flex-shrink:0}.logo{width:110px;height:100px;object-fit:contain}#menu{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:18px;padding:12px 0}.icon{width:var(--icon);height:var(--icon);border-radius:7px;background:var(--orange);padding:7px;color:#fff;flex-shrink:0;position:relative}.icon.plain{padding:0;background:transparent}.icon svg{width:100%;height:100%;stroke:white;stroke-width:2;fill:none}.icon.reset{margin-right:14px}.exit{color:var(--orange);font-size:44px;line-height:1;text-decoration:none;margin-top:8px}.category-wrap{position:relative}#category{width:60px;height:60px}#category-preview{width:60px;height:60px;display:block;margin:auto}#category .chevron{position:absolute;width:20px;height:12px;bottom:-8px;left:50%;transform:translateX(-50%);stroke:#333;stroke-width:3;fill:none}.cover-icon{background:var(--blue);padding:0}.cover-icon span{display:block;width:100%;height:100%}.range-label{visibility:hidden;flex-shrink:0}.computer-mode .range-label{visibility:visible}select{background:var(--orange);color:white;border:0;border-radius:6px;height:42px;padding:0 9px;font-weight:bold}.popover{position:absolute;top:62px;left:0;z-index:100;background:white;padding:12px;border:1px solid #ddd;box-shadow:0 6px 22px #0002;border-radius:12px;display:grid;grid-template-columns:repeat(4,50px);gap:8px}.category-option{width:50px;height:50px;background:white;padding:5px;border-radius:7px}.category-option[aria-pressed=true]{outline:2px solid var(--orange)}
#workspace{position:relative;flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr);gap:24px;width:94%;align-self:center}#stage{position:relative;min-width:0;min-height:0;border:2px solid #686868;border-radius:25px;background:#fff;overflow:visible;touch-action:none}#items{position:absolute;inset:0;pointer-events:none;overflow:hidden;border-radius:23px}.computer-mode #workspace{grid-template-columns:minmax(0,1fr) 175px}.object{position:absolute;width:var(--object-size,50px);height:var(--object-size,50px);padding:0;border:0;background:transparent;pointer-events:auto;touch-action:none;user-select:none;cursor:grab;z-index:2}.object:active{cursor:grabbing}.shape{width:100%;height:100%;display:block;object-fit:contain;pointer-events:none}.dot{border-radius:50%;background:linear-gradient(135deg,var(--c1),var(--c2));width:80%;height:80%;margin:10%}.tint{background:var(--tint);mask:var(--mask) center/contain no-repeat;-webkit-mask:var(--mask) center/contain no-repeat}.object.dragging{z-index:10;filter:drop-shadow(0 3px 3px #0003)}#quantity{position:absolute;right:25px;top:14px;font-size:clamp(32px,5vw,65px);font-weight:bold;pointer-events:none;z-index:3}#quantity .tens{color:#e11}#trash{position:absolute;bottom:14px;right:15px;left:auto;width:60px;height:82px;z-index:1}#trash svg{width:100%;height:100%;overflow:visible;pointer-events:none}#trash .lid{transform-origin:62px 25px;transition:transform .2s ease}#trash.active .lid{transform:rotate(35deg)}#trash.active{color:var(--orange)}#challenge{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;min-width:0;padding:10px 5px 18px;position:relative}#target-block{text-align:center;position:absolute;top:clamp(5px,7vh,70px);left:50%;transform:translateX(-50%)}#target-block>img{display:block;width:140px;height:38px;object-fit:contain}#target{display:block;font-size:clamp(46px,7vh,75px);color:#00aa55;font-weight:bold;margin-top:16px}.check-block{width:170px;flex-shrink:0}#score{display:flex;align-items:center;justify-content:center;gap:10px;border:2px solid #ffab00;border-radius:10px;width:112px;height:42px;font-size:27px;font-weight:bold;margin:0 auto 38px;font-variant-numeric:tabular-nums}#correct{color:green}#wrong{color:red}.slash{color:#333}.check-actions{position:relative;width:170px;height:62px;display:flex;align-items:center;justify-content:space-between}#check{width:60px;height:60px;mix-blend-mode:multiply}#next{width:80px;height:60px}#start-hand{position:absolute;left:106px;top:-48px;font-size:38px;opacity:1;transition:opacity .45s;pointer-events:none;animation:point 1.4s ease-in-out infinite}.assigned #start-hand{opacity:0}.waiting #next img{animation:arrow-pulse 1.7s ease-in-out infinite}footer{min-height:58px;display:flex;justify-content:flex-start;flex-shrink:0}#palette{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding-left:25px}.palette-object{width:52px;height:52px;background:white;border-radius:50%;padding:3px;border:3px solid transparent;touch-action:none}.palette-object[aria-pressed=true]{border-color:#e32626;outline:none}.palette-object:not([aria-pressed=true]){opacity:.65}.drag-ghost{position:fixed;pointer-events:none;width:50px;height:50px;z-index:500}
#drawing{background:transparent;position:absolute;inset:0;width:100%;height:100%;z-index:20;touch-action:none;cursor:crosshair}.board-open #drawing{z-index:35}.board-open:not(.board-select) .cover{pointer-events:none}#covers{position:absolute;inset:0;pointer-events:none;z-index:30}.cover{position:absolute;background:#03a9f4;border:1px solid white;pointer-events:auto;touch-action:none;cursor:move;box-shadow:0 1px 3px #0001}#text-entry{position:absolute;z-index:40;min-width:100px;min-height:45px;width:200px;max-width:95%;padding:3px;border:1px dashed #777;background:#ffffffea;font:24px Arial;resize:both;outline:none}#board-tools{position:fixed;bottom:18px;left:50%;transform:translateX(-50%);z-index:80;display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:7px;padding:10px;background:#fff;box-shadow:0 3px 18px #0003;border-radius:12px;max-width:calc(100vw - 20px);width:max-content}.tool{background:#00b9ce;color:white;border-radius:50%;width:36px;height:36px;padding:0;font-size:26px;line-height:36px}.tool svg{width:22px;height:22px;vertical-align:middle;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.tool.selected{background:var(--orange)}#board-tools .tool[aria-pressed=true]{outline:none}#board-tools [data-tool=delete]{background:#ff1717}.grip{display:flex;align-items:center;justify-content:center;background:white;color:#bbb;cursor:move;touch-action:none;width:16px;font-size:0}.grip::after{content:"";display:block;width:3px;height:24px;border-radius:2px;background:currentColor;margin:0}.color-tool{position:relative;flex-shrink:0;width:36px;height:36px}
#ink{display:flex;align-items:center;justify-content:center;width:100%;height:100%;padding:0;border-radius:50%;background:#00b9ce}
#ink>span{display:block;width:17px;height:17px;border-radius:50%;background:var(--chosen-ink,#e91818)}
#ink[aria-expanded=true]{outline:3px solid #84bcff;outline-offset:1px}
#ink-palette{position:absolute;bottom:calc(100% + 12px);left:50%;transform:translateX(-50%);display:flex;gap:5px;padding:11px;border:2px solid var(--orange);border-radius:28px;background:#fff;z-index:1}
#ink-palette button{width:20px;height:20px;padding:0;border-radius:50%;flex-shrink:0}
.board-open #menu>button:not(#whiteboard-toggle),.board-open .category-wrap,.board-open .range-label{opacity:.25;pointer-events:none}.board-open #palette{opacity:.25;pointer-events:none}.board-open #challenge{opacity:.25;pointer-events:none}.board-open #whiteboard-toggle{outline:3px solid #ffb88c;outline-offset:4px}.board-open footer{visibility:hidden}#feedback{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);z-index:200;pointer-events:none}#feedback img{width:180px;max-width:55vw;height:auto;display:block}#feedback.last img{width:270px}.feedback-animation{animation:feedback var(--duration,1800ms) ease both}
@keyframes feedback{0%{opacity:0;transform:translate(-50%,-50%) scale(.25)}25%,78%{opacity:1;transform:translate(-50%,-50%) scale(1)}100%{opacity:0;transform:translate(-50%,-50%) scale(1.06)}}@keyframes point{0%,100%{transform:translateY(-5px)}50%{transform:translateY(5px)}}@keyframes arrow-pulse{0%,100%{opacity:.4}50%{opacity:1}}
@media(max-width:1000px){:root{--icon:38px}#app{gap:10px;padding:10px 14px}header{grid-template-columns:78px 1fr 25px;gap:10px;min-height:78px}.logo{width:78px;height:78px}#category,#category-preview{width:50px;height:50px}#menu{gap:13px;padding-top:7px}.icon.reset{margin-right:8px}select{height:38px}#workspace{gap:15px}.computer-mode #workspace{grid-template-columns:minmax(0,1fr) 155px}#challenge{padding:0 0 15px}#score{margin-bottom:32px}#target-block{top:20px}#trash{width:45px;height:60px}#palette{padding-left:10px}.palette-object{width:45px;height:45px}footer{min-height:45px}#stage{border-radius:20px}}
@media(max-width:600px){:root{--icon:34px}#app{padding:8px;gap:8px}header{grid-template-columns:55px 1fr 22px;min-height:90px;gap:7px}.logo{width:55px;height:60px}#menu{gap:10px 12px;padding:0 4px;justify-content:center}.icon.reset{margin-right:3px}#category,#category-preview{width:42px;height:42px}#category .chevron{width:17px;height:10px;bottom:-7px}.range-label select{height:34px;width:63px;font-size:14px;padding:0 4px}.exit{font-size:34px;margin:0}.popover{left:-50px;top:48px;grid-template-columns:repeat(4,43px);gap:4px;padding:8px}.category-option{width:43px;height:43px}#workspace,.computer-mode #workspace{grid-template-columns:minmax(0,1fr);gap:0;width:100%}#challenge{position:absolute;bottom:8px;right:8px;z-index:5;width:130px;padding:0;gap:10px;pointer-events:none}#target-block{position:static;transform:none;margin:0;background:#fffffff2;border-radius:8px}#target-block>img{width:95px;height:24px}#target{font-size:40px;margin:0}.check-block{width:125px;background:#fffffff0;border-radius:10px;padding:4px}#score{font-size:23px;width:92px;height:34px;margin:0 auto 30px}.check-actions{width:117px;height:45px}#check{width:45px;height:45px;pointer-events:auto}#check:disabled{pointer-events:none}#next{width:60px;height:45px;pointer-events:auto}#start-hand{left:75px;top:-35px;font-size:28px}#quantity{font-size:34px;right:15px;top:10px}#trash{width:35px;height:48px;bottom:10px;right:10px;left:auto}.computer-mode #trash{bottom:165px}.palette-object{width:37px;height:37px;padding:2px;border-width:2px}#palette{gap:3px;padding:0;justify-content:center;width:100%}footer{min-height:40px}#board-tools{bottom:10px;gap:6px;padding:8px;width:calc(100% - 20px)}.tool{width:32px;height:32px;line-height:32px;font-size:24px}.color-tool{width:32px;height:32px}.grip{display:none}#feedback img{width:150px}.board-open #challenge{pointer-events:none}.board-open #challenge button{pointer-events:none}}
@media(max-height:500px) and (min-width:601px){#app{padding-top:6px;gap:6px}header{min-height:50px;grid-template-columns:62px 1fr 22px}.logo{width:60px;height:50px}#menu{padding:0;gap:12px}#target-block{top:0}#target{font-size:45px;margin:0}#target-block>img{height:25px}#challenge{padding-bottom:4px}#score{height:34px;font-size:24px;margin-bottom:28px}footer{min-height:38px}.palette-object{width:38px;height:38px}#board-tools{bottom:8px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
