<!-- SOLIDIVISM-STAGING · part 16 -->
0, H = 12, D = 16;
    const T = 1.2; // wall thickness

    const tex = createTacticalTexture(label || 'CONTROL');
    const wallMat = new THREE.MeshStandardMaterial({
      map: tex, roughness: 0.5, metalness: 0.6,
      emissive: 0x330000, emissiveIntensity: 0.3, emissiveMap: tex,
      side: THREE.DoubleSide
    });

    // WALLS: back + left + right solid, front has video screen + door
    // Back wall (-z)
    const backWall = new THREE.Mesh(new THREE.BoxGeometry(W, H, T), wallMat);
    backWall.position.set(bx, H/2, bz - D/2 + T/2);
    group.add(backWall);

    // Left wall (-x)
    const leftWall = new THREE.Mesh(new THREE.BoxGeometry(T, H, D), wallMat);
    leftWall.position.set(bx - W/2 + T/2, H/2, bz);
    group.add(leftWall);

    // Right wall (+x)
    const rightWall = new THREE.Mesh(new THREE.BoxGeometry(T, H, D), wallMat);
    rightWall.position.set(bx + W/2 - T/2, H/2, bz);
    group.add(rightWall);

    // Front wall (+z): two segments with DOOR GAP in center
    const doorHalf = 3;
    const frontL = new THREE.Mesh(
      new THREE.BoxGeometry(W/2 - doorHalf, H, T), wallMat);
    frontL.position.set(bx - (W/2 + doorHalf)/2, H/2, bz + D/2 - T/2);
    group.add(frontL);
    const frontR = new THREE.Mesh(
      new THREE.BoxGeometry(W/2 - doorHalf, H, T), wallMat);
    frontR.position.set(bx + (W/2 + doorHalf)/2, H/2, bz + D/2 - T/2);
    group.add(frontR);

    // Roof
    const roof = new THREE.Mesh(new THREE.BoxGeometry(W, T, D), wallMat);
    roof.position.set(bx, H + T/2, bz);
    group.add(roof);

    // VIDEO SCREEN on back wall (inside, facing door)
    const video = document.createElement('video');
    video.src = videoUrl;
    video.crossOrigin = 'anonymous';
    video.loop = true; video.muted = true; video.playsInline = true;
    video.play().catch(() => {});
    const vtex = new THREE.VideoTexture(video);
    vtex.minFilter = THREE.LinearFilter;

    const screenGeo = new THREE.PlaneGeometry(W - 4, H - 3);
    const screenMat = new THREE.MeshBasicMaterial({ map: vtex });
    const screen = new THREE.Mesh(screenGeo, screenMat);
    screen.position.set(bx, H/2 + 0.5, bz - D/2 + T + 0.1);
    // Face toward +z (toward the door, visible when entering)
    group.add(screen);

    // Glass overlay
    const glass = new THREE.Mesh(
      new THREE.PlaneGeometry(W - 4, H - 3),
      new THREE.MeshStandardMaterial({
        color: 0x88ccff, transparent: true, opacity: 0.07,
        roughness: 0.1, metalness: 0.9, side: THREE.DoubleSide
      })
    );
    glass.position.set(bx, H/2 + 0.5, bz - D/2 + T + 0.15);
    group.add(glass);

    // Interior red glow strips
    const stripMat = new THREE.MeshStandardMaterial({
      color: 0xFF2200, emissive: 0xFF2200, emissiveIntensity: 1.5
    });
    const stripL = new THREE.Mesh(new THREE.BoxGeometry(0.3, H - 2, 0.3), stripMat);
    stripL.position.set(bx - W/2 + T + 0.5, H/2, bz);
    group.add(stripL);
    const stripR = new THREE.Mesh(new THREE.BoxGeometry(0.3, H - 2, 0.3), stripMat);
    stripR.position.set(bx + W/2 - T - 0.5, H/2, bz);
    group.add(stripR);

    // Label above door (outside)
    const lc = document.createElement('canvas');
    lc.width = 512; lc.height = 64;
    const lx = lc.getContext('2d');
    lx.font = 'bold 36px monospace'; lx.textAlign = 'center';
    lx.strokeStyle = '#000'; lx.lineWidth = 6;
    const lbl = (label || 'CONTROL').toUpperCase();
    lx.strokeText(lbl, 256, 44);
    lx.fillStyle = '#FF3333'; lx.fillText(lbl, 256, 44);
    const ltex = new THREE.CanvasTexture(lc);
    const lmesh = new THREE.Mesh(
      new THREE.PlaneGeometry(10, 1.25),
      new THREE.MeshBasicMaterial({ map: ltex, transparent: true, depthTest: false })
    );
    lmesh.position.set(bx, H + 2, bz + D/2 + 0.5);
    lmesh.renderOrder = 999;
    group.add(lmesh);
    labelMeshes.push({mesh: lmesh, bx, bz});

    scene.add(group);

    // COLLISION: walls block, door gap open
    const walls = [
      {minX: bx - W/2, maxX: bx + W/2, minZ: bz - D/2, maxZ: bz - D/2 + T},
      {minX: bx - W/2, maxX: bx - W/2 + T, minZ: bz - D/2, maxZ: bz + D/2},
      {minX: bx + W/2 - T, maxX: bx + W/2, minZ: bz - D/2, maxZ: bz + D/2},
      {minX: bx - W/2, maxX: bx - doorHalf, minZ: bz + D/2 - T, maxZ: bz + D/2},
      {minX: bx + doorHalf, maxX: bx + W/2, minZ: bz + D/2 - T, maxZ: bz + D/2},
    ];
    colliders.push({ walls, mesh: group, bx, bz, width: W, depth: D, room: true });

    observe('building.create', { label: label, position: { x: bx, z: bz }, dimensions: { w: W, h: H, d: D } });

    return group;
  }

  // ── PUBLIC API ──
  return {
    init,
    setupInput,
    addBuilding,
    checkCollision,
    getScene: () => scene,
    getPlayer: () => player,
    getCamera: () => camera,
    getBuildings: () => buildings,
    createVideoPanel,
    createControlRoom,
    getVideoPanel,
    getColliders: () => colliders
  };
})();

/* ═══════════════════════════════════════════════════════════════════
   E