* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #2b1d12; color: #fff;
  font-family: "Baloo 2", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif; user-select: none; -webkit-user-select: none; touch-action: none; }
#tela { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
button { font: inherit; cursor: pointer; border: 0; color: #fff; }

/* ---------- telas ---------- */
.tela { position: fixed; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 18px; z-index: 10; padding: 20px; }
.tela.ativa { display: flex; animation: aparece .35s ease-out; }
@keyframes aparece { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }
#menu { background: #2b1d12 url(../assets/arte/titulo.jpg) center/cover; justify-content: space-between; padding: 4vh 20px 2vh; }
#menu::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 30%, rgba(0,0,0,0) 30%, rgba(20,10,0,.55)); pointer-events: none; }
.logo { position: relative; text-align: center; line-height: .85; animation: pulo 2.4s ease-in-out infinite; filter: drop-shadow(0 8px 0 rgba(0,0,0,.35)); }
@keyframes pulo { 50% { transform: translateY(-8px) rotate(-1deg); } }
.logo .l1 { font-size: clamp(44px, 9vw, 120px); font-weight: 900; color: #ffd23f; -webkit-text-stroke: 3px #5a2a0a; letter-spacing: 2px; transform: rotate(-3deg); }
.logo .l2 { font-size: clamp(54px, 11vw, 150px); font-weight: 900; color: #ff5a2a; -webkit-text-stroke: 4px #4a1505; }
.logo .l3 { margin-top: 10px; font-size: clamp(20px, 3vw, 36px); font-weight: 800; color: #b6ff7a; -webkit-text-stroke: 1.5px #1b4a0a; }
.menuBotoes { position: relative; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.tela button, .menuBotoes button { background: linear-gradient(#ffb53a, #f07d1a); border-radius: 16px; padding: 10px 26px; font-size: 22px; font-weight: 800;
  box-shadow: 0 5px 0 #8a3c06, 0 8px 18px rgba(0,0,0,.35); text-shadow: 0 2px 0 rgba(0,0,0,.3); transition: transform .08s; min-width: 240px; }
.tela button:active { transform: translateY(4px); box-shadow: 0 1px 0 #8a3c06; }
button.grande { font-size: 32px; padding: 12px 40px; background: linear-gradient(#8ee34b, #3fae1c); box-shadow: 0 6px 0 #1d5e08, 0 10px 20px rgba(0,0,0,.35); }
.rodape { position: relative; font-size: 14px; opacity: .85; text-shadow: 0 1px 2px #000; }
h2 { font-size: 34px; font-weight: 900; color: #ffd23f; -webkit-text-stroke: 1.5px #4a1f05; text-shadow: 0 3px 0 rgba(0,0,0,.3); }

#fases, #herois { background: radial-gradient(ellipse at top, #5a3a1c, #1d120a); justify-content: flex-start; overflow-y: auto; touch-action: pan-y; }
#grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; width: min(1100px, 100%); }
.fase { position: relative; background: linear-gradient(#6b4a2a, #3b2614); border-radius: 18px; padding: 10px; text-align: center; cursor: pointer; box-shadow: 0 5px 0 #24160b; transition: transform .12s; min-width: 0 !important; }
.fase:hover { transform: translateY(-4px) rotate(-1deg); }
.fase img.fab { width: 90px; height: 90px; object-fit: contain; display: block; margin: 0 auto; filter: drop-shadow(0 3px 2px rgba(0,0,0,.4)); }
.fase.limpa img.fab { filter: hue-rotate(70deg) saturate(1.3); }
.fase .num { position: absolute; top: 6px; left: 10px; font-size: 26px; font-weight: 900; color: #ffd23f; -webkit-text-stroke: 1px #3a1a05; }
.fase .nome { font-size: 15px; font-weight: 800; line-height: 1.1; min-height: 34px; }
.fase .lugar { font-size: 12px; opacity: .8; }
.fase .est { font-size: 22px; letter-spacing: 2px; color: #ffd23f; text-shadow: 0 2px 0 #5a2a0a; }
.fase .est .apagada { color: rgba(255,255,255,.2); text-shadow: none; }
.fase.trancada { filter: grayscale(1) brightness(.55); cursor: not-allowed; }
.fase.trancada::after { content: '🔒'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 44px; }
.fase .chefeTag { position: absolute; top: 6px; right: 8px; background: #8b1a1a; border-radius: 8px; padding: 0 6px; font-size: 12px; font-weight: 800; }
.voltar { background: linear-gradient(#999, #666) !important; box-shadow: 0 5px 0 #333 !important; min-width: 160px !important; }

#cartas, #cartasLanc { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; width: min(1100px, 100%); }
.carta { display: flex; gap: 10px; align-items: center; background: rgba(255,255,255,.08); border-radius: 16px; padding: 10px; border: 2px solid rgba(255,255,255,.12); }
.carta img, .carta svg { width: 76px; height: 76px; border-radius: 12px; flex: none; background: rgba(0,0,0,.25); object-fit: cover; }
.carta b { font-size: 18px; display: block; }
.carta i { font-style: normal; color: #ffd23f; font-weight: 800; font-size: 14px; display: block; }
.carta span { font-size: 13px; opacity: .9; line-height: 1.2; display: block; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#hud .topo { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
#faseNome { font-size: 20px; font-weight: 800; text-shadow: 0 2px 3px #000; line-height: 1.05; }
#faseNome small { display: block; font-size: 13px; opacity: .85; }
#hud .direita { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
#pontos { font-size: 36px; font-weight: 900; color: #fff; -webkit-text-stroke: 2px #3a1a05; text-shadow: 0 3px 0 rgba(0,0,0,.35); line-height: 1; }
#pontos.pulsa { animation: pulsa .25s; }
@keyframes pulsa { 50% { transform: scale(1.15); color: #ffe14d; } }
.botoes { display: flex; gap: 8px; pointer-events: auto; }
.botoes button { width: 46px; height: 46px; border-radius: 14px; background: rgba(40,25,10,.65); font-size: 22px; border: 2px solid rgba(255,255,255,.25); }
#poluicao { text-align: center; font-size: 12px; font-weight: 800; text-shadow: 0 1px 2px #000; }
#poluicao .barra { width: min(240px, 28vw); height: 14px; border-radius: 8px; background: rgba(0,0,0,.45); border: 2px solid rgba(255,255,255,.35); overflow: hidden; }
#poluicao .barra i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #7ddc3a, #f2c230 40%, #8a5a2a 75%, #4a3a2a); transition: width .3s; }
#fila { position: absolute; left: 12px; bottom: max(12px, env(safe-area-inset-bottom)); display: flex; gap: 8px; pointer-events: auto; }
.cardHeroi { position: relative; width: 64px; height: 64px; border-radius: 14px; background: rgba(30,20,10,.65); border: 3px solid rgba(255,255,255,.3); overflow: hidden; cursor: pointer; transition: transform .15s; }
.cardHeroi img { width: 100%; height: 100%; object-fit: cover; }
.cardHeroi.sel { border-color: #ffd23f; transform: translateY(-8px) scale(1.08); box-shadow: 0 0 16px #ffd23f; }
.cardHeroi.usado { filter: grayscale(1) brightness(.45); transform: scale(.85); cursor: default; }
.cardHeroi.bonus { border-color: #7dffb0; }
#lancadores { position: absolute; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); display: flex; gap: 8px; pointer-events: auto; transition: opacity .2s; }
#lancadores.off { opacity: .35; pointer-events: none; }
.bLanc { width: 66px; height: 66px; border-radius: 16px; background: rgba(30,20,10,.65); border: 3px solid rgba(255,255,255,.3); padding: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; line-height: 1; }
.bLanc svg { width: 44px; height: 44px; }
.bLanc.sel { border-color: #ffd23f; background: rgba(120,70,10,.8); box-shadow: 0 0 14px #ffd23f; transform: translateY(-4px); }
#cartao { position: absolute; left: 12px; top: 74px; max-width: 360px; background: rgba(25,15,8,.82); border-radius: 16px; padding: 10px 14px; border: 2px solid rgba(255,210,63,.6);
  opacity: 0; transform: translateY(10px); transition: opacity .3s, transform .3s; }
#cartao.mostra { opacity: 1; transform: none; }
#cartao b { color: #ffd23f; font-size: 18px; display: block; } #cartao i { font-style: normal; color: #b6ff7a; font-weight: 800; display: block; } #cartao span { font-size: 14px; }
#aviso { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); background: rgba(25,15,8,.8); border-radius: 14px; padding: 8px 16px; font-size: 17px; font-weight: 700; text-align: center; max-width: min(560px, 48vw); opacity: 0; transition: opacity .4s; }
#aviso.mostra { opacity: 1; }
#faixa { position: absolute; top: 38%; left: 0; right: 0; text-align: center; pointer-events: none; opacity: 0; }
#faixa.mostra { animation: faixa 2.4s ease-out forwards; }
#faixa .n { font-size: clamp(28px, 5vw, 60px); font-weight: 900; color: #ffd23f; -webkit-text-stroke: 2px #4a1f05; text-shadow: 0 4px 0 rgba(0,0,0,.35); }
#faixa .s { font-size: clamp(16px, 2.4vw, 26px); font-weight: 800; text-shadow: 0 2px 3px #000; }
@keyframes faixa { 0% { opacity: 0; transform: scale(1.6); } 12% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-30px); } }

/* ---------- painéis ---------- */
.painel { background: rgba(10,6,2,.55); }
.painel .caixa { background: linear-gradient(#6b4a2a, #3b2614); border-radius: 26px; padding: 22px 30px; display: flex; flex-direction: column; align-items: center; gap: 12px; border: 4px solid #ffd23f;
  box-shadow: 0 10px 0 #24160b, 0 20px 50px rgba(0,0,0,.5); max-width: 92vw; animation: caixa .45s cubic-bezier(.2,1.6,.4,1); }
@keyframes caixa { from { transform: scale(.4) rotate(-6deg); opacity: 0; } }
.painel .estrelas { display: flex; gap: 10px; font-size: 70px; line-height: 1; }
.painel .estrelas span { color: rgba(255,255,255,.18); transform: scale(.5); transition: transform .3s cubic-bezier(.2,1.8,.4,1), color .2s; }
.painel .estrelas span.on { color: #ffd23f; transform: scale(1); text-shadow: 0 4px 0 #8a5a06, 0 0 20px #ffd23f; }
.painel .estrelas span:nth-child(2) { margin-top: -18px; font-size: 86px; }
.painel .total { font-size: 44px; font-weight: 900; -webkit-text-stroke: 1.5px #3a1a05; }
.painel .linhaBot { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.painel .linhaBot button { min-width: 150px; }
.painel .ajuda { font-size: 13px; opacity: .8; max-width: 460px; text-align: center; }
.painel img.derrotaImg { height: 110px; }

#girar { display: none; position: fixed; inset: 0; z-index: 50; background: #2b1d12; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; text-align: center; padding: 30px; }
@media (orientation: portrait) and (max-width: 700px) { #girar { display: flex; } }
@media (max-height: 500px) {
  .cardHeroi { width: 50px; height: 50px; } .bLanc { width: 54px; height: 54px; } .bLanc svg { width: 34px; height: 34px; }
  #pontos { font-size: 28px; } #faseNome { font-size: 16px; } #cartao { top: 56px; max-width: 300px; }
  .tela button { font-size: 18px; padding: 8px 18px; min-width: 190px; } button.grande { font-size: 24px; }
  .logo .l1 { font-size: 54px; } .logo .l2 { font-size: 64px; }
}
