#home .card-go.d{grid-column:1/-1;min-height:135px}
#games .xwrap{gap:20px}#gameCatalogue{padding-bottom:12px}.mg-menu-lead{display:grid;grid-template-columns:1fr 1fr;gap:14px}.mg-random{background:linear-gradient(130deg,#fff2b1,#ffe0a1);border-color:#d8a040}.mg-menu-lead .xbtn{min-height:160px}
.mg-wrap{position:relative;z-index:1;flex:1;min-height:0;overflow:auto;width:min(900px,92vw);margin:0 auto;padding:12px 0 30px;display:flex;flex-direction:column;gap:16px}
.mg-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.mg-heading h2{font:900 clamp(26px,4vw,38px)/1.15 var(--title);color:var(--brand-d);margin:0}
#mgPrompt{font-size:clamp(20px,3vw,26px);font-weight:700;margin:0;text-align:center;line-height:1.4}.mg-stage{border:3px solid var(--line);border-radius:28px;background:#fff;padding:24px;display:flex;flex-direction:column;gap:22px;min-height:300px;justify-content:center}.mg-visual:empty{display:none}.mg-visual{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:18px}.mg-svg{display:block;width:clamp(130px,24vw,230px);max-height:240px}.mg-equation{font-size:clamp(30px,6vw,54px);font-weight:900;color:#24563e;text-align:center}.mg-response{display:flex;flex-direction:column;gap:20px;align-items:center}.mg-choices{display:flex;gap:12px;justify-content:center;flex-wrap:wrap;width:100%}.mg-option{border:3px solid #c6dfbd;background:#f6fbef;padding:16px 20px;min-width:100px;min-height:64px;border-radius:18px;box-shadow:0 4px 0 #c6dfbd;font-size:22px;font-weight:800}.mg-option.right{background:#d6f3d5;border-color:#2d9846}.mg-option.wrong{background:#fff1de;border-color:#df9b40}.mg-option:focus-visible,.mg-number-grid button:focus-visible{outline:4px solid var(--ink)}.mg-choices.illustrated .mg-svg{width:100px;height:100px}.mg-choices.illustrated .mg-option{padding:10px}
.mg-number-form{display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap}.mg-number-form label{font-weight:700;font-size:18px}.mg-number-form input{font:900 30px var(--font);color:#24563e;width:130px;min-height:62px;border:3px solid var(--brand);border-radius:14px;text-align:center;background:#fcfff9;user-select:text;-webkit-user-select:text}.mg-feedback{min-height:54px;text-align:center;font-size:19px;line-height:1.4;font-weight:700;margin:0;color:#526748}.mg-feedback.good{color:#1d7933}.mg-feedback.retry{color:#97570e}.mg-actions{display:flex;justify-content:center;gap:12px;flex-wrap:wrap}.mg-foot{font-size:14px;color:#61705d;text-align:center;margin:0}
.mg-coins{display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;max-width:650px}.mg-coin{width:55px;height:55px;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;background:linear-gradient(130deg,#f0f3f4,#c4cbd0);border:4px double #7a8790;color:#38454d;font-size:21px;font-weight:900;box-shadow:0 3px 0 #a7afb4}.mg-coin.copper{background:linear-gradient(130deg,#fbd5ae,#c3864c);border-color:#a36535;color:#613d20}.mg-stack{border-radius:12px;background:repeating-linear-gradient(0deg,#d7b087 0 4px,#ae7444 4px 6px);height:80px;width:68px;display:flex;align-items:center;justify-content:center;color:#382519;font-size:14px;font-weight:900;border:2px solid #ae7444;text-shadow:0 1px white}
.mg-dots{display:grid;grid-template-columns:repeat(5,14px);gap:7px;padding:10px;justify-content:center}.mg-dots i{width:14px;height:14px;background:#4c82b4;border-radius:50%}.mg-domino{display:flex;align-items:center;border:3px solid #8a9ab0;border-radius:16px;background:#fafcff;min-height:95px}.mg-domino>span{font-size:48px;width:85px;text-align:center;border-left:2px solid #8a9ab0}.mg-arrays{display:flex;flex-wrap:wrap;gap:10px;justify-content:center}.mg-arrays .mg-dots{border:2px solid #d2e4eb;border-radius:12px}.mg-hero{font-size:72px}.mg-triangle{display:grid;grid-template-columns:1fr 1fr;gap:20px;width:230px}.mg-triangle span{background:#fff1bd;border:3px solid #e6c269;border-radius:50%;width:75px;height:75px;display:grid;place-items:center;font-size:32px;font-weight:900}.mg-triangle span:first-child{grid-column:1/3;justify-self:center}.mg-triangle span:last-child{justify-self:end}.mg-machine{display:flex;align-items:center;gap:18px;font-size:38px;font-weight:900}.mg-machine b{background:#f5e5ff;padding:24px;border:3px solid #c7a0e2;border-radius:22px}.mg-sequence{display:flex;gap:10px;flex-wrap:wrap;justify-content:center}.mg-sequence span{border-radius:16px;border:3px solid #b4dbc9;background:#effbf7;min-width:65px;padding:12px;font-size:30px;font-weight:900}.mg-pattern{display:flex;gap:6px;align-items:center;justify-content:center;flex-wrap:wrap}.mg-pattern .mg-svg{width:60px;height:60px}.mg-pattern b{font-size:40px}
.mg-fraction-display,.mg-fraction-input{display:grid;grid-template-columns:repeat(var(--parts),1fr);width:min(380px,100%);height:140px;border:3px solid #508e73;overflow:hidden;border-radius:14px}.mg-fraction-display span,.mg-fraction-input button{border:1px solid #508e73;background:#fff}.mg-fraction-display .coloured,.mg-fraction-input button[aria-pressed=true]{background:#f9b34c}.mg-fraction-input.round{width:210px;height:210px;border-radius:50%;grid-template-columns:1fr 1fr}.mg-fraction-input.round:has(button:nth-child(3)){grid-template-rows:1fr 1fr}.mg-fraction-input button:focus-visible{outline:5px solid var(--ink);outline-offset:-6px}
.mg-number-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;width:min(440px,100%)}.mg-number-grid button{font-size:26px;font-weight:900;min-height:58px;border:3px solid #c6dfbd;border-radius:14px;background:#f6fbef}.mg-number-grid button[aria-pressed=true]{background:#fff0b2;border-color:#d3a12d}.mg-hundred{display:grid;grid-template-columns:repeat(10,1fr);gap:2px;width:min(480px,100%)}.mg-hundred span{display:flex;align-items:center;justify-content:center;aspect-ratio:1.2;border:1px solid #c5dbbd;border-radius:4px;font-size:clamp(12px,2.4vw,19px);font-weight:700}.mg-hundred .missing{background:#ffe49a;color:#614500;border:2px solid #d8a334}.mg-base{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;max-width:500px}.mg-ten{display:flex;flex-direction:column;gap:1px}.mg-ten i,.mg-units i{width:15px;height:15px;background:#e9bb55;border:1px solid #a37927}.mg-units{display:grid;grid-template-columns:repeat(3,15px);align-content:start;gap:4px}.mg-numberline{display:flex;flex-wrap:wrap;justify-content:center;gap:3px}.mg-numberline span{border-bottom:3px solid #c5dbbd;padding:6px;font-size:15px}.mg-numberline .price{background:#fff0b2;border-color:#d3a12d;border-radius:8px}
@media(max-width:600px){.mg-menu-lead{grid-template-columns:1fr}.mg-stage{padding:18px 12px;min-height:260px}.mg-wrap{gap:12px}.mg-option{font-size:18px;min-width:75px;padding:12px}.mg-heading{flex-wrap:wrap}.mg-choices.illustrated .mg-svg{width:75px;height:75px}.mg-sequence{gap:6px}.mg-sequence span{min-width:44px;padding:9px;font-size:23px}.mg-number-form label{width:100%;text-align:center}.mg-pattern .mg-svg{width:43px;height:43px}.mg-machine{font-size:30px;gap:12px}.mg-machine b{padding:18px}.mg-coin{width:46px;height:46px;font-size:17px}.mg-number-grid button{min-height:48px;font-size:22px}.mg-triangle{width:190px}}
/* Let large activities grow inside the scrolling area instead of shrinking their contents. */
.mg-wrap>*{flex-shrink:0}
#home .card-go.c{grid-column:1/-1;min-height:120px}

/* Distinguish cleared tiles and reveal a complete pair only when a hint is requested. */
.trail-cell.matched{background:#e9f1e5!important;color:#79a073;border:2px dashed #c9d9c3;box-shadow:none;opacity:.65;font-size:25px}
.trail-cell.hinted{outline:4px solid #d69a15;outline-offset:-6px;background:#ffe394}
/* Touch-first adventures: choose, celebrate, and move on. */
.mg-question{display:flex;align-items:center;justify-content:center;gap:14px}.mg-question #mgPrompt{flex:1}.mg-question .btn{flex-shrink:0;min-height:48px}.mg-stage{position:relative;overflow:hidden;background:radial-gradient(circle at 5% 10%,#fff2ba 0,transparent 35%),radial-gradient(circle at 100% 100%,#dff3ff 0,transparent 40%),#fffdf5;border-color:#acd8c5}.mg-buddy{width:100px;align-self:center}.mg-buddy .mg-svg{width:100%;height:85px}.mg-visual{gap:10px}.mg-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));max-width:640px}.mg-option{min-width:0;min-height:78px;cursor:pointer;touch-action:manipulation;color:#24563e;transition:transform .15s,background .15s;overflow-wrap:anywhere}.mg-option:nth-child(4n+2){background:#edf4ff;border-color:#bfd5ed;box-shadow:0 4px 0 #bfd5ed}.mg-option:nth-child(4n+3){background:#fff1db;border-color:#ebd0a2;box-shadow:0 4px 0 #ebd0a2}.mg-option:nth-child(4n+4){background:#f5edff;border-color:#d9c5ef;box-shadow:0 4px 0 #d9c5ef}.mg-option:active{transform:translateY(3px)}.mg-option.wrong,.mg-number-grid button.wrong{background:#ffe1e4;border-color:#d53d55;box-shadow:0 4px 0 #b92b42;color:#a01831}.mg-option.right,.mg-number-grid button.right{background:#d6f3d5;border-color:#2d9846;box-shadow:0 4px 0 #2d9846;color:#17632a}.mg-feedback.retry{color:#ae2942}.mg-option:disabled{opacity:1}.mg-choices.illustrated .mg-svg{margin:auto}.mg-choices .mg-fraction-display{height:95px;width:100%;min-width:100px}.mg-star-track{color:#b47708;letter-spacing:7px;font-size:32px;line-height:1.4}.mg-foot{line-height:1.6}.mg-stage.celebrate:after{content:'⭐ ✨ ⭐ ✨ ⭐';position:absolute;inset:0;display:grid;place-items:center;pointer-events:none;font-size:clamp(28px,5vw,52px);background:#ffffff33;animation:mg-reward 1.2s both}.celebrate .mg-buddy{animation:mg-hop .5s 2}@keyframes mg-reward{0%{opacity:0;transform:translateY(60px) scale(.5)}30%{opacity:1}100%{opacity:0;transform:translateY(-130px) scale(1.2)}}@keyframes mg-hop{50%{transform:translateY(-12px) rotate(8deg)}}@media(max-width:600px){.mg-question{flex-wrap:wrap}.mg-question #mgPrompt{flex-basis:100%}.mg-buddy{width:75px}.mg-buddy .mg-svg{height:65px}.mg-stage{gap:16px}.mg-option{font-size:22px;min-height:72px}.mg-choices{gap:12px}}@media(prefers-reduced-motion:reduce){.mg-stage.celebrate:after,.celebrate .mg-buddy{animation:none}.mg-option{transition:none}}
#mgHint[hidden]{display:none}.mg-choices.illustrated .mg-option>span{display:block;margin-top:8px;font-size:17px}.mg-option .mg-fraction-display span{display:block;margin:0}.mg-buddy .mg-svg{overflow:visible}
.mg-menu-lead{grid-template-columns:1fr}.mg-menu-lead .mg-random{min-height:240px;align-items:center;text-align:center;background:linear-gradient(130deg,#ffdf70,#ffb66d);border:3px solid #d88d28;box-shadow:0 8px 0 #dca146}.mg-random .xt{font-size:clamp(42px,7vw,64px)}.mg-random .xf{font-size:48px}.mg-practice{margin-top:28px;border-top:2px solid var(--line);padding-top:22px}.mg-practice summary{font-size:21px;font-weight:800;color:#416b44;cursor:pointer;min-height:50px;padding:10px}.mg-practice>p{color:#61705d}.mg-practice #openTrails{margin:12px 0 22px;max-width:460px}.mg-dots{display:flex;flex-wrap:wrap;gap:10px;align-items:center}.mg-die{display:grid;grid-template-columns:repeat(3,12px);grid-template-rows:repeat(3,12px);gap:5px;background:#fff;border:2px solid #7198b9;border-radius:12px;padding:9px;box-shadow:0 3px 0 #cedeea}.mg-dots .mg-die i{width:12px;height:12px;background:#346e9c;border-radius:50%}.mg-dots .mg-die .blank{visibility:hidden}.mg-arrays .mg-dots{background:#eff6fb}.mg-domino .mg-dots{max-width:180px}
