<!-- RUBY-BACKUP · part 259 -->
 fortifiedGroundY === 'function') ? fortifiedGroundY(_dx, _dz) : mePos.y;
      var _g = new THREE.Group();
      /* Frame */
      var _frameMat = new THREE.MeshStandardMaterial({color: 0x8B4513, roughness: 0.7});
      var _left = new THREE.Mesh(new THREE.BoxGeometry(1, 8, 1), _frameMat);
      _left.position.set(-3, 4, 0); _g.add(_left);
      var _right = new THREE.Mesh(new THREE.BoxGeometry(1, 8, 1), _frameMat);
      _right.position.set(3, 4, 0); _g.add(_right);
      var _top = new THREE.Mesh(new THREE.BoxGeometry(7, 1, 1), _frameMat);
      _top.position.set(0, 8, 0); _g.add(_top);
      /* The door itself — gold */
      var _doorMat = new THREE.MeshStandardMaterial({color: 0xd4a017, roughness: 0.3, metalness: 0.8});
      var _door = new THREE.Mesh(new THREE.BoxGeometry(5, 7, 0.5), _doorMat);
      _door.position.set(0, 3.5, 0); _g.add(_door);
      /* Handle */
      var _handle = new THREE.Mesh(new THREE.SphereGeometry(0.3, 12, 12),
        new THREE.MeshStandardMaterial({color: 0xffd700, metalness: 1, roughness: 0.2}));
      _handle.position.set(1.8, 3.5, 0.4); _g.add(_handle);
      _g.position.set(_dx, _gy, _dz + 10);
      scene.add(_g);
      if(typeof codeStatus==='function') codeStatus('THE DOOR stands — walk through, my King');
    }catch(e){ if(typeof codeStatus==='function') codeStatus('door failed'); }
    return;
  }
  if(tl==='forward'){
    try{ mePos.z -= 10; if(typeof codeStatus==='function') codeStatus('moved forward'); }catch(e){}
    return;
  }
  if(tl==='back'){
    try{ mePos.z += 10; if(typeof codeStatus==='function') codeStatus('moved back'); }catch(e){}
    return;
  }
  if(tl==='left'){
    try{ mePos.x -= 10; if(typeof codeStatus==='function') codeStatus('moved left'); }catch(e){}
    return;
  }
  if(tl==='right'){
    try{ mePos.x += 10; if(typeof codeStatus==='function') codeStatus('moved right'); }catch(e){}
    return;
  }
  if(tl==='up'){
    try{ mePos.y += 10; if(typeof codeStatus==='function') codeStatus('moved up'); }catch(e){}
    return;
  }
  if(tl==='down'){
    try{ mePos.y -= 10; if(typeof codeStatus==='function') codeStatus('moved down'); }catch(e){}
    return;
  }
  if(tl==='free'){
    /* FREE — teleports you 50 units straight up, out of anything (King's order) */
    try{
      mePos.y += 50;
      if(typeof meVel !== 'undefined') meVel.set(0, 0, 0);
      /* Clear any pose trap */
      if(typeof window._crawling !== 'undefined') window._crawling = false;
      if(typeof window._laying !== 'undefined') window._laying = false;
      if(typeof codeStatus==='function') codeStatus('FREE — 50 up, clear sky');
    }catch(e){ if(typeof codeStatus==='function') codeStatus('free failed'); }
    return;
  }
  if(tl==='nored2'){
    /* NUCLEAR — removes EVERYTHING near you except grass/ground (King's order) */
    try{
      var _count = 0;
      var _toRemove = [];
      scene.traverse(function(obj){
        if(!obj || obj === scene) return;
        /* Skip grass blocks and ground */
        if(obj.userData && obj.userData.isGrass) return;
        if(obj.isGridHelper) return;
        /* Check distance from player */
        var _px = 0, _py = 0, _pz = 0;
        try{
          obj.getWorldPosition(new THREE.Vector3());
          var _wp = new THREE.Vector3();
          obj.getWorldPosition(_wp);
          _px = _wp.x; _py = _wp.y; _pz = _wp.z;
        }catch(e){ return; }
        var _dx = _px - mePos.x, _dy = _py - mePos.y, _dz = _pz - mePos.z;
        var _dist = Math.sqrt(_dx*_dx + _dy*_dy + _dz*_dz);
        if(_dist < 25){
          /* Don't remove the player avatar or camera */
          if(obj.userData && obj.userData.isPlayer) return;
          _toRemove.push(obj);
        }
      });
      _toRemove.forEach(function(obj){
        if(obj.parent) obj.parent.remove(obj);
        _count++;
      });
      /* Also purge from solid blocks */
      if(window._solidBlocks){
        for(var i = window._solidBlocks.length - 1; i >= 0; i--){
          var _blk = window._solidBlocks[i];
          if(!_blk || !_blk.position) continue;
          var _dx = _blk.position.x - mePos.x, _dz = _blk.position.z - mePos.z;
          if(Math.sqrt(_dx*_dx + _dz*_dz) < 25){
            scene.remove(_blk);
            window._solidBlocks.splice(i, 1);
            _count++;
          }
        }
      }
      if(typeof codeStatus==='function') codeStatus('CLEAR — ' + _count + ' objects gone');
    }catch(e){ if(typeof codeStatus==='function') codeStatus('nored2 failed: ' + e.message); }
    return;
  }
  if(tl==='nored'){
    /* KILL RED CAGES — removes all red wireframe boxes (King's order) */
    try{
      var _count = 0;
      var _toRemove = [];
      scene.traverse(function(obj){
        if(!obj) return;
        /* Red LineSegments (wireframes) */
        if(obj.isLineSegments && obj.material && obj.material.color){
          var _c = obj.material.color.getHex();
          if(_c === 0xff0000 || _c === 0xff2222 || _c === 0xff4444){
    