/* Scoped to games: original mechanics and state stay untouched. */
#minigameModal {justify-content:center;padding:12px;box-sizing:border-box;--mg-accent:#bca5ff}
#mgScrim{background:rgba(12,9,31,.82);backdrop-filter:blur(9px)}
#mgSheet{box-sizing:border-box;max-width:560px;width:100%;min-height:0;max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);padding:22px 18px 22px;border-radius:28px;border:1px solid #7463a2;background:radial-gradient(ellipse at 92% 0%,#514183 0%,transparent 47%),linear-gradient(155deg,#25194d,#33205d 65%,#40276d);box-shadow:0 24px 80px #100a2d99;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;color:#fff}
#mgSheet .mgTitle{font-size:clamp(17px,4.8vw,23px);line-height:1.23;padding:0 42px 0 4px;text-align:left;margin:2px 0 5px;font-weight:900;letter-spacing:-.35px}
#mgSheet .mgSubtitle{text-align:left;font-size:12px;color:#d4c9ee;margin:0 0 16px;padding-left:4px;letter-spacing:.5px;font-weight:700}
#mgSheet .mgClose{top:16px;right:15px;width:44px;height:44px;padding:0;display:grid;place-items:center;background:#ffffff13;border:1px solid #ffffff30;border-radius:14px;color:#fff;box-shadow:none}
#mgSheet .mgProgress{height:8px;background:#ffffff18;margin:0 4px 18px;border:1px solid #ffffff15;overflow:hidden;border-radius:99px}
#mgProgressBar{background:linear-gradient(90deg,#ad8dff,#f8d86c)!important;box-shadow:0 0 12px #cbaaff80}
#mgBody{position:relative;min-width:0;animation:mgEnter .25s ease-out}
@keyframes mgEnter{from{opacity:.5;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
#mgBody button,#mgReward button{min-height:44px;transition:transform .15s,box-shadow .15s;box-sizing:border-box;touch-action:manipulation;line-height:1.25}
#mgBody button:not(:disabled):active{transform:translateY(2px)}
#mgBody button:focus-visible,#mgSheet .mgClose:focus-visible{outline:3px solid #ffe49a;outline-offset:3px}
#mgBody button:disabled{cursor:default}
#mgBody #ordenarSlots,#mgBody .numSlots{display:flex;gap:7px!important;flex-wrap:wrap;justify-content:center;background:#130f2d38;border:1px solid #ffffff20;border-radius:20px;padding:12px 8px;margin:14px 0 20px!important;min-height:0}
#mgBody [id^=oSlot_],#mgBody .numSlot{width:clamp(42px,12vw,64px)!important;height:60px!important;background:#ffffff0d;border-radius:13px!important;border:2px dashed #a99bc8!important;box-sizing:border-box;font-variant-numeric:tabular-nums;color:white;font-weight:900}
#mgBody .numSlot.correct-slot{background:#287a60;border-color:#8ce0b9!important}#mgBody .numSlot.wrong-slot{background:#883d58;border-color:#ffa6b5!important}
#mgBody #ordenarBtns,#mgBody .numOptions,#mgBody #completarBtns,#mgBody .letterOptions{gap:9px!important;flex-wrap:wrap}
#mgBody #ordenarBtns button,#mgBody .numChip{width:clamp(48px,14vw,70px)!important;height:64px!important;border-radius:16px!important;background:linear-gradient(155deg,#ffe49c,#f3b84f)!important;color:#3c2545!important;border:1px solid #ffedb2!important;box-shadow:0 4px 0 #9c662c,0 8px 14px #140c2b55!important;font-size:clamp(21px,6vw,30px)!important}
#mgBody #completarBtns button,#mgBody .letterChip{min-width:0!important;width:clamp(46px,13vw,68px)!important;height:62px!important;border-radius:16px!important;background:linear-gradient(150deg,#ba8cf7,#985bce)!important;color:#fff!important;border:1px solid #d9b8ff!important;box-shadow:0 4px 0 #59358d,0 8px 14px #140c2b55!important;font-size:27px!important}
#mgBody .wordDisplay{font-size:clamp(24px,8vw,44px);letter-spacing:3px;overflow-wrap:anywhere;padding:12px 6px;border-radius:18px;background:#130f2d38;border:1px solid #ffffff20;margin:12px 0;line-height:1.65}
#mgBody #lacunaBox{color:#fff;box-sizing:border-box}#mgBody .mg-word-art{display:grid;place-items:center;width:112px;height:112px;border-radius:30px;background:radial-gradient(circle,#ffffff25,#ffffff08);border:1px solid #ffffff20;margin:4px auto 12px!important;font-size:72px!important;line-height:1!important}
#mgBody .mg-word-art img{width:94px;height:94px;object-fit:contain;filter:drop-shadow(0 7px 9px #10082055)}
#mgBody .mg-arithmetic{width:min(100%,330px);padding:14px 12px 16px;background:#17122e80;border:1px solid #ffffff24;border-radius:22px;margin:auto;box-sizing:border-box;font-variant-numeric:tabular-nums}
#mgBody .mg-math-row{display:grid;grid-template-columns:repeat(var(--cols),minmax(0,1fr));gap:5px;align-items:center;text-align:center;font-weight:900;margin:3px 0}
#mgBody .mg-math-row span{font-size:clamp(22px,8vw,34px);line-height:1.27;min-width:0}#mgBody .mg-math-head span{font-size:10px;letter-spacing:.4px;color:#d1c1ec;background:#ffffff0a;border-radius:6px;padding:4px 0}#mgBody .mg-math-first{color:#ffe394}#mgBody .mg-math-second{color:#92e5bf}#mgBody .mg-math-op{color:#ffe394}
#mgBody #armeSlots{display:grid!important;grid-template-columns:repeat(var(--cols),minmax(0,1fr));gap:5px!important;border-top:1px solid #b3a4d1;padding-top:10px;margin-top:8px}
#mgBody [id^=aSlot_]{width:auto!important;height:43px!important;min-width:0;box-sizing:border-box;border-radius:10px!important;background:#ffffff13;border:2px dashed #ac9dce;font-size:25px!important}
#mgBody #armeDigits{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr));gap:7px!important;max-width:360px;margin:0 auto}
#mgBody #armeDigits button{width:100%!important;height:48px!important;min-width:0;background:linear-gradient(155deg,#62518e,#4b3a77)!important;border:1px solid #9b85c8!important;border-radius:13px!important;box-shadow:0 3px 0 #241842;color:#fff!important}#mgBody #armeDigits button:last-child{background:#793f65!important;border-color:#bf79a0!important}
#mgBody .sceneCanvas,#mgBody .cidadeCanvas{height:clamp(145px,39vw,215px);isolation:isolate;border:1px solid #ffffff40;border-radius:20px;box-shadow:0 6px 18px #140c2b40;box-sizing:border-box}
#mgBody .sceneCanvas:before,#mgBody .cidadeCanvas:before{content:"";position:absolute;inset:0;background-image:var(--mg-scene);background-position:center;background-size:cover;z-index:-1;transition:filter .6s}
#mgBody .sceneCanvas:has(.sceneAnimal.sad):before{filter:saturate(.4) brightness(.65)}
#mgBody .sceneAnimal{z-index:1;bottom:12px;font-size:52px;filter:drop-shadow(0 5px 5px #14291c66)}#mgBody .sceneAnimal img{height:70px;width:70px;object-fit:contain}
#mgBody .mg-scene-label{position:absolute;top:10px;left:10px;background:#172f45c9;border:1px solid #ffffff55;color:#fff;padding:6px 10px;border-radius:10px;font-size:12px;font-weight:900;z-index:1;max-width:90%}
#mgBody .cidadeCanvas>.mg-scene-label{left:10px;transform:none}#mgBody .cidadeCanvas .cidadeBuilding{display:none}
#mgBody .acaoCard{background:#ffffff0b;border:1px solid #ffffff24;border-radius:18px;padding:12px 10px;margin:12px 0}#mgBody .acaoEmoji{font-size:30px}#mgBody .acaoTexto{font-size:16px;line-height:1.4}
#mgBody .planetBtns{gap:10px;grid-template-columns:1fr 1fr}#mgBody .planetBtn{padding:13px 9px;font-size:14px;min-height:60px;border:1px solid #ffffff36;border-radius:16px;box-shadow:0 4px 0 #17112855}#mgBody .planetBtnBoa{background:linear-gradient(150deg,#268b66,#176248)}#mgBody .planetBtnRuim{background:linear-gradient(150deg,#d65c71,#a83b55)}
#mgBody .poluicaoBar{background:#ffffff17;border:1px solid #ffffff18;height:9px;border-radius:99px;overflow:hidden}#mgBody .fonteBtn,#mgBody button[onclick="cofrinhoProximo()"]{width:100%;min-width:0;border:1px solid #ffe49c!important;border-radius:16px!important;background:linear-gradient(150deg,#ffe69b,#eeb150)!important;color:#38254a!important;box-shadow:0 4px 0 #94602e!important;font-weight:900}
#mgBody .cofBtn{border:1px solid #ffffff30;border-radius:14px;box-shadow:0 3px 0 #100b2833;min-height:48px}#mgBody .mg-lesson{background:#ffffff0c!important;border:1px solid #ffffff25;padding:16px!important;border-radius:18px!important;line-height:1.65!important}#mgBody .mg-lesson-title{font-size:20px!important;color:#ffe39a!important}#mgBody .mg-lesson-icon{width:76px;height:76px;display:grid;place-items:center;background:#ffffff13;border-radius:22px;margin:0 auto 10px;font-size:42px!important}
#mgBody .feedbackPlanet:empty,#mgBody [id$=Feedback]:empty,#mgBody #feedbackCof:empty,#mgBody #feedbackCidade:empty{min-height:0!important;padding:0!important;margin:0!important}
#mgSheet .mgReward{background:#ffffff0a;border:1px solid #ffffff20;border-radius:20px;padding:12px;margin-top:12px}#mgBody #confeteZone{background:radial-gradient(ellipse,#7856a74d,transparent);border-radius:20px}
button[onclick^="abrirMinigame("]{position:relative;isolation:isolate;border:1px solid #ffffff55!important;box-shadow:0 4px 0 #20163a88,0 8px 16px #1c10452a!important;border-radius:18px!important;overflow:hidden;min-width:0}button[onclick^="abrirMinigame("]>div:first-child{font-size:27px!important;line-height:1.2;margin-bottom:4px;filter:drop-shadow(0 3px 3px #0002)}
@media(max-width:350px){#mgSheet{padding:18px 12px}#mgBody #armeDigits{gap:5px!important}#mgBody .planetBtn{font-size:12px}}
@media(orientation:landscape) and (max-height:550px){#mgSheet{max-width:680px;padding:12px 20px;max-height:calc(100dvh - 16px)}#mgSheet .mgSubtitle{margin-bottom:8px}#mgSheet .mgProgress{margin-bottom:10px}#mgBody .sceneCanvas,#mgBody .cidadeCanvas{height:130px}}
@media(prefers-reduced-motion:reduce){#mgBody,#mgBody *{animation-duration:.01ms!important;transition-duration:.01ms!important}}

#mgBody #ordenarOpcoes button{width:clamp(48px,14vw,70px)!important;height:64px!important;border-radius:16px!important;background:linear-gradient(155deg,#ffe49c,#f3b84f)!important;color:#3c2545!important;border:1px solid #ffedb2!important;box-shadow:0 4px 0 #9c662c!important;font-size:clamp(21px,6vw,30px)!important}
#mgBody button[onclick^="responderCompletar("]{border:1px solid #d9b8ff!important;background:linear-gradient(150deg,#ba8cf7,#985bce)!important;color:#fff!important;box-shadow:0 4px 0 #59358d!important}
#mgBody .mg-energy-art{position:absolute;bottom:12px;left:12px;padding:5px 9px;border-radius:10px;background:#173f4bdc;color:white;font-weight:800;font-size:11px;z-index:2}
