<!-- RUBY-BACKUP · part 487 -->
{
      /* sigh — shoulders drop */
      UI_MESH.position.y = -0.03;
    }else{
      /* looks away */
      UI_MESH.rotation.y = 0.5;
    }
  }, 100);
  codeStatus('Unimpressed. I am not impressed.');
}
function stopUnimpressed(){
  if(UI_ANIM){ clearInterval(UI_ANIM); UI_ANIM = null; }
}
function startYoungKing(){
  stopSwift(); stopDancer(); stopStrider();
  if(typeof playerMesh!=='undefined' && playerMesh && typeof scene!=='undefined'){
    scene.remove(playerMesh);
  }
  YK_MESH = buildYoungKing();
  if(YK_MESH && typeof scene!=='undefined'){
    if(typeof mePos!=='undefined'){
      YK_MESH.position.set(mePos.x*0.13, 0, mePos.z*0.13);
    }
    scene.add(YK_MESH);
    if(typeof playerMesh!=='undefined') playerMesh = YK_MESH;
  }
  /* animation: regal stillness with childlike bursts */
  var t = 0;
  YK_ANIM = setInterval(function(){
    t += 0.1;
    if(!YK_MESH) return;
    var cycle = t % 20;
    if(cycle < 14){
      /* regal: stands tall, slow breathing, slight sway */
      YK_MESH.rotation.y = Math.sin(t*0.2)*0.1;
      YK_MESH.position.y = Math.sin(t*0.5)*0.02;
      YK_MESH.rotation.z = 0;
    }else if(cycle < 16){
      /* childlike: happy hop */
      YK_MESH.position.y = Math.abs(Math.sin((cycle-14)*Math.PI))*0.15;
      YK_MESH.rotation.z = Math.sin((cycle-14)*Math.PI*2)*0.1;
    }else if(cycle < 18){
      /* childlike: curious spin */
      YK_MESH.rotation.y += 0.3;
    }else{
      /* childlike: tilt head (curious) */
      YK_MESH.rotation.z = Math.sin((cycle-18)*Math.PI)*0.15;
    }
  }, 50);
  codeStatus('Young King — regal bearing, childlike wonder');
}
function stopYoungKing(){
  if(YK_ANIM){ clearInterval(YK_ANIM); YK_ANIM = null; }
}
function startCyborg(){
  stopSwift(); stopDancer(); stopStrider();
  /* replace player mesh with cyborg */
  if(typeof playerMesh!=='undefined' && playerMesh && typeof scene!=='undefined'){
    scene.remove(playerMesh);
  }
  CYBORG_MESH = buildCyborg();
  if(CYBORG_MESH && typeof scene!=='undefined'){
    /* position at player */
    if(typeof mePos!=='undefined'){
      CYBORG_MESH.position.set(mePos.x*0.13, 0, mePos.z*0.13);
    }
    scene.add(CYBORG_MESH);
    /* keep playerMesh reference for animation */
    if(typeof playerMesh!=='undefined') playerMesh = CYBORG_MESH;
  }
  codeStatus('Cyborg — carbon fiber, chrome, blue glow. Like the shoes.');
}
function startSwift(){
  stopSwift(); stopDancer(); stopStrider();
  SWIFT_LAST = null;
  SWIFT_ANIM = setInterval(function(){
    if(typeof mePos==='undefined' || typeof playerMesh==='undefined' || !playerMesh) return;
    var now = {x: mePos.x, z: mePos.z, t: Date.now()};
    if(SWIFT_LAST){
      var dx = now.x - SWIFT_LAST.x, dz = now.z - SWIFT_LAST.z;
      var dt = (now.t - SWIFT_LAST.t)/1000;
      var speed = dt>0 ? Math.sqrt(dx*dx+dz*dz)/dt : 0;
      var newMode = 'idle';
      if(speed > 8) newMode = 'run';
      else if(speed > 0.5) newMode = 'walk';
      SWIFT_MODE = newMode;
      /* animate based on mode */
      var t = Date.now()/100;
      /* track exhaustion: was running, now stopped */
      if(SWIFT_MODE==='run'){
        SWIFT_WAS_RUNNING = Date.now();
      }
      var exhausted = false;
      if(SWIFT_MODE==='idle' && SWIFT_WAS_RUNNING && (Date.now()-SWIFT_WAS_RUNNING)<8000){
        exhausted = true;
      }
      if(exhausted){
        /* BURNT OUT: bent over, hands on knees, breathing hard */
        var breath = Math.sin(t*3)*0.06; /* rapid heavy breathing */
        playerMesh.rotation.x = 0.6; /* bent over */
        playerMesh.position.y = -0.15 + breath;
        playerMesh.rotation.z = Math.sin(t*3)*0.03;
        /* arms hang toward knees (approximated by lean) */
      }else if(SWIFT_MODE==='run'){
        /* fast bob, lean forward */
        playerMesh.position.y += Math.abs(Math.sin(t*2))*0.08;
        playerMesh.rotation.x = 0.2;
        playerMesh.rotation.z = Math.sin(t*2)*0.15;
      }else if(SWIFT_MODE==='walk'){
        /* moderate stride */
        playerMesh.position.y += Math.abs(Math.sin(t))*0.04;
        playerMesh.rotation.x = 0.05;
        playerMesh.rotation.z = Math.sin(t)*0.08;
      }else{
        /* idle — subtle breathing */
        playerMesh.rotation.x = 0;
        playerMesh.rotation.z = 0;
        playerMesh.position.y += Math.sin(t*0.3)*0.01;
      }
    }
    SWIFT_LAST = now;
  }, 100);
  codeStatus('Swift — walks when you walk, runs when you run');
}
function stopSwift(){
  if(SWIFT_ANIM){ clearInterval(SWIFT_ANIM); SWIFT_ANIM = null; }
  SWIFT_MODE = 'idle';
}
function startDancer(){
  stopDancer(); stopStrider();
  var t = 0;
  DANCER_ANIM = setInterval(function(){
    t += 0.2;
    if(typeof playerMesh!=='undefined' && playerMesh){
      /* spin + bounce + sway */
      playerMesh.rotation.y += 0.1;
      playerMesh.position.y += Math.abs(Math.sin(t))*0.05;
      playerMesh.rotation.z = Math.sin(t)*0.2;
    }
  }, 50);
  codeStatus('Dancer dances — watch it go');
}
function stopDancer(){
  if(DANCER