<!-- NEW1 — TEST 1 · THE LIVING DISTRICT · part 9 -->
st fwd = (inp.fwd ? 1 : 0) - (inp.back ? 0.55 : 0);
    let moved = 0;
    if (fwd !== 0) {
      const dx = Math.sin(king.yaw) * fwd, dz = Math.cos(king.yaw) * fwd;
      const step = WALK_SPEED * dt;
      // axis-separated: slide along walls instead of sticking to them
      const nx = king.x + dx * step;
      if (!hitsCollider(nx, king.z) && !inWater(nx, king.z)) { king.x = nx; moved = step; }
      const nz = king.z + dz * step;
      if (!hitsCollider(king.x, nz) && !inWater(king.x, nz)) { king.z = nz; moved = step; }
      // the world's rim: the district apron, no farther
      king.x = Math.max(-330, Math.min(330, king.x));
      king.z = Math.max(-290, Math.min(290, king.z));
    }
    // On a bridge his feet ride the deck's rise (a smooth crown over
    // the band's middle); everywhere else the stand layer is flat law.
    let lift = 0;
    const band = meta.riverBand;
    if (king.z > band.zMin && king.z < band.zMax && meta.bridges.some((bx) => Math.abs(bx - king.x) < 6.5)) {
      const b = 1 - (king.z / ((band.zMax - band.zMin) / 2)) ** 2;
      lift = 1.3 * Math.max(0, b);
    }
    group.position.set(king.x, lift, king.z);
    group.rotation.y = king.yaw;
    if (moved > 0) {
      king.phase += moved * gait.walk.phasePerUnit;
      poses.walk(rig, king.phase, 1);
    } else {
      poses.idle(rig, king.t, 0.8);
    }
    return { x: king.x, z: king.z, yaw: king.yaw };
  };

  /* ---------- the street camera: behind him, smoothed, fenced ---- */
  const _want = new THREE.Vector3(), _look = new THREE.Vector3();
  king.boom = function (camera, dt) {
    const fx = Math.sin(king.yaw), fz = Math.cos(king.yaw);
    _want.set(king.x - fx * king.boomD, king.boomH, king.z - fz * king.boomD);
    // the camera may not sink into a building either: if its resting
    // place falls inside a solid, rise above that solid's roof.
    const hit = hitsCollider(_want.x, _want.z);
    if (hit) _want.y = Math.max(_want.y, hit.top + 1.6);
    if (_want.y < king.BOOM_MIN_Y) _want.y = king.BOOM_MIN_Y;
    const k = 1 - Math.exp(-dt * 4.5);
    camera.position.lerp(_want, k);
    _look.set(king.x + fx * 5, 1.7, king.z + fz * 5);
    camera.lookAt(_look);
    return camera.position;
  };

  return king;
}

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


===== FILE: public/new1/index.html =====
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>NEW1 — The Block City Test</title>
<style>
  html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; background: #0a0e14; }
  #app, #app canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
  .masthead {
    position: fixed; top: 0; left: 0; right: 0; z-index: 5; pointer-events: none;
    padding: 14px 16px 26px; color: #f3e9d2; text-align: center;
    font-family: Georgia, 'Times New Roman', serif;
    background: linear-gradient(180deg, rgba(5,6,10,.82), rgba(5,6,10,0));
  }
  .masthead .kicker { font-size: 11px; letter-spacing: .34em; color: #d8a944; text-transform: uppercase; }
  .masthead h1 { margin: 4px 0 2px; font-size: 26px; font-weight: 600; letter-spacing: .06em; }
  .masthead .sub { font-size: 13px; font-style: italic; color: #cfc4a5; }
  .masthead .crew { margin-top: 5px; font-size: 11px; letter-spacing: .14em; color: #9d937a; text-transform: uppercase; }
  .census {
    position: fixed; left: 12px; bottom: 12px; z-index: 5; pointer-events: none;
    max-width: calc(100vw - 48px); box-sizing: border-box;
    font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; line-height: 1.65;
    color: #bfe3c0; background: rgba(6,10,7,.62); border: 1px solid rgba(150,220,160,.25);
    border-radius: 10px; padding: 8px 12px; white-space: pre-wrap; overflow-wrap: break-word;
  }
  @media (max-width: 520px) {
    .census { font-size: 10.5px; line-height: 1.6; left: 8px; bottom: 8px; padding: 7px 10px; }
  }
  .census b { color: #ffe9a8; font-weight: 600; }
  .census .spot { color: #ffd9ec; }
  .err { color: #ff9d8a; }
  #enterBtn {
    position: fixed; top: 118px; right: 12px; z-index: 6;
    font-family: Georgia, 'Times New Roman', serif; font-size: 13px; font-weight: 700;
    letter-spacing: .18em; color: #241a02; padding: 12px 18px; border-radius: 999px;
    border: 1px solid #8a6a1d; cursor: pointer;
    background: linear-gradient(180deg, #f6d97b, #d8a944 55%, #b9862f);
    box-shadow: 0 2px 14px rgba(216,169,68,.45), inset 0 1px 0 rgba(255,255,255,.55);
  }
  #enterBtn:active { transform: translateY(1px); }
  #pad { display: none; }
  body.inside #pad { display: block; }
  .padCluster { position: fixed; z-index: 6; display: flex; gap: 14px; }
  .padTurn { left: 14px; bottom: 168px; }
  .pa