<!-- SOLID CITY · part 1969 -->
-139, 122, 2, 100, 0, ly - 4, ly - 0.1);
  addBox(139, 122, 2, 100, 0, ly - 4, ly - 0.1);
}
function hyperStop() {
  var H = window.CityHyper; if (!H || !H.pois || H.pois.some(function (p) { return p.id === 'south-lot'; })) return;
  H.pois.push({ id: 'south-lot', name: 'The South Lot', short: 'SOUTH LOT', x: POS.x, z: POS.z + 122, stand: { x: POS.x, z: POS.z + 100 },
    alias: 'south lot parking rides cars dart hauler long road first city parking',
    text: 'The South Lot, under the First City\u2019s southern edge: fourteen futuristic rides waiting in the stalls. Walk to one and roll \u2014 the Long Road runs east from the lot to the capital shelf.' });
  if (H.regrid) H.regrid();
}
function outButton() {
  if (M.outBtn) return M.outBtn;
  var b = document.createElement('button');
  b.textContent = 'STEP OUT \u2B07';
  b.style.cssText = 'position:fixed;left:50%;bottom:212px;transform:translateX(-50%);z-index:60;display:none;padding:12px 22px;border-radius:24px;border:2px solid #d8aa48;background:rgba(12,14,20,0.88);color:#ffd873;font:700 15px Georgia,serif;letter-spacing:1px;';
  b.addEventListener('pointerdown', function (ev) { ev.preventDefault(); act(); });
  document.body.appendChild(b);
  M.outBtn = b;
  return b;
}
function nearCar(wx, wz) {
  if (!M.group) return null;
  var cars = (M.group.userData || {}).cars || [], best = null, bd = 5.2;
  cars.forEach(function (car) {
    if (car.state !== 'parked') return;
    var d = Math.hypot(wx - (POS.x + car.x), wz - (POS.z + car.z));
    if (d < bd) { bd = d; best = car; }
  });
  return best;
}
function actHere(wx, wz) {
  if (window.CityDrive && CityDrive.active()) return { kind: 'firstparking', label: 'STEP OUT OF THE RIDE' };
  var car = nearCar(wx, wz);
  if (car) return { kind: 'firstparking', label: '\uD83D\uDE97 ROLL \u2014 ' + car.name };
  return null;
}
function act() {
  if (window.CityDrive && CityDrive.active()) {
    var st = CityDrive.state();
    CityDrive.end();
    if (st && st.carId && M.group) {
      (M.group.userData.cars || []).forEach(function (car) {
        if (car.id === st.carId) {
          car.state = 'parked';
          car.x = car.mesh.position.x; car.z = car.mesh.position.z; car.yaw = car.mesh.rotation.y;
          car.solids = addBox(car.x, car.z, 2.6, 5.6, car.yaw, car.y, car.y + 2.1);
        }
      });
    }
    return;
  }
  var car = nearCar(S.p.x, S.p.z);
  if (!car || !window.CityDrive) return;
  removeSolids(car.solids); car.solids = null;
  car.state = 'driven';
  CityDrive.begin(car.mesh, car.yaw, POS.x, POS.z, car.id);
}
function load() {
  M.state = 'loading';
  var p; try { p = import('/city/first-city-parking.js?v=20261013a'); } catch (e) { p = Promise.reject(e); }
  p.then(function (mod) {
    var make = mod.createFirstParking || mod.default;
    var g = make({ THREE: A.T, groundAt: (typeof groundAt === 'function') ? groundAt : function () { return 20; }, deckY: firstCityDeckY() });
    g.position.set(POS.x, 0, POS.z);
    A.world.add(g); M.group = g; M.state = 'ready';
    collide(g.userData || {}); hyperStop(); outButton();
    if (window.logBuild) logBuild('first-parking', 'The South Lot: apron + ramp + 14 rides + the Long Road, below the First City');
  }).catch(function (e) { M.state = 'failed'; try { console.warn('[city] South Lot skipped:', e && e.message); } catch (x) {} });
}
function standY(wx, wz, wy) {
  var deckY = firstCityDeckY(), best = -1;
  // the First City's own podium (lent by this placer until its own grows one)
  if (wx > FC.x - 212 && wx < FC.x + 212 && wz > FC.z - 380 && wz < FC.z + 380) {
    if (wy > deckY - 2.4 && deckY > best) best = deckY;
  }
  if (M.state !== 'ready' || !M.group) return best;
  var lx = wx - POS.x, lz = wz - POS.z, zones = M.group.userData.zones || [];
  for (var i = 0; i < zones.length; i++) {
    var zn = zones[i];
    if (zn.kind === 'flat') {
      if (lx >= zn.x0 && lx <= zn.x1 && lz >= zn.z0 && lz <= zn.z1 && wy > zn.y - 2.4 && zn.y > best) best = zn.y;
    } else if (zn.kind === 'ramp') {
      if (lx >= zn.x0 && lx <= zn.x1 && lz >= zn.z0 && lz <= zn.z1) {
        var t = (lz - zn.z0) / (zn.z1 - zn.z0), sy = zn.y0 + (zn.y1 - zn.y0) * t;
        if (wy > sy - 2.4 && sy > best) best = sy;
      }
    } else if (zn.kind === 'road') {
      for (var j = 0; j < zn.segs.length; j++) {
        var sg = zn.segs[j], dx = sg.x2 - sg.x1, dz = sg.z2 - sg.z1, L2 = dx * dx + dz * dz;
        var tt = L2 > 0 ? ((lx - sg.x1) * dx + (lz - sg.z1) * dz) / L2 : 0;
        if (tt < -0.05 || tt > 1.05) continue;
        var px = sg.x1 + dx * tt, pz = sg.z1 + dz * tt;
        if (Math.hypot(lx - px, lz - pz) > 7.2) continue;
        var ry = sg.y1 + (sg.y2 - sg.y1) * tt + 0.02;
        if (wy > ry - 2.4 && ry > best) best = ry;
      }
    }
  }
  return best;
}
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.hi