* {
  margin: 0;
  padding: 0;
}

:root {
  --thunder-duration: 10s;
  --thunder-delay: 5s;
}

body {
  background-image: linear-gradient(to bottom, #030420, #000000 70%);
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

hr.thunder {
  border: unset;
  position: absolute;
  width: 100vw;
  height: 100vh;
  animation-name: thunder;
  animation-duration: var(--thunder-duration);
  animation-timing-function: linear;
  animation-delay: var(--thunder-delay);
  animation-iteration-count: infinite;
}

hr:not(.thunder) {
  width: 50px;
  border-color: transparent;
  border-right-color: rgba(255, 255, 255, 0.7);
  border-right-width: 50px;
  position: absolute;
  bottom: 100%;
  transform-origin: 100% 50%;
  animation-name: rain;
  animation-duration: 1s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes rain {
  from {
    transform: rotate(105deg) translateX(0);
  }
  to {
    transform: rotate(105deg) translateX(calc(100vh + 20px));
  }
}

@keyframes thunder {
  0% {
    background-color: transparent;
  }
  1% {
    background-color: white;
  }
  2% {
    background-color: rgba(255, 255, 255, 0.8);
  }
  8% {
    background-color: transparent;
  }
}