<!-- SAGA-SOLID · part 85 -->
;
            // Damage
            if(window._lockedTarget.userData){
              window._lockedTarget.userData.hp -= 34;
              if(window._lockedTarget.userData.hp <= 0){
                scene.remove(window._lockedTarget);
                var idx = window._targets.indexOf(window._lockedTarget);
                if(idx >= 0) window._targets.splice(idx, 1);
                window._lockedTarget = null;
                window._inBattle = false;
                hideLock();
                if(window.say) window.say('Target destroyed.');
              } else {
                if(window.say) window.say('Hit!');
              }
            }
            // Explosion flash
            var exp = new THREE.Mesh(
              new THREE.SphereGeometry(2, 10, 10),
              new THREE.MeshBasicMaterial({color:0xffcc00, transparent:true, opacity:0.8})
            );
            exp.position.copy(ball.position);
            scene.add(exp);
            setTimeout(function(){ scene.remove(exp); }, 300);
          }
        }, 50);
        return;
      }catch(e){}
    }
    // No lock: use original forward fire
    if(origFire) origFire();
  };

  // Register 'target' code
  if(window.registerCode){
    window.registerCode('target', function(){ window.spawnTarget(); });

  /* ===== SOLID'S EYES — canvas capture. King's order 2026-10-07: RESTORE YOUR EYES ===== */
CODES['eyeshot'] = {cat:'Solid', desc:'Capture canvas for Solid Eyes', fn: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 pi