<!-- HONEYCOMB-TEST · part 8 -->
ngle) * HEX_SIZE
      ));
    }
    edgeGeo.setFromPoints(edgePts);
    const edgeMat = new THREE.LineBasicMaterial({ color: 0xFF2200 });
    const edge = new THREE.Line(edgeGeo, edgeMat);
    group.add(edge);

    // DATA PLATFORM — raised ceiling where King stands to review data
    // Each hex holds actual data; the platform is the review station
    const platGeo = new THREE.CylinderGeometry(HEX_SIZE * 0.6, HEX_SIZE * 0.6, 1, 6);
    const platMat = new THREE.MeshStandardMaterial({
      color: 0x660000,
      emissive: 0xFF2200,
      emissiveIntensity: 0.4,
      roughness: 0.4,
      metalness: 0.6
    });
    const platform = new THREE.Mesh(platGeo, platMat);
    platform.position.set(cx, cy + 4, cz);
    platform.rotation.y = Math.PI / 6; // Align with hex
    group.add(platform);



    // Platform collider (stand on it)
    const platCollider = {
      minX: cx - HEX_SIZE*0.6, maxX: cx + HEX_SIZE*0.6,
      minZ: cz - HEX_SIZE*0.6, maxZ: cz + HEX_SIZE*0.6,
      y: cy + 4.5, // Stand height
      isPlatform: true
    };
    colliders.push({ walls: [platCollider], label: (label || 'hex') + '_platform' });

    // 6 corner posts (open design, no walls)
    const postGeo = new THREE.BoxGeometry(1, 8, 1);
    const postMat = new THREE.MeshStandardMaterial({
      color: 0x330000,
      emissive: 0xFF2200,
      emissiveIntensity: 0.5,
      roughness: 0.5,
      metalness: 0.6
    });
    for (let i = 0; i < 6; i++) {
      const angle = (Math.PI / 180) * (60 * i);
      const px = cx + Math.cos(angle) * (HEX_SIZE - 1);
      const pz = cz + Math.sin(angle) * (HEX_SIZE - 1);
      const post = new THREE.Mesh(postGeo, postMat);
      post.position.set(px, 4, pz);
      group.add(post);
    }

    // Floating label
    if (label) {
      const lc = document.createElement('canvas');
      lc.width = 512; lc.height = 64;
      const lx = lc.getContext('2d');
      lx.font = 'bold 32px monospace'; lx.textAlign = 'center';
      lx.fillStyle = '#FF3333';
      lx.fillText(label.toUpperCase(), 256, 44);
      const ltex = new THREE.CanvasTexture(lc);
      const lmat = new THREE.MeshBasicMaterial({
        map: ltex, transparent: true, depthTest: false, side: THREE.DoubleSide
      });
      const lmesh = new THREE.Mesh(new THREE.PlaneGeometry(10, 1.25), lmat);
      lmesh.position.set(cx, 10, cz);
      lmesh.renderOrder = 999;
      group.add(lmesh);
    }


    scene.add(group);
    observe('honeycomb.room_create', {
      label: label,
      position: { x: cx, z: cz },
      hex: { q, r },
      hasFloor: true, // King's law: always true
      function: functionName
    });

    return { group, q, r, label };
  }

  // MINIMAL TEST: Pure hex floors only, no posts/platforms/HUD
  // For controlled comparison of honeycomb geometry
  function createHexRoom(q, r, label, functionName, layer = 0) {
    const { x: cx, z: cz } = hexToPixel(q, r);
    const layerHeight = 20;
    const cy = layer * layerHeight;
    const group = new THREE.Group();

    // PURE HEX FLOOR ONLY — no posts, no platforms, no clutter
    const shape = new THREE.Shape();
    for (let i = 0; i < 6; i++) {
      const angle = (Math.PI / 180) * (60 * i - 30);
      const x = Math.cos(angle) * HEX_SIZE;
      const y = Math.sin(angle) * HEX_SIZE;
      if (i === 0) shape.moveTo(x, y);
      else shape.lineTo(x, y);
    }
    shape.closePath();
    const geo = new THREE.ShapeGeometry(shape);
    geo.rotateX(-Math.PI / 2);
    const mat = new THREE.MeshStandardMaterial({
      color: 0x880000, emissive: 0xFF3333, emissiveIntensity: 0.8,
      roughness: 0.5, metalness: 0.3, side: THREE.DoubleSide
    });
    const floor = new THREE.Mesh(geo, mat);
    floor.position.set(cx, cy + 0.5, cz);
    group.add(floor);

    // Thin red edge
    const edgeGeo = new THREE.BufferGeometry();
    const pts = [];
    for (let i = 0; i <= 6; i++) {
      const a = (Math.PI / 180) * (60 * (i % 6) - 30);
      pts.push(new THREE.Vector3(cx + Math.cos(a)*HEX_SIZE, cy+0.6, cz + Math.sin(a)*HEX_SIZE));
    }
    edgeGeo.setFromPoints(pts);
    group.add(new THREE.Line(edgeGeo, new THREE.LineBasicMaterial({ color: 0xFF0000 })));

    // Label
    if (label) {
      const lc = document.createElement('canvas');
      lc.width = 256; lc.height = 64;
      const lx = lc.getContext('2d');
      lx.font = 'bold 28px monospace'; lx.textAlign = 'center';
      lx.fillStyle = '#FFFFFF';
      lx.fillText(label, 128, 40);
      const ltex = new THREE.CanvasTexture(lc);
      const lmesh = new THREE.Mesh(
        new THREE.PlaneGeometry(8, 2),
        new THREE.MeshBasicMaterial({ map: ltex, transparent: true, side: THREE.DoubleSide })
      );
      lmesh.position.set(cx, cy + 6, cz);
      group.add(lmesh);
    }

    scene.add(group);
    return { group, q, r, label };
  }

  // ONE STAIRWAY to the top — King's design
  // Walk ON the hexes, not in them. Perimeter wall defines the castle.
  function buildGrandStairway() {
    const st