/* Painéis da batalha (19/11/2026). Dono: o núcleo (tela.js pinta; aqui só a cara). Prefixo ba-.
   Tela larga: três colunas (andar | cena | grupo), sempre à vista. Tela estreita: os dois painéis viram gavetas que abrem pelas faixas de cima e de baixo.
   A cara é a nossa (pedra azul-escura, fio de ouro, Cinzel); só mostra o que existe no jogo. */
.ba-meio { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ba-meio #cena { min-width: 0; }
.ba-painel { display: none; flex-direction: column; gap: 10px; flex: none; max-height: 46%; overflow-y: auto; scrollbar-width: thin; padding: 12px max(12px, env(safe-area-inset-right, 0px)) 12px max(12px, env(safe-area-inset-left, 0px));
             background: linear-gradient(#141829, #0a0c15); color: #e8dcc0; font-size: 13px; }
.ba-painel.aberta { display: flex; }
.ba-esq { border-bottom: 1px solid #8f7741; } .ba-dir { border-top: 1px solid #8f7741; }
.ba-painel > div { display: flex; flex-direction: column; gap: 10px; } .ba-painel > div:empty { display: none; }
.ba-painel h2 { margin: 0; font-family: var(--titulo); font-size: 16px; letter-spacing: .05em; text-transform: uppercase; color: var(--ouro2); }
.ba-painel h3 { margin: 4px 0 0; font-family: var(--titulo); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: #c9a85a; display: flex; justify-content: space-between; }
.ba-painel .dados { width: 100%; } .ba-painel p { margin: 0; }
.ba-caixa { background: linear-gradient(rgba(30,36,60,.75), rgba(14,17,30,.85)); border: 1px solid #3d456a; border-radius: 10px; padding: 10px; box-shadow: inset 0 1px 0 rgba(160,180,255,.12); display: flex; flex-direction: column; gap: 8px; }

/* cabeçalho do andar: selo com o número + nome do ambiente */
.ba-cab { display: flex; align-items: center; gap: 12px; }
.ba-selo { flex: none; width: 54px; height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; border-radius: 8px 8px 16px 16px;
           background: linear-gradient(#c79a34, #6a4a10); border: 2px solid #ffe7a3; box-shadow: 0 0 0 2px #2a1904, 0 4px 10px rgba(0,0,0,.6); color: #fff8e1; text-shadow: 0 2px 2px rgba(0,0,0,.7); }
.ba-selo small { font: 700 9px/1 var(--titulo); letter-spacing: .1em; text-transform: uppercase; }
.ba-selo b { font: 800 24px/1.05 var(--titulo); }
.ba-cab span { color: #c9a85a; font-size: 12px; }
.ba-cab .chefe { color: #ff9a8a; font-weight: 700; }
.ba-par { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ba-par b { font: 700 16px/1 var(--titulo); color: #fff3c4; font-variant-numeric: tabular-nums; }
.ba-par.sit b { font: 600 13px/1.3 system-ui, sans-serif; color: #ffd98a; text-align: right; }
.ba-trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; }
.ba-trio div { background: rgba(10,12,22,.7); border: 1px solid #2c3352; border-radius: 8px; padding: 6px 2px; }
.ba-trio small { display: block; font: 700 9.5px/1.2 var(--titulo); letter-spacing: .08em; text-transform: uppercase; color: #9aa0b4; }
.ba-trio b { font: 700 16px/1.3 var(--titulo); color: #fff3c4; }
.ba-moedas { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; }

/* grupo */
.ba-forca { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; text-align: center; }
.ba-forca div { background: rgba(10,12,22,.7); border: 1px solid #2c3352; border-radius: 8px; padding: 5px 2px; font: 700 10px/1.3 var(--titulo); letter-spacing: .08em; text-transform: uppercase; color: #9aa0b4; }
.ba-forca b { font-size: 16px; color: #fff3c4; margin-left: 6px; }
.ba-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.ba-ctl b { min-width: 14px; text-align: center; }
.ba-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.ba-heroi { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 3px 8px; align-items: center; padding: 6px; border-radius: 9px; background: linear-gradient(rgba(30,36,60,.8), rgba(14,17,30,.9));
            border: 1px solid color-mix(in srgb, var(--rar, #b9bcc6) 55%, #1a1f31); box-shadow: inset 0 1px 0 rgba(160,180,255,.1); }
.ba-ret { grid-row: span 3; width: 40px; height: 40px; border-radius: 8px; border: 2px solid var(--rar, #b9bcc6); background: #1a1f31 center 8% / 150% no-repeat; box-shadow: 0 0 8px color-mix(in srgb, var(--rar, #b9bcc6) 45%, transparent); }
.ba-heroi .nome { display: flex; justify-content: space-between; gap: 4px; font-weight: 700; font-size: 12.5px; white-space: nowrap; overflow: hidden; }
.ba-heroi .nome small { font-weight: 500; color: #9aa0b4; }
.ba-vida { position: relative; height: 13px; border-radius: 4px; background: #1a1f31; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.6); }
.ba-vida::before { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--f, 0) * 100%); background: linear-gradient(#7be07a, #3c9a45); }
.ba-vida.meia::before { background: linear-gradient(#ffd76a, #c98a1c); } .ba-vida.pouca::before { background: linear-gradient(#ff8a7a, #c0392b); }
.ba-vida span { position: absolute; inset: 0; text-align: center; font: 700 10px/13px system-ui, sans-serif; color: #fff; text-shadow: 0 1px 2px #000; }
.ba-hab { height: 4px; border-radius: 2px; background: #1a1f31; overflow: hidden; }
.ba-hab::before { content: ""; display: block; height: 100%; width: calc(var(--f, 0) * 100%); background: linear-gradient(#7fc4ff, #3b78d8); }
.ba-hab.pronta::before { background: linear-gradient(#fff3b0, #e6b93c); }
.ba-heroi.fora { opacity: .92; } .ba-heroi.fora .ba-ret { filter: saturate(.6) brightness(.85); }
.ba-estado { font-size: 11px; color: #9aa0b4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* tela larga: três colunas, painéis sempre à vista, sem as faixas */
@media (min-width: 1100px) and (min-aspect-ratio: 1/1) {
  .ba-meio { display: grid; grid-template-columns: 286px minmax(0, 1fr) 336px; grid-template-rows: minmax(0, 1fr); }
  .ba-meio #cena { height: 100%; }
  .ba-painel { display: flex; max-height: none; height: 100%; padding: 12px; }
  .ba-esq { border-bottom: 0; border-right: 1px solid #8f7741; } .ba-dir { border-top: 0; border-left: 1px solid #8f7741; }
  #vBatalha .faixa { display: none; }
}

/* encaixes das partes (telas/batalha-<parte>.js). Vazios não ocupam lugar. */
#baTopo, #baAcoes { flex: none; } #baTopo:empty, #baAcoes:empty { display: none; }
#baCena { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }   /* por cima da cena; quem precisar de clique liga pointer-events no próprio elemento */

/* a barra de cima vem antes da faixa do andar (que no celular vira só o puxador da gaveta) */
#vBatalha > #baTopo { order: -1; }
#vBatalha .faixa { white-space: nowrap; padding-block: 6px; font-size: 13px; }

/* (19/11/2026) sem botão repetido: "Lutar agora" fica só no recado do meio da cena (desligado em batalha-acoes.js);
   em tela larga o Automático fica só no painel do grupo, que está sempre à vista */
@media (min-width: 1100px) and (min-aspect-ratio: 1/1) { #baAcoes .baa-auto { display: none; } }

/* (19/11/2026) o painel media 100% da altura MAIS a própria margem interna e passava 24 px do pé da tela: o botão "Ver todos os heróis" ficava cortado.
   Agora a margem interna conta dentro da altura, e em tela larga o painel ocupa exatamente a sua coluna e rola por dentro. */
.ba-painel { box-sizing: border-box; }
@media (min-width: 1100px) and (min-aspect-ratio: 1/1) { .ba-painel { height: auto; min-height: 0; align-self: stretch; padding-bottom: 14px; } }
