/* Rain Animation Styles */
#rain-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Allows clicks to pass through */
  overflow: hidden;
  z-index: 9998; /* Below the reward overlay, but above content */
  background-color: rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#rain-container.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto; /* Re-enable pointer events when visible if needed, though likely not */
}

.falling-item {
  position: absolute;
  top: -80px; /* Start above the screen */
  animation: fall linear;
  will-change: transform;
}

.falling-item img {
  display: block;
  height: auto; /* Maintain aspect ratio */
}

.rain-text {
  position: absolute;
  bottom: 80px;
  width: 100%;
  text-align: center;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 60px;
  color: #000;
  z-index: 9999;
}

.rain-text-stroke {
  color: #000;
  font-size: 40px;
  font-family: 'Bricolage Grotesque', 'Mulish', Arial, sans-serif;
  font-weight: 700;
  text-align: center;
  line-height: 1.1;
  text-shadow:
    -2px -2px 0 #fff,
     2px -2px 0 #fff,
    -2px  2px 0 #fff,
     2px  2px 0 #fff,
     0px  2px 0 #fff,
     2px  0px 0 #fff,
    -2px  0px 0 #fff,
     0px -2px 0 #fff;
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  z-index: 9999;
  margin-bottom: 40px;
}

.rain-image {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  max-width: 90vw;
  height: auto;
  display: block;
  margin: 0 auto;
  z-index: 9999;
}

@keyframes fall {
  to {
    transform: translateY(110vh);
  }
}

/* Mobile specific styles */
@media (max-width: 768px) {
  .rain-text {
    font-size: 32px;
  }

  .rain-image {
    width: 330px;
  }
}

@media (max-width: 600px) {
  .rain-image {
    width: 330px;
  }

  .rain-text-stroke {
    font-size: 32px;
    bottom: 40px;
  }
}

/* Accessibility: Disable animation for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .falling-item {
    animation: none;
  }
}
