<!-- SOLID CITY · part 2958 -->
d * 0.55, 0, topY + 1.15, -d * 0.14, st.roof, 0.48, 0, 0);
      box(solid, f, w * 0.62, 0.16, d * 0.55, 0, topY + 1.15, d * 0.14, st.roof, -0.48, 0, 0);
    } else {
      box(solid, f, w + 1.0, 0.28, d + 1.0, 0, topY + 0.14, 0, st.roof);
      box(glow, f, w + 1.04, 0.1, d + 1.04, 0, topY + 0.3, 0, C.gold);
    }
    footprint(f, w, d, BASE, BASE + topY + 2.1);
    return record('', 'house', f, district);
  }
  function buildPavilion(f, district, big) {
    var w = big ? 17 : 12, d = big ? 13 : 9.5;
    box(solid, f, w + 2, 0.3, d + 2, 0, 0.15, 0, C.stone);
    standRect(f, w + 2, d + 2, BASE + 0.3, 0, 0);
    for (var px = -1; px <= 1; px += 2) for (var pz = -1; pz <= 1; pz += 2) {
      box(solid, f, 0.42, 3.1, 0.42, px * (w / 2 - 0.5), 1.85, pz * (d / 2 - 0.5), C.woodDark);
      footprints.push({ x: f.x + f.tx * px * (w / 2 - 0.5) + f.rx * pz * (d / 2 - 0.5), z: f.z + f.tz * px * (w / 2 - 0.5) + f.rz * pz * (d / 2 - 0.5), w: 0.6, d: 0.6, a: f.a, y0: BASE, y1: BASE + 3.4 });
    }
    cyl(solid, f, 0.4, Math.max(w, d) * 0.78, 2.6, 4, 0, 4.9, 0, C.slate, 0, Math.PI / 4, 0);
    box(glow, f, 0.7, 0.7, 0.7, 0, 6.35, 0, C.gold);
    box(solid, f, w * 0.55, 0.45, 0.6, 0, 0.55, 0, C.wood);
    return record('', 'pavilion', f, district);
  }
  function buildGrand(f, district, kind, name) {
    var isHotel = kind === 'hotel';
    var w = isHotel ? 40 : 30, d = isHotel ? 17 : 19, floors = isHotel ? 3 : 2, fh = 3.1;
    var platD = isHotel ? d + 6 : d + 12, platZ = isHotel ? -0.8 : 1.5;
    box(solid, f, w + 5, 0.4, platD, 0, 0.2, platZ, C.stone);
    standRect(f, w + 5, platD, BASE + 0.4, 0, platZ);
    for (var fl = 0; fl < floors; fl++) {
      var fy = 0.4 + fl * fh;
      box(solid, f, w, fh, d, 0, fy + fh / 2, 0, fl === floors - 1 ? C.cream2 : C.cream);
      box(solid, f, w + 1.4, 0.16, 3.4, 0, fy + 0.08, -d / 2 - 1.7, C.conc);
      for (var px = -w / 2 + 2; px <= w / 2 - 2; px += 4) box(solid, f, 0.26, fh - 0.3, 0.26, px, fy + fh / 2, -d / 2 - 3.2, C.woodDark);
      box(glassB, f, w * 0.86, 1.05, 0.12, 0, fy + 1.85, -d / 2 - 0.07, C.glass);
    }
    var topY = 0.4 + floors * fh;
    box(solid, f, w + 1.4, 0.3, d + 1.4, 0, topY + 0.15, 0, C.slate);
    box(glow, f, w + 1.44, 0.12, d + 1.44, 0, topY + 0.02, 0, C.gold);
    box(solid, f, 3.4, 2.5, 0.3, 0, 1.65, -d / 2 - 0.16, C.woodDark);
    if (!isHotel) box(solid, f, 11, 0.22, 6.5, 0, 0.51, d / 2 + 4.1, C.pool);
    footprint(f, w, d, BASE, BASE + topY + 0.3);
    var rec = record(name, kind, f, district);
    return rec;
  }
  function buildStall(f) {
    box(solid, f, 5.6, 1.05, 2.4, 0, 0.72, 0, C.wood);
    for (var px = -1; px <= 1; px += 2) for (var pz = -1; pz <= 1; pz += 2)
      box(solid, f, 0.2, 2.5, 0.2, px * 2.7, 1.25, pz * 1.5, C.woodDark);
    box(solid, f, 6.6, 0.14, 4.2, 0, 2.62, 0, C.roofRed, 0.1, 0, 0);
    box(glow, f, 1.3, 0.3, 0.3, 0, 1.35, -1.25, [C.flower1, C.flower3, C.gold][Math.floor(R() * 3)]);
    footprint(f, 5.6, 2.4, BASE, BASE + 1.25);
  }
  function buildTree(f, palm) {
    var rec = { x: f.x, z: f.z };
    if (palm) {
      cyl(solid, f, 0.16, 0.24, 5.6, 6, 0, 2.8, 0, C.trunk, 0.12, 0, 0.06);
      for (var k = 0; k < 6; k++) {
        var aa = k / 6 * Math.PI * 2;
        box(solid, f, 3.6, 0.07, 0.7, Math.cos(aa) * 1.6, 5.9 - Math.abs(Math.sin(aa)) * 0.3, Math.sin(aa) * 1.6, C.leafLight, 0, -aa, 0.35);
      }
    } else {
      cyl(solid, f, 0.22, 0.34, 3.1, 6, 0, 1.55, 0, C.trunk);
      sph(solid, f, 2.6, 0, 4.6, 0, C.leaf, 1, 0.85, 1);
      sph(solid, f, 1.8, 1.4, 3.8, 0.7, C.leafLight, 1, 0.8, 1);
    }
    footprints.push({ x: f.x, z: f.z, w: 0.7, d: 0.7, a: f.a, y0: BASE, y1: BASE + 3 });
    trees.push(rec);
  }
  function buildGarden(f, r, ring2) {
    disc(solid, f, r, 0.045, C.lawn);
    if (ring2) disc(solid, f, r * 0.62, 0.06, C.lawnDeep);
    for (var k = 0; k < 9; k++) {
      var aa = R() * Math.PI * 2, rr = r * (0.35 + R() * 0.55);
      box(glow, f, 0.55, 0.3, 0.55, Math.cos(aa) * rr, 0.18, Math.sin(aa) * rr, [C.flower1, C.flower2, C.flower3][k % 3]);
    }
  }
  function buildFountain(f) {
    cyl(solid, f, 5.2, 5.6, 0.85, 18, 0, 0.43, 0, C.stone);
    cyl(solid, f, 4.5, 4.5, 0.3, 18, 0, 0.78, 0, C.pool);
    cyl(solid, f, 0.35, 0.5, 2.6, 8, 0, 1.7, 0, C.silver);
    sph(glow, f, 0.65, 0, 3.3, 0, C.gold);
    footprint(f, 10.6, 10.6, BASE, BASE + 0.9);
    return record('', 'fountain', f, '');
  }
  function buildLamp(f) {
    cyl(solid, f, 0.09, 0.13, 3.6, 6, 0, 1.8, 0, C.titanium);
    sph(glow, f, 0.32, 0, 3.8, 0, C.gold);
    footprints.push({ x: f.x, z: f.z, w: 0.3, d: 0.3, a: f.a, y0: BASE, y1: BASE + 3.6 });
  }

  /* ---------- the laying-out: bands between the roads ---------- */
  function angleDiff(a, b) { var d = Math.abs(a - b) % (Math.PI * 2); return d > Math.PI ? Math.PI * 2 - d : d; }
  if (SKY) {
    /* THE SKY TWIN'S FLOOR (the King's word, 2026-10-14: "Build
     * another in the sky above it — glass floor to see it from
     * below"): the whol