.ml-jogo{--roxo:#2b1660;--papel:#fff8e7;--ouro:#ffc93c;--rosa:#ff4f8b;
  margin:16px auto;
  width:min(460px,100%,max(300px,calc((100vh - 32px) * 5 / 7)));
  width:min(460px,100%,max(300px,calc((100dvh - 32px) * 5 / 7)));
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;color:var(--papel);line-height:1.4;
  -webkit-user-select:none;user-select:none;box-sizing:border-box}
.ml-jogo *,.ml-jogo *::before,.ml-jogo *::after{box-sizing:border-box}

.ml-jogo .ml-palco{position:relative;width:100%;aspect-ratio:5/7;border-radius:18px;overflow:hidden;
  background:linear-gradient(165deg,#4a1fb8 0%,#8a2be2 50%,#e0408a 100%);box-shadow:0 10px 30px rgba(43,22,96,.35);
  display:flex;flex-direction:column;padding:14px}

.ml-jogo .ml-topo{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:2px 4px 10px}
.ml-jogo .ml-dado{display:flex;flex-direction:column;line-height:1.1}
.ml-jogo .ml-dado:last-child{align-items:flex-end}
.ml-jogo .ml-dado span{font-size:12px;opacity:.8}
.ml-jogo .ml-dado b{font-size:22px;font-weight:800;font-variant-numeric:tabular-nums}
.ml-jogo .ml-nivel{font-size:13px;font-weight:700;background:rgba(255,255,255,.16);padding:5px 12px;border-radius:999px}

.ml-jogo .ml-quadro{position:relative;flex:1 1 auto;min-height:0}
.ml-jogo .ml-quadro canvas{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:block;touch-action:none;cursor:pointer}

.ml-jogo .ml-barra{display:flex;gap:8px;justify-content:center;padding-top:12px}
.ml-jogo .ml-barra button{font-size:14px;padding:8px 14px;background:rgba(255,255,255,.16);color:var(--papel);box-shadow:none}
.ml-jogo .ml-barra button[aria-pressed="true"]{background:var(--papel);color:var(--roxo)}
.ml-jogo .ml-barra button:active{transform:none}

.ml-jogo .ml-tela{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;
  text-align:center;padding:22px;background:rgba(43,22,96,.88);overflow-y:auto;transition:opacity .25s,visibility .25s}
.ml-jogo .ml-tela.ml-oculta{opacity:0;visibility:hidden;pointer-events:none}

.ml-jogo h2,.ml-jogo h3{font-family:Georgia,"Times New Roman",serif;font-weight:700;color:var(--papel);text-transform:none;
  letter-spacing:-.5px;line-height:1;margin:0 0 10px;padding:0;border:0;background:none}
.ml-jogo h2{font-size:clamp(28px,8vw,40px);transform:rotate(-3deg)}
.ml-jogo h3{font-size:28px}
.ml-jogo [data-tela="fim"] h2{font-size:30px}
.ml-jogo p{margin:5px 0;font-size:15px;line-height:1.45;max-width:32ch;color:#f1e6ff}

.ml-jogo .ml-marca{background:#fff;border-radius:12px;padding:8px 14px;margin-bottom:16px;display:inline-flex;align-items:center;
  color:var(--roxo);font-weight:800;font-size:17px}
.ml-jogo .ml-marca img{display:block;max-height:40px;max-width:200px;width:auto;height:auto;margin:0}

.ml-jogo button{font:inherit;font-weight:700;font-size:17px;line-height:1.2;margin:0;padding:12px 26px;border:0;border-radius:999px;cursor:pointer;
  background:var(--ouro);color:var(--roxo);box-shadow:0 5px 0 #c9951a;text-transform:none;letter-spacing:normal;transition:transform .08s,box-shadow .08s}
.ml-jogo button:active{transform:translateY(4px);box-shadow:0 1px 0 #c9951a}
.ml-jogo button:focus-visible,.ml-jogo canvas:focus-visible{outline:3px solid var(--papel);outline-offset:3px}
.ml-jogo button:disabled{opacity:.6;cursor:wait}

.ml-jogo .ml-niveis{display:flex;gap:8px;width:100%;max-width:340px;margin:14px 0 10px}
.ml-jogo .ml-niveis button{flex:1;padding:10px 4px;font-size:16px;display:flex;flex-direction:column;align-items:center;border-radius:14px}
.ml-jogo .ml-niveis small{font-size:12px;font-weight:600;opacity:.8;margin-top:2px}
.ml-jogo .ml-niveis [data-nivel="facil"]{background:#3ddc97;box-shadow:0 5px 0 #23935f}
.ml-jogo .ml-niveis [data-nivel="normal"]{background:#38b6ff;box-shadow:0 5px 0 #1a7bb3}
.ml-jogo .ml-niveis [data-nivel="dificil"]{background:var(--rosa);color:#fff;box-shadow:0 5px 0 #a8265a}
.ml-jogo .ml-niveis button:active{box-shadow:none}

.ml-jogo .ml-link{background:none;box-shadow:none;color:var(--papel);text-decoration:underline;text-underline-offset:3px;font-size:15px;padding:8px 12px}
.ml-jogo .ml-link:active{transform:none;box-shadow:none}
.ml-jogo .ml-dica{font-size:12px;opacity:.8}

.ml-jogo .ml-abas{display:flex;gap:6px;margin:6px 0 14px}
.ml-jogo .ml-abas button{background:rgba(255,255,255,.14);color:var(--papel);box-shadow:none;font-size:14px;padding:7px 14px}
.ml-jogo .ml-abas button[aria-selected="true"]{background:var(--papel);color:var(--roxo)}

.ml-jogo ol.ml-lista{list-style:none;margin:0 0 6px;padding:0;width:100%;max-width:320px;text-align:left}
.ml-jogo .ml-lista li{display:flex;align-items:center;gap:10px;margin:0;padding:6px 10px;border-radius:8px;font-size:15px;color:var(--papel)}
.ml-jogo .ml-lista li:nth-child(odd){background:rgba(255,255,255,.08)}
.ml-jogo .ml-lista .ml-pos{width:24px;font-weight:800;color:var(--ouro);text-align:right}
.ml-jogo .ml-lista .ml-nome{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ml-jogo .ml-lista small{font-size:12px;opacity:.7}
.ml-jogo .ml-lista b{font-variant-numeric:tabular-nums}
.ml-jogo .ml-lista li.ml-eu{background:var(--ouro);color:var(--roxo)}
.ml-jogo .ml-lista li.ml-eu .ml-pos{color:var(--roxo)}
.ml-jogo .ml-lista li.ml-vazio{justify-content:center;opacity:.8;background:none}

.ml-jogo .ml-form{width:100%;max-width:320px;margin:8px 0 10px}
.ml-jogo .ml-form[hidden]{display:none}
.ml-jogo .ml-form label{display:block;font-size:14px;margin-bottom:6px;color:var(--ouro);font-weight:700}
.ml-jogo .ml-linha{display:flex;gap:6px}
.ml-jogo .ml-form input,.ml-jogo .ml-form input[type="text"]{
  display:block!important;flex:1 1 auto!important;width:auto!important;min-width:0!important;max-width:none!important;height:auto!important;
  margin:0!important;padding:10px 12px!important;font:inherit!important;font-size:16px!important;line-height:1.3!important;
  border:2px solid #fff8e7!important;border-radius:10px!important;background:#fff8e7!important;color:#2b1660!important;
  -webkit-text-fill-color:#2b1660!important;box-shadow:none!important;opacity:1!important;visibility:visible!important;
  -webkit-appearance:none!important;appearance:none!important;text-align:left!important}
.ml-jogo .ml-form input::placeholder{color:#7a6aa3!important;-webkit-text-fill-color:#7a6aa3!important;opacity:1!important}
.ml-jogo .ml-form input:focus{border-color:#ffc93c!important;outline:none!important}
.ml-jogo .ml-form button{font-size:15px;padding:10px 16px;border-radius:10px;box-shadow:0 3px 0 #c9951a}
.ml-jogo .ml-msg{font-size:13px;min-height:1.2em;color:#ffd0e2;margin:6px 0 0;max-width:none}

.ml-jogo .ml-grande{font-family:Georgia,serif;font-size:52px;font-weight:700;line-height:1;color:var(--ouro);margin:2px 0 6px;font-variant-numeric:tabular-nums}
.ml-jogo .ml-acoes{display:flex;gap:10px;align-items:center;margin-top:10px}

@media (prefers-reduced-motion:reduce){.ml-jogo .ml-tela,.ml-jogo button{transition:none}}

.ml-jogo ol.ml-lista[hidden]{display:none}
.ml-jogo .ml-lista li.ml-vazio{text-align:center;line-height:1.35}
