<!-- SOLID CITY · part 73 -->
dth:auto;top:auto;bottom:0;height:72vh;border-radius:16px 16px 0 0;border-width:2px 0 0;padding-bottom:env(safe-area-inset-bottom)}#uni-btn{bottom:auto;top:calc(232px + env(safe-area-inset-top))}}';
  document.head.appendChild(css);
}
function panel() {
  if (P) return P; styles();
  P = document.createElement('section'); P.id = 'uni-panel'; P.hidden = true; P.setAttribute('aria-label', 'Solid City University');
  P.innerHTML = '<div class="u-hd"><button type="button" id="uni-back" aria-label="Back">\u2190</button><b id="uni-title">Solid City University</b><button type="button" class="u-x" id="uni-x" aria-label="Close">\u2715</button></div><div class="u-bd" id="uni-body"></div>';
  ($('sc-hud') || document.body).appendChild(P); body = $('uni-body');
  ['pointerdown', 'wheel', 'touchstart'].forEach(function (ev) { P.addEventListener(ev, function (e) { e.stopPropagation(); }, { passive: true }); });
  ['keydown', 'keyup'].forEach(function (ev) { P.addEventListener(ev, function (e) { if (e.key === 'Escape') { close(); return; } e.stopPropagation(); }); });
  $('uni-x').addEventListener('click', close);
  $('uni-back').addEventListener('click', function () { var f = U.hist.pop(); if (f) f(true); else openDirectory(true); });
  return P;
}
U.hist = [];
function show(title, html, back) { panel(); $('uni-title').textContent = title; body.innerHTML = html; body.scrollTop = 0; P.hidden = false; U.open = true; $('uni-back').hidden = !U.hist.length && !back; }
function nav(fn) { return function (isBack) { if (!isBack && U.cur) U.hist.push(U.cur); if (U.hist.length > 20) U.hist.shift(); U.cur = fn; fn(); }; }
function close() { if (P) P.hidden = true; U.open = false; U.hist = []; U.cur = null; }
function bind(sel, fn) { body.querySelectorAll(sel).forEach(function (b) { b.addEventListener('click', function (e) { e.preventDefault(); fn(b, e); }); }); }
function me() {
  if (U.me) return Promise.resolve(U.me);
  return fetch('/api/city/me', { credentials: 'same-origin', cache: 'no-store' }).then(function (r) { return r.json(); }).then(function (j) { U.me = j || {}; U.csrf = (j && j.csrf) || ''; return U.me; }).catch(function () { U.me = {}; return U.me; });
}
function post(url, data) {
  return me().then(function () { return fetch(url, { method: 'POST', credentials: 'same-origin', headers: { 'Content-Type': 'application/json', 'X-CSRF-Token': U.csrf }, body: JSON.stringify(data || {}) }); })
    .then(function (r) { return r.json().catch(function () { return {}; }).then(function (j) { j._s = r.status; return j; }); });
}
function need(fn) { if (CUR) return fn(); show('Solid City University', '<p class="u-meta">Loading the curriculum\u2026</p>'); curriculum().then(fn).catch(function () { show('Solid City University', '<p class="u-err">The curriculum could not load. Try again in a moment.</p>'); }); }

function openDirectory(isBack) { need(function () { nav(function () {
  var h = '<p>Eight campuses on the University Ring, linked to the capital by lit roads. Walk, drive (Hyper) or fly; Watch has a <b>Campus Tour</b>.</p>' +
    CUR.campuses.map(function (c) { return '<div class="u-item"><b>' + esc(c.name) + '</b><small>' + esc(c.blurb) + '</small><div class="u-row"><button type="button" data-go="' + esc(c.id) + '">\uD83E\uDDED Go there</button><button type="button" data-cat="' + esc(c.id) + '">\uD83D\uDCDA Catalog</button></div></div>'; }).join('') +
    '<div class="u-row"><button type="button" id="u-all" class="gold">\u2756 ALL THAT WE CAN DO!</button><button type="button" id="u-beauty">\uD83C\uDF39 Beauty Log</button></div>' +
    '<div class="u-row"><button type="button" id="u-book" class="gold">\uD83D\uDCD6 The King\u2019s Book of Law</button></div>' +
    '<div class="u-row"><button type="button" id="u-tour">\uD83C\uDFAC Campus Tour (Watch)</button><button type="button" id="u-mine">\uD83D\uDCD3 My library</button><a class="u-btn" href="/learn" target="_blank" rel="noopener">/learn</a></div>';
  show('Solid City University', h);
  bind('[data-go]', function (b) { goCampus(b.getAttribute('data-go')); });
  bind('[data-cat]', function (b) { openCampus(b.getAttribute('data-cat')); });
  bind('#u-book', function () { close(); if (window.CityBook) CityBook.open(0); else location.href = '/book-of-law'; });
  bind('#u-all', function () { close(); if (window.CityPodium) CityPodium.open('features'); });
  bind('#u-beauty', function () { close(); if (window.CityPodium) CityPodium.open('beauty'); else window.open('/beauty', '_blank'); });
  bind('#u-tour', function () { close(); if (window.CityWatch) CityWatch.start('campus', 'Campus Tour'); });
  bind('#u-mine', function () { openLibrary(null, true); });
})(isBack); }); }
function goCampus(id) {
  var H = window.CityHyper, poi = H && H.pois.filter(function (p) { return p.id === 'campus-' + id; })[0]; if (!poi) return;
  close(); U.said[id] = false; H.driveTo(poi, 'AI DRIVE');
}
function openCampus(id, tab) { need(function () { nav(function () {
 