<!-- RUBY · part 21 -->
tent = 'RAISING THE REGIME';
  t.style.cssText = 'color:#ffd700;font-family:monospace;font-size:22px;letter-spacing:3px;';
  var m = document.createElement('div');
  m.id = 'regimeloadmsg';
  m.style.cssText = 'margin-top:14px;color:#00ff88;font-family:monospace;font-size:14px;';
  var wrap = document.createElement('div');
  wrap.style.cssText = 'margin-top:18px;width:220px;height:6px;background:#222;border-radius:3px;overflow:hidden;';
  var bar = document.createElement('div');
  bar.id = 'regimeloadbar';
  bar.style.cssText = 'height:100%;width:0%;background:#ffd700;';
  wrap.appendChild(bar);
  ov.appendChild(t); ov.appendChild(m); ov.appendChild(wrap);
  if(document.body) document.body.appendChild(ov);
})();

var MAT = {
  gold: new THREE.MeshStandardMaterial({color:0xd4a017, roughness:0.35, metalness:0.75, emissive:0x664400, emissiveIntensity:0.6}),
  goldBright: new THREE.MeshBasicMaterial({color:0xffd766}),
  dark: new THREE.MeshStandardMaterial({color:0x1a1a26, roughness:0.6, metalness:0.4}),
  darkTop: new THREE.MeshStandardMaterial({color:0x9a7d22, roughness:0.45, metalness:0.55, emissive:0x554400, emissiveIntensity:0.5}),
  window: new THREE.MeshBasicMaterial({color:0xffee88}),
  road: new THREE.MeshStandardMaterial({color:0xd4a52e, roughness:0.45, metalness:0.45, emissive:0x664400, emissiveIntensity:0.6}),
  mountain: new THREE.MeshStandardMaterial({color:0x7a8aaa, roughness:0.95, flatShading:true}),
  mountain2: new THREE.MeshStandardMaterial({color:0x5a6a8a, roughness:0.95, flatShading:true}),
  trunk: new THREE.MeshStandardMaterial({color:0x5a3a1a, roughness:0.9}),
  leaf: new THREE.MeshStandardMaterial({color:0x22aa48, roughness:0.8, flatShading:true}),
  leaf2: new THREE.MeshStandardMaterial({color:0x189a3a, roughness:0.8, flatShading:true}),
  red: new THREE.MeshBasicMaterial({color:0xff2222}),
  cyan: new THREE.MeshBasicMaterial({color:0x22eeff}),
  white: new THREE.MeshStandardMaterial({color:0xd8d8e0, roughness:0.4, metalness:0.3}),
  pillar: new THREE.MeshStandardMaterial({color:0x6a5a3a, roughness:0.6, metalness:0.3}),
  blue: new THREE.MeshStandardMaterial({color:0x2266cc, roughness:0.5, metalness:0.3}),
  teal: new THREE.MeshStandardMaterial({color:0x22bbaa, roughness:0.5, metalness:0.3}),
  gray: new THREE.MeshStandardMaterial({color:0x888890, roughness:0.7}),
  rock: new THREE.MeshStandardMaterial({color:0x33333e, roughness:0.9, flatShading:true})
};

// GROUND
var ground = new THREE.Mesh(new THREE.PlaneGeometry(9000,9000),
  new THREE.MeshStandardMaterial({color:0x0c1128, roughness:0.9, metalness:0.15}));
ground.rotation.x=-Math.PI/2; ground.position.set(500,0,500); scene.add(ground);

// STARS (denser)
(function(){
  var n=2200, pos=new Float32Array(n*3);
  for(var i=0;i<n;i++){
    var t=Math.random()*Math.PI*2, p=Math.random()*Math.PI*0.49, r=13000;
    pos[i*3]=500+r*Math.sin(p)*Math.cos(t);
    pos[i*3+1]=300+r*Math.cos(p)*0.55;
    pos[i*3+2]=500+r*Math.sin(p)*Math.sin(t);
  }
  var g=new THREE.BufferGeometry(); g.setAttribute('position',new THREE.BufferAttribute(pos,3));
  scene.add(new THREE.Points(g,new THREE.PointsMaterial({color:0xffffff,size:18,sizeAttenuation:false,transparent:true,opacity:0.9})));
})();

// AURORA (more dramatic, 5 ribbons)
var auroras=[];
(function(){
  var cols=[0x9944ff,0x44aaff,0x44ffcc,0xbb44ff,0x44ddff];
  for(var k=0;k<5;k++){
    var m=new THREE.Mesh(new THREE.PlaneGeometry(8000,380,64,1),
      new THREE.MeshBasicMaterial({color:cols[k],transparent:true,opacity:0.16,
        side:THREE.DoubleSide,depthWrite:false,blending:THREE.AdditiveBlending}));
    m.position.set(500+(k-2)*600, 2000-k*150, 500-k*700);
    m.rotation.y=k*0.4; m.userData.phase=k*1.4;
    scene.add(m); auroras.push(m);
  }
})();

// GRID DOME
(function(){
  var g=new THREE.GridHelper(16000,80,0x4a6adf,0x1a2a6a);
  g.position.set(500,2600,500); g.material.transparent=true; g.material.opacity=0.3;
  scene.add(g);
})();

// HORIZON GLOW (layered)
(function(){
  [[3800,100,0xff9a2a,0.6],[3800,240,0xff6a1a,0.25],[3800,40,0xffcc55,0.7]].forEach(function(p){
    var r=new THREE.Mesh(new THREE.TorusGeometry(p[0],p[1],10,90),
      new THREE.MeshBasicMaterial({color:p[2],transparent:true,opacity:p[3],
        blending:THREE.AdditiveBlending,depthWrite:false}));
    r.rotation.x=Math.PI/2; r.position.set(500,50,500); scene.add(r);
  });
})();

// ROADS
(function(){
  function road(x1,z1,x2,z2,w){
    w=w||14;
    var dx=x2-x1,dz=z2-z1,len=Math.sqrt(dx*dx+dz*dz);
    var m=new THREE.Mesh(new THREE.BoxGeometry(len,3,w),MAT.road);
    m.position.set((x1+x2)/2,1.5,(z1+z2)/2);
    m.rotation.y=-Math.atan2(dz,dx); scene.add(m);
  }
  var cx=500,cz=500;
  road(cx-900,cz,cx+900,cz,20); road(cx,cz-900,cx,cz+900,20);
  road(cx-650,cz-650,cx+650,cz+650,13); road(cx-650,cz+650,cx+650,cz-650,13);
  var R=620,seg=28;
  for(var i=0;i<seg;i++){
    var a1=(i/seg)*Math.PI*2,a2=((i+1)/seg)*Math.PI*2;
    road(cx+Math.cos(a1)*R,cz+Math.sin(a1)*R,cx+Math.cos(a2)*R,cz+Math.sin