/* Caixinha de Costura — the mini-game layer (ui/minigame-ui.js). A bright "game inside the game" look: a sewing-room
   scene behind, glossy panels with ribbon titles, chunky 3D buttons, a dark velvet tray for the board.
   Landscape first (the game runs lying down on phones). All shapes are CSS / canvas drawings of our own. */
.mg{--mgInk:#3a2340;--mgPink:#ef5d95;--mgPinkD:#c2306b;--mgPurple:#8a54d6;--mgPurpleD:#5b2fa3;--mgGold:#ffc93c;--mgGoldD:#e08d10;--mgGreen:#4fcf5c;--mgGreenD:#23913a;--mgCream:#fff8ef;
  position:fixed;inset:0;z-index:45;display:flex;flex-direction:column;font-family:Fredoka,var(--ui),system-ui,sans-serif;color:var(--mgInk);overflow:hidden;
  background:
    radial-gradient(ellipse at 50% 120%,rgba(58,35,64,.35),transparent 60%),
    linear-gradient(180deg,transparent 0 62%,rgba(0,0,0,.06) 62% 63%,transparent 63%),
    repeating-linear-gradient(90deg,#d79b6a 0 70px,#cf9160 70px 72px,#dca274 72px 140px) bottom/100% 38% no-repeat,
    radial-gradient(circle at 12px 12px,rgba(255,255,255,.55) 3px,transparent 4px) 0 0/34px 34px,
    linear-gradient(180deg,#f7c6dc 0%,#f2b2d0 55%,#e9a3c4 62%);
  padding:max(8px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));box-sizing:border-box}
.mg[hidden]{display:none}
/* floating sewing bits in the scene */
.mg::before,.mg::after{content:"";position:absolute;pointer-events:none;border-radius:50%;opacity:.55}
.mg::before{width:120px;height:120px;left:-30px;bottom:18%;background:radial-gradient(circle at 38% 38%,#fff 0 6px,transparent 7px),radial-gradient(circle at 62% 38%,#fff 0 6px,transparent 7px),radial-gradient(circle at 38% 62%,#fff 0 6px,transparent 7px),radial-gradient(circle at 62% 62%,#fff 0 6px,transparent 7px),radial-gradient(circle,#8fd3ff 0 55%,#5aa9e6 56% 64%,transparent 65%)}
.mg::after{width:90px;height:90px;right:-20px;top:22%;background:radial-gradient(circle at 40% 40%,#fff 0 5px,transparent 6px),radial-gradient(circle at 60% 40%,#fff 0 5px,transparent 6px),radial-gradient(circle at 40% 60%,#fff 0 5px,transparent 6px),radial-gradient(circle at 60% 60%,#fff 0 5px,transparent 6px),radial-gradient(circle,#ffd36b 0 55%,#e9a92c 56% 64%,transparent 65%)}
body.mg-on .toolbar,body.mg-on .hud{visibility:hidden}
body.mg-on .toast{bottom:auto;top:calc(var(--st,0px) + 60px)}
body.mg-on .back{z-index:55}   /* the video window opens above the mini-game */

/* ---------- top bar: lives, FC, close ---------- */
.mg-top{position:relative;z-index:2;display:flex;align-items:center;gap:10px;flex:0 0 auto;margin-bottom:6px}
.mg-pill{display:flex;align-items:center;height:34px;padding:0 14px 0 34px;margin-left:16px;border-radius:999px;background:linear-gradient(#5b3b7a,#3a2350);border:2.5px solid #fff;color:#fff;font:700 16px/1 Fredoka,var(--ui),sans-serif;box-shadow:0 3px 0 rgba(58,35,64,.35);position:relative;white-space:nowrap}
.mg-pill .mg-pic{position:absolute;left:-18px;top:50%;transform:translateY(-50%);width:44px;height:44px;display:grid;place-items:center;filter:drop-shadow(0 2px 0 rgba(58,35,64,.35))}
.mg-pill .mg-pic svg{width:100%;height:100%}
.mg-pill .mg-pic b{position:absolute;inset:0;display:grid;place-items:center;font:800 17px/1 Fredoka,sans-serif;color:#fff;text-shadow:0 1px 0 #7a1030;padding-bottom:3px}
.mg-pill small{font-size:12px;opacity:.85;margin-right:4px}
.mg-pill .fcg{width:30px;height:30px;font-size:11px;margin:0}
.mg-x{margin-left:auto;width:46px;height:46px;border-radius:50%;border:3px solid #fff;background:radial-gradient(circle at 35% 30%,#ff7b7b,#e02929 60%,#a3121a);color:#fff;font:900 26px/1 Fredoka,sans-serif;cursor:pointer;box-shadow:0 4px 0 rgba(58,35,64,.35),inset 0 -3px 0 rgba(0,0,0,.18);text-shadow:0 2px 0 rgba(0,0,0,.25);flex:0 0 auto}
.mg-x:active{transform:translateY(2px);box-shadow:0 2px 0 rgba(58,35,64,.35)}
.mg-lifebox{display:flex;align-items:center;gap:8px}
.mg-title{flex:1;justify-content:center;display:flex;align-items:center;gap:8px;margin-left:8px}
.mg-title b{font:700 22px/1 Fredoka,sans-serif;color:#fff;-webkit-text-stroke:5px var(--mgPinkD);paint-order:stroke fill;letter-spacing:.5px;text-shadow:0 3px 0 rgba(58,35,64,.25)}
.mg-main{position:relative;z-index:1;flex:1 1 auto;min-height:0;display:flex}

/* ---------- glossy panels with ribbon titles ---------- */
.mg-panel{position:relative;border-radius:22px;padding:30px 14px 14px;box-sizing:border-box;border:3px solid #fff;
  box-shadow:0 6px 0 rgba(58,35,64,.3),inset 0 2px 0 rgba(255,255,255,.6),inset 0 -5px 0 rgba(0,0,0,.12);min-height:0}
.mg-panel.blue{background:linear-gradient(#7fd0ff,#3e9ee8 55%,#2f84d1)}
.mg-panel.purple{background:linear-gradient(#c99cf5,#9a63e2 55%,#7c46c9)}
.mg-panel.cream{background:linear-gradient(#fffaf2,#fde9d2)}
.mg-panel.pink{background:linear-gradient(#ffb7d3,#f27aac 55%,#e05a94)}
.mg-ribbon{position:absolute;left:50%;top:-18px;transform:translateX(-50%);min-width:60%;max-width:94%;text-align:center;padding:7px 22px 9px;white-space:nowrap;
  font:700 20px/1 Fredoka,sans-serif;color:#fff;-webkit-text-stroke:4px rgba(120,40,10,.55);paint-order:stroke fill;border-radius:12px 12px 16px 16px;
  background:linear-gradient(#ffb347,#ff8a1f 60%,#f06c0c);border:3px solid #fff;box-shadow:0 4px 0 rgba(58,35,64,.28);box-sizing:border-box;overflow:hidden;text-overflow:ellipsis}
.mg-ribbon.pink{background:linear-gradient(#ff8fbd,#ef5d95 60%,#d8417c);-webkit-text-stroke-color:rgba(120,10,50,.55)}
.mg-ribbon.purple{background:linear-gradient(#b98cf0,#8a54d6 60%,#7140c2);-webkit-text-stroke-color:rgba(50,10,90,.55);font-size:16px}
.mg-inset{background:rgba(25,40,110,.38);border-radius:16px;box-shadow:inset 0 3px 6px rgba(0,0,0,.25);padding:10px}
.mg-panel.purple .mg-inset{background:rgba(60,20,110,.35)}
.mg-panel.pink .mg-inset{background:rgba(120,20,70,.28)}
.mg-muted{color:rgba(255,255,255,.9);font:500 13px/1.3 Fredoka,sans-serif;margin:8px 0 0;text-align:center}
.mg-panel.cream .mg-muted{color:#8a7590}

/* chunky 3D buttons */
.mg-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;border:3px solid #fff;border-radius:18px;padding:10px 26px 12px;font:700 22px/1 Fredoka,sans-serif;color:#fff;cursor:pointer;
  -webkit-text-stroke:4px rgba(0,0,0,.18);paint-order:stroke fill;text-shadow:0 2px 0 rgba(0,0,0,.18);box-shadow:0 5px 0 rgba(58,35,64,.35),inset 0 -5px 0 rgba(0,0,0,.16),inset 0 3px 0 rgba(255,255,255,.4);
  background:linear-gradient(#7be86f,var(--mgGreen) 55%,var(--mgGreenD));transition:transform .08s}
.mg-btn:active{transform:translateY(3px);box-shadow:0 2px 0 rgba(58,35,64,.35),inset 0 -3px 0 rgba(0,0,0,.16)}
.mg-btn:disabled{filter:grayscale(.85);opacity:.75;cursor:default;transform:none}
.mg-btn.violet{background:linear-gradient(#bb8cf5,var(--mgPurple) 55%,var(--mgPurpleD))}
.mg-btn.gold{background:linear-gradient(#ffe07a,var(--mgGold) 55%,var(--mgGoldD));color:#fff}
.mg-btn.plain{background:linear-gradient(#fff,#efe3f0);color:var(--mgInk);-webkit-text-stroke:0;text-shadow:none;border-color:#d9c7de}
.mg-btn.small{font-size:16px;padding:8px 16px 10px;border-radius:14px}
.mg-btn .fcg{width:28px;height:28px;font-size:10px;margin:0 8px 0 0;vertical-align:0;flex:none;-webkit-text-stroke:0;text-shadow:none}
.mg-btn .mg-play-ic{display:inline-block;width:0;height:0;border-left:14px solid #fff;border-top:9px solid transparent;border-bottom:9px solid transparent;margin-right:8px;vertical-align:-1px;filter:drop-shadow(0 1px 0 rgba(0,0,0,.25))}

/* ---------- home ---------- */
.mg-home{flex:1;display:grid;grid-template-columns:minmax(0,.95fr) minmax(0,1.25fr) minmax(0,.95fr);gap:18px;align-items:stretch;padding:22px 6px 6px;min-height:0}
.mg-level{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;text-align:center}
.mg-level .mg-inset{width:100%;box-sizing:border-box;display:flex;flex-direction:column;gap:8px;align-items:center}
.mg-goalrow{display:flex;justify-content:center;gap:14px;flex-wrap:wrap}
.mg-gi{display:flex;flex-direction:column;align-items:center;gap:2px;color:#fff;font:700 18px/1 Fredoka,sans-serif;-webkit-text-stroke:3px rgba(0,0,0,.25);paint-order:stroke fill}
.mg-gi canvas{filter:drop-shadow(0 3px 0 rgba(0,0,0,.2))}
.mg-gi.score{font-size:22px}
.mg-goal{color:#fff;font:600 15px/1.25 Fredoka,sans-serif;margin:0;text-shadow:0 1px 0 rgba(0,0,0,.25)}
.mg-chips{display:flex;gap:6px;justify-content:center;flex-wrap:wrap}
.mg-chip{display:inline-flex;align-items:center;gap:5px;padding:4px 10px;border-radius:999px;background:linear-gradient(#fff,#f2e8ff);border:2px solid rgba(58,35,64,.15);font:700 14px/1 Fredoka,sans-serif;color:var(--mgPurpleD)}
.mg-chip.gold{color:#9a5a00;background:linear-gradient(#fff6d6,#ffe39a)}
.mg-chip i{font-style:normal}
.mg-playbtn{font-size:28px;padding:12px 56px 15px;margin-top:4px}
.mg-wait{font:600 13px/1.2 Fredoka,sans-serif;color:#fff;margin:0;background:rgba(160,20,40,.55);padding:5px 10px;border-radius:10px}
.mg-lines{font:500 12px/1.3 Fredoka,sans-serif;color:rgba(255,255,255,.92);margin:0;max-width:340px}
.mg-rank{display:flex;flex-direction:column}
.mg-rlist{overflow:auto;min-height:0;flex:1;display:flex;flex-direction:column;gap:6px;padding:2px}
.mg-rrow{display:flex;align-items:center;gap:8px;padding:5px 10px 5px 6px;border-radius:14px;background:linear-gradient(#fff,#f1e9ff);border:2px solid #fff;box-shadow:0 3px 0 rgba(58,35,64,.25);font:700 15px/1 Fredoka,sans-serif}
.mg-rrow.p1{background:linear-gradient(#fff4c2,#ffd65a)}
.mg-rrow.p2{background:linear-gradient(#f4f6fb,#cfd6e6)}
.mg-rrow.p3{background:linear-gradient(#ffe2cc,#f2b07c)}
.mg-rrow.me{background:linear-gradient(#e2ffd9,#9be58e);outline:3px solid #fff;box-shadow:0 3px 0 rgba(58,35,64,.25),0 0 0 5px rgba(79,207,92,.35)}
.mg-pos{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:var(--mgPurple);color:#fff;font:700 14px/1 Fredoka,sans-serif;border:2px solid #fff;flex:0 0 auto;box-shadow:0 2px 0 rgba(58,35,64,.25)}
.mg-rrow.p1 .mg-pos{background:#e9a10b}.mg-rrow.p2 .mg-pos{background:#8f9bb5}.mg-rrow.p3 .mg-pos{background:#c46a2a}.mg-rrow.me .mg-pos{background:var(--mgGreenD)}
.mg-rname{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mg-rlv{white-space:nowrap;color:var(--mgPurpleD)}
.mg-rgap{text-align:center;color:#fff;font-weight:700}
.mg-how{display:flex;flex-direction:column;gap:8px;justify-content:center}
.mg-howrow{display:flex;align-items:center;gap:10px;background:#fff;border-radius:14px;padding:6px 10px;box-shadow:0 2px 0 rgba(58,35,64,.15);font:500 13.5px/1.25 Fredoka,sans-serif}
.mg-howrow canvas{flex:0 0 auto}
.mg-howrow b{font-weight:700;color:var(--mgPinkD)}

/* ---------- playing ---------- */
.mg-play{flex:1;display:flex;gap:14px;min-height:0;align-items:stretch;justify-content:center}
.mg-side{flex:0 0 190px;display:flex;flex-direction:column;justify-content:center;gap:10px;min-height:0;padding-top:4px}
.mg-info{flex:0 1 auto;display:flex;flex-direction:column;align-items:center;gap:8px;padding:12px 10px}
.mg-moves{width:84px;height:84px;border-radius:50%;display:grid;place-items:center;background:radial-gradient(circle at 35% 30%,#fff,#e8f4ff 60%,#bfe0ff);border:4px solid #fff;box-shadow:0 4px 0 rgba(20,40,110,.35),inset 0 -4px 0 rgba(0,0,0,.08);flex:0 0 auto}
.mg-moves b{font:700 42px/1 Fredoka,sans-serif;color:#1d4fa0}
.mg-moves span{display:none}
.mg-moves.low{animation:mgPulse .9s infinite}
.mg-moves.low b{color:#d7263d}
@keyframes mgPulse{50%{transform:scale(1.08)}}
.mg-movelbl{color:#fff;font:700 13px/1 Fredoka,sans-serif;margin-top:-4px;text-shadow:0 1px 0 rgba(0,0,0,.25)}
.mg-goals{display:flex;flex-direction:column;gap:6px;width:100%}
.mg-grow{position:relative;display:flex;align-items:center;justify-content:center;gap:8px;background:rgba(15,40,110,.32);border-radius:14px;padding:4px 8px;color:#fff;font:700 22px/1 Fredoka,sans-serif;-webkit-text-stroke:3px rgba(0,0,0,.25);paint-order:stroke fill;box-shadow:inset 0 2px 4px rgba(0,0,0,.2)}
.mg-grow canvas{filter:drop-shadow(0 2px 0 rgba(0,0,0,.2))}
.mg-grow.done::after{content:"✓";position:absolute;right:8px;top:50%;transform:translateY(-50%);width:24px;height:24px;border-radius:50%;background:var(--mgGreen);border:2px solid #fff;display:grid;place-items:center;font:900 15px/1 Fredoka,sans-serif;-webkit-text-stroke:0}
.mg-grow.score{flex-direction:column;gap:4px;font-size:16px;padding:6px 8px}
.mg-grow.score small{font-size:12px;-webkit-text-stroke:2px rgba(0,0,0,.2)}
.mg-gbar{display:none}
.mg-score{width:100%;display:flex;flex-direction:column;gap:4px}
.mg-score .mg-sbar{position:relative;height:14px;border-radius:99px;background:rgba(15,40,110,.4);box-shadow:inset 0 2px 3px rgba(0,0,0,.3);overflow:visible}
.mg-score .mg-sbar i{position:absolute;left:0;top:0;bottom:0;border-radius:99px;background:linear-gradient(#ffe27a,#ffb703);width:var(--p);transition:width .3s}
.mg-score .mg-sbar em{position:absolute;top:50%;transform:translate(-50%,-50%);font-style:normal;font-size:18px;color:#d6d0e2;-webkit-text-stroke:1.5px #3a2340;line-height:1}
.mg-score .mg-sbar em.on{color:#ffd23f}
.mg-score .mg-sl{display:flex;justify-content:space-between;color:#fff;font:600 12px/1 Fredoka,sans-serif}
.mg-score .mg-sl b{font-size:14px}
.mg-stars{display:none}
.mg-lvtag{margin-top:auto;color:#fff;font:700 15px/1.1 Fredoka,sans-serif;text-align:center;-webkit-text-stroke:3px rgba(0,0,0,.2);paint-order:stroke fill}
.mg-lvtag b{display:block;font-size:26px}
.mg-quit{align-self:center}
.mg-boardbox{flex:1 1 auto;min-width:0;min-height:0;position:relative;display:flex;align-items:center;justify-content:center}
.mg-boardwrap{position:relative;line-height:0;padding:9px;border-radius:24px;background:linear-gradient(135deg,#ffd36b,#ff8fbd 50%,#a77cf0);box-shadow:0 7px 0 rgba(58,35,64,.35),0 0 0 3px #fff}
#mgCv{border-radius:16px;background:radial-gradient(circle at 50% 30%,#3a4a9a,#22306b 70%,#1b2659);display:block;touch-action:none}
.mg-play{position:relative}
.mg-over{position:absolute;inset:-4px;display:flex;align-items:center;justify-content:center;background:rgba(40,20,60,.55);border-radius:24px;line-height:normal;padding:22px 10px 10px;z-index:3}
.mg-over[hidden]{display:none}

/* ---------- pop-ups (win, lose, continue, leave) ---------- */
.mg-res{position:relative;width:min(360px,92%);text-align:center;padding:34px 18px 18px;animation:mgIn .35s cubic-bezier(.2,1.4,.4,1)}
@keyframes mgIn{from{transform:scale(.6);opacity:0}}
.mg-res .mg-ribbon{font-size:21px;min-width:80%}
.mg-sstars{display:flex;justify-content:center;gap:4px}
.mg-sstars em{font-style:normal;font-size:26px;line-height:1;color:#c9c0dc;-webkit-text-stroke:2px #fff;filter:drop-shadow(0 2px 0 rgba(20,40,110,.35))}
.mg-sstars em.on{color:#ffd23f}
.mg-rr{margin:4px 0 12px;color:#fff;font:600 16px/1.3 Fredoka,sans-serif;text-shadow:0 1px 0 rgba(0,0,0,.3)}
.mg-panel.cream .mg-rr{color:var(--mgInk);text-shadow:none}
.mg-bigstars{display:flex;justify-content:center;align-items:flex-end;gap:4px;margin:2px 0 8px}
.mg-bigstars i{font-style:normal;font-size:56px;line-height:1;color:#b9a9cf;-webkit-text-stroke:2.5px #fff;filter:drop-shadow(0 3px 0 rgba(58,35,64,.35));animation:mgStar .5s both;animation-delay:var(--d)}
.mg-bigstars i:nth-child(2){font-size:72px}
.mg-bigstars i.on{color:#ffd23f;filter:drop-shadow(0 3px 0 rgba(58,35,64,.35)) drop-shadow(0 0 10px rgba(255,220,90,.8))}
@keyframes mgStar{from{transform:scale(0) rotate(-60deg)}}
.mg-rbtns{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}
.mg-plus5{display:flex;align-items:center;justify-content:center;gap:10px;margin:0 0 12px}
.mg-plus5 b{font:700 46px/1 Fredoka,sans-serif;color:#fff;-webkit-text-stroke:6px var(--mgPinkD);paint-order:stroke fill}
.mg-plus5 span{font:700 18px/1.1 Fredoka,sans-serif;color:#fff;text-align:left;text-shadow:0 1px 0 rgba(0,0,0,.3)}
.mg-cont{display:flex;flex-direction:column;gap:10px;align-items:stretch}
.mg-cont .mg-btn{font-size:19px}
.mg-cont small{display:block;font:500 12px/1.2 Fredoka,sans-serif;color:#fff;opacity:.9;margin-top:-4px}
.mg-giveup{background:none;border:0;color:#fff;font:600 14px/1 Fredoka,sans-serif;text-decoration:underline;cursor:pointer;margin-top:4px;opacity:.9}

/* toolbar button */
#bMini .mg-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:#e0525f;margin-left:5px;vertical-align:middle}

/* small landscape screens (phones lying down) */
@media (max-height:540px){
  .mg-top{margin-bottom:2px}
  .mg-title b{font-size:17px;-webkit-text-stroke-width:4px}
  .mg-pill{height:28px;font-size:13px;padding:0 10px 0 28px;margin-left:14px}.mg-pill .mg-pic{width:36px;height:36px;left:-15px}.mg-pill .mg-pic b{font-size:14px}
  .mg-x{width:38px;height:38px;font-size:21px}
  .mg-home{gap:12px;padding-top:18px}
  .mg-panel{padding:24px 10px 10px;border-radius:18px}
  .mg-ribbon{font-size:16px;top:-15px;padding:5px 16px 7px}
  .mg-ribbon.purple{font-size:13px}
  .mg-playbtn{font-size:22px;padding:9px 40px 12px}
  .mg-goal{font-size:13px}
  .mg-howrow{font-size:12px;padding:4px 8px}
  .mg-rrow{font-size:13px;padding:3px 8px 3px 4px}.mg-pos{width:22px;height:22px;font-size:11px}
  .mg-side{flex-basis:150px;gap:6px}
  .mg-info{padding:8px 8px}
  .mg-moves{width:62px;height:62px}.mg-moves b{font-size:30px}
  .mg-grow{font-size:17px;padding:2px 6px}
  .mg-lvtag b{font-size:20px}
  .mg-btn.small{font-size:14px;padding:6px 12px 8px}
  .mg-boardwrap{padding:6px;border-radius:18px}#mgCv{border-radius:12px}
  .mg-res{padding:26px 14px 10px}.mg-res .mg-ribbon{font-size:17px}.mg-rr{font-size:14px;margin-bottom:8px}.mg-bigstars i{font-size:42px}.mg-bigstars i:nth-child(2){font-size:54px}
  .mg-cont{gap:6px}.mg-cont .mg-btn{font-size:16px;padding:7px 14px 9px}.mg-plus5{margin-bottom:6px}
  .mg-sstars em{font-size:20px}
  .mg-plus5 b{font-size:36px}
}
@media (orientation:portrait) and (max-width:700px) and (max-aspect-ratio:3/4){
  .mg-home{grid-template-columns:1fr;overflow:auto}
  .mg-play{flex-direction:column}
  .mg-side{flex:0 0 auto;flex-direction:row}
}
@media (prefers-reduced-motion:reduce){.mg-moves.low,.mg-bigstars i,.mg-res{animation:none}}

/* ---------- nível difícil (v147): every 5th level from 10 — deep red panels, a tag, a splash when it starts ---------- */
.mg-panel.hard{background:linear-gradient(#ff7a8a,#e2365a 55%,#b81f48)}
.mg-panel.hard .mg-inset{background:rgba(110,10,40,.38)}
.mg-ribbon.hard{background:linear-gradient(#a55be0,#7a2fc0 60%,#5f20a0);-webkit-text-stroke-color:rgba(40,0,70,.6)}
.mg-hardtag{display:block;width:max-content;margin:-4px auto 10px;padding:4px 14px 5px;border-radius:999px;background:#3a1030;border:2px solid #fff;
  color:#ffd3dc;font:700 14px/1 Fredoka,sans-serif;letter-spacing:.06em;text-transform:uppercase;box-shadow:0 3px 0 rgba(58,35,64,.3)}
.mg-lvtag i{display:block;width:max-content;margin:0 auto 4px;padding:3px 10px;border-radius:999px;background:#3a1030;border:2px solid #fff;
  font:700 12px/1 Fredoka,sans-serif;font-style:normal;letter-spacing:.06em;text-transform:uppercase;color:#ffd3dc;-webkit-text-stroke:0}
.mg-play.hard .mg-boardwrap{background:linear-gradient(135deg,#ff6b81,#c2185b 50%,#6a1b9a)}
.mg-play{position:relative}
.mg-hardsplash{position:absolute;inset:0;z-index:4;display:flex;align-items:center;justify-content:center;pointer-events:none;
  background:rgba(60,10,40,.45);border-radius:24px;animation:mgHardBg 2.2s ease forwards}
.mg-hardsplash>div{display:flex;flex-direction:column;align-items:center;gap:6px;padding:16px 34px 18px;border-radius:22px;border:4px solid #fff;
  background:linear-gradient(#ff7a8a,#e2365a 55%,#b81f48);box-shadow:0 7px 0 rgba(58,35,64,.4);animation:mgHardIn 2.2s cubic-bezier(.2,1.4,.4,1) forwards}
.mg-hardsplash b{font:700 34px/1 Fredoka,sans-serif;color:#fff;text-transform:uppercase;letter-spacing:.03em;-webkit-text-stroke:5px rgba(90,0,30,.55);paint-order:stroke fill}
.mg-hardsplash span{font:600 16px/1.1 Fredoka,sans-serif;color:#fff}
@keyframes mgHardIn{0%{transform:scale(.3) rotate(-6deg);opacity:0}18%{transform:scale(1.08) rotate(2deg);opacity:1}26%{transform:scale(1) rotate(0)}80%{transform:scale(1);opacity:1}100%{transform:scale(.9);opacity:0}}
@keyframes mgHardBg{0%{opacity:0}12%{opacity:1}80%{opacity:1}100%{opacity:0}}
@media (prefers-reduced-motion:reduce){.mg-hardsplash>div{animation:none}}
@media (max-height:500px){.mg-hardsplash b{font-size:26px}.mg-hardsplash span{font-size:14px}.mg-hardtag{font-size:12px;margin-bottom:6px}}

/* ---------- cartoon pass (v147): the same look as the rest of the game — ink outlines, solid ink drop shadows,
   ink text strokes, a light cushioned board ---------- */
.mg-panel{border:3px solid #fff;box-shadow:0 0 0 3px var(--mgInk),0 8px 0 3px var(--mgInk),inset 0 3px 0 rgba(255,255,255,.55),inset 0 -6px 0 rgba(0,0,0,.12)}
.mg-ribbon{border:3px solid var(--mgInk);-webkit-text-stroke:4px var(--mgInk);box-shadow:0 4px 0 var(--mgInk),inset 0 -4px 0 rgba(0,0,0,.14),inset 0 2px 0 rgba(255,255,255,.5)}
.mg-ribbon.pink,.mg-ribbon.purple,.mg-ribbon.hard{-webkit-text-stroke-color:var(--mgInk)}
.mg-title b{-webkit-text-stroke:5px var(--mgInk);text-shadow:0 3px 0 var(--mgInk)}
.mg-btn{border:3px solid var(--mgInk);-webkit-text-stroke:3px var(--mgInk);paint-order:stroke fill;text-shadow:none;
  box-shadow:0 5px 0 var(--mgInk),inset 0 -5px 0 rgba(0,0,0,.16),inset 0 3px 0 rgba(255,255,255,.5)}
.mg-btn:active{transform:translateY(4px);box-shadow:0 1px 0 var(--mgInk),inset 0 -3px 0 rgba(0,0,0,.16)}
.mg-btn.plain{border-color:var(--mgInk);-webkit-text-stroke:0}
.mg-x{border:3px solid var(--mgInk);box-shadow:0 4px 0 var(--mgInk),inset 0 2px 0 rgba(255,255,255,.5)}
.mg-pill{border:3px solid var(--mgInk);box-shadow:0 3px 0 var(--mgInk)}
.mg-chip{border:2.5px solid var(--mgInk);box-shadow:0 2px 0 var(--mgInk)}
.mg-rrow{border:2.5px solid var(--mgInk);box-shadow:0 3px 0 var(--mgInk)}
.mg-rrow.me{outline:none;box-shadow:0 3px 0 var(--mgInk),0 0 0 4px rgba(79,207,92,.45)}
.mg-pos{border:2px solid var(--mgInk)}
.mg-howrow{border:2.5px solid var(--mgInk);box-shadow:0 3px 0 var(--mgInk)}
.mg-inset{border:2.5px solid rgba(58,35,64,.55)}
.mg-gi,.mg-lvtag,.mg-grow{-webkit-text-stroke-color:var(--mgInk)}
.mg-goal,.mg-movelbl,.mg-rr{text-shadow:0 2px 0 var(--mgInk)}
.mg-moves{border:3px solid var(--mgInk)!important;box-shadow:0 4px 0 var(--mgInk),inset 0 -4px 0 rgba(30,80,160,.18)!important}
.mg-hardtag,.mg-lvtag i{border-color:var(--mgInk)}
.mg-boardwrap{background:linear-gradient(135deg,#ffd36b,#ff8fbd 50%,#a77cf0);border:3px solid var(--mgInk);box-shadow:0 8px 0 var(--mgInk),inset 0 2px 0 rgba(255,255,255,.55)}
#mgCv{background:linear-gradient(#b98ad6,#9466c0);box-shadow:inset 0 0 0 3px var(--mgInk)}
.mg-play.hard #mgCv{background:linear-gradient(#e9748f,#b8406a)}
.mg-res .mg-ribbon{-webkit-text-stroke-color:var(--mgInk)}
.mg-hardsplash>div{border:4px solid var(--mgInk);box-shadow:0 0 0 3px #fff inset,0 8px 0 var(--mgInk)}
.mg-hardsplash b{-webkit-text-stroke:6px var(--mgInk)}
.mg-plus5 b{-webkit-text-stroke-color:var(--mgInk)}
.mg-bigstars i{-webkit-text-stroke:3px var(--mgInk)}
.mg-sstars em{-webkit-text-stroke:2px var(--mgInk)}
/* v149: nothing from the shop shows over the mini-game (the "Ganhe agora" bubble, the furniture tip, "Jogo salvo") */
body.mg-on .adoffer,body.mg-on #hoverTip,body.mg-on #saved{display:none!important}
/* v149: how to play — the guided first move and the tips (ui/minigame-ui.js coachTip / howTo) */
.mg-coach-back{position:absolute;inset:-6px;z-index:5;background:rgba(40,20,60,.55);border-radius:24px}
.mg-lift{position:relative;z-index:6;animation:mgLift 1.4s ease-in-out infinite}
@keyframes mgLift{0%,100%{box-shadow:0 0 0 3px #fff,0 0 0 7px rgba(255,210,63,.95)}50%{box-shadow:0 0 0 3px #fff,0 0 0 12px rgba(255,210,63,.45)}}
.mg-boardwrap.mg-lift{animation:none}
.mg-coach{position:absolute;z-index:7;top:50%;transform:translateY(-50%);width:min(300px,42%);display:flex;flex-direction:column;align-items:center;gap:8px;padding:14px 14px 12px;border-radius:20px;
  background:#fff8ef;border:3px solid var(--mgInk);box-shadow:0 6px 0 rgba(58,35,64,.45);text-align:center;line-height:1.3;animation:mgCoachIn .35s cubic-bezier(.2,1.4,.4,1)}
.mg-coach.left{left:8px}
.mg-coach.right{right:8px}
.mg-coach-txt b{display:block;font-size:19px;color:var(--mgPinkD);margin-bottom:4px}
.mg-coach-txt p{margin:0;font:600 14px/1.35 Quicksand,var(--ui),sans-serif;color:var(--mgInk)}
.mg-coach-txt p b{display:inline;font-size:inherit;color:inherit;margin:0;font-family:Fredoka,sans-serif}
.mg-coach-pic{display:flex;gap:6px;justify-content:center}
@keyframes mgCoachIn{from{opacity:0;transform:translateY(-50%) scale(.85)}to{opacity:1;transform:translateY(-50%) scale(1)}}
.mg-howbtn{margin:8px auto 0;display:block}
.mg-howto{position:absolute;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;background:rgba(40,20,60,.55);padding:calc(var(--st,0px) + 30px) 12px 12px}
.mg-howbox{width:min(760px,100%);max-height:100%;display:flex;flex-direction:column;padding:30px 14px 14px;text-align:center}
.mg-howscroll{overflow:auto;min-height:0;display:flex;flex-direction:column;align-items:center}
.mg-howscroll .mg-hsteps{width:100%}
.mg-hsteps{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.mg-hstep{display:flex;flex-direction:column;align-items:center;gap:6px;padding:10px 8px;border-radius:16px;background:#fff;border:2px solid rgba(58,35,64,.18)}
.mg-hstep b{font-size:15px;color:var(--mgPinkD)}
.mg-hstep span{font:600 12.5px/1.35 Quicksand,var(--ui),sans-serif}
.mg-hpic{display:flex;align-items:center;justify-content:center;gap:4px;min-height:48px;position:relative}
.mg-hpic .mg-pic{width:44px;height:40px}
.mg-harrow{position:absolute;bottom:-6px;left:50%;transform:translateX(-50%);font-style:normal;font-weight:800;color:var(--mgPinkD)}
@media (max-width:700px),(max-height:520px){
  .mg-coach{width:min(250px,46%);padding:10px 10px 9px;gap:6px}.mg-coach-txt b{font-size:16px}.mg-coach-txt p{font-size:12px}
  .mg-hsteps{grid-template-columns:repeat(2,1fr);gap:6px}.mg-hstep{padding:6px 8px;gap:3px}.mg-hstep b{font-size:13.5px}.mg-hstep span{font-size:11px}
  .mg-howbox{padding:24px 10px 10px}.mg-hpic{min-height:34px}.mg-hpic canvas{width:30px!important;height:30px!important}.mg-hpic .mg-pic{width:34px;height:30px}
  .mg-howscroll .mg-muted{font-size:11px;margin:4px 0 6px!important}.mg-howscroll .mg-btn{font-size:16px;padding:6px 22px 8px}
}
@media (max-width:480px){   /* phone standing up: one card per row */
  .mg-hsteps{grid-template-columns:1fr}.mg-hstep{flex-direction:row;text-align:left;flex-wrap:wrap}.mg-hstep .mg-hpic{flex:0 0 auto}
}
@media (max-height:380px){   /* very short phones lying down: tighter guide so "Entendi" always fits */
  .mg-howto{padding-top:calc(var(--st,0px) + 22px)}
  .mg-howbox{padding:20px 8px 8px}.mg-hsteps{gap:5px}.mg-hstep{padding:4px 6px;gap:2px}
  .mg-hpic{min-height:26px}.mg-hpic canvas{width:24px!important;height:24px!important}.mg-hpic .mg-pic{width:28px;height:24px}
  .mg-hstep b{font-size:12.5px}.mg-hstep span{font-size:10.5px;line-height:1.25}
  .mg-howscroll .mg-muted{display:none}.mg-howscroll .mg-btn{margin-top:6px;font-size:15px;padding:5px 20px 7px}
}
