<!-- LIVE · part 36 -->
rved mountain chain — stretched and bent */

    /* Lakes in valleys */
    function lake(x, z, r){
      var lk = new THREE.Mesh(new THREE.CircleGeometry(r, 24), waterMat);
      lk.rotation.x = -Math.PI/2;
      lk.position.set(x, 0.4, z);
      scene.add(lk);
      /* Shoreline */
      var shore = new THREE.Mesh(new THREE.RingGeometry(r, r+5, 24),
        new THREE.MeshStandardMaterial({color: 0xd4b896, roughness: 1}));
      shore.rotation.x = -Math.PI/2;
      shore.position.set(x, 0.35, z);
      scene.add(shore);
      /* Gentle waves */
      var ph = Math.random() * 10;
      window._dynamics.push(function(t){
        waterMat.opacity = 0.6 + Math.sin(t * 0.8 + ph) * 0.15;
      });
    }

    /* Rivers connecting */
    function river(x1, z1, x2, z2){
      var len = Math.sqrt((x2-x1)*(x2-x1) + (z2-z1)*(z2-z1));
      var rv = new THREE.Mesh(new THREE.PlaneGeometry(12, len), waterMat);
      rv.rotation.x = -Math.PI/2;
      rv.position.set((x1+x2)/2, 0.38, (z1+z2)/2);
      rv.rotation.z = Math.atan2(x2-x1, z2-z1);
      scene.add(rv);
    }

    /* Build scenic areas */
    lake(-2000, -3500, 120);
    lake(-1500, -3200, 80);
    river(-2000, -3500, -1500, -3200);

    lake(2000, 3500, 150);
    river(2000, 3500, 2500, 3800);

    lake(4200, 300, 100);

    lake(-4200, 200, 130);
    lake(-4000, 600, 90);
    river(-4200, 200, -4000, 600);

    /* Waterfalls — from mountains to lakes */
    function waterfall(x, y, z){
      var fall = new THREE.Mesh(new THREE.PlaneGeometry(15, 80),
        new THREE.MeshBasicMaterial({color: 0xaaddff, transparent: true, opacity: 0.6, side: THREE.DoubleSide}));
      fall.position.set(x, y - 40, z);
      scene.add(fall);
      window._dynamics.push(function(t){
        fall.material.opacity = 0.5 + Math.sin(t * 3) * 0.15;
      });
    }
    waterfall(-2000, 200, -3580);
    waterfall(2000, 220, 3580);

  }catch(e){ console.error(e); }
}
if(typeof buildScenic === 'function'){ try{ buildScenic(); }catch(e){ console.error(e); } }

/* TOPOGRAPHY WOVEN IN — real Earth shapes in the districts. 2026-10-04.
   Shield volcanoes (Hawaii), stratovolcanoes (Fuji), canyon layers, sea cliffs. */
function buildTopographyWoven(){
  try{
    var basaltMat = new THREE.MeshStandardMaterial({color: 0x2a2a2a, roughness: 0.95});
    var greenMat = new THREE.MeshStandardMaterial({color: 0x1a5a1a, roughness: 0.9});
    var sandstoneMat = new THREE.MeshStandardMaterial({color: 0xc4844a, roughness: 0.9});
    var limestoneMat = new THREE.MeshStandardMaterial({color: 0xd4c4a0, roughness: 0.85});
    var shaleMat = new THREE.MeshStandardMaterial({color: 0x8a7a6a, roughness: 0.95});

    /* SHIELD VOLCANO — broad dome, gentle slopes (Hawaii/Mauna Loa: 2-10 deg) */
    function shieldVolcano(x, z, r, h){
      var segments = 16;
      for(var i = 0; i < segments; i++){
        var t = i / segments;
        var rr = r * (1 - t);
        var yy = h * Math.pow(1 - t, 1.5); /* Gentle dome curve */
        var ring = new THREE.Mesh(new THREE.CylinderGeometry(rr, rr + r/segments, h/segments, 24), basaltMat);
        ring.position.set(x, yy, z);
        scene.add(ring);
      }
      /* Caldera at summit */
      var caldera = new THREE.Mesh(new THREE.CylinderGeometry(r*0.15, r*0.2, 10, 16), basaltMat);
      caldera.position.set(x, h, z);
      scene.add(caldera);
      /* Vegetation zones — green at base, bare at top */
      for(var v = 0; v < 20; v++){
        var vt = Math.random() * 0.6; /* Only lower 60% */
        var vr = r * (1 - vt) * 0.9;
        var va = Math.random() * Math.PI * 2;
        var vx = x + Math.cos(va) * vr;
        var vz = z + Math.sin(va) * vr;
        var vy = h * Math.pow(1 - vt, 1.5);
        var tree = new THREE.Mesh(new THREE.ConeGeometry(3, 8, 6), greenMat);
        tree.position.set(vx, vy + 4, vz);
        scene.add(tree);
      }
    }

    /* STRATOVOLCANO — concave cone, steep at top (Fuji: 35-40 deg summit) */
    function stratovolcano(x, z, r, h){
      var pts = [];
      var segs = 20;
      for(var i = 0; i <= segs; i++){
        var t = i / segs;
        /* Concave profile: steep at top, flat at base */
        var pr = r * Math.pow(1 - t, 1.8);
        var py = h * t;
        pts.push(new THREE.Vector2(Math.max(pr, 0.1), py));
      }
      var geo = new THREE.LatheGeometry(pts, 24);
      var mtn = new THREE.Mesh(geo, new THREE.MeshStandardMaterial({color: 0x4a4a4a, roughness: 0.9}));
      mtn.position.set(x, 0.13, z);
      scene.add(mtn);
      /* Snow cap */
      var cap = new THREE.Mesh(new THREE.ConeGeometry(r*0.25, h*0.25, 16),
        new THREE.MeshStandardMaterial({color: 0xffffff, roughness: 0.3}));
      cap.position.set(x, h - h*0.12, z);
      scene.add(cap);
      /* Radial gullies */
      for(var g = 0; g < 8; g++){
        var ga = (g / 8) * Math.PI * 2;
        var gully = new THREE.Mesh(new THREE.BoxGeometry(4, h*0.6, 8), basaltMat);
        gully.position.set(x + Math.cos(ga)*r*0.5, h*0.3, z + Math.