/* Motion layer for STW Visual Cards */

@keyframes vc-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Live pulse — color comes from currentColor (rarity) */
@keyframes vc-live-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
    box-shadow:
      0 0 0 0 color-mix(in srgb, currentColor 42%, transparent),
      0 0 6px 1px color-mix(in srgb, currentColor 32%, transparent);
  }
  50% {
    transform: scale(1.08);
    opacity: 0.82;
    box-shadow:
      0 0 0 5px color-mix(in srgb, currentColor 0%, transparent),
      0 0 8px 2px color-mix(in srgb, currentColor 18%, transparent);
  }
}

@keyframes vc-grid-drift {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 48px 28px;
  }
}

a.group.relative.block,
a.vc-mod-card,
.vc-card,
a.inline-flex {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

a.group.relative.block,
a.vc-mod-card,
.vc-card {
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;
}

a.group.relative.block::before,
a.vc-mod-card::before {
  transition:
    opacity 160ms ease,
    box-shadow 160ms ease,
    width 160ms ease;
}

a.group.relative.block .size-4,
a.vc-mod-card .size-4 {
  transition: transform 160ms ease;
}

.live-dot {
  background: currentColor;
  color: #5eb8ff; /* hub / default */
}

.vc-rarity-uncommon-sim .live-dot,
.vc-rarity-uncommon .live-dot {
  color: var(--rarity-uncommon);
}

.vc-rarity-rare-sim .live-dot,
.vc-rarity-rare .live-dot {
  color: var(--rarity-rare);
}

.vc-rarity-epic-sim .live-dot,
.vc-rarity-epic .live-dot {
  color: var(--rarity-epic);
}

.vc-rarity-legendary-sim .live-dot,
.vc-rarity-legendary .live-dot,
.vc-page-legendary .live-dot {
  color: var(--rarity-legendary);
}

@media (prefers-reduced-motion: no-preference) {
  .vc-rise {
    animation: vc-rise 560ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .vc-rise-d1 {
    animation-delay: 70ms;
  }
  .vc-rise-d2 {
    animation-delay: 140ms;
  }
  .vc-rise-d3 {
    animation-delay: 210ms;
  }
  .vc-rise-d4 {
    animation-delay: 280ms;
  }
  .vc-rise-d5 {
    animation-delay: 350ms;
  }

  .live-dot {
    animation: vc-live-pulse 2.8s ease-in-out infinite;
    will-change: transform, opacity, box-shadow;
  }

  .tactical-grid {
    animation: vc-grid-drift 28s linear infinite;
  }

  section[aria-labelledby="sim-title"] button {
    transition:
      transform 160ms ease,
      border-color 160ms ease,
      background-color 160ms ease,
      color 160ms ease;
  }
}

/* Real mouse hover only — phones must not rely on sticky :hover */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  a.group.relative.block:not([class*="vc-rarity-"]):hover,
  .vc-card:hover {
    transform: translateY(-6px);
    border-color: rgba(94, 184, 255, 0.55) !important;
    box-shadow:
      0 22px 44px rgba(0, 0, 0, 0.38),
      0 0 0 1px rgba(94, 184, 255, 0.22),
      0 0 34px rgba(94, 184, 255, 0.18);
    filter: brightness(1.06);
  }

  a.group.relative.block:not([class*="vc-rarity-"]):hover::before,
  .vc-card:hover::before {
    width: 3px;
    opacity: 1;
    box-shadow: 0 0 22px 2px rgba(94, 184, 255, 0.65);
  }

  a.group.relative.block:not([class*="vc-rarity-"]):hover .size-4,
  .vc-card:hover .size-4 {
    transform: translate(3px, -3px);
  }

  a.group.relative.block:not([class*="vc-rarity-"]):active,
  .vc-card:active {
    transform: translateY(-3px) scale(0.995);
  }
}

@media (prefers-reduced-motion: reduce) {
  .vc-rise,
  .live-dot,
  .tactical-grid {
    animation: none !important;
  }

  a.group.relative.block:hover,
  a.group.relative.block.vc-press,
  .vc-card:hover,
  .vc-card.vc-press {
    transform: none;
    filter: none;
  }
}
