<!-- RUBY-BACKUP · part 34 -->
laceholder="'+(cd.arg||'...')+'" '
        +'style="flex:1;background:#000;color:#ffd700;border:1px solid #8a6a1c;border-radius:8px;'
        +'padding:10px;font-size:16px;font-family:Georgia,serif;"/>'
        +'<button id="cps-arggo" style="background:#d8a920;color:#000;border:none;border-radius:8px;'
        +'padding:10px 18px;font-size:16px;font-weight:bold;">GO</button></div>';
      rowEl.parentNode.insertBefore(pr, rowEl.nextSibling);
      var inp = document.getElementById('cps-argin');
      var go = document.getElementById('cps-arggo');
      function fire(){
        try{
          var v = inp.value.trim();
          var full = cd.code + (v ? ' ' + v : '');
          window.armInstall(full, cd.why);
        }catch(e){}
      }
      function tapGo(e){ try{ e.preventDefault(); e.stopPropagation(); }catch(x){} fire(); }
      go.addEventListener('touchstart', tapGo, {passive:false});
      go.addEventListener('mousedown', tapGo);
      inp.addEventListener('keydown', function(e){ if(e.key==='Enter') fire(); });
      setTimeout(function(){ try{ inp.focus(); }catch(e){} }, 100);
      try{ pr.scrollIntoView({block:'nearest'}); }catch(e){}
    }catch(e){}
  }

  window.toggleCodeScroll = openScroll;
  window.openCodeScroll = openScroll;
  window.closeCodeScroll = closeScroll;

  /* ============ THE UI BUTTON — gold pyramid, screen-fixed ============ */
  function makeUIButton(){
    try{
      if(document.getElementById('pyramidBtn')) return;
      var b = document.createElement('div');
      b.id = 'pyramidBtn';
      b.innerHTML = '\u25B2';
      b.style.cssText = 'position:fixed;right:12px;bottom:210px;width:52px;height:52px;'
        +'z-index:29999;background:radial-gradient(circle at 35% 30%, #ffe27a, #d8a920 55%, #8a6a1c);'
        +'border:2px solid #ffe27a;border-radius:50%;color:#3a2a08;'
        +'font-size:24px;display:flex;align-items:center;justify-content:center;'
        +'box-shadow:0 0 16px rgba(216,169,32,0.5);cursor:pointer;'
        +'-webkit-tap-highlight-color:transparent;user-select:none;-webkit-user-select:none;';
      function tap(e){
        try{ if(e){ e.preventDefault(); e.stopPropagation(); } }catch(x){}
        openScroll();
      }
      b.addEventListener('touchstart', tap, {passive:false});
      b.addEventListener('mousedown', tap);
      document.body.appendChild(b);
    }catch(e){}
  }

  /* ============ THE 3D BUTTON — gold disc on the pyramid's base ============ */
  var btn3d = null;
  function make3DButton(){
    try{
      if(btn3d || typeof THREE==='undefined' || !window.scene) return;
      // Gold disc at the pyramid base, front face, thumb height
      var geo = new THREE.CylinderGeometry(1.6, 1.6, 0.4, 24);
      var mat = new THREE.MeshStandardMaterial({color:0xffd700, metalness:0.8, roughness:0.25, emissive:0x553f08});
      var disc = new THREE.Mesh(geo, mat);
      disc.position.set(0, 3.2, -60 + 15.5); // front of base tier (base spans ±13.5)
      disc.rotation.x = Math.PI/2 - 0.35; // tilted up toward the player
      disc.userData.pyramidButton = true;
      disc.userData.nodeId = 'pyramid-button';
      if(window.scene) window.scene.add(disc);
      // Pyramid glyph floating above it
      var gg = new THREE.ConeGeometry(0.8, 1.2, 4);
      var gm = new THREE.MeshBasicMaterial({color:0xffe27a});
      var glyph = new THREE.Mesh(gg, gm);
      glyph.position.set(0, 5.2, -60 + 15.5);
      glyph.rotation.y = Math.PI/4;
      if(window.scene) window.scene.add(glyph);
      btn3d = {disc:disc, glyph:glyph};
      // Gentle pulse
      var t0 = Date.now();
      (function pulse(){
        try{
          if(!btn3d) return;
          var s = 1 + Math.sin((Date.now()-t0)/500)*0.08;
          glyph.scale.set(s,s,s);
          glyph.rotation.y += 0.02;
          requestAnimationFrame(pulse);
        }catch(e){}
      })();
      // Hook into the tap system: if the pyramid button is tapped, open the scroll
      // (via touch-nodes stamp + a tap interceptor)
      try{
        if(window.stampNode) window.stampNode(disc, {client:'pyramid-button'});
      }catch(e){}
    }catch(e){}
  }

  /* Tap interceptor: check if a tap hit the 3D pyramid button */
  function hookTap(){
    try{
      if(window.__pyrTapHooked) return;
      window.__pyrTapHooked = true;
      // Wrap dDown if it exists (rigging.js tap pipeline)
      var tries = 0;
      var iv = setInterval(function(){
        tries++;
        try{
          if(typeof dDown === 'function' && !dDown.__pyrWrapped){
            var orig = dDown;
            dDown = function(id, sx, sy){
              try{
                // Raycast to see if the pyramid button was hit
                if(btn3d && typeof THREE!=='undefined'){
                  var ndc = new THREE.Vector2((sx/window.innerWidth)*2-1, -(sy/window.innerHeight)*2+1);
                  var c = null;
                  try{ c = camera; }catch(e){}
                  if(!c){ try{ c = window.__pyrCam; }catch(e2){} }
 