  /* ---- the phone held upright: a tighter, calmer HUD (sizes come down a step, nothing sits on top of an open panel) */
  /* the talk box: readable, not shouting; the portrait a little smaller; buttons wrap rather than run off */
  body.is-narrow #talk { padding: var(--pad-panel); gap: var(--gap-row); }
  body.is-narrow #talk .tt { font-size: var(--fs-control); line-height: var(--lh-loose); }
  body.is-narrow #talk .tn { font-size: var(--fs-control); }
  body.is-narrow #talk.big { min-height: 0; }
  body.is-narrow #talk.big .tn { font-size: var(--fs-label); }
  body.is-narrow #talk.big .tt { font-size: var(--fs-heading); line-height: var(--lh-loose); }
  body.is-narrow #talk button, body.is-narrow #talk.big button { font-size: var(--fs-control); padding: var(--space-8) var(--space-16); }
  body.is-narrow #talk .ta { flex-wrap: wrap; gap: var(--space-8); }
  body.is-narrow #talk .tp { width: 68px !important; height: 68px !important; border-radius: var(--radius-14); }
  /* Jump and Use step aside while a panel or a conversation is up (they sat on its buttons) */
  body.is-coarse.is-narrow:not(.hudxb):is(:has(#talk:not([hidden])), :has(#term:not([hidden])), :has(#panel:not([hidden])), :has(#build:not([hidden])), :has(#wardrobe:not([hidden])), :has(#designer:not([hidden]))) :is(#jumpbtn, #actionbtn) { display: none !important; }
  /* a toast that pops up mid-screen waits till the panel's closed */
  body.is-narrow:is(:has(#term:not([hidden])), :has(#panel:not([hidden])), :has(#wardrobe:not([hidden])), :has(#talk:not([hidden])), :has(#build:not([hidden])), :has(#drawer:not([hidden]))) #daily-toast { visibility: hidden; }
  /* a conversation over an open drawer: the drawer closes its eyes (they'd sit in a muddle, one on the other) */
  body.is-narrow:has(#talk:not([hidden])) #drawer { visibility: hidden; }

  /* ---- phone, pass two: everything a size down, the build panel a strip, the ring buttons a row by your thumb */
  /* the dock: a slimmer row */
  body.is-narrow #tabbar { min-height: 54px; padding: var(--space-4); gap: var(--space-4); border-radius: 18px; }
  body.is-narrow #tabbar .tab { min-height: 42px; grid-template-rows: 20px auto; padding: var(--space-4) var(--space-2) var(--space-4); font-size: 11.5px; border-width: 2.5px; border-radius: 12px; }
  body.is-narrow #tabbar .tab svg { width: 20px; height: 20px; }
  /* Jump: a big round button where the right thumb rests, just above the dock; Use up and to its left */
  body.is-coarse.is-narrow #jumpbtn { width: var(--ctl-thumb); height: var(--ctl-thumb); right: calc(var(--hud-inline) + 4px); bottom: calc(var(--hud-bottom) + 72px); font: var(--t-control); line-height: var(--lh-solid); display: grid; place-items: center; align-content: center; gap: var(--space-2); }
  body.is-coarse.is-narrow #jumpbtn::before { content: '⬆'; font-size: var(--fs-title); line-height: var(--lh-solid); }
  body.is-coarse.is-narrow #actionbtn { width: 58px; height: 58px; min-width: 58px; right: calc(var(--hud-inline) + 84px); bottom: calc(var(--hud-bottom) + 104px); }
  /* no mouse hints on a phone ("Left click Select · Right click Sit"): a tap does it */
  body.is-coarse #hover { display: none !important; }
  /* the build panel: one scrolling row of kinds, one of tools, one of sizes (about a quarter of the screen, not half) */
  body.is-narrow #build { padding: var(--space-8) var(--space-8) var(--space-8); }
  body.is-narrow #build .bb-top { gap: var(--space-8); }
  body.is-narrow #cat-tabs { flex-wrap: nowrap !important; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding: var(--space-2) var(--space-32) var(--space-4) 0; gap: var(--space-4); }
  body.is-narrow #cat-tabs::-webkit-scrollbar { display: none; }
  body.is-narrow #cat-tabs .cat { flex: none; }
  body.is-narrow #cat-info { display: none; }
  body.is-narrow #build .bb-sub { margin-top: var(--space-4); }
  body.is-narrow #build .bb-tools { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: var(--space-4); }
  body.is-narrow #build .bb-tools .btn.small { flex: none; }
  body.is-narrow #build .cardwrap { margin-top: var(--space-4); }
  body.is-narrow #build .cpg, #build .cpg { display: none !important; }   /* (the rail scrolls the shelf: no ◀ ▶ over its last picture: Tom) */
  body.is-narrow .szcard { width: 72px; height: 60px; gap: var(--space-2); border-width: 2.5px; border-radius: var(--radius-14); font-size: var(--fs-caption); }
  body.is-narrow #build .cardwrap, body.is-narrow #build .cardcol { height: auto !important; min-height: 0 !important; gap: 0; }
  body.is-narrow #build #cards { padding: var(--space-8) var(--space-4) var(--space-8); margin-top: 0; gap: var(--space-8); }
  body.is-narrow #build .kcard { width: 76px !important; padding: var(--space-4) var(--space-2) var(--space-4); font-size: var(--fs-caption); }
  body.is-narrow #build .kcard .ki { width: 46px; height: 46px; }
  body.is-narrow #elshelves { gap: var(--space-4); }
  body.is-narrow #elshelves button { font-size: var(--fs-label); padding: 0 var(--space-8); min-height: var(--ctl-s); }
  /* Undo and Redo: small, under the settings button (they sat on the stars) */
  /* Undo and Redo: two small round buttons at the bottom left, just above the dock (above the build strip while it's open) */
  body.is-narrow .undobtn { position: fixed; top: auto !important; right: auto !important; left: var(--hud-inline); bottom: calc(var(--hud-bottom) + 66px); z-index: 7; width: var(--ctl-m); height: var(--ctl-m); padding: 0; display: grid; place-items: center; overflow: hidden; font-size: 0; border-width: 2.5px; border-radius: 50%; box-shadow: 0 3px 0 rgba(19,28,92,.45); }
  body.is-narrow .undobtn::before { content: '↩'; font: var(--t-title); line-height: var(--lh-solid); }
  body.is-narrow #redobtn { left: calc(var(--hud-inline) + 48px); }
  body.is-narrow #redobtn::before { content: '↪'; }
  body.is-narrow:has(#build:not([hidden])) .undobtn { bottom: calc(var(--hud-bottom) + 214px); }

  /* ---- phone, pass three: the build strip holds its width (its rows scroll inside it), the designer is a sheet along the bottom */
  body.is-narrow #build { grid-template-columns: minmax(0, 1fr); overflow: hidden; }
  body.is-narrow #build > * { min-width: 0; max-width: 100%; }
  body.is-narrow #build .bb-top { min-width: 0; overflow: hidden; }
  body.is-narrow #cat-tabs { flex: 1 1 auto; min-width: 0; touch-action: pan-x; -webkit-overflow-scrolling: touch; }
  body.is-narrow #build .bb-sub, body.is-narrow #build .cardwrap, body.is-narrow #build .cardcol { min-width: 0; overflow: hidden; }
  body.is-narrow #build #cards { touch-action: pan-x; overflow-x: auto; }
  body.is-narrow #build #cards .kcard[data-kit] { touch-action: pan-x; }   /* (a swipe that starts on a card scrolls the shelf, not only one in a gap: cardSwipeUndo puts back what it picked up. Tom: "scrolling the voxel menu was hard") */
  body.is-narrow #build .bb-tools { min-width: 0; touch-action: pan-x; }
  body.is-narrow .szcard .fp2 { zoom: .62; }
  body.is-narrow .szcard .szn { font-size: var(--fs-caption); white-space: nowrap; }
  body.is-narrow #designer { top: auto !important; bottom: var(--hud-bottom) !important; left: var(--panel-inset) !important; right: var(--panel-inset) !important; width: auto !important; max-width: none !important; max-height: min(48vh, 420px) !important; transform: none !important; overflow-y: auto; border-radius: var(--radius-14); }

  /* ---- a game on a phone: the screen is the game. No dock, just the Ring button (bottom left), Jump and your power side by
     side at bottom right, nothing up top but the round's own chip; the power steps aside while a panel is open */
  body.is-narrow.ingame #tabbar { display: none !important; }

  /* the next-step pill: slimmer, and only as wide as its words */
  body.is-narrow #objchip:not([hidden]) { width: auto !important; max-width: 100%; align-self: flex-start; height: 34px !important; min-height: 34px !important; border-width: 2.5px; border-radius: var(--radius-14); box-shadow: 0 3px 0 rgba(19,28,92,.4); }
  body.is-narrow #objchip .oc-main { grid-template-columns: 22px minmax(0, auto) auto !important; gap: var(--space-8) !important; font-size: var(--fs-label) !important; padding: 0 var(--space-4) 0 var(--space-8) !important; }
  body.is-narrow #objchip .oc-arrow, body.is-narrow #objchip .oc-arrow i { width: 22px !important; height: 22px !important; }
  body.is-narrow #objchip .oc-arrow svg { width: 21px !important; height: 21px !important; }
  body.is-narrow #objchip button:not(.oc-main) { width: 30px !important; min-width: 30px !important; }
  /* name tags in a game: smaller, so you can see the game (yours stays gold, a touch bigger) */
  body.is-narrow .ellbl { padding: var(--space-2) var(--space-8); font-size: var(--fs-caption); border-width: 1.5px; }
  body.is-narrow .ellbl.gnome-label { font-size: 9px; /* off-scale: a tiny label inside a fixed-size badge */ }
  body.is-narrow .ellbl.me { font-size: var(--fs-caption); padding: var(--space-2) var(--space-8); border-width: 2px; box-shadow: 0 2px 0 #131c5c; }

  /* a game's top bar on a phone: one slim row from the left, clear of the settings button; your stars wait till the game's over */
  body.is-narrow #cghud { left: var(--hud-inline) !important; right: auto !important; margin: 0 !important; top: var(--hud-top) !important; max-width: calc(100vw - 2 * var(--hud-inline) - 52px); gap: var(--space-4); }
  body.is-narrow #eljoin { left: var(--hud-inline); right: auto; margin: 0; top: var(--hud-top); height: 36px; padding: 0 var(--space-8); border-width: 2.5px; border-radius: var(--radius-10); }
  body.is-narrow #cghud .cg-main { gap: var(--space-4); min-width: 0; }
  body.is-narrow #cghud :is(.cg-chip, .cg-clock) { height: 36px; border-width: 2.5px; border-radius: var(--radius-10); }
  body.is-narrow #cghud .cg-chip { padding: 0 var(--space-8) 0 var(--space-8); font-size: var(--fs-label); }
  body.is-narrow #cghud .cg-chip i { font-size: var(--fs-heading); }
  body.is-narrow #cghud .cg-clock { padding: 0 var(--space-8) 0 var(--space-8); font-size: var(--fs-heading); }
  body.is-narrow #cghud .cg-clock i { font-size: var(--fs-label); }
  body.is-narrow #cghud .cg-stat { min-height: 36px; padding: var(--space-2) var(--space-8) var(--space-2) var(--space-4); gap: var(--space-4); border-width: 2.5px; border-radius: var(--radius-14); }
  body.is-narrow #cghud .cg-stat > i { width: 24px; height: 24px; font-size: var(--fs-control); }
  body.is-narrow #cghud .cg-sv b { font-size: var(--fs-control); }
  body.is-narrow #cghud .cg-sv small { font-size: var(--fs-caption); max-width: 110px; }
  body.is-narrow #cghud > button { width: var(--ctl-s); height: var(--ctl-s); min-width: var(--ctl-s); border-width: 2.5px; border-radius: var(--radius-10); }
  body.is-narrow.ingame #gold { display: none !important; }
  body.is-narrow.ingame #sysbtn { top: var(--hud-top) !important; }
  /* the announcer: a slim strip under the top bar, not a banner across the middle */
  body.is-narrow #elann { top: calc(var(--hud-top) + 46px); gap: var(--space-8); padding: var(--space-4) var(--space-12) var(--space-8) var(--space-8); max-width: calc(100vw - 2 * var(--hud-inline)); border-width: 2.5px; border-radius: var(--radius-14); }
  body.is-narrow #elann i { font-size: var(--fs-title); }
  body.is-narrow #elann small { font-size: 9px; /* off-scale: a tiny label inside a fixed-size badge */ }
  body.is-narrow #elann b { font-size: var(--fs-label); line-height: var(--lh-tight); }
  /* Undo and Redo hide under any open sheet */
  body.is-narrow:is(:has(#term:not([hidden])), :has(#panel:not([hidden])), :has(#drawer:not([hidden])), :has(#talk:not([hidden])), :has(#wardrobe:not([hidden])), :has(#designer:not([hidden]))) :is(#undobtn, #redobtn) { display: none !important; }
  body.is-narrow #term .tb { grid-template-columns: minmax(0, 1fr); }   /* (a sheet's body is one column the sheet's width: wide rows scroll or wrap inside it) */
  body.is-narrow #term .tb > * { min-width: 0; }
  body.is-narrow.ingame #ringbar > :not(#ringbtn) { display: none !important; }
  body.is-narrow.ingame #objchip, body.is-narrow.ingame #undobtn, body.is-narrow.ingame #redobtn { display: none !important; }
  body.is-coarse.is-narrow.ingame #jumpbtn { width: 84px; height: 84px; bottom: calc(var(--hud-bottom) + 18px) !important; }
  body.is-coarse.is-narrow.ingame #actionbtn { bottom: calc(var(--hud-bottom) + 112px) !important; right: calc(var(--hud-inline) + 14px); }
  /* 🕹️ islands HUD: Main (Jump) keeps the corner; --arc-r/--arc-b are its middle. Use is the arc's spot 1,
     90px to its left; the stick is a fixed disc bottom left at the same height, drawn whenever it can be used */
  /* The HUD row (docs/style #spacing): its top steps down at sea, where the compass has the top; what sits under it starts 16 below. */
  body.hudx { --hud-row-t: var(--hud-top); --hud-below: calc(var(--hud-row-t) + var(--ctl-l) + var(--space-16)); }
  body.hudx.isl-compass:not(.hxcprow) { --hud-row-t: calc(var(--hud-top) + 76px); }   /* (the compass band: the strip, its label and a gap) */
  body.is-narrow { --panel-inset: max(var(--space-8), env(safe-area-inset-left), env(safe-area-inset-right)); --panel-max-width: calc(100vw - 2 * var(--panel-inset)); }   /* (the one phone exception: panels 8 from the edge) */
  body.hudx.is-coarse { --arc-b: calc(var(--hud-bottom) + 106px); }
  body.hudx.is-coarse.hxlay { --arc-r: calc(var(--hud-inline) + 42px); --arc-b: calc(var(--hud-bottom) + 110px); }
  body.hudx.is-coarse.hxlay.ingame { --arc-r: calc(var(--hud-inline) + 46px); --arc-b: calc(var(--hud-bottom) + 60px); }
  body.hudx.is-coarse.hxlay { --arc-r: calc(var(--hud-inline) + 46px); --arc-b: calc(var(--hud-bottom) + 60px); }   /* (no tab bar: Main and the stick sit down in the corners, as in a game) */
  body.hudx.is-coarse.hxlay #jumpbtn { width: var(--ctl-thumb); height: var(--ctl-thumb); right: calc(var(--arc-r) - var(--ctl-thumb) / 2); bottom: calc(var(--arc-b) - var(--ctl-thumb) / 2) !important; }
  body.hudx.is-coarse.hxlay #actionbtn { right: calc(var(--arc-r) + 61px) !important; bottom: calc(var(--arc-b) - 29px) !important; }
  body.hudx.is-coarse #stickctl { left: calc(var(--hud-inline) + 12px) !important; top: auto !important; bottom: calc(var(--arc-b) - 48px); }
  body.hudx.is-coarse #stickctl:not(.held) { opacity: .72; }
  /* 🕹️ the arc: every mode's buttons land on Main (Jump's middle, --arc-r/--arc-b) or a spot round it, the same
     places in every mode. 1 is 90px left (Use), 2 is 90px up, 3 the diagonal between them, filled last. Powers (#elpow sits on
     Jump's middle): the first takes 2, the second 3, and a third borrows 1 while Use folds away for the round */
  body.hudx.is-coarse.hxlay #elpow > button:nth-child(1) { right: 0; bottom: 90px; }
  body.hudx.is-coarse.hxlay #elpow > button:nth-child(2) { right: 64px; bottom: 64px; }
  body.hudx.is-coarse.hxlay #elpow > button:nth-child(3) { right: 90px; bottom: 0; }
  body.hudx.is-coarse.hxlay:not(.hudxnojump):has(#elpow:not([hidden]) > button:nth-child(3)) #actionbtn { display: none !important; }
  /* Main is Jump unless you can't jump here (.hudxnojump, hudxSync: a 🚫 no-jump game, riding). Then the first power takes Main
     and the rest move up one, so Use keeps 1; a wand's Fire takes Main too */
  body.hudxnojump.is-coarse.hxlay #elpow { right: var(--arc-r) !important; bottom: var(--arc-b) !important; }
  body.hudxnojump.is-coarse.hxlay #elpow > button:nth-child(1) { right: 0; bottom: 0; }
  body.hudxnojump.is-coarse.hxlay #elpow > button:nth-child(2) { right: 0; bottom: 90px; }
  body.hudxnojump.is-coarse.hxlay #elpow > button:nth-child(3) { right: 64px; bottom: 64px; }
  body.hudx.hudxnojump.is-coarse.hxlay #firebtn { width: var(--ctl-thumb); height: var(--ctl-thumb); right: calc(var(--arc-r) - var(--ctl-thumb) / 2); bottom: calc(var(--arc-b) - var(--ctl-thumb) / 2); }
  /* carrying a wand: 🎯 Fire (#firebtn, F) on 2, so you can still jump. In a vehicle (🚪 Get out shown): no jumping, so Fire takes
     Main and Get out (#exitbtn, E) is Use, on 1 */
  body.hudx.is-coarse.hxlay #firebtn { position: fixed; width: var(--ctl-thumb); height: var(--ctl-thumb); right: calc(var(--arc-r) - var(--ctl-thumb) / 2); bottom: calc(var(--arc-b) + var(--ctl-thumb) / 2 + var(--space-12)); z-index: 7; }
  body.hudx.is-coarse.hxlay #firebtn .fe { font-size: var(--fs-hero); } body.hudx.is-coarse.hxlay #firebtn .fl { font-size: var(--fs-caption); }
  body.hudx.is-coarse.hxlay :is(#firebtn, #exitbtn) kbd { display: none; }
  body.hudx.is-coarse.hxlay:has(#exitbtn:not([hidden])) #firebtn { width: var(--ctl-thumb); height: var(--ctl-thumb); right: calc(var(--arc-r) - var(--ctl-thumb) / 2); bottom: calc(var(--arc-b) - var(--ctl-thumb) / 2); }
  body.hudx.is-coarse.hxlay #exitbtn { position: fixed; width: 58px; height: 58px; right: calc(var(--arc-r) + 61px); bottom: calc(var(--arc-b) - 29px); z-index: 7; }
  body.hudx.is-coarse.hxlay #exitbtn .fe { font-size: var(--fs-title); } body.hudx.is-coarse.hxlay #exitbtn .fl { font-size: var(--fs-caption); }
  /* at the wheel: ⚡ Boost (#islboost) takes Main; 🚶 Leave (#islstop) steps up to 2, or is Use on 1 with nothing in reach (Play
     near an island is Use). Docked, Boost goes and Jump (which leaves the wheel) keeps Main */
  body.hudx.is-coarse.hxlay:has(#islboost:not([hidden])) #jumpbtn { display: none !important; }
  body.hudx.is-coarse.hxlay #islboost { width: var(--ctl-thumb); height: var(--ctl-thumb); font-size: var(--fs-hero); right: calc(var(--arc-r) - var(--ctl-thumb) / 2); bottom: calc(var(--arc-b) - var(--ctl-thumb) / 2); }
  body.hudx.is-coarse.hxlay #islstop { right: calc(var(--arc-r) - 29px); bottom: calc(var(--arc-b) + 61px); }
  body.hudx.is-coarse.hxlay:not(:has(#actionbtn:not([hidden]))) #islstop { right: calc(var(--arc-r) + 61px); bottom: calc(var(--arc-b) - 29px); }
  /* fishing: 🎣 Cast (#frcast) is Use, on 1; held, its reel fills above it */
  body.hudx.is-coarse.hxlay #frcast { left: auto; right: calc(var(--arc-r) + 90px - 36px); bottom: calc(var(--arc-b) - 36px); transform: none; }
  body.hudx.is-coarse.hxlay #frcast .fc-b { width: 72px; height: 72px; } body.hudx.is-coarse.hxlay #frcast .fc-b i { font-size: var(--fs-hero); }
  body.hudx.is-coarse.hxlay:has(#frcast:not([hidden])) #actionbtn { display: none !important; }
  /* a code world: its ✋ Use (#ccuse) is Use, on 1; the hotbar (#cchot) stays in the middle, over the arc's top */
  body.hudx.is-coarse.hxlay #ccuse { left: auto; right: calc(var(--arc-r) + 90px); bottom: calc(var(--arc-b) - 27px); transform: translateX(50%); }
  body.hudx.is-coarse.hxlay #ccuse:active { transform: translateX(50%) translateY(2px); }
  body.hudx.is-coarse.hxlay:has(#ccuse:not([hidden])) #actionbtn { display: none !important; }
  body.hudx.is-coarse.hxlay #cchot { bottom: calc(var(--arc-b) + 128px); }
  /* driving (#padctl): Steer takes the stick's corner; Gas takes Main, Brake 1, a race's Boost 2. Flying (never with Boost)
     puts ↑ on 2 and ↓ on 3. The pad's groups step aside so each button sits on its own spot */
  body.hudx.is-coarse.hxlay #padctl .pad-steer { left: calc(var(--hud-inline) + 12px); bottom: calc(var(--arc-b) - 28px); }
  body.hudx.is-coarse.hxlay #padctl :is(.pad-drive, .pad-main, .pad-fly) { display: contents; }
  body.hudx.is-coarse.hxlay #padctl .pad-drive .padbtn { position: absolute; }
  body.hudx.is-coarse.hxlay #padctl .pad-gas { right: calc(var(--arc-r) - 36px); bottom: calc(var(--arc-b) - 36px); }
  body.hudx.is-coarse.hxlay #padctl .padbtn[data-pad-key="s"] { right: calc(var(--arc-r) + 62px); bottom: calc(var(--arc-b) - 28px); }
  body.hudx.is-coarse.hxlay #padctl .padbtn[data-pad-race] { right: calc(var(--arc-r) - 28px); bottom: calc(var(--arc-b) + 62px); }
  body.hudx.is-coarse.hxlay #padctl .padbtn[data-pad-fly][data-pad-key=" "] { right: calc(var(--arc-r) - 28px); bottom: calc(var(--arc-b) + 62px); }
  body.hudx.is-coarse.hxlay #padctl .padbtn[data-pad-fly][data-pad-key="shift"] { right: calc(var(--arc-r) + 36px); bottom: calc(var(--arc-b) + 36px); }
  body.hudx.is-coarse.hxlay #padctl .padbtn[hidden] { display: none; }
  /* core games: the core's Jump and Use are Main and 1 already, and a vehicle's 🚪 Get out is Use. Out of #sshud's right-edge
     column, bare-handed Attack (yours, it lasts the round) takes 2 and a held weapon's Attack (in hand, it comes and goes) takes
     3; what's left of the column (a named use, Restart) stands over the arc's top, and Forge's hotbar (#fcphot) over the arc */
  body.hudx.is-coarse.hxlay #sshud .ssh-actions-at { top: auto; bottom: calc(var(--arc-b) + 190px); transform: none; }
  body.hudx.is-coarse.hxlay #sshud .ssh-actions-at > :is([data-control="attack"], [data-control="getOut"]) { position: fixed; z-index: 7; display: grid; place-items: center; width: 58px; height: 58px; min-height: 0; padding: 0 var(--space-4); border-radius: 50%; font: var(--t-caption); white-space: normal; text-align: center; }
  body.hudx.is-coarse.hxlay #sshud .ssh-actions-at > :is([data-control="attack"], [data-control="getOut"]) kbd { display: none; }
  body.hudx.is-coarse.hxlay #sshud .ssh-actions-at > [data-control="attack"]:not([data-target]) { right: calc(var(--arc-r) - 29px); bottom: calc(var(--arc-b) + 61px); }
  body.hudx.is-coarse.hxlay #sshud .ssh-actions-at > [data-control="attack"][data-target] { right: calc(var(--arc-r) + 35px); bottom: calc(var(--arc-b) + 35px); }
  body.hudx.is-coarse.hxlay #sshud .ssh-actions-at > [data-control="getOut"] { right: calc(var(--arc-r) + 61px); bottom: calc(var(--arc-b) - 29px); }
  /* D-core 4: the hotbar and the 🎒 centred just over the arc's top (186 px up), never on it */
  body.hudx.is-coarse.hxlay #fcphot { bottom: calc(var(--hud-bottom) + 186px); }
  body.hudx.is-coarse.hxlay #sshud .ssh-bag { top: auto; left: 50%; bottom: calc(var(--hud-bottom) + 186px); transform: translateX(-50%); width: max-content; }
  body.hudx.is-coarse.hxlay:not(:has(#build:not([hidden]))) .undobtn { bottom: calc(var(--arc-b) + 56px); }   /* (Undo while you walk on your Forge island: over the stick, not on it) */
  /* 🕹️ islands HUD Build (Forge and Core islands, phones): 🔨 Build top right turns into ✓ Done; the tray hangs from the top
     under it and ▶ takes the top left; Undo, then the strip's settings (🧊 🎥 〰️ 👁), hang under the tray's left edge.
     ✋ 🔄 📏 wait for a picked thing. (hudxSync sets .hudxb and --hudx-tray-b) */
  #hudbuild[hidden] { display: none !important; }
  body.hudx.hxlay #hudbuild { position: fixed; z-index: 9; top: var(--hud-top); display: grid; place-items: center; height: 44px; min-height: 44px; padding: 0 var(--space-16); border-radius: var(--radius-pill); font: var(--t-control); white-space: nowrap; }
  body.hudx.hxlay:not(.hudxb) #hudbuild { right: var(--hud-inline); width: var(--ctl-l); height: var(--ctl-l); min-width: 0; padding: 0; border-radius: 50%; font-size: var(--fs-hero); }   /* (L, the right corner's anchor) */
  body.hudx.hxlay #hudbuild i { font-style: normal; }
  body.hudx.hxlay #hudbuild.off { background: #e4e6f0; color: #8a90ad; border-color: #8a90ad; box-shadow: none; }   /* (can't build here: greyed, a tap says why) */
  body.hudx.hxlay #hudbuild.off i { filter: grayscale(1); opacity: .55; }
  body.hudx.hxlay.hudxring #hudbuild.off { display: none !important; }
  #hudxwhy { position: fixed; right: var(--hud-inline); z-index: 12; max-width: calc(100vw - 2 * var(--hud-inline)); padding: var(--space-8) var(--space-12); border-radius: var(--radius-14); background: var(--ink); color: #fff; font: var(--t-label); opacity: 0; transform: translateY(-4px); transition: opacity .2s, transform .2s; pointer-events: none; }
  #hudxwhy.on { opacity: 1; transform: none; }   /* (🔨 greyed, tapped: why, for a moment) */   /* (⭕ Ring's corner: Ring is how you make things there) */
  body.hudx.hxlay.isl-compass #hudbuild { top: var(--hud-row-t); }   /* (at sea the compass has the top: level with the place chip) */
  body.hudx.hxlay #hudbuild .rl, #hudxplace .rl { position: absolute; top: calc(100% - var(--ctl-hint) / 2); left: 50%; transform: translateX(-50%); display: grid; place-items: center; box-sizing: border-box; height: var(--ctl-hint); padding: 0 var(--space-8); border-radius: var(--radius-pill); background: var(--ink); color: #fff; font: var(--t-caption); white-space: nowrap; pointer-events: none; }
  /* 🕹️ the top row: the place chip (L) · ★ · 📜 · Me (M) · 🔨 Build (L); ⚙ under Build until Me › Settings */
  #hudxplace, #hudxtop { display: none; }
  body.hudx.hxlay #hudxplace { position: fixed; left: var(--hud-inline); top: var(--hud-top); display: grid; place-items: center; width: var(--ctl-l); height: var(--ctl-l); padding: 0; box-sizing: border-box; border: 3px solid var(--edge); border-radius: 50%; background: var(--parch); box-shadow: 0 3px 0 var(--edge); font-size: var(--fs-hero); line-height: var(--lh-solid); cursor: pointer; }
  body.hudx.hxlay #hudxtop { position: fixed; right: calc(var(--hud-inline) + var(--ctl-l) + var(--ctl-gap)); top: calc(var(--hud-row-t) + (var(--ctl-l) - var(--ctl-m)) / 2); display: flex; align-items: flex-start; gap: var(--space-8); }
  #hudxtop > * { position: relative; display: grid; place-items: center; height: var(--ctl-m); min-width: var(--ctl-m); box-sizing: border-box; padding: 0; border: var(--border-3) solid var(--edge); border-radius: var(--ctl-m-radius); background: var(--parch); box-shadow: 0 3px 0 var(--edge); color: var(--ink); font: var(--t-control); }
  /* ★ Quests (D5): your stars on its face, today's dailies as dots on its pill; gold once all three are done */
  #hudxtop .hx-q { padding: var(--space-4); background: var(--parch-lo); font-variant-numeric: tabular-nums; white-space: nowrap; }   /* (the same make as Me: a navy rim, a 4px band inside it, a white face) */
  #hudxtop .hx-q .qn { display: grid; place-items: center; height: 100%; box-sizing: border-box; padding: 0 var(--space-8); border-radius: var(--radius-10); background: var(--parch); box-shadow: 0 0 0 1.5px var(--edge); }
  #hudxtop .hx-q .dots { position: absolute; left: 50%; top: calc(100% - 9px); transform: translateX(-50%); display: flex; align-items: center; gap: var(--space-4); height: var(--ctl-hint); box-sizing: border-box; padding: 0 var(--space-8); border-radius: var(--radius-pill); background: var(--ink); }   /* (hangs on the same line as Me's Lv) */
  #hudxtop .hx-q .dots:empty { display: none; }
  #hudxtop .hx-q .dots i { width: 6px; height: 6px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px #fff; }
  #hudxtop .hx-q .dots i.on { background: var(--gold, #e0a526); box-shadow: inset 0 0 0 1.5px #fff; }
  /* What next? (D5): the button glows and its line hangs under it a while */
  #hudxtop .hx-q.hxnext { background: var(--gold); }   /* (What next?: its band turns gold, inside the rim as Me's ring is) */
  #hudxtop .hx-q .hang { position: absolute; left: 50%; top: calc(100% + 14px); transform: translateX(-50%); padding: var(--space-4) var(--space-12); border: 2.5px solid var(--edge); border-radius: var(--radius-pill); background: #fff; color: var(--ink); font: var(--t-label); white-space: nowrap; pointer-events: none; }
  #hudxtop .hx-q .hang[hidden] { display: none; }
  /* Me's XP ring (D5): gold from 12 o'clock for what you've earned, the stretch just earned white till it turns, a pale track */
  #hudxtop .hx-me { width: var(--ctl-m); padding: var(--space-4); border-radius: var(--radius-round); border-width: var(--border-3); font-size: var(--fs-title); background: conic-gradient(var(--gold) 0 var(--mxp0), #fff var(--mxp0) var(--mxp), var(--parch-lo) var(--mxp) 100%); transition: --mxp .5s ease-out, --mxp0 .6s ease-in-out; }
  #hudxtop .hx-me .face { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: var(--parch); box-shadow: 0 0 0 1.5px var(--edge); }
  #hudxtop .hx-me.near .lv { box-shadow: 0 0 0 2px var(--gold); }   /* (nearly a level: the Lv chip is rimmed gold; no glow outside the button) */
  #hudxtop .hx-me.lvup .lv { background: var(--gold); color: var(--ink); }
  #hudxtop .hx-me .lv { position: absolute; left: 50%; top: calc(100% - 9px); transform: translateX(-50%); height: var(--ctl-hint); box-sizing: border-box; padding: 0 var(--space-8); border-radius: var(--radius-pill); background: var(--ink); color: #fff; font: var(--t-caption); line-height: var(--ctl-hint); white-space: nowrap; }
  #hudxtop .hx-me .bdg { position: absolute; right: -6px; top: -6px; min-width: 20px; padding: 0 var(--space-4); height: 20px; border-radius: var(--radius-pill); background: #ff3b3b; border: 2.5px solid var(--edge); box-sizing: border-box; color: #fff; font: var(--t-caption); line-height: 15px /* off-scale: centres the text in its box */; font-style: normal; text-align: center; }
  #hudxtop .hx-me .bdg[hidden] { display: none; }
  body.hudx.hxlay #topright > :is(#gold, #who, #zone, #compass) { display: none !important; }   /* (★ is on the row, who's here on the place chip) */
  body.hudx.hxlay #topright { top: calc(var(--hud-row-t) + var(--ctl-l) + var(--ctl-gap)) !important; }
  body.hudx.hxlay.hudxring #topright { top: max(calc(var(--hud-row-t) + var(--ctl-l) + var(--ctl-gap)), calc(var(--hudx-ring-b, 0px) + var(--space-8))) !important; }   /* (under Ring and whatever it stacks under itself: 🚪 Leave, the chalk's tools) */
  body.hudx.hxlay.hudxring:not(.hudxb) #lgbpbtn { top: max(132px, calc(var(--hudx-ring-b, 0px) + 60px)) !important; }   /* (then ? , then 📐 Logic and 🎥 Free cam, as far down again: the same places when Ring has nothing under it) */
  body.hudx.hxlay.hudxring:not(.hudxb) #lgcambtn { top: max(200px, calc(var(--hudx-ring-b, 0px) + 128px)) !important; }
  body.hudx.hxlay #sysbtn { display: none !important; }   /* (⚙ is Me › ⚙) */
  /* 🕹️ Me: the dock's panel, hung under the top row and stopping above the thumbs; your card heads it, then the tabs */
  body.hudx.hxlay #panel.me { position: fixed !important; left: var(--panel-inset) !important; right: var(--panel-inset) !important; top: var(--hud-below) !important; bottom: calc(var(--hud-bottom) + 200px) !important; width: auto !important; max-height: none !important; margin: 0 !important; transform: none !important; }
  body.hudx.hxlay.is-narrow #wardrobe { max-height: calc(var(--vvh, 100vh) - var(--hud-below) - var(--space-8)); }   /* (the wardrobe sits on the bottom and stops under the top row too, not over it) */
  body.hudx.hxlay #panel.me > header { position: absolute; right: 10px; top: 10px; z-index: 1; padding: 0; background: none; border: 0; }
  body.hudx.hxlay #panel.me #panel-title { display: none; }
  #mehead { display: flex; flex-direction: column; gap: var(--gap-section); padding: var(--space-12) var(--pad-panel) var(--space-4); }
  #mehead[hidden] { display: none; }
  #mehead .mh { display: flex; align-items: center; gap: var(--space-8); margin: 0; padding: 0 var(--ctl-m) 0 0; border: 0; background: none; color: inherit; text-align: left; font: inherit; cursor: pointer; }
  #mehead .face { width: 52px; height: 52px; flex: none; display: grid; place-items: center; box-sizing: border-box; border-radius: 50%; border: 4px solid var(--edge); border-right-color: var(--gold); border-bottom-color: var(--gold); background: var(--parch-lo); font-size: var(--fs-hero); }
  #mehead .who { flex: 1; min-width: 0; }
  #mehead .who b { display: block; font: var(--t-heading); }
  #mehead .who small { display: block; color: var(--muted); font: var(--t-fine); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #mehead .xp { display: block; height: 8px; margin-top: var(--space-4); overflow: hidden; border: 2px solid var(--edge); border-radius: var(--radius-pill); background: #fff; }
  #mehead .xp i { display: block; height: 100%; background: var(--gold); }
  #mehead .tabs { display: flex; gap: var(--space-8); }
  #mehead .chip { display: flex; align-items: center; gap: var(--space-4); height: var(--ctl-s); padding: 0 var(--ctl-s-pad); border: var(--ctl-s-border) solid var(--edge); border-radius: var(--radius-pill); background: #fff; color: var(--ink); font: var(--t-label); white-space: nowrap; cursor: pointer; }
  #mehead .chip[aria-selected="true"] { background: var(--wood-lo); color: #fff; box-shadow: inset 0 0 0 2px #fff; }   /* (selected: the dock's white inset ring, not gold) */
  #mehead .chip .n { padding: var(--space-2) var(--space-4); border-radius: var(--radius-pill); background: var(--pop); color: #fff; font-size: var(--fs-caption); }
  /* 🕹️ Here and now: the place chip's panel (where Me hangs): name, who's here, the log, the emotes */
  body.hudx.hxlay #panel.me[data-kind="here"] { bottom: auto !important; max-height: calc(var(--vvh, 100vh) - var(--hud-below) - var(--hud-bottom) - 200px) !important; }
  #panel-body .hn { display: flex; flex-direction: column; gap: var(--gap-section); padding: var(--space-12) 0 0; }
  .hn .hnh { display: flex; align-items: flex-start; gap: var(--space-8); padding-right: var(--ctl-m); }
  .hn .who { flex: 1; min-width: 0; }
  .hn .who b { display: block; font: var(--t-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hn .who small { display: block; color: inherit; opacity: .75; font: var(--t-fine); }
  body.hudx.hxlay:has(#panel.me:not([hidden])) #fcgrid { visibility: hidden; }   /* (the Forge strip sits where Me and Here and now hang) */
  .hn button { font: inherit; color: var(--ink); cursor: pointer; }
  .hn .sail { flex: none; height: 34px; padding: 0 var(--space-12); border: 2px solid var(--edge); border-radius: var(--radius-pill); background: #fff; font: var(--t-badge); white-space: nowrap; }
  .hn .faces { align-self: flex-start; display: flex; align-items: center; height: 34px; padding: 0 var(--space-4) 0 var(--space-12); border: 2px solid var(--edge); border-radius: var(--radius-pill); background: #fff; }
  .hn .faces:disabled { cursor: default; }
  .hn .faces.on { background: var(--gold); }
  .hn i { width: 24px; height: 24px; flex: none; display: grid; place-items: center; margin-left: -8px; box-sizing: border-box; border: 2px solid var(--edge); border-radius: 50%; color: #fff; font: var(--t-badge); font-style: normal; }
  .hn i.you { background: var(--parch); font-size: var(--fs-label); }
  .hn i.more { background: #fff; color: var(--ink); font-size: var(--fs-caption); }
  .hn .faces small { margin: 0 var(--space-8); font: var(--t-badge); }
  .hn .ppl { display: flex; flex-direction: column; gap: var(--space-8); }
  .hn .pr { display: flex; align-items: center; gap: var(--space-8); padding-left: var(--space-8); }
  .hn .pr .t { flex: 1; min-width: 0; font: var(--t-label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hn .pr .k { height: var(--ctl-s); padding: 0 var(--space-12); border: var(--ctl-s-border) solid var(--edge); border-radius: var(--ctl-s-radius); background: #fff; }
  .hn .log { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--pad-row); border-radius: var(--radius-14); background: rgba(19, 28, 92, .07); }
  .hn .log p { margin: 0; font: var(--t-note); overflow-wrap: anywhere; }
  .hn .log p.none { color: var(--muted); }
  .hn .emos { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--space-8); }
  .hn .emos button { height: var(--ctl-m); padding: 0; border: 2px solid var(--edge); border-radius: var(--radius-14); background: #fff; font-size: var(--fs-title); line-height: var(--lh-solid); }
  .hn .emos button.on { background: var(--wood-lo); color: #fff; box-shadow: inset 0 0 0 2px #fff; }
  /* 🗺 the chart's tile: a window on the sea under the name, the same size always; 🗺 Chart and 🚪 Leave ride its bottom edge */
  .hn .hnmap { position: relative; flex: none; height: 118px; border: 2px solid var(--edge); border-radius: var(--radius-14); overflow: hidden; background: #0b3a78; box-shadow: 0 3px 0 var(--edge); }
  .hn .hnmap .mapw { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
  .hn .hnmap canvas { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
  .hn .hnmap .mapw:hover canvas { transform: scale(1.04); }
  .hn .hnmap .ml { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; height: 32px; padding: 0 var(--space-12); border: 2px solid var(--edge); border-radius: var(--radius-pill); background: #fff; color: var(--ink); font: var(--t-label); line-height: var(--lh-solid); white-space: nowrap; box-shadow: 0 2px 0 var(--edge); }
  .hn .hnmap .ml kbd { margin-left: var(--space-8); padding: 0 var(--space-4); border: 1.5px solid var(--edge); border-radius: var(--radius-6); font: var(--t-code); }
  /* One card in two: the sea on top (a darker band to the card's edges, the chart's tile in it), here below; 🚪 Leave on the seam */
  .hn.hnsplit, #panel-body .hn.hnsplit, #hxhere .hn.hnsplit { gap: 0; }   /* (the halves meet: 🚪 Leave straddles the seam; #panel-body's and #hxhere's own .hn gap would push it down) */
  .hn .hnsea { display: flex; flex-direction: column; gap: var(--space-8); margin: calc(-1 * var(--pad-panel)) calc(-1 * var(--pad-panel)) 0; padding: var(--pad-panel) var(--pad-panel) var(--space-16); border-radius: var(--hnr, var(--radius-10)) var(--hnr, var(--radius-10)) 0 0; background: rgba(6, 16, 64, .3); border-bottom: 2px solid rgba(6, 16, 64, .45); }
  #panel-body .hn .hnsea { margin: calc(-1 * (var(--space-4) + var(--space-12))) calc(-1 * var(--pad-panel)) 0; --hnr: var(--radius-10); }   /* (phones: #panel-body's own 4px 12px padding too, so the band reaches the card's edges) */
  /* full bleed: the sea fills the top half to the card's edges; its name rides on it, over a little shade, ✕ beside it */
  .hn .hnsea { position: relative; padding: 0; gap: 0; overflow: hidden; }
  .hn .hnsea .hnmap { height: 164px; border: 0; border-radius: 0; box-shadow: none; }
  .hn .hnsea .hnh { position: absolute; z-index: 1; left: 0; right: 0; top: 0; padding: var(--space-12) calc(var(--ctl-m) + var(--space-12)) var(--space-24) var(--pad-panel); background: linear-gradient(rgba(6, 16, 64, .7), rgba(6, 16, 64, 0)); color: #fff; pointer-events: none; text-shadow: 0 1px 2px rgba(0, 0, 0, .45); }
  .hn .hnsea .hnmap .ml { left: 12px; bottom: 12px; }
  .hn .hnhere .hnh { align-items: center; }
  .hn .hnh .lv { flex: none; height: var(--ctl-s); padding: 0 var(--space-16); border: var(--ctl-s-border) solid var(--edge); border-radius: var(--radius-pill); background: #fff; color: var(--ink); font: var(--t-label); line-height: var(--lh-solid); white-space: nowrap; box-shadow: 0 2px 0 var(--edge); }
  .hn .hnhere { display: flex; flex-direction: column; gap: var(--gap-section); }
  .hn.hnsplit .hnhere { padding-top: var(--gap-section); }
  .hn.hnsplit .hnhere .hnh { padding-right: 0; }
  .hn .emos .shop { grid-column: 1 / -1; height: var(--ctl-s); font: var(--t-label); line-height: var(--lh-solid); background: var(--parch-lo); }
  /* the chart (Here and now › 🗺 Chart): the sea, then each way to get somewhere */
  body.hudx.hxlay #panel.me[data-kind="here"]:has(.chartv) { bottom: calc(var(--hud-bottom) + 120px) !important; max-height: none !important; }
  .hn .back { width: var(--ctl-m); height: var(--ctl-m); flex: none; padding: 0; border: var(--ctl-m-border) solid var(--edge); border-radius: var(--radius-round); background: #fff; font: var(--t-heading); line-height: var(--lh-solid); }
  .hn .chart { position: relative; flex: none; overflow: hidden; border: 2px solid var(--edge); border-radius: var(--radius-14); background: #0b3a78; }
  .hn .chart canvas { display: block; width: 100%; height: auto; cursor: crosshair; touch-action: none; }   /* (its own shape: a tap reads where it lands; drag and pinch are the chart's, not the page's) */
  .hn .chart .cl { position: absolute; right: 8px; top: 8px; height: var(--ctl-s); padding: 0 var(--space-12); border: var(--ctl-s-border) solid var(--edge); border-radius: var(--ctl-s-radius); background: #fff; font: var(--t-badge); }
  .hn .chart .crs { position: absolute; left: 8px; top: 8px; padding: var(--space-4) var(--space-12); border-radius: var(--radius-pill); background: rgba(19, 28, 92, .85); color: #fff; font: var(--t-caption); pointer-events: none; }
  .hn .ic { width: 28px; flex: none; text-align: center; font-size: var(--fs-title); line-height: var(--lh-solid); }
  .hn .pr .t small { display: block; opacity: .75; font: var(--t-fine); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hn .pr .k.go { background: var(--gold); }
  .hn.looks { display: flex; flex-direction: column; gap: var(--space-8); }   /* (🕹️ Me › Looks: a row a slot) */
  .hn.looks .k { min-width: 44px; font: var(--t-label); line-height: var(--lh-solid); white-space: nowrap; }
  .hn .sw { display: inline-block; width: 22px; height: 22px; border: 2px solid var(--edge); border-radius: 50%; vertical-align: middle; }
  .hn .hxnone { margin: var(--space-8) var(--space-4); font: var(--t-body); color: inherit; opacity: .85; }
  .hn .pr .k.sent { display: inline-flex; align-items: center; background: var(--parch-lo); font: var(--t-badge); }
  .hn .sail kbd { margin-left: var(--space-8); padding: 0 var(--space-4); border: 1.5px solid var(--edge); border-radius: var(--radius-6); font: var(--t-code); }
  .hn .sh { display: flex; align-items: center; justify-content: space-between; gap: var(--space-8); margin-top: var(--space-4); font: var(--t-label); }
  .hn .sh .k { height: var(--ctl-s); padding: 0 var(--space-12); border: var(--ctl-s-border) solid var(--edge); border-radius: var(--ctl-s-radius); background: #fff; font: var(--t-badge); }
  .hn .lists { display: contents; }
  .hn .ask { display: flex; flex-direction: column; gap: var(--space-8); padding: var(--pad-card); border: 2px solid var(--edge); border-radius: var(--radius-14); background: var(--parch); }   /* (leaving a round asks first) */
  .hn .ask b { font: var(--t-control); } .hn .ask p { margin: 0; font: var(--t-note); }
  .hn .ask .aa { display: flex; gap: var(--space-8); justify-content: flex-end; }
  .hn .ask .k { height: 36px; padding: 0 var(--space-12); border: 2px solid var(--edge); border-radius: var(--radius-10); background: #fff; font: var(--t-label); line-height: var(--lh-solid); }
  .hn .ask .k.go { background: var(--gold); }
  body.hudx.hxroomy #hxhere .chartv > .ask { grid-column: 1 / -1; }
  .hn .loggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--space-8); }
  .hn .loggrid span { display: grid; justify-items: center; gap: var(--space-2); padding: var(--space-4) var(--space-4); background: #fff; border: 2px solid var(--edge); border-radius: var(--radius-14); }
  .hn .loggrid { color: var(--ink); }
  .hn .loggrid i { width: auto; height: auto; margin: 0; border: 0; border-radius: 0; background: none; color: inherit; font: var(--t-title); font-weight: 400 /* off-scale: an emoji glyph, drawn plain */; font-family: sans-serif; } .hn .loggrid b { font: var(--t-heading); } .hn .loggrid small { font: var(--t-caption); text-align: center; opacity: .8; }   /* (not .hn i, the faces' circles) */
  .hn .tnote { margin: 0; font: var(--t-fine); opacity: .8; }
  .hn .lists > p.none, .hn > p.none { margin: 0; opacity: .75; font: var(--t-fine); }
  #panel.me[data-kind="here"] #panel-body:has(.chartv) { overflow-y: auto; }
  .hn .pr.row { width: 100%; margin: 0; padding: var(--space-4) 0 var(--space-4) var(--space-8); border: 0; background: none; color: inherit; text-align: left; }
  .hn .pr.row .k { color: var(--ink); }
  .hn .pr.row .k { display: grid; place-items: center; }
  /* 🕹️ the tab bar goes (each of its buttons lives up top now), and the bar's 🏝️ Island: the chart has your islands */
  body.hudx.hxlay #tabbar, body.hudx.hxlay #ringbar > #islbtn { display: none !important; }
  body.hudx.hxlay #ringbar > #ringbtn { margin-right: 0 !important; }
  body.hudx.hxlay:not(.hudxring) #ringbar { display: none !important; }   /* (⭕ Ring: Stop and Leave are the play chip's, the islands are the chart's; a classic island and a harbour keep it, in 🔨's corner) */
  body.hudx.hxlay #islcompass { pointer-events: auto; cursor: pointer; }   /* (the strip opens the chart) */
  #panel .sysin { display: flex; flex-direction: column; gap: var(--gap-row); }
  #panel .sysin .sys-check { min-height: var(--ctl-m); padding: var(--pad-row); display: flex; align-items: center; gap: var(--space-8); box-sizing: border-box; font: var(--t-control); color: #fff; background: var(--wood-lo); border: var(--ctl-m-border) solid var(--edge); border-radius: var(--ctl-m-radius); box-shadow: inset 0 2px 0 rgba(255,255,255,.3), 0 3px 0 var(--edge); cursor: pointer; }
  #panel .sysin .sys-check input { width: 18px; height: 18px; margin: 0; accent-color: #3d5afe; }
  #panel .sysin button { min-height: var(--ctl-m); padding: var(--pad-row); font: var(--t-control); color: #fff; background: var(--wood-lo); border: var(--ctl-m-border) solid var(--edge); border-radius: var(--ctl-m-radius); box-shadow: inset 0 2px 0 rgba(255,255,255,.3), 0 3px 0 var(--edge); text-align: left; }
  #panel .sysin .tsub { margin-top: var(--space-4); }
  #panel .sysin [hidden] { display: none !important; }
  body.hudxb.hxlay :is(#hudxplace, #hudxtop) { display: none; }   /* (the tray hangs from the top) */
  body.hudx.hxlay.isl-compass #hudxplace { top: var(--hud-row-t); }   /* (at sea the compass has the top) */
  /* 🕹️ now's row, under the place chip: ▶ (the play chip), or the round's clock and score */
  body.intro :is(#hudxplace, #hudxtop, #hudbuild, #hxnear) { visibility: hidden; }   /* (the title card: the top row waits, as #topright does) */
  body.hudx.hxlay:not(.hudxb) #testplay { position: fixed !important; top: var(--hud-below) !important; left: var(--hud-inline) !important; right: auto !important; bottom: auto !important; transform: none !important; margin: 0 !important; height: var(--ctl-m); box-sizing: border-box; border-radius: var(--radius-pill) !important; padding: 0 var(--space-16); font: var(--t-control); white-space: nowrap; }   /* (as a Forge island's ▶: the older kits' ▶ 🏃 Tag kept the 34px of the old top-centre button) */
  body.hudx.hxlay #ringbar > #ringleave { display: none !important; }   /* (🚪 is Here and now's, at the end of the place's name row) */
  body.hudx.hxlay:not(.hudxb) #fcgrid { left: var(--hud-inline) !important; top: var(--hud-below) !important; }   /* (Forge's bar, off the place chip) */
  body.hudx.hxlay:not(.hudxb):has(#testplay:not([hidden])) #fcgrid { top: calc(var(--hud-below) + var(--ctl-m) + var(--ctl-gap)) !important; }   /* (under ▶, which keeps now's row) */
  #hxnear { display: none; }
  body.hudx.hxlay #hxnear:not([hidden]) { position: fixed; left: var(--hud-inline); top: var(--hud-below); z-index: 21; display: flex; align-items: center; gap: var(--space-8); height: 44px; max-width: min(320px, calc(100vw - 2 * var(--hud-inline))); padding: 0 var(--space-16) 0 var(--space-8); box-sizing: border-box; border: 3px solid var(--edge); border-radius: var(--radius-pill); background: #fff; box-shadow: 0 3px 0 var(--edge); color: var(--ink); font: var(--t-control); cursor: pointer; }   /* (D1: ▶ the game island's name, under the place chip) */
  #hxnear .pl { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--gold); border: 2px solid var(--edge); box-sizing: border-box; font: var(--t-label); }
  #hxnear .nm { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  #hxnear.lock .pl { background: var(--parch-lo); }
  #sshud .ssh-now { display: none; }
  body.hudx.hxlay #sshud .ssh-now { position: fixed; left: var(--hud-inline); top: var(--hud-below); z-index: 31; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-8); max-width: calc(100vw - 2 * var(--hud-inline)); }
  body.hudx.hxlay #sshud .ssh-now:empty { display: none; }
  #sshud .ssh-nowrow { display: flex; align-items: center; gap: var(--space-8); }
  #sshud .ssh-chip { height: 44px; min-height: 44px; box-sizing: border-box; padding: 0 var(--space-16); border-radius: var(--radius-pill); font: var(--t-control); white-space: nowrap; }
  #sshud .ssh-chip small { font: var(--t-caption); opacity: .7; }
  #sshud .ssh-chip.sel { box-shadow: inset 0 0 0 3px var(--edge); }
  #sshud .ssh-score { display: flex; align-items: center; gap: var(--space-8); height: 32px; padding: 0 var(--space-12); border-radius: var(--radius-pill); background: #ffffffaa; color: var(--ink); font: var(--t-label); white-space: nowrap; }   /* (a readout: no edge) */
  #sshud .ssh-by { color: var(--ink-soft); font: var(--t-label); }
  #sshud .ssh-score small { margin-right: var(--space-4); color: var(--ink-soft); font-weight: 700; }
  #sshud .ssh-card.ssh-nowcard { justify-items: stretch; text-align: left; width: 290px; max-width: calc(100vw - 2 * var(--hud-inline)); }
  #sshud .ssh-card.ssh-nowcard > .btn { justify-self: stretch; height: var(--ctl-m); padding: 0 var(--space-16); font: var(--t-control); }
  #sshud .ssh-nowkeys { display: flex; flex-wrap: wrap; gap: var(--space-8); margin-top: var(--space-4); }
  #sshud .ssh-nowkeys .btn { flex: 1; margin: 0; white-space: nowrap; }
  body.hudx.hxlay #sshud .ssh-top { top: calc(var(--hud-below) + var(--ctl-m) + var(--ctl-gap)); }   /* (the notices, under now's row) */
  body.hudx.hxroomy #sshud .ssh-top { top: calc(var(--hud-top) + var(--ctl-l)); }   /* (roomy: now's row is one row beside the place chip, so the numbers go just under it) */
  body.hudx.hxlay #sshud:has(.ssh-nowcard) .ssh-top { visibility: hidden; }   /* (the chip's card has the room) */
  body.hudx.hxlay #sshud .ssh-bag { top: calc(var(--hud-below) + var(--ctl-m) + var(--ctl-gap)); }   /* (under now's row, off the place chip) */
  body.hudxb.hxlay #hudbuild { right: var(--hud-inline); background: var(--go); }
  /* 🕹️ D2: the tray's tabs along the top, between ▶ and ✓ Done (both circles, to make room) */
  body.hudxb.hxlay #hudbuild { width: var(--ctl-m); min-width: 0; padding: 0; border-radius: var(--radius-round); font-size: var(--fs-title); }
  body.hudxb.hxlay #testplay:not([hidden]) { width: var(--ctl-m) !important; height: var(--ctl-m) !important; min-width: 0 !important; padding: 0 !important; border-radius: 50% !important; font-size: 0 !important; display: grid !important; place-items: center; }
  body.hudxb.hxlay #testplay::before { content: '▶'; font-size: var(--fs-heading); }
  body.hudxb.hxlay #testplay[hidden] { display: none !important; }   /* (no ▶ where there's no game, as at home) */
  body.hudxb.hxlay #build .bb-sub { flex-wrap: wrap; row-gap: var(--space-8); }   /* (the sizes get their own row, the tools under them) */
  body.hudxb.hxlay #build .bb-sub > #elshelves { flex: 1 1 100%; }
  #hudxtabs { display: none; }
  body.hudxb.hxlay #hudxtabs:not([hidden]) { position: fixed; z-index: 9; top: var(--hud-top); left: calc(var(--hud-inline) + 50px); right: calc(var(--hud-inline) + 50px); height: 44px; display: flex; align-items: center; justify-content: center; gap: var(--space-4); }
  #hudxtabs .t { flex: none; width: var(--ctl-s); height: var(--ctl-s); display: flex; align-items: center; justify-content: center; gap: var(--space-4); padding: 0; box-sizing: border-box; border: var(--ctl-s-border) solid var(--edge); border-radius: var(--radius-pill); background: var(--parch); box-shadow: 0 2px 0 var(--edge); color: var(--ink); font: var(--t-control); cursor: pointer; }
  #hudxtabs .t.on { width: auto; padding: 0 var(--space-12); background: var(--gold); font: var(--t-label); }
  body.hudxb.hxlay.hudxpg #build { display: none !important; }
  body.hudxb.hxlay.hudxpg #term { max-height: calc(var(--vvh, 100vh) * .38) !important; }   /* (Look, Land: short, the world under it) */
  body.hudxb.hxlay.hudxpg.hudxtall #term { max-height: calc(var(--vvh, 100vh) - var(--hud-top) - var(--ctl-m) - var(--ctl-gap) - 200px) !important; }   /* (Game, Island: down to just above the thumbs, which stay) */   /* (a page tab: the island menu's page has the tray's place) */
  body.hudxb.hxlay #term .rtabs { display: none !important; }   /* (its tabs are the tray's) */
  body.hudxb.hxlay.hudxpg #term > .th { display: none !important; }   /* (the tray's tabs and ✓ Done head a tab's page: no second header with the island's name and ×) */
  /* 🕹️ D2: 🎮 Game's sheet, a row a setting, then its pages; 🧩 Logic (the full editor) takes the screen */
  #term .fchxrow { display: flex; align-items: center; gap: var(--space-8); width: 100%; box-sizing: border-box; min-height: 52px; margin: 0 0 var(--space-8); padding: var(--space-8) var(--space-12); border: 2px solid var(--edge); border-radius: var(--radius-14); background: #fff; color: var(--ink); font: var(--t-control); text-align: left; cursor: pointer; }
  #term .fchxrow > i { width: 28px; flex: none; font-style: normal; font-size: var(--fs-title); text-align: center; }
  #term .fchxrow > span { flex: 1; min-width: 0; }
  #term .fchxrow small { display: block; font: var(--t-caption); color: var(--ink-soft); }
  #term .fchxrow > b { flex: none; font-size: var(--fs-heading); }
  #term .fchxcard { cursor: default; padding-top: var(--space-8); padding-bottom: var(--space-12); }
  #term .fchxcard input { display: block; width: 100%; box-sizing: border-box; margin-top: var(--space-8); min-height: var(--ctl-m); padding: 0 var(--space-12); border: var(--ctl-m-border) solid var(--ink-soft); border-radius: var(--ctl-m-radius); font: var(--t-body); }
  #term .fchxsh { margin: var(--space-12) var(--space-4) var(--space-8); font: var(--t-label); color: var(--ink-soft); }
  #term .fchxback { display: flex; align-items: center; justify-content: flex-start; gap: var(--space-8); margin-bottom: var(--space-8); font: var(--t-control); }
  #term .fchxback b { flex: 1; text-align: left; }
  #term .fchxback .hxback { display: grid; place-items: center; width: var(--ctl-m); height: var(--ctl-m); flex: none; padding: 0; border: var(--ctl-m-border) solid var(--edge); border-radius: var(--radius-round); background: #fff; color: var(--ink); font: var(--t-heading); }
  body.hudxb.hxlay.hudxpg.hudxtall.hxlogic #term, body.hudxb.hxlay.hxlogic.hxlogic.hxlogic #term { left: var(--panel-inset) !important; right: var(--panel-inset) !important; width: auto !important; height: calc(var(--vvh, 100vh) - var(--hud-top) - var(--ctl-m) - var(--ctl-gap) - var(--space-16)) !important; max-height: none !important; z-index: 40 !important; }
  #term .hxnew { display: flex; align-items: center; gap: var(--space-8); width: 100%; min-height: 48px; margin: 0 0 var(--space-8); padding: 0 var(--space-16); box-sizing: border-box; border: 3px solid var(--edge); border-radius: var(--radius-14); background: var(--parch); color: var(--ink); font: var(--t-control); text-align: left; cursor: pointer; }
  #term .hxnew i { font-style: normal; font-size: var(--fs-title); } #term .hxnew span { margin-left: auto; opacity: .6; }
  #term .hxback { display: block; width: auto; align-self: flex-start; justify-self: start; margin: 0 auto var(--space-8) 0; padding: var(--space-8) var(--space-12); border: 2px solid var(--edge); border-radius: var(--radius-pill); background: var(--parch); color: var(--ink); font: var(--t-label); cursor: pointer; }
  body.hudxb.hxlay #build { position: fixed !important; top: calc(var(--hud-top) + var(--ctl-m) + var(--ctl-gap)) !important; bottom: auto !important; left: var(--panel-inset) !important; right: var(--panel-inset) !important; width: auto !important; max-width: none !important; margin: 0 !important; transform: none !important; transition: none !important; z-index: 8; }
  body.hudxb.hxlay #build-done { display: none !important; }
  body.hudxb.hxlay .undobtn { top: calc(var(--hudx-tray-b, calc(var(--hud-top) + var(--ctl-m) + var(--ctl-gap))) + var(--space-8)) !important; bottom: auto !important; }
  body.hudxb.hxlay #fcgrid { left: calc(var(--hud-inline) + 100px) !important; top: calc(var(--hudx-tray-b, calc(var(--hud-top) + var(--ctl-m) + var(--ctl-gap))) + 2px) !important; visibility: visible !important; }
  body.hudxb.hxlay #fcgrid [data-fcs="mode"] { display: none !important; }
  body.hudxb.hxlay #testplay { position: fixed !important; top: var(--hud-top) !important; left: var(--hud-inline) !important; right: auto !important; bottom: auto !important; transform: none !important; margin: 0 !important; }
  body.hudxb.hxlay :is(#sysbtn, #gold, #eldisc, #sshud .ssh-top, #sshud .ssh-now) { visibility: hidden !important; }
  body.hudx.hxlay:not(.hudxb):has(#lgbpbtn[data-ss="game"]:not([hidden])) :is(#lgbpbtn, #lgcambtn) { display: none !important; }   /* (D4: on a Core island 🎮 Game and 🎥 Free cam live in Build; the Ring's, on classic islands, stay) */
  body.hudxb.hxlay :is(#lgcambtn, #lgbpbtn) { position: fixed !important; top: calc(var(--hudx-tray-b, calc(var(--hud-top) + var(--ctl-m) + var(--ctl-gap))) + 4px) !important; right: auto !important; bottom: auto !important; transform: none !important; margin: 0 !important; }   /* (a core island's 🎥 and 🎮 ride with Undo) */
  body.hudxb.hxlay #lgcambtn { left: calc(var(--hud-inline) + 100px) !important; }
  body.hudxb.hxlay #lgbpbtn { left: calc(var(--hud-inline) + 170px) !important; }
  body.hudx.hxlay:not(.hudxb):not(.ingame) #topstack { position: fixed !important; top: calc(var(--hud-row-t) + var(--ctl-l) + var(--ctl-gap)) !important; left: var(--hud-inline) !important; right: auto !important; bottom: auto !important; transform: none !important; max-width: calc(100vw - 2 * var(--hud-inline)); }   /* (a tracked quest's chip: under the top row, not over it; toasts and the coach stop the same gap short of the right edge) */
  body.hudx.hxlay:not(.hudxb):not(.ingame):has(#testplay:not([hidden])) #topstack { top: calc(var(--hud-below) + var(--ctl-m) + var(--ctl-gap)) !important; }   /* (under ▶) */
  body.hudxb.hxlay #topstack { position: fixed !important; top: calc(var(--hudx-tray-b, calc(var(--hud-top) + var(--ctl-m) + var(--ctl-gap))) + 60px) !important; left: var(--hud-inline) !important; right: var(--hud-inline) !important; bottom: auto !important; transform: none !important; }   /* (the place bar: a row under the settings) */
  /* 🕹️ the picked thing's row on a Forge island (hudxRowTick; ?build=a|b|c): Forge's strip buttons, on the thing */
  #hudxrow { position: fixed; left: 0; top: 0; z-index: 30; display: flex; gap: var(--space-4); align-items: center; padding: var(--space-4); background: #ffffff; border: 3px solid #131c5c; border-radius: var(--radius-14); box-shadow: 0 4px 0 #131c5c; will-change: transform; transition: opacity .15s; }
  #hudxrow[hidden] { display: none; }
  #hudxrow button { display: inline-grid; place-items: center; min-width: var(--ctl-m); height: var(--ctl-m); padding: 0 var(--space-4); color: #131c5c; background: #eef2ff; border: 2px solid #c5cbe8; border-radius: var(--radius-10); cursor: pointer; }
  #hudxrow button i { font-style: normal; font-size: var(--fs-title); line-height: var(--lh-solid); }
  #hudxrow button[aria-pressed="true"] { color: #ffffff; background: #3d63ff; border-color: #131c5c; }
  #hudxrow .hxpin { padding: 0 var(--space-8); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: var(--t-label); color: var(--ink); }
  #hudxrow.drag { opacity: .35; pointer-events: none; }   /* (faded while a handle is dragged) */
  body.hudxaway :is(#foinsp, #term) { visibility: hidden !important; pointer-events: none !important; }   /* (open, waiting for ⓘ) */
  body.hudxb.hxlay.hudxopen #build { display: none !important; }   /* (the Inspector takes the tray's place) */
  body.hudxb.hxlay :is(#foinsp:not(.emb), #fvinsp, #term, #tag) { top: calc(var(--hud-top) + var(--ctl-m) + var(--ctl-gap)) !important; bottom: auto !important; max-height: calc(var(--vvh, 100vh) * .5) !important; overflow-y: auto; }
  body.hudx.is-coarse.hxlay #islnear:not(.hi) { bottom: max(var(--snb, 120px), calc(var(--arc-b) + 56px)); }   /* (the near chips sit over the thumbs, not between them) */
  body.hudx.is-coarse.hxlay:not(.hudxb):is(:has(#talk:not([hidden])), :has(#term:not([hidden])), :has(#panel:not([hidden])), :has(#build:not([hidden])), :has(#wardrobe:not([hidden])), :has(#designer:not([hidden])), :has(#tag:not([hidden]))) #stickctl { display: none !important; }
  body.hudxb.is-coarse.hxlay:is(:has(#talk:not([hidden])), :has(#panel:not([hidden])), :has(#wardrobe:not([hidden])), :has(#designer:not([hidden]))) :is(#stickctl, #jumpbtn, #actionbtn) { display: none !important; }   /* (building with the tray up top: the stick and Jump stay) */
  /* your powers in an arc round Jump, the way console-style phone games do it: the main one up and to its left, any more
     round to its left. (#elpow is a point at Jump's middle; each power sits at its own spot from there) */
  body.is-coarse.is-narrow #elpow:not([hidden]) { display: block !important; }
  body.is-coarse.is-narrow #elpow { right: calc(var(--hud-inline) + 46px); bottom: calc(var(--hud-bottom) + 60px); left: auto !important; width: 0; height: 0; z-index: 7; }   /* (elPowAnchor puts it on Jump's middle) */
  body.is-coarse.is-narrow #elpow > button { position: absolute; transform: translate(50%, 50%); }
  body.is-coarse.is-narrow #elpow > button.down { transform: translate(50%, calc(50% + 3px)); }
  body.is-coarse.is-narrow #elpow > button:nth-child(1) { right: 62px; bottom: 58px; }
  body.is-coarse.is-narrow #elpow > button:nth-child(2) { right: 88px; bottom: -6px; }
  body.is-coarse.is-narrow #elpow > button:nth-child(3) { right: 118px; bottom: 62px; }
  body.is-coarse.is-narrow #elpow > button:nth-child(n+4) { right: 6px; bottom: 112px; }
  body.is-coarse.is-narrow #elpow button.pw-main { width: var(--ctl-l); height: var(--ctl-l); border-radius: var(--radius-14); padding: var(--space-4); }
  body.is-coarse.is-narrow #elpow .pw-main i { font-size: var(--fs-hero); }
  body.is-coarse.is-narrow #elpow button { width: 46px; padding: var(--space-4) var(--space-4); border-radius: var(--radius-14); font-size: var(--fs-caption); }
  body.is-coarse.is-narrow #elpow button b { display: none; }
  body.is-narrow:is(:has(#term:not([hidden])), :has(#panel:not([hidden])), :has(#talk:not([hidden])), :has(#drawer:not([hidden])), :has(#result:not([hidden])), :has(#wardrobe:not([hidden])), :has(#build:not([hidden]))) :is(#elpow, #testplay, .testplay) { visibility: hidden !important; }

  /* ---- phone, pass four: the X stays on the build strip, the summon card is slim, the place bar leads with ✓ Build here */
  body.is-narrow #build { overflow: visible; }
  body.is-narrow #build-done { right: -4px !important; top: -12px !important; width: 34px; height: 34px; }
  body.is-narrow #placehint:has(.lk-ic) { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: var(--space-8); }
  body.is-narrow #placehint > .lk-ic { display: none; }
  body.is-narrow #placehint > .lk-t { flex: 1 1 100%; }
  body.is-narrow #placehint > .lk-t small { display: none; }
  body.is-narrow #placehint .lk-t b { font-size: var(--fs-control); }
  body.is-narrow #placehint:has(.lk-ic) button { font-size: var(--fs-label); padding: var(--space-4) var(--space-8); min-height: var(--ctl-s); min-width: 0; }
  body.is-narrow #placehint button.phgo { order: -1; flex: 1 1 auto; font-size: var(--fs-control); padding: var(--space-4) var(--space-12); }
  body.is-narrow #placehint button.phgo:disabled { opacity: .5; filter: grayscale(.4); }
  body.is-narrow #placehint :is([data-a="undo"], [data-a="redo"]) { display: none; }
  body.is-narrow:has(#placehint:not([hidden])) #objchip { display: none !important; }
  body.is-narrow #spell { max-height: 46vh; }
  body.is-narrow #spell :is(#spell-tip, #spell-limit, #spell-mats, #spell-reel) { display: none !important; }
  body.is-narrow #spell #alive-row:has(#alive-hint:not(:empty)):not(:has(~ #behave-row:not([hidden]))) { display: none; }
  body.is-narrow #spell .sp-head b { font-size: var(--fs-heading); }
  body.is-narrow #spell .sp-foot .btn { padding: var(--space-8) var(--space-16); font-size: var(--fs-control); min-height: var(--ctl-m); }
  body.is-narrow #build #cards-rail { display: none; }
  /* a thing's card (tap something you built): a compact strip above the dock, not a big card over the middle */
  body.is-narrow #tag { position: fixed !important; left: var(--panel-inset) !important; right: var(--panel-inset) !important; top: auto !important; bottom: calc(var(--hud-bottom) + 64px) !important; width: auto !important; max-width: none !important; transform: none !important; padding: var(--space-12) var(--space-12); border-radius: var(--radius-14); z-index: 9; }
  body.is-narrow #tag .tn { font-size: var(--fs-heading); }
  body.is-narrow #tag .tm { font-size: var(--fs-label); }
  body.is-narrow #tag .ta { gap: var(--space-4); flex-wrap: wrap; }
  body.is-narrow #tag .ta button { font-size: var(--fs-label); padding: var(--space-4) var(--space-12); min-height: var(--ctl-s); }
  body.is-narrow #tag .tprim button { display: inline-flex; align-items: center; gap: var(--space-4); flex: 1 1 0; justify-content: center; min-height: var(--ctl-s); padding: var(--space-4) var(--space-4); }
  body.is-narrow #tag .tprim button i { font-size: var(--fs-control); font-style: normal; }
  body.is-narrow #tag .tprim button small { display: none; }
  body.is-narrow #tag kbd { display: none; }
  body.is-coarse.is-narrow:has(#tag:not([hidden])) :is(#jumpbtn, #actionbtn) { display: none !important; }
  /* the ring buttons: a row along the bottom-left, by your thumb (the big Ring button first, its helpers beside it) */
  body.is-narrow #ringboardbtn { position: static; }
  body.is-narrow :is(#ringboardbtn, #ringmp, #ringerase, #ringleave, #ringglobe) { width: 38px; height: 38px; border-width: 2.5px; }
  body.is-narrow :is(#ringboardbtn, #ringmp, #ringleave) svg { width: 21px; height: 21px; }

  /* the Ring button on a phone: raised in the middle of the dock (a gap between Make and People), its helpers in a little row
     just above it when they're wanted (the Board, who can come in, leave, wipe the chalk, the globe). In a game, alone at the
     bottom middle */
  body.is-narrow:has(#ringbar:not([hidden])) #tabbar .tab:nth-child(2) { margin-right: 60px; /* off-scale: room for the Ring button */ }   /* (the gap is only there while the Ring button is: not in the tutorial) */
  body.is-narrow #ringbar { position: fixed !important; top: auto !important; left: 50% !important; right: auto !important; bottom: calc(var(--hud-bottom) + 10px) !important; transform: translateX(-50%); margin: 0 !important; display: grid; grid-template-columns: repeat(5, auto); grid-auto-flow: column; justify-content: center; align-items: end; gap: var(--space-8); z-index: 9; }
  body.is-narrow #ringbar > :not(#ringbtn) { grid-row: 1; }
  body.is-narrow #ringbar > #ringshape { grid-column: auto; }
  body.is-narrow #ringbar > :is(#ringbtn, #islbtn) { grid-row: 2; grid-column: 1 / -1; justify-self: center; width: 60px; height: 60px; box-shadow: 0 0 0 4px rgba(19,28,92,.35), inset 0 3px 0 rgba(255,255,255,.35), 0 4px 0 var(--edge); }
  body.is-narrow #ringbar > :is(#ringbtn, #islbtn) .rl { font-size: 10px; /* off-scale: a tiny label inside a fixed-size badge */ }
  body.is-narrow #ringbar > #islbtn { margin-left: 64px; /* off-scale: room for the Ring button */ } body.is-narrow #ringbar:has(> #islbtn:not([hidden])) > #ringbtn { margin-right: 64px; /* off-scale: room for the Island button */ }   /* (🏝️ the Island button beside the Ring button, the two side by side in the dock's gap) */
  body.is-narrow:has(#ringbar:not([hidden]) > #islbtn:not([hidden])) #tabbar .tab:nth-child(2) { margin-right: 128px; /* off-scale: room for the Ring and Island buttons */ }
  body:is(:has(#placehint:not([hidden])), :has(#spell:not([hidden])), :has(#plan:not([hidden])), :has(#designer:not([hidden]))) #ringbar { visibility: hidden !important; }   /* (while something's in your hand, the Ring buttons step aside) */
  body:has(#placehint[data-bring]:not([hidden])) #sshud .ssh-top { visibility: hidden; }   /* a circle being brought to an island: its bar has the top over the game's values */
  body.is-narrow.ingame #ringbar { bottom: calc(var(--hud-bottom) + 6px) !important; }
  body.is-narrow.ingame #ringbar > #ringbtn { width: 48px; height: 48px; }
  body.is-narrow:is(:has(#build:not([hidden])), :has(#tag:not([hidden])), :has(#talk:not([hidden])), :has(#drawer:not([hidden]))) #ringbar { visibility: hidden; }
  /* the place bar (and the home plot's): one compact strip */
  body.is-narrow #placehint:has(.lk-ic) { gap: var(--space-8) var(--space-8); padding: var(--space-8) var(--space-12); font-size: var(--fs-control); border-radius: var(--radius-14); }
  body.is-narrow #placehint .lk-t b { font-size: var(--fs-control); }
  body.is-narrow #placehint .lk-t small { font-size: var(--fs-caption); white-space: normal; }
  body.is-narrow #placehint:has(.lk-ic) button { font-size: var(--fs-label); padding: var(--space-4) var(--space-12); }
  /* the build panel: smaller chips and cards, so the world still shows above it; the camera buttons go (drag and pinch do it) */
  body.is-narrow .cat { padding: 0 var(--space-8); gap: var(--space-4); }
  body.is-narrow .cat .ce { font-size: var(--fs-control); }
  body.is-narrow .bb-tools .btn.small { padding: 0 var(--space-8); }
  body.is-coarse.is-narrow #buildcam { display: none !important; }
  /* panels' swatch rows and two-way switches wrap inside the sheet instead of pushing it wider */
  body.is-narrow #term .gtags.brnlook button { font-size: var(--fs-label); min-height: var(--ctl-s); padding: var(--space-2) var(--space-8) var(--space-2) var(--space-4); }
  body.is-narrow #term .elseg button { white-space: normal; min-width: 0; }
  /* the quest pill steps back while a sheet is open over it (it sat on the sheet's title) */
  body.is-narrow:is(:has(#term:not([hidden])), :has(#panel:not([hidden])), :has(#wardrobe:not([hidden])), :has(#map:not([hidden])), :has(#drawer:not([hidden]))) #objchip { visibility: hidden; }
/* 🕹️ islands HUD: ⭕ Ring takes 🔨 Build's corner (top right) where there's no 🔨 (a classic island); the chalk tools hang under it; in a game it steps out (Stop is the play chip's) */
body.hudx.hxlay.hudxring #ringbar { top: var(--hud-top) !important; bottom: auto !important; left: auto !important; right: var(--hud-inline) !important; transform: none; grid-template-columns: none; grid-auto-flow: row; justify-items: end; align-items: start; }
body.hudx.hxlay.hudxring #ringbar > #ringbtn { grid-row: 1; grid-column: 1; justify-self: end; margin: 0 !important; width: 58px; height: 58px; }
body.hudx.hxlay.hudxring #ringbar > :not(#ringbtn) { grid-row: auto; grid-column: 1; }
body.hudx.hxlay.hudxring.ingame #ringbar { display: none !important; }
/* 🕹️ 📜's 📰 Today (the bulletin: streak, daily jobs, news), and the ! on 📜 while there's news you've not seen */
body.hudx.hxlay #hudxtop .hx-q { position: relative; }
body.hudx.hxlay #hudxtop .hx-q .bdg { position: absolute; right: -6px; top: -6px; min-width: 20px; padding: 0 var(--space-4); height: 20px; border-radius: var(--radius-pill); background: #ff3b3b; border: 2.5px solid var(--edge); box-sizing: border-box; color: #fff; font: var(--t-caption); line-height: 15px /* off-scale: centres the text in its box */; font-style: normal; text-align: center; }
body.hudx.hxlay #hudxtop .hx-q .bdg[hidden] { display: none; }
#panel .hxtoday { position: relative; width: 100%; min-height: 48px; margin: 0 0 var(--space-8); padding: var(--space-8) var(--space-12); display: flex; align-items: center; gap: var(--space-8); box-sizing: border-box; border: 3px solid var(--edge); border-radius: var(--radius-14); background: var(--parch, #fff8e6); box-shadow: 0 3px 0 var(--edge); font: var(--t-control); color: var(--ink, #131c5c); text-align: left; cursor: pointer; }
#panel .hxtoday .ic { font-size: var(--fs-title); } #panel .hxtoday .t { flex: 1; min-width: 0; text-align: left; } #panel .hxtoday .k { opacity: .6; }
#panel .hxtoday .t small { display: block; color: var(--muted); font: var(--t-caption); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#panel .hxtoday.hxnext { border-color: var(--gold, #e0a526); }   /* (Next up: what What next? suggests) */
#panel .hxtoday.news::after { content: '!'; position: absolute; left: 30px; top: 4px; width: 20px; height: 20px; border-radius: var(--radius-pill); background: #ff3b3b; border: 2.5px solid var(--edge); box-sizing: border-box; color: #fff; font: var(--t-caption); line-height: 15px /* off-scale: centres the text in its box */; text-align: center; }
/* 📰 Today (D5): the bulletin is a card where Quests hangs, not a sheet over a dimmed world; ‹ goes back to Quests */
#bulletin .hxback { display: none; }
body.hudx.hxlay #bulletin { position: fixed; inset: auto; left: var(--panel-inset); right: var(--panel-inset); top: var(--hud-below); height: auto; z-index: 30; display: block; padding: 0; background: none; pointer-events: none; }
body.hudx.hxlay #bulletin .bulletin-card { --bmax: calc(var(--vvh, 100vh) - var(--hud-below) - var(--hud-bottom) - 200px); }   /* (as Me's card: its own max, since #app, not the window, holds it) */
body.hudx.hxlay #bulletin .bulletin-card { box-sizing: border-box; width: 100%; height: auto; max-height: var(--bmax); pointer-events: auto; border-width: 3px; border-color: var(--edge); border-radius: var(--radius-14); box-shadow: 0 4px 0 var(--edge); }
body.hudx.hxlay #bulletin .bulletin-card > header { display: flex; align-items: center; gap: var(--space-8); }
body.hudx.hxlay #bulletin .hxback { display: grid; place-items: center; width: var(--ctl-m); height: var(--ctl-m); flex: none; padding: 0; border: var(--ctl-m-border) solid var(--edge); border-radius: var(--radius-round); background: #fff; color: var(--ink); font: var(--t-heading); cursor: pointer; }
body.hudx.hxroomy #bulletin { left: auto; right: var(--hud-inline); width: 400px; }
body.hudx.hxroomy #bulletin .bulletin-card { --bmax: calc(var(--vvh, 100vh) - var(--hud-below) - var(--hud-bottom) - var(--space-24)) !important; }   /* (Quests' own height: the same card, a page further in) */
body.hudxb.hxroomy #bulletin { right: calc(var(--hud-inline) + var(--hxsb) + 12px); }
body.hudx.hxlay:has(#bulletin:not([hidden])) :is(#islcompass, #nudgebtn) { visibility: hidden; }   /* (the bulletin is a sheet in #app: what sits over #app steps aside) */
/* 🕹️ the 📇 card: not a modal but a card where the one that opened it hung (Me on the right, Here and now on the left), ‹ back to it */
#profile .hxback { display: none; }
body.hudx.hxlay #profile { position: fixed; inset: auto; left: var(--panel-inset); right: var(--panel-inset); top: var(--hud-below); height: auto; z-index: 30; display: block; padding: 0; background: none; pointer-events: none; }
body.hudx.hxlay #profile[hidden] { display: none; }
body.hudx.hxlay #profile .profile-card { --bmax: calc(var(--vvh, 100vh) - var(--hud-below) - var(--hud-bottom) - 200px); box-sizing: border-box; width: 100%; height: auto; max-height: var(--bmax); pointer-events: auto; border-width: 3px; border-color: var(--edge); border-radius: var(--radius-14); box-shadow: 0 4px 0 var(--edge); }
body.hudx.hxlay #profile .profile-card > header { display: flex; align-items: center; gap: var(--space-8); }
body.hudx.hxlay #profile[data-from]:not([data-from=""]) .hxback { display: grid; place-items: center; width: var(--ctl-m); height: var(--ctl-m); flex: none; padding: 0; border: var(--ctl-m-border) solid var(--edge); border-radius: var(--radius-round); background: #fff; color: var(--ink); font: var(--t-heading); cursor: pointer; }
body.hudx.hxroomy #profile { left: auto; right: var(--hud-inline); width: 440px; }
body.hudx.hxroomy #profile[data-from="here"] { right: auto; left: var(--hud-inline); }
body.hudx.hxroomy #profile .profile-card { --bmax: calc(var(--vvh, 100vh) - var(--hud-below) - var(--hud-bottom) - var(--space-24)) !important; }
body.hudxb.hxroomy #profile:not([data-from="here"]) { right: calc(var(--hud-inline) + var(--hxsb) + 12px); }
body.hudx.hxlay:has(#profile:not([hidden])) :is(#islcompass, #nudgebtn) { visibility: hidden; }
/* 🕹️ hints on phones: a quest's or the tutorial's glow on the control's own spot (hudxCtl), and the ! for a new level (Me) or new things to build (🔨) */
body.hudx.hxlay :is(.hxpulse, #hudbuild.ring-perm-pulse) { animation: dpulse 1.1s ease-in-out infinite; }
body.hudx.hxlay #hudxtop .hx-me { position: relative; }   /* (for its !; 🔨 is fixed already, which places its ! too) */
body.hudx.hxlay :is(#hudxtop .hx-me, #hudbuild).hxnew::after { content: '!'; position: absolute; right: -6px; top: -6px; width: 20px; height: 20px; border-radius: var(--radius-pill); background: #ff3b3b; border: 2.5px solid var(--edge); box-sizing: border-box; color: #fff; font: var(--t-caption); line-height: 15px /* off-scale: centres the text in its box */; text-align: center; }
body.hudx.hxlay #hudxtop .hx-me.hxnew:has(.bdg:not([hidden]))::after { display: none; }   /* (every badge top right, as ★'s; a count wins over the !) */
/* 💬 the feed on phones: the game's lines, fading, under the left column (hudxTopSync measures it: --hudx-feed-t). Read, not pressed */
body.hudx.hxlay:is(:not(.hudxb), .hxroomy) #chat:not(.open) { display: flex; position: fixed; left: var(--hud-inline); top: var(--hudx-feed-t, var(--hud-below)); right: auto; bottom: auto; z-index: 20; width: min(300px, calc(100vw - 2 * var(--hud-inline) - 84px)); height: auto; }
body.hudx.hxlay:is(:not(.hudxb), .hxroomy) #chat:not(.open) :is(#chat-head, #chat-tabs, #say) { display: none !important; }
body.hudx.hxlay:is(:not(.hudxb), .hxroomy) #chat:not(.open) { flex-direction: column; background: none; border: 0; box-shadow: none; pointer-events: none; overflow: visible; }
body.hudx.hxlay:is(:not(.hudxb), .hxroomy) #chat:not(.open) #chatlog { max-height: 120px; overflow: hidden; padding: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: var(--space-4); }
body.hudx.hxlay:is(:not(.hudxb), .hxroomy) #chat:not(.open) #chatlog p { font-size: var(--fs-label); padding: var(--space-4) var(--space-12); }
body.hudx.hxlay #chat:not(.open) #chatlog :is(p.coach-line, p .feed-link) { pointer-events: none; cursor: default; text-decoration: none; }   /* (D4: the feed is for reading, not a way into anything) */
body.hudx.hxlay:is(:not(.hudxb), .hxroomy) #chat:not(.open) #chatlog p:not(:nth-last-child(-n+3)) { display: none; }
body.hudx.hxlay:is(:has(#panel:not([hidden])), :has(#hxhere:not([hidden])), :has(#bulletin:not([hidden])), :has(#profile:not([hidden])), :has(#talk:not([hidden])), :has(#term:not([hidden]))) #chat:not(.open) { visibility: hidden; }   /* (a sheet's up: its lines wait) */
/* 🖥️ the islands HUD on a roomy screen (hxroomy: not narrow, not short). The layout is the phone's
   (hxlay); what follows is the old desktop layout stepping aside where the HUD has the job, as devices.css does on a phone */
body.hudx.hxroomy :is(#matlab-btn, #sfx-btn, #zoom-in, #zoom-out, #bulletin-btn, #compass, #who) { display: none !important; }   /* (📰 is 📜's Today, ⚙ and the sound are Me › ⚙) */
/* at sea the compass is a strip in the middle, clear of the corners: they keep the top as on land */
body.hudx.hxcprow.isl-compass #hudbuild, body.hudx.hxcprow.isl-compass #hudxplace { top: var(--hud-top); }
body.hudx.hxcprow.isl-compass #hudxtop { top: calc(var(--hud-top) + (var(--ctl-l) - var(--ctl-m)) / 2); }
/* a panel is a card under its button, not a sheet across the screen: Me on the right, Here and now under the place chip */
body.hudx.hxroomy #panel.me { left: auto !important; right: var(--panel-inset) !important; width: 400px !important; bottom: auto !important; max-height: calc(var(--vvh, 100vh) - var(--hud-below) - var(--hud-bottom) - var(--space-24)) !important; overflow-y: auto !important; }
body.hudx.hxroomy #panel.me[data-kind="here"] { right: auto !important; left: var(--hud-inline) !important; }
/* the place chip spells out where you are, and ▶ (now's row: the core's play chip and score, or Forge's ▶) sits beside it */
body.hudx.hxroomy #hudxplace { display: flex; gap: var(--space-8); width: auto; max-width: 360px; padding: 0 var(--space-20) 0 var(--space-16); border-radius: var(--radius-pill); }
body.hudx.hxroomy #hudxplace .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: var(--t-heading); color: var(--ink); }
body.hudx.hxroomy #sshud .ssh-now { left: var(--hudx-place-r, calc(var(--hud-inline) + var(--ctl-l) + var(--ctl-gap))); top: calc(var(--hud-top) + (var(--ctl-l) - var(--ctl-m)) / 2); }
body.hudx.hxroomy:not(.hudxb) #testplay { left: var(--hudx-place-r, calc(var(--hud-inline) + var(--ctl-l) + var(--ctl-gap))) !important; top: calc(var(--hud-top) + (var(--ctl-l) - var(--ctl-m)) / 2) !important; }
body.hudx.hxroomy:not(.hudxb):not(.ingame):has(#testplay:not([hidden])) #topstack { top: calc(var(--hud-top) + var(--ctl-l) + var(--ctl-gap)) !important; }
/* hovering a HUD button: its name, and its key */
#hudxhov { position: fixed; z-index: 40; padding: var(--space-8) var(--space-12); border-radius: var(--radius-10); background: var(--ink); color: #fff; font: var(--t-label); white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; }
#hudxhov.on { opacity: 1; transition-delay: .25s; }
#hudxkey { position: fixed; z-index: 39; padding: var(--space-4) var(--space-8); border-radius: var(--radius-14); background: var(--gold); color: var(--ink); border: 2px solid var(--edge); box-shadow: 0 3px 0 var(--edge); font: var(--t-label); white-space: nowrap; pointer-events: none; display: none; }
body.hudx.hxlay #hudxkey.on { display: block; }   /* (D4: the glow names its key on desktop) */
#hudxkey kbd { margin-left: var(--space-4); display: inline-grid; place-items: center; box-sizing: border-box; height: var(--ctl-hint); vertical-align: middle; padding: 0 var(--space-4); border: 1.5px solid var(--edge); border-radius: var(--radius-6); background: #fff; font: var(--t-code); }
#hudxhov kbd { margin-left: var(--space-8); display: inline-grid; place-items: center; box-sizing: border-box; height: var(--ctl-hint); vertical-align: middle; padding: 0 var(--space-4); border: 1.5px solid #fff; border-radius: var(--radius-6); font: var(--t-code); }
/* 🖥️ a card a side: Here and now's own card on the left (hxnCard), so Me can be open on the right with it */
#hxhere[hidden] { display: none !important; }
body.hudx.hxroomy #hxhere { position: fixed; z-index: 30; left: var(--panel-inset); top: var(--hud-below); width: 400px; max-height: calc(var(--vvh, 100vh) - var(--hud-below) - var(--hud-bottom) - var(--space-24)); display: flex; flex-direction: column; overflow-y: auto; box-sizing: border-box; border-radius: var(--radius-14); }
body.hudx.hxroomy #hxhere > header { position: absolute; right: 10px; top: 10px; z-index: 2; padding: 0; background: none; border: 0; }
#hxhere .hn { display: flex; flex-direction: column; gap: var(--gap-section); padding: var(--pad-panel); }
/* 🖥️ the chart, widened: it covers both sides (Me too), the sea big on the left and the ways to get places beside it */
body.hudx.hxroomy #hxhere:has(.chartv) { z-index: 35; width: calc(100vw - 2 * var(--hud-inline)); max-width: 1700px; overflow: hidden; }
body.hudxb.hxroomy #hxhere:has(.chartv) { top: var(--hud-top); max-height: calc(var(--vvh, 100vh) - var(--hud-top) - var(--hud-inline)); }   /* (D4: in Build the chart covers both sides, the sidebar's header too) */
body.hudx.hxroomy #hxhere .chartv { display: grid; grid-template-columns: auto minmax(240px, 1fr); grid-template-areas: "h h" "c l"; gap: var(--space-12) var(--space-12); }
body.hudx.hxroomy #hxhere .chartv > .hnh { grid-area: h; }
body.hudx.hxroomy #hxhere .chartv > .chart { grid-area: c; align-self: start; }
body.hudx.hxroomy #hxhere .chartv .chart canvas { width: min(calc(min(1700px, 100vw - 2 * var(--hud-inline)) - 24px - 14px - 300px), calc((var(--vvh, 100vh) - var(--hud-top) - 190px) * 16 / 9)); }
body.hudxb.hxroomy #hxhere .chartv .chart canvas { width: min(calc(min(1700px, 100vw - 2 * var(--hud-inline)) - 24px - 14px - 300px), calc((var(--vvh, 100vh) - var(--hud-top) - 118px) * 16 / 9)); }
body.hudx.hxroomy #hxhere .chartv > .lists { grid-area: l; display: flex; flex-direction: column; gap: var(--space-8); min-height: 0; contain: size; overflow-y: auto; }
/* 🖥️ Build docks right (D4): a sidebar down the right for as long as you build. Its top has ▶, the tray's tabs and
   ✓ Done (where 🔨 was); under them the tray, a page tab (#term) or the Inspector. The place chip and the feed stay
   left, the row moves left of the sidebar, and Undo, 🧊 🎥 👁 (or a core island's 🎥 and 🎮) sit bottom left. */
body.hudx.hxroomy { --hxsb: 384px; }
body.hudxb.hxroomy #app::before { content: ''; position: fixed; z-index: 8; top: var(--hud-top); right: var(--hud-inline); bottom: var(--hud-inline); width: var(--hxsb); box-sizing: border-box; border: 3px solid var(--edge); border-radius: var(--radius-14); background: linear-gradient(180deg, #4b67ff 0%, #3d5afe 55%, #3550e6 100%); box-shadow: inset 0 3px 0 rgba(255,255,255,.28), 0 6px 0 rgba(19,28,92,.5); pointer-events: none; }
body.hudxb.hxroomy #testplay { z-index: 10 !important; top: calc(var(--hud-top) + var(--space-8)) !important; left: calc(100vw - var(--hud-inline) - var(--hxsb) + 8px) !important; }
body.hudxb.hxroomy #hudbuild { top: calc(var(--hud-top) + var(--space-8)); right: calc(var(--hud-inline) + var(--space-8)); z-index: 10; }
body.hudxb.hxroomy #hudxtabs:not([hidden]) { z-index: 10; top: calc(var(--hud-top) + var(--space-8)); left: calc(100vw - var(--hud-inline) - var(--hxsb) + 58px); right: calc(var(--hud-inline) + 58px); justify-content: flex-start; }
body.hudxb.hxroomy:not(:has(#testplay:not([hidden]))) #hudxtabs:not([hidden]) { left: calc(100vw - var(--hud-inline) - var(--hxsb) + 10px); }
body.hudxb.hxroomy :is(#build, #term, #foinsp:not(.emb), #fvinsp, #tag) { position: fixed !important; z-index: 9 !important; top: calc(var(--hud-top) + var(--space-8) + var(--ctl-m) + var(--ctl-gap)) !important; right: calc(var(--hud-inline) + 6px) !important; left: auto !important; bottom: auto !important; width: calc(var(--hxsb) - 12px) !important; max-width: none !important; max-height: calc(var(--vvh, 100vh) - var(--hud-top) - var(--space-8) - var(--ctl-m) - var(--ctl-gap) - var(--hud-inline) - var(--space-8)) !important; margin: 0 !important; transform: none !important; box-sizing: border-box; overflow-y: auto; }
body.hudxb.hxroomy #build { height: calc(var(--vvh, 100vh) - var(--hud-top) - var(--space-8) - var(--ctl-m) - var(--ctl-gap) - var(--hud-inline) - var(--space-8)) !important; display: flex !important; flex-direction: column; gap: var(--space-8); padding: 0 var(--space-8) var(--space-8) !important; background: none !important; border: 0 !important; box-shadow: none !important; overflow: hidden; }
body.hudxb.hxroomy #build[hidden], body.hudxb.hxroomy.hudxpg #build, body.hudxb.hxroomy.hudxopen #build { display: none !important; }
body.hudxb.hxroomy #build :is(.bb-top, .bb-tools, #cat-tabs) { flex-wrap: wrap; overflow: visible; }
body.hudxb.hxroomy #build #cat-tabs:has(> .cat[data-cat="plans"]) .cat { padding-inline: var(--space-8); }   /* (a builder bots island's four tabs, 📐 Plans among them, on one row) */
body.hudxb.hxroomy #build .bb-top { flex: none; gap: var(--space-8); }
body.hudxb.hxroomy #build :is(.cardwrap, .cardcol) { flex: 1; min-height: 0; height: auto !important; }
body.hudxb.hxroomy #build #cards { display: grid; grid-template-columns: repeat(3, 1fr); align-content: start; gap: var(--space-8); height: 100%; margin: 0; padding: var(--space-4) var(--space-2) var(--space-8); overflow-x: hidden; overflow-y: auto; }
body.hudxb.hxroomy #build .kcard { width: auto !important; }
body.hudxb.hxroomy #build #cards-rail { display: none; }
body.hudxb.hxroomy :is(#hudxplace, #hudxtop) { display: flex; }
body.hudxb.hxroomy #hudxtop { right: calc(var(--hud-inline) + var(--hxsb) + 12px); }
body.hudxb.hxroomy #panel.me { right: calc(var(--hud-inline) + var(--hxsb) + 12px) !important; }
body.hudxb.hxroomy .undobtn { position: fixed; top: auto !important; right: auto !important; left: var(--hud-inline); bottom: var(--hud-inline) !important; z-index: 7; width: 42px; height: 42px; padding: 0; display: grid; place-items: center; overflow: hidden; font-size: 0; border-width: 2.5px; border-radius: 50%; }   /* (as a phone's: ↩ ↪ at the bottom left) */
body.hudxb.hxroomy .undobtn::before { content: '↩'; font: var(--t-title); line-height: var(--lh-solid); }
body.hudxb.hxroomy #redobtn { left: calc(var(--hud-inline) + 48px); }
body.hudxb.hxroomy #redobtn::before { content: '↪'; }
body.hudxb.hxroomy :is(#fcgrid, #lgcambtn, #lgbpbtn) { top: auto !important; bottom: var(--hud-inline) !important; }
body.hudxb.hxroomy #topstack { top: var(--hud-below) !important; right: auto !important; }
body.hudxb.hxroomy.hudxpg #term, body.hudxb.hxroomy.hudxpg.hudxtall #term { max-height: calc(var(--vvh, 100vh) - var(--hud-top) - var(--space-8) - var(--ctl-m) - var(--ctl-gap) - var(--hud-inline) - var(--space-8)) !important; }
body.hudxb.hxroomy.hudxpg #term { border: 0 !important; border-radius: var(--radius-14) !important; box-shadow: none !important; }   /* (a tab's page is the sidebar's body, not a card inside it) */
body.hudxb.hxroomy.hudxpg.hudxtall.hxlogic.hxlogic #term, body.hudxb.hxroomy.hxlogic.hxlogic.hxlogic.hxlogic #term { left: var(--hud-inline) !important; right: var(--hud-inline) !important; width: auto !important; max-width: none !important; height: calc(var(--vvh, 100vh) - var(--hud-top) - var(--space-8) - var(--ctl-m) - var(--ctl-gap) - var(--hud-inline)) !important; max-height: none !important; z-index: 40 !important; }   /* (🧩 Logic: the full editor, the whole screen) */
body.hudxb.hxroomy:not(:has(#build:not([hidden]))):not(.hudxpg):not(.hudxopen) #app::before { bottom: auto; height: 60px; }   /* (placing: the tray steps aside, the sidebar is its top row) */
body.hudxb.hxroomy :is(#placehint, #bstrip) { left: calc(var(--hud-inline) + 250px + (100vw - 2 * var(--hud-inline) - var(--hxsb) - 12px - 250px) / 2) !important; }   /* (centred in the room left of the sidebar, clear of Undo and 🧊 🎥 👁) */
body.hudxb.hxroomy #placehint { top: calc(var(--hud-top) + var(--ctl-l) + var(--ctl-gap)) !important; }   /* (under the row) */
body.hudxb.hxroomy #dock[hidden] { display: block !important; }   /* (Me and Here and now hang in the dock: in Build they stay) */
body.hudxb.hxroomy #dock[hidden] > :is(#drawer, #emotes) { display: none !important; }
/* 🖥️ the dock goes on desktop (D4): Me has levels, friends and the bag; 📜 the quests; Here and now the emotes; 🔨 Build; the chart Home */
body.hudx.hxroomy :is(#dockbar, #tabbar), body.hudx.hxlay.is-phone-landscape #dockbar { display: none !important; }   /* (a phone on its side: the islands HUD, no dock) */
body.hudxb.hxroomy #sshud .ssh-keys { visibility: hidden; }   /* (play's keys: Undo and the tools have the corner while you build) */

/* Me's XP ring animates its two stops (hudxRing) */
@property --mxp { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
@property --mxp0 { syntax: '<percentage>'; inherits: false; initial-value: 0%; }

/* 🖥️ the bottom right on desktop (D4): the phone's arc, smaller, while a mode puts something there. At the wheel: ⚡ Boost is
   Main (56) in the corner, Use (⛵ Ashore, what E does) on 1 to its left, 🚶 Leave on 2 above, anything else on 3, each with its key */
body.hudx.hxlay:not(.is-coarse) { --dk-r: calc(48px + env(safe-area-inset-right, 0px)); --dk-b: calc(52px + env(safe-area-inset-bottom, 0px)); }
body.hudx.hxlay:not(.is-coarse) #islboost { width: var(--ctl-l); height: var(--ctl-l); font-size: var(--fs-hero); right: calc(var(--dk-r) - var(--ctl-l) / 2); bottom: calc(var(--dk-b) - var(--ctl-l) / 2); }
body.hudx.hxlay:not(.is-coarse) #islstop { width: 44px; height: 44px; font-size: var(--fs-title); right: calc(var(--dk-r) - 22px); bottom: calc(var(--dk-b) + 48px); }
body.hudx.hxlay:not(.is-coarse):not(:has(#islnear.arc:not([hidden]))) #islstop { right: calc(var(--dk-r) + 48px); bottom: calc(var(--dk-b) - 22px); }   /* (nothing in reach: Leave is Use, on 1) */
body.hudx.hxlay:not(.is-coarse) #islnear.arc { left: auto; right: 0; bottom: 0; width: 0; height: 0; padding: 0; border: 0; background: none; box-shadow: none; transform: none; animation: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
body.hudx.hxlay:not(.is-coarse) #islnear.arc .sn-go { position: fixed; width: 44px; height: 44px; margin: 0; padding: 0; border-radius: 50%; font-size: var(--fs-title); display: grid; place-items: center; }
body.hudx.hxlay:not(.is-coarse) #islnear.arc .u1 { right: calc(var(--dk-r) + 48px); bottom: calc(var(--dk-b) - 22px); }
body.hudx.hxlay:not(.is-coarse) #islnear.arc .u3 { right: calc(var(--dk-r) + 28px); bottom: calc(var(--dk-b) + 28px); }
body.hudx.hxlay:not(.is-coarse) #islnear.arc kbd { position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); font: var(--t-caption); padding: var(--space-2) var(--space-4) var(--space-4); }

/* 🖥️ at sea (D4): the compass in the gap between the chip and the row (hudxCompassFit), or under the row when the gap is tight */
body.hudx.hxcprow.isl-compass #islcompass { width: var(--hxcp-w, min(560px, calc(100vw - 32px))); top: var(--hxcp-t, calc(8px + env(safe-area-inset-top, 0px))); }
body.hudx.hxcprow.isl-compass #hudxplace { max-width: var(--hxchip-max, 360px); }   /* (D6: the name is cut to the room left of the centred compass) */

/* ★ Quests (D5): other quests one line each; a tap opens one (.open) to its ask and 🧭 Guide me */
body.hudx.hxlay #panel:has(#mehead .qh) .quests .quest:not(.open):not(.tut):not(.ready) :is(.qs, .qd, .bar) { display: none; }

/* Me's level row (D5): the Lv badge, your name over a fat XP bar, the next unlock at its end. No gold edge: the ring is Me's gold */
#mehead .mhrow { display: flex; align-items: center; gap: var(--space-8); }
#mehead .mhrow .mh { flex: 1; min-width: 0; }
#mehead .mhf { position: relative; flex: none; width: 52px; height: 52px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }   /* (D6: your 📇 card, or 🔑 Sign in) */
#mehead .mhf .face { width: 100%; height: 100%; font-size: var(--fs-hero); }
#mehead .mhf.guest .face { border-color: var(--edge); background: var(--parch); }
#mehead .mhf .lv { position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); padding: var(--space-2) var(--space-8); border-radius: var(--radius-pill); background: var(--ink); color: #fff; font: var(--t-caption); line-height: var(--lh-loose); }
#mehead .mhf:hover .face { box-shadow: 0 0 0 3px var(--gold); }
#mehead .lvr .xp { position: relative; height: 20px; margin-top: var(--space-4); }
#mehead .lvr .xp em { position: absolute; inset: 0; display: grid; place-items: center; font: var(--t-badge); font-style: normal; color: var(--ink); }
#mehead .lvr .nx { flex: none; display: grid; place-items: center; width: 44px; height: 44px; box-sizing: border-box; border: 2.5px dashed var(--edge); border-radius: var(--radius-14); background: var(--parch); font-size: var(--fs-title); line-height: var(--lh-solid); }
#mehead .lvr .nx small { font: var(--t-badge); color: var(--muted); }

/* 🖥️ the arc on desktop in every mode (D4, .hxdk): Main (56) on --dk-r/--dk-b, 1 is 70 left (Use), 2 is 70 up, 3 the diagonal;
   the same order as the phone's. Each shows its key under it */
body.hxdk.hxlay #jumpbtn:not([hidden]) { display: grid !important; position: fixed; z-index: 7; place-items: center; width: var(--ctl-l); height: var(--ctl-l); padding: 0; right: calc(var(--dk-r) - var(--ctl-l) / 2); bottom: calc(var(--dk-b) - var(--ctl-l) / 2); border-radius: 50%; font: 700 0/1 var(--ui); color: #fff; background: var(--go, #3d63ff); border: 3px solid var(--edge, #131c5c); box-shadow: 0 4px 0 var(--edge, #131c5c); cursor: pointer; }
body.hxdk.hxlay #jumpbtn::before { content: '⤒'; font-size: var(--fs-title); line-height: var(--lh-solid); }
body.hxdk.hxlay #jumpbtn::after { content: 'Space'; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); padding: var(--space-2) var(--space-4) var(--space-4); border-radius: var(--radius-6); font: var(--t-caption); color: #fff; background: rgba(8,26,56,.7); border: 2px solid rgba(255,255,255,.6); }
body.hxdk.hxlay:is(.hudxnojump, :has(#exitbtn:not([hidden])), :has(#islboost:not([hidden]))) #jumpbtn { display: none !important; }
/* a wand's 🎯 Fire on 2 (Jump keeps Main); in a vehicle Fire takes Main and 🚪 Get out is Use, on 1 */
body.hxdk.hxlay :is(#firebtn, #exitbtn) { position: fixed; z-index: 7; width: var(--ctl-m); height: var(--ctl-m); padding: 0; border-radius: var(--radius-round); }
body.hxdk.hxlay :is(#firebtn, #exitbtn) .fe { font-size: var(--fs-title); } body.hxdk.hxlay :is(#firebtn, #exitbtn) .fl { display: none; }
body.hxdk.hxlay :is(#firebtn, #exitbtn) kbd { top: auto; left: 50%; bottom: -10px; transform: translateX(-50%); display: grid; place-items: center; box-sizing: border-box; height: var(--ctl-hint); padding: 0 var(--space-4); font: var(--t-caption); border-width: 2px; border-radius: var(--radius-6); }
body.hxdk.hxlay #firebtn { width: var(--ctl-l); height: var(--ctl-l); right: calc(var(--dk-r) - var(--ctl-l) / 2); bottom: calc(var(--dk-b) + var(--ctl-l) / 2 + var(--space-12)); }
body.hxdk.hxlay:is(.hudxnojump, :has(#exitbtn:not([hidden]))) #firebtn { width: var(--ctl-l); height: var(--ctl-l); right: calc(var(--dk-r) - var(--ctl-l) / 2); bottom: calc(var(--dk-b) - var(--ctl-l) / 2); }
body.hxdk.hxlay #exitbtn { right: calc(var(--dk-r) + 48px); bottom: calc(var(--dk-b) - 22px); }
/* powers: #elpow is a point on Main's middle; the first takes 2, the second 3, a third 1. Can't jump: the first takes Main */
body.hxdk.hxlay #elpow:not([hidden]) { display: block !important; left: auto !important; right: var(--dk-r); bottom: var(--dk-b); width: 0; height: 0; z-index: 7; }
body.hxdk.hxlay #elpow > button { position: absolute; transform: translate(50%, 50%); width: var(--ctl-m) !important; height: var(--ctl-m) !important; padding: var(--space-4) !important; border-radius: var(--radius-14) !important; font-size: 0; }
body.hxdk.hxlay #elpow > button.down { transform: translate(50%, calc(50% + 3px)); }
body.hxdk.hxlay #elpow > button i { font-size: var(--fs-title) !important; } body.hxdk.hxlay #elpow > button b { display: none; }
body.hxdk.hxlay #elpow > button kbd { position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); font: var(--t-caption); }
body.hxdk.hxlay #elpow > button:nth-child(1) { right: 0; bottom: 70px; }
body.hxdk.hxlay #elpow > button:nth-child(2) { right: 50px; bottom: 50px; }
body.hxdk.hxlay #elpow > button:nth-child(3) { right: 70px; bottom: 0; }
body.hxdk.hxlay.hudxnojump #elpow > button:nth-child(1) { right: 0; bottom: 0; width: var(--ctl-l) !important; height: var(--ctl-l) !important; }
body.hxdk.hxlay.hudxnojump #elpow > button:nth-child(2) { right: 0; bottom: 70px; }
body.hxdk.hxlay.hudxnojump #elpow > button:nth-child(3) { right: 50px; bottom: 50px; }
/* core rounds: bare-handed Attack on 2, a held weapon's on 3, a vehicle's 🚪 Get out is Use, on 1 */
/* (a transform on the column would place its fixed round buttons against the column, so it is centered by its margins) */
body.hxdk.hxlay #sshud .ssh-actions-at { top: 0; bottom: 0; height: max-content; margin-block: auto; transform: none; }
body.hxdk.hxlay #sshud .ssh-actions-at > :is([data-control="attack"], [data-control="getOut"]) { position: fixed; z-index: 7; display: grid; place-items: center; width: 44px; height: 44px; min-height: 0; padding: 0 var(--space-4); border-radius: 50%; font: var(--t-caption); white-space: normal; text-align: center; overflow: visible; }
body.hxdk.hxlay #sshud .ssh-actions-at > :is([data-control="attack"], [data-control="getOut"]) kbd { position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); font: var(--t-caption); }
body.hxdk.hxlay #sshud .ssh-actions-at > [data-control="attack"]:not([data-target]) { right: calc(var(--dk-r) - 22px); bottom: calc(var(--dk-b) + 48px); }
body.hxdk.hxlay #sshud .ssh-actions-at > [data-control="attack"][data-target] { right: calc(var(--dk-r) + 28px); bottom: calc(var(--dk-b) + 28px); }
body.hxdk.hxlay #sshud .ssh-actions-at > [data-control="getOut"] { right: calc(var(--dk-r) + 48px); bottom: calc(var(--dk-b) - 22px); }
body.hxdk.hxlay:has(#exitbtn:not([hidden])) #islnear.arc .u1 { display: none; }   /* (in a vehicle 🚪 Get out is Use) */

/* Reduced motion: the islands HUD's level-up drop, XP ring fill and pulses hold still (the change still shows) */
@media (prefers-reduced-motion: reduce) {
  body.hxlay :is(#lvlbanner, #lvlup), body.hxlay :is(#lvlbanner, #lvlup).out { animation: none !important; }
  #hudxtop .hx-me { transition: none !important; }
  body.hudx.hxlay :is(.hxpulse, #hudbuild.ring-perm-pulse) { animation: none; box-shadow: 0 3px 0 var(--edge), 0 0 0 3px #fff, 0 0 0 6px var(--gold); }
}

/* 🕹️ a Forge island of yours outside 🔨 Build: Undo and Redo are Build's (D1), as the strip is (fcStripTick) */
body.hudx.hxlay.hxfcout :is(#undobtn, #redobtn) { display: none !important; }
body.hudx.hxlay.hxbout :is(#undobtn, #redobtn) { display: none !important; }   /* (any island or home of yours outside 🔨 Build: Undo is Build's) */

/* Round icon buttons: drawn shapes, not font glyphs (a glyph sits where the font's metrics put it, so ▶ ↩ ↪ rode off-centre). currentColor keeps each button's own colour, greyed when it can't */
body:is(.is-narrow, .hudxb.hxroomy) :is(#undobtn, #redobtn)::before, body.hudxb.hxlay #testplay::before { content: ''; display: block; width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--hxico) center / contain no-repeat; mask: var(--hxico) center / contain no-repeat; }
body:is(.is-narrow, .hudxb.hxroomy) :is(#undobtn, #redobtn) { --hxico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7.5 3 3 7.5 7.5 12M3.5 7.5h9a4.75 4.75 0 0 1 0 9.5H8'/%3E%3C/svg%3E"); }
body:is(.is-narrow, .hudxb.hxroomy) #redobtn::before { transform: scaleX(-1); }
body.hudxb.hxlay #testplay { --hxico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6.5 4.2v11.6a1 1 0 0 0 1.5.86l9.3-5.8a1 1 0 0 0 0-1.72L8 3.34a1 1 0 0 0-1.5.86z'/%3E%3C/svg%3E"); }

/* A piece in hand folds the sidebar away, so the hotbar centres in the room right of Undo and 🧊 🎥 👁, not the room left of a sidebar that isn't there.
   Where even that's too tight for it, Undo and the camera bar step up above it instead of sitting under it */
body.hudxb.hxroomy:has(#placehint:not([hidden])) #bstrip { left: calc(var(--hud-inline) + 250px + (100vw - 2 * var(--hud-inline) - 250px) / 2) !important; }
@media (max-width: 1000px) {
  body.hudxb.hxroomy:has(#placehint:not([hidden])) #bstrip { left: 50vw !important; }
  body.hudxb.hxroomy:has(#bstrip:not([hidden])) :is(#fcgrid, #lgcambtn, #lgbpbtn, .undobtn) { bottom: calc(var(--hud-inline) + 92px) !important; }
}
body.hudxb.hxlay #testplay.fcstopbtn { --hxico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect x='4.5' y='4.5' width='11' height='11' rx='2.2'/%3E%3C/svg%3E"); }   /* (⏹ while the world still runs: it stops) */
body.hudxb.hxlay.hxlogic :is(#fcgrid, #lgcambtn, #lgbpbtn, #undobtn, #redobtn) { display: none !important; }   /* (Logic fills the screen: 🧊 🎥 👁 and Undo sat on its last section) */

/* A block's or a thing's panel (🧱 #fvinsp, 🧩 #foinsp) outside 🔨 Build — a tap on one as you walk — hangs where Me's panels do:
   under the top row on the right, never over ★ Me 🔨. In Build it's the tray's (above, with #term) */
body.hudx.hxlay:not(.hudxb) :is(#fvinsp, #foinsp:not(.emb)) { position: fixed !important; top: var(--hud-below) !important; right: var(--panel-inset) !important; left: auto !important; bottom: auto !important; transform: none !important; margin: 0 !important; max-height: calc(var(--vvh, 100vh) - var(--hud-below) - var(--hud-bottom) - 200px) !important; }
body.hudx.hxroomy:not(.hudxb) :is(#fvinsp, #foinsp:not(.emb)) { width: 400px !important; max-height: calc(var(--vvh, 100vh) - var(--hud-below) - var(--hud-bottom) - var(--space-24)) !important; }
body.hudxb.hxroomy :is(#fvinsp, #foinsp:not(.emb)) { border: 0 !important; border-radius: var(--radius-14) !important; box-shadow: none !important; }   /* (in the sidebar it's the sidebar's body, as a tab's page is) */

/* ⏹ while a game runs outside 🔨 Build: ▶ and the game chip share the spot beside the place chip, so ▶ turns into a round
   red ⏹ there and the chip moves right of it (it used to sit on top of ⏹, which stayed live underneath) */
body.hudx.hxlay:not(.hudxb):has(#sshud .ssh-nowrow) #testplay.fcstopbtn:not([hidden]) { width: var(--ctl-m) !important; height: var(--ctl-m) !important; min-width: 0 !important; padding: 0 !important; border-radius: 50% !important; font-size: 0 !important; display: grid !important; place-items: center; --hxico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect x='4.5' y='4.5' width='11' height='11' rx='2.2'/%3E%3C/svg%3E"); }
body.hudx.hxlay:not(.hudxb):has(#sshud .ssh-nowrow) #testplay.fcstopbtn:not([hidden])::before { content: ''; display: block; width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--hxico) center / contain no-repeat; mask: var(--hxico) center / contain no-repeat; }
body.hudx.hxlay:not(.hudxb):has(#testplay.fcstopbtn:not([hidden])) #sshud .ssh-now { left: calc(var(--hud-inline) + 52px); max-width: calc(100vw - 2 * var(--hud-inline) - 52px); }
body.hudx.hxroomy:not(.hudxb):has(#testplay.fcstopbtn:not([hidden])) #sshud .ssh-now { left: calc(var(--hudx-place-r, calc(var(--hud-inline) + var(--ctl-l) + var(--ctl-gap))) + 52px); }
