<!-- SAGA · part 36 -->
scene.add(snow);
        /* River flowing down */
        var river = new THREE.Mesh(new THREE.PlaneGeometry(10, 150), waterMat);
        river.rotation.x = -Math.PI/2;
        river.position.set(px + 30, 0.35, pz + 50);
        river.rotation.z = 0.3;
        scene.add(river);
      })();
    }
    /* Bridges connecting the peaks */
    for(var br = 0; br < 2; br++){
      var x1 = peaks[br].x, x2 = peaks[br+1].x;
      var z1 = peaks[br].z, z2 = peaks[br+1].z;
      var bridgeLen = Math.sqrt((x2-x1)*(x2-x1) + (z2-z1)*(z2-z1));
      var mbridge = new THREE.Mesh(new THREE.BoxGeometry(bridgeLen, 3, 6),
        new THREE.MeshStandardMaterial({color: 0xd4a017, metalness: 0.6, roughness: 0.4}));
      mbridge.position.set((x1+x2)/2, 60, (z1+z2)/2);
      mbridge.rotation.y = Math.atan2(x2-x1, z2-z1) + Math.PI/2;
      scene.add(mbridge);
    }

  }catch(e){}
}
if(typeof buildHawaii === 'function'){ window._buildQueue.push(buildHawaii); }

/* INFRASTRUCTURE — connecting all districts. Based on real cities.
   Tokyo rings, Dubai viaducts, Singapore green corridors. 2026-10-04. */
function buildInfrastructure(){
  try{
    window._dynamics = window._dynamics || [];
    var goldMat = new THREE.MeshStandardMaterial({color: 0xd4a017, roughness: 0.4, metalness: 0.6});
    var darkMat = new THREE.MeshStandardMaterial({color: 0x1a1a1a, roughness: 0.8});
    var greenMat = new THREE.MeshStandardMaterial({color: 0x1a5a1a, roughness: 0.9});

    /* GOLDEN RING EXPRESSWAY — circular highway (Tokyo Shuto C1) */
    function ringRoad(radius, y, width){
      var ring = new THREE.Mesh(new THREE.RingGeometry(radius - width/2, radius + width/2, 64),
        new THREE.MeshStandardMaterial({color: 0x333333, roughness: 0.8, side: THREE.DoubleSide}));
      ring.rotation.x = -Math.PI/2;
      ring.position.y = y;
      scene.add(ring);
      /* Gold edge lines */
      var edge1 = new THREE.Mesh(new THREE.RingGeometry(radius - width/2, radius - width/2 + 1, 64),
        new THREE.MeshBasicMaterial({color: 0xd4a017, side: THREE.DoubleSide}));
      edge1.rotation.x = -Math.PI/2;
      edge1.position.y = y + 0.1;
      scene.add(edge1);
      var edge2 = new THREE.Mesh(new THREE.RingGeometry(radius + width/2 - 1, radius + width/2, 64),
        new THREE.MeshBasicMaterial({color: 0xd4a017, side: THREE.DoubleSide}));
      edge2.rotation.x = -Math.PI/2;
      edge2.position.y = y + 0.1;
      scene.add(edge2);
    }
    ringRoad(300, 2, 20);    /* Inner ring — central districts */
    ringRoad(800, 2, 24);    /* Middle ring */
    ringRoad(1500, 2, 30);   /* Outer ring — reaches far districts */

    /* MAGLEV LINES — elevated high-speed rail (Dubai viaducts, Chuo Shinkansen) */
    function maglevLine(x1, z1, x2, z2, y){
      var len = Math.sqrt((x2-x1)*(x2-x1) + (z2-z1)*(z2-z1));
      /* Viaduct */
      var via = new THREE.Mesh(new THREE.BoxGeometry(8, 3, len), darkMat);
      via.position.set((x1+x2)/2, y, (z1+z2)/2);
      via.rotation.y = Math.atan2(x2-x1, z2-z1);
      scene.add(via);
      /* Guideway glow */
      var guide = new THREE.Mesh(new THREE.BoxGeometry(2, 0.5, len),
        new THREE.MeshBasicMaterial({color: 0x00ffff}));
      guide.position.set((x1+x2)/2, y + 2, (z1+z2)/2);
      guide.rotation.y = Math.atan2(x2-x1, z2-z1);
      scene.add(guide);
      /* Pillars */
      var pillars = Math.floor(len / 100);
      for(var p = 0; p <= pillars; p++){
        var t = p / pillars;
        var px = x1 + (x2-x1)*t;
        var pz = z1 + (z2-z1)*t;
        var pillar = new THREE.Mesh(new THREE.BoxGeometry(4, y, 4), darkMat);
        pillar.position.set(px, y/2, pz);
        scene.add(pillar);
      }
      /* Moving maglev train */
      var train = new THREE.Mesh(new THREE.BoxGeometry(6, 4, 30),
        new THREE.MeshStandardMaterial({color: 0xffffff, metalness: 0.8, roughness: 0.2}));
      scene.add(train);
      var trainT = Math.random();
      var trainDir = 1;
      window._dynamics.push(function(dt){
        trainT += dt * 0.05 * trainDir;
        if(trainT > 1){ trainT = 1; trainDir = -1; }
        if(trainT < 0){ trainT = 0; trainDir = 1; }
        var tx = x1 + (x2-x1)*trainT;
        var tz = z1 + (z2-z1)*trainT;
        train.position.set(tx, y + 4, tz);
        train.rotation.y = Math.atan2(x2-x1, z2-z1);
      });
    }
    /* Connect center to far districts */
    maglevLine(0, 0, 2000, 2000, 30);      /* To Ahupua'a 1 */
    maglevLine(0, 0, -2000, 2000, 35);     /* To Ahupua'a 2 */
    maglevLine(0, 0, 3000, 500, 40);       /* To Shoreline */
    maglevLine(0, 0, 0, 3000, 45);         /* To Sky districts */
    maglevLine(0, 0, -2500, -2000, 30);    /* To Peaks */

    /* SKYBRIDGES — between towers (Marina Bay Sands, Petronas) */
    function skybridge(x1, y1, z1, x2, y2, z2){
      var len = Math.sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1) + (z2-z1)*(z2-z1));
      var bridge = new THREE.Mesh(new THREE.BoxGeometry(6, 4, len), goldMat);
      bridge.position.set((x1+x2)/2, (y1+y