<!-- RUBY-BACKUP · part 240 -->
span>';
    html += '</div></div>';
  });
  a.innerHTML = html;
}
function hideAvatars(){
  var a = document.getElementById('avatars');
  if(a) a.style.display='none';
}

/* STRIDER — the avatar that moves */
var STRIDER_ANIM = null;

/* DANCER — the avatar that dances */
var DANCER_ANIM = null;

/* SWIFT — walks when walking, runs when running */
var SWIFT_ANIM = null;
var SWIFT_LAST = null;
var SWIFT_MODE = 'idle'; /* idle, walk, run */
var SWIFT_WAS_RUNNING = 0;

/* CYBORG — futuristic hyper-realistic superhero, same effect as the shoes */
var CYBORG_MESH = null;
function buildCyborg(){
  if(typeof THREE==='undefined') return null;
  var group = new THREE.Group();
  /* materials — like the shoes: carbon fiber, chrome, blue glow */
  var carbon = new THREE.MeshStandardMaterial({color: 0x111111, roughness: 0.6, metalness: 0.4});
  var chrome = new THREE.MeshStandardMaterial({color: 0xcccccc, roughness: 0.1, metalness: 1.0});
  var glow = new THREE.MeshStandardMaterial({color: 0x0088ff, emissive: 0x0088ff, emissiveIntensity: 1.5});
  var darkGlow = new THREE.MeshStandardMaterial({color: 0x003366, emissive: 0x0088ff, emissiveIntensity: 0.8});
  /* torso — carbon fiber with chrome chest plate */
  var torso = new THREE.Mesh(new THREE.BoxGeometry(0.6, 0.8, 0.35), carbon);
  torso.position.y = 1.2;
  group.add(torso);
  var chest = new THREE.Mesh(new THREE.BoxGeometry(0.4, 0.3, 0.05), chrome);
  chest.position.set(0, 1.3, 0.2);
  group.add(chest);
  /* glowing core */
  var core = new THREE.Mesh(new THREE.SphereGeometry(0.08, 16, 16), glow);
  core.position.set(0, 1.3, 0.23);
  group.add(core);
  /* head — chrome with blue glowing eyes */
  var head = new THREE.Mesh(new THREE.SphereGeometry(0.22, 24, 24), chrome);
  head.position.y = 1.95;
  group.add(head);
  var eyeL = new THREE.Mesh(new THREE.SphereGeometry(0.04, 12, 12), glow);
  eyeL.position.set(-0.08, 1.98, 0.18);
  group.add(eyeL);
  var eyeR = eyeL.clone(); eyeR.position.x = 0.08;
  group.add(eyeR);
  /* cyborg jaw — carbon fiber lower face */
  var jaw = new THREE.Mesh(new THREE.BoxGeometry(0.25, 0.12, 0.2), carbon);
  jaw.position.set(0, 1.82, 0.05);
  group.add(jaw);
  /* arms — chrome upper, carbon lower, glowing joints */
  [-1, 1].forEach(function(side){
    var upper = new THREE.Mesh(new THREE.CylinderGeometry(0.09, 0.09, 0.5, 12), chrome);
    upper.position.set(side*0.42, 1.35, 0);
    group.add(upper);
    var joint = new THREE.Mesh(new THREE.SphereGeometry(0.07, 12, 12), glow);
    joint.position.set(side*0.42, 1.08, 0);
    group.add(joint);
    var lower = new THREE.Mesh(new THREE.CylinderGeometry(0.07, 0.07, 0.45, 12), carbon);
    lower.position.set(side*0.42, 0.82, 0);
    group.add(lower);
    var hand = new THREE.Mesh(new THREE.BoxGeometry(0.12, 0.15, 0.12), chrome);
    hand.position.set(side*0.42, 0.55, 0);
    group.add(hand);
  });
  /* legs — carbon fiber with glowing knee joints */
  [-1, 1].forEach(function(side){
    var thigh = new THREE.Mesh(new THREE.CylinderGeometry(0.11, 0.11, 0.5, 12), carbon);
    thigh.position.set(side*0.18, 0.65, 0);
    group.add(thigh);
    var knee = new THREE.Mesh(new THREE.SphereGeometry(0.08, 12, 12), darkGlow);
    knee.position.set(side*0.18, 0.38, 0);
    group.add(knee);
    var shin = new THREE.Mesh(new THREE.CylinderGeometry(0.09, 0.09, 0.4, 12), chrome);
    shin.position.set(side*0.18, 0.15, 0);
    group.add(shin);
  });
  /* back thrusters — blue glow */
  [-1, 1].forEach(function(side){
    var thruster = new THREE.Mesh(new THREE.CylinderGeometry(0.06, 0.08, 0.2, 12), darkGlow);
    thruster.position.set(side*0.2, 1.1, -0.25);
    thruster.rotation.x = Math.PI/2;
    group.add(thruster);
  });
  /* carbon fiber lattice detail — thin glowing lines on torso */
  for(var i=0; i<3; i++){
    var line = new THREE.Mesh(new THREE.BoxGeometry(0.62, 0.02, 0.37), darkGlow);
    line.position.y = 1.0 + i*0.2;
    group.add(line);
  }
  return group;
}

/* YOUNG KING — kingly demeanor, childlike attitudes */
var YK_MESH = null, YK_ANIM = null;
function buildYoungKing(){
  if(typeof THREE==='undefined') return null;
  var group = new THREE.Group();
  var gold = new THREE.MeshStandardMaterial({color: 0xffcc00, roughness: 0.3, metalness: 0.8});
  var royal = new THREE.MeshStandardMaterial({color: 0x660000, roughness: 0.7});
  var skin = new THREE.MeshStandardMaterial({color: 0xffccaa, roughness: 0.5});
  /* body — regal robe, dignified proportions (not chibi) */
  var robe = new THREE.Mesh(new THREE.CylinderGeometry(0.25, 0.4, 1.0, 16), royal);
  robe.position.y = 0.7;
  group.add(robe);
  /* gold trim */
  var trim = new THREE.Mesh(new THREE.TorusGeometry(0.32, 0.03, 8, 24), gold);
  trim.rotation.x = Math.PI/2;
  trim.position.y = 1.15;
  group.add(trim);
  /* head — normal proportions */
  var head = new THREE.Mesh(new THREE.SphereGeometry(0.18, 20, 20), skin);
  head.position.y = 1.45;
  group.add(head);
  /* crown — small, regal (not funny) */
  var band = new