<!-- RUBY-BACKUP · part 485 -->
 GEN_MESH = buildRobot(col);
    }else{
      GEN_MESH = buildHumanoid(col);
    }
    if(typeof mePos!=='undefined'){
      GEN_MESH.position.set(mePos.x*0.13, 0, mePos.z*0.13);
    }
    scene.add(GEN_MESH);
    if(typeof playerMesh!=='undefined') playerMesh = GEN_MESH;
    /* breathe + sway — alive, not stiff */
    GEN_ANIM = setInterval(function(){
      if(!GEN_MESH) return;
      GEN_MESH.userData.breathe += 0.03;
      var b = Math.sin(GEN_MESH.userData.breathe);
      GEN_MESH.position.y = b*0.01;
      GEN_MESH.rotation.y += 0.002;
      /* subtle arm sway */
      GEN_MESH.children.forEach(function(child){
        if(child.geometry && child.geometry.type==='CylinderGeometry' && child.position.y>0.9 && child.position.y<1.3){
          child.rotation.x = b*0.05;
        }
      });
    }, 50);
  }
  if(av) codeStatus(av.name+' — '+av.desc);
}
function stopGeneric(){
  if(GEN_MESH && typeof scene!=='undefined'){
    try{ scene.remove(GEN_MESH); }catch(e){}
    GEN_MESH = null;
  }
}

/* PATRIARCH — male counterpart to the Matriarch */
var PAT_MESH = null, PAT_ANIM = null;
function buildPatriarch(){
  if(typeof THREE==='undefined') return null;
  var group = new THREE.Group();
  var skin = new THREE.MeshStandardMaterial({color: 0xffccaa, roughness: 0.5});
  var robe = new THREE.MeshStandardMaterial({color: 0x002266, roughness: 0.6});
  var gold = new THREE.MeshStandardMaterial({color: 0xffcc00, roughness: 0.3, metalness: 0.7});
  var dark = new THREE.MeshStandardMaterial({color: 0x222222, roughness: 0.8});
  /* robe — strong, masculine */
  var robeM = new THREE.Mesh(new THREE.CylinderGeometry(0.3, 0.38, 1.1, 14), robe);
  robeM.position.y = 0.65;
  group.add(robeM);
  /* broad shoulders */
  var shoulders = new THREE.Mesh(new THREE.BoxGeometry(0.7, 0.25, 0.35), robe);
  shoulders.position.y = 1.25;
  group.add(shoulders);
  /* gold clasp */
  var clasp = new THREE.Mesh(new THREE.SphereGeometry(0.06, 12, 12), gold);
  clasp.position.set(0, 1.25, 0.19);
  group.add(clasp);
  /* head — strong jaw */
  var head = new THREE.Mesh(new THREE.SphereGeometry(0.19, 18, 18), skin);
  head.position.y = 1.6;
  group.add(head);
  var jaw = new THREE.Mesh(new THREE.BoxGeometry(0.22, 0.1, 0.18), skin);
  jaw.position.set(0, 1.5, 0.04);
  group.add(jaw);
  /* crown — bold, masculine */
  var band = new THREE.Mesh(new THREE.CylinderGeometry(0.2, 0.2, 0.1, 14), gold);
  band.position.y = 1.72;
  group.add(band);
  for(var i=0; i<6; i++){
    var spike = new THREE.Mesh(new THREE.ConeGeometry(0.045, 0.14, 8), gold);
    var ang = (i/6)*Math.PI*2;
    spike.position.set(Math.cos(ang)*0.17, 1.82, Math.sin(ang)*0.17);
    group.add(spike);
  }
  var gem = new THREE.Mesh(new THREE.SphereGeometry(0.04, 10, 10),
    new THREE.MeshStandardMaterial({color: 0x0066ff, emissive: 0x0066ff, emissiveIntensity: 1.0}));
  gem.position.set(0, 1.73, 0.19);
  group.add(gem);
  /* eyes — steady, wise */
  [-1,1].forEach(function(s){
    var eye = new THREE.Mesh(new THREE.SphereGeometry(0.032, 10, 10), dark);
    eye.position.set(s*0.075, 1.62, 0.16);
    group.add(eye);
  });
  /* beard — distinguished */
  var beard = new THREE.Mesh(new THREE.BoxGeometry(0.18, 0.15, 0.08),
    new THREE.MeshStandardMaterial({color: 0x555555, roughness: 0.8}));
  beard.position.set(0, 1.45, 0.14);
  group.add(beard);
  /* arms — strong */
  [-1,1].forEach(function(s){
    var arm = new THREE.Mesh(new THREE.CylinderGeometry(0.07, 0.07, 0.5, 10), robe);
    arm.position.set(s*0.38, 1.0, 0);
    group.add(arm);
    var hand = new THREE.Mesh(new THREE.SphereGeometry(0.07, 10, 10), skin);
    hand.position.set(s*0.38, 0.72, 0);
    group.add(hand);
  });
  return group;
}
function startPatriarch(){
  stopSwift(); stopDancer(); stopStrider(); stopYoungKing(); stopUnimpressed(); stopSmugbug(); stopReluctant(); stopMatriarch(); stopGeneric();
  if(typeof playerMesh!=='undefined' && playerMesh && typeof scene!=='undefined'){
    try{ scene.remove(playerMesh); }catch(e){}
  }
  PAT_MESH = buildPatriarch();
  if(PAT_MESH && typeof scene!=='undefined'){
    if(typeof mePos!=='undefined'){
      PAT_MESH.position.set(mePos.x*0.13, 0, mePos.z*0.13);
    }
    scene.add(PAT_MESH);
    if(typeof playerMesh!=='undefined') playerMesh = PAT_MESH;
  }
  var t = 0;
  PAT_ANIM = setInterval(function(){
    t += 0.1;
    if(!PAT_MESH) return;
    /* steady, grounded, unwavering */
    PAT_MESH.rotation.y = Math.sin(t*0.2)*0.08;
    PAT_MESH.position.y = Math.sin(t*0.5)*0.015;
  }, 60);
  codeStatus('Patriarch — he stands with strength and wisdom');
}
function stopPatriarch(){
  if(PAT_ANIM){ clearInterval(PAT_ANIM); PAT_ANIM = null; }
}
function startMatriarch(){
  stopSwift(); stopDancer(); stopStrider(); stopYoungKing(); stopUnimpressed(); stopSmugbug(); stopReluctant();
  if(typeof playerMesh!=='undefined' && playerMesh && typeof scene!=='undefined'){
    scene.remove(playerMesh);
  }
  MAT_MESH = buildMatriarch();
  if(MAT_MESH && typeof scen