/* v2.7 CPU action presentation */

.table-board {
  isolation: isolate;
}

.cpu-motion-ghost {
  position: absolute !important;
  z-index: 40 !important;
  margin: 0 !important;
  pointer-events: none !important;
  transform-origin: center center !important;
  will-change: transform, opacity;
}

.cpu-arriving {
  visibility: hidden !important;
}

.cpu-arrival-flash {
  animation: cpuArrivalFlash .48s ease-out;
}

.cpu-attacker-focus {
  z-index: 8;
  border-color: #ffe07a !important;
  box-shadow: 0 0 0 5px rgba(255, 211, 91, .28), 0 0 30px rgba(255, 183, 61, .36) !important;
  transform: translateY(8px) scale(1.07) !important;
  filter: brightness(1.14);
}

.cpu-target-focus {
  z-index: 8;
  border-color: #ff776d !important;
  box-shadow: 0 0 0 5px rgba(255, 84, 76, .25), 0 0 30px rgba(255, 70, 61, .3) !important;
  filter: brightness(1.09);
}

.cpu-hit-flash {
  animation: cpuHitFlash .42s ease-out;
}

.cpu-destroying {
  pointer-events: none !important;
  animation: cpuDestroy .52s ease-in forwards !important;
}

.cpu-attack-arrow {
  position: absolute;
  z-index: 35;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 224, 111, .3), #ff795d 70%, #ff4f45);
  transform-origin: 0 50%;
  pointer-events: none;
  box-shadow: 0 0 14px rgba(255, 85, 68, .55);
  animation: cpuArrowIn .24s ease-out both;
}

.cpu-attack-arrow::after {
  content: "";
  position: absolute;
  right: -11px;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid #ff5147;
  transform: translateY(-50%);
  filter: drop-shadow(0 0 5px rgba(255, 85, 68, .55));
}

.cpu-arrow-label {
  position: absolute;
  left: 50%;
  top: -26px;
  transform: translateX(-50%) rotate(var(--counter-rotation, 0deg));
  padding: 3px 8px;
  border: 1px solid rgba(255, 222, 150, .42);
  border-radius: 999px;
  background: rgba(39, 22, 15, .94);
  color: #ffe9bb;
  font-size: .62rem;
  font-weight: 950;
  letter-spacing: .08em;
  white-space: nowrap;
}

.cpu-damage-float {
  position: absolute;
  z-index: 46;
  transform: translate(-50%, -50%);
  color: #fff3e7;
  font-size: clamp(1.45rem, 4vw, 2.25rem);
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 2px 0 #6e160f, 0 0 14px rgba(255, 58, 44, .8);
  pointer-events: none;
  animation: cpuDamageFloat .7s ease-out forwards;
}

@keyframes cpuArrivalFlash {
  0% { filter: brightness(1.8); transform: scale(1.15); }
  100% { filter: brightness(1); transform: scale(1); }
}

@keyframes cpuArrowIn {
  from { opacity: 0; transform: rotate(var(--arrow-angle)) scaleX(.1); }
  to { opacity: 1; transform: rotate(var(--arrow-angle)) scaleX(1); }
}

@keyframes cpuHitFlash {
  0%, 100% { filter: brightness(1); }
  30% { filter: brightness(2.2) saturate(1.5); transform: translateX(-5px); }
  55% { transform: translateX(5px); }
}

@keyframes cpuDamageFloat {
  0% { opacity: 0; transform: translate(-50%, -15%) scale(.72); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -135%) scale(.95); }
}

@keyframes cpuDestroy {
  0% { opacity: 1; filter: brightness(1); transform: scale(1); }
  35% { filter: brightness(1.8) saturate(.35); transform: scale(1.08) rotate(-2deg); }
  100% { opacity: 0; filter: grayscale(1) brightness(.45); transform: scale(.28) rotate(10deg); }
}

@media (max-width: 760px) {
  .cpu-arrow-label {
    top: -23px;
    font-size: .54rem;
    padding: 3px 6px;
  }

  .cpu-attack-arrow {
    height: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cpu-arrival-flash,
  .cpu-hit-flash,
  .cpu-destroying,
  .cpu-attack-arrow,
  .cpu-damage-float {
    animation-duration: .01ms !important;
  }
}
