<!-- SOLID CITY · part 3433 -->
h = Math.atan2(dz, dx); if (th < 0) th += Math.PI * 2;
      var gate = 0.45;
      var cands = [];
      for (var k = 0; k <= 2; k++) {
        var tht = th + k * Math.PI * 2;
        if (tht > THETA_MAX + 0.3) continue;
        var s = tht / THETA_MAX;
        if (Math.abs(r - radiusAt(s)) <= 3.6) cands.push(yAt(s));
      }
      if (Math.hypot(wx - startPt.x, wz - startPt.z) <= 7) cands.push(Y0);
      if (Math.hypot(wx - endPt.x, wz - endPt.z) <= 12) cands.push(Y1);
      var best = null;
      for (var ci = 0; ci < cands.length; ci++) {
        var y = cands[ci];
        if (py == null || y <= py + gate) { if (best == null || y > best) best = y; }
      }
      return best;
    }
  };
  return group;
}
export default createStairOfLight;


===== FILE: public/city/starwell-place.js =====
/* Solid City — places THE STARWELL (public/city/starwell.js): the vast chamber
   where the Bore ends — deep space made physical.
   Lazy: imported after the city is built; any import/build error is caught and
   the city carries on. Floor height is read from the village (terrace A top),
   matching the Bore exactly — one unbroken journey.
   Adds: perimeter collision, radar blip, Hyper POI, Watch caption.
   No narration — the space explains itself. */
(function () {
'use strict';
if (!window.SC || !SC.api) return;
var A = SC.api, S = A.S;
var POS = { x: 2000, z: 1010 }, RAD = 72; // chamber center; the Bore meets its south edge
var M = { state: 'idle', group: null, wait: 7.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;
  } 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 = 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, starwell: 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]); }); }
function hyperStop() {
  var H = window.CityHyper; if (!H || !H.pois || H.pois.some(function (p) { return p.id === 'the-starwell'; })) return;
  H.pois.push({ id: 'the-starwell', name: 'The Starwell', short: 'STARWELL', x: POS.x, z: POS.z, stand: { x: POS.x, z: POS.z + 42 },
    alias: 'starwell stars cosmos space chamber',
    text: 'The Starwell: the Bore opens into deep space made physical — a dome of stars, nebula mist, five perfect forms orbiting a single star.' });
  if (H.regrid) H.regrid();
}
function watchStop() {
  var W = window.CityWatch, r = W && W.routes && W.routes.grand; if (!r || r._starwell) return;
  var orig = r.build; r._starwell = true;
  r.build = function () {
    var w = orig.apply(this, arguments);
    w.push({ x: POS.x, z: POS.z + 130, y: M.floorY + 190, v: 220, cap: { cap: 'THE STARWELL', sub: 'deep space · made physical', say: 'The Starwell: the tunnel opens into deep space made physical. Five perfect forms orbit a single star.' }, agl: false });
    return w;
  };
}
function standY(x, z) {
  var dx = x - POS.x, dz = z - POS.z;
  if (Math.hypot(dx, dz) < RAD - 1) return M.floorY; // chamber floor
  if (Math.abs(dx) < 6.4 && dz < -RAD + 3 && dz > -RAD - 14) return M.floorY; // the dark alcove
  return -1000;
}
function load() {
  var fy = villageFloor();
  if (fy === null) { M.wait = 1.5; return; }
  M.floorY = fy; M.state = 'loading';
  var p; try { p = import('/city/starwell.js?v=20261011b'); } catch (e) { p = Promise.reject(e); }
  p.then(function (mod) {
    var make = mod.createStarwell || 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] Starwell 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);
  M.group.visible = d < 6000;
  if (d < 2000 && 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, '#7a6aff', fl ? 3 : 6, fl ? '' : 'STARWELL'); }
window.CityStarwell = { update: update