/* ==========================================================================
   AURORA MOTION SYSTEM V1
   Load after aurora-components.css.
   Aurora landscape gameplay only.
   ========================================================================== */

body.aurora-gameplay-active {
  --aurora-motion-gold: rgba(232, 209, 143, .82);
  --aurora-motion-glow: rgba(201, 160, 74, .24);
  --aurora-motion-ease: cubic-bezier(.22,.82,.26,1);
}

/* JS ghost used for card travel. */
.aurora-motion-ghost {
  transform-origin: 50% 68%;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

/* Card-back ghost built at Fable-mockup scale (aurora-motion.js's
   createGhostFrom/CARD_BACK_FLIGHT_SIZE) — the resting .pill-card-back/
   .mini-card.card-back it clones from is styled for its own small size
   (border-width, radius), so those need their own larger values here, plus
   the centered suit glyph the mockup used to read as a card rather than a
   plain rectangle mid-flight. Colors come from the same --card-back-*
   tokens (style.css) the resting element uses — only geometry differs. */
.aurora-deal-ghost-oversized {
  border-radius: 5px !important;
  border-width: 2px !important;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5), inset 0 0 0 1.5px rgba(78,20,30,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}
.aurora-deal-ghost-oversized::after {
  content: "\2660";
  font-size: 17px;
  color: rgba(233, 223, 198, 0.85);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Prevent legacy card-in animation and the new travel animation from playing
   simultaneously. The real target is hidden during travel and settles once. */
body.aurora-gameplay-active .aurora-motion-target {
  animation: none !important;
}

/* Current actor gets one calm illumination pass. No infinite pulsing. */
body.aurora-gameplay-active .opp-pill.aurora-seat-focus,
body.aurora-gameplay-active .hero-zone.aurora-seat-focus,
body.aurora-gameplay-active .seat-card.cd-hero.aurora-seat-focus {
  animation: auroraSeatFocus 620ms var(--aurora-motion-ease);
}

@keyframes auroraSeatFocus {
  0%   { filter: brightness(1); }
  28%  { filter: brightness(1.15); }
  100% { filter: brightness(1); }
}

/* Winner emphasis: a restrained spotlight and small lift. */
body.aurora-gameplay-active .opp-pill.aurora-winner-celebrate,
body.aurora-gameplay-active .hero-zone.aurora-winner-celebrate,
body.aurora-gameplay-active .seat-card.cd-hero.aurora-winner-celebrate {
  animation: auroraWinnerCelebrate 1100ms var(--aurora-motion-ease);
}

@keyframes auroraWinnerCelebrate {
  0%   { filter: brightness(1); }
  18%  {
    filter: brightness(1.2);
    box-shadow: 0 0 0 1px var(--aurora-motion-gold),
                0 0 22px var(--aurora-motion-glow),
                0 10px 24px rgba(0,0,0,.46);
  }
  72%  {
    filter: brightness(1.1);
    box-shadow: 0 0 0 1px rgba(232,209,143,.45),
                0 0 14px rgba(201,160,74,.16),
                0 8px 20px rgba(0,0,0,.42);
  }
  100% { filter: brightness(1); }
}

/* Lightweight chip particles. They are meaning, not casino confetti. */
.aurora-flying-chip {
  position: fixed;
  z-index: 1000;
  width: 11px;
  height: 11px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(circle at 34% 30%, #fff0b8 0 12%, transparent 13%),
    radial-gradient(circle, #d4ad52 0 52%, #8f6d29 53% 68%, #e5c878 69% 76%, #6e501b 77%);
  box-shadow: 0 4px 8px rgba(0,0,0,.45);
  will-change: transform, opacity;
}

/* Board receives a quiet light response after a street lands. Claude may add
   .aurora-board-settled after the final card's promise resolves. */
body.aurora-gameplay-active .board-stage.aurora-board-settled {
  animation: auroraBoardSettle 520ms var(--aurora-motion-ease);
}

@keyframes auroraBoardSettle {
  0%   { filter: brightness(1); }
  45%  { filter: brightness(1.055); }
  100% { filter: brightness(1); }
}

/* Hero's own hole cards land face-down like everyone else's during the
   deal, then lift/reveal together once the whole deal finishes
   (aurora:hand-deal-complete flips app.js's heroDealFaceDown flag and
   re-triggers this class) — owner request 2026-07-18: "hero cards land
   face-down first, then flip or lift together after the final card." */
body.aurora-gameplay-active .hand-fan--hero.hand-fan--hero-reveal {
  animation: auroraHeroReveal 260ms var(--aurora-motion-ease);
}

@keyframes auroraHeroReveal {
  0%   { transform: translateY(3px) scale(.97); opacity: .55; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .aurora-motion-ghost,
  .aurora-flying-chip {
    display: none !important;
  }

  body.aurora-gameplay-active .aurora-seat-focus,
  body.aurora-gameplay-active .aurora-winner-celebrate,
  body.aurora-gameplay-active .aurora-board-settled,
  body.aurora-gameplay-active .hand-fan--hero-reveal {
    animation: none !important;
  }

  /* Reduced-motion / test-fixture path: the rule above fully disables
     auroraWinnerCelebrate, so without this, .aurora-winner-celebrate would
     be a complete visual no-op here — no way to represent "winner state" in
     a deterministic screenshot (this is exactly the mode
     test/visual/run.js always runs under). A static hold of the
     animation's own 18% keyframe (its peak), not a substitute for the
     animation in normal play — normal play still gets the full 1100ms
     sequence, this only fires when motion is already off. */
  body.aurora-gameplay-active .opp-pill.aurora-winner-celebrate,
  body.aurora-gameplay-active .hero-zone.aurora-winner-celebrate,
  body.aurora-gameplay-active .seat-card.cd-hero.aurora-winner-celebrate {
    filter: brightness(1.15);
    box-shadow: 0 0 0 1px var(--aurora-motion-gold),
                0 0 22px var(--aurora-motion-glow),
                0 10px 24px rgba(0,0,0,.46);
  }
}
