<!-- SOLID CITY · part 3603 -->
tion namePlaque(T, text, w, stoneMat) {
  w = w || 7;
  var c = document.createElement('canvas'); c.width = 512; c.height = 160;
  var g = c.getContext('2d');
  g.fillStyle = '#141216'; g.fillRect(0, 0, 512, 160);
  g.strokeStyle = '#8a6f3a'; g.lineWidth = 5; g.strokeRect(10, 10, 492, 140);
  g.fillStyle = '#d8aa48'; g.textAlign = 'center'; g.textBaseline = 'middle';
  var fs = text.length > 18 ? 34 : 44;
  g.font = 'bold ' + fs + 'px Georgia, serif';
  g.fillText(text, 256, 82);
  var t = new T.CanvasTexture(c); t.encoding = T.sRGBEncoding; t.anisotropy = 4;
  var grp = new T.Group();
  var slab = new T.Mesh(new T.BoxGeometry(w + 0.8, w * 160 / 512 + 0.8, 0.5), stoneMat);
  grp.add(slab);
  var face = new T.Mesh(new T.PlaneGeometry(w, w * 160 / 512),
    new T.MeshBasicMaterial({ map: t }));
  face.position.z = 0.26; grp.add(face);
  return grp;
}
function mulberry(a) { return function () { a |= 0; a = a + 0x6D2B79F5 | 0; var t = Math.imul(a ^ a >>> 15, 1 | a); t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t; return ((t ^ t >>> 14) >>> 0) / 4294967296; }; }

export function createTunnelBore(o) {
  var T = o.THREE, P = o.position || { x: 0, y: 0, z: 0 };
  var root = new T.Group(); root.name = 'tunnel-bore'; root.position.set(P.x, P.y, P.z);
  var R = mulberry(20261011);
  var foot = [], walls = [];
  var C = { gold: 0xd8aa48, basalt: 0x1c1a20, stone: 0x2b2630, floor: 0x141216 };
  var basaltMat = new T.MeshLambertMaterial({ color: C.basalt });
  var stoneMat = new T.MeshLambertMaterial({ color: C.stone });
  var floorMat = new T.MeshLambertMaterial({ color: C.floor });
  var goldBasic = new T.MeshBasicMaterial({ color: C.gold });
  var goldGlow = new T.MeshBasicMaterial({ color: 0xffe8b0 });

  // ---------- floor: dark polished stone ----------
  var floor = new T.Mesh(new T.BoxGeometry(16, 1.5, BORE_LEN + 4), floorMat);
  floor.position.set(0, -0.75, -BORE_LEN / 2 + 1); root.add(floor);
  // ground skirt seals the tube against uneven terrain
  var skirt = new T.Mesh(new T.BoxGeometry(22, 2.5, BORE_LEN + 8), basaltMat);
  skirt.position.set(0, -2.6, -BORE_LEN / 2 + 1); root.add(skirt);

  // ---------- the gold meridian: walk the line, it never wavers ----------
  var mer = new T.Mesh(new T.BoxGeometry(0.35, 0.07, BORE_LEN), goldBasic);
  mer.position.set(0, 0.05, -BORE_LEN / 2); root.add(mer);

  // ---------- walls & ceiling ----------
  [-1, 1].forEach(function (s) {
    var w = new T.Mesh(new T.BoxGeometry(1.6, WALL_H + 1.5, BORE_LEN + 4), basaltMat);
    w.position.set(s * (BORE_W / 2 + 0.8), (WALL_H + 1.5) / 2 - 1.5, -BORE_LEN / 2 + 1);
    root.add(w);
  });
  var ceil = new T.Mesh(new T.BoxGeometry(BORE_W + 4.8, 1.6, BORE_LEN + 4), basaltMat);
  ceil.position.set(0, WALL_H + 0.8 - 1.5 + 0.8, -BORE_LEN / 2 + 1); root.add(ceil);
  // collision walls (world-converted by the placer; axis-aligned so single boxes are exact)
  walls.push({ x0: -BORE_W / 2 - 1.6, x1: -BORE_W / 2, z0: -BORE_LEN - 1, z1: 1, y0: 0, y1: WALL_H });
  walls.push({ x0: BORE_W / 2, x1: BORE_W / 2 + 1.6, z0: -BORE_LEN - 1, z1: 1, y0: 0, y1: WALL_H });

  // ---------- the gold crown line: full length, unbroken ----------
  var crown = new T.Mesh(new T.BoxGeometry(0.3, 0.1, BORE_LEN), goldBasic);
  crown.position.set(0, WALL_H - 1.55, -BORE_LEN / 2); root.add(crown);

  // ---------- 21 golden-ratio arches ----------
  function archRing(scale) {
    var sh = new T.Shape();
    sh.absellipse(0, 0, 7.5 * scale, 7.5 * PHI * scale, 0, Math.PI * 2, false, 0);
    var hole = new T.Path();
    hole.absellipse(0, 0, 6 * scale, 6 * PHI * scale, 0, Math.PI * 2, false, 0);
    sh.holes.push(hole);
    var geo = new T.ExtrudeGeometry(sh, { depth: 1.4 * scale, bevelEnabled: false, curveSegments: 40 });
    geo.translate(0, 0, -0.7 * scale);
    return new T.Mesh(geo, stoneMat);
  }
  var i, z;
  for (i = 0; i < 21; i++) {
    z = -(i + 0.5) * (BORE_LEN / 21);
    var arch = archRing(1);
    arch.position.set(0, 6 * PHI, z);
    root.add(arch);
    // gold keystone at the visible crown
    var key = new T.Mesh(new T.BoxGeometry(1.1, 1.6, 1.7), goldBasic);
    key.position.set(0, 6 * PHI + 6 * PHI + 0.5, z);
    root.add(key);
  }

  // ---------- Fibonacci light bands ----------
  var bands = fibBands(), bandLights = [];
  bands.forEach(function (d, bi) {
    var bz = -d, last = bi === bands.length - 1;
    var bw = last ? 1.4 : 0.55, bh = last ? 0.35 : 0.18;
    // ceiling strip (just under the ceiling) + wall strips (proud of the walls)
    var cs = new T.Mesh(new T.BoxGeometry(BORE_W + 1.6, bh, bw), last ? goldGlow : goldBasic);
    cs.position.set(0, WALL_H - 0.9, bz); root.add(cs);
    [-1, 1].forEach(function (s) {
      var ws = new T.Mesh(new T.BoxGeometry(bh, WALL_H - 2, bw), last ? goldGlow : goldBasic);
      ws.position.set(s * (BORE_W / 2 - 0.1), (WALL_H - 2) / 2, bz); root.add(ws);
    });
    if (bi % 2 === 0 || last) {
      var pl = new T.PointLight(0xffd9a0, last ? 2.2 : 1.15, last ? 120 : 55);
     