<!-- NEW1 — TEST 1 · THE LIVING DISTRICT · part 445 -->
 {
          poses.idle(c.rig, tReal + c.i, 1);
          c.timer += dtGame;
          if (c.timer > 25) { // a micro-stroll around the workplace now and then
            c.timer = 0;
            const a = rng() * 6.28, r = rng() * 10;
            c.workMicro = { x: c.jobPoint.x + Math.cos(a) * r, z: c.jobPoint.z + Math.sin(a) * r };
          }
          if (c.workMicro) {
            const dx = c.workMicro.x - c.x, dz = c.workMicro.z - c.z, d = Math.hypot(dx, dz);
            if (d > 0.5) {
              const sp = gait.walk.speed * 2;
              placeAt(c, c.x + (dx / d) * sp * dtReal, c.z + (dz / d) * sp * dtReal);
              faceTo(c, dx, dz);
              c.phase += sp * dtReal * gait.walk.phasePerUnit;
              poses.walk(c.rig, c.phase, 0.7);
            }
          }
          if (now >= p.workEnd) {
            if (p.errand) startRoute(c, grocery.center, 'errand');
            else if (p.leisure) startRoute(c, leisureGate(c), 'leisure');
            else startRoute(c, c.home.door, 'home');
          }
          break;
        }
        case 'errand':
          poses.idle(c.rig, tReal + c.i, 1);
          c.timer -= dtGame;
          if (c.timer <= 0) {
            if (p.leisure && now < 1260) startRoute(c, leisureGate(c), 'leisure');
            else startRoute(c, c.home.door, 'home');
          }
          break;
        case 'leisure': stepLeisure(c, dtGame, dtReal, tReal); break;
      }
    }
    stepBall(dtReal);
  }
  function leisureGate(c) {
    // the door you arrive at for each leisure kind
    if (c.leisureKind === 'football') return { x: pitch.x, z: pitch.z + pitch.hd + 4 };
    if (c.leisureKind === 'run' || c.leisureKind === 'walk') return { x: park.center.x + 26, z: park.center.z };
    if (c.leisureKind === 'bike') return { x: c.home.door.x, z: c.home.door.z }; // the joyride starts from home streets — arrive home first, ride from there
    return { x: park.center.x, z: park.center.z };
  }

  function census() {
    const counts = { sleep: 0, travel: 0, work: 0, errand: 0, leisure: 0 };
    for (const c of citizens) counts[c.state] = (counts[c.state] || 0) + 1;
    const hh = String(Math.floor(gameMin / 60)).padStart(2, '0');
    const mm = String(Math.floor(gameMin % 60)).padStart(2, '0');
    const awake = citizens.filter((c) => c.state !== 'sleep');
    let spotlight = 'the city sleeps';
    if (awake.length) {
      const c = awake[Math.floor(tReal / 6) % awake.length];
      const doing = { travel: 'is on the way', work: 'is at work — ' + c.job.name, errand: 'is at the grocery', leisure: 'is at leisure' }[c.state] || 'is out';
      spotlight = c.name + ' of ' + c.home.suburb + ' ' + doing;
    }
    return { day, clock: hh + ':' + mm, counts, spotlight };
  }

  return { group, update, census, citizens };
}

if (typeof module !== 'undefined' && module.exports) module.exports = { makeLife };
if (typeof window !== 'undefined') window.makeLife = makeLife;
export { makeLife };
export default makeLife;


===== FILE: public/new1/stage.js =====
/* stage.js — THE STAGE for the King's /new1 test.
 *
 * One factory: makeStage(THREE, renderer, opts) -> stage
 *
 * The stage is the foundation every other piece stands on:
 *   1. THE MAP FLOOR   — one large flat plane the whole district sits on.
 *   2. THE STAND LAYER — an invisible plane 0.02 above the floor. Every
 *      character in the world resolves its standing height through
 *      stage.groundY(x, z). Decorative geometry can dip, tilt or lie;
 *      feet cannot. Nobody falls beneath a floor again.
 *   3. THE CAMERA RIG  — a slow cinematic establishing move that frames
 *      the WHOLE district at once, with hard anti-incursion clamps:
 *      the polar angle and distance are fenced so the view can never
 *      clip inside a building, dive under the floor, or frame the void
 *      past the world edge.
 *   4. BUILD MEMORY    — Solid's memory ships in every build (the King's
 *      standing law): window.logBuild / window.readMemory on the
 *      localStorage key 'solid-memory'.
 *
 * Self-contained: no assets, no CDN. THREE is handed in by the caller.
 */

'use strict';

/* ------------------------------------------------------------------ */
/* Build memory (the King's law: no map ships without it)              */
/* ------------------------------------------------------------------ */

var MEMORY_KEY = 'solid-memory';
var memoryMirror = [];

function memoryRead() {
  try {
    var raw = window.localStorage.getItem(MEMORY_KEY);
    if (raw) {
      var list = JSON.parse(raw);
      if (Array.isArray(list)) memoryMirror = list;
    }
    /* raw === null: storage is empty or unreachable — the mirror
     * already holds the truth; never let an empty read erase it. */
  } catch (e) { /* storage unavailable — the mirror still holds the log */ }
  return memoryMirror;
}

function memoryLog(site, what) {
  memoryRead();
  memoryMirror.push({ t: Date.now(), s