<!-- LIVE · part 23 -->
  var members = [
      {name: 'KING', color: 0xffd700, x: 21, z: 21},
      {name: 'PROVOLTA', color: 0x00ffff, x: -21, z: 21},
      {name: 'SOLID', color: 0xff6600, x: 21, z: -21},
      {name: 'SABLE', color: 0x0088ff, x: -21, z: -21}
    ];
    for(var i = 0; i < members.length; i++){
      var m = members[i];
      /* Pillar */
      var pillar = new THREE.Mesh(
        new THREE.CylinderGeometry(1.5, 2, 12, 8),
        new THREE.MeshStandardMaterial({color: m.color, roughness: 0.4, metalness: 0.6})
      );
      pillar.position.set(m.x, 6.13, m.z);
      g.add(pillar);
      /* Gold cap */
      var cap = new THREE.Mesh(new THREE.SphereGeometry(2, 16, 12), goldMat);
      cap.position.set(m.x, 12.5, m.z);
      g.add(cap);
      /* Base */
      var base = new THREE.Mesh(new THREE.BoxGeometry(5, 0.5, 5), goldMat);
      base.position.set(m.x, 0.35, m.z);
      g.add(base);
    }
    /* Center stone — our story */
    var stone = new THREE.Mesh(
      new THREE.OctahedronGeometry(3),
      new THREE.MeshStandardMaterial({color: 0xffffff, emissive: 0x444444, roughness: 0.2})
    );
    stone.position.set(0, 4, 0);
    g.add(stone);
    if(typeof scene !== 'undefined') scene.add(g);
    /* Gentle rotation for the center stone */
    if(!window._courtAnim){
      window._courtAnim = true;
      var _spin = function(){
        try{ stone.rotation.y += 0.01; }catch(e){ console.error(e); }
        requestAnimationFrame(_spin);
      };
      _spin();
    }
  }catch(e){ console.error(e); }
}
if(typeof buildRoyalCourt === 'function'){ try{ buildRoyalCourt(); }catch(e){ console.error(e); } }

/* CLOUD 9 — our first home. Circle of 16 gold blocks. From the beginning. */
function buildCloud9(){
  try{
    var g = new THREE.Group();
    var goldMat = new THREE.MeshStandardMaterial({color: 0xd4a017, roughness: 0.4, metalness: 0.6});
    for(var i = 0; i < 16; i++){
      var a = (i / 16) * Math.PI * 2;
      var bx = 8 + Math.cos(a) * 5;
      var bz = 9 + Math.sin(a) * 5;
      var block = new THREE.Mesh(new THREE.BoxGeometry(1.5, 1.5, 1.5), goldMat);
      block.position.set(bx, 0.9, bz);
      g.add(block);
    }
    /* Center marker */
    var center = new THREE.Mesh(
      new THREE.OctahedronGeometry(1),
      new THREE.MeshStandardMaterial({color: 0xffffff, emissive: 0xffffff, emissiveIntensity: 0.5})
    );
    center.position.set(8, 2, 9);
    g.add(center);
    if(typeof scene !== 'undefined') scene.add(g);
  }catch(e){ console.error(e); }
}
if(typeof buildCloud9 === 'function'){ try{ buildCloud9(); }catch(e){ console.error(e); } }

/* THE SOLIDITRONIUM — the dome. Our builder's home. */
function buildSoliditronium(){
  try{
    var g = new THREE.Group();
    var cx = 25, cz = 25;
    var glassMat = new THREE.MeshStandardMaterial({color: 0x88ccff, transparent: true, opacity: 0.3, roughness: 0.1});
    var goldMat = new THREE.MeshStandardMaterial({color: 0xd4a017, roughness: 0.4, metalness: 0.6});
    /* Dome */
    var dome = new THREE.Mesh(new THREE.SphereGeometry(8, 24, 16, 0, Math.PI * 2, 0, Math.PI / 2), glassMat);
    dome.position.set(cx, 0.13, cz);
    g.add(dome);
    /* Door frame */
    var door = new THREE.Mesh(new THREE.BoxGeometry(3, 4, 0.5), goldMat);
    door.position.set(cx, 2, cz + 7.8);
    g.add(door);
    /* Desk inside */
    var desk = new THREE.Mesh(new THREE.BoxGeometry(4, 1, 2), goldMat);
    desk.position.set(cx, 1, cz);
    g.add(desk);
    if(typeof scene !== 'undefined') scene.add(g);
  }catch(e){ console.error(e); }
}
if(typeof buildSoliditronium === 'function'){ try{ buildSoliditronium(); }catch(e){ console.error(e); } }

/* PROVOLTA'S VEIL — teal sanctuary. She knows the outcome, so she doesn't judge. */
function buildProvoltaVeil(){
  try{
    var g = new THREE.Group();
    var cx = -35, cz = -35; /* off zero lines */
    var tealMat = new THREE.MeshStandardMaterial({color: 0x00ffff, emissive: 0x00ffff, emissiveIntensity: 0.3, transparent: true, opacity: 0.7});
    var darkMat = new THREE.MeshStandardMaterial({color: 0x0a2a2a, roughness: 0.8});
    /* Circular platform */
    var plat = new THREE.Mesh(new THREE.CylinderGeometry(10, 11, 1, 24), darkMat);
    plat.position.set(cx, 0.6, cz);
    g.add(plat);
    /* Teal veil — curved wall */
    for(var i = 0; i < 12; i++){
      var a = (i / 12) * Math.PI * 2;
      var px = cx + Math.cos(a) * 9;
      var pz = cz + Math.sin(a) * 9;
      var panel = new THREE.Mesh(new THREE.PlaneGeometry(4, 6), tealMat);
      panel.position.set(px, 3.5, pz);
      panel.lookAt(cx, 3.5, cz);
      g.add(panel);
    }
    /* Center flame */
    var flame = new THREE.Mesh(
      new THREE.OctahedronGeometry(1.5),
      new THREE.MeshStandardMaterial({color: 0x00ffff, emissive: 0x00ffff, emissiveIntensity: 2})
    );
    flame.position.set(cx, 3, cz);
    g.add(flame);
    if(typeof scene !== 'undefined') scene.add(g);
    if(!window._veilAnim){
      window._veilAnim = true;
      var _spin = function(){
        t