<!-- HONEYCOMB-TEST · part 4 -->
beginPath(); x.moveTo(256-B-L, B); x.lineTo(256-B, B); x.lineTo(256-B, B+L); x.stroke();

    return new THREE.CanvasTexture(c);
  }

  // ── TACTICAL TEXTURE: Futuristic fortification ──
  function createTacticalTexture(label) {
    const c = document.createElement('canvas');
    c.width = 256; c.height = 256;
    const x = c.getContext('2d');
    
    // Black armor base
    x.fillStyle = '#0a0a0c';
    x.fillRect(0, 0, 256, 256);
    
    // Panel lines
    x.strokeStyle = '#1e1e24';
    x.lineWidth = 2;
    for (let i = 0; i <= 256; i += 32) {
      x.beginPath(); x.moveTo(i, 0); x.lineTo(i, 256); x.stroke();
      x.beginPath(); x.moveTo(0, i); x.lineTo(256, i); x.stroke();
    }
    
    // Red corner brackets
    x.strokeStyle = '#FF0000';
    x.lineWidth = 8;
    const B = 12, L = 50;
    x.beginPath(); x.moveTo(B, B+L); x.lineTo(B, B); x.lineTo(B+L, B); x.stroke();
    x.beginPath(); x.moveTo(256-B-L, B); x.lineTo(256-B, B); x.lineTo(256-B, B+L); x.stroke();
    x.beginPath(); x.moveTo(B, 256-B-L); x.lineTo(B, 256-B); x.lineTo(B+L, 256-B); x.stroke();
    x.beginPath(); x.moveTo(256-B-L, 256-B); x.lineTo(256-B, 256-B); x.lineTo(256-B, 256-B-L); x.stroke();
    
    // Red data stripes
    x.fillStyle = '#FF0000';
    x.fillRect(0, 110, 256, 10);
    x.fillRect(0, 128, 256, 4);
    
    // Circuit traces
    x.strokeStyle = '#FF4444';
    x.lineWidth = 2;
    x.beginPath(); x.moveTo(24, 190); x.lineTo(90, 190); x.lineTo(90, 210); x.lineTo(170, 210); x.stroke();
    x.beginPath(); x.moveTo(232, 50); x.lineTo(170, 50); x.lineTo(170, 70); x.stroke();
    x.fillStyle = '#FF0000';
    x.beginPath(); x.arc(170, 210, 7, 0, 7); x.fill();
    x.beginPath(); x.arc(170, 70, 7, 0, 7); x.fill();
    
    // Hazard chevrons
    for (let i = 0; i < 8; i++) {
      x.fillStyle = (i % 2 === 0) ? '#FF0000' : '#0a0a0c';
      x.fillRect(i * 32, 240, 32, 16);
    }
    
    // Label
    if (label) {
      x.fillStyle = '#FFFFFF';
      x.font = 'bold 18px monospace';
      x.textAlign = 'center';
      x.fillText(label.substring(0, 12).toUpperCase(), 128, 100);
    }
    
    // Central diamond emblem
    x.strokeStyle = '#FF0000';
    x.lineWidth = 3;
    x.beginPath();
    x.moveTo(128, 30); x.lineTo(165, 67); x.lineTo(128, 104); x.lineTo(91, 67);
    x.closePath(); x.stroke();
    
    return new THREE.CanvasTexture(c);
  }

  // ── BUILDING: Solid and visible — ONE system ──
  function addBuilding(bx, bz, width, height, depth, label) {
    // FUTURE DESIGN: No walls. 4 corner posts + sloped rocket-ship canopy.
    // Open on all sides — walk under freely. Posts are the only solid parts.
    const group = new THREE.Group();
    const tex = createTacticalTexture(label);

    const postMat = new THREE.MeshStandardMaterial({
      map: tex, roughness: 0.5, metalness: 0.6,
      emissive: 0x330000, emissiveIntensity: 0.4, emissiveMap: tex,
      side: THREE.DoubleSide
    });

    // 4 corner posts
    const postGeo = new THREE.BoxGeometry(1.5, height, 1.5);
    const hx = width / 2 - 0.75, hz = depth / 2 - 0.75;
    const corners = [
      [bx - hx, bz - hz], [bx + hx, bz - hz],
      [bx - hx, bz + hz], [bx + hx, bz + hz]
    ];
    for (const [px, pz] of corners) {
      const post = new THREE.Mesh(postGeo, postMat);
      post.position.set(px, height / 2, pz);
      group.add(post);
    }

    // Sloped canopy: 4-sided pyramid roof (like standing under a rocket ship)
    const roofGeo = new THREE.ConeGeometry(Math.max(width, depth) * 0.75, height * 0.35, 4);
    const roofMat = new THREE.MeshStandardMaterial({
      map: tex, roughness: 0.4, metalness: 0.7,
      emissive: 0x440000, emissiveIntensity: 0.5, emissiveMap: tex,
      side: THREE.DoubleSide
    });
    const roof = new THREE.Mesh(roofGeo, roofMat);
    roof.position.set(bx, height + height * 0.175, bz);
    roof.rotation.y = Math.PI / 4;
    group.add(roof);

    // Glowing red ring under canopy edge (the "engine glow")
    const ringGeo = new THREE.TorusGeometry(Math.max(width, depth) * 0.55, 0.3, 8, 4);
    const ringMat = new THREE.MeshStandardMaterial({
      color: 0xFF2200, emissive: 0xFF2200, emissiveIntensity: 2.0
    });
    const ring = new THREE.Mesh(ringGeo, ringMat);
    ring.position.set(bx, height - 0.5, bz);
    ring.rotation.x = Math.PI / 2;
    ring.rotation.z = Math.PI / 4;
    group.add(ring);

    // Floating label above
    if (label) {
      const lc = document.createElement('canvas');
      lc.width = 512; lc.height = 64;
      const lx = lc.getContext('2d');
      lx.fillStyle = '#00000000'; lx.fillRect(0, 0, 512, 64);
      lx.font = 'bold 36px monospace'; lx.textAlign = 'center';
      lx.strokeStyle = '#000000'; lx.lineWidth = 6;
      lx.strokeText(label.toUpperCase(), 256, 44);
      lx.fillStyle = '#FF3333';
      lx.fillText(label.toUpperCase(), 256, 44);
      const ltex = new THREE.CanvasTexture(lc);
      const lmat = new THREE.MeshBasicMaterial({ map: ltex, transparent: true, depthT