<!-- RUBY-BACKUP · part 244 -->
.1, 0.98); g.add(head);
  /* hair */
  var hair = new THREE.Mesh(new THREE.SphereGeometry(0.145, 24, 24, 0, Math.PI*2, 0, Math.PI*0.55), hairMat);
  hair.position.y = 1.57; hair.scale.set(0.98, 1.05, 1); g.add(hair);
  /* eyes — with whites */
  [-1,1].forEach(function(s){
    var white = new THREE.Mesh(new THREE.SphereGeometry(0.028, 14, 14),
      new THREE.MeshStandardMaterial({color: 0xffffff, roughness: 0.2}));
    white.position.set(0.045, 1.57, s*0.06); g.add(white);
    var pupil = new THREE.Mesh(new THREE.SphereGeometry(0.013, 10, 10), dark);
    pupil.position.set(0.055, 1.57, s*0.06); g.add(pupil);
  });
  /* nose */
  var nose = new THREE.Mesh(new THREE.ConeGeometry(0.018, 0.04, 10), skin);
  nose.position.set(0.1, 1.53, 0); nose.rotation.z = -Math.PI/2; g.add(nose);
  /* mouth */
  var mouth = new THREE.Mesh(new THREE.BoxGeometry(0.015, 0.008, 0.05),
    new THREE.MeshStandardMaterial({color: 0x8a4a3a, roughness: 0.6}));
  mouth.position.set(0.095, 1.48, 0); g.add(mouth);
  /* neck */
  var neck = new THREE.Mesh(new THREE.CylinderGeometry(0.05, 0.06, 0.1, 16), skin);
  neck.position.y = 1.42; g.add(neck);
  /* torso — tapered, natural */
  var torso = new THREE.Mesh(new THREE.CylinderGeometry(0.14, 0.18, 0.55, 20), cloth);
  torso.position.y = 1.1; g.add(torso);
  /* shoulders */
  var shoulders = new THREE.Mesh(new THREE.SphereGeometry(0.16, 20, 20), cloth);
  shoulders.scale.set(1.4, 0.6, 0.8); shoulders.position.y = 1.35; g.add(shoulders);
  /* arms — upper + forearm + hand */
  [-1,1].forEach(function(s){
    var upper = new THREE.Mesh(new THREE.CylinderGeometry(0.045, 0.04, 0.3, 14), cloth);
    upper.position.set(0, 1.2, s*0.24); upper.rotation.x = s*0.1; g.add(upper);
    var fore = new THREE.Mesh(new THREE.CylinderGeometry(0.04, 0.035, 0.28, 14), skin);
    fore.position.set(0, 0.92, s*0.26); g.add(fore);
    var hand = new THREE.Mesh(new THREE.SphereGeometry(0.05, 14, 14), skin);
    hand.position.set(0, 0.76, s*0.27); g.add(hand);
  });
  /* hips */
  var hips = new THREE.Mesh(new THREE.SphereGeometry(0.15, 18, 18), cloth);
  hips.scale.set(1.1, 0.7, 0.9); hips.position.y = 0.82; g.add(hips);
  /* legs — thigh + shin + foot */
  [-1,1].forEach(function(s){
    var thigh = new THREE.Mesh(new THREE.CylinderGeometry(0.07, 0.06, 0.35, 14), cloth);
    thigh.position.set(0, 0.62, s*0.09); g.add(thigh);
    var shin = new THREE.Mesh(new THREE.CylinderGeometry(0.055, 0.05, 0.35, 14), skin);
    shin.position.set(0, 0.28, s*0.09); g.add(shin);
    var foot = new THREE.Mesh(new THREE.BoxGeometry(0.18, 0.07, 0.09), dark);
    foot.position.set(0.05, 0.035, s*0.09); g.add(foot);
  });
  /* subtle breathing */
  g.userData.breathe = 0;
  return g;
}
function startGeneric(id){
  stopSwift(); stopDancer(); stopStrider(); stopYoungKing(); stopUnimpressed(); stopSmugbug(); stopReluctant(); stopMatriarch();
  if(GEN_MESH && typeof scene!=='undefined') scene.remove(GEN_MESH);
  if(GEN_ANIM){ clearInterval(GEN_ANIM); GEN_ANIM = null; }
  if(typeof playerMesh!=='undefined' && playerMesh && typeof scene!=='undefined'){
    try{ scene.remove(playerMesh); }catch(e){}
  }
  var av = AVATARS.find(function(x){ return x.id===id; });
  var col = av ? av.color : '#ffffff';
  if(typeof THREE!=='undefined' && typeof scene!=='undefined'){
    /* CG characters get future robot/superhero style, humans get hyper-realistic */
    if(CG_CHARACTERS.indexOf(id) >= 0){
      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});
  /* ro