.game-fraction{display:inline-flex;flex-direction:column;vertical-align:middle;text-align:center;font-size:.9em;line-height:1.2;margin:0 .15em}.game-fraction>span:first-child{border-bottom:1.5px solid currentColor;padding:0 .15em}.game-fraction>span:last-child{padding:.08em .15em 0}#question{font-family:system-ui,sans-serif!important;font-weight:650!important;font-size:clamp(1.15rem,3.6vw,1.65rem)!important;line-height:1.65!important;text-wrap:pretty}#answers button{font-family:system-ui,sans-serif!important;line-height:1.6!important}#question sup,#answers sup{font-size:.7em;line-height:0}.game-learning-tools{display:flex;gap:10px;flex-wrap:wrap;margin:16px 0}.game-learning-tools button{flex:1 1 140px;margin:0!important;font-size:1rem!important;min-height:48px!important;padding:12px!important}.game-support-text{background:#edf8f4;border-radius:16px;padding:16px;text-align:left;line-height:1.7;font-family:system-ui,sans-serif;font-size:1rem}.game-support-text h3,.game-support-text h4{font-size:1.1rem;margin:0 0 10px}.game-support-text p{margin:10px 0}.game-support-text li{margin-bottom:10px}.game-support-text a{text-decoration:underline;color:#176b73}.game-worksheet[hidden],.game-support-text[hidden]{display:none!important}.game-worksheet{position:fixed!important;inset:0!important;transform:none!important;margin:8px auto!important;width:calc(100vw - 16px)!important;max-width:1100px!important;height:calc(100dvh - 16px)!important;z-index:20;box-sizing:border-box;max-height:calc(100dvh - 16px);overflow-y:auto;overscroll-behavior:contain;background:#fffdf5;color:#183f50;border:2px solid #c2dcd7;border-radius:24px;padding:clamp(14px,3vw,28px);font-family:system-ui,sans-serif;text-align:left;touch-action:pan-y}.working-top{display:flex;align-items:center;justify-content:space-between;gap:12px}.working-top h2{font-size:1.3rem!important;margin:0!important}.working-top button{width:auto!important;margin:0!important;min-width:100px}.working-question{position:sticky;top:-14px;background:#e7f5ff;border-radius:12px;padding:14px;line-height:1.7;z-index:1;font-size:1.15rem}.working-tools{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.working-tools button{width:auto!important;min-height:44px!important;margin:0!important;padding:10px 14px!important;font-size:1rem!important}.working-tools button[aria-pressed=true]{background:#d9f2e7;border:2px solid #187e78}.game-worksheet canvas{display:block;width:100%;height:clamp(260px,48dvh,480px);background-color:white;background-image:linear-gradient(#dce8ec 1px,transparent 1px),linear-gradient(90deg,#dce8ec 1px,transparent 1px);background-size:24px 24px;border:1px solid #bed6df;border-radius:12px;touch-action:none;user-select:none;-webkit-user-select:none}.game-worksheet textarea{display:block;width:100%;box-sizing:border-box;min-height:100px;font:18px/1.5 system-ui;padding:12px;border:1px solid #bed6df;border-radius:12px;background:white;color:#183f50;user-select:text;-webkit-user-select:text}.game-worksheet label{display:block;margin:14px 0 6px}.game-worksheet .working-note{font-size:.9rem;line-height:1.5}body.game-working-open{overflow:hidden}
@media print{body.game-working-open *{visibility:hidden!important}body.game-working-open .game-worksheet,body.game-working-open .game-worksheet *{visibility:visible!important}body.game-working-open .game-worksheet{position:fixed;inset:0;max-height:none;overflow:visible;border:0;border-radius:0;padding:16px;background:white}body.game-working-open .working-tools,body.game-working-open #closeWorksheet,body.game-working-open .working-note{display:none!important}body.game-working-open .working-question{position:static}body.game-working-open .game-worksheet canvas{height:360px}body.game-working-open .game-worksheet textarea{height:180px}}

.game-worksheet::backdrop{background:#183f5088;backdrop-filter:blur(4px)}

/* A swipe scrolls by default; only the selected drawing tools capture it. */
@media screen{
 .game-worksheet{height:calc(100vh - 16px)!important;height:calc(100dvh - 16px)!important;max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch;scroll-padding-block:90px 24px;padding-bottom:max(24px,env(safe-area-inset-bottom))}
 .game-worksheet .working-top{position:sticky;top:0;z-index:3;flex-wrap:wrap;padding:10px 0;background:#fffdf5;border-bottom:1px solid #dce8ec}
 .game-worksheet .working-top h2{flex:1 1 120px;font-size:1.1rem!important}
 .game-worksheet .working-top button{flex:0 1 auto;min-width:0;min-height:44px;padding:9px 12px!important;font-size:.9rem!important;line-height:1.3}
 .game-worksheet #workingScroll[aria-pressed=true]{background:#d9f2e7;border:2px solid #187e78}
 .game-worksheet .working-question{position:static;font-size:1rem;line-height:1.6;margin:14px 0}
 .game-worksheet canvas{height:clamp(180px,34dvh,360px);flex-shrink:0}
 .game-worksheet.worksheet-scroll-mode canvas{touch-action:pan-y;cursor:grab}
 .game-worksheet textarea{max-width:100%;touch-action:pan-y}
}
@media print{.game-worksheet #workingScroll{display:none!important}}


.kg-challenge-prompt{white-space:normal!important;line-height:1.5}.kg-challenge-lesson{display:block;font-size:.85rem;color:#596b7d;margin:6px 0}.kg-challenge-pictures{display:flex;flex-wrap:wrap;justify-content:center;gap:7px;margin:14px auto;max-width:550px}.kg-question-listen{display:block!important;margin:12px auto!important;border:2px solid #a7c9e7!important;border-radius:18px!important;padding:10px 22px!important;background:#edf7ff!important;color:#29475b!important;min-height:48px;font:inherit}.kg-challenge-answers{display:flex!important;flex-wrap:wrap;justify-content:center;gap:12px!important}.kg-challenge-choice{display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-width:90px;min-height:100px;font-size:1.2rem!important;max-width:45%;overflow-wrap:anywhere}.kg-challenge-choice .kg-art,.kg-challenge-pictures .kg-art{display:block;background-repeat:no-repeat;width:85px;height:85px;flex:none;border-radius:12px}.kg-challenge-pictures .kg-art{width:55px;height:55px}.kg-challenge-shape{width:85px;height:85px}.kg-challenge-icon{font-size:44px;line-height:1.2}.kg-challenge-pictures .kg-challenge-icon{font-size:35px}.kg-challenge-shadow{filter:brightness(0)}.kg-challenge-choice .kg-calendar{display:flex;flex-direction:column;font-size:.7rem;padding:8px;border:2px solid #aaa;border-radius:10px}.kg-challenge-choice .kg-calendar strong{font-size:1rem}.kg-challenge-choice .kg-shape-art{width:85px;height:85px}.kg-challenge-choice .kg-art-pair{display:flex;width:85px;height:85px}.kg-challenge-choice .kg-art-pair .kg-art{width:50%;height:50%}.kg-shop .product .price,.kg-shop #takings,.kg-shop #bankRecord,.kg-shop #stepBill,.kg-shop #stepChange{display:none!important}.kg-shop #shoppingList{font-size:1.3rem}.kg-shop .product{min-height:130px}@media(max-width:480px){.kg-challenge-choice{min-width:75px;padding:10px!important;font-size:1rem!important}.kg-challenge-choice .kg-art,.kg-challenge-shape{width:70px;height:70px}.kg-challenge-pictures .kg-art{width:45px;height:45px}}
/* The same cheerful picture-card palette follows KG into every adventure. */
dialog:has(.kg-challenge-prompt){border:4px solid #a78acd!important;border-radius:30px!important;background:linear-gradient(125deg,#fff4c9,#e6f8ef 60%,#f3e5ff)!important;color:#254553!important;box-shadow:0 10px 0 #8569aa55,0 25px 70px #183f5040!important}.kg-challenge-prompt{background:#fffdf3;border:3px solid #e4c987;border-radius:22px;padding:16px!important;color:#254553!important}.kg-challenge-choice:nth-child(4n+1):not(.correct):not(.wrong){background:#fff0b8!important;border:3px solid #e7bb60!important;box-shadow:0 5px 0 #d8bc83}.kg-challenge-choice:nth-child(4n+2):not(.correct):not(.wrong){background:#d9f6eb!important;border:3px solid #79c7ad!important;box-shadow:0 5px 0 #a1cdb9}.kg-challenge-choice:nth-child(4n+3):not(.correct):not(.wrong){background:#ffe1ed!important;border:3px solid #e1a1bd!important;box-shadow:0 5px 0 #d7aec3}.kg-challenge-choice:nth-child(4n):not(.correct):not(.wrong){background:#e2eaff!important;border:3px solid #9ab5e5!important;box-shadow:0 5px 0 #a6b7d5}.kg-challenge-choice{color:#254553!important;border-radius:22px!important}.kg-question-listen{background:#e4f4ff!important;border-color:#87b7d7!important}.kg-shop .product:nth-child(4n+1){background:#fff0c3}.kg-shop .product:nth-child(4n+2){background:#e4f8ec}.kg-shop .product:nth-child(4n+3){background:#fce2ed}.kg-shop .product:nth-child(4n){background:#e2eaff}
