<!-- SOLIDIVISM · part 49 -->
  );
    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 });

    return group;
  }

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


===== FILE: public/solidivism/foundation.js.pre-staging-20261009 =====
/* ============================================================
   SOLIDIVISM FOUNDATION v1.0
   The most impressive kind — clean, solid, unbreakable.
   Claimed by The King, October 8, 2026.
   
   Principles:
   1. Everything visible IS solid. Everything solid IS visible.
   2. No separation between render and collision — one system.
   3. Built to be seen. Built to hold.
   ============================================================ */

const Solidivism = (function() {
  'use strict';

  let scene, camera, renderer, player;
  let colliders = [];
  let buildings = [];
  let labelMeshes = [];

  // ── INIT: The foundation ──
  function init(containerId) {
    const container = document.getElementById(containerId);
    
    // Scene: dark tactical void
    scene = new THREE.Scene();
    scene.background = new THREE.Color(0x0a0a0e);
    
    // Camera: cinematic third-person
    camera = new THREE.PerspectiveCamera(
      60, window.innerWidth / window.innerHeight, 0.1, 500
    );
    camera.position.set(0, 12, 83); // Behind avatar at new spawn
    
    // Renderer: maximum quality
    renderer = new THREE.WebGLRenderer({ antialias: true });
    renderer.setSize(container.clientWidth, container.clientHeight);
    renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
    container.appendChild(renderer.domElement);
    
    // Lights: dramatic tactical lighting
    const ambient = new THREE.AmbientLight(0xffffff, 0.4);
    scene.add(ambient);
    
    const keyLight = new THREE.DirectionalLight(0xff3333, 1.2);
    keyLight.position.set(30, 50, 30);
    scene.add(keyLight);
    
    const fillLight = new THREE.DirectionalLight(0x3388ff, 0.5);
    fillLight.position.set(-30, 20, -30);
    scene.add(fillLight);
    
    const rimLight = new THREE.PointLight(0xff0000, 1.2, 150);
    rimLight.position.set(0, 10, 0);
    scene.add(rimLight);
    
    // Ground: tactical grid
    createGround();
    
    // Player: the avatar
    createPlayer();
    
    // Start the loop
    animate();
    
    // Handle resize
    window.addEventListener('resize', onResize);
  }

  // ── GROUND: Futuristic motherboard floor (seamless 4-side loop) ──
  function createMotherboardTexture() {
    const S = 512;
    const c = document.createElement('canvas');
    c.width = S; c.height = S;
    const x = c.getContext('2d');
    
    // PCB base: deep black-green
    x.fillStyle = '#0a0f0a';
    x.fillRect(0, 0, S, S);
    
    // Subtle PCB texture noise
    x.fillStyle = '#0d130d';
    for (let i = 0; i < 200; i++) {
      const px = Math.floor(Math.random() * S);
      const py = Math.floor(Math.random() * S);
      x.fillRect(px, py, 2, 2);
    }
    
    // Circuit traces: red copper lines (keep away from edges for seamless loop)
    const M = 24; // margin — nothing crosses the edge
    x.strokeStyle = '#CC0000';
    x.lineWidth = 3;
    
    // Horizontal traces
    const hLines = [80, 150, 230, 320, 410, 470];
    hLines.forEach(y => {
      x.beginPath();
      x.moveTo(M, y);
      // Zigzag like real motherboard traces
      let cx = M;
      while (cx < S - M - 40) {
        const seg = 40 + Math.random() * 60;
        x.lineTo(cx + seg, y);
        if (Math.random() > 0.5 && cx + seg < S - M - 40) {
          const dy = (Math.random() > 0.5 ? 1 : -1) * 30;
          x.lineTo(cx + seg, y + dy);
          x.lineTo(cx + seg + 30, y + dy);
          x.lineTo(cx + seg + 30, y);
          cx += seg + 30;
        } else {
          cx += seg;
        }
      }
      x.lineTo(S - M, y);
      x.stroke();
    });
    
    // Vertical traces
    const vLines = [70, 140, 250, 340, 430];
    vLines.forEach(px => {
      x.beginPath();
      x.moveTo(px, M);
      let cy = M;
      while (cy < S - M - 40) {
        const seg = 40 + Math.random() * 60;
        x.lineTo(px, cy