<!-- SAGA-STAGING · part 54 -->
: hourglass spins, beacon pulses
  function animateStudio(){
    try{
      hg.rotation.y += 0.01;
      tetra.rotation.y += 0.02;
      var s = 1 + Math.sin(Date.now()*0.003)*0.1;
      beacon.scale.set(s, 1, s);
    }catch(e){ console.error(e); }
    requestAnimationFrame(animateStudio);
  }
  animateStudio();
  if(typeof trackNewThing === 'function') trackNewThing('creatorstudio', 'Playa Creator Studio at LAT 60.00, LON 00.00');
})();


/* THE COIN — LAT 100.0, LON 0.0 — the real coin from coin.html, flips forever, thieves burn */
(function(){
  var vx = 0, vz = 5556;
  var coinG = new THREE.Group();
  coinG.position.set(vx, 120, vz);
  scene.add(coinG);
  window._theCoin = coinG;
  // Load the real coin textures (SOLID front, Epistolary back)
  var loader = new THREE.TextureLoader();
  loader.load('/saga2/solid-coin.png', function(frontTex){
    loader.load('/saga2/epistolary-coin.png', function(backTex){
      var edgeMat = new THREE.MeshStandardMaterial({color:0xc9a54f, roughness:0.25, metalness:0.9});
      var frontMat = new THREE.MeshStandardMaterial({map:frontTex, roughness:0.35, metalness:0.6});
      var backMat = new THREE.MeshStandardMaterial({map:backTex, roughness:0.35, metalness:0.6});
      var coinGeo = new THREE.CylinderGeometry(40, 40, 8, 64);
      var coin = new THREE.Mesh(coinGeo, [edgeMat, frontMat, backMat]);
      coin.rotation.x = Math.PI/2;
      coinG.add(coin);
      // Gold ridges (both faces)
      var ridgeGeo = new THREE.TorusGeometry(39, 1, 12, 64);
      var ridgeF = new THREE.Mesh(ridgeGeo, edgeMat);
      ridgeF.position.z = 4; coinG.add(ridgeF);
      var ridgeB = new THREE.Mesh(ridgeGeo, edgeMat);
      ridgeB.position.z = -4; coinG.add(ridgeB);
    });
  });
  // Flip animation + burn trap
  var burnCooldown = 0;
  function animateCoin(){
    try{
      // Flip end-over-end forever
      coinG.rotation.x += 0.02;
      coinG.rotation.y += 0.01;
      // Burn trap: if player gets close, they burn
      if(typeof playerBody !== 'undefined' && playerBody && playerBody.position){
        var dx = playerBody.position.x - vx;
        var dz = playerBody.position.z - vz;
        var dist = Math.sqrt(dx*dx + dz*dz);
        var now = Date.now();
        if(dist < 80 && now > burnCooldown){
          burnCooldown = now + 2000;
          // Flash red
          var flash = document.createElement('div');
          flash.style.cssText = 'position:fixed;top:0;left:0;width:100%;height:100%;' +
            'background:rgba(255,50,0,0.5);z-index:99999;pointer-events:none;';
          document.body.appendChild(flash);
          setTimeout(function(){ document.body.removeChild(flash); }, 300);
          // Message
          if(typeof say === 'function') say('THE COIN BURNS THIEVES');
          if(typeof codeStatus === 'function') codeStatus('🔥 THE COIN BURNS — thieves burn 🔥');
          // Knockback (push away from coin)
          var push = 150;
          var ang = Math.atan2(dz, dx);
          playerBody.position.x += Math.cos(ang) * push;
          playerBody.position.z += Math.sin(ang) * push;
        }
      }
    }catch(e){ console.error(e); }
    requestAnimationFrame(animateCoin);
  }
  animateCoin();
  if(typeof trackNewThing === 'function') trackNewThing('thecoin', 'The Coin at LAT 100.0, LON 0.0 — flips forever, thieves burn');
})();


/* VOLCANO — LAT 100.0, LON 0.0 — Hawaiian lava rock, for the King */
(function(){
  var vx = 0, vz = 5556; // LAT 100.0 (z/55.56), LON 0.0 (x/62.5)
  var lavaRock = new THREE.MeshStandardMaterial({color:0x2a1a1a, roughness:0.95, metalness:0.05});
  var darkBasalt = new THREE.MeshStandardMaterial({color:0x1a1a1a, roughness:1.0, metalness:0.0});
  var lavaGlow = new THREE.MeshStandardMaterial({color:0xff4400, roughness:0.6, metalness:0.0, emissive:0xff2200, emissiveIntensity:1.5});
  // FLAT lava field — takes over the surrounding area (no tall cone)
  var field = new THREE.Mesh(new THREE.CylinderGeometry(1200, 1200, 30, 48), lavaRock);
  field.position.set(vx, 15, vz);
  field.receiveShadow = true;
  scene.add(field);
  // Raised rim (low shield edge)
  var rim = new THREE.Mesh(new THREE.TorusGeometry(1100, 40, 12, 48), darkBasalt);
  rim.rotation.x = Math.PI/2;
  rim.position.set(vx, 25, vz);
  scene.add(rim);
  // Lava lake — glowing pool in the flat field
  var lava = new THREE.Mesh(new THREE.CircleGeometry(200, 32), lavaGlow);
  lava.rotation.x = -Math.PI/2;
  lava.position.set(vx, 32, vz);
  scene.add(lava);
  // Point light from lava (glow)
  var lavaLight = new THREE.PointLight(0xff4400, 2.0, 2000);
  lavaLight.position.set(vx, 100, vz);
  scene.add(lavaLight);
  // Valley — rift running down the side (real Hawaiian valley style)
  for(var i=0; i<8; i++){
    var r = new THREE.Mesh(new THREE.BoxGeometry(60, 30, 200), darkBasalt);
    var ang = (i/8)*Math.PI*2;
    r.position.set(vx + Math.cos(ang)*450, 120, vz + Math.sin(ang)*450);
    r.rotation.y = -ang;
    scene.add(r);
  }
  // Lava rocks scat