 - dt);
          for (let i = state.rainLines.length - 1; i >= 0; i--) {
            const r = state.rainLines[i];
            r.y += r.spd * (dt / 1000);
            r.x += r.spd * 0.06 * (dt / 1000);
            if (r.y - r.len > H) { state.rainLines.splice(i, 1); }
          }
          while (state.rainLines.length < 90) spawnRainLine();
          updateHUD();
        }

        function drawBackground(ctx, w, h) {
          const g = ctx.createRadialGradient(w*0.3, h*0.05, 10, w*0.3, h*0.05, Math.max(