/**
 * RC Overnight WOW Lab — presentation-only polish (no math/RNG changes).
 * Linked after motion-language.css; respects reduced motion via existing body classes.
 */

/* ===== B — Living background (player, subtle) ===== */
@media (prefers-reduced-motion: no-preference) {
  .playground--player-view.slot-idle-motion-active:not(.slot-reduced-motion) .game-stage-bg-glow {
    animation: wow-bg-glow-pulse 9s ease-in-out infinite;
  }

  .playground--player-view.slot-idle-motion-active:not(.slot-reduced-motion) .game-stage-bg-particles {
    animation: wow-bg-particles-drift 28s linear infinite;
    opacity: 0.42;
  }

  .playground--player-view.slot-idle-motion-active:not(.slot-reduced-motion) .game-stage-bg-grid {
    animation: showcase-grid-drift 48s linear infinite;
    opacity: 0.55;
  }

  .playground--player-view.slot-idle-motion-active:not(.slot-reduced-motion) .game-stage-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
      105deg,
      transparent 42%,
      rgba(255, 215, 0, 0.04) 50%,
      transparent 58%
    );
    animation: wow-bg-light-sweep 14s ease-in-out infinite;
  }
}

@keyframes wow-bg-glow-pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.78; transform: scale(1.04); }
}

@keyframes wow-bg-particles-drift {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-24px, -18px, 0); }
}

@keyframes wow-bg-light-sweep {
  0%, 100% { opacity: 0; transform: translateX(-8%); }
  45% { opacity: 1; }
  55% { opacity: 1; transform: translateX(8%); }
}

/* ===== A/C — Scatter landing rings ===== */
[data-game-stage-reels] {
  position: relative;
}

.scatter-landing-ring {
  position: absolute;
  top: 50%;
  left: calc(12% + var(--scatter-reel, 0) * 14.2%);
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  border-radius: 50%;
  border: 2px solid rgba(168, 85, 247, 0.75);
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.45);
  pointer-events: none;
  z-index: 2;
  animation: scatter-ring-pop 0.52s ease-out forwards;
}

.scatter-landing-ring--tier-2 {
  border-color: rgba(255, 140, 0, 0.85);
  box-shadow: 0 0 22px rgba(255, 140, 0, 0.5);
  animation-duration: 0.62s;
}

.scatter-landing-ring--tier-3 {
  border-color: rgba(255, 215, 0, 0.95);
  box-shadow: 0 0 28px rgba(255, 215, 0, 0.65);
  animation: scatter-ring-blast 0.72s ease-out forwards;
}

@keyframes scatter-ring-pop {
  from { transform: scale(0.55); opacity: 0.9; }
  to { transform: scale(1.35); opacity: 0; }
}

@keyframes scatter-ring-blast {
  0% { transform: scale(0.4); opacity: 1; }
  40% { transform: scale(1.5); opacity: 0.85; }
  100% { transform: scale(2.2); opacity: 0; }
}

.scatter-near-bonus-active[data-game-stage-aspect]::before,
.scatter-tension-active[data-game-stage-aspect]::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(circle at 50% 42%, transparent 22%, rgba(4, 8, 18, 0.35) 78%);
  animation: scatter-tension-vignette 1.4s ease-in-out infinite alternate;
}

@keyframes scatter-tension-vignette {
  from { opacity: 0.65; }
  to { opacity: 1; }
}

.scatter-trigger-blast[data-game-stage-aspect] {
  animation: scatter-trigger-flash 0.45s ease-out;
}

@keyframes scatter-trigger-flash {
  0% { filter: brightness(1); }
  35% { filter: brightness(1.35) saturate(1.15); }
  100% { filter: brightness(1); }
}

/* ===== A — CHILL DUDE scatter save premium ===== */
.scatter-save-overlay--premium {
  background: rgba(4, 8, 18, 0.82);
  overflow: hidden;
}

.scatter-save-courier {
  position: absolute;
  left: 12%;
  top: 28%;
  font-size: 2.4rem;
  filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.65));
  animation: scatter-courier-fly 1.1s ease-out forwards;
  pointer-events: none;
}

.scatter-save-courier-trail {
  position: absolute;
  left: -40px;
  top: 50%;
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.8));
  transform: translateY(-50%);
}

@keyframes scatter-courier-fly {
  from { transform: translate(-120px, 40px) rotate(-18deg); opacity: 0; }
  30% { opacity: 1; }
  to { transform: translate(0, 0) rotate(0deg); opacity: 1; }
}

.scatter-save-stamp {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  color: #38bdf8;
  border: 2px solid rgba(56, 189, 248, 0.65);
  display: inline-block;
  padding: 0.15rem 0.55rem;
  transform: rotate(-4deg);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
}

/* ===== F — Bonus intro personality 2.0 ===== */
.bonus-intro-overlay--hansolo .bonus-intro-glow {
  background: radial-gradient(circle, rgba(255, 215, 0, 0.55), rgba(168, 85, 247, 0.2) 70%);
}

.bonus-intro-overlay--hansolo .bonus-intro-smoke {
  opacity: 1.2;
  filter: contrast(1.1);
}

.bonus-intro-overlay--kissik .bonus-intro-glow {
  background: radial-gradient(circle, rgba(255, 105, 180, 0.55), transparent 70%);
}

.bonus-intro-overlay--kissik .bonus-intro-particles {
  background-image: radial-gradient(circle, rgba(255, 182, 225, 0.55) 2px, transparent 2px);
  background-size: 48px 48px;
  animation: bonus-intro-particles-drift 6s linear infinite;
}

.bonus-intro-overlay--viking .bonus-intro-backdrop {
  background: radial-gradient(circle at 50% 30%, rgba(79, 195, 247, 0.25), rgba(4, 6, 14, 0.88) 72%);
}

.bonus-intro-overlay--viking .bonus-intro-panel {
  animation: viking-intro-shake 0.55s ease-out;
}

@keyframes viking-intro-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

.bonus-intro-overlay--ujn .bonus-intro-fx::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(74, 222, 128, 0.04) 2px,
    rgba(74, 222, 128, 0.04) 4px
  );
  pointer-events: none;
  animation: ujn-code-rain 3s linear infinite;
}

@keyframes ujn-code-rain {
  from { transform: translateY(-8px); }
  to { transform: translateY(8px); }
}

/* ===== Near bonus mode enhancement ===== */
.near-miss-director-host.near-bonus-mode {
  box-shadow: inset 0 0 0 999px rgba(4, 8, 18, var(--near-bonus-dim, 0.52));
}

.near-miss-director-host.near-bonus-mode .near-miss-dim:not(.hidden) {
  background: radial-gradient(circle at 50% 40%, rgba(255, 140, 0, 0.08) 0%, rgba(4, 8, 18, 0.62) 72%);
}

@media (prefers-reduced-motion: reduce) {
  .scatter-landing-ring,
  .scatter-save-courier,
  .scatter-near-bonus-active[data-game-stage-aspect]::before,
  .scatter-trigger-blast[data-game-stage-aspect],
  .bonus-intro-overlay--viking .bonus-intro-panel,
  .bonus-intro-overlay--ujn .bonus-intro-fx::after {
    animation: none !important;
  }
}
