/*
 * Painel da luta de chefe (game/src/ui/boss-fight-hud.js), no tema Bolsa Grafite: placa cinza escura de contorno
 * preto, filete pontilhado, faixa cinza-azulada no título, botão azul. Só estilo.
 */
.bfh { position: absolute; inset: 0; pointer-events: none; color: #eef1f4; font: 13px/1.3 'idlepoke-pixel', system-ui, sans-serif; text-shadow: 1px 1px 0 rgba(0, 0, 0, .7); }
.bfh [hidden] { display: none !important; }
.bfh small { font-size: 11px; color: #b9c2cc; }

/* ---------- chefe: nome, fase, vida, tempo */
.bfh-boss { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); width: min(600px, calc(100% - 300px)); min-width: 300px; }
.bfh-head { display: flex; align-items: baseline; gap: 10px; padding: 0 2px 3px; }
.bfh-name { font-size: 20px; color: #ffd8c8; text-shadow: 2px 2px 0 #16181d; }
.bfh-phase-tag { color: #e2e8ec; }
.bfh-chips { display: flex; gap: 4px; }
.bfh-chip { font-weight: normal; padding: 0 6px; border: 2px solid #16181d; border-radius: 4px; background: #5b6a74; color: #fff; }
.bfh-chip.rage { background: #b01818; }
.bfh-chip.guard { background: #6f7f89; }
.bfh-timer { margin-left: auto; font-size: 16px; color: #e2e8ec; }
.bfh-timer.low { color: #ff8a80; }
.bfh-bar { position: relative; height: 18px; background: #2a2e35; border: 2px solid #16181d; border-radius: 6px; box-shadow: inset 0 0 0 2px #4d535c, 0 3px 0 rgba(0, 0, 0, .3); overflow: hidden; }
.bfh-bar i { position: absolute; left: 2px; top: 2px; bottom: 2px; }
.bfh-fill { background: linear-gradient(180deg, #ff9a80 0 2px, #e83828 2px 55%, #b01818 55%); max-width: calc(100% - 4px); }
.bfh-lag { background: #ffe9c8; max-width: calc(100% - 4px); }
.bfh-ticks { position: absolute; inset: 2px; }
.bfh-ticks i { top: 0 !important; bottom: 0 !important; left: 0; width: 2px; margin-left: -1px; background: #16181d; box-shadow: 1px 0 0 #ffe9c8; }
.bfh-pct { position: absolute; right: 8px; top: 0; line-height: 14px; font-size: 11px; color: #fff; }

/* ---------- golpe em preparo e próximo golpe */
.bfh-cast { margin: 6px auto 0; width: 86%; background: #3c4149; border: 2px solid #16181d; border-radius: 6px; box-shadow: inset 0 0 0 2px #4d535c, 0 3px 0 rgba(0, 0, 0, .3); padding: 4px 8px 5px; }
.bfh-cast-row { display: flex; align-items: center; gap: 8px; }
.bfh-cast-name { font-size: 16px; white-space: nowrap; }
.bfh-cast-bar { position: relative; flex: 1; height: 10px; background: #2a2e35; border: 2px solid #16181d; border-radius: 4px; overflow: hidden; }
.bfh-cast-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45), inset 0 -3px 0 rgba(0, 0, 0, .25); }
.bfh-cast-hint { margin-top: 3px; padding-top: 3px; text-align: center; color: #ffd23c; background: repeating-linear-gradient(90deg, #a9b1bc 0 2px, transparent 2px 5px) top / 100% 2px no-repeat; }
.bfh-cast.alert { border-color: #e0262c; animation: bfh-alert .5s steps(2) infinite; }
.bfh-cast.done .bfh-cast-bar i { background: #fff !important; }
@keyframes bfh-alert { 50% { box-shadow: inset 0 0 0 2px #e0262c, 0 3px 0 rgba(0, 0, 0, .3); } }
.bfh-next { margin-top: 6px; text-align: center; }
.bfh-next small { margin-right: 6px; }
.bfh-next b { font-weight: normal; text-shadow: 1px 1px 0 #16181d; }

/* ---------- time */
.bfh-team { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 214px; display: grid; gap: 4px; }
.bfh-mon { display: grid; grid-template-columns: 34px 1fr 40px; grid-template-rows: 16px 10px; column-gap: 6px; align-items: center; padding: 3px 6px 4px 3px; background: #3c4149; border: 2px solid #16181d; border-radius: 6px; box-shadow: inset 0 0 0 2px #4d535c, 0 2px 0 rgba(0, 0, 0, .3); }
.bfh-face { grid-row: 1 / 3; width: 34px; height: 34px; display: grid; place-items: center; overflow: hidden; border-radius: 4px; background: radial-gradient(circle at 50% 65%, #6a7280 0 45%, #4a5059 70%); }
.bfh-face img { image-rendering: pixelated; }
.bfh-who { grid-column: 2 / 4; display: flex; align-items: baseline; gap: 6px; min-width: 0; white-space: nowrap; }
.bfh-who b { font-weight: normal; overflow: hidden; text-overflow: ellipsis; }
.bfh-kit { margin-left: auto; padding: 0 4px; border-radius: 3px; background: #5b6a74; color: #fff !important; text-shadow: none; }
.bfh-kit.tank { background: #3550c8; }
.bfh-kit.melee { background: #a45c0c; }
.bfh-kit.ranged { background: #6a3fb8; }
.bfh-kit.support { background: #1f8a4c; }
.bfh-hp { position: relative; height: 8px; background: #2a2e35; border: 2px solid #16181d; border-radius: 3px; overflow: hidden; }
.bfh-hp i { position: absolute; left: 0; top: 0; bottom: 0; }
.bfh-hp i.ok { background: #5fd35f; } .bfh-hp i.mid { background: #f2c14e; } .bfh-hp i.low { background: #e5533d; }
.bfh-hp-n { font-size: 11px; text-align: right; color: #e2e8ec; }
.bfh-mon { position: relative; }
.bfh-mon.called { border-color: #ffe27a; }
.bfh-mon.hunted { border-color: #e0262c; box-shadow: inset 0 0 0 2px #e0262c, 0 2px 0 rgba(0, 0, 0, .3); }
.bfh-move { position: absolute; left: 100%; top: 50%; transform: translateY(-50%); margin-left: 6px; padding: 1px 7px 2px; white-space: nowrap; background: #2a2e35; border: 2px solid; border-radius: 6px; box-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.bfh-mon.down { background: #2a2e35; box-shadow: none; color: #8a939d; }
.bfh-mon.down .bfh-face img { opacity: .35; }
.bfh-mon.down .bfh-hp-n { color: #ff8a80; }
/* Max Revive: botão na linha do Pokémon seu desmaiado (1 vez por luta) */
.bfh-revive { position: absolute; left: 100%; top: 50%; transform: translateY(-50%); margin-left: 6px; padding: 2px 8px 3px; white-space: nowrap; cursor: pointer; pointer-events: auto;
  font: inherit; font-size: 12px; color: #fff; background: linear-gradient(180deg, #ffd86b, #e0a020); border: 2px solid #16181d; border-radius: 6px; box-shadow: 0 2px 0 rgba(0, 0, 0, .35); text-shadow: 1px 1px 0 #6b4a00;
  animation: bfh-revive-pulse 1.2s ease-in-out infinite; }
.bfh-revive:hover { filter: brightness(1.1); }
@keyframes bfh-revive-pulse { 0%, 100% { box-shadow: 0 2px 0 rgba(0, 0, 0, .35), 0 0 0 0 rgba(255, 216, 107, .7); } 50% { box-shadow: 0 2px 0 rgba(0, 0, 0, .35), 0 0 0 5px rgba(255, 216, 107, 0); } }
@media (prefers-reduced-motion: reduce) { .bfh-revive { animation: none; } }

/* ---------- fala, aviso de fase */
.bfh-say { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); max-width: min(640px, 80%); padding: 6px 16px; text-align: center; font-size: 16px; background: #3c4149; border: 2px solid #16181d; border-radius: 8px; box-shadow: inset 0 0 0 2px #4d535c, 0 3px 0 rgba(0, 0, 0, .3); }
.bfh-banner { margin: 6px auto 0; width: 60%; padding: 3px 20px 5px; text-align: center; background: linear-gradient(180deg, #a9b6be 0 2px, #8796a0 2px, #6f7f89 55%, #5b6a74); border: 2px solid #16181d; border-radius: 8px; box-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.bfh-banner small { display: block; color: #16181d; text-shadow: none; }
.bfh-banner b { font-weight: normal; font-size: 22px; text-shadow: 2px 2px 0 #2b353c; }

/* ---------- resultado */
.bfh-result { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, 92%); pointer-events: auto; background: #3c4149; border: 2px solid #16181d; border-radius: 10px; box-shadow: inset 0 0 0 2px #4d535c, 0 3px 0 rgba(0, 0, 0, .28), 0 8px 18px rgba(0, 0, 0, .45); overflow: hidden; }
.bfh-res-head { display: flex; align-items: baseline; gap: 12px; padding: 6px 14px; background: linear-gradient(180deg, #a9b6be 0 2px, #8796a0 2px, #6f7f89 55%, #5b6a74); border-bottom: 2px solid #2b353c; }
.bfh-res-head b { font-weight: normal; font-size: 24px; text-shadow: 2px 2px 0 #2b353c; }
.bfh-result.win .bfh-res-head b { color: #ffe27a; }
.bfh-result.lose .bfh-res-head b { color: #ffb0a8; }
.bfh-res-body { padding: 10px 14px 12px; display: grid; gap: 10px; background: repeating-linear-gradient(90deg, #a9b1bc 0 2px, transparent 2px 5px) top / 100% 2px no-repeat; }
.bfh-res-sum { display: flex; gap: 18px; }
.bfh-res-sum span { display: grid; }
.bfh-res-sum b { font-weight: normal; font-size: 18px; }
.bfh-res-grid { display: grid; grid-template-columns: 104px 1fr 1fr 1fr; gap: 4px 8px; align-items: center; }
.bfh-res-who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bfh-res-who.down { color: #9aa3ad; }
.bfh-res-who.best { color: #ffe27a; }
.bfh-stat { position: relative; height: 16px; background: #2a2e35; border: 2px solid #16181d; border-radius: 3px; overflow: hidden; }
.bfh-stat i { position: absolute; left: 0; top: 0; bottom: 0; }
.bfh-stat.dmg i { background: #b8480e; } .bfh-stat.taken i { background: #8a2a34; } .bfh-stat.heal i { background: #1f8a4c; }
.bfh-stat em { position: absolute; right: 4px; top: 0; line-height: 12px; font-style: normal; font-size: 11px; }
.bfh-again { justify-self: center; font: inherit; color: #fff; cursor: pointer; padding: 4px 18px; border: 2px solid #1a2370; border-radius: 8px; background: linear-gradient(180deg, #8aa2ff 0 2px, #5573ea 2px 50%, #3550c8 50%); text-shadow: 1px 1px 0 #1a2370; }
.bfh-again:hover, .bfh-again:focus-visible { border-color: #e0262c; outline: none; }
.bfh-over .bfh-say { display: none; }

/* telas estreitas (celular em pé): time vira uma faixa embaixo, sem o nome */
@media (max-width: 760px) {
  .bfh-boss { width: calc(100% - 20px); min-width: 0; }
  .bfh-team { top: auto; bottom: 8px; left: 8px; right: 8px; width: auto; transform: none; grid-template-columns: repeat(6, 1fr); }
  .bfh-mon { grid-template-columns: 1fr; grid-template-rows: 34px 10px; padding: 3px; justify-items: center; }
  .bfh-face { grid-row: auto; }
  .bfh-who, .bfh-hp-n, .bfh-move { display: none; }
  .bfh-hp { width: 100%; }
  .bfh-say { bottom: 72px; font-size: 13px; }
}

/* líder de ginásio: qual Pokémon dele está em campo ("2 de 3") */
.bfh-count { margin-left: 6px; padding: 0 6px; border: 2px solid #16181d; border-radius: 4px; background: #2b2f36; color: #cfd6de; font-size: 11px; }

/* celular deitado (tela baixa): o time vira uma coluna estreita de retratos, para não cobrir o golpe em preparo */
@media (max-height: 480px) and (min-width: 761px) {
  .bfh-boss { top: 4px; }
  .bfh-team { width: 46px; top: 50px; transform: none; gap: 3px; }
  .bfh-mon { grid-template-columns: 1fr; grid-template-rows: 34px 8px; padding: 3px; justify-items: center; }
  .bfh-face { grid-row: auto; }
  .bfh-who, .bfh-hp-n, .bfh-move { display: none; }
  .bfh-hp { width: 100%; }
}

/* lendário em grupo: até 12 Pokémon no painel (linhas mais baixas); os dos outros jogadores ficam mais apagados */
.bfh-team.many { gap: 2px; }
.bfh-team.many .bfh-mon { grid-template-columns: 26px 1fr 40px; grid-template-rows: 14px 8px; padding: 1px 6px 2px 3px; }
.bfh-team.many .bfh-face { width: 26px; height: 26px; }
.bfh-team.many .bfh-face img { width: 26px; height: 26px; }
.bfh-mon.ally .bfh-who b { color: #b9c2cc; }
.bfh-mon.ally { box-shadow: inset 0 0 0 2px #454b54, 0 2px 0 rgba(0, 0, 0, .3); }
@media (max-width: 760px) { .bfh-team.many .bfh-mon { grid-template-columns: 1fr; grid-template-rows: 26px 8px; padding: 2px; } }
@media (max-height: 480px) and (min-width: 761px) {
  .bfh-team.many { grid-template-columns: 1fr 1fr; width: 76px; }
  .bfh-team.many .bfh-mon { grid-template-columns: 1fr; grid-template-rows: 26px 8px; padding: 2px; }
}

/* ---------- barra do golpe especial (embaixo da vida) e escolha do golpe */
.bfh-mon { grid-auto-rows: 7px; }
.bfh-charge { grid-column: 2 / 4; position: relative; height: 5px; margin-top: 1px; background: #2a2e35; border: 1px solid #16181d; border-radius: 2px; overflow: hidden; }
.bfh-charge i { position: absolute; left: 0; top: 0; bottom: 0; background: #ffd24a; }
/* risquinhos: um por ponto */
.bfh-charge::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(100% / var(--n) - 1px), rgba(22, 24, 29, .8) calc(100% / var(--n) - 1px) calc(100% / var(--n))); }
.bfh-mon.full .bfh-charge { border-color: #ffe27a; box-shadow: 0 0 0 1px #ffe27a; }
.bfh-mon.burst { border-color: #ffe27a; box-shadow: inset 0 0 0 2px #ffe27a, 0 2px 0 rgba(0, 0, 0, .3); }
.bfh-mon.pick { pointer-events: auto; cursor: pointer; }
.bfh-mon.pick:hover { border-color: #8aa2ff; }
.bfh-tip { position: absolute; left: 10px; top: calc(50% + 150px); width: 214px; padding: 2px 6px 3px; font-size: 11px; text-align: center; background: #2b2f36; border: 2px solid #16181d; border-radius: 6px; color: #ffe27a; }
.bfh-sp-menu { position: absolute; left: 232px; top: 50%; transform: translateY(-50%); width: 190px; pointer-events: auto; padding: 5px 7px 7px; background: #3c4149; border: 2px solid #16181d; border-radius: 8px; box-shadow: inset 0 0 0 2px #4d535c, 0 3px 0 rgba(0, 0, 0, .3), 0 6px 14px rgba(0, 0, 0, .4); }
.bfh-sp-head { display: flex; align-items: baseline; gap: 6px; margin-bottom: 5px; }
.bfh-sp-head b { font-weight: normal; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bfh-sp-x { font: inherit; width: 22px; height: 22px; line-height: 16px; padding: 0; color: #fff; cursor: pointer; background: #2a2e35; border: 2px solid #16181d; border-radius: 5px; }
.bfh-sp-list { display: grid; gap: 4px; }
.bfh-sp-opt { display: flex; align-items: center; gap: 6px; font: inherit; color: #eef1f4; text-align: left; cursor: pointer; padding: 4px 8px 5px; background: #2a2e35; border: 2px solid; border-radius: 6px; text-shadow: 1px 1px 0 rgba(0, 0, 0, .7); }
.bfh-sp-opt i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.bfh-sp-opt.on { background: #4d535c; box-shadow: inset 0 0 0 2px #ffe27a; }
.bfh-sp-opt:hover, .bfh-sp-opt:focus-visible { background: #4d535c; outline: none; }
.bfh-sp-note { display: block; margin-top: 5px; }
.bfh-over .bfh-sp-menu, .bfh-over .bfh-tip { display: none; }
@media (max-width: 760px) {
  .bfh-charge { grid-column: 1; width: 100%; }
  .bfh-tip { left: 8px; right: 8px; top: auto; bottom: 66px; width: auto; }
  .bfh-sp-menu { left: 50%; top: auto; bottom: 100px; transform: translateX(-50%); width: min(300px, calc(100% - 16px)); }
  .bfh-sp-list { grid-template-columns: 1fr 1fr; }
}
@media (max-height: 480px) and (min-width: 761px) {
  .bfh-charge { grid-column: 1; width: 100%; }
  .bfh-tip { left: 62px; top: 50px; width: 180px; }
  .bfh-sp-menu { left: 62px; top: 50px; transform: none; width: 300px; }
  .bfh-sp-list { grid-template-columns: 1fr 1fr; }
  .bfh-team.many ~ .bfh-tip, .bfh-team.many ~ .bfh-sp-menu { left: 92px; }
}
@media (max-width: 760px) { .bfh-team.many .bfh-charge { grid-column: 1; } }

/* botão "em sequência" de cada Pokémon (painel do golpe especial) e a etiqueta 1›4 na linha dele */
.bfh-seq { margin-left: 3px; padding: 0 3px; border-radius: 3px; background: #ffe27a; color: #2a2e35 !important; text-shadow: none; font-weight: bold; }
.bfh-sp-seq { display: block; width: 100%; margin-top: 6px; font: inherit; color: #eef1f4; text-align: left; cursor: pointer; padding: 5px 8px 6px; background: #2a2e35; border: 2px solid #16181d; border-radius: 6px; text-shadow: 1px 1px 0 rgba(0, 0, 0, .7); }
.bfh-sp-seq.on { background: #4d535c; box-shadow: inset 0 0 0 2px #ffe27a; }
.bfh-sp-seq:hover, .bfh-sp-seq:focus-visible { background: #4d535c; outline: none; }
