/* v2.67: restore the pre-v2.66 battle layout and keep only the polished image VFX. */
.battle-screen.battle-visual-upgraded .duel,
.battle-screen .duel {
  position: relative;
  isolation: isolate;
  overflow: visible;
}

.battle-screen .versus {
  position: relative;
  z-index: 18;
  overflow: visible;
}

.battle-impact-vfx-v267 {
  position: absolute;
  z-index: 30;
  top: 46%;
  left: 50%;
  width: clamp(170px, 38vw, 340px);
  max-width: none;
  height: auto;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(.45) rotate(-7deg);
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 14px rgba(255, 118, 46, .66));
  animation: v267-impact-burst .68s 1.48s ease-out both;
}

.battle-impact-vfx-v267.effect-stratagem,
.battle-impact-vfx-v267.effect-evade {
  filter: drop-shadow(0 0 14px rgba(94, 190, 219, .56));
}

.battle-impact-vfx-v267.effect-parry {
  filter: drop-shadow(0 0 13px rgba(241, 211, 102, .62));
}

/* Remove the boxed card-effect copy. Card result stays in the existing result banner/log. */
.battle-screen.battle-visual-upgraded .fighter-card-effect,
.battle-screen.battle-visual-upgraded .fighter-card-effect.active,
.battle-screen.battle-visual-upgraded .fighter-card-effect.dialogue {
  display: none !important;
}

.battle-screen.battle-visual-upgraded.visual-finished .battle-dialogue-row,
.battle-screen.battle-visual-upgraded .battle-dialogue-row.visual-dialogue-relocated {
  display: grid !important;
}

/* Keep the fixed controls centered on desktop and fully inside portrait mobile screens. */
.battle-screen.battle-visual-upgraded .battle-buttons {
  box-sizing: border-box;
  left: 50%;
  right: auto;
  width: min(720px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  transform: translateX(-50%);
}

.battle-screen.battle-visual-upgraded.visual-speed-2 .battle-impact-vfx-v267 {
  animation-duration: .36s;
  animation-delay: .74s;
}

@keyframes v267-impact-burst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.4) rotate(-7deg); }
  30% { opacity: 1; transform: translate(-50%, -50%) scale(.92) rotate(0); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.18) rotate(5deg); }
}

@media (max-width: 760px) and (orientation: portrait) {
  .battle-impact-vfx-v267 {
    top: 42%;
    width: min(58vw, 230px);
  }

  .battle-screen.battle-visual-upgraded .battle-buttons {
    left: max(6px, env(safe-area-inset-left));
    right: max(6px, env(safe-area-inset-right));
    width: auto;
    max-width: none;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .battle-impact-vfx-v267 {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
  }
}
