/* Batalha, parte "acoes" (19/11/2026): faixa logo abaixo da cena (#baAcoes). Dono: telas/batalha-acoes.js. Prefixo baa-.
   Altura fixa: 58 px em tela estreita, 64 px em tela larga. Nada aqui rola para o lado: os medalhões encolhem por igual.
   O que muda com o tempo entra por atributo/variável no elemento (stroke-dashoffset do anel, --v da vida) e desliza por transição. */
.baa-faixa, .baa-faixa * { box-sizing: border-box; }
.baa-faixa { position: relative; z-index: 2; display: flex; align-items: center; gap: 8px; height: 58px; min-width: 0;
             padding: 3px max(8px, env(safe-area-inset-right, 0px)) 3px max(8px, env(safe-area-inset-left, 0px));
             background: linear-gradient(#1a2038, #0b0e19); border-top: 1px solid #8f7741; box-shadow: inset 0 1px 0 rgba(160, 180, 255, .14); color: #e8dcc0; }

/* ---- medalhões ---- */
.baa-grupo { flex: 1 1 auto; min-width: 0; height: 100%; display: flex; align-items: stretch; gap: 3px; }
.baa-med { flex: 1 1 0; min-width: 0; max-width: 66px; height: 100%; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
           border: 0; border-radius: 8px; background: none; box-shadow: none; color: inherit; font: inherit; text-align: center; cursor: pointer; transition: filter .12s, background-color .12s; }
.baa-med:hover { filter: brightness(1.15); }
.baa-med[aria-expanded="true"] { background: rgba(243, 213, 138, .12); box-shadow: inset 0 0 0 1px #8f7741; }
.baa-anel { position: relative; flex: none; width: 34px; height: 34px; }
.baa-anel svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.baa-trilho { fill: #0a0c16; stroke: #2a3150; stroke-width: 3; }
.baa-arco { fill: none; stroke: #6fb6ff; stroke-width: 3; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .5s linear, stroke .3s; }
.baa-volta .baa-arco { transition: stroke-dashoffset .2s ease-out, stroke .2s; }
.baa-ret { position: absolute; inset: 13%; border-radius: 50%; border: 1.5px solid var(--rar, #b9bcc6); background: #1a1f31 center 8% / 150% no-repeat;
           box-shadow: 0 0 6px color-mix(in srgb, var(--rar, #b9bcc6) 50%, transparent); }
/* pronta: anel de ouro e um brilho que respira (só opacidade, contínuo) */
.baa-anel::after { content: ""; position: absolute; inset: -1px; border-radius: 50%; pointer-events: none; opacity: 0; transition: opacity .3s;
                   box-shadow: 0 0 9px 2px rgba(255, 205, 100, .8), inset 0 0 5px rgba(255, 225, 150, .55); }
.baa-pronta .baa-arco { stroke: #ffd76a; }
.baa-pronta .baa-anel::after { opacity: 1; animation: baa-pulso 1.5s ease-in-out infinite alternate; }
@keyframes baa-pulso { from { opacity: .35; } to { opacity: 1; } }

.baa-txt { width: 100%; min-width: 0; display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 0 2px; }
.baa-nome { display: block; font: 600 9px/10px system-ui, sans-serif; color: #c9cde0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.baa-pronta .baa-nome { color: #ffe08a; }
.baa-vida { display: block; height: 3px; border-radius: 2px; background: #1a1f31; overflow: hidden; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .6); }
.baa-vida i { display: block; height: 100%; background: linear-gradient(#7be07a, #3c9a45); transform-origin: left center; transform: scaleX(var(--v, 1)); transition: transform .45s linear; }
.baa-meia .baa-vida i { background: linear-gradient(#ffd76a, #c98a1c); }
.baa-pouca .baa-vida i { background: linear-gradient(#ff8a7a, #c0392b); }

.baa-vazio { flex: 1; min-width: 0; margin: 0; align-self: center; font-size: 12px; line-height: 1.25; color: #c9cde0;
             display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }

/* ---- ações da luta ---- */
.baa-botoes { flex: none; display: flex; align-items: center; gap: 6px; }
.baa-bt { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; margin: 0; padding: 4px 10px; border-radius: 10px; border: 1px solid #8f7741;
          background: linear-gradient(#2e3550, #171b2c); color: #ffe9b0; font: 700 12px/1.1 var(--titulo); letter-spacing: .04em; text-transform: uppercase; text-shadow: 0 2px 2px #000; white-space: nowrap;
          box-shadow: 0 0 0 1px #05060a, inset 0 1px 0 rgba(160, 180, 255, .16); cursor: pointer; transition: filter .12s, transform .12s; }
.baa-bt:hover { filter: brightness(1.2); }
.baa-bt:active { transform: translateY(1px); }
.baa-ico { position: relative; flex: none; display: inline-flex; }
.baa-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.baa-rot { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.baa-rot small { font: 600 9px/1 system-ui, sans-serif; letter-spacing: .06em; color: #9aa0b4; text-shadow: none; }
/* Automático: ligado = verde; desligado = apagado, com um risco por cima do ícone (o estado não depende só de cor) */
.baa-auto { color: #9aa0b4; }
.baa-auto.baa-lig { color: #9df0a8; border-color: #5fa86a; background: linear-gradient(#34482f, #1a2419); }
.baa-auto:not(.baa-lig) .baa-ico::after { content: ""; position: absolute; left: 50%; top: 50%; width: 24px; height: 2px; border-radius: 1px; background: #ff9a8a;
                                          box-shadow: 0 0 0 1px #171b2c; transform: translate(-50%, -50%) rotate(-45deg); }
.baa-lutar { background: linear-gradient(#c79a34, #7a5a16); border-color: #ffe7a3; color: #fff8e1; }

/* ---- balão da habilidade: sobe por cima da cena, preso à faixa ---- */
.baa-balao { position: absolute; z-index: 3; bottom: calc(100% + 6px); left: clamp(8px, calc(var(--x, 50%) - 124px), calc(100% - 256px)); width: 248px; max-width: calc(100% - 16px);
             display: flex; flex-direction: column; align-items: stretch; gap: 4px; margin: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid #8f7741;
             background: linear-gradient(rgba(26, 32, 56, .98), rgba(9, 11, 20, .98)); color: #e8dcc0; font: 400 12.5px/1.35 system-ui, sans-serif; text-align: left; text-transform: none; white-space: normal;
             box-shadow: 0 0 0 1px #05060a, 0 8px 20px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(160, 180, 255, .16); cursor: pointer; animation: baa-surge .16s ease-out; }
@keyframes baa-surge { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.baa-b-tit { font: 700 15px/1.15 var(--titulo); letter-spacing: .05em; text-transform: uppercase; color: var(--ouro2, #f3d58a); }
.baa-b-quem { font-size: 11px; color: #9aa0b4; }
.baa-b-frase { color: #e8dcc0; }
.baa-b-lin { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; padding-top: 4px; border-top: 1px solid #2c3352; font-variant-numeric: tabular-nums; }
.baa-b-lin b { color: #fff3c4; }
.baa-b-vivo { color: #ffd98a; }
.baa-b-nota { font-size: 11.5px; color: #9aa0b4; }

/* tela estreita no aperto: as ações viram ícone curto (o nome completo fica no aria-label e no title) */
@media (max-width: 640px) {
  .baa-cheia .baa-rot, .baa-espera .baa-auto .baa-rot { display: none; }
  .baa-cheia .baa-bt, .baa-espera .baa-auto { width: 44px; padding: 4px; }
}

/* tela larga: medalhão deitado (retrato à esquerda, nome e vida à direita), faixa de 64 px */
@media (min-width: 820px) {
  .baa-faixa { height: 64px; gap: 12px; padding: 5px max(12px, env(safe-area-inset-right, 0px)) 5px max(12px, env(safe-area-inset-left, 0px)); }
  .baa-grupo { gap: 6px; }
  .baa-med { max-width: 190px; flex-direction: row; justify-content: flex-start; gap: 8px; padding: 0 8px 0 3px; text-align: left;
             background: linear-gradient(rgba(30, 36, 60, .8), rgba(14, 17, 30, .9)); box-shadow: inset 0 0 0 1px #2c3352; }
  .baa-med[aria-expanded="true"] { background: linear-gradient(rgba(58, 52, 40, .85), rgba(24, 22, 20, .92)); box-shadow: inset 0 0 0 1px #8f7741; }
  .baa-anel { width: 46px; height: 46px; }
  .baa-txt { flex: 1; width: auto; gap: 5px; padding: 0; }
  .baa-nome { font: 700 11px/1.15 var(--titulo); letter-spacing: .03em; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
  .baa-vida { height: 4px; }
  .baa-bt { min-height: 48px; padding: 4px 14px; font-size: 13px; }
  .baa-vazio { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .baa-pronta .baa-anel::after, .baa-balao { animation: none; }
}
