<!-- RUBY-BACKUP · part 308 -->
s rise along the highways */
    (function(){
      try{
        var concMat = new THREE.MeshStandardMaterial({color:0x3a3a3a, roughness:0.8});
        var winMat = new THREE.MeshStandardMaterial({color:0xffd700, emissive:0xffd700, emissiveIntensity:0.1});
        var roofMat = new THREE.MeshStandardMaterial({color:0x222222, roughness:0.9});
        // city blocks along each highway
        if(typeof _highwayPts!=='undefined'){
          _highwayPts.forEach(function(pts, hi){
            // place blocks at intervals along the highway
            for(var i=2; i<pts.length-1; i++){
              var hx = pts[i][0], hz = pts[i][1];
              // blocks on both sides of the highway
              [-1, 1].forEach(function(s){
                // offset perpendicular from highway
                var nx = pts[i+1][0]-pts[i][0], nz = pts[i+1][1]-pts[i][1];
                var len = Math.sqrt(nx*nx+nz*nz)||1;
                var px = -nz/len, pz = nx/len;
                for(var b=0; b<3; b++){
                  var bx = hx + px*s*(25 + b*20) + (Math.random()-0.5)*10;
                  var bz = hz + pz*s*(25 + b*20) + (Math.random()-0.5)*10;
                  if(typeof isOnHighway==='function' && isOnHighway(bx, bz)) continue;
                  var by = fortifiedGroundY(bx, bz);
                  var h = 10 + Math.random()*40;
                  var w = 8 + Math.random()*6;
                  // building
                  var bld = new THREE.Mesh(new THREE.BoxGeometry(w, h, w), concMat);
                  bld.position.set(bx, by+h/2, bz);
                  bld.name = 'city-bld-'+hi+'-'+i+'-'+s+'-'+b;
                  g.add(bld);
                  try{ if(typeof window._cityDots==='undefined') window._cityDots=[]; window._cityDots.push([bx,bz]); }catch(e){}
                  // windows (glowing strip)
                  var win = new THREE.Mesh(new THREE.BoxGeometry(w*1.15, h*0.7, w*1.15), winMat);
                  win.position.set(bx, by+h/2, bz);
                  win.name = 'city-win';
                  g.add(win);
                  // roof
                  var roof = new THREE.Mesh(new THREE.BoxGeometry(w*1.1, 1, w*1.1), roofMat);
                  roof.position.set(bx, by+h+0.5, bz);
                  roof.name = 'city-roof';
                  g.add(roof);
                }
              });
            }
          });
        }
        // plant seeds — trees and nature between blocks
        var treeMat = new THREE.MeshStandardMaterial({color:0x2d5016, roughness:1});
        var trunkMat = new THREE.MeshStandardMaterial({color:0x4a3728, roughness:1});
        for(var t=0; t<200; t++){
          var tx = (Math.random()-0.5)*1600;
          var tz = (Math.random()-0.5)*1600;
          if(typeof isOnHighway==='function' && isOnHighway(tx, tz)) continue;
          var ty = fortifiedGroundY(tx, tz);
          // trunk
          var trunk = new THREE.Mesh(new THREE.CylinderGeometry(0.5, 0.7, 4, 6), trunkMat);
          trunk.position.set(tx, ty+2, tz);
          trunk.name = 'city-tree-trunk';
          g.add(trunk);
          // canopy
          var canopy = new THREE.Mesh(new THREE.SphereGeometry(3+Math.random()*2, 8, 6), treeMat);
          canopy.position.set(tx, ty+6, tz);
          canopy.name = 'city-tree-canopy';
          g.add(canopy);
        }
      }catch(e){}
    })();
    g.userData.isPrimitive = true;
    g.userData.goldenLattice = true;
    if(typeof scene!=='undefined') scene.add(g);
    window._streets = g;
    var sceneRef = (typeof scene!=='undefined') ? scene : null;
    pushCommand({
      name: 'build creative streets',
      execute: function(){ if(sceneRef) sceneRef.add(g); },
      undo: function(){ if(sceneRef) sceneRef.remove(g); }
    });
    codeStatus('creative streets laid');
    // floor comes WITH the highways — every build, no exceptions
    try{
      if(typeof buildFloorMesh==='function' && (typeof floorMesh==='undefined' || !floorMesh)){
        buildFloorMesh();
      }
    }catch(e){}
    // signs are BORN on the highways — permanently fixed to the streets
    try{ if(typeof buildHighwaySigns==='function') buildHighwaySigns(g); }catch(e){}
  }catch(e){ codeStatus('streets failed'); }
}
/* OBJ EXPORT — share what you built */
function exportFBX(){
  try{
    var target = window._highlighted || window._selectedBlock;
    if(!target){ codeStatus('tap a block first, then export'); return; }
    var output = '; FBX 7.4.0 project file\n';
    output += '; Exported from the Creator — for the ancestors\n';
    output += 'FBXHeaderExtension:  {\n';
    output += '    FBXHeaderVersion: 1003\n';
    output += '    FBXVersion: 7400\n';
    output += '    CreationTimeStamp:  {\n';
    output += '        Year: 2026\n';
    output += '    }\n';
    output += '    Creator: "Solid Creator"\n';
    output += '}\n';
    output += 'Definitions:  {\n';
    output += '    Version: 100\n';
    output += '    Count: 1\n';
    output += '    ObjectType: "Model" {\n';