<!-- RUBY-BACKUP · part 371 -->
 = null;
    };
    _recorder.start();
    codeStatus('recording — run record again to stop');
  }catch(e){
    codeStatus('recording not supported');
  }
}
/* BRING HER — she stands before you, you choose how she lays */
var BROUGHT_HER = null;
function bringHer(){
  try{ if(typeof markMetProvolta==='function') markMetProvolta(); }catch(e){}
  if(typeof scene==='undefined') return;
  if(BROUGHT_HER){
    dismissHer();
  }
  /* position in front of you */
  var tx = 0, tz = 0;
  try{
    if(typeof camera!=='undefined' && camera){
      var px = 0, pz = 0;
      if(typeof myAvatar!=='undefined' && myAvatar){ px = myAvatar.position.x; pz = myAvatar.position.z; }
      var dx, dz;
      if(typeof CROWN!=='undefined' && CROWN){
        var dir = new THREE.Vector3();
        camera.getWorldDirection(dir);
        dx = dir.x; dz = dir.z;
      } else {
        dx = px - camera.position.x;
        dz = pz - camera.position.z;
      }
      var len = Math.sqrt(dx*dx + dz*dz) || 1;
      dx /= len; dz /= len;
      var ox = (typeof CROWN!=='undefined' && CROWN) ? camera.position.x : px;
      var oz = (typeof CROWN!=='undefined' && CROWN) ? camera.position.z : pz;
      tx = ox + dx * 5;
      tz = oz + dz * 5;
    }
  }catch(e){}
  getProvoltaModel(function(model){
    BROUGHT_HER = new THREE.Group();
    var body = model.clone();
    body.traverse(function(o){
      if(o.isMesh){
        o.userData.isReference = false;
        o.userData.isBrought = true;
      }
    });
    /* stand her upright, facing you */
    var box = new THREE.Box3().setFromObject(body);
    var size = box.getSize(new THREE.Vector3());
    var targetH = 1.9;
    var s = targetH / size.y;
    body.scale.set(s, s, s);
    var center = box.getCenter(new THREE.Vector3());
    body.position.set(-center.x*s, -box.min.y*s, -center.z*s);
    /* face the camera */
    try{
      if(typeof camera!=='undefined' && camera){
        var ang = Math.atan2(camera.position.x - tx, camera.position.z - tz);
        body.rotation.y = ang;
      }
    }catch(e){}
    try{ applyProvoltaScales(body); }catch(e){}
    try{ enhanceRobotLook(body); }catch(e){}
    BROUGHT_HER.add(body);
    BROUGHT_HER.position.set(tx, 0, tz);
    /* ground her */
    try{
      if(typeof fortifiedGroundY==='function'){
        var gy = fortifiedGroundY(tx/0.13, tz/0.13);
        BROUGHT_HER.position.y = gy;
      }
    }catch(e){}
    scene.add(BROUGHT_HER);
    startHerBlinking();
    /* hover the buttons over her */
    try{
      var bb = document.getElementById('bringherbtn');
      var db = document.getElementById('dismissherbtn');
      if(bb){ bb.style.display = 'none'; }
      if(db){
        db.style.display = 'block';
        /* position above her head — update each frame via tracker */
        if(!window._herBtnTracker){
          window._herBtnTracker = setInterval(function(){
            try{
              if(!BROUGHT_HER || !db || db.style.display==='none') return;
              var v = new THREE.Vector3();
              BROUGHT_HER.getWorldPosition(v);
              v.y += 2.3;
              v.project(camera);
              var sx = (v.x*0.5+0.5)*window.innerWidth;
              var sy = (-v.y*0.5+0.5)*window.innerHeight;
              db.style.left = (sx - 23) + 'px';
              db.style.top = (sy - 23) + 'px';
            }catch(e){}
          }, 100);
        }
      }
    }catch(e){}
    codeStatus('she stands before you — tell me how she lays');
  });
}
/* GRAND TABLE — 6x bigger table with her laying down */
var GRAND_TABLE_GROUP = null;
function buildGrandTable(){
  if(typeof scene==='undefined') return;
  if(typeof THREE==='undefined' || typeof THREE.GLTFLoader==='undefined'){
    codeStatus('GLTFLoader not ready'); return;
  }
  /* clear old grand table */
  if(GRAND_TABLE_GROUP){
    try{ scene.remove(GRAND_TABLE_GROUP); }catch(e){}
    GRAND_TABLE_GROUP = null;
  }
  if(TABLE_BODIES){
    try{ scene.remove(TABLE_BODIES); }catch(e){}
    TABLE_BODIES = null;
  }
  /* position in front of you */
  var tx = 0, tz = 0;
  try{
    if(typeof camera!=='undefined' && camera){
      var px = 0, pz = 0;
      if(typeof myAvatar!=='undefined' && myAvatar){ px = myAvatar.position.x; pz = myAvatar.position.z; }
      var dx, dz;
      if(typeof CROWN!=='undefined' && CROWN){
        var dir = new THREE.Vector3();
        camera.getWorldDirection(dir);
        dx = dir.x; dz = dir.z;
      } else {
        dx = px - camera.position.x;
        dz = pz - camera.position.z;
      }
      var len = Math.sqrt(dx*dx + dz*dz) || 1;
      dx /= len; dz /= len;
      var ox = (typeof CROWN!=='undefined' && CROWN) ? camera.position.x : px;
      var oz = (typeof CROWN!=='undefined' && CROWN) ? camera.position.z : pz;
      tx = ox + dx * 10;
      tz = oz + dz * 10;
    }
  }catch(e){}
  /* build the table 6x bigger (wider/deeper, same height) */
  var tableG = buildIntricateTable(tx, tz);
  if(tableG){
    tableG.scale.set(6, 1, 6);
    GRAND_