<!-- SOLIDABILITY-WORLD · part 36 -->
our site — lots of pages depend on it.',
      };
    }

    return {
      what: `This is called ${label}.`,
      does: 'It\'s a piece of your website\'s machinery.',
      matters: 'Every piece matters — this one plays its part behind the scenes.',
    };
  }

  // Start a guided human tour: "Show me my website"
  async function startTour() {
    const layout = SWWorld.getLayout();
    if (!layout) return;

    // Pick the most meaningful stops (not most complex — most human-relevant)
    const stops = [];

    // 1. Server (the heart)
    const server = layout.rooms.find(r => r.filePath === 'server.js');
    if (server) stops.push(server);

    // 2. Something with auth (who gets in)
    const auth = layout.rooms.find(r => /auth|login/i.test(r.filePath || ''));
    if (auth && auth !== server) stops.push(auth);

    // 3. Something with forum/posts (community)
    const forum = layout.rooms.find(r => /thread|forum/i.test(r.filePath || ''));
    if (forum && !stops.includes(forum)) stops.push(forum);

    // 4. Something with chat (live)
    const chat = layout.rooms.find(r => /chat/i.test(r.filePath || '') && !/chatlog/i.test(r.filePath || ''));
    if (chat && !stops.includes(chat)) stops.push(chat);

    // 5. Something visual (what people see)
    const views = layout.rooms.find(r => /views/i.test(r.filePath || ''));
    if (views && !stops.includes(views)) stops.push(views);

    tourStops = stops.slice(0, 5);
    currentStop = 0;
    guiding = true;

    SWHyper.narrate(
      `Welcome to your website. I'll show you the 5 most important parts, ` +
      `in plain language. Tap <b>Next</b> when you're ready, or tap any building to explore.`
    );

    showGuideUI();
    if (tourStops.length > 0) {
      goToStop(0);
    }
  }

  function goToStop(index) {
    if (index < 0 || index >= tourStops.length) return;
    currentStop = index;
    const room = tourStops[index];
    const desc = humanDescription(room);

    // Navigate there
    SWHyper.aiDriveTo(room, `Showing you ${room.label}.`);

    // Show human-friendly panel
    setTimeout(() => {
      showStopPanel(room, desc, index);
    }, 2500);
  }

  function showGuideUI() {
    let ui = document.getElementById('guide-ui');
    if (!ui) {
      ui = document.createElement('div');
      ui.id = 'guide-ui';
      document.getElementById('app').appendChild(ui);
    }
    ui.classList.add('visible');
    updateGuideUI();
  }

  function updateGuideUI() {
    const ui = document.getElementById('guide-ui');
    if (!ui) return;
    ui.innerHTML = `
      <div class="guide-bar">
        <span class="guide-step">${currentStop + 1} of ${tourStops.length}</span>
        <button class="guide-btn" onclick="SWGuide.previous()" ${currentStop === 0 ? 'disabled' : ''}>← Back</button>
        <button class="guide-btn primary" onclick="SWGuide.next()">
          ${currentStop === tourStops.length - 1 ? 'Finish ✓' : 'Next →'}
        </button>
        <button class="guide-btn" onclick="SWGuide.stop()">✕</button>
      </div>
    `;
  }

  function showStopPanel(room, desc, index) {
    SWHyper.narrate(
      `<b>${room.label}</b><br><br>` +
      `${desc.what}<br><br>` +
      `${desc.does}<br><br>` +
      `<i>${desc.matters}</i>`
    );
    updateGuideUI();
  }

  function next() {
    if (currentStop >= tourStops.length - 1) {
      stop();
      SWHyper.narrate(
        `That's your website — the 5 parts that matter most. ` +
        `Tap any building to learn about it, or ask me "what does this do?"`
      );
      return;
    }
    goToStop(currentStop + 1);
  }

  function previous() {
    if (currentStop > 0) goToStop(currentStop - 1);
  }

  function stop() {
    guiding = false;
    tourStops = [];
    currentStop = 0;
    const ui = document.getElementById('guide-ui');
    if (ui) ui.classList.remove('visible');
    SWHyper.stopAI();
  }

  // Answer "what does this do?" for any building in plain language
  function explain(room) {
    const desc = humanDescription(room);
    return `${desc.what} ${desc.does} ${desc.matters}`;
  }

  // Shared Language Glossary — what our words mean
  // Consistent across the world, controls, and explanations
  function showGlossary() {
    const terms = [
      ['❤️ The Heart', 'Your main server. Everything flows through here.'],
      ['🔑 The Gatekeeper', 'Login and security. Who gets in.'],
      ['💬 The Forum', 'Where conversations happen. Your community.'],
      ['💭 Live Chat', 'Real-time messages. Instant talk.'],
      ['🧠 The Mind', 'Your AI. Thinks and remembers.'],
      ['🎨 What You See', 'Page layouts. What people look at.'],
      ['💾 The Memory', 'Database. Remembers everything.'],
      ['🖼️ The Gallery', 'Pictures and files. Uploads live here.'],
      ['🎮 The Game', 'Your 3D worlds. Play happens here.'],
      ['💰 The Treasury', 'Money. Payments and revenue.'],
      ['⚙️ The Controls', 'Admin. Settings and management.'],
      ['🔥 Hot', 'Recently ch