<!-- SOLID CITY · part 57 -->
R.id = 'bk-reader'; R.hidden = true; R.setAttribute('role', 'dialog'); R.setAttribute('aria-label', "The King's Book of Law");
  var bk = el('div'); bk.id = 'bk-book';
  var hd = el('div', 'bk-hd'), prevTop = el('button', 'bk-btn', '\u2715'); prevTop.type = 'button'; prevTop.setAttribute('aria-label', 'Close the book'); prevTop.id = 'bk-x';
  var crest = el('div', 'bk-crest', "THE KING'S BOOK OF LAW"), share = el('a', 'bk-btn', '\u2197'); share.href = '/book-of-law'; share.target = '_blank'; share.rel = 'noopener'; share.title = 'Open the public page'; share.style.cssText = 'display:inline-flex;align-items:center;justify-content:center;text-decoration:none';
  hd.appendChild(share); hd.appendChild(crest); hd.appendChild(prevTop);
  var page = el('div'); page.id = 'bk-page'; page.tabIndex = 0;
  var ft = el('div', 'bk-ft'), pv = el('button', 'bk-btn', '\u2039 Prev'), sel = el('select'), nx = el('button', 'bk-btn', 'Next \u203A');
  pv.type = nx.type = 'button'; pv.id = 'bk-prev'; nx.id = 'bk-next'; sel.id = 'bk-toc'; sel.setAttribute('aria-label', 'Contents');
  ft.appendChild(pv); ft.appendChild(sel); ft.appendChild(nx);
  bk.appendChild(hd); bk.appendChild(page); bk.appendChild(ft); R.appendChild(bk); ($('sc-hud') || document.body).appendChild(R);
  ['pointerdown', 'wheel', 'touchstart'].forEach(function (ev) { R.addEventListener(ev, function (e) { e.stopPropagation(); }, { passive: true }); });
  R.addEventListener('keydown', function (e) { if (e.key === 'Escape') close(); else if (e.key === 'ArrowRight') go(B.page + 1); else if (e.key === 'ArrowLeft') go(B.page - 1); e.stopPropagation(); });
  R.addEventListener('keyup', function (e) { e.stopPropagation(); });
  addEventListener('keydown', function (e) { if (e.key === 'Escape' && R && !R.hidden) { close(); e.stopPropagation(); } }, true);   // Esc closes from any focused control
  R.addEventListener('click', function (e) { if (e.target === R) close(); });
  prevTop.addEventListener('click', close); pv.addEventListener('click', function () { go(B.page - 1); }); nx.addEventListener('click', function () { go(B.page + 1); });
  sel.addEventListener('change', function () { go(+sel.value); });
  var sx = 0, sy = 0; page.addEventListener('touchstart', function (e) { sx = e.touches[0].clientX; sy = e.touches[0].clientY; }, { passive: true });
  page.addEventListener('touchend', function (e) { var dx = e.changedTouches[0].clientX - sx, dy = e.changedTouches[0].clientY - sy; if (Math.abs(dx) > 60 && Math.abs(dx) > Math.abs(dy) * 1.5) go(B.page + (dx < 0 ? 1 : -1)); }, { passive: true });
  return R;
}
function render(i, dir) {
  var b = B.book, page = $('bk-page'), sel = $('bk-toc'); page.textContent = '';
  if (!sel.options.length) { sel.appendChild(el('option', null, 'Title page')).value = '0'; b.pages.forEach(function (p) { var o = el('option', null, p.label.replace(/^PAGE /, 'Page ') + ' \u2014 ' + p.title); o.value = String(p.n); sel.appendChild(o); }); }
  sel.value = String(i);
  if (i === 0) {
    var cv = el('div', 'bk-cover'); cv.innerHTML = CROWN;   // static markup only
    cv.appendChild(el('div', 'bk-big', b.title)); var r0 = el('div', 'bk-rule'); cv.appendChild(r0); cv.appendChild(el('p', 'bk-sub', b.subtitle));
    cv.appendChild(el('p', 'bk-label', 'THIRTEEN PAGES')); page.appendChild(cv);
  } else {
    var p = b.pages[i - 1]; page.appendChild(el('div', 'bk-label', p.label)); page.appendChild(el('h2', 'bk-title', p.title)); page.appendChild(el('div', 'bk-rule'));
    p.paras.forEach(function (t, k) { page.appendChild(el('p', k === 0 ? 'bk-first' : '', t)); });
    if (i === b.pages.length && b.sign) page.appendChild(el('p', 'bk-sign', b.sign));
  }
  $('bk-prev').disabled = i <= 0; $('bk-next').disabled = i >= b.pages.length;
  page.scrollTop = 0; page.classList.remove('turn-n', 'turn-p'); void page.offsetWidth; if (dir) page.classList.add(dir > 0 ? 'turn-n' : 'turn-p');
}
function go(i) { if (!B.book) return; i = Math.max(0, Math.min(B.book.pages.length, i)); if (i === B.page && $('bk-page').childNodes.length) return; var d = i - B.page; B.page = i; render(i, d); }
function open(i) {
  text().then(function () { reader(); R.hidden = false; B.page = i || 0; render(B.page, 0); setTimeout(function () { var p = $('bk-page'); if (p) p.focus({ preventScroll: true }); }, 30); })
    .catch(function () { if (window.CityHyper && CityHyper.narrate) CityHyper.narrate('The book could not be opened right now. Try again in a moment.', 4); });
}
function close() { if (R) R.hidden = true; }
window.CityBook = { update: update, radar: radar, actHere: actHere, open: open, close: close, POS: POS, READ: READ,
  state: function () { return { state: B.state, open: !!(R && !R.hidden), page: B.page, pages: B.book ? B.book.pages.length : 0 }; } };
})();


===== FILE: public/city/book-law.js.bak-sign-20261014 =====
/* SOLID CITY — THE KING'S BOOK OF LAW on display (2026-10-10, the King: "The first book will be on display with gold
   ultra-