<!-- RUBY-BACKUP · part 548 -->
RT — east, flat area
    (function(){
      var ax=300, az=200;
      // runway
      var runway = new THREE.Mesh(new THREE.BoxGeometry(200, 0.3, 20), new THREE.MeshStandardMaterial({color:0x2a2a2a}));
      runway.position.set(ax, 0.3, az);
      runway.name='runway';
      g.add(runway);
      // runway lights
      for(var i=0; i<10; i++){
        var light = new THREE.Mesh(new THREE.SphereGeometry(0.3, 8, 8),
          new THREE.MeshStandardMaterial({color:0x00ff00, emissive:0x00ff00, emissiveIntensity:1}));
        light.position.set(ax-90+i*20, 0.6, az+11);
        light.name='runway-light';
        g.add(light);
      }
      // terminal
      var term = new THREE.Mesh(new THREE.BoxGeometry(40, 12, 20), glassMat);
      term.position.set(ax, 6, az+30);
      term.name='airport-terminal';
      g.add(term);
      // control tower
      var tower = new THREE.Mesh(new THREE.CylinderGeometry(3, 4, 25, 8), concMat);
      tower.position.set(ax+30, 12.5, az+30);
      tower.name='control-tower';
      g.add(tower);
      var cab = new THREE.Mesh(new THREE.CylinderGeometry(5, 5, 4, 8), glassMat);
      cab.position.set(ax+30, 27, az+30);
      cab.name='tower-cab';
      g.add(cab);
      // sign
      var canvas=document.createElement('canvas');
      canvas.width=256; canvas.height=64;
      var ctx=canvas.getContext('2d');
      ctx.fillStyle='#0a0a0a'; ctx.fillRect(0,0,256,64);
      ctx.fillStyle='#88ccff'; ctx.font='bold 36px sans-serif';
      ctx.textAlign='center'; ctx.fillText('AIRPORT', 128, 44);
      var tex=new THREE.CanvasTexture(canvas);
      var sm=new THREE.Mesh(new THREE.BoxGeometry(24,5,0.5),
        new THREE.MeshStandardMaterial({map:tex}));
      sm.position.set(ax, 14, az+20);
      sm.name='airport-sign';
      g.add(sm);
    })();

    // SPACE PORT — far west, futuristic
    (function(){
      var sx=-500, sz=-300;
      // launch pad
      var pad = new THREE.Mesh(new THREE.CylinderGeometry(20, 22, 2, 24), concMat);
      pad.position.set(sx, 1, sz);
      pad.name='launch-pad';
      g.add(pad);
      // rocket
      var body = new THREE.Mesh(new THREE.CylinderGeometry(3, 3, 20, 12),
        new THREE.MeshStandardMaterial({color:0xdddddd, metalness:0.8, roughness:0.3}));
      body.position.set(sx, 12, sz);
      body.name='rocket-body';
      g.add(body);
      var nose = new THREE.Mesh(new THREE.ConeGeometry(3, 6, 12),
        new THREE.MeshStandardMaterial({color:0xcc0000, metalness:0.6}));
      nose.position.set(sx, 25, sz);
      nose.name='rocket-nose';
      g.add(nose);
      // fins
      for(var i=0; i<4; i++){
        var fin = new THREE.Mesh(new THREE.BoxGeometry(0.5, 6, 4),
          new THREE.MeshStandardMaterial({color:0xcc0000}));
        var a = i*Math.PI/2;
        fin.position.set(sx+Math.cos(a)*3.5, 4, sz+Math.sin(a)*3.5);
        fin.rotation.y = -a;
        fin.name='rocket-fin';
        g.add(fin);
      }
      // gantry
      var gantry = new THREE.Mesh(new THREE.BoxGeometry(4, 30, 4), redMat);
      gantry.position.set(sx+10, 15, sz);
      gantry.name='gantry';
      g.add(gantry);
      // glowing ring
      var ring = new THREE.Mesh(new THREE.TorusGeometry(25, 0.5, 8, 32),
        new THREE.MeshStandardMaterial({color:0x00ffff, emissive:0x00ffff, emissiveIntensity:0.8}));
      ring.position.set(sx, 2, sz);
      ring.rotation.x = Math.PI/2;
      ring.name='spaceport-ring';
      g.add(ring);
      // sign
      var canvas=document.createElement('canvas');
      canvas.width=256; canvas.height=64;
      var ctx=canvas.getContext('2d');
      ctx.fillStyle='#0a0a0a'; ctx.fillRect(0,0,256,64);
      ctx.fillStyle='#00ffff'; ctx.font='bold 32px sans-serif';
      ctx.textAlign='center'; ctx.fillText('SPACE PORT', 128, 44);
      var tex=new THREE.CanvasTexture(canvas);
      var sm=new THREE.Mesh(new THREE.BoxGeometry(24,5,0.5),
        new THREE.MeshStandardMaterial({map:tex}));
      sm.position.set(sx, 8, sz+25);
      sm.name='spaceport-sign';
      g.add(sm);
    })();

    g.userData.isPrimitive = true;
    if(typeof scene!=='undefined') scene.add(g);
    window._infra = g;
    if(typeof codeStatus==='function') codeStatus('infrastructure stands');
    if(typeof pushCommand==='function'){
      var sr=(typeof scene!=='undefined')?scene:null;
      pushCommand({name:'build infrastructure', execute:function(){ if(sr) sr.add(g); }, undo:function(){ if(sr) sr.remove(g); }});
    }
  }catch(e){
    if(typeof codeStatus==='function') codeStatus('infrastructure failed');
  }
}
setTimeout(function(){ try{ if(typeof buildInfrastructure==='function') buildInfrastructure(); }catch(e){} }, 4000);
/* TOPOGRAPHIC METRICS — the game watches itself, fixes its inconsistencies */
/* Terrain height function (must match buildFloorMesh) */
function getTerrainH(x, z){
  try{
    var h = Math.sin(x*0.01)*Math.cos(z*0.01)*8
          + Math.sin(x*0.03+1.7)*Math.cos(z*0.025+0.6)*4
          + Math.sin(x*0.08+4.2)*Math.cos(z*0.07+2.1)*1