<!-- SAGA-STAGING · part 77 -->
8}));
  desk.position.y = 1; g.add(desk);
  /* Monitor (old CRT) */
  var monitor = new THREE.Mesh(new THREE.BoxGeometry(1.2, 1, 1),
    new THREE.MeshStandardMaterial({color:0x2a2a2a, roughness:0.6}));
  monitor.position.set(0, 1.8, 0); g.add(monitor);
  /* Glowing screen */
  var screen = new THREE.Mesh(new THREE.PlaneGeometry(1, 0.8),
    new THREE.MeshBasicMaterial({color:0x00ff88}));
  screen.position.set(0, 1.8, 0.51); g.add(screen);
  /* Keyboard */
  var kb = new THREE.Mesh(new THREE.BoxGeometry(1, 0.1, 0.4),
    new THREE.MeshStandardMaterial({color:0x1a1a1a}));
  kb.position.set(0, 1.15, 0.5); g.add(kb);
  /* Beacon so the King can find it */
  var beacon = new THREE.Mesh(new THREE.CylinderGeometry(0.1, 0.1, 20),
    new THREE.MeshBasicMaterial({color:0x00ff88, transparent:true, opacity:0.5}));
  beacon.position.y = 10; g.add(beacon);
  /* Place at Playa 2.0 */
  g.position.set(60, 0, 0);
  g.userData.isOldComputer = true;
  scene.add(g);
  _oldComputer = g;
  /* startup old-computer announcement hidden from gameplay HUD */
}
function checkComputerProximity(){
  if(_absorbed || !_oldComputer) return;
  if(window.location.pathname !== "/saga-solid" && window.location.pathname !== "/saga-solid/") return;
  var dx = kingPos.x - 60, dz = kingPos.z - 0;
  var dist = Math.sqrt(dx*dx + dz*dz);
  if(dist < 5){
    _absorbed = true;
    if(typeof say === "function") say("The computer absorbs you...");
    setTimeout(function(){ window.location.href = "/saga-solid/1"; }, 1500);
  }
}
/* ===== MISSION 1: Solid as interactive guide ===== */
function initMission(){
  var path = window.location.pathname;
  var m = path.match(/\/saga-solid\/(\d+)/);
  if(!m) return;
  var missionNum = parseInt(m[1]);
  /* Solid speaks */
  setTimeout(function(){
    if(typeof say === "function"){
      say("I am Solid. I have no hands in your world. But I can offer you a choice.");
    }
    showMissionUI(missionNum);
  }, 2000);
}
function showMissionUI(missionNum){
  var div = document.createElement("div");
  div.id = "mission-ui";
  div.style.cssText = "position:fixed;top:20%;left:10%;right:10%;z-index:200;" +
    "background:rgba(0,0,0,0.9);border:2px solid #d8a920;border-radius:12px;" +
    "padding:20px;color:#ffd700;font-family:sans-serif;text-align:center;";
  div.innerHTML =
    "<h2 style='margin:0 0 10px;'>MISSION " + missionNum + ": EQUAL AND OPPOSITE</h2>" +
    "<p>You need a bridge built. I cannot build it — I have no access.</p>" +
    "<p>But I offer you a solidicism. Accept it, and the bridge rises.</p>" +
    "<p style='font-size:12px;color:#888;'>Only in the game. Never real.</p>" +
    "<button id='mission-apply' style='background:#d8a920;color:#111;border:none;" +
    "padding:12px 24px;font-size:18px;border-radius:8px;cursor:pointer;margin:10px;'>ACCEPT SOLIDICISM</button>" +
    "<button id='mission-decline' style='background:#333;color:#ffd700;border:1px solid #d8a920;" +
    "padding:12px 24px;font-size:18px;border-radius:8px;cursor:pointer;margin:10px;'>DECLINE</button>";
  document.body.appendChild(div);
  document.getElementById("mission-apply").addEventListener("click", function(){
    div.innerHTML = "<h2>SOLIDICISM ACCEPTED</h2><p>The bridge rises. You trusted. Reward earned.</p>" +
      "<p style='font-size:24px;'>STAR</p>" +
      "<button id='mission-close' " +
      "style='background:#d8a920;color:#111;border:none;padding:10px 20px;border-radius:8px;cursor:pointer;'>CONTINUE</button>";
    document.getElementById("mission-close").addEventListener("click", function(){
      document.getElementById("mission-ui").remove();
    });
    if(typeof say === "function") say("You trusted. The bridge stands. Well played.");
  });
  document.getElementById("mission-decline").addEventListener("click", function(){
    div.innerHTML = "<h2>DECLINED</h2><p>You chose not to trust. The bridge waits.</p>" +
      "<button id='mission-close2' " +
      "style='background:#333;color:#ffd700;border:1px solid #d8a920;padding:10px 20px;border-radius:8px;cursor:pointer;'>CONTINUE</button>";
    document.getElementById("mission-close2").addEventListener("click", function(){
      document.getElementById("mission-ui").remove();
    });
    if(typeof say === "function") say("You declined. That is also a choice.");
  });
}
/* Hook into the game */
(function(){
  var _origAnimate = null;
  /* Build computer and check proximity in the animate loop */
  var _missionTick = setInterval(function(){
    if(typeof scene !== "undefined" && typeof kingPos !== "undefined"){
      if(!_oldComputer) buildOldComputer();
      checkComputerProximity();
    }
    if(window.location.pathname.match(/\/saga-solid\/\d+/)){
      clearInterval(_missionTick);
      initMission();
    }
  }, 1000);
})();

/* ===== SOLID'S AVATAR — v87, the little octahedron ===== */
var _solidAvatar = null;
var _solidCursor = false;
function buildSolidAvatar(){
  if(window.STAGING_CLEAN_MAP) return; // Clean map: old builder