<!-- SOLID CITY · part 3434 -->
, radar: radar, pos: POS, standY: standY, state: function () { return M.state; } };
})();


===== FILE: public/city/starwell.js =====
/* SOLID CITY — THE STARWELL (2026-10-11, the King's signature commission)
 * "A long tunnel through the mountain to a whole new space vibe."
 *
 * THE STARWELL: the Bore opens into deep space made physical. Leave the warm
 * wood-and-fire village behind — this is the cosmos, enclosed: dark basalt,
 * a true dome of stars (thousands of points), nebula mist in deep blues and
 * violets, and the five Platonic solids — tetrahedron, cube, octahedron,
 * dodecahedron, icosahedron — the five perfect forms, slowly rotating, lit
 * from within. At the heart: a single brilliant star floating above a dark
 * monolith. Visitors orbit it silently.
 *
 * The transition is total: warm -> precise -> infinite. Stone, mathematics, cosmos.
 *
 * The King's loose-end law: its true name is set in stone, one quiet marker each.
 *   - THE EMERGENCE: where the Bore meets the Starwell (south portal, this module)
 *   - A PASSAGE YET TO BE WALKED: the dark north arch — an honest unfinished edge
 *
 * Self-contained ES module. Local frame: chamber center (0,0,0), floor y=0.
 * The placer sets world position. Chamber radius 72.
 */
var PHI = 1.6180339887;
var R_CH = 72;
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; }; }
function 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 ? 30 : 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();
  grp.add(new T.Mesh(new T.BoxGeometry(w + 0.8, w * 160 / 512 + 0.8, 0.5), stoneMat));
  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 nebulaTexture(T, color) {
  var c = document.createElement('canvas'); c.width = 256; c.height = 256;
  var g = c.getContext('2d');
  var gr = g.createRadialGradient(128, 128, 8, 128, 128, 128);
  gr.addColorStop(0, color); gr.addColorStop(0.45, color + '66'); gr.addColorStop(1, color + '00');
  g.fillStyle = gr; g.fillRect(0, 0, 256, 256);
  var t = new T.CanvasTexture(c); t.encoding = T.sRGBEncoding; return t;
}
function glowTexture(T) {
  var c = document.createElement('canvas'); c.width = 256; c.height = 256;
  var g = c.getContext('2d');
  var gr = g.createRadialGradient(128, 128, 4, 128, 128, 128);
  gr.addColorStop(0, 'rgba(255,250,235,1)'); gr.addColorStop(0.3, 'rgba(255,240,210,0.55)');
  gr.addColorStop(1, 'rgba(255,240,210,0)');
  g.fillStyle = gr; g.fillRect(0, 0, 256, 256);
  var t = new T.CanvasTexture(c); t.encoding = T.sRGBEncoding; return t;
}
function archRingGeo(T, scale, stoneMat) {
  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.6 * scale, bevelEnabled: false, curveSegments: 40 });
  geo.translate(0, 0, -0.8 * scale);
  return new T.Mesh(geo, stoneMat);
}

export function createStarwell(o) {
  var T = o.THREE, P = o.position || { x: 0, y: 0, z: 0 };
  var root = new T.Group(); root.name = 'starwell'; root.position.set(P.x, P.y, P.z);
  var R = mulberry(20261012);
  var foot = [];
  var stoneMat = new T.MeshLambertMaterial({ color: 0x2b2630 });
  var basaltMat = new T.MeshLambertMaterial({ color: 0x1c1a20 });
  var goldBasic = new T.MeshBasicMaterial({ color: 0xd8aa48 });

  // ---------- floor: dark polished basalt ----------
  var floor = new T.Mesh(new T.CircleGeometry(R_CH + 2, 72),
    new T.MeshLambertMaterial({ color: 0x0d0c12 }));
  floor.rotation.x = -Math.PI / 2; floor.position.y = 0.02; root.add(floor);
  // orbit rings: mathematics underfoot
  [15, 28, 42, 56].forEach(function (rr) {
    var ring = new T.Mesh(new T.RingGeometry(rr - 0.22, rr + 0.22, 128), goldBasic);
    ring.rotation.x = -Math.PI / 2; ring.position.y = 0.07; root.add(ring);
  });
  // the meridian continues: from the emergence to the monolith
  var mer = new T.Mesh(new T.BoxGeometry(0.35, 0.07, 64), goldBasic);
  mer.position.set(0, 0.06, 38); root.add(mer);

  // ---------- the dome of stars ----------
  var dome = new T.Mesh(
    new T.SphereGeometry(R_CH, 48, 24, 0, Math.PI * 2, 0, Math.PI / 2),
    new T.MeshBasicMaterial({ color: