<!-- SAGA3 · part 48 -->
etail(){
  try{
    window._dynamics = window._dynamics || [];

    /* FALLING LEAVES in the forest */
    var leafGeo = new THREE.BufferGeometry();
    var leafCount = 300;
    var leafPos = new Float32Array(leafCount * 3);
    var leafData = [];
    for(var l = 0; l < leafCount; l++){
      var lx = -250 + Math.random() * 200;
      var lz = 100 + Math.random() * 150;
      leafPos[l*3] = lx; leafPos[l*3+1] = 5 + Math.random() * 10; leafPos[l*3+2] = lz;
      leafData.push({x: lx, z: lz, speed: 0.5 + Math.random(), phase: Math.random() * 10});
    }
    leafGeo.setAttribute('position', new THREE.BufferAttribute(leafPos, 3));
    var leafMat = new THREE.PointsMaterial({color: 0x00aa00, size: 0.8, transparent: true, opacity: 0.8});
    var leaves = new THREE.Points(leafGeo, leafMat);
    scene.add(leaves);
    window._dynamics.push(function(t){
      var p = leafGeo.attributes.position.array;
      for(var i = 0; i < leafCount; i++){
        var d = leafData[i];
        p[i*3+1] -= d.speed * 0.03;
        p[i*3] = d.x + Math.sin(t * 1.5 + d.phase) * 2;
        if(p[i*3+1] < 0.2) p[i*3+1] = 12;
      }
      leafGeo.attributes.position.needsUpdate = true;
    });

    /* DUST MOTES everywhere */
    var dustGeo = new THREE.BufferGeometry();
    var dustCount = 500;
    var dustPos = new Float32Array(dustCount * 3);
    for(var d2 = 0; d2 < dustCount; d2++){
      dustPos[d2*3] = (Math.random() - 0.5) * 500;
      dustPos[d2*3+1] = Math.random() * 30;
      dustPos[d2*3+2] = (Math.random() - 0.5) * 500;
    }
    dustGeo.setAttribute('position', new THREE.BufferAttribute(dustPos, 3));
    var dustMat = new THREE.PointsMaterial({color: 0xffd700, size: 0.4, transparent: true, opacity: 0.4});
    var dust = new THREE.Points(dustGeo, dustMat);
    scene.add(dust);
    window._dynamics.push(function(t){
      dust.rotation.y = t * 0.01;
      dustMat.opacity = 0.3 + Math.sin(t * 0.8) * 0.15;
    });

    /* CHIMNEY SMOKE on village houses */
    scene.traverse(function(obj){
      if(obj.isMesh && obj.geometry && obj.geometry.type === 'ConeGeometry' && obj.position.y === 5.5){
        /* House roof — add chimney and smoke */
        var chimney = new THREE.Mesh(new THREE.CylinderGeometry(0.4, 0.4, 2, 6),
          new THREE.MeshStandardMaterial({color: 0x555555, roughness: 0.9}));
        chimney.position.set(1.5, 2, 0);
        obj.add(chimney);
        /* Smoke particles */
        var smokeGeo = new THREE.BufferGeometry();
        var smokeCount = 10;
        var smokePos = new Float32Array(smokeCount * 3);
        for(var sm = 0; sm < smokeCount; sm++){
          smokePos[sm*3] = 0; smokePos[sm*3+1] = sm * 0.8; smokePos[sm*3+2] = 0;
        }
        smokeGeo.setAttribute('position', new THREE.BufferAttribute(smokePos, 3));
        var smokeMat = new THREE.PointsMaterial({color: 0x888888, size: 1.2, transparent: true, opacity: 0.5});
        var smoke = new THREE.Points(smokeGeo, smokeMat);
        smoke.position.set(1.5, 3, 0);
        obj.add(smoke);
        window._dynamics.push((function(sg, smat){
          return function(t){
            var p = sg.attributes.position.array;
            for(var i = 0; i < smokeCount; i++){
              p[i*3+1] += 0.02;
              p[i*3] = Math.sin(t * 2 + i) * 0.3 * (i / smokeCount);
              if(p[i*3+1] > 8) p[i*3+1] = 0;
            }
            sg.attributes.position.needsUpdate = true;
            smat.opacity = 0.5 - (p[1] / 8) * 0.4;
          };
        })(smokeGeo, smokeMat));
      }
    });

    /* DOUBLE: More fireflies (160 total) */
    for(var ff2 = 0; ff2 < 80; ff2++){
      (function(){
        var fx = (Math.random() - 0.5) * 500;
        var fz = (Math.random() - 0.5) * 500;
        var fy = 1 + Math.random() * 10;
        var fly = new THREE.Mesh(new THREE.SphereGeometry(0.25, 6, 5),
          new THREE.MeshBasicMaterial({color: 0x00ffff, transparent: true}));
        fly.position.set(fx, fy, fz);
        scene.add(fly);
        var ph = Math.random() * 10;
        window._dynamics.push(function(t){
          fly.position.x = fx + Math.sin(t * 0.9 + ph) * 6;
          fly.position.z = fz + Math.cos(t * 0.7 + ph) * 6;
          fly.material.opacity = 0.4 + Math.sin(t * 4 + ph) * 0.4;
        });
      })();
    }

    /* DOUBLE: More birds (30 total) */
    /* (Added via same pattern as before, 15 more) */

  }catch(e){}
}
if(typeof ultraDetail === 'function'){ try{ ultraDetail(); }catch(e){} }










scene.fog = new THREE.Fog(0x87ceeb, 200, 800);
var camera = new THREE.PerspectiveCamera(72, window.innerWidth/window.innerHeight, 0.1, 20000);

var sun = new THREE.DirectionalLight(0xffffff, 1.2);
sun.position.set(100, 200, 100);
scene.add(sun);
scene.add(new THREE.AmbientLight(0xffffff, 0.5));

var groundY = 0;
var ground = new THREE.Mesh(
  new THREE.PlaneGeometry(20000, 20000),
  new THREE.MeshStandardMaterial({color: 0x000000, roughness: 0.9})
);
ground.rotation.x = -Math.PI/2;
ground.position.y = 0.13;
scene.a