/* Rain effect styles - renders above background image */
.rain {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  /* place above body background but below UI content */
  z-index: 0;
  pointer-events: none;
  transition: opacity 0.5s ease-in-out;
  -webkit-transition: opacity 0.5s ease-in-out;
}

.rain.back-row {
  display: block;
  z-index: 0;
  opacity: 0.45;
}

/* Lightning effect layer */
.lightning {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('https://images.wallpapersden.com/image/download/firewatch-new-hd-22-art_bWpubm2UmZqaraWkpJRnamtlrWZpaWU.jpg');
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  -webkit-filter: brightness(3);
  filter: brightness(3);
  -o-filter: brightness(3);
  -moz-filter: brightness(3);
  z-index: -1;
  pointer-events: none;
  opacity: 0;
}

/* Lightning flash animation - shorter, more realistic */
.flashit {
  -webkit-animation: flash ease-out 0.4s;
  -moz-animation: flash ease-out 0.4s;
  animation: flash ease-out 0.4s;
}

@-webkit-keyframes flash {
  0% { opacity: 0; } 
  10% { opacity: 0.8; }
  20% { opacity: 0.3; }
  30% { opacity: 0.9; }
  50% { opacity: 1; }
  70% { opacity: 0.4; }
  80% { opacity: 0.7; }
  100% { opacity: 0; }
}

@keyframes flash {
  0% { opacity: 0; } 
  10% { opacity: 0.8; }
  20% { opacity: 0.3; }
  30% { opacity: 0.9; }
  50% { opacity: 1; }
  70% { opacity: 0.4; }
  80% { opacity: 0.7; }
  100% { opacity: 0; }
}

.drop {
  position: absolute;
  bottom: 100%;
  width: 15px;
  height: 120px;
  pointer-events: none;
  animation: drop 0.5s linear infinite;
}

@keyframes drop {
  0% {
    transform: translateY(0vh);
  }
  75% {
    transform: translateY(90vh);
  }
  100% {
    transform: translateY(90vh);
  }
}

.stem {
  width: 1px;
  height: 60%;
  margin-left: 7px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.25));
  animation: stem 0.5s linear infinite;
}

@keyframes stem {
  0% {
    opacity: 1;
  }
  65% {
    opacity: 1;
  }
  75% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

.splat {
  width: 15px;
  height: 10px;
  border-top: 2px dotted rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  opacity: 1;
  transform: scale(0);
  animation: splat 0.5s linear infinite;
  display: block;
}

@keyframes splat {
  0% {
    opacity: 1;
    transform: scale(0);
  }
  80% {
    opacity: 1;
    transform: scale(0);
  }
  90% {
    opacity: 0.5;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}
