/* ===== battle.css — Tela de batalha: unidades, VFX, HUD de batalha, boss, fim de batalha =====
   Gerado por tools/split-css-modules.mjs (Fase B-CSS). Nao editar a divisao manualmente sem
   reconferir a cascata. Ver VaultBrain/Brain/Padroes/Padroes CSS.md ===== */
.bot-battle-result {
  margin: 0 10px 8px;
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: var(--radius-lg);
  padding: 7px 10px;
  font-size: 11px;
}
.bot-battle-result-title {
  font-size: 10px;
  color: var(--text2);
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.bot-battle-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
}
#battle-screen {
  background: linear-gradient(180deg, #2d5a27 0%, #1a3d16 50%, #143612 100%);
  position: relative;
}
#battle-canvas {
  position: relative;
  overflow: visible;
  contain: layout style;
}
#battle-canvas-outer {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  contain: layout;
}
.unit {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  pointer-events: auto;
  cursor: pointer;
  overflow: visible;
  will-change: transform;
}
.unit-body {
  font-size: 24px;
  line-height: 1;
  position: relative;
  transition: filter 0.15s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-content);
}
.unit-hp-bar {
  width: 27px;
  height: 8px;
  background: #1a1a2e;
  border-radius: var(--radius-xs);
  margin-top: 1px;
  flex-shrink: 0;
  position: relative;
  z-index: var(--z-battle-unit-bars);
}
.unit-hp-fill {
  height: 100%;
  background: var(--green);
  border-radius: var(--radius-xs);
  transition: width 0.15s;
}
.unit-sp-bar {
  width: 27px;
  height: 3px;
  background: #111;
  border-radius: var(--radius-xs);
  margin-top: 1px;
  flex-shrink: 0;
  position: relative;
  z-index: var(--z-battle-unit-bars);
}
.unit-sp-fill {
  height: 100%;
  background: var(--blue);
  border-radius: var(--radius-xs);
  transition: width 0.15s;
}
.unit-status {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  pointer-events: none;
  white-space: nowrap;
}
.battle-hud {
  background: var(--surface);
  padding: 5px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-top: 2px solid var(--accent);
}
.hud-side {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 70px;
}
.hud-side.right {
  justify-content: flex-end;
}
.hud-count {
  font-family: 'Righteous', cursive;
  font-size: 18px;
}
.hud-timer {
  font-family: 'Righteous', cursive;
  font-size: 20px;
  color: var(--accent);
  min-width: 50px;
  text-align: center;
}
.hud-timer.rage {
  color: var(--red);
  animation: rage-pulse 0.5s infinite alternate;
}
.field-divider {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(var(--white-rgb), 0.1);
}
.wall-zone {
  position: absolute;
  left: 8%;
  right: 8%;
  height: 2px;
  background: rgba(139, 90, 43, 0);
  border-top: 1px dashed rgba(200, 140, 60, 0.4);
  pointer-events: none;
  z-index: var(--z-base);
}
.vfx-text {
  position: absolute;
  pointer-events: none;
  font-weight: 800;
  animation: floatUp 0.9s forwards;
  z-index: var(--z-battle-vfx-high);
  white-space: nowrap;
}
.vfx-particle {
  position: absolute;
  pointer-events: none;
  border-radius: var(--radius-circle);
  animation: particle-fly 0.6s forwards;
  z-index: var(--z-battle-vfx-high);
}
.vfx-ring {
  position: absolute;
  pointer-events: none;
  border-radius: var(--radius-circle);
  border: 3px solid;
  animation: ring-expand 0.4s forwards;
  z-index: var(--z-battle-vfx-mid);
}
.vfx-aoe {
  position: absolute;
  pointer-events: none;
  border-radius: var(--radius-circle);
  border: 3px solid;
  z-index: var(--z-battle-vfx-mid);
  animation: aoe-expand 0.65s ease-out forwards;
}
.vfx-slime-pool {
  text-shadow:
    0 0 8px #4cde8a,
    0 0 16px #4cde8a88;
  animation: slime-pulse 0.6s ease-in-out infinite alternate;
}
.vfx-monkey-jump {
  position: absolute;
  pointer-events: none;
  z-index: var(--z-battle-overlay);
  animation: monkey-spin var(--ms) linear;
}
.vfx-beam {
  position: absolute;
  pointer-events: none;
  transform-origin: left center;
  animation: beam-fade 0.18s forwards;
  z-index: var(--z-battle-vfx-low);
}
.vfx-proj {
  position: absolute;
  pointer-events: none;
  font-size: 14px;
  z-index: var(--z-battle-proj);
  transform: translate(-50%, -50%);
}
.vfx-proj-coconut {
  position: absolute;
  pointer-events: none;
  font-size: 9px;
  z-index: var(--z-battle-proj-top);
  animation: coconut-spin 0.4s linear infinite;
}
.inspect-panel {
  position: absolute;
  left: 6px;
  right: 6px;
  background: linear-gradient(135deg, rgba(var(--surface-rgb), 0.97), rgba(15, 25, 40, 0.97));
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 5px 8px;
  z-index: var(--z-battle-overlay);
  font-size: 11px;
  box-shadow:
    0 0 20px rgba(var(--accent-rgb), 0.15),
    0 4px 16px rgba(var(--black-rgb), 0.4);
  display: flex;
  align-items: center;
  gap: 6px;
}
.inspect-mini {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 3px rgba(var(--accent-rgb), 0.4));
}
.inspect-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  flex: 1;
}
.inspect-stat {
  background: linear-gradient(135deg, rgba(36, 51, 80, 0.9), rgba(var(--surface-rgb), 0.9));
  padding: 2px 6px;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid rgba(var(--white-rgb), 0.06);
}
.inspect-desc {
  font-size: 12px;
  color: var(--text2);
  max-width: 100%;
}
.rage-banner {
  position: absolute;
  top: 5%;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Righteous', cursive;
  font-size: 17px;
  color: var(--red);
  text-shadow: 0 0 12px var(--red);
  animation: rage-banner-anim 0.5s infinite alternate;
  pointer-events: none;
  z-index: var(--z-battle-overlay);
  white-space: nowrap;
  background: rgba(var(--black-rgb), 0.75);
  padding: 3px 10px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--red);
}
.quake-shake {
  animation: quake-shake 0.4s ease;
}
#end-screen {
  background: var(--bg);
  align-items: center;
  justify-content: center;
  text-align: center;
}
.end-title {
  font-family: 'Righteous', cursive;
  font-size: 32px;
  margin-bottom: 6px;
}
#battle-canvas::after {
  display: none;
}
.field-divider {
  display: none;
}
.wall-zone {
  display: none;
}
.unit-hp-bar {
  height: 8px;
  border-radius: var(--radius-xs);
  overflow: hidden;
  background: #111a;
  position: relative;
}
.unit-hp-fill {
  height: 100%;
  border-radius: 1.5px;
  transition: width 0.12s;
}
.unit-sp-bar {
  height: 2px;
  border-radius: var(--radius-xs);
  background: #0a0a1a;
  margin-top: 2px;
}
.unit-sp-fill {
  border-radius: var(--radius-xs);
  transition: width 0.12s;
}
.unit-hp-bar.low-hp .unit-hp-fill {
  animation: hp-danger 0.65s ease-in-out infinite alternate;
}
#battle-timer {
  border-radius: 14px;
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.3);
  letter-spacing: 1px;
}
#battle-timer.rage {
  box-shadow: 0 0 24px rgba(var(--red-rgb), 0.7);
}
.vfx-text {
  font-family: 'Righteous', cursive;
}
.unit-status {
  font-size: 10px;
  letter-spacing: 0;
}
#end-screen {
  background: var(--bg);
}
#end-emoji {
  filter: drop-shadow(0 0 20px rgba(var(--gold-rgb), 0.5));
  animation: trophy-pop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.end-title {
  animation: title-glow 2.5s ease-in-out infinite alternate;
}
.confetti-piece {
  position: absolute;
  pointer-events: none;
  border-radius: var(--radius-xs);
  animation: confetti-fall var(--dur, 2s) var(--delay, 0s) linear forwards;
  opacity: 0;
}
#trophy-bar {
  transition: box-shadow 0.3s;
}
.trophy-bump {
  animation: trophyBump 0.4s ease-out;
}
.battle-start-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-battle-flash);
  animation: battle-flash-anim 1s ease-out forwards;
  background: radial-gradient(
    ellipse at 50% 55%,
    rgba(100, 255, 120, 0.95) 0%,
    rgba(30, 200, 70, 0.7) 45%,
    rgba(0, 130, 40, 0) 100%
  );
}

/* ── BOSS UNIT ── */
.is-boss-unit {
  filter: drop-shadow(0 0 10px #ff4d6a) drop-shadow(0 0 22px rgba(var(--red-rgb), 0.5));
  animation: boss-pulse 1.2s ease-in-out infinite alternate;
}
.tut-battle-pulse img {
  filter: drop-shadow(0 0 12px #ffd700) drop-shadow(0 0 6px #ff8800) !important;
  animation: tut-battle-pulse 1s infinite !important;
}
