/* Foundation Up: the play surface. Load after style.css and game-kit.css.
   Board, HUD and hand each own a fixed share of the viewport. The shared
   Hand and Binder retain their own geometry and interaction styling. */
:root {
  --game-border: #a8c0ab38;
  --game-panel: #102d35;
  --game-tray-height: clamp(210px, 35vh, 285px);
  --game-header-height: 48px;
  --game-hud-height: 68px;
  /* The ground the table stands on: one value, drawn by #app from the served page's first frame and by the shell after.
     Its colour is the engine's dark ground (style.css --night, from --vf-bg), the colour the door stands on. */
  --fu-ground: radial-gradient(ellipse at 40% 37%, #42645338, transparent 67%), var(--night);
}
html, body { width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
/* ONE SCREEN, BAND INCLUDED. The page does not scroll: #app takes the screen, and the public-test band stands inside the
   kit's frame as its first bar (journey.css, "THE PLACE FIRST ON A SHORT FRAME", Threshold's small-frame ruling), so the
   table takes what the band leaves and, on a short frame, the band travels with the board. */
body { min-width: 320px; height: 100dvh; display: flex; flex-direction: column; }
/* THE FIRST PLACE IS IN THE SERVED PAGE (@vf/game-kit 0.108.0, going in): #app carries data-vfg-going-in="foundation-up"
   and draws the table's ground from the first frame, so the doorway on the door grows into the ground the table stands
   on (never an empty frame), and the table the journey draws inside it takes over on the same picture. */
#app { width: 100%; flex: 1 1 auto; min-height: 0; overflow: hidden; background: var(--fu-ground); }
#app > .vfg-viewport { height: 100%; min-height: 0; }
.game-shell {
  display: grid;
  grid-template-rows: var(--game-header-height) var(--game-hud-height) minmax(0, 1fr) var(--game-tray-height);
  width: 100%; height: 100%; min-height: 0; overflow: hidden;
  background: var(--fu-ground);
}
.game-shell button { touch-action: manipulation; }
.game-top {
  display: flex; align-items: center; gap: 12px; min-width: 0;
  padding: 0 20px; border-bottom: 1px solid var(--game-border);
  background: #081c23e8; box-shadow: 0 2px 12px #0002; z-index: 8;
}
.game-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
/* The card games' one control (@vf/game-kit 0.104.0 PlaceFinder) leads the top bar; the bar's own markup stands
   beside it as if it were the bar's own children, so every rule written for `.game-brand` and the nav still holds. */
.game-top-markup { display: contents; }
.game-top .logo { width: 27px; height: 30px; gap: 3px; flex-shrink: 0; }
.game-top .logo i { width: 4px; height: 10px; border-radius: 1px; }
.game-top .logo i:nth-child(2) { height: 16px; }
.game-top .logo i:nth-child(3) { height: 23px; }
.game-top .logo i:nth-child(4) { height: 29px; }
.game-top h1 { font-size: 23px; line-height: 1; letter-spacing: -.025em; white-space: nowrap; }
.game-top .eyebrow { font-size: 8px; letter-spacing: .15em; margin-bottom: 3px; }
.game-top nav, .game-top .top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-left: auto; min-width: 0; }
.game-top button { font-size: 11px; padding: 7px 10px; white-space: nowrap; }
.game-top .version { font-size: 10px; color: var(--muted); white-space: nowrap; }
.game-hud {
  display: grid; grid-template-columns: minmax(220px, .94fr) minmax(305px, 1.1fr) auto;
  align-items: center; gap: 14px; min-width: 0; padding: 8px 20px;
  border-bottom: 1px solid #b9cbb11f; background: #102d30b8; z-index: 7;
}
.game-goal, .goal-button {
  min-width: 0; height: 46px; text-align: left; padding: 6px 10px;
  border: 1px solid #d3ba7566; border-radius: 7px;
  background: linear-gradient(110deg, #e3bc7514, #203b351a);
}
.game-goal strong, .goal-button strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 16px Georgia, serif; }
.game-goal .eyebrow, .goal-button .eyebrow { display: block; font-size: 8px; margin-bottom: 3px; }
.game-goal small, .goal-button small { font-size: 9px; }
.game-hud .phasebar, .game-phases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 0; min-width: 0; }
.game-hud .phase { padding: 7px 8px; gap: 7px; min-height: 43px; min-width: 0; border-radius: 6px; }
.game-hud .phase .step { font-size: 16px; flex-shrink: 0; }
.game-hud .phase strong { font: 13px Georgia, serif; white-space: nowrap; }
.game-hud .phase small { font-size: 8px; margin-top: 2px; white-space: nowrap; }
.game-hud .phase.active { box-shadow: inset 0 -2px #d8bf7e; }
.game-hud .stats, .game-counters { display: flex; align-items: center; gap: 12px; margin: 0; flex-wrap: nowrap; min-width: 0; }
.game-hud .stat { padding-left: 12px; min-width: 0; }
.game-hud .stat:first-child { padding-left: 0; }
.game-hud .stat strong { font-size: 19px; line-height: 1.05; margin: 2px 0; }
.game-hud .stat small { font-size: 8px; white-space: nowrap; }
.game-hud .endround { font-size: 10px; padding: 8px 10px; white-space: nowrap; }
.game-main {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px;
  min-height: 0; min-width: 0; overflow: hidden; padding: 12px 16px 10px;
}
.game-board {
  position: relative; isolation: isolate; display: flex; flex-direction: column;
  min-width: 0; min-height: 0; overflow: hidden; padding: 10px 12px;
  border: 2px solid #738675; border-radius: 14px;
  /* The ground is the Card Engine's answer (--fu-board-scene, set by the shared runtime from consumer:foundation-up/board-backdrop);
     refused or unset, the board keeps its own gradient and no picture. */
  background: linear-gradient(108deg, #1d4339f2, #15333bf0), var(--fu-board-scene, none) center/cover;
  box-shadow: inset 0 0 40px #051e244d, 0 3px #263d37, 0 6px 12px #0004;
}
.board-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: 0 0 28px; min-width: 0; margin: 0 2px 6px; }
.board-heading h2 { font-size: 20px; line-height: 1.1; white-space: nowrap; }
.board-heading > div, .board-heading .board-actions { display: flex; gap: 7px; align-items: center; min-width: 0; }
.board-heading small { font-size: 9px; }
.board-heading button { padding: 4px 7px; font-size: 10px; }
.board-heading .pill { font-size: 9px; padding: 3px 6px; }
.game-board .layers, .game-board .board-layers { display: grid; grid-template-rows: repeat(5, minmax(0, 1fr)); gap: 6px; min-height: 0; flex: 1; }
.game-board .layer {
  display: grid; grid-template-columns: 48px 135px minmax(0, 1fr); align-items: center;
  gap: 10px; min-height: 0; flex: 1 1 0; margin: 0 0 6px; padding: 5px 10px;
  border: 1px solid #bed2b52b; border-radius: 8px;
  background: linear-gradient(105deg, #c8d6b410, #06202966); box-shadow: 0 2px #071e2266;
}
.game-board .layer:last-child { margin-bottom: 0; }
.game-board .layers > .layer, .game-board .board-layers > .layer { margin: 0; }
.game-board .layer > img { width: 45px; height: 45px; object-fit: contain; filter: drop-shadow(0 3px 3px #0006); }
.game-board .layer h3 { font-size: 15px; line-height: 1.1; margin: 2px 0; }
.game-board .layer .eyebrow { font-size: 7px; letter-spacing: .11em; }
.game-board .layer small { font-size: 9px; line-height: 1.25; }
.game-board .nodes {
  display: flex; align-items: center; align-content: flex-start; flex-wrap: nowrap; gap: 5px;
  min-width: 0; min-height: 0; max-height: 100%; overflow-x: auto; overflow-y: auto;
  padding: 3px 2px 4px; scrollbar-width: thin; scrollbar-color: #8db29955 transparent;
}
.game-board .node {
  flex: 0 0 auto; max-width: 175px; padding: 6px 8px; min-height: 30px;
  font-size: 10px; line-height: 1.25; border-radius: 5px; text-wrap: pretty;
  background: linear-gradient(135deg, #1f5148, #123b3d); border-color: #9abb8d66;
  box-shadow: 0 2px 2px #00191d33;
}
.game-board .node.active, .game-board .node[aria-pressed="true"], .game-board .node.selected { border-color: var(--gold); background: #ba9f5433; box-shadow: 0 0 0 1px #e3bc752b; }
.game-board .node strong, .game-board .node small { display: block; }
.game-board .node small { margin-top: 2px; font-size: 8px; }
.game-board .empty { font-size: 10px; line-height: 1.3; }
.game-board .layer.target { border-color: #e3bc7580; background: #e3bc7514; }
.game-board .layer.unavailable { opacity: .65; }
.game-inspector { min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.game-sidepanel {
  min-height: 0; min-width: 0; flex: 1; overflow: auto; overscroll-behavior: contain;
  padding: 13px; border: 1px solid var(--game-border); border-radius: 11px;
  background: linear-gradient(155deg, #1b3b40, #102a32); box-shadow: 0 3px 0 #071b20;
  scrollbar-width: thin; scrollbar-color: #8db29955 transparent;
}
.game-sidepanel h2 { font-size: 20px; line-height: 1.15; }
.game-sidepanel h3 { font-size: 17px; line-height: 1.2; margin: 5px 0 7px; }
.game-sidepanel p { font-size: 11px; line-height: 1.45; color: #becfc5; margin: 6px 0; }
.game-sidepanel .eyebrow { font-size: 8px; }
.game-sidepanel .inspect-art, .game-sidepanel .selected-art, .game-sidepanel > img, .game-sidepanel .hero { width: 96px; height: 96px; object-fit: contain; float: right; margin: 0 0 8px 10px; filter: drop-shadow(0 5px 4px #0005); }
.game-sidepanel .inspect-heading { min-height: 90px; }
.game-sidepanel .inspect-heading::after { display: table; content: ''; clear: both; }
.game-sidepanel .inspect-summary { font-size: 11px; line-height: 1.45; }
.game-sidepanel .notice { font-size: 10px; line-height: 1.4; padding: 8px; margin: 8px 0; }
.game-sidepanel .provenance { font-size: 9px; padding: 7px; margin-top: 8px; }
.game-sidepanel .source { font-size: 9px !important; }
.game-sidepanel .actions { gap: 5px; margin-top: 8px; }
.game-sidepanel .actions button { font-size: 10px; padding: 7px 9px; }
.game-sidepanel .field { margin: 8px 0; font-size: 10px; }
.game-sidepanel .field input, .game-sidepanel .field select { padding: 7px; margin-top: 4px; font-size: 11px; }
.action-row { display: flex; align-items: center; gap: 6px; margin-top: 9px; clear: both; }
.action-row button { flex: 1; padding: 8px 9px; font-size: 11px; }
.action-row button.small { flex: 0 0 auto; }
.target-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; clear: both; margin: 9px 0; }
.target-grid button { padding: 7px 2px; font-size: 9px; min-height: 34px; line-height: 1.2; border-radius: 6px; }
.target-grid button img { display: block; width: 24px; height: 24px; object-fit: contain; margin: 0 auto 4px; }
.target-grid button.active, .target-grid button[aria-pressed="true"] { color: var(--gold); border-color: var(--gold); background: #e3bc751c; }
.connection-option { display: flex; align-items: center; gap: 7px; padding: 7px 8px; width: 100%; margin: 5px 0; text-align: left; font-size: 10px; line-height: 1.3; border-radius: 6px; }
.connection-option strong, .connection-option small { display: block; }
.connection-option small { font-size: 9px; }
.mini-status { font-size: 10px; line-height: 1.4; padding: 7px 9px; border: 1px solid var(--game-border); border-radius: 7px; background: #0a232bb3; }
.mini-status:empty { display: none; }
.mini-status strong { color: var(--gold); }
.game-orgs { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; min-width: 0; }
.org-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; font-size: 9px; white-space: nowrap; border-radius: 5px; }
.org-chip img { width: 22px; height: 22px; object-fit: contain; }
.org-chip strong { font-weight: 600; }
.org-chip .coins { color: var(--gold); font-size: 11px; margin-left: 3px; }
.org-chip.active, .org-chip[aria-pressed="true"] { border-color: #e3bc75a6; background: #e3bc7515; }
.game-tray {
  position: relative; isolation: isolate; min-height: 0; min-width: 0; overflow: hidden;
  display: grid; grid-template-rows: 30px minmax(0, 1fr); padding: 0 16px 4px;
  border-top: 1px solid #d3bd776e;
  background: radial-gradient(ellipse at 50% 100%, #53715c3b, transparent 73%), linear-gradient(#0b2228, #07191f);
  box-shadow: 0 -6px 20px #00181b4d;
}
.tray-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; height: 30px; padding: 1px 4px 0; z-index: 4; }
.tray-head > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tray-head h2, .tray-head h3 { font: 16px Georgia, serif; white-space: nowrap; }
.tray-head small { font-size: 9px; }
.tray-head .eyebrow { font-size: 8px; }
.tray-head button { font-size: 10px; padding: 4px 8px; }
#shared-hand { position: relative; width: 100%; height: 100%; min-width: 0; min-height: 0; overflow: visible; }
/* The face below is Foundation Up content passed to the shared Hand. */
.fu-hand-face, .hand-face {
  display: flex; flex-direction: column; align-items: stretch; width: 100%; height: 100%;
  overflow: hidden; border: 1px solid #d2bb8b; border-radius: 7px;
  padding: 6%; color: #233b34; text-align: left;
  background: radial-gradient(ellipse at 30% 5%, #fff4da, #ded2b5); box-shadow: inset 0 0 0 2px #efe0ba;
}
.fu-hand-face img, .hand-face img { width: 56%; height: 44%; object-fit: contain; align-self: center; margin: 3% 0; filter: drop-shadow(0 2px 2px #324f3222); }
.fu-hand-face .eyebrow, .hand-face .eyebrow { color: #5a6957; letter-spacing: .03em; font-size: 7px; }
.fu-hand-face h3, .hand-face h3 { font: 600 11px/1.12 Georgia, serif; overflow-wrap: anywhere; }
.fu-hand-face p, .hand-face p { font-size: 7px; line-height: 1.25; margin-top: 3px; }
.fu-hand-face small, .hand-face small { color: #5a6957; font-size: 7px; line-height: 1.2; }
.fu-hand-face footer, .hand-face footer { margin-top: auto; padding-top: 3px; font-size: 7px; color: #536248; }
.game-tools { position: absolute; right: 10px; top: 44px; bottom: 10px; width: min(370px, calc(100% - 20px)); z-index: 10; overflow: auto; padding: 14px; border: 1px solid #98b29ba6; border-radius: 9px; background: #0e2b33f7; box-shadow: 0 15px 30px #0008; }
.game-tools h3 { font-size: 18px; }
.game-tools p, .game-tools .log { font-size: 11px; }
.game-tools .item { padding: 10px; margin-top: 7px; }
.game-tools .item h3 { font-size: 15px; }
.game-tools .item p { font-size: 10px; }
.game-tools .gaps { padding: 9px; margin-top: 9px; }
#modal { width: min(680px, calc(100vw - 28px)); max-height: calc(100dvh - 32px); padding: 23px; scrollbar-width: thin; scrollbar-color: #9ab69c66 transparent; }
#modal h2 { font-size: 25px; }
#modal p { line-height: 1.5; }
#binder-modal { position: fixed; inset: 20px; width: auto; max-width: none; height: calc(100vh - 40px); height: calc(100dvh - 40px); max-height: none; margin: 0; padding: 0; overflow: hidden; border-radius: 14px; background: #0c242d; }
#binder-modal[open] { display: flex; flex-direction: column; }
#binder-modal .binder-heading, #binder-modal .binder-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: 0 0 52px; padding: 10px 20px; border-bottom: 1px solid var(--game-border); }
#binder-modal h2 { font-size: 23px; margin: 0; }
#binder-modal .close { z-index: 15; }
#shared-binder { position: relative; flex: 1; min-width: 0; min-height: 0; overflow: hidden; }
/* THE CORNER BAND (@vf/game-kit 0.108.0): over an open panel the kit's control stands in the screen's leading top corner
   (shared-runtime's wayAroundIn mounts it in both panels), so each panel starts below it, as a kit layer's content does
   (.vfg-overlay--placed: the corner's offset, the control's 44px, a gap). The 44px is the kit's --vfg-target-comfort,
   which is scoped to .vfg-root and so is not readable on a dialog. */
:root { --fu-way-band: calc(var(--vf-space-5) + 44px + var(--vf-space-3)); }
#modal { inset-block: var(--fu-way-band) 0; max-height: calc(100dvh - var(--fu-way-band) - 16px); }
#binder-modal { top: var(--fu-way-band); height: calc(100dvh - var(--fu-way-band) - 20px); }
#toast { bottom: calc(var(--game-tray-height) + 12px); font-size: 12px; padding: 10px 16px; }
@media (min-width: 1500px) {
  :root { --game-tray-height: clamp(230px, 35vh, 310px); }
  .game-main { grid-template-columns: minmax(0, 1fr) 330px; padding: 14px 22px 12px; gap: 16px; }
  .game-board { padding: 12px 16px; }
  .game-board .layer { grid-template-columns: 58px 170px minmax(0, 1fr); gap: 12px; }
  .game-board .layer > img { width: 53px; height: 53px; }
  .game-board .layer h3 { font-size: 18px; }
  .game-board .node { max-width: 210px; font-size: 12px; padding: 8px 10px; }
  .game-sidepanel { padding: 17px; }
}
@media (max-width: 1080px) {
  .game-top { padding: 0 14px; }
  .game-hud { grid-template-columns: minmax(190px, .85fr) minmax(270px, 1.2fr) auto; gap: 9px; padding: 8px 14px; }
  .game-hud .stats, .game-counters { gap: 8px; }
  .game-hud .stat { padding-left: 8px; }
  .game-hud .phase { gap: 5px; padding: 7px 6px; }
  .game-main { grid-template-columns: minmax(0, 1fr) 274px; gap: 9px; padding: 10px 12px 9px; }
  .game-board { padding: 9px; }
  .game-board .layer { grid-template-columns: 40px 116px minmax(0, 1fr); gap: 7px; padding: 5px 7px; }
  .game-board .layer > img { width: 38px; height: 38px; }
  .game-board .layer h3 { font-size: 14px; }
  .game-sidepanel { padding: 11px; }
  .game-top .version { display: none; }
}
@media (max-width: 850px) {
  :root { --game-header-height: 48px; --game-hud-height: 90px; --game-tray-height: 180px; }
  .game-top h1 { font-size: 21px; }
  .game-top { gap: 8px; padding: 0 10px; }
  .game-top nav, .game-top .top-actions { gap: 4px; }
  .game-top button { font-size: 10px; padding: 6px 7px; }
  .game-hud { grid-template-columns: minmax(180px, 1fr) auto; grid-template-rows: 38px 32px; gap: 6px 10px; padding: 6px 12px 8px; }
  .game-goal, .goal-button { height: 37px; padding: 4px 8px; }
  .game-goal strong, .goal-button strong { font-size: 14px; }
  .game-goal .eyebrow, .goal-button .eyebrow { font-size: 7px; margin-bottom: 2px; }
  .game-hud .phasebar, .game-phases { grid-row: 2; grid-column: 1 / -1; }
  .game-hud .phase { min-height: 31px; padding: 5px 8px; justify-content: center; }
  .game-hud .phase .step { display: inline; font-size: 13px; }
  .game-hud .phase strong { font-size: 12px; }
  .game-hud .phase small { display: none; }
  .game-hud .stats, .game-counters { grid-column: 2; grid-row: 1; gap: 10px; }
  .game-hud .stat strong { font-size: 16px; }
  .game-hud .endround { padding: 6px 7px; }
  .game-main { grid-template-columns: minmax(0, 1fr) 235px; gap: 8px; padding: 8px; }
  .game-board { padding: 8px; border-radius: 10px; }
  .board-heading { gap: 5px; }
  .board-heading h2 { font-size: 17px; }
  .board-heading small { display: none; }
  .game-board .layer { grid-template-columns: 31px 91px minmax(0, 1fr); gap: 5px; padding: 4px 5px; }
  .game-board .layer > img { width: 30px; height: 30px; }
  .game-board .layer h3 { font-size: 12px; }
  .game-board .layer .eyebrow { font-size: 6px; }
  .game-board .layer small { font-size: 8px; }
  .game-board .nodes { grid-column: auto; }
  .game-board .node { max-width: 140px; font-size: 9px; padding: 5px 6px; }
  .game-sidepanel { padding: 10px; }
  .game-sidepanel h2 { font-size: 18px; }
  .game-sidepanel .inspect-art, .game-sidepanel .selected-art, .game-sidepanel > img, .game-sidepanel .hero { width: 74px; height: 74px; }
  .game-sidepanel .inspect-heading { min-height: 70px; }
  .game-tray { padding-inline: 8px; }
  .tray-head .game-orgs { gap: 3px; }
  .org-chip { padding: 3px 5px; font-size: 8px; gap: 3px; }
  .org-chip img { width: 18px; height: 18px; }
}
@media (max-width: 600px) {
  :root { --game-header-height: 45px; --game-hud-height: 86px; --game-tray-height: 178px; }
  .game-top .logo { display: none; }
  .game-top .eyebrow { font-size: 7px; }
  .game-top h1 { font-size: 19px; }
  .game-top nav { max-width: none; flex-wrap: nowrap; }
  .game-top button { font-size: 9px; padding: 6px; }
  .game-hud { grid-template-columns: minmax(135px, 1fr) auto; gap: 4px 6px; padding-inline: 8px; }
  .game-goal strong, .goal-button strong { font-size: 12px; }
  .game-hud .stats, .game-counters { gap: 6px; }
  .game-hud .stat { padding-left: 6px; }
  .game-hud .stat small { font-size: 7px; }
  .game-hud .stat strong { font-size: 15px; }
  .game-hud .endround { font-size: 8px; padding: 6px; }
  .game-main { grid-template-columns: minmax(0, 1fr) 155px; gap: 5px; padding: 6px; }
  .game-board { padding: 5px; border-width: 1px; }
  .board-heading { flex-basis: 25px; margin-bottom: 4px; }
  .board-heading h2 { font-size: 14px; }
  .board-heading button { font-size: 8px; padding: 3px 4px; }
  .board-heading .pill { display: none; }
  .game-board .layer { grid-template-columns: 25px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 1px 5px; padding: 4px 5px; margin-bottom: 4px; }
  .game-board .layer > img { width: 25px; height: 25px; }
  .game-board .layer h3 { font-size: 11px; }
  .game-board .layer .eyebrow { display: none; }
  .game-board .layer > div:not(.nodes) > small { display: none; }
  .game-board .nodes { grid-column: 1 / -1; padding: 2px 0; gap: 4px; }
  .game-board .node { padding: 3px 5px; min-height: 23px; max-width: 125px; font-size: 8px; }
  .game-board .empty { font-size: 8px; }
  .game-inspector { gap: 5px; }
  .game-sidepanel { padding: 8px; border-radius: 8px; }
  .game-sidepanel h2 { font-size: 15px; }
  .game-sidepanel h3 { font-size: 14px; }
  .game-sidepanel p { font-size: 9px; }
  .game-sidepanel .eyebrow { font-size: 7px; }
  .game-sidepanel .inspect-art, .game-sidepanel .selected-art, .game-sidepanel > img, .game-sidepanel .hero { float: none; display: block; width: 54px; height: 54px; margin: 0 auto 5px; }
  .game-sidepanel .inspect-heading { min-height: 0; }
  .target-grid { gap: 3px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .target-grid button { font-size: 8px; padding: 5px 2px; min-height: 29px; }
  .target-grid button img { width: 19px; height: 19px; }
  .action-row { flex-wrap: wrap; gap: 4px; margin-top: 6px; }
  .action-row button { padding: 6px 4px; font-size: 9px; }
  .mini-status { padding: 5px 6px; font-size: 8px; }
  .game-tray { padding-inline: 4px; }
  .tray-head { gap: 6px; padding-inline: 3px; }
  .tray-head h2, .tray-head h3 { font-size: 14px; }
  .tray-head small { display: none; }
  .tray-head button { font-size: 9px; padding: 4px 6px; }
  .org-chip { font-size: 7px; padding: 3px; }
  .org-chip img { display: none; }
  .org-chip .coins { font-size: 9px; margin-left: 1px; }
  #binder-modal { inset: 8px; top: var(--fu-way-band); height: calc(100dvh - var(--fu-way-band) - 8px); border-radius: 10px; }
  #binder-modal .binder-heading, #binder-modal .binder-head { padding: 8px 13px; flex-basis: 44px; }
  #binder-modal h2 { font-size: 19px; }
  #modal { padding: 18px; }
}
@media (max-height: 680px) and (min-width: 601px) {
  :root { --game-tray-height: 160px; --game-header-height: 46px; --game-hud-height: 58px; }
  .game-hud { padding-top: 5px; padding-bottom: 5px; }
  .game-main { padding-top: 8px; padding-bottom: 8px; }
  .game-board { padding-top: 7px; padding-bottom: 7px; }
  .board-heading { flex-basis: 25px; margin-bottom: 4px; }
  .game-board .layer { margin-bottom: 4px; }
  .game-board .layers, .game-board .board-layers { gap: 4px; }
  .game-board .layer > img { width: 34px; height: 34px; }
  .game-board .layer h3 { font-size: 13px; }
  .game-board .layer { padding-block: 3px; }
  .game-sidepanel .inspect-art, .game-sidepanel .selected-art, .game-sidepanel > img, .game-sidepanel .hero { width: 70px; height: 70px; }
  .game-sidepanel .inspect-heading { min-height: 68px; }
  .game-sidepanel p { margin: 4px 0; font-size: 10px; }
}
@media (max-height: 680px) and (min-width: 601px) and (max-width: 850px) {
  :root { --game-hud-height: 84px; }
}
@media (max-height: 560px) {
  :root { --game-tray-height: 144px; }
  .game-board .layer > img { width: 25px; height: 25px; }
  .game-board .layer .eyebrow, .game-board .layer > div:not(.nodes) > small { display: none; }
  .game-board .layer h3 { font-size: 11px; }
  .game-board .node { min-height: 24px; padding: 4px 6px; font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .game-shell *, .game-shell *::before, .game-shell *::after { scroll-behavior: auto !important; transition-duration: 0s !important; }
}

.binder-inspect{position:absolute;inset:0;z-index:20;background:#0c242df8;overflow:auto;padding:18px;text-align:center}.vfg-viewport{width:100%;}.game-tray .vfg-hand{height:100%;} .game-tray .vfg-hand__card{color:inherit;}

/* Consumer adapters for the concrete Foundation Up markup. */
.game-inspector.game-sidepanel{display:block;overflow:auto;}
.inspection-head,.inspection-title{display:flex;align-items:center;justify-content:space-between;gap:10px;}
.inspection-title{margin:8px 0;justify-content:flex-start;}
.inspection-title img{width:52px;height:60px;object-fit:contain;flex:0 0 auto;}
.inspection-title h2{font-size:20px;}
.inspection-links .connection-option{display:block;border:1px solid var(--game-border);}
.game-board .layer{grid-template-columns:45px 140px minmax(0,1fr) auto;}
.game-board .layer .target-button{grid-column:4;grid-row:1;padding:6px;font-size:9px;white-space:nowrap;}
.game-board .suggested-target{border-color:#e3bc75b0;background:#e3bc7515;}
@media(max-width:1050px){.game-board .layer{grid-template-columns:32px 110px minmax(0,1fr) auto;}}
@media(max-width:600px){.game-board .layer{grid-template-columns:25px 90px minmax(0,1fr);}.game-board .layer .target-button{grid-column:3;}.game-board .layer:has(.target-button) .nodes{display:none;}}

@media(min-width:900px) and (max-height:850px){.game-board .layer>img{width:32px;height:32px;}.game-board .layer h3{font-size:13px;margin:1px 0;}.game-board .layer small{font-size:7px;}.game-board .layer{grid-template-columns:36px 140px minmax(0,1fr) auto;padding-block:2px;}.game-board .layer-label{line-height:1;}}/* Readable evidence choices and retained consequences (first written for Complete Arc; the journey's tasks keep the .arc-task class). */
.text-link{display:inline!important;padding:0!important;border:0!important;background:none!important;color:#d9d7a1!important;text-decoration:underline;text-underline-offset:3px;font:inherit!important;white-space:normal!important}
.arc-task{padding:20px;border:1px solid #77918866;border-radius:12px;margin:14px 0;background:#102e35}.arc-task.complete{border-color:#b4ca85}.arc-task h3{font-size:21px;margin:12px 0}.arc-task p{line-height:1.6}.task-choices{display:grid;gap:10px;margin-top:16px}.task-choices button{text-align:left;padding:14px;min-height:48px;white-space:normal}.task-choices button:disabled{opacity:.45}.blocked{color:#ebc189;font-size:13px;line-height:1.5}.prerequisite{font-size:13px;line-height:1.8}.recent-event{border-left:2px solid #b4ca85;padding-left:10px;font-size:12px}.recent-event small{display:block;color:#bac9bf;margin-top:4px}.arc-result h2{font-size:25px}.game-inspector>.primary{width:100%;margin:8px 0}.game-inspector .item{padding:10px;margin:8px 0}.game-inspector .item h3{font-size:14px}.game-inspector .itemhead{display:block}.game-inspector .item button{white-space:normal}.next-task{font-size:10px;color:#d6d9c9;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.game-counters{gap:9px}.game-counters span{font-size:8px;white-space:nowrap}.game-counters b{display:block;font-size:17px}.game-phases button{font-size:11px;padding:8px 5px}.game-phases .active{border-color:#d8bf7e;background:#d8bf7e20}.game-orgs button{min-height:48px}#modalbody h2:focus{outline:none}#dialog-error{color:#ffc2a6}.log small{display:block}.arc-task .notice{overflow-wrap:anywhere;font-size:12px;max-height:180px;overflow:auto}
@media(min-width:1100px){.game-hud{grid-template-columns:minmax(180px,.8fr) minmax(260px,1fr) auto}.game-main{grid-template-columns:minmax(0,1fr) 350px}}
@media(max-width:760px){.game-hud{grid-template-columns:1fr}.game-goal{display:none}.game-shell{--game-hud-height:100px}.game-phases{grid-template-columns:repeat(3,1fr)}.game-counters{justify-content:space-between}.game-top{padding:0 8px}.game-top h1{font-size:16px}.game-top button{padding:7px;font-size:10px}.game-top .eyebrow{display:none}.next-task{display:none}.game-inspector{min-width:0}.game-orgs strong{font-size:10px}.game-orgs small{font-size:8px}}
.game-orgs .org-chip span strong,.game-orgs .org-chip span small{display:block;line-height:1.35}.game-orgs .org-chip span{padding-right:5px}.arc-task .notice{max-height:none;overflow:visible}.game-inspector .prerequisite{line-height:1.8}

/* ── Threshold, 2026-10-20 (Mirror's verdict 1a, 1b, 1d, 1e). Presentation only: no rule or behaviour changes here.
   · The board is three named bands: heading, layers, and a footer for the tools and who acts. The footer has its
     own row, so it can never sit on Layer 1 again; side by side where the width holds both.
   · A layer row is at least as tall as its label and its cards, and cards WRAP: nothing scrolls sideways inside a
     row. When five full rows are taller than the board, the layers band scrolls down inside the board's frame,
     with a visible bar. Nothing is hidden behind a clip.
   · The brand eyebrow is one line, so the header block never starts above the viewport.
   · The toast takes no pointer and sits under the HUD, away from the footer controls it used to cover. */
.game-board {
  display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "head head" "layers layers" "tools tools" "orgs orgs";
  row-gap: 6px; column-gap: 12px; align-content: stretch;
}
.game-board > .board-heading { grid-area: head; flex: none; margin: 0 2px; }
.game-board > .board-layers, .game-board > .layers { grid-area: layers; }
.game-board > .board-tools { grid-area: tools; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.game-board > .game-orgs { grid-area: orgs; align-self: center; }
@media (min-width: 1000px) {
  .game-board { grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "head head" "layers layers" "tools orgs"; }
  .game-board > .game-orgs { justify-content: flex-end; }
}
.game-board .layers, .game-board .board-layers {
  grid-template-rows: repeat(5, minmax(min-content, 1fr)); min-height: 0;
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: #8db299aa transparent; scrollbar-gutter: stable;
}
.game-board .layer { min-height: min-content; padding-block: 3px; }
.game-board .layer-label { min-width: 0; }
.game-board .layer h3 { overflow-wrap: break-word; }
.game-board .nodes { flex-wrap: wrap; overflow: visible; max-height: none; align-content: center; padding: 0; }
.game-board .node { max-width: min(100%, 290px); min-height: 26px; padding-block: 5px; white-space: normal; overflow-wrap: anywhere; }
.game-brand > span { min-width: 0; display: block; }
@media (min-width: 761px) { .game-top .eyebrow { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }
/* The message bar stands on the hand's own head, measured there by journey-app.js (placeToast): over the head's words,
   the key line and the fiction label, never over a control (Mirror's cold walk, finding 9). */
#toast { pointer-events: none; bottom: auto; transform: none; max-width: none; box-sizing: border-box; padding: 6px 12px; line-height: 1.35; }
/* Under 360px wide the hand's head leaves the bar about 184 x 92px beside a 14px "Draw context" (read live on dpl_CdZcBicc:
   the longest message ran 17px onto two cards at 320x568), so the bar's words sit tighter there, at the engine's 12px floor. */
@media (max-width: 359.98px) { #toast { font-size: 12px; padding: 4px 8px; line-height: 1.25; } }

/* ── Lathe, 2026-11-14. EVERY BAR BUTTON IS A 44PX TARGET: the bar's buttons stood 32 to 34px tall; the bar is 45 to
   52px tall, so the floor fits in it. (The journey is the game's one page since 2026-11-15; the phone board and bar
   rules that served Complete Arc and the restored table retired with them.) */
.game-top button { min-height: 44px; }
/* The tray's own buttons too ("Draw context"): 26px on the journey at a desk. The tray's head takes their height; the
   hand below solves its cards for whatever room is left, as it always has. */
.game-tray { grid-template-rows: auto minmax(0, 1fr); }
.tray-head { height: auto; min-height: 30px; }
.tray-head button { min-height: 44px; }
.tray-head .action-row { flex-wrap: nowrap; margin-top: 0; }
/* A device without keys shows none of the keys the tray's hint names (arrows, digits, Esc), and its width goes to the
   tray's buttons, which ran off the right edge at 390 beside it. The device decides, by the engine's one query: the hint
   carries data-vf-when="keys" (journey-app.js) and @vf/design-engine 0.187.0's tokens.css hides it wherever the primary
   pointer cannot hover or is not fine (@vf/game-kit 0.112.0; Threshold's ruling k112 section 2). No query here. */
