<!-- SOLID CITY · part 3601 -->
 = d / nz, c = Math.cos(rot), s = Math.sin(rot);
  var hx = cw / 2 * Math.abs(c) + cd / 2 * Math.abs(s), hz = cw / 2 * Math.abs(s) + cd / 2 * Math.abs(c);
  for (var i = 0; i < nx; i++) for (var j = 0; j < nz; j++) {
    var ox = -w / 2 + cw * (i + 0.5), oz = -d / 2 + cd * (j + 0.5), lx = cx + ox * c + oz * s, lz = cz - ox * s + oz * c;
    A.solids.push({ x0: POS.x + lx - hx, x1: POS.x + lx + hx, z0: POS.z + lz - hz, z1: POS.z + lz + hz, y0: M.floorY + y0, y1: M.floorY + y1, tunnelBore: true });
  }
}
function collide(ud) {
  (ud.footprint || []).forEach(function (b) { addBox(b[0], b[1], b[2], b[3], b[6] || 0, b[4], b[5]); });
  // long walls: axis-aligned, pushed as single exact boxes
  (ud.walls || []).forEach(function (w) {
    A.solids.push({ x0: POS.x + w.x0, x1: POS.x + w.x1, z0: POS.z + w.z0, z1: POS.z + w.z1, y0: M.floorY + w.y0, y1: M.floorY + w.y1, tunnelBore: true });
  });
}
function hyperStop() {
  var H = window.CityHyper; if (!H || !H.pois || H.pois.some(function (p) { return p.id === 'the-bore'; })) return;
  H.pois.push({ id: 'the-bore', name: 'The Bore', short: 'BORE', x: POS.x, z: POS.z - 8, stand: { x: POS.x - 2, z: POS.z + 34 },
    alias: 'bore tunnel mountain passage',
    text: 'The Bore: 800 meters of perfect line through the mountain — 21 golden-ratio arches, light falling at Fibonacci intervals. Walk the gold meridian; it never wavers.' });
  if (H.regrid) H.regrid();
}
function watchStop() {
  var W = window.CityWatch, r = W && W.routes && W.routes.grand; if (!r || r._tunnelBore) return;
  var orig = r.build; r._tunnelBore = true;
  r.build = function () {
    var w = orig.apply(this, arguments);
    w.push({ x: POS.x, z: POS.z + 60, y: M.floorY + 120, v: 200, cap: { cap: 'THE BORE', sub: '800 meters · one perfect line', say: 'The Bore: eight hundred meters of perfect line through the mountain. The gold meridian never wavers.' }, agl: false });
    return w;
  };
}
function standY(x, z) {
  if (Math.abs(x - POS.x) < 6.5 && z > POS.z - LEN - 1 && z < POS.z + 2) return M.floorY;
  return -1000;
}
function load() {
  var fy = villageFloor();
  if (fy === null) { M.wait = 1.5; return; } // the road must exist before the Bore; try again shortly
  M.floorY = fy; M.state = 'loading';
  var p; try { p = import('/city/tunnel-bore.js?v=20261012a'); } catch (e) { p = Promise.reject(e); }
  p.then(function (mod) {
    var make = mod.createTunnelBore || mod.default;
    var g = make({ THREE: A.T, position: { x: POS.x, y: M.floorY, z: POS.z } });
    A.world.add(g); M.group = g; M.state = 'ready';
    collide(g.userData || {}); hyperStop(); watchStop();
  }).catch(function (e) { M.state = 'failed'; try { console.warn('[city] Tunnel Bore skipped:', e && e.message); } catch (x) {} });
}
function update(dt) {
  if (M.state === 'idle') { if (A.isBuilt && !A.isBuilt()) return; M.wait -= dt; if (M.wait <= 0) load(); return; }
  if (M.state !== 'ready' || document.hidden) return;
  var c = A.camera.position, d = Math.hypot(c.x + A.origin.x - POS.x, c.z + A.origin.z - (POS.z - LEN / 2));
  M.group.visible = d < 6000;
  if (d < 1600 && M.group.userData.update) try { M.group.userData.update(S.t); } catch (e) {}
}
function radar(g, blip, fl) { if (M.state === 'ready') blip(POS.x, POS.z, '#d8aa48', fl ? 3 : 6, fl ? '' : 'BORE'); }
window.CityTunnelBore = { update: update, radar: radar, pos: POS, standY: standY, state: function () { return M.state; } };
})();


===== FILE: public/city/tunnel-bore-place.js.bak-oneroad-20261012 =====
/* Solid City — places THE BORE (public/city/tunnel-bore.js): the 800m tunnel
   from Kauhale Mauna's upper terrace through the mountain to the Starwell.
   Lazy: imported after the city is built; any import/build error is caught and
   the city carries on. The floor height is read from the village at runtime
   (terrace A top), so the road flows into the mouth with no step, no gap.
   Adds: wall collision (long axis-aligned boxes, exact), radar blip, Hyper POI,
   Watch caption. No narration — the geometry is the guide. */
(function () {
'use strict';
if (!window.SC || !SC.api) return;
var A = SC.api, S = A.S;
var POS = { x: 2000, z: 1880 }, LEN = 800; // mouth; bore runs north (-z) to z=1080
var M = { state: 'idle', group: null, wait: 6.0, floorY: 22 };
function villageFloor() {
  try {
    var V = window.CityVillageMauna;
    if (!V || V.state() !== 'ready') return null;
    var g = V.group(); if (!g) return null;
    return g.position.y + 1.1; // terrace A top (village-local topY 1.1)
  } catch (e) { return null; }
}
function addBox(cx, cz, w, d, rot, y0, y1) {
  var nx = Math.max(1, Math.ceil(w / 2.5)), nz = Math.max(1, Math.ceil(d / 2.5)), cw = w / nx, cd = d / nz, c = Math.cos(rot), s = Math.sin(rot);
  var hx = cw / 2 * Math.abs(c) + cd / 2 * Math.abs(s), hz = cw / 2 * Math.abs(s) + cd / 2 * Math.abs(c);
  for (var i = 0; i < nx; i++) for (var j = 0; j < nz; j++) {
    var ox = -w / 2 + cw * (i + 0.5), oz = -d / 2 + cd * (j + 0.5), lx = 