<!-- SAGA-SOLID · part 42 -->
);
    var glassMat = new THREE.MeshStandardMaterial({color: 0xaaddff, transparent: true, opacity: 0.4});

    function station(x, z, name){
      var st = new THREE.Group();
      /* Platform */
      var plat = new THREE.Mesh(new THREE.BoxGeometry(30, 2, 12), steelMat);
      plat.position.y = 1;
      st.add(plat);
      /* Canopy */
      var canopy = new THREE.Mesh(new THREE.BoxGeometry(32, 0.5, 14), glassMat);
      canopy.position.y = 8;
      st.add(canopy);
      /* Pillars */
      for(var p = -1; p <= 1; p++){
        for(var q = -1; q <= 1; q += 2){
          var pillar = new THREE.Mesh(new THREE.CylinderGeometry(0.5, 0.5, 7, 8), steelMat);
          pillar.position.set(p*12, 4.5, q*6);
          st.add(pillar);
        }
      }
      /* Sign */
      var sign = new THREE.Mesh(new THREE.BoxGeometry(10, 2, 0.5),
        new THREE.MeshBasicMaterial({color: 0x00ffff}));
      sign.position.set(0, 10, 0);
      st.add(sign);
      st.position.set(x, 0.13, z);
      scene.add(st);
    }

    station(100, -80);    /* City Central */
    station(-80, 160);    /* Village */
    station(2000, 1980);  /* Ahupua'a */
    station(3000, 480);   /* Shoreline */

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

/* SCHOOLS — places of learning, for the children. 2026-10-04. */
function buildSchools(){
  try{
    var wallMat = new THREE.MeshStandardMaterial({color: 0xf0e0c0, roughness: 0.9});
    var roofMat = new THREE.MeshStandardMaterial({color: 0x2a5aaa, roughness: 0.8});

    function school(x, z){
      var sc = new THREE.Group();
      /* Main building */
      var main = new THREE.Mesh(new THREE.BoxGeometry(20, 8, 12), wallMat);
      main.position.y = 4;
      sc.add(main);
      /* Roof */
      var roof = new THREE.Mesh(new THREE.BoxGeometry(22, 1, 14), roofMat);
      roof.position.y = 8.5;
      sc.add(roof);
      /* Door */
      var door = new THREE.Mesh(new THREE.PlaneGeometry(3, 5),
        new THREE.MeshBasicMaterial({color: 0x8a5a2a}));
      door.position.set(0, 2.5, 6.01);
      sc.add(door);
      /* Windows — bright, welcoming */
      for(var w = -2; w <= 2; w++){
        if(w === 0) continue;
        var win = new THREE.Mesh(new THREE.PlaneGeometry(2, 2),
          new THREE.MeshBasicMaterial({color: 0xaaddff}));
        win.position.set(w*4, 5, 6.01);
        sc.add(win);
      }
      /* Playground */
      var yard = new THREE.Mesh(new THREE.CircleGeometry(15, 20),
        new THREE.MeshStandardMaterial({color: 0x4aaa4a, roughness: 1}));
      yard.rotation.x = -Math.PI/2;
      yard.position.set(18, 0.1, 0);
      sc.add(yard);
      /* Swing set */
      var frame = new THREE.Mesh(new THREE.BoxGeometry(6, 0.3, 0.3), wallMat);
      frame.position.set(18, 4, 0);
      sc.add(frame);
      for(var s = -1; s <= 1; s += 2){
        var leg = new THREE.Mesh(new THREE.CylinderGeometry(0.15, 0.15, 4, 6), wallMat);
        leg.position.set(18 + s*3, 2, 0);
        sc.add(leg);
        var swing = new THREE.Mesh(new THREE.BoxGeometry(1, 0.2, 1), roofMat);
        swing.position.set(18 + s*3, 2, 0);
        sc.add(swing);
      }
      sc.position.set(x, 0.13, z);
      scene.add(sc);
    }

    school(-80, 220);   /* Village school */
    school(140, -100);  /* City school */

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

/* MARKETS — gathering places with stalls. 2026-10-04. */
function buildMarkets(){
  try{
    var woodMat = new THREE.MeshStandardMaterial({color: 0x8a6a3a, roughness: 0.8});
    var canvasColors = [0xff0000, 0x00ff00, 0x0000ff, 0xffff00, 0xff8800];

    function stall(x, z, colorIdx, rot){
      var st = new THREE.Group();
      /* Table */
      var table = new THREE.Mesh(new THREE.BoxGeometry(4, 1, 3), woodMat);
      table.position.y = 1;
      st.add(table);
      /* Posts */
      for(var p = 0; p < 4; p++){
        var post = new THREE.Mesh(new THREE.CylinderGeometry(0.15, 0.15, 4, 6), woodMat);
        post.position.set(p < 2 ? -1.8 : 1.8, 2, p % 2 === 0 ? -1.3 : 1.3);
        st.add(post);
      }
      /* Canopy */
      var canopy = new THREE.Mesh(new THREE.BoxGeometry(4.5, 0.3, 3.5),
        new THREE.MeshStandardMaterial({color: canvasColors[colorIdx % canvasColors.length], roughness: 0.9}));
      canopy.position.y = 4;
      st.add(canopy);
      /* Goods */
      for(var g = 0; g < 5; g++){
        var good = new THREE.Mesh(new THREE.SphereGeometry(0.3, 8, 6),
          new THREE.MeshStandardMaterial({color: canvasColors[(colorIdx+g) % canvasColors.length]}));
        good.position.set((Math.random()-0.5)*3, 1.7, (Math.random()-0.5)*2);
        st.add(good);
      }
      st.position.set(x, 0.13, z);
      st.rotation.y = rot || 0;
      scene.add(st);
    }

    /* City market — 8 stalls in a row */
    for(var i = 0; i < 8; i++){
      stall(80 + i*8, -120, 