/* ===== Stock logo coin rain — full-page falling effect ===== */
#stock-rain {
  position: fixed;
  inset: 0;
  z-index: 12;
  overflow: hidden;
  pointer-events: none;
  contain: layout style paint;
}

.stock-coin {
  position: absolute;
  top: -80px;
  width: var(--size, 42px);
  height: var(--size, 42px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 30% 28%, #ffe9a0 0%, #f5c542 38%, #d4a017 72%, #a67c00 100%);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.35),
    inset 0 1px 2px rgba(255, 255, 255, 0.55),
    inset 0 -2px 4px rgba(0, 0, 0, 0.2);
  border: 2px solid rgba(180, 130, 20, 0.85);
  animation-name: stockCoinFall;
  animation-timing-function: linear;
  animation-iteration-count: 1;
  animation-fill-mode: forwards;
  will-change: transform, opacity;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

.stock-coin::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  pointer-events: none;
}

.stock-coin__logo {
  width: 58%;
  height: 58%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
  z-index: 1;
}

/* Dollar coin variant (no logo) */
.stock-coin.is-dollar {
  background:
    radial-gradient(circle at 30% 28%, #fff6c8 0%, #f0d060 40%, #c9a227 75%, #8b6914 100%);
}

.stock-coin.is-dollar .stock-coin__logo {
  display: none;
}

.stock-coin.is-dollar::after {
  content: "$";
  font: 800 calc(var(--size, 42px) * 0.48) / 1 "Segoe UI", system-ui, sans-serif;
  color: #6b4e00;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  z-index: 1;
}

/* Silver / green money bill flake */
.stock-bill {
  position: absolute;
  top: -40px;
  width: var(--w, 28px);
  height: var(--h, 14px);
  border-radius: 2px;
  background: linear-gradient(135deg, #1f9d55 0%, #3ddc84 42%, #0f6b3a 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  animation-name: stockBillFall;
  animation-timing-function: linear;
  animation-iteration-count: 1;
  animation-fill-mode: forwards;
  will-change: transform, opacity;
  opacity: 0.92;
}

.stock-bill::after {
  content: "$";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.9);
  font: 700 9px/1 system-ui, sans-serif;
}

@keyframes stockCoinFall {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg) rotateY(0deg);
    opacity: 0;
  }
  6% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--drift, 40px), 110vh, 0)
      rotate(var(--spin, 360deg))
      rotateY(var(--flip, 720deg));
    opacity: 0;
  }
}

@keyframes stockBillFall {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 0;
  }
  8% {
    opacity: 0.95;
  }
  100% {
    transform: translate3d(var(--drift, 30px), 110vh, 0) rotate(var(--spin, 280deg));
    opacity: 0.1;
  }
}

/* Soften on small screens / reduce motion */
@media (max-width: 480px) {
  .stock-coin {
    --size: 32px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #stock-rain {
    display: none !important;
  }
}
