<!-- SOLID CITY · part 1764 -->
ct. Tap SABLE to talk. The spaceport is south-west — board a ship and fly.', 8);
}
$('sc-enter').disabled = true; $('sc-enter').addEventListener('click', enter);
S.camYaw = 0;
boot();

/* test / screenshot hooks (read-only debugging; no server effect) */
window.SC = {
  state: S, origin: origin,
  stats: function () { var ft = frameTimes.slice().sort(function (a, b) { return a - b; }); var avg = ft.reduce(function (a, b) { return a + b; }, 0) / (ft.length || 1); var wt = workTimes.slice().sort(function (a, b) { return a - b; }); return { workAvgMs: wt.reduce(function (a, b) { return a + b; }, 0) / (wt.length || 1), workP95Ms: wt[Math.floor(wt.length * 0.95)] || 0, fps: fpsVal, avgMs: avg, p95Ms: ft[Math.floor(ft.length * 0.95)] || 0, calls: renderer.info.render.calls, tris: renderer.info.render.triangles, terrain: terrainStats(), solids: solids.length, mem: renderer.info.memory }; },
  resetFrames: function () { frameTimes.length = 0; workTimes.length = 0; },
  fly: function (x, y, z, heading, pitch) { S.mode = 'fly'; avatar.visible = false; S.ship.x = x; S.ship.y = y; S.ship.z = z; S.ship.q.setFromAxisAngle(UP, heading || 0); rotLocal(AX, -(pitch || 0)); S.ship.speed = 300; S.ship.throttle = 0.6; setFlightUI(true); shipCam = null; },
  walk: function (x, z, yaw) { S.mode = 'walk'; avatar.visible = true; S.p.x = x; S.p.z = z; S.p.y = groundAt(x, z); if (yaw != null) S.camYaw = yaw; setFlightUI(false); },
  board: board, launch: startCountdown, talk: openTalk, soul: openSoul, rtc: returnToCity, heightAt: heightAt
};
window.SC.api = {
  T: T, S: S, D: D, PAD: PAD, SABLE_POS: SABLE_POS, VOLCANOES: VOLCANOES, ISLANDS: ISLANDS, CITY_Y: CITY_Y, IS_TOUCH: IS_TOUCH, MOBILE: MOBILE,
  world: world, scene: scene, camera: camera, renderer: renderer, origin: origin, curve: curve, labelTex: labelTex, groundAt: groundAt, heightAt: heightAt, whereName: whereName,
  solids: solids, portals: portals, RADIO_MASTS: RADIO_MASTS, input: input, help: help, openPortal: openPortal, openTalk: openTalk,
  startAuto: startAuto, shipVectors: shipVectors, maxSpeed: maxSpeed, setFlightUI: setFlightUI, avatar: avatar,
  resetShipCam: function () { shipCam = null; }, solidsTop: function (x, z, pad) { var t = -1e9; for (var k = 0; k < solids.length; k++) { var q = solids[k]; if (x > q.x0 - pad && x < q.x1 + pad && z > q.z0 - pad && z < q.z1 + pad && q.y1 > t) t = q.y1; } return t; },
  rotLocal: rotLocal, levelShip: levelShip, startCountdown: startCountdown, board: board, R_PLANET: R_PLANET, ship: ship,
  isBuilt: function () { return cityBuilt; }, openSoul: openSoul, SOUL: SOUL, soulTab: spTab
};
})();


===== FILE: public/city/city.js.tmp =====
/* SOLID CITY — epistles.xyz/city (MVP, 2026-10-09)
 * Client-side only: a red/black/gold city on a ~64 km procedural island chain
 * (a nod to the Big Island), chunked quadtree LOD terrain, curved-planet shader,
 * floating origin, sky/stars/galaxy, orbit layer, walking + arcade spaceship,
 * SABLE NPC (login-gated, via /api/city/sable -> existing SABLE route).
 * Solidivism rule kept: everything visible near the ground is solid (colliders).
 */
(function () {
'use strict';
var T = window.THREE;
var $ = function (id) { return document.getElementById(id); };
var IS_TOUCH = ('ontouchstart' in window) || navigator.maxTouchPoints > 0;
var MOBILE = IS_TOUCH && Math.min(screen.width, screen.height) < 820;
var QS = new URLSearchParams(location.search);
var R_PLANET = 1200000;            // curvature radius (m) — horizon & orbit look
var CITY_Y = 22;                   // city ground height
var SEED = 20261009;
var PERF = QS.has('perf');

/* ---------------- seeded simplex noise (2D) ---------------- */
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; }; }
var rnd = mulberry(SEED);
var perm = new Uint8Array(512), p0 = [];
for (var i = 0; i < 256; i++) p0[i] = i;
for (i = 255; i > 0; i--) { var j = Math.floor(rnd() * (i + 1)), tt = p0[i]; p0[i] = p0[j]; p0[j] = tt; }
for (i = 0; i < 512; i++) perm[i] = p0[i & 255];
var G2 = [[1,1],[-1,1],[1,-1],[-1,-1],[1,0],[-1,0],[0,1],[0,-1]];
var F2 = 0.5 * (Math.sqrt(3) - 1), Gk = (3 - Math.sqrt(3)) / 6;
function snoise(x, y) {
  var s = (x + y) * F2, i = Math.floor(x + s), j = Math.floor(y + s);
  var t = (i + j) * Gk, x0 = x - (i - t), y0 = y - (j - t);
  var i1 = x0 > y0 ? 1 : 0, j1 = 1 - i1;
  var x1 = x0 - i1 + Gk, y1 = y0 - j1 + Gk, x2 = x0 - 1 + 2 * Gk, y2 = y0 - 1 + 2 * Gk;
  var ii = i & 255, jj = j & 255, n = 0, g, tq;
  tq = 0.5 - x0 * x0 - y0 * y0; if (tq > 0) { g = G2[perm[ii + perm[jj]] & 7]; tq *= tq; n += tq * tq * (g[0] * x0 + g[1] * y0); }
  tq = 0.5 - x1 * x1 - y1 * y1; if (tq > 0) { g = G2[perm[ii + i1 + perm[jj + j1]] & 7]; tq *= tq; n += tq * tq * (g[0] * x1 + g[1] * y1); }
  tq = 0.5 - x2 * x2 - y2 * y2; if (tq > 0) { g = G2[perm[ii + 1 + perm[jj + 1]] & 7]; tq