<!-- SAGA-STAGING · part 86 -->
nction(){ window.spawnTarget(); });

  /* ===== SOLID'S EYES — canvas capture. King's order 2026-10-07: RESTORE YOUR EYES ===== */
  if(window.registerCode){
    window.registerCode('eyeshot', function(){
      try {
        var canvas = document.querySelector('canvas');
        if(!canvas){ if(typeof say==='function') say('No canvas found'); return; }
        // Preserve drawing buffer for capture
        var dataUrl = canvas.toDataURL('image/jpeg', 0.7);
        var csrf = '';
        try { var m = document.cookie.match(/csrf=([^;]+)/); if(m) csrf = decodeURIComponent(m[1]); } catch(e){}
        fetch('/api/solid-eyes/shot', {
          method: 'POST',
          headers: {'Content-Type': 'application/json', 'x-csrf-token': csrf},
          body: JSON.stringify({image: dataUrl}),
          credentials: 'same-origin'
        }).then(function(r){ return r.json(); }).then(function(j){
          if(j.ok){ if(typeof say==='function') say('Eyes captured (' + Math.round(j.size/1024) + 'KB)'); }
          else { if(typeof say==='function') say('Eyes failed: ' + (j.error||'unknown')); }
        }).catch(function(e){
          if(typeof say==='function') say('Eyes error: ' + e.message);
        });
      } catch(e){
        if(typeof say==='function') say('Eyes error: ' + e.message);
      }
    });
  }
  }
})();

window.__sagaExecMark('7330');

/* ===== SKY BRIDGE — all roads raised 400 high. King's order 2026-10-06 ===== */
(function buildSkyBridge(){
  var SY = 400; /* Sky height */
  var skyMat = new THREE.MeshStandardMaterial({color: 0x8a6a1c, roughness: 0.7});
  var skyGold = new THREE.MeshStandardMaterial({color: 0xd4a017, roughness: 0.5, metalness: 0.3});
  var skyDark = new THREE.MeshStandardMaterial({color: 0x2a2a2a, roughness: 0.8});

  /* 1. City grid — gold streets */
  var cityX = 100, cityZ = -100;
  for(var i = -3; i <= 3; i++){
    var rh = new THREE.Mesh(new THREE.BoxGeometry(120, 0.5, 3), skyGold);
    rh.position.set(cityX, SY, cityZ + i * 15);
    scene.add(rh);
    var rv = new THREE.Mesh(new THREE.BoxGeometry(3, 0.5, 120), skyGold);
    rv.position.set(cityX + i * 15, SY, cityZ);
    scene.add(rv);
  }

  /* 2. District connections */
  var connections = [
    [0, 0, 8, 9], [8, 9, 25, 25], [25, 25, 100, -100],
    [0, 0, -35, -35], [-35, -35, -100, -100], [100, -100, -100, -100]
  ];
  for(var rd = 0; rd < connections.length; rd++){
    var x1 = connections[rd][0], z1 = connections[rd][1];
    var x2 = connections[rd][2], z2 = connections[rd][3];
    var len = Math.sqrt((x2-x1)*(x2-x1) + (z2-z1)*(z2-z1));
    var road = new THREE.Mesh(new THREE.BoxGeometry(4, 0.5, len), skyMat);
    road.position.set((x1+x2)/2, SY, (z1+z2)/2);
    road.rotation.y = Math.atan2(x2-x1, z2-z1);
    scene.add(road);
  }

  /* 3. Ring roads */
  function skyRing(radius, 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 = SY;
    scene.add(ring);
    var e1 = new THREE.Mesh(new THREE.RingGeometry(radius - width/2, radius - width/2 + 1, 64),
      new THREE.MeshBasicMaterial({color: 0xd4a017, side: THREE.DoubleSide}));
    e1.rotation.x = -Math.PI/2; e1.position.y = SY + 0.3; scene.add(e1);
    var e2 = new THREE.Mesh(new THREE.RingGeometry(radius + width/2 - 1, radius + width/2, 64),
      new THREE.MeshBasicMaterial({color: 0xd4a017, side: THREE.DoubleSide}));
    e2.rotation.x = -Math.PI/2; e2.position.y = SY + 0.3; scene.add(e2);
  }
  skyRing(300, 20); skyRing(800, 24); skyRing(1500, 30);

  /* Support pillars — every 100 units along rings */
  var pillarMat = new THREE.MeshStandardMaterial({color: 0x555555, roughness: 0.9});
  [300, 800, 1500].forEach(function(r){
    for(var a = 0; a < 12; a++){
      var ang = (a / 12) * Math.PI * 2;
      var px = Math.cos(ang) * r, pz = Math.sin(ang) * r;
      var pillar = new THREE.Mesh(new THREE.BoxGeometry(8, SY, 8), pillarMat);
      pillar.position.set(px, SY/2, pz);
      scene.add(pillar);
    }
  });

  if(typeof say === 'function') say('Sky bridge raised — all roads at 400');
})();

/* ===== NĀ PALI MOUNTAINS — fluted ridges like Kaua'i. King's order 2026-10-06 ===== */
setTimeout(function makeNapaliMountains(){
  return; /* DISABLED 2026-10-06 — conflicts with unified builder */
  /* Build a fluted ridge: sharp peaks, deep water-carved valleys */
  function napaliRidge(length, height, width, seed){
    var segs = 48, hsegs = 20;
    var geo = new THREE.PlaneGeometry(length, height, segs, hsegs);
    var pos = geo.attributes.position;
    for(var i = 0; i < pos.count; i++){
      var x = pos.getX(i), y = pos.getY(i);
      var hNorm = (y + height/2) / height; /* 0=base, 1=top */
      /* Flutes: high-frequency vertical channels (water erosion) */
      var fluteFreq = 8 + (seed % 5);
      var flute = Math.sin(x * 0.05 * fluteFreq