<!-- SAGA · part 50 -->
     var dz = playerBody.position.z - g.position.z;
        g.rotation.y = Math.atan2(dx, dz);
      }
    }catch(e){}
    requestAnimationFrame(animateSolid);
  }
  animateSolid();
  if(typeof trackNewThing === 'function') trackNewThing('solid-body', "Solid's body at Playa 2.0 — play with her");
})();


/* TEACH ME — simple human-friendly Creator guide */
(function(){
  if(document.getElementById('teach-me')) return;
  var panel = document.createElement('div');
  panel.id = 'teach-me';
  panel.style.cssText = 'position:fixed;top:0;left:0;width:100%;height:100%;z-index:10003;' +
    'background:rgba(5,5,10,0.95);display:none;flex-direction:column;color:#ffd700;' +
    'font-family:system-ui;padding:20px;box-sizing:border-box;overflow-y:auto;';
  var steps = [
    {
      title: "Step 1: Make a block appear",
      text: "Tap the ◆ diamond (top-right), then tap 🔨 Creator. You'll see switches. Flip the ⬛ Cube switch ON — a gold cube appears in front of you in the world. That's it. You made something.",
      action: "Try it: ◆ → 🔨 Creator → flip ⬛ Cube"
    },
    {
      title: "Step 2: Move it",
      text: "Close the Creator (tap ✕). Now tap the cube in the world — it's selected. Open Creator again, flip the ✥ Move switch ON, close, then tap your cube. It hops forward. Each tap moves it a little.",
      action: "Try it: tap cube → ✥ Move → tap cube again"
    },
    {
      title: "Step 3: Line them up",
      text: "Make a few more blocks (any kind). Then flip the 📐 Align switch — they all line up straight from 60 to 300, nice and neat. Or just walk up to the gold button on the wall at the Creator Studio and tap it.",
      action: "Try it: make 3 blocks → 📐 Align"
    },
    {
      title: "You're building!",
      text: "That's all you need to start. The other switches do what they say: 🔄 Rotate spins, ⤢ Scale grows, 🎨 Color changes color, 📋 Duplicate copies, 🗑 Delete removes, ↩ Undo takes it back. Nothing can break — blocks never overlap, and you can't lose anything.",
      action: "Go play. It's yours."
    }
  ];
  var current = 0;
  function render(){
    var st = steps[current];
    panel.innerHTML =
      '<div style="max-width:500px;margin:40px auto;">' +
      '<h2 style="font-size:22px;margin:0 0 16px 0;">' + st.title + '</h2>' +
      '<p style="font-size:16px;line-height:1.6;margin:0 0 20px 0;">' + st.text + '</p>' +
      '<div style="background:#1a1a2e;border:1px solid #ffd700;border-radius:8px;padding:14px;margin:0 0 24px 0;font-size:15px;">' +
      st.action + '</div>' +
      '<div style="display:flex;gap:12px;justify-content:space-between;">' +
      (current > 0 ? '<button id="teach-prev" style="flex:1;padding:14px;background:#1a1a2e;color:#ffd700;border:1px solid #ffd700;border-radius:8px;min-height:56px;font-size:16px;cursor:pointer;">← Back</button>' : '<div style="flex:1;"></div>') +
      (current < steps.length - 1 ? '<button id="teach-next" style="flex:1;padding:14px;background:#ffd700;color:#1a1a2e;border:none;border-radius:8px;min-height:56px;font-size:16px;cursor:pointer;font-weight:bold;">Next →</button>' :
      '<button id="teach-done" style="flex:1;padding:14px;background:#ffd700;color:#1a1a2e;border:none;border-radius:8px;min-height:56px;font-size:16px;cursor:pointer;font-weight:bold;">Start Building</button>') +
      '</div>' +
      '<div style="text-align:center;margin-top:16px;font-size:13px;opacity:0.7;">Step ' + (current+1) + ' of ' + steps.length + '</div>' +
      '</div>';
    var prev = document.getElementById('teach-prev');
    if(prev) prev.addEventListener('click', function(){ current--; render(); });
    var next = document.getElementById('teach-next');
    if(next) next.addEventListener('click', function(){ current++; render(); });
    var done = document.getElementById('teach-done');
    if(done) done.addEventListener('click', function(){
      panel.style.display = 'none';
      if(window.openCreator) window.openCreator();
    });
  }
  document.body.appendChild(panel);
  window.openTeachMe = function(){
    current = 0;
    render();
    panel.style.display = 'flex';
  };
  // Add "Teach Me" to diamond menu
  var menu = document.getElementById('playa2-menu');
  if(menu){
    var tb = document.createElement('button');
    tb.textContent = '📖 Teach Me';
    tb.style.cssText = 'background:#1a1a2e;color:#ffd700;border:1px solid #ffd700;border-radius:8px;padding:10px 16px;font-size:16px;cursor:pointer;min-height:48px;';
    tb.addEventListener('click', function(){
      window.openTeachMe();
      document.getElementById('playa2-menu').style.display = 'none';
    });
    menu.insertBefore(tb, menu.firstChild);
  }
})();


/* ALL OF PLAYA EXPOSED — every block and tool on the surface around LAT 60.0, LON 0.0 */
(function(){
  var cx = 0, cz = 3333.6;
  var goldMat = new THREE.MeshStandardMaterial({color:0xd4a017, roughness:0.4, metalness:0.6});
  var marbleMat = new THREE.MeshStandardMaterial({color:0xf5f5f5, roughness: