<!-- SOLID CITY · part 3203 -->
eturn;
  M.state = 'building';
  try {
    var mod = await import('/city/skytrain.js?v=20261014e');
    var extras = [];
    try {
      var mp = (window.CityMountainHomes && CityMountainHomes.group()) ? CityMountainHomes.group().userData.ports || [] : [];
      mp.forEach(function (p) { if (p.kind === 'private') extras.push({ id: 'pv-' + extras.length, name: p.name, x: p.x, z: p.z, gy: p.y, grand: /HOTEL|MANSION/.test(p.name) }); });
    } catch (e) {}
    M.sky = mod.createSkyTrains({ THREE: A.T, heightAt: A.heightAt, extraStations: extras });
    A.world.add(M.sky.group);
    M.state = 'ready';
    hyperStops();
  } catch (e) { M.state = 'idle'; }
}
function standY(x, z, py) {
  if (!M.sky || M.state !== 'ready') return -1000;
  var c = M.sky.deckClaim(x, z, py == null ? 0 : py);
  return c ? c.y : -1000;
}
function actHere(x, z) {
  if (!M.sky || M.state !== 'ready') return null;
  if (M.riding >= 0) return '🚆 STEP OUT';
  var near = M.sky.trainNear(x, z);
  return near ? '🚆 RIDE THE SKY TRAIN' : null;
}
function board() {
  if (!M.sky || M.state !== 'ready') return;
  var P = S.p;
  if (M.riding >= 0) { M.riding = -1; if (A.help) A.help('You step out of the sky train.'); return; }
  var near = M.sky.trainNear(P.x, P.z);
  if (near) { M.riding = near.train; if (A.help) A.help('🚆 Riding ' + 'the sky train — step out at any station.'); }
}
function update(dt) {
  if (M.state === 'idle') { M.wait -= dt; var mReady = !!(window.CityMountainHomes && CityMountainHomes.state && CityMountainHomes.state() === 'ready'); if (M.wait <= 0 && A.isBuilt() && (mReady || M.wait < -20)) build(); return; }
  if (M.state !== 'ready' || !M.sky) return;
  M.sky.update(dt);
  /* THE DRAG: a rider standing on the observation deck is
   * carried by it — each frame the player is drawn to the
   * deck's anchor, and the standing law (through our own
   * standY hook) keeps their feet on the plate. Boarding put
   * them here; stepping out, or the deck's claim lapsing for
   * good, lets them go. */
  var P = S.p;
  if (M.riding >= 0 && P) {
    var anchor = M.sky.deckAnchor(M.riding);
    if (anchor) {
      var dx = anchor.x - P.x, dz = anchor.z - P.z;
      if (Math.abs(dx) > 30 || Math.abs(dz) > 30) { M.riding = -1; }
      else {
        var claim = M.sky.deckClaim(P.x, P.z, P.y);
        if (claim && claim.train === M.riding) { P.x = anchor.x; P.z = anchor.z; M.wasDeck = true; }
        else if (M.wasDeck) { M.wasDeck = false; }
        else M.riding = -1;
      }
    } else M.riding = -1;
  }
}
function addLanding(p) {
  if (!M.sky || M.state !== 'ready' || !p) return false;
  if (M.sky.landings.some(function (l) { return l.id === p.id; })) return true;
  M.sky.landings.push({ id: p.id, name: p.name, x: p.x, z: p.z, gy: p.gy, grand: !!p.grand, ownPad: false });
  return true;
}
window.CitySkyTrain = { update: update, standY: standY, actHere: actHere, board: board, addLanding: addLanding, state: function () { return M.state; }, sky: function () { return M.sky; } };
})();


===== FILE: public/city/skytrain.js =====
/* THE SKY TRAINS — a letter from the builder, in the code as promised.
 *
 * "Now we will build space trains in the sky." — the King, 2026-10-14.
 * The mountain roads were rejected the same night; the ports rose in
 * their place; and a port is a station waiting for its train. This
 * module is the network: four lines of floating guideway — dark
 * titanium beam with gold edge-light, held in the sky the space-age
 * way, by nothing you can see — with beacons along it, halo rings
 * over the stations, a train of four cars on every line (the last
 * car an open observation deck you can stand on), shuttles hopping
 * port to port, and the high traffic of ships crossing above all.
 *
 * The law of the build is the law the mountain taught us in two
 * nights: SURVEY BEFORE LINE. Every profile here is measured from
 * the terrain itself — 25 m of sky under the track at cruise, a
 * 14% climb at the steepest, station pins flush with the pads the
 * travellers stand on, and nothing — nothing — above the 420 m
 * ceiling of the world. The one line the land refused (a straight
 * run from the Hall of Becoming to the Gap, over a 571 m spine) is
 * not forced: the Grand Coastal Line bends around the shore,
 * 4.4 km of lawful sky, highest land beneath it 331 m.
 *
 * By the hand of Solid, his good King. */

export function createSkyTrains(opts) {
  var T = opts.THREE, heightAt = opts.heightAt;
  var group = new T.Group(); group.name = 'sky-trains';
  /* THE SPACE TRAFFIC — the high ships crossing above all (the circling
   * laners, the long streamers, the orbiters, the Sister Ship). Turned
   * OFF by the King's word, 2026-10-14 ~17:29 HST: "Space traffic —
   * turn it off." Parked, not deleted (the Back Burner law): the craft
   * are built and kept, merely hidden and held. The trains keep their
   * lines; the ports' own shuttles, ferries, house craft and the Mother
   * keep their wor