/* The stage can rebuild during an action. These flights stay in viewport coordinates. */
.battle-card-motion {
  position: fixed;
  inset: 0;
  z-index: 89;
  overflow: hidden;
  pointer-events: none;
  isolation: isolate;
}

.battle-card-motion * {
  pointer-events: none !important;
}

#app:has(.run-room[inert]) > .battle-card-motion {
  visibility: hidden;
}

.battle-motion-trails {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.battle-motion-card,
.battle-motion-smoke,
.battle-motion-ash,
.battle-motion-pile-pulse {
  position: absolute;
  top: 0;
  left: 0;
}

.battle-motion-card {
  z-index: 2;
  will-change: transform, opacity, filter;
}

.battle-motion-smoke,
.battle-motion-ash,
.battle-motion-pile-pulse {
  z-index: 3;
}

#app .battle-motion-card > .poke-card.ptcg-v2 {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  opacity: 1;
  filter: drop-shadow(0 6px 8px #07191288);
  transform: none !important;
  transition: none !important;
}

.battle-motion-smoke {
  width: 52px;
  height: 44px;
  border-radius: 48% 54% 45% 56%;
  background: radial-gradient(ellipse at 52% 53%, #cbd3cd 4%, #8c9b9ac2 36%, #5d67671a 67%, transparent 74%);
  mix-blend-mode: screen;
}

.battle-motion-ash {
  width: 4px;
  height: 5px;
  border-radius: 45%;
  background: #ffcf88;
  box-shadow: 0 0 6px #fb9858a6;
}

.battle-motion-pile-pulse {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 2px solid #ffe28a;
  box-shadow: 0 0 12px rgba(255, 168, 52, 0.72);
}

.battle-motion-pile-pulse.discard {
  border-color: #ff9238;
  box-shadow: 0 0 12px rgba(255, 102, 24, 0.72);
}

.battle-motion-pile-pulse.scry {
  border-color: #a78bfa;
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.72), 0 0 6px rgba(56, 189, 248, 0.65);
}

#app[data-screen="battle"] .hand-row .poke-card.battle-card-in-flight {
  visibility: hidden !important;
  pointer-events: none !important;
}

#app[data-screen="battle"] .hand-row .poke-card.ptcg-v2.is-field-drag {
  pointer-events: none !important;
}

/* Match the preview's bottom edge to the hand area so :hover survives the lift. */
#app[data-screen="battle"] .hand-dock {
  --hand-preview-offset: calc(var(--hand-dock-bottom-padding) + 1px);
}

@media (max-width: 620px) {
  #app[data-screen="battle"] .hand-dock {
    --hand-preview-offset: 1px;
  }
}

#app[data-screen="battle"] .hand-row .poke-card.ptcg-v2:not(.is-aiming) {
  transition: transform .17s cubic-bezier(.22,.78,.24,1) !important;
}

#app[data-screen="battle"] .battle-screen:not(.is-aiming) .hand-row .poke-card.ptcg-v2:is(:hover, :focus-visible) {
  transform: translateY(var(--hand-preview-offset)) rotate(0deg) scale(1.38) !important;
  filter: drop-shadow(0 10px 12px #07191275);
}

#app[data-screen="battle"] .battle-screen:not(.is-aiming) .hand-row .poke-card.ptcg-v2.unplayable:is(:hover, :focus-visible) {
  filter: grayscale(.4) drop-shadow(0 10px 12px #07191275);
}

@media (max-width: 620px), (max-height: 540px) {
  #app[data-screen="battle"] .battle-screen:not(.is-aiming) .hand-row .poke-card.ptcg-v2:is(:hover, :focus-visible) {
    transform: translateY(var(--hand-preview-offset)) rotate(0deg) scale(1.12) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #app[data-screen="battle"] .hand-row .poke-card.ptcg-v2:not(.is-aiming) {
    transition: none !important;
  }
}
