/* Clima visual da arena — pointer-events:none (não bloqueia cliques) */
#battleWeatherLayer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
}
#battleWeatherLayer[data-mode="clear"],
#battleWeatherLayer:empty {
  display: none;
}
#battleWeatherLayer .bw-wx { position: absolute; inset: 0; }

#battleWeatherLayer .bw-atm,
#battleWeatherLayer .bw-mist,
#battleWeatherLayer .bw-ground,
#battleWeatherLayer .bw-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

@keyframes bwMistDrift {
  from { transform: translate3d(-1.5%, 0, 0); }
  to   { transform: translate3d(1.5%, 1%, 0); }
}
@keyframes bwStormFlash {
  0%, 88%, 100% { opacity: 0; }
  90% { opacity: 0.55; }
  92% { opacity: 0.08; }
  94% { opacity: 0.4; }
  96% { opacity: 0; }
}
@keyframes bwDriftDownSoft {
  0% { top: -12%; transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0; }
  8% { opacity: 0.9; }
  45% { top: 48%; transform: translate3d(var(--dx, 24px), 0, 0) rotate(28deg); }
  100% { top: 112%; transform: translate3d(calc(var(--dx, 24px) * -0.45), 0, 0) rotate(-16deg); opacity: 0; }
}
@keyframes bwSheetRainFar {
  from { background-position: 0 0; }
  to   { background-position: -18px 140px; }
}
@keyframes bwSheetRainMid {
  from { background-position: 0 0; }
  to   { background-position: -34px 180px; }
}
@keyframes bwSheetRainNear {
  from { background-position: 0 0; }
  to   { background-position: -55px 220px; }
}
@keyframes bwSheetSnowFar {
  from { background-position: 0 0; }
  to   { background-position: 28px 100px; }
}
@keyframes bwSheetSnowMid {
  from { background-position: 0 0; }
  to   { background-position: -40px 140px; }
}
@keyframes bwSheetSnowNear {
  from { background-position: 0 0; }
  to   { background-position: 55px 200px; }
}
@keyframes bwSheetSnowWind {
  from { background-position: 0 0; }
  to   { background-position: 140px 90px; }
}
@keyframes bwStreakFall {
  0% { transform: translate3d(0, -15%, 0) rotate(16deg); opacity: 0; }
  8% { opacity: 0.85; }
  100% { transform: translate3d(-42px, 120%, 0) rotate(16deg); opacity: 0; }
}
@keyframes bwSnowFlakeFall {
  0% { transform: translate3d(0, -12%, 0); opacity: 0; }
  10% { opacity: 0.9; }
  25% { transform: translate3d(18px, 20%, 0); }
  50% { transform: translate3d(-14px, 48%, 0); }
  75% { transform: translate3d(22px, 76%, 0); }
  100% { transform: translate3d(-8px, 118%, 0); opacity: 0; }
}
@keyframes bwSnowFlakeWind {
  0% { transform: translate3d(0, -10%, 0); opacity: 0; }
  10% { opacity: 0.9; }
  100% { transform: translate3d(120px, 110%, 0); opacity: 0; }
}
@keyframes bwSplashPop {
  0%, 100% { transform: scale(0.3); opacity: 0; }
  40% { transform: scale(1.4); opacity: 0.45; }
  70% { opacity: 0; }
}

#battleWeatherLayer .bw-rain-sheet,
#battleWeatherLayer .bw-snow-sheet {
  position: absolute;
  inset: 0;
  background-repeat: repeat;
  will-change: background-position;
}
#battleWeatherLayer .bw-rain-streak {
  position: absolute;
  top: -20%;
  width: 1.5px;
  border-radius: 2px;
  background: linear-gradient(180deg, transparent, rgba(210, 230, 255, 0.55) 55%, transparent);
  animation: bwStreakFall cubic-bezier(0.4, 0.05, 0.85, 0.3) infinite;
}
#battleWeatherLayer .bw-rain-splash {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(200, 220, 255, 0.35);
  animation: bwSplashPop ease-out infinite;
}
#battleWeatherLayer .bw-snow-flake {
  position: absolute;
  top: -10%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, rgba(230, 240, 255, 0.8) 50%, transparent 72%);
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
  animation: bwSnowFlakeFall ease-in-out infinite;
}
#battleWeatherLayer .bw-snow-flake.wind { animation-name: bwSnowFlakeWind; }
#battleWeatherLayer .bw-leaf,
#battleWeatherLayer .bw-pollen {
  position: absolute;
  top: -12%;
  left: 0;
  will-change: top, transform, opacity;
  animation: bwDriftDownSoft ease-in-out infinite;
}
#battleWeatherLayer .bw-leaf {
  width: 7px;
  height: 4px;
  border-radius: 40% 60% 40% 60%;
  background: linear-gradient(135deg, #6bb34a, #2f6b28);
}
#battleWeatherLayer .bw-pollen {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 230, 140, 0.75);
}

/* Filtro leve no chão (aplicado via JS em #battleGround) */
.battle-ground.bw-filter-rain { filter: saturate(0.82) brightness(0.92); }
.battle-ground.bw-filter-storm { filter: saturate(0.7) brightness(0.82); }
.battle-ground.bw-filter-snow { filter: saturate(0.75) brightness(1.05) hue-rotate(10deg); }
.battle-ground.bw-filter-snow_wind { filter: saturate(0.7) brightness(1.04) hue-rotate(12deg); }
.battle-ground.bw-filter-leaves { filter: saturate(1.05) brightness(0.98); }
