/* =========================================
   PLUIE QUI TOMBE (couvre toute la largeur)
   ========================================= */

.rain {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 9997;
}

.rain .drop {
  position: absolute;
  top: -15vh;
  /* hitbox large, trait fin au centre */
  width: 16px;
  height: var(--length, 80px);
  margin-left: -7px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(180, 210, 255, 0.15) 20%,
    rgba(180, 210, 255, 0.75) 100%
  ) center / 2px 100% no-repeat;
  border-radius: 0 0 50% 50%;
  animation: rain-fall var(--duration, 0.9s) linear var(--delay, 0s) infinite;
  will-change: transform;
  pointer-events: none;
  cursor: default;
}

@keyframes rain-fall {
  0%   { transform: translate3d(0, -15vh, 0); opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translate3d(var(--sway, 3px), 115vh, 0); opacity: 1; }
}

/* 50 positions uniques de 1% à 99% */
.rain .drop:nth-child(1)  { left: 1%;  --duration: 0.80s; --delay: -0.20s; --length: 70px;  --sway: 3px; }
.rain .drop:nth-child(2)  { left: 3%;  --duration: 1.10s; --delay: -0.50s; --length: 95px;  --sway: 4px; }
.rain .drop:nth-child(3)  { left: 5%;  --duration: 0.70s; --delay: -0.10s; --length: 60px;  --sway: 2px; }
.rain .drop:nth-child(4)  { left: 7%;  --duration: 1.20s; --delay: -0.70s; --length: 110px; --sway: 5px; }
.rain .drop:nth-child(5)  { left: 9%;  --duration: 0.90s; --delay: -0.30s; --length: 80px;  --sway: 3px; }
.rain .drop:nth-child(6)  { left: 11%; --duration: 0.85s; --delay: -0.60s; --length: 75px;  --sway: 4px; }
.rain .drop:nth-child(7)  { left: 13%; --duration: 1.00s; --delay: -0.40s; --length: 90px;  --sway: 2px; }
.rain .drop:nth-child(8)  { left: 15%; --duration: 0.75s; --delay: -0.15s; --length: 65px;  --sway: 5px; }
.rain .drop:nth-child(9)  { left: 17%; --duration: 1.15s; --delay: -0.80s; --length: 105px; --sway: 3px; }
.rain .drop:nth-child(10) { left: 19%; --duration: 0.95s; --delay: -0.55s; --length: 85px;  --sway: 4px; }
.rain .drop:nth-child(11) { left: 21%; --duration: 0.88s; --delay: -0.35s; --length: 78px;  --sway: 2px; }
.rain .drop:nth-child(12) { left: 23%; --duration: 1.05s; --delay: -0.65s; --length: 92px;  --sway: 5px; }
.rain .drop:nth-child(13) { left: 25%; --duration: 0.82s; --delay: -0.25s; --length: 72px;  --sway: 3px; }
.rain .drop:nth-child(14) { left: 27%; --duration: 1.08s; --delay: -0.75s; --length: 98px;  --sway: 4px; }
.rain .drop:nth-child(15) { left: 29%; --duration: 0.72s; --delay: -0.12s; --length: 62px;  --sway: 2px; }
.rain .drop:nth-child(16) { left: 31%; --duration: 1.25s; --delay: -0.90s; --length: 115px; --sway: 5px; }
.rain .drop:nth-child(17) { left: 33%; --duration: 0.92s; --delay: -0.45s; --length: 82px;  --sway: 3px; }
.rain .drop:nth-child(18) { left: 35%; --duration: 0.78s; --delay: -0.18s; --length: 68px;  --sway: 4px; }
.rain .drop:nth-child(19) { left: 37%; --duration: 1.12s; --delay: -0.82s; --length: 102px; --sway: 2px; }
.rain .drop:nth-child(20) { left: 39%; --duration: 0.86s; --delay: -0.28s; --length: 76px;  --sway: 5px; }
.rain .drop:nth-child(21) { left: 41%; --duration: 1.00s; --delay: -0.50s; --length: 88px;  --sway: 3px; }
.rain .drop:nth-child(22) { left: 43%; --duration: 0.76s; --delay: -0.14s; --length: 66px;  --sway: 4px; }
.rain .drop:nth-child(23) { left: 45%; --duration: 1.18s; --delay: -0.85s; --length: 108px; --sway: 2px; }
.rain .drop:nth-child(24) { left: 47%; --duration: 0.90s; --delay: -0.42s; --length: 80px;  --sway: 5px; }
.rain .drop:nth-child(25) { left: 49%; --duration: 0.84s; --delay: -0.22s; --length: 74px;  --sway: 3px; }
.rain .drop:nth-child(26) { left: 51%; --duration: 1.06s; --delay: -0.68s; --length: 96px;  --sway: 4px; }
.rain .drop:nth-child(27) { left: 53%; --duration: 0.74s; --delay: -0.10s; --length: 64px;  --sway: 2px; }
.rain .drop:nth-child(28) { left: 55%; --duration: 1.15s; --delay: -0.78s; --length: 104px; --sway: 5px; }
.rain .drop:nth-child(29) { left: 57%; --duration: 0.95s; --delay: -0.60s; --length: 86px;  --sway: 3px; }
.rain .drop:nth-child(30) { left: 59%; --duration: 1.02s; --delay: -0.38s; --length: 90px;  --sway: 4px; }
.rain .drop:nth-child(31) { left: 61%; --duration: 0.88s; --delay: -0.32s; --length: 78px;  --sway: 2px; }
.rain .drop:nth-child(32) { left: 63%; --duration: 1.10s; --delay: -0.72s; --length: 100px; --sway: 5px; }
.rain .drop:nth-child(33) { left: 65%; --duration: 0.80s; --delay: -0.16s; --length: 70px;  --sway: 3px; }
.rain .drop:nth-child(34) { left: 67%; --duration: 1.04s; --delay: -0.58s; --length: 94px;  --sway: 4px; }
.rain .drop:nth-child(35) { left: 69%; --duration: 0.78s; --delay: -0.24s; --length: 68px;  --sway: 2px; }
.rain .drop:nth-child(36) { left: 71%; --duration: 1.22s; --delay: -0.88s; --length: 112px; --sway: 5px; }
.rain .drop:nth-child(37) { left: 73%; --duration: 0.92s; --delay: -0.48s; --length: 84px;  --sway: 3px; }
.rain .drop:nth-child(38) { left: 75%; --duration: 0.76s; --delay: -0.08s; --length: 66px;  --sway: 4px; }
.rain .drop:nth-child(39) { left: 77%; --duration: 1.14s; --delay: -0.80s; --length: 106px; --sway: 2px; }
.rain .drop:nth-child(40) { left: 79%; --duration: 0.86s; --delay: -0.34s; --length: 76px;  --sway: 5px; }
.rain .drop:nth-child(41) { left: 81%; --duration: 0.98s; --delay: -0.52s; --length: 88px;  --sway: 3px; }
.rain .drop:nth-child(42) { left: 83%; --duration: 0.72s; --delay: -0.06s; --length: 62px;  --sway: 4px; }
.rain .drop:nth-child(43) { left: 85%; --duration: 1.16s; --delay: -0.84s; --length: 108px; --sway: 2px; }
.rain .drop:nth-child(44) { left: 87%; --duration: 0.90s; --delay: -0.44s; --length: 80px;  --sway: 5px; }
.rain .drop:nth-child(45) { left: 89%; --duration: 0.82s; --delay: -0.26s; --length: 74px;  --sway: 3px; }
.rain .drop:nth-child(46) { left: 91%; --duration: 1.08s; --delay: -0.70s; --length: 96px;  --sway: 4px; }
.rain .drop:nth-child(47) { left: 93%; --duration: 0.76s; --delay: -0.12s; --length: 64px;  --sway: 2px; }
.rain .drop:nth-child(48) { left: 95%; --duration: 1.20s; --delay: -0.86s; --length: 110px; --sway: 5px; }
.rain .drop:nth-child(49) { left: 97%; --duration: 0.94s; --delay: -0.56s; --length: 86px;  --sway: 3px; }
.rain .drop:nth-child(50) { left: 99%; --duration: 1.00s; --delay: -0.36s; --length: 90px;  --sway: 4px; }

@media (prefers-reduced-motion: reduce) {
  .rain { display: none; }
}
