<!-- RUBY-BACKUP · part 528 -->
           hl.position.set(0, 0, 3.2);
              car.add(hl);
              g.add(car);
              window._traffic.push({mesh:car, hw:hi, t:Math.random(), speed:0.02+Math.random()*0.03, dir:Math.random()>0.5?1:-1});
            }
          });
        }
        /* animate traffic */
        setInterval(function(){
          try{
            window._traffic.forEach(function(tc){
              tc.t += tc.speed * tc.dir * 0.016;
              if(tc.t > 1) tc.t = 0;
              if(tc.t < 0) tc.t = 1;
              var pts = _highwayPts[tc.hw];
              var seg = Math.floor(tc.t * (pts.length-1));
              var ft = (tc.t * (pts.length-1)) - seg;
              if(seg >= pts.length-1){ seg = pts.length-2; ft = 1; }
              var ax = pts[seg][0], az = pts[seg][1];
              var bx = pts[seg+1][0], bz = pts[seg+1][1];
              var cx = ax + (bx-ax)*ft, cz = az + (bz-az)*ft;
              var cy = 12;
              if(typeof fortifiedGroundY==='function') cy = fortifiedGroundY(cx, cz) + 2;
              tc.mesh.position.set(cx, cy, cz);
              /* face direction */
              var ang = Math.atan2(bx-ax, bz-az);
              tc.mesh.rotation.y = ang + (tc.dir<0 ? Math.PI : 0);
            });
          }catch(e){}
        }, 50);
      }catch(e){}
    })();
    /* THE CITY — dense blocks 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(){