<!-- SAGA-STAGING · part 53 -->
extContent = '🔨 Creator';
    cb.style.cssText = 'background:#1a1a2e;color:#ffd700;border:1px solid #ffd700;border-radius:8px;padding:10px 16px;font-size:16px;cursor:pointer;min-height:48px;';
    cb.addEventListener('click', function(){
      window.openCreator();
      document.getElementById('playa2-menu').style.display = 'none';
    });
    menu.appendChild(cb);
  }
})();


/* GOLD WALL BUTTON — unfolds all boxes 0-60 */
(function(){
  var cx = 0, cz = 3333.6;
  var btnGold = new THREE.MeshStandardMaterial({color:0xffd700, roughness:0.2, metalness:0.9, emissive:0xaa8800, emissiveIntensity:0.3});
  var btnGroup = new THREE.Group();
  // Button base (on the gold wall/trim)
  var base = new THREE.Mesh(new THREE.CylinderGeometry(6, 6, 2, 24), btnGold);
  base.rotation.x = Math.PI/2;
  base.position.set(cx + 25, 8, cz);
  btnGroup.add(base);
  // Button top (pressable)
  var top = new THREE.Mesh(new THREE.CylinderGeometry(4, 4, 1.5, 24), btnGold);
  top.rotation.x = Math.PI/2;
  top.position.set(cx + 25, 8, cz + 1.5);
  top.userData.unfoldButton = true;
  btnGroup.add(top);
  window._unfoldBtn = top;
  scene.add(btnGroup);
  // Pulse animation
  function pulseBtn(){
    try{
      var s = 1 + Math.sin(Date.now()*0.005)*0.15;
      top.scale.set(s, s, 1);
    }catch(e){ console.error(e); }
    requestAnimationFrame(pulseBtn);
  }
  pulseBtn();
  // Tap handler (raycast)
  var raycaster = new THREE.Raycaster();
  var mouse = new THREE.Vector2();
  document.addEventListener('click', function(e){
    if(!window._sagaCamera) return;
    // Skip if creator panel is open
    var panel = document.getElementById('creator-ui');
    if(panel && panel.style.display === 'flex') return;
    var x = (e.clientX / window.innerWidth) * 2 - 1;
    var y = -(e.clientY / window.innerHeight) * 2 + 1;
    mouse.set(x, y);
    raycaster.setFromCamera(mouse, window._sagaCamera);
    var hits = raycaster.intersectObject(top);
    if(hits.length > 0){
      // UNFOLD ALL BOXES 0-60
      if(typeof window._unfoldAll === 'function'){
        window._unfoldAll();
      }
      // Button press animation
      top.position.z = cz + 0.5;
      setTimeout(function(){ top.position.z = cz + 1.5; }, 200);
      if(typeof say === 'function') say('Unfolding 0-60');
    }
  });
})();

/* PLAYA CREATOR STUDIO — LAT 60.00, LON 00.00 — built into the map */
(function(){
  var cx = 0, cz = 3333.6; // LAT 60.00 (z/55.56), LON 00.00 (x/62.5)
  var goldMat = new THREE.MeshStandardMaterial({color:0xd4a017, roughness:0.4, metalness:0.6});
  var darkMat = new THREE.MeshStandardMaterial({color:0x1a1a1a, roughness:0.7});
  var marbleMat = new THREE.MeshStandardMaterial({color:0xf5f5f5, roughness:0.3});
  var cyanMat = new THREE.MeshStandardMaterial({color:0x00ccff, roughness:0.3, metalness:0.5, emissive:0x0088aa, emissiveIntensity:0.5});
  var g = new THREE.Group();
  g.position.set(cx, 0, cz);
  // Foundation platform (large)
  var plat = new THREE.Mesh(new THREE.CylinderGeometry(30, 32, 2, 32), darkMat);
  plat.position.y = 1; plat.receiveShadow = true; g.add(plat);
  var trim = new THREE.Mesh(new THREE.TorusGeometry(30, 0.8, 12, 64), goldMat);
  trim.rotation.x = Math.PI/2; trim.position.y = 2; g.add(trim);
  // THE 4 SIGNATURE BLOCKS (from epistles.xyz/playa block picker)
  // 1. Hourglass V-Core (centerpiece)
  var hg = new THREE.Group();
  var top = new THREE.Mesh(new THREE.ConeGeometry(4, 6, 4), goldMat);
  top.position.y = 3; top.rotation.x = Math.PI; hg.add(top);
  var bot = new THREE.Mesh(new THREE.ConeGeometry(4, 6, 4), goldMat);
  bot.position.y = -3; hg.add(bot);
  hg.position.y = 12; g.add(hg);
  // 2. Refined Pylon
  var pylon = new THREE.Mesh(new THREE.CylinderGeometry(1.5, 2, 14, 8), marbleMat);
  pylon.position.set(18, 9, 0); pylon.castShadow = true; g.add(pylon);
  // 3. Hollow Tetra
  var tetra = new THREE.Mesh(new THREE.TetrahedronGeometry(5), cyanMat);
  tetra.position.set(-18, 9, 0); tetra.castShadow = true; g.add(tetra);
  // 4. Layered Pyramid
  var pyr1 = new THREE.Mesh(new THREE.ConeGeometry(6, 4, 4), goldMat);
  pyr1.position.set(0, 6, 18); g.add(pyr1);
  var pyr2 = new THREE.Mesh(new THREE.ConeGeometry(4, 3, 4), marbleMat);
  pyr2.position.set(0, 9.5, 18); g.add(pyr2);
  var pyr3 = new THREE.Mesh(new THREE.ConeGeometry(2, 2, 4), cyanMat);
  pyr3.position.set(0, 12, 18); g.add(pyr3);
  // Portal door (to epistles.xyz/playa)
  var doorFrame = new THREE.Mesh(new THREE.BoxGeometry(8, 12, 1), goldMat);
  doorFrame.position.set(0, 8, -20); g.add(doorFrame);
  var doorGlow = new THREE.Mesh(new THREE.PlaneGeometry(6, 10),
    new THREE.MeshStandardMaterial({color:0x00ccff, emissive:0x00aacc, emissiveIntensity:1.0}));
  doorGlow.position.set(0, 8, -19.4); g.add(doorGlow);
  // Rotating beacon (marks the location)
  var beacon = new THREE.Mesh(new THREE.CylinderGeometry(0.5, 0.5, 30, 8), cyanMat);
  beacon.position.y = 25; g.add(beacon);
  window._creatorStudioBeacon = beacon;
  scene.add(g);
  // Animate