<!-- RUBY-BACKUP · part 429 -->
ne==='undefined') return;
  var cv = document.createElement('canvas');
  cv.width = 1024; cv.height = 256;
  var ctx = cv.getContext('2d');
  /* brick wall background */
  ctx.fillStyle = '#3a2a20';
  ctx.fillRect(0, 0, 1024, 256);
  /* brick lines */
  ctx.strokeStyle = '#2a1a10';
  ctx.lineWidth = 2;
  for(var by=0; by<256; by+=32){
    ctx.beginPath(); ctx.moveTo(0, by); ctx.lineTo(1024, by); ctx.stroke();
    for(var bx=(by%64?0:32); bx<1024; bx+=64){
      ctx.beginPath(); ctx.moveTo(bx, by); ctx.lineTo(bx, by+32); ctx.stroke();
    }
  }
  /* gold outline letters */
  ctx.font = 'bold 160px Arial Black, Arial';
  ctx.textAlign = 'center';
  ctx.lineWidth = 12;
  ctx.strokeStyle = '#d4af37';
  ctx.strokeText(text, 512, 190);
  /* diamond fill — sparkling */
  ctx.fillStyle = '#e8f4ff';
  ctx.fillText(text, 512, 190);
  /* diamond sparkles */
  for(var s=0; s<60; s++){
    var sx = 200 + Math.random()*624;
    var sy = 60 + Math.random()*150;
    var sr = 2 + Math.random()*5;
    ctx.fillStyle = 'rgba(255,255,255,'+(0.5+Math.random()*0.5)+')';
    ctx.beginPath();
    /* diamond shape */
    ctx.moveTo(sx, sy-sr);
    ctx.lineTo(sx+sr*0.7, sy);
    ctx.lineTo(sx, sy+sr);
    ctx.lineTo(sx-sr*0.7, sy);
    ctx.closePath();
    ctx.fill();
  }
  /* gold drips */
  ctx.fillStyle = '#d4af37';
  for(var d=0; d<15; d++){
    var dx = 200 + Math.random()*624;
    var dh = 10 + Math.random()*40;
    ctx.fillRect(dx, 195, 4, dh);
  }
  var tex = new THREE.CanvasTexture(cv);
  var wall = new THREE.Mesh(new THREE.PlaneGeometry(10, 2.5),
    new THREE.MeshStandardMaterial({map: tex, roughness: 0.8}));
  wall.position.set(x, y, z);
  wall.rotation.y = rotY || 0;
  scene.add(wall);
  /* spotlight on it */
  var spot = new THREE.SpotLight(0xffffff, 1.5, 20);
  spot.position.set(x, y+5, z+3);
  spot.target = wall;
  scene.add(spot);
  scene.add(spot.target);
}


/* PROVOLTA — rebuilt in ultra-dense intaglio */
var GUARDIAN = null;
function intaglioRing(radius, tube, color, opacity){
  return new THREE.Mesh(new THREE.TorusGeometry(radius, tube, 6, 48),
    new THREE.MeshBasicMaterial({color: color, transparent: true, opacity: opacity}));
}

/* PROVOLTA'S TRUE FORM — warrior.glb */
function loadWarriorModel(x, y, z){
  if(typeof THREE==='undefined' || typeof THREE.GLTFLoader==='undefined'){
    codeStatus('GLTFLoader not ready — using built form');
    return null;
  }
  var loader = new THREE.GLTFLoader();
  var g = new THREE.Group();
  g.position.set(x, y, z);
  loader.load('/ruby/warrior.glb?v=1',
    function(glb){
      var model = glb.scene;
      /* scale to human size */
      var box = new THREE.Box3().setFromObject(model);
      var size = box.getSize(new THREE.Vector3());
      var targetHeight = 1.9;
      var scale = targetHeight / size.y;
      model.scale.set(scale, scale, scale);
      /* center on ground */
      var center = box.getCenter(new THREE.Vector3());
      model.position.set(-center.x*scale, -box.min.y*scale, -center.z*scale);
      try{ applyProvoltaScales(model); }catch(e){}
      try{ enhanceRobotLook(model); }catch(e){}
      try{ recordProvoltaHeight(model); }catch(e){}
      g.add(model);
      /* her nameplate */
      var nameCv = document.createElement('canvas');
      nameCv.width = 512; nameCv.height = 64;
      var nameCtx = nameCv.getContext('2d');
      nameCtx.fillStyle = 'rgba(0,0,0,0)';
      nameCtx.fillRect(0, 0, 512, 64);
      nameCtx.font = 'bold 36px Georgia';
      nameCtx.textAlign = 'center';
      nameCtx.shadowColor = '#00ccff';
      nameCtx.shadowBlur = 15;
      nameCtx.fillStyle = '#aaddff';
      nameCtx.fillText('PROVOLTA', 256, 44);
      var nameTex = new THREE.CanvasTexture(nameCv);
      var nameplate = new THREE.Mesh(new THREE.PlaneGeometry(1.5, 0.19),
        new THREE.MeshBasicMaterial({map: nameTex, transparent: true}));
      nameplate.position.set(0, 2.15, 0);
      g.add(nameplate);
      /* halo rings */
      for(var ar=0; ar<3; ar++){
        var halo = new THREE.Mesh(new THREE.TorusGeometry(0.7 + ar*0.15, 0.01, 6, 40),
          new THREE.MeshBasicMaterial({color: 0x00ccff, transparent: true, opacity: 0.25 - ar*0.06}));
        halo.position.y = 1.1;
        halo.rotation.x = Math.PI/2;
        g.add(halo);
      }
      g.userData.isGuardian = true;
      g.userData.name = 'PROVOLTA';
      g.userData.trueForm = true;
      codeStatus('PROVOLTA — true form loaded');
    },
    undefined,
    function(err){
      codeStatus('warrior model failed to load — using built form');
    }
  );
  return g;
}
function buildGuardian(x, y, z){
  var g = new THREE.Group();
  var chrome = new THREE.MeshStandardMaterial({color: 0xc0c8d8, metalness: 0.95, roughness: 0.12});
  var gold = new THREE.MeshStandardMaterial({color: 0xd4af37, metalness: 0.95, roughness: 0.1});
  var glowBlue = new THREE.MeshBasicMaterial({color: 0x00ccff, transparent: true, opacity: 0.85});
  var crimson = new THREE.MeshStandardMaterial({color: 0x6a122