<!-- SOLIDIVISM · part 56 -->
r 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 + seg);
        cy += seg;
      }
      x.lineTo(px, S - M);
      x.stroke();
    });
    
    // Vias: connection points (red dots with dark centers)
    x.fillStyle = '#FF0000';
    for (let i = 0; i < 40; i++) {
      const px = M + Math.random() * (S - 2 * M);
      const py = M + Math.random() * (S - 2 * M);
      x.beginPath(); x.arc(px, py, 6, 0, 7); x.fill();
      x.fillStyle = '#0a0f0a';
      x.beginPath(); x.arc(px, py, 3, 0, 7); x.fill();
      x.fillStyle = '#FF0000';
    }
    
    // Chip pads: rectangles (like CPU sockets)
    x.strokeStyle = '#FF3333';
    x.lineWidth = 2;
    const chips = [[100, 100, 80, 60], [300, 250, 100, 80], [150, 380, 70, 50], [380, 120, 60, 60]];
    chips.forEach(([cx, cy, w, h]) => {
      x.strokeRect(cx - w/2, cy - h/2, w, h);
      // Inner pins
      x.fillStyle = '#FF0000';
      for (let px = cx - w/2 + 8; px < cx + w/2 - 4; px += 12) {
        x.fillRect(px, cy - h/2 - 4, 6, 4);
        x.fillRect(px, cy + h/2, 6, 4);
      }
    });
    
    // Glowing red edge frame (seamless — same on all sides)
    x.strokeStyle = '#FF0000';
    x.lineWidth = 4;
    x.strokeRect(2, 2, S-4, S-4);
    x.strokeStyle = '#660000';
    x.lineWidth = 2;
    x.strokeRect(10, 10, S-20, S-20);
    
    const tex = new THREE.CanvasTexture(c);
    tex.wrapS = THREE.RepeatWrapping;
    tex.wrapT = THREE.RepeatWrapping;
    tex.repeat.set(8, 8); // Tile 8x8 across the floor
    return tex;
  }

  function createGround() {
    const tex = createMotherboardTexture();
    const geo = new THREE.PlaneGeometry(400, 400);
    const mat = new THREE.MeshStandardMaterial({ 
      map: tex,
      roughness: 0.7,
      metalness: 0.3,
      emissive: 0x330000,
      emissiveIntensity: 0.2
    });
    const ground = new THREE.Mesh(geo, mat);
    ground.rotation.x = -Math.PI / 2;
    ground.position.y = 0;
    scene.add(ground);
  }

  // ── PLAYER: The one who walks ──
  function createPlayer() {
    const group = new THREE.Group();
    
    // Body: sleek cylinder + spheres (CapsuleGeometry not in r128)
    const bodyGeo = new THREE.CylinderGeometry(0.8, 0.8, 1.5, 16);
    const bodyMat = new THREE.MeshStandardMaterial({
      color: 0x00ffcc,
      roughness: 0.3,
      metalness: 0.7,
      emissive: 0x00ffcc,
      emissiveIntensity: 0.3
    });
    const body = new THREE.Mesh(bodyGeo, bodyMat);
    body.position.y = 1.5;
    group.add(body);
    
    // Visor: red tactical
    const visorGeo = new THREE.BoxGeometry(0.9, 0.25, 0.3);
    const visorMat = new THREE.MeshStandardMaterial({
      color: 0xff0000,
      emissive: 0xff0000,
      emissiveIntensity: 0.8
    });
    const visor = new THREE.Mesh(visorGeo, visorMat);
    visor.position.set(0, 2.2, 0.6);
    group.add(visor);
    
    group.position.set(0, 0, 0);
    scene.add(group);
    player = group;
  }

  // ── 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(25