<!-- SOLID CITY · part 2151 -->
++) if (POIS[i].id === id) return POIS[i]; }
var ROMAN = ['II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X'];
function bearing(x, z) { var a = Math.atan2(x - 8600, -z), d = ['N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW']; return d[(Math.round(a / (Math.PI / 4)) + 8) % 8]; }
var FLY = [
  { id: 'home', name: 'Home: land at the Orbital Spaceport', short: 'HOME', x: PT.x, z: PT.z, home: true, alias: 'home spaceport land landing base port', text: 'Autopilot lands you on the spaceport pad.' },
  { id: 'city', name: 'Solid City', short: 'SOLID CITY', x: 60, z: -60, alt: Y + 460, alias: 'solid city city capital town', text: 'The King\u2019s capital on the west coast of the main island.' }
];
A.VOLCANOES.forEach(function (v) {
  if (!v.name) return; var nm = v.name.charAt(0) + v.name.slice(1).toLowerCase().replace(/ (\S)/g, function (m, c) { return ' ' + c.toUpperCase(); });
  FLY.push({ id: fold(v.name).replace(/\W+/g, ''), name: nm, short: v.name, x: v.x, z: v.z, alt: Math.max(0, A.heightAt(v.x, v.z)) + 650, volcano: true, alias: fold(v.name) + ' volcano', text: (v.crater ? 'An active crater: watch the lava glow. ' : 'A shield volcano, ') + 'about ' + (Math.round(A.heightAt(v.x, v.z) / 100) / 10).toFixed(1) + ' km high.' });
});
A.ISLANDS.forEach(function (isl, k) {
  if (isl.main) return; var nm = 'Isle ' + (ROMAN[k - 1] || k);
  FLY.push({ id: 'isle' + k, name: nm + ' (' + bearing(isl.x, isl.z) + ')', short: nm.toUpperCase(), x: isl.x, z: isl.z, alt: Math.max(0, A.heightAt(isl.x, isl.z)) + 700, alias: fold(nm) + ' island isle ' + k, text: 'An outer island of the chain, about ' + (isl.r / 1000).toFixed(1) + ' km across.' });
});
var GLOSS = [
  ['Forum Plaza', 'The city centre. SABLE stands here; the Forum gate leads to the real boards.'],
  ['SABLE', 'The AI guide. Talking to her needs an epistles login.'],
  ['Music Studio Tower', 'Home of Studio Radio (the King\u2019s 333 songs). Its gate opens /ss.'],
  ['Radio masts', 'Stand near one and the music gets louder.'],
  ['Orbital Spaceport', 'Board a ship, LAUNCH, fly. RETURN TO CITY brings you home.'],
  ['Warp Speed', 'The arcade run through the spaceport gate.'],
  ['Solidivism', 'Everything visible is solid: you can\u2019t walk or fly through it.'],
  ['AI DRIVE', 'The controller walks or flies you there. Touch the stick to take over.']
];

/* ---------------- state ---------------- */
var H = { mode: 'WALK', focus: null, hist: [], fhist: [], nav: null, tour: null, armed: false, flyDrive: null, scan: null, scanT: 0, lastDrag: 0, beaconT: 0, prevMode: 'WALK', wasFly: false };

/* ---------------- UI (same markup / ids / order as sw-hyper.js) ---------------- */
var root = $('sc'), hud = $('sc-hud');
var hc = document.createElement('div'); hc.id = 'hyper-controller';
function B(id, icon, title, cls, walkOnly, mode) { return '<button type="button" class="' + (mode ? 'hc-mode-btn' : 'hc-btn') + (cls ? ' ' + cls : '') + '"' + (id ? ' id="' + id + '"' : '') + (mode ? ' data-mode="' + mode + '"' : '') + (walkOnly ? ' data-walk' : '') + ' title="' + title + '" aria-label="' + title + '">' + icon + '</button>'; }
hc.innerHTML = '<div id="hc-mode-indicator">WALK</div><div id="hc-buttons">' +
  B('', '🚶', 'Walk (manual)', 'active', true, 'WALK') + B('', '👁️', 'Look around', '', true, 'LOOK') +
  B('hc-aidrive', '🤖', 'AI Drive', 'hc-ai') + B('hc-tour', '🗺️', 'Guided tour', '', true) +
  B('hc-focus', '🎯', 'Focus nearest') + B('hc-scan', '📡', 'Scan area') + B('hc-go', '🧭', 'Navigate to focused') +
  B('hc-return', '↩️', 'Return') + B('hc-stop', '⏹️', 'Stop AI', 'hc-stop') +
  B('hc-guide', '👋', 'Show me Solid City (meet SABLE)', '', true) + B('hc-glossary', '📖', 'Shared language', '', true) + B('hc-watch', '🎬', 'WATCH: cinematic autopilot', 'hc-ai') + B('hc-build', '🔨', 'BUILD: the Forge', 'hc-ai', true) +
  '</div><div id="hc-command"><input type="text" id="hc-input" enterkeyhint="go" autocomplete="off" placeholder="Try: &quot;drive me to studio&quot;"></div>';
hud.appendChild(hc);
/* collapsible column: one gold toggle folds the buttons away (Walk/Look + Stop stay); remembered in localStorage */
(function () {
  var KEY = 'sc-hc-folded', fb = document.createElement('button'), saved = null;
  try { saved = localStorage.getItem(KEY); } catch (e) {}
  fb.type = 'button'; fb.id = 'hc-fold'; hc.appendChild(fb);
  var gone = 0;
  function set(f, save) {
    clearTimeout(gone);
    fb.textContent = f ? '\u276E' : '\u276F'; fb.setAttribute('aria-expanded', String(!f));
    fb.title = fb.ariaLabel = f ? 'Show all controls' : 'Hide controls';
    fb.setAttribute('aria-label', fb.title);
    if (f) { hc.classList.add('hc-folded'); gone = setTimeout(function () { hc.classList.add('hc-gone'); }, 260); }
    else { hc.classList.remove('hc-gone'); void hc.offsetWidth; hc.classList.remove('hc-folded'); }
    if (save) try { localStorage.setItem(KEY, f ? '1' : '0'); } catch (e) {}
  }
  set(saved === null ? matchMedia('(max-width:430px)').m