
/* The native look the island and the Ooga Chat app (src/ooga-chat/) share: the tokens, the cave-sign lettering, a
   panel's carved title, status chip, stone slab and amber primary button, and the Bananas panel (banana-panel.js).
   Both pages load it before their own stylesheet; scripts/build.mjs joins it ahead of style.css into the island's one
   style block. */

:root {
  color-scheme: dark;
  --bg: #0a0a0b;
  --fg: #ededea;
  --muted: #a6a6a2;
  --faint: #6f6f6c;
  --border: rgba(255, 255, 255, 0.09);
  --accent: #d8892b;
  --accent-text: #ffd9a0;
  --ok: #22c55e;
  --warn: #c9a44a;
  --danger: #e5533d;
  --paper: #f3efe4;
  --wood: #8a6236;
  --wood-dk: #5c4425;
  --plank: #a9773f;
  --wood-edge: #4a3319;
  --nail: #3a2a18;
  --stone: #3a3734;
  --stone-dk: #2d2b28;
  --stone-lt: #45413d;
  --ink: #2a1a0c;
  --ink-muted: rgba(42, 26, 12, 0.72);
  --ink-faint: rgba(42, 26, 12, 0.5);
  --planks: radial-gradient(circle at 9px 9px, var(--nail) 2.5px, transparent 3px), radial-gradient(circle at calc(100% - 9px) 9px, var(--nail) 2.5px, transparent 3px), radial-gradient(circle at 9px calc(100% - 9px), var(--nail) 2.5px, transparent 3px), radial-gradient(circle at calc(100% - 9px) calc(100% - 9px), var(--nail) 2.5px, transparent 3px), repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.05) 0 2px, transparent 2px 11px), repeating-linear-gradient(180deg, var(--plank) 0 34px, var(--wood-edge) 34px 36px, var(--wood) 36px 70px, var(--wood-edge) 70px 72px);
  /* The panels' dark sections, the reaction card, the banner's HUD buttons and every "tablet" box (tooltips, notes,
     fields, the games' HUDs), one near-black. */
  --slab-dark: #161412;
  --tablet: var(--slab-dark);
  --tablet-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 -2px 0 rgba(0, 0, 0, 0.35), 0 2px 0 rgba(0, 0, 0, 0.4);
  --radius: 8px;
  --mono: ui-monospace, "Cascadia Code", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  /* An installed web app has no browser toolbar. --home-chrome is how far the touch cluster can drop. */
  --home-chrome: 0px;
  --stick-inset: 96px;
  --stick-size: 112px;
  --act-inset: 64px;
  /* A touch drawer's default height in percent of the screen; sheet.js reads it. */
  --drawer-share: 24;
}

* {
  box-sizing: border-box;
}

/* The microphone dialog uses the voice-handoff title, slab and actions, and the same planked frame as the chat
   dialogs. Both apps load those shared rules; this dialog needs only its sizing and input layout here. */
.microphone-dialog {
  width: min(360px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 14px 16px 16px;
  border: 3px solid var(--wood-edge);
  border-radius: var(--radius);
  background: var(--planks);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.35);
  color: var(--paper);
  font: inherit;
}

.microphone-dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.microphone-dialog p { margin: 0; overflow-wrap: anywhere; }
.microphone-dialog .voice-handoff-body { display: grid; gap: 12px; }
.microphone-dialog label { display: grid; gap: 4px; font-size: 11px; }
.microphone-dialog [role="status"] { color: rgba(243, 239, 228, 0.78); font-size: 11px; }
.microphone-dialog select {
  width: 100%;
  min-width: 0;
  padding: 8px;
  border: 2px solid var(--stone-dk);
  border-radius: 6px;
  background: var(--tablet);
  color: var(--paper);
  font: inherit;
  font-size: 16px;
}
.microphone-dialog .foot-button { min-height: 40px; padding: 0 16px; }
.microphone-dialog select:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
@media (pointer: coarse) {
  .microphone-dialog .foot-button, .microphone-picker.foot-button { min-height: 44px; }
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

/* A carved title stays hidden until hud.js swaps its text for lettering (and labels it), so the
   fallback font never flashes while the page's scripts load. If the scripts never run, the plain
   text shows after a few seconds rather than never. */
[data-sign]:not([aria-label]) {
  visibility: hidden;
  animation: sign-fallback 0s 4s forwards;
}

@keyframes sign-fallback {
  to {
    visibility: visible;
  }
}

.sign {
  display: inline-block;
  height: 1em;
  width: auto;
  overflow: visible;
  vertical-align: -0.2em;
}

/* The island's panels share one shape: a carved title with a status chip, one stone slab that scrolls and
   takes every extra pixel of the drawer's height, and the panel's action pinned under it. The panel itself
   scrolls only when the drawer is shorter than its fixed parts (a phone's keyboard up). */
.panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding: 12px 14px 10px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.35) transparent;
}

.panel > .help { flex: none; margin: 0; }

.panel-title {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
}

.panel .panel-title h2 {
  margin: 0 auto 0 0;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.6));
}

.panel-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border: 1px solid rgba(243, 239, 228, 0.22);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.28);
  color: rgba(243, 239, 228, 0.72);
  font-size: 9px;
  line-height: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.panel-chip:empty { display: none; }

.panel-chip[data-tone="live"]::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 5px rgba(34, 197, 94, 0.55);
}

.panel-chip[data-tone="live"] { color: #bfeccb; border-color: rgba(34, 197, 94, 0.38); }
.panel-chip[data-tone="test"] { color: #ffd84a; border-color: rgba(255, 216, 74, 0.45); background: rgba(255, 216, 74, 0.08); }
.panel-chip[data-tone="wait"] { color: var(--accent-text); border-color: rgba(216, 137, 43, 0.42); }
.panel-chip[data-tone="closed"] { color: #ffb4a6; border-color: rgba(229, 83, 61, 0.45); }

.slab {
  background: var(--slab-dark);
  border: 2px solid var(--stone-dk);
  border-radius: 9px 7px 10px 8px;
  box-shadow: var(--tablet-shadow);
}

.panel > .slab {
  flex: 1 1 auto;
  min-height: 96px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(243, 239, 228, 0.2) transparent;
}

.slab-head {
  margin: 0;
  color: var(--accent-text);
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.6));
}

.feed-open,
.panel-primary {
  display: block;
  width: 100%;
  margin-top: 14px;
  min-height: 44px;
  padding: 0 12px;
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  background: linear-gradient(#e2a04a, var(--accent));
  color: var(--ink);
  font-size: 15px;
  box-shadow: 0 3px 0 var(--nail);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.panel-primary { flex: none; margin: 0; }

.feed-open .sign path,
.panel-primary .sign path {
  stroke: currentColor;
  stroke-width: 0.3;
}

.feed-open:hover,
.feed-open.virtual-hover,
.feed-open:focus-visible,
.panel-primary:hover,
.panel-primary.virtual-hover,
.panel-primary:focus-visible {
  background: linear-gradient(#f0b05a, #e2a04a);
  outline: none;
}

/* Bananas: the all-time total on top, its count and sats beneath, then the donors and the latest tips in the same
   slab. Like every panel's slab it scrolls above the panel's action, so Feed the Oogas stays at the foot as
   Contributor sign-in does; its sections never shrink, and each list scrolls inside its own window: the donors' five
   donor rows tall (`--banana-five`), the latest tips' at least as tall and taking whatever room the slab has left. The
   slab may shrink to nothing, so even a phone's short drawer keeps the action whole; only a drawer shorter than the
   title and the action scrolls the panel. */
.panel > .banana-slab {
  --banana-five: calc(5 * (17px + 12px + 1px));
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 12px 12px 10px;
}
.banana-slab > section { flex: none; }
.banana-slab > .banana-recent { flex: 1 0 auto; display: flex; flex-direction: column; }
.banana-leaders,
.banana-recent-list {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.45) transparent;
}
/* The donors' window holds five rows however few entries it has. The latest tips' is never shorter and grows into the
   slab's spare room, unless it holds nothing: then it keeps the donors' height with its note under it. */
.banana-leaders { height: var(--banana-five); }
.banana-recent-list { flex: 1 0 var(--banana-five); min-height: var(--banana-five); }
.banana-recent:has(> .banana-empty:not([hidden])) > .banana-recent-list { flex-grow: 0; }

/* The total's title over it, and the total with the banana beside it as tall as its figures, both flush left. */
.banana-hero {
  display: grid;
  row-gap: 4px;
  text-align: left;
}

.banana-hero-value {
  margin: 0;
  color: var(--accent-text);
  font-size: clamp(26px, 7vw, 34px);
  font-weight: 700;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
  overflow-wrap: anywhere;
}

/* On the figures' baseline and a cap height tall (the em fallback is about a cap). */
.banana-hero-icon {
  width: 0.72em;
  height: 0.72em;
  width: 1cap;
  height: 1cap;
  margin-right: 0.2em;
  vertical-align: baseline;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.45));
}

.banana-hero-label,
.banana-totals dt,
.banana-board-labels {
  color: rgba(243, 239, 228, 0.58);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.banana-totals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 0;
  padding-top: 10px;
  text-align: left;
}

.banana-totals,
.banana-rates,
.banana-board {
  border-top: 1px solid rgba(0, 0, 0, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.banana-totals div { min-width: 0; }

.banana-totals dd {
  margin: 3px 0 0;
  color: var(--paper);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* A banana's price in dollars and sats, then a bitcoin's in bananas, a line each, flush left. A stale price dims; the
   line says so on hover. */
.banana-rates {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding-top: 10px;
  text-align: left;
}

.banana-rate {
  min-width: 0;
  margin: 0;
  color: var(--paper);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.banana-rate[data-tone="stale"] { color: rgba(243, 239, 228, 0.6); }
/* The bitcoin line is measured on one line (banana-panel.js `fitBtcRate`) and wraps only when even "100M sats" will not fit. */
.banana-rate[data-fit="line"] { white-space: nowrap; }

/* The banana before an amount, as a currency's sign: an em square centred on the figures after it. */
.banana-rate-icon,
.banana-amount-icon {
  width: 1em;
  height: 1em;
  margin-right: 0.15em;
  vertical-align: -0.15em;
  vertical-align: calc((1cap - 1em) / 2);
}

.panel[data-panel="bananas"][data-unit="sats"] .banana-amount-icon { display: none; }

.banana-board { margin-top: 12px; padding-top: 12px; }

.banana-board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.banana-units {
  display: inline-flex;
  flex: none;
  padding: 2px;
  border: 1px solid rgba(0, 0, 0, 0.5);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.banana-units button {
  min-height: 24px;
  padding: 0 9px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: rgba(243, 239, 228, 0.66);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.banana-units button[aria-pressed="true"] {
  background: linear-gradient(#e2a04a, var(--accent));
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}

.banana-units button:not([aria-pressed="true"]):hover,
.banana-units button.virtual-hover:not([aria-pressed="true"]) {
  background: rgba(255, 255, 255, 0.07);
  color: var(--paper);
}

.banana-units button:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 1px; }

.banana-board-labels,
.banana-leaders li {
  display: grid;
  grid-template-columns: 3ch minmax(0, 1fr) auto;
  column-gap: 10px;
  align-items: baseline;
}

.banana-board-labels { margin-top: 10px; padding: 0 2px 5px; }
.banana-board-labels span:last-child { text-align: right; }

.banana-leaders { margin: 0; padding: 0; list-style: none; }
.banana-leaders li[hidden] { display: none; }

/* A row's 17px line, 12px of padding and 1px rule are the `--banana-five` unit. */
.banana-leaders li {
  padding: 6px 2px;
  border-top: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  font-size: 12px;
  line-height: 17px;
}

.banana-rank { color: rgba(243, 239, 228, 0.5); font-size: 10px; font-variant-numeric: tabular-nums; }
.banana-leaders li:nth-child(-n + 3) .banana-rank { color: var(--accent-text); }
/* A donor's name keeps to one line and ends in an ellipsis where it would not fit; hovering shows it whole. */
.banana-donor { min-width: 0; overflow: hidden; color: var(--paper); text-overflow: ellipsis; white-space: nowrap; }
.banana-donor[data-anon="true"] { color: rgba(243, 239, 228, 0.55); font-style: italic; }
.banana-amount { color: var(--paper); font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.banana-leaders li:first-child .banana-amount { color: var(--accent-text); }

.banana-recent { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(0, 0, 0, 0.4); }
.banana-recent-filter { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 11px; color: rgba(243, 239, 228, 0.7); cursor: pointer; }
.banana-recent-filter input { margin: 0; accent-color: var(--accent); }
.banana-recent-list { margin: 10px 0 0; padding: 0; list-style: none; }
.banana-recent-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: baseline;
  padding: 8px 2px;
  border-top: 1px solid rgba(0, 0, 0, 0.35);
  font-size: 12px;
}
/* The name and its check share one line, the check centred on the name's line rather than on its x-height; a name too
   long for it ends in an ellipsis before the check, and hovering shows it whole. */
.banana-recent-name { display: flex; align-items: center; min-width: 0; color: var(--paper); }
.banana-recent-name[data-anon="true"] { color: rgba(243, 239, 228, 0.55); font-style: italic; }
.banana-recent-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The orange check is a seal with a ridged rim (banana-panel.js `seal`). */
.banana-verified {
  display: inline-flex;
  flex: none;
  width: 13px;
  height: 13px;
  margin-left: 5px;
}
.banana-verified svg { width: 100%; height: 100%; }
.banana-verified-seal { fill: var(--accent); }
.banana-verified-tick { fill: none; stroke: #211b14; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.banana-recent-message { grid-column: 1 / -1; margin: 0; color: rgba(243, 239, 228, 0.7); overflow-wrap: anywhere; line-height: 1.4; }
.banana-recent-list li[hidden], .banana-verified[hidden], .banana-recent-message[hidden] { display: none; }

.banana-empty {
  margin: 0;
  padding: 14px 0 6px;
  color: rgba(243, 239, 228, 0.62);
  font-size: 10.5px;
  text-align: center;
}

.banana-board-note {
  margin: auto 0 0;
  padding-top: 12px;
  color: rgba(243, 239, 228, 0.48);
  font-size: 9.5px;
  line-height: 1.45;
}

@media (pointer: coarse) {
  .banana-units button { min-height: 40px; padding: 0 12px; }
}

/* Ooga Chat's mark (native-icons.js `cloud`) is drawn on 11 pixels where the other tab icons use 9, so it takes 11/9 of
   their box, reaching evenly into the tab's side padding, and its pixels match theirs. */
.sheet-toggle svg.cloud-icon,
.oc-tab svg.cloud-icon {
  flex: none;
  width: calc(100% * 11 / 9);
  margin: 0 calc(100% / -9);
}
/* Its outer dots: a pixel nearer the middle on a side-docked panel's tab, where the wide ones read too spread. */
.cloud-icon .cloud-near,
.sheet:not([data-dock="bottom"]) .cloud-icon .cloud-wide { display: none; }
.sheet:not([data-dock="bottom"]) .cloud-icon .cloud-near { display: inline; }

@media (display-mode: standalone) {
  :root { --home-chrome: 36px; }
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.4;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

/* An installed web app on iOS can lay out smaller than the screen under height: 100%; 100vh fills it. */
@media (display-mode: standalone) {
  html,
  body { height: 100vh; }
}

.stage {
  position: relative;
  width: 100%;
  height: 100%;
}

#scene,
#overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#scene {
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.carry-cursor-active #scene,
.aim-cursor-focused #scene {
  cursor: none !important;
}

.carry-cursor {
  position: fixed;
  left: 0;
  top: 0;
  width: 16px;
  height: 22px;
  overflow: visible;
  pointer-events: none;
  z-index: 30;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.55));
}

.carry-cursor svg {
  display: block;
  width: 100%;
  height: 100%;
}

#overlay {
  pointer-events: none;
}

.scanlines,
.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scanlines {
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.06) 0 1px, transparent 1px 4px);
}

.vignette {
  background: radial-gradient(ellipse at 50% 45%, transparent 58%, rgba(0, 0, 0, 0.5) 100%);
}

.curtain {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  pointer-events: none;
  background: #000;
  transition: opacity 0.9s ease;
}

.curtain[data-open="true"] { opacity: 0; }
.curtain-half, .curtain-label { visibility: hidden; }
.curtain[data-failed="true"] { pointer-events: auto; }
.curtain[data-failed="true"] .curtain-label { visibility: visible; }

.curtain-half {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: transform 0.9s cubic-bezier(0.7, 0, 0.3, 1);
  will-change: transform;
}

.curtain[data-open="true"] .curtain-half.left {
  transform: translateX(-62%);
}

.curtain[data-open="true"] .curtain-half.right {
  transform: translateX(62%);
}

.curtain-label {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 26px;
  border-radius: var(--radius);
  background: var(--planks);
  border: 3px solid var(--wood-edge);
  color: var(--paper);
  text-align: center;
  transition: opacity 0.25s ease;
}

.curtain-label b {
  font-size: 24px;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55);
}

#curtain-saying {
  padding: 5px 11px;
  border: 2px solid var(--stone-dk);
  border-radius: 9px 7px 10px 8px;
  background: var(--tablet);
  box-shadow: var(--tablet-shadow);
  color: var(--paper);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7);
}

.curtain-spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid rgba(243, 239, 228, 0.18);
  border-top-color: var(--accent);
  animation: curtain-spin 0.9s linear infinite;
}

.curtain[data-open="true"] .curtain-label {
  opacity: 0;
}

@keyframes curtain-spin {
  to {
    transform: rotate(360deg);
  }
}

.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: calc(10px + var(--safe-top)) calc(16px + var(--safe-right)) 10px calc(16px + var(--safe-left));
  background: linear-gradient(rgba(10, 10, 11, 0.92), rgba(10, 10, 11, 0.55) 80%, transparent);
  pointer-events: none;
}

.topbar>* {
  pointer-events: auto;
}

.brand h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
  color: var(--paper);
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.6));
}

.home-link {
  color: inherit;
  text-decoration: none;
}

body[data-active-scene="hub"] .home-link {
  cursor: default;
}

.brand p {
  margin: 2px 0 0;
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.world-clock {
  position: absolute;
  top: calc(10px + var(--safe-top));
  right: 0;
  left: 0;
  width: 5em;
  height: 1em;
  margin: 0 auto;
  color: var(--paper);
  text-align: center;
  font-size: 22px;
  line-height: 1;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.6));
  pointer-events: none;
}

.world-clock .sign {
  display: block;
  width: 100%;
  height: 100%;
  vertical-align: 0;
}

.world-block {
  position: absolute;
  top: calc(37px + var(--safe-top));
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--faint);
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}

.presets {
  grid-column: 3;
  display: flex;
  gap: 6px;
}

.presets[data-scene="hub"] {
  grid-column: 2 / -1;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.presets button,
.sheet-toggle {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.presets button {
  min-height: 28px;
  padding: 0 12px;
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  background: linear-gradient(var(--plank), var(--wood));
  color: var(--paper);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
  box-shadow: 0 3px 0 var(--nail);
}

.presets[data-scene="hub"] button {
  min-width: 44px;
  min-height: 34px;
  padding: 0 10px;
  white-space: nowrap;
}

.presets button:hover,
.presets button.virtual-hover,
.presets button:focus-visible {
  background: linear-gradient(#b8844a, var(--plank));
  outline: none;
}

.presets .leave {
  color: var(--paper);
}

.presets [data-action="mute"][aria-pressed="true"] {
  color: var(--muted);
  text-decoration: line-through;
}

.presets .leave:hover,
.presets .leave.virtual-hover,
.presets .leave:focus-visible {
  color: #ffb554;
}

.sheet {
  --sheet-chat-top: 143px;
  --sheet-chat-left: 144px;
  position: fixed;
  top: calc(52px + var(--safe-top));
  right: 0;
  height: var(--sheet-height, 520px);
  max-height: calc(100% - 90px - var(--safe-top) - var(--safe-bottom));
  width: 380px;
  max-width: calc(100vw - 32px - var(--safe-left) - var(--safe-right));
  display: flex;
  flex-direction: column;
  isolation: isolate;
  border-radius: var(--radius);
  color: var(--paper);
  transition: transform 0.28s ease;
}

/* The opaque body covers the retracted tabs, including their inner borders. */
.sheet-body {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--planks);
  border: 3px solid var(--wood-edge);
  border-radius: inherit;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.35);
  /* With the panel's own 10px, room for a footer button's 3px drop shadow and then the same 10px seen above it. */
  padding-bottom: 3px;
  transition: visibility 0s;
  overflow: auto;
}

.sheet-content {
  flex: 1;
  min-height: 96px;
  display: flex;
  flex-direction: column;
}

.sheet[data-open="false"] {
  transform: translateX(100%);
  pointer-events: none;
}
.sheet[data-dock="left"][data-open="false"] { transform: translateX(-100%); }
.sheet[data-open="false"] .sheet-body { visibility: hidden; transition-delay: 0.28s; }
.sheet[data-open="false"] .sheet-toggle { pointer-events: auto; }

/* Scrolling game panels keep a thin wooden scrollbar instead of the platform's grey one. */
.garage,
.orbit-parts,
.orbit-stack {
  scrollbar-width: thin;
  scrollbar-color: var(--wood-edge) rgba(0, 0, 0, 0.25);
}

.garage::-webkit-scrollbar,
.orbit-parts::-webkit-scrollbar,
.orbit-stack::-webkit-scrollbar {
  width: 8px;
}

.garage::-webkit-scrollbar-thumb,
.orbit-parts::-webkit-scrollbar-thumb,
.orbit-stack::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: var(--wood-edge);
}

/* The one thing a new player should press next glows until they press it. */
[data-hint="yes"] {
  animation: panel-hint 1.2s ease-in-out infinite alternate;
}

@keyframes panel-hint {
  from {
    box-shadow: 0 2px 0 var(--nail), 0 0 0 0 rgba(245, 197, 66, 0);
  }

  to {
    box-shadow: 0 2px 0 var(--nail), 0 0 14px 3px rgba(245, 197, 66, 0.75);
  }
}

/* A game's side panels fold away with their fold button and come back from a wooden tab on the
   screen's edge. The tab is the panel's next sibling and shows only while the panel is folded. */
.fold-panel {
  transition: transform 0.25s ease;
}

.fold-left[data-folded="true"] {
  transform: translateX(calc(-100% - 24px - var(--safe-left)));
}

.fold-right[data-folded="true"] {
  transform: translateX(calc(100% + 90px + var(--safe-right)));
}

.panel-fold {
  position: absolute;
  top: 0;
  right: 0;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--paper);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.panel-fold:hover,
.panel-fold:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.panel-fold-inline {
  position: static;
  flex: none;
}

.orbit-head,
.panel-head {
  position: relative;
}

.orbit-head .panel-fold ~ h2 {
  padding-right: 32px;
}

.panel-head {
  min-height: 26px;
}

/* A panel's title: paper, larger, spaced. A section heading inside a panel is the smaller muted label
   with a rule under it (see .section-head), so the two never read as the same thing. */
.panel-head h3 {
  margin: 4px 0 0;
  color: var(--paper);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
}

.section-head {
  margin: 0 0 6px;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.panel-edge {
  position: absolute;
  top: calc(96px + var(--safe-top));
  padding: 14px 6px;
  border: 3px solid var(--wood-edge);
  background: var(--planks);
  color: var(--paper);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.panel-edge-left {
  left: calc(0px + var(--safe-left));
  border-left: 0;
  border-radius: 0 8px 8px 0;
}

.panel-edge-right {
  right: calc(0px + var(--safe-right));
  border-right: 0;
  border-radius: 8px 0 0 8px;
}

.fold-panel:not([data-folded="true"]) + .panel-edge,
.fold-panel[hidden] + .panel-edge {
  display: none;
}

@media (max-width: 720px) {
  .fold-left[data-folded="true"],
  .fold-right[data-folded="true"] {
    transform: translateY(calc(100% + 24px));
  }

  .panel-edge {
    top: auto;
    bottom: calc(0px + var(--safe-bottom));
    padding: 6px 14px;
    writing-mode: horizontal-tb;
    border: 3px solid var(--wood-edge);
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
  }
}

/* Block Frenzy draws its own play HUD, Sound button and "All controls" list, so the banner's block height and its
   `.mode-hud` buttons (character, sound and the controls reference, which has no rows for this scene) stay out of it;
   its panels are hidden through the HUD (`setPanelsHidden`), as every game's are. */
body[data-active-scene="block"] .world-block,
body[data-active-scene="block"] .mode-hud {
  display: none;
}

.sheet-toggle {
  position: absolute;
  z-index: 0;
  top: 71px;
  left: -41px;
  width: 41px;
  height: 64px;
  margin-top: 0;
  padding: 0;
  border: 0;
  background: none;
  outline: none;
  touch-action: none;
}

/* Keep the whole tab clickable while its face slides behind the panel body. A side tab's face has a border only on
   its outer side and meets the panel's own border (or the screen's edge) on the other, so even padding centres the
   artwork between the two in both side docks; each icon's viewBox centres its own pixels. */
.sheet-tab-face {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  pointer-events: none;
  padding: 0 3px;
  border: 3px solid var(--wood-edge);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: linear-gradient(90deg, var(--wood), var(--wood-dk));
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
  transform: translateX(var(--sheet-tab-slide, 0px));
  opacity: var(--sheet-tab-opacity, 1);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.sheet-toggle-bananas {
  top: 7px;
  margin-top: 0;
  height: 56px;
}

.sheet-toggle:hover .sheet-tab-face,
.sheet-toggle.virtual-hover .sheet-tab-face,
.sheet-toggle:focus-visible .sheet-tab-face {
  background: linear-gradient(90deg, var(--plank), var(--wood));
}

.sheet-panels { display: contents; }
.sheet-toggle-chat { top: var(--sheet-chat-top); height: 56px; }
.sheet-toggle svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.5)); }
.sheet[data-open="true"] .sheet-toggle[aria-selected="true"] .sheet-tab-face { background: linear-gradient(90deg, #b8844a, var(--plank)); }
.sheet-toggle:focus-visible .sheet-tab-face { outline: 2px solid var(--accent); outline-offset: -3px; }
.sheet-toggle .tab-count { position: absolute; bottom: 3px; right: 3px; margin: 0; }

.sheet-drag, .sheet-corner, .sheet-edge {
  margin: 0; padding: 0; border: 0; border-radius: 0;
  background: transparent; color: var(--paper); touch-action: none; user-select: none;
}
.sheet-drag { position: absolute; z-index: 3; top: 6px; left: 16px; right: 16px; height: 12px; cursor: grab; }
.sheet-drag:active { cursor: grabbing; }
.sheet-edge { position: absolute; z-index: 3; }
.sheet-edge-n, .sheet-edge-s { left: 16px; right: 16px; height: 6px; cursor: ns-resize; }
.sheet-edge-n { top: 0; }
.sheet-edge-s { bottom: 0; }
.sheet-edge-w, .sheet-edge-e { top: 16px; bottom: 16px; width: 6px; cursor: ew-resize; }
.sheet-edge-w { left: 0; }
.sheet-edge-e { right: 0; }
.sheet-corner { position: absolute; z-index: 3; width: 16px; height: 16px; }
.sheet-corner-nw { left: 0; top: 0; cursor: nwse-resize; }
.sheet-corner-ne { right: 0; top: 0; cursor: nesw-resize; }
.sheet-corner-sw { left: 0; bottom: 0; cursor: nesw-resize; }
.sheet-corner-se { right: 0; bottom: 0; cursor: nwse-resize; }
.sheet-corner::after { content: ""; position: absolute; inset: 4px; border-color: var(--muted); border-style: solid; border-width: 0; }
.sheet-corner-nw::after { border-left-width: 2px; border-top-width: 2px; }
.sheet-corner-ne::after { border-right-width: 2px; border-top-width: 2px; }
.sheet-corner-sw::after { border-left-width: 2px; border-bottom-width: 2px; }
.sheet-corner-se::after { border-right-width: 2px; border-bottom-width: 2px; }
.sheet-drag:focus-visible, .sheet-corner:focus-visible, .sheet-edge:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.sheet[data-open="false"] :is(.sheet-drag, .sheet-corner, .sheet-edge) { display: none; }

/* Untouched panels dock at the bottom on smaller screens. */
.sheet[data-dock="bottom"] {
  top: auto;
  left: 0;
  right: 0;
  bottom: var(--chat-keyboard, 0px);
  width: 100%;
  max-width: none;
  height: var(--sheet-height, 52vh);
  max-height: max(0px, calc(var(--chat-viewport, 100vh) - 74px - var(--safe-top)));
  border-radius: var(--radius) var(--radius) 0 0;
}

.sheet[data-dock="bottom"] .sheet-body {
  border-bottom: 0;
  padding-bottom: calc(3px + var(--safe-bottom));
  box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.35);
}

.sheet[data-dock="bottom"][data-open="false"] { transform: translateY(100%); }
.sheet[data-dock="bottom"][data-open="true"]:not([hidden])~.joysticks,
.sheet[data-dock="bottom"][data-open="true"]:not([hidden])~.bottom-hud>.act { display: none; }

/* On a touch screen the drawer stays at the foot of the screen and pushes the sticks and the act button up
   over its tabs, so the roster of who's talking stays up while the visitor keeps walking. sheet.js writes a resized drawer's --drawer-height, and takes data-sticks away
   from one too tall to leave them room: they step aside as before, as they do for the chat's keyboard. */
@media (pointer: coarse) {
  :root {
    --drawer-clear: 51px;
    --drawer-height: min(calc(var(--drawer-share) * 1vh), calc(100dvh - var(--stick-size) - var(--drawer-clear) - 86px - var(--safe-top)));
  }

  .joysticks,
  .bottom-hud { --drawer-lift: calc(var(--drawer-height) + var(--drawer-clear)); }

  .sheet[data-dock="bottom"][data-sized="false"] { height: var(--drawer-height); }

  .sheet[data-dock="bottom"][data-sticks="true"][data-open="true"]:not([hidden])~.joysticks,
  .sheet[data-dock="bottom"][data-sticks="true"][data-open="true"]:not([hidden])~.bottom-hud>.act { display: block; }

  .sheet[data-dock="bottom"][data-sticks="true"][data-open="true"]:not([hidden])~.joysticks .joystick { bottom: var(--drawer-lift); }
  .sheet[data-dock="bottom"][data-sticks="true"][data-open="true"]:not([hidden])~.bottom-hud>.act {
    bottom: calc(var(--drawer-lift) + var(--act-inset) - var(--stick-inset));
  }

  .sheet[data-dock="bottom"][data-sticks="true"][data-open="true"][data-keyboard]:not([hidden])~.joysticks,
  .sheet[data-dock="bottom"][data-sticks="true"][data-open="true"][data-keyboard]:not([hidden])~.bottom-hud>.act { display: none; }
}

/* Past 720px the act button stands in the bottom stack, so the stack rides up instead. */
@media (pointer: coarse) and (min-width: 721px) {
  .sheet[data-dock="bottom"][data-sticks="true"][data-open="true"]:not([hidden])~.bottom-hud { bottom: var(--drawer-lift); }
}

.sheet[data-dock="bottom"] .sheet-toggle {
  top: -39px;
  left: 72px;
  width: 64px;
  height: 39px;
}

.sheet[data-dock="bottom"] .sheet-tab-face {
  padding: 2px 18px 0;
  border: 3px solid var(--wood-edge);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(var(--wood), var(--wood-dk));
  transform: translateY(var(--sheet-tab-slide, 0px));
}

.sheet[data-dock="bottom"] .sheet-toggle-bananas { left: 0; }
.sheet[data-dock="bottom"] .sheet-toggle-bananas .sheet-tab-face { padding: 4px 18px 0; }
.sheet[data-dock="bottom"] .sheet-toggle-chat { left: var(--sheet-chat-left); }

/* Every panel touches an edge; its tabs face inward and fit with its body. */
.sheet:is([data-dock="left"], [data-dock="right"]) .sheet-toggle { top: calc(7px + var(--sheet-tab-index, 0) * 64px); height: 56px; }
.sheet[data-dock="bottom"] .sheet-toggle { left: calc(var(--sheet-tab-index, 0) * 72px); }
.sheet[data-dock="left"] .sheet-toggle { left: auto; right: -41px; }
.sheet[data-dock="left"] .sheet-tab-face {
  border-left: 0; border-right: 3px solid var(--wood-edge); border-radius: 0 8px 8px 0;
  transform: translateX(calc(-1 * var(--sheet-tab-slide, 0px)));
}
.sheet[data-sized="true"] {
  position: fixed; right: auto; bottom: auto; max-width: none; max-height: none;
}
.sheet[data-sized="true"]:not([data-dock="bottom"]) .sheet-toggle {
  top: calc(7px + var(--sheet-tab-index, 0) * var(--sheet-tab-step, 64px));
  height: calc(var(--sheet-tab-step, 64px) - 8px);
}
.sheet[data-sized="true"][data-dock="bottom"] .sheet-toggle {
  left: calc(var(--sheet-tab-index, 0) * var(--sheet-tab-step, 72px));
  width: min(64px, var(--sheet-tab-step, 72px));
}
/* A phone's closed tabs lie along the foot of the screen, clear of its rounded corner. */
@media (pointer: coarse) {
  .sheet[data-dock="bottom"] .sheet-toggle {
    left: calc(16px + var(--safe-left) + var(--sheet-tab-index, 0) * var(--sheet-tab-step, 72px));
    width: min(64px, var(--sheet-tab-step, 72px));
  }
  .sheet[data-sized="true"][data-dock="bottom"] .sheet-toggle {
    left: calc(16px + var(--safe-left) + var(--sheet-tab-index, 0) * var(--sheet-tab-step, 72px));
  }
}
.sheet[data-sized="true"] .sheet-toggle svg { max-height: 100%; }

/* A phone's drawer keeps a small tab at the far right: up opens or lifts it, down closes it. */
.sheet-expand { display: none; }
@media (pointer: coarse) and (max-width: 720px), (pointer: coarse) and (max-height: 500px) {
  .sheet[data-dock="bottom"] .sheet-expand {
    display: block;
    position: absolute;
    top: -30px;
    right: calc(10px + var(--safe-right));
    width: 44px;
    height: 30px;
    padding: 0;
    border: 3px solid var(--wood-edge);
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(var(--wood), var(--wood-dk));
    color: var(--paper);
    cursor: pointer;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
}
.sheet-expand svg { display: block; width: 16px; height: 16px; margin: auto; }
.sheet-expand[data-dir="down"] svg { transform: rotate(180deg); }
.sheet.sheet-moving { transition: none; }
.sheet.sheet-tab-drag { opacity: 0.7; }
.sheet-merge-target .sheet-body,
.sheet-merge-target .sheet-tab-face { outline: 2px solid var(--accent-text); outline-offset: -2px; }

/* Open: hidden at rest, fully out on panel or fixed tab-area hover.
   Closed panels and touch devices keep the whole tab. */
@media (hover: hover) and (pointer: fine) {
  .sheet[data-open="true"] { --sheet-tab-slide: 100%; --sheet-tab-opacity: 0; }
  .sheet[data-open="true"]:is(:hover, .virtual-hover) { --sheet-tab-slide: 0px; --sheet-tab-opacity: 1; }
  .sheet-panels:hover,
  .sheet-panels:has(.virtual-hover, :focus-visible) { --sheet-tab-slide: 0px; --sheet-tab-opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet,
  .sheet-body,
  .sheet-tab-face { transition: none !important; }
}

.presets button:focus-visible,
.actions button:focus-visible,
.link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.tab-count {
  display: inline-block;
  min-width: 16px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #111;
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: 0;
}

.sheet-notifications { position: relative; flex: none; }
.sheet-bell {
  position: relative;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  /* The browser's button padding would leave the bell's track 12px wide and push the 16px bell right. */
  padding: 0;
  border: 1px solid rgba(243, 239, 228, 0.28);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  color: var(--accent-text);
  cursor: pointer;
}
/* The viewBox starts a quarter unit down, lifting the stroked bell (2 to 14.5) onto the circle's middle. */
.sheet-bell svg { display: block; width: 16px; height: 16px; pointer-events: none; }
.sheet-bell .tab-count { position: absolute; top: -5px; right: -8px; pointer-events: none; }
.sheet-bell:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sheet-unread {
  position: absolute;
  z-index: 3;
  top: calc(100% + 5px);
  right: 0;
  width: max-content;
  max-width: min(240px, calc(100vw - 32px));
  margin: 0;
  padding: 4px 9px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: #241810;
  color: #f3efe4;
  font-size: 11px;
  line-height: 1.6;
  list-style: none;
  overflow-wrap: anywhere;
  pointer-events: none;
}
.sheet-unread li { display: flex; align-items: flex-start; gap: 7px; padding: 2px 0; }
.sheet-unread li[hidden] { display: none; }
.sheet-unread li + li { border-top: 1px solid rgba(243, 239, 228, 0.14); }
/* A line's mark, in a column as tall as its first line of text: a dot for a sign-in or sign-out, The Commons' icon for
   messages. The count of earlier lines keeps the column, empty, and the empty list has none. */
.sheet-unread-mark { flex: none; display: grid; place-items: center; width: 10px; height: 1.6em; }
.sheet-unread-mark::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.sheet-unread-mark svg { display: none; width: 10px; height: 10px; }
.sheet-unread [data-kind="in"] .sheet-unread-mark::before { background: #22c55e; }
.sheet-unread [data-kind="out"] .sheet-unread-mark::before { background: var(--danger); }
.sheet-unread [data-kind="chat"] .sheet-unread-mark::before { content: none; }
.sheet-unread [data-kind="chat"] .sheet-unread-mark svg { display: block; }
.sheet-unread [data-kind="none"] .sheet-unread-mark { display: none; }
@media (pointer: coarse) {
  .sheet-bell { width: 40px; height: 40px; }
}

.roster-hint:not(:has(> :not([hidden]))) { display: none; }

/* A phone on its side leaves the default drawer under 100px: too short to stack the title, a row of the slab and a
   44px Feed the Oogas. While the Bananas panel shows there, its untouched drawer stands at least 200px tall
   (sheet.js's BANANA_DRAWER, which also holds a resized or saved drawer to it and, that drawer too tall to leave the
   sticks room over it, takes data-sticks away). Other panels keep their drawer. */
@media (pointer: coarse) and (orientation: landscape) and (max-height: 500px) {
  :root:has(#sheet[data-dock="bottom"][data-sized="false"] #bananas-panel:not([hidden])) {
    --drawer-height: max(calc(var(--drawer-share) * 1vh), 200px);
  }
}
/* Ooga Chat: the log takes the height, the composer is pinned under it, and the account's name and the
   room's memory sit above it in one line each. */
.panel[data-panel="chat"] > .panel-title { position: relative; }
.panel[data-panel="chat"] > .panel-title h2 { margin-right: 0; }
.chat-about { flex: none; margin-right: auto; }

.chat-about summary,
#players-diagnostics-info {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(243, 239, 228, 0.28);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  color: rgba(243, 239, 228, 0.72);
  font-size: 11px;
  line-height: 1;
  list-style: none;
  cursor: pointer;
}

.chat-about summary::-webkit-details-marker { display: none; }
.chat-about[open] summary,
.chat-about summary:hover,
#players-diagnostics-info[aria-expanded="true"],
#players-diagnostics-info:hover { border-color: var(--accent); color: var(--accent-text); }
.chat-about summary:focus-visible,
#players-diagnostics-info:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.chat-retention {
  position: absolute;
  z-index: 2;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 7px 10px;
  border-left: 2px solid var(--accent);
  border-radius: 0 6px 6px 0;
  background: #241810;
  color: rgba(243, 239, 228, 0.9);
  font-size: 10px;
  line-height: 1.5;
}

.chat-identity {
  flex: none;
  display: grid;
  gap: 4px;
}

.chat-display-form { display: flex; align-items: center; gap: 6px; min-width: 0; }

.chat-display-form label {
  flex: none;
  color: rgba(243, 239, 228, 0.58);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.chat-display-form input {
  flex: 1;
  width: 80px;
  min-width: 0;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid rgba(0, 0, 0, 0.5);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--paper);
  font-size: 12px;
  outline: none;
}

.chat-display-form input:focus-visible { border-color: var(--accent); }
.chat-display-form input:disabled { opacity: 0.55; }

.chat-display-save {
  flex: none;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--wood-edge);
  border-radius: 5px;
  background: linear-gradient(var(--plank), var(--wood));
  color: var(--paper);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.chat-display-save:hover:not(:disabled),
.chat-display-save:focus-visible { background: linear-gradient(#b8844a, var(--plank)); outline: none; }
.chat-display-save:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.chat-display-save:disabled { opacity: 0.5; cursor: default; }

.chat-display-status { margin: 0; color: var(--accent-text); font-size: 10px; }
.chat-display-status:empty { display: none; }

.chat-log {
  list-style: none;
  margin: 0;
  padding: 2px 10px;
}

.chat-log:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.chat-log:empty::before {
  content: "Nobody has said anything yet.";
  display: block;
  padding: 14px 0;
  color: rgba(243, 239, 228, 0.55);
  font-size: 10.5px;
  text-align: center;
}

.chat-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  column-gap: 6px;
  align-items: baseline;
  padding: 7px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.chat-row:first-child { border-top: 0; box-shadow: none; }

.chat-name {
  min-width: 0;
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.chat-login-name { min-width: 0; color: rgba(243, 239, 228, 0.45); font-size: 9.5px; overflow-wrap: anywhere; }
.chat-time { color: rgba(243, 239, 228, 0.42); font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.chat-text {
  grid-column: 1 / -1;
  margin-top: 2px;
  color: var(--paper);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

/* The visitor's own lines: a green rule down their edge and a green name. */
.chat-row[data-own="true"] {
  margin-left: -10px;
  padding-left: 8px;
  border-left: 2px solid rgba(34, 197, 94, 0.7);
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.07), transparent 60%);
}

.chat-row[data-own="true"] .chat-name { color: #8fe3a8; }

.chat-announcement { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.panel .chat-status {
  flex: none;
  margin: 0;
}

.chat-form {
  display: flex;
  flex: none;
  align-items: stretch;
  gap: 8px;
}

.chat-field { position: relative; display: flex; flex: 1; min-width: 0; }

.chat-form input {
  flex: 1;
  min-width: 0;
  padding-right: 46px;
}

.chat-form input:disabled {
  opacity: 0.55;
}

.chat-left {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  color: rgba(243, 239, 228, 0.5);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.chat-left[data-over="true"] {
  color: var(--danger);
}

.chat-send {
  flex: none;
  min-height: 38px;
  padding: 0 14px;
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  background: linear-gradient(#e2a04a, var(--accent));
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 3px 0 var(--nail);
  cursor: pointer;
}

.chat-send:hover:not(:disabled),
.chat-send:focus-visible {
  background: linear-gradient(#f0b05a, #e2a04a);
  outline: none;
}

.chat-send:focus-visible { box-shadow: 0 3px 0 var(--nail), 0 0 0 2px var(--accent-text); }

.chat-send:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Private conversations (#188): a switch between the island's chat and the private one, which has its own blue tint
   and lock, so a line meant for one person is never typed into the island's by mistake. */
.pm-switch { display: flex; flex: none; gap: 6px; }
.pm-switch[hidden] { display: none; }
.pm-switch-button {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--wood-edge);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.22);
  color: rgba(243, 239, 228, 0.72);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}
.pm-switch-button[aria-pressed="true"] { border-color: var(--accent); background: rgba(216, 137, 43, 0.12); color: var(--accent-text); }
.pm-switch-button[data-pm-view="private"][aria-pressed="true"] { border-color: #7aa8e8; background: rgba(90, 140, 220, 0.16); color: #cfe0ff; }
.pm-switch-button:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 1px; }
.pm-switch .pm-count { position: static; margin: 0 0 0 2px; }
.pm-lock { flex: none; width: 9px; height: 10px; }
/* As the partner's row lock shows it (private-chat.js): amber while an invite or the pad waits, blue once sealed. */
.pm-switch-button[data-lock="waiting"] .pm-lock, .pm-title[data-lock="waiting"] .pm-lock { color: var(--warn); }
.pm-switch-button[data-lock="sealed"] .pm-lock { color: #9fbfee; }

.pm { display: none; flex: 1 1 auto; flex-direction: column; gap: 6px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.pm [hidden] { display: none; }
.panel[data-panel="chat"][data-view="private"] .pm { display: flex; }
.panel[data-panel="chat"][data-view="private"] > :is(.chat-identity, .chat-log, .chat-status, .chat-form),
.panel[data-panel="chat"][data-view="private"] > .panel-title > .chat-about { display: none; }
/* Without the island's About button, the title itself keeps the room's chip and the bell at the right. */
.panel[data-panel="chat"][data-view="private"] > .panel-title h2 { margin-right: auto; }
/* Ooga Chat (cloud-panel.js), the last tab, and Ooga Chat's own (the app takes these rules): one roster
   of circles, as many to a row as fit at 76 px or more a column (six in a 600 px panel) (speakers, then listeners) scrolling in its slab, the emoji bar and the footer. A speaker's
   portrait carries a 3px ring past a 3px dark gap, green for the island, purple for Ooga Chat. A name keeps to one line, cut short with its whole self in its title. */
.sheet-toggle-cloud { height: 56px; }
.cloud-status [hidden] { display: none; }
.panel > .cloud-roster {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); align-content: start; gap: 10px 4px; margin: 0; padding: 14px 8px;
  overflow-y: auto; overscroll-behavior: contain; list-style: none; container-type: inline-size;
}
/* A tile (audience-tiles.js): the portrait with its ring and the hand or a reaction over its centre, at three quarters of
   its size, the name, and the role under it after a speaker's microphone. A tile out of sight skips its layout and paint.
   An emoji font draws its glyph a little above the middle of its line, so the overlay's top padding brings its ink down
   onto the circle's centre. */
.cloud-tile {
  --face: 40px;
  display: flex; flex-direction: column; align-items: center; min-width: 0; padding: 6px 0 2px; border-radius: 6px;
  content-visibility: auto; contain-intrinsic-block-size: auto 88px;
}
.cloud-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cloud-face { position: relative; flex: none; margin-bottom: 10px; }
.cloud-portrait {
  display: flex; align-items: center; justify-content: center; width: var(--face); height: var(--face); overflow: hidden;
  border-radius: 50%; background: var(--stone-dk); box-shadow: 0 0 0 2px var(--stone-lt);
}
.cloud-tile[data-source="world"] .cloud-portrait { box-shadow: 0 0 0 3px var(--slab-dark), 0 0 0 6px #22c55e; }
.cloud-tile[data-source="chat"] .cloud-portrait { box-shadow: 0 0 0 3px var(--slab-dark), 0 0 0 6px #b18aff; }
.cloud-portrait > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cloud-portrait > svg { display: block; width: 62%; height: auto; shape-rendering: crispEdges; }
.cloud-react {
  position: absolute; inset: 0; display: grid; place-items: center; padding-top: 0.09em;
  font-size: calc(var(--face) * 0.75); line-height: 1; pointer-events: none;
}
.cloud-hand { grid-area: 1 / 1; }
/* The pop (reaction-bar.js) rises 7px as it goes and fades over its last quarter, so what the eye follows is the first
   three quarters: started 3.25px low, it crosses the circle's centre a fifth of the way through and spends the rest of
   its bright time above it. Under Calm it only fades, so it stays centred. */
.cloud-pop { position: absolute; inset: 0; display: grid; place-items: center; padding-top: inherit; translate: 0 3.25px; pointer-events: none; }
.cloud-pop[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) {
  .cloud-pop { translate: none; }
}
.cloud-name { display: flex; align-items: center; justify-content: center; gap: 4px; max-width: 100%; color: var(--paper); font-size: 10px; font-weight: 700; }
.cloud-name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cloud-role { display: flex; align-items: center; gap: 4px; margin-top: 2px; color: rgba(243, 239, 228, 0.62); font-size: 9px; white-space: nowrap; }
.cloud-role .roster-voice svg { width: 10px; height: 10px; }
.cloud-mic[hidden] { display: none; }
.cloud-foot { display: flex; flex: none; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; }
.cloud-foot-name { min-width: 0; color: var(--paper); font-size: 11px; font-weight: 600; overflow-wrap: anywhere; }
.cloud-foot-name:empty { display: none; }
.cloud-foot-name[data-source="island"]::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 5px rgba(34, 197, 94, 0.55); vertical-align: 1px;
}
.cloud-foot-name[data-source="chat"]::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #b18aff; vertical-align: 1px;
}
/* The voice buttons, then the visitor's name with Sign out beside it on a line of its own under them, as every account row
   has it, in a chat too. */
.cloud-foot-who { display: inline-flex; flex: 1 1 100%; align-items: center; justify-content: center; gap: 10px; min-width: 0; }
.cloud-foot-who:not(:has(> :not([hidden]):not(:empty))) { display: none; }
.cloud-foot-actions { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; }
.cloud-foot-actions .foot-button { white-space: nowrap; }
/* Every panel's voice buttons, the island's and Ooga Chat's, at one width, the widest's, so no footer shifts: Mute or
   Unmute (shown and off until in voice) beside Join or Leave voice (and Joining…, Leaving…), wider only for a longer
   reason (Reconnecting voice). */
.cloud-mute, .cloud-voice, .account-mute, .account-voice, .account-leave, .account-end { min-width: 100px; padding: 0 8px; }
.cloud-foot-actions [hidden] { display: none; }
/* The voice switch prompt (voice-handoff.js), the island's and Ooga Chat's alike: a planked card floating under the
   banner, over the panels, that takes no focus by itself; Not now beside the amber Switch here. */
.voice-handoff {
  position: fixed; top: calc(76px + env(safe-area-inset-top, 0px)); left: 50%; z-index: 990; transform: translateX(-50%);
  box-sizing: border-box; width: 340px; max-width: calc(100vw - 32px); padding: 14px 16px 16px;
  border: 3px solid var(--wood-edge); border-radius: var(--radius); background: var(--planks);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.35); color: var(--paper);
}
.voice-handoff[hidden] { display: none; }
.voice-handoff-title { margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5); }
.voice-handoff-body { margin: 0 0 12px; padding: 9px 12px; background: var(--slab-dark); border: 2px solid var(--stone-dk); border-radius: 9px 7px 10px 8px; box-shadow: var(--tablet-shadow); font-size: 12px; line-height: 1.45; }
.voice-handoff-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
@media (pointer: coarse) {
  .cloud-mic { padding: 6px; margin: -6px; }
}

.pm-head { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 8px; }
.pm-head .pm-end { min-height: 24px; }
.pm-title { display: flex; align-items: center; gap: 6px; min-width: 0; margin: 0; color: #cfe0ff; font-size: 11px; font-weight: 600; overflow-wrap: anywhere; }
.pm .pm-note, .pm .pm-budget { flex: none; margin: 0; white-space: pre-line; }
.pm .pm-note:empty, .pm .pm-budget:empty { display: none; }
.pm-actions { display: flex; flex: none; flex-wrap: wrap; align-items: center; gap: 6px; }
.pm-actions[hidden] { display: none; }
.pm-button {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--wood-edge);
  border-radius: 5px;
  background: linear-gradient(var(--plank), var(--wood));
  color: var(--paper);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  cursor: pointer;
}
.pm-button:hover, .pm-button:focus-visible, .pm-file:focus-within { background: linear-gradient(#b8844a, var(--plank)); outline: none; box-shadow: 0 0 0 2px var(--accent); }
.pm-button:disabled { opacity: 0.5; cursor: default; }
.pm-quiet { background: rgba(0, 0, 0, 0.22); color: rgba(243, 239, 228, 0.78); }
.pm-file input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; }
.pm-make { display: inline-flex; gap: 6px; }
.pm-make select {
  min-height: 30px;
  padding: 0 6px;
  border: 1px solid rgba(0, 0, 0, 0.5);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--paper);
  font-size: 11px;
}
.pm-print { flex: none; margin: 0; color: rgba(243, 239, 228, 0.72); font-size: 10px; overflow-wrap: anywhere; }
.pm-print[hidden] { display: none; }
.pm-print code { color: #cfe0ff; font-size: 10.5px; letter-spacing: 0.02em; white-space: nowrap; }
.pm-log { flex: 1 1 auto; min-height: 44px; overflow: auto; overscroll-behavior: contain; border-color: rgba(90, 140, 220, 0.55); }
.pm-log:empty::before { content: "Sealed with your pad: only the two of you can read what is said here. The island passes it on and sees who talks to whom, when, and how long each line is."; }
.pm-log .chat-row[data-own="true"] { border-left-color: rgba(122, 168, 232, 0.8); background: linear-gradient(90deg, rgba(90, 140, 220, 0.1), transparent 60%); }
.pm-log .chat-row[data-own="true"] .chat-name { color: #cfe0ff; }
.pm-log .chat-row[data-note="true"] .chat-text { color: rgba(243, 239, 228, 0.62); font-size: 10.5px; }
/* The page's own notes carry no name, so a display name can never pass for one. */
.pm-note-tag { color: rgba(243, 239, 228, 0.5); font-size: 8.5px; letter-spacing: 0.1em; text-transform: uppercase; }
.pm-state { color: rgba(243, 239, 228, 0.5); font-size: 9px; white-space: nowrap; }
.pm-state[data-failed="true"] { color: #ffb4a6; }
.pm-retry { min-height: 22px; margin-left: 6px; padding: 0 6px; font-size: 8.5px; }
.pm-form .chat-send { background: linear-gradient(#a9c6f2, #6f9be0); }

@media (pointer: coarse) {
  .chat-send,
  .chat-form input { min-height: 44px; }
  .chat-display-form input,
  .chat-display-save { min-height: 40px; }
  .chat-about summary,
  #players-diagnostics-info { width: 30px; height: 30px; }
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--paper);
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.5));
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.panel-head h2 {
  margin-bottom: 8px;
}

.help {
  margin: 12px 0 0;
  color: rgba(243, 239, 228, 0.62);
  font-size: 10.5px;
  line-height: 1.5;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}

.modal {
  width: 340px;
  max-width: calc(100vw - 32px);
  margin: auto;
  padding: 16px 18px 18px;
  border: 3px solid var(--wood-edge);
  border-radius: var(--radius);
  background: var(--planks);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.35);
  color: var(--paper);
  font: inherit;
}

/* Every modal closes with the same X, sized as a target rather than a word. */
.modal-close {
  flex: none;
  width: 28px;
  height: 28px;
  margin: -4px -4px 0 0;
  padding: 0;
  color: var(--paper);
  background: rgba(0, 0, 0, 0.22);
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  font: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover,
.modal-close.virtual-hover,
.modal-close:focus-visible {
  background: rgba(0, 0, 0, 0.38);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.donation-popup {
  width: 440px;
  max-height: calc(100dvh - 32px);
  overflow: auto;
}

/* The kiosk draws the name and message on its own screen. These fields only take the typing, so they stay in the
   page, focusable, a phone's keyboard able to open on them, but out of sight; 16px keeps iOS from zooming in. */
#donation-fields {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

#donation-fields input { font-size: 16px; }

#donation-screen {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  border-radius: 6px;
}

#donation-screen:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.modal h2 {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--paper);
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.5));
}

.modal .panel-head h2 {
  margin-bottom: 12px;
}

.help.empty {
  margin: 6px 0 0;
  padding: 14px;
  background: var(--tablet);
  border: 2px solid var(--stone-dk);
  border-radius: 9px 7px 10px 8px;
  box-shadow: var(--tablet-shadow);
  text-align: center;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.stat {
  padding: 10px 8px;
  background: var(--tablet);
  border: 2px solid var(--stone-dk);
  border-radius: 9px 7px 10px 8px;
  box-shadow: var(--tablet-shadow);
  text-align: center;
}

.stat b {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.1;
}

.stat span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* How Contributing Oogas are ordered, over the list (hud.js). */
.roster-sort {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.roster-sort-label {
  color: rgba(243, 239, 228, 0.78);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.roster-sort select {
  min-width: 0;
  min-height: 26px;
  padding: 0 6px;
  border: 1px solid rgba(0, 0, 0, 0.5);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--paper);
  font-size: 11px;
  cursor: pointer;
}

.roster-sort select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

@media (pointer: coarse) {
  .roster-sort select { min-height: 40px; }
}

/* One row an Ooga: presence, name, the player's marks, activity age and state, each in a column of its own
   so a long name ends in an ellipsis inside its cell and a mark or state coming and going never moves the others.
   The voice mark's column is the mark's own width, so the age follows it closely and the name keeps the room. */
.roster {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) 12px max-content 6.5ch;
  grid-auto-rows: max-content;
  column-gap: 6px;
  align-content: start;
  list-style: none;
  margin: 0;
  padding: 2px 10px;
}

.roster li {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  column-gap: 8px;
  align-items: center;
  min-height: 22px;
  padding: 6px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  font-size: 12px;
}

.roster li > .roster-name { padding-left: 2px; }

.roster li:first-child {
  border-top: 0;
  box-shadow: none;
}

.roster-away button {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 30px;
  border: 1px dashed rgba(243, 239, 228, 0.24);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.18);
  color: rgba(243, 239, 228, 0.7);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.roster-away button:hover,
.roster-away button.virtual-hover {
  border-color: var(--accent);
  color: var(--paper);
}

.roster-away button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

@media (pointer: coarse) {
  .roster-away button { min-height: 44px; }
}

/* The host's outlined black dot sits behind the online dot, sharing its centre without moving the row's name. */
.roster-dots {
  position: relative;
  display: flex;
  justify-content: center;
}

.roster-dots .roster-host {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.roster-presence {
  position: relative;
  z-index: 1;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(166, 166, 162, 0.45);
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.35);
}

.roster-presence[data-online="true"] {
  background: var(--ok);
  box-shadow: 0 0 5px rgba(34, 197, 94, 0.55);
}

/* An Ooga Chat speaker on a cloud (players.js): Ooga Chat's purple where a player's dot is green. */
.roster-presence[data-online="cloud"] {
  background: #b18aff;
  box-shadow: 0 0 5px rgba(177, 138, 255, 0.6);
}

/* An Ooga Chat listener on Main Island (players.js, and Ooga Chat's Online Oogas): in gray, dot and name. */
.roster-presence[data-online="listener"] {
  background: var(--faint);
  box-shadow: none;
}
.players-listener .roster-label { color: var(--muted); }

/* The name, on one line and cut short with an ellipsis where it would not fit, filling its cell: a button, with no
   caret, that opens the row onto a darker strip under it (the contributor's stats here, a player's volume in Online
   Oogas). */
.roster-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--paper);
  font: inherit;
  text-align: left;
}

.roster-name:disabled {
  cursor: default;
}

.roster-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-name:not(:disabled) {
  cursor: pointer;
}

.roster-name:not(:disabled):hover,
.roster-name:not(:disabled).virtual-hover,
.roster-name[aria-expanded="true"] {
  color: var(--accent-text);
}

.roster-name:not(:disabled):hover .roster-label,
.roster-name:not(:disabled).virtual-hover .roster-label {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.roster-name:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (pointer: coarse) {
  .roster-name:not(:disabled) {
    padding: 6px 0;
    margin: -6px 0;
  }
}

/* A contributor's stats (hud.js `openStats`): their Ooga's face at the left with their total and first contribution
   side by side next to it, then the kinds and a chip a repository with their count there across the whole strip, under
   the face too. The facts keep to one line while they fit (`data-fit="line"`, hud.js `fitSince`). */
.roster-stats {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 40px minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 5px;
  align-items: start;
  margin: 6px -6px 0;
  padding: 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.28);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.roster-stats[hidden] {
  display: none;
}

.roster-stats-face {
  grid-row: 1;
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
}

.roster-stats-facts {
  display: flex;
  flex-wrap: wrap;
  align-self: center;
  gap: 2px 14px;
  margin: 0;
}

.roster-stats-facts[data-fit="line"] { flex-wrap: nowrap; }

.roster-stats-facts dt {
  color: var(--muted);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.roster-stats-facts dd {
  margin: 1px 0 0;
  color: var(--paper);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.roster-stats-kinds {
  grid-column: 1 / -1;
  margin: 0;
  color: rgba(243, 239, 228, 0.72);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.roster-stats-kinds[hidden] { display: none; }
.roster-stats-kinds span { white-space: nowrap; }
/* Comments and merges: activity, outside the contribution total, after the kinds on their line. */
.roster-stats-also { color: var(--muted); }

.roster-stats-repos {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  gap: 4px;
}

.roster-stats-repos a {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 2px 6px;
  border: 1px solid rgba(243, 239, 228, 0.16);
  border-radius: 999px;
  background: rgba(243, 239, 228, 0.05);
  color: var(--paper);
  font-size: 10px;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.roster-stats-repos b {
  color: var(--accent-text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.roster-stats-repos a:hover,
.roster-stats-repos a.virtual-hover {
  border-color: var(--accent);
}

.roster-stats-repos a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.roster-stats-none {
  color: var(--muted);
  font-size: 10px;
}

/* A signed-in player's voice keeps a column of its own after the name (grey in voice, green speaking, red
   muted at their end; the slash is this visitor's own mute, which a click on the mark toggles). */
.roster-marks {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.roster-host[hidden],
.roster-voice[hidden] {
  display: none;
}

.roster-host {
  flex: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #000;
  box-shadow: 0 0 0 1px var(--paper);
}

.roster-voice {
  display: inline-flex;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.roster-voice svg {
  width: 12px;
  height: 12px;
}

.roster-voice:disabled {
  cursor: default;
}

/* A voice link (net.js `voiceLink`): pale stone with nothing asked, pulsing amber while this visitor's ask waits, green once linked. */
.players-link {
  display: inline-flex;
  padding: 0;
  border: 0;
  background: none;
  color: #dcd8cb;
  cursor: pointer;
}
.players-link[hidden] { display: none; }
/* In a hosted chat's voice (players.js `call`, call-v1): Ooga Chat's purple cloud where the voice mark would stand. */
.call-mark { display: inline-flex; }
/* The island's emoji bar is its room's: with hosted chats on it stands in the list of chats (cloud-panel.js `data-space`,
   "list"), over the visitor's Ooga as in every other tab, and gives way to the chat's own bar in a chat. */
#cloud-panel[data-space="on"] #cloud-reactions { display: none; }
#cloud-panel:not([data-space="on"]) #cloud-chat-reactions { display: none; }
.call-mark[hidden] { display: none; }
.call-mark svg { width: 12px; height: 12px; shape-rendering: crispEdges; }
.players-link svg { width: 11px; height: 11px; shape-rendering: crispEdges; }
.players-link:hover, .players-link:focus-visible { color: #fff; outline: none; }
.players-link:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.players-link[data-link="asked"] { color: #ffa51f; }
.players-link[data-link="asked"]:is(:hover, :focus-visible) { color: #ffd27a; }
.players-link[data-link="asked"] svg { animation: players-link-wait 2s ease-in-out infinite; }
.players-link[data-link="linked"] { color: #35ff7e; }
.players-link[data-link="linked"]:is(:hover, :focus-visible) { color: #a4ffc4; }
@keyframes players-link-wait { 50% { opacity: 0.5; } }
@media (prefers-reduced-motion: reduce) {
  .players-link[data-link="asked"] svg { animation: none; }
}

.roster-voice:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* A short fade only as speech ends; new sound and mute changes take their colour immediately. */
.roster-voice[data-voice="on"][data-voice-fade="true"] {
  transition: color 0.25s ease-out;
}

.roster-voice[data-voice="speaking"] {
  color: var(--ok);
}

.roster-voice[data-voice="muted"] {
  color: var(--danger);
}

/* The microphone (native-icons.js `mic`): hollow in voice; speaking, its capsule fills from the bottom with the voice's
   level (`--lv`, written by the page each meter read, eased between reads, full where no level is known); crossed out
   when muted or silenced here. */
.roster-voice .mic-level { transform: scaleY(0); transition: transform 0.05s linear; }
.roster-voice[data-voice="speaking"] .mic-level { transform: scaleY(var(--lv, 1)); }
.roster-voice .mic-gap,
.roster-voice .mic-slash { display: none; }
.roster-voice:is([data-voice="muted"], [aria-pressed="true"]) :is(.mic-gap, .mic-slash) { display: inline; }

.roster-voice[aria-pressed="true"] {
  opacity: 0.55;
}

/* A voice this visitor cannot hear where they stand (another zone, or past the hearing range), in Online Oogas. */
.roster-voice[data-far="true"] {
  opacity: 0.45;
}

@media (prefers-reduced-motion: reduce) {
  .roster-voice[data-voice="on"][data-voice-fade="true"], .roster-voice .mic-level { transition: none; }
}

@media (pointer: coarse) {
  .roster-voice,
  .players-link {
    padding: 6px;
    margin: -6px;
  }
}

/* The live players tab (players.js): a group a zone under its heading, and a row a player with the roster's marks,
   the crosshair that turns the camera and, for players in the visitor's zone, how far away they stand. Each cell keeps
   its column, so a hidden crosshair or an empty distance never moves the others. */
.players {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px;
}

.players[hidden] {
  display: none;
}

/* After the name: the raised hand, the voice link, the voice mark and the crosshair, four columns of one width (the
   voice mark's) with each icon centred in its own, then the distance against the row's right edge. Every group is a
   grid of its own, so no column may size to its content: the icons line up down the whole tab, the visitor's own row
   too, whoever shows a hand, a link, a voice mark or a distance. The distance cell is always as wide as "999 m"
   (`.players-distance`), so the name keeps every other pixel. The gap spaces the items after the name; the name takes
   back the extra beside its dot. Every cell sits on the row's first line; a player's volume, under it. */
.players-rows {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) 12px 12px 12px 12px max-content;
  column-gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.players-rows li {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: center;
  min-height: 22px;
  padding: 6px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  font-size: 12px;
}

.players-rows li:first-child {
  border-top: 0;
  box-shadow: none;
}

.players-rows li > * { grid-row: 1; }
.players-rows li > .players-volume { grid-row: 2; }
.players-rows .roster-dots { grid-column: 1; }
.players-rows .roster-marks { display: contents; }
.players-rows .players-link { grid-column: 4; grid-row: 1; justify-self: center; }
.players-rows .roster-voice { grid-column: 5; grid-row: 1; justify-self: center; }

.players-name {
  display: inline-flex;
  grid-column: 2;
  margin-left: -7px;
  align-items: center;
  min-width: 0;
  color: var(--paper);
}

/* The raised hand's column. A reaction (players.js) pops up in the same place, over the hand when one is raised, and
   fades. An emoji is wider than the column and stays centred on it, spilling into the gaps either side, so nothing
   moves when a reaction comes and goes. */
.players-mark {
  display: grid;
  grid-column: 3;
  grid-template-columns: 12px;
  width: 12px;
  place-items: center;
}

.players-mark > * { grid-area: 1 / 1; }

.players-hand {
  font: 13px/1 "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.players-react {
  position: relative;
  z-index: 1;
  font: 16px/1 "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  pointer-events: none;
}

/* A player's own disclosure keeps volume apart from mute and camera targeting. */
.players-volume {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(0, 1fr) 5ch;
  align-items: center;
  column-gap: 8px;
  margin-top: 6px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.players-volume[hidden] { display: none; }

/* In Ooga Chat (players.js): a button a chat, its title wrapping and its counts under it. */
.players-rows li.players-chat { display: block; padding: 0; }
.players-chat-open {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 38px;
  padding: 6px 4px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--paper);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.players-chat-open:hover, .players-chat-open.virtual-hover { background: rgba(255, 255, 255, 0.05); }
.players-chat-open:focus-visible { outline: 2px solid var(--accent-text); outline-offset: -2px; }
.players-chat-title { font-size: 12px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.players-chat-counts { color: rgba(243, 239, 228, 0.78); font-size: 11px; }
.players-chat-here { color: var(--accent-text); font-size: 11px; font-weight: 700; }
.players-chat-here[hidden] { display: none; }
@media (pointer: coarse) {
  .players-chat-open { min-height: 44px; }
}
/* A chevron at the row's end says it opens something: the chat's preview. */
.players-chat-open { grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; }
.players-chat-open > * { grid-column: 1; }
.players-chat-open::after {
  content: "\203A"; grid-column: 2; grid-row: 1 / span 2; align-self: center; padding-right: 4px;
  color: rgba(243, 239, 228, 0.45); font-size: 20px; font-weight: 700; line-height: 1;
}
.players-chat-open:is(:hover, :focus-visible, .virtual-hover)::after { color: var(--accent-text); }

/* Change chats? (cloud-panel.js `openChat`): the question on a slab, Stay and the amber Switch chats under it. */
.hosted-switch { width: 360px; }
.hosted-switch-slab { display: grid; gap: 8px; padding: 12px; }
.hosted-switch-text { margin: 0; font-size: 12px; line-height: 1.45; color: rgba(243, 239, 228, 0.88); overflow-wrap: anywhere; }
.hosted-switch-note { margin: 0; font-size: 11px; line-height: 1.4; color: rgba(243, 239, 228, 0.7); }
.hosted-switch-note:empty { display: none; }
.hosted-switch-go { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 4px; }
@media (max-width: 399px) {
  .hosted-switch-go .foot-button { min-height: 44px; flex: 1 1 auto; }
}

.players-volume-range {
  width: 100%;
  min-width: 0;
  height: 32px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.players-volume-value {
  justify-self: end;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.players-look {
  display: inline-flex;
  grid-column: 6;
  justify-self: center;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.players-look[hidden] {
  display: none;
}

.players-look svg {
  width: 12px;
  height: 12px;
  shape-rendering: crispEdges;
}

.players-look:not([aria-disabled="true"]):hover,
.players-look:not([aria-disabled="true"]).virtual-hover {
  color: var(--accent-text);
}

.players-look:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.players-look[aria-disabled="true"] {
  opacity: 0.35;
  cursor: default;
}

/* Every row has this cell, empty or not, at the width of "999 m" in the panel's monospace face, numbers to the right so
   their units line up: the column it makes is the same in every group. */
.players-distance {
  grid-column: 7;
  width: 5ch;
  text-align: right;
  color: var(--paper);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* A player who let go of their Ooga: where they last stood, in red, said in words too. */
.players-distance[data-known="last"] {
  color: var(--danger);
}

.players-note {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.players-note[hidden] {
  display: none;
}

/* A player at or beyond the visitor's hearing range. */
.players-distance[data-far="true"] {
  opacity: 0.45;
}

/* The hearing range (#380): its label, the slider and the range in metres on one line, a short note under them. */
.players-hearing {
  flex: none;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(8ch, auto);
  align-items: center;
  column-gap: 8px;
}

.players-hearing[hidden] {
  display: none;
}

/* Opt-in speech for joins (#430): a checkbox labelled as the hearing range is. */
.players-speak {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  color: rgba(243, 239, 228, 0.72);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}

.players-speak[hidden] {
  display: none;
}

.players-speak input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Reactions (reactions.js), on X Spaces' pattern in its dark mode: a near-black card, the ten emoji, a divider and the
   raised hand pinned past it, over the account row of every panel that has one, on the island and in Ooga Chat's app
   alike. The ten stand in one row where the panel is wide enough for them (the bar's own width, a container query);
   where not, in one row that scrolls sideways beside the hand, narrower cells on the narrowest, its edge fading under a
   chevron while more lie past it (reaction-bar.js). The card stops at 560px, centred, so a wide drawer's ten
   stay together. A long press opens the picker floating over the screen, in the same dark. Emoji are the
   system's own colour glyphs. */
.reactions {
  container: reactions / inline-size;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

/* In a panel's foot the card stands at the panel's own padding and gap, in every panel of both apps: 8px off the panel's
   sides and 6px from the list over it and the account row under it. */
.panel-foot > .reactions { margin: 0; }

.reactions[hidden] { display: none; }

/* The foot of every panel with the emoji bar, on the island and in Ooga Chat's app alike: the bar over the account row
   (the name in a row with the buttons while they fit), or, once the foot is wide enough for both, the bar's one row
   and the account row side by side, centred together. */
.panel-foot {
  container: panel-foot / inline-size;
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 16px;
}

/* The island's panels keep as tight as Ooga Chat's (ooga-chat.css `.oc-panel`): 6px over and under and 8px at the sides,
   their parts 6px apart, so every slab, the emoji bar and the footer share one width and one margin. */
.sheet-content > .panel { gap: 6px; padding: 6px 8px; }
.panel-foot > * { flex: 1 1 100%; min-width: 0; }
.panel-foot > .account { flex: 1 1 100%; width: auto; }

@container panel-foot (min-width: 960px) {
  .panel-foot > * { flex: 0 1 auto; }
  .panel-foot > .account { flex: 0 1 auto; }
  .panel-foot > .reactions { flex-basis: 560px; }
}

.reaction-bar {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 560px;
  margin-inline: auto;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(243, 239, 228, 0.1);
  background: var(--slab-dark);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 4px 14px rgba(0, 0, 0, 0.45);
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

.reaction-scroll { position: relative; flex: 1; min-width: 0; }

.reaction-grid {
  --reaction-cell: 44px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--reaction-cell);
  gap: 0 2px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.reaction-grid::-webkit-scrollbar { display: none; }
.reaction-grid > .reaction { height: var(--reaction-cell); scroll-snap-align: start; }

@container reactions (max-width: 359px) {
  .reaction-grid { --reaction-cell: 38px; }
  .reaction-grid > .reaction { font-size: 22px; }
}

@container reactions (min-width: 460px) {
  .reaction-grid { --reaction-cell: 38px; grid-auto-flow: row; grid-template-columns: repeat(10, minmax(0, 1fr)); overflow: visible; scroll-snap-type: none; }
}

@media (pointer: coarse) {
  @container reactions (min-width: 460px) { .reaction-grid { --reaction-cell: 44px; } }
}

/* While a mouse drags the row (reaction-bar.js), it follows the pointer with snapping off. */
.reaction-grid[data-dragging] { scroll-snap-type: none; cursor: grabbing; }
.reaction-grid[data-dragging] > .reaction { cursor: grabbing; }

/* The chevrons over the row's ends, each fading into the card under it: the right one while more lie to the right, the
   left one once the row has scrolled away from its start. */
.reaction-more {
  position: absolute; top: 0; right: 0; bottom: 0; display: grid; place-items: center end; width: 40px; padding: 0 2px 0 0; border: 0;
  background: linear-gradient(90deg, transparent, var(--slab-dark) 62%); color: rgba(243, 239, 228, 0.8); cursor: pointer;
}
.reaction-more[hidden] { display: none; }
.reaction-back { right: auto; left: 0; place-items: center start; padding: 0 0 0 2px; background: linear-gradient(270deg, transparent, var(--slab-dark) 62%); }
.reaction-more svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.reaction-more:is(:hover, :focus-visible) { color: var(--paper); }
.reaction-more:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }

/* Square, centred in its cell, so the hover, press and focus rings are circles however wide the cell is. */
.reaction {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  aspect-ratio: 1;
  min-width: 0;
  max-width: 100%;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  font: 24px/1 "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.12s ease, background-color 0.12s ease;
}

.reaction:hover,
.reaction.virtual-hover { background: rgba(243, 239, 228, 0.1); }
.reaction:active { transform: scale(1.22); }
.reaction:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.reaction:disabled { opacity: 0.4; cursor: default; transform: none; background: none; }
.reaction[data-picking="true"] { background: rgba(216, 137, 43, 0.22); box-shadow: inset 0 0 0 2px var(--accent); }

/* A custom reaction (#730, reaction-policy.js `show`) is a picture the size of the emoji type around it, wherever an
   emoji stands: the bars, the picker, rows, tiles and seats. */
.reaction-art { display: inline-block; width: 1.1em; height: 1.1em; vertical-align: -0.15em; pointer-events: none; user-select: none; -webkit-user-drag: none; }

.reaction-divider {
  flex: none;
  align-self: stretch;
  width: 1px;
  margin: 2px 2px;
  background: rgba(243, 239, 228, 0.16);
}

.reaction-hand {
  flex: none;
  width: 44px;
  height: 44px;
  font-size: 28px;
}

/* The hand while it is up: a ring in the accent, as a toggle that stays pressed. */
.reaction-hand[aria-pressed="true"] {
  background: rgba(216, 137, 43, 0.22);
  box-shadow: inset 0 0 0 2px var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  .reaction { transition: none; }
  .reaction:active { transform: none; }
}

/* The picker floats in the middle of the screen, over the panels and the world, as wide as fits. */
.reaction-picker {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
  width: min(400px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px - var(--safe-top) - var(--safe-bottom));
  padding: 12px;
  border-radius: 18px;
  background: var(--slab-dark);
  color: var(--paper);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(243, 239, 228, 0.12);
  transform: translate(-50%, -50%);
}

.reaction-picker[hidden] { display: none; }

.reaction-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.reaction-picker-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.reaction-picker-current {
  font: 22px/1 "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  letter-spacing: 0;
}

.reaction-picker-close {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(243, 239, 228, 0.1);
  color: var(--paper);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.reaction-picker-close:hover { background: rgba(243, 239, 228, 0.18); }
.reaction-picker-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.reaction-picker-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.reaction-picker-search {
  flex: 1 1 140px;
  min-width: 0;
  height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(243, 239, 228, 0.18);
  border-radius: 15px;
  background: #0b0a09;
  color: var(--paper);
  font-size: 12px;
}

.reaction-picker-search:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }

.reaction-tones { display: flex; gap: 4px; }

.reaction-tone {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: #ffcc4d;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.reaction-tone[data-tone="1"] { background: #f7dece; }
.reaction-tone[data-tone="2"] { background: #f3d2a2; }
.reaction-tone[data-tone="3"] { background: #d5ab88; }
.reaction-tone[data-tone="4"] { background: #af7e57; }
.reaction-tone[data-tone="5"] { background: #7c533e; }
.reaction-tone[aria-checked="true"] { border-color: var(--accent); }
.reaction-tone:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.reaction-hearts {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.reaction-heart {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: none;
  font: 14px/1 "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  cursor: pointer;
}

.reaction-heart[aria-checked="true"] { border-color: var(--accent); background: rgba(216, 137, 43, 0.14); }
.reaction-heart:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.reaction-picker-nav {
  display: flex;
  justify-content: space-between;
  gap: 2px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(243, 239, 228, 0.12);
}

.reaction-picker-jump,
.reaction-choice {
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  line-height: 1;
  cursor: pointer;
}

.reaction-picker-jump { flex: 1; height: 26px; font-size: 16px; }

.reaction-picker-jump:hover,
.reaction-choice:hover,
.reaction-picker-jump.virtual-hover,
.reaction-choice.virtual-hover { background: rgba(243, 239, 228, 0.1); }

.reaction-picker-jump:focus-visible,
.reaction-choice:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.reaction-picker-grid {
  flex: 1 1 auto;
  min-height: 120px;
  max-height: 320px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.reaction-picker-group {
  margin: 6px 2px 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.reaction-picker-group[hidden],
.reaction-picker-set[hidden],
.reaction-choice[hidden] { display: none; }

.reaction-picker-set {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
}

.reaction-choice { height: 34px; font-size: 22px; }

.reaction-picker-foot { display: flex; justify-content: flex-end; }
.reaction-picker .reaction-picker-reset { color: var(--muted); font-size: 10px; }

@media (pointer: coarse) {
  .reaction { height: 44px; }
  .reaction-choice { height: 40px; }
  .reaction-picker-set { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); }
  .reaction-tone { width: 26px; height: 26px; }
  .reaction-heart { width: 32px; height: 32px; font-size: 18px; }
}

/* Dropout consent stays compact; its explanation opens from the adjacent question mark. */
#players-diagnostics { position: relative; }
.diagnostics-label { display: flex; align-items: center; gap: 6px; }
.diagnostics-label .players-speak { flex: 0 1 auto; white-space: normal; }
.diagnostics-label input { flex: none; }
#players-diagnostics-info { flex: none; padding: 0; }
#players-diagnostics-status { color: #fff; }
#players-diagnostics-help {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 2;
  margin: 0;
  padding: 10px;
  background: #171b1a;
  border: 1px solid var(--muted);
  border-radius: 6px;
  color: #fff;
}

#players-diagnostics-help.diagnostics-help-above { top: auto; bottom: 100%; }

/* Native disclosure keeps advanced settings together on every panel layout. */
.players-settings { flex: none; }
.players-settings:not(:has(.players-settings-content > :not([hidden]))) { display: none; }
.players-settings > summary {
  padding: 6px 0;
  color: var(--paper);
  font-size: 11px;
  cursor: pointer;
}
.players-settings > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.players-settings-content { display: grid; gap: 8px; padding-top: 8px; }
/* Every word in Advanced settings is white, to read easily against the panel. */
.players-settings > summary,
.players-settings-content :is(.players-hearing-label, .players-hearing-value, .players-hearing-help, .players-speak) { color: #fff; }

.players-hearing-label {
  color: rgba(243, 239, 228, 0.72);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.players-hearing input[type="range"] {
  width: 100%;
  min-width: 0;
  height: 26px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.players-hearing-value {
  justify-self: end;
  color: var(--paper);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.players-hearing-help {
  grid-column: 1 / -1;
  color: rgba(243, 239, 228, 0.62);
  font-size: 9.5px;
}

@media (pointer: coarse) {
  .players-look {
    padding: 8px;
    margin: -8px;
  }

  .players-hearing input[type="range"] {
    height: 32px;
  }
}

.roster-age {
  color: rgba(243, 239, 228, 0.55);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.roster-state {
  box-sizing: border-box;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid transparent;
  min-width: 6ch;
  text-align: center;
}

.roster-state[data-state="working"] {
  color: #ffd84a;
  border-color: rgba(255, 216, 74, 0.4);
  background: rgba(255, 216, 74, 0.08);
}

.roster-state[data-state="sleeping"],
.roster-state[data-state="away"] {
  color: var(--muted);
  border-color: rgba(166, 166, 162, 0.4);
  background: rgba(166, 166, 162, 0.08);
}

.roster-state[data-state="chilling"] {
  color: var(--accent-text);
  border-color: rgba(216, 137, 43, 0.4);
  background: rgba(216, 137, 43, 0.08);
}

.roster .roster-state {
  min-width: 0;
  padding: 2px 0;
  font-size: 9px;
}

.field {
  display: block;
  margin-top: 10px;
}

.field span {
  display: block;
  margin-bottom: 4px;
  color: rgba(243, 239, 228, 0.75);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.field input,
.chat-form input {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 2px solid var(--stone-dk);
  border-radius: 7px 6px 8px 6px;
  background: var(--tablet);
  box-shadow: var(--tablet-shadow);
  outline: none;
  transition: border-color 0.15s ease;
}

.field input:focus-visible,
.chat-form input:focus-visible {
  border-color: var(--accent);
}

/* Ooga Chat's message fields, island and private, as dark as the log over them and the reaction card under them. */
.chat-form input { background: var(--slab-dark); }

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.actions button {
  min-height: 38px;
  padding: 0 10px;
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  background: linear-gradient(#e2a04a, var(--accent));
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  box-shadow: 0 3px 0 var(--nail);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.actions button:hover,
.actions button.virtual-hover {
  background: linear-gradient(#f0b05a, #e2a04a);
}

.link {
  border: 0;
  padding: 0;
  background: transparent;
  color: rgba(243, 239, 228, 0.6);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.link:hover,
.link.virtual-hover {
  color: var(--paper);
}

/* Account controls stay with their panel, including when detached. */
.account {
  display: flex;
  flex: none;
  width: 100%;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  min-width: 0;
}

/* The name with Sign out beside it, on a line of its own under the voice buttons, in a chat too. */
.account-who {
  display: inline-flex;
  flex: 1 1 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
}

.account-who:not(:has(> :not([hidden]))),
.account-actions:not(:has(> :not([hidden]))) { display: none; }

.account-name {
  min-width: 0;
  color: var(--paper);
  font-size: 11px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.account[data-live="true"] .account-name::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 5px rgba(34, 197, 94, 0.55);
  vertical-align: 1px;
}

.account-room {
  color: rgba(243, 239, 228, 0.6);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.account-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.foot-button {
  min-height: 28px;
  padding: 0 10px;
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  background: linear-gradient(var(--plank), var(--wood));
  color: var(--paper);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
  box-shadow: 0 2px 0 var(--nail);
  white-space: nowrap;
  cursor: pointer;
}

.foot-button:hover,
.foot-button.virtual-hover,
.foot-button:focus-visible { background: linear-gradient(#b8844a, var(--plank)); outline: none; }
.foot-button:focus-visible { box-shadow: 0 2px 0 var(--nail), 0 0 0 2px var(--accent); }
/* A button that can do nothing yet (Unmute before Join voice, Join voice where voice isn't open) reads as off, as the
   panels' other buttons do, and a hover leaves it as it is. */
.foot-button:disabled { opacity: 0.5; cursor: default; background: linear-gradient(var(--plank), var(--wood)); }

.foot-primary {
  background: linear-gradient(#e2a04a, var(--accent));
  color: var(--ink);
  text-shadow: none;
}

.foot-primary:hover,
.foot-primary.virtual-hover,
.foot-primary:focus-visible { background: linear-gradient(#f0b05a, #e2a04a); }

/* In voice with the microphone live, the voice button wears the presence green. A microphone button that says so in
   `data-mic` (the account rows' and Ooga Chat's footers, both apps) is green on Mute and red on an enabled Unmute, and plain while disabled. */
.foot-button[aria-pressed="true"]:not([data-mic]),
.foot-button[data-mic="live"]:not(:disabled) { border-color: rgba(34, 197, 94, 0.75); }
.foot-button[data-mic="muted"]:not(:disabled) { border-color: rgba(239, 68, 68, 0.8); }
/* The microphone itself before the words (native-icons.js `label`, the voice mark's microphone): crossed while muted or
   not yet open, live while it is, tinted with the edge where enabled. */
.foot-button[data-mic]:not([hidden]) { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.foot-button > .mic-icon { flex: none; width: 14px; height: 14px; }
/* The microphone's level fills its capsule from the bottom (native-icons.js `mic`, `--lv`; shown by the voice mark's rules). */
.mic-icon .mic-level { transform-box: fill-box; transform-origin: 50% 100%; }
.foot-button > .mic-icon .mic-level { display: none; }
.foot-button[data-mic="live"] > .mic-icon :is(.mic-gap, .mic-slash) { display: none; }
.foot-button[data-mic="live"]:not(:disabled) > .mic-icon { color: #9ff0b8; }
.foot-button[data-mic="muted"]:not(:disabled) > .mic-icon { color: #ffb4a6; }

@media (pointer: coarse) {
  .foot-button { min-height: 40px; }
  .account .link { min-height: 40px; }
  /* On a phone the name's line sits as tight under the buttons and over the panel's edge as with a mouse: Sign out is
     tapped through the 6px gaps round it (::after), reaching neither the buttons nor past the panel's foot. */
  .account-who > .link, .cloud-foot-who > .link { min-height: 0; position: relative; }
  .account-who > .link::after, .cloud-foot-who > .link::after { content: ""; position: absolute; inset: -6px -8px; }
}

.bottom-hud,
.message-stack {
  display: contents;
}

.position-debug {
  position: fixed;
  left: calc(16px + var(--safe-left));
  bottom: calc(16px + var(--safe-bottom));
  z-index: 12;
  max-width: calc(100vw - 32px - var(--safe-left) - var(--safe-right));
  padding: 8px 10px;
  color: #b8ffc5;
  background: rgba(10, 18, 13, 0.9);
  border: 1px solid rgba(101, 232, 121, 0.65);
  border-radius: 4px;
  font-size: 10px;
  line-height: 1.45;
  text-align: left;
  white-space: pre;
  cursor: copy;
  user-select: text;
  overflow-x: auto;
}

/* On touch screens the thumb sticks own the bottom edge: dock the debug panel at the top instead. */
@media (pointer: coarse) {
  .position-debug {
    top: calc(16px + var(--safe-top));
    bottom: auto;
  }
}

/* The feed panel: the Konami code toggles it, page-wide, over any scene. */
.feed-debug {
  position: fixed;
  right: calc(16px + var(--safe-right));
  bottom: calc(16px + var(--safe-bottom));
  z-index: 12;
  width: min(380px, calc(100vw - 32px - var(--safe-left) - var(--safe-right)));
  max-height: calc(60vh - var(--safe-bottom));
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  color: #bfe0ff;
  background: rgba(8, 14, 22, 0.92);
  border: 1px solid rgba(96, 170, 255, 0.6);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.45;
  user-select: text;
}

.feed-debug[hidden] {
  display: none;
}

.feed-debug-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #e6f2ff;
  min-width: 0;
  overflow-wrap: anywhere;
}

.feed-debug-close {
  flex: none;
  padding: 0 6px;
  color: inherit;
  background: none;
  border: 1px solid rgba(96, 170, 255, 0.4);
  border-radius: 3px;
  font: inherit;
  font-size: 12px;
  line-height: 1.3;
  cursor: pointer;
}

.feed-debug-state,
.feed-debug-log {
  margin: 6px 0 0;
  font: inherit;
  white-space: pre;
  overflow-x: auto;
}

.feed-debug-log {
  color: #8fb8e8;
  border-top: 1px solid rgba(96, 170, 255, 0.25);
  padding-top: 6px;
  overflow-y: auto;
}

.position-debug[data-copied="true"] {
  color: #fff6b0;
  border-color: #ffd84a;
}

.toast,
.hint {
  position: absolute;
  left: 50%;
  transform: translate(-50%, 8px);
  padding: 10px 16px;
  background: linear-gradient(var(--plank), var(--wood));
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  box-shadow: 0 3px 0 var(--nail);
  letter-spacing: 0.06em;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  max-width: min(620px, calc(100vw - 32px));
  text-align: center;
  line-height: 1.4;
}

.toast {
  bottom: calc(11px + var(--safe-bottom));
  color: #ffd27a;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}

.hint {
  top: calc(84px + var(--safe-top));
  color: var(--paper);
  font-size: 11px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}

.toast[data-diagnostics] { bottom: calc(80px + var(--safe-bottom)); }

.toast[data-reload] {
  pointer-events: auto;
}

/* A newer version's line at the foot of every side-panel tab (hud.js `offerUpdate`), as Ooga Chat's device line: in
   the panel's flow under everything else in it, at its foot where the panel has room to spare, so it never covers a
   control, and its × at the line's end. */
.reload-line { order: 1; flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: auto 0 0; color: rgba(243, 239, 228, 0.78); font-size: 12px; }
.reload-line-close {
  margin-left: auto; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: none;
  color: rgba(243, 239, 228, 0.6); font: inherit; font-size: 18px; line-height: 1; cursor: pointer;
}
.reload-line-close:hover { background: rgba(243, 239, 228, 0.1); color: var(--paper); }
.reload-line-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
@media (pointer: coarse) { .reload-line-close { width: 40px; height: 40px; } }

.toast.show,
.hint.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* The microphone's note: stays while muted in voice, under the clock, clear of the act button and the toasts. */
.mic-note {
  position: absolute;
  left: 50%;
  top: calc(52px + var(--safe-top));
  transform: translateX(-50%);
  padding: 6px 12px;
  background: var(--tablet);
  border: 2px solid var(--stone-dk);
  border-radius: 6px;
  box-shadow: var(--tablet-shadow);
  color: var(--paper);
  font-size: 11px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  pointer-events: none;
}

.mic-note[data-muted="true"] {
  color: #ffb3a6;
  border-color: var(--danger);
}

/* HALLOWEEN: the ghost hunt (ghost-hud.js). The round line and the visitor's bar under the clock and the hint, the
   banners across the middle, the flash when a ghost gets you; none of it takes a pointer. */
.ghost-hud {
  position: absolute;
  left: 50%;
  top: calc(118px + var(--safe-top));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}

.ghost-hud[hidden] {
  display: none;
}

/* The hunt's lobby: the land's title card, lighter behind so the island shows through, its players as stone tablets. */
.ghost-lobby {
  pointer-events: auto;
  z-index: 6;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 0 100vmax rgba(8, 6, 4, 0.3);
}

.ghost-lobby[hidden] {
  display: none;
}

/* World labels sit above the island HUD, but never above the lobby's own player list. */
.ghost-lobby:not([hidden]) ~ .tooltip {
  visibility: hidden;
}

.ghost-lobby-players li {
  grid-template-columns: 22px 1fr;
}

.ghost-lobby-mark {
  grid-row: span 2;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}

.ghost-lobby-players li[data-ready] .ghost-lobby-mark {
  color: #3ce65a;
}

.ghost-lobby-players b {
  overflow-wrap: anywhere;
  white-space: normal;
}

.ghost-lobby-note {
  margin: 0 0 12px;
}

/* GAME MODE (scene-hub.js `setGameMode`): the act button and the message stack at the foot of the play area (toasts
   and the hint pill) stand down while an island event runs; Space still jumps and uses. */
body.game-mode #act,
body.game-mode #message-stack {
  display: none;
}

/* GAME MODE: the top left's controls stand down too (the map, the character and its modes, the jetpack, the melee
   weapon, the magazine); on a touch screen the rifle stays, being how a finger fires. */
body.game-mode .weapon-equipment-row > :not(.weapon-hud) {
  display: none;
}

@media (pointer: fine) {
  body.game-mode .weapon-hud {
    display: none;
  }
}

/* The hunt's minimap, bottom left (top left on a touch screen, where the sticks take the foot): a round radar in the
   wood's frame, drawn by ghost-game.js `drawMinimap`. */
.ghost-minimap {
  position: absolute;
  left: calc(16px + var(--safe-left, 0px));
  bottom: calc(16px + var(--safe-bottom, 0px));
  width: 180px;
  height: 180px;
  border: 3px solid var(--wood-edge);
  border-radius: 50%;
  background: #0b0d0c;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 8px 20px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 4;
}

.ghost-minimap[hidden] {
  display: none;
}

@media (pointer: coarse) {
  .ghost-minimap {
    top: var(--ghost-map-top, calc(70px + var(--safe-top, 0px)));
    bottom: auto;
    width: 128px;
    height: 128px;
  }
}

/* The hunters' scoreboard, fixed to the top centre through the hunt (under the title on a narrow screen): each one's
   face in a circle with their points under it, the leader's circle glowing green. */
.ghost-scores {
  position: fixed;
  left: 50%;
  top: calc(6px + var(--safe-top, 0px));
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
  z-index: 4;
}

@media (max-width: 720px) {
  .ghost-scores {
    top: calc(62px + var(--safe-top, 0px));
  }
}

.ghost-scores[hidden] {
  display: none;
}

.ghost-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.ghost-score canvas {
  width: 38px;
  height: 38px;
  padding: 2px;
  background: var(--tablet);
  border: 2px solid var(--wood-edge);
  border-radius: 50%;
  box-shadow: var(--tablet-shadow);
}

.ghost-score b {
  color: var(--paper);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.9), 0 0 4px rgba(0, 0, 0, 0.8);
}

.ghost-score[data-lead] canvas {
  border-color: #3dff66;
  box-shadow: 0 0 10px 2px rgba(61, 255, 102, 0.75), 0 0 22px rgba(61, 255, 102, 0.45);
}

.ghost-score[data-lead] b {
  color: #8dffa6;
}

/* While a Halving Hourglass stands: a notice under the scoreboard that every rifle does half damage. */
.ghost-halving {
  position: fixed;
  left: 50%;
  top: calc(66px + var(--safe-top, 0px));
  transform: translateX(-50%);
  margin: 0;
  padding: 3px 10px;
  background: rgba(20, 10, 2, 0.75);
  border: 2px solid #f7931a;
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(247, 147, 26, 0.55);
  color: #ffc163;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  z-index: 4;
  animation: ghost-halving 1.2s ease-in-out infinite;
}

.ghost-halving[hidden] {
  display: none;
}

@keyframes ghost-halving {
  50% { box-shadow: 0 0 18px rgba(247, 147, 26, 0.9); }
}

@media (max-width: 720px) {
  .ghost-halving {
    top: calc(122px + var(--safe-top, 0px));
  }
}

/* A won hunt's banner: green, smaller and higher, over its results card (the podium and every hunter's tally). */
.ghost-banner[data-win] {
  top: 13%;
}

.ghost-banner[data-win] strong {
  font-size: clamp(34px, 7vw, 84px);
  color: #2fe05a;
  text-shadow: 0 0 28px rgba(40, 255, 90, 0.55), 0 0 6px rgba(0, 90, 20, 0.9), 0 5px 0 rgba(0, 0, 0, 0.75);
}

.ghost-banner span:empty {
  display: none;
}

.ghost-banner[data-win] span {
  color: #6dff8e;
  text-shadow: 0 0 16px rgba(40, 255, 90, 0.45), 0 3px 0 rgba(0, 0, 0, 0.75);
}

.ghost-results {
  top: 60%;
  z-index: 6;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 0 100vmax rgba(8, 6, 4, 0.3);
}

.ghost-results[hidden] {
  display: none;
}

.ghost-results .game-intro-goal {
  margin: 0 0 6px;
}

.ghost-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  margin: 0 0 12px;
}

/* A place nobody took keeps its block, with no one and nothing on it. */
.ghost-podium-step[data-empty] canvas,
.ghost-podium-step[data-empty] figcaption {
  visibility: hidden;
}

/* The winner floats a little over the top step. */
.ghost-podium-step[data-place="1"]:not([data-empty]) canvas {
  animation: ghost-levitate 2.4s ease-in-out infinite;
  filter: drop-shadow(0 10px 6px rgba(0, 0, 0, 0.45));
}

@keyframes ghost-results-in {
  from { opacity: 0; transform: translate(-50%, 4%) scale(0.94); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@keyframes ghost-levitate {
  0%, 100% { transform: translateY(-6px); }
  50% { transform: translateY(-16px); }
}

.ghost-results .ghost-results-players {
  grid-template-columns: 1fr 1fr;
}

.ghost-results-players li {
  grid-template-columns: 22px 1fr;
}

/* On a narrow screen the card stands on the foot of the screen, under the banner, its tallies still two to a row. */
@media (max-width: 720px) {
  .ghost-results {
    top: auto;
    bottom: calc(12px + var(--safe-bottom, 0px));
    transform: translateX(-50%);
    padding: 12px 12px 10px;
    animation-name: ghost-results-in;
  }

  .ghost-banner[data-win] {
    top: 19%;
  }

  .ghost-podium-step {
    width: min(110px, 23vw);
  }
}

.ghost-results-place {
  grid-row: span 2;
  color: var(--accent-text);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}

.ghost-results-players b {
  overflow-wrap: anywhere;
  white-space: normal;
}

/* A round's new-enemy card (ghost-hud.js `intro`), through the countdown of a round that brings one in: the enemy
   hovering on it over what it does, the round's banner raised over it (`data-high`). It takes no clicks, so the
   hunters can still look round and move. */
.game-intro.ghost-intro {
  top: 58%;
  z-index: 6;
  width: min(460px, calc(100vw - 32px));
  pointer-events: none;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 0 100vmax rgba(8, 6, 4, 0.3);
}

.ghost-intro[hidden] {
  display: none;
}

.game-intro.ghost-intro .game-intro-title {
  font-size: 34px;
}

.ghost-intro-art {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  height: 165px;
  margin: 4px 0 10px;
}

.ghost-intro-art canvas {
  width: 72px;
  height: 90px;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.6));
  animation: ghost-hover 2.6s ease-in-out infinite;
}

.ghost-intro-art canvas:nth-child(2) {
  width: 96px;
  height: 120px;
  margin-bottom: 14px;
  animation-delay: -0.9s;
}

.ghost-intro-art canvas:nth-child(3) {
  animation-delay: -1.7s;
}

/* One enemy alone, large: a ghost hovering ("float"), or a model playing its own loop ("clip"). */
.ghost-intro-art .ghost-intro-solo {
  display: none;
  width: 240px;
  height: 165px;
  animation: none;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.45));
}

.ghost-intro:not([data-art="trio"]) .ghost-intro-art canvas {
  display: none;
}

.ghost-intro:not([data-art="trio"]) .ghost-intro-art .ghost-intro-solo {
  display: block;
}

.ghost-intro[data-art="float"] .ghost-intro-art .ghost-intro-solo {
  animation: ghost-hover 2.6s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.6));
}

.ghost-intro[data-enemy="boss"] .ghost-intro-art .ghost-intro-solo {
  filter: drop-shadow(0 0 16px rgba(255, 40, 30, 0.85));
}

@keyframes ghost-hover {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-14px) rotate(3deg); }
}

.ghost-banner[data-high] {
  top: 13%;
}

.ghost-banner[data-high] strong {
  font-size: clamp(34px, 7vw, 84px);
}

.ghost-banner[data-high] span {
  font-size: clamp(20px, 3.5vw, 40px);
}

/* On a narrow screen the card stands on the foot of the screen, as the results card does. */
@media (max-width: 720px) {
  .game-intro.ghost-intro {
    top: auto;
    bottom: calc(12px + var(--safe-bottom, 0px));
    transform: translateX(-50%);
    padding: 12px 12px 10px;
    animation-name: ghost-results-in;
  }

  .ghost-intro-art {
    height: 110px;
  }

  .ghost-intro-art .ghost-intro-solo {
    width: 160px;
    height: 110px;
  }

  .ghost-intro-art canvas {
    width: 56px;
    height: 70px;
  }

  .ghost-intro-art canvas:nth-child(2) {
    width: 76px;
    height: 95px;
    margin-bottom: 10px;
  }

  .ghost-banner[data-high] {
    top: 19%;
  }
}

.ghost-podium-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(120px, 26vw);
  margin: 0;
}

.ghost-podium-step canvas {
  width: 100%;
  aspect-ratio: 3 / 4;
}

.ghost-podium-step figcaption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  margin: 2px 0 4px;
  color: var(--paper);
  text-align: center;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.8);
}

.ghost-podium-step b {
  font-size: 12px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.ghost-podium-step small {
  color: #8dffa6;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.ghost-podium-block {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  padding-top: 6px;
  background: var(--planks);
  border: 3px solid var(--wood-edge);
  border-radius: 6px 6px 0 0;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
  color: var(--accent-text);
  font-size: 22px;
  font-weight: 700;
}

.ghost-podium-step[data-place="1"] .ghost-podium-block {
  height: 92px;
  border-color: #c9a227;
}

.ghost-podium-step[data-place="2"] .ghost-podium-block {
  height: 62px;
  border-color: #b8bcc4;
}

.ghost-podium-step[data-place="3"] .ghost-podium-block {
  height: 44px;
  border-color: #b07a45;
}

/* The hunt's spectator bar, bottom centre while the visitor is down (above the thumb sticks on a touch screen): the
   hunter followed, with a step on to the next. */
/* The Byzantine Keep's merchant: weapons, the damage each does and its price in bananas. */
.keep-shop {
  width: min(560px, calc(100vw - 24px));
  padding: 12px;
}

.keep-shop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.keep-shop-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--paper);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

.keep-shop-purse,
.keep-shop-note {
  margin: 8px 0;
  font-size: 11px;
  color: var(--accent-text);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

.keep-shop-note {
  margin-bottom: 0;
}

.keep-shop-list {
  list-style: none;
  margin: 0;
  padding: 2px 10px;
}

.keep-shop-list li {
  display: grid;
  grid-template-columns: 56px 1fr auto 116px;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  font-size: 12px;
  color: rgba(243, 239, 228, 0.88);
}

.keep-shop-list li + li {
  border-top: 1px solid rgba(243, 239, 228, 0.07);
}

.keep-shop-name {
  font-weight: 700;
}

.keep-shop-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
}

.keep-shop-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.keep-shop-next {
  font-size: 10px;
  line-height: 1.35;
  color: var(--accent-text);
}

.keep-shop-next:empty {
  display: none;
}

/* The test flag's Downgrade (`keeptest=1`): small and plain stone beside the row's own action. */
.keep-shop-list .keep-shop-down {
  justify-self: start;
  min-height: 22px;
  margin-top: 2px;
  padding: 0 6px;
  background: var(--stone);
  box-shadow: none;
  color: var(--paper);
  font-size: 10px;
}

.keep-shop-list .keep-shop-down[hidden] {
  display: none;
}

/* A levelled weapon's Levels, opened under its row: a line a level owned, its pips, name, cost and damage, and a button
   to use it at that level, the one in use lit. */
.keep-shop-list .keep-shop-fold[hidden] {
  display: none;
}

.keep-shop-list .keep-shop-levels {
  grid-column: 2 / -1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 8px;
  padding: 4px 8px;
  list-style: none;
  background: var(--slab-dark);
  border: 2px solid var(--stone-dk);
  border-radius: 9px 7px 10px 8px;
  box-shadow: var(--tablet-shadow);
}

.keep-shop-list .keep-shop-levels[hidden] {
  display: none;
}

.keep-shop-list .keep-shop-levels li {
  display: grid;
  grid-template-columns: 1fr auto auto 64px;
  gap: 10px;
  min-height: 30px;
  font-size: 11px;
  border-top: none;
}

.keep-shop-list .keep-shop-levels li + li {
  border-top: 1px solid rgba(243, 239, 228, 0.07);
}

.keep-shop-level-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.keep-shop-levels li[data-current="true"] .keep-shop-level-name {
  color: var(--accent-text);
  font-weight: 700;
}

.keep-shop-level-cost {
  font: 10px var(--mono);
  color: var(--accent-text);
}

.keep-shop-level-damage {
  font-size: 10px;
  color: rgba(243, 239, 228, 0.78);
}

.keep-shop-list .keep-shop-levels button {
  min-height: 26px;
  padding: 0 6px;
  font-size: 10px;
}

@media (max-width: 380px) {
  .keep-shop-list .keep-shop-levels { grid-column: 1 / -1; }
  .keep-shop-list .keep-shop-levels li { grid-template-columns: 1fr 64px; row-gap: 0; }
}

/* A weapon's level: four pips, filled to it. */
.keep-level {
  display: inline-flex;
  gap: 3px;
}

.keep-level i {
  width: 9px;
  height: 9px;
  box-sizing: border-box;
  border: 2px solid rgba(243, 239, 228, 0.35);
  border-radius: 2px;
  background: #1a1410;
}

.keep-level[data-level="1"] i:nth-child(-n + 1),
.keep-level[data-level="2"] i:nth-child(-n + 2),
.keep-level[data-level="3"] i:nth-child(-n + 3),
.keep-level[data-level="4"] i {
  border-color: #ffd28a;
  background: var(--accent);
  box-shadow: 0 0 5px rgba(255, 179, 71, 0.8);
}

.keep-arm .keep-level {
  margin-top: 1px;
}

.keep-shop-damage {
  font-size: 11px;
  color: rgba(243, 239, 228, 0.78);
}

.keep-shop-price {
  font: 11px var(--mono);
  color: var(--accent-text);
  text-align: right;
}

.keep-shop-list button {
  min-height: 30px;
  padding: 0 8px;
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  background: linear-gradient(#e2a04a, var(--accent));
  box-shadow: 0 3px 0 var(--nail);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.keep-shop-list button:disabled {
  background: var(--stone);
  color: rgba(243, 239, 228, 0.62);
  cursor: default;
}

.keep-shop-list button:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

@media (max-width: 380px) {
  .keep-shop-list li {
    grid-template-columns: 56px 1fr;
    padding: 6px 0;
  }
  .keep-shop-price { text-align: left; }
}

.keep-shop-list .keep-arm-picture {
  display: block;
  box-sizing: border-box;
  width: 56px;
  height: 56px;
  margin: 4px 0;
  border: 2px solid var(--stone-dk);
  border-radius: 6px;
  background: radial-gradient(circle at 50% 45%, var(--stone-lt), var(--stone) 70%);
}

/* The Keep's conversations (Eryk's quest) and its quest log, on the shop's frame. */
.keep-talk,
.keep-quests {
  width: min(460px, calc(100vw - 24px));
  padding: 12px;
}

.keep-talk-line {
  margin: 10px 0;
  padding: 12px 14px;
  min-height: 3.6em;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(243, 239, 228, 0.88);
}

.keep-talk-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.keep-talk-actions button {
  min-width: 96px;
  min-height: 34px;
  padding: 0 14px;
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  background: var(--stone);
  color: var(--paper);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.keep-talk-actions button:hover {
  background: var(--stone-lt);
}

.keep-talk-actions button[data-main] {
  background: linear-gradient(#e2a04a, var(--accent));
  box-shadow: 0 3px 0 var(--nail);
  color: var(--ink);
}

.keep-talk-actions button:focus-visible,
.keep-quests-open:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

.keep-quests-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 2px 12px;
}

.keep-quests-list li {
  padding: 10px 0;
}

.keep-quests-list li + li {
  border-top: 1px solid rgba(243, 239, 228, 0.07);
}

.keep-quest-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.keep-quest-title {
  font-size: 12px;
  font-weight: 700;
  color: rgba(243, 239, 228, 0.88);
}

.keep-quest-chip {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.keep-quest-chip[data-done="true"] {
  background: #4f8a3a;
  color: var(--paper);
}

.keep-quest-text {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: rgba(243, 239, 228, 0.78);
}

.keep-quest-none {
  font-size: 11px;
  color: rgba(243, 239, 228, 0.62);
}

/* The Quests button beside the Keep's health and bananas, a dot on it while a quest is under way. */
.keep-quests-open {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--planks);
  border: 3px solid var(--wood-edge);
  border-radius: var(--radius);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 8px 20px rgba(0, 0, 0, 0.35);
  font: 700 12px var(--mono);
  color: var(--paper);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
  pointer-events: auto;
  cursor: pointer;
}

.keep-quests-open svg {
  width: 16px;
  height: 16px;
  flex: none;
}


.keep-quests-open[data-active="true"]::after {
  content: "";
  position: absolute;
  top: -5px;
  right: -5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--wood-edge);
}

/* On a wide screen the Keep's boat hull and helm stand at the foot of the bottom stack, under its toasts. */
@media (min-width: 721px) {
  .bottom-hud>.keep-status {
    position: static;
    transform: none;
    order: 9;
  }
}

/* While a visitor mans one of the Keep's cannons: the way off it. */
.keep-cannon-leave {
  position: absolute;
  right: calc(16px + var(--safe-right, 0px));
  bottom: calc(96px + var(--safe-bottom, 0px));
  min-height: 44px;
  padding: 0 16px;
  background: var(--stone);
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  box-shadow: 0 3px 0 var(--nail);
  color: var(--paper);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  z-index: 6;
}

.keep-cannon-leave[hidden] {
  display: none;
}

.keep-cannon-leave:hover {
  background: var(--stone-lt);
}

.keep-cannon-leave:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

/* The Byzantine Keep's left column, one under another: the weapon selector (a ship's four at her helm), Quests, the
   health and the bananas. */
.keep-side {
  position: absolute;
  left: calc(12px + var(--safe-left, 0px));
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 84px;
  pointer-events: none;
  z-index: 6;
}

.keep-side[hidden] {
  display: none;
}

.keep-side > * {
  pointer-events: auto;
}

/* The weapon selector: the weapon in hand, which a press opens into the weapons owned on an arc beside it (the
   position of each from script, `--fx`, `--fy`, its delay `--fd`); a press on one takes it and folds the arc. */
.keep-arms {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.keep-arms[hidden] {
  display: none;
}

.keep-arm {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 84px;
  padding: 4px 4px 5px;
  background: var(--planks);
  border: 3px solid var(--wood-edge);
  border-radius: var(--radius);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 8px 20px rgba(0, 0, 0, 0.35);
  color: var(--paper);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
  cursor: pointer;
}

/* The picture on stone, so the planks' seams never cut across it. */
.keep-arm .keep-arm-picture {
  display: block;
  box-sizing: border-box;
  width: 70px;
  height: 70px;
  border: 2px solid var(--stone-dk);
  border-radius: 6px;
  background: radial-gradient(circle at 50% 45%, var(--stone-lt), var(--stone) 70%);
}

/* At a ship's helm the weapons give way to the ship's own four: each lit while it works, dimmed under a count of
   seconds while it cannot be used again. */
.keep-arms[data-helm="true"] {
  display: none;
}

.keep-ship-act {
  position: relative;
  font-family: inherit;
}

.keep-ship-act .keep-arm-picture svg {
  display: block;
  width: 100%;
  height: 100%;
}

.keep-ship-act b {
  position: absolute;
  left: 0;
  right: 0;
  top: 22px;
  font: 700 22px var(--mono);
  color: var(--paper);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.75);
  pointer-events: none;
}


.keep-ship-act[data-state="on"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-text), 0 0 16px rgba(247, 147, 26, 0.55), 0 4px 0 rgba(0, 0, 0, 0.35);
  color: var(--accent-text);
}

@media (pointer: coarse) {
  .keep-ship-act b { top: 12px; font-size: 16px; }
}

.keep-arms-open {
  position: relative;
}

.keep-arms-open::after {
  content: "";
  position: absolute;
  right: -9px;
  top: 50%;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 0 7px 8px;
  border-color: transparent transparent transparent var(--wood-edge);
  transform: translateY(-50%);
  transition: transform 0.18s ease;
}

.keep-arms-open[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent-text);
}

.keep-arms-open[aria-expanded="true"]::after {
  border-left-color: var(--accent);
  transform: translateY(-50%) scaleX(-1);
}

.keep-arms-fan {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  z-index: 2;
}

.keep-arm.keep-arm-choice {
  position: absolute;
  left: 0;
  top: 0;
  width: 84px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.3);
  transition: transform 0.24s cubic-bezier(0.2, 1.35, 0.4, 1) var(--fd, 0ms), opacity 0.16s ease var(--fd, 0ms);
}

.keep-arms-fan[data-open="true"] .keep-arm-choice {
  opacity: 1;
  pointer-events: auto;
  transform: translate(calc(-50% + var(--fx, 0px)), calc(-50% + var(--fy, 0px))) scale(1);
}

/* The arc's icons are the column's size, the health's. */
.keep-arm.keep-arm-choice .keep-arm-picture {
  width: 70px;
  height: 70px;
}

.keep-arm.keep-arm-choice:hover {
  border-color: var(--accent);
  filter: brightness(1.12);
}

@media (prefers-reduced-motion: reduce) {
  .keep-arm.keep-arm-choice { transition: opacity 0.12s linear; }
  .keep-arms-open::after { transition: none; }
}

/* A weapon's key, as on a hotbar: a small number in the button's corner. */
.keep-arm {
  position: relative;
}

.keep-arm-key {
  position: absolute;
  top: 3px;
  left: 5px;
  min-width: 14px;
  padding: 0 3px;
  border-radius: 3px;
  background: rgba(10, 8, 6, 0.75);
  color: var(--paper);
  font: 700 10px/14px var(--mono);
  text-align: center;
  pointer-events: none;
}

@media (pointer: coarse) {
  .keep-arm-key { display: none; }
}

.keep-arm[data-active="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-text), 0 0 16px rgba(247, 147, 26, 0.55), 0 4px 0 rgba(0, 0, 0, 0.35);
  color: var(--accent-text);
}

.keep-arm:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

@media (pointer: coarse) {
  .keep-side { top: calc(150px + var(--safe-top, 0px)); transform: none; width: 56px; gap: 6px; }
  .keep-arm { width: 56px; }
  .keep-arm .keep-arm-picture { width: 40px; height: 40px; }
  .keep-arm.keep-arm-choice { width: 56px; }
  .keep-arm.keep-arm-choice .keep-arm-picture { width: 40px; height: 40px; }
  .keep-level i { width: 7px; height: 7px; }
  .keep-life { width: 52px; height: 52px; }
}

/* The Keep's health: a circle filled like a pie as far as the hit points go (`--hp`, 0 to 1), the count in it, a
   brighter red when nearly gone. */
@property --hp {
  syntax: "<number>";
  inherits: true;
  initial-value: 1;
}

.keep-life {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 64px;
  height: 64px;
  border: 3px solid var(--wood-edge);
  border-radius: 50%;
  background: conic-gradient(#d8432f calc(var(--hp) * 360deg), rgba(0, 0, 0, 0.55) 0);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 8px 20px rgba(0, 0, 0, 0.35), inset 0 0 0 3px rgba(0, 0, 0, 0.22);
  transition: --hp 0.3s ease-out;
}

.keep-life[data-low="true"] {
  background: conic-gradient(#ff4a30 calc(var(--hp) * 360deg), rgba(0, 0, 0, 0.55) 0);
}

.keep-life b {
  font: 700 15px var(--mono);
  color: var(--paper);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.85), 0 0 6px rgba(0, 0, 0, 0.85);
}

.keep-life[data-hit] {
  animation: keep-health-hit 0.35s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .keep-life { transition: none; }
  .keep-life[data-hit] { animation: none; }
}

.keep-side .keep-quests-open,
.keep-side .keep-bananas {
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
}

/* The icons from the land's art (keep-icon-data.js): each carries its own round stone frame, so it stands on the
   card as it is, with no stone square under it. */
.keep-arm-picture.keep-arm-icon {
  position: relative;
  display: block;
  border: 0;
  border-radius: 50%;
  background: none;
  overflow: visible;
}

/* The picture itself is laid in its box by scene-keep.js `fitIcon`, its frame the heart's size. */
.keep-arm-icon img,
.keep-side-face .keep-side-icon {
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55));
}

.keep-weapon-reveal-picture .keep-arm-icon {
  width: 120px;
  height: 120px;
}

/* Health, Quests and Bananas as cards like the weapon's: the icon, its name under it, the count over the icon. */
.keep-side .keep-life,
.keep-side .keep-quests-open,
.keep-side .keep-bananas {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 84px;
  height: auto;
  padding: 4px 4px 5px;
  background: var(--planks);
  border: 3px solid var(--wood-edge);
  border-radius: var(--radius);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 8px 20px rgba(0, 0, 0, 0.35);
  color: var(--paper);
  font: 700 10px var(--mono);
  letter-spacing: 0.04em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

.keep-side-face {
  position: relative;
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
}

.keep-side-icon {
  width: 100%;
  height: 100%;
}

.keep-side-face b {
  position: absolute;
  font: 700 15px var(--mono);
  color: var(--paper);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.9), 0 0 6px rgba(0, 0, 0, 0.9);
}

/* The bananas' count low on the icon, on a dark chip so it reads over the banana. */
.keep-bananas .keep-side-face b {
  bottom: 2px;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.6);
  font-size: 12px;
}

/* The health lost darkens the heart's disc from twelve o'clock round, as the pie did. */
.keep-life .keep-side-face::after {
  content: "";
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  background: conic-gradient(transparent calc(var(--hp) * 360deg), rgba(0, 0, 0, 0.68) 0);
  pointer-events: none;
}

.keep-life[data-low="true"] .keep-side-icon {
  animation: keep-life-low 1.1s ease-in-out infinite;
}

@keyframes keep-life-low {
  50% { filter: drop-shadow(0 0 8px rgba(255, 60, 30, 0.9)); }
}

.keep-side-name {
  display: block;
}

/* The left column with no wood behind it: the icons stand on the view, their names shadowed to read over it. */
#keep-arms .keep-arm,
#keep-ship .keep-arm,
.keep-side .keep-life,
.keep-side .keep-quests-open,
.keep-side .keep-bananas {
  background: none;
  border-color: transparent;
  box-shadow: none;
  text-shadow: 0 1px 0 #000, 0 0 4px #000, 0 0 8px rgba(0, 0, 0, 0.9);
}

#keep-arms .keep-arm[data-active="true"],
#keep-arms .keep-arm.keep-arm-choice:hover {
  border-color: transparent;
  box-shadow: none;
  filter: none;
}

#keep-arms .keep-arm:focus-visible {
  outline: none;
}

/* The weapon in hand, and the one picked out while cycling through the wheel (focus) or under the pointer: an orange
   glow under its icon's circle. */
#keep-arms .keep-arm .keep-arm-picture.keep-arm-icon {
  border-radius: 50%;
  transition: background 0.12s ease, filter 0.12s ease;
}

#keep-arms .keep-arm:is([data-active="true"], :focus-visible, .keep-arm-choice:hover) .keep-arm-picture {
  background: radial-gradient(circle, rgba(255, 140, 40, 0.95) 0 38%, rgba(255, 110, 20, 0.55) 52%, rgba(255, 90, 10, 0) 70%);
  filter: drop-shadow(0 0 6px rgba(255, 130, 30, 0.95)) drop-shadow(0 0 14px rgba(255, 100, 20, 0.7));
}

#keep-arms .keep-arm:is([data-active="true"], :focus-visible) {
  color: var(--accent-text);
}

.keep-side > .keep-life[hidden],
.keep-side > .keep-bananas[hidden] {
  display: none;
}

/* At a helm the ship's four glow the same way while one works, its count over its icon while it cannot be used. */
#keep-ship .keep-ship-act[data-state="on"] {
  border-color: transparent;
  box-shadow: none;
}

#keep-ship .keep-ship-act[data-state="on"] .keep-arm-picture {
  background: radial-gradient(circle, rgba(255, 140, 40, 0.95) 0 38%, rgba(255, 110, 20, 0.55) 52%, rgba(255, 90, 10, 0) 70%);
  filter: drop-shadow(0 0 6px rgba(255, 130, 30, 0.95)) drop-shadow(0 0 14px rgba(255, 100, 20, 0.7));
}

/* Over each of the four's circle, a pie of the time left, closing round to twelve o'clock: an orange tint while it works,
   dark while it cannot be used again. */
#keep-ship .keep-ship-act .keep-arm-picture {
  position: relative;
}

.keep-ship-pie {
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  pointer-events: none;
  display: none;
}

.keep-ship-act:is([data-state="on"], [data-state="wait"]) .keep-ship-pie {
  display: block;
}

.keep-ship-act[data-state="on"] .keep-ship-pie {
  background: conic-gradient(rgba(255, 130, 20, 0.55) calc(var(--left, 0) * 360deg), transparent 0);
}

.keep-ship-act[data-state="wait"] .keep-ship-pie {
  background: conic-gradient(rgba(0, 0, 0, 0.62) calc(var(--left, 0) * 360deg), transparent 0);
}

#keep-ship .keep-ship-act b {
  z-index: 1;
  text-shadow: 0 2px 0 #000, 0 0 6px #000;
}

@media (prefers-reduced-motion: reduce) {
  #keep-arms .keep-arm .keep-arm-picture.keep-arm-icon { transition: none; }
}

@media (pointer: coarse) {
  .keep-side .keep-life,
  .keep-side .keep-quests-open,
  .keep-side .keep-bananas { width: 56px; }
  .keep-side-face { width: 40px; height: 40px; }
  .keep-side-face b { font-size: 12px; }
  .keep-bananas .keep-side-face b { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .keep-life[data-low="true"] .keep-side-icon { animation: none; }
}

/* The Byzantine Keep's boat hull and helm at the foot of the screen, and the plank its bananas and boat hull share. */
.keep-status {
  position: absolute;
  left: 50%;
  bottom: calc(16px + var(--safe-bottom, 0px));
  transform: translateX(-50%);
  display: flex;
  align-items: stretch;
  gap: 8px;
  pointer-events: none;
  z-index: 5;
}

.keep-status[hidden] {
  display: none;
}

.keep-health,
.keep-bananas {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: var(--planks);
  border: 3px solid var(--wood-edge);
  border-radius: var(--radius);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 8px 20px rgba(0, 0, 0, 0.35);
}

.keep-bananas {
  gap: 6px;
  min-width: 44px;
  font: 700 12px var(--mono);
  color: var(--paper);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

/* A banana landing in the stash: its icon swells a little and back, quickly. */
.keep-bananas .keep-side-face[data-pulse] {
  animation: keep-bananas-pulse 0.18s ease-out;
}

@keyframes keep-bananas-pulse {
  0% { transform: scale(1); filter: none; }
  40% { transform: scale(1.14); filter: brightness(1.35); }
  100% { transform: scale(1); filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  .keep-bananas .keep-side-face[data-pulse] { animation: none; }
}

.keep-bananas svg {
  width: 16px;
  height: 16px;
  flex: none;
}

/* The island being come to, named in white under the header at the top left: sliding in, holding, fading out. */
.keep-area {
  position: fixed;
  top: calc(76px + var(--safe-top, 0px));
  left: calc(16px + var(--safe-left, 0px));
  font-family: "Uncial Antiqua", Georgia, serif;
  font-size: clamp(22px, 3.2vw, 34px);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.75), 0 0 16px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  white-space: nowrap;
  z-index: 55;
  opacity: 0;
}

.keep-area[hidden] {
  display: none;
}

/* On a phone the header runs to two rows: the name stands under both. */
@media (max-width: 720px) {
  .keep-area { top: calc(132px + var(--safe-top, 0px)); }
}

.keep-area[data-show] {
  animation: keep-area 4.2s ease-out forwards;
}

@keyframes keep-area {
  0% { opacity: 0; transform: translateX(-24px); }
  15% { opacity: 1; transform: translateX(0); }
  70% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .keep-area[data-show] { animation: keep-area-calm 4.2s linear forwards; }
  @keyframes keep-area-calm {
    0%, 100% { opacity: 0; }
    10%, 70% { opacity: 1; }
  }
}

.keep-quests-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.keep-quests-note {
  margin: 0;
  font-size: 11px;
  color: var(--accent-text);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

.keep-quests-reset {
  min-height: 30px;
  padding: 0 12px;
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  background: var(--stone);
  color: var(--paper);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.keep-quests-reset:hover {
  background: var(--stone-lt);
}

.keep-quests-reset:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

/* A weapon newly gained: "New weapon", its picture, name, damage and line in the middle of the view over a soft dark
   glow, swelling in, holding and fading away. */
.keep-weapon-reveal {
  position: fixed;
  left: 50%;
  top: 42%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(92vw, 560px);
  padding: 28px 24px;
  transform: translate(-50%, -50%);
  text-align: center;
  background: radial-gradient(ellipse at center, rgba(8, 6, 4, 0.78) 30%, rgba(8, 6, 4, 0.5) 60%, transparent 75%);
  pointer-events: none;
  z-index: 60;
  opacity: 0;
}

.keep-weapon-reveal[hidden] {
  display: none;
}

.keep-weapon-reveal[data-show] {
  animation: keep-weapon-reveal 4.6s ease-out forwards;
}

.keep-weapon-reveal-kicker {
  font-size: clamp(13px, 2vw, 17px);
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent-text);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.7);
}

.keep-weapon-reveal-picture canvas {
  display: block;
  box-sizing: border-box;
  width: 120px;
  height: 120px;
  border: 3px solid var(--wood-edge);
  border-radius: 10px;
  background: radial-gradient(circle at 50% 45%, var(--stone-lt), var(--stone) 70%);
  box-shadow: 0 0 30px rgba(255, 140, 30, 0.55), 0 4px 0 rgba(0, 0, 0, 0.35);
}

.keep-weapon-reveal-name {
  font-size: clamp(30px, 6vw, 56px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.04em;
  color: #ffb347;
  text-shadow: 0 4px 0 #6a3410, 0 0 24px rgba(255, 140, 30, 0.7);
}

.keep-weapon-reveal-damage {
  font: 700 12px var(--mono);
  color: var(--paper);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7);
}

.keep-weapon-reveal-about {
  margin: 2px 0 0;
  max-width: 420px;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(243, 239, 228, 0.9);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.8), 0 0 10px rgba(0, 0, 0, 0.8);
}

@keyframes keep-weapon-reveal {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  12% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
  20% { transform: translate(-50%, -50%) scale(1); }
  82% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -54%) scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
  .keep-weapon-reveal[data-show] { animation: keep-weapon-reveal-calm 4.6s linear forwards; }
  @keyframes keep-weapon-reveal-calm {
    0%, 100% { opacity: 0; transform: translate(-50%, -50%); }
    8%, 85% { opacity: 1; transform: translate(-50%, -50%); }
  }
}

/* A quest taken on: its name large across the middle of the view, swelling in, holding and rising away. */
.keep-quest-banner {
  position: fixed;
  left: 50%;
  top: 34%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: min(92vw, 900px);
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  z-index: 60;
  opacity: 0;
}

.keep-quest-banner[hidden] {
  display: none;
}

.keep-quest-banner[data-show] {
  animation: keep-quest-banner 3.6s ease-out forwards;
}

.keep-quest-banner-kicker {
  font-family: "Uncial Antiqua", Georgia, serif;
  font-size: clamp(14px, 2.2vw, 20px);
  font-weight: 400;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent-text);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.7), 0 0 18px rgba(0, 0, 0, 0.6);
}

.keep-quest-banner-name {
  font-family: "Uncial Antiqua", Georgia, serif;
  font-size: clamp(34px, 7vw, 76px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: #ffb347;
  text-shadow: 0 4px 0 #6a3410, 0 0 28px rgba(255, 140, 30, 0.75), 0 0 60px rgba(0, 0, 0, 0.7);
  overflow-wrap: anywhere;
}

@keyframes keep-quest-banner {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.55); }
  14% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  22% { transform: translate(-50%, -50%) scale(1); }
  78% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -62%) scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
  .keep-quest-banner[data-show] { animation: keep-quest-banner-calm 3.6s linear forwards; }
  @keyframes keep-quest-banner-calm {
    0%, 100% { opacity: 0; transform: translate(-50%, -50%); }
    10%, 85% { opacity: 1; transform: translate(-50%, -50%); }
  }
}

/* A blow taken there: the view's edges flash red. */
.keep-hurt {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(200, 20, 10, 0.12) 35%, rgba(200, 20, 10, 0.62) 100%);
  opacity: 0;
  pointer-events: none;
  z-index: 4;
}

.keep-hurt[hidden] {
  display: none;
}

.keep-hurt[data-hit] {
  animation: keep-hurt 0.45s ease-out;
}

@keyframes keep-hurt {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

.keep-health i {
  width: 16px;
  height: 14px;
  border: 2px solid var(--wood-edge);
  border-radius: 3px;
  background: #d8432f;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.28);
}

.keep-helm {
  display: flex;
  gap: 6px;
  pointer-events: auto;
}

.keep-helm[hidden] {
  display: none;
}

.keep-helm-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 78px;
  min-height: 44px;
  padding: 5px 8px;
  font: inherit;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--stone);
  border: 3px solid var(--wood-edge);
  border-radius: var(--radius);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 8px 20px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.keep-helm-side[data-on="true"] {
  background: linear-gradient(#e2a04a, var(--accent));
  color: var(--ink);
}

.keep-helm-side b {
  display: flex;
  gap: 3px;
}

.keep-helm-side i {
  width: 9px;
  height: 9px;
  border: 2px solid var(--wood-edge);
  border-radius: 50%;
  background: #f3efe4;
}

.keep-helm-side i[data-on="false"] {
  background: rgba(0, 0, 0, 0.45);
}

.keep-helm-side:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

.keep-boat[hidden] {
  display: none;
}

.keep-boat i[hidden] {
  display: none;
}

.keep-boat svg {
  width: 22px;
  height: 14px;
}

.keep-boat i {
  background: #c98a3c;
}

.keep-health i[data-on="false"] {
  background: rgba(0, 0, 0, 0.45);
  box-shadow: none;
}

.keep-health[data-hit] {
  animation: keep-health-hit 0.35s ease-out;
}

@keyframes keep-health-hit {
  0% { transform: scale(1.18); filter: brightness(1.8); }
  100% { transform: scale(1); filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  .keep-health[data-hit] { animation: none; }
}

@media (pointer: coarse) {
  .keep-status { bottom: auto; top: calc(96px + var(--safe-top, 0px)); }
  .keep-health i { width: 12px; height: 11px; }
}

.ghost-spectate {
  position: absolute;
  left: 50%;
  bottom: calc(16px + var(--safe-bottom, 0px));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-width: calc(100vw - 32px);
  padding: 7px 10px 8px;
  background: var(--planks);
  border: 3px solid var(--wood-edge);
  border-radius: var(--radius);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 8px 20px rgba(0, 0, 0, 0.35);
  color: var(--paper);
  pointer-events: auto;
  z-index: 5;
}

.ghost-spectate[hidden],
.ghost-spectate-next[hidden] {
  display: none;
}

.ghost-spectate-head {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--accent-text);
}

.ghost-spectate-watch {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ghost-spectate-next {
  flex: none;
  padding: 5px 10px;
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--paper);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
}

.ghost-spectate-name {
  font-size: 10px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

@media (pointer: coarse) {
  .ghost-spectate {
    bottom: calc(216px + var(--safe-bottom, 0px));
  }

  .ghost-spectate-next {
    min-height: 32px;
  }
}

/* The hangar's sound panel under its Sound button: on or off, the level and the pad's vibration, on the planks. */
/* Stable playback controls: changing a label never shifts its neighbours. */
.presets[data-scene="timechain"] { flex-wrap: wrap; }
#lecture-toggle { width: 76px; min-width: 76px; flex: 0 0 76px; }
#lecture-toggle:disabled { opacity: 0.6; cursor: progress; }
#lecture-speed { width: 64px; min-width: 64px; flex: 0 0 64px; font-variant-numeric: tabular-nums; }

/* The Lecture Hall's question: the lecture waits on one of its answers. */
.hangar-sound {
  position: absolute;
  top: calc(58px + var(--safe-top));
  right: calc(16px + var(--safe-right, 0px));
  width: min(300px, calc(100vw - 32px));
  padding: 10px 12px 10px;
  background: var(--planks);
  border: 3px solid var(--wood-edge);
  border-radius: var(--radius);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 8px 20px rgba(0, 0, 0, 0.35);
  color: var(--paper);
  pointer-events: auto;
  z-index: 20;
}

.hangar-sound[hidden] {
  display: none;
}

.hangar-sound-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.hangar-sound-head h3 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--paper);
  white-space: nowrap;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.6));
}

.hangar-sound-toggle {
  flex: none;
  min-width: 84px;
  min-height: 28px;
  padding: 0 10px;
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  background: linear-gradient(#f0b05a, var(--accent));
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.hangar-sound-toggle[aria-pressed="false"] {
  background: var(--wood-edge);
  color: var(--paper);
}

.hangar-sound-slab {
  padding: 2px 12px;
}

.hangar-sound-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 38px;
  font-size: 12px;
  white-space: nowrap;
  color: rgba(243, 239, 228, 0.88);
}

.hangar-sound-row + .hangar-sound-row {
  border-top: 1px solid rgba(243, 239, 228, 0.07);
}

.hangar-sound-note {
  margin: 8px 0 0;
  font-size: 10px;
  line-height: 1.3;
  color: var(--accent-text);
  white-space: nowrap;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.6));
}

/* A hangar door's keypad on screen (`hangar-keypad.js`), in the steel of the one on the wall: the room's name, its
   screen and twelve lit keys, the last row green; red while it refuses a code, shaking once as it does. On a wide
   screen it stands to one side of the middle, away from the keypad on the wall (`data-side`), leaving the Ooga and
   that keypad in view. */
.hangar-keypad {
  position: absolute;
  inset: 50% auto auto 50%;
  margin: 0;
  translate: -50% -50%;
  width: min(232px, calc(100vw - 32px));
  padding: 9px 12px 10px;
  background: linear-gradient(#2c313c, #1d2028);
  border: 3px solid #3b4351;
  border-radius: 12px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.45), 0 10px 26px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #e8f4ff;
  pointer-events: auto;
  z-index: 6;
}

.hangar-keypad:focus {
  outline: none;
}

@media (min-width: 760px) {
  .hangar-keypad {
    inset: 50% auto auto 72%;
  }

  .hangar-keypad[data-side="left"] {
    inset: 50% auto auto 28%;
  }
}

.hangar-keypad[data-state="deny"] {
  animation: hangar-keypad-shake 0.4s ease-out;
}

@keyframes hangar-keypad-shake {
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}

@media (prefers-reduced-motion: reduce) {
  .hangar-keypad[data-state="deny"] {
    animation: none;
  }
}

.hangar-keypad-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.hangar-keypad-head h3 {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffb347;
  white-space: nowrap;
}

.hangar-keypad-close {
  flex: none;
  width: 26px;
  height: 26px;
  border: 2px solid #3b4351;
  border-radius: 6px;
  background: #14171d;
  color: #c9d0d8;
  font-size: 12px;
  cursor: pointer;
}

.hangar-keypad-screen {
  margin: 0 0 10px;
  padding: 7px 6px;
  border: 2px solid #0b1510;
  border-radius: 6px;
  background: #0d2a1c;
  color: #5dff9e;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  line-height: 18px;
  letter-spacing: 0.12em;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 0 6px rgba(93, 255, 158, 0.55);
}

.hangar-keypad[data-state="check"] .hangar-keypad-screen {
  color: #ffd166;
  text-shadow: 0 0 6px rgba(255, 209, 102, 0.55);
}

.hangar-keypad[data-state="deny"] .hangar-keypad-screen,
.hangar-keypad[data-state="lock"] .hangar-keypad-screen {
  background: #2a0d0d;
  border-color: #160606;
  color: #ff5a4f;
  text-shadow: 0 0 6px rgba(255, 90, 79, 0.6);
}

.hangar-keypad-keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.hangar-keypad-keys button {
  height: 40px;
  border: 2px solid #0f1116;
  border-radius: 7px;
  background: linear-gradient(#26303e, #171f29);
  color: #7fdcff;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  text-shadow: 0 0 6px rgba(127, 220, 255, 0.6);
  box-shadow: inset 0 1px 0 rgba(127, 220, 255, 0.22), 0 2px 0 rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.hangar-keypad-keys button:active {
  translate: 0 1px;
  box-shadow: inset 0 1px 0 rgba(127, 220, 255, 0.22), 0 1px 0 rgba(0, 0, 0, 0.5);
}

.hangar-keypad-keys .hangar-keypad-go {
  color: #2ecc71;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-shadow: 0 0 6px rgba(46, 204, 113, 0.6);
  box-shadow: inset 0 1px 0 rgba(46, 204, 113, 0.22), 0 2px 0 rgba(0, 0, 0, 0.5);
}

.hangar-keypad[data-state="deny"] .hangar-keypad-keys button,
.hangar-keypad[data-state="lock"] .hangar-keypad-keys button {
  color: #ff5a4f;
  text-shadow: 0 0 6px rgba(255, 90, 79, 0.6);
}

.hangar-keypad-note {
  margin: 8px 0 0;
  font-size: 9.5px;
  color: #9fb0c4;
  text-align: center;
  white-space: nowrap;
}

/* The hunt's mini player, bottom right: what is playing and the music switch, on the lobby card's planks. */
.ghost-player {
  position: absolute;
  right: 16px;
  bottom: calc(16px + var(--safe-bottom, 0px));
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(300px, calc(100vw - 32px));
  padding: 7px 9px 7px 11px;
  background: var(--planks);
  border: 3px solid var(--wood-edge);
  border-radius: var(--radius);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 8px 20px rgba(0, 0, 0, 0.35);
  color: var(--paper);
  pointer-events: auto;
  z-index: 4;
}

.ghost-player[hidden] {
  display: none;
}

.ghost-player-note {
  color: #ff8a1f;
  font-size: 16px;
  line-height: 1;
}

.ghost-player[data-off] .ghost-player-note {
  color: var(--muted);
}

.ghost-player-title {
  min-width: 0;
  font-size: 10px;
  line-height: 1.25;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}

.ghost-player-toggle {
  flex: none;
  padding: 4px 9px;
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  background: linear-gradient(#f0b05a, var(--accent));
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
}

.ghost-player-skip {
  flex: none;
  padding: 3px 7px;
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--paper);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}

.ghost-player-skip[hidden] {
  display: none;
}

.ghost-player[data-off] .ghost-player-toggle {
  background: var(--wood-edge);
  color: var(--paper);
}

/* The lobby's controls, a line of key chips under the players. */
.ghost-lobby-how {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  font-size: 11px;
}

.ghost-lobby-how li {
  white-space: nowrap;
}

.ghost-lobby-how kbd {
  display: inline-block;
  min-width: 1.6em;
  margin: 0 1px;
  padding: 1px 6px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-bottom-width: 3px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.25);
  font: inherit;
  font-size: 10.5px;
  font-weight: 700;
  text-align: center;
}

.ghost-boss {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: var(--tablet);
  border: 2px solid #7a4bd8;
  border-radius: 6px;
  box-shadow: var(--tablet-shadow);
}

.ghost-boss[hidden] {
  display: none;
}

.ghost-boss-label {
  color: #e0d4ff;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ghost-boss meter {
  width: min(320px, calc(100vw - 140px));
  height: 10px;
}

.ghost-banner {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  pointer-events: none;
  text-align: center;
  width: calc(100vw - 32px);
  font-family: "Creepster", "Chalkduster", "Impact", fantasy, sans-serif;
  font-weight: 400;
}

.ghost-banner[hidden] {
  display: none;
}

.ghost-banner strong {
  color: #e3121b;
  font-size: clamp(52px, 12vw, 150px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.04em;
  text-shadow: 0 0 28px rgba(255, 20, 20, 0.55), 0 0 6px rgba(120, 0, 0, 0.9), 0 5px 0 rgba(0, 0, 0, 0.75);
}

.ghost-banner span {
  color: #ff3a2e;
  font-size: clamp(26px, 5vw, 64px);
  line-height: 1.1;
  letter-spacing: 0.06em;
  text-shadow: 0 0 16px rgba(255, 30, 20, 0.45), 0 3px 0 rgba(0, 0, 0, 0.75);
}

.ghost-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

.ghost-flash[data-kind="hurt"] {
  background: radial-gradient(ellipse at center, transparent 45%, rgba(229, 83, 61, 0.65));
}

.ghost-flash[data-kind="hurt"].on {
  animation: ghost-hurt 0.22s ease-out;
}

.ghost-flash[data-kind="soul"] {
  opacity: 1;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(20, 5, 40, 0.7));
}

@keyframes ghost-hurt {
  from { opacity: 1; }
  to { opacity: 0; }
}

.tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  padding: 5px 9px;
  background: var(--tablet);
  border: 2px solid var(--stone-dk);
  border-radius: 7px 6px 8px 6px;
  box-shadow: var(--tablet-shadow);
  font-size: 11px;
  letter-spacing: 0.03em;
  pointer-events: none;
  max-width: 280px;
  line-height: 1.35;
}

.tooltip--name {
  display: grid;
  grid-template-columns: 8px auto;
  align-items: center;
  gap: 6px;
  padding: 3px 5px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  max-width: calc(100vw - 16px);
  text-shadow: -1px -1px 0 #111, 1px -1px 0 #111, -1px 1px 0 #111, 1px 1px 0 #111, 0 2px 4px #000;
}

.tooltip--name::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 1px #171714, 0 1px 3px #000;
}

.tooltip--name.tooltip--no-status-dot { grid-template-columns: auto; }
.tooltip--name.tooltip--no-status-dot::before { display: none; }

.tooltip-health {
  grid-column: 1 / -1;
  width: 72px;
  height: 4px;
  margin: -2px auto 1px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(25, 20, 15, 0.78);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.8);
}

.tooltip-health > span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--accent);
  transform-origin: left center;
}

.tooltip--name[data-state="working"]::before {
  background: #ffd84a;
}

.tooltip--name[data-state="online"]::before {
  background: var(--ok);
}

.tooltip--name[data-state="chilling"]::before {
  background: var(--accent);
}

/* Carried equipment expands in place; the jetpack stays beside the character control. */
.equipment-hud {
  position: absolute;
  top: calc(62px + var(--safe-top));
  left: calc(16px + var(--safe-left));
  display: grid;
  grid-template-columns: 218px;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.weapon-equipment-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
}

.weapon-equipment-row:not(:has(> :not([hidden]))) {
  display: none;
}

.mode-hud,
.leave-hud,
.chips-hud,
.gorilla-hud,
.primary-hud,
.weapon-hud,
.rescue-hud,
.magazine-hud,
.jetpack-hud {
  grid-column: 1;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  width: 78px;
  height: 52px;
  padding: 7px 10px;
  background: var(--slab-dark);
  /* A border and top highlight only a little lighter than the near-black, so the frame stays quiet. */
  border: 2px solid #221f1c;
  border-radius: 9px 7px 10px 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), inset 0 -2px 0 rgba(0, 0, 0, 0.35), 0 2px 0 rgba(0, 0, 0, 0.4);
  color: var(--paper);
  font: inherit;
  overflow: hidden;
  pointer-events: auto;
  transition: width 0.2s ease, background 0.15s ease, transform 0.15s ease;
}

.mode-hud:hover,
.mode-hud.virtual-hover,
.mode-hud:focus-visible,
.leave-hud:hover,
.leave-hud.virtual-hover,
.leave-hud:focus-visible,
.chips-hud:hover,
.gorilla-hud:hover,
.gorilla-hud.virtual-hover,
.gorilla-hud:focus-visible,
.primary-hud:hover,
.primary-hud.virtual-hover,
.primary-hud:focus-visible,
.weapon-hud:hover,
.weapon-hud.virtual-hover,
.weapon-hud:focus-visible,
.rescue-hud:hover,
.rescue-hud.virtual-hover,
.rescue-hud:focus-visible,
.magazine-hud:hover:not(:disabled),
.magazine-hud.virtual-hover:not(:disabled),
.magazine-hud:focus-visible,
.jetpack-hud:hover:not(:disabled),
.jetpack-hud.virtual-hover:not(:disabled),
.jetpack-hud:focus-visible {
  /* A solid colour, as at rest: the background fades between two colours, never a colour and a gradient, which would
     show the button see-through for the length of the fade. */
  background: #2a2622;
  outline: none;
}

.mode-hud:active,
.leave-hud:active,
.chips-hud:active,
.gorilla-hud:active,
.primary-hud:active,
.weapon-hud:active,
.rescue-hud:active,
.magazine-hud:active:not(:disabled),
.jetpack-hud:active:not(:disabled) {
  transform: translateY(1px);
}

.mode-hud:focus-visible,
.leave-hud:focus-visible,
.chips-hud:focus-visible,
.gorilla-hud:focus-visible,
.primary-hud:focus-visible,
.weapon-hud:focus-visible,
.rescue-hud:focus-visible,
.magazine-hud:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.jetpack-hud:disabled {
  display: none;
}

.mode-hud {
  flex: none;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  overflow: visible;
}

.rescue-hud[data-holding="true"] {
  background: #33291f;
}

.rescue-hud::after {
  content: "";
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--accent);
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}

.rescue-hud[data-holding="true"]::after {
  opacity: 1;
  animation: mode-release-progress 650ms linear forwards;
}

@keyframes mode-release-progress {
  to { transform: scaleX(1); }
}

/* The way out, beside the Ooga's face: an orange arrow over EXIT, an exit sign. Where a place's banner has a Leave button,
   hud.js shows this one, named by it, and the banner's own is kept out of sight. */
body[data-leave-hud] .presets [data-action="leave"] {
  display: none;
}

.leave-hud {
  flex: none;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

/* The Ember Den's chip count, beside the Ooga's face: two stacks over the number. */
.chips-hud {
  flex: none;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 0;
  cursor: pointer;
}

.chips-hud { overflow: visible; }

/* The exact total, under the button while it is pointed at or focused. */
.chips-tip {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 10;
  width: max-content;
  max-width: 240px;
  padding: 6px 10px;
  background: var(--slab-dark);
  border: 2px solid #4a4038;
  border-radius: 7px 6px 8px 6px;
  font-size: 14px;
  line-height: 1.35;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%);
  transition: opacity 0.12s ease;
  pointer-events: none;
}

.chips-hud:is(:hover, .virtual-hover, :focus-visible) .chips-tip {
  opacity: 1;
  visibility: visible;
}

.chips-icon {
  width: 32.5px;
  height: 22.5px;
  flex: none;
}

.chips-count {
  font-size: 15px;
  font-weight: 750;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.leave-icon {
  width: 68px;
  height: 42px;
  flex: none;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.45));
}

.freeroam-icon,
.mode-face-icon {
  width: 44px;
  height: 44px;
  flex: none;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.45));
}

.mode-face-icon {
  position: absolute;
  left: 5px;
  top: 2px;
}

.mode-hud[data-gorilla="true"] .mode-face-icon {
  width: 40px;
  height: 40px;
  left: 7px;
  top: calc(50% - 3px);
  transform: translateY(-50%);
}

.mode-hud[data-health="false"] .mode-face-icon { left: calc(50% - 22px); }
.mode-hud[data-health="false"][data-gorilla="true"] .mode-face-icon { left: calc(50% - 20px); }

.gorilla-hud {
  flex: none;
  justify-content: flex-start;
  padding: 0;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}

.gorilla-action-icon {
  width: 40px;
  height: 40px;
  transform: translateY(-2px);
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.45));
}

.mode-health {
  display: block;
  position: absolute;
  left: 54px;
  top: 8px;
  width: 10px;
  height: 32px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
}

.mode-health::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(0, 0, 0, 0.45);
}

.mode-health > span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--accent);
  transform-origin: bottom;
}

.mode-hud[data-selected="false"] .mode-face-icon {
  display: none !important;
}

.mode-hud[data-selected="false"] .freeroam-icon {
  position: absolute;
  left: 50%;
  top: 2px;
  width: 44px;
  height: 44px;
  transform: translateX(-50%);
}

.detached-destination-name {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  min-width: 78px;
  transform: translateX(-50%);
  color: var(--accent-text);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 1px 2px #000, 0 0 5px #000;
  opacity: 0;
  transition: opacity 0.4s ease-out;
  pointer-events: none;
  white-space: nowrap;
}

.detached-destination-name.show,
#destination-hud:hover .detached-destination-name,
#destination-hud:focus-visible .detached-destination-name {
  opacity: 1;
  transition-duration: 0s;
}

.jetpack-hud {
  flex: none;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.jetpack-hud[data-equipped="true"] .jetpack-icon {
  transform: translateX(-13px);
}

/* The Block Party's dancing level in the banner (timechain-party-dance.js): a slab as tall as the equipment buttons, a
   step down and a step up either side of the dancer and the level, which warms from paper to banana gold as it rises. */
.dance-hud {
  position: relative;
  display: flex;
  align-items: stretch;
  flex: none;
  height: 52px;
  background: var(--slab-dark);
  border: 2px solid #221f1c;
  border-radius: 9px 7px 10px 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), inset 0 -2px 0 rgba(0, 0, 0, 0.35), 0 2px 0 rgba(0, 0, 0, 0.4);
  overflow: hidden;
  pointer-events: auto;
  --dance-glow: 0;
}

.dance-hud[hidden] { display: none; }

.dance-step {
  width: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--paper);
  font: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.dance-step:hover:not(:disabled),
.dance-step.virtual-hover:not(:disabled),
.dance-step:focus-visible {
  background: #2a2622;
  outline: none;
}

.dance-step:active:not(:disabled) { transform: translateY(1px); }
.dance-step:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.dance-step:disabled { color: #5d564e; cursor: default; }

.dance-read {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 34px;
  border-left: 1px solid #221f1c;
  border-right: 1px solid #221f1c;
}

.dance-icon {
  width: 16px;
  height: 20px;
  filter: drop-shadow(0 0 calc(var(--dance-glow) * 5px) rgba(255, 207, 90, 0.8));
}

.dance-num {
  color: color-mix(in srgb, var(--paper), #ffcf5a calc(var(--dance-glow) * 100%));
  font-size: 16px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 calc(var(--dance-glow) * 6px) rgba(255, 207, 90, 0.7);
}

.dance-hud[data-level="0"] .dance-icon { opacity: 0.45; }
.dance-hud[data-level="0"] { --dance-glow: 0; }
.dance-hud[data-level="1"] { --dance-glow: 0.1; }
.dance-hud[data-level="2"] { --dance-glow: 0.2; }
.dance-hud[data-level="3"] { --dance-glow: 0.3; }
.dance-hud[data-level="4"] { --dance-glow: 0.42; }
.dance-hud[data-level="5"] { --dance-glow: 0.54; }
.dance-hud[data-level="6"] { --dance-glow: 0.66; }
.dance-hud[data-level="7"] { --dance-glow: 0.78; }
.dance-hud[data-level="8"] { --dance-glow: 0.9; }
.dance-hud[data-level="9"] { --dance-glow: 1; }

.weapon-hud {
  flex: none;
  gap: 6px;
  padding: 0;
  pointer-events: auto;
  cursor: pointer;
}

.weapon-hud[data-equipped="true"] {
  width: 218px;
}

/* HALLOWEEN: the ghost hunt's gun has its own icon and no magazine to count, so it stays the small button with its
   infinity beside it, and a hunter keeps it on screen through the hunt on every kind of pointer. */
.weapon-icon .weapon-art-ghost,
.weapon-hud[data-skin="ghost"] .weapon-art-ak,
.weapon-hud[data-skin="ghost"] .weapon-readout {
  display: none;
}

.weapon-hud[data-skin="ghost"] .weapon-art-ghost {
  display: inline;
}

.weapon-hud[data-skin="ghost"][data-equipped="true"] {
  width: 78px;
}

.weapon-hud[data-skin="ghost"][data-equipped="true"] .weapon-compact {
  opacity: 1;
  visibility: visible;
}

body.game-mode .weapon-hud[data-skin="ghost"] {
  display: flex;
}

.rescue-hud {
  flex: none;
  padding: 0;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}

.rescue-hud canvas {
  width: 30px;
  height: 30px;
  flex: none;
  image-rendering: pixelated;
  transform: translateY(-2px);
}

.rescue-portrait {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex: none;
}

.rescue-equipment {
  position: relative;
  width: 78px;
  height: 52px;
  flex: none;
}

.rescue-equipment > span {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  width: 100%;
  font-size: 10px;
  line-height: 12px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px #000;
}

.weapon-equipment-row:has(.rescue-hud:not([hidden])) {
  flex-wrap: wrap;
  row-gap: 23px;
  max-width: calc(100vw - 32px - var(--safe-left) - var(--safe-right));
}

body.dsb-menu-open .rescue-equipment { visibility: hidden; pointer-events: none; }

.primary-hud {
  flex: none;
  padding: 0;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}

.primary-hud[data-equipped="true"],
.weapon-hud[data-equipped="true"],
.jetpack-hud[data-equipped="true"] {
  border-bottom-color: var(--accent);
}

.primary-strength {
  display: block;
  position: relative;
  width: 10px;
  height: 32px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.45);
  /* A light ring, so the empty track reads on the banner's near-black buttons. */
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(243, 239, 228, 0.45);
}

.primary-strength::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(0, 0, 0, 0.45);
}

.primary-strength-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: #ffd84a;
  transform: scaleY(0.5);
  transform-origin: bottom;
}

.gorilla-hud[data-returning="true"] .primary-strength-fill {
  transition: transform 0.25s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .gorilla-hud[data-returning="true"] .primary-strength-fill { transition: none; }
}

.jetpack-compact-fuel {
  display: block;
  position: relative;
  width: 10px;
  height: 32px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.45);
  /* A light ring, so the empty track reads on the banner's near-black buttons. */
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(243, 239, 228, 0.45);
}

.jetpack-compact-fuel-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: #ffd84a;
  transform-origin: bottom;
}

.jetpack-compact-fuel::after {
  content: "";
  position: absolute;
  bottom: 20%;
  left: 0;
  right: 0;
  height: 1px;
  z-index: 1;
  background: rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

.jetpack-compact-fuel[data-level="low"] .jetpack-compact-fuel-fill {
  background: var(--danger);
}

.rescue-hunger[data-level="full"] .jetpack-compact-fuel-fill {
  background: var(--ok);
}

.primary-hud:not([data-equipped="true"]) .primary-strength-fill {
  opacity: 0.45;
}

.primary-hud[data-charging="true"] .primary-strength-fill {
  background: #ffd84a;
}

.magazine-hud {
  flex: none;
  padding: 0 4px;
  cursor: pointer;
}

.magazine-hud:disabled {
  cursor: default;
}

.magazine-icon {
  width: 40px;
  height: 40px;
  flex: none;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.45));
}

#magazine-back {
  opacity: 0.8;
}

.magazine-hud:not([data-count="2"]) #magazine-back,
.magazine-hud:not([data-count="2"]) .magazine-ammo-low {
  display: none;
}

.equipment-compact {
  position: absolute;
  left: 46px;
  top: 50%;
  width: 26px;
  transform: translateY(-50%);
  font-size: 10px;
  line-height: 14px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.14s ease, visibility 0s;
}

.magazine-readout {
  display: flex;
  flex-direction: column;
  line-height: 11px;
}

.magazine-ammo-low {
  opacity: 0.8;
}

.weapon-hud[data-equipped="true"] .weapon-compact {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.1s ease, visibility 0s linear 0.1s;
}

.jetpack-hud:not([data-equipped="true"]) .jetpack-compact {
  opacity: 0;
  visibility: hidden;
}

.equipment-compact[data-level="empty"] {
  color: var(--danger);
}

.equipment-compact[data-level="low"] {
  color: var(--warn);
}

.magazine-banana-empty {
  opacity: 0.25;
  filter: grayscale(1);
}

.magazine-banana-fill {
  opacity: 1;
}

.magazine-banana[data-filled="false"] .magazine-banana-fill {
  opacity: 0;
}

.magazine-hud[data-level="empty"] .magazine-ammo,
.magazine-ammo-low[data-level="empty"] {
  color: var(--danger);
}

.magazine-hud[data-level="low"] .magazine-ammo,
.magazine-ammo-low[data-level="low"] {
  color: var(--warn);
}

.magazine-hud[data-reloading="true"] .magazine-ammo,
.magazine-ammo-low[data-reloading="true"] {
  color: var(--accent-text);
}

.weapon-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.primary-icon,
.weapon-icon,
.jetpack-icon {
  width: 40px;
  height: 40px;
  flex: none;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.45));
}

.weapon-icon {
  width: 48px;
  height: 48px;
  transform: translate(-2px, 2px);
}

.primary-icon {
  width: 44px;
  height: 44px;
}

.weapon-readout {
  width: 149px;
  flex: none;
}

.weapon-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3px;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.weapon-magazine {
  display: grid;
  grid-template-columns: repeat(15, 9px);
  gap: 2px 1px;
}

.weapon-banana {
  display: block;
  width: 9px;
  height: 9px;
  shape-rendering: crispEdges;
}

.weapon-banana-empty {
  opacity: 0.25;
  filter: grayscale(1);
}

.weapon-banana-fill {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.weapon-banana[data-filled="true"] .weapon-banana-fill {
  opacity: 1;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.5));
}

.weapon-banana--loading[data-filled="true"] .weapon-banana-fill {
  animation: weapon-banana-load 0.22s ease-out backwards;
  animation-delay: inherit;
}

@keyframes weapon-banana-load {
  from { opacity: 0; transform: translateY(5px) scale(0.55); }
  70% { opacity: 1; transform: translateY(-1px) scale(1.12); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .weapon-banana--loading[data-filled="true"] .weapon-banana-fill {
    animation: none;
  }
}

.weapon-readout:has(.weapon-magazine[data-level="empty"]) .weapon-label {
  color: var(--danger);
}

.weapon-readout:has(.weapon-magazine[data-level="low"]) .weapon-label {
  color: var(--warn);
}

.weapon-hud[data-reloading="true"] .weapon-label {
  color: var(--accent-text);
}

.weapon-readout {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.14s ease, visibility 0s linear 0.18s;
}

.weapon-hud[data-equipped="true"] .weapon-readout {
  opacity: 1;
  visibility: visible;
  transition-delay: 0.06s, 0s;
}

@media (max-width: 360px) {
  .equipment-hud { left: calc(8px + var(--safe-left)); }
  .weapon-equipment-row { gap: 4px; }
}
.joysticks,
.bottom-hud>.act {
  display: none;
}

.joystick {
  position: absolute;
  bottom: calc(max(48px, var(--stick-inset) - var(--home-chrome)) + var(--safe-bottom));
  width: var(--stick-size);
  height: var(--stick-size);
  border-radius: 50%;
  background: rgba(18, 18, 20, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.18);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.joystick.live {
  opacity: 0.95;
}

#joy-move {
  left: calc(20px + var(--safe-left));
}

#joy-look {
  right: calc(20px + var(--safe-right));
}

#joy-look,
#joy-look span {
  border-color: rgba(111, 159, 202, 0.55);
}

.joystick span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease-out;
}

#joy-look span {
  background: #6f9fca;
}

.joystick.live span {
  transition: none;
}

.act {
  position: absolute;
  z-index: 13;
  left: 50%;
  bottom: calc(max(48px, var(--act-inset) - var(--home-chrome)) + var(--safe-bottom));
  transform: translateX(-50%);
  min-height: 44px;
  padding: 0 22px;
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  background: linear-gradient(#e2a04a, var(--accent));
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 3px 0 var(--nail);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  /* A held press (climbing, a long tap) must not select the label or open the phone's text menu. */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.act:hover,
.act.virtual-hover,
.act:focus-visible {
  background: linear-gradient(#f0b05a, #e2a04a);
  outline: none;
}

/* The factory foreman's on-screen tour menu and its End tour button, in the HUD's wood. */
.greeter-menu {
  position: fixed;
  z-index: 13;
  left: 50%;
  bottom: calc(122px + var(--safe-bottom));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 210px;
  max-width: min(320px, calc(100vw - 32px));
  padding: 10px 12px;
  background: linear-gradient(var(--plank), var(--wood));
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  box-shadow: 0 3px 0 var(--nail);
  text-align: center;
}

.greeter-menu-title,
.greeter-menu-help {
  margin: 0;
  color: var(--ink);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.greeter-menu-help {
  opacity: 0.7;
  letter-spacing: 0.04em;
  text-transform: none;
  white-space: pre-line;
}

.greeter-choice,
.greeter-stop {
  min-height: 36px;
  padding: 0 14px;
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  background: linear-gradient(#e2a04a, var(--accent));
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 2px 0 var(--nail);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.greeter-choice.sel,
.greeter-choice:hover,
.greeter-choice:focus-visible,
.greeter-stop:hover,
.greeter-stop:focus-visible {
  background: linear-gradient(#f0b05a, #e2a04a);
  outline: none;
}

.greeter-stop {
  position: fixed;
  z-index: 13;
  left: 50%;
  bottom: calc(122px + var(--safe-bottom));
  transform: translateX(-50%);
}

/* Tess's island offer and tour: the two choices share a row, and on tour the panel sits low, clear of the landmarks but above the toasts and the drawer's pull tabs. */
.greeter-row {
  display: flex;
  gap: 6px;
}

.greeter-row .greeter-choice {
  flex: 1;
  white-space: nowrap;
}

/* Asking her: the question box beside its Ask button, and the suggestions under it, each on one line. */
.greeter-ask {
  display: flex;
  gap: 6px;
}

.greeter-ask[hidden],
.greeter-chips[hidden] {
  display: none;
}

.greeter-ask input {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  padding: 0 10px;
  border: 2px solid var(--stone-dk);
  border-radius: 7px 6px 8px 6px;
  background: var(--tablet);
  box-shadow: var(--tablet-shadow);
  color: var(--paper);
  font-size: 12px;
  outline: none;
}

.greeter-ask input:focus-visible {
  border-color: var(--accent);
}

/* On a touch screen the panel keeps to the room between the two sticks, the keyboard's send key asks, and the box
   is 16px, under which a phone zooms into it. */
@media (pointer: coarse) {
  .greeter-menu {
    max-width: 210px;
  }

  .greeter-ask .greeter-choice {
    display: none;
  }

  .greeter-ask input {
    font-size: 16px;
  }
}

.greeter-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.greeter-chip {
  padding: 4px 8px;
  border: 1px solid var(--wood-edge);
  border-radius: 999px;
  background: var(--plank);
  color: var(--ink);
  font-size: 10px;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.greeter-chip:hover,
.greeter-chip:focus-visible {
  background: #e2a04a;
  outline: none;
}

/* While she thinks over one question, Ask and the suggestions wait. */
.greeter-choice:disabled,
.greeter-chip:disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

/* While her tour holds the view the look stick does nothing and steps aside; the move stick stays, since moving ends
   the tour and walks the Ooga. */
body.tess-touring #joy-look {
  visibility: hidden;
}

/* Each stop's view puts its landmark in the middle of the screen, and on a touch screen the sticks and an open drawer
   would lift the panel onto it. So her panel takes the equipment's slot under the top bar instead, matching its top in
   every layout below, and the equipment, which does nothing on tour, steps aside for it. */
@media (pointer: coarse) {
  body.tess-touring .equipment-hud {
    visibility: hidden;
    /* Equipped readouts set their own visibility; fade the whole group out too. */
    opacity: 0;
  }

  body.tess-touring .greeter-menu.greeter-tour {
    top: calc(62px + var(--safe-top));
    bottom: auto;
  }
}

@media (pointer: coarse) and (max-width: 720px) {
  body.tess-touring .greeter-menu.greeter-tour {
    top: calc(98px + var(--safe-top));
  }

  body.tess-touring .topbar:not(:has(.presets:not([hidden])))~.greeter-menu.greeter-tour {
    top: calc(55px + var(--safe-top));
  }
}

/* A short landscape screen has no room over the middle for both the panel and her bubble. She always flies to the
   view's right, so the panel docks at the left, beside the move stick (#joy-move), which an open drawer lifts to it. */
@media (pointer: coarse) and (max-height: 500px) and (orientation: landscape) {
  body.tess-touring .greeter-menu.greeter-tour {
    top: calc(62px + var(--safe-top));
    left: calc(32px + var(--stick-size) + var(--safe-left));
    transform: none;
  }
}

@media (pointer: coarse) and (max-width: 720px) and (max-height: 500px) and (orientation: landscape) {
  body.tess-touring .greeter-menu.greeter-tour {
    top: calc(64px + var(--safe-top));
  }

  body.tess-touring .topbar:has(.presets[data-scene="hub"]:not([hidden]))~.greeter-menu.greeter-tour {
    top: calc(96px + var(--safe-top));
  }
}

/* On tour the heading is two lines on purpose: where in the tour, then the stop's name. */
.greeter-menu.greeter-tour .greeter-menu-title {
  white-space: pre-line;
}

.greeter-menu.greeter-tour {
  bottom: calc(60px + var(--safe-bottom));
}

.race {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.race>* {
  pointer-events: auto;
}

.garage {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(880px, calc(100vw - 32px));
  max-height: calc(100% - 120px - var(--safe-top) - var(--safe-bottom));
  display: flex;
  flex-direction: column;
  padding: 14px 18px 16px;
  border: 3px solid var(--wood-edge);
  border-radius: var(--radius);
  background: var(--planks);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.35);
  color: var(--paper);
}

.garage-head h2,
.race-results h2,
.race-pause h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
}

/* A results or pause card's heading is plain bold text: carved lettering reads thin at this size, so its lettering
   (hud.js) is hidden and the words it carries as its label are shown in its place, whoever letters it and when. A
   title card keeps its big carved name. */
.race-results:not(.game-intro) > h2:has(> [data-sign]),
.race-pause > h2:has(> [data-sign]) {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.04em;
  color: var(--paper);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55);
}

:is(.race-results:not(.game-intro), .race-pause) > h2 [data-sign] .sign { display: none; }
:is(.race-results:not(.game-intro), .race-pause) > h2 [data-sign]::after { content: attr(aria-label); }

.garage-head .help {
  margin: 6px 0 0;
}

.garage .help {
  color: var(--paper);
  font-size: 12px;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7);
}

.garage-columns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
  min-height: 0;
  overflow: auto;
}

.garage-col h3 {
  margin: 0 0 6px;
}

.garage-list {
  list-style: none;
  margin: 0;
  padding: 2px 8px;
  background: var(--tablet);
  border: 2px solid var(--stone-dk);
  border-radius: 9px 7px 10px 8px;
  box-shadow: var(--tablet-shadow);
}

.garage-list li {
  border-bottom: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

.garage-list li:last-child {
  border-bottom: 0;
  box-shadow: none;
}

.garage-list button {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  margin: 3px 0;
  padding: 6px 8px;
  border: 2px solid transparent;
  background: transparent;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.garage-list button:hover,
.garage-list button.virtual-hover,
.garage-list button:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.garage-list button[aria-pressed="true"] {
  background: linear-gradient(#f0b05a, var(--accent));
  color: var(--ink);
  border: 2px solid var(--wood-edge);
  box-shadow: 0 3px 0 var(--nail), 0 0 14px rgba(240, 176, 90, 0.45);
  transform: translateX(2px);
  font-weight: 700;
}

.garage-list button[aria-pressed="true"] .garage-name::before {
  content: "\2713  ";
  font-weight: 700;
}

.garage-list button[aria-pressed="true"] .garage-note {
  color: var(--ink-muted);
}

.garage-list button[aria-pressed="true"] .garage-stat i {
  background: rgba(42, 26, 12, 0.22);
}

.garage-list button[aria-pressed="true"] .garage-stat i.on {
  background: var(--ink);
}

.garage-list button[aria-pressed="true"] .garage-medal {
  border-color: rgba(42, 26, 12, 0.35);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.22);
}

.garage-list button[aria-pressed="true"] .roster-state {
  border-color: currentColor;
  background: #25241f;
}

.garage-name {
  min-width: 0;
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.garage-note {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.garage-stat {
  grid-column: 1 / -1;
  display: flex;
  gap: 3px;
}

.garage-stat i {
  width: 6px;
  height: 10px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.14);
}

.garage-stat i.on {
  background: var(--ok);
}

.garage-medal {
  font-size: 9.5px;
  letter-spacing: 0.12em;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
}

.garage-medal[data-medal="gold"] {
  color: #f5c542;
  border-color: rgba(245, 197, 66, 0.5);
}

.garage-medal[data-medal="silver"] {
  color: #d8dde3;
  border-color: rgba(216, 221, 227, 0.5);
}

.garage-medal[data-medal="bronze"] {
  color: #d1762e;
  border-color: rgba(209, 118, 46, 0.5);
}

.garage-foot {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.race-cup {
  background: linear-gradient(#f0d060, #d8b12b);
}

.garage-cup {
  vertical-align: middle;
  margin-left: 8px;
  font-size: 9px;
}

.race-note {
  margin: 8px 0 0;
  color: var(--accent-text);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.race-standings-head {
  margin: 12px 0 0;
}

.race-standings li {
  padding: 4px 0;
}

.race-results .help,
.modal .help {
  margin: 12px 0 0;
  padding: 8px 12px;
  background: var(--tablet);
  border: 2px solid var(--stone-dk);
  border-radius: 9px 7px 10px 8px;
  box-shadow: var(--tablet-shadow);
  color: var(--paper);
  font-size: 11px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

/* The prompt is read and copied, so it takes the width a desktop can spare. */
#recipe {
  width: min(620px, calc(100vw - 32px));
}

.recipe {
  max-height: min(46vh, 420px);
  margin: 10px 0 0;
  padding: 10px 12px;
  overflow: auto;
  background: var(--tablet);
  border: 2px solid var(--stone-dk);
  border-radius: 9px 7px 10px 8px;
  box-shadow: var(--tablet-shadow);
  color: var(--paper);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 10.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overscroll-behavior: contain;
}

/* The board close-up shared by every readable board. */
.board-modal {
  width: 440px;
}

.board-screen {
  display: block;
  width: 100%;
  height: auto;
  margin: 10px 0 8px;
  border: 3px solid #1a1612;
  border-radius: 6px;
  background: #000;
  image-rendering: pixelated;
  box-shadow: 0 0 0 2px var(--stone-dk), 0 0 18px rgba(255, 216, 74, 0.18);
}

.chalk-modal {
  width: min(94vw, 1040px);
  max-width: none;
  max-height: min(96vh, 820px);
  padding: 14px;
  border: 7px solid #5b3924;
  border-radius: 12px;
  background: #6c4729;
  color: #f2ebd6;
  box-shadow: 0 28px 80px #000b, inset 0 0 0 3px #a27140;
  animation: chalk-zoom 220ms ease-out;
}

.chalk-modal::backdrop { background: #050b09b8; }

@keyframes chalk-zoom {
  from { opacity: 0; transform: scale(0.72); }
  to { opacity: 1; transform: scale(1); }
}

.chalk-head, .chalk-ledge { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chalk-head { margin: 0 0 10px; }
.chalk-head h2 { margin: 0; font-size: clamp(17px, 2vw, 24px); }
.chalk-close { width: 38px; height: 38px; border: 2px solid #d2a166; border-radius: 5px; background: #3f271a; color: #fff5dd; font-size: 28px; line-height: 1; cursor: pointer; }
.chalk-close:hover, .chalk-close:focus-visible { background: #694126; }

.chalk-frame {
  position: relative;
  overflow: hidden;
  border: 9px solid #4c3020;
  border-radius: 4px;
  background: #173b31;
  box-shadow: inset 0 0 0 2px #ac7941, 0 8px 18px #1b100b8c;
}

.chalk-frame canvas { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; touch-action: none; cursor: crosshair; }
.chalk-frame.has-tool canvas { cursor: none; }
.chalk-frame.typing canvas { cursor: text; }
.chalk-caret { position: absolute; width: 3px; height: 8%; background: #f2f3d6; box-shadow: 0 0 5px #f2f3d6; pointer-events: none; animation: chalk-caret-blink 1s steps(1) infinite; }
.chalk-caret[hidden] { display: none; }
.chalk-type-input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
@keyframes chalk-caret-blink { 50% { opacity: 0; } }

.chalk-ledge {
  min-height: 64px;
  padding: 9px 14px;
  background: linear-gradient(#9f7041, #724725);
  border: 2px solid #4c3020;
  border-top: 0;
  box-shadow: inset 0 3px #c19055;
}

.chalk-tool {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 95px;
  padding: 8px 12px;
  border: 2px solid #53351f;
  border-radius: 5px;
  background: #80522f;
  color: #fff3d8;
  font: inherit;
  cursor: pointer;
}
.chalk-tool[aria-pressed="true"], .chalk-tool:hover, .chalk-tool:focus-visible { background: #3a5a48; border-color: #d8e8c3; }
.chalk-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.chalk-actions button { padding: 7px 12px; border: 2px solid #53351f; border-radius: 5px; background: #80522f; color: #fff3d8; font: inherit; cursor: pointer; }
.chalk-actions button:hover, .chalk-actions button:focus-visible { background: #3a5a48; border-color: #d8e8c3; }
.chalk-actions button:disabled { opacity: 0.55; cursor: default; }
.chalk-actions .chalk-keyboard { display: grid; place-items: center; margin-right: auto; min-width: 42px; }
.chalk-keyboard svg { width: 24px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.chalk-keyboard[aria-pressed="true"] { background: #3a5a48; border-color: #d8e8c3; }
.chalk-hint { font-size: 13px; text-align: center; color: #f2dfbd; }
.chalk-eraser-shape { display: block; width: 32px; height: 18px; border: 2px solid #c6ad8c; border-radius: 3px; background: #403a35; box-shadow: inset 0 -4px #899280; transform: rotate(-13deg); }
.chalk-stick-shape { display: block; width: 30px; height: 8px; border-radius: 3px; background: #e5e8d0; box-shadow: 0 1px 3px #17241b; transform: rotate(-28deg); }

.chalk-pointer { position: absolute; display: none; width: 1px; height: 1px; pointer-events: none; z-index: 2; }
.chalk-pointer.visible { display: block; }
.chalk-pointer .chalk-held { position: absolute; left: -5px; top: -5px; width: 38px; height: 10px; border-radius: 4px; background: #e5e8d0; transform: rotate(-38deg) scale(2); transform-origin: 5px 5px; box-shadow: 0 2px 4px #061f18b0; }
/* A classic board eraser from above, lying sideways: a long pine block, grain running its length, a groove along each long side, and its thick black felt pad showing along the bottom edge. chalkboard.js sizes it to the eraser's footprint, and all its look stays inside that box. */
.chalk-pointer.eraser .chalk-held {
  left: 0; top: 0; box-sizing: border-box; border: 1px solid #8a6a3e; border-bottom-color: #121110; border-radius: 0;
  background:
    linear-gradient(180deg, #0000 0 74%, #8a6a3e 74% 77%, #3b3936 77%, #151413 86%, #1f1d1b),
    linear-gradient(180deg, #0000 0 10%, #8f7043 10% 15%, #f4e4c0 15% 18%, #0000 18% 56%, #8f7043 56% 61%, #f4e4c0 61% 64%, #0000 64%),
    repeating-linear-gradient(180deg, #a9855033 0 2%, #0000 2% 5%, #a9855022 5% 6%, #0000 6% 11%),
    linear-gradient(90deg, #ecd8ae, #dfc794);
  box-shadow: none; transform: translate(-50%, -50%);
}
/* Held upright: the same block turned, its felt along the right edge. */
.chalk-pointer.eraser.upright .chalk-held {
  border-bottom-color: #8a6a3e; border-right-color: #121110;
  background:
    linear-gradient(90deg, #0000 0 74%, #8a6a3e 74% 77%, #3b3936 77%, #151413 86%, #1f1d1b),
    linear-gradient(90deg, #0000 0 10%, #8f7043 10% 15%, #f4e4c0 15% 18%, #0000 18% 56%, #8f7043 56% 61%, #f4e4c0 61% 64%, #0000 64%),
    repeating-linear-gradient(90deg, #a9855033 0 2%, #0000 2% 5%, #a9855022 5% 6%, #0000 6% 11%),
    linear-gradient(#ecd8ae, #dfc794);
}

@media (max-width: 600px) {
  .chalk-modal { width: 98vw; padding: 7px; border-width: 4px; }
  .chalk-frame { border-width: 5px; }
  .chalk-ledge { padding: 7px; gap: 4px; }
  .chalk-tool { min-width: 68px; padding: 6px; font-size: 12px; }
  .chalk-hint { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) { .chalk-modal, .chalk-caret { animation: none; } }

.board-nav {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  grid-template-areas: "prev center next";
  align-items: center;
  gap: 8px;
}

.board-nav > .board-page:first-child { grid-area: prev; }
.board-nav > .board-center { grid-area: center; }
.board-nav > .board-page:last-child { grid-area: next; }

.board-page {
  display: grid;
  place-items: center;
  padding: 0;
  height: 32px;
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  background: var(--wood-edge);
  color: var(--paper);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.board-page svg {
  display: block;
  width: 1em;
  height: 1em;
  pointer-events: none;
}

.board-pause[aria-pressed="false"] .board-play,
.board-pause[aria-pressed="true"] .board-pause-bars {
  display: none;
}

/* A one-page board keeps the caption centred: the chevrons keep their columns, unseen. */
.board-page[hidden] {
  display: block;
  visibility: hidden;
}

.board-caption {
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.board-caption-above .board-caption {
  display: block;
  height: 18px;
  margin: 8px 0 4px;
  line-height: 18px;
  white-space: nowrap;
}

.board-caption-above .board-screen { margin-top: 0; }
.board-screen.board-pickable { cursor: pointer; }
.board-caption-above .board-dots { margin: 0; }

.board-modal.board-carousel {
  padding: 0 0 8px;
  border: 0;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.05) 0 2px, transparent 2px 11px), repeating-linear-gradient(180deg, var(--wood) 0 34px, var(--wood-edge) 34px 36px, var(--plank) 36px 70px, var(--wood-edge) 70px 72px);
}

.board-carousel .panel-head {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: center;
  box-sizing: border-box;
  height: 48px;
  padding-inline: 8px;
  border-bottom: 2px solid var(--wood-edge);
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.05) 0 2px, transparent 2px 11px), var(--wood);
}

.board-carousel .panel-head h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.board-carousel .board-dots { grid-column: 2; margin: 0; gap: 7px; }
.board-carousel .panel-head .modal-close {
  grid-column: 3;
  justify-self: end;
  width: 36px;
  height: 32px;
  margin: 0;
  background: var(--wood-edge);
  font-size: 22px;
}
.board-carousel .board-screen {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.board-carousel.board-caption-above .board-screen { margin-top: 0; }
.board-carousel .board-nav { grid-template-columns: 36px 44px 36px; justify-content: center; gap: 10px; margin-top: 8px; }
.board-carousel .board-note { margin: 8px 8px 0; }

.board-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.board-caption[hidden], .board-pause[hidden], .board-resize[hidden] {
  display: none;
}

.board-pause {
  width: 44px;
}

/* The Oogatron is a window over the island, without a modal backdrop or input barrier. */
.board-modal.board-floating[open] {
  position: fixed;
  inset: auto;
  margin: 0;
  max-width: none;
  max-height: none;
  padding: calc(8px * var(--board-scale)) 0;
  border: 0;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.05) 0 2px, transparent 2px 11px), repeating-linear-gradient(180deg, var(--wood) 0 34px, var(--wood-edge) 34px 36px, var(--plank) 36px 70px, var(--wood-edge) 70px 72px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: calc(8px * var(--board-scale));
  overflow: hidden;
  pointer-events: auto;
  z-index: 20;
}

.board-floating .panel-head {
  display: grid;
  grid-template-columns: calc(36px * var(--board-scale)) minmax(0, 1fr) calc(36px * var(--board-scale));
  align-items: center;
  padding-inline: calc(8px * var(--board-scale));
  cursor: move;
  touch-action: none;
  user-select: none;
}

.board-floating .panel-head h2 {
  display: none;
}

.board-filter[hidden], .board-filter-menu[hidden] { display: none; }
.board-filter svg { display: block; width: 1em; height: 1em; margin: auto; pointer-events: none; }
.board-filter[data-active="true"] { color: var(--accent); }
.board-filter-menu {
  position: absolute;
  z-index: 1;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: calc(8px * var(--board-scale));
  padding: calc(8px * var(--board-scale));
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  background: var(--tablet);
  font-size: calc(12px * var(--board-scale));
}
.board-rollup { display: flex; align-items: center; gap: calc(8px * var(--board-scale)); cursor: pointer; }
.board-rollup input { flex: none; width: calc(15px * var(--board-scale)); height: calc(15px * var(--board-scale)); margin: 0; accent-color: var(--accent); }
.board-filter-tabs { display: flex; gap: calc(6px * var(--board-scale)); }
.board-filter-tabs button, .board-filter-done {
  padding: calc(6px * var(--board-scale)) calc(10px * var(--board-scale));
  border: 2px solid var(--wood-edge);
  border-radius: 5px;
  background: var(--wood-edge);
  color: var(--paper);
  font: inherit;
  cursor: pointer;
}
.board-filter-tabs button { flex: 1; }
.board-filter-tabs [aria-selected="true"] { border-color: var(--accent); color: var(--accent); }
.board-filter-list { min-height: 0; overflow: auto; overscroll-behavior: contain; }
.board-filter-list label { display: flex; align-items: center; gap: calc(8px * var(--board-scale)); padding: calc(5px * var(--board-scale)); overflow-wrap: anywhere; cursor: pointer; }
.board-filter-list input { flex: none; width: calc(15px * var(--board-scale)); height: calc(15px * var(--board-scale)); margin: 0; accent-color: var(--accent); }

.board-floating .modal-close {
  margin: 0;
  width: calc(36px * var(--board-scale));
  height: calc(32px * var(--board-scale));
  background: var(--wood-edge);
  font-size: calc(22px * var(--board-scale));
}

.board-floating .board-screen {
  height: 100%;
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  object-fit: contain;
  cursor: pointer;
}

.board-floating.board-controls-hidden[open] {
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.board-floating.board-controls-hidden .panel-head,
.board-floating.board-controls-hidden .board-nav,
.board-floating.board-controls-hidden .board-resize {
  visibility: hidden;
}

.board-floating.board-controls-hidden .board-screen {
  pointer-events: auto;
}

.board-floating .board-nav {
  width: max-content;
  justify-self: center;
  grid-template-columns: calc(36px * var(--board-scale)) calc(44px * var(--board-scale)) calc(36px * var(--board-scale));
  gap: calc(10px * var(--board-scale));
}

.board-floating .board-page {
  height: calc(32px * var(--board-scale));
  font-size: calc(22px * var(--board-scale));
}

.board-floating .board-pause {
  width: calc(44px * var(--board-scale));
}

.board-floating .board-dots {
  margin: 0;
  gap: calc(7px * var(--board-scale));
}

.board-floating .board-dot {
  width: calc(12px * var(--board-scale));
  height: calc(12px * var(--board-scale));
}

.board-floating .help[hidden] {
  display: none;
}

.board-resize {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: calc(20px * var(--board-scale));
  height: calc(20px * var(--board-scale));
  padding: 0;
  border: 0;
  background: linear-gradient(135deg, transparent 0 56%, var(--wood-edge) 56% 62%, transparent 62% 70%, var(--wood-edge) 70% 76%, transparent 76% 84%, var(--wood-edge) 84% 90%, transparent 90%);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  cursor: nwse-resize;
  touch-action: none;
}

.board-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin: 10px 0 0;
}

.board-dots[hidden] {
  display: none;
}

.board-dot {
  position: relative;
  width: 12px;
  height: 12px;
  padding: 0;
  border: 2px solid var(--wood-edge);
  border-radius: 50%;
  background: var(--stone-dk);
  cursor: pointer;
}

/* A finger-sized target round each dot, overlapping into the gaps. */
.board-dot::before {
  content: "";
  position: absolute;
  inset: -6px;
}

.board-dot[aria-current="true"] {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(255, 216, 74, 0.55);
}

.board-note {
  margin: 10px 0 0;
  padding: 10px 12px;
  background: var(--tablet);
  border: 2px solid var(--stone-dk);
  border-radius: 9px 7px 10px 8px;
  box-shadow: var(--tablet-shadow);
  color: var(--paper);
  font-size: 11.5px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.board-note[hidden] {
  display: none;
}

.board-links {
  margin: 10px 0 0;
}

/* The model viewer: a machine up close in 3D, turned by a drag, beside its stats. Wide on desktop, the model on the
   left and its account in a column beside it; stacked on a phone, the model first. */
.model-modal {
  width: min(880px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  overscroll-behavior: contain;
}

.model-body {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.model-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin: 0 0 8px;
  border: 3px solid #1a1612;
  border-radius: 6px;
  background: radial-gradient(ellipse at 50% 38%, #3a332b 0%, #1d1915 62%, #120f0c 100%);
  cursor: grab;
  touch-action: none;
}

.model-canvas:active { cursor: grabbing; }

.model-canvas:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.model-view .help { margin: 8px 0 0; text-align: center; }

.model-kicker {
  margin: 0;
  color: var(--accent-text);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.model-name {
  margin: 2px 0 8px;
  font-size: 18px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.model-text {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.55;
}

.model-stats {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 5px 12px;
  margin: 0;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.24);
  border: 2px solid var(--wood-edge);
  border-radius: 8px;
}

.model-stats dt {
  color: var(--accent-text);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-top: 2px;
}

.model-stats dd {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.model-info .board-link { text-align: left; }

/* The Genesis Museum's own colours (Abyss Aurora), as the Ember Den keeps its own: cream words on near-black panels,
   a soft teal-blue for what can be pressed, gold for where a visitor stands in a run, Bitcoin's orange for the block. */
.genesis-portal, .wp-reader, .model-modal {
  --gn-text: #efe6d2; --gn-gold: #ffd66b; --gn-hint: #ffb04d; --gn-btc: #f7931a; --gn-teal: #3db8cc; --gn-teal-text: #9be4ef; --gn-paper: #15120f;
  --gn-panel: color-mix(in srgb, var(--bg) 82%, transparent); --gn-wash: color-mix(in srgb, var(--fg) 7%, transparent); --gn-line: color-mix(in srgb, var(--fg) 18%, transparent);
}
/* The Genesis room's pop-ups (`theme: "genesis"`): every block of words on a dark, slightly translucent panel of its
   own, so the cream type reads against the planks (body text on the panel is about 14:1 against it, well over AA's
   4.5:1); links on a panel too. */
.model-modal.model-genesis .model-info > .model-kicker,
.model-modal.model-genesis .model-info > .model-name,
.model-modal.model-genesis .model-info > .model-text,
.model-modal.model-genesis .model-info > .board-note,
.model-modal.model-genesis .model-info > .board-links {
  margin: 0 0 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--gn-panel);
}
.model-modal.model-genesis .model-info > .model-kicker { padding-bottom: 2px; border-radius: 8px 8px 0 0; margin-bottom: 0; }
.model-modal.model-genesis .model-info > .model-name { border-radius: 0 0 8px 8px; padding-top: 2px; }
.model-modal.model-genesis .model-info > .board-links { display: grid; gap: 6px; }
.model-modal.model-genesis .model-stats:empty { display: none; }
.model-modal.model-genesis .model-info > .board-links .board-link { background: var(--gn-wash); border-radius: 6px; padding: 4px 8px; }
.model-modal.model-genesis .model-canvas.model-page { background: var(--gn-paper); cursor: default; touch-action: auto; aspect-ratio: 17 / 22; max-height: min(58vh, 560px); width: auto; max-width: 100%; margin: 0 auto; display: block; }

@media (max-width: 720px) {
  .model-body { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .model-stats { grid-template-columns: minmax(0, 1fr); gap: 1px 0; }
  .model-stats dd { margin-bottom: 5px; }
}


.board-links[hidden] {
  display: none;
}

.board-link {
  display: block;
  margin: 4px 0 0;
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  overflow-wrap: anywhere;
}

.board-link[hidden] {
  display: none;
}

.board-caption-above .board-note {
  box-sizing: border-box;
  height: clamp(112px, 22dvh, 168px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* A wide board (the Timechain Sphere, a tall page of rows) gets a wide dialog on desktop: the page on the left,
   fitted to the window's height, and the caption, pages, note and help in a column beside it. Phones keep the
   default. */
@media (min-width: 721px) {
  .board-modal.board-wide {
    width: min(960px, calc(100vw - 32px));
  }

  .board-modal.board-wide[open] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    grid-template-rows: auto auto auto auto auto 1fr;
    grid-template-areas: "head head" "screen nav" "screen dots" "screen note" "screen help" "screen .";
    column-gap: 18px;
    align-items: start;
  }

  .board-wide .panel-head {
    grid-area: head;
  }

  .board-wide .board-screen {
    grid-area: screen;
    justify-self: center;
    width: min(100%, calc((100dvh - 140px) * var(--board-ratio, 1)));
    margin: 0;
  }

  .board-wide .board-nav {
    grid-area: nav;
  }

  .board-wide .board-dots {
    grid-area: dots;
  }

  .board-wide .board-note {
    grid-area: note;
  }

  .board-wide .help {
    grid-area: help;
  }
}

/* Live lecture screens get the viewport, with their controls below instead of a narrow side column. */
.board-modal.board-expanded[open] {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: min(1440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
}
.board-expanded .board-screen {
  align-self: center;
  flex: none;
  width: min(100%, calc(max(120px, 100dvh - 230px) * var(--board-ratio, 1)));
  margin: 0;
  image-rendering: auto;
  touch-action: none;
}
.board-expanded .board-note,
.board-expanded .help { margin: 0; }

/* A board whose page says its own note (a lesson's) gives the page the room: the note is kept for a screen reader
   and left out of sight, the links share one row, and the page takes nearly the whole window's height. */
.board-modal.board-expanded.board-plain[open] {
  width: min(1560px, calc(100vw - 16px));
  max-height: calc(100dvh - 16px);
  gap: 6px;
  padding-bottom: 12px;
}
.board-expanded.board-plain .board-screen {
  width: min(100%, calc(max(120px, 100dvh - 200px) * var(--board-ratio, 1)));
}
.board-expanded.board-plain .board-note {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.board-expanded.board-plain .board-dots { margin-top: 2px; }
.board-expanded.board-plain .board-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 18px;
  margin: 0;
}
.board-expanded.board-plain .board-links .board-link { margin: 0; }
.board-expanded.board-plain .help { padding: 3px 12px; text-align: center; }
/* On a short, wide window (a phone on its side) the page stands beside its controls. */
@media (max-height: 520px) and (min-width: 640px) {
  .board-modal.board-expanded.board-plain[open] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    grid-template-rows: auto auto auto auto 1fr;
    grid-template-areas: "head head" "screen nav" "screen dots" "screen links" "screen help";
    column-gap: 12px;
    align-items: start;
  }
  .board-expanded.board-plain .panel-head { grid-area: head; }
  .board-expanded.board-plain .board-screen { grid-area: screen; justify-self: center; width: min(100%, calc(max(120px, 100dvh - 84px) * var(--board-ratio, 1))); }
  .board-expanded.board-plain .board-nav { grid-area: nav; }
  .board-expanded.board-plain .board-dots { grid-area: dots; }
  .board-expanded.board-plain .board-links { grid-area: links; }
  .board-expanded.board-plain .help { grid-area: help; }
}

.recipe-actions {
  grid-template-columns: 1fr;
}

.race-results .actions {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.garage-foot .help {
  margin: 0;
}

.race-go {
  width: auto;
  margin: 0;
  padding: 0 26px;
  font-size: 18px;
}

.race-strip {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.race-hud {
  position: absolute;
  top: calc(74px + var(--safe-top));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: var(--tablet);
  border: 2px solid var(--stone-dk);
  border-radius: 9px 7px 10px 8px;
  box-shadow: var(--tablet-shadow);
  color: var(--paper);
  white-space: nowrap;
}

.race-hud-left {
  left: calc(16px + var(--safe-left));
}

.race-hud-right {
  right: calc(16px + var(--safe-right));
}

.race-rank {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.race-rank b {
  font-size: 30px;
  line-height: 1;
  color: var(--accent-text);
}

.race-rank span {
  font-size: 12px;
  color: var(--accent-text);
}

.race-rank small,
.race-lap small {
  color: var(--muted);
  font-size: 10px;
}

.race-lap {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.race-lap span,
.race-speed span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.race-lap b {
  font-size: 20px;
  line-height: 1;
}

.race-time {
  min-width: 8ch;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.race-item {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 2px solid var(--stone-dk);
  border-radius: 7px 6px 8px 6px;
  background: rgba(0, 0, 0, 0.35);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

.race-item[data-item="rock"],
.race-item[data-item="peel"],
.race-item[data-item="turbo"],
.race-item[data-item="shout"] {
  border-color: var(--accent);
  color: var(--paper);
  box-shadow: 0 0 12px rgba(216, 137, 43, 0.35);
}

.race-boost {
  width: 90px;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
}

.race-boost-fill {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #f5c542, #ffb13b);
}

.race-boost-fill.full {
  background: linear-gradient(90deg, #79d8ff, #fff);
}

/* The drift bar wears its tier's spark colour: orange, blue, purple. */
.race-boost-fill[data-tier="1"] {
  background: linear-gradient(90deg, #f5c542, #ffb13b);
}

.race-boost-fill[data-tier="2"] {
  background: linear-gradient(90deg, #79d8ff, #b9ecff);
}

.race-boost-fill[data-tier="3"] {
  background: linear-gradient(90deg, #c99bff, #ffffff);
}

.race-meter {
  display: grid;
  gap: 4px;
}

/* Ten banana pips under the bar, lit one at a time, gold when the turbo is ready. */
.race-pips {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
  width: 90px;
}

.race-pips i {
  display: block;
  height: 5px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.45);
}

.race-pips i[data-on="yes"] {
  background: #f5c542;
}

.race-pips i[data-on="full"] {
  background: #fff;
  box-shadow: 0 0 6px rgba(121, 216, 255, 0.9);
}

/* The item box shows the item itself, as its pixel icon, over a small name. */
.race-item {
  background-repeat: no-repeat;
  background-position: center 5px;
  background-size: 22px 22px;
  image-rendering: pixelated;
  align-content: end;
  padding-bottom: 3px;
}

.race-item[data-item="rock"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 9' shape-rendering='crispEdges'%3E%3Cpath fill='%239aa3ad' d='M1 1h5v1H1zM0 2h1v1H0zM6 2h1v1H6z'/%3E%3Cpath fill='%238a5a32' d='M3 2h1v1H3zM4 3h1v1H4zM5 4h1v1H5zM6 5h1v1H6zM7 6h1v2H7z'/%3E%3C/svg%3E");
}

.race-item[data-item="peel"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 9' shape-rendering='crispEdges'%3E%3Cpath fill='%23211b14' d='M0 0h1v5H0zM2 0h1v2H2zM3 2h1v2H3zM4 4h1v1H4zM1 5h1v2H1zM5 5h1v1H5zM6 6h1v1H6zM2 7h2v1H2zM7 7h1v1H7zM4 8h4v1H4z'/%3E%3Cpath fill='%23ffd84a' d='M1 2h2v2H1zM1 4h3v1H1zM2 5h3v1H2zM2 6h4v1H2zM4 7h3v1H4z'/%3E%3C/svg%3E");
}

.race-item[data-item="turbo"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 9' shape-rendering='crispEdges'%3E%3Cpath fill='%233a2a0a' d='M4 0h4v1H4zM3 1h1v2H3zM2 3h1v1H2zM1 4h1v1H1zM5 5h1v1H5zM4 6h1v1H4zM3 7h1v2H3z'/%3E%3Cpath fill='%23ffd84a' d='M4 1h3v1H4zM4 2h2v1H4zM3 3h4v1H3zM2 4h5v1H2zM4 5h1v1H4zM3 6h1v1H3z'/%3E%3C/svg%3E");
}

.race-item[data-item="shout"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 9' shape-rendering='crispEdges'%3E%3Cpath fill='%23ff8a73' d='M1 3h2v3H1zM3 2h1v5H3zM4 1h1v7H4z'/%3E%3Cpath fill='%23f3efe4' d='M6 2h1v1H6zM7 1h1v1H7zM6 4h2v1H6zM6 6h1v1H6zM7 7h1v1H7z'/%3E%3C/svg%3E");
}

.race-mirror {
  padding: 6px 10px;
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  background: var(--wood-edge);
  color: var(--paper);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.race-mirror[aria-pressed="true"] {
  background: linear-gradient(#f0b05a, var(--accent));
  color: var(--ink);
}

.race-speed {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.race-speed b {
  min-width: 2ch;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.race-center {
  position: absolute;
  left: 50%;
  top: 34%;
  transform: translate(-50%, -50%);
  font-size: 64px;
  font-weight: 700;
  color: var(--paper);
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.6), 0 0 24px rgba(216, 137, 43, 0.6);
  letter-spacing: 0.1em;
  pointer-events: none;
}

.block-struggle {
  position: absolute;
  left: 50%;
  top: 60%;
  transform: translate(-50%, -50%);
  width: min(260px, 66vw);
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--paper);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.block-struggle-bar {
  height: 16px;
  margin-top: 4px;
  border: 2px solid var(--paper);
  background: rgba(0, 0, 0, 0.6);
}

.block-struggle-bar i {
  display: block;
  height: 100%;
  background: #f2c230;
  transform: scaleX(0);
  transform-origin: left;
}

.race-notice {
  position: absolute;
  left: 50%;
  top: calc(84px + var(--safe-top));
  transform: translateX(-50%);
  padding: 6px 14px;
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  background: var(--planks);
  color: var(--paper);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.race-item-btn {
  left: auto;
  right: calc(24px + var(--safe-right));
  transform: none;
}

.race-results,
.race-pause {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 32px));
  padding: 16px 18px 18px;
  border: 3px solid var(--wood-edge);
  border-radius: var(--radius);
  background: var(--planks);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.35);
  color: var(--paper);
}

.race-podium {
  margin: 12px 0 0;
  padding: 2px 10px;
  background: var(--tablet);
  border: 2px solid var(--stone-dk);
  border-radius: 9px 7px 10px 8px;
  box-shadow: var(--tablet-shadow);
  list-style: none;
  counter-reset: place;
}

.race-podium li {
  display: grid;
  grid-template-columns: 2ch 1fr auto;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
  font-variant-numeric: tabular-nums;
}

.race-podium li:last-child {
  border-bottom: 0;
  box-shadow: none;
}

.race-podium li::before {
  counter-increment: place;
  content: counter(place);
  color: var(--accent-text);
  font-weight: 700;
}

.race-podium li.you {
  color: #f5c542;
}

/* A race's table and, in a cup, the standings under it can outgrow the window: the card holds to it and
   its tables give up their height, each scrolling on its own (the HUD opens them at the visitor's row). A
   window too short for that scrolls the card instead. */
#race-results:not([hidden]) {
  display: flex;
  flex-direction: column;
  max-height: calc(100% - 32px - var(--safe-top) - var(--safe-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
}

@media (min-height: 600px) {
  #race-results .race-podium {
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

.race-pause .actions {
  grid-template-columns: 1fr 1fr;
}

.drop-columns {
  grid-template-columns: 1fr 1fr;
}

.drop-rows {
  margin: 0;
  padding: 2px 10px;
  list-style: none;
}

.drop-rows li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
  font-variant-numeric: tabular-nums;
}

.drop-rows li:last-child {
  border-bottom: 0;
  box-shadow: none;
}

.drop-rows li::before {
  content: none;
}

.drop-rows li > span:first-child {
  white-space: nowrap;
}

.drop-rows li > span:last-child {
  min-width: 0;
  color: var(--accent-text);
  font-weight: 600;
  text-align: right;
}

.drop-rows .fact {
  white-space: nowrap;
}

.orbit-final {
  display: grid;
  justify-items: center;
  gap: 2px;
  margin: 10px 0 0;
  padding: 10px 12px 12px;
  background: var(--tablet);
  border: 2px solid var(--stone-dk);
  border-radius: 10px 8px 11px 9px;
  box-shadow: var(--tablet-shadow);
}

.orbit-final-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.orbit-final b {
  font-size: 44px;
  line-height: 1;
  font-weight: 800;
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
}

.orbit-final.is-best b {
  color: #f5c542;
}

.orbit-final.is-shown b {
  animation: orbit-final-pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1);
}

.orbit-final-tags {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 18px;
}

.orbit-final-tags .garage-medal {
  font-size: 11px;
}

.orbit-final-best {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.orbit-final.is-best .orbit-final-best {
  color: #f5c542;
  font-weight: 700;
}

@keyframes orbit-final-pop {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
}

.orbit-panel {
  top: calc(74px + var(--safe-top));
  bottom: calc(16px + var(--safe-bottom));
  transform: none;
  width: min(340px, calc(50vw - 24px));
  max-height: none;
  padding: 12px 14px 14px;
}

.orbit-build {
  left: calc(12px + var(--safe-left));
}

.orbit-rocket {
  left: auto;
  right: calc(70px + var(--safe-right));
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.orbit-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
}

.orbit-head .help {
  margin: 6px 0 0;
}

.orbit-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 10px;
}

.orbit-tab {
  flex: 1 1 auto;
  padding: 5px 8px;
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  background: var(--wood-edge);
  color: var(--paper);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.orbit-tab[aria-pressed="true"] {
  background: linear-gradient(#f0b05a, var(--accent));
  color: var(--ink);
  box-shadow: 0 2px 0 var(--nail);
}

.orbit-parts {
  flex: 1;
  min-height: 0;
  margin-top: 8px;
  padding: 8px;
  overflow: auto;
  background: var(--tablet);
  border: 2px solid var(--stone-dk);
  border-radius: 9px 7px 10px 8px;
  box-shadow: var(--tablet-shadow);
}

.orbit-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.orbit-tile {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 6px 6px 8px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.25) 70%);
  color: var(--paper);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.orbit-tile:hover,
.orbit-tile:focus-visible {
  border-color: var(--accent);
  outline: none;
  transform: translateY(-2px);
}

.orbit-tile:active {
  transform: translateY(1px);
}

.orbit-tile canvas {
  width: 56px;
  height: 56px;
  image-rendering: pixelated;
}

.orbit-tile-name {
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
}

/* A tile's note is one or two short lines, split on purpose with a newline. Nothing in a tile truncates. */
.orbit-tile-stat {
  max-width: 100%;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
  text-align: center;
  white-space: pre-line;
}

.orbit-tile .orbit-price {
  position: absolute;
  top: 5px;
  right: 5px;
}

.orbit-price {
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(245, 197, 66, 0.16);
  color: #f5c542;
  font-size: 10.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.orbit-keys {
  margin: 8px 0 0;
  white-space: pre-line;
  color: var(--paper);
  font-size: 10.5px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7);
}

.orbit-rocket-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.orbit-rocket-head h3 {
  margin: 0;
  white-space: nowrap;
  color: var(--paper);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
}

.orbit-rocket-head small {
  color: var(--muted);
  letter-spacing: 0.04em;
}

.orbit-pilot {
  padding: 4px 9px;
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--paper);
  font-size: 11px;
  cursor: pointer;
}

.orbit-pilot b {
  color: #f5c542;
}

/* A signed-in visitor flies their own Ooga: the button still names them, but no longer turns. */
.orbit-pilot:disabled {
  cursor: default;
}

.orbit-ready {
  display: grid;
  gap: 8px;
  padding: 8px 10px;
  background: var(--tablet);
  border: 2px solid var(--stone-dk);
  border-radius: 9px 7px 10px 8px;
  box-shadow: var(--tablet-shadow);
}

.orbit-ready-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 8px;
  align-items: baseline;
}

.orbit-ready-row span:first-child {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.orbit-ready-row b {
  font-variant-numeric: tabular-nums;
}

.orbit-track {
  position: relative;
  grid-column: 1 / -1;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
}

.orbit-track-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, #f5c542, #ffb13b);
  transition: width 0.25s ease;
}

.orbit-track-fill[data-state="ok"] {
  background: linear-gradient(90deg, #22c55e, #b8f0c8);
}

.orbit-track-fill[data-state="bad"] {
  background: linear-gradient(90deg, #ff6a3a, #e5533d);
}

.orbit-track-mark {
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: 50%;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

.orbit-track-twr .orbit-track-mark {
  left: 33.3%;
}

.orbit-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.orbit-facts li {
  display: flex;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  font-size: 10.5px;
}

.orbit-facts li span:first-child {
  color: var(--muted);
}

.orbit-facts li[data-warn="warn"] span:last-child {
  color: var(--warn);
}

.orbit-stack {
  flex: 1;
  min-height: 60px;
  margin: 0;
  padding: 4px 8px;
  overflow: auto;
  list-style: none;
  background: var(--tablet);
  border: 2px solid var(--stone-dk);
  border-radius: 9px 7px 10px 8px;
  box-shadow: var(--tablet-shadow);
}

.orbit-stage-head {
  margin: 6px 0 2px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--hue);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.orbit-stack li:not(.orbit-stage-head):not(.orbit-empty) {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px;
}

.orbit-stage-head:first-child {
  margin-top: 2px;
  padding-top: 0;
  border-top: 0;
}

.orbit-stack li[data-selected="true"] {
  background: rgba(240, 176, 90, 0.18);
}

.orbit-stack .orbit-row-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 1px 2px;
  border: 0;
  background: transparent;
  color: var(--paper);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.orbit-mini {
  width: 26px;
  height: 26px;
  image-rendering: pixelated;
}

.orbit-tools {
  display: flex;
  gap: 2px;
  opacity: 0.55;
}

.orbit-stack li:hover .orbit-tools,
.orbit-stack li[data-selected="true"] .orbit-tools {
  opacity: 1;
}

.orbit-stack .orbit-tool {
  width: 24px;
  height: 24px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--paper);
  cursor: pointer;
}

.orbit-stack .orbit-remove:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.orbit-empty {
  padding: 10px 4px;
  color: var(--muted);
  font-size: 11px;
}

.orbit-ready-rockets h4 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 5px;
}

.orbit-clear {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-decoration: underline;
  text-transform: none;
  cursor: pointer;
}

.orbit-clear:hover {
  color: var(--paper);
}

.orbit-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.orbit-preset {
  display: grid;
  gap: 2px;
  padding: 8px 6px;
  border: 2px solid var(--wood-edge);
  border-radius: 8px;
  background: linear-gradient(#f5c870, var(--accent));
  color: var(--ink);
  text-align: center;
  box-shadow: 0 3px 0 var(--nail), 0 0 14px rgba(240, 176, 90, 0.35);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.orbit-preset:hover,
.orbit-preset:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 var(--nail), 0 0 20px rgba(245, 197, 66, 0.6);
  outline: none;
}

.orbit-preset:active {
  transform: translateY(1px);
}

.orbit-preset[aria-pressed="true"] {
  background: linear-gradient(#ffe39a, #f5c542);
  border-color: #fff4cf;
  box-shadow: 0 3px 0 var(--nail), 0 0 22px rgba(255, 228, 140, 0.8);
}

.orbit-preset-name {
  font-size: 13px;
  font-weight: 800;
}

.orbit-preset[aria-pressed="true"] .orbit-preset-name::before {
  content: "\2713 ";
}

.orbit-preset-note {
  font-size: 9.5px;
  white-space: pre-line;
  opacity: 0.75;
}

.orbit-problems {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 11px;
}

.orbit-problems li {
  margin: 2px 0;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

.orbit-problems li[data-warn="bad"] {
  color: #ffb4a6;
}

.orbit-problems li[data-warn="warn"] {
  color: #f3dfa0;
}

.orbit-problems li[data-warn="ok"] {
  color: #b8f0c8;
}

.orbit-launch {
  width: 100%;
  margin: 0;
}

.orbit-tile,
.orbit-stack li[data-index] {
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.orbit-tile {
  cursor: grab;
}

body.orbit-dragging,
body.orbit-dragging * {
  cursor: grabbing !important;
  user-select: none;
}

body.orbit-dragging #tooltip {
  display: none;
}

.orbit-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: rgba(20, 16, 12, 0.92);
  color: var(--paper);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.orbit-ghost .orbit-mini {
  width: 34px;
  height: 34px;
}

.orbit-ghost[data-remove="true"] {
  border-color: var(--danger);
  color: #ffb4a6;
}

.orbit-ghost[data-remove="true"]::after {
  content: "remove";
  color: var(--danger);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.orbit-drop-line {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 49;
  height: 4px;
  border-radius: 2px;
  background: #f5c542;
  box-shadow: 0 0 10px rgba(245, 197, 66, 0.9);
  pointer-events: none;
}

.orbit-launch:disabled {
  filter: grayscale(0.8) brightness(0.8);
  cursor: not-allowed;
}

.orbit-card-panel {
  position: absolute;
  top: calc(74px + var(--safe-top));
  padding: 10px 12px 12px;
  border: 3px solid var(--wood-edge);
  border-radius: var(--radius);
  background: var(--planks);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.35);
  color: var(--paper);
  pointer-events: none;
}

.orbit-card-panel h3 {
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

.orbit-mission-card {
  left: calc(16px + var(--safe-left));
  width: 290px;
}

.orbit-eva {
  width: 100%;
  margin-top: 8px;
  padding: 7px 14px;
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  background: linear-gradient(#7fe0ff, #3fa9c9);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.4);
  cursor: pointer;
  pointer-events: auto;
}

.orbit-eva small {
  font-weight: 600;
  opacity: 0.7;
}

.orbit-mission {
  margin: 0;
  padding: 6px 10px;
  list-style: none;
  counter-reset: step;
  background: var(--tablet);
  border: 2px solid var(--stone-dk);
  border-radius: 9px 7px 10px 8px;
  box-shadow: var(--tablet-shadow);
  pointer-events: none;
}

.orbit-mission li {
  display: grid;
  grid-template-columns: 1.6em 1fr;
  padding: 3px 0;
  color: var(--faint);
  font-size: 11px;
}

.orbit-mission li::before {
  counter-increment: step;
  content: counter(step);
  grid-row: span 2;
  color: var(--faint);
  font-weight: 700;
}

.orbit-detail {
  grid-column: 2;
  font-size: 10px;
  letter-spacing: 0.03em;
}

.orbit-mission li:not([data-state="now"]) .orbit-detail {
  display: none;
}

.orbit-mission li[data-state="now"] {
  color: var(--paper);
  font-weight: 700;
}

.orbit-mission li[data-state="now"]::before {
  content: "\25B6";
  color: #f5c542;
}

.orbit-mission li[data-state="now"] .orbit-detail {
  color: #f5c542;
  font-weight: 600;
}

.orbit-mission li[data-state="done"] {
  color: #b8f0c8;
}

.orbit-mission li[data-state="done"]::before {
  content: "\2713";
  color: var(--ok);
}

.orbit-mission li[data-state="missed"] {
  color: var(--faint);
  text-decoration: line-through;
}

.orbit-flight {
  right: calc(70px + var(--safe-right));
  width: 240px;
}

.orbit-flight-head,
.orbit-flight-body {
  padding: 8px 10px;
  background: var(--tablet);
  border: 2px solid var(--stone-dk);
  border-radius: 9px 7px 10px 8px;
  box-shadow: var(--tablet-shadow);
}

.orbit-flight-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
}

.orbit-big {
  grid-row: span 2;
  display: flex;
  flex-direction: column;
}

.orbit-big span,
.orbit-small span,
.orbit-meter span:first-child {
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.orbit-big b {
  color: #f5c542;
  font-size: 32px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.orbit-big small {
  color: var(--muted);
  font-size: 9.5px;
}

.orbit-small {
  text-align: right;
}

.orbit-small b {
  display: block;
  font-size: 16px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.orbit-small small {
  color: var(--muted);
}

.orbit-flight-body {
  display: grid;
  grid-template-columns: 1fr 46px;
  gap: 10px;
  margin-top: 8px;
}

.orbit-meters {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.orbit-meter {
  display: grid;
  gap: 3px;
}

.orbit-meter .race-boost {
  width: 100%;
  height: 8px;
}

.orbit-altimeter {
  position: relative;
  justify-self: end;
  width: 16px;
  height: 190px;
  border: 2px solid var(--wood-edge);
  border-radius: 999px;
  background: linear-gradient(0deg, rgba(47, 163, 184, 0.45), rgba(8, 10, 24, 0.8) 40%, rgba(0, 0, 0, 0.9));
}

.orbit-alt-fill {
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 2px;
  height: 0;
  max-height: calc(100% - 4px);
  border-radius: 999px;
  background: linear-gradient(0deg, #ff8a2a, #f5c542);
}

.orbit-alt-mark {
  position: absolute;
  right: 20px;
  transform: translateY(50%);
  color: var(--muted);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.orbit-alt-mark::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -20px;
  width: 18px;
  border-top: 1px solid currentColor;
}

.orbit-alt-top {
  bottom: 100%;
  color: #7fe0ff;
  font-weight: 700;
}

.orbit-alt-air {
  bottom: 30%;
}

.orbit-alt-pad {
  bottom: 8.5%;
}

.orbit-alt-now {
  position: absolute;
  left: -5px;
  right: -5px;
  bottom: 0;
  height: 4px;
  transform: translateY(50%);
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

.orbit-fill[data-state="warn"] {
  background: linear-gradient(90deg, #f0b05a, #ff8a2a);
}

.orbit-fill[data-state="bad"] {
  background: linear-gradient(90deg, #ff6a3a, #e5533d);
}

.orbit-fill[data-state="ok"] {
  background: linear-gradient(90deg, #22c55e, #b8f0c8);
}

.orbit-hot {
  background: linear-gradient(90deg, #d8892b, #ffb13b);
}

#orbit-notice {
  top: auto;
  bottom: calc(12% + var(--safe-bottom));
  max-width: min(560px, calc(100vw - 32px));
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(24, 19, 14, 0.9), rgba(12, 10, 8, 0.9));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  color: var(--paper);
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 0.02em;
  text-align: center;
  text-transform: none;
  animation: orbit-callout 0.28s ease-out;
}

#orbit-notice kbd {
  display: inline-block;
  min-width: 1.6em;
  margin: 0 2px;
  padding: 0 7px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-bottom-width: 3px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: #f5c542;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

@keyframes orbit-callout {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  #orbit-notice,
  .orbit-final.is-shown b {
    animation: none;
  }
}

.orbit-gauge {
  position: absolute;
  left: 50%;
  bottom: calc(22% + var(--safe-bottom));
  width: min(360px, calc(100vw - 48px));
  height: 20px;
  transform: translateX(-50%);
  border: 3px solid var(--wood-edge);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.55);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.orbit-gauge-green,
.orbit-gauge-gold,
.orbit-needle {
  position: absolute;
  top: 0;
  bottom: 0;
}

.orbit-gauge-green {
  left: 55%;
  width: 31%;
  background: rgba(34, 197, 94, 0.55);
}

.orbit-gauge-gold {
  left: 66%;
  width: 12%;
  background: rgba(245, 197, 66, 0.8);
}

.orbit-needle {
  left: 0;
  width: 0;
  border-right: 3px solid #fff;
  background: linear-gradient(90deg, rgba(255, 106, 30, 0.25), rgba(255, 179, 59, 0.6));
}

[hidden] {
  display: none !important;
}

@media (pointer: coarse) {
  .scanlines {
    display: none;
  }

  .joysticks,
  .bottom-hud>.act {
    display: block;
  }

  .mine-mini,
  .mine-card-close,
  .mine-ops-tabs .orbit-tab {
    min-height: 32px;
  }

  .mine-card-close {
    width: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {

  .toast,
  .hint {
    transition: none;
  }

  .curtain-half,
  .curtain-label {
    transition-duration: 0.2s;
  }

  .curtain-spinner {
    animation: none;
  }
}

/* Every environment shares one banner; hud.js fits its visible controls from phone to desktop. */
body[data-active-scene] {
  --hub-title-font: clamp(13px, calc(8.62px + 1.2162vw), 22px);
  --hub-meta-font: clamp(10.5px, calc(9.77px + 0.2027vw), 12px);
  --hub-banner-gutter: clamp(8px, 1.5vw, 16px);
}

body[data-active-scene] .topbar {
  min-height: calc(52px + var(--safe-top));
  padding-left: calc(var(--hub-banner-gutter) + var(--safe-left));
  padding-right: calc(var(--hub-banner-gutter) + var(--safe-right));
}

/* Reserve the mainland's subtitle row even in environments without a subtitle. */
body[data-active-scene] .brand {
  display: grid;
  grid-template-rows: auto calc(var(--hub-meta-font) * 1.4);
  row-gap: 2px;
  width: max-content;
}
body[data-active-scene] .brand h1 { font-size: var(--hub-title-font); white-space: nowrap; }
body[data-active-scene] .brand p { margin: 0; font-size: var(--hub-meta-font); }

body[data-active-scene] .world-clock,
body[data-active-scene] .world-block {
  right: calc(var(--hub-banner-gutter) + var(--safe-right));
  left: auto;
  margin: 0;
}

body[data-active-scene] .world-clock { font-size: var(--hub-title-font); }
body[data-active-scene] .world-block {
  top: calc(15px + var(--hub-title-font) + var(--safe-top));
  width: max-content;
  justify-content: flex-end;
  font-size: var(--hub-meta-font);
}

body[data-active-scene] #equipment-hud {
  top: var(--hub-equipment-top, calc(62px + var(--safe-top)));
  left: var(--hub-equipment-left, calc(var(--hub-banner-gutter) + var(--safe-left)));
  grid-template-columns: max-content;
}

body[data-active-scene] .weapon-equipment-row {
  width: max-content;
  gap: clamp(4px, calc(2px + 0.55vw), 8px);
  flex-wrap: nowrap;
  transform: scale(var(--hub-equipment-scale, 0.85));
  transform-origin: top left;
}

body[data-active-scene] .weapon-equipment-row .magazine-hud { margin-right: 0; }
body[data-active-scene] .weapon-hud { transition: background 0.15s ease, transform 0.15s ease; }

body[data-active-scene] .equipment-hud[data-banner="below"] .weapon-equipment-row {
  width: var(--hub-equipment-width);
  flex-wrap: wrap;
}

body[data-active-scene] .equipment-hud:is([data-banner="compact"], [data-banner="below"]) .weapon-hud[data-equipped="true"] { width: 78px; }
body[data-active-scene] .equipment-hud:is([data-banner="compact"], [data-banner="below"]) .weapon-hud[data-equipped="true"] .weapon-readout {
  opacity: 0;
  visibility: hidden;
}
body[data-active-scene] .equipment-hud:is([data-banner="compact"], [data-banner="below"]) .weapon-hud[data-equipped="true"] .weapon-compact {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

body[data-active-scene] .sheet[data-dock="right"][data-sized="false"] { top: calc(72px + var(--safe-top)); }
body[data-active-scene] .mic-note { top: var(--hub-equipment-bottom, calc(72px + var(--safe-top))); }

@media (max-width: 720px) {
  body[data-active-scene] #equipment-hud~.bottom-hud>#message-stack {
    top: var(--hub-equipment-bottom, calc(118px + var(--safe-top)));
    left: calc(var(--hub-banner-gutter) + var(--safe-left));
  }
}

@media (max-width: 720px) {
  .topbar {
    grid-template-columns: auto 1fr;
    gap: 10px;
    padding-right: calc(12px + var(--safe-right));
    padding-left: calc(12px + var(--safe-left));
  }

  .brand p {
    display: block;
    font-size: 10.5px;
  }

  .brand h1 {
    font-size: 13px;
  }

  .world-clock {
    top: calc(10px + var(--safe-top));
    right: calc(12px + var(--safe-right));
    left: auto;
    margin: 0;
    font-size: 13px;
  }

  .world-block {
    top: calc(27px + var(--safe-top));
    right: calc(12px + var(--safe-right));
    left: auto;
    justify-content: flex-start;
    font-size: 10.5px;
  }

  .presets {
    grid-column: 1 / -1;
    justify-content: center;
    gap: 6px;
  }

  .presets button {
    flex: 1;
    min-height: 28px;
    padding: 0 6px;
    font-size: 10px;
  }

  .presets[data-scene="hub"] {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .presets[data-scene="hub"] button {
    flex: 1 0 52px;
    min-height: 32px;
    padding: 0 6px;
  }

  .presets .leave span {
    display: none;
  }

  /* The foot keeps the wide panel's 10px, so the room under a footer matches the gap over it. */
  .panel {
    padding: 12px 14px 10px;
  }

  /* Under 16px a phone zooms the page into the input. */
  .chat-form input,
  .chat-display-form input {
    font-size: 16px;
  }

  #qr {
    width: 120px;
    height: 120px;
  }

  .message-stack {
    position: absolute;
    z-index: 5;
    left: calc(12px + var(--safe-left));
    right: calc(12px + var(--safe-right));
    top: calc(114px + var(--safe-top));
    display: flex;
    width: min(220px, calc(100vw - 24px - var(--safe-left) - var(--safe-right)));
    flex-direction: column;
    align-items: stretch;
    pointer-events: none;
  }

  .message-stack>.toast,
  .message-stack>.hint {
    position: relative;
    inset: auto;
    width: 100%;
    max-width: 100%;
    max-height: 0;
    margin-top: 0;
    padding: 0;
    transform: translateY(8px);
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    line-height: 1.35;
    white-space: normal;
    text-align: left;
    text-overflow: clip;
    overflow: hidden;
    text-shadow: 0 1px 2px #000, 0 0 6px rgba(0, 0, 0, 0.85);
    transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.3s ease, margin-top 0.3s ease;
  }

  .topbar:has(.presets[data-scene="hub"]:not([hidden]))~.bottom-hud>.message-stack {
    top: calc(94px + var(--safe-top));
  }

  #equipment-hud:has(.weapon-hud:not([hidden]), .magazine-hud:not([hidden]), .jetpack-hud:not([hidden]), .gorilla-hud:not([hidden]))~.bottom-hud>.message-stack {
    --equipment-height: 56px;
    top: calc(98px + var(--equipment-height) + var(--safe-top));
  }

  #equipment-hud:has(.weapon-hud:not([hidden]), .magazine-hud:not([hidden])):has(.jetpack-hud:not([hidden]))~.bottom-hud>.message-stack {
    --equipment-height: 56px;
  }

  .message-stack>.toast.show,
  .message-stack>.hint.show {
    max-height: 7em;
    margin-top: 4px;
    transform: translateY(0);
  }

  :root {
    --stick-inset: 84px;
    --stick-size: 100px;
    --act-inset: 112px;
  }

  .equipment-hud {
    top: calc(98px + var(--safe-top));
    left: calc(12px + var(--safe-left));
  }

  .topbar:not(:has(.presets:not([hidden])))~.equipment-hud {
    top: calc(55px + var(--safe-top));
  }

  .garage {
    max-height: calc(100% - 90px - var(--safe-top) - var(--safe-bottom));
    padding: 10px 12px 12px;
  }

  .garage-columns,
  .drop-columns {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .garage-foot {
    grid-template-columns: 1fr 1fr;
  }

  .garage-foot .help {
    display: none;
  }

  .race-hud {
    top: calc(100px + var(--safe-top));
    gap: 8px;
    padding: 6px 10px;
  }

  .garage-list button {
    min-height: 44px;
    margin: 2px 0;
    padding: 4px 8px;
  }

  .garage-head .help {
    display: none;
  }

  .race-hud-left {
    left: calc(10px + var(--safe-left));
  }

  .race-hud-right {
    right: calc(10px + var(--safe-right));
  }

  .race-speed {
    display: none;
  }

  .race-hud-right {
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 170px;
  }

  /* Drift beside Throw, both under the right thumb; the stick keeps the left. Throw carries .act too, so
     this names Drift alone, or Throw lands exactly under it. */
  body[data-active-scene="race"] #act {
    left: auto;
    right: calc(126px + var(--safe-right));
    transform: none;
  }

  #garage-racers {
    display: grid;
    grid-template-columns: 1fr;
  }

  .race-center {
    font-size: 44px;
  }

  .race-item-btn {
    bottom: calc(max(48px, var(--act-inset) - var(--home-chrome)) + var(--safe-bottom));
  }
}

@media (min-width: 620px) and (max-width: 720px) {
  .sheet[data-dock="bottom"] .panel[data-panel="roster"] > .roster {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
  }

  .sheet[data-dock="bottom"] .panel[data-panel="roster"] > .roster li {
    grid-column: auto;
    grid-template-columns: 8px minmax(0, 1fr) 26px max-content 6.5ch;
  }

  .sheet[data-dock="bottom"] .panel[data-panel="roster"] > .roster li.roster-away {
    grid-column: 1 / -1;
  }

}

/* Keep full-size weapon readouts on phones; spares move onto their own row. */
@media (max-width: 430px) {
  .weapon-equipment-row {
    flex-wrap: wrap;
    width: calc(100vw - 24px - var(--safe-left) - var(--safe-right));
  }

  .weapon-equipment-row .magazine-hud {
    margin-right: calc(100% - 78px);
  }

  #equipment-hud:has(.magazine-hud:not([hidden]))~.bottom-hud>.message-stack {
    --equipment-height: 116px;
  }

  #equipment-hud:has(.magazine-hud:not([hidden])):has(.jetpack-hud:not([hidden]))~.bottom-hud>.message-stack {
    --equipment-height: 116px;
  }
}

@media (max-width: 360px) {
  .equipment-hud { left: calc(8px + var(--safe-left)); }
  .weapon-equipment-row { width: calc(100vw - 16px - var(--safe-left) - var(--safe-right)); }
}

@media (max-height: 500px) and (orientation: landscape) {
  .equipment-hud {
    top: calc(62px + var(--safe-top));
  }

  #equipment-hud:has(.weapon-hud:not([hidden]), .magazine-hud:not([hidden])):has(.jetpack-hud:not([hidden]))~.bottom-hud>.message-stack {
    --equipment-height: 116px;
  }

  .presets {
    grid-column: 3;
  }

  .toast,
  .hint {
    left: 16px;
    right: auto;
    top: auto;
    bottom: calc(16px + var(--safe-bottom));
    transform: translate(0, 8px);
    max-width: calc(100vw - 340px);
  }

  .topbar:has(.presets[data-scene="hub"]:not([hidden]))~.toast,
  .topbar:has(.presets[data-scene="hub"]:not([hidden]))~.hint {
    top: auto;
  }

  :root {
    --stick-inset: 70px;
    --stick-size: 96px;
    --act-inset: 96px;
  }

  .act {
    left: auto;
    right: calc(140px + var(--safe-right));
    z-index: 13;
    transform: none;
  }

  .race-item-btn {
    right: calc(330px + var(--safe-right));
  }

  .race-hud {
    top: calc(64px + var(--safe-top));
  }

  .garage {
    top: calc(58px + var(--safe-top));
    transform: translateX(-50%);
    max-height: calc(100% - 66px - var(--safe-top));
    padding: 8px 12px 10px;
  }

  .garage-head .help,
  .garage-foot .help {
    display: none;
  }

  .garage-foot {
    grid-template-columns: auto auto;
    justify-content: end;
  }

  .garage-list button {
    min-height: 32px;
    margin: 2px 0;
    padding: 3px 8px;
  }

  .toast.show,
  .hint.show {
    transform: translate(0, 0);
  }
}

@media (max-width: 720px) and (max-height: 500px) and (orientation: landscape) {
  .equipment-hud {
    top: calc(64px + var(--safe-top));
  }

  .topbar:has(.presets[data-scene="hub"]:not([hidden]))~.equipment-hud {
    top: calc(96px + var(--safe-top));
  }
}

@media (max-width: 720px) {
  .orbit-panel {
    top: auto;
    bottom: calc(8px + var(--safe-bottom));
    height: 46vh;
    width: calc(50vw - 12px);
    padding: 8px 9px 10px;
  }

  .orbit-build {
    left: calc(6px + var(--safe-left));
  }

  .orbit-rocket {
    right: calc(6px + var(--safe-right));
  }

  .orbit-head .help,
  .orbit-keys,
  .orbit-tile-stat,
  .orbit-facts {
    display: none;
  }

  .orbit-head h2 {
    font-size: 16px;
  }

  .orbit-tab {
    padding: 3px 5px;
    font-size: 9.5px;
  }

  .orbit-tiles {
    grid-template-columns: 1fr;
  }

  .orbit-tile canvas {
    width: 40px;
    height: 40px;
  }

  .orbit-ready {
    padding: 5px 7px;
    gap: 5px;
  }

  .orbit-ready-row span:first-child {
    font-size: 8.5px;
  }

  .orbit-rocket {
    overflow: auto;
    gap: 6px;
  }

  .orbit-rocket-head small,
  .orbit-problems li[data-warn="ok"] {
    display: none;
  }

  .orbit-stack {
    flex: none;
    min-height: 110px;
    max-height: 150px;
  }

  .orbit-presets {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .orbit-preset {
    padding: 4px 6px;
  }

  .orbit-preset-name {
    font-size: 11px;
  }

  .orbit-preset-note {
    display: none;
  }

  .orbit-stack .orbit-tool:not(.orbit-remove) {
    display: none;
  }

  .orbit-stack .orbit-row-name {
    min-width: 0;
    font-size: 10.5px;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .orbit-launch {
    position: sticky;
    bottom: 0;
    padding: 6px 10px;
    font-size: 15px;
  }

  #orbit-notice {
    bottom: calc(230px + var(--safe-bottom));
    font-size: 12.5px;
    padding: 8px 12px;
  }

  .orbit-card-panel {
    top: calc(100px + var(--safe-top));
    padding: 5px 6px 6px;
    border-width: 2px;
  }

  .orbit-small b {
    font-size: 13px;
  }

  .orbit-small span {
    font-size: 8px;
  }

  .orbit-meter:nth-child(2),
  .orbit-meter:nth-child(5) {
    display: none;
  }

  .orbit-card-panel h3 {
    display: none;
  }

  .orbit-mission-card {
    left: calc(8px + var(--safe-left));
    width: calc(100vw - 162px - var(--safe-left) - var(--safe-right));
    font-size: 11px;
  }

  .orbit-mission li:not([data-state="now"]) {
    display: none;
  }

  .orbit-flight {
    right: calc(8px + var(--safe-right));
    width: 138px;
  }

  .orbit-big b {
    font-size: 22px;
  }

  .orbit-big small {
    display: none;
  }

  .orbit-flight-body {
    grid-template-columns: 1fr 34px;
    gap: 6px;
    padding: 6px;
  }

  .orbit-altimeter {
    height: 88px;
    width: 12px;
  }

  .orbit-meters {
    gap: 4px;
  }

}

/* Desktop messages share a bottom stack beneath the Space action. */
@media (min-width: 721px) {
  .bottom-hud {
    position: absolute;
    left: 50%;
    bottom: calc(11px + var(--safe-bottom));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: max-content;
    max-width: calc(100% - 32px - var(--safe-left) - var(--safe-right));
    transform: translateX(-50%);
    pointer-events: none;
  }

  .bottom-hud>.act {
    position: static;
    transform: none;
    pointer-events: auto;
  }

  .bottom-hud>.message-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 41px;
    width: 100%;
  }

  .message-stack>.toast,
  .message-stack>.hint {
    position: static;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
    transform: translateY(8px);
  }

  .message-stack>.toast.show,
  .message-stack>.hint.show {
    transform: translateY(0);
  }
}

/* The aiming mark stays centered independently of equipment expansion. */
.weapon-reticle {
  position: fixed;
  left: 50%;
  top: 50%;
  width: calc(var(--reticle-radius, 14px) * 2);
  height: calc(var(--reticle-radius, 14px) * 2);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 30;
  filter: drop-shadow(0 1px 1px #000) drop-shadow(0 0 2px #000);
}
.weapon-reticle > svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke: #fff;
  stroke-width: 1.5px;
  stroke-linecap: round;
}
.weapon-reticle[data-close="true"] > svg {
  visibility: hidden;
}
.weapon-reticle[data-sight="true"] > svg {
  visibility: hidden;
}
.weapon-reticle[data-occluded="true"] {
  visibility: hidden;
}
.weapon-reticle > span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #fff9dc;
}
.weapon-reticle[data-target="friendly"] { --reticle-target: #65e879; }
.weapon-reticle[data-target="enemy"] { --reticle-target: #ff6464; }
.weapon-reticle[data-target="object"] { --reticle-target: #ff9d42; }
.weapon-reticle[data-target="friendly"] > span,
.weapon-reticle[data-target="enemy"] > span,
.weapon-reticle[data-target="object"] > span {
  width: 4px;
  height: 4px;
  background: var(--reticle-target);
}
.weapon-reticle[data-sight="true"] > span {
  top: calc(50% + 4px);
  width: 4px;
  height: 4px;
  background: var(--reticle-target, #fff9dc);
}
.weapon-reticle[data-target="out-of-range"] > span {
  visibility: hidden;
}
.weapon-reticle > span::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  border: 1.5px solid #fff;
  border-radius: 50%;
  opacity: var(--reticle-hit, 0);
  transform: translate(-50%, -50%) scale(calc(1.7 - var(--reticle-hit, 0) * 0.7));
}

/* The Sphere borrows combat mouse-look with an empty-handed, fixed center dot. */
body[data-active-scene="timechain"] .weapon-reticle {
  left: 50% !important;
  top: 50% !important;
  visibility: visible;
}
body[data-active-scene="timechain"] .weapon-reticle > svg,
body[data-active-scene="timechain"] .weapon-reticle > span::after { display: none; }
body[data-active-scene="timechain"] .weapon-reticle > span {
  top: 50%;
  width: 3px;
  height: 3px;
  background: #fff9dc;
  visibility: visible;
}

/* With no weapon to aim (pilot.js `syncWeaponHud`), combat's crosshair is a single dot. */
.weapon-reticle[data-unarmed="true"] { visibility: visible; }
.weapon-reticle[data-unarmed="true"] > svg,
.weapon-reticle[data-unarmed="true"] > span::after { display: none; }
.weapon-reticle[data-unarmed="true"] > span {
  width: 3px;
  height: 3px;
  background: #fff9dc;
  visibility: visible;
}

/* DSB keeps controls in the existing page and its world in a separate scene. */
.dsb-island-icon, .emberden-icon { display: none; }
body[data-active-scene="dsb"] .dsb-island-icon,
body[data-active-scene="poker"] .emberden-icon {
  display: block;
  width: 56px;
  height: 44px;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.45));
}
body[data-active-scene="poker"] #freeroam-icon { display: none; }
body[data-active-scene="poker"] .emberden-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  overflow: visible;
}
body[data-active-scene="dsb"] :is(#freeroam-icon, #weapon-hud, #magazine-hud) { display: none !important; }
body[data-active-scene] :is(.world-clock, .world-block) {
  right: calc(var(--hub-banner-button-right, calc(var(--hub-banner-gutter) + var(--safe-right))) + var(--hub-banner-button-w, var(--hub-banner-button, 36px)) * 2 + var(--hub-banner-button-gap, 8px) + 12px + var(--hub-banner-account, 0px));
}
/* Sign in, or out again, left of the controls button and of its size: a mark alone, named by its label and tooltip.
   hud.js publishes the room it takes (`--hub-banner-account`) for the clock to clear. */
.account-top {
  position: absolute;
  top: var(--hub-banner-button-top, calc(10px + var(--safe-top)));
  right: calc(var(--hub-banner-button-right, calc(var(--hub-banner-gutter) + var(--safe-right))) + (var(--hub-banner-button-w, var(--hub-banner-button, 36px)) + var(--hub-banner-button-gap, 8px)) * 2);
  width: var(--hub-banner-button-w, var(--hub-banner-button, 36px));
  height: var(--hub-banner-button, 36px);
  touch-action: manipulation;
}
.account-top[hidden], body:not([data-active-scene]) .account-top, body[data-active-scene="studio"] .account-top { display: none; }
.account-top svg { width: calc(var(--hub-banner-button, 36px) * 2 / 3); height: calc(var(--hub-banner-button, 36px) * 2 / 3); }
.account-top[data-signed="true"] .account-in, .account-top[data-signed="false"] .account-out { display: none; }
/* A phone's banner has room for it only on the island, where its title is the banner's shortest; under 375px the clock
   would meet the title, so the account row in Contributing Oogas is the way in there. */
@media (max-width: 640px) {
  body:not([data-active-scene="hub"]) .account-top { display: none; }
}
@media (max-width: 374px) {
  .account-top { display: none; }
}
/* The controls and sound buttons, sized and placed by hud.js (`--hub-banner-button`, `-top`, `-right`, `-gap`). */
.environment-sound {
  position: absolute;
  top: var(--hub-banner-button-top, calc(10px + var(--safe-top)));
  right: var(--hub-banner-button-right, calc(var(--hub-banner-gutter) + var(--safe-right)));
  width: var(--hub-banner-button-w, var(--hub-banner-button, 36px));
  height: var(--hub-banner-button, 36px);
}
.environment-sound svg { width: calc(var(--hub-banner-button, 36px) * 2 / 3); height: calc(var(--hub-banner-button, 36px) * 2 / 3); }
.environment-sound svg path:not(:first-child) { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.environment-sound .sound-muted, .environment-sound[data-muted="true"] .sound-waves { display: none; }
.environment-sound[data-muted="true"] .sound-muted { display: block; }

/* The speaker button's panel (sound-panel.js): a level for all game sounds, all players' voices and each sound here.
   It hangs under the button, which places it (`--sound-mixer-top`, `-right`), over the side panels' tabs in a game
   (sheet.js lifts them to 90); its slab scrolls when the rows outgrow the window. */
.sound-mixer {
  position: fixed;
  top: var(--sound-mixer-top, calc(58px + var(--safe-top)));
  right: max(8px, var(--sound-mixer-right, 16px));
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
  width: min(360px, calc(100vw - 16px));
  max-height: calc(100dvh - var(--sound-mixer-top, 58px) - 12px - var(--safe-bottom));
  padding: 10px 12px 10px;
  background: var(--planks);
  border: 3px solid var(--wood-edge);
  border-radius: var(--radius);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 12px 28px rgba(0, 0, 0, 0.45);
  color: var(--paper);
  pointer-events: auto;
  outline: none;
}
.sound-mixer[hidden] { display: none; }
.sound-mixer-head { flex: none; display: flex; align-items: center; gap: 8px; min-height: 28px; }
.sound-mixer-head h2 { margin: 0 auto 0 0; font-size: 14px; font-weight: 700; line-height: 1; letter-spacing: 0.06em; white-space: nowrap; color: var(--paper); filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.6)); }
.sound-mixer-toggle, .sound-mixer-close, .sound-mixer-reset {
  flex: none;
  min-height: 28px;
  padding: 0 10px;
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.sound-mixer-toggle { min-width: 84px; background: linear-gradient(#f0b05a, var(--accent)); color: var(--ink); }
.sound-mixer-toggle[aria-pressed="false"] { background: var(--wood-edge); color: var(--paper); }
.sound-mixer-close, .sound-mixer-reset { background: var(--stone); color: var(--paper); }
.sound-mixer-close { width: 28px; padding: 0; font-size: 16px; line-height: 1; }
.sound-mixer-close:hover, .sound-mixer-reset:hover { background: var(--stone-lt); }
.sound-mixer :is(button, input):focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.sound-mixer-slab { flex: 0 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 2px 12px 4px; scrollbar-width: thin; scrollbar-color: rgba(243, 239, 228, 0.2) transparent; }
.sound-mixer-row {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 10px;
  min-height: 38px;
}
.sound-mixer-row + .sound-mixer-row { border-top: 1px solid rgba(243, 239, 228, 0.07); }
.sound-mixer-row label { font-size: 12px; line-height: 1.2; white-space: nowrap; color: rgba(243, 239, 228, 0.88); }
.sound-mixer-row output { font-family: var(--mono); font-size: 11px; text-align: right; color: var(--accent-text); white-space: nowrap; }
.sound-mixer-everything, .sound-mixer-music, .sound-mixer-players { grid-template-columns: minmax(0, 1fr) 38px; gap: 0 10px; min-height: 44px; padding: 6px 0 2px; }
:is(.sound-mixer-everything, .sound-mixer-music, .sound-mixer-players) input[type="range"] { grid-row: 2; grid-column: 1 / -1; }
:is(.sound-mixer-everything, .sound-mixer-music, .sound-mixer-players) label { font-size: 13px; font-weight: 700; color: var(--paper); }
#sound-mixer-all { border-bottom: 2px solid var(--stone-dk); }
.sound-mixer-row[hidden] { display: none; }
.sound-mixer-here { margin: 10px 0 2px; font-size: 9px; font-weight: 700; line-height: 1; letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap; color: rgba(243, 239, 228, 0.5); }
.sound-mixer-empty { margin: 8px 0 10px; font-size: 12px; line-height: 1.4; color: rgba(243, 239, 228, 0.6); }
.sound-mixer-empty[hidden] { display: none; }
.sound-mixer[data-muted="true"] .sound-mixer-slab { opacity: 0.5; }
.sound-mixer-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sound-mixer-foot p { margin: 0; font-size: 10px; line-height: 1; white-space: nowrap; color: var(--accent-text); filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.6)); }
:is(.sound-mixer, .hangar-sound, .den-page) input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; margin: 0; background: transparent; cursor: pointer; }
:is(.sound-mixer, .hangar-sound, .den-page) input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--accent) var(--fill, 100%), rgba(243, 239, 228, 0.16) var(--fill, 100%));
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.5);
}
:is(.sound-mixer, .hangar-sound, .den-page) input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -5px;
  border: 2px solid var(--wood-edge);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}
:is(.sound-mixer, .hangar-sound, .den-page) input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: rgba(243, 239, 228, 0.16); }
:is(.sound-mixer, .hangar-sound, .den-page) input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--accent); }
:is(.sound-mixer, .hangar-sound, .den-page) input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border: 2px solid var(--wood-edge); border-radius: 50%; background: var(--paper); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.5); }
@media (max-width: 380px) {
  .sound-mixer-row { grid-template-columns: minmax(0, 1fr) 38px; gap: 0 10px; padding: 6px 0 2px; }
  .sound-mixer-row input[type="range"] { grid-row: 2; grid-column: 1 / -1; }
}
body[data-active-scene="dsb"] #destination-hud:disabled { opacity: 1; cursor: default; }
.dsb-panel { position: absolute; z-index: 5; right: 20px; top: 104px; width: 300px; max-height: calc(100% - 230px); overflow: auto; padding: 18px; background: rgba(25, 15, 42, 0.92); border: 1px solid #8863a5; border-radius: 10px; box-shadow: 0 8px 35px #0005; }
.dsb-panel h2 { margin: 4px 0 12px; color: #ffdf38; font-size: 25px; }
.dsb-panel p { margin: 8px 0; }
.dsb-eyebrow { color: #57e1dc; font-size: 10px; letter-spacing: 0.15em; }
.dsb-panel button { padding: 8px; margin: 4px 4px 4px 0; background: #37234c; border: 1px solid #765594; border-radius: 5px; cursor: pointer; }
.dsb-panel button:hover, .dsb-panel button:focus-visible { border-color: #ffdf38; }
.dsb-panel output { display: block; color: #ffdf38; margin: 12px 0; }
.dsb-panel summary { cursor: pointer; color: #bfb0d0; padding: 8px 0; }
.dsb-panel details { border-top: 1px solid #ffffff20; margin-top: 10px; }
.dsb-panel label { display: block; margin: 10px 0; }
.dsb-panel input { max-width: 100%; font-size: 11px; }
.dsb-panel .help { font-size: 11px; color: #bfb0d0; }
#dsb-feed { white-space: pre-line; font-size: 11px; color: #57e1dc; }
.dsb-intro, .dsb-stop { display: none; }
.dsb-panel[data-phase="boat"] .dsb-stop, .dsb-panel[data-phase="coaster"] .dsb-stop { display: inline-block; }
.dsb-entry #joy-look { visibility: hidden; }
.dsb-entry .dsb-panel { background: transparent; border: 0; box-shadow: none; right: 50%; transform: translateX(50%); top: auto; bottom: 20px; width: min(460px, 75vw); text-align: center; max-height: 44%; }
.dsb-entry .dsb-intro { display: block; }
.dsb-entry .dsb-world { display: none; }
.dsb-entry .dsb-intro h2 { color: white; }
.dsb-entry .dsb-sounds { font-size: 11px; }
.dsb-shop { border-top: 1px solid #ffdf38; margin-top: 12px; }
@media (max-width: 720px) {
  .dsb-panel { top: 100px; right: 8px; width: 220px; padding: 10px; max-height: calc(100% - 300px); font-size: 11px; }
  .dsb-panel h2 { font-size: 19px; }
  .dsb-entry .dsb-panel { bottom: 210px; max-height: 35%; width: 75vw; }
}
.dsb-toggle { display: block; }

  .dsb-panel[data-folded="true"]:not([data-phase="entrance"]) { width: auto; padding: 3px 8px; }
  .dsb-panel[data-folded="true"] .dsb-world > :not(.dsb-toggle),
  .dsb-panel[data-folded="true"]:not([data-phase="entrance"]) .dsb-sounds { display: none; }

.dsb-arrival-card { display: none; }
.dsb-arrival .dsb-arrival-card { display: block; text-align: center; }
.dsb-arrival .dsb-world, .dsb-arrival .dsb-sounds, .dsb-arrival #joy-move, .dsb-arrival #joy-look, .dsb-arrival #act { visibility: hidden; }
.dsb-arrival .dsb-world, .dsb-arrival .dsb-sounds { display: none; }
.dsb-arrival .dsb-panel { top: auto; bottom: 24px; right: 50%; transform: translateX(50%); width: max-content; max-width: 85vw; }

.dsb-entry .dsb-panel { top: 24px; bottom: auto; left: 24px; right: auto; transform: none; width: min(340px, 75vw); text-align: left; }
@media (max-width: 720px) { .dsb-entry .dsb-panel { top: 12px; left: 50%; transform: translateX(-50%); width: 85vw; max-height: 30%; text-align: center; } }
/* The passage from ₿IFRÖST and the flight after it show their own card and nothing of the walk's. */
.dsb-entry .dsb-panel { background: #060a1cb8; border-radius: 12px; padding: 12px 16px; }
.dsb-entry .equipment-hud, .dsb-entry #act, .dsb-entry .dsb-context, .dsb-arrival .equipment-hud, .dsb-arrival .dsb-context { display: none; }

/* Nearby, opt-in CRT menu. The broadcast continues with the cabinet closed. */
#dsb-tv { width: min(820px, 94vw); max-height: 90dvh; overflow: auto; padding: 20px; border: 8px solid #78543b; border-radius: 24px; background: #392739; color: #e6fff2; box-shadow: 0 20px 90px #000b; }
#dsb-tv::backdrop { background: #080512bb; }
#dsb-tv header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
#dsb-tv h2, #dsb-tv h3, #dsb-tv p { margin: 8px 0; overflow-wrap: anywhere; }
#dsb-tv h2 { color: #ffdf38; font-size: 28px; }
#dsb-tv button, #dsb-tv a { color: #ffdf38; background: #251c39; border: 1px solid #9574ad; border-radius: 6px; padding: 10px 12px; font: inherit; cursor: pointer; }
#dsb-tv button:focus-visible, #dsb-tv a:focus-visible { outline: 3px solid #49ddd9; outline-offset: 2px; }
#dsb-tv button:disabled { color: #a49cac; border-color: #4d435a; cursor: default; }
.dsb-tv-glass { padding: 20px; background: #0b191c; border: 4px solid #11101c; border-radius: 24px; }
#dsb-tv-menu { display: flex; flex-wrap: wrap; gap: 8px; }
#dsb-tv-channel[aria-expanded="true"] { border-color: #49ddd9; color: #49ddd9; }
#dsb-tv-status, .dsb-tv-help { color: #a6bfc4; font-size: 12px; }
#dsb-tv-song { color: #ffdf38; font-size: 23px; }
.dsb-tv-columns { display: grid; grid-template-columns: 1fr 240px; gap: 22px; margin-top: 18px; }
#dsb-tv ol { padding-left: 22px; }
#dsb-tv li { margin-bottom: 8px; overflow-wrap: anywhere; }
.dsb-tv-request { text-align: center; }
#dsb-tv-qr { width: 156px; height: 156px; image-rendering: pixelated; display: block; margin: 0 auto 16px; }
.dsb-tv-request a { display: block; }
.dsb-tv-request p { font-size: 12px; line-height: 1.6; }
@media (max-width: 600px) { #dsb-tv { padding: 10px; border-width: 5px; } .dsb-tv-glass { padding: 12px; } .dsb-tv-columns { grid-template-columns: 1fr; } #dsb-tv-menu { flex-direction: column; } }

/* DSB controls must receive real pointer input over the passive HUD layer. */
.dsb-panel, #dsb-tv, .dsb-context { pointer-events: auto; }
.dsb-context { position: absolute; z-index: 8; bottom: 130px; left: 50%; transform: translateX(-50%); max-width: 90vw; padding: 14px 22px; border: 2px solid #ffe36a; border-radius: 10px; background: #30203e; color: #fff2a0; font: inherit; cursor: pointer; box-shadow: 0 4px 18px #0008; }
.dsb-context:disabled { color: #c5b4ce; border-color: #8e719e; cursor: default; }
.dsb-context:focus-visible { outline: 3px solid #49ddd9; }
@media (max-width: 720px) { .dsb-context { bottom: 235px; font-size: 12px; padding: 12px; } }

.dsb-tv-jukebox { border-top: 1px solid #416168; border-bottom: 1px solid #416168; padding: 14px 0; margin: 16px 0; }
.dsb-tv-search { display: flex; gap: 8px; margin: 8px 0; }
#dsb-tv-query { width: 100%; min-width: 0; padding: 10px; border: 1px solid #49ddd9; border-radius: 5px; background: #16272a; color: white; font: inherit; }
#dsb-tv-results > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid #ffffff18; }
#dsb-tv-results span { min-width: 0; overflow-wrap: anywhere; }
#dsb-tv-results button { flex-shrink: 0; }
#dsb-tv-invoice { padding: 16px; background: #16272a; text-align: center; }
#dsb-tv-invoice-qr { display: block; width: min(280px, 100%); height: auto; margin: 12px auto; image-rendering: pixelated; }
#dsb-tv-wallet { display: inline-block; }
#dsb-tv-invoice-text { display: block; width: 100%; margin-top: 12px; height: 64px; font-size: 10px; background: #0b191c; color: #e6fff2; }
@media (max-width: 600px) { #dsb-tv-results > div { align-items: stretch; flex-direction: column; } }

#dsb-tv-menu[hidden] { display: none; }
.dsb-panel[data-folded="true"] #dsb-shop { display: none; }

/* Zuzu's compact, native-input conversation stays beside the physical world. */
#zuzu-conversation { position: fixed; inset: auto 16px calc(16px + var(--zuzu-keyboard, 0px)) auto; margin: 0; width: min(380px, calc(100vw - 32px)); max-height: min(440px, calc(var(--zuzu-viewport, 100dvh) - 24px)); padding: 16px; border: 1px solid #b68a43; border-radius: 14px; background: #21192ff5; color: #f5edf9; box-shadow: 0 8px 36px #0008; pointer-events: auto; overflow: auto; }
#zuzu-conversation[open] { display: flex; flex-direction: column; gap: 10px; }
#zuzu-conversation::backdrop { background: #08051222; }
#zuzu-conversation header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
#zuzu-conversation h2 { margin: 0; color: #ffd267; font-size: 22px; }
#zuzu-conversation p { margin: 0; font-size: 11px; line-height: 1.5; }
#zuzu-mode, #zuzu-status { color: #cebdd7; }
#zuzu-history { margin: 0; padding: 0; list-style: none; overflow: auto; min-height: 0; max-height: 180px; overscroll-behavior: contain; }
#zuzu-history li { padding: 8px 0; border-bottom: 1px solid #ffffff18; }
#zuzu-history strong { display: block; font-size: 11px; color: #e9c17a; }
#zuzu-history span { display: block; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.5; }
#zuzu-form { flex-shrink: 0; }
#zuzu-form label { display: block; font-size: 12px; margin-bottom: 6px; }
#zuzu-form > div { display: flex; gap: 8px; }
#zuzu-message { flex: 1; min-width: 0; width: 100%; resize: none; padding: 10px; border: 1px solid #9874ad; border-radius: 8px; color: #fff; background: #110e1b; font: 16px/1.35 system-ui, sans-serif; touch-action: auto; user-select: text; -webkit-user-select: text; }
#zuzu-conversation button { min-height: 44px; padding: 8px 12px; border: 1px solid #b68a43; border-radius: 8px; color: #ffdc85; background: #382641; font: inherit; cursor: pointer; }
#zuzu-conversation button:disabled { opacity: 0.5; cursor: default; }
#zuzu-conversation button:focus-visible, #zuzu-message:focus-visible { outline: 2px solid #49ddd9; outline-offset: 2px; }
.dsb-talking .dsb-panel, .dsb-talking #dsb-context, .dsb-talking #joy-move, .dsb-talking #joy-look, .dsb-talking #act { visibility: hidden; }
@media (max-width: 720px) {
  #zuzu-conversation { right: max(8px, var(--safe-right)); bottom: calc(8px + var(--safe-bottom) + var(--zuzu-keyboard, 0px)); width: calc(100vw - 16px - var(--safe-left) - var(--safe-right)); padding: 12px; max-height: min(360px, calc(var(--zuzu-viewport, 100dvh) - 24px)); }
  #zuzu-history { max-height: 120px; }
}

/* Ooga Mine: the gear palette on the left, the operation on the right, and a card for whatever was
   tapped in the cave. Everything else reuses the orbit and race panels. */
.mine-tabs {
  grid-template-columns: repeat(4, 1fr);
}

.mine-tile[data-afford="no"] .orbit-price {
  background: rgba(229, 83, 61, 0.18);
  color: #ff9a86;
}

.mine-tile[data-locked="true"] {
  opacity: 0.45;
  filter: grayscale(0.6);
}

.mine-tile[data-owned]:not([data-owned="0"])::after {
  content: attr(data-owned);
  position: absolute;
  top: 5px;
  left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: var(--paper);
  font-size: 10px;
  font-weight: 700;
}

.mine-tile-real {
  color: var(--accent-text);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mine-ops {
  bottom: auto;
  max-height: calc(100% - 90px - var(--safe-top) - var(--safe-bottom));
  overflow: auto;
}

.game-goal {
  display: grid;
  grid-template-columns: auto auto auto 1fr auto;
  align-items: baseline;
  gap: 2px 6px;
  padding: 8px 10px;
  background: var(--tablet);
  border: 2px solid var(--stone-dk);
  border-radius: 9px 7px 10px 8px;
  box-shadow: var(--tablet-shadow);
}

.game-goal > span:first-child,
.mine-row > span:first-child,
.mine-alert > span:first-child {
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.game-goal b {
  color: #f5c542;
  font-size: 26px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.game-goal small {
  color: var(--muted);
  font-size: 10px;
}

.game-goal .mine-score {
  color: var(--accent-text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.game-goal b[data-flash="a"] {
  animation: mine-flash-a 0.9s ease-out;
}

.game-goal b[data-flash="b"] {
  animation: mine-flash-b 0.9s ease-out;
}

.mine-clock {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.mine-clock[data-state="warn"] {
  color: #ffb13b;
}

.mine-resources {
  display: grid;
  grid-template-columns: 1fr 1fr 1.1fr;
  gap: 4px;
}

.mine-res {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 1px 5px;
  padding: 5px 7px;
  border-radius: 7px;
  border: 2px solid var(--stone-dk);
  background: var(--tablet);
  box-shadow: var(--tablet-shadow);
}

.mine-res .mine-icon {
  grid-row: span 2;
}

.mine-res b {
  font-size: 15px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.mine-res small {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mine-res-bananas b {
  color: #ffd84a;
}

.mine-res-coin b {
  color: #f7a53a;
}

.mine-res .race-boost {
  width: 100%;
  height: 8px;
}

.mine-res .mine-mini {
  padding: 1px 6px;
  font-size: 9.5px;
}

.mine-row .mine-unit {
  width: 11px;
  height: 11px;
  margin-left: 3px;
  vertical-align: -1px;
}

.mine-icon {
  width: 22px;
  height: 22px;
  image-rendering: pixelated;
}

/* A value that just jumped up flashes once; the attribute alternates so the animation restarts. */
.mine-res b[data-flash="a"] {
  animation: mine-flash-a 0.9s ease-out;
}

.mine-res b[data-flash="b"] {
  animation: mine-flash-b 0.9s ease-out;
}

@keyframes mine-flash-a {
  from {
    color: #b8f0c8;
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.9);
  }
}

@keyframes mine-flash-b {
  from {
    color: #b8f0c8;
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.9);
  }
}

.mine-event {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* The countdown ring: a conic sweep the HUD shortens as the event runs out. */
.mine-ring {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: conic-gradient(currentColor calc(var(--p, 1) * 360deg), rgba(255, 255, 255, 0.15) 0);
  -webkit-mask: radial-gradient(circle, transparent 4px, #000 5px);
  mask: radial-gradient(circle, transparent 4px, #000 5px);
}

.mine-event[data-good="yes"] .mine-ring {
  color: #22c55e;
}

.mine-event[data-good="no"] .mine-ring {
  color: #ff8a73;
}

.mine-step {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 10px;
  border: 2px dashed rgba(245, 197, 66, 0.55);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.35);
  font-size: 11px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

.mine-step b {
  min-width: 0;
  line-height: 1.25;
}

.mine-step span {
  color: #f5c542;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.mine-pnl {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr;
  gap: 4px;
}

.mine-pnl > div {
  display: grid;
  padding: 5px 7px;
  border-radius: 7px;
  background: var(--tablet);
  border: 2px solid var(--stone-dk);
}

.mine-pnl span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mine-pnl b {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.mine-pnl small {
  color: var(--muted);
  font-size: 9px;
}

.mine-pnl b[data-state="good"] {
  color: #7ee29a;
}

.mine-pnl b[data-state="bad"] {
  color: #ff8a73;
}

.mine-profit[data-state="bad"] {
  border-color: var(--danger);
  animation: mine-pulse 0.8s ease-in-out infinite alternate;
}

.mine-offer {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 2px solid #22c55e;
  border-radius: 7px;
  background: rgba(34, 197, 94, 0.16);
  font-size: 11px;
}

.mine-ops-tabs {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 0;
}

.mine-row small[data-state="good"] {
  color: #7ee29a;
}

.mine-row small[data-state="bad"],
.mine-row b[data-state="bad"] {
  color: #ff8a73;
}

.mine-chamber {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 2px 8px;
  align-items: center;
  font-size: 11px;
}

.mine-chamber small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
}

.mine-chamber[data-state="bad"] small {
  color: #ff8a73;
}

.mine-bars {
  display: grid;
  gap: 3px;
}

.mine-bars .race-boost {
  width: 100%;
  height: 7px;
}

.mine-hint {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.mine-tile-profit {
  max-width: 100%;
  font-size: 10px;
  line-height: 1.25;
  text-align: center;
  white-space: pre-line;
}

.mine-tile-profit[data-state="good"] {
  color: #7ee29a;
}

.mine-tile-profit[data-state="bad"] {
  color: #ff8a73;
}

.mine-tablet {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 10px;
  padding: 8px 10px;
  background: var(--tablet);
  border: 2px solid var(--stone-dk);
  border-radius: 9px 7px 10px 8px;
  box-shadow: var(--tablet-shadow);
}

/* A stat is a stack: label over value over note, two to a row in the tablet. A note may take a second
   line on purpose; nothing in a stat truncates. Chamber rows and hints span both columns. */
.mine-row {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 1px;
  min-width: 0;
  font-size: 11px;
}

.mine-tablet > .mine-chamber,
.mine-tablet > .mine-hint,
.mine-tablet > .mine-meter {
  grid-column: 1 / -1;
}

.mine-row > span:first-child {
  font-size: 8.5px;
  letter-spacing: 0.1em;
}

.mine-row b {
  min-width: 0;
  font-size: 15px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.mine-row small {
  min-width: 0;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.25;
  white-space: pre-line;
}

.mine-row .mine-mini {
  justify-self: start;
}

.mine-meter {
  grid-template-columns: 62px 1fr auto;
}

.mine-meter .race-boost {
  width: 100%;
  height: 8px;
}

.mine-mini {
  padding: 2px 8px;
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--paper);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}

.mine-mini small {
  color: var(--muted);
  font-weight: 400;
}

.mine-mini:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.mine-mode[aria-pressed="false"] {
  background: linear-gradient(#f0b05a, var(--accent));
  color: var(--ink);
}

.mine-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.mine-act.mine-quiet {
  background: var(--wood-edge);
  color: var(--paper);
}

/* Every dug chamber's heat as a thin bar under the profit line, always in view. */
.mine-heat-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  height: 4px;
}

.mine-heat-strip span {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.mine-heat-strip i {
  display: block;
  width: 0;
  height: 100%;
  background: #7ee29a;
}

.mine-heat-strip i[data-state="warn"] {
  background: #ffb13b;
}

.mine-heat-strip i[data-state="bad"] {
  background: #ff6a2a;
}

/* The ticker: the last four things the log said, each line fading out on its own. */
.mine-ticker {
  position: absolute;
  left: 50%;
  top: calc(96px + var(--safe-top));
  transform: translateX(-50%);
  display: grid;
  gap: 3px;
  width: min(460px, calc(100vw - 32px));
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
  z-index: 8;
}

.mine-ticker li {
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(10, 8, 6, 0.62);
  color: var(--paper);
  font-size: 11px;
  text-align: center;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
  opacity: 0;
}

.mine-ticker li[data-live="yes"] {
  animation: mine-ticker-fade 7s ease-out both;
}

.mine-ticker li[data-kind="bad"] {
  color: #ffb8a6;
}

.mine-ticker li[data-kind="good"] {
  color: #b8f0c8;
}

@keyframes mine-ticker-fade {
  0% { opacity: 0; transform: translateY(-4px); }
  6% { opacity: 1; transform: translateY(0); }
  75% { opacity: 1; }
  100% { opacity: 0; }
}

/* The strip that stays when both panels are folded on a phone: mined, profit, clock, jobs. Its class is
   its own: .mine-mini is the small button. */
.mine-strip {
  display: none;
  position: absolute;
  left: 50%;
  /* Below the banner's controls (hud.js measures where they end; a phone stacks them under the title), so it never
     takes their taps. */
  top: var(--banner-controls-bottom, calc(68px + var(--safe-top)));
  transform: translateX(-50%);
  gap: 10px;
  align-items: baseline;
  padding: 4px 10px;
  border: 2px solid var(--stone-dk);
  border-radius: 8px;
  background: var(--tablet);
  color: var(--paper);
  font-size: 11px;
  white-space: nowrap;
  z-index: 9;
}

.mine-strip b {
  color: #f5c542;
  font-variant-numeric: tabular-nums;
}

.mine-strip [data-state="bad"] {
  color: #ff8a73;
}

.mine-strip [data-state="good"] {
  color: #7ee29a;
}

#mine-shop[data-folded="true"] ~ #mine-ops[data-folded="true"] ~ .mine-strip:not([hidden]) {
  display: flex;
}

/* The palette's best buy: the machine that pays itself back soonest and has a spot. */
.mine-tile[data-best="yes"] {
  box-shadow: 0 0 0 2px #7ee29a, 0 0 12px rgba(126, 226, 154, 0.55);
}

.mine-tile[data-best="yes"]::before {
  content: "best buy";
  position: absolute;
  top: -8px;
  left: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #7ee29a;
  color: var(--ink);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mine-row small[data-state="good"] {
  color: #7ee29a;
}

.mine-act {
  display: grid;
  justify-items: start;
  gap: 1px;
  padding: 6px 8px;
  border: 2px solid var(--wood-edge);
  border-radius: 7px;
  background: linear-gradient(#f0b05a, var(--accent));
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--nail);
}

.mine-act b {
  font-variant-numeric: tabular-nums;
}

.mine-act small {
  color: var(--ink-muted);
  font-size: 9.5px;
  font-weight: 600;
}

.mine-act:disabled {
  filter: grayscale(0.8) brightness(0.8);
  cursor: not-allowed;
}

.mine-act[data-state="due"] {
  background: linear-gradient(#ff8a6a, var(--danger));
}

.mine-urgent {
  grid-column: 1 / -1;
  background: linear-gradient(#ff8a6a, var(--danger));
  animation: mine-pulse 0.8s ease-in-out infinite alternate;
}

@keyframes mine-pulse {
  to {
    filter: brightness(1.25);
  }
}

.mine-alert {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px;
  padding: 6px 8px;
  border: 2px solid var(--danger);
  border-radius: 7px;
  background: rgba(229, 83, 61, 0.2);
}

.mine-alert b {
  color: #ff9a86;
  font-variant-numeric: tabular-nums;
}

.mine-jobs-head {
  margin: 2px 0 0;
}

.mine-faults {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mine-faults li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  background: rgba(196, 86, 47, 0.16);
  font-size: 11px;
}

.mine-faults li[data-kind="fire"] {
  background: rgba(214, 96, 40, 0.34);
}

.mine-faults li b {
  margin-left: auto;
  color: var(--muted);
  font-weight: 500;
}

.mine-clear {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.mine-event[data-good="yes"] {
  border-color: #22c55e;
}

.mine-event[data-good="no"] {
  border-color: var(--danger);
}

.mine-center {
  font-size: 34px;
  text-align: center;
  white-space: nowrap;
}

.mine-card {
  position: absolute;
  left: 50%;
  bottom: calc(74px + var(--safe-bottom));
  transform: translateX(-50%);
  width: min(390px, calc(100vw - 32px));
  max-height: calc(100vh - 90px - var(--safe-bottom) - var(--safe-top));
  overflow: auto;
  padding: 10px 12px 12px;
  border: 3px solid var(--wood-edge);
  border-radius: var(--radius);
  background: var(--planks);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.35);
  color: var(--paper);
}

.mine-card h3 {
  margin: 0;
  padding-right: 20px;
  font-size: 15px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
}

.mine-card p {
  margin: 3px 0 6px;
  font-size: 11px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

.mine-card-close {
  position: absolute;
  top: 6px;
  right: 8px;
  border: 0;
  background: none;
  color: var(--paper);
  font-size: 18px;
  cursor: pointer;
}

.mine-card-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 10px;
  margin: 0 0 8px;
  padding: 6px 8px;
  list-style: none;
  background: var(--tablet);
  border: 2px solid var(--stone-dk);
  border-radius: 8px;
  font-size: 10.5px;
}

.mine-card-facts li {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.mine-card-facts li span:first-child {
  color: var(--muted);
}

.mine-card-facts li[data-warn="bad"] span:last-child {
  color: #ff9a86;
}

.mine-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.mine-card-actions .mine-act {
  font-size: 11px;
}

.mine-card-actions .mine-act[aria-pressed="true"] {
  background: linear-gradient(#b8f0c8, #22c55e);
}

.game-intro {
  width: min(620px, calc(100vw - 32px));
  text-align: center;
  /* The cave dims behind the title card. */
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 0 100vmax rgba(8, 6, 4, 0.55);
  animation: game-intro-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.game-intro > :not(.game-intro-glow) {
  position: relative;
}

/* While a game's title card is up its board and panels wait behind it, and come back when it closes. */
body[data-lounge-exterior] #overlay,
body[data-lounge-exterior] .poker-return,
.race:has(> [data-intro]:not([hidden])) .garage,
.race:has(> [data-intro]:not([hidden])) .panel-edge,
#poker:has(> [data-intro]:not([hidden])) .poker-return,
#poker:has(> [data-intro]:not([hidden])) .poker-focus {
  visibility: hidden;
}

/* The rays are clipped by their own layer, so the card itself never has to be a scroll box. */
.game-intro-glow {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

/* Slow light rays behind the coin; one transformed layer, nothing repaints. */
.game-intro-rays {
  position: absolute;
  left: 50%;
  top: 118px;
  width: 520px;
  height: 520px;
  margin: -260px 0 0 -260px;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 216, 74, 0.13) 0deg 9deg, transparent 9deg 24deg);
  mask-image: radial-gradient(circle, #000 20%, transparent 62%);
  animation: game-rays 28s linear infinite;
  pointer-events: none;
}

.game-intro-kicker {
  margin: 0 0 6px;
  color: var(--accent-text);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7);
}

.game-intro .game-intro-title {
  color: #f5c542;
  font-size: 40px;
  filter: drop-shadow(0 3px 0 #7a3f0c) drop-shadow(0 0 14px rgba(255, 200, 60, 0.45));
}

.game-intro-coin {
  display: block;
  width: 58px;
  height: 58px;
  margin: 12px auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 12px rgba(247, 147, 26, 0.7));
  animation: game-coin 2.6s ease-in-out infinite;
}

.game-intro-goal {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

.game-intro-goal b {
  color: #f5c542;
}

/* A card's words sit on stone, as the sound panel's rows do, never on the planks: the goal on a slab of its own, and
   the line under it in the planks' own lettering colour. The cabinet's glass and the cards with their own layout
   (Cloud Hopper's, the ghost hunt's results) keep theirs. */
.game-intro:not(.cloud-hopper-panel, .ghost-results) > .game-intro-goal {
  margin: 0 0 8px;
  padding: 9px 12px;
  background: var(--tablet);
  border: 2px solid var(--stone-dk);
  border-radius: 9px 7px 10px 8px;
  box-shadow: var(--tablet-shadow);
}

.game-intro-who {
  margin: 4px 0 12px;
  color: var(--accent-text);
  font-size: 11px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7);
}

.game-rules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  text-align: left;
}

.game-rules li {
  display: grid;
  grid-template-columns: 26px 1fr;
  column-gap: 8px;
  align-items: center;
  padding: 7px 9px;
  background: var(--tablet);
  border: 2px solid var(--stone-dk);
  border-radius: 9px 7px 10px 8px;
  box-shadow: var(--tablet-shadow);
  animation: game-rule-in 0.4s ease-out both;
}

.game-rules li:nth-child(2) { animation-delay: 0.08s; }
.game-rules li:nth-child(3) { animation-delay: 0.16s; }
.game-rules li:nth-child(4) { animation-delay: 0.24s; }
.game-rules li:nth-child(5) { animation-delay: 0.32s; }
.game-rules li:nth-child(6) { animation-delay: 0.4s; }

.game-rule-icon {
  grid-row: span 2;
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
}

.game-rules b {
  font-size: 11.5px;
  white-space: nowrap;
}

.game-rules small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}

.game-intro .actions {
  justify-content: center;
}

.game-intro-go {
  animation: game-go 1.6s ease-in-out 0.8s infinite;
}

@keyframes game-intro-in {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.94); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes game-rays {
  to { transform: rotate(360deg); }
}

@keyframes game-coin {
  0%, 100% { transform: translateY(2.5px) rotateY(0deg); }
  50% { transform: translateY(-2.5px) rotateY(180deg); }
}

@keyframes game-rule-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes game-go {
  0%, 100% { box-shadow: 0 2px 0 var(--nail), 0 0 0 rgba(255, 216, 74, 0); }
  50% { box-shadow: 0 2px 0 var(--nail), 0 0 18px rgba(255, 216, 74, 0.75); }
}

@media (prefers-reduced-motion: reduce) {
  .game-intro,
  .game-intro-rays,
  .game-intro-coin,
  .game-rules li,
  .game-intro-go {
    animation: none;
  }
}

/* Only a window too short for the card scrolls it. */
@media (max-height: 700px) {
  .game-intro {
    max-height: calc(100% - 24px);
    overflow-y: auto;
  }
}

@media (max-width: 520px) {
  .game-rules {
    grid-template-columns: 1fr;
  }

  .game-intro .game-intro-title {
    font-size: 30px;
  }
}

body.mine-dragging,
body.mine-dragging * {
  cursor: grabbing !important;
  user-select: none;
}

body.mine-dragging #tooltip {
  display: none;
}

@media (max-width: 720px) {
  .mine-tabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .game-goal b {
    font-size: 18px;
  }

  .mine-tablet {
    grid-template-columns: 1fr;
  }

  .mine-row {
    font-size: 10px;
  }

  .mine-pnl {
    grid-template-columns: 1fr 1fr;
  }

  .mine-profit {
    grid-column: 1 / -1;
  }

  .mine-res b {
    font-size: 13px;
  }

  /* With a panel open, the act button rides above it rather than under it. */
  body[data-active-scene="mine"]:has(#mine-shop:not([data-folded="true"]), #mine-ops:not([data-folded="true"])) .act {
    bottom: calc(46vh + 24px + var(--safe-bottom));
  }

  .mine-resources {
    grid-template-columns: 1fr 1fr;
  }

  .mine-res-power {
    grid-column: 1 / -1;
  }

  .mine-meter {
    grid-template-columns: 48px 1fr auto;
  }

  .mine-row b {
    font-size: 13px;
  }

  .mine-actions {
    grid-template-columns: 1fr;
  }

  .mine-jobs-head,
  .mine-clear,
  .mine-tile-real {
    display: none;
  }

  .mine-card {
    bottom: calc(46vh + 16px + var(--safe-bottom));
    max-height: calc(54vh - 32px - var(--safe-top));
  }

}

/* The mine's goal header: what is mined, big, with the target beside it, the clock and the live score on
   the right, the progress track under both. */
.mine-goal {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 4px 10px;
  padding: 8px 10px;
  background: var(--tablet);
  border: 2px solid var(--stone-dk);
  border-radius: 9px 7px 10px 8px;
  box-shadow: var(--tablet-shadow);
}

.mine-goal-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 6px;
  min-width: 0;
}

.mine-goal-main > span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mine-goal b {
  color: #f5c542;
  font-size: 24px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.mine-goal small {
  color: var(--muted);
  font-size: 10px;
}

.mine-goal-side {
  display: grid;
  justify-items: end;
  gap: 1px;
}

.mine-goal .mine-clock {
  font-size: 15px;
}

.mine-goal .mine-score {
  color: var(--accent-text);
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.mine-goal .orbit-track {
  grid-column: 1 / -1;
  width: 100%;
}

.mine-goal b[data-flash="a"] {
  animation: mine-flash-a 0.9s ease-out;
}

.mine-goal b[data-flash="b"] {
  animation: mine-flash-b 0.9s ease-out;
}

.mine-pnl > div,
.mine-res {
  min-width: 0;
}

/* Between two side panels the toast keeps to the lane between them. */
@media (min-width: 721px) {
  body[data-active-scene="mine"] .toast,
  body[data-active-scene="orbit"] .toast {
    max-width: max(240px, calc(100vw - 2 * 400px));
  }
}

@media (max-width: 720px) {
  /* The mine's operation panel docks at the bottom like every game panel on a phone, so folding it
     takes it off the screen rather than to the middle of it. */
  .mine-ops {
    top: auto;
    bottom: calc(8px + var(--safe-bottom));
    height: 46vh;
    max-height: 46vh;
  }

  /* The rocket panel's head: the pilot chip takes its own line under the title. */
  .orbit-rocket-head {
    flex-wrap: wrap;
  }

  .orbit-rocket-head .orbit-pilot {
    flex: 1 1 100%;
    text-align: left;
  }
}

/* A stage head is a name and a fact: one line on a desktop, the fact under the name on a phone. */
.orbit-stage-head b {
  font-weight: inherit;
}

.orbit-stage-head small {
  font-size: inherit;
}

.orbit-stage-head small::before {
  content: " · ";
}

@media (max-width: 720px) {
  /* The long form of a label lives in a .wide span; a phone shows the short word. */
  .wide {
    display: none;
  }

  .orbit-stage-head small {
    display: block;
    letter-spacing: 0.04em;
  }

  .orbit-stage-head small::before {
    content: none;
  }

  /* One scroll region: the stack scrolls with the panel and clears the sticky Launch button. */
  .orbit-stack {
    max-height: none;
    overflow: visible;
    padding-bottom: 10px;
  }
}

@media (max-width: 720px) {
  /* The race notice sits under the readouts and above the thumb controls, never over either. */
  .race-notice {
    top: auto;
    bottom: calc(184px + var(--safe-bottom));
    max-width: calc(100vw - 32px);
    font-size: 11px;
    text-align: center;
  }
}

@media (max-width: 720px) {
  /* The ticker sits under the hint stack on a phone, never on top of it. */
  .mine-ticker {
    top: calc(184px + var(--safe-top));
  }
}

@media (max-width: 720px) {
  /* While a card is up (an intro or a results sheet), the hint stack stays out of its way. */
  body:has(.race-results:not([hidden])) .message-stack {
    visibility: hidden;
  }
}

/* Native gate dialog shares the stone tablet style and stays inside mobile viewports. */
#ooga-portal-menu { width: min(28rem, calc(100vw - 2rem)); max-height: calc(var(--gate-height, 100dvh) - 2rem); overflow: auto; }
#ooga-portal-menu ol { list-style: none; padding: 0; display: grid; gap: 0.6rem; }
#ooga-portal-menu ol button { width: 100%; min-height: 48px; text-align: left; white-space: normal; }
#ooga-portal-menu ol button:disabled { opacity: 0.65; cursor: not-allowed; }
#ooga-portal-menu button:focus-visible { outline: 3px solid #83e0ed; outline-offset: 2px; }

/* Ooga Arcade's carnival games: the rally's HUD pieces, sized for a thumb and dressed from the jungle. A big score,
   the power meter (a bamboo cane with a leaf-green window and a bone for its needle) over one wide action button
   carved from a timber plank, pop callouts, an ON FIRE tiki torch, and results with stars. */
.carnival-score b {
  font-size: 34px;
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
}

/* The score box stacks the score and best over the goal bar; once the run passes its best, the Best burns gold. */
#carnival .carnival-scores {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-width: 176px;
}

.carnival-scoreline {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

#carnival-best-box[hidden], .carnival-rows li[hidden], .carnival-act[hidden] { display: none; }

.carnival-best b {
  font-variant-numeric: tabular-nums;
}

.carnival-best[data-record="true"] span,
.carnival-best[data-record="true"] b {
  color: #ffd23a;
  text-shadow: 0 0 8px rgba(255, 210, 58, 0.6);
}

/* The goal bar: a groove cut in the stone that fills with ember gold as the score climbs, and the three star
   thresholds standing on it as pixel stars, dark until the score reaches each. */
.carnival-goal {
  position: relative;
  height: 18px;
  margin: 2px 9px 0 0;
}

.carnival-goal::before,
.carnival-goal-fill {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 6px;
  height: 6px;
  border-radius: 3px;
}

.carnival-goal::before {
  background: rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.06);
}

.carnival-goal-fill {
  background: linear-gradient(90deg, #b8641f, #ff9a3c 55%, #ffd23a);
  box-shadow: 0 0 8px rgba(255, 160, 60, 0.55);
  transform: scaleX(0);
  transform-origin: left center;
}

.carnival-goal-star {
  position: absolute;
  top: 0;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  fill: #5a4a36;
  filter: drop-shadow(1px 0 0 #1c150e) drop-shadow(-1px 0 0 #1c150e) drop-shadow(0 1px 0 #1c150e) drop-shadow(0 -1px 0 #1c150e);
}

/* The stars stand evenly along the bar (the scene's GOAL_AT), whatever the game's thresholds. */
.carnival-goal-star:nth-of-type(1) {
  left: 30%;
}

.carnival-goal-star:nth-of-type(2) {
  left: 60%;
}

.carnival-goal-star:nth-of-type(3) {
  left: 90%;
}

.carnival-goal-star[data-lit="true"] {
  fill: #ffd23a;
  filter: drop-shadow(1px 0 0 #5a2a08) drop-shadow(-1px 0 0 #5a2a08) drop-shadow(0 0 5px rgba(255, 210, 58, 0.95));
}

/* NEW BEST, the moment the run passes the best it started with: a ribbon that drops in under the score box, holds
   and fades. */
.carnival-record {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  padding: 4px 12px;
  border: 2px solid #ffd23a;
  border-radius: 999px;
  background: #e0452b;
  color: #fff8e0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 0 16px rgba(255, 120, 40, 0.7);
  pointer-events: none;
}

/* A big moment's warm flash, over the view and under the HUD. */
.carnival-flash {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(ellipse at 50% 45%, rgba(255, 244, 214, 0.5), rgba(255, 190, 110, 0.16) 45%, transparent 72%);
  pointer-events: none;
}

/* The streak and its multiplier, a stone chip over the meter; the coaching line, a dark pill between the meter and
   the button, one line sized for its longest words. */
.carnival-combo,
.carnival-coach {
  position: absolute;
  left: 0;
  right: 0;
  width: max-content;
  margin: 0 auto;
  white-space: nowrap;
  pointer-events: none;
}

.carnival-combo {
  bottom: calc(172px + var(--safe-bottom));
  padding: 4px 12px;
  border: 2px solid var(--stone-dk);
  border-radius: 9px 7px 10px 8px;
  background: var(--tablet);
  box-shadow: var(--tablet-shadow);
  color: #ffd23a;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.carnival-coach {
  bottom: calc(102px + var(--safe-bottom));
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(20, 14, 8, 0.74);
  color: var(--paper);
  font-size: 12px;
  line-height: 18px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

/* Pinball's multiplier stands nearly all game, so its chip hangs under the right-hand stats, off the flippers. */
#carnival[data-kind="pinball"] .carnival-combo {
  top: calc(124px + var(--safe-top));
  right: calc(16px + var(--safe-right));
  bottom: auto;
  left: auto;
  margin: 0;
}

/* Stone Stacker's own screen shows its combo, its x2 and its fire, so the chips would say each twice. */
#carnival[data-kind="stacker"] .carnival-combo,
#carnival[data-kind="stacker"] .carnival-streak {
  display: none;
}

/* Under the results' and the pause's cards the play controls stand down. */
#carnival[data-phase="results"] .carnival-act,
#carnival[data-phase="pause"] .carnival-act,
#carnival[data-phase="results"] .carnival-meter,
#carnival[data-phase="pause"] .carnival-meter,
#carnival[data-phase="results"] .carnival-combo,
#carnival[data-phase="pause"] .carnival-combo,
#carnival[data-phase="results"] .carnival-streak,
#carnival[data-phase="pause"] .carnival-coach {
  visibility: hidden;
}

/* The carnival games take the act button and the canvas; the walking sticks stay in the scenes that walk. */
body[data-active-scene="skee"] .joysticks,
body[data-active-scene="hoops"] .joysticks,
body[data-active-scene="shy"] .joysticks,
body[data-active-scene="claw"] .joysticks,
body[data-active-scene="hockey"] .joysticks,
body[data-active-scene="billiards"] .joysticks,
body[data-active-scene="darts"] .joysticks,
body[data-active-scene="pinball"] .joysticks,
body[data-active-scene="ride"] .joysticks,
body[data-active-scene="invaders"] .joysticks,
body[data-active-scene="snake"] .joysticks,
body[data-active-scene="pong"] .joysticks,
body[data-active-scene="stampede"] .joysticks,
body[data-active-scene="flap"] .joysticks,
body[data-active-scene="breaker"] .joysticks,
body[data-active-scene="dash"] .joysticks,
body[data-active-scene="stacker"] .joysticks {
  display: none;
}

/* Ooga Raid: one stick moves and aims, so the look stick stays away; Jump! and Fire sit under the right thumb. */
body[data-active-scene="raid"] #joy-look {
  display: none;
}

body[data-active-scene="raid"] #act,
#raid-fire {
  position: absolute;
  left: auto;
  bottom: calc(120px + var(--safe-bottom));
  z-index: 13;
  min-width: 80px;
  min-height: 56px;
  transform: none;
}

body[data-active-scene="raid"] #act {
  right: calc(116px + var(--safe-right));
}

#raid-fire {
  right: calc(20px + var(--safe-right));
  background: linear-gradient(#f08a6a, var(--danger));
}

#raid-fire:hover,
#raid-fire.virtual-hover,
#raid-fire:focus-visible {
  background: linear-gradient(#f6a083, #ec6a52);
}

/* A wide touch screen stacks Jump! over the messages at the foot of the page, over the game's screen; in the raid
   the button goes to the thumb instead, and the messages keep their own places. */
@media (pointer: coarse) and (min-width: 721px) {
  body[data-active-scene="raid"] .bottom-hud,
  body[data-active-scene="raid"] .bottom-hud>.message-stack {
    display: contents;
  }

  body[data-active-scene="raid"] .message-stack>.toast,
  body[data-active-scene="raid"] .message-stack>.hint {
    position: absolute;
    max-width: min(620px, calc(100vw - 32px));
    transform: translate(-50%, 8px);
  }

  body[data-active-scene="raid"] .message-stack>.toast.show,
  body[data-active-scene="raid"] .message-stack>.hint.show {
    transform: translate(-50%, 0);
  }
}

/* The raid's calls stay on one line: centred from the middle, the notice would otherwise wrap at half the width. They
   hang inside the screen's top edge on every layout (the scene writes where), never down among a phone's thumb
   controls, where the race's notice goes. */
#raid .raid-notice {
  top: var(--raid-notice-top, calc(84px + var(--safe-top)));
  bottom: auto;
  white-space: nowrap;
}

/* The strip stands beside the 8 by 7 screen on a wide display and under it on a tall one: the scene's fit writes
   which into data-raid-fit on #raid and where into --raid-hud-top, in CSS pixels from the top of #raid. */
.raid-strip .raid-hud {
  top: var(--raid-hud-top, calc(74px + var(--safe-top)));
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 8px 12px;
  white-space: normal;
}

.raid-stat {
  display: grid;
  gap: 1px;
  min-width: 64px;
}

.raid-stat span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.raid-stat b {
  color: var(--paper);
  font-size: 14px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.race-hud-left .raid-stat b {
  color: var(--accent-text);
}

.raid-stat small {
  color: var(--muted);
  font-size: 9.5px;
  white-space: nowrap;
}

.raid-stat small[data-on="true"] {
  color: #f5c542;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Wide, each panel stands just off the frame's side rather than at the page's edge, so on a large display the stats
   stay beside the play and not across the room from it (the margin is SIDE_PX at least, wider than a panel). */
#raid[data-raid-fit="wide"] .raid-strip .race-hud-left {
  left: auto;
  right: calc(100% - var(--raid-screen-edge, 140px) + 12px);
}

#raid[data-raid-fit="wide"] .raid-strip .race-hud-right {
  right: auto;
  left: calc(100% - var(--raid-screen-edge, 140px) + 12px);
}

#raid[data-raid-fit="tall"] .raid-strip .raid-hud {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 12px;
  max-width: none;
}

/* Player 2's stats join each panel when two play: a third row beside the screen, a second line under it when tall. */
.raid-stat[hidden] {
  display: none;
}

#raid[data-raid-fit="tall"][data-raid-players="2"] .raid-strip .raid-hud {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 6px 12px;
}

/* The stage card between stages: the next stage's number over its carved name, a third of the way down the screen (the scene writes where). */
.raid-card {
  position: absolute;
  left: 50%;
  top: var(--raid-card-top, 40%);
  transform: translate(-50%, -50%);
  max-width: calc(100vw - 32px);
  padding: 12px 24px 14px;
  border: 3px solid var(--wood-edge);
  border-radius: var(--radius);
  background: var(--planks);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.35);
  color: var(--paper);
  text-align: center;
  pointer-events: none;
}

.raid-card-kicker {
  margin: 0 0 6px;
  color: var(--accent-text);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  white-space: nowrap;
}

.raid-card h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
}

/* The boss card: the boss's carved name under a red kicker as it enters, where the stage card stands, slammed in big and
   settling, with a red edge so it never reads as the stage card. */
.raid-bosscard {
  border-color: var(--danger);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 24px rgba(226, 76, 52, 0.45);
  animation: raid-boss-in 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.raid-bosscard .raid-card-kicker {
  color: #ff8a73;
}

.raid-bosscard h2 {
  font-size: clamp(20px, 5.4vw, 26px);
}

@keyframes raid-boss-in {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1.8); filter: brightness(2.4); }
  45% { opacity: 1; }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: none; }
}

/* The weapon callout: a pickup's name popping in big over the lower play (the scene writes where), held on one line. */
.raid-call {
  position: absolute;
  left: 50%;
  top: var(--raid-call-top, 60%);
  transform: translate(-50%, -50%);
  max-width: calc(100vw - 32px);
  color: var(--paper);
  font-size: clamp(24px, 6.5vw, 44px);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.65), 0 0 18px rgba(245, 197, 66, 0.75);
  pointer-events: none;
  animation: raid-call-in 0.9s ease-out both;
}

.raid-call[hidden] {
  display: none;
}

@keyframes raid-call-in {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.25); color: #f5c542; }
  32% { transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 1; transform: translate(-50%, -62%) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .raid-bosscard,
  .raid-call {
    animation: none;
  }
}

/* The title card's one-or-two-players choice: the pick pressed, the other plain wood. */
.raid-players button[aria-pressed="false"] {
  background: rgba(0, 0, 0, 0.25);
  color: var(--paper);
  box-shadow: none;
}

/* The choice a pad's d-pad has marked, which A or Start plays. */
.raid-players button[data-pad-mark] {
  outline: 3px solid #9fe6c8;
  outline-offset: 2px;
}

.raid-players-help {
  margin: 8px 0 0;
  white-space: pre-line;
  text-align: center;
}

/* The title card's record: the best score over the furthest stage reached, two lines split on purpose. */
#raid-intro-best {
  white-space: pre-line;
}

/* The title card holds more than most (the players, the stage select, the best), so it keeps to the band between the
   top bar and the folded sheet's tab, whose buttons stay in reach, and scrolls inside it only on a screen too short. */
#raid-intro {
  top: calc(50% + 4px + (var(--safe-top) - var(--safe-bottom)) / 2);
  max-height: calc(100% - 100px - var(--safe-top) - var(--safe-bottom));
  overflow-y: auto;
}

/* In one column on a phone its rules and the players sit closer, so the whole card, Raid! and Exit Game included, fits
   in that band. */
@media (max-width: 520px) {
  #raid-intro .game-rules {
    gap: 3px;
  }

  #raid-intro .game-rules li {
    padding-block: 3px;
  }

  #raid-intro .raid-players {
    margin-top: 10px;
  }
}

/* The boss bar: a boss main's hit points left, hung on the screen's top edge in the strip of page the fit keeps clear
   above it, so it never covers play (the scene writes where and how wide; 20px tall in all). */
.raid-boss {
  position: absolute;
  left: 50%;
  top: var(--raid-boss-top, calc(74px + var(--safe-top)));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  width: var(--raid-boss-w, 240px);
  max-width: calc(100vw - 32px);
  height: 20px;
  box-sizing: border-box;
  padding: 0 8px;
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  /* Grained wood without the planks' corner nails, which would sit on the label at this height. */
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.05) 0 2px, transparent 2px 11px), var(--wood);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.raid-boss[hidden] {
  display: none;
}

.raid-boss-name {
  color: var(--accent-text);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.raid-boss-track {
  display: block;
  height: 8px;
  border: 1px solid rgba(0, 0, 0, 0.6);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.raid-boss-fill {
  display: block;
  height: 100%;
  background: linear-gradient(#ff8a73, var(--danger));
  transform-origin: left center;
}

.raid-pause h2 {
  text-align: center;
}

.raid-pause-help {
  margin: 8px 0 12px;
  text-align: center;
}

/* Shaman's Secrets: a carved-stone tablet over the title card (the Konami code opens it), the secrets as toggles in two
   columns, one on a phone. It flashes and settles as it opens. */
.race-results.raid-secrets {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100% - 24px);
  overflow-y: auto;
  border-color: var(--stone-dk);
  background: var(--tablet);
  box-shadow: var(--tablet-shadow), 0 6px 0 rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 0 100vmax rgba(8, 6, 4, 0.45);
  text-align: center;
  animation: raid-secrets-in 0.7s ease-out both;
}

.raid-secrets h2 {
  color: #9fe6c8;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.6)) drop-shadow(0 0 10px rgba(120, 230, 190, 0.45));
}

.raid-secret-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.raid-secret {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 6px 9px;
  border: 2px solid var(--stone-dk);
  border-radius: 9px 7px 10px 8px;
  background: rgba(0, 0, 0, 0.22);
  box-shadow: var(--tablet-shadow);
  color: var(--paper);
  text-align: left;
  cursor: pointer;
}

.raid-secret b {
  font-size: 11.5px;
  white-space: nowrap;
}

.raid-secret small {
  grid-column: 1;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.3;
}

.raid-secret i {
  grid-column: 2;
  grid-row: 1 / span 2;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.raid-secret[aria-pressed="true"] {
  border-color: #3f8f6e;
  background: rgba(60, 170, 120, 0.22);
}

.raid-secret[aria-pressed="true"] i {
  background: #3f8f6e;
  color: var(--paper);
}

.raid-secret[data-locked="true"] {
  cursor: default;
  opacity: 0.7;
}

.raid-secret:focus-visible,
.raid-secret[data-focus="true"] {
  outline: 2px solid #9fe6c8;
  outline-offset: 1px;
}

.raid-secrets-help {
  white-space: pre-line;
}

.raid-secrets .actions {
  grid-template-columns: 1fr;
  justify-items: center;
}

.raid-secrets .actions button {
  min-width: 140px;
}

@keyframes raid-secrets-in {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); filter: brightness(3) saturate(0.4); }
  30% { opacity: 1; filter: brightness(2.2) saturate(0.6); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  .race-results.raid-secrets {
    animation: none;
  }
}

@media (max-width: 520px) {
  .raid-secret-list {
    grid-template-columns: 1fr;
  }
}

/* The title card's stage chooser while the stage select is on: a step either way round the stage's name. */
.raid-start {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  gap: 8px;
  align-items: center;
  margin: 0 0 10px;
}

.raid-start[hidden] {
  display: none;
}

.raid-start-step {
  height: 38px;
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  background: linear-gradient(#e2a04a, var(--accent));
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 3px 0 var(--nail);
  cursor: pointer;
}

.raid-start-pick {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 4px 8px;
  border: 2px solid var(--stone-dk);
  border-radius: 9px 7px 10px 8px;
  background: var(--tablet);
  box-shadow: var(--tablet-shadow);
}

.raid-start-pick span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.raid-start-pick b {
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* The chooser's keys, one line under it across all three columns. */
.raid-start-help {
  grid-column: 1 / -1;
  margin: 0;
  white-space: nowrap;
}

/* Mirror mode: the raid's picture flipped left to right (both canvases, so the overlay keeps to the play); the HUD is
   the DOM's and reads as ever. The scene sets the flag while a run with it plays and clears it in leave. */
body[data-raid-mirror] #scene,
body[data-raid-mirror] #overlay {
  transform: scaleX(-1);
}

/* The mark a run with secrets on wears in the strip. */
.raid-stat small.raid-cheat-mark {
  color: #9fe6c8;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.raid-stat small.raid-cheat-mark[hidden] {
  display: none;
}

/* A tiki torch: the badge burns hottest at its foot, a flame licks up from its top and it stands on a bamboo pole. */
.carnival-streak {
  position: absolute;
  left: 50%;
  top: calc(128px + var(--safe-top));
  transform: translateX(-50%);
  padding: 6px 16px;
  border: 2px solid #ffd23a;
  border-radius: 22px 22px 10px 10px;
  background: radial-gradient(ellipse 75% 130% at 50% 120%, #fff3a0, #ffd23a 32%, #ff9a3c 60%, #e0452b 92%);
  color: #3a1206;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-shadow: 0 0 6px rgba(255, 243, 160, 0.9);
  box-shadow: 0 0 18px rgba(255, 120, 40, 0.8);
  pointer-events: none;
  animation: carnival-pulse 0.6s ease-in-out infinite alternate;
}

.carnival-streak::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -13px;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  border-radius: 50% 0 50% 50%;
  background: radial-gradient(circle at 38% 62%, #fff3a0 0 22%, #ffb13a 52%, #e0452b 88%);
  box-shadow: 0 0 10px rgba(255, 140, 40, 0.9);
  transform: rotate(-45deg);
  z-index: -1;
}

.carnival-streak::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -16px;
  width: 12px;
  height: 14px;
  margin-left: -6px;
  border: 2px solid var(--wood-edge);
  border-top: 0;
  border-radius: 0 0 3px 3px;
  background: repeating-linear-gradient(180deg, transparent 0 4px, rgba(74, 51, 25, 0.75) 4px 6px), linear-gradient(90deg, #6f6a24, #d8c46a 45%, #8a7f30);
}

@keyframes carnival-pulse {
  to { transform: translateX(-50%) scale(1.08); box-shadow: 0 0 30px rgba(255, 160, 40, 1); }
}

/* A callout sizes to its words but never past the screen: a long one breaks at a space into two even lines. */
.carnival-pop {
  top: 40%;
  width: max-content;
  max-width: calc(100vw - 32px);
  font-size: 38px;
  line-height: 1.1;
  text-align: center;
  text-wrap: balance;
  color: #fff3c8;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.6), 0 0 22px rgba(255, 95, 162, 0.7);
}

.carnival-pop[data-big="true"] {
  font-size: 60px;
  color: #ffd23a;
  text-shadow: 0 5px 0 rgba(0, 0, 0, 0.6), 0 0 32px rgba(255, 210, 58, 0.9);
}

/* Ptero Flap's flight fills its whole screen, so in play its callouts stay off the glass: above it on a wide view
   (the glass spans 19% to 81% of the height), below it on a tall one, where scene-carnival.js's `retroView` fits the
   4:3 glass to 92% of the width and lifts it 7%, so its foot sits at 43% of the height plus 34.5% of the width. */
#carnival[data-kind="flap"][data-phase="play"] .carnival-pop {
  top: 10%;
}

@media (max-aspect-ratio: 1/1) {
  #carnival[data-kind="flap"][data-phase="play"] .carnival-pop {
    top: calc(43% + 34.5vw + 30px);
  }
}

/* The power meter is a dried bamboo cane: dark gold-brown, so the fresh leaf is the only bright green on it, with a
   node band every fifth of its length and rope wrapped round both ends, drawn in its own background layers so the
   window and the bone always sit on top. */
.carnival-meter {
  position: absolute;
  left: 50%;
  bottom: calc(134px + var(--safe-bottom));
  transform: translateX(-50%);
  width: min(460px, calc(100vw - 48px));
  height: 26px;
  border: 3px solid var(--wood-edge);
  border-radius: 999px;
  background:
    repeating-linear-gradient(115deg, var(--wood-edge) 0 2px, var(--wood) 2px 4px, var(--plank) 4px 5px) left / 16px 100% no-repeat,
    repeating-linear-gradient(115deg, var(--wood-edge) 0 2px, var(--wood) 2px 4px, var(--plank) 4px 5px) right / 16px 100% no-repeat,
    repeating-linear-gradient(90deg, transparent 0 calc(20% - 4px), rgba(58, 52, 16, 0.85) calc(20% - 4px) calc(20% - 2px), rgba(255, 240, 170, 0.5) calc(20% - 2px) 20%),
    linear-gradient(180deg, rgba(255, 250, 210, 0) 8%, rgba(255, 250, 210, 0.1) 26%, rgba(255, 250, 210, 0) 46%),
    linear-gradient(180deg, #8f7c3a, #6b5c26 42%, #4a3f18 78%, #2f2810);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4), inset 0 -3px 4px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  pointer-events: none;
}

/* The green window is a fresh leaf, cut to a blade with its pale midrib along the middle and a hard dark edge. */
.carnival-window {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 9px 2px;
  background: linear-gradient(180deg, transparent calc(50% - 1px), rgba(236, 255, 196, 0.85) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)), linear-gradient(180deg, #b8ff7e, #5fd83e 55%, #2f9e2c);
  box-shadow: 0 0 0 2px #10300a, 0 0 14px rgba(140, 255, 90, 0.9);
}

.carnival-needle {
  position: absolute;
  inset: 0;
}

/* The needle is a bone: a cream shaft with two round knobs at each end, outlined dark so it reads over the cane. */
.carnival-needle::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -6px;
  width: 12px;
  background:
    radial-gradient(circle at 3px 3.5px, #fff8e6 3px, transparent 3.5px),
    radial-gradient(circle at 9px 3.5px, #fff8e6 3px, transparent 3.5px),
    radial-gradient(circle at 3px calc(100% - 3.5px), #fff8e6 3px, transparent 3.5px),
    radial-gradient(circle at 9px calc(100% - 3.5px), #fff8e6 3px, transparent 3.5px),
    linear-gradient(90deg, transparent 3.5px, #f3e8cc 3.5px 8.5px, transparent 8.5px);
  filter: drop-shadow(1px 0 0 #2a1a0c) drop-shadow(-1px 0 0 #2a1a0c) drop-shadow(0 0 4px rgba(255, 210, 58, 0.7));
}

/* The action button is a plank carved from warm timber: grain, a dark edge, the word cut in, and a leaf on its corner. */
.carnival-act {
  position: absolute;
  left: 50%;
  bottom: calc(28px + var(--safe-bottom));
  transform: translateX(-50%);
  min-width: 220px;
  height: 68px;
  padding: 0 34px;
  border: 3px solid var(--wood-edge);
  border-radius: 16px 12px 18px 13px;
  background:
    repeating-linear-gradient(177deg, rgba(92, 52, 18, 0.16) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(183deg, rgba(255, 234, 190, 0.12) 0 1px, transparent 1px 11px),
    linear-gradient(180deg, #ecb870, #d39650 48%, #b47a3c);
  color: var(--ink);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 236, 196, 0.6);
  box-shadow: 0 6px 0 var(--wood-dk), inset 0 2px 0 rgba(255, 240, 205, 0.55), inset 0 -3px 0 rgba(74, 51, 25, 0.4), 0 10px 24px rgba(0, 0, 0, 0.45), 0 0 22px rgba(255, 190, 90, 0.35);
  touch-action: manipulation;
}

.carnival-act::before {
  content: "";
  position: absolute;
  left: 14px;
  top: -9px;
  width: 26px;
  height: 13px;
  border-radius: 0 100% 0 100%;
  background: linear-gradient(to top right, transparent calc(50% - 0.75px), rgba(230, 255, 190, 0.75) calc(50% - 0.75px) calc(50% + 0.75px), transparent calc(50% + 0.75px)), linear-gradient(135deg, #9fe060, #4ea23a 60%, #2f7a2c);
  box-shadow: inset 0 0 0 1px rgba(20, 60, 12, 0.5);
  transform: rotate(-18deg);
  pointer-events: none;
}

.carnival-act:active:not(:disabled) {
  transform: translateX(-50%) translateY(4px);
  box-shadow: 0 2px 0 var(--wood-dk), inset 0 2px 0 rgba(255, 240, 205, 0.55), inset 0 -3px 0 rgba(74, 51, 25, 0.4), 0 6px 14px rgba(0, 0, 0, 0.45);
}

.carnival-act:disabled {
  opacity: 0.55;
  filter: saturate(0.6);
}

.carnival-results {
  text-align: center;
}

.carnival-stars {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 10px 0 2px;
}

/* Each star with the score it takes printed under it. */
.carnival-star-slot {
  display: grid;
  justify-items: center;
  gap: 2px;
}

.carnival-star-need {
  color: rgba(243, 239, 228, 0.78);
  font-size: 10px;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}

/* The game's breakdown of the run under the total, when it gives one: prose, so it may wrap. */
.carnival-note {
  margin: 6px 0 0;
  color: var(--paper);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}

/* How to play, on the pause card. */
.carnival-help {
  margin: 10px 0 0;
  padding: 8px 12px;
  background: var(--tablet);
  border: 2px solid var(--stone-dk);
  border-radius: 9px 7px 10px 8px;
  color: var(--paper);
  font-size: 12px;
  line-height: 1.45;
}

.carnival-star {
  width: 44px;
  height: 44px;
  fill: rgba(0, 0, 0, 0.35);
}

.carnival-star[data-lit="true"] {
  fill: #ffd23a;
  filter: drop-shadow(0 0 8px rgba(255, 210, 58, 0.9));
}

/* What the watching Oogas think of the run: one line under the stars, sized for its longest words ("Ooga try
   again.") so it never wraps on a phone. */
.carnival-says {
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.05em;
  white-space: nowrap;
  color: var(--paper);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55), 0 0 12px rgba(255, 190, 90, 0.35);
}

.carnival-final {
  margin: 4px 0 0;
}

.carnival-final b {
  display: block;
  font-size: 58px;
  line-height: 1.05;
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
}

.carnival-newbest {
  display: inline-block;
  margin-top: 4px;
  padding: 3px 12px;
  border-radius: 999px;
  background: #e0452b;
  color: #fff8e0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  animation: carnival-pulse-badge 0.7s ease-in-out infinite alternate;
}

@keyframes carnival-pulse-badge {
  to { transform: scale(1.1); }
}

@media (prefers-reduced-motion: reduce) {
  .carnival-streak,
  .carnival-newbest {
    animation: none;
  }
}

.carnival-rows li {
  grid-template-columns: 1fr auto;
  text-align: left;
}

.carnival-rows li::before {
  content: none;
}

/* The carnival title cards' rule tiles are tanned hide, not slate: dark leather stitched round its edge, the small
   print in bone. */
#carnival .game-rules li {
  background: linear-gradient(160deg, #603e24, #4a2f1a 55%, #37220f);
  border-color: #24160a;
  outline: 1px dashed rgba(239, 230, 210, 0.24);
  outline-offset: -5px;
}

#carnival .game-rules small {
  color: rgba(239, 230, 210, 0.76);
}

/* On a phone the right-hand stats stack, so a long label such as Coconuts never pushes them into the score or
   reflows as the numbers change, the score steps down so a pinball's five or six digits still clear them (and again
   at seven, with its best shortened), the torch
   burns below both boards, and the callouts shrink so most fit one line. */
@media (max-width: 720px) {
  #carnival .race-hud-right {
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    max-width: none;
  }

  #carnival .carnival-score b {
    font-size: 28px;
  }

  #carnival .carnival-score b[data-long="true"] {
    font-size: 23px;
  }

  #carnival .carnival-scores {
    min-width: 140px;
  }

  .carnival-record {
    top: calc(100% + 6px);
    padding: 3px 10px;
    font-size: 11px;
  }

  .carnival-combo {
    font-size: 12px;
  }

  #carnival[data-kind="pinball"] .carnival-combo {
    top: calc(172px + var(--safe-top));
    right: calc(10px + var(--safe-right));
  }

  .carnival-streak {
    top: calc(174px + var(--safe-top));
  }

  .carnival-pop {
    font-size: 24px;
    letter-spacing: 0.04em;
  }

  .carnival-pop[data-big="true"] {
    font-size: 40px;
  }
}

/* The arcade's prize counter: the ticket balance and a grid of prizes, each with its price and a redeem button. */
.prize-panel {
  width: min(520px, calc(100vw - 32px));
  text-align: center;
}

.prize-balance {
  margin: 8px 0 10px;
  padding: 6px 12px;
  background: var(--tablet);
  border: 2px solid var(--stone-dk);
  border-radius: 9px 7px 10px 8px;
  box-shadow: var(--tablet-shadow);
  font-size: 14px;
}

.prize-balance b {
  font-size: 22px;
  color: var(--accent-text);
}

.prize-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.prize {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 10px 6px 8px;
  border: 2px solid var(--stone-dk);
  border-radius: 9px 7px 10px 8px;
  background: var(--tablet);
  box-shadow: var(--tablet-shadow);
}

.prize[data-owned="true"] {
  border-color: #ffd23a;
  box-shadow: 0 0 14px rgba(255, 210, 58, 0.55);
}

.prize-icon {
  width: 40px;
  height: 40px;
}

.prize b {
  font-size: 12px;
  overflow-wrap: anywhere;
}

.prize small {
  color: var(--muted);
  font-size: 10px;
}

.prize-buy {
  width: 100%;
  margin-top: 4px;
  font-size: 12px;
}

.prize-buy:disabled {
  opacity: 0.5;
}

@media (max-width: 480px) {
  .prize-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Two columns reach down over the act button, idle while the counter is up, so it steps aside for Ooga done. */
  body:has(#prize-panel:not([hidden])) #act {
    visibility: hidden;
  }
}

/* Ember Den: a walkable room, a readable lobby, and a focused table. */

/* The Ember Den's one set of styles, which every panel, dialog and button here is made from (the unit tier's "Ember Den
   styles" check holds them to it): corners (--ui-r a panel's, --ui-r-btn a control's, --ui-r-in what stands inside one,
   --ui-r-card a playing card's, --ui-r-pill a badge's), the dark glass and its edge, the lettering, and how a chosen
   button looks. A table's era keeps its own colours and title lettering (--pk-*, --era-font), never its own shapes. */
#poker, #poker-panel {
  --ui-r: 12px; --ui-r-btn: 10px; --ui-r-in: 7px; --ui-r-card: 4px; --ui-r-pill: 99px;
  --ui-glass: #0f1211e0; --ui-edge: #ffffff1f; --ui-font: system-ui, sans-serif;
  --ui-on: #4fd08f; --ui-on-text: #c9f5dd; --ui-on-face: #2e7d5b33; --ui-on-ring: inset 0 0 0 1px #4fd08f55;
  --pk-accent: #dfbe77; --pk-bright: #f4dda2; --pk-ink: #213023;
  --pk-text: #f5efdf; --pk-muted: #c1d0bb; --pk-surface: #243e33; --pk-deep: #142820;
  --pk-halo: #45654f; --pk-rail: #d3c5a5; --pk-feltLight: #3b7963; --pk-feltDark: #164332; --pk-felt: #317459;
  --pk-line: #dfbe7766; --pk-soft: #dfbe7722; --pk-glow: #dfbe7755;
  --pk-surfaceSoft: #243e33aa; --pk-haloSoft: #45654f77; --pk-haloGlass: #45654ff2; --pk-deepGlass: #142820f7;
  --pk-haloVeil: #45654f8c; --pk-deepVeil: #142820d9;
}
#poker { pointer-events: none; color: var(--pk-text); font-family: var(--ui-font); }
#poker .poker-return, #poker .poker-focus { pointer-events: auto; }
/* Ask Ooga To Move: the line on a computer opponent's seat card, and the bar while the visitor's Ooga carries a guest
   overhead (what the aim says, the keys, Throw and Put down), low in the middle of the floor view, clear of the sticks. */
.poker-ask { display: block; margin-top: 5px; padding: 3px 4px; font-size: 9px; font-weight: 700; letter-spacing: 0.04em; line-height: 1.2; color: var(--pk-ink); background: var(--pk-accent); border-radius: var(--ui-r-in); overflow-wrap: anywhere; }
#poker .poker-seat.npc .poker-seat-button:not(:disabled) { cursor: pointer; }
#poker .poker-seat.npc .poker-seat-button:not(:disabled):hover .poker-ask { background: var(--pk-bright); color: var(--pk-ink); }
#poker .poker-carry { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 22px); transform: translateX(-50%); z-index: 6; width: min(360px, calc(100vw - 32px)); box-sizing: border-box; padding: 12px; border: 1px solid var(--ui-edge); border-radius: var(--ui-r); background: var(--ui-glass); box-shadow: 0 8px 22px #0007; pointer-events: auto; text-align: center; }
@media (pointer: coarse) { .poker-open-key { display: none; } }
.poker-carry-hint { margin: 0 0 10px; line-height: 1.3; font-size: 14px; font-weight: 750; color: var(--pk-bright); }
.poker-carry-keys { margin: 4px 0 8px; font-size: 9.5px; color: var(--pk-muted); }
.poker-carry-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
/* On a touch screen the prompt stands clear above the sticks. */
@media (pointer: coarse) { #poker .poker-carry { bottom: calc(max(48px, var(--stick-inset) - var(--home-chrome)) + var(--safe-bottom) + var(--stick-size) + 14px); } }
/* The lounge playlist's "now playing" line: a small pill under the header for a few seconds; a tap opens the credits. */
#poker .poker-now { position: fixed; left: 50%; top: 66px; transform: translateX(-50%); z-index: 6; max-width: calc(100vw - 32px); min-height: 36px; padding: 5px 14px; font-size: 11px; color: var(--pk-bright); background: var(--ui-glass); border: 1px solid var(--ui-edge); border-radius: var(--ui-r-pill); pointer-events: auto; overflow-wrap: anywhere; animation: poker-now-in 0.4s ease-out both; }
@keyframes poker-now-in { from { opacity: 0; translate: 0 -6px; } }
#poker [hidden] { display: none !important; }
/* Dark glass, every Ember Den button's look (the Ember Den tab's too): a quiet translucent face mixed from the table's
   own text colour, so each era's palette carries through; one switched on ringed in green with a dot on its top left
   corner, clear of its label, so its state never rests on colour alone; the one main action of a screen (`.poker-primary`) filled in the era's accent. */
#poker button { color: var(--pk-text); background: color-mix(in srgb, var(--pk-text) 6%, transparent); border: 1px solid color-mix(in srgb, var(--pk-text) 16%, transparent); font-family: inherit; min-height: 44px; white-space: normal; border-radius: var(--ui-r-btn); box-shadow: none; }
#poker button[aria-pressed="true"] { color: var(--ui-on-text); background: var(--ui-on-face); border-color: var(--ui-on); box-shadow: var(--ui-on-ring); }
#poker button[aria-pressed="true"], .poker-tab-body button[aria-pressed="true"] { position: relative; }
#poker button[aria-pressed="true"]::before, :is(.poker-tab-body, .den-page) button[aria-pressed="true"]::before { content: ""; position: absolute; top: -4px; left: -4px; width: 9px; height: 9px; border-radius: 50%; background: var(--ui-on); box-shadow: 0 0 0 2px #0f1211; }
#poker button:focus-visible, #poker input:focus-visible, #poker summary:focus-visible, #poker select:focus-visible { outline: 3px solid var(--pk-bright); outline-offset: 3px; }
#poker button:disabled { cursor: default; opacity: 0.45; }
/* Seated in 3D (#959, poker-seated.js): the game's HUD pinned to the screen's corners, off the board, the pot, the dealer,
   the visitor's own cards and chips and the faces round the table. Top left the table's facts, top right the view
   switch and table options, bottom left the visitor's stack, pot and price (with their hand's inset in third person),
   bottom right the betting actions, shown only on their turn. The sticks are hidden while seated. */
#poker .poker-seated { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#poker .poker-seated > * { position: absolute; pointer-events: auto; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--ui-edge); border-radius: var(--ui-r); background: var(--ui-glass); box-shadow: 0 6px 18px #0006; }
#poker .poker-seated p, #poker .poker-seated dl { margin: 0; }
#poker .poker-seated button { min-height: 40px; padding: 4px 10px; font-size: 11px; font-weight: 700; }
#poker .poker-seated button[aria-pressed="true"] { color: var(--ui-on-text); background: var(--ui-on-face); border-color: var(--ui-on); box-shadow: var(--ui-on-ring); }
#poker .poker-seated button.poker-primary { color: var(--pk-ink); background: var(--pk-accent); border-color: var(--pk-bright); }
.poker-seated-info { left: max(12px, var(--safe-left)); top: calc(76px + var(--safe-top)); max-width: min(300px, 42vw); font-size: 10px; line-height: 1.35; color: var(--pk-muted); }
.poker-seated-head { font-size: 13px; font-weight: 750; color: var(--pk-bright); white-space: nowrap; }
.poker-seated-turn { margin-top: 2px; font-size: 12px; font-weight: 750; color: var(--pk-text); overflow-wrap: anywhere; }
.poker-seated-corner { right: max(12px, var(--safe-right)); top: calc(76px + var(--safe-top)); display: grid; gap: 6px; max-width: min(420px, 54vw); }
.poker-seated-views, .poker-seated-tools { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; position: relative; }
.poker-seated-emotes { position: absolute; right: 0; top: calc(100% + 6px); display: grid; grid-template-columns: repeat(5, 44px); gap: 4px; padding: 6px; border: 1px solid var(--pk-line); border-radius: var(--ui-r-btn); background: var(--pk-deepGlass); }
#poker .poker-seated-emotes button { min-height: 44px; padding: 0; font-size: 20px; }
/* The left panel's width, shared with the betting panel docked under it and the Table view's room for it (`--poker-left-w`,
   on #poker so the table sees it too). */
#poker { --poker-left-w: min(250px, 44vw); }
#poker:has(.poker-seated > .poker-seated-own[data-rail]) { --poker-left-w: min(300px, 46vw); }
.poker-seated-own { --own-foot: calc(12px + var(--safe-bottom, 0px)); left: max(12px, var(--safe-left)); bottom: var(--own-foot); display: grid; gap: 8px; width: var(--poker-left-w); }
#poker .poker-seated > .poker-seated-own { padding: 12px 14px; }
.poker-seated-own .poker-seated-card { width: 64px; }
.poker-seated-mine dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.poker-seated-mine dt { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--pk-muted); white-space: nowrap; }
.poker-seated-mine dd { margin: 2px 0 0; font-size: 17px; font-weight: 750; color: var(--pk-bright); white-space: nowrap; }
.poker-seated-result { font-size: 10px; color: var(--pk-text); overflow-wrap: anywhere; }
.poker-seated-result:empty { display: none; }
.poker-seated-hand { display: flex; gap: 6px; justify-content: center; }
/* Your hand after you fold: grey and dimmed, with its name. */
.poker-seated-hand[data-folded] .poker-seated-card { filter: grayscale(1) brightness(0.6); opacity: 0.7; }
.poker-seated-hand-name[data-folded] { color: var(--pk-muted); }
#poker .poker-seated > .poker-seated-board { left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; gap: 8px; padding: 10px; pointer-events: none; animation: poker-seated-board-in 0.14s ease-out; }
#poker .poker-seated > .poker-seated-board[hidden] { display: none; }
.poker-seated-board .poker-seated-card { width: clamp(48px, 15vw, 104px); filter: drop-shadow(0 4px 8px #0008); }
#poker .poker-seated-between .poker-seated-deal { margin-top: 10px; pointer-events: auto; }
#poker .poker-seated-between .poker-seated-deal[hidden] { display: none; }
/* A player still in a hand that ended with their cards face down may show them (poker-seated.js `canShow`). */
#poker .poker-seated-between .poker-seated-show { margin-top: 10px; pointer-events: auto; }
/* The card that won the draw for the button, under its line (poker-seated.js `announce`). */
.poker-seated-between .poker-seated-drawn { display: block; width: 58px; margin: 10px auto 0; filter: drop-shadow(0 4px 8px #0008); }
.poker-seated-between .poker-seated-drawn[hidden] { display: none; }
#poker .poker-seated-between .poker-seated-show[hidden] { display: none; }
.poker-seated-between-cards .poker-seated-card[data-empty], .poker-seated-hand .poker-seated-card[data-empty], .poker-seated-board .poker-seated-card[data-empty] { box-sizing: border-box; border: 2px dashed #ffffff59; border-radius: 8%; background: #0000004d; filter: none; }
@keyframes poker-seated-board-in { from { opacity: 0; transform: translate(-50%, -46%); } }
@media (prefers-reduced-motion: reduce) { #poker .poker-seated > .poker-seated-board { animation: none; } }
/* The player rail (poker-seated.js `rail`), broadcast style, atop the panel at the bottom left, which widens to hold it. */
/* It reaches up to the banner's foot (`--banner-foot`, kept by hud.js) and no further: the players list gives way first. */
.poker-seated-own[data-rail] { display: flex; flex-direction: column; gap: 12px; max-height: calc(100dvh - var(--own-foot) - var(--banner-foot, 63px)); }
/* Widened by the panel's right edge (poker-seated.js `widen`): the cards grow with it, the rail's two in
   each row and the board's five, by --rk (1 to 1.5, this browser's choice); the labels by --lk, at 0.4 of that. Never past
   the screen. Set on #poker, so the betting panel under the left one and the Table view widen with it. */
#poker { --rk: var(--poker-rail-k, 1); --lk: calc(1 + (var(--rk) - 1) * 0.4); }
#poker[data-wide]:has(.poker-seated > .poker-seated-own[data-rail]) { --poker-left-w: min(calc(300px * var(--rk)), calc(100vw - 24px - var(--safe-left, 0px) - var(--safe-right, 0px))); }
.poker-players-wgrip { position: absolute; top: 12px; bottom: 0; right: 0; width: 12px; cursor: ew-resize; touch-action: none; outline: none; border-radius: 0 var(--ui-r) var(--ui-r) 0; }
.poker-players-wgrip::after { content: ""; position: absolute; top: calc(50% - 6px); right: 4px; width: 4px; height: 40px; margin-top: -20px; border-radius: var(--ui-r-pill); background: #ffffff33; transition: background .12s; }
.poker-players-wgrip:is(:hover, :focus-visible, [data-drag])::after { background: var(--pk-accent); }
/* With the rail, one rhythm: 12 px between its sections (the rail, the board), 6 px inside one, and every label on the
   rows' inner edge (5 px in). */
.poker-players-board { display: grid; gap: 6px; }
.poker-players-stage b { margin-left: auto; font-weight: 700; color: var(--pk-text); letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; }
.poker-players-stage { min-height: 22px; display: flex; align-items: center; gap: 8px; padding: 0 5px; font-size: calc(11px * var(--lk)); font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pk-bright); }
.poker-players-five { display: grid; grid-template-columns: repeat(5, minmax(0, calc(52px * var(--rk)))); gap: 6px; padding: 0 5px; }
.poker-seated-own .poker-players-five .poker-seated-card { width: 100%; }
.poker-players-five .poker-seated-card[data-empty] { box-sizing: border-box; border: 2px dashed #ffffff40; border-radius: 8%; background: #0000004d; }
/* The rail's and its board's faces: the rank over the suit, centred and as large as the card allows, on the card's paper. */
:is(.poker-players-cards, .poker-players-five) .poker-seated-card[data-rank] { container-type: inline-size; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; border-radius: 9%; background: linear-gradient(120deg, #fffdf4, #e5e3d7); color: #222a2b; overflow: hidden; }
:is(.poker-players-cards, .poker-players-five) .poker-seated-card[data-rank] svg { display: none; }
/* Every rank in one serif with lining figures (`poker-rank`, a device font: Georgia's old-style figures stood a 10's 1
   and 0 at x-height beside a capital Q), so letters and numbers share one height; and each suit a shape of the same
   square (`--suit`, painted in the card's colour), where text suits come from whatever font has them, each its own size. */
@font-face { font-family: "poker-rank"; src: local("Times New Roman Bold"), local("TimesNewRomanPS-BoldMT"), local("Times-Bold"), local("Liberation Serif Bold"); font-weight: 700 900; }
:is(.poker-players-cards, .poker-players-five) .poker-seated-card[data-rank]::before { content: attr(data-rank); font: 800 56cqw/0.95 "poker-rank", Georgia, serif; }
/* A 10's two figures set close; the spacing after its last figure given back, so it stands centred over its suit. */
:is(.poker-players-cards, .poker-players-five) .poker-seated-card[data-rank="10"]::before { letter-spacing: -0.06em; padding-right: 0.06em; }
:is(.poker-players-cards, .poker-players-five) .poker-seated-card[data-rank]::after { content: ""; width: 38cqw; height: 38cqw; margin-top: 12cqw; background: currentColor; -webkit-mask: var(--suit) center / contain no-repeat; mask: var(--suit) center / contain no-repeat; }
:is(.poker-players-cards, .poker-players-five) .poker-seated-card[data-suit="♠"] { --suit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 2C30 28 4 40 4 60c0 16 18 24 34 14-2 10-6 18-12 24h48c-6-6-10-14-12-24 16 10 34 2 34-14 0-20-26-32-46-58z'/%3E%3C/svg%3E"); }
:is(.poker-players-cards, .poker-players-five) .poker-seated-card[data-suit="♥"] { --suit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 96C30 78 4 62 4 34 4 16 18 4 32 4c10 0 16 6 18 14 2-8 8-14 18-14 14 0 28 12 28 30 0 28-26 44-46 62z'/%3E%3C/svg%3E"); }
:is(.poker-players-cards, .poker-players-five) .poker-seated-card[data-suit="♦"] { --suit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 2 88 50 50 98 12 50z'/%3E%3C/svg%3E"); }
:is(.poker-players-cards, .poker-players-five) .poker-seated-card[data-suit="♣"] { --suit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='24' r='21'/%3E%3Ccircle cx='24' cy='58' r='21'/%3E%3Ccircle cx='76' cy='58' r='21'/%3E%3Ccircle cx='50' cy='48' r='9'/%3E%3Cpath d='M45 52c0 22-5 34-15 46h40c-10-12-15-24-15-46z'/%3E%3C/svg%3E"); }
:is(.poker-players-cards, .poker-players-five) .poker-seated-card[data-red="true"] { color: #a32c40; }
/* The visitor's own block at the top of the betting panel: whose turn it is over the clock, the numbers, then the seat's
   buttons, in the same rhythm, with a rule under it before the emotes. */
.poker-seated-mine { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 10px; row-gap: 6px; padding-top: 10px; border-top: 1px solid var(--pk-line); }
.poker-seated-mine > * { grid-column: 1 / -1; }
.poker-seated-mine > .poker-seated-turn:not(:empty) { grid-column: 1; max-width: 170px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.poker-seated-mine > .poker-seated-turn:not(:empty) + .poker-seated-clock { grid-column: 2; }
#poker .poker-seated-mine > .poker-seated-turn:empty, .poker-seated-mine > dl { display: none; }
.poker-seated-mine > .poker-seated-clock { margin: 0; }
/* The seat's note under the timer keeps its line even when empty, so the buttons under it never move. */
.poker-seated-mine > .poker-seated-plan > p:empty::before { content: "\00a0"; }
/* The visitor's own row in the rail carries their cards and hand, so the big cards under it give way. */
.poker-seated-own[data-rail] > :is(.poker-seated-hand, .poker-seated-hand-name) { display: none; }
.poker-players { --row: max(46px, calc(28px * var(--rk) * 7 / 5 + 8px)); display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: calc(var(--row) + 28px); }
/* The panel's top edge, a grip that sets the players list's height (poker-seated.js `grip`): a pill that lights when
   pointed at, focused or dragged; gone while the list is folded away. */
.poker-players-grip { position: absolute; top: 0; left: 0; right: 0; height: 12px; cursor: ns-resize; touch-action: none; outline: none; border-radius: var(--ui-r) var(--ui-r) 0 0; }
.poker-players-grip::after { content: ""; position: absolute; left: 50%; top: 4px; width: 40px; height: 4px; margin-left: -20px; border-radius: var(--ui-r-pill); background: #ffffff33; transition: background .12s; }
.poker-players-grip:is(:hover, :focus-visible, [data-drag])::after { background: var(--pk-accent); }
.poker-seated-own:has(> .poker-players[data-closed]) > .poker-players-grip { display: none; }
#poker .poker-seated .poker-players-head { display: flex; align-items: center; gap: 8px; min-height: 22px; padding: 0 5px; border: 0; background: none; color: var(--pk-bright); font-size: calc(11px * var(--lk)); letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; }
.poker-players-head b { margin-left: auto; font-weight: 600; color: var(--pk-muted); letter-spacing: 0; text-transform: none; }
.poker-players-head i { width: 7px; height: 7px; border-right: 2px solid var(--pk-muted); border-bottom: 2px solid var(--pk-muted); transform: rotate(45deg) translateY(-2px); transition: transform 0.15s; }
.poker-players[data-closed] .poker-players-head i { transform: rotate(-45deg); }
/* Folded by its header, the list keeps only the visitor's own row, whatever height it was given. */
.poker-players[data-closed] .poker-players-row:not(.yours) { display: none; }
#poker .poker-players[data-closed] .poker-players-list { height: auto; max-height: none; }
.poker-players-list { display: grid; gap: 1px; margin: 0; padding: 0; list-style: none; height: var(--poker-rail-h, auto); min-height: var(--row); max-height: max(46px, calc(28px * var(--rk) * 7 / 5 + 8px), var(--poker-rail-h, min(450px, calc(100dvh - 272px - var(--safe-top, 0px) - var(--safe-bottom, 0px))))); overflow-y: auto; overscroll-behavior: contain; }
/* A row is never shorter than its cards (5:7, `28px * --rk` wide) with its padding and border, even when the list is short
   of room: it scrolls instead of squeezing the rows. */
.poker-players-row { min-height: max(45px, calc(28px * var(--rk) * 7 / 5 + 8px)); box-sizing: border-box; display: grid; grid-template-columns: calc(22px * var(--lk)) calc(32px * var(--lk)) minmax(0, 1fr) auto calc(54px * var(--lk)); align-items: center; gap: 5px; padding: 3px 5px; border-radius: var(--ui-r-in); border: 1px solid transparent; background: #ffffff0a; }
.poker-players-row[hidden] { display: none; }
.poker-players-pos { justify-self: center; min-width: calc(20px * var(--lk)); padding: 1px 2px; border-radius: var(--ui-r-pill); font-size: calc(9px * var(--lk)); font-weight: 800; text-align: center; color: var(--pk-muted); }
.poker-players-pos[data-kind="D"] { color: #2a2418; background: #ece3c7; }
.poker-players-pos[data-kind="SB"], .poker-players-pos[data-kind="BB"] { color: var(--pk-bright); border: 1px solid var(--pk-line); }
.poker-players-pfp { position: relative; display: grid; place-items: center; width: calc(32px * var(--lk)); height: calc(32px * var(--lk)); }
.poker-players-face { width: calc(26px * var(--lk)); height: calc(26px * var(--lk)); border-radius: 50%; background: #0006; image-rendering: pixelated; }
/* The acting seat's clock: a thin ring draining round the face, the seconds over it, in the turn bar's colours. */
.poker-players-pfp svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; }
.poker-players-pfp circle { fill: none; stroke: #b48cff; stroke-width: 2; stroke-dasharray: 100; stroke-dashoffset: 100; stroke-linecap: round; visibility: hidden; transition: stroke-dashoffset .12s linear; }
.poker-players-pfp[data-stage] circle { visibility: visible; }
.poker-players-pfp[data-stage~="mine"] circle { stroke: #4fd08f; }
.poker-players-pfp[data-stage^="yellow"][data-stage~="mine"] circle { stroke: #f2c14e; }
.poker-players-pfp[data-stage^="red"][data-stage~="mine"] circle { stroke: #ff6a4a; }
.poker-players-pfp[data-stage^="bank"] circle { stroke: #8cdcf9; }
.poker-players-pfp > b { position: absolute; inset: 3px; display: grid; place-items: center; border-radius: 50%; font: 800 calc(11px * var(--lk)) var(--ui-font); color: #fff; text-shadow: 0 1px 2px #000; }
.poker-players-pfp > b:empty { display: none; }
.poker-players-pfp[data-stage] > b { background: #0000008c; }
@media (prefers-reduced-motion: reduce) { .poker-players-pfp circle { transition: none; } }
.poker-players-who { display: grid; min-width: 0; line-height: 1.2; }
.poker-players-who b { overflow: hidden; font-size: calc(12.5px * var(--lk)); color: var(--pk-text); white-space: nowrap; text-overflow: ellipsis; }
.poker-players-who small:empty { display: none; }
.poker-players-who small { font-size: calc(10.5px * var(--lk)); color: var(--pk-muted); white-space: nowrap; }
.poker-players-cards { display: flex; gap: 3px; }
.poker-seated-own .poker-players-cards .poker-seated-card { width: calc(28px * var(--rk)); }
.poker-players-chips { display: grid; justify-items: end; line-height: 1.2; }
.poker-players-chips b { font-size: calc(12.5px * var(--lk)); color: var(--pk-bright); font-variant-numeric: tabular-nums; }
.poker-players-chips small { padding: 0 5px; border-radius: var(--ui-r-pill); font-size: calc(9.5px * var(--lk)); font-weight: 700; color: #2a2418; background: var(--pk-accent); font-variant-numeric: tabular-nums; }
.poker-players-chips small[hidden] { display: none; }
.poker-players-row.yours { background: #dfbe771a; border-color: var(--pk-line); }
.poker-players-row.turn { border-color: #4fd08f; box-shadow: inset 3px 0 0 #4fd08f; }
.poker-players-row.turn .poker-players-who small { color: #c9f5dd; }
.poker-players-row.folded :is(.poker-players-pos, .poker-players-face, .poker-players-who b, .poker-players-who small, .poker-players-cards, .poker-players-chips) { filter: grayscale(1) brightness(0.55); }
.poker-players-row.folded { background: #24262699; border-color: #ffffff14; }
.poker-players-row.yours.folded { border-color: #ffffff38; }
/* An emote over the face, as Ooga Chat's `.cloud-pop` over a portrait (never faded with a folded row). */
.poker-players-pop { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; padding-top: 0.09em; font-size: calc(26px * var(--lk)); line-height: 1; translate: 0 3.25px; pointer-events: none; }
.poker-players-pop[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .poker-players-pop { translate: none; } }
/* The voice mark to the right of the name, in the middle of the row; the name gives way to it and the note under it wraps. */
.poker-players-who { grid-template-columns: minmax(0, 1fr) auto; }
.poker-players-who > :is(b, small) { grid-column: 1; }
.poker-players-who:has(> .poker-players-voice:not([hidden])) small:not([data-blind]) { white-space: normal; }
#poker .poker-seated .poker-players-voice { min-width: 0; min-height: 0; grid-area: 1 / 2 / 3 / 3; align-self: center; margin: -4px -4px -4px 0; padding: 4px; border: 0; background: none; border-radius: var(--ui-r-in); color: var(--pk-muted); }
#poker .poker-seated .poker-players-voice[hidden] { display: none; }
#poker .poker-seated .poker-players-voice[data-voice="speaking"] { color: #35ff7e; }
#poker .poker-seated .poker-players-voice[data-voice="muted"] { color: #ff7a5c; }
#poker .poker-seated .poker-players-voice svg { width: calc(12px * var(--lk)); height: calc(12px * var(--lk)); }
.poker-players-row.allin .poker-players-chips b { padding: 0 5px; border-radius: var(--ui-r-pill); color: #fff4d6; background: #b3262b; font-size: 9.5px; font-weight: 800; }
.poker-players-row.winner { background: #dfbe7738; border-color: var(--pk-accent); }
.poker-players-row.winner .poker-players-who small { color: var(--pk-bright); font-weight: 700; }
.poker-players-row.winner .poker-players-chips small { color: #10251a; background: #4fd08f; }
.poker-players-row.lost .poker-players-who small { color: var(--pk-muted); }
.poker-seated-plan { display: grid; gap: 6px; }
.poker-seated-plan p { min-height: 1.3em; font-size: 10px; line-height: 1.3; color: var(--pk-text); overflow-wrap: anywhere; }
.poker-seated-plan > div { min-height: 40px; }
.poker-seated-plan > div { display: flex; flex-wrap: wrap; gap: 6px; }
/* Every button at the panel's foot (the refill) spans its whole width but those sharing a row: Post and Wait, and Sit out
   or I'm back with Stand up. */
.poker-seated-plan > div > button { flex: 1 1 100%; }
/* Sit out next hand (or, sitting out, I'm back in its place), Top up and Stand up share the row, as wide as each other. */
/* (side padding kept small so Deal me in fits one line, as Sit out does, and the row never changes height) */
.poker-seated-plan :is([data-seated-act="sitout"], [data-seated-act="topup"], [data-seated-act="back"], [data-seated-act="stand"]) { flex: 1 1 0; min-width: 0; padding-inline: 4px; }
#poker .poker-seated-plan [data-seated-act="stand"] { color: #ffb4a6; background: transparent; border-color: #e5533d99; }
#poker .poker-seated-plan [data-seated-act="stand"]:not(:disabled):hover { background: #e5533d1f; border-color: #e5533d; }
.poker-seated-plan :is([data-seated-act="post"], [data-seated-act="wait"]) { flex: 1 1 0; min-width: 0; }
.poker-seated-card { display: block; width: 46px; aspect-ratio: 5 / 7; }
.poker-seated-card svg { display: block; width: 100%; height: 100%; }
.poker-seated-actions { right: max(12px, var(--safe-right)); bottom: calc(12px + var(--safe-bottom, 0px)); width: min(380px, calc(100vw - 24px)); display: grid; gap: 8px; }
.poker-seated-ask { display: grid; gap: 2px; font-size: 12px; color: var(--pk-muted); }
.poker-seated-ask[hidden] { display: none; }
.poker-seated-ask strong { font-size: 14px; color: var(--pk-bright); }
.poker-seated-size { display: grid; gap: 6px; }
.poker-seated-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.poker-seated-size label { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.poker-seated-size input { width: 100%; min-height: 32px; accent-color: var(--pk-accent); }
#poker .poker-seated-size input[data-seated="amount"] { width: 76px; min-height: 32px; box-sizing: border-box; padding: 3px 6px; text-align: right; font: inherit; font-size: 14px; font-weight: 750; color: var(--pk-bright); background: transparent; border: 1px solid transparent; border-radius: var(--ui-r-btn); cursor: text; }
#poker .poker-seated-size input[data-seated="amount"]:hover:not(:disabled) { border-color: #ffffff33; }
#poker .poker-seated-size input[data-seated="amount"]:focus { outline: none; border-color: var(--pk-bright); background: #00000059; }
#poker .poker-seated-size input[data-seated="amount"]:disabled { opacity: 0.5; cursor: default; }
/* Fold, Check or Call, and Raise keep these widths, Raise the widest, whatever they say (a long label wraps inside its button). */
.poker-seated-buttons { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr); gap: 6px; }
/* Out of chips, the refill takes the whole row in the moves' place. */
.poker-seated-buttons > [data-seated-act="refill"] { grid-column: 1 / -1; }
/* Watching from a chair: the two ways in share the row, or one takes it. */
.poker-seated-buttons:has(> [data-seated-act="enter-post"]:not([hidden])) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
#poker .poker-seated-buttons > :is([data-seated-act="enter-post"], [data-seated-act="enter-wait"]) { white-space: pre-line; }
.poker-seated-buttons > [data-seated-act="enter-post"][data-alone] { grid-column: 1 / -1; }
#poker .poker-seated-buttons > [hidden] { display: none; }
/* A row of buttons is its least height and never more, however long a label gets (three lines fit), so nothing over it moves
   through a hand. */
#poker .poker-seated-actions :is(.poker-seated-buttons, .poker-seated-plan > div) > button { position: relative; height: 0; padding-block: 0; padding-inline: 4px; line-height: 1.15; }
#poker .poker-seated-plan > div[data-emotes] { height: 0; flex-wrap: nowrap; align-items: center; }
/* (waiting to act the buttons keep their turn's size and type, so nothing in the row changes as the turn comes) */
#poker .poker-seated > .poker-seated-between { left: 50%; top: calc(190px + var(--safe-top)); transform: translateX(-50%); max-width: min(420px, calc(100vw - 24px)); padding: 10px 18px; text-align: center; pointer-events: none; }
#poker .poker-seated > .poker-seated-between[hidden] { display: none; }
.poker-seated-between-title { font-size: 18px; font-weight: 750; color: var(--pk-bright); overflow-wrap: anywhere; }
.poker-seated-between-sub { font-size: 13px; font-weight: 700; color: var(--pk-text); }
.poker-seated-between-sub:empty { display: none; }
.poker-seated-between-cards { display: grid; gap: 16px; margin: 10px 0 16px; }
.poker-seated-between-cards[hidden] { display: none; }
.poker-seated-between-row { display: flex; justify-content: center; gap: 6px; }
.poker-seated-between-pair > div { display: flex; gap: 6px; }
/* More than one winner: one under another, each pair beside its name, hand and winnings. */
.poker-seated-between-list { display: grid; gap: 10px; justify-content: center; }
/* A pot: its label and winners, held (pointed at, pressed or focused) to light the board by it; the one lit stands out. */
.poker-seated-between-pot { display: grid; gap: 8px; padding: 8px 10px; border: 1px solid transparent; border-radius: var(--ui-r-btn); pointer-events: auto; cursor: pointer; outline: none; }
.poker-seated-between-pot[data-active] { border-color: var(--pk-line); background: #ffffff0d; }
.poker-seated-between-pot:focus-visible { border-color: var(--pk-bright); }
.poker-seated-between-label { margin: 0; font-size: 10px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pk-muted); text-align: left; }
.poker-seated-between-pot[data-active] .poker-seated-between-label { color: var(--pk-accent); }
.poker-seated-between-list .poker-seated-between-pair { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; text-align: left; }
.poker-seated-between-list .poker-seated-between-pair > div:last-child { display: grid; gap: 1px; min-width: 0; }
.poker-seated-between-name { font-size: 12px; font-weight: 750; color: var(--pk-bright); overflow-wrap: anywhere; }
.poker-seated-between-hand { font-size: 10px; color: var(--pk-muted); }
.poker-seated-between-won { font-size: 13px; font-weight: 750; color: var(--pk-accent); }
/* Past three winners (a full table splitting a pot the board plays): two columns of smaller cards, so the board and the
   bottom line stay on screen. */
.poker-seated-between-cards[data-many] .poker-seated-between-list { grid-template-columns: repeat(2, auto); gap: 8px 12px; }
.poker-seated-between-cards[data-many] .poker-seated-between-list:has(> :only-child) { grid-template-columns: auto; }
.poker-seated-between-cards[data-many] .poker-seated-between-pot:only-child { grid-template-columns: repeat(2, auto); column-gap: 16px; }
.poker-seated-between-pot > .poker-seated-between-label { grid-column: 1 / -1; }
.poker-seated-between-cards[data-many] .poker-seated-between-list .poker-seated-card { width: clamp(30px, 8vw, 40px); }
/* A narrow screen with many winners (a full table splitting a pot the board plays seats nine): two columns, each winner's
   name, hand and share under their cards, and the list held to the screen under the card's top, title, board and bottom
   line (RESERVE, about 230px), scrolling past that. */
@media (max-width: 560px) {
  .poker-seated-between-cards[data-many] .poker-seated-between-list {
    grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px;
    max-height: calc(100dvh - 190px - var(--safe-top, 0px) - 230px); overflow-y: auto; overscroll-behavior: contain; pointer-events: auto;
  }
  .poker-seated-between-cards[data-many] .poker-seated-between-list:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
  .poker-seated-between-cards[data-many] .poker-seated-between-pot:only-child { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 6px; }
  .poker-seated-between-cards[data-many] .poker-seated-between-list .poker-seated-between-pair { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 3px; text-align: center; }
  .poker-seated-between-cards[data-many] .poker-seated-between-pot { padding: 6px; }
}
.poker-seated-between-cards .poker-seated-card { width: clamp(40px, 11vw, 58px); border-radius: var(--ui-r-card); filter: drop-shadow(0 3px 6px #0008) brightness(0.45); }
.poker-seated-between-cards .poker-seated-card[data-used] { outline: 2px solid var(--pk-accent); outline-offset: 2px; filter: drop-shadow(0 3px 6px #0008); }
.poker-seated-between-next:empty { display: none; }
.poker-seated-between-next { margin-top: 4px; font-size: 11px; color: var(--pk-muted); white-space: nowrap; }
#poker .poker-seated-actions[data-mode="wait"] button.poker-primary:not([aria-pressed="true"]) { color: var(--pk-text); background: var(--pk-surface); border-color: var(--pk-line); }
#poker .poker-seated-buttons button { min-height: 48px; font-size: 12px; }
/* A phone: the corner group narrows, and on a narrow screen the actions take the whole bottom with the visitor's
   numbers stacked over them. */
@media (max-width: 720px) {
  .poker-seated-corner { max-width: 58vw; }
  #poker .poker-seated button { min-height: 44px; padding: 4px 8px; font-size: 10px; }
}
@media (max-width: 560px) {
  .poker-seated-info { max-width: 38vw; }
  .poker-seated-actions { left: max(12px, var(--safe-left)); right: max(12px, var(--safe-right)); width: auto; }
  /* The rail needs about 200px a row (place, face, a name, two cards, the chips), so on a phone it spans the width. */
  #poker .poker-seated > .poker-seated-own[data-rail] { left: max(12px, var(--safe-left)); right: max(12px, var(--safe-right)); width: auto; --rk: 1; --lk: 1; }
  .poker-players-wgrip { display: none; }
  .poker-players-list { max-height: max(46px, calc(28px * var(--rk) * 7 / 5 + 8px), var(--poker-rail-h, min(100dvh, calc(100dvh - 272px - var(--poker-actions-h, 212px) - var(--safe-top, 0px) - var(--safe-bottom, 0px))))); }
  #poker .poker-seated:has(.poker-seated-actions:not([hidden])) .poker-seated-own { --own-foot: calc(var(--poker-actions-h, 212px) + 24px + var(--safe-bottom, 0px)); }
  .poker-seated-own .poker-seated-card { width: 50px; }
}
@media (max-height: 460px) {
  .poker-seated-info, .poker-seated-corner { top: calc(60px + var(--safe-top)); }
  .poker-seated-actions { width: min(340px, 48vw); gap: 4px; padding: 6px 8px; }
  #poker .poker-seated-buttons button { min-height: 44px; }
  .poker-seated-card, .poker-seated-own .poker-seated-card { width: 34px; }
  #poker .poker-seated > .poker-seated-own { padding: 8px 10px; }
}
#poker button:not(:disabled):not(.poker-primary):hover { background: color-mix(in srgb, var(--pk-text) 11%, transparent); border-color: color-mix(in srgb, var(--pk-text) 32%, transparent); }
#poker button[aria-pressed="true"]:not(:disabled):hover { background: #2e7d5b4d; border-color: #6fe0a4; }
#poker .poker-primary:not(:disabled):hover { filter: brightness(1.08); }
/* Leaving (the leave dialogs' Leave, the seat's Stand up) is an outline in red: easy to find, never the loudest thing. */
#poker dialog:is(.poker-leave, .poker-sheet) :is([data-poker="confirm-leave"], [data-poker="room-confirm"]) { color: #ffb4a6; background: transparent; border-color: #e5533d99; }
#poker dialog:is(.poker-leave, .poker-sheet) :is([data-poker="confirm-leave"], [data-poker="room-confirm"]):not(:disabled):hover { background: #e5533d1f; border-color: #e5533d; }
/* The Ember Den tab's pages (poker-den.js): the tables, the visitor's seat, how to play and their settings, one at a time. */
.den-nav { display: flex; gap: 3px; margin: 0; padding: 3px; border-radius: var(--ui-r-btn); background: #1b1713; }
.den-nav button { flex: 1 1 auto; min-height: 36px; padding: 4px 6px; border: 0; border-radius: var(--ui-r-in); background: none; color: #cfc6b4; font: 700 12px var(--ui-font); white-space: nowrap; cursor: pointer; }
.den-nav button[hidden] { display: none; }
.den-nav button:hover { color: #fff; }
.den-nav button[aria-selected="true"] { color: var(--ui-on-text); background: var(--ui-on-face); box-shadow: inset 0 0 0 1px var(--ui-on); }
#poker-panel > [data-den-page] { display: none; }
#poker-panel[data-den="tables"] > [data-den-page="tables"], #poker-panel[data-den="seat"] > [data-den-page="seat"], #poker-panel[data-den="help"] > [data-den-page="help"], #poker-panel[data-den="settings"] > [data-den-page="settings"] { display: grid; }
.den-page { grid-auto-rows: max-content; align-content: start; gap: 10px; padding: 12px; color: #ece9e2; font: 500 13px/1.45 var(--ui-font); }
.den-page p { margin: 0; }
.den-page h3 { margin: 6px 0 -2px; font-size: 10px; font-weight: 750; letter-spacing: 0.1em; text-transform: uppercase; color: #a9a59c; }
.den-page button { min-height: 40px; padding: 6px 12px; border: 1px solid #ffffff26; border-radius: var(--ui-r-btn); background: #ffffff0f; color: #ece9e2; font: 700 12px var(--ui-font); cursor: pointer; }
.den-page button:not(:disabled):hover { background: #ffffff1a; border-color: #ffffff4d; }
.den-page button:disabled { cursor: default; opacity: 0.45; }
.den-page button[hidden] { display: none; }
.den-page button[aria-pressed="true"] { position: relative; color: var(--ui-on-text); background: var(--ui-on-face); border-color: var(--ui-on); box-shadow: var(--ui-on-ring); }
.den-page button.poker-primary, .den-page button.poker-primary:not(:disabled):hover { color: var(--pk-ink); background: linear-gradient(120deg, var(--pk-bright), var(--pk-accent)); border-color: var(--pk-bright); }
:is(.den-nav, .den-page) :is(button, input):focus-visible { outline: 2px solid var(--pk-bright); outline-offset: 2px; }
#den-poker { display: grid; gap: 10px; }
#den-poker[hidden], #blackjack-list[hidden] { display: none; }
.den-games { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.den-games button { display: grid; align-content: center; gap: 3px; min-height: 60px; text-align: left; }
.den-games b { font-size: 17px; }
.den-games small { font-size: 12px; font-weight: 500; }
.den-page .den-play { display: block; height: auto; padding: 10px 14px; text-align: left; }
.den-play b, .den-play small { display: block; line-height: 1.35; }
.den-play b { font-size: 16px; }
.den-play small { font-size: 12px; font-weight: 500; }
.den-list, .den-people, .den-hands { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.den-list:empty { display: none; }
#blackjack-list { display: grid; gap: .5rem; }
#blackjack-list label { display: flex; align-items: center; gap: .45rem; }
#blackjack-list input[type="search"] { min-width: 0; flex: 1; }
#blackjack-list details { border-bottom: 1px solid rgba(221,198,148,.25); padding: .4rem 0; }
#blackjack-list summary { cursor: pointer; }
#blackjack-list summary small { display: block; margin: .2rem 0 0 1rem; }
#blackjack-list .bj-minimum { float: right; color: #f6d99b; font-size: .82rem; }
#blackjack-list .bj-map-dealer { margin: .7rem 0 0; padding: .4rem; text-align: center; color: #d4eadb; background: #254d40; border-radius: .5rem .5rem 0 0; }
#blackjack-list .bj-seat-map { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 2px; list-style: none; margin: 0; padding: 0 2px .4rem; background: #183a30; border-radius: 0 0 48% 48% / 0 0 17% 17%; }
#blackjack-list .bj-seat-map li { min-width: 0; }
#blackjack-list .bj-seat-map li:nth-child(2), #blackjack-list .bj-seat-map li:nth-child(6) { padding-top: 8px; }
#blackjack-list .bj-seat-map li:nth-child(3), #blackjack-list .bj-seat-map li:nth-child(5) { padding-top: 13px; }
#blackjack-list .bj-seat-map li:nth-child(4) { padding-top: 15px; }
#blackjack-list .bj-seat-map button { width: 100%; min-height: 44px; padding: 0; border: 1px solid #98bda9; border-radius: 45%; background: #1e342b; color: #f7f4e7; font: inherit; font-weight: 700; }
#blackjack-list .bj-seat-map [data-state="taken"] { opacity: 1; background: #303a35; border-color: #52675b; color: #bfcbc3; }
#blackjack-list .bj-seat-map [data-state="friend"] { opacity: 1; background: #bce9d4; color: #133726; border: 3px double #21503d; }
#blackjack-list .bj-seat-map [data-state="selected"], #blackjack-list .bj-map-actions button:first-child:enabled { background: #f1d79a; color: #24271d; border-color: #ffedc7; }
#blackjack-list .bj-seat-preview { margin: .6rem 0; overflow-wrap: anywhere; }
#blackjack-list .bj-map-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
#blackjack-list .bj-map-actions button { min-height: 44px; }
#blackjack-list button:focus-visible { outline: 2px solid white; outline-offset: 1px; }
/* Give the seat preview room in an untouched phone drawer. A manually sized drawer keeps its height. */
@media (pointer: coarse) {
  :root:has(#sheet[data-open="true"][data-dock="bottom"][data-sized="false"] #poker-panel:not([hidden]) [data-den-page="tables"]:not([hidden]) #blackjack-list:not([hidden]) details[open]:not([hidden])) {
    --drawer-height: min(62dvh, calc(100dvh - var(--stick-size) - var(--drawer-clear) - 86px - var(--safe-top)));
  }
}
@media (pointer: coarse) and (max-height: 500px) {
  #sheet[data-open="true"][data-dock="bottom"][data-sized="false"]:has(#poker-panel:not([hidden]) [data-den-page="tables"]:not([hidden]) #blackjack-list:not([hidden]) details[open]:not([hidden])) { height: calc(100dvh - 76px - var(--safe-top)); }
  #sheet[data-open="true"][data-dock="bottom"][data-sized="false"]:has(#poker-panel:not([hidden]) [data-den-page="tables"]:not([hidden]) #blackjack-list:not([hidden]) details[open]:not([hidden])) ~ :is(.joysticks,.bottom-hud) { visibility: hidden; }
}
#blackjack-list [hidden] { display: none; }
/* Blackjack's seat and dialogs are poker's (`.poker-seated`, `.poker-rules`), in the waterfront's own felt whatever poker
   table was last looked at. Only what poker has no need of is here: the second and third rows of cards, and four moves. */
#poker #blackjack-panel { --pk-accent: #dfbe77; --pk-bright: #f4dda2; --pk-ink: #213023; --pk-text: #f5efdf; --pk-muted: #c1d0bb; --pk-line: #dfbe7766; outline: none; }
#poker dialog:is(#blackjack-rules, #blackjack-options) { --felt: #215b52; --rail: #583b30; --pick: #f4d591; --body: #111816; }
.bj-crest { display: grid; place-items: center; flex: none; width: 46px; height: 46px; box-sizing: border-box; border: 3px double #f4d591; border-radius: 50%; font: 700 18px Georgia, serif; color: #f4d591; }
dialog.poker-rules > details.bj-rules { margin: 0 20px 14px; font-size: 13.5px; line-height: 1.45; color: #c9c5bc; }
.bj-rules summary, .bj-recap summary { cursor: pointer; font-weight: 650; }
.bj-rules p { margin: 8px 0 0; }
/* The players' list gives way and scrolls first, so both hands stay in sight. */
#blackjack-panel .poker-seated-own { overflow-y: auto; overscroll-behavior: contain; }
#blackjack-panel .poker-seated-own > * { flex: none; }
#blackjack-panel .poker-seated-own > .poker-players { flex: 0 1 auto; }
#blackjack-panel .poker-players-list { height: auto; flex: 0 1 auto; max-height: none; }
#blackjack-panel .poker-seated-plan > div { flex-wrap: nowrap; }
#blackjack-panel .poker-seated-plan > div > button { flex: 1 1 0; min-width: 0; padding-inline: 4px; }
#blackjack-panel .poker-players-five .poker-seated-card { width: 100%; }
#blackjack-panel .poker-players-board[data-turn] .poker-players-stage { color: var(--ui-on-text); }
#blackjack-panel .bj-total { font-size: calc(15px * var(--lk)); color: var(--pk-bright); }
/* A row's third card on overlaps the last, so any hand keeps the room of two. */
#blackjack-panel .poker-players-cards[data-more] { gap: 0; }
#blackjack-panel .poker-players-cards[data-more] .poker-seated-card:not(:first-child) { margin-left: calc((31px * var(--rk)) / (var(--n) - 1) - 28px * var(--rk)); }
#blackjack-panel .poker-players-cards .poker-seated-card[hidden] { display: none; }
/* Hit and Stand on one row, Double, Split and Surrender on the next, so every label fits its button; one that still does not
   (a narrow panel) takes its key to a second line. */
#blackjack-panel .poker-seated-buttons { grid-template-columns: repeat(6, minmax(0, 1fr)); }
#blackjack-panel .poker-seated-buttons > button { grid-column: span 2; white-space: normal; }
#blackjack-panel .poker-seated-buttons > :is([data-bj="hit"], [data-bj="stand"]) { grid-column: span 3; }
#blackjack-panel .poker-seated-buttons > [data-bj="bet"] { grid-column: 1 / -1; }
#blackjack-panel .bj-sides { margin-top: 6px; grid-template-columns: 1fr 1fr; }
/* Three or four hands split from one sit two to a row, their cards smaller. */
#blackjack-panel .bj-hands { display: contents; }
#blackjack-panel .bj-hands:has(> [data-bj-hand="third"]:not([hidden])) { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; }
#blackjack-panel .bj-hands:has(> [data-bj-hand="third"]:not([hidden])) .poker-players-five { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; }
#blackjack-panel .bj-recap { font-size: 11px; color: var(--pk-text); padding: 0 5px; }
#blackjack-panel .bj-recap ul { margin: 6px 0 0; padding-left: 16px; line-height: 1.45; }
#blackjack-panel .bj-signal { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
body:has(#blackjack-panel:not([hidden])) :is(#act, #joy-look, #joy-move) { visibility: hidden; }
/* A phone's keyboard lifts the panel it types in. */
#poker #blackjack-panel > .poker-seated-actions { translate: 0 calc(-1 * var(--bj-keyboard, 0px)); }
/* On a short screen the bet's controls stand aside while a hand plays, so the visitor's own cards stay in sight. */
@media (max-height: 700px) { #blackjack-panel:has([data-bj="bet"][hidden]) .poker-seated-size { display: none; } }
/* On a phone on its side both panels are one column at the left, clear of the dealer's hands. */
@media (max-height: 520px) and (min-width: 561px) {
  #poker #blackjack-panel { inset: auto auto max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); width: clamp(230px, 40vw, 330px); max-height: 80dvh; overflow: hidden auto; pointer-events: auto; border-radius: var(--ui-r); }
  body:has(.sheet[data-dock="bottom"]:not([hidden])) #poker #blackjack-panel { bottom: calc(53px + env(safe-area-inset-bottom)); max-height: calc(100dvh - 121px); }
  #poker #blackjack-panel > * { position: static; width: auto; max-height: none; overflow: visible; border-radius: 0; }
  /* The cards side by side over the moves, and only what the moment needs: nothing to scroll to before acting. */
  #blackjack-panel .poker-seated-own { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
  #blackjack-panel .poker-players, #blackjack-panel .poker-seated-own:not(:has([data-rank])), #blackjack-panel:has([data-bj="bet"][hidden]) .poker-seated-size { display: none; }
  #blackjack-panel .poker-players-five { gap: 2px; padding: 0; }
  #blackjack-panel .bj-recap { grid-column: 1 / -1; }
}

#chair-invitation { position: fixed; z-index: 100; top: max(56px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); box-sizing: border-box; width: min(350px, calc(100vw - 20px)); padding: 12px; border: 1px solid #caa765; border-radius: 10px; background: #152c25; color: #fff7e8; font: 600 14px/1.4 system-ui, sans-serif; }
#chair-invitation p { margin: 0 0 8px; }
#chair-invitation button { min-height: 44px; margin-right: 6px; padding: 0 12px; }
#blackjack-panel .bj-invited-seat:not([hidden]) { display: grid; gap: 4px; }
#blackjack-panel .bj-decision { display: none; }
@media (max-width: 700px), (max-height: 520px) {
  #poker #blackjack-panel:has(.bj-decision:not([hidden])) > [data-rail],
  #poker #blackjack-panel:has(.bj-decision:not([hidden])) .poker-seated-plan p,
  #poker #blackjack-panel:has(.bj-decision:not([hidden])) [data-bj-moves] button:not([data-legal]) { display: none; }
  #blackjack-panel .bj-decision:not([hidden]) { display: grid; grid-template-columns: 1fr auto; gap: 3px 6px; text-align: left; font-variant-numeric: tabular-nums; }
  #blackjack-panel .bj-decision strong { grid-area: 1 / 1; color: var(--pk-bright); }
  #blackjack-panel:has(.bj-invited-seat:not([hidden]) button:not([hidden])) [data-bj-seats] { display: none; }
  #blackjack-panel .bj-invited-seat button { min-height: 44px; }
  /* Keep the chair preview and live decision reachable above the island drawer and its protruding tabs. */
  #poker #blackjack-panel:has(:is(.bj-decision, .bj-invited-seat):not([hidden])) { z-index: 14; }
  #poker #blackjack-panel:has(.bj-decision:not([hidden])) [data-bj-moves] button { min-height: 44px; }
  #poker #blackjack-panel:has(:is(.bj-decision, .bj-invited-seat):not([hidden])) > .poker-seated-actions { background: #15211c; }
  #blackjack-panel:has(.bj-decision:not([hidden])) [data-bj-moves] { display: flex; flex-wrap: wrap; gap: 4px; }
  #blackjack-panel:has(.bj-decision:not([hidden])) [data-bj-moves] > button { flex: 1 1 0; min-width: 44px; }
  #blackjack-panel:has(.bj-decision:not([hidden])) [data-bj-moves] > :is([data-bj="hit"], [data-bj="stand"]) { flex-basis: calc(50% - 2px); }
  #blackjack-panel .bj-decision-cards, #blackjack-panel .bj-decision [data-bj-other-hands] { grid-column: 1 / -1; }
  #blackjack-panel .bj-decision-cards, #blackjack-panel [data-bj-active-cards] { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
  #blackjack-panel [data-bj-active-cards] > span { border-radius: 4px; padding: 4px 6px; color: #19231f; background: #fff9ea; font: 750 22px/1.1 system-ui, sans-serif; }
  #blackjack-panel [data-bj-active-cards] > [data-red="true"] { color: #a11e2c; }
  #blackjack-panel [data-bj-active-total] { margin-left: 3px; }
  #blackjack-panel .bj-decision b { font-size: 22px; line-height: 1.12; }
  #blackjack-panel .bj-decision small { align-self: center; font-size: 12px; }
}
.den-table { border: 1px solid #ffffff14; border-radius: var(--ui-r-btn); background: #ffffff0a; }
.den-table.yours { border-color: var(--ui-on); }
.den-page .den-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 7px 10px 7px 8px; border: 0; background: none; text-align: left; }
.den-no { display: grid; place-items: center; width: 32px; height: 32px; border: 2px solid #0006; border-radius: 50%; color: #fff; font-size: 13px; }
.den-words b { display: block; font-size: 13.5px; color: #fff; }
.den-words small { font-size: 11.5px; font-weight: 500; color: #b4b1a8; }
.den-side { display: flex; font-size: 12px; color: var(--pk-accent); white-space: nowrap; }
.den-page canvas, .den-ooga { width: 28px; height: 28px; border-radius: 50%; background: #2a2c2a; image-rendering: pixelated; }
.den-ooga { display: grid; place-items: center; }
.den-ooga svg { width: 14px; height: auto; }
.den-side > canvas, .den-side > .den-ooga { border: 2px solid #171816; }
.den-side > * + * { margin-left: -8px; }
.den-more { display: grid; gap: 10px; padding: 2px 10px 10px; }
.den-more[hidden] { display: none; }
.den-more p { font-size: 12px; color: #b4b1a8; }
.den-people { gap: 4px; }
.den-people li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 9px; font-weight: 600; overflow-wrap: anywhere; }
.den-people b { color: var(--pk-accent); font-variant-numeric: tabular-nums; }
.den-acts { display: flex; gap: 8px; }
.den-acts button { flex: 1; }
.den-group { border: 1px solid #ffffff14; border-radius: var(--ui-r-btn); background: #ffffff0a; padding: 2px 12px; }
.den-set { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; font-weight: 550; }
.den-set + .den-set { border-top: 1px solid #ffffff12; }
.den-page :is(.den-pick, .poker-chip-styles) { display: flex; gap: 6px; margin: 0; }
.den-page :is(.den-pick, .poker-chip-styles) button { min-width: 38px; min-height: 32px; padding: 3px 10px; }
.den-page .poker-chip-styles { gap: 4px; }
.den-page .poker-chip-styles button { min-width: 30px; padding: 3px 4px; }
.den-set input[type="checkbox"] { -webkit-appearance: none; appearance: none; flex: none; position: relative; width: 38px; height: 22px; margin: 0; border-radius: var(--ui-r-pill); background: #ffffff2b; cursor: pointer; transition: background 0.12s; }
.den-set input[type="checkbox"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.12s; }
.den-set input[type="checkbox"]:checked { background: var(--ui-on); }
.den-set input[type="checkbox"]:checked::after { transform: translateX(16px); }
.den-set input[type="range"] { width: 130px; }
.den-moves { display: grid; gap: 5px; margin: 0; }
.den-moves div { display: grid; grid-template-columns: 56px 1fr; gap: 8px; }
.den-moves dt { font-weight: 750; color: var(--pk-accent); }
.den-moves dd { margin: 0; }
.den-hands li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.den-hands b, .den-hands small { display: block; }
.den-hands small { font-size: 11px; color: #b4b1a8; }
.den-hands .poker-players-five { display: grid; grid-template-columns: repeat(5, 26px); gap: 3px; }
.den-hands .poker-seated-card { box-sizing: border-box; width: 26px; }
/* Tall enough for every table, until the visitor sizes the panel themselves. */
.sheet[data-dock="right"][data-sized="false"]:has(#poker-panel:not([hidden])) { height: 740px; }
.poker-sheet-content > .den-page { display: grid; margin: 0; padding: 12px 0 20px; border: 0; background: none; box-shadow: none; }
#poker[data-seated-hud] .poker-sheet :is(.poker-mode-picker, .poker-mode-note, .poker-lobby-options), .poker-tab-tools-body :is(.poker-mode-picker, .poker-mode-note, .poker-lobby-options, details.poker-rules) { display: none; }
body[data-poker-suits] .poker-seated-card[data-suit="♦"], body[data-poker-suits] .poker-card[data-suit="♦"] { color: #1f5fae; }
body[data-poker-suits] .poker-seated-card[data-suit="♣"], body[data-poker-suits] .poker-card[data-suit="♣"] { color: #1d7a45; }
/* The Ember Den tab (#poker-panel, poker-seated.js): the table's facts, the views and the seat's options, in the sheet
   while seated in 3D, with the poker emotes as its always-shown row. Its groups are named over their buttons. */
.poker-tab-body { display: grid; align-content: start; gap: 14px; padding: 12px; color: var(--pk-text); font-family: var(--ui-font); }
.poker-tab-body .poker-seated-info, .poker-tab-body .poker-seated-corner { position: static; max-width: none; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.poker-tab-body .poker-seated-info { display: grid; gap: 3px; font-size: 11px; line-height: 1.35; color: var(--pk-muted); }
.poker-tab-body .poker-seated-info p { margin: 0; }
.poker-tab-body .poker-seated-head { font-size: 15px; font-weight: 750; color: var(--pk-bright); white-space: normal; }
.poker-seated-head [data-seated="blinds"] { font-weight: 600; color: var(--pk-text); }
.poker-tab-body .poker-seated-corner { display: grid; grid-template-columns: 2fr 1fr; gap: 6px; }
.poker-tab-body :is(.poker-seated-views, .poker-seated-tools) { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 6px; }
.poker-tab-body :is(.poker-seated-views, .poker-seated-tools)::before { grid-column: 1 / -1; font-size: 9px; font-weight: 750; letter-spacing: 0.1em; text-transform: uppercase; color: var(--pk-muted); }
.poker-tab-body .poker-seated-views::before { content: "View"; }
.poker-tab-body .poker-seated-tools::before { content: "Your cards"; }
/* Dark glass: quiet translucent buttons; one switched on gets a green ring and a dot, so its state never rests on colour
   alone; Stand up, which leaves the table, an outline in red, easy to find without outshouting the rest. */
.poker-tab-body button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 4px 10px; color: #e9e4d6; background: #ffffff0f; border: 1px solid #ffffff26; border-radius: var(--ui-r-btn); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.poker-tab-body button[aria-pressed="true"] { color: var(--ui-on-text); background: var(--ui-on-face); border-color: var(--ui-on); box-shadow: var(--ui-on-ring); }
.poker-tab-body button:disabled { cursor: default; opacity: 0.45; }
.poker-tab-body button:not(:disabled):hover { background: #ffffff1a; border-color: #ffffff4d; }
.poker-tab-body button[aria-pressed="true"]:not(:disabled):hover { background: #2e7d5b4d; border-color: #6fe0a4; }
.poker-tab-body [data-seated-act="stand"] { color: #ffb4a6; background: transparent; border-color: #e5533d99; }
.poker-tab-body [data-seated-act="stand"]:not(:disabled):hover { background: #e5533d1f; border-color: #e5533d; }
.poker-tab-body button:focus-visible { outline: 3px solid var(--pk-bright); outline-offset: 2px; }
.poker-tab-body .poker-seated-emotes { display: none; }
#poker input[type="checkbox"] { accent-color: #4fd08f; }
/* The emotes at the top of the betting panel in 3D (poker-seated.js), one panel with it under a divider: the emoji bar's
   row, scrolling under its chevrons, without a card of its own, and the bar's own buttons, not Ember Den's. On a phone
   the visitor's own numbers stand `--poker-emote-room` higher for it. */
#poker .poker-seated { --poker-emote-room: 54px; }
.poker-seated-emote-row { margin: 0 0 2px; }
#poker .poker-seated-emote-row[hidden] { display: none; }
/* Open, the emotes take the seat's row beside the emote button, in place of its other buttons, growing out from it. */
.poker-seated-plan > div[data-emotes] > :is([data-seated-act="sitout"], [data-seated-act="topup"], [data-seated-act="back"], [data-seated-act="stand"]) { display: none; }
#poker .poker-seated-plan .poker-seated-emote-row { flex: 1 1 0; min-width: 0; margin: 0; align-self: stretch; display: flex; animation: poker-emote-open 0.22s ease-out; }
#poker .poker-seated-plan .poker-seated-emote-row[hidden] { display: none; }
#poker .poker-seated-plan .poker-seated-emote-row .reaction-bar { flex: 1 1 auto; min-width: 0; padding: 0; border: 0; align-self: center; }
@keyframes poker-emote-open { from { clip-path: inset(0 100% 0 0); opacity: 0.3; } to { clip-path: inset(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #poker .poker-seated-plan .poker-seated-emote-row { animation: none; } }
/* The emote button in the seat's row, left of Sit out: square, the face its label, lit while the emotes are open. */
#poker .poker-seated-plan [data-seated-act="emote"] { flex: 0 0 auto; width: 44px; padding: 0; font-size: 20px; line-height: 1; }
#poker .poker-seated-plan [data-seated-act="emote"][aria-expanded="true"] { background: #2e7d5b4d; border-color: #6fe0a4; }
/* Its face drawn as a line in the button's own colour, not the system's emoji. */
.poker-emote-line { display: block; width: 22px; height: 22px; margin: auto; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#poker .poker-seated-plan [data-seated-act="emote"][aria-expanded="true"] .poker-emote-line { color: #6fe0a4; }
#poker .poker-seated-emote-row .reaction-bar { max-width: none; padding: 0 0 8px; border: 0; border-bottom: 1px solid #ffffff1f; border-radius: 0; background: none; box-shadow: none; }
#poker .poker-seated-emote-row .reaction { width: auto; min-height: 0; height: var(--reaction-cell); padding: 0; border: 0; border-radius: 50%; background: none; box-shadow: none; font: 24px/1 "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
#poker .poker-seated-emote-row .reaction:not(:disabled):hover { background: rgba(243, 239, 228, 0.1); border: 0; }
/* The chip shuffle's button before the ten emotes (poker-seated.js), lit while it runs; the row keeps one line. */
#poker .poker-seated-emote-row .reaction[aria-pressed="true"] { background: rgba(216, 137, 43, 0.22); box-shadow: inset 0 0 0 2px var(--accent); }
@container reactions (min-width: 460px) { #poker .poker-seated-emote-row .reaction-grid { grid-template-columns: repeat(11, minmax(0, 1fr)); } }
/* The menu variant's (a seat without the row) pressed look. */
#poker button[data-seated-act="shuffle"][aria-pressed="true"]::before { content: none; }
.poker-chip-icon { display: block; width: 1.15em; height: 1.15em; margin: auto; pointer-events: none; }
#poker .poker-seated-emotes [data-seated-act="shuffle"][aria-pressed="true"] { background: rgba(216, 137, 43, 0.32); box-shadow: inset 0 0 0 2px var(--accent); }
#poker .poker-seated-emote-row .reaction-more { min-height: 0; padding: 0 2px 0 0; border: 0; border-radius: 0; background: linear-gradient(90deg, transparent, #0f1211 62%); }
#poker .poker-seated-emote-row .reaction-back { padding: 0 0 0 2px; background: linear-gradient(270deg, transparent, #0f1211 62%); }
.poker-seated-turn:empty { display: none; }
/* The turn clock over the visitor's own numbers in 3D: a draining bar and the seconds, larger on their own turn. */
.poker-seated-clock { display: flex; align-items: center; gap: 8px; margin: 4px 0 6px; }
.poker-seated-clock[hidden] { display: none; }
.poker-seated-clock[data-off] { visibility: hidden; }
#poker .poker-seated-clock[data-stage="deal"] .poker-seated-clock-bar i { background: #a3a9a6; }
#poker .poker-seated-clock[data-stage="deal"] b { color: #c9cdcb; }
.poker-seated-clock-bar { flex: 1; height: 8px; border-radius: var(--ui-r-pill); background: #ffffff24; overflow: hidden; }
.poker-seated-clock-bar i { display: block; height: 100%; transform-origin: left center; background: #4fd08f; transition: transform .12s linear; }
.poker-seated-clock[data-stage^="yellow"] .poker-seated-clock-bar i { background: #f2c14e; }
.poker-seated-clock[data-stage^="red"] .poker-seated-clock-bar i { background: #ff6a4a; }
.poker-seated-clock[data-stage^="bank"] .poker-seated-clock-bar i { background: #8cdcf9; }
.poker-seated-clock b { min-width: 3.5ch; text-align: right; font: 750 18px var(--ui-font); font-variant-numeric: tabular-nums; color: #f4dda2; }
/* Another seat's clock is violet, the time bank still blue, so the visitor's own green to red reads as theirs. */
.poker-seated-clock:not([data-stage~="mine"]):not([data-stage^="bank"]) .poker-seated-clock-bar i { background: #b48cff; }
.poker-seated-clock:not([data-stage~="mine"]) b { color: #cdb6ff; }
.poker-seated-clock[data-stage="red mine"] b { color: #ff8a6a; animation: poker-clock-pulse .5s ease-in-out infinite alternate; }
@keyframes poker-clock-pulse { to { transform: scale(1.18); } }
@media (prefers-reduced-motion: reduce) { .poker-seated-clock[data-stage="red mine"] b { animation: none; } .poker-seated-clock-bar i { transition: none; } }
/* What the visitor holds, named under their cards. The line stands empty between hands, so the panel keeps its height and nothing in it moves as a hand is named. */
.poker-seated-hand-name { min-height: 1.25em; margin: 2px 0; text-align: center; font-size: 17px; font-weight: 750; line-height: 1.25; color: #f4dda2; }
/* What stays over the view while seated: the visitor's hand and numbers (whose turn it is at their head) and the betting
   actions in the bottom right corner, under a sheet open at the right; both kept over the sheet's tab rail where it
   docks at the foot. */
.poker-seated-mine .poker-seated-turn, .poker-seated-mine .poker-seated-turn:empty { display: block; min-height: 1.3em; margin: 0; font-size: 14px; line-height: 1.3; }
body:has(.sheet[data-dock="bottom"]:not([hidden])) #poker .poker-seated > :is(.poker-seated-own, .poker-seated-actions) { --own-foot: calc(53px + var(--safe-bottom, 0px)); bottom: var(--own-foot); }
/* Seated in 3D, a sheet open at the right stops 12px above the betting panel under it (`--poker-actions-h`, kept by poker-seated.js). */
body:is([data-poker-seated-3d], :has(#blackjack-panel:not([hidden]))) .sheet[data-dock="right"] { max-height: calc(100% - 72px - var(--safe-top) - var(--poker-actions-h, 230px) - 24px - var(--safe-bottom, 0px)); }
/* Watching a table from the floor, the left panel is the players and the board alone, under the table's name; folded, that
   line over the street and pot. On a touch screen it hangs under the banner, clear of the sticks. */
.poker-seated:not([data-watch]) :is(.poker-watch-head, .poker-watch-sit) { display: none; }
#poker .poker-seated[data-watch] > :not(.poker-seated-own), .poker-seated[data-watch] > .poker-seated-own > :not(.poker-watch-head, .poker-players, .poker-players-board, .poker-watch-sit, .poker-players-grip, .poker-players-wgrip) { display: none; }
#poker .poker-seated[data-watch] .poker-players-head, #poker .poker-seated[data-watch][data-folded] :is(.poker-players, .poker-players-five, .poker-watch-sit, .poker-players-grip, .poker-players-wgrip) { display: none; }
.poker-watch-head { display: flex; align-items: center; gap: 6px; }
#poker .poker-seated .poker-watch-head button { border: 0; background: none; }
#poker .poker-seated .poker-watch-head button:first-child { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1px 8px; padding: 0 5px; text-align: left; }
.poker-watch-head b { font-size: 14px; color: var(--pk-bright); }
.poker-watch-head small { grid-row: 2; font-size: 11px; font-weight: 500; color: var(--pk-muted); }
.poker-watch-head i { grid-area: 1 / 2 / 3 / 3; width: 7px; height: 7px; border-right: 2px solid var(--pk-muted); border-bottom: 2px solid var(--pk-muted); transform: rotate(45deg); }
.poker-seated[data-folded] .poker-watch-head i { transform: rotate(-135deg); }
#poker .poker-seated .poker-watch-head button:last-child { width: 40px; padding: 0; font-size: 20px; font-weight: 400; }
@media (pointer: coarse) {
  #poker#poker .poker-seated[data-watch] > .poker-seated-own[data-rail] { top: calc(var(--banner-foot, 63px) + 6px); bottom: auto; max-height: calc(100dvh - var(--banner-foot, 63px) - var(--stick-size) - 150px); }
  .poker-seated[data-watch] .poker-players-grip { display: none; }
}
/* Wide and tall enough, the betting panel stands under the left panel as one with it, as wide as it (the width setting
   widens both): the left panel lifted by the betting panel's height (`--poker-actions-h`), their joining corners square
   and the line between them a hairline. A sheet at the right then has the full height. On a phone the two already stack
   across the width, and on a phone on its side (520px tall or less) the betting panel keeps to the right. */
@media (min-width: 561px) and (min-height: 521px) {
  #poker .poker-seated > .poker-seated-actions { left: max(12px, var(--safe-left)); right: auto; width: var(--poker-left-w); }
  #poker .poker-seated:has(> .poker-seated-actions:not([hidden])) > .poker-seated-own { --own-foot: calc(12px + var(--poker-actions-h, 212px) + var(--safe-bottom, 0px)); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
  /* The width grip runs down both, its pill at the middle of the two. */
  .poker-seated:has(> .poker-seated-actions:not([hidden])) .poker-players-wgrip { bottom: calc(-1 * var(--poker-actions-h, 212px)); z-index: 1; width: 10px; }
  body:not([data-poker-seated-table]) #poker .poker-seated:has(> .poker-seated-own) > .poker-seated-actions { border-top-left-radius: 0; border-top-right-radius: 0; border-top-color: #ffffff12; }
  body:has(.sheet[data-dock="bottom"]:not([hidden])) #poker .poker-seated:has(> .poker-seated-actions:not([hidden])) > .poker-seated-own { --own-foot: calc(53px + var(--poker-actions-h, 212px) + var(--safe-bottom, 0px)); }
  body:is([data-poker-seated-3d], :has(#blackjack-panel:not([hidden]))) .sheet[data-dock="right"] { max-height: calc(100% - 72px - var(--safe-top) - 12px - var(--safe-bottom, 0px)); }
  body:is([data-poker-seated-3d], :has(#blackjack-panel:not([hidden]))) .sheet[data-dock="right"][data-sized="true"] { max-height: none; }
  .poker-players-list { max-height: max(46px, calc(28px * var(--rk) * 7 / 5 + 8px), var(--poker-rail-h, min(450px, calc(100dvh - 272px - var(--poker-actions-h, 212px) - var(--safe-top, 0px) - var(--safe-bottom, 0px))))); }
}
@media (max-width: 560px) {
  body:has(.sheet[data-dock="bottom"]:not([hidden])) #poker .poker-seated:has(.poker-seated-actions:not([hidden])) .poker-seated-own { --own-foot: calc(53px + var(--poker-actions-h, 212px) + 24px + var(--safe-bottom, 0px)); }
}
/* The top corners are free now, so on a phone or a short screen the between-hands card starts just under the banner and
   scrolls past the room it has: over the visitor's hand on a phone held upright (220px for it and the tab rail), and
   down to the tab rail on one on its side, where the hand stands to the card's left. */
@media (max-width: 560px), (max-height: 500px) {
  #poker .poker-seated > .poker-seated-between { top: calc(62px + var(--safe-top)); overflow-y: auto; overscroll-behavior: contain; pointer-events: auto; }
  .poker-seated-between-cards[data-many] .poker-seated-between-list { max-height: none; overflow: visible; }
}
@media (max-width: 560px) { #poker .poker-seated > .poker-seated-between { max-height: calc(100dvh - 62px - var(--safe-top) - 220px - var(--poker-emote-room) - var(--safe-bottom, 0px)); } }
@media (max-height: 500px) and (min-width: 561px) {
  #poker .poker-seated > .poker-seated-between { max-height: calc(100dvh - 62px - var(--safe-top) - 60px - var(--safe-bottom, 0px)); padding: 8px 14px; }
  .poker-seated-between-cards { gap: 8px; margin: 6px 0 8px; }
  .poker-seated-between-cards .poker-seated-card { width: 38px; }
}
/* Seated in the Table view the HUD is the 1st Person one over the 2D table: its panels stand over the table panel,
   whose own buttons, status strip and dock stand aside, the hand's result in the same between-hands card, and what only
   the room needs (the board strip and Peek) is left out, the 2D table showing the board itself. The side panel stays away, its buttons in the table's header. */
body[data-poker-seated-table] #poker .poker-seated { z-index: 22; }
body[data-poker-seated-table] #poker .poker-seated > .poker-seated-board { display: none; }
/* The Table view draws every seat, its cards and the board itself, so the players and board panel would only cover it. */
body[data-poker-seated-table] #poker .poker-seated > .poker-seated-own { display: none; }
body[data-poker-seated-table] [data-seated-act="peek"] { display: none; }
/* The Table view shows the hand's result on the table, so the between-hands card is left out, and its Deal next hand
   takes the betting buttons' place across the panel's foot (poker-seated.js `dealRow`). */
body[data-poker-seated-table] #poker .poker-seated > .poker-seated-between { display: none; }
#poker .poker-seated-deal-row { width: 100%; min-height: 48px; font-size: 13px; }
#poker .poker-seated-deal-row[hidden], body:not([data-poker-seated-table]) #poker .poker-seated-deal-row { display: none; }
body[data-poker-seated-table] #poker .poker-seated-actions:has(> .poker-seated-deal-row:not([hidden])) > .poker-seated-buttons { display: none; }
#poker[data-seated-hud] .poker-focus :is(.poker-table-tools, .poker-status-strip, .poker-chair-look, .poker-dock) { display: none; }
/* Seated in the Table view on a screen with room for it, the table takes the whole height under the header, with the
   betting panel's width (`--poker-left-w`, widened with it) and the seats' reach past the felt kept clear at the left,
   where the panel stands, so nothing sits under it.
   Below the widths here the felt left over would be too narrow for the top seats (seats 4 and 5 a quarter of its width
   apart; plaques 148px wide up to 900px tall, 172px past it, each with its face and turn ring 22px out past its left
   edge), so the view keeps its own layout there. (`body` first, so
   it outranks the short-window rule further down.) */
@media (min-width: 1320px) and (min-height: 781px) and (max-height: 900px), (min-width: 1430px) and (min-height: 901px) {
  body #poker[data-seated-hud]:not([data-chair-view]) .poker-arena { width: auto; max-width: none; height: max(300px, calc(100dvh - 255px)); aspect-ratio: auto; margin: 94px 100px 0 calc(var(--poker-left-w) + 100px); }
}
@media (min-width: 1260px) and (min-height: 521px) and (max-height: 780px) {
  body #poker[data-seated-hud]:not([data-chair-view]) .poker-arena { width: auto; max-width: none; height: max(300px, calc(100dvh - 255px)); aspect-ratio: auto; margin: 94px 100px 0 calc(var(--poker-left-w) + 100px); }
}
/* Its header carries the side panel's buttons, in the side panel's dark glass: Hand history and Options (Auto deal
   among them), the view, and Stand up. */
#poker .poker-head-seat { display: none; }
#poker[data-seated-hud] .poker-head-seat { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; margin-left: auto; }
.poker-head-gap { width: 10px; }
#poker .poker-head-seat button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 4px 14px; color: #e9e4d6; background: #ffffff0f; border: 1px solid #ffffff26; border-radius: var(--ui-r-btn); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
#poker .poker-head-seat button[hidden] { display: none; }
#poker .poker-head-seat button[aria-pressed="true"] { color: var(--ui-on-text); background: var(--ui-on-face); border-color: var(--ui-on); box-shadow: var(--ui-on-ring); }
#poker .poker-head-seat button:not(:disabled):hover { background: #ffffff1a; border-color: #ffffff4d; }
#poker .poker-head-seat .poker-head-stand { color: #ffb4a6; background: transparent; border-color: #e5533d99; }
#poker .poker-head-seat .poker-head-stand:not(:disabled):hover { background: #e5533d1f; border-color: #e5533d; }
/* Seated, Stand up is the betting panel's (beside Sit out), so the header leaves it out. */
#poker[data-seated-hud] .poker-head-seat .poker-head-stand { display: none; }
#poker .poker-head-seat button:focus-visible { outline: 3px solid var(--pk-bright); outline-offset: 2px; }
/* On a phone the header's buttons take a compact row under the title, the table stops above the betting panel, and
   the hand panel stands aside: the 2D seat shows the cards, the stack and the turn's clock itself. */
@media (max-width: 560px) {
  #poker[data-seated-hud]:not([data-chair-view]) .poker-table-head { flex-wrap: wrap; height: auto; }
  #poker[data-seated-hud] .poker-head-seat { flex: 1 1 100%; display: grid; grid-template-columns: repeat(4, auto); justify-content: stretch; margin-left: 0; }
  #poker .poker-head-seat .poker-head-gap { display: none; }
  #poker .poker-head-seat button { min-height: 32px; padding: 2px 4px; font-size: 10px; white-space: nowrap; }
  #poker[data-seated-hud] .poker-focus { bottom: calc(var(--poker-actions-h, 230px) + 74px + var(--safe-bottom, 0px)); }
  /* Table view keeps only the hand panel's seat row (Sit out next hand, I'm back, Post or Wait for BB, Refill), a strip
     over the betting panel: the 2D seat shows the cards, the stack and the clock. */
  body[data-poker-seated-table] #poker .poker-seated > .poker-seated-own { display: none; }
  body[data-poker-seated-table] #poker .poker-seated-mine > :not(.poker-seated-plan) { display: none; }

  #poker[data-seated-hud]:not([data-chair-view]) .poker-arena { width: calc(100% - 76px); height: clamp(170px, calc(100dvh - var(--poker-actions-h, 230px) - 280px), 420px); margin: 54px auto 22px; }
}
/* Smaller screens (narrower than a laptop's, or shorter): the seated HUD's two panels in a compact cut, in either view,
   so they take less of the table: tighter padding and gaps, the hand's cards and the numbers smaller, a narrower
   betting panel with smaller emotes, presets and buttons. */
@media (max-width: 1180px), (max-height: 780px) {
  #poker { --poker-left-w: min(212px, 40vw); }
  .poker-seated-own { gap: 4px; }
  #poker .poker-seated > .poker-seated-own { padding: 8px 10px; }
  .poker-seated-own .poker-seated-card { width: 46px; }
  .poker-seated-hand-name { font-size: 14px; }
  .poker-seated-mine dt { font-size: 9px; }
  .poker-seated-mine dd { font-size: 14px; }
  .poker-seated-mine .poker-seated-turn, .poker-seated-mine .poker-seated-turn:empty { font-size: 12px; }
  .poker-seated-plan > div { min-height: 34px; }
  #poker .poker-seated-plan button { min-height: 34px; font-size: 11px; }
  .poker-seated-actions { width: min(320px, calc(100vw - 24px)); gap: 6px; }
  #poker .poker-seated > .poker-seated-actions { padding: 8px 10px; }
  #poker .poker-seated-emote-row :is(.reaction-bar, .reaction-grid) { --reaction-cell: 32px; }
  #poker .poker-seated-emote-row .reaction { font-size: 19px; }
  #poker .poker-seated-presets button { min-height: 32px; font-size: 11px; }
  #poker .poker-seated-buttons button { min-height: 40px; font-size: 11px; }
  .poker-seated-size input { min-height: 26px; }
}
/* The smallest screens (a small phone either way up): narrower seat plates, so nine of them fit round the smaller table. */
@media (max-width: 400px), (max-height: 400px) and (max-width: 720px) {
  #poker[data-seated-hud]:not([data-chair-view]) .poker-seat { width: 80px; }
}
@media (max-height: 400px) and (max-width: 720px) {
}
/* Phones and short windows: the betting panel in its most compact cut, either view: the presets and moves shorter, the
   gaps and padding tighter (on a phone held upright, no emote row, and the panel the screen's width less its margins). On a touch screen the presets and moves keep a
   finger's 44px (below). */
@media (max-width: 560px) { .poker-seated-actions { width: auto; } }
@media (max-width: 720px), (max-height: 520px) {
  .poker-seated-actions { gap: 4px; }
  #poker .poker-seated > .poker-seated-actions { padding: 6px 8px; }
  .poker-seated-presets, .poker-seated-buttons { gap: 4px; }
  #poker .poker-seated-presets button { min-height: 28px; padding-block: 2px; font-size: 10.5px; }
  #poker .poker-seated-buttons button { min-height: 34px; padding: 2px 4px; font-size: 11px; }
  .poker-seated-size { gap: 2px; }
  .poker-seated-size input { min-height: 22px; }
  #poker .poker-seated-size input[data-seated="amount"] { min-height: 26px; font-size: 13px; }
}
/* A short window (a small laptop): the table takes the height left over the seated HUD's panels, in its own proportions,
   so the seats at its lower corners stand clear of them. */
@media (min-width: 721px) and (max-height: 700px) {
  #poker[data-seated-hud]:not([data-chair-view]) .poker-arena { height: clamp(200px, calc(100dvh - 355px), 470px); width: auto; aspect-ratio: 5 / 2; max-width: 100%; margin-inline: auto; }
}
/* There, with the betting panel docked at the bottom left, the table keeps to the right (its seats' plaques reach about
   50px past the felt), away from the panel. */
@media (min-width: 721px) and (min-height: 521px) and (max-height: 700px) {
  #poker[data-seated-hud]:not([data-chair-view]) .poker-arena { margin-left: auto; margin-right: 60px; }
}
/* On a touch screen the betting panel's presets and moves are at least a finger's 44px tall, and its emotes 40px, in either view. */
@media (pointer: coarse) { #poker .poker-seated-actions :is(.poker-seated-presets, .poker-seated-buttons) button { min-height: 44px; } #poker .poker-seated-emote-row :is(.reaction-bar, .reaction-grid) { --reaction-cell: 40px; } }
/* On a phone held upright the betting panel's buttons are thinner still, a touch screen's too. */
@media (max-width: 560px) { #poker .poker-seated-actions .poker-seated-presets button { min-height: 32px; } #poker .poker-seated-actions .poker-seated-buttons button { min-height: 38px; } }
/* A phone on its side: the header's buttons in one compact row, the table in the left of the panel (the landscape
   layout's), clear of a narrow betting panel at the right (its presets in one row, Fold and Call side by side over
   Raise), and of the hand panel's seat row over it, as on a phone held upright. */
@media (max-height: 520px) and (min-width: 561px) {
  #poker[data-seated-hud]:not([data-chair-view]) .poker-table-head { height: auto; flex-wrap: nowrap; }
  #poker[data-seated-hud] .poker-head-seat { flex-wrap: nowrap; gap: 4px; }
  #poker .poker-head-seat .poker-head-gap { display: none; }
  #poker .poker-head-seat button { min-height: 32px; padding: 2px 8px; font-size: 10px; white-space: nowrap; }
  /* Table view keeps only the hand panel's seat row, a strip over the betting panel at the right. */
  body[data-poker-seated-table] #poker .poker-seated > .poker-seated-own { display: none; }
  body[data-poker-seated-table] #poker .poker-seated-mine > :not(.poker-seated-plan) { display: none; }
  .poker-seated-actions { width: min(230px, 36vw); }
  #poker .poker-seated-presets button { padding-inline: 2px; font-size: 10px; }
  .poker-seated-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .poker-seated-buttons [data-seated-act="raise"] { grid-column: 1 / -1; }
  #poker[data-seated-hud]:not([data-chair-view]) .poker-arena { width: calc(100vw - min(230px, 36vw) - 100px); max-width: none; margin-inline: 40px auto; }
}
/* Seated in 3D the way back to the table only repeats what the seat shows, so it stands aside. */
body[data-poker-seated-3d] #poker .poker-return { display: none; }
#poker .poker-primary { background: linear-gradient(120deg, var(--pk-bright), var(--pk-accent)); color: var(--pk-ink); border-color: var(--pk-bright); font-weight: 750; }
/* One filled button a screen: beside Sit down, Open table is an ordinary one. */
#poker .poker-carry-actions > .poker-primary:not([hidden]) ~ .poker-primary { color: var(--pk-text); background: color-mix(in srgb, var(--pk-text) 6%, transparent); border-color: color-mix(in srgb, var(--pk-text) 16%, transparent); }
.poker-kicker { color: var(--pk-accent); letter-spacing: 0.17em; font-size: 9px; line-height: 1.5; }
.poker-mode-picker { display: grid; gap: 8px; }
#poker .poker-mode-picker button { padding: 13px 14px; text-align: left; }
.poker-mode-picker span { display: block; font-size: 15px; font-weight: 700; }
.poker-mode-picker small { display: block; font-size: 11px; margin-top: 5px; font-weight: 400; }
.poker-mode-note { color: var(--pk-muted); font-size: 11px; margin: 10px 0 22px; }
#poker .poker-return { position: absolute; right: max(12px,var(--safe-right)); top: calc(76px + var(--safe-top)); padding: 8px 12px; border-color: var(--pk-accent); text-align: left; background: var(--pk-soft); }
.poker-return span, .poker-return small { display: block; }
.poker-return span { font-size: 13px; font-weight: 700; }
.poker-return small { margin-top: 4px; color: var(--pk-muted); font-size: 11px; }
#poker[data-your-turn="true"] .poker-return { box-shadow: inset 4px 0 0 var(--pk-bright); }
.poker-lobby-options { margin-top: 16px; padding-top: 6px; border-top: 1px solid var(--pk-line); font-size: 11px; color: var(--pk-muted); }
#poker summary { cursor: pointer; min-height: 44px; align-content: center; }
.poker-nickname { display: grid; gap: 5px; }
.poker-nickname input { min-height: 40px; box-sizing: border-box; width: 100%; border: 1px solid var(--pk-line); border-radius: var(--ui-r-btn); padding: 8px; background: var(--pk-deep); color: var(--pk-text); font: inherit; }
.poker-focus { position: absolute; inset: 72px 14px 12px; max-width: 1380px; margin-inline: auto; padding: 20px 24px; box-sizing: border-box; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--pk-line); border-radius: var(--ui-r); background: radial-gradient(ellipse at 50% 38%, var(--pk-haloVeil), var(--pk-deepVeil) 78%); box-shadow: 0 18px 80px #0008, inset 0 3px 0 var(--pk-accent); z-index: 21; scrollbar-width: thin; }
/* The room shows dimly through the panel's veil, so every block of text on it stands on a solid surface of its own. */
.poker-table-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: var(--ui-r); background: var(--pk-deepGlass); }
.poker-table-head .poker-kicker { margin: 0 0 6px; }
.poker-table-head .poker-kicker > span:first-child { margin: 0 6px; opacity: 0.5; }
.poker-table-title { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.poker-table-head h3 { color: var(--pk-text); font: 400 30px Georgia, serif; margin: 0; white-space: nowrap; }
.poker-table-head p:not(.poker-kicker) { margin: 6px 0 0; font-size: 11px; color: var(--pk-muted); }
.poker-mode-badge, .poker-free { border: 1px solid var(--pk-line); color: var(--pk-bright); padding: 5px 7px; border-radius: var(--ui-r-in); font-size: 9px; letter-spacing: 0.09em; }
.poker-mode-badge { background: var(--pk-soft); }
.poker-table-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.poker-table-tools button { padding: 8px 14px; font-size: 12px; }
/* The Emote button stands in the table head above 720px and in the status strip at 720px and below, where the head has
   no room. Its menu of ten drops from the head's tools; on a phone it is a sheet over the foot of the table view. */
.poker-table-tools { position: relative; }
.poker-status-strip .poker-emote-button { display: none; }
.poker-emote-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; width: 290px; padding: 8px; box-sizing: border-box; border: 1px solid var(--pk-line); border-radius: var(--ui-r); background: var(--pk-deepGlass); box-shadow: 0 12px 34px #0009; }
#poker .poker-emote-menu button { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 5px 9px; font-size: 11px; text-align: left; background: var(--pk-surface); }
.poker-emote-glyph { font-size: 20px; line-height: 1; }
/* The status strip is one row of fixed places at a fixed height (the row never grows round its words: a connection
   line too long for its place scrolls there), so nothing coming, going or growing in it moves what is under it: the chair view's button, the connection line (which may wrap to two lines), Reconnect, the phone's Emote
   button, then the timer last, at the right edge, sized for its longest text and kept in place while it has none. */
.poker-status-strip { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto var(--pk-timer, 14em); grid-template-rows: minmax(0, 1fr); align-items: center; gap: 0 12px; height: 44px; box-sizing: border-box; border: 1px solid var(--pk-line); border-radius: var(--ui-r); background: var(--pk-deepGlass); padding: 10px 12px; margin-top: 16px; color: var(--pk-muted); font-size: 11px; }
/* All in the one row: Reconnect and Emote come after the timer in the markup but stand before it, and auto-placement
   would start a second row for them. */
.poker-status-strip > * { grid-row: 1; }
.poker-status-strip [data-poker="chair-view"] { grid-column: 1; }
.poker-status-strip .poker-connection { grid-column: 2; max-height: 100%; overflow-y: auto; overflow-wrap: anywhere; line-height: 1.25; }
.poker-status-strip [data-poker="reconnect"] { grid-column: 3; }
.poker-status-strip .poker-emote-button { grid-column: 4; }
.poker-connection::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--pk-accent); margin-right: 7px; }
#poker[data-connection="failed"] .poker-connection::before, #poker[data-connection="reconnecting"] .poker-connection::before { background: #f1b17c; }
.poker-status-strip .poker-timer { grid-column: 5; display: flex; align-items: center; justify-content: flex-end; min-height: 2.5em; text-align: right; line-height: 1.25; font-variant-numeric: tabular-nums; }
.poker-timer.idle { visibility: hidden; }
#poker .poker-status-strip button { min-height: 32px; padding: 4px 9px; font-size: 11px; }
.poker-timer.urgent { color: #ffd6a3; font-weight: 700; }
.poker-table-layout { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 24px; }
.poker-play { min-width: 0; }
.poker-arena { position: relative; height: clamp(350px, 43vh, 470px); width: 100%; margin: 58px auto 60px; isolation: isolate; }
/* The felt's middle, in three rows: the two outer rows always share what the board leaves, so the board sits on the
   table's centre line whatever the pot or the street says, the pot and its chips just above it, the street and the hand's
   result under it. */
.poker-center { position: absolute; left: 23%; right: 23%; top: 17%; bottom: 17%; display: grid; grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr); justify-items: center; pointer-events: none; z-index: 1; }
.poker-pot-area { align-self: end; display: flex; flex-direction: column; align-items: center; }
.poker-felt-foot { align-self: start; justify-self: stretch; display: flex; flex-direction: column; align-items: center; }
/* The dealer stands above the table at the far rail, between the two far seats, its bust a few pixels behind the rail;
   the bust is the arena's middle, and the label hangs to its right where there is room for it. */
.poker-dealer { --bust: 40px; --face: 48px; position: absolute; left: 50%; bottom: calc(100% - 8px); z-index: 1; margin-left: calc(var(--bust) / -2); display: flex; align-items: center; gap: 7px; color: var(--pk-bright); font-size: 8px; letter-spacing: 0.15em; }
.poker-dealer span { width: min-content; line-height: 1.25; }
@media (max-width: 1180px) { .poker-dealer span { display: none; } }
.poker-dealer svg { width: var(--bust); height: var(--bust); filter: drop-shadow(0 3px 3px #08251c66); }
/* The room's own gorilla's face, out of the flow so the centre keeps its height: centred over the bust, its chin on the
   collar (the SVG's neck line, 39% up from its foot). */
.poker-dealer-face { position: absolute; left: calc(var(--bust) / 2 - var(--face) / 2); bottom: calc(var(--bust) * 0.39); width: var(--face); height: var(--face); filter: drop-shadow(0 3px 3px #08251c66); }
/* The deal: the bust dips 4px and a card swings out from under it, down onto the felt. */
.poker-dealer[data-dealing] :is(.poker-dealer-face, svg) { animation: poker-dealer-dip 0.7s ease-in-out; }
.poker-dealer[data-dealing]::after { content: ""; position: absolute; z-index: -1; left: calc(var(--bust) / 2 - 5px); bottom: 4px; width: 10px; height: 14px; box-sizing: border-box; border: 1px solid var(--pk-deep); border-radius: var(--ui-r-card); background: var(--pk-bright); animation: poker-dealer-card 0.7s ease-out both; }
@keyframes poker-dealer-dip { 40% { translate: 0 4px; } }
@keyframes poker-dealer-card { from { opacity: 0; transform: translate(0, -6px) rotate(0deg); } 30% { opacity: 1; } to { opacity: 0; transform: translate(6px, 34px) rotate(80deg); } }
.poker-pot { display: grid; grid-template-columns: auto auto; gap: 0 6px; margin: 4px 0 0; align-items: baseline; text-align: center; }
.poker-pot > span { grid-column: 1 / -1; font-size: 9px; color: var(--pk-muted); letter-spacing: 0.16em; }
.poker-pot strong { min-width: 7ch; font-size: 32px; line-height: 1; color: var(--pk-bright); font-variant-numeric: tabular-nums; }
.poker-pot small { font-size: 9px; color: var(--pk-muted); }
.poker-pot-chips { display: flex; justify-content: center; align-items: flex-end; gap: 6px; height: 34px; margin: 0 0 4px; }
.poker-chip-stack { display: flex; flex-direction: column-reverse; min-width: 22px; --chip-face: var(--pk-bright); }
.poker-chip-stack:nth-child(2) { --chip-face: var(--pk-rail); }
.poker-chip-stack:nth-child(3) { --chip-face: var(--pk-felt); }
.poker-chip-stack i { display: block; width: 22px; height: 6px; margin-top: -2px; box-sizing: border-box; border: 1px solid var(--pk-deep); border-radius: 50%; background: var(--chip-face); box-shadow: inset 0 -1px 0 var(--pk-accent); }
.poker-chip-stack i:first-child { margin-top: 0; }
.poker-board, .poker-hand { display: flex; justify-content: center; align-items: center; gap: 6px; }
.poker-board { width: 100%; max-width: 360px; }
.poker-card { display: block; flex: 0 1 62px; width: 62px; min-width: 0; aspect-ratio: 5 / 7; border-radius: var(--ui-r-card); box-shadow: 0 2px 2px #0004, 0 7px 13px #10291c55; animation: poker-deal 0.24s ease-out both; }
.poker-card svg { display: block; width: 100%; height: 100%; border-radius: inherit; }
.poker-card-slot { border: 1px solid var(--pk-line); box-shadow: inset 0 1px 4px #0003; box-sizing: border-box; background: #0001; animation: none; }
.poker-street { width: 100%; margin: 6px 0 0; color: var(--pk-muted); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; text-align: center; }
.poker-seat { position: absolute; width: clamp(80px, 12%, 122px); transform: translate(-50%, -50%); z-index: 2; container: poker-seat / inline-size; }
#poker .poker-seat-button { display: flex; flex-direction: column; justify-content: center; position: relative; width: 100%; min-height: 67px; padding: 8px 6px; color: var(--pk-text); background: linear-gradient(var(--pk-surface), var(--pk-deep)); border: 1px solid var(--pk-line); border-radius: var(--ui-r-btn); box-shadow: 0 5px 12px #0a1e1666; text-align: center; opacity: 1; }
/* The seated character's face. By default (and wherever container queries are missing) a 22px badge out of the flow
   half over the plaque's left edge, level with its middle, clear of the seat's cards above or below it and of its bet,
   so the seat keeps its height and nothing in it is covered. */
.poker-face { display: block; position: absolute; left: -13px; top: calc(50% - 11px); z-index: 3; width: 22px; height: 22px; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--pk-rail); background: var(--pk-deep); }
.poker-face[hidden] { display: none; }
.poker-face-img { display: block; width: 100%; height: 100%; border-radius: 50%; }
.poker-seat.turn .poker-face { border-color: var(--pk-bright); box-shadow: 0 0 10px var(--pk-glow); }
/* About 45% in effect under the folded button's own 0.55. */
.poker-seat.folded .poker-face { opacity: 0.82; }
/* An emote over the face: on the badge (on either edge), or on the 48px face once the seat has two columns. It pops in and
   fades over 2.6 s, the time the scene shows it; `data-beat` swaps between two copies of the animation to restart it. */
.poker-seat-emote { position: absolute; left: -15px; top: calc(50% - 13px); z-index: 5; display: grid; place-items: center; width: 26px; height: 26px; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--pk-bright); background: var(--pk-deep); font-size: 14px; line-height: 1; pointer-events: none; animation: poker-emote-a 2.6s ease-out forwards; }
.poker-seat-emote[data-beat="b"] { animation-name: poker-emote-b; }
@keyframes poker-emote-a { 0% { opacity: 0; scale: 0.4; } 8% { opacity: 1; scale: 1.18; } 14% { scale: 1; } 80% { opacity: 1; } 100% { opacity: 0; scale: 1; } }
@keyframes poker-emote-b { 0% { opacity: 0; scale: 0.4; } 8% { opacity: 1; scale: 1.18; } 14% { scale: 1; } 80% { opacity: 1; } 100% { opacity: 0; scale: 1; } }
/* A seat wide enough for a face beside its stack: two columns, the face first; an open seat shows a dashed circle there. */
@container poker-seat (min-width: 112px) {
  #poker .poker-seat-button { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; align-content: center; }
  .poker-seat-button > :not(.poker-face, .poker-position) { grid-column: 2; }
  /* The last action runs the plaque's full width under the face, so no action's words wrap beside it. */
  .poker-seat-button > .poker-last-action { grid-column: 1 / -1; }
  .poker-face, .poker-seat.empty .poker-seat-button::before { position: relative; left: auto; top: auto; grid-column: 1; grid-row: 1 / span 2; width: 48px; height: 48px; margin-right: 6px; box-sizing: border-box; border-radius: 50%; }
  .poker-seat.empty .poker-seat-button::before { content: ""; border: 2px dashed var(--pk-line); }
  /* The text column beside the face is 44 to 54px: the panel's value size, and a stack too long for it wraps. */
  .poker-seat .poker-stack { font-size: 14px; overflow-wrap: anywhere; }
  /* Centred on the face: the button's 1px border and 6px padding, then half the face. */
  .poker-seat .poker-seat-emote, .poker-seat:is([data-position="0"], [data-position="1"], [data-position="2"], [data-position="7"], [data-position="8"]) .poker-seat-emote { left: 18px; top: calc(50% - 13px); bottom: auto; }
}
/* A name keeps two lines whether it needs them or not, and the last action one, so a plaque's height is the same
   in every state of the hand. */
.poker-player { font-size: 11px; overflow-wrap: anywhere; line-height: 1.2; min-height: 2.4em; }
.poker-stack { font-size: 16px; color: var(--pk-bright); font-variant-numeric: tabular-nums; margin-top: 4px; }
.poker-last-action { font-size: 9px; line-height: 1.2; color: var(--pk-muted); min-height: 1.2em; margin-top: 4px; }
/* An occupied seat is a disabled button (nobody can take it) but must read solid: above `#poker button:disabled`'s 0.45,
   below the folded and empty seats' own opacities. */
#poker .poker-seat-button:disabled { opacity: 1; }
#poker .poker-seat.empty .poker-seat-button { border: 1px dashed var(--pk-line); background: var(--pk-surfaceSoft); box-shadow: none; opacity: 0.72; }
.poker-seat.empty .poker-stack { font-size: 11px; color: var(--pk-muted); }
.poker-seat.empty .poker-last-action { display: none; }
#poker .poker-seat.turn .poker-seat-button { border-color: var(--pk-bright); box-shadow: 0 0 0 2px var(--pk-glow), 0 0 20px var(--pk-glow); }
#poker .poker-seat.yours .poker-seat-button { border-color: var(--pk-bright); }
.poker-seat.yours .poker-player:not(.self-named)::before { content: "YOU · "; color: var(--pk-accent); font-size: 8px; }
#poker .poker-seat.folded .poker-seat-button { opacity: 0.55; }
#poker .poker-seat.winner .poker-seat-button { border-color: var(--pk-bright); background: var(--pk-halo); box-shadow: 0 0 18px var(--pk-glow); }
.poker-position { position: absolute; right: -7px; top: -10px; border-radius: var(--ui-r-pill); padding: 3px 6px; color: var(--pk-ink); background: var(--pk-rail); box-shadow: 0 2px 3px #0005; font-size: 9px; font-weight: 750; z-index: 4; }
/* The seat's decision clock: the corner opposite the dealer chip, a fixed box whether a clock shows there or not. */
.poker-seat-clock { position: absolute; left: -7px; top: -10px; z-index: 4; min-width: 4.6ch; box-sizing: border-box; padding: 3px 5px; border-radius: var(--ui-r-pill); color: var(--pk-ink); background: var(--pk-bright); box-shadow: 0 2px 3px #0005; font-size: 9px; font-weight: 750; text-align: center; font-variant-numeric: tabular-nums; }
.poker-seat-clock:empty { visibility: hidden; }
/* A seat's two cards, tucked half behind its plaque on the side away from the felt's middle (under a near seat, over a
   far one), so only their outer half shows. They are sized from the seat's width, the half that shows carries the
   card's corner index (a face-down card shows its back), and the row keeps its box with no cards in it. */
.poker-seat-cards { --card-w: 38cqi; display: flex; justify-content: center; position: absolute; left: 0; right: 0; top: calc(100% - var(--card-w) * 0.7); height: calc(var(--card-w) * 1.4); gap: 3px; z-index: -1; pointer-events: none; }
.poker-seat:is([data-position="3"], [data-position="4"], [data-position="5"], [data-position="6"]) .poker-seat-cards { top: auto; bottom: calc(100% - var(--card-w) * 0.7); }
.poker-seat-cards .poker-card { flex: 0 0 var(--card-w); width: var(--card-w); border-radius: var(--ui-r-card); }
.poker-seat-cards .poker-card[data-face] { position: relative; overflow: hidden; background: linear-gradient(120deg, #fffdf4, #e5e3d7); color: #222a2b; }
.poker-seat-cards .poker-card[data-face] svg { visibility: hidden; }
.poker-seat-cards .poker-card[data-face]::after { content: attr(data-rank) attr(data-suit); position: absolute; left: 0; right: 0; bottom: 6%; text-align: center; font: 700 calc(var(--card-w) * 0.42)/1 Georgia, serif; letter-spacing: -0.04em; }
.poker-seat:is([data-position="3"], [data-position="4"], [data-position="5"], [data-position="6"]) .poker-seat-cards .poker-card[data-face]::after { top: 6%; bottom: auto; }
.poker-seat-cards .poker-card[data-red="true"] { color: #a32c40; }
.poker-bet { position: absolute; top: calc(100% + 5px); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 2px 6px; background: var(--pk-deepGlass); border-radius: var(--ui-r-pill); font-size: 11px; color: var(--pk-bright); white-space: nowrap; font-variant-numeric: tabular-nums; }
.poker-bet::before { content: ""; width: 10px; height: 6px; border: 2px dashed #fff0cb; border-radius: 50%; background: #ceaa5c; box-shadow: 0 2px 0 #987330, 0 3px 0 #e7c16e; }
.poker-seat[data-position="0"] { left: 50%; top: 96%; }
.poker-seat[data-position="1"] { left: 24%; top: 87%; }
.poker-seat[data-position="2"] { left: 8%; top: 61%; }
.poker-seat[data-position="3"] { left: 15%; top: 27%; }
.poker-seat[data-position="4"] { left: 37%; top: 5%; }
.poker-seat[data-position="5"] { left: 63%; top: 5%; }
.poker-seat[data-position="6"] { left: 85%; top: 27%; }
.poker-seat[data-position="7"] { left: 92%; top: 61%; }
.poker-seat[data-position="8"] { left: 76%; top: 87%; }
#poker .poker-seat.empty:not(.npc) .poker-seat-cards { display: none; }
.poker-seat[data-position="0"] .poker-bet, .poker-seat[data-position="1"] .poker-bet, .poker-seat[data-position="8"] .poker-bet { top: auto; bottom: calc(100% + 6px); }
.poker-seat[data-position="2"] .poker-bet { left: calc(100% + 5px); top: 22px; transform: none; }
.poker-seat[data-position="7"] .poker-bet { left: auto; right: calc(100% + 5px); top: 22px; transform: none; }
/* The hand's result stands on the felt under the street, in the row the board leaves free, so it pushes nothing. */
.poker-result { max-width: 100%; box-sizing: border-box; padding: 5px 10px; margin: 6px 0 0; border: 1px solid var(--pk-line); border-radius: var(--ui-r-in); background: linear-gradient(var(--pk-soft), var(--pk-soft)), var(--pk-deepGlass); color: var(--pk-bright); font-size: 12px; line-height: 1.4; text-align: center; overflow-wrap: anywhere; }
/* The dock keeps one height: beside the private hand, the decision column is three fixed rows, the turn line, a slot
   shared by the turn's help and any notice, and the action row, where the betting buttons and the table setup take
   turns in the same place. */
.poker-dock { --pk-slot: 34px; --pk-act: 56px; display: grid; grid-template-columns: 164px minmax(0, 1fr); align-items: center; gap: 18px; padding: 18px 16px; border: 1px solid var(--pk-line); border-radius: var(--ui-r); background: var(--pk-deepGlass); }
#poker[data-your-turn="true"] .poker-dock { border-color: var(--pk-accent); box-shadow: inset 0 3px 0 var(--pk-accent); }
.poker-private { text-align: center; min-width: 0; }
.poker-private-label { display: block; color: var(--pk-accent); font-size: 8px; letter-spacing: 0.14em; margin-bottom: 6px; }
.poker-hand { gap: 7px; padding: 4px 0; }
.poker-hand .poker-card { flex: 0 0 62px; width: 62px; }
.poker-hand .poker-card:first-child { transform: rotate(-3deg); }
.poker-hand .poker-card:last-child { transform: rotate(3deg); }
.poker-private p { margin: 8px 0 3px; font-size: 13px; color: var(--pk-bright); }
.poker-private small { display: block; color: var(--pk-muted); font-size: 11px; line-height: 1.4; }
.poker-decision { min-width: 0; display: grid; grid-template-areas: "turn" "slot" "act"; grid-template-rows: auto var(--pk-slot) var(--pk-act); row-gap: 6px; }
/* The turn line keeps two lines' room whatever it says: a long name wraps inside it, and anything longer still
   (enlarged text) scrolls there rather than moving the rows under it. */
.poker-turn { grid-area: turn; height: calc(2em * 1.3); box-sizing: border-box; overflow-y: auto; overflow-wrap: anywhere; margin: 0; font-size: 17px; line-height: 1.3; font-weight: 650; color: var(--pk-text); }
.poker-turn.is-yours { color: var(--pk-bright); }
.poker-turn-help { grid-area: slot; margin: 0; color: var(--pk-muted); font-size: 11px; line-height: 1.5; }
.poker-decision > [data-poker="controls"], .poker-decision > .poker-setup { grid-area: act; align-self: center; min-width: 0; }
/* The setup fills the action row, so a button whose words wrap ("Deal next hand" on a phone) keeps its height. */
.poker-decision > .poker-setup { align-self: stretch; display: flex; }
.poker-setup .poker-buttons { flex: 1; flex-wrap: nowrap; }
#poker .poker-setup .poker-buttons button { flex: 1 1 0; min-width: 0; }
/* At a practice table the bot counter ("Computer opponents − N +", with why an end is shut) has a row of its own under
   the action row, through the hand too (shut then, saying why), so the dock keeps one height from the deal to the result.
   Its note keeps two lines' room whatever it says. */
.poker-decision:has(> .poker-bots:not([hidden])) { grid-template-areas: "turn" "slot" "act" "bots"; grid-template-rows: auto var(--pk-slot) var(--pk-act) auto; }
.poker-decision > .poker-bots { grid-area: bots; min-width: 0; }
.poker-bots { display: grid; grid-template-columns: minmax(0, 1fr) 40px 32px 40px; grid-template-areas: "label minus count plus" "note note note note"; align-items: center; column-gap: 6px; row-gap: 4px; }
.poker-bots-label { grid-area: label; align-self: center; white-space: nowrap; font-size: 9px; font-weight: 750; letter-spacing: 0.1em; text-transform: uppercase; color: var(--pk-muted); }
.poker-bots-note { grid-area: note; align-self: start; margin: 0; min-height: 1.4em; font-size: 10px; line-height: 1.4; color: var(--pk-muted); overflow-wrap: anywhere; }
.poker-bots > output { grid-area: count; text-align: center; font-size: 17px; font-weight: 750; color: var(--pk-bright); font-variant-numeric: tabular-nums; }
.poker-bots > [data-poker-action="bot-remove"] { grid-area: minus; }
.poker-bots > [data-poker-action="bot-add"] { grid-area: plus; }
.poker-bots[hidden] { display: none; }
.poker-bots-note:empty { display: none; }
.poker-tab-body .poker-bots { grid-column: 1 / -1; }
#poker .poker-bots > button, .poker-tab-body .poker-bots > button { min-width: 0; width: 40px; min-height: 40px; padding: 0; font-size: 18px; line-height: 1; }
.poker-sizing { display: grid; grid-template-columns: minmax(0, 1fr) 136px; align-items: center; gap: 9px; margin-top: 10px; }
.poker-presets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
#poker .poker-presets button { color: var(--pk-muted); font-size: 11px; padding: 4px 2px; }
#poker .poker-presets button[aria-pressed="true"] { color: var(--ui-on-text); background: var(--ui-on-face); border-color: var(--ui-on); box-shadow: var(--ui-on-ring); }
.poker-amount { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--pk-muted); }
.poker-amount span { flex-shrink: 0; }
.poker-amount input { width: 100%; min-width: 0; height: 44px; box-sizing: border-box; border: 1px solid var(--pk-line); border-radius: var(--ui-r-btn); background: var(--pk-surface); color: var(--pk-bright); font: inherit; font-size: 16px; padding: 6px; font-variant-numeric: tabular-nums; }
.poker-sizing input[type="range"] { grid-column: 1 / -1; width: 100%; margin: 0; height: 30px; accent-color: var(--pk-accent); cursor: pointer; }
.poker-bet-help { margin: 4px 0 0; color: var(--pk-muted); font-size: 10px; line-height: 1.5; }
.poker-actions { display: grid; grid-template-columns: 0.85fr 1.1fr 1.4fr; gap: 7px; }
#poker .poker-actions button { min-height: 56px; font-size: 14px; font-weight: 600; padding: 9px 5px; }
#poker .poker-actions button:first-child { color: var(--pk-muted); background: transparent; }
#poker .poker-actions button:nth-child(2) { border-color: var(--pk-accent); }
.poker-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
/* The decision clock along the acting seat's plaque: green, yellow, red, then the time bank in its own blue, with the
   seconds in a pill at the plaque's corner for the clock's last five and the whole bank. */
/* The decision clock round the acting seat's face (poker-hud.js `clock`): a thin ring just outside the face's border,
   draining green to yellow to red and blue through the time bank, and the seconds over the dimmed face. */
.poker-clock { position: absolute; inset: -5px; z-index: 1; pointer-events: none; container-type: size; }
.poker-clock[hidden] { display: none; }
.poker-clock svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.poker-clock circle { fill: none; stroke: #b48cff; stroke-width: 2.4; stroke-dasharray: 100; stroke-dashoffset: 0; stroke-linecap: round; transition: stroke-dashoffset 0.15s linear; }
.poker-clock[data-stage="green mine"] circle { stroke: #4fd08f; }
.poker-clock[data-stage="yellow mine"] circle { stroke: #f2c14e; }
.poker-clock[data-stage="red mine"] circle { stroke: #ff6a4a; }
.poker-clock[data-stage^="bank"] circle { stroke: #8cdcf9; }
.poker-clock b { position: absolute; inset: 5px; display: grid; place-items: center; border-radius: 50%; background: #0000008c; font: 800 clamp(9px, 34cqmin, 15px)/1 var(--ui-font); color: #fff; text-shadow: 0 1px 2px #000; font-variant-numeric: tabular-nums; }
.poker-clock b:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .poker-clock circle { transition: none; } }
.poker-pre { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 6px 0; }
#poker .poker-pre button { min-height: 40px; font-size: 12px; padding: 6px 4px; }
#poker .poker-pre button[aria-pressed="true"], #poker .poker-seat-plan button[aria-pressed="true"] { color: var(--ui-on-text); background: var(--ui-on-face); border-color: var(--ui-on); box-shadow: var(--ui-on-ring); }
.poker-seat-plan { margin: 6px 0; }
.poker-plan-note { margin: 0 0 6px; font-size: 10px; color: var(--pk-muted); }
.poker-buttons button { flex: 1 1 105px; font-size: 12px; padding: 8px; }
.poker-rail { align-self: start; min-width: 0; padding: 16px; border: 1px solid var(--pk-line); border-radius: var(--ui-r); background: var(--pk-deepGlass); }
.poker-rail-title { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--pk-muted); }
.poker-table-facts { margin: 15px 0; padding-bottom: 12px; border-bottom: 1px solid var(--pk-line); }
.poker-table-facts > div { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; margin: 9px 0; }
.poker-table-facts dt { color: var(--pk-muted); }
.poker-table-facts dd { margin: 0; color: var(--pk-text); font-variant-numeric: tabular-nums; }
.poker-activity h4 { font-size: 12px; margin: 15px 0 9px; font-weight: 600; }
.poker-log { white-space: pre-line; margin: 0 0 16px; color: var(--pk-muted); font-size: 11px; line-height: 1.8; max-height: 180px; overflow: auto; overflow-wrap: anywhere; scrollbar-width: thin; }
.poker-table-footer details { border-top: 1px solid var(--pk-line); font-size: 11px; color: var(--pk-muted); line-height: 1.7; }
.poker-table-footer summary { color: var(--pk-text); }
.poker-preferences { display: grid; font-size: 11px; margin-bottom: 8px; }
.poker-preferences label { display: flex; align-items: center; gap: 8px; min-height: 38px; cursor: pointer; }
.poker-preferences input { accent-color: var(--pk-accent); width: 16px; height: 16px; }
.poker-chip-styles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; align-items: center; grid-column: 1 / -1; padding: 4px 0; }
.poker-chip-styles span { grid-column: 1 / -1; white-space: nowrap; }
.poker-chip-styles button { min-height: 38px; padding: 4px 2px; font-size: 13px; font-weight: 750; white-space: nowrap; }
.poker-table-footer .poker-buttons { margin: 8px 0 12px; }
/* A notice takes the help's slot while it shows, scrolling inside it should it run past two lines. */
.poker-notice { grid-area: slot; align-self: stretch; box-sizing: border-box; color: var(--pk-muted); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; overflow-y: auto; margin: 0; }
.poker-notice:empty { display: none; }
.poker-notice:not(:empty) { padding: 2px 8px; border-left: 2px solid var(--pk-accent); background: var(--pk-soft); }
.poker-decision:has(.poker-notice:not(:empty)) .poker-turn-help { visibility: hidden; }
.poker-history ol { padding-left: 18px; }
.poker-history li { padding: 6px 0; }
body[data-poker-seated="true"] #joy-move, body[data-poker-seated="true"] #joy-look, body[data-poker-seated="true"] #act,
body[data-poker-table-view="true"] #joy-move, body[data-poker-table-view="true"] #joy-look, body[data-poker-table-view="true"] #act { visibility: hidden; }
@keyframes poker-deal { from { opacity: 0; translate: 0 -9px; } to { opacity: 1; translate: 0 0; } }
@media (max-width: 1080px) {
  .poker-table-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .poker-rail { padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 22px; }
  .poker-rail-title { grid-column: 1; }
  .poker-table-facts { grid-column: 1; }
  .poker-activity { grid-column: 2; grid-row: 1 / 3; }
  .poker-log { max-height: 115px; }
  .poker-table-footer { grid-column: 1 / -1; }
  .poker-table-footer .poker-preferences { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px), (pointer: coarse) and (max-width: 960px) and (max-height: 520px) {
  .poker-focus { inset: 65px 4px max(4px, var(--safe-bottom)); padding: 12px 9px; border-radius: var(--ui-r); }
  .poker-table-head { gap: 8px; align-items: flex-start; }
  .poker-table-head h3 { font-size: 24px; }
  .poker-table-head .poker-kicker { font-size: 7px; }
  .poker-table-head .poker-kicker span:last-child { display: none; }
  .poker-table-head p:not(.poker-kicker) { font-size: 10px; }
  .poker-table-title { gap: 6px; }
  .poker-mode-badge, .poker-free { font-size: 7px; padding: 4px; }
  .poker-table-tools { gap: 4px; max-width: 145px; }
  .poker-table-tools button { min-height: 44px; padding: 5px 9px; font-size: 11px; }
  .poker-status-strip { --pk-timer: 9em; height: 50px; gap: 0 8px; font-size: 10px; padding-block: 8px; margin-top: 10px; }
  .poker-table-tools .poker-emote-button { display: none; }
  .poker-status-strip .poker-emote-button { display: inline-block; }
  #poker .poker-status-strip .poker-emote-button { min-height: 44px; }
  .poker-emote-menu { position: fixed; top: auto; left: 12px; right: 12px; bottom: calc(max(4px, var(--safe-bottom)) + 8px); width: auto; }
  .poker-arena { height: clamp(345px, 43dvh, 390px); }
  .poker-seat { width: 64px; }
  #poker .poker-seat-button { min-height: 58px; padding: 6px 3px; border-radius: var(--ui-r-btn); }
  .poker-player { font-size: 10px; }
  .poker-stack { font-size: 13px; margin-top: 3px; }
  .poker-last-action { font-size: 8px; margin-top: 3px; }
  .poker-seat[data-position="2"] { left: 10%; }
  .poker-seat[data-position="7"] { left: 90%; }
  .poker-seat[data-position="1"] { left: 22%; }
  .poker-seat[data-position="8"] { left: 78%; }
  .poker-position { font-size: 8px; top: -8px; right: -3px; padding: 3px 4px; }
  .poker-bet { font-size: 9px; padding: 2px 4px; gap: 3px; }
  .poker-bet::before { width: 7px; height: 4px; }
  .poker-seat[data-position="2"] .poker-bet { left: calc(100% + 2px); top: 44px; }
  .poker-seat[data-position="7"] .poker-bet { right: calc(100% + 2px); top: 44px; }
  .poker-center { left: 22%; right: 22%; top: 20%; bottom: 20%; }
  .poker-dealer { --bust: 32px; --face: 40px; }
  .poker-pot { margin: 7px 0 10px; gap: 0 5px; }
  .poker-pot > span { font-size: 8px; }
  .poker-pot strong { font-size: 26px; }
  .poker-pot small { font-size: 8px; }
  .poker-pot-chips { height: 26px; }
  .poker-chip-stack { min-width: 16px; }
  .poker-chip-stack i { width: 16px; height: 5px; }
  .poker-board { gap: 4px; }
  .poker-board .poker-card { border-radius: var(--ui-r-card); }
  .poker-street { font-size: 9px; margin-top: 10px; }
  .poker-dock { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 12px 10px; }
  .poker-private { display: grid; grid-template-columns: 116px minmax(0, 1fr); text-align: left; column-gap: 12px; }
  .poker-private-label { grid-column: 2; margin: 4px 0 2px; font-size: 8px; }
  .poker-hand { grid-column: 1; grid-row: 1 / 4; padding: 0; }
  .poker-hand .poker-card { flex-basis: 52px; width: 52px; }
  .poker-private p { margin: 0 0 3px; font-size: 14px; }
  .poker-private small { font-size: 11px; }
  .poker-turn { font-size: 16px; }
  .poker-turn-help { font-size: 11px; }
  .poker-sizing { grid-template-columns: minmax(0, 1fr) 112px; gap: 6px; }
  #poker .poker-presets button { font-size: 10px; }
  .poker-amount { font-size: 9px; gap: 4px; }
  .poker-actions { gap: 5px; }
  #poker .poker-actions button { font-size: 12px; min-height: 53px; padding: 7px 3px; }
  .poker-result { font-size: 10px; padding: 3px 6px; margin-top: 4px; }
}
@media (max-width: 400px) { .poker-dealer span { display: none; } .poker-seat { width: 59px; } .poker-table-head h3 { font-size: 22px; } }
@media (min-width: 721px) and (max-height: 780px) { .poker-focus { inset-block: 65px 6px; padding-top: 12px; } .poker-arena { height: 330px; } .poker-dealer { --bust: 32px; --face: 40px; } .poker-card { flex-basis: 52px; width: 52px; } .poker-pot { margin: 2px 0 0; } }
@media (prefers-reduced-motion: reduce) { .poker-card, .poker-dealer[data-dealing] :is(.poker-dealer-face, svg), .poker-seat-emote { animation: none; } .poker-dealer[data-dealing]::after { display: none; } }

/* The panel's selects. */
#poker select { color: var(--pk-text); background: var(--pk-deep); border: 1px solid var(--pk-line); border-radius: var(--ui-r-btn); padding: 7px 9px; min-height: 44px; min-width: 0; font: inherit; }
#poker select:focus-visible { outline: 3px solid var(--pk-accent); outline-offset: 2px; }
@media (max-width: 720px), (pointer: coarse) and (max-width: 960px) and (max-height: 520px) {
  /* On a phone the table fills the screen and legibility wins: the backdrop stays solid, and the surfaces on it keep
     the phone's old padding and rules so the fitted layout holds. */
  .poker-focus { background: var(--pk-deepGlass); }
  .poker-table-head { padding: 0; }
  .poker-status-strip { padding-inline: 0; border-width: 1px 0; border-radius: 0; }
  .poker-rail { padding: 16px 0 0; border-width: 1px 0 0; border-radius: 0; }
}
.poker-fairness p { color: var(--pk-muted); font-size: 11px; line-height: 1.6; }
.poker-fairness { border-top: 1px solid var(--pk-line); padding-top: 12px; margin-top: 12px; }
.poker-fairness summary { color: var(--pk-accent); cursor: pointer; }
.poker-fairness label { display: grid; gap: 6px; margin-top: 10px; }
.poker-fairness input { max-width: 100%; }
.poker-proof-root { overflow-wrap: anywhere; font-family: monospace; }

/* Station metadata and invoices stay within the mobile TV glass. */
#dsb-tv, #dsb-tv * { box-sizing: border-box; }
.dsb-tv-columns > *, .dsb-tv-glass { min-width: 0; }
#dsb-tv-wallet { overflow-wrap: anywhere; }
#dsb-tv header { position: sticky; top: -20px; z-index: 1; background: #392739; padding: 8px 0; }
@media (max-width: 600px) { #dsb-tv header { top: -10px; } }

/* The Studio's gameplay tools (tomato) stand at the right edge. */
.dsb-studio-tools { position: fixed; right: 16px; top: 150px; z-index: 15; display: flex; flex-direction: column; gap: 7px; }
.dsb-studio-tools[hidden] { display: none; }
.dsb-studio-tools button { min-height: 42px; background: #352a33; border: 1px solid #d5aa69; border-radius: 6px; color: #ffdfad; padding: 8px 12px; font: 12px system-ui; white-space: nowrap; }
@media (max-width: 600px) { .dsb-studio-tools { top: 170px; right: 10px; } }

/* Equip expands the mobile HUD onto a second row: keep its fire target stable between taps. */
.dsb-studio-active .weapon-hud { transition: background .15s ease; touch-action: manipulation; }

/* Maxis: the same stable fire target while seated in the club. */
.maxis-club-active .weapon-hud { transition: background .15s ease; touch-action: manipulation; }

/* Without Rulers owns one local catalog panel; all rules stay scoped to the shop. */
.rulers-catalog, .rulers-catalog * { box-sizing: border-box; }
.rulers-catalog { position: fixed; z-index: 56; right: 18px; top: 8dvh; width: min(850px, 94vw); max-height: 84dvh; display: flex; flex-direction: column; color: #eae4d6; background: #191c1e; border: 1px solid #a17547; border-radius: 7px; box-shadow: 0 20px 60px #000b; font: 14px/1.45 system-ui,sans-serif; }
.rulers-catalog[hidden], .rulers-catalog [hidden], .rulers-tools[hidden] { display: none !important; }
.rulers-catalog header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 3px solid #e89033; }
.rulers-catalog h2 { font: bold 23px/1.15 monospace; margin: 0; letter-spacing: -.025em; }
.rulers-catalog h2 span, .rulers-price { color: #ffb95d; }
.rulers-eyebrow { margin: 0 0 4px; color: #bcad96; font-size: 10px; letter-spacing: .18em; }
.rulers-catalog button, .rulers-catalog input, .rulers-catalog a, .rulers-tools button { min-height: 44px; font: inherit; }
.rulers-catalog button, .rulers-tools button { color: #f0e8da; background: #303435; border: 1px solid #606160; border-radius: 4px; padding: 8px 11px; cursor: pointer; }
.rulers-catalog button:hover, .rulers-catalog button[aria-pressed="true"] { background: #a95820; color: #fff8ec; border-color: #f6b763; }
.rulers-catalog :focus-visible, .rulers-tools :focus-visible { outline: 2px solid #ffb65a; outline-offset: 3px; }
.rulers-privacy { font-size: 12px; padding: 10px 18px; margin: 0; color: #d7c9b2; background: #242728; }
.rulers-catalog nav { display: flex; gap: 6px; padding: 10px 14px; flex-wrap: wrap; border-bottom: 1px solid #414039; }
.rulers-catalog nav button { font-size: 12px; }
.rulers-browse { padding: 14px 18px; overflow: auto; min-height: 0; overscroll-behavior: contain; }
.rulers-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.rulers-heading { margin: 0; font-size: 17px; }
.rulers-search { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; font-size: 12px; }
.rulers-search input { flex: 1; min-width: 0; background: #101516; color: #fff5e6; border: 1px solid #646563; border-radius: 4px; padding: 8px 10px; }
.rulers-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.rulers-card, .rulers-collection { background: #24292b; border: 1px solid #464943; border-radius: 4px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.rulers-catalog img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; border-radius: 3px; background: #eee9df; }
.rulers-catalog article h3 { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.rulers-catalog article p { margin: 0; font-size: 12px; }
.rulers-card button { margin-top: auto; }
.rulers-catalog a { color: #ffc074; display: inline-flex; align-items: center; gap: 4px; overflow-wrap: anywhere; }
.rulers-catalog a:hover { color: #fff; }
.rulers-themes { grid-column: 1/-1; display: flex; gap: 7px; flex-wrap: wrap; }
.rulers-themes button { font-size: 12px; }
.rulers-detail { grid-column: 1/-1; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.rulers-detail h3 { font-size: 19px !important; }
.rulers-detail p { margin: 12px 0 !important; }
.rulers-about { grid-column: 1/-1; padding: 16px; }
.rulers-about p { margin: 12px 0 !important; }
.rulers-catalog footer { padding: 8px 18px; border-top: 1px solid #535044; background: #212526; }
.rulers-catalog footer p { margin: 0; font-size: 11px; color: #c5baa7; }
.rulers-catalog footer a { font-size: 12px; }
.rulers-tools { position: fixed; z-index: 22; bottom: 92px; right: 14px; }
.rulers-tools button { background: #34271c; border-color: #b78342; color: #ffe3b4; }
@media (max-width: 600px) {
  .rulers-catalog { top: 4dvh; right: 3vw; max-height: 90dvh; font-size: 12px; }
  .rulers-catalog header { padding: 10px; gap: 6px; }
  .rulers-catalog h2 { font-size: 17px; }
  .rulers-catalog header button { max-width: 100px; font-size: 12px; }
  .rulers-catalog nav { gap: 4px; padding: 7px; }
  .rulers-catalog nav button { flex: 1 0 21%; font-size: 11px; padding: 5px; }
  .rulers-privacy, .rulers-browse, .rulers-catalog footer { padding: 8px 10px; }
  .rulers-heading { font-size: 14px; }
  .rulers-results { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .rulers-search { display: block; }
  .rulers-search input { width: 100%; margin-top: 4px; }
  .rulers-card, .rulers-collection { padding: 7px; }
  .rulers-detail { grid-template-columns: minmax(0,1fr); }
  .rulers-detail img { max-width: 240px; justify-self: center; }
}

/* BIG BITCOIN: browse-only information terminal, scoped to this headquarters. */
.big-terminal { position: fixed; z-index: 45; inset: 7dvh 5vw auto auto; width: min(860px,90vw); max-height: 86dvh; display: flex; flex-direction: column; background: #17171b; color: #e6dcc5; border: 1px solid #a18a5c; box-shadow: 0 20px 80px #000c; font-family: system-ui,sans-serif; }
.big-terminal[hidden] { display: none; }
.big-terminal header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px; border-bottom: 3px solid #a92825; background: #242126; }
.big-terminal h2 { margin: 4px 0 0; font-size: 32px; letter-spacing: .035em; color: #f04b35; }
.big-eyebrow { color: #c8ad76; font-size: 10px; letter-spacing: .13em; text-transform: uppercase; margin: 0; }
.big-terminal button { min-height: 44px; border: 1px solid #8a754f; background: #302a2c; color: #f0e2c4; padding: 8px 12px; cursor: pointer; }
.big-terminal button:hover, .big-terminal button[aria-pressed="true"] { background: #79252a; border-color: #d8b875; }
.big-terminal :focus-visible { outline: 2px solid #edc878; outline-offset: 3px; }
.big-privacy { padding: 10px 20px; margin: 0; font-size: 12px; line-height: 1.5; background: #302729; }
.big-terminal nav { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 20px; border-bottom: 1px solid #5e503c; }
.big-terminal nav button { flex: 1; font-size: 12px; }
.big-results { min-height: 0; overflow: auto; overscroll-behavior: contain; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; padding: 20px; }
.big-results article { display: flex; flex-direction: column; gap: 12px; background: #28252a; border: 1px solid #63563e; border-top: 3px solid #9e2928; padding: 18px; }
.big-results h3 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.big-results p { margin: 0; font-size: 13px; line-height: 1.6; }
.big-results .big-eyebrow { font-size: 10px; }
.big-results a { color: #efc97b; font-size: 13px; margin-top: auto; padding-top: 6px; }
.big-terminal footer { font-size: 11px; line-height: 1.5; color: #b8aa91; border-top: 1px solid #5e503c; padding: 12px 20px; }
.dsb-context.big-context { border-color: #b59964; background: #4d2429; color: #f2ddb4; }
@media (pointer: coarse), (max-width: 720px) {
  .dsb-context.big-context { position: fixed; left: var(--big-action-x,50%); top: var(--big-action-y,65%); bottom: auto; transform: translate(-50%,-100%); width: var(--big-action-width,140px); max-width: none; box-sizing: border-box; min-height: 44px; padding: 8px 6px; font-size: 11px; line-height: 1.35; white-space: normal; }
}
@media (max-width: 600px), (max-height: 500px) {
  .big-terminal { inset: 2dvh 3vw auto auto; width: 94vw; max-height: 96dvh; }
  .big-terminal header, .big-terminal nav, .big-results { padding: 10px; }
  .big-terminal h2 { font-size: 23px; }
  .big-terminal header button { max-width: 100px; font-size: 11px; }
  .big-terminal nav button { padding: 6px; font-size: 11px; }
  .big-terminal footer, .big-privacy { padding: 8px 10px; font-size: 10px; }
  .big-results { gap: 9px; }
  .big-results article { padding: 12px; }
  .big-results h3 { font-size: 15px; }
}
@media (max-width: 430px) { .big-results { grid-template-columns: 1fr; } }

/* Proof of Ink: workshop catalog, isolated from the existing showrooms. */
.ink-catalog { position: fixed; z-index: 45; top: 6dvh; right: 4vw; width: min(880px,92vw); max-height: 86dvh; display: flex; flex-direction: column; background: #191e20; color: #efe2cb; border: 1px solid #ad7945; border-radius: 5px; box-shadow: 0 18px 70px #000b; font-family: system-ui,sans-serif; }
.ink-catalog[hidden], .ink-tools[hidden] { display: none; }
.ink-catalog header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; background: #262927; border-bottom: 3px solid #cc7e36; }
.ink-catalog h2 { font-size: 25px; letter-spacing: .025em; margin: 4px 0; }
.ink-catalog h2 span { color: #ed913d; }
.ink-eyebrow { font-size: 10px !important; letter-spacing: .13em; color: #d6a366; margin: 0; }
.ink-catalog button { cursor: pointer; border: 1px solid #656355; border-radius: 3px; color: #efe2cb; background: #303534; padding: 8px 12px; min-height: 38px; }
.ink-catalog button:hover, .ink-catalog button[aria-pressed="true"] { background: #a86128; color: #fff5e5; border-color: #f2b571; }
.ink-catalog :focus-visible, .ink-tools :focus-visible { outline: 2px solid #ffc176; outline-offset: 3px; }
.ink-privacy { padding: 9px 20px; margin: 0; font-size: 12px; background: #36382f; color: #e0d5bd; }
.ink-catalog nav, .ink-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 18px; }
.ink-catalog nav { border-bottom: 1px solid #535346; }
.ink-catalog nav button { font-size: 12px; }
.ink-browse { overflow: auto; overscroll-behavior: contain; min-height: 0; padding: 16px 20px; }
.ink-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ink-heading { font-size: 18px; margin: 0; }
.ink-search { display: flex; align-items: center; gap: 15px; font-size: 12px; }
.ink-search input { min-width: 0; flex: 1; padding: 9px 12px; color: #fff3e0; background: #101719; border: 1px solid #686e67; border-radius: 3px; }
.ink-filters { padding: 10px 0; }
.ink-filters button { font-size: 12px; }
.ink-results { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.ink-card { display: flex; flex-direction: column; gap: 9px; padding: 11px; background: #2a302f; border: 1px solid #51574e; border-top: 3px solid #ac7745; border-radius: 3px; }
.ink-catalog img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; background: #eee9e1; border-radius: 2px; }
.ink-catalog article h3 { font-size: 14px; margin: 0; overflow-wrap: anywhere; }
.ink-catalog article p { font-size: 12px; margin: 0; line-height: 1.5; }
.ink-card button { margin-top: auto; }
.ink-price { color: #f1bf83; }
.ink-catalog a { color: #ffc17c; display: inline-block; font-size: 12px; overflow-wrap: anywhere; }
.ink-catalog a:hover { color: #fff; }
.ink-process { aspect-ratio: 1; display: grid; place-items: center; padding: 20px; text-align: center; background: repeating-linear-gradient(135deg,#343d3b,#343d3b 12px,#2c3332 12px,#2c3332 24px); color: #eeb171; font-size: 25px; font-weight: 800; }
.ink-about, .ink-empty { grid-column: 1/-1; padding: 15px; }
.ink-about p, .ink-about a { margin: 12px 12px 0 0 !important; }
.ink-detail { grid-column: 1/-1; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ink-detail h3 { font-size: 21px !important; }
.ink-detail p, .ink-detail a { margin: 15px 0 !important; }
.ink-detail a { padding: 12px; background: #a96125; color: #fff5e5; border-radius: 3px; }
.ink-catalog footer { border-top: 1px solid #53584e; padding: 9px 20px; background: #242b2a; }
.ink-status { font-size: 11px; color: #c5bea8; margin: 0 0 4px; }
.ink-tools { position: fixed; right: 14px; bottom: 92px; z-index: 22; }
.ink-tools button { background: #3b3025; color: #ffdeb0; border-color: #c79453; }
@media (pointer: coarse), (max-width: 720px) {
  .ink-tools, .dsb-context.ink-context-browse {
    position: fixed; left: var(--ink-action-x, 50%); top: var(--ink-action-y, 65%);
    right: auto; bottom: auto; transform: translate(-50%, -100%);
    width: var(--ink-action-width, 140px); max-width: none;
  }
  .ink-tools button, .dsb-context.ink-context-browse {
    box-sizing: border-box; width: var(--ink-action-width, 140px);
    min-height: 44px; padding: 8px 6px; font-size: 11px; line-height: 1.35;
    white-space: normal; overflow-wrap: break-word;
  }
}

@media (max-width: 600px) {
  .ink-catalog { top: 4dvh; right: 3vw; max-height: 91dvh; width: 94vw; }
  .ink-catalog header, .ink-browse, .ink-catalog footer { padding: 10px; }
  .ink-catalog h2 { font-size: 19px; }
  .ink-catalog header button { max-width: 104px; font-size: 11px; }
  .ink-privacy { padding: 8px 10px; font-size: 11px; }
  .ink-catalog nav { padding: 7px; gap: 4px; }
  .ink-catalog nav button { flex: 1 0 27%; font-size: 11px; padding: 6px; }
  .ink-search { display: block; }
  .ink-search input { width: 100%; box-sizing: border-box; margin-top: 5px; }
  .ink-results { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .ink-card { padding: 7px; }
  .ink-card h3 { font-size: 12px !important; }
  .ink-detail { grid-template-columns: 1fr; }
  .ink-detail img { max-width: 240px; justify-self: center; }
}

/* All full venue interfaces share one safe, visual-viewport-centred shell. */
.dsb-menu-shade { position: fixed; inset: 0; z-index: 990; background: #060b12b8; }
:is(#dsb-tv,.dsb-menu-shell).dsb-menu-engaged:not(.maxis-fullscreen):not(:fullscreen) {
  --menu-edge: max(12px,env(safe-area-inset-top),env(safe-area-inset-bottom),env(safe-area-inset-left),env(safe-area-inset-right));
  position: fixed; z-index: 1000; left: var(--menu-x,50vw); top: var(--menu-y,50dvh); right: auto; bottom: auto;
  transform: translate(-50%,-50%); margin: 0; box-sizing: border-box;
  width: min(var(--menu-width,900px),calc(var(--menu-w,100vw) - 2 * var(--menu-edge)));
  height: auto; max-width: none; max-height: calc(var(--menu-h,100dvh) - 2 * var(--menu-edge));
  display: block; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable;
  padding: 0; font: var(--menu-font,14px/1.5 system-ui,sans-serif);
}
.dsb-menu-engaged::backdrop { background: #060b1280; }
.dsb-menu-engaged > header { position: sticky; top: 0; z-index: 2; margin: 0; padding: 14px 18px; }
.dsb-menu-engaged header h2 { white-space: normal; overflow-wrap: anywhere; }
.dsb-menu-engaged button { min-height: 44px; white-space: normal; }
.dsb-menu-engaged input:not([type="range"]),.dsb-menu-engaged select { font-size: 16px; }
.dsb-menu-engaged :is(.rulers-browse,.ink-browse,.big-results,.dsb-tv-glass) { max-height: none; overflow: visible; }
.dsb-menu-engaged :is(.rulers-results,.ink-results,.big-results) { min-width: 0; }
.dsb-menu-engaged :is(nav button,.rulers-themes button,.ink-filters button) { font-size: 14px; }
.dsb-menu-engaged :is(.rulers-card p,.ink-card p,.big-results p) { font-size: 14px; }
body.dsb-menu-open :is(.bottom-hud,.top-hud,#joy-move,#joy-look,#act,.weapon-hud,.dsb-context,.dsb-studio-tools,.rulers-tools,.ink-tools,.world-block,.world-clock) { visibility: hidden !important; pointer-events: none !important; }
.dsb-tv-routes { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px; }
.dsb-tv-routes button { flex: 1; min-height: 44px; }
#dsb-tv.dsb-menu-engaged .dsb-tv-glass { margin: 0 16px 16px; }
#dsb-tv.dsb-menu-engaged header { top: 0; padding: 14px 18px; }
.meme-menu { color: #eee4ce; background: #191f26; border: 1px solid #b27f49; border-radius: 8px; }
.meme-menu header { display: flex; justify-content: space-between; align-items: center; gap: 18px; background: #27292a; border-bottom: 3px solid #ce5238; }
.meme-menu h2 { font-size: clamp(19px,3vw,29px); margin: 4px 0; }
.meme-menu small { color: #d7a260; letter-spacing: .14em; }
.meme-menu nav { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 18px; border-bottom: 1px solid #56616a; }
.meme-menu button { color: #f5e8d0; background: #313c47; border: 1px solid #778491; border-radius: 4px; padding: 9px 12px; font: inherit; cursor: pointer; }
.meme-menu button:hover,.meme-menu button[aria-pressed="true"] { border-color: #f1b866; background: #6a302d; }
.meme-menu :focus-visible { outline: 3px solid #f8c77b; outline-offset: 2px; }
.meme-content { padding: 18px; font-size: 16px; }
.meme-content h3 { font-size: 26px; margin: 0 0 16px; overflow-wrap: anywhere; }
.meme-menu a { color: #f7c482; display: inline-block; padding: 10px 0; overflow-wrap: anywhere; }
.meme-statement { font-size: 27px; margin: 0 0 12px; }
.meme-gallery { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-top: 20px; }
.meme-gallery figure { margin: 0; }
.meme-gallery img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; display: block; border-radius: 3px; }
.meme-profile { display: grid; gap: 10px; text-align: left; }
.meme-profile span { overflow-wrap: anywhere; }
.meme-person img { float: left; margin: 0 24px 24px 0; border: 1px solid #b9915d; }
.meme-person { display: flow-root; }
.meme-destinations { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 16px; }
@media (max-width:600px) {
  .meme-menu header { gap: 10px; padding: 12px; }
  .meme-menu header button { max-width: 110px; }
  .meme-menu nav { padding: 10px; gap: 5px; }
  .meme-menu nav button { flex: 1 0 40%; }
  .meme-gallery { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .meme-content { padding: 14px; }
  .meme-statement { font-size: 22px; }
  .meme-person img { float: none; }
  .dsb-menu-engaged > header { gap: 10px; padding: 12px; }
  .dsb-menu-engaged header > button { flex-shrink: 0; }
  .dsb-tv-routes { padding: 8px; gap: 5px; }
}
@media (pointer:coarse),(max-width:720px) {
  .dsb-active .dsb-context:not(.big-context):not(.ink-context-browse) { position: fixed; left: 50%; top: auto; bottom: max(145px,calc(env(safe-area-inset-bottom) + 132px)); transform: translateX(-50%); max-width: 180px; min-height: 44px; padding: 8px; white-space: normal; }
}

/* Short desktop windows still need a clear click path to the carried Ooga. */
@media (pointer:fine) and (max-height:520px) {
  .dsb-active .dsb-context:not(.big-context):not(.ink-context-browse) { bottom: 15vh; }
}

/* Stackchain's publication styling uses the existing shared viewport/focus shell. */
.stackchain-menu { color: #eee2c9; background: #20272b; border: 1px solid #b08b52; border-radius: 8px; }
.stackchain-menu header { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: #282a29; border-bottom: 3px solid #a68149; }
.stackchain-menu h2 { font-size: clamp(18px,3vw,28px); margin: 4px 0; }
.stackchain-menu header small { color: #d1b27e; letter-spacing: .12em; }
.stackchain-menu nav { display: flex; flex-wrap: wrap; gap: 7px; padding: 12px 18px; border-bottom: 1px solid #635845; }
.stackchain-menu button { color: #f1e7d0; background: #303a40; border: 1px solid #8b816d; border-radius: 4px; font: inherit; padding: 8px 12px; cursor: pointer; }
.stackchain-menu button:hover,.stackchain-menu button[aria-pressed="true"] { background: #634f36; border-color: #e9be79; }
.stackchain-menu :focus-visible { outline: 3px solid #f5c57b; outline-offset: 2px; }
.stackchain-content { padding: 18px; font-size: 16px; }
.stackchain-content h3 { margin: 0 0 10px; font-size: 25px; overflow-wrap: anywhere; }
.stackchain-menu a { display: inline-block; color: #f1c98a; padding: 12px 0; overflow-wrap: anywhere; }
.stackchain-motto { color: #e0bf85; font-size: 22px; letter-spacing: .1em; }
.stackchain-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin: 18px 0; }
.stackchain-card { padding: 12px; border: 1px solid #72634b; border-radius: 4px; background: #292f31; min-width: 0; }
.stackchain-card h3 { font-size: 18px; line-height: 1.35; margin-top: 12px; }
.stackchain-card img { width: 100%; height: auto; aspect-ratio: 1.5; object-fit: cover; display: block; }
.stackchain-product img { aspect-ratio: .85; object-fit: contain; background: #171e22; }
.stackchain-meta,.stackchain-stamp { color: #c6bca7; font-size: 13px; }
.stackchain-stamp { display: block; margin-top: 18px; }
.stackchain-price { color: #f5d398; }
.stackchain-count { grid-column: 1 / -1; margin: 0; }
.stackchain-content label { display: grid; gap: 8px; }
.stackchain-content input { box-sizing: border-box; width: 100%; padding: 12px; color: #f4e8d2; background: #151f25; border: 1px solid #a48960; border-radius: 4px; }
@media (max-width:600px) {
  .stackchain-menu header button { max-width: 106px; }
  .stackchain-menu nav { padding: 10px; gap: 5px; }
  .stackchain-menu nav button { flex: 1 0 42%; }
  .stackchain-content { padding: 14px; }
  .stackchain-grid { grid-template-columns: 1fr; gap: 12px; }
  .stackchain-card img { max-height: 235px; object-fit: contain; }
}

/* SVRN's restrained boutique palette; layout and focus stay in the shared DSB shell. */
.svrn-menu { color: #eee2cb; background: #242321; border: 1px solid #a6804e; border-radius: 6px; }
.svrn-menu header { display: flex; justify-content: space-between; align-items: center; gap: 16px; background: #292521; border-bottom: 2px solid #b47135; }
.svrn-menu h2 { font-size: clamp(20px,3vw,30px); margin: 3px 0; letter-spacing: .08em; }
.svrn-menu small { color: #c5aa80; }
.svrn-menu nav { display: flex; flex-wrap: wrap; gap: 7px; padding: 14px 18px; border-bottom: 1px solid #5a4d3d; }
.svrn-menu button { font: inherit; color: #f2e7d3; background: #38332c; border: 1px solid #847155; border-radius: 3px; padding: 8px 12px; cursor: pointer; }
.svrn-menu button:hover,.svrn-menu button[aria-pressed="true"] { background: #62503a; border-color: #e2b77a; }
.svrn-menu :focus-visible { outline: 3px solid #efc183; outline-offset: 2px; }
.svrn-content { padding: 20px; font-size: 16px; }
.svrn-content h3 { margin: 0 0 12px; overflow-wrap: anywhere; }
.svrn-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin: 20px 0; }
.svrn-card { background: #2e2a25; border: 1px solid #635440; padding: 16px; min-width: 0; }
.svrn-card h3 { font-size: 19px; margin-top: 12px; }
.svrn-menu a { display: inline-block; color: #edc58c; padding: 12px 0; overflow-wrap: anywhere; }
.svrn-note { display: block; font-size: 13px; color: #c3b5a0; margin-top: 18px; }
@media (max-width:600px) {
  .svrn-menu header button { max-width: 110px; }
  .svrn-menu nav button { flex: 1 0 42%; }
  .svrn-grid { grid-template-columns: 1fr; }
  .svrn-content { padding: 14px; }
}

/* Adoption uses the island sheet's materials and controls; the DSB shell keeps focus and viewport placement. */
.rescue-menu {
  --menu-width: 440px;
  --menu-font: 13px/1.4 var(--mono);
  border-radius: var(--radius);
  color: var(--paper);
}
.rescue-menu:not([open]) { display: none; }
.rescue-menu .panel-title h2 { min-width: 0; }
.rescue-menu .panel-title .sign { max-width: 100%; }
.rescue-menu .panel-title .foot-button { flex: none; }
.rescue-adoption { padding: 12px; }
.rescue-adoption > .help:first-child { margin-top: 0; }
.rescue-breeds { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-top: 14px; }
.rescue-breed { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-width: 0; padding: 12px 4px; }
.rescue-breed canvas { display: block; width: 40px; height: 40px; image-rendering: pixelated; }
.rescue-breed[aria-pressed="true"] { border-color: var(--accent-text); background: linear-gradient(#e2a04a,var(--accent)); color: var(--ink); text-shadow: none; }
.rescue-breed[aria-pressed="true"] span { text-decoration: underline; text-underline-offset: 3px; }
.rescue-menu .field { margin-top: 16px; }
.rescue-menu .field input { font-size: 13px; }
.rescue-note:empty { display: none; }
@media (max-width:380px) {
  .rescue-breeds { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (pointer:coarse) {
  .rescue-menu .field input { min-height: 44px; font-size: 16px; }
}

/* The island panel's frame, slab and controls, painted in the wallet shop's red and white. */
.wallets-menu {
  --menu-width: 560px;
  --menu-font: 13px/1.4 var(--mono);
  --paper: #fff4ef;
  --ink: #4b1b17;
  --wood-edge: #75231e;
  --nail: #471814;
  --accent: #bb3027;
  --accent-text: #fff4ef;
  --stone-dk: #c7b0a4;
  --tablet: linear-gradient(160deg,#fffaf4,#eee2d8 55%,#dcc9bd);
  color: var(--paper);
  background: linear-gradient(#cf3b30e0,#a52b24e0),var(--planks);
  border-radius: var(--radius);
}
.wallets-menu:not([open]) { display: none; }
.wallets-menu .panel-title h2 { min-width: 0; }
.wallets-menu .panel-title .sign { max-width: 100%; }
.wallets-menu .panel-title .foot-button { flex: none; }
.wallets-menu .help { color: var(--paper); }
.wallets-menu .foot-button { color: var(--ink); background: linear-gradient(#fffaf4,#e8d8ce); text-shadow: none; }
.wallets-menu .foot-button:hover,.wallets-menu .foot-button:focus-visible { background: linear-gradient(#fff,#f3e7df); }
.wallets-menu .foot-button:focus-visible { box-shadow: 0 2px 0 var(--nail),0 0 0 2px var(--paper); }
.wallets-content { display: flex; flex-direction: column; gap: 12px; }
.wallets-picks { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; padding: 12px; }
.wallets-pick { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-width: 0; padding: 16px 8px; }
.wallets-pick canvas { max-width: 100%; width: auto; height: 64px; object-fit: contain; image-rendering: pixelated; }
.wallets-pick b { font-size: 11px; max-width: 100%; overflow-wrap: anywhere; }
.wallets-menu .wallets-pick[aria-pressed="true"] { color: var(--paper); background: linear-gradient(#d6493b,var(--accent)); border-color: var(--wood-edge); }
.wallets-pick[aria-pressed="true"] b { text-decoration: underline; text-underline-offset: 3px; }
.wallets-menu .wallets-take { color: var(--paper); background: linear-gradient(#d6493b,var(--accent)); }
.wallets-menu .wallets-take:hover,.wallets-menu .wallets-take:focus-visible { background: linear-gradient(#e25748,#c8352a); }
@media (pointer:coarse) { .wallets-menu .foot-button { min-height: 44px; } }
@media (max-width: 520px) { .wallets-picks { grid-template-columns: repeat(2,minmax(0,1fr)); } }
/* The line over the view while a device is carried, with the Throw button beside it. */
.wallet-carry { position: fixed; left: 50%; top: calc(64px + var(--safe-top)); transform: translateX(-50%); z-index: 15; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 8px; max-width: calc(100vw - 32px); margin: 0; padding: 6px 8px 6px 12px; color: #fff4df; background: #2a1d17e6; border: 2px solid #f2c14e; border-radius: 6px; font: 12px system-ui; letter-spacing: .03em; text-align: center; }
.wallet-carry[hidden] { display: none; }
.wallet-throw { min-height: 36px; padding: 0 14px; color: #2a1d17; background: linear-gradient(#ffcf6b,#e2a04a); border: 2px solid #8a5a32; border-radius: 6px; font: 600 12px system-ui; letter-spacing: .06em; cursor: pointer; }
.wallet-throw:hover { background: linear-gradient(#ffd98a,#f0b05a); }
/* On touch screens the top holds the scene's buttons: the line sits over the act button, between the sticks. */
@media (pointer: coarse) { .wallet-carry { top: auto; bottom: calc(172px + var(--safe-bottom)); max-width: min(420px, calc(100vw - 32px)); } }

.studio-session { width:min(42rem,calc(100vw - 2rem)); max-height:85vh; overflow:auto; background:#211b25; color:var(--fg); border:1px solid #aa8054; border-radius:.75rem; padding:1.2rem; }
.studio-session::backdrop { background:rgba(0,0,0,.65); }
.studio-session header,.studio-controls { display:flex; align-items:center; justify-content:space-between; gap:.6rem; flex-wrap:wrap; }
.studio-session video { display:block; width:100%; aspect-ratio:2/1; background:#080809; }
.studio-session button,.studio-session select { padding:.55rem .7rem; margin:.2rem; }
.studio-session label { display:block; margin:.65rem 0; }
.studio-session input[type=range] { width:100%; }
.studio-session [data-error] { color:#ffc878; }
.studio-session details { margin:.8rem 0; padding:.65rem; border:1px solid var(--border); border-radius:.4rem; }
.studio-session summary { cursor:pointer; }
.studio-session meter { display:block; width:100%; height:1rem; }
.studio-session [data-audio],.studio-session [data-mic-reason],.studio-session [data-playback] { font-size:.9rem; }
.studio-session [data-transcript] { line-height:1.5; }
.studio-session select { max-width:100%; }


/* Block Frenzy: the side picker's two forts, the score chips in their team colours, and the blocks' states. */
.block-sides {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.block-side {
  flex: 1 1 120px;
  min-height: 44px;
  border: 3px solid var(--wood-edge);
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
}

.block-target {
  flex: 1 1 44px;
  background: #5a3a22;
}

.block-target[data-map] { flex-basis: max-content; white-space: nowrap; }

.block-side[data-team="blue"] {
  background: #1d4fa8;
}

.block-side[data-team="red"] {
  background: #a8261d;
}

.block-side[aria-pressed="false"] {
  opacity: 0.55;
}

.block-side[aria-pressed="true"] {
  box-shadow: 0 0 0 3px #f7931a;
}

.block-score[data-team="blue"] b {
  color: #9cc8ff;
}

.block-score[data-team="red"] b {
  color: #ffb0a6;
}

.block-state b {
  font-size: 14px;
  text-transform: uppercase;
}

.block-state b[data-state="carried"] {
  color: #f7931a;
}

.block-state b[data-state="dropped"] {
  color: #ffd27a;
}

/* The quiz trap's card: the question, four answers in a grid (one column on a phone), and the bubble's time left. */
.block-quiz {
  border-color: #3dff7a;
  box-shadow: 0 0 0 3px rgba(61, 255, 122, 0.35), 0 12px 40px rgba(0, 0, 0, 0.5);
}

.block-quiz-q {
  font-size: 17px;
  line-height: 1.3;
  margin: 6px 0 12px;
}

.block-answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.block-answer {
  min-height: 44px;
  padding: 8px 10px;
  border: 2px solid var(--wood-edge);
  border-radius: 8px;
  background: #1c2a20;
  color: #eaffef;
  font: inherit;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.block-answer:hover:not(:disabled),
.block-answer:focus-visible {
  border-color: #3dff7a;
}

.block-answer[data-mark="right"] {
  background: #1f6b35;
  border-color: #3dff7a;
}

.block-answer[data-mark="wrong"] {
  background: #6b1f1f;
  border-color: #ff4a3a;
}

.block-answer:disabled {
  cursor: default;
}

.block-quiz-time {
  height: 6px;
  margin-top: 8px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.block-quiz-time span {
  display: block;
  height: 100%;
  width: 100%;
  background: #3dff7a;
}

@media (max-width: 560px) {
  .block-answers {
    grid-template-columns: 1fr;
  }
}

/* Block Frenzy's Ooga by name on the board (a narrow screen, where it isn't on show), and the touch paint button above the jump. */
.block-ooga {
  margin: 0;
  font-size: 16px;
  font-weight: bold;
  color: #f3e6cc;
}

.block-paint {
  bottom: calc(118px + var(--safe-bottom));
  background: linear-gradient(#ff7a6a, #d63a2a);
}

/* First person's crosshair: a small cross with a dot, centred on the view. */
.block-cross {
  position: absolute;
  z-index: 12;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  pointer-events: none;
  background:
    linear-gradient(#fff3d6, #fff3d6) center / 2px 22px no-repeat,
    linear-gradient(#fff3d6, #fff3d6) center / 22px 2px no-repeat;
  filter: drop-shadow(0 0 2px #000);
}

.block-cross::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f7931a;
}

/* Block Frenzy's weapons bar, bottom right; movable and minimizable, and the wind sign in the strip. */
.block-tools {
  position: absolute;
  z-index: 12;
  right: calc(12px + var(--safe-right, 0px));
  bottom: calc(14px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  max-width: calc(100% - 24px);
}

.block-tools button {
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  background: rgba(30, 20, 12, 0.82);
  color: #f3e6cc;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.block-bar-tabs {
  display: flex;
  gap: 4px;
}

.block-bar-tabs button {
  width: 26px;
  height: 22px;
  padding: 0;
  line-height: 1;
}

.block-bar-grip {
  cursor: move !important;
  touch-action: none;
}

.block-slots {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
  /* Room over the row for the chosen slot to grow into. */
  margin-top: 12px;
}

.block-slots button {
  position: relative;
  width: 48px;
  height: 48px;
  padding: 0;
  display: grid;
  place-items: center;
  transform-origin: 50% 100%;
  transition: transform 0.12s ease-out;
}

/* The weapon in hand stands larger than the rest: grown and lifted in place, so no other slot moves. */
.block-slots button[aria-pressed="true"] {
  z-index: 1;
  transform: translateY(-4px) scale(1.22);
  background: rgba(64, 42, 22, 0.96);
}

.block-slots kbd {
  position: absolute;
  top: 1px;
  left: 3px;
  font: inherit;
  font-size: 10px;
  opacity: 0.8;
}

/* The count: a fixed corner plate, so a changing number moves nothing. */
.block-slots b {
  position: absolute;
  right: 2px;
  bottom: 2px;
  min-width: 14px;
  padding: 0 2px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.6);
  font-size: 12px;
  font-weight: bold;
  line-height: 14px;
  text-align: center;
  color: #ffd27a;
}

.block-slots b:empty {
  display: none;
}

.block-slot-icon {
  width: 40px;
  height: 30px;
}

.block-icon-tp {
  fill: var(--block-team, #3a8dff);
}

.block-icon-td {
  fill: var(--block-team-deep, #1d4fa8);
}

.block-icon-tl {
  fill: var(--block-team-light, #9cc8ff);
}

/* Yours and out: the slot stays lit with a red 0. Not yours yet: dim and grey, a dashed edge, no count. */
.block-slots button[data-state="empty"]:disabled {
  opacity: 1;
}

.block-slots button[data-state="empty"] b {
  color: #ff6a5a;
}

.block-slots button[data-state="empty"] .block-slot-icon {
  opacity: 0.5;
}

.block-slots button[data-state="locked"] {
  border-style: dashed;
}

.block-slots button[data-state="locked"] .block-slot-icon {
  filter: grayscale(1);
}

.block-slots button[data-state="locked"] b {
  display: none;
}

/* The chosen weapon's name, standing over its slot (`data-at`, placed by the scene) for as long as it is chosen. */
.block-tool-name {
  position: absolute;
  right: 0;
  bottom: 100%;
  margin-bottom: 6px;
  padding: 2px 8px;
  border: 1px solid var(--wood-edge);
  border-radius: 6px;
  background: rgba(30, 20, 12, 0.9);
  color: #ffd27a;
  font-size: 13px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}

.block-tool-name[data-show="true"] {
  opacity: 1;
}

.block-tool-name[data-at="slot"] {
  right: auto;
  transform: translateX(-50%);
  transition: opacity 0.25s, left 0.15s ease-out;
}

@media (max-width: 480px) {
  .block-slots button {
    width: 44px;
    height: 44px;
  }

  .block-slot-icon {
    width: 36px;
    height: 27px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .block-slots button,
  .block-tool-name {
    transition: none;
  }

  .block-tool-name[data-at="slot"] {
    transition: none;
  }
}

.block-actions {
  display: flex;
  gap: 4px;
}

.block-actions button {
  min-height: 36px;
  padding: 2px 8px;
}

.block-actions kbd {
  margin-right: 4px;
  font: inherit;
  opacity: 0.6;
}

.block-actions b {
  margin-left: 4px;
  color: #ffd27a;
}

.block-tools button[aria-pressed="true"] {
  border-color: #f7931a;
  box-shadow: 0 0 0 2px rgba(247, 147, 26, 0.45);
}

.block-tools[data-min="true"] .block-slots,
.block-tools[data-min="true"] .block-actions {
  display: none;
}

.block-tool-crate {
  background: rgba(70, 44, 20, 0.88) !important;
}

@media (pointer: fine) {
  .block-actions {
    display: none;
  }
}

@media (pointer: coarse) {
  .block-tools kbd,
  .block-bar-grip {
    display: none;
  }

  .block-tools {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    align-items: center;
    bottom: calc(176px + var(--safe-bottom));
  }

  .block-slots {
    justify-content: center;
  }

}

/* Keep Throw above both sticks and Jump; the weapons bar starts above Throw. */
@media (pointer: coarse) and (max-width: 720px) {
  .block-paint { bottom: calc(max(48px, var(--stick-inset) - var(--home-chrome)) + var(--stick-size) + 8px + var(--safe-bottom)); }
  .block-tools { bottom: calc(max(48px, var(--stick-inset) - var(--home-chrome)) + var(--stick-size) + 60px + var(--safe-bottom)); }
}

/* Block Frenzy's sprint gauge in the strip. */
.block-sprint-bar {
  width: 64px;
  height: 8px;
  margin-top: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.block-sprint-bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: #7fe08a;
}

.block-sprint-bar i[data-tired="true"] {
  background: #f7931a;
}

.block-tools button:disabled {
  opacity: 0.45;
  cursor: default;
}

.block-tool-pass:not(:disabled) {
  border-color: #f7931a;
  background: rgba(120, 70, 10, 0.9);
}

/* Block Frenzy's mini-map, on the right below the strip, and the action feed on the left. */
.block-map {
  position: absolute;
  z-index: 11;
  right: calc(12px + var(--safe-right, 0px));
  top: 160px;
  width: 88px;
  height: 148px;
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  background: rgba(30, 20, 12, 0.72);
  pointer-events: none;
}

.block-feed {
  position: absolute;
  z-index: 11;
  left: calc(12px + var(--safe-left, 0px));
  top: 160px;
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: min(260px, 45vw);
  pointer-events: none;
}

.block-feed li {
  margin: 0 0 4px;
  padding: 3px 8px;
  border-radius: 5px;
  background: rgba(30, 20, 12, 0.72);
  color: #f3e6cc;
  font-size: 11px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.block-feed li:empty {
  display: none;
}

.block-feed li[data-team="blue"] {
  border-left: 3px solid #3a8dff;
}

.block-feed li[data-team="red"] {
  border-left: 3px solid #ff4a3a;
}

@media (max-width: 520px) {
  .block-map {
    top: 226px;
    width: 66px;
    height: 111px;
  }

  .block-feed li {
    font-size: 10px;
  }
}

/* Block Frenzy's live tally. The visitor's own five counts stand under the map through a round (beside it on a short
   screen, where the sticks are below). Everyone's, by side, show while Z is held or after a tap on the small panel:
   the results table's side panels over the ghost hunt's scoreboard rows (`.ghost-score`: a face in a circle, the
   leader's glowing green), here one Ooga a line with its name and counts. */
.block-tally {
  position: absolute;
  z-index: 11;
  right: calc(12px + var(--safe-right, 0px));
  top: 314px;
  box-sizing: border-box;
  min-width: 88px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1px 6px;
  padding: 4px 6px;
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  background: rgba(30, 20, 12, 0.72);
  color: #f3e6cc;
  font-size: 9px;
  line-height: 1.35;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  pointer-events: auto;
  cursor: pointer;
}

.block-tally b {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.block-tally-board {
  position: absolute;
  z-index: 13;
  left: 50%;
  top: calc(132px + var(--safe-top, 0px));
  transform: translateX(-50%);
  width: min(760px, calc(100% - 24px));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  color: var(--paper);
  pointer-events: auto;
}

.block-tally-board[hidden] {
  display: none;
}

.block-tally-board .ghost-scores {
  position: static;
  display: block;
  max-width: none;
  transform: none;
}

.block-tally-board .block-side-panel h3,
.block-tally-board .ghost-score {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) repeat(5, 6ch);
  align-items: center;
  gap: 4px;
}

.block-tally-board h3 span {
  grid-column: 1 / 3;
}

.block-tally-board .ghost-score canvas {
  width: 20px;
  height: 20px;
  padding: 1px;
  box-shadow: none;
}

.block-tally-board .ghost-score span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.block-tally-board .ghost-score b,
.block-tally-board .ghost-score i {
  grid-row: 1;
  color: var(--paper);
  font-size: 13px;
  font-style: normal;
  text-align: right;
  text-shadow: none;
  font-variant-numeric: tabular-nums;
}

/* Grabbed leads, then the blocks mined (the row's points). */
.block-tally-board .ghost-score i:nth-of-type(1) { grid-column: 3; }
.block-tally-board .ghost-score b { grid-column: 4; }
.block-tally-board .ghost-score i:nth-of-type(2) { grid-column: 5; }
.block-tally-board .ghost-score i:nth-of-type(3) { grid-column: 6; }
.block-tally-board .ghost-score i:nth-of-type(4) { grid-column: 7; }

.block-tally-board .ghost-score[data-lead] b {
  color: #8dffa6;
}

.block-tally-board .ghost-score[data-you] {
  background: rgba(245, 197, 66, 0.16);
  border-radius: 4px;
}

@media (max-width: 520px) {
  .block-tally {
    top: 343px;
    min-width: 66px;
    padding: 3px 4px;
    font-size: 8px;
    letter-spacing: 0;
  }

  .block-tally-board {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .block-tally-board .block-side-panel h3,
  .block-tally-board .ghost-score {
    grid-template-columns: 24px minmax(0, 1fr) repeat(5, 5ch);
    gap: 2px;
  }
}

@media (max-height: 480px) {
  .block-tally {
    top: 160px;
    right: calc(106px + var(--safe-right, 0px));
  }

  .block-tally-board {
    top: calc(64px + var(--safe-top, 0px));
  }
}

/* Short portrait phones need the tally below the sticks, not over the look pad. */
@media (pointer: coarse) and (max-width: 520px) and (min-height: 481px) and (max-height: 640px) {
  .block-tally {
    top: auto;
    bottom: calc(16px + var(--safe-bottom));
    left: calc(12px + var(--safe-left));
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: 44px;
    text-align: center;
    align-content: center;
  }
  .block-tally span { grid-row: 1; }
  .block-tally b { grid-row: 2; text-align: center; }
}

/* On a wide screen Block Frenzy's board sits on the left, leaving the right for the Ooga on show, with its name
   under it. */
@media (min-width: 760px) {
  #block-board {
    left: calc(20px + var(--safe-left, 0px));
    transform: translateY(-50%);
    width: min(560px, 54vw);
  }

  #block-board .garage-columns {
    grid-template-columns: 1fr 1fr;
  }
}

.block-preview-name {
  position: absolute;
  z-index: 11;
  right: 9vw;
  bottom: 9%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 14px 10px;
  border: 2px solid var(--wood-edge);
  border-radius: 8px;
  background: rgba(30, 20, 12, 0.82);
  color: #f3e6cc;
}

.block-preview-name b {
  font-size: 16px;
}

.block-preview-name span {
  font-size: 10px;
  opacity: 0.75;
}

#block-board[hidden] ~ .block-preview-name,
#block-board[hidden] ~ .block-weapon-card {
  display: none;
}

/* The board's weapons preview: its card up by the weapon turning over the Ooga on show. The Ooga stands a share of
   the view's height right of its middle, so on a view less wide for its height the card keeps further right, clear of
   the weapon (the scene also holds the weapon left of the card's edge). */
.block-weapon-card {
  position: absolute;
  z-index: 11;
  right: max(12px, min(9vw, calc(50vw - 46vh - 250px)));
  top: 14%;
  width: 250px;
  max-width: 28vw;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 14px 10px;
  border: 2px solid var(--wood-edge);
  border-radius: 8px;
  background: rgba(30, 20, 12, 0.82);
  color: #f3e6cc;
}

.block-weapon-card small {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.8;
}

.block-weapon-card b {
  font-size: 16px;
  color: #ffd27a;
}

/* Two lines held for the blurb, so the card keeps its height from weapon to weapon. */
.block-weapon-card p {
  margin: 0;
  min-height: 3.9em;
  font-size: 12px;
  line-height: 1.3;
}

.block-weapon-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.block-weapon-nav span {
  font-size: 11px;
  opacity: 0.75;
}

.block-weapon-nav button {
  min-width: 44px;
  min-height: 36px;
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  background: rgba(70, 44, 20, 0.88);
  color: #f3e6cc;
  font: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.block-weapon-nav button:focus-visible {
  outline: 2px solid #f7931a;
  outline-offset: 2px;
}

/* Block Frenzy's jetpack fuel, beside the sprint gauge, in flame orange. */
.block-jet .block-sprint-bar i {
  background: #ff8a2a;
}

/* Presets keep their scene actions but share the same title/controls/clock layout. */
body[data-active-scene] .topbar { align-items: start; }
body[data-active-scene] .topbar > .presets {
  /* No grid placement, so the topbar's padding box (the screen's edge) holds it, as hud.js measures. */
  grid-column: auto;
  grid-row: auto;
  position: absolute;
  top: var(--banner-presets-top, calc(62px + var(--safe-top)));
  left: var(--banner-presets-left, 16px);
  right: auto;
  width: max-content;
  max-width: var(--banner-presets-width, calc(100vw - 32px));
  flex-wrap: wrap;
  justify-content: flex-start;
}
body[data-active-scene] .topbar > .presets button { flex: 0 0 auto; }
/* The hangar's Sound opens its volume and vibration panel, so it stays. */
.topbar .presets :is([data-action="mute"], [data-action$="-mute"]):not([data-action="hangar-mute"]) { display: none; }
body[data-active-scene] #environment-sound { display: flex; align-items: center; justify-content: center; }

/* The character studio (scene-studio.js): the banner holds the title, the game's own equipment buttons and the controls
   button, and the studio's buttons run down the left side under it, one width, lit while switched on. The title reads
   OBL. The sound button is left out, and the clock and block height are kept out of sight but in place, since hud.js
   fits the banner's row up to the clock's edge. */
.studio-side {
  position: absolute;
  top: calc(var(--banner-controls-bottom, calc(68px + var(--safe-top))) + 6px);
  left: calc(12px + var(--safe-left));
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
}
.studio-side button { flex: 0 0 auto; padding: 0 10px; }
.studio-wardrobe { display: grid; gap: 7px; margin: 12px 0; }
/* The wardrobe follows the pop-ups' text standard (AGENTS.md, A pop-up or menu): its words stand on stone, never on the
   planks. The tiles and the open editor share one slab; a tile reads as its slot's name alone (12px, paper at 0.88), in
   the light accent when something other than the Ooga's own is worn there, and what is worn shows in its editor. The
   chosen tile is ringed in amber and a tile changed since the last save carries a dot. */
.studio-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 5px; background: var(--slab-dark);
  border: 2px solid var(--stone-dk); border-radius: 9px 7px 10px 8px; box-shadow: var(--tablet-shadow); }
.studio-wardrobe .studio-tile { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 44px; box-sizing: border-box; padding: 6px 7px; border: 1px solid rgba(243, 239, 228, 0.07);
  border-radius: 5px; background: rgba(0, 0, 0, 0.16); color: var(--paper); font: inherit; text-align: left; cursor: pointer; }
.studio-tile:hover { background: rgba(243, 239, 228, 0.06); }
.studio-tile[aria-pressed="true"] { border-color: var(--accent); background: rgba(216, 137, 43, 0.14); box-shadow: inset 0 0 0 1px var(--accent); }
.studio-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.studio-tile-icon { flex: 0 0 18px; width: 18px; height: 18px; color: rgba(243, 239, 228, 0.62); shape-rendering: crispEdges; }
.studio-tile[data-worn] .studio-tile-icon { color: var(--accent-text); }
.studio-tile-name { min-width: 0; color: rgba(243, 239, 228, 0.88); font-size: 12px; line-height: 1.2; white-space: nowrap; }
.studio-tile[data-worn] .studio-tile-name { color: var(--accent-text); }
.studio-tile { position: relative; }
.studio-tile[data-changed]::after { content: ""; position: absolute; top: 5px; left: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.studio-tile[data-unsupported] { opacity: 0.55; }
/* The chosen tile's editor, across the slab under that tile's row: its name, its list, who made the piece and, for the
   hat and the mask, a size whose value reads as the pop-ups' values do. */
.studio-editors[hidden] { display: none; }
.studio-editors { grid-column: 1 / -1; padding: 8px; border: 1px solid rgba(216, 137, 43, 0.6); border-radius: 5px; background: rgba(0, 0, 0, 0.22); }
.studio-editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.studio-editor[hidden] { display: none; }
.studio-editor-name { margin: 0; color: rgba(243, 239, 228, 0.88); font-size: 12px; font-weight: 700; }
.studio-editor .studio-slot-credit { color: rgba(243, 239, 228, 0.78); font-size: 11px; }
.studio-editor .studio-note { color: rgba(243, 239, 228, 0.62); font-size: 11px; }
.studio-editor .studio-hat-size-label { color: rgba(243, 239, 228, 0.88); font-size: 12px; letter-spacing: 0; text-transform: none; }
.studio-editor .studio-hat-size-label output { font-family: var(--mono); font-size: 11px; color: var(--accent-text); }
.studio-editor select { width: 100%; min-width: 0; min-height: 44px; box-sizing: border-box; padding: 0 8px; border: 1px solid rgba(0, 0, 0, 0.5); border-radius: 5px;
  background: rgba(0, 0, 0, 0.28); color: var(--paper); font: inherit; font-size: 12px; cursor: pointer; }
.studio-editor select:disabled { opacity: 0.55; cursor: default; }
.studio-editor select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.studio-save-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 10px; }
.studio-save-row .studio-changes { flex: 1 0 auto; margin: 0; }
.studio-save-row .foot-button { flex: 0 0 auto; }
.studio-size-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.studio-size-line .studio-hat-size-label { flex: 1 1 auto; }
.studio-size-line .link { padding: 0; min-height: 0; font-size: 11px; }
.studio-size-line .link:disabled { opacity: 0.4; cursor: default; }
.studio-height-line input[type="range"] { flex: 1 1 auto; min-width: 0; }
.studio-changes { color: var(--accent-text); font-size: 11px; white-space: nowrap; }
.studio-changes .link { padding: 0; min-height: 0; font-size: 11px; }
.studio-slot-credit { color: rgba(243, 239, 228, 0.65); font-size: 10px; line-height: 1.4; overflow-wrap: anywhere; }
.studio-slot-credit:empty { display: none; }
/* An Ooga's own colours, each under the editor of what it colours (the skin's under the body's): a rule over it, its
   name and what is worn, then square swatches with its own first (a dashed ring), the chosen one ringed in amber, and
   last a colour wheel for any colour, which takes the colour worn once one is mixed. The hex field says and takes it. */
.studio-colour { padding-top: 8px; border-top: 1px solid rgba(243, 239, 228, 0.12); }
:is(.studio-colour, .studio-valued) .studio-editor-name { display: flex; gap: 8px; align-items: baseline; }
.studio-colour-name { color: var(--accent-text); font-size: 11px; font-weight: 400; }
.studio-wardrobe .studio-swatch.studio-wheel { -webkit-appearance: none; appearance: none; display: block;
  background: conic-gradient(#e2453c, #e8c13b, #5fbf4b, #3bb7d2, #4062d8, #b04bd0, #e2453c); }
.studio-wheel::-webkit-color-swatch-wrapper { padding: 0; }
.studio-wheel::-webkit-color-swatch { border: 0; opacity: 0; }
.studio-wheel::-moz-color-swatch { border: 0; opacity: 0; }
.studio-hex { display: flex; align-items: center; gap: 8px; color: rgba(243, 239, 228, 0.88); font-size: 12px; }
.studio-hex input { flex: 1 1 0; width: 0; min-width: 0; min-height: 36px; box-sizing: border-box; padding: 0 8px; border: 1px solid rgba(0, 0, 0, 0.5); border-radius: 5px;
  background: rgba(0, 0, 0, 0.28); color: var(--paper); font-family: var(--mono); font-size: 12px; text-transform: uppercase; }
.studio-hex input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.studio-hex input[aria-invalid] { border-color: #e2453c; }
.studio-hex input:disabled { opacity: 0.55; }
.studio-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); gap: 5px; }
.studio-wardrobe .studio-swatch { width: 100%; min-width: 0; min-height: 0; height: auto; aspect-ratio: 1; padding: 0; border: 2px solid rgba(0, 0, 0, 0.55); border-radius: 5px; background: #555; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(243, 239, 228, 0.2); }
.studio-swatch[data-own] { border-style: dashed; border-color: rgba(243, 239, 228, 0.6); }
.studio-swatch[aria-pressed="true"] { border: 2px solid var(--accent); box-shadow: inset 0 0 0 2px var(--slab-dark); }
.studio-swatch:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.studio-swatch:disabled { opacity: 0.4; cursor: default; }
@media (pointer: coarse) {
  .studio-swatches { grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); }
  /* A tile's words keep its whole width a phone gives it: a smaller mark, closer in. */
  .studio-wardrobe .studio-tile { gap: 5px; padding: 6px 5px; }
  .studio-tile-icon { flex-basis: 14px; width: 14px; height: 14px; }
}
/* The foot pinned under the slots is a stone slab of its own: a copy of the planks could never line its seams up with
   the panel's behind it as the slots scroll, so it would read as a broken board. Its text stands on the stone. */
.studio-wardrobe-foot { position: sticky; bottom: 0; z-index: 1; display: grid; gap: 6px; margin-top: 2px; padding: 8px; background: var(--slab-dark);
  border: 2px solid var(--stone-dk); border-radius: 9px 7px 10px 8px; box-shadow: var(--tablet-shadow); }
.studio-wardrobe .studio-wardrobe-foot .studio-note { padding: 0; background: none; color: rgba(243, 239, 228, 0.62); font-size: 11px; }
.studio-wardrobe .studio-wardrobe-foot .studio-note:empty { display: none; }
.studio-wardrobe :is(input[type="range"], summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.studio-hat-size-label { display: flex; justify-content: space-between; gap: 8px; }
.studio-hat-size-label output { color: var(--accent-text); font-variant-numeric: tabular-nums; }
.studio-wardrobe input[type="range"] { width: 100%; min-width: 0; height: 44px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.studio-wardrobe input[type="range"]:disabled { opacity: 0.5; cursor: default; }
.studio-wardrobe button { white-space: normal; min-height: 44px; padding: 6px 10px; font-size: 11px; }
.studio-wardrobe p { margin: 0; }
.studio-wardrobe a { color: var(--accent-text); line-height: 1.5; }
.studio-wardrobe .studio-note { line-height: 1.4; }
.equipment-update { position: absolute; z-index: 50; top: calc(var(--banner-controls-bottom, 68px) + 12px); left: 50%; transform: translateX(-50%); width: min(360px, calc(100vw - 24px)); box-sizing: border-box; padding: 12px; border: 2px solid var(--wood-edge); border-radius: var(--radius); color: var(--paper); background: var(--planks); box-shadow: 0 4px 12px #0008; }
.equipment-update p { margin: 0 0 8px; }
.equipment-update div { display: flex; gap: 8px; flex-wrap: wrap; }
.equipment-update button { flex: 1 1 auto; min-height: 44px; padding: 6px 10px; font-size: 11px; white-space: normal; }
.studio-wardrobe .foot-primary:disabled,
.equipment-update .foot-primary:disabled { background: linear-gradient(#e2a04a, var(--accent)); }
.equipment-update [role="status"]:empty { display: none; }
/* Its quick pick of every Ooga, in the banner where the controls button stands elsewhere, in the equipment buttons' look. */
.studio-pick {
  position: absolute;
  top: var(--hub-banner-button-top, calc(10px + var(--safe-top)));
  right: calc(var(--hub-banner-button-right, calc(var(--hub-banner-gutter) + var(--safe-right))) + var(--hub-banner-button-w, var(--hub-banner-button, 36px)) + var(--hub-banner-button-gap, 8px));
  width: min(190px, 42vw);
  height: var(--hub-banner-button, 36px);
  padding: 0 8px;
  background: var(--slab-dark);
  border: 2px solid #221f1c;
  border-radius: 9px 7px 10px 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), inset 0 -2px 0 rgba(0, 0, 0, 0.35), 0 2px 0 rgba(0, 0, 0, 0.4);
  color: var(--paper);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.studio-side [aria-pressed="true"] { border-color: var(--accent); color: var(--accent-text); }
body[data-active-scene="studio"] #environment-sound { display: none; }
body[data-active-scene="studio"] .controls-help-button { right: var(--hub-banner-button-right, calc(var(--hub-banner-gutter) + var(--safe-right))); }
body[data-active-scene="studio"] :is(.world-clock, .world-block) { visibility: hidden; }
/* Its This Ooga panel down the right side, under the banner and against the screen's right edge: what the file gives
   the Ooga and how much of the intake's limit it takes, in the game's wood. Its left edge is a grip that drags it
   wider or narrower (scene-studio.js sets its width), never over the studio's buttons on the left; its head stays
   put while the rest scrolls under it. It folds to a tab on the right edge on every screen, so on a phone it never
   slides down over the sticks. */
.studio-features {
  position: absolute;
  top: calc(var(--banner-controls-bottom, calc(68px + var(--safe-top))) + 6px);
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(270px, calc(100vw - 140px - var(--safe-left)));
  min-width: min(200px, calc(100vw - 140px - var(--safe-left)));
  max-width: calc(100vw - 140px - var(--safe-left));
  max-height: calc(100% - var(--banner-controls-bottom, calc(68px + var(--safe-top))) - 24px - var(--safe-bottom));
  padding: 8px calc(12px + var(--safe-right)) 12px 16px;
  border: 3px solid var(--wood-edge);
  border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--planks);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
  color: var(--paper);
}
.studio-features[hidden] { display: none; }
.studio-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--wood-edge) rgba(0, 0, 0, 0.25);
}
.studio-resize {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: ew-resize;
  touch-action: none;
}
/* Its grip mark: two short lines down the middle of the edge, lit while held or focused. */
.studio-resize::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  width: 4px;
  height: 34px;
  margin-top: -17px;
  border-left: 2px solid var(--wood-edge);
  border-right: 2px solid var(--wood-edge);
}
.studio-resize:hover::before,
.studio-resize:focus-visible::before,
.studio-features[data-resizing="true"] .studio-resize::before { border-color: var(--accent); }
.studio-resize:focus-visible { outline: none; }
/* The words on the wood itself, the headings and the line under the title, are white; the rest sit on dark insets. */
.studio-features .section-head { margin: 12px 0 5px; border-bottom-color: rgba(255, 255, 255, 0.3); color: var(--paper); text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6); }
.studio-who { margin: 2px 0 0; color: var(--paper); font-size: 10px; overflow-wrap: anywhere; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6); }
.studio-bar { height: 8px; border-radius: 4px; background: rgba(0, 0, 0, 0.4); overflow: hidden; }
.studio-bar span { display: block; width: 0; height: 100%; background: var(--accent); }
.studio-bar[data-state="full"] span { background: #e0603a; }
.studio-size { margin: 5px 0 0; font-size: 14px; font-weight: 700; }
#studio-size-parts:not(:empty) { margin-top: 4px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.studio-note { margin: 2px 0 0; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.studio-note[data-state="bad"] { color: #ffb08a; }
/* Its text sits on a dark inset, so the planks' seams never run through a line. */
.studio-file,
.studio-wardrobe .studio-note,
#studio-groups .studio-list { padding: 6px 8px; border-radius: 6px; background: rgba(0, 0, 0, 0.62); }
.studio-list { margin: 0; padding: 0; list-style: none; }
.studio-list li { display: flex; flex-direction: column; gap: 1px; padding: 4px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.studio-list li:last-child { border-bottom: 0; }
/* A label and its bytes: the bytes stand level with the label's middle, however many lines the label takes. */
.studio-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.studio-head .studio-note { margin: 0; white-space: nowrap; line-height: 1; }
.studio-head .studio-key { line-height: 1.3; }
.studio-key { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.studio-colours { display: flex; flex-wrap: wrap; gap: 2px 10px; }
/* A colour chip copies its value on a click, under the plain pointer: the copy cursor's badge would sit over its
   tooltip. A name with a tooltip says so with a dotted underline. */
.studio-chip { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.studio-chip:hover,
.studio-chip:focus-visible { outline: none; text-decoration: underline; }
.studio-copy { position: fixed; top: 0; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.studio-key[title] { cursor: help; text-decoration: underline dotted rgba(255, 255, 255, 0.4); text-underline-offset: 2px; }
.studio-value { font-size: 12px; overflow-wrap: anywhere; }
.studio-swatch { display: inline-block; width: 11px; height: 11px; margin-right: 6px; border: 1px solid rgba(0, 0, 0, 0.6); border-radius: 2px; vertical-align: -1px; }
.studio-list .studio-bar { height: 4px; margin-top: 2px; }
.studio-features-edge { top: calc(var(--banner-controls-bottom, calc(68px + var(--safe-top))) + 6px); }
/* On a touch screen it stops above the sticks and the act button. */
@media (pointer: coarse) {
  .studio-features { max-height: calc(100% - var(--banner-controls-bottom, calc(68px + var(--safe-top))) - 210px - var(--safe-bottom)); }
}
@media (max-width: 720px) {
  .studio-features[data-folded="true"] { transform: translateX(calc(100% + 90px + var(--safe-right))); }
  .studio-features-edge {
    top: calc(var(--banner-controls-bottom, calc(68px + var(--safe-top))) + 6px);
    bottom: auto;
    padding: 14px 6px;
    writing-mode: vertical-rl;
    border: 3px solid var(--wood-edge);
    border-right: 0;
    border-radius: 8px 0 0 8px;
  }
}

/* Cave stations cycle through the OBL land button instead of a second camera toolbar. */
.topbar .presets:is([data-scene="lab"], [data-scene="factory"], [data-scene="hangar"], [data-scene="bifrost"], [data-scene="arcade"]) [data-preset] { display: none; }
body[data-active-scene="arcade"] #destination-hud:not([hidden]) { display: flex; }
/* Below the title the land button sits at the screen's edge, so a long place name starts under it. */
.equipment-hud[data-banner="below"] .detached-destination-name { left: 0; transform: none; text-align: left; }

/* Keep a character control in every banner, including detached views and game scenes. */
.mode-roster-icon { width: 34px; height: 44px; }
#mode-hud[data-selected="true"] .mode-roster-icon { display: none; }

/* Cloud Hopper keeps the route visible beneath a small clock; its title and results share the arcade's wood and stone. */
.cloud-hopper-hud {
  position: fixed;
  z-index: 35;
  top: calc(82px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  width: min(360px, calc(100vw - 32px));
  padding: 12px 18px;
  border: 1px solid #abcfe45c;
  border-radius: 18px;
  background: #142b40e8;
  color: #f6fbff;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 5px 24px #05152645;
}
.cloud-hopper-hud[hidden] { display: none; }
.cloud-hopper-name { margin: 0; color: #afdff5; font-size: 11px; font-weight: 700; letter-spacing: .16em; }
.cloud-hopper-time { display: block; margin: 5px 0; color: #fff; font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.cloud-hopper-time[hidden] { display: none; }
.cloud-hopper-record { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 7px; }
.cloud-hopper-record-text { min-width: 0; overflow-wrap: anywhere; }
.cloud-hopper-record-tail { display: inline-flex; max-width: 100%; align-items: center; gap: 5px; }
.cloud-hopper-record-time { font-variant-numeric: tabular-nums; }
.cloud-hopper-record-ghost { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 26px;
  width: 26px; min-width: 26px; height: 25px; min-height: 0; margin: 0; padding: 4px; border: 1px solid #6f899766;
  border-radius: 6px; background: #0e2031; color: #7c94a5; box-shadow: none; cursor: default; }
.cloud-hopper-record-ghost[hidden] { display: none; }
.cloud-hopper-record-ghost svg { display: block; width: 14px; height: 14px; }
.cloud-hopper-record-ghost:not(:disabled) { pointer-events: auto; cursor: pointer; }
.cloud-hopper-record-ghost[aria-pressed="true"] { color: #ddfaff; border-color: #8aeaff; background: #24566f; }
.cloud-hopper-record-ghost:focus-visible { outline: 2px solid #8aeaff; outline-offset: 2px; }
.cloud-hopper-status { font-weight: 700; }
/* Power-ups held, as buttons in the banner's equipment row beside the jetpack's, only while one applies, each edged
   in its own colour: X-ray's goggles with its seconds (blinking red its last two), the feather, the hook (brighter
   while thrown); on a touch screen the hook's button is held to throw. */
.cloud-hopper-power { cursor: default; }
.cloud-hopper-power-readout { font-weight: 700; letter-spacing: .04em; }
.cloud-hopper-power.xray { border-bottom-color: #4fe3ff; }
.cloud-hopper-power.xray .cloud-hopper-power-readout { color: #9ef2ff; }
.cloud-hopper-power.xray.ending .cloud-hopper-power-readout { color: var(--danger); animation: cloud-hopper-blink .5s steps(2, jump-none) infinite; }
.cloud-hopper-power.updraft { border-bottom-color: #7fe0a8; }
.cloud-hopper-power.updraft .cloud-hopper-power-readout { color: #c4f7d6; }
.cloud-hopper-power.hook { border-bottom-color: #c9a24a; cursor: pointer; touch-action: none; }
.cloud-hopper-power.hook .cloud-hopper-power-readout { color: #f2d58a; }
.cloud-hopper-power.hook.thrown { border-bottom-color: #ffd54a; }
.cloud-hopper-power.hook.thrown .cloud-hopper-power-readout { color: #fff0b8; }
@keyframes cloud-hopper-blink { 50% { opacity: .25; } }
/* A gust's cue: a pale band of wind down the edge of the screen it comes from, its chevrons pointing the way it
   blows, pulsing while it warns and streaming while it blows. */
.cloud-hopper-gust {
  position: fixed;
  z-index: 34;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(22vw, 170px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
  pointer-events: none;
  background: linear-gradient(to right, #c8ecff59, #c8ecff1f 55%, transparent);
  color: #eaf8ff;
  animation: cloud-hopper-gust-pulse .7s ease-in-out infinite alternate;
}
.cloud-hopper-gust[hidden] { display: none; }
.cloud-hopper-gust[data-from="right"] { left: auto; right: 0; align-items: flex-end; background: linear-gradient(to left, #c8ecff59, #c8ecff1f 55%, transparent); }
.cloud-hopper-gust-word { font-weight: 800; font-size: 15px; letter-spacing: .2em; text-shadow: 0 1px 3px #0009, 0 0 10px #8fdcff; }
.cloud-hopper-gust-arrows { display: flex; gap: 4px; }
.cloud-hopper-gust[data-from="right"] .cloud-hopper-gust-arrows { transform: scaleX(-1); }
.cloud-hopper-gust-arrows i { width: 16px; height: 16px; border: solid #eaf8ff; border-width: 4px 4px 0 0; transform: rotate(45deg); filter: drop-shadow(0 0 4px #8fdcff); animation: cloud-hopper-gust-chevron 1.2s linear infinite; }
.cloud-hopper-gust-arrows i:nth-child(2) { animation-delay: .2s; }
.cloud-hopper-gust-arrows i:nth-child(3) { animation-delay: .4s; }
.cloud-hopper-gust[data-state="blowing"] { animation: none; background: linear-gradient(to right, #c8ecff8c, #c8ecff33 55%, transparent); }
.cloud-hopper-gust[data-state="blowing"][data-from="right"] { background: linear-gradient(to left, #c8ecff8c, #c8ecff33 55%, transparent); }
.cloud-hopper-gust[data-state="blowing"] .cloud-hopper-gust-arrows i { animation-duration: .45s; }
@keyframes cloud-hopper-gust-pulse { from { opacity: .45; } to { opacity: 1; } }
@keyframes cloud-hopper-gust-chevron { 0% { opacity: .2; translate: -6px 0; } 40% { opacity: 1; } 100% { opacity: .2; translate: 6px 0; } }
.cloud-hopper-help { margin: 5px 0 0; color: #d8e9f3; font-size: 11px; line-height: 1.5; }
/* Under the clock, the lines fold up into it as the run starts, shrinking and fading until the card holds only the name
   and the clock; the next run opens them at once. */
.cloud-hopper-brief { display: grid; grid-template-rows: 1fr; transform-origin: 50% 0; }
.cloud-hopper-brief > div { min-height: 0; overflow: hidden; }
.cloud-hopper-running .cloud-hopper-brief { grid-template-rows: 0fr; opacity: 0; transform: translateY(-6px) scale(0.9);
  transition: grid-template-rows .7s cubic-bezier(.4, 0, .2, 1) .35s, opacity .5s ease .35s, transform .7s cubic-bezier(.4, 0, .2, 1) .35s; }
.cloud-hopper-running .cloud-hopper-time { margin-bottom: 0; transition: margin .7s cubic-bezier(.4, 0, .2, 1) .35s; }
@media (prefers-reduced-motion: reduce) { .cloud-hopper-running .cloud-hopper-brief, .cloud-hopper-running .cloud-hopper-time { transition: none; } }
@media (prefers-reduced-motion: reduce) { .cloud-hopper-gust, .cloud-hopper-gust-arrows i { animation: none; } }
.cloud-hopper-panel {
  position: fixed;
  inset: auto;
  left: 50%;
  top: 50%;
  margin: 0;
  max-height: calc(100dvh - 32px - var(--safe-top) - var(--safe-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.35);
}
.cloud-hopper-panel::backdrop { background: rgba(8, 6, 4, 0.55); }
.cloud-hopper-panel img, .cloud-hopper-panel canvas {
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}
/* Keep the fixed camera's view of the falling Ooga (framed at 75% height) clear below, and the top bar clear above. */
.cloud-hopper-panel.cloud-hopper-dq {
  left: 50%;
  top: calc(72px + var(--safe-top));
  right: auto;
  width: min(760px, calc(100vw - 32px - var(--safe-left) - var(--safe-right)));
  max-height: calc(66dvh - 80px - var(--safe-top));
  padding: 12px 16px;
  transform: translateX(-50%);
  animation: none;
}
.cloud-hopper-panel.cloud-hopper-dq[open] { display: flex; flex-direction: column; }
.cloud-hopper-panel.cloud-hopper-dq::backdrop { background: transparent; }
.cloud-hopper-dq > :not(.game-intro-glow) { flex-shrink: 0; }
/* Only a window too short for its board (a phone on its side) scrolls it, under a thin bar in the card's colours. */
.cloud-hopper-dq .cloud-hopper-scores { flex-shrink: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(245, 197, 66, 0.45) transparent; }
.cloud-hopper-dq .cloud-hopper-scores-title { margin: 8px 0 6px; }
.cloud-hopper-panel.cloud-hopper-dq .game-intro-title { margin: 4px 0 8px; font-size: 28px; }
.cloud-hopper-panel.cloud-hopper-dq .actions { margin-top: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cloud-hopper-panel.cloud-hopper-dq.cloud-hopper-picking .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* Choosing a level, the card holds the level cards and their board under them, and may use the window's height. */
.cloud-hopper-panel.cloud-hopper-dq.cloud-hopper-picking { max-height: calc(100dvh - 88px - var(--safe-top) - var(--safe-bottom)); }
/* Three buttons stay in one row on a phone: a little less padding and spacing, the same words. */
@media (max-width: 420px) {
  .cloud-hopper-panel.cloud-hopper-dq { padding: 12px; }
  .cloud-hopper-panel.cloud-hopper-dq .actions, .cloud-hopper-panel.cloud-hopper-intro .actions { gap: 6px; }
  .cloud-hopper-panel.cloud-hopper-dq .actions button, .cloud-hopper-panel.cloud-hopper-intro .actions button { padding: 0 4px; letter-spacing: 0.02em; }
}
.cloud-hopper-result-art { display: block; width: min(100%, 320px); height: min(18dvh, 150px); margin: 4px auto 6px; object-fit: contain; }
.cloud-hopper-dq .cloud-hopper-result-art { width: min(100%, 260px); height: min(10dvh, 104px); }
.cloud-hopper-result-art[hidden] { display: none; }
.cloud-hopper-intro-art { display: block; width: min(100%, 420px); height: min(30dvh, 230px); margin: 10px auto; object-fit: contain; }
.cloud-hopper-guide-art { display: flex; align-items: center; justify-content: center; height: min(28dvh, 220px); margin: 4px auto 12px; }
.cloud-hopper-guide-art canvas { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.45)); }
.cloud-hopper-intro-art[hidden], .cloud-hopper-guide-art[hidden] { display: none; }
/* The level cards: the number in the picture's corner, the name alone on one row, then route and best or lock.
   They stand in one row, four at a time (two on a phone) at the size four always had, and the row scrolls sideways to
   the rest (the selected card is scrolled to, `cloud-hopper-hud.js`); its padding keeps a focused card's ring inside. */
.cloud-hopper-levels { --level-gap: 10px; --level-shown: 4; display: grid; grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--level-shown) - 1) * var(--level-gap)) / var(--level-shown)); gap: var(--level-gap);
  margin: 6px -5px 8px; padding: 4px 5px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; scroll-padding-inline: 5px; scrollbar-width: thin; scrollbar-color: rgba(255, 213, 74, 0.55) transparent; }
.cloud-hopper-levels[hidden] { display: none; }
.cloud-hopper-level { position: relative; display: flex; flex-direction: column; padding: 0 0 8px; overflow: hidden; border: 2px solid rgba(255, 246, 220, 0.18);
  border-radius: 8px; background: rgba(10, 16, 26, 0.55); color: var(--paper); font: inherit; text-align: left; cursor: pointer; scroll-snap-align: start; }
.cloud-hopper-level.selected { border: 3px solid #ffd54a; background: rgba(255, 213, 74, 0.14); }
.cloud-hopper-level:focus-visible { outline: 2px solid #ffd84a; outline-offset: 2px; }
.cloud-hopper-level.locked { cursor: default; }
.cloud-hopper-level-frame { position: relative; display: block; }
.cloud-hopper-level-art { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: rgba(0, 0, 0, 0.3); }
/* The player's own Ooga stands on the cloud a run starts from, in the middle of each picture. */
.cloud-hopper-level-ooga { position: absolute; left: 50%; bottom: 12%; width: auto; height: 46%; transform: translateX(-50%); pointer-events: none; }
.cloud-hopper-level.locked .cloud-hopper-level-frame { filter: grayscale(0.7) brightness(0.55); }
.cloud-hopper-level-number { position: absolute; top: 6px; left: 6px; display: flex; align-items: center; justify-content: center; min-width: 26px; height: 26px;
  padding: 0 6px; border: 2px solid rgba(255, 246, 220, 0.45); border-radius: 6px; background: rgba(20, 14, 8, 0.85); color: #ffd54a; font-size: 15px; font-weight: 800; }
.cloud-hopper-level.selected .cloud-hopper-level-number { border-color: #ffd54a; }
.cloud-hopper-level.locked .cloud-hopper-level-number { color: #cbb894; }
.cloud-hopper-level-name { display: block; margin: 6px 8px 0; font-size: 13px; letter-spacing: 0.04em; white-space: nowrap; }
.cloud-hopper-level-note { display: block; margin: 2px 8px 0; font-size: 10px; opacity: 0.85; }
/* The cards get a wider card to fill: the intro, and the result card while a level is being chosen. */
.cloud-hopper-panel.cloud-hopper-intro, .cloud-hopper-panel.cloud-hopper-picking { width: min(1120px, calc(100vw - 32px)); }
.cloud-hopper-intro .cloud-hopper-levels, .cloud-hopper-picking .cloud-hopper-levels { --level-gap: 16px; }
.cloud-hopper-intro .cloud-hopper-level-name, .cloud-hopper-picking .cloud-hopper-level-name { margin-top: 8px; font-size: 17px; }
.cloud-hopper-intro .cloud-hopper-level-note, .cloud-hopper-picking .cloud-hopper-level-note { font-size: 12px; }
@media (max-width: 600px) {
  .cloud-hopper-levels { --level-shown: 2; }
  .cloud-hopper-intro .cloud-hopper-levels, .cloud-hopper-picking .cloud-hopper-levels { --level-gap: 10px; }
  .cloud-hopper-intro .cloud-hopper-level-name, .cloud-hopper-picking .cloud-hopper-level-name { font-size: 13px; }
}
.cloud-hopper-panel.cloud-hopper-guide { width: min(480px, calc(100vw - 32px)); }
.cloud-hopper-panel.cloud-hopper-guide .game-intro-title { font-size: 32px; }
.cloud-hopper-guide .game-intro-who { max-width: 380px; margin: 4px auto 12px; font-size: 12px; }
.cloud-hopper-panel.cloud-hopper-guide .actions { grid-template-columns: 0.8fr 1fr 0.9fr; }
.cloud-hopper-guide .game-intro-go { animation: none; }
.cloud-hopper-panel .game-intro-title { margin: 8px 0 14px; }
.cloud-hopper-panel .game-intro-title .sign { max-width: 100%; }
/* A line that wraps splits evenly, never leaving one word on its own. */
.cloud-hopper-panel .game-intro-who { color: var(--paper); line-height: 1.5; text-wrap: balance; }
.cloud-hopper-panel .game-intro-goal { text-wrap: balance; }
/* The intro's two buttons share one row. */
.cloud-hopper-panel.cloud-hopper-intro .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cloud-hopper-panel .cloud-hopper-time { margin: 14px 0; color: #f5c542; font-size: 42px; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5); }
.cloud-hopper-scores-title { margin: 14px 0 8px; color: var(--accent-text); font-size: 12px; }
.cloud-hopper-scores .race-podium { margin: 0; text-align: left; font-size: 12px; }
.cloud-hopper-scores .race-podium li::before { content: none; }
.cloud-hopper-score-rank { color: var(--accent-text); font-weight: 700; }
.cloud-hopper-scores .race-podium li.you { background: rgba(245, 197, 66, 0.08); }
.cloud-hopper-scores .race-podium strong { white-space: nowrap; }
.cloud-hopper-scores .race-podium span:not(.cloud-hopper-score-rank) { overflow-wrap: anywhere; }
/* A place no one has taken yet stays on the board, empty. */
.cloud-hopper-scores .race-podium li.empty { color: var(--muted); }
/* The ten places stand in two columns of five, so a board fits its card without scrolling. */
/* Each place carries its own side padding, so a highlighted one reaches the board's edges and fills its half, a
   thin line between the halves; the board's rounded corners clip it. */
.cloud-hopper-scores .race-podium { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(5, auto); grid-auto-flow: column; padding: 0; overflow: hidden; }
.cloud-hopper-scores .race-podium li:nth-child(5) { border-bottom: 0; box-shadow: none; }
.cloud-hopper-scores .race-podium li { padding: 4px 12px; }
.cloud-hopper-scores .race-podium li:nth-child(n + 6) { border-left: 1px solid rgba(0, 0, 0, 0.35); }
/* The DQ card, kept clear of the falling Ooga below, sets its places a little closer and leaves the empty ones to
   say no one has a time yet. */
.cloud-hopper-dq .cloud-hopper-scores .race-podium li { padding: 3px 12px; }
.cloud-hopper-scores-status, .cloud-hopper-personal-best, .cloud-hopper-uploads { margin: 5px 0; color: var(--paper); font-size: 11px; line-height: 1.4; }
.cloud-hopper-personal-best { color: var(--accent-text); }
.cloud-hopper-panel .actions { margin-top: 16px; }
/* The panel's buttons by what they do: banana gold goes on, leaf green chooses, light gray steps back, stone leaves. */
.cloud-hopper-panel .actions button[data-role="go"] { background: linear-gradient(#ffe27a, #f0b62a); color: var(--ink); }
.cloud-hopper-panel .actions button[data-role="go"]:hover, .cloud-hopper-panel .actions button[data-role="go"].virtual-hover { background: linear-gradient(#fff0a8, #ffe27a); }
.cloud-hopper-panel .actions button[data-role="choose"] { background: linear-gradient(#a6d97f, #5f9e3f); color: #13260b; }
.cloud-hopper-panel .actions button[data-role="choose"]:hover, .cloud-hopper-panel .actions button[data-role="choose"].virtual-hover { background: linear-gradient(#c2e8a3, #a6d97f); }
.cloud-hopper-panel .actions button[data-role="back"] { background: linear-gradient(#bdb8b0, #87827b); color: var(--ink); }
.cloud-hopper-panel .actions button[data-role="back"]:hover, .cloud-hopper-panel .actions button[data-role="back"].virtual-hover { background: linear-gradient(#d1cdc6, #bdb8b0); }
.cloud-hopper-panel .actions button[data-role="leave"] { background: linear-gradient(#77706a, #4a4541); color: var(--paper); }
.cloud-hopper-panel .actions button[data-role="leave"]:hover, .cloud-hopper-panel .actions button[data-role="leave"].virtual-hover { background: linear-gradient(#8a837c, #77706a); }
.cloud-hopper-panel .actions button:disabled { opacity: 0.55; cursor: default; }
@media (max-width: 600px) {
  .cloud-hopper-hud { top: calc(118px + var(--safe-top)); width: min(300px, calc(100vw - 24px)); padding: 9px 12px; }
  .cloud-hopper-time { font-size: 26px; }
  .cloud-hopper-panel { padding: 16px 12px; }
  .cloud-hopper-panel.cloud-hopper-dq { padding: 12px; }
}
/* A shorter window leaves the DQ card its level's name for a heading and a smaller picture, and the intro wider,
   lower pictures, so each card's board still fits without scrolling. */
@media (max-height: 760px) {
  .cloud-hopper-intro .cloud-hopper-level-art, .cloud-hopper-picking .cloud-hopper-level-art { aspect-ratio: 2 / 1; }
  .cloud-hopper-intro .cloud-hopper-levels, .cloud-hopper-picking .cloud-hopper-levels { margin: 2px -5px 4px; }
  .cloud-hopper-intro .cloud-hopper-scores-title, .cloud-hopper-picking .cloud-hopper-scores-title { margin: 8px 0 6px; }
  .cloud-hopper-panel.cloud-hopper-intro .game-intro-title { margin: 4px 0 8px; }
}
@media (max-height: 720px) {
  .cloud-hopper-dq .game-intro-kicker, .cloud-hopper-dq .game-intro-title { display: none; }
  .cloud-hopper-panel.cloud-hopper-dq { padding: 10px 14px; }
  .cloud-hopper-dq .cloud-hopper-result-art { height: min(8dvh, 104px); margin: 2px auto 4px; }
  .cloud-hopper-panel.cloud-hopper-dq .actions { margin-top: 6px; }
}
@media (max-height: 600px) {
  .cloud-hopper-panel.cloud-hopper-dq { padding: 8px 12px; }
  .cloud-hopper-intro-art { height: min(26dvh, 140px); margin: 4px auto; }
  .cloud-hopper-guide-art { height: min(24dvh, 130px); margin: 0 auto 4px; }
  .cloud-hopper-result-art { height: min(18dvh, 100px); margin: 0 auto 4px; }
  .cloud-hopper-dq .cloud-hopper-result-art { height: min(14dvh, 72px); }
  .cloud-hopper-dq .game-intro-kicker,
  .cloud-hopper-dq .game-intro-title,
  .cloud-hopper-dq .game-intro-who { display: none; }
  .cloud-hopper-dq .cloud-hopper-scores-title { margin: 6px 0; }
  .cloud-hopper-panel.cloud-hopper-dq .actions { margin-top: 8px; }
}
@media (max-width: 420px) {
  .cloud-hopper-scores-title { font-size: 11px; }
}

body.cloud-hopper-active #destination-hud { display: none; }

/* Block Frenzy's board: one short line of keys, the full list folded under "All controls" and scrolled within a
   bounded height, so the choices above stay in view. */
#block-board .block-help-wrap {
  min-width: 0;
}

#block-board .block-controls summary {
  cursor: pointer;
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.85;
}

#block-board .block-controls[open] .help {
  max-height: 22vh;
  overflow-y: auto;
  margin-top: 4px;
}

/* Controls reference: a quiet native modal, with real, independently lit keycaps. */
body[data-active-scene] #controls-help-button { display: flex; align-items: center; justify-content: center; }
.controls-help-button { position: absolute; top: var(--hub-banner-button-top, calc(10px + var(--safe-top))); right: calc(var(--hub-banner-button-right, calc(var(--hub-banner-gutter) + var(--safe-right))) + var(--hub-banner-button-w, var(--hub-banner-button, 36px)) + var(--hub-banner-button-gap, 8px)); width: var(--hub-banner-button-w, var(--hub-banner-button, 36px)); height: var(--hub-banner-button, 36px); }
/* On a wide screen (hud.js `data-banner-labels`) the three top buttons stand as large as the equipment row's, a smaller
   icon over its name in small capitals; elsewhere the name stays in the tooltip alone. */
.banner-label { display: none; }
.topbar[data-banner-labels="true"] :is(.account-top, .controls-help-button, .environment-sound) { flex-direction: column; gap: 3px; }
.topbar[data-banner-labels="true"] :is(.account-top, .controls-help-button, .environment-sound) svg {
  width: calc(var(--hub-banner-button, 36px) * 0.46);
  height: calc(var(--hub-banner-button, 36px) * 0.46);
}
/* The Sign in button's name follows its state (hud.js sets `data-signed`). */
.account-top .banner-label::before { content: "Sign in"; }
.account-top[data-signed="true"] .banner-label::before { content: "Sign out"; }
.topbar[data-banner-labels="true"] .banner-label {
  display: block;
  font-size: 9px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--paper);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.85), 0 0 4px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}
.controls-help-button svg { width: calc(var(--hub-banner-button, 36px) * 2 / 3); height: calc(var(--hub-banner-button, 36px) * 2 / 3); }
/* A first visit to the island: a ring grows off the controls button three times, then stops (destination-map.js). */
.controls-help-button[data-hint="pulse"] { color: var(--accent-text); }
.controls-help-button[data-hint="pulse"]::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 9px 7px 10px 8px;
  border: 2px solid var(--accent-text);
  box-shadow: 0 0 0 0 rgba(216, 137, 43, 0.65);
  animation: controls-hint-pulse 1.4s ease-out 0.6s 3 both;
  pointer-events: none;
}
@keyframes controls-hint-pulse {
  0% { opacity: 1; box-shadow: 0 0 0 0 rgba(216, 137, 43, 0.65); }
  70% { opacity: 1; box-shadow: 0 0 0 12px rgba(216, 137, 43, 0); }
  100% { opacity: 0; box-shadow: 0 0 0 12px rgba(216, 137, 43, 0); }
}
/* Reduced motion: no ring, a steady amber outline for the same few seconds. */
@media (prefers-reduced-motion: reduce) {
  .controls-help-button[data-hint="pulse"]::after { animation: none; opacity: 1; box-shadow: 0 0 0 3px rgba(216, 137, 43, 0.55); }
}
.controls-help { width: min(480px, calc(100vw - 24px)); padding: 16px; max-height: calc(100dvh - 32px - var(--safe-top) - var(--safe-bottom)); overflow-y: auto; overscroll-behavior: contain; }
/* Its words and its keys sit on stone slabs, as the sound panel's rows do, never on the planks. */
.controls-help-about { margin: 0 0 10px; padding: 9px 12px; }
#controls-help-context { margin: 0 0 4px; color: var(--gold, #ffd84a); font-size: 12px; }
#controls-help-note { margin: 0; font-size: 12px; line-height: 1.4; color: rgba(243, 239, 228, 0.78); }
.controls-list { margin-top: 10px; padding: 3px 12px; background: var(--slab-dark); border: 2px solid var(--stone-dk); border-radius: 9px 7px 10px 8px; box-shadow: var(--tablet-shadow); }
.controls-list:empty { display: none; }
.controls-row { display: grid; grid-template-columns: 174px minmax(0, 1fr); align-items: center; gap: 12px; padding: 6px 0; border-top: 1px solid rgba(243, 239, 228, 0.07); font-size: 12px; line-height: 1.4; }
.controls-row:first-child { border-top: 0; }
.controls-keys { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.controls-keys kbd, .controls-gesture { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 24px; padding: 2px 5px; border: 1px solid #f3efe465; border-bottom-width: 3px; border-radius: 4px; background: var(--stone); color: #f3efe4; font: inherit; }
.controls-keys kbd[data-pressed="true"] { background: #ffd84a; color: #171308; border-color: transparent; }
.controls-key-cluster { display: grid; grid-template-columns: repeat(3, 24px); gap: 3px; }
.controls-key-cluster :is([data-key="w"], [data-key="arrowup"]) { grid-area: 1 / 2; }
.controls-key-cluster :is([data-key="a"], [data-key="arrowleft"]) { grid-area: 2 / 1; }
.controls-key-cluster :is([data-key="s"], [data-key="arrowdown"]) { grid-area: 2 / 2; }
.controls-key-cluster :is([data-key="d"], [data-key="arrowright"]) { grid-area: 2 / 3; }
.controls-aliases { display: flex; flex-wrap: wrap; gap: 4px; }
@media (max-width: 420px) {
  .controls-help { padding: 12px; }
  .controls-row { grid-template-columns: minmax(110px, 1fr) 1.1fr; gap: 8px; }
}
.controls-help-pad { margin: 0 0 4px; padding: 6px 12px; border: 2px solid var(--wood-edge); border-radius: 6px; background: var(--accent); color: #1b1006; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.controls-help-pad:hover, .controls-help-pad:focus-visible { background: #e89a3c; outline: 2px solid #ffd84a; outline-offset: 2px; }
.controls-glyph, .pad-glyph { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 6px; border: 1px solid #f3efe465; border-radius: 12px; background: var(--slab-dark); color: #f3efe4; font-weight: 700; font-size: 12px; white-space: nowrap; }
.controls-glyph.round, .pad-glyph.round { width: 24px; padding: 0; }
.controls-glyph.stick, .pad-glyph.stick { width: 24px; padding: 0; border-radius: 50%; border-style: double; border-width: 3px; font-size: 10px; }
.g-xa { color: #5fb94a; } .g-xb { color: #e5533d; } .g-xx { color: #3d8be5; } .g-xy { color: #e8c43a; }
.g-pcross { color: #8fb3f0; } .g-pcircle { color: #f07a7a; } .g-psquare { color: #ee97d6; } .g-ptri { color: #4fd1a8; }
/* A pad's focus ring, the same in every dialog and card the controller walks. */
.pad-focus, .pad-focus:focus, .pad-settings :is(button, input):focus-visible { outline: 2px solid #ffd84a; outline-offset: 2px; }

/* The controller screen: the player's controller beside its actions, the feel below. One column on phones. */
.pad-settings { width: min(1000px, calc(100vw - 24px)); padding: 14px; max-height: calc(100dvh - 24px - var(--safe-top) - var(--safe-bottom)); overflow-y: auto; overscroll-behavior: contain; }
.pad-settings > * + * { margin-top: 12px; }
.pad-settings .panel-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.pad-device { display: flex; align-items: center; gap: 8px; margin-left: auto; padding: 5px 10px; border-radius: 999px; background: var(--tablet); font-size: 12px; }
.pad-device small { display: block; color: var(--muted); font-size: 10px; }
.pad-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.pad-dot.live { background: var(--ok); box-shadow: 0 0 0 3px #22c55e33; }
.pad-family, .pad-tabs, .pad-seg, .pad-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pad-label { margin-right: 4px; color: var(--paper); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; opacity: .8; white-space: nowrap; }
.pad-settings button { font: inherit; color: var(--paper); cursor: pointer; }
.pad-family button, .pad-tabs button, .pad-seg button, .pad-buttons button, .pad-small, .pad-change { padding: 5px 10px; border: 1px solid #f3efe440; border-radius: 6px; background: var(--tablet); font-size: 12px; white-space: nowrap; }
.pad-family button[aria-pressed="true"], .pad-tabs button[aria-selected="true"], .pad-seg button[aria-pressed="true"], .pad-buttons button.primary { border-color: transparent; background: var(--accent); color: #1b1006; font-weight: 700; }
.pad-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.pad-picture, .pad-setup, .pad-tune, .pad-list { padding: 10px; border-radius: var(--radius); background: var(--tablet); box-shadow: var(--tablet-shadow); }
.pad-picture svg { display: block; width: 100%; height: auto; }
.pad-hint { min-height: 2.9em; margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.pad-note { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.pad-list .pad-note { margin-bottom: 4px; }
.pad-tabs { margin-bottom: 8px; }
.pad-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 6px 4px; border-top: 1px solid #f3efe424; border-radius: 4px; font-size: 12px; }
.pad-row.lit { background: #ffd84a14; }
.pad-row.capture { background: #d8892b22; outline: 1px solid var(--accent); }
.pad-name small { display: block; color: var(--faint); font-size: 10px; }
.pad-glyphs { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.pad-none { color: var(--faint); font-size: 10px; }
.pad-change:disabled { opacity: .45; cursor: default; }
.pad-prompt { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--accent-text); font-size: 12px; }
.pad-prompt button { padding: 4px 10px; border: 0; border-radius: 6px; background: var(--accent); color: #1b1006; font-weight: 700; }
.pad-prompt button.plain { background: var(--stone-lt); color: var(--paper); font-weight: 400; }
.pad-tune { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 18px; }
.pad-tune .section-head { grid-column: 1 / -1; margin: 0; }
.pad-field { display: grid; gap: 4px; align-content: start; }
.pad-field > label { display: flex; justify-content: space-between; gap: 8px; color: var(--paper); font-size: 12px; }
.pad-field output { font: 12px var(--mono); font-variant-numeric: tabular-nums; }
.pad-field input[type="range"] { width: 100%; accent-color: var(--accent); }
.pad-small { justify-self: start; }
.pad-check { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.pad-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.pad-setup { display: grid; gap: 8px; }
.pad-setup .section-head { margin: 0; }
.pad-setup-step { font-size: 14px; font-weight: 700; }
.pad-setup-bar { height: 6px; overflow: hidden; border-radius: 3px; background: var(--stone-lt); }
.pad-setup-bar i { display: block; width: 0; height: 100%; background: var(--accent); transition: width .2s; }
.pad-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pad-foot .pad-buttons { margin-left: auto; }
.pad-toast { position: sticky; bottom: 0; display: flex; align-items: center; gap: 10px; width: fit-content; max-width: 100%; margin: 12px auto 0; padding: 8px 12px; border-radius: 8px; background: var(--stone-lt); box-shadow: 0 6px 20px #0008; font-size: 12px; }
.pad-toast button { border: 0; background: transparent; color: #ffd84a; font-weight: 700; }
#pad-diagram .body { fill: #1f1d1b; stroke: #57524c; stroke-width: 2; }
#pad-diagram .ctl { cursor: pointer; }
#pad-diagram .ctl .cap { fill: #2c2a27; stroke: #6b655e; stroke-width: 1.5; transition: fill .08s; }
#pad-diagram .ctl text { fill: var(--fg); font: 700 12px system-ui, sans-serif; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
#pad-diagram .ctl.small text { font-size: 9px; }
#pad-diagram .ctl text.g-xa { fill: #5fb94a; } #pad-diagram .ctl text.g-xb { fill: #e5533d; } #pad-diagram .ctl text.g-xx { fill: #3d8be5; } #pad-diagram .ctl text.g-xy { fill: #e8c43a; }
#pad-diagram .ctl text.g-pcross { fill: #8fb3f0; } #pad-diagram .ctl text.g-pcircle { fill: #f07a7a; } #pad-diagram .ctl text.g-psquare { fill: #ee97d6; } #pad-diagram .ctl text.g-ptri { fill: #4fd1a8; }
#pad-diagram .ctl:hover .cap, #pad-diagram .ctl.sel .cap { stroke: #ffd84a; stroke-width: 2.5; }
#pad-diagram .ctl.on .cap { fill: #ffd84a; }
#pad-diagram .ctl.on text { fill: #171308; }
#pad-diagram .ctl.target .cap { stroke: #ffd84a; stroke-width: 3; animation: pad-pulse 1s ease-in-out infinite; }
#pad-diagram .ctl.unused .cap { stroke-dasharray: 3 3; }
#pad-diagram .dead { fill: none; stroke: #ffd84a55; stroke-dasharray: 2 3; }
#pad-diagram .stickdot { fill: var(--accent); }
#pad-diagram .stickdot.rest { fill: var(--faint); }
#pad-diagram .stick-name { fill: var(--muted); font-size: 10px; }
@keyframes pad-pulse { 50% { stroke-opacity: .25; } }
@media (prefers-reduced-motion: reduce) { #pad-diagram .ctl.target .cap { animation: none; } }
@media (max-width: 760px) {
  .pad-main { grid-template-columns: minmax(0, 1fr); }
  .pad-device { margin-left: 0; }
  .pad-foot .pad-buttons { margin-left: 0; }
}
/* Players read shared hockey scores inside the goal half-circles. */
#carnival[data-kind="hockey"][data-hockey-shared="true"] .carnival-scores,
#carnival[data-kind="hockey"][data-hockey-shared="true"] .race-hud-right > .race-lap:nth-child(-n+2) { display: none; }
#carnival[data-kind="hockey"][data-hockey-shared="true"] .carnival-coach { top: calc(64px + var(--safe-top)); bottom: auto; }

/* Keep the avatar and exit on one mobile row, clear of both the score and the playfield. */
@media (max-width: 720px) {
  body.arcade-game[data-cabinet-phase="playing"] #equipment-hud { top: calc(54px + var(--safe-top)); left: calc(8px + var(--safe-left)); }
  body.arcade-game[data-cabinet-phase="playing"] .topbar > .presets { top: calc(54px + var(--safe-top)); left: var(--banner-equipment-right, calc(74px + var(--safe-left))); max-width: calc(100% - var(--banner-equipment-right, calc(74px + var(--safe-left))) - 8px - var(--safe-right)); }
  body.arcade-game[data-cabinet-phase="playing"] .topbar > .presets button { min-height: 40px; }
  body[data-cabinet-phase="playing"] #drop-board { top: calc(104px + var(--safe-top)); bottom: calc(16px + var(--safe-bottom)); max-height: none; transform: translateX(-50%); }
  body[data-cabinet-phase="playing"] .mine-strip { top: calc(104px + var(--safe-top)); }
}

.arcade-banner-name { text-decoration: none; }
@media (max-width: 720px) {
  .arcade-banner-name > span { display: none; }
  .arcade-banner-name::after { content: "OA"; }
}

/* Menus fill the measured glass; its real control silhouettes stay in the foreground. */
#cabinet-backdrop { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#cabinet-backdrop[hidden], #cabinet-foreground[hidden] { display: none; }
#cabinet-foreground { width: 100vw; height: 100vh; max-width: none; max-height: none; pointer-events: none; z-index: 200; margin: 0; padding: 0; }
.stage.cabinet-display { position: absolute; overflow: hidden; isolation: isolate; background: #080604; container-type: inline-size; --safe-top: 0px; --safe-bottom: 0px; --safe-left: 0px; --safe-right: 0px; }
.cabinet-display :is(.topbar, .bottom-bar, .joysticks, #equipment-hud, #mode-hud, #act, #position-debug) { visibility: hidden; }
body[data-cabinet-phase]:not([data-cabinet-phase="idle"]):not([data-cabinet-phase="playing"]) :is(#position-debug, .equipment-hud, .mode-hud, .joysticks) { visibility: hidden; }
body[data-cabinet-phase]:not([data-cabinet-phase="idle"]):not([data-cabinet-phase="playing"]) .sheet { visibility: hidden; }
.cabinet-display .race:has(.game-intro:not([hidden])) :is(.race-hud, .carnival-coach, .carnival-touch) { visibility: hidden; }
.cabinet-display .game-intro:not([hidden]) {
  display: flex; flex-direction: column; gap: 6px; position: absolute; inset: 0;
  width: 100%; height: 100%; max-width: none; max-height: none; min-height: 0;
  transform: none; padding: 12px; margin: 0; border: 0; border-radius: 0; box-shadow: none;
  overflow: hidden; animation: none;
}
.cabinet-display .game-intro > * { flex-shrink: 0; }
.cabinet-display .game-intro :is(.game-intro-coin, .game-intro-kicker, .game-intro-who, .game-intro-glow) { display: none; }
.cabinet-display .game-intro .game-intro-title { margin: 0; font-size: clamp(20px, 4cqw, 40px); line-height: 1.15; }
.cabinet-display .game-intro .game-intro-goal { margin: 0; padding: 0; background: none; border: 0; box-shadow: none; font-size: clamp(11px, 2cqw, 18px); line-height: 1.35; }
.cabinet-display .game-intro .game-rules {
  flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 2px 0; align-content: center;
}
.cabinet-display .game-intro .game-rules li { grid-template-columns: 28px minmax(0, 1fr); gap: 5px 10px; padding: 14px; animation: none; }
.cabinet-display .game-intro .game-rule-icon { width: 24px; height: 24px; }
.cabinet-display .game-intro .game-rules b { white-space: normal; font-size: clamp(11px, 2cqw, 18px); }
.cabinet-display .game-intro .game-rules small { font-size: clamp(10px, 1.7cqw, 15px); line-height: 1.3; }
.cabinet-display .game-intro .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.cabinet-display .game-intro .actions button { min-width: 0; min-height: 44px; padding: 6px 8px; font-size: clamp(13px, 2.4cqw, 20px); letter-spacing: 0.02em; animation: none; }
@container (max-width: 480px) {
  .cabinet-display .game-intro:not([hidden]) { padding: 8px; gap: 4px; }
  .cabinet-display .game-intro .game-rules { align-content: start; }
  .cabinet-display .game-intro .game-rules li { grid-template-columns: 16px minmax(0, 1fr); padding: 4px; gap: 2px 4px; }
  .cabinet-display .game-intro .game-rule-icon { width: 14px; height: 14px; }
  .cabinet-display .game-intro .game-rules b { font-size: 11px; }
  .cabinet-display .game-intro .game-rules small { font-size: 10px; }
}
body[data-cabinet-phase]:not([data-cabinet-phase="idle"]) :is(.game-intro, .race-results, .game-rules li) { animation: none; }
/* Cabinet scoreboards use the same ten ranked places and footer navigation as Cloud Hopper. */
.cabinet-display .game-intro .cabinet-leaderboard { flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.cabinet-leaderboard h3 { margin: 4px 0; color: var(--accent-text); font-size: 13px; }
.cabinet-leaderboard p { margin: 4px 0 6px; font-size: 11px; line-height: 1.3; }
.cabinet-leaderboard ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(5, auto); grid-auto-flow: column; padding: 0; margin: 0; list-style: none; border: 2px solid var(--stone-dk); border-radius: 8px; background: var(--tablet); overflow: hidden; }
.cabinet-leaderboard li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: baseline; gap: 5px; padding: 4px 10px; font-size: 12px; text-align: left; border-bottom: 1px solid #0005; }
.cabinet-leaderboard li:nth-child(n + 6) { border-left: 1px solid #0005; }
.cabinet-leaderboard li:nth-child(5), .cabinet-leaderboard li:last-child { border-bottom: 0; }
.cabinet-leaderboard li > span:first-child { color: var(--accent-text); font-weight: bold; }
.cabinet-leaderboard li > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cabinet-leaderboard li.empty { color: var(--muted); }
.cabinet-leaderboard li.you { background: #f5c54222; }
.cabinet-leaderboard-toggle { display: none; }
.arcade-game .race .cabinet-leaderboard-toggle[aria-expanded="true"] { --arcade-button: linear-gradient(#bdb8b0, #87827b); --arcade-button-hover: linear-gradient(#d1cdc6, #bdb8b0); color: var(--ink); }
@container (max-width: 480px) {
  .cabinet-display .game-intro.cabinet-has-leaderboard .actions { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .cabinet-display .game-intro.cabinet-has-leaderboard .actions button { padding: 6px 3px; font-size: 12px; letter-spacing: 0; }
  .cabinet-display .cabinet-leaderboard-toggle { display: block; }
  .cabinet-display .game-intro:not(.cabinet-show-scores) .cabinet-leaderboard,
  .cabinet-display .game-intro.cabinet-show-scores :is(.game-rules, .game-intro-goal) { display: none; }
  .cabinet-leaderboard li { grid-template-columns: 12px minmax(0, 1fr) auto; padding: 4px 5px; font-size: 11px; gap: 3px; }
  .cabinet-leaderboard h3 { font-size: 12px; }
}
/* Native dialogs escape the stage's clipping; position Cloud Hopper in the same measured aperture. */
body[data-cabinet-phase="menu"] .cloud-hopper-panel {
  left: var(--cabinet-center-x); top: var(--cabinet-center-y);
  width: var(--cabinet-width); max-width: none; max-height: var(--cabinet-height);
  padding: 12px; border: 0; border-radius: 0; box-shadow: none; animation: none;
}
body[data-cabinet-phase="menu"] .cloud-hopper-panel.cloud-hopper-intro[open] { display: flex; flex-direction: column; gap: 6px; height: var(--cabinet-height); overflow: hidden; }
body[data-cabinet-phase="menu"] .cloud-hopper-intro :is(.game-intro-kicker, .game-intro-who, .game-intro-glow) { display: none; }
body[data-cabinet-phase="menu"] .cloud-hopper-intro .game-intro-title { margin: 0; font-size: 28px; }
body[data-cabinet-phase="menu"] .cloud-hopper-intro .game-intro-goal { font-size: 13px; }
body[data-cabinet-phase="menu"] .cloud-hopper-intro .cloud-hopper-levels { --level-gap: 8px; flex: 1 1 0; min-height: 0; overflow-y: auto; margin: 0 -5px; align-content: center; }
body[data-cabinet-phase="menu"] .cloud-hopper-intro .cloud-hopper-level-name { white-space: normal; font-size: 14px; }
body[data-cabinet-phase="menu"] .cloud-hopper-intro .actions { flex-shrink: 0; margin: 0; gap: 8px; }
body[data-cabinet-phase="menu"] .cloud-hopper-intro .actions button { min-height: 44px; padding: 6px 8px; font-size: 13px; animation: none; }
body[data-cabinet-phase="menu"] .cloud-hopper-panel::backdrop { background: transparent; }
body:is([data-cabinet-phase="shrinking"], [data-cabinet-phase="leaving"]) :is(.cloud-hopper-panel, .cloud-hopper-hud) { visibility: hidden; }
.cabinet-scores-toggle { display: none; }
body[data-cabinet-phase="menu"] .cloud-hopper-intro .cloud-hopper-scores { flex: 1 1 0; min-height: 0; overflow-y: auto; }
body[data-cabinet-phase="menu"] .cloud-hopper-intro .cloud-hopper-scores-title { margin: 4px 0; }
@media (max-width: 600px) {
  body[data-cabinet-phase="menu"] .cloud-hopper-intro .actions { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  body[data-cabinet-phase="menu"] .cloud-hopper-intro .actions button { padding: 6px 3px; font-size: 12px; letter-spacing: 0; }
  body[data-cabinet-phase="menu"] .cloud-hopper-intro .cabinet-scores-toggle { display: block; }
  body[data-cabinet-phase="menu"] .cloud-hopper-intro:not(.cabinet-scores-open) .cloud-hopper-scores,
  body[data-cabinet-phase="menu"] .cloud-hopper-intro.cabinet-scores-open .cloud-hopper-levels,
  body[data-cabinet-phase="menu"] .cloud-hopper-intro .game-intro-goal { display: none; }
  body[data-cabinet-phase="menu"] .cloud-hopper-intro .cloud-hopper-scores .race-podium { font-size: 11px; }
  body[data-cabinet-phase="menu"] .cloud-hopper-intro .cloud-hopper-scores .race-podium li { padding: 3px 5px; }
  body[data-cabinet-phase="menu"] .cloud-hopper-panel.cloud-hopper-intro { padding: 8px; gap: 4px; }
  body[data-cabinet-phase="menu"] .cloud-hopper-intro .game-intro-title { font-size: 20px; }
  body[data-cabinet-phase="menu"] .cloud-hopper-intro .game-intro-goal { font-size: 11px; }
  /* The glass's phone list scrolls down its rows instead, two cards a row. */
  body[data-cabinet-phase="menu"] .cloud-hopper-intro .cloud-hopper-levels { --level-gap: 5px; grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow-x: hidden; overflow-y: auto; scroll-snap-type: y proximity; align-content: start; }
  body[data-cabinet-phase="menu"] .cloud-hopper-level { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 2px 5px; padding: 4px; text-align: left; }
  body[data-cabinet-phase="menu"] .cloud-hopper-level-frame { grid-row: span 2; }
  body[data-cabinet-phase="menu"] .cloud-hopper-level-art { height: 36px; }
  body[data-cabinet-phase="menu"] .cloud-hopper-level-number { display: none; }
  body[data-cabinet-phase="menu"] .cloud-hopper-intro .cloud-hopper-level-name { font-size: 11px; margin: 0; letter-spacing: 0; }
  body[data-cabinet-phase="menu"] .cloud-hopper-intro .cloud-hopper-level-note { font-size: 10px; margin: 0; }
}
.cabinet-exit { position: fixed; top: calc(12px + var(--safe-top)); left: calc(12px + var(--safe-left)); bottom: auto; z-index: 100; padding: 8px 12px; }

/* Cloud Hopper's action palette throughout the arcade: gold plays, green chooses,
   light stone goes back/resumes, dark stone leaves. Text and pressed/disabled states remain explicit. */
.arcade-game :is(.race, .presets) button {
  --arcade-button: linear-gradient(#a6d97f, #5f9e3f);
  --arcade-button-hover: linear-gradient(#c2e8a3, #a6d97f);
  background: var(--arcade-button); color: #13260b;
}
.arcade-game :is(.race, .presets) button:is(.game-intro-go, .race-go, .act,
  [data-action$="-start"], [data-action$="-again"], [data-action$="-next"], [data-action="orbit-launch"], [data-action="carnival-act"]) {
  --arcade-button: linear-gradient(#ffe27a, #f0b62a);
  --arcade-button-hover: linear-gradient(#fff0a8, #ffe27a); color: var(--ink);
}
.arcade-game :is(.race, .presets) button:is([data-action$="-pause"], [data-action$="-resume"],
  [data-action="garage"], [data-action="orbit-build"], [data-action="mine-card-close"], .panel-fold) {
  --arcade-button: linear-gradient(#bdb8b0, #87827b);
  --arcade-button-hover: linear-gradient(#d1cdc6, #bdb8b0); color: var(--ink);
}
.arcade-game :is(.race, .presets) button:is([data-action="leave"], [data-action="mine-abandon"]) {
  --arcade-button: linear-gradient(#77706a, #4a4541);
  --arcade-button-hover: linear-gradient(#8a837c, #77706a); color: var(--paper);
}
.arcade-game :is(.race, .presets) button:is(:hover, .virtual-hover):not(:disabled) { background: var(--arcade-button-hover); }
.arcade-game :is(.race, .presets) button:disabled { opacity: 0.55; cursor: default; }
/* The same palette on Block Frenzy's and The Ember Den's cards and the arcade hall's prize counter, none of them an
   arcade game's scene, so every game card's buttons match: gold plays, green chooses, light stone goes back, dark
   stone leaves. The Den's own button look stays off its title card. */
:is(#block, #poker, #arcade-ui) :is(.race-results, .race-pause) .actions button {
  --arcade-button: linear-gradient(#a6d97f, #5f9e3f);
  --arcade-button-hover: linear-gradient(#c2e8a3, #a6d97f);
  background: var(--arcade-button); color: #13260b;
}
:is(#block, #poker, #arcade-ui) :is(.race-results, .race-pause) .actions button:is(.game-intro-go, [data-action$="-start"], [data-action$="-again"], [data-action$="-next"]) {
  --arcade-button: linear-gradient(#ffe27a, #f0b62a);
  --arcade-button-hover: linear-gradient(#fff0a8, #ffe27a); color: var(--ink);
}
:is(#block, #poker, #arcade-ui) :is(.race-results, .race-pause) .actions button[data-action="leave"] {
  --arcade-button: linear-gradient(#77706a, #4a4541);
  --arcade-button-hover: linear-gradient(#8a837c, #77706a); color: var(--paper);
}
:is(#block, #poker, #arcade-ui) :is(.race-results, .race-pause) .actions button.prize-close {
  --arcade-button: linear-gradient(#bdb8b0, #87827b);
  --arcade-button-hover: linear-gradient(#d1cdc6, #bdb8b0); color: var(--ink);
}
:is(#block, #poker, #arcade-ui) :is(.race-results, .race-pause) .actions button:is(:hover, .virtual-hover):not(:disabled) { background: var(--arcade-button-hover); }
.cabinet-exit { background: linear-gradient(#77706a, #4a4541); color: var(--paper); }
.cabinet-exit:hover { background: linear-gradient(#8a837c, #77706a); }

/* Arcade player controls remain reachable above game cards, including Cloud Hopper. */
body.arcade-game .cloud-hopper-panel { z-index: 40; }

/* A destination is a named action using the scene's existing travel rules. The dialog is the page's pop-up: the
   modal's planked frame, its mode line, legend, list and choice each on a stone slab, stone buttons and one amber action. Its
   title and choice stay in view as it scrolls, each on a plank of its own; the map's own colours are the atlas's. */
.destination-map { width: min(1120px, calc(100vw - 24px)); max-height: calc(100dvh - 24px - var(--safe-top) - var(--safe-bottom)); overflow: auto; overscroll-behavior: contain; padding: 18px; }
.destination-map .panel-head { position: sticky; top: -18px; z-index: 4; align-items: center; margin: -18px -18px 12px; padding: 12px 18px 10px; background: var(--plank); border-bottom: 2px solid var(--wood-edge); }
.destination-map .panel-head h2 { margin: 0; color: var(--paper); font-size: clamp(16px, 2vw, 20px); letter-spacing: 0.04em; }
.destination-map-mode { color: rgba(243, 239, 228, 0.88); font-size: 12px; line-height: 1.5; margin: 0 0 12px; padding: 7px 12px; letter-spacing: .06em; background: var(--slab-dark); border: 2px solid var(--stone-dk); border-radius: 9px 7px 10px 8px; box-shadow: var(--tablet-shadow); }
.destination-map-mode:empty { display: none; }
/* The map's column is as wide as the map the window's height allows (never so wide the list has under 270px), and
   the list takes the rest, its groups side by side where two fit: no bare wood stands beside either. */
.destination-map-layout { display: grid; grid-template-columns: min(calc((100dvh - 305px) * 1.2), calc(100% - 288px)) minmax(0, 1fr); gap: 18px; align-items: start; }
.destination-map-survey { min-width: 0; }
.destination-map-legend { margin-top: 10px; padding: 8px 12px; }
.destination-atlas { width: min(100%, calc((100dvh - 305px) * 1.2)); margin-inline: auto; position: relative; aspect-ratio: 6 / 5; overflow: hidden; border: 2px solid var(--stone-dk); border-radius: 6px; background: #112d35; isolation: isolate; }
.destination-atlas[hidden] { display: none; }
.destination-atlas canvas, .destination-atlas svg, #destination-atlas-pins { position: absolute; inset: 0; width: 100%; height: 100%; }
.destination-atlas svg { pointer-events: none; }
.destination-atlas-marker { position: absolute; transform: translate(-50%, -50%); width: 44px; height: 44px; min-width: 44px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: #fff7de; font-size: 14px; line-height: 1; cursor: pointer; }
.destination-atlas-marker[hidden] { display: none; }
.destination-atlas-marker svg { position: static; width: 28px; height: 28px; padding: 4px; background: #203e3b; border: 1px solid #dcceaa; border-radius: 50%; fill: none; stroke: currentColor; stroke-width: 1.8; }
.destination-atlas-marker small { position: absolute; right: 0; bottom: 0; font-size: 10px; background: #203e3b; color: #fff7de; padding: 1px 3px; border-radius: 4px; }
.destination-pin-label { display: none; position: absolute; top: 43px; max-width: 100px; width: max-content; padding: 3px 5px; font-size: 11px; line-height: 1.2; background: #102e39; border-radius: 4px; color: #fff7de; pointer-events: none; }
.destination-atlas-marker:is(:hover,:focus-visible,[aria-pressed="true"]) .destination-pin-label { display: block; }
.destination-atlas-marker:hover, .destination-atlas-marker[aria-pressed="true"] { background: #efd17e; color: #182d2a; border-color: #fff2c8; z-index: 1; }
.destination-atlas-marker:is(:hover,[aria-pressed="true"]) svg { background: #efd17e; border-color: #182d2a; }
.atlas-callout { stroke: #f1e7c8; stroke-width: 1.5; }
.atlas-anchor { fill: #fff2c8; }
.atlas-route { stroke: #f5d47a; stroke-width: 2.5; stroke-dasharray: 6 7; }
.atlas-selected { fill: #e8cc5622; stroke: #f6d67d; stroke-width: 3; }
.atlas-origin { fill: #102e39; stroke: #9de9eb; stroke-width: 3; }
.atlas-origin-core { fill: #9de9eb; }
.destination-map-key { display: flex; flex-wrap: wrap; gap: 5px 14px; margin: 0; color: rgba(243, 239, 228, 0.78); font-size: 11px; line-height: 1.5; }
.destination-map-key span:first-child { color: #9de9eb; }.destination-map-key span:nth-child(2) { color: #f6d67d; }
.destination-map-mapnote { margin: 4px 0 0; font-size: 11px; line-height: 1.5; color: rgba(243, 239, 228, 0.62); }
.destination-map-mapnote:empty { display: none; }
#destination-map-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-content: start; gap: 8px 10px; max-height: 590px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(243, 239, 228, 0.2) transparent; padding: 8px 10px; background: var(--slab-dark); border: 2px solid var(--stone-dk); border-radius: 9px 7px 10px 8px; box-shadow: var(--tablet-shadow); }
#destination-map-list section { min-width: 0; }
#destination-map-list section[data-group="Play"] { grid-column: 1 / -1; }
#destination-map-list h3 { color: rgba(243, 239, 228, 0.5); margin: 4px 0 6px; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; }
#destination-map-list button { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 100%; min-height: 52px; padding: 9px 12px; margin-bottom: 5px; text-align: left; white-space: normal; color: var(--paper); background: var(--stone-dk); border: 1px solid var(--stone-lt); border-radius: 6px; cursor: pointer; }
#destination-map-list button:hover, #destination-map-list button:focus-visible { background: var(--stone); }
#destination-map-list button strong { font-size: 13px; }
#destination-map-list button span { color: rgba(243, 239, 228, 0.7); font-size: 11px; line-height: 1.4; font-weight: normal; }
#destination-map-list button[aria-current] { border-color: rgba(243, 239, 228, 0.5); }
#destination-map-list button[aria-pressed="true"] { background: var(--stone); border-color: var(--accent); box-shadow: inset 3px 0 var(--accent); }
.destination-map-preview { position: sticky; bottom: -8px; z-index: 3; display: flex; align-items: center; gap: 18px; justify-content: space-between; margin: 12px 0 0; padding: 10px 14px; background: var(--slab-dark); border: 2px solid var(--stone-dk); border-radius: 9px 7px 10px 8px; box-shadow: var(--tablet-shadow); }
.destination-map-tools, #destination-map-layers, .destination-map-tabs, .destination-map-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.destination-map-tools { justify-content: space-between; margin-bottom: 10px; }
.destination-map-tools button, #destination-map-guide { min-height: 44px; min-width: 44px; margin: 0; padding: 8px 12px; color: var(--paper); background: var(--stone); border: 2px solid var(--wood-edge); border-radius: 6px; font-size: 12px; font-weight: 700; cursor: pointer; }
.destination-map-tools button:hover, #destination-map-guide:not(:disabled):hover { background: var(--stone-lt); }
.destination-map-tools button[aria-pressed="true"] { background: linear-gradient(#f0b05a, var(--accent)); color: var(--ink); }
#destination-map-guide { border-color: var(--stone-lt); }
#destination-map-guide:disabled { opacity: .5; cursor: default; }
.destination-map-tabs { display: none; }
#destination-map-layers[hidden], #destination-map-list button[hidden], #destination-map-list section[hidden] { display: none; }
#destination-return, #destination-waypoint { position: fixed; z-index: 46; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 24px); padding: 8px 12px; border: 1px solid #d9c28c; border-radius: 10px; background: #192a29f5; color: #fff1cc; }
#destination-return { top: calc(132px + var(--safe-top)); min-height: 44px; }
#destination-waypoint { top: calc(185px + var(--safe-top)); display: flex; align-items: center; gap: 10px; width: max-content; font-size: 12px; }
#destination-waypoint-arrow { display: inline-block; font-size: 28px; }
#destination-waypoint-stop { min-width: 44px; min-height: 44px; margin: 0; }
#destination-return[hidden], #destination-waypoint[hidden], #destination-waypoint-arrow[hidden] { display: none; }
.destination-map-preview > div { min-width: 0; }
.destination-map-eyebrow { margin: 0 0 5px; font-size: 9px; font-weight: 700; letter-spacing: .14em; color: var(--accent-text); }
#destination-map-selection { margin: 0 0 4px; font-size: 17px; color: var(--paper); }
#destination-map-detail { margin: 0; max-width: 650px; line-height: 1.5; color: rgba(243, 239, 228, 0.78); font-size: 12px; }
#destination-map-go { flex-shrink: 0; max-width: 260px; min-height: 44px; white-space: normal; padding: 8px 18px; border: 2px solid var(--wood-edge); border-radius: 6px; background: linear-gradient(#e2a04a, var(--accent)); color: var(--ink); font-size: 14px; font-weight: bold; box-shadow: 0 3px 0 var(--nail); cursor: pointer; }
#destination-map-go:not(:disabled):hover { background: linear-gradient(#f0b05a, #e2a04a); }
#destination-map-go:disabled { opacity: .5; cursor: default; }
#destination-map-status { margin: 10px 0 0; font-size: 12px; line-height: 1.5; }
/* Empty, the status keeps its place in the page for screen readers and takes none on screen. */
#destination-map-status:empty { margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
.destination-map button:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }
#destination-map-close { min-width: 44px; min-height: 44px; }
.destination-map-receipt { position: fixed; z-index: 46; top: calc(68px + var(--safe-top)); left: 50%; transform: translateX(-50%); width: max-content; max-width: min(470px, calc(100vw - 32px)); padding: 13px 18px; border: 1px solid #e9d189; border-radius: 12px; background: #192a29ed; color: #fff1ce; box-shadow: 0 5px 24px #0008; font-size: 13px; line-height: 1.5; pointer-events: none; animation: map-arrival .32s ease-out; }
.destination-map-receipt[hidden] { display: none; }
.destination-map-receipt[data-kind="warp"] { border-color: #a7efd8; box-shadow: 0 0 0 6px #8ad7c61a, 0 5px 24px #0008; }
#destination-map-effect { position: fixed; inset: 0; z-index: 44; pointer-events: none; animation: map-warp-settle .45s ease-out both; }
#destination-map-effect[hidden] { display: none; }
@keyframes map-warp-settle { from { box-shadow: inset 0 0 100px 20px #79c9b54d; } to { box-shadow: inset 0 0 0 0 #79c9b500; } }
@keyframes map-arrival { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
@media (prefers-reduced-motion: reduce) { .destination-map-receipt { animation: none; } #destination-map-effect { display: none; animation: none; } }
@media (max-width: 760px) {
  .destination-map-tools button { padding: 6px; font-size: 11px; }
  #destination-map-guide { font-size: 13px; }
  .destination-map-tabs { display: flex; }
  .destination-map-tabs, #destination-map-layers { width: 100%; flex-wrap: nowrap; }
  .destination-map-tabs button, #destination-map-layers button { flex: 1 1 0; min-width: 0; }
  .destination-map[data-display="map"] #destination-map-list, .destination-map[data-display="list"] .destination-map-survey { display: none; }
  .destination-map-actions { width: 100%; flex-wrap: nowrap; }
  .destination-map-actions button { flex: 1; }
  .destination-map { padding: 12px; }.destination-map .panel-head { top: -12px; margin: -12px -12px 10px; padding: 10px 12px 8px; }
  .destination-map-layout { grid-template-columns: 1fr; gap: 12px; }
  #destination-map-list { max-height: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #destination-map-list section[data-group="Play"] { grid-column: 1 / -1; }
  .destination-map-preview { position: static; gap: 10px; flex-direction: column; align-items: stretch; padding: 10px 12px; }
  #destination-map-go { max-width: none; width: 100%; }
  #destination-map-detail { font-size: 11px; }
}
@media (max-height: 540px) {
  .destination-atlas { width: 100%; }
  .destination-map-preview { position: static; }
  .destination-map-layout { grid-template-columns: minmax(0, 1fr) 230px; }
  #destination-map-list { grid-template-columns: 1fr; max-height: none; }
}
@media (max-height: 540px) and (max-width: 520px) { .destination-map-layout { grid-template-columns: 1fr; } }
@media (max-width: 380px) { #destination-map-list { grid-template-columns: 1fr; } }

/* Block Frenzy's menu: dark backing behind every line of text on the wood, so it reads. */
#block-board .garage-head,
#block-board .garage-col {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(18, 11, 6, 0.74);
}

#block-board .section-head,
#block-board .help,
#block-board label,
#block-board summary {
  color: #f7ecd8;
}

/* Block Frenzy's in-play help card. */
.block-help {
  position: absolute;
  z-index: 15;
  left: 50%;
  top: 20%;
  transform: translateX(-50%);
  width: min(460px, calc(100% - 24px));
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(18, 11, 6, 0.92);
  color: #f7ecd8;
  font-size: 13px;
}

.block-tip {
  color: #ffd27a !important;
}

/* Block Frenzy's controls list: whole groups in a grid that is three across when wide, two when middling and one when
   narrow (by the list's own width), each group's rows aligned in two columns: key caps, then a short action. */
@media (min-width: 900px) {
  #block-board:has(.block-controls[open]) {
    width: min(94vw, 1060px);
    max-width: min(94vw, 1060px);
  }
}

/* A small screen scrolls the list inside the panel instead. */
@media (max-width: 899px) {
  #block-board .block-keys {
    max-height: 42vh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

.block-keys {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 10px 18px;
  align-items: start;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(18, 11, 6, 0.82);
  color: #f7ecd8;
  font-size: 12px;
}

.block-key-group {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 8px;
  row-gap: 3px;
  align-items: center;
}

.block-key-group h4 {
  grid-column: 1 / -1;
  margin: 0 0 2px;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(255, 210, 122, 0.25);
  color: #ffd27a;
  font-size: 12px;
}

.block-key-group div {
  display: contents;
}

.block-key-group div > span:last-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.block-key-caps {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 2px;
}

.block-key-caps i {
  font-style: normal;
  opacity: 0.7;
}

.block-keys kbd,
.block-key-part kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 4px;
  border: 1px solid rgba(255, 210, 122, 0.45);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffd27a;
  font: inherit;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.block-key-part {
  white-space: nowrap;
}

.block-live { margin: 8px 0; }
.block-live-sizes, .block-live-buttons { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.block-live-list { list-style: none; margin: 4px 0; padding: 0; font-size: 11px; }
/* The watch deck's banner on the planks, its buttons the game's own wooden foot buttons. */
.block-watch { position: absolute; top: 56px; right: 12px; display: flex; gap: 8px 10px; align-items: center; flex-wrap: wrap; justify-content: center; max-width: min(460px, calc(100% - 24px)); padding: 10px 16px; background: var(--planks); color: var(--paper); border: 3px solid var(--wood-edge); border-radius: var(--radius); box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 8px 20px rgba(0, 0, 0, 0.35); font-size: 13px; font-weight: 700; text-align: center; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55); pointer-events: auto; }
.block-watch .foot-button { min-height: 32px; padding: 0 12px; font-size: 11px; }
@media (pointer: coarse) { .block-watch .foot-button { min-height: 40px; } }
/* On a phone the scoreboard fills the top left, so the banner sits low, clear of it and above the thumb sticks. */
@media (max-width: 720px) { .block-watch { top: auto; left: 12px; right: 12px; bottom: calc(196px + var(--safe-bottom)); } }
/* The watch deck's scoreboard: a planked card like the game's other panels (the voice card's and the modals' planks, wood
   edge and drop shadow), its numbers in the team colours of the board's score chips, the clock on a dark slab. */
.block-viewer-board { position: absolute; top: 56px; left: 12px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; max-width: calc(100% - 24px); box-sizing: border-box; padding: 8px 14px 10px; background: var(--planks); color: var(--paper); border: 3px solid var(--wood-edge); border-radius: var(--radius); box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.35); font-weight: 700; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55); pointer-events: none; }
.block-board-stats { flex-basis: 100%; border-collapse: collapse; padding: 4px 8px; background: var(--slab-dark); border: 2px solid var(--stone-dk); border-radius: 9px 7px 10px 8px; font-size: 12px; color: var(--paper); }
.block-board-stats th, .block-board-stats td { padding: 1px 6px 1px 0; text-align: right; font-weight: normal; }
.block-board-stats th { opacity: 0.8; }
.block-board-stats th:first-child, .block-board-stats td:first-child { text-align: left; max-width: 110px; overflow: hidden; }
.block-board-stats tr[data-side="blue"] td { color: #9cc8ff; }
.block-board-stats tr[data-side="red"] td { color: #ffb0a6; }
.block-board-side { display: flex; flex-direction: column; align-items: center; min-width: 58px; font-size: clamp(12px, 1.4vw, 15px); text-transform: uppercase; letter-spacing: 0.12em; }
.block-board-side b { font-size: clamp(34px, 5vw, 56px); line-height: 1; font-variant-numeric: tabular-nums; }
.block-board-side[data-side="blue"] b { color: #9cc8ff; }
.block-board-side[data-side="red"] b { color: #ffb0a6; }
.block-board-mid { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.block-board-mid small { font-size: clamp(12px, 1.4vw, 15px); letter-spacing: 0.06em; }
.block-board-mid small:last-child { padding: 2px 10px; background: var(--slab-dark); border: 2px solid var(--stone-dk); border-radius: 8px; font-size: clamp(16px, 2vw, 22px); font-variant-numeric: tabular-nums; }
/* A phone: a smaller card, so it leaves the field in view under it. */
@media (max-width: 720px) { .block-viewer-board { gap: 4px 10px; padding: 6px 10px 8px; } .block-board-side { min-width: 44px; } .block-board-side b { font-size: 30px; } }

/* Clanktown's mirage (`poseMirage` in scene-block.js): inside the zone round the Mainframe, a pink-and-teal glitch tint,
   still scan lines and a warning ring at the screen's edge. Drawn plainly over the game, not blended into it, and never
   moved: a full-screen blended or animated layer costs a weak GPU a pass every frame, just where the fighting is. */
.block-mirage {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    repeating-linear-gradient(0deg, rgba(56, 245, 224, 0.07) 0 2px, transparent 2px 6px),
    radial-gradient(ellipse at 50% 50%, rgba(255, 79, 216, 0.06) 40%, rgba(255, 79, 216, 0.22) 80%, rgba(56, 245, 224, 0.32) 100%);
  box-shadow: inset 0 0 0 3px rgba(255, 79, 216, 0.55), inset 0 0 60px rgba(56, 245, 224, 0.35);
}
.block-mirage[hidden] { display: none; }

/* Block Frenzy's multiplayer panel: the next step stands out, Leave doesn't; picks a match has set are muted. */
.block-live-buttons button { padding: 8px 14px; border: 2px solid #c8791f; border-radius: 6px; background: #e8962e; color: #2b1b10; font: inherit; font-weight: 700; cursor: pointer; }
.block-live-buttons button.is-leave, #block-live-wait, #block-live-watch { border-color: #6d5a44; background: transparent; color: #e9dfcf; font-weight: 400; }
.block-side:disabled { opacity: 0.35; cursor: not-allowed; }
/* Block Frenzy's trophy screen (`finish` in scene-block.js). The card is a frame round an open window: the scene's
   camera frames the winners' 3D podium in `#block-trophy-stage`, so the wood boards sit above and below it and the cave
   dims round the card. Cloud Hopper's results look: the gold pixel-block title, big glowing numbers, buttons coloured by
   what they do. The winning side's colour comes from `data-team`. */
#block-results.block-trophy {
  --trophy: #3a8dff;
  --trophy-light: #9cc8ff;
  display: flex;
  flex-direction: column;
  width: min(760px, calc(100vw - 20px - var(--safe-left) - var(--safe-right)));
  height: min(900px, calc(100dvh - 20px - var(--safe-top) - var(--safe-bottom)));
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: 0 0 0 100vmax rgba(8, 6, 4, 0.42);
  text-align: center;
}
#block-results.block-trophy[data-team="red"] { --trophy: #ff4a3a; --trophy-light: #ffb0a6; }
#block-results.block-trophy[hidden] { display: none; }
.block-trophy-head, .block-trophy-board {
  position: relative;
  border: 3px solid var(--wood-edge);
  background: var(--planks);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.35);
}
.block-trophy-head { flex: none; padding: 10px 14px 8px; border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; }
.block-trophy-head .game-intro-kicker { margin: 0 0 4px; }
.block-trophy-head .game-intro-title {
  margin: 0;
  color: #f5c542;
  font-size: 46px;
  filter: drop-shadow(0 3px 0 #7a3f0c) drop-shadow(0 3px 0 #4a2306) drop-shadow(0 0 16px rgba(255, 200, 60, 0.7));
  animation: block-trophy-drop 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.35) both;
}
/* The open window: only its sides are wood, so the podium shows through between the boards. */
.block-trophy-stage {
  position: relative;
  flex: 1 1 0;
  min-height: 150px;
  border-left: 3px solid var(--wood-edge);
  border-right: 3px solid var(--wood-edge);
  /* A warm vignette over the view: the light reads as sunset gold and the sky darkens at the edges against either side. */
  background: radial-gradient(ellipse at 50% 52%, transparent 30%, rgba(120, 48, 6, 0.35) 72%, rgba(60, 20, 4, 0.7) 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 216, 74, 0.35), inset 0 0 40px rgba(255, 200, 60, 0.25);
  pointer-events: none;
  overflow: hidden;
}
/* Gold sparkles twinkling over the podium: one layer of small dots, nothing repaints but its opacity. */
.block-trophy-sparkles {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 14% 24%, #fff6c8 0 2px, transparent 3px),
    radial-gradient(circle at 82% 18%, #ffd84a 0 3px, transparent 4px),
    radial-gradient(circle at 26% 70%, #ffd84a 0 2px, transparent 3px),
    radial-gradient(circle at 72% 62%, #fff6c8 0 2px, transparent 3px),
    radial-gradient(circle at 90% 44%, #ffe9a0 0 2px, transparent 3px),
    radial-gradient(circle at 8% 52%, #ffe9a0 0 3px, transparent 4px);
  animation: block-trophy-twinkle 1.6s ease-in-out infinite alternate;
}
.block-trophy-banner {
  position: absolute;
  left: 50%;
  bottom: 8px;
  margin: 0;
  padding: 6px 22px 7px;
  border: 3px solid rgba(0, 0, 0, 0.45);
  border-radius: 4px;
  background: linear-gradient(var(--trophy-light), var(--trophy) 55%);
  color: #fff;
  font-size: 26px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55);
  white-space: nowrap;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 0 22px var(--trophy);
  transform: translateX(-50%) rotate(-2deg);
  animation: block-trophy-pop 0.5s 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.5) both;
}
.block-trophy-board {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 14px 14px;
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  animation: block-trophy-rise 0.4s 0.1s ease-out both;
}
/* The score and the round's time share one row. */
.block-trophy-tally { display: flex; align-items: center; justify-content: center; gap: 28px; flex-wrap: wrap; }
.block-trophy-score { display: flex; align-items: baseline; justify-content: center; gap: 14px; margin: 0; line-height: 1; }
.block-trophy-score i { color: var(--paper); font-size: 34px; font-style: normal; opacity: 0.7; }
.block-final { font-size: 64px; font-variant-numeric: tabular-nums; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.55), 0 0 18px currentColor; }
.block-final[data-team="blue"] { color: #58b4ff; }
.block-final[data-team="red"] { color: #ff7a5c; }
.block-trophy-time { margin: 4px 0 2px; color: #f5c542; font-size: 34px; font-variant-numeric: tabular-nums; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5), 0 0 12px rgba(255, 200, 60, 0.45); }
.block-trophy-board .help { margin: 0 0 8px; text-wrap: balance; }
/* The two sides, styled as Cloud Hopper's shared top 10; the winners' panel lit in gold. */
.block-trophy-sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; text-align: left; }
.block-side-panel { padding: 4px 8px 6px; border: 2px solid var(--stone-dk); border-radius: 9px 7px 10px 8px; background: var(--tablet); box-shadow: var(--tablet-shadow); }
.block-side-panel.won { border-color: #f5c542; box-shadow: var(--tablet-shadow), 0 0 0 2px rgba(245, 197, 66, 0.35), 0 0 18px rgba(245, 197, 66, 0.35); }
.block-side-panel h3, .block-side-panel li { display: grid; grid-template-columns: minmax(0, 1fr) 6ch 6ch 6ch 6ch; align-items: baseline; gap: 4px; }
.block-side-panel h3 { margin: 2px 0 4px; font-size: 14px; }
.block-side-panel[data-team="blue"] h3 span { color: #58b4ff; }
.block-side-panel[data-team="red"] h3 span { color: #ff7a5c; }
.block-side-panel.won h3 span::after { content: " ★"; color: #f5c542; }
.block-side-panel h3 small { color: var(--muted); font-size: 10px; text-align: right; text-transform: uppercase; }
.block-side-panel ol { margin: 0; padding: 0; list-style: none; }
.block-side-panel li { padding: 3px 4px; border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 13px; }
/* A long player name stays readable, including on touch where there is no title hover. */
.block-side-panel li span { overflow-wrap: anywhere; }
.block-side-panel li b { text-align: right; font-variant-numeric: tabular-nums; }
.block-side-panel li.you { background: rgba(245, 197, 66, 0.16); border-radius: 4px; }
.block-side-panel li.mvp span::before { content: "♛ "; color: #f5c542; }
/* The highlights as medals. */
.block-badges { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; text-align: left; }
.block-badge { display: grid; grid-template-columns: 22px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 4px 8px; border: 2px solid rgba(0, 0, 0, 0.35); border-radius: 8px; background: rgba(0, 0, 0, 0.22); }
.block-badge::before { content: ""; grid-row: 1 / 3; width: 18px; height: 18px; border: 2px solid rgba(0, 0, 0, 0.45); border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6c8, #f5c542 45%, #a8720f); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); }
.block-badge[data-medal="silver"]::before { background: radial-gradient(circle at 35% 30%, #ffffff, #c9ced6 45%, #7c8290); }
.block-badge[data-medal="bronze"]::before { background: radial-gradient(circle at 35% 30%, #ffe1c2, #d0874a 45%, #7d4618); }
.block-badge[data-medal="wood"]::before { border-radius: 4px; background: linear-gradient(#b98a52, #6f4a25); }
.block-badge span { color: var(--accent-text); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.block-badge b { font-size: 13px; overflow-wrap: anywhere; }
/* The buttons stay in view: if the board must scroll on a very short screen, they hold to its foot. */
.block-trophy-board .actions { position: sticky; bottom: 0; z-index: 1; margin-top: 8px; padding-top: 4px; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--wood); box-shadow: 0 0 0 6px var(--wood); border-radius: 4px; }
.block-trophy-board .actions button[data-role="go"] { background: linear-gradient(#ffe27a, #f0b62a); color: var(--ink); }
.block-trophy-board .actions button[data-role="go"]:hover, .block-trophy-board .actions button[data-role="go"].virtual-hover { background: linear-gradient(#fff0a8, #ffe27a); }
.block-trophy-board .actions button[data-role="choose"] { background: linear-gradient(#a6d97f, #5f9e3f); color: #13260b; }
.block-trophy-board .actions button[data-role="choose"]:hover, .block-trophy-board .actions button[data-role="choose"].virtual-hover { background: linear-gradient(#c2e8a3, #a6d97f); }
.block-trophy-board .actions button[data-role="leave"] { background: linear-gradient(#77706a, #4a4541); color: var(--paper); }
.block-trophy-board .actions button[data-role="leave"]:hover, .block-trophy-board .actions button[data-role="leave"].virtual-hover { background: linear-gradient(#8a837c, #77706a); }
@keyframes block-trophy-drop { from { transform: translateY(-60px) scale(1.25); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes block-trophy-pop { from { transform: translateX(-50%) rotate(-2deg) scale(0.2); opacity: 0; } to { transform: translateX(-50%) rotate(-2deg); opacity: 1; } }
@keyframes block-trophy-rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes block-trophy-twinkle { from { opacity: 0.25; } to { opacity: 1; } }
/* Wide screens: the two sides run the card's width under the score, so names have room, and the medals run three
   across under them, so the window keeps its height and nothing scrolls. */
@media (min-width: 980px) and (min-height: 600px) {
  #block-results.block-trophy { width: min(1000px, calc(100vw - 40px)); }
  .block-trophy-board { padding-bottom: 10px; }
  .block-final { font-size: 52px; }
  .block-trophy-time { font-size: 30px; margin: 0; }
  .block-trophy-board .help { margin-bottom: 6px; }
  .block-badges { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 8px 0 0; }
}
/* Phones and short screens: smaller numbers and rows, so the card fits without scrolling where it can. */
@media (max-width: 560px), (max-height: 700px) {
  #block-results.block-trophy { height: calc(100dvh - 12px - var(--safe-top) - var(--safe-bottom)); }
  .block-trophy-head { padding: 6px 10px 4px; }
  .block-trophy-head .game-intro-title { font-size: 32px; }
  .block-trophy-stage { min-height: 120px; }
  .block-trophy-tally { gap: 16px; }
  .block-trophy-banner { font-size: 18px; padding: 4px 14px 5px; }
  .block-trophy-board { padding: 6px 8px 10px; }
  .block-final { font-size: 44px; }
  .block-trophy-score i { font-size: 24px; }
  .block-trophy-time { font-size: 24px; margin: 2px 0; }
  .block-trophy-board .help { font-size: 11px; margin-bottom: 6px; }
  .block-trophy-sides { gap: 6px; }
  .block-side-panel { padding: 3px 5px 4px; }
  .block-side-panel h3, .block-side-panel li { grid-template-columns: minmax(0, 1fr) 4.5ch 3.5ch 3.5ch 3.5ch; gap: 2px; }
  .block-side-panel h3 small { font-size: 8px; }
  .block-side-panel li { font-size: 10.5px; padding: 2px; }
  .block-badges { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin-top: 6px; }
  .block-badge { grid-template-columns: 14px minmax(0, 1fr); column-gap: 5px; padding: 3px 5px; }
  .block-badge::before { width: 12px; height: 12px; }
  .block-badge span { font-size: 8px; }
  .block-badge b { font-size: 11px; }
  .block-trophy-board .actions { margin-top: 8px; gap: 6px; }
  .block-trophy-board .actions button { min-height: 38px; padding: 4px; font-size: 12px; }
}
@media (max-width: 560px) {
  .block-trophy-sides { grid-template-columns: 1fr; }
  .block-trophy-board .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .block-trophy-board .actions button[data-role="leave"] { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .block-trophy-head .game-intro-title, .block-trophy-banner, .block-trophy-board, .block-trophy-sparkles { animation: none; }
}

/* Directory text and links only: no external world is loaded to browse its entry. */
.cave-directory { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 32px - var(--safe-top) - var(--safe-bottom)); overflow-y: auto; overscroll-behavior: contain; }
.cave-directory p { font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.cave-directory h3 { font-size: 14px; margin: 20px 0 8px; color: var(--gold, #ffd84a); }
.cave-directory ul { padding: 0; list-style: none; }
.cave-directory li { padding: 12px 0; border-top: 1px solid #f3efe424; }
.cave-directory-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cave-directory-actions :is(button, a) { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; border: 1px solid var(--wood-edge); border-radius: 6px; background: var(--slab-dark); color: #f3efe4; font: inherit; font-size: 12px; cursor: pointer; }
.cave-directory-actions :is(button, a):focus-visible { outline: 3px solid #ffd84a; outline-offset: 2px; }

.cave-directory .modal-close { width: 44px; height: 44px; }

body[data-active-scene] #cave-directory-button { min-height: 44px; }

/* Duels (duel.js): the target, a challenge heard and the duel's bars, at the top left under the banner (the top centre
   is the walking directions'). */
.duel-target, .duel-invite, .duel-hud {
  position: fixed;
  left: calc(16px + var(--safe-left));
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 32px - var(--safe-left));
  padding: 8px 10px;
  color: var(--paper);
  background: rgba(22, 20, 18, 0.88);
  border: 2px solid var(--wood-edge);
  border-radius: var(--radius);
  font-size: 13px;
}
.duel-target { top: calc(76px + var(--safe-top)); }
.duel-invite { top: calc(128px + var(--safe-top)); width: min(320px, calc(100vw - 32px)); flex-wrap: wrap; justify-content: center; }
.duel-hud { top: calc(76px + var(--safe-top)); flex-direction: column; align-items: stretch; gap: 6px; }
.duel-yield { align-self: center; }
.duel-target[hidden], .duel-invite[hidden], .duel-hud[hidden], .duel-note[hidden] { display: none; }
.duel-target-name { font-weight: 700; overflow-wrap: anywhere; }
.duel-invite-text { flex-basis: 100%; margin: 0; text-align: center; font-weight: 700; }
.duel-button, .duel-yield {
  padding: 6px 12px;
  color: var(--ink);
  background: var(--accent);
  border: 2px solid var(--wood-edge);
  border-radius: 6px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.duel-button:disabled { opacity: 0.6; cursor: default; }
.duel-decline, .duel-yield { color: var(--paper); background: var(--stone-lt); }
.duel-yield { padding: 3px 10px; font-size: 11px; }
.duel-close {
  width: 28px;
  height: 28px;
  color: var(--paper);
  background: none;
  border: 0;
  font-size: 18px;
  cursor: pointer;
}
/* The panel: its title and the time left, then a row a duelist (name, bar, health, metres from the flag), one over
   the other in shared columns. */
.duel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.duel-title { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.75; }
.duel-rows { display: grid; grid-template-columns: minmax(0, auto) auto 3ch 5ch; gap: 6px 8px; align-items: center; }
.duel-side { display: contents; }
.duel-name { max-width: 14ch; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.duel-far { font-size: 11px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; opacity: 0.85; }
.duel-far[data-out="true"] { color: var(--danger); font-weight: 700; opacity: 1; }
.duel-bar { position: relative; display: block; width: min(140px, 28vw); height: 8px; background: rgba(0, 0, 0, 0.5); border-radius: 4px; overflow: hidden; }
/* Green, amber under half and orange under a quarter, as the bars over the duelists' heads; what a blow just took stays
   red behind the bar a beat (the chip follows the same width late). */
.duel-fill { position: relative; display: block; width: 100%; height: 100%; background: #4ade80; transition: width 0.15s; }
.duel-fill[data-level="mid"] { background: #f2c94c; }
.duel-fill[data-level="low"] { background: #ff9a3d; }
.duel-chip { position: absolute; inset: 0 auto 0 0; width: 100%; background: #e0261b; transition: width 0.7s ease-out 0.35s; }
.duel-hp { font-size: 11px; font-variant-numeric: tabular-nums; text-align: right; }
.duel-clock { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.duel-clock[data-low="true"] { color: var(--danger); }
.duel-note { margin: 0; color: var(--danger); font-weight: 700; }
/* A blow taken: the view's edge flashes red (duel.js fades it). */
.duel-flash {
  position: fixed;
  inset: 0;
  z-index: 29;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at center, rgba(200, 16, 16, 0) 42%, rgba(200, 16, 16, 0.5) 78%, rgba(170, 8, 8, 0.85) 100%);
}
/* The count before the first blow and how the duel ended, large over the middle of the view. */
.duel-count, .duel-result {
  position: fixed;
  left: 50%;
  top: 21%;
  z-index: 31;
  margin: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
  text-align: center;
  white-space: nowrap;
}
.duel-count, .duel-result-title {
  font-weight: 900;
  line-height: 1;
  color: #ffe27a;
  text-shadow: 0 5px 0 #24100e, -3px 0 0 #24100e, 3px 0 0 #24100e, 0 -3px 0 #24100e, 0 0 26px rgba(0, 0, 0, 0.75);
}
.duel-count { font-size: clamp(84px, 20vw, 200px); }
.duel-count[data-go="true"] { font-size: clamp(56px, 13vw, 140px); color: #ff6a4d; }
.duel-result { display: grid; justify-items: center; gap: 12px; }
.duel-result-title { font-size: clamp(46px, 11vw, 128px); letter-spacing: 0.04em; }
.duel-result[data-result="lost"] .duel-result-title { color: #ff5a4d; }
.duel-result[data-result="draw"] .duel-result-title, .duel-result[data-result="over"] .duel-result-title { color: var(--paper); }
.duel-result-line {
  max-width: calc(100vw - 32px);
  padding: 6px 14px;
  color: var(--paper);
  background: rgba(22, 20, 18, 0.88);
  border: 2px solid var(--wood-edge);
  border-radius: var(--radius);
  font-size: clamp(13px, 2.4vw, 20px);
  font-weight: 700;
  white-space: normal;
}
.duel-flash[hidden], .duel-count[hidden], .duel-result[hidden] { display: none; }
.players-duel { grid-column: 1 / -1; justify-self: start; margin-top: 6px; }
.players-duel[hidden] { display: none; }

/* In Valhodl the hover labels and the hints and messages at the foot of the screen are black with white words. */
body:is([data-active-scene="keep"], [data-active-scene="keephalls"]) .tooltip,
body:is([data-active-scene="keep"], [data-active-scene="keephalls"]) .hint,
body:is([data-active-scene="keep"], [data-active-scene="keephalls"]) .toast {
  background: rgba(8, 8, 10, 0.92);
  border-color: #2b2b30;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.6), 0 8px 20px rgba(0, 0, 0, 0.4);
  color: #f3efe4;
}

/* A land's name across the view (Valhodl on arriving, an island come to by sea): the white of the islands' names in
   the sky, glowing black, half again as large as a quest's title. */
.keep-quest-banner[data-land="true"] {
  width: min(96vw, 1300px);
}

/* A land's name: plain, half the size it was, only fading in and out over four seconds. */
.keep-quest-banner[data-land="true"][data-show] {
  animation: keep-land-banner 4s linear forwards;
}

@keyframes keep-land-banner {
  0%, 100% { opacity: 0; transform: translate(-50%, -50%); }
  20%, 75% { opacity: 1; transform: translate(-50%, -50%); }
}

.keep-quest-banner[data-land="true"] .keep-quest-banner-name {
  font-size: clamp(26px, 5.25vw, 57px);
  color: #f3efe4;
  text-shadow: none;
}

.keep-quest-banner[data-land="true"] .keep-quest-banner-kicker {
  font-size: clamp(11px, 1.65vw, 15px);
  color: #f3efe4;
  text-shadow: none;
}

/* The first time a visitor gets into a boat: W, A, S and D laid out as on a keyboard, each with the way it paddles. */
.keep-keys {
  position: fixed;
  left: 50%;
  top: 58%;
  display: grid;
  grid-template-columns: auto 48px 48px 48px auto;
  grid-template-rows: auto 48px 48px auto;
  grid-template-areas:
    ".  .  wl .  ."
    ".  .  w  .  ."
    "al a  s  d  dl"
    ".  .  sl .  .";
  align-items: center;
  justify-items: center;
  gap: 6px 6px;
  padding: 14px 18px;
  background: rgba(8, 8, 10, 0.78);
  border: 2px solid #2b2b30;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 60;
  opacity: 0;
}

.keep-keys[hidden] {
  display: none;
}

.keep-keys[data-show] {
  animation: keep-keys var(--for, 5s) linear forwards;
}

.keep-keys kbd {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 48px;
  height: 48px;
  background: linear-gradient(#f3efe4, #cfc6b4);
  border: 2px solid #6b6253;
  border-radius: 8px;
  box-shadow: 0 4px 0 #4a4337;
  font: 700 22px var(--mono);
  color: #1a1714;
}

.keep-keys-say {
  font: 700 13px var(--mono);
  letter-spacing: 0.06em;
  color: #f3efe4;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}

.keep-keys-w { grid-area: w; }
.keep-keys-a { grid-area: a; }
.keep-keys-s { grid-area: s; }
.keep-keys-d { grid-area: d; }
.keep-keys-wl { grid-area: wl; }
.keep-keys-sl { grid-area: sl; }
.keep-keys-al { grid-area: al; justify-self: end; }
.keep-keys-dl { grid-area: dl; justify-self: start; }

@keyframes keep-keys {
  0% { opacity: 0; transform: translate(-50%, -46%); }
  6% { opacity: 1; transform: translate(-50%, -50%); }
  90% { opacity: 1; transform: translate(-50%, -50%); }
  100% { opacity: 0; transform: translate(-50%, -50%); }
}

@media (prefers-reduced-motion: reduce) {
  @keyframes keep-keys {
    0% { opacity: 0; }
    6%, 90% { opacity: 1; }
    100% { opacity: 0; }
  }
}

/* The Genesis room's portal panel: the prompt at the door, the riddle, the block header filling in, the nonce
   dial and the open door's line, on the same dark panels as the room's pop-ups; a sheet at the foot on a phone. */
.genesis-portal {
  position: fixed; right: 16px; top: 84px; z-index: 40; width: min(380px, calc(100vw - 32px)); box-sizing: border-box;
  padding: 10px 12px 12px; border-radius: 12px; background: var(--gn-panel); color: var(--gn-text); font-family: var(--mono);
  font-size: 13px; line-height: 1.4; border: 1px solid var(--gn-line); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45); backdrop-filter: blur(4px);
}
.genesis-portal[hidden] { display: none; }
.genesis-portal .gp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.genesis-portal .gp-kicker { font-size: 10px; letter-spacing: 0.12em; opacity: 0.7; }
.genesis-portal .gp-x { background: none; border: 0; color: inherit; font: inherit; font-size: 18px; line-height: 1; cursor: pointer; opacity: 0.6; padding: 0 2px; }
.genesis-portal .gp-x:hover { opacity: 1; }
.genesis-portal h3 { margin: 4px 0 6px; font-size: 15px; letter-spacing: 0.08em; }
.genesis-portal p { margin: 0 0 8px; }
.genesis-portal .gp-prog { font-size: 11px; letter-spacing: 0.1em; color: var(--gn-gold); margin-bottom: 6px; }
.genesis-portal .gp-q { white-space: pre-line; font-size: 15px; line-height: 1.45; padding: 8px 10px; border-left: 3px solid var(--gn-gold); background: var(--gn-wash); border-radius: 0 8px 8px 0; }
.genesis-portal .gp-how, .genesis-portal .gp-badge { font-size: 11px; opacity: 0.75; }
.genesis-portal .gp-hint { color: var(--gn-hint); }
.genesis-portal .gp-header { width: 100%; border-collapse: collapse; font-size: 11px; margin: 6px 0 8px; table-layout: fixed; }
.genesis-portal .gp-header th { text-align: left; width: 88px; font-weight: normal; letter-spacing: 0.08em; opacity: 0.7; padding: 2px 6px 2px 0; vertical-align: top; }
.genesis-portal .gp-header td { padding: 2px 0; word-break: break-all; }
.genesis-portal .gp-header .gp-dim td { opacity: 0.35; }
.genesis-portal .gp-header .gp-mined td { color: var(--gn-teal-text); }
.genesis-portal .gp-header .gp-live td { color: var(--gn-gold); }
.genesis-portal .gp-dial { padding: 8px 10px; border-radius: 8px; background: var(--gn-wash); margin-bottom: 8px; }
.genesis-portal .gp-hash { font-size: 11px; word-break: break-all; color: var(--gn-gold); min-height: 2.8em; }
.genesis-portal .gp-hash.gp-found { color: var(--gn-btc); }
.genesis-portal .gp-zeros { font-size: 11px; opacity: 0.75; margin: 4px 0 8px; }
.genesis-portal .gp-btn { display: block; width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--gn-line); background: var(--gn-btc); color: var(--ink); font: inherit; font-size: 13px; letter-spacing: 0.1em; cursor: pointer; touch-action: none; user-select: none; }
.genesis-portal .gp-btn:hover { filter: brightness(1.08); }
.genesis-portal .gp-btn.gp-quiet { background: var(--gn-wash); color: inherit; }
@media (max-width: 720px) {
  .genesis-portal { right: 8px; left: 8px; top: auto; bottom: 96px; width: auto; max-height: 46vh; overflow: auto; }
}

/* The Genesis room's show (timechain-genesis-shows.js): its name and its caption in a strip at the foot of the screen,
   just under the hologram (the show sets `--gs-bottom`), on the room's dark panel, and beside them a read-aloud
   toggle, the voice's button while it reads, and a STOP button, none smaller than a fingertip (44 px);
   the full width, over the touch controls, on a phone, the buttons under the caption where the screen is narrow. */
.genesis-show {
  position: fixed; left: 50%; bottom: var(--gs-bottom, 18px); transform: translateX(-50%); z-index: 40; width: min(980px, calc(100vw - 32px)); box-sizing: border-box;
  display: flex; align-items: center; gap: 14px;
  padding: 8px 12px 10px 14px; border-radius: 12px; background: var(--gn-panel); color: var(--gn-text); font-family: var(--mono);
  border: 1px solid var(--gn-line); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45); backdrop-filter: blur(4px); pointer-events: auto;
  --gn-text: #efe6d2; --gn-gold: #ffd66b; --gn-teal-text: #9be4ef;
  --gn-panel: color-mix(in srgb, var(--bg) 78%, transparent); --gn-line: color-mix(in srgb, var(--fg) 18%, transparent);
}
.genesis-show[hidden] { display: none; }
.genesis-show .gs-words { flex: 1; min-width: 0; }
.genesis-show .gs-kicker { display: block; font-size: 12px; letter-spacing: 0.12em; color: var(--gn-teal-text); }
.genesis-show .gs-stop {
  flex: none; display: inline-flex; align-items: center; gap: 9px; min-width: 104px; min-height: 48px; padding: 0 16px; box-sizing: border-box;
  border: 2px solid #14110e; border-radius: 10px; background: var(--gn-gold); color: #14110e; font: inherit; font-size: 17px; font-weight: 700;
  letter-spacing: 0.1em; cursor: pointer; box-shadow: 0 0 0 1px var(--gn-gold), 0 2px 10px rgba(0, 0, 0, 0.4);
}
.genesis-show .gs-stop i { width: 13px; height: 13px; background: #14110e; border-radius: 2px; }
.genesis-show .gs-stop:hover, .genesis-show .gs-stop:focus-visible { background: #fff0b8; outline: none; }
/* Its read-aloud toggle: an outline while off (a crossed speaker), filled while on (a sounding one), and then the
   voice's button before it (so the toggle stays under the finger that pressed it), an outline naming the voice that
   reads (a press changes it); on a narrow or a low screen the toggle is its icon alone while on, so the three
   buttons keep one row. */
.genesis-show .gs-voice, .genesis-show .gs-who {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; min-width: 48px; padding: 0 12px; box-sizing: border-box;
  border: 2px solid var(--gn-teal-text); border-radius: 10px; background: transparent; color: var(--gn-teal-text); font: inherit; font-size: 13px; font-weight: 700;
  letter-spacing: 0.08em; cursor: pointer;
}
.genesis-show .gs-voice[hidden], .genesis-show .gs-who[hidden] { display: none; }
.genesis-show .gs-who { white-space: nowrap; }
.genesis-show .gs-voice[aria-pressed="true"] { background: var(--gn-teal-text); color: #14110e; }
.genesis-show .gs-voice:hover, .genesis-show .gs-voice:focus-visible, .genesis-show .gs-who:hover, .genesis-show .gs-who:focus-visible { box-shadow: 0 0 0 2px color-mix(in srgb, var(--gn-teal-text) 45%, transparent); outline: none; }
.genesis-show .gs-voice[aria-pressed="true"] .gs-cross, .genesis-show .gs-voice[aria-pressed="true"] .gs-voice-off,
.genesis-show .gs-voice[aria-pressed="false"] .gs-waves, .genesis-show .gs-voice[aria-pressed="false"] .gs-voice-on { display: none; }
.genesis-show .gs-caption { margin: 2px 0 0; font-size: 22px; line-height: 1.35; min-height: 2.7em; }
@media (max-height: 500px) {
  .genesis-show { bottom: var(--gs-bottom, 6px); padding: 4px 10px 6px; width: min(980px, calc(100vw - 220px)); gap: 10px; }
  .genesis-show .gs-kicker { font-size: 10px; }
  .genesis-show .gs-caption { font-size: 18px; line-height: 1.25; min-height: 0; }
  .genesis-show .gs-stop { min-height: 44px; min-width: 96px; font-size: 15px; padding: 0 12px; }
  .genesis-show .gs-voice, .genesis-show .gs-who { min-height: 44px; min-width: 44px; padding: 0 10px; font-size: 12px; }
  .genesis-show .gs-voice[aria-pressed="true"] .gs-voice-on { display: none; }
}
@media (max-width: 720px) {
  .genesis-show { bottom: var(--gs-bottom, 8px); width: calc(100vw - 16px); padding: 6px 8px 8px 10px; gap: 6px 8px; }
  .genesis-show .gs-kicker { font-size: 10px; }
  .genesis-show .gs-caption { font-size: 19px; line-height: 1.3; min-height: 2.6em; }
  .genesis-show .gs-stop { min-height: 44px; min-width: 88px; font-size: 15px; padding: 0 10px; gap: 7px; }
  .genesis-show .gs-voice, .genesis-show .gs-who { min-height: 44px; min-width: 44px; padding: 0 10px; font-size: 12px; }
  .genesis-show .gs-voice, .genesis-show .gs-who { margin-left: auto; }
  .genesis-show .gs-who:not([hidden]) + .gs-voice { margin-left: 0; }
  .genesis-show .gs-voice[aria-pressed="true"] .gs-voice-on { display: none; }
  /* A narrow screen: the caption the strip's full width, the buttons in a row under it. */
  .genesis-show { flex-wrap: wrap; }
  .genesis-show .gs-words { flex: 1 1 100%; }
}

/* The whitepaper's large reader (the Genesis room): the nine pages as one strip filling the height, scrolled smoothly,
   a page indicator, zoom, the bitcoin.org link; adapted from stacktoshi's monolith reader (#354, removed in #539). At
   the phone's width the page fills the width. */
.model-modal .model-actions { display: flex; gap: 8px; margin: 8px 0 2px; }
.model-modal .model-actions[hidden], .model-modal .board-nav[hidden] { display: none; }
.model-modal .model-button { flex: 1; display: block; box-sizing: border-box; font: inherit; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-align: center; text-decoration: none; cursor: pointer; padding: 10px 12px; border: 1px solid var(--gn-line); border-radius: 8px; background: var(--gn-btc); color: var(--ink); }
.model-modal .model-button:hover { filter: brightness(1.1); }
.model-modal .model-canvas.model-page.model-page-link { cursor: zoom-in; }
.wp-reader { box-sizing: border-box; width: min(calc(100vw - 24px), 880px); height: calc(100dvh - 20px); max-width: none; max-height: none; margin: auto; padding: 0; border: 0; background: transparent; color: var(--gn-text); font-family: var(--mono); overflow: visible; }
.wp-reader[open] { display: flex; flex-direction: column; gap: 8px; }
.wp-reader::backdrop { background: color-mix(in srgb, var(--bg) 84%, transparent); }
.wp-reader .wpr-panel { position: relative; flex: 1; min-height: 0; border-radius: 18px; overflow: hidden; background: var(--gn-paper); box-shadow: 0 0 0 1px var(--gn-line), 0 24px 80px rgba(0, 0, 0, 0.7); }
.wp-reader .wpr-view { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; outline: none; }
.wp-reader .wpr-view.wpr-held { cursor: grabbing; }
.wp-reader .wpr-strip { display: block; max-width: none; height: auto; transform-origin: 0 0; will-change: transform; user-select: none; -webkit-user-drag: none; }
.wp-reader .wpr-thumb { position: absolute; top: 0; right: 4px; width: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.55); opacity: 0; transition: opacity 0.35s; pointer-events: none; }
.wp-reader .wpr-view.wpr-moving .wpr-thumb { opacity: 1; transition-duration: 0.08s; }
.wp-reader .wpr-close { position: absolute; top: 10px; right: 14px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--gn-line); background: var(--gn-panel); color: inherit; font: inherit; font-size: 18px; line-height: 1; cursor: pointer; }
.wp-reader .wpr-close:hover { background: var(--gn-wash); }
.wp-reader .wpr-foot { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; font-size: 11px; letter-spacing: 0.06em; }
.wp-reader .wpr-page { color: var(--gn-gold); letter-spacing: 0.1em; white-space: nowrap; }
.wp-reader .wpr-credit { opacity: 0.7; white-space: nowrap; }
.wp-reader .wpr-site { color: var(--gn-teal-text); }
.wp-reader .wpr-about { height: 28px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--gn-teal); background: var(--gn-panel); color: var(--gn-teal-text); font: inherit; font-size: 11px; letter-spacing: 0.08em; cursor: pointer; white-space: nowrap; }
.wp-reader .wpr-about:hover { background: color-mix(in srgb, var(--gn-teal) 18%, transparent); }

.den-eyepiece[open] { inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; box-sizing: border-box; margin: 0; border: 0; padding: 0; background: radial-gradient(circle closest-side, transparent 88%, #513e27 89%, #191719 90%, #08090b 94%); color: #f7e9ce; touch-action: none; cursor: crosshair; }
.den-eyepiece::backdrop { background: transparent; }
.den-optics { position: absolute; bottom: max(12px,env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; width: max-content; max-width: 95%; padding: 8px 12px; background: #17151bf2; border: 1px solid #856845; border-radius: 8px; cursor: default; font: 14px/1.3 system-ui,sans-serif; }
.den-optics p { width: 100%; text-align: center; margin: 0 0 3px; }
.den-optics output { min-width: 3em; text-align: center; font-variant-numeric: tabular-nums; }
.den-optics button { min-height: 40px; min-width: 40px; border: 1px solid #997e59; background: #30282a; color: #fff2d7; padding: 0 .65em; border-radius: 4px; cursor: pointer; }
body:has(.den-eyepiece[open]) #stage > :not(#scene) { visibility: hidden; }

.den-portrait[open] { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; box-sizing: border-box; margin: 0; padding: 0; border: 0; background: transparent; color: #fff2d7; }
.den-portrait::backdrop { background: transparent; }
.den-portrait a:not([hidden]) { display: inline-flex; align-items: center; min-height: 40px; padding: 0 .7em; color: #ffdea0; }
body:has(.den-portrait[open]) #stage > :not(#scene) { visibility: hidden; }

body:has(.lounge-heirloom[open]) #stage > :not(#scene) { visibility: hidden; }
.lounge-heirloom { max-height: 80vh; overflow: auto; }
.lounge-heirloom > :is(button, select, input, label) { display: block; margin: .6em 0; }
.lounge-heirloom :is(button, select, input) { max-width: 100%; font: inherit; }
.lounge-heirloom button { padding: .45em .8em; cursor: pointer; }
.lounge-heirloom label input { display: block; margin-top: .4em; }
@media (min-width: 900px) {
  .lounge-heirloom { margin-right: 1.5rem; }
}

.lounge-heirloom:has(.lounge-landscape) { width: min(94vw, 1080px); max-width: 94vw; margin: auto; }
.lounge-landscape { display: block; width: 100%; height: auto; max-height: 58dvh; object-fit: contain; }


/* Seated era tables share the room’s materials and keep every wager at its familiar control. */
#poker[data-poker-era="founder"] :is(.poker-focus,.poker-sheet,.poker-leave) { --era-mark: "◇"; --pk-deep: #131914; --pk-surface: #222c21; --pk-accent: #dfbc7b; --pk-bright: #fff0ca; --era-font: Georgia,serif; }
#poker[data-poker-era="terminal"] :is(.poker-focus,.poker-sheet,.poker-leave) { --era-mark: "›"; --pk-deep: #141711; --pk-surface: #25281d; --pk-accent: #ffbd65; --pk-bright: #ffe2a8; --era-font: ui-monospace,monospace; }
#poker[data-poker-era="circuit"] :is(.poker-focus,.poker-sheet,.poker-leave) { --era-mark: "ϟ"; --pk-deep: #0a1521; --pk-surface: #152b40; --pk-accent: #8cdcf9; --pk-bright: #daf5ff; --era-font: system-ui,sans-serif; }
#poker[data-poker-era="machine"] :is(.poker-focus,.poker-sheet,.poker-leave) { --era-mark: "⚙"; --pk-deep: #161511; --pk-surface: #2d251e; --pk-accent: #eeb47b; --pk-bright: #ffe2bc; --era-font: ui-monospace,monospace; }
#poker[data-poker-era="enamel"] :is(.poker-focus,.poker-sheet,.poker-leave) { --era-mark: "◆"; --pk-deep: #1c1812; --pk-surface: #332b21; --pk-accent: #e7ae87; --pk-bright: #fff0cd; --era-font: Georgia,serif; }
#poker[data-poker-era="solar"] :is(.poker-focus,.poker-sheet,.poker-leave) { --era-mark: "◐"; --pk-deep: #211113; --pk-surface: #392125; --pk-accent: #efb383; --pk-bright: #ffe0b1; --era-font: Baskerville,Georgia,serif; }
#poker[data-poker-era="market"] :is(.poker-focus,.poker-sheet,.poker-leave) { --era-mark: "▥"; --pk-deep: #0d1919; --pk-surface: #183334; --pk-accent: #ebc072; --pk-bright: #ffedbb; --era-font: system-ui,sans-serif; }
#poker[data-poker-era="assay"] :is(.poker-focus,.poker-sheet,.poker-leave) { --era-mark: "✦"; --pk-deep: #12121b; --pk-surface: #272632; --pk-accent: #e5c58b; --pk-bright: #fff1d6; --era-font: Baskerville,Georgia,serif; }
#poker[data-poker-era="root"] :is(.poker-focus,.poker-sheet,.poker-leave) { --era-mark: "⌘"; --pk-deep: #0c1b17; --pk-surface: #1a342a; --pk-accent: #9ddab8; --pk-bright: #dbf9dc; --era-font: Georgia,serif; }
#poker[data-poker-era="slate"] :is(.poker-focus,.poker-sheet,.poker-leave) { --era-mark: "≋"; --pk-deep: #14181c; --pk-surface: #282e33; --pk-accent: #d9b888; --pk-bright: #f2e3cf; --era-font: Georgia,serif; }
#poker :is(.poker-focus,.poker-sheet,.poker-leave) {
  --pk-deepGlass: color-mix(in srgb,var(--pk-surface) 97%,transparent); --pk-line: color-mix(in srgb,var(--pk-accent) 38%,var(--pk-deep));
  --pk-soft: color-mix(in srgb,var(--pk-accent) 14%,transparent); --pk-glow: color-mix(in srgb,var(--pk-accent) 40%,transparent);
  --pk-surfaceSoft: var(--pk-surface); --pk-ink: var(--pk-deep); --pk-haloGlass: var(--pk-surface); --pk-haloSoft: var(--pk-soft);
  --pk-deepVeil: color-mix(in srgb,var(--pk-deep) 94%,transparent); --pk-haloVeil: color-mix(in srgb,var(--pk-surface) 78%,transparent);
  --pk-text:#f1efe7; --pk-muted:color-mix(in srgb,var(--pk-text) 77%,var(--pk-deep));
}
.poker-felt { position:absolute;inset:1% 4%;width:92%;height:98%;object-fit:fill;pointer-events:none;mask-image:linear-gradient(90deg,transparent,#000 3% 97%,transparent),linear-gradient(0deg,transparent,#000 4% 95%,transparent);mask-composite:intersect; }
.poker-crest { width:54px;height:54px;flex:none; }
.poker-table-head { justify-content:flex-start;border-bottom:3px double var(--pk-line); }
.poker-table-head .poker-table-tools { margin-inline-start:auto; }
.poker-table-head h3 { white-space:normal;font:500 clamp(26px,3.4vw,54px)/1.05 var(--era-font);color:var(--pk-bright); }
.poker-focus :is(.poker-table-head,.poker-rail,.poker-dock,.poker-status-strip),#poker .poker-focus :is(.poker-seat-button,.poker-actions button) { border-radius:var(--ui-r-btn); }
.poker-phone-tool,.poker-phone-tools { display:none; }
.poker-sheet { pointer-events:auto;box-sizing:border-box;width:min(100%,480px);max-width:100%;max-height:82dvh;margin:auto auto 0;overflow:auto;background:var(--pk-surface);border:1px solid var(--pk-accent);color:var(--pk-text);border-radius:var(--ui-r) var(--ui-r) 0 0;padding:16px 16px max(16px,env(safe-area-inset-bottom)); }
.poker-sheet::backdrop { background:#030804b8; }
.poker-sheet header { display:flex;align-items:center;justify-content:space-between;margin-bottom:16px;position:sticky;top:0;z-index:1; }
.poker-sheet > :not(header) { margin-inline:20px; }
.poker-sheet header h3 { margin:0;font:500 23px var(--era-font);color:#fff; }
.poker-sheet header button { min-width:44px;font-size:20px; }
.poker-sheet .poker-sizing { display:grid; }
#poker .poker-sheet-content > :is(.poker-primary, [data-remove-bot]) { width:100%; }
.poker-rail .poker-log { max-height:10rem; }
/* Each surface carries its rail material into the header and action dock. */
.poker-focus {
  font-family:system-ui,sans-serif;
  background:radial-gradient(ellipse at 32% 37%,var(--pk-haloVeil),transparent 66%),var(--pk-deepVeil);
  box-shadow:0 16px 60px #0008,inset 0 3px var(--pk-accent);
}
.poker-focus .poker-table-head { background:transparent;border-bottom:1px solid var(--pk-line); }
.poker-focus .poker-status-strip { background:transparent;border:0;padding:5px 0;margin-top:2px; }
.poker-focus .poker-crest { padding:3px;box-sizing:border-box;background:var(--pk-surface);border:1px solid var(--pk-line);border-radius:var(--ui-r); }
.poker-focus .poker-felt { inset:0;width:100%;height:100%;border-radius:39% / 43%;mask-image:none; }
.poker-focus .poker-rail { background:transparent;border-width:0 0 0 1px;padding:0 0 0 16px;margin-top:16px; }
.poker-focus .poker-dock { background:var(--pk-deep);border-width:1px 0 0; }
#poker[data-your-turn="true"] .poker-dock { border-color:var(--pk-line);box-shadow:none; }
.poker-turn.is-yours::before { content:"";display:inline-block;width:7px;height:7px;margin:0 7px 2px 0;border-radius:50%;background:var(--pk-accent); }
#poker .poker-actions button { background:var(--pk-surface);border-color:var(--pk-line);color:var(--pk-bright); }
#poker .poker-actions button:not(:disabled):hover { border-color:var(--pk-accent);background:var(--pk-soft); }
.poker-focus .poker-seat-button { font-family:system-ui,sans-serif; }
#poker .poker-seat.empty:not(.npc) .poker-seat-button {
  width:max-content;max-width:100%;min-width:44px;min-height:44px;margin:auto;padding:3px 6px;
  align-items:center;justify-content:center;display:flex;gap:0;background:var(--pk-deep);border-radius:var(--ui-r-btn);
}
#poker .poker-seat.empty:not(.npc) .poker-seat-button::before { content:none; }
/* While playing, retain the full seat target and its accessible name around a small numbered rail marker. */
body[data-poker-seated="true"] #poker .poker-seat.empty:not(.npc) .poker-seat-button {
  border:0;background:transparent;opacity:1;
}
body[data-poker-seated="true"] #poker .poker-seat.empty:not(.npc) .poker-seat-button::before {
  content:attr(data-seat-number);width:23px;height:23px;margin:0;box-sizing:border-box;
  display:grid;place-items:center;border:1px solid var(--pk-line);border-radius:50%;
  background:var(--pk-deep);color:var(--pk-muted);font:600 11px/1 system-ui,sans-serif;
}
body[data-poker-seated="true"] .poker-seat.empty:not(.npc) :is(.poker-player,.poker-stack) { display:none; }
/* The line on a computer opponent's seat lies over the foot of its plaque (its last action), out of the flow, so it
   never changes the plaque's height. */
.poker-focus .poker-seat .poker-ask { position:absolute;left:0;right:0;bottom:0;margin:0;background:var(--pk-deep);color:var(--pk-accent);border-top:1px solid var(--pk-line);border-radius:0 0 var(--ui-r-btn) var(--ui-r-btn); }
.poker-focus .poker-pot strong { font-family:var(--era-font);color:#fff8e8;text-shadow:0 1px 5px #0008; }
.poker-focus .poker-board .poker-card-slot { border-color:#f7ead74a; }
#poker[data-poker-era="founder"] .poker-table-title h3 { font-variant:small-caps;letter-spacing:.025em; }
#poker[data-poker-era="founder"] .poker-dock { border-top:3px double var(--pk-line); }
#poker[data-poker-era="terminal"] .poker-table-head { border-bottom-style:dashed; }
#poker[data-poker-era="terminal"] .poker-dock { border-top-style:dashed; }
#poker[data-poker-era="circuit"] .poker-table-head { border-image:linear-gradient(90deg,var(--pk-accent),var(--pk-line) 30%,transparent) 1; }
#poker[data-poker-era="machine"] .poker-crest { background:radial-gradient(circle at 6px 6px,#d1a779 1px,transparent 2px),radial-gradient(circle at calc(100% - 6px) calc(100% - 6px),#c59769 1px,transparent 2px),linear-gradient(155deg,#4b3c30,#27221c); }
#poker[data-poker-era="machine"] .poker-pot strong { padding:2px 7px;border:1px solid var(--pk-line);background:#211b16;font-family:ui-monospace,monospace; }
#poker[data-poker-era="enamel"] .poker-table-head { border-bottom:3px solid;border-image:repeating-linear-gradient(45deg,#ab5741 0 8px,#e1c7a5 8px 16px) 3; }
#poker[data-poker-era="enamel"] .poker-table-title h3 { font-style:italic;font-weight:700; }
#poker[data-poker-era="enamel"] .poker-actions button:not(:first-child) { color:#46281f;background:#f1dfc2;border-color:#a97758; }
#poker[data-poker-era="solar"] .poker-crest { border-radius:50%;background:linear-gradient(90deg,#643a31 50%,#29191f 50%); }
#poker[data-poker-era="solar"] .poker-table-title h3 { font-style:italic; }
#poker[data-poker-era="market"] .poker-table-title h3 { text-transform:uppercase;letter-spacing:-.035em;font-weight:700; }
#poker[data-poker-era="assay"] :is(.poker-table-head,.poker-dock) { border-style:double;border-block-width:3px; }
#poker[data-poker-era="assay"] .poker-table-title h3 { font-variant:small-caps; }
#poker[data-poker-era="root"] .poker-table-title h3 { font-style:italic; }
#poker[data-poker-era="slate"] .poker-crest { border-left:4px double var(--pk-accent); }
#poker[data-poker-era="slate"] .poker-dock { border-top:2px dashed #8c7f6b; }
@media (max-width: 720px), (pointer: coarse) and (max-width: 960px) and (max-height: 520px) {
  .poker-focus { padding:6px; }
  .poker-table-head { align-items:center;padding:4px;gap:5px; }
  .poker-crest { width:30px;height:30px; }
  .poker-table-head h3 { font-size:clamp(20px,5.5vw,32px); }
  .poker-table-head .poker-kicker { display:none; }
  .poker-table-tools .poker-free { display:none; }
  .poker-dock .poker-turn-help { visibility:hidden; }
  .poker-focus .poker-status-strip { margin-top:3px;padding:3px 7px; }
  .poker-table-layout { gap:5px; }
  .poker-arena { height:clamp(255px,43dvh,420px);margin:36px auto 40px; }
  .poker-felt { inset:1% 0;width:100%; }
  .poker-seat { width:clamp(49px,15vw,66px); }
  #poker .poker-seat-button { min-width:44px;min-height:44px;padding:3px;align-items:center; }
  .poker-seat-button :is(.poker-ask,.poker-last-action) { display:none; }
  .poker-seat .poker-face { position:relative;left:auto;top:auto;width:clamp(26px,7vw,32px);height:clamp(26px,7vw,32px);border-width:1px; }
  .poker-seat .poker-seat-emote { left:calc(50% - 13px);top:0; }
  .poker-seat-clock { left:-3px;top:-8px;padding:2px 4px;font-size:8.5px; }
  .poker-seat .poker-stack { font-size:10px; }
  .poker-center { left:18%;right:18%; }
  .poker-arena .poker-dealer { --bust:21px;--face:24px;bottom:calc(100% - 4px); }
  .poker-pot { margin:2px 0; }
  .poker-pot-chips { height:13px; }
  .poker-board { gap:2px; }
  .poker-street { margin-top:4px; }
  .poker-board .poker-card,.poker-hand .poker-card { width:clamp(27px,8vw,42px);flex:0 0 clamp(27px,8vw,42px); }
  :is(.poker-board,.poker-hand) .poker-card[data-face] { position:relative;overflow:hidden;background:linear-gradient(120deg,#fffdf4,#e5e3d7);color:#222a2b; }
  :is(.poker-board,.poker-hand) .poker-card[data-face] svg { visibility:hidden; }
  :is(.poker-board,.poker-hand) .poker-card[data-face]::before,
  :is(.poker-board,.poker-hand) .poker-card[data-face]::after { position:absolute;font:700 clamp(17px,5vw,23px)/1 Georgia,serif; }
  :is(.poker-board,.poker-hand) .poker-card[data-face]::before { content:attr(data-rank);top:2px;left:4px; }
  :is(.poker-board,.poker-hand) .poker-card[data-face]::after { content:attr(data-suit);bottom:2px;right:4px; }
  :is(.poker-board,.poker-hand) .poker-card[data-red="true"] { color:#a32c40; }
  /* The phone's dock: the private hand beside the turn line, then the help-or-notice slot and the action row, the
     same rows whether or not it is the visitor's turn. */
  .poker-dock { --pk-slot:32px;--pk-act:53px;position:sticky;bottom:0;z-index:4;padding:8px;gap:4px 8px;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-areas:"private turn" "slot slot" "act act";grid-template-rows:62px var(--pk-slot) var(--pk-act); }
  .poker-dock .poker-decision { display:contents; }
  .poker-dock:has(.poker-bots:not([hidden])) { grid-template-areas:"private turn" "slot slot" "act act" "bots bots";grid-template-rows:62px var(--pk-slot) var(--pk-act) auto; }
  .poker-private { grid-area:private;grid-template-columns:auto 1fr;column-gap:10px; }
  .poker-private .poker-hand { justify-self:start; }
  .poker-private-label,.poker-private p,.poker-private small { margin:0; }
  /* The hand's name wraps to two lines in the phone's narrow column ("Your private cards"), so two are kept, and the
     private hand fills its row rather than growing round its words. */
  .poker-private { align-self:stretch;min-height:0; }
  .poker-private small { min-height:2.8em; }
  .poker-dock .poker-turn { font-size:13px;margin:0;height:auto;align-self:stretch;text-align:end; }
  .poker-dock .poker-sizing,.poker-dock .poker-bet-help,.poker-dock [data-poker="raise"],.poker-focus .poker-rail { display:none; }
  .poker-phone-tools { display:flex;gap:4px; }
  #poker .poker-phone-tools button { flex:1;min-width:0;font-size:11px;padding:4px; }
  .poker-phone-tool { display:block; }
  .poker-phone-tools button,.poker-actions button,.poker-sheet .poker-presets button { min-height:44px; }
}

.poker-seat-cards .poker-card[data-card="back"] { position:relative; }
.poker-seat-cards .poker-card[data-card="back"]::after { content:var(--era-mark);position:absolute;inset:0;display:grid;place-items:center;border:2px double var(--pk-accent);border-radius:var(--ui-r-card);background:var(--pk-surface);color:var(--pk-accent);font:bold calc(var(--card-w) * 0.4)/1 Georgia; }
.poker-table-head h3[tabindex="-1"]:focus { outline:none; }
.poker-arena .poker-face { border-color:var(--pk-line); }
@container poker-seat (min-width:112px) {
  .poker-seat-button > .poker-ask { grid-column:1 / -1;margin-top:3px;justify-self:stretch; }
}
@media (max-width: 720px), (pointer: coarse) and (max-width: 960px) and (max-height: 520px) {
  .poker-seat-cards .poker-card[data-card="back"]::after { border-width:1px; }
  .poker-table-head .poker-table-tools { max-width:96px; }
  .poker-table-head h3 { overflow-wrap:anywhere; }
  .poker-focus .poker-phone-tools button { padding-inline:2px; }
}

@media (pointer: coarse) and (max-width: 960px) and (max-height: 520px) and (orientation: landscape) {
  .poker-focus { inset: 48px max(5px,env(safe-area-inset-right)) max(3px,var(--safe-bottom)) max(5px,env(safe-area-inset-left)); }
  .poker-table-head { min-height: 44px; }
  .poker-table-head h3 { font-size: 22px; }
  .poker-table-head .poker-kicker { display: none; }
  .poker-table-head .poker-table-tools { max-width: none; }
  /* A phone on its side: the table takes the left of the panel from under the head to the foot, and the status strip
     and the dock stand in the right, so the table gets the height. The seats spread a little further apart, their faces
     a little smaller, so nine plaques fit the shorter table without touching. */
  .poker-focus { display: grid; grid-template-columns: minmax(0,3fr) minmax(0,2fr); grid-template-rows: auto auto minmax(0,1fr); align-content: start; column-gap: 10px; }
  .poker-table-head { grid-column: 1 / -1; }
  .poker-status-strip { grid-area: 2 / 2; }
  .poker-table-layout, .poker-play { display: contents; }
  .poker-arena { grid-area: 2 / 1 / 4 / 2; height: clamp(150px, calc(100dvh - 210px), 230px); margin: 46px 0; }
  .poker-dock { grid-area: 3 / 2; align-self: start; position: static; margin-top: 6px; }
  .poker-seat .poker-face { width: 22px; height: 22px; }
  .poker-seat .poker-player { font-size: 9px; }
  .poker-seat[data-position="1"] { left: 25%; }
  .poker-seat[data-position="8"] { left: 75%; }
  .poker-seat:is([data-position="2"], [data-position="7"]) { top: 64%; }
  .poker-seat:is([data-position="3"], [data-position="6"]) { top: 22%; }
  .poker-pot-chips { display: none; }
  .poker-pot strong { font-size: 18px; }
  .poker-board .poker-card,.poker-hand .poker-card { width: 27px;flex-basis: 27px; }
  .poker-board .poker-card[data-face]::after,.poker-hand .poker-card[data-face]::after { font-size: 14px; }
  .poker-sheet { max-height: 96dvh; }
}

.poker-leave { pointer-events:auto; width:min(27rem,calc(100% - 2rem)); box-sizing:border-box; padding:22px; color:var(--pk-bright); background:var(--pk-surface); border:1px solid var(--pk-accent); border-radius:var(--ui-r); }
.poker-leave::backdrop { background:#080909bf; }
.poker-leave h3 { margin:0; font:500 23px var(--era-font); }
.poker-leave div { display:flex; flex-wrap:wrap; gap:8px; }
.poker-leave > h3, .poker-sheet > header { padding:14px 20px; color:#fff; background:radial-gradient(ellipse at 50% 0,#ffffff1c,transparent 75%),var(--felt); border-bottom:1px solid color-mix(in srgb,var(--pick) 60%,transparent); }
.poker-leave > h3 + p { margin:16px 20px; font-size:14px; line-height:1.5; }
.poker-leave > h3 ~ div { padding:0 20px 20px; }
#poker .poker-leave button { flex:1; min-height:44px; }
/* Every dialog here (leaving, the table's rules, its tools, the leaderboard) is the table itself as a card. Its own felt
   (--felt) heads it under the table's crest, its rail's leather (--rail) frames it, and its accent alone marks what is
   chosen, over a dark neutral body, so every table reads as clearly as the next. (poker-models.js `eras` has the felts.) */
#poker dialog:is(.poker-leave, .poker-sheet) { --felt:#315442; --rail:#6b3034; --pick:#e6c27a; --body:#121714; }
#poker[data-poker-era="terminal"] dialog:is(.poker-leave, .poker-sheet) { --felt:#3a4034; --rail:#574538; --pick:#ffb84d; --body:#12140f; }
#poker[data-poker-era="circuit"] dialog:is(.poker-leave, .poker-sheet) { --felt:#1b4a76; --rail:#2c3c5c; --pick:#7ed4fb; --body:#0c1520; }
#poker[data-poker-era="machine"] dialog:is(.poker-leave, .poker-sheet) { --felt:#544636; --rail:#42342d; --pick:#f2a45c; --body:#15130f; }
#poker[data-poker-era="enamel"] dialog:is(.poker-leave, .poker-sheet) { --felt:#415a37; --rail:#8a3b30; --pick:#f39a76; --body:#141611; }
#poker[data-poker-era="solar"] dialog:is(.poker-leave, .poker-sheet) { --felt:#6d3937; --rail:#4a2a2b; --pick:#ffbe7d; --body:#171112; }
#poker[data-poker-era="assay"] dialog:is(.poker-leave, .poker-sheet) { --felt:#34374f; --rail:#28243a; --pick:#f1cd6c; --body:#12121a; }
#poker[data-poker-era="slate"] dialog:is(.poker-leave, .poker-sheet) { --felt:#385060; --rail:#3b363f; --pick:#dcc19a; --body:#12171a; }
#poker dialog.poker-rules { width:min(30rem,calc(100% - 2rem)); }
#poker dialog:is(.poker-leave, .poker-sheet) { max-height:calc(100dvh - 1.5rem); overflow:auto; padding:0; color:#ece9e2; font-family:var(--ui-font); border-radius:var(--ui-r);
  background:var(--body); border:5px solid var(--rail); box-shadow:0 0 0 1px color-mix(in srgb,var(--pick) 55%,transparent),0 18px 60px #000a; }
/* (a sheet at a phone's foot keeps its last button clear of the home bar) */
#poker dialog.poker-sheet { padding-bottom:max(16px,env(safe-area-inset-bottom)); }
.poker-rules-head { display:flex; align-items:center; gap:14px; padding:14px 20px; background:radial-gradient(ellipse at 50% 0,#ffffff1c,transparent 75%),var(--felt); border-bottom:1px solid color-mix(in srgb,var(--pick) 60%,transparent); }
#poker[data-poker-era] .poker-rules-head .poker-crest { width:48px; height:48px; background:none; border:0; }
#poker .poker-rules-head div { display:block; }
.poker-rules-table { display:block; margin-bottom:3px; font-size:12px; font-weight:650; color:#fffffff0; }
.poker-rules-head h3 { color:#fff; }
dialog.poker-rules > :is(p, fieldset, .poker-rules-foot) { margin-inline:20px; }
dialog.poker-rules > p { margin-block:14px; font-size:13.5px; color:#c9c5bc; }
dialog.poker-rules fieldset { margin-block:0 14px; padding:0; border:0; min-width:0; }
dialog.poker-rules legend { padding:0; margin-bottom:6px; font-size:12.5px; font-weight:650; color:var(--pick); }
#poker dialog:is(.poker-leave, .poker-sheet) button { color:#ece9e2; background:#ffffff0d; border:1px solid #ffffff26; }
:is(.poker-leave, .poker-sheet) button, .poker-carry-actions button { font-size:13px; font-weight:700; }
#poker dialog:is(.poker-leave, .poker-sheet) button:not(:disabled):hover { background:#ffffff1a; border-color:color-mix(in srgb,var(--pick) 60%,transparent); }
#poker dialog:is(.poker-leave, .poker-sheet) button.poker-primary { color:#15110b; background:var(--pick); border-color:var(--pick); }
#poker dialog:is(.poker-leave, .poker-sheet) button[aria-pressed="true"] { color: var(--ui-on-text); background: var(--ui-on-face); border-color: var(--ui-on); box-shadow: var(--ui-on-ring); }
#poker dialog:is(.poker-leave, .poker-sheet) button.poker-primary:not(:disabled):hover { background:color-mix(in srgb,var(--pick) 88%,#fff); }
#poker dialog:is(.poker-leave, .poker-sheet) button:focus-visible { outline:2px solid #fff; outline-offset:2px; }
dialog.poker-rules .poker-rules-bots { align-items:center; flex-wrap:nowrap; }
#poker .poker-rules-bots button { flex:0 0 44px; font-size:20px; }
.poker-rules-bots output { min-width:2.5ch; text-align:center; font-size:20px; font-weight:650; }
dialog.poker-rules .poker-rules-note { margin:8px 0 0; min-height:1.5em; font-size:13px; line-height:1.4; color:#c9c5bc; }
dialog.poker-rules .poker-rules-foot { padding-bottom:20px; }
/* The chip leaderboard (poker-chips-board.js), in the table rules' clothes. */
#poker dialog.poker-chips { width:min(380px,calc(100% - 24px)); outline:none; }
.poker-chips .poker-rules-head { position:sticky; top:0; z-index:1; justify-content:space-between; flex-wrap:nowrap; }
.poker-chips .poker-rules-head h3 { font-size:21px; white-space:nowrap; }
.poker-chips .poker-rules-head span { display:block; margin-top:4px; font-size:12.5px; color:#ffffffc7; }
/* A dialog's close, in its head's corner. */
#poker dialog:is(.poker-leave, .poker-sheet) > header > button { flex:none; width:44px; min-width:0; margin-right:-10px; padding:0; font-size:22px; line-height:1; background:none; border-color:transparent; }
dialog.poker-chips > ol { margin:8px 12px; padding:0; list-style:none; }
.poker-chips li { display:grid; grid-template-columns:2ch 34px minmax(0,1fr) auto; align-items:center; gap:10px; min-height:46px; padding:0 10px 0 4px; border-radius:var(--ui-r-in); }
.poker-chips li.yours { background:color-mix(in srgb,var(--pick) 14%,transparent); }
.poker-chips li span { text-align:right; font-size:12.5px; color:#a9a59c; font-variant-numeric:tabular-nums; }
.poker-chips canvas { width:34px; height:34px; border-radius:50%; background:#ffffff12; image-rendering:pixelated; }
.poker-chips li b { font-size:14px; font-weight:600; line-height:1.2; overflow-wrap:anywhere; }
.poker-chips li strong { font-size:15px; font-weight:650; color:#a9a59c; font-variant-numeric:tabular-nums; }
.poker-chips li strong i { display:inline-block; width:6px; height:6px; margin-right:8px; vertical-align:middle; border-radius:var(--ui-r-pill); background:currentColor; animation:poker-saving 1s ease-in-out infinite alternate; }
@keyframes poker-saving { to { opacity:.25; } }
@media (prefers-reduced-motion:reduce) { .poker-chips li strong i { animation:none; } }
.poker-chips li strong.up { color:var(--pick); }
.poker-chips li strong.down { color:#ffb4a6; }
dialog.poker-chips > p { margin-block:20px; text-align:center; }
dialog.poker-chips > p:empty { display:none; }
.poker-chips footer { display:grid; grid-template-columns:1fr auto; gap:3px 12px; padding:13px 22px 15px; border-top:1px solid #ffffff1f; font-size:14px; }
.poker-chips footer output { font-weight:650; font-variant-numeric:tabular-nums; }
.poker-chips footer small { grid-column:1 / -1; font-size:12px; color:#c9c5bc; }
.poker-chips footer small:empty { display:none; }
/* Cold Storage's frozen coin: the padlock's dialog and the pretend card, frosted ice on the room's own tokens. The hash
   wraps anywhere rather than truncate; the card's words are carved in the signs' alphabet, never a code to scan. */
#poker .htlc-card { --pk-surface:#1b2f3c; --pk-deep:#0e1c25; --pk-accent:#a9d8ee; --pk-bright:#e4f6ff; --pk-ink:#0e2230; --pk-line:#a9d8ee66;
  pointer-events:auto; width:min(25rem,calc(100% - 2rem)); max-height:calc(100dvh - 2rem); overflow:auto; box-sizing:border-box; padding:20px;
  color:var(--pk-text); background:linear-gradient(160deg,#24404f,var(--pk-surface) 55%,var(--pk-deep)); border:1px solid var(--pk-accent); border-radius:var(--ui-r); box-shadow:0 0 22px #9fdcff33; }
.htlc-card::backdrop { background:#050c10bf; }
.htlc-card:focus { outline:none; }
.htlc-card h3 { margin:0; font:500 24px Georgia,serif; color:var(--pk-bright); }
.htlc-card p { margin:10px 0 0; line-height:1.45; }
.htlc-hash { padding:8px 10px; font:600 13px/1.5 ui-monospace,monospace; letter-spacing:.04em; color:var(--pk-bright); background:#0b1820; border:1px solid var(--pk-line); border-radius:var(--ui-r-in); overflow-wrap:anywhere; }
.htlc-card form { margin:14px 0 0; }
#poker .htlc-card input { box-sizing:border-box; width:100%; min-height:44px; padding:8px 10px; font:600 16px ui-monospace,monospace; letter-spacing:.08em; text-transform:uppercase; color:var(--pk-bright); background:#0b1820; border:1px solid var(--pk-accent); border-radius:var(--ui-r-btn); }
.htlc-wrong { color:#ffc2a8; font-weight:700; }
.htlc-card div { display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }
#poker .htlc-card button { flex:1; min-height:44px; }
.htlc-tablet { display:flex; justify-content:center; padding:18px 12px; background:linear-gradient(170deg,#6f7c80,#4e5a5f 60%,#3c4649); border:3px solid #2c3437; border-radius:var(--ui-r-btn); box-shadow:inset 0 2px 0 #ffffff2e, inset 0 -3px 0 #0005; }
.htlc-tablet .sign { display:block; height:34px; width:auto; max-width:100%; color:#1f2729; filter:drop-shadow(0 1px 0 #ffffff40); }
#htlc-pay p { text-align:center; }

/* Keep secondary table information in the same dialog on every screen. */
.poker-focus .poker-table-layout { display:block;max-width:1050px;margin-inline:auto; }
.poker-focus .poker-play { display:block; }
.poker-dock .poker-sizing,.poker-dock .poker-bet-help,.poker-dock [data-poker="raise"] { display:none; }
.poker-focus .poker-actions { grid-template-columns:repeat(3,minmax(0,1fr)); }
#poker[data-connection="practice"] .poker-connection { display:none; }
.poker-dock:has(.poker-turn.is-yours) .poker-turn-help { visibility:hidden; }
.poker-sheet-nav { display:flex;gap:6px;margin-bottom:12px; }
#poker .poker-sheet-nav button { flex:1;min-width:0;padding:6px;font-size:13px; }
#poker .poker-sheet-nav [aria-pressed="true"] { color: var(--ui-on-text); background: var(--ui-on-face); border-color: var(--ui-on); box-shadow: var(--ui-on-ring); }
.poker-sheet-turn { color:var(--pk-accent);font-weight:650; }
.poker-sheet .poker-log { max-height:28dvh;overflow-y:auto; }
.poker-sheet .poker-history summary,.poker-sheet .poker-table-footer summary { padding-block:8px;cursor:pointer; }
.poker-sheet .poker-rail-title { margin-block:12px; }
.poker-sheet .poker-activity h4 { margin:0 0 6px; }
@media (min-width:721px) and (min-height:521px) {
  .poker-sheet { margin:auto;border-radius:var(--ui-r); }
}
/* Where the head carries the Emote button its tools stay on one line and the button keeps its place while it is off,
   unseen and out of reach, so it coming and going never moves or wraps the head. */
@media (min-width:721px) and (not (pointer:coarse)), (min-width:961px), (min-width:721px) and (min-height:521px) {
  #poker .poker-table-tools { flex-wrap:nowrap; }
  #poker .poker-table-tools button { white-space:nowrap; }
  #poker .poker-table-tools .poker-emote-button[hidden] { display:inline-block !important; visibility:hidden; }
}
@media (max-width:720px), (pointer:coarse) and (max-width:960px) {
  #poker .poker-table-tools { max-width:none;flex-wrap:nowrap;gap:4px; }
  #poker .poker-table-tools button { padding-inline:6px;line-height:1.1; }
}
@media (pointer:coarse) and (max-width:960px) and (max-height:520px) and (orientation:landscape) {
  .poker-focus .poker-table-layout,.poker-focus .poker-play { display:contents; }
}

@media (hover:hover) and (pointer:fine) {
  .poker-seat-button[data-npc="1"] .poker-ask { position:absolute;inset:auto 0 0;margin:0;background:var(--pk-deep);visibility:hidden; }
  .poker-seat-button[data-npc="1"]:is(:hover,:focus-visible) .poker-ask { visibility:visible; }
}

/* From the physical chair, the room fills the space between the title and the betting rail. */
#poker[data-chair-view] .poker-focus {
  display:flex;flex-direction:column;max-width:none;padding:0;border:0;background:none;box-shadow:none;
}
#poker[data-chair-view] .poker-table-head,#poker[data-chair-view] .poker-status-strip {
  flex:none;padding:4px 10px;background:var(--pk-deepGlass);
}
#poker[data-chair-view] [data-poker="chair-view"] { border-color:var(--pk-accent);color:var(--pk-bright); }
.poker-chair-look { flex:1 0 88px;position:relative;cursor:grab;touch-action:none;user-select:none; }
.poker-chair-look:active { cursor:grabbing; }
.poker-chair-look:focus-visible { outline:2px solid var(--pk-accent);outline-offset:-2px; }
.poker-chair-look > span,.poker-chair-look output { position:absolute;bottom:6px;left:8px;padding:3px 7px;border-radius:var(--ui-r-in);background:#101616c9;color:#fff;font:12px system-ui; }
.poker-chair-look output { left:50%;bottom:16%;transform:translateX(-50%);font-size:14px;text-align:center; }
@media (pointer:coarse) { .poker-look-keys { display:none; } }
#poker[data-chair-view] .poker-table-layout { display:block;flex:none;width:min(100%,860px);margin:0 auto; }
#poker[data-chair-view] .poker-play { display:block; }
#poker[data-chair-view] .poker-arena { height:auto;margin:0;background:var(--pk-deepGlass); }
#poker[data-chair-view] :is(.poker-seats,.poker-felt,.poker-dealer,.poker-pot-chips) { display:none; }
#poker[data-chair-view] .poker-center { position:static;display:flex;flex-direction:row;gap:10px;padding:4px; }
#poker[data-chair-view] .poker-pot { margin:0; }
#poker[data-chair-view] .poker-pot strong { font-size:18px; }
#poker[data-chair-view] .poker-board .poker-card { width:26px;flex-basis:26px; }
#poker[data-chair-view] .poker-result { margin:0;padding:4px;background:var(--pk-deep); }
#poker[data-chair-view] .poker-dock { position:static;margin:0;padding:8px 12px; }
@media (max-width:720px) {
  #poker .poker-now { left:max(8px,var(--safe-left));top:104px;transform:none;max-width:46vw;white-space:normal; }
}
@media (max-height:520px) and (orientation:landscape) {
  #poker[data-chair-view] .poker-focus { display:grid;grid-template: auto 1fr auto / 1fr minmax(240px,42%); }
  #poker[data-chair-view] .poker-table-head { grid-column:1/-1; }
  #poker[data-chair-view] .poker-status-strip { grid-area:2/1;align-self:start;justify-self:start;z-index:1; }
  #poker[data-chair-view] .poker-chair-look { grid-area:2/1/4/2; }
  #poker[data-chair-view] .poker-table-layout { grid-area:2/2/4/3;width:100%; }
}

/* Dark glass, last word: the Ember Den's buttons the earlier, more specific rules dressed in each era's own colours (the
   table panel's betting bar, the Emote menu), and its own pop-ups outside #poker (the telescope's and the photo booth's
   controls, the family heirlooms), take the one look the Ember Den tab set: a quiet translucent face, a switched-on one
   ringed in green, the main action filled in the era's accent. Each era keeps its corner radius. */
#poker :is(.poker-actions, .poker-emote-menu) button:not(.poker-primary),
#poker[data-poker-era] .poker-actions button:not(.poker-primary) { color: var(--pk-text); background: color-mix(in srgb, var(--pk-text) 6%, transparent); border-color: color-mix(in srgb, var(--pk-text) 16%, transparent); }
#poker :is(.poker-actions, .poker-emote-menu) button:not(.poker-primary):not(:disabled):hover,
#poker[data-poker-era] .poker-actions button:not(.poker-primary):not(:disabled):hover { background: color-mix(in srgb, var(--pk-text) 11%, transparent); border-color: color-mix(in srgb, var(--pk-text) 32%, transparent); }
#poker .poker-actions button.poker-primary, #poker[data-poker-era] .poker-actions button.poker-primary,
#poker .poker-seated button.poker-primary { color: var(--pk-ink); background: linear-gradient(120deg, var(--pk-bright), var(--pk-accent)); border-color: var(--pk-bright); }
:is(.den-optics, .lounge-heirloom) :is(button, select) { min-height: 40px; padding: 0 .8em; color: #e9e4d6; background: #ffffff0f; border: 1px solid #ffffff26; border-radius: 10px; font: inherit; cursor: pointer; }
:is(.den-optics, .lounge-heirloom) :is(button, select):not(:disabled):hover { background: #ffffff1a; border-color: #ffffff4d; }
:is(.den-optics, .lounge-heirloom) button[aria-pressed="true"] { color: var(--ui-on-text); background: var(--ui-on-face); border-color: var(--ui-on); box-shadow: var(--ui-on-ring); }
:is(.den-optics, .lounge-heirloom) :is(button, select):focus-visible { outline: 3px solid #f4dda2; outline-offset: 2px; }
.den-optics { background: #0f1211eb; border-color: #ffffff26; border-radius: 12px; }

/* The Emote button is an emoji, square beside the table's other tools. */
#poker .poker-emote-button { min-width: 44px; padding-inline: 8px; }

/* Many winners at any width: the pots stand one under another, each pot's winners in two columns, and the card keeps to
   the room under its top, scrolling past it, so the board and the bottom line stay on screen. */
.poker-seated-between-cards[data-many] .poker-seated-between-list { grid-template-columns: minmax(0, 1fr); }
.poker-seated-between-cards[data-many] .poker-seated-between-pot { grid-template-columns: repeat(2, minmax(0, auto)); column-gap: 16px; }
#poker .poker-seated > .poker-seated-between { max-height: calc(100dvh - 190px - var(--safe-top, 0px) - 16px); overflow-y: auto; overscroll-behavior: contain; }
#poker .poker-seated > .poker-seated-between:has([data-many]) { pointer-events: auto; }

/* The betting actions, coloured as poker players read them, in filled tints so they never read as a switched-on button
   (a green ring and a dot): Fold red, Check or Call green, Bet or Raise the era's gold. In the seated view and the table
   panel alike; a move chosen ahead keeps its dot. */
#poker :is([data-seated-act="fold"], .poker-actions button[data-poker="fold"]),
#poker[data-poker-era] .poker-actions button[data-poker="fold"] { color: #ffd2c8; background: #b8393933; border-color: #e5533d80; }
#poker :is([data-seated-act="fold"], .poker-actions button[data-poker="fold"]):not(:disabled):hover,
#poker[data-poker-era] .poker-actions button[data-poker="fold"]:not(:disabled):hover { background: #b839394d; border-color: #e5533d; }
#poker :is([data-seated-act="call"], .poker-actions button[data-poker="call"]),
#poker[data-poker-era] .poker-actions button[data-poker="call"] { color: #d4f7e2; background: #2e7d5b40; border-color: #4fd08f80; }
#poker :is([data-seated-act="call"], .poker-actions button[data-poker="call"]):not(:disabled):hover,
#poker[data-poker-era] .poker-actions button[data-poker="call"]:not(:disabled):hover { background: #2e7d5b66; border-color: #4fd08f; }
#poker .poker-seated [data-seated-act="raise"] { color: var(--pk-ink); background: linear-gradient(120deg, var(--pk-bright), var(--pk-accent)); border-color: var(--pk-bright); }
/* A move chosen ahead (aria-pressed) stands out from its unchosen colour by a solid ring and its dot. */
#poker .poker-seated :is([data-seated-act="fold"], [data-seated-act="call"], [data-seated-act="raise"])[aria-pressed="true"] { border-color: var(--ui-on); box-shadow: 0 0 0 1px var(--ui-on); }

/* Table tools inside the Ember Den tab (poker-hud.js `dockTools`): an arrow back to the seat over the dialog's own tabs
   and panes, which keep their contents and take the tab's look. */
.poker-tab-tools { display: grid; gap: 12px; }
.poker-tab-tools[hidden] { display: none; }
.poker-tab-tools-body .poker-bots { margin: 4px 0 8px; }
.poker-tab-tools-body { display: grid; gap: 12px; font-size: 11px; line-height: 1.4; color: var(--pk-text); }
.poker-tab-tools-body .poker-sheet-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.poker-tab-tools-body [hidden] { display: none !important; }
.poker-tab-tools-body h4 { margin: 0 0 4px; font-size: 12px; color: var(--pk-bright); }
.poker-tab-tools-body .poker-log { white-space: pre-line; max-height: 220px; overflow: auto; font-family: var(--ui-font); }
.poker-tab-tools-body .poker-table-facts { display: grid; gap: 4px; margin: 6px 0; }
.poker-tab-tools-body .poker-table-facts div { display: flex; justify-content: space-between; }
.poker-tab-tools-body .poker-table-facts dd { margin: 0; color: var(--pk-bright); font-weight: 700; }
.poker-tab-tools-body .poker-kicker { font-size: 9px; letter-spacing: 0.1em; color: var(--pk-muted); }
.poker-tab-tools-body .poker-rail-title { display: flex; justify-content: space-between; }
.poker-tab-tools-body :is(.poker-buttons, .poker-chip-styles, .poker-mode-picker, .poker-table-footer > div) { display: grid; gap: 6px; }
.poker-tab-tools-body .poker-chip-styles { grid-template-columns: repeat(3, 1fr); }
.poker-tab-tools-body button { min-height: 40px; }
.poker-tab-tools-body .poker-primary { color: var(--pk-ink); background: linear-gradient(120deg, var(--pk-bright), var(--pk-accent)); border-color: var(--pk-bright); }
.poker-tab-tools-body .poker-primary small, .poker-tab-tools-body button small { display: block; font-weight: 400; opacity: 0.8; }
.poker-tab-tools-body input[type="checkbox"] { accent-color: #4fd08f; }
.poker-tab-tools-body label { display: flex; align-items: center; gap: 6px; }
/* In the Ember Den tab the seat's own Auto deal button stands for it, so Table tools leaves its checkbox out there. */

/* The 2D table uses one layout per viewport, never one per hand phase.
   Chair view retains its physical-room layout and its private-hand dock. */
#poker[data-table-view="true"] { z-index:1000; }
#poker { --poker-number-font:system-ui,sans-serif;--poker-surround:#0d1411; }
/* Match the artwork's dark surround across the entire viewport. The image
   keeps its existing dimensions; expanding this layer never scales the table. */
#poker[data-poker-era="terminal"] { --poker-surround:#101511; }
#poker[data-poker-era="circuit"] { --poker-surround:#0a0f0d; }
#poker[data-poker-era="machine"] { --poker-surround:#0d120e; }
#poker:is([data-poker-era="enamel"],[data-poker-era="solar"]) { --poker-surround:#0f1410; }
#poker[data-poker-era="market"] { --poker-surround:#0e120e; }
#poker[data-poker-era="assay"] { --poker-surround:#0d1310; }
#poker[data-poker-era="root"] { --poker-surround:#0b100e; }
#poker[data-poker-era="slate"] { --poker-surround:#0d1311; }
#poker :is(.poker-pot,.poker-pot strong,.poker-stack,.poker-kicker,.poker-position,.poker-bet,.poker-result,.poker-result-summary,.poker-timer,.poker-turn,.poker-turn-help,.poker-bet-help,.poker-seat-hand-name,button,input,[data-poker="status"]) { font-family:var(--poker-number-font);font-variant-numeric:lining-nums tabular-nums; }
#poker:not([data-chair-view]) .poker-focus { position:fixed;inset:0;max-width:none;margin:0;padding:16px 24px;border:0;border-radius:0;display:block;overflow:auto;background:var(--poker-surround);box-shadow:none; }
#poker:not([data-chair-view]) .poker-table-head { border-radius:0;height:76px;box-sizing:border-box;padding:0 0 12px;gap:14px; }
#poker:not([data-chair-view]) .poker-crest { width:48px;height:48px;flex:none; }
#poker:not([data-chair-view]) .poker-table-head h3 { font-size:30px; }
#poker:not([data-chair-view]) .poker-table-tools { margin-left:auto;max-width:none;gap:8px;flex-wrap:nowrap; }
#poker:not([data-chair-view]) .poker-table-tools > button { min-height:48px;padding:10px 16px;border-radius:var(--ui-r-btn);background:var(--pk-surface);border:1px solid var(--pk-line);color:var(--pk-bright);font:700 14px/1.2 system-ui; }
#poker:not([data-chair-view]) .poker-table-tools > button:hover { border-color:var(--pk-accent); }
#poker :is(button,input,.poker-result):focus-visible { outline:2px solid var(--pk-accent);outline-offset:3px; }
#poker:not([data-chair-view]) .poker-status-strip { height:44px;margin:0;padding:0;border:0;background:none;gap:8px;font-size:11px;grid-template-columns:80px minmax(0,1fr) 85px 60px 14em; }
#poker:not([data-chair-view]) .poker-status-strip button { min-height:44px; }
#poker:not([data-chair-view]) :is(.poker-table-layout,.poker-play) { display:block;max-width:none; }
#poker:not([data-chair-view]) .poker-arena { --board-y:40%;--board-card:76px;width:min(1100px,calc(100% - 140px));max-width:none;height:clamp(360px,calc(100dvh - 510px),560px);margin:94px auto 76px; }
#poker:not([data-chair-view]) .poker-felt { inset:0;width:100%;height:100%;border-radius:0; }
#poker:not([data-chair-view]) :is(.poker-dealer,.poker-pot-chips,.poker-private) { display:none; }
#poker:not([data-chair-view]) .poker-center { inset:0;display:block; }
/* The pot's whole text block is centered between the inner rail and board.
   This region and the board's box keep their dimensions even at showdown. */
#poker:not([data-chair-view]) .poker-pot-area { position:absolute;left:0;right:0;top:20%;height:calc(var(--board-y) - 20%);display:flex;justify-content:center;align-items:center; }
#poker:not([data-chair-view]) .poker-pot { display:flex;flex-direction:column;gap:3px;align-items:center;justify-content:center;margin:0;text-align:center;height:64px; }
#poker:not([data-chair-view]) .poker-pot strong { font:700 32px/1.1 var(--poker-number-font); }
#poker:not([data-chair-view]) .poker-pot small { display:block;font-size:10px; }
#poker:not([data-chair-view]) .poker-board { position:absolute;top:var(--board-y);left:50%;transform:translateX(-50%);width:calc(var(--board-card) * 5 + 48px);height:calc(var(--board-card) * 1.4);max-width:none;gap:12px; }
#poker:not([data-chair-view]) .poker-board .poker-card { width:var(--board-card);flex:0 0 var(--board-card); }
#poker:not([data-chair-view]) .poker-card { animation:none;transition:transform .18s ease,filter .18s ease; }
#poker:not([data-chair-view]) .poker-card.used { transform:translateY(-10px);box-shadow:0 0 0 2px var(--pk-accent),0 6px 15px #0006; }
#poker:not([data-chair-view]) .poker-card.unused { opacity:1;filter:saturate(.15) brightness(.58);transform:translateY(8px) scale(.94); }
#poker:not([data-chair-view]) .poker-felt-foot { position:absolute;top:calc(var(--board-y) + var(--board-card) * 1.4 + 20px);left:27%;right:27%;height:38px;display:block;text-align:center; }
#poker:not([data-chair-view]) .poker-street { display:none; }
#poker .poker-result-summary { box-sizing:border-box;max-width:100%;height:36px;overflow:hidden;padding:7px 10px;border:1px solid var(--pk-line);border-radius:var(--ui-r-in);background:var(--pk-deep);color:var(--pk-bright);font:600 13px/20px system-ui; }
#poker:not([data-chair-view]) .poker-seat { --card-w:76px;--card-tuck:35px;--plaque:56px;--face-left:-16px;--seat-border:1px;width:172px;container:none; }
#poker:not([data-chair-view]) .poker-seat-button { display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:20px 22px;align-content:center;justify-items:start;box-sizing:border-box;height:var(--plaque);min-height:var(--plaque);padding:4px 10px 4px 55px;border:1px solid var(--pk-line);border-radius:var(--ui-r-btn);background:var(--pk-deep);text-align:left;opacity:1; }
#poker:not([data-chair-view]) .poker-seat-button > * { grid-column:1; }
#poker:not([data-chair-view]) .poker-seat .poker-seat-button { border-radius:var(--ui-r-btn); }
#poker:not([data-chair-view]) .poker-seat-button > :is(.poker-face,.poker-position) { grid-area:auto; }
#poker:not([data-chair-view]) .poker-face { position:absolute;left:var(--face-left);top:50%;transform:translateY(-50%);width:var(--plaque);height:var(--plaque);margin:0;opacity:1; }
/* The portrait is inside the bordered button; the bubble is its sibling on the seat. */
#poker:not([data-chair-view]) .poker-seat-emote { left:calc(var(--face-left) + var(--seat-border) + var(--plaque) / 2 - 13px);top:calc(50% - 13px);bottom:auto; }
#poker:not([data-chair-view]) .poker-player { min-width:0;max-width:100%;min-height:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font:500 14px/20px system-ui; }
#poker:not([data-chair-view]) .poker-stack { max-width:100%;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font:700 17px/22px var(--poker-number-font); }
#poker:not([data-chair-view]) .poker-last-action { display:none; }
#poker:not([data-chair-view]) .poker-ask { position:absolute;left:0;right:0;top:100%;bottom:auto;font-size:10px;visibility:hidden;background:var(--pk-deep);z-index:5; }
#poker:not([data-chair-view]) .poker-seat-button:is(:hover,:focus-visible) .poker-ask { visibility:visible; }
#poker:not([data-chair-view]) .poker-seat.yours .poker-player::before { content:none; }
#poker:not([data-chair-view]) .poker-seat.yours { --seat-border:2px; }
#poker:not([data-chair-view]) .poker-seat.yours .poker-seat-button { border:2px solid var(--pk-accent); }
#poker:not([data-chair-view]) .poker-seat.folded .poker-seat-button { opacity:1;filter:saturate(.15) brightness(.65); }
#poker:not([data-chair-view]) .poker-position { left:-23px;right:auto;top:-10px;bottom:auto;width:23px;height:23px;box-sizing:border-box;padding:0;display:grid;place-items:center;border-radius:50%;font:700 11px system-ui; }
#poker:not([data-chair-view]) .poker-seat-clock { left:auto;right:0;top:calc(100% + 3px); }
#poker:not([data-chair-view]) .poker-seat-cards { --card-w:inherit;position:absolute;top:auto;bottom:calc(100% - 35px);left:50%;right:auto;transform:translateX(-50%);width:calc(var(--card-w) * 2 + 8px);height:calc(var(--card-w) * 1.4);gap:8px; }
#poker:not([data-chair-view])[data-hand-complete="true"] .poker-seat-cards { bottom:calc(100% - 12px); }
#poker:not([data-chair-view]) .poker-seat-cards .poker-card { width:var(--card-w);flex:0 0 var(--card-w); }
#poker:not([data-chair-view]) .poker-seat-cards .poker-card svg { visibility:visible; }
#poker:not([data-chair-view]) .poker-seat-cards .poker-card::after { display:none; }
#poker:not([data-chair-view]) .poker-seat.folded .poker-card { opacity:1;filter:saturate(.15) brightness(.58);transform:translateY(8px); }
#poker .poker-seat-hand-name { position:absolute;top:calc(100% + 9px);left:50%;transform:translateX(-50%);max-width:230px;width:max-content;color:var(--pk-accent);font:600 12px/16px var(--poker-number-font);text-align:center; }
#poker .poker-seat-hand-name:empty { display:none; }
#poker .poker-seat-plus { display:none; }
#poker:not([data-chair-view]) .poker-seat.empty { width:46px; }
#poker:not([data-chair-view]) .poker-seat.empty .poker-seat-button { display:flex;align-items:center;justify-content:center;width:46px;height:46px;min-height:46px;padding:0;border-radius:50%;border:1px dashed var(--pk-line);background:var(--pk-deep);opacity:1; }
body[data-poker-seated] #poker:not([data-chair-view]) .poker-seat.empty:not(.npc) .poker-seat-button { border:1px dashed var(--pk-line);border-radius:50%;background:var(--pk-deep); }
#poker:not([data-chair-view]) .poker-seat.empty .poker-seat-button > :not(.poker-seat-plus) { display:none; }
#poker:not([data-chair-view]) .poker-seat.empty .poker-seat-button::before,#poker:not([data-chair-view]) .poker-seat.empty .poker-seat-button::after { content:none!important; }
#poker:not([data-chair-view]) .poker-seat.empty .poker-seat-plus { display:block;position:relative;width:18px;height:18px;flex:none;font-size:0; }
#poker .poker-seat-plus::before,#poker .poker-seat-plus::after { content:"";position:absolute;left:50%;top:50%;width:18px;height:2px;transform:translate(-50%,-50%);background:var(--pk-bright);border-radius:var(--ui-r-btn); }
#poker .poker-seat-plus::after { transform:translate(-50%,-50%) rotate(90deg); }
#poker[data-chair-view] .poker-result-summary { display:none; }
#poker[data-chair-view] .poker-decision > .poker-result { grid-area:slot;max-height:var(--pk-slot);overflow:auto; }
#poker[data-chair-view][data-hand-complete="true"] .poker-turn-help { visibility:hidden; }
#poker[data-chair-view] .poker-decision:has(.poker-notice:not(:empty)) .poker-result { visibility:hidden; }
#poker:not([data-chair-view]) .poker-seat[data-position="0"] { left:50%;top:99%; }
#poker:not([data-chair-view]) .poker-seat[data-position="1"] { left:24%;top:90%; }
#poker:not([data-chair-view]) .poker-seat[data-position="2"] { left:7%;top:62%; }
#poker:not([data-chair-view]) .poker-seat[data-position="3"] { left:15%;top:25%; }
#poker:not([data-chair-view]) .poker-seat[data-position="4"] { left:37%;top:3%; }
#poker:not([data-chair-view]) .poker-seat[data-position="5"] { left:63%;top:3%; }
#poker:not([data-chair-view]) .poker-seat[data-position="6"] { left:85%;top:25%; }
#poker:not([data-chair-view]) .poker-seat[data-position="7"] { left:93%;top:62%; }
#poker:not([data-chair-view]) .poker-seat[data-position="8"] { left:76%;top:90%; }
/* Bets stay on the felt side of their seat, distinct from stacks and cards. */
#poker:not([data-chair-view]) .poker-bet { font:700 11px var(--poker-number-font); }
#poker:not([data-chair-view]) .poker-seat:is([data-position="0"],[data-position="1"],[data-position="8"]) .poker-bet { bottom:calc(100% + var(--card-w) * 1.4 - 22px);top:auto; }
/* Near-corner bets follow the inward diagonal from their cards. Keeping these
   inside the side-seat bets preserves the seats' left-to-right order. */
#poker:not([data-chair-view]) .poker-seat:is([data-position="1"],[data-position="8"]) .poker-bet { bottom:calc(100% + var(--card-w) * 1.4 - 46px);transform:none; }
#poker:not([data-chair-view]) .poker-seat[data-position="1"] .poker-bet { left:calc(50% + var(--card-w) + 10px); }
#poker:not([data-chair-view]) .poker-seat[data-position="8"] .poker-bet { left:auto;right:calc(50% + var(--card-w) + 10px); }

/* Fixed turn/help slots and action region; notices and all winners scroll within
   their own slots rather than resizing the controls or being covered by seats. */
#poker:not([data-chair-view]) .poker-dock { position:static;display:block;box-sizing:border-box;width:min(900px,100%);height:176px;margin:0 auto;padding:12px 18px;border:1px solid var(--pk-line);border-radius:var(--ui-r);background:var(--pk-deep); }
#poker:not([data-chair-view]) .poker-decision { display:grid;height:100%;grid-template-columns:190px minmax(0,1fr);grid-template-rows:42px minmax(0,1fr);grid-template-areas:"turn act" "slot act";gap:6px 20px; }
#poker:not([data-chair-view]) .poker-turn { grid-area:turn;align-self:start;height:42px;overflow:auto;overflow-wrap:anywhere;font:650 15px/20px system-ui;text-align:left; }
#poker:not([data-chair-view]) :is(.poker-turn-help,.poker-notice) { grid-area:slot;height:100%;min-height:0;overflow:auto;font:11px/1.5 system-ui;visibility:visible; }
#poker:not([data-chair-view]) .poker-decision:has(.poker-notice:not(:empty)) .poker-turn-help { visibility:hidden; }
#poker:not([data-chair-view]) .poker-decision > [data-poker="controls"] { grid-area:act;align-self:stretch;display:grid;grid-template-rows:80px 48px 18px;gap:3px;min-width:0; }
#poker:not([data-chair-view]) .poker-sizing { display:grid;grid-row:1;grid-template-columns:minmax(0,1fr) 110px;grid-template-rows:36px 38px;gap:6px 10px;margin:0; }
#poker:not([data-chair-view]) .poker-presets { grid-column:1/-1;grid-row:1;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px; }
#poker:not([data-chair-view]) .poker-presets button { min-width:0;min-height:36px;padding:5px;border-radius:var(--ui-r-btn);font:600 12px system-ui;background:var(--pk-surface); }
#poker:not([data-chair-view]) .poker-presets button[aria-pressed="true"] { background:var(--pk-soft);border-color:var(--pk-accent);color:var(--pk-bright); }
#poker:not([data-chair-view]) .poker-sizing input[type="range"] { grid-column:1;grid-row:2;min-width:0;height:38px;accent-color:var(--pk-accent); }
#poker:not([data-chair-view]) .poker-amount { grid-column:2;grid-row:2;gap:5px; }
#poker:not([data-chair-view]) .poker-amount input { height:38px;font:700 17px var(--poker-number-font);text-align:center;appearance:textfield;background:var(--pk-deep); }
#poker .poker-amount input::-webkit-inner-spin-button { appearance:none; }
#poker:not([data-chair-view]) .poker-actions { grid-row:2;grid-template-columns:1fr 1fr 1.25fr;gap:8px; }
#poker:not([data-chair-view]) .poker-actions [data-sheet="bet"] { display:none; }
#poker:not([data-chair-view]) .poker-actions [data-poker="raise"] { display:block; }
#poker:not([data-chair-view]) .poker-actions button { min-height:48px;height:48px;min-width:0;padding:5px 7px;border-radius:var(--ui-r-btn);font:700 14px/1.2 system-ui; }
#poker:not([data-chair-view]) .poker-actions [data-poker="fold"] { background:#382321;color:#eabbb0;border-color:#98594b; }
#poker:not([data-chair-view]) .poker-actions [data-poker="call"] { background:var(--pk-surface);color:var(--pk-bright);border-color:var(--pk-line); }
#poker:not([data-chair-view]) .poker-focus .poker-primary { background:linear-gradient(var(--pk-bright),var(--pk-accent));color:var(--pk-ink);border-color:var(--pk-bright); }
#poker:not([data-chair-view]) .poker-bet-help { display:block;grid-row:3;margin:0;overflow:auto;font:10px/16px system-ui; }
/* The setup keeps two rows of buttons' room, filled from the top, so a button that comes between hands (free chips)
   takes the second row rather than lifting the others. */
#poker:not([data-chair-view]) .poker-setup { grid-area:act;align-self:end;height:94px; }
#poker:not([data-chair-view]) .poker-setup .poker-buttons { flex-wrap:wrap;gap:6px;align-content:flex-start; }
#poker:not([data-chair-view]) .poker-setup .poker-buttons button { flex:1 1 30%;min-height:44px;border-radius:var(--ui-r-btn);font-weight:700; }
#poker:not([data-chair-view]) .poker-result { grid-area:slot;margin:0;padding:4px 6px;height:100%;min-height:0;max-height:100%;width:100%;overflow:auto;overscroll-behavior:contain;pointer-events:auto;text-align:left;font:12px/1.5 var(--poker-number-font); }
#poker:not([data-chair-view])[data-hand-complete="true"] .poker-turn-help { visibility:hidden; }
#poker:not([data-chair-view]) .poker-decision:has(.poker-notice:not(:empty)) .poker-result { visibility:hidden; }
/* A practice table's bot counter (style.css .poker-bots) stands at the foot of the action area with the setup's buttons
   in one row over it, in the setup's own 94px, between hands only: during a hand that area is the betting controls' or
   the pre-actions' (placed in its free cell), and the dock's fixed height never changes. */
#poker:not([data-chair-view]) .poker-decision > .poker-bots { grid-area:act;align-self:end; }
#poker:not([data-chair-view]) .poker-decision:has(> .poker-setup[hidden]) > .poker-bots { display:none; }
#poker:not([data-chair-view]) .poker-decision:has(> .poker-bots:not([hidden])) > .poker-setup { height:44px;margin-bottom:50px; }
#poker:not([data-chair-view]) .poker-decision:has(> .poker-bots:not([hidden])) > .poker-setup .poker-buttons { display:flex;flex-wrap:nowrap; }
#poker:not([data-chair-view]) .poker-decision:has(> .poker-bots:not([hidden])) > .poker-setup .poker-buttons button { flex:1 1 0;min-width:0;padding:4px 6px; }
/* The phone's landscape dock is a 270px column: the counter's keys narrow so its label keeps one line. */
@media (max-height:520px) and (orientation:landscape) {
 #poker:not([data-chair-view]) .poker-bots { grid-template-columns:minmax(0,1fr) 36px 22px 36px;column-gap:4px; }
 #poker:not([data-chair-view]) .poker-bots > button { width:36px; }
 #poker:not([data-chair-view]) .poker-bots-label { letter-spacing:0.04em; }
}

@media (min-width:721px) and (max-height:900px) {
 #poker:not([data-chair-view]) .poker-focus { padding:12px 20px; }
 #poker:not([data-chair-view]) .poker-table-head { height:72px; }
 #poker:not([data-chair-view]) .poker-arena { --board-card:60px;width:min(940px,calc(100% - 140px));height:max(300px,calc(100dvh - 420px));margin:60px auto 56px; }
 #poker:not([data-chair-view]) .poker-seat { --card-w:62px;width:148px; }
 #poker:not([data-chair-view]) .poker-seat.empty { width:46px; }
 #poker:not([data-chair-view]) .poker-dock { height:160px; }
 #poker:not([data-chair-view]) .poker-decision > [data-poker="controls"] { grid-template-rows:68px 44px 18px; }
 #poker:not([data-chair-view]) .poker-sizing { grid-template-rows:32px 32px;gap:4px 8px; }
 #poker:not([data-chair-view]) .poker-presets button { min-height:32px; }
 #poker:not([data-chair-view]) .poker-sizing :is(input[type="range"],input[type="number"]) { height:32px; }
 #poker:not([data-chair-view]) .poker-actions button { min-height:44px;height:44px; }
}
@media (min-width:721px) and (max-width:1050px) {
 #poker:not([data-chair-view]) .poker-seat { --plaque:48px;--card-w:48px;width:112px; }
 #poker:not([data-chair-view]) .poker-seat-button { padding-left:40px; }
 #poker:not([data-chair-view]) .poker-seat { --face-left:-10px; }
 #poker:not([data-chair-view]) .poker-player { font-size:12px; }
 #poker:not([data-chair-view]) .poker-stack { font-size:14px; }
 #poker:not([data-chair-view]) .poker-decision { grid-template-columns:150px minmax(0,1fr);gap:6px 12px; }
}
@media (max-width:720px) {
 #poker:not([data-chair-view]) .poker-focus { padding:max(10px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left)); }
 #poker:not([data-chair-view]) .poker-table-head { height:54px;padding:0 0 8px;gap:8px; }
 #poker:not([data-chair-view]) :is(.poker-crest,.poker-kicker) { display:none; }
 #poker:not([data-chair-view]) .poker-table-title { gap:6px; }
 #poker:not([data-chair-view]) .poker-table-head h3 { font-size:23px; }
 #poker:not([data-chair-view]) .poker-table-head [data-poker="status"] { font-size:9px;margin-top:4px; }
 #poker:not([data-chair-view]) .poker-mode-badge { font-size:7px;padding:3px; }
 #poker:not([data-chair-view]) .poker-table-tools { gap:6px; }
 #poker:not([data-chair-view]) .poker-table-tools > button { min-height:44px;padding:8px 10px;font-size:11px; }
 #poker:not([data-chair-view]) .poker-table-tools [data-poker-action="walk"] { max-width:86px; }
 #poker:not([data-chair-view]) .poker-status-strip { font-size:9px;gap:3px;grid-template-columns:44px minmax(0,1fr) 62px 44px 9em; }
 #poker:not([data-chair-view]) .poker-status-strip button { padding:2px;font-size:9px; }
 #poker:not([data-chair-view]) .poker-arena { --board-y:48%;--board-card:30px;width:100%;height:max(320px,calc(100dvh - 470px));margin:46px auto 66px; }
 #poker:not([data-chair-view]) .poker-seat { --plaque:44px;--card-w:40px;--card-tuck:28px;width:92px; }
 #poker:not([data-chair-view]) .poker-seat-button { grid-template-rows:17px 19px;padding:2px 2px 2px 37px;border-radius:var(--ui-r-btn); }
 #poker:not([data-chair-view]) .poker-seat { --face-left:-8px; }
 #poker:not([data-chair-view]) .poker-player { font-size:11px;line-height:17px; }
 #poker:not([data-chair-view]) .poker-stack { font-size:11px;line-height:19px;letter-spacing:-.02em;overflow:visible; }
 #poker:not([data-chair-view]) .poker-seat-cards { bottom:calc(100% - 28px);width:85px;gap:5px; }
 #poker:not([data-chair-view])[data-hand-complete="true"] .poker-seat-cards { bottom:calc(100% - 14px); }
 #poker:not([data-chair-view]) .poker-seat[data-position="0"] { left:50%;top:104%;width:112px; }
 #poker:not([data-chair-view]) .poker-seat[data-position="1"] { left:18%;top:81%; }
 #poker:not([data-chair-view]) .poker-seat[data-position="2"] { left:13%;top:53%; }
 #poker:not([data-chair-view]) .poker-seat[data-position="3"] { left:14%;top:27%; }
 #poker:not([data-chair-view]) .poker-seat[data-position="4"] { left:32%;top:3%; }
 #poker:not([data-chair-view]) .poker-seat[data-position="5"] { left:74%;top:3%; }
 #poker:not([data-chair-view]) .poker-seat[data-position="6"] { left:86%;top:27%; }
 #poker:not([data-chair-view]) .poker-seat[data-position="7"] { left:87%;top:53%; }
 #poker:not([data-chair-view]) .poker-seat[data-position="8"] { left:82%;top:81%; }
 #poker:not([data-chair-view]) .poker-seat.empty { width:44px; }
 #poker:not([data-chair-view]) .poker-seat.empty .poker-seat-button { width:44px;height:44px;min-height:44px;padding:0; }
 #poker:not([data-chair-view]) .poker-position { left:-14px;top:-12px;width:20px;height:20px; }
 #poker:not([data-chair-view]) .poker-pot strong { font-size:26px; }
 #poker:not([data-chair-view]) .poker-pot span,#poker:not([data-chair-view]) .poker-pot small { font-size:8px; }
 #poker:not([data-chair-view]) .poker-board { width:166px;gap:4px; }
 #poker:not([data-chair-view]) .poker-felt-foot { left:30%;right:30%;top:64%; }
 #poker:not([data-chair-view]) .poker-result-summary { font-size:11px;padding:6px;height:32px; }
 #poker .poker-seat-hand-name { font-size:9px;max-width:240px;white-space:nowrap; }
 #poker:not([data-chair-view]) .poker-dock { width:100%;height:240px;padding:10px; }
 #poker:not([data-chair-view]) .poker-decision { grid-template-columns:minmax(0,1fr);grid-template-rows:20px 28px minmax(0,1fr);grid-template-areas:"turn" "slot" "act";gap:4px; }
 #poker:not([data-chair-view]) .poker-turn { height:20px;font-size:13px;line-height:20px;white-space:nowrap;overflow:auto; }
 #poker:not([data-chair-view]) .poker-decision > [data-poker="controls"] { grid-template-rows:92px 48px 18px;gap:3px; }
 #poker:not([data-chair-view]) .poker-sizing { grid-template-rows:44px 44px;gap:4px 8px; }
 #poker:not([data-chair-view]) .poker-presets button { min-height:44px; }
 #poker:not([data-chair-view]) .poker-sizing :is(input[type="range"],input[type="number"]) { height:44px; }
 #poker:not([data-chair-view]) .poker-setup .poker-buttons { display:grid;grid-template-columns:1fr 1fr; }
 #poker:not([data-chair-view])[data-hand-complete="true"] .poker-result { grid-area:slot / 1 / act / 2;align-self:start;height:78px; }
 #poker:not([data-chair-view]) .poker-result { font-size:11px; }
}
@media (max-height:520px) and (orientation:landscape) {
 #poker:not([data-chair-view]) .poker-focus { padding:10px 12px; }
 /* A themed top border must not offset the 44px controls inside their 44px row. */
 #poker:not([data-chair-view]) .poker-table-head { height:44px;padding-bottom:0;border-top-width:0;align-items:flex-start; }
 #poker:not([data-chair-view]) :is(.poker-crest,.poker-table-head .poker-kicker,.poker-table-head [data-poker="status"]) { display:none; }
 /* The title owns the 128px before the status strip, including its mode badge.
    Inline wrapping keeps every table name readable within the fixed header. */
 #poker:not([data-chair-view]) .poker-table-head > div:not(.poker-table-tools) { flex:0 0 128px;min-width:0; }
 #poker:not([data-chair-view]) .poker-table-title { display:block;line-height:18px; }
 #poker:not([data-chair-view]) .poker-table-head h3 { display:inline;font-size:16px;line-height:18px;white-space:normal; }
 #poker:not([data-chair-view]) .poker-mode-badge { display:inline-block;margin-left:4px;padding:1px 3px;font-size:7px;line-height:10px;vertical-align:middle; }
 #poker:not([data-chair-view]) .poker-table-tools > button { min-height:44px;padding:8px 12px; }
 #poker:not([data-chair-view]) .poker-status-strip { position:absolute;top:10px;left:152px;right:290px;width:auto;display:flex;gap:6px;font-size:9px;overflow:auto; }
 #poker:not([data-chair-view]) .poker-status-strip button { flex:none;padding:2px 5px;font-size:9px; }
 #poker:not([data-chair-view]) .poker-connection { flex:1 0 72px;max-height:44px;overflow:auto; }
 #poker:not([data-chair-view]) .poker-status-strip .poker-timer { flex:0 0 79px;margin-left:auto;order:9; }
 #poker:not([data-chair-view]) .poker-play { width:calc(100% - 290px); }
 #poker:not([data-chair-view]) .poker-arena { --board-y:50%;--board-card:29px;width:calc(100% - 70px);height:max(200px,calc(100dvh - 156px));margin:50px auto 12px; }
 #poker:not([data-chair-view]) .poker-seat { --plaque:44px;--card-w:37px;--card-tuck:24px;width:84px; }
 #poker:not([data-chair-view]) .poker-seat:is([data-position="4"],[data-position="5"]) { top:9%; }
 /* A smaller visible vacancy retains the full button area for touch. */
 #poker:not([data-chair-view]) .poker-seat.empty .poker-seat-button,body[data-poker-seated] #poker:not([data-chair-view]) .poker-seat.empty:not(.npc) .poker-seat-button { border:0;background:transparent;box-shadow:none; }
 #poker:not([data-chair-view]) .poker-seat.empty .poker-seat-plus { width:32px;height:32px;box-sizing:border-box;border:1px dashed var(--pk-line);border-radius:50%;background:var(--pk-deep); }
 #poker:not([data-chair-view]) .poker-seat.empty .poker-seat-plus::before,#poker:not([data-chair-view]) .poker-seat.empty .poker-seat-plus::after { width:14px; }
 #poker:not([data-chair-view]) .poker-seat-button { grid-template-rows:17px 19px;padding:2px 3px 2px 38px; }
 #poker:not([data-chair-view]) .poker-seat { --face-left:-9px; }
 #poker:not([data-chair-view]) .poker-player { font:500 11px/17px system-ui; }
 #poker:not([data-chair-view]) .poker-stack { font:700 13px/19px system-ui; }
 #poker:not([data-chair-view]) .poker-seat:not(.yours) .poker-seat-hand-name { top:calc(100% + 4px); }
 #poker:not([data-chair-view]) .poker-seat-cards { bottom:calc(100% - 24px); }
 #poker:not([data-chair-view]) .poker-seat:is([data-position="2"],[data-position="7"]) .poker-bet { top:50%;transform:translateY(-50%); }
 #poker:not([data-chair-view]) .poker-pot { height:48px;gap:2px; }
 #poker:not([data-chair-view]) .poker-pot strong { font-size:22px; }
 #poker:not([data-chair-view]) .poker-pot span,#poker:not([data-chair-view]) .poker-pot small { font-size:8px; }
 #poker:not([data-chair-view]) .poker-board { width:161px;gap:4px; }
 #poker:not([data-chair-view]) .poker-felt-foot { display:none; }
 #poker:not([data-chair-view]) .poker-dock { position:absolute;right:max(12px,env(safe-area-inset-right));top:66px;bottom:auto;width:270px;height:max(272px,calc(100dvh - 66px - max(12px,env(safe-area-inset-bottom))));margin:0;padding:10px; }
 #poker:not([data-chair-view]) .poker-decision { grid-template-columns:1fr;grid-template-rows:40px 28px minmax(0,1fr);grid-template-areas:"turn" "slot" "act";gap:4px; }
 #poker:not([data-chair-view]) .poker-turn { height:40px;font-size:13px; }
 #poker:not([data-chair-view]) .poker-decision > [data-poker="controls"] { grid-template-rows:minmax(100px,1fr) 52px 18px; }
 #poker:not([data-chair-view]) .poker-sizing { grid-template-rows:1fr 1fr;gap:4px; }
 #poker:not([data-chair-view]) .poker-presets { gap:4px; }
 #poker:not([data-chair-view]) .poker-presets button { min-height:48px;font-size:11px; }
 #poker:not([data-chair-view]) .poker-sizing :is(input[type="range"],input[type="number"]) { height:48px; }
 #poker:not([data-chair-view]) .poker-actions { gap:5px; }
 #poker:not([data-chair-view]) .poker-actions button { height:52px;min-height:52px;font-size:12px; }
 #poker:not([data-chair-view]) .poker-setup .poker-buttons { display:grid;grid-template-columns:1fr 1fr; }
 #poker:not([data-chair-view])[data-hand-complete="true"] .poker-result { grid-area:slot / 1 / act / 2;align-self:start;height:calc(100% - 102px); }
}
/* A short landscape viewport needs the same centered indices as portrait. */
@media (max-width:720px), (max-height:520px) and (orientation:landscape) {
 #poker:not([data-chair-view]) .poker-card[data-face] { position:relative;overflow:hidden;background:#fffdf6; }
 #poker:not([data-chair-view]) .poker-card[data-face] svg { visibility:hidden; }
 #poker:not([data-chair-view]) .poker-card[data-face]::before { content:attr(data-rank);position:absolute;top:3px;left:0;right:0;text-align:center;font:700 16px/1 var(--poker-number-font);color:#202c36; }
 #poker:not([data-chair-view]) .poker-card[data-face]::after { display:block;content:attr(data-suit);position:absolute;top:18px;left:0;right:0;bottom:auto;text-align:center;font:700 20px/1 Georgia;color:#202c36; }
 #poker:not([data-chair-view]) .poker-seat-cards .poker-card[data-face]::before { content:attr(data-rank) " " attr(data-suit);top:2px;font-size:13px;line-height:18px;letter-spacing:0; }
 #poker:not([data-chair-view]) .poker-seat-cards .poker-card[data-face]::after { display:none; }
 #poker:not([data-chair-view]) .poker-seat-cards .poker-card[data-face].used::before { content:attr(data-rank);top:3px;font-size:16px;line-height:1; }
 #poker:not([data-chair-view]) .poker-seat-cards .poker-card[data-face].used::after { display:block; }
 #poker:not([data-chair-view]) .poker-card[data-red="true"]::before,#poker:not([data-chair-view]) .poker-card[data-red="true"]::after { color:#b72e3c; }
}
/* Compact bets meet the top edge of every card pair. Only the card border is
   overlapped, leaving the indices below clear without exposing more card. */
@media (max-width:1050px), (max-height:520px) and (orientation:landscape) {
 #poker:not([data-chair-view]) .poker-seat[data-position] .poker-bet { left:50%;right:auto;top:auto;bottom:calc(100% + var(--card-w) * 1.4 - var(--card-tuck) - 2px);transform:translateX(-50%);z-index:5;background:var(--pk-deep);border:1px solid var(--pk-line);pointer-events:none; }
}
/* On a phone or a short window an opponent's cards face down show only their top edge over the plaque, so nine seats'
   backs never pile over their neighbours (smaller cards, narrower than the plaque), and the bet sits on that edge (it
   follows --card-w and --card-tuck). Their faces stand as
   usual once the hand shows them. */
@media (max-width:720px), (max-height:520px) and (orientation:landscape) {
 #poker:not([data-chair-view]) .poker-seat:not(.yours):not(:has(.poker-card[data-face])) { --card-w:28px;--card-tuck:calc(var(--card-w) * 1.4 - 9px); }
 #poker:not([data-chair-view]) .poker-seat:not(.yours):not(:has(.poker-card[data-face])) .poker-seat-cards { bottom:calc(100% - var(--card-tuck));width:calc(var(--card-w) * 2 + 4px);gap:4px; }
}
/* The nine seats stand on the table's outer edge (where the felt picture's leather rail ends), spaced evenly along it from
   the visitor's seat at the foot: nine equal lengths of that outline, mirrored left to right. */
#poker:not([data-chair-view]) .poker-seat[data-position="0"] { left:50%;top:94.3%; }
#poker:not([data-chair-view]) .poker-seat[data-position="1"] { left:24%;top:91.5%; }
#poker:not([data-chair-view]) .poker-seat[data-position="2"] { left:3%;top:63.2%; }
#poker:not([data-chair-view]) .poker-seat[data-position="3"] { left:12.6%;top:17.3%; }
#poker:not([data-chair-view]) .poker-seat[data-position="4"] { left:37.7%;top:5.7%; }
#poker:not([data-chair-view]) .poker-seat[data-position="5"] { left:62.3%;top:5.7%; }
#poker:not([data-chair-view]) .poker-seat[data-position="6"] { left:87.4%;top:17.3%; }
#poker:not([data-chair-view]) .poker-seat[data-position="7"] { left:97%;top:63.2%; }
#poker:not([data-chair-view]) .poker-seat[data-position="8"] { left:76%;top:91.5%; }
/* The same nine lengths of that outline as the table is drawn narrower than it is wide on a phone held upright, and
   squatter on one on its side. */
@media (max-width:560px) {
 #poker:not([data-chair-view]) .poker-seat[data-position="0"] { left:50%;top:94.3%; }
 #poker:not([data-chair-view]) .poker-seat[data-position="1"] { left:16.3%;top:86.5%; }
 #poker:not([data-chair-view]) .poker-seat[data-position="2"] { left:2.1%;top:57.8%; }
 #poker:not([data-chair-view]) .poker-seat[data-position="3"] { left:6.4%;top:26.5%; }
 #poker:not([data-chair-view]) .poker-seat[data-position="4"] { left:33.2%;top:6.1%; }
 #poker:not([data-chair-view]) .poker-seat[data-position="5"] { left:66.8%;top:6.1%; }
 #poker:not([data-chair-view]) .poker-seat[data-position="6"] { left:93.6%;top:26.5%; }
 #poker:not([data-chair-view]) .poker-seat[data-position="7"] { left:97.9%;top:57.8%; }
 #poker:not([data-chair-view]) .poker-seat[data-position="8"] { left:83.7%;top:86.5%; }
}
@media (max-width:400px) {
 #poker:not([data-chair-view]) .poker-seat[data-position="1"] { left:13%; }
 #poker:not([data-chair-view]) .poker-seat[data-position="8"] { left:87%; }
}
@media (min-width:561px) and (max-height:520px) and (orientation:landscape) {
 #poker:not([data-chair-view]) .poker-seat[data-position="0"] { left:50%;top:94.3%; }
 #poker:not([data-chair-view]) .poker-seat[data-position="1"] { left:21.4%;top:90.2%; }
 #poker:not([data-chair-view]) .poker-seat[data-position="2"] { left:2.6%;top:60.4%; }
 #poker:not([data-chair-view]) .poker-seat[data-position="3"] { left:9.4%;top:21%; }
 #poker:not([data-chair-view]) .poker-seat[data-position="4"] { left:36.5%;top:5.7%; }
 #poker:not([data-chair-view]) .poker-seat[data-position="5"] { left:63.5%;top:5.7%; }
 #poker:not([data-chair-view]) .poker-seat[data-position="6"] { left:90.6%;top:21%; }
 #poker:not([data-chair-view]) .poker-seat[data-position="7"] { left:97.4%;top:60.4%; }
 #poker:not([data-chair-view]) .poker-seat[data-position="8"] { left:78.6%;top:90.2%; }
}
@media (prefers-reduced-motion:reduce) {
 #poker:not([data-chair-view]) .poker-card { transition:none; }
}

/* Hosted chats' look (chat-hosts.js, docs/ooga-chat-hosts.md), Ooga Chat's and the island's alike: the list before a
   chat is chosen (a panel's `data-space="list"`, which hides its roster, and in Ooga Chat's app its emoji bar, which
   has nowhere to send outside a chat; the island's sends over the visitor's Ooga, so it stays), then the chat's bar, invite card, badges,
   pop-ups and the Start a chat dialog. The island joins it after style.css; Ooga Chat stages it with its `hosts` chunk
   (scripts/ooga-chat.mjs). Under 400px the pop-ups are sheets at the foot of the screen with 44px controls. */
.panel[data-space="list"] > :is(.cloud-status, .cloud-roster, .oc-volume, .hc-invite, .hc-room-strip),
.oc-panel[data-space="list"] > .panel-foot > .reactions,
.panel[data-space="list"] > .panel-title > .panel-chip,
.hc-chats[hidden], .hc-room-bar[hidden], .hc-invite[hidden], .hc-pop[hidden] { display: none; }
.hc-chats { display: grid; flex: 1 1 auto; align-content: start; gap: 10px; min-height: 0; overflow-y: auto; padding: 16px 18px; }
.hc-chats-head, .hc-room-bar, .hc-queue-row { display: flex; align-items: center; gap: 8px; }
.hc-chats-head .section-head, .hc-room-title, .hc-queue-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.hc-chats-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.hc-chat-row {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid rgba(243, 239, 228, 0.12);
  border-radius: 6px; background: rgba(0, 0, 0, 0.2); color: var(--paper); font: inherit; text-align: left; cursor: pointer;
}
.hc-chat-row:hover, .hc-chat-row:focus-visible { border-color: var(--accent); outline: none; }
/* The visitor's own chat, gone straight back to: an amber edge and its host line in amber. */
.hc-chat-mine { border-color: rgba(216, 137, 43, 0.55); }
.hc-chat-mine .hc-chat-row-host { color: var(--accent-text); }
/* The chat the visitor is in, at the head of the list while they browse it: Ooga Chat's purple (its speakers' ring and
   the visitor's own dot), its edge doubled and a soft glow, its line saying so; pressing it goes back into the chat. */
.hc-chat-here { border-color: #b18aff; box-shadow: inset 0 0 0 1px #b18aff, 0 0 12px rgba(177, 138, 255, 0.3); background: rgba(177, 138, 255, 0.1); }
.hc-chat-here .hc-chat-row-host { color: #d4bfff; font-weight: 700; }
.hc-chat-here .hc-chat-row-host::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #b18aff; vertical-align: 1px; animation: hc-here 1.6s ease-in-out infinite; }
@keyframes hc-here { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .hc-chat-here .hc-chat-row-host::before { animation: none; } }
/* A preview opened from inside another chat: what joining does there, and for its host the ways to step down first. */
.hc-switch-line { margin: 0; color: var(--accent-text); font-size: 12px; line-height: 1.4; }
.hc-switch-host { flex-direction: column; }
.hc-switch-host[hidden], .hc-switch-line[hidden] { display: none; }
/* A row is a grid: the host's face down the left, the title with the land's tag in the top right corner beside it (a
   title too long for the room left ends in "…", its whole self in the row's own words), then the host and the counts. */
.hc-chat-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; column-gap: 10px; row-gap: 2px; align-items: start; }
.hc-chat-row > .cloud-portrait { --face: 36px; grid-row: 1 / span 3; align-self: center; width: 36px; height: 36px; }
.hc-chat-row-text { display: contents; font-size: 11px; color: rgba(243, 239, 228, 0.78); }
.hc-chat-row-title { grid-column: 2; grid-row: 1; min-width: 0; overflow: hidden; color: var(--paper); font-size: 12px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.hc-chat-row > .panel-chip { grid-column: 3; grid-row: 1; align-self: start; }
.hc-chat-row-host, .hc-chat-row-count { grid-column: 2 / 4; font-size: 11px; color: rgba(243, 239, 228, 0.78); }
.hc-chats-status { margin: 0; color: rgba(243, 239, 228, 0.7); font-size: 11px; }
.hc-chats-status .link[hidden] { display: none; }
.hc-room-bar { flex: none; font-size: 12px; font-weight: 700; color: var(--paper); }
/* In a chat the bar stands in the panel title's line (chat-hosts.js), the carved name giving way to it, and the
   visitor's name leaves the footer: their own tile says who they are. */
.panel-title > .hc-room-bar { flex: 1 1 auto; min-width: 0; }
/* There Back to chats is its arrow alone (its words kept for assistive technology) and the title keeps to one line,
   cut short with its whole self in its title, so the chips and buttons beside it never squeeze it into a column. */
.panel-title > .hc-room-bar .hc-room-back { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 20px; font-size: 0; }
@media (pointer: coarse) { .panel .panel-title > .hc-room-bar .hc-room-back { min-width: 34px; min-height: 30px; padding: 0; } }
/* The arrow drawn, not a "‹" glyph (which sits low, at the letters' x-height): a chevron centred on the title's
   capitals. */
.panel-title > .hc-room-bar .hc-room-back::before { content: ""; width: 7px; height: 7px; border-bottom: 2px solid currentColor; border-left: 2px solid currentColor; transform: translate(1.5px, -1px) rotate(45deg); }
.panel-title > .hc-room-bar .hc-room-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; overflow-wrap: normal; }
/* In a chat the title line is the chat's own dark bar, in both apps, out to the panel's edges (its padding and gap,
   `--hc-pad-top`, `--hc-pad-x`, `--hc-gap`, one tight set for both apps' panels; full screen fixes the same
   bar over the view there): Back, the title over its counts, a host's Requests bell, Share and the view's fold button,
   each 32px square. */
.panel[data-space="on"] { --hc-pad-top: 6px; --hc-pad-x: 8px; --hc-gap: 6px; }
.panel[data-space="on"] > .panel-title {
  box-sizing: border-box; min-height: 52px; margin: calc(-1 * var(--hc-pad-top)) calc(-1 * var(--hc-pad-x)) calc(-1 * var(--hc-gap));
  padding: 0 8px 0 4px; gap: 6px; border-bottom: 1px solid rgba(243, 239, 228, 0.08); border-radius: 0; background: #0c0b0a;
}
.panel[data-space="on"] > .panel-title > :is(.hc-requests, .hc-share) { width: 32px; height: 32px; }
/* The island view's fold button the same square there, its edge amber while the view is open. */
.panel[data-space="on"] > .panel-title > .iv-fold {
  width: 32px; height: 32px; border-radius: 6px; background: rgba(36, 32, 28, 0.72); box-shadow: inset 0 0 0 1px rgba(243, 239, 228, 0.12); color: rgba(243, 239, 228, 0.9);
}
.panel[data-space="on"] > .panel-title > .iv-fold[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--accent); color: #ffd59a; }
.panel[data-space="on"] > .panel-title > .iv-fold svg { width: 17px; height: 17px; }
/* A host's Requests pop-up drops from the bar over the top of the view across the panel's width, never pushing the view
   or the roster, and scrolls itself past what the panel has room for under the bar (a phone's short island sheet
   included). Ooga Chat's full screen fixes it under its fixed bar instead (ooga-chat.css). */
.panel[data-space="on"] { position: relative; }
.panel[data-space="on"] > .hc-dock:not(:empty) {
  position: absolute; z-index: 5; top: 52px; left: 0; right: 0; max-height: calc(100% - 52px); margin: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.panel[data-space="on"] > .hc-dock > .hc-pop.hc-docked { margin: 0; }
/* The pop-up shrinks to the room under the bar, its list scrolling inside it, so none of it is ever clipped away. */
.hc-dock:not(:empty) { display: flex; flex-direction: column; }
.hc-dock > .hc-pop.hc-docked:not([hidden]) { display: flex; flex-direction: column; min-height: 0; }
.hc-dock > .hc-pop.hc-docked > .hc-pop-slab { min-height: 0; }
/* The title over how many speak and listen, one line each. */
.hc-room-titles { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; gap: 1px; }
.hc-room-titles > .hc-room-title { line-height: 1.15; }
.hc-room-count { overflow: hidden; color: rgba(243, 239, 228, 0.6); font-size: 10.5px; font-weight: 400; letter-spacing: 0.03em; white-space: nowrap; text-overflow: ellipsis; }
.hc-room-count:empty { display: none; }
/* In a chat on a narrow screen the land's tag (the Chats list and the preview say it) gives its room to the title. */
@media (max-width: 479px) { .panel[data-space="on"] > .panel-title > .panel-chip:not(.hc-requests) { display: none; } }
/* Share, a square button of its own size in the title's row, its icon drawn in the text's colour. */
.hc-share, .hc-requests {
  position: relative; flex: none; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; cursor: pointer;
  background: rgba(36, 32, 28, 0.72); box-shadow: inset 0 0 0 1px rgba(243, 239, 228, 0.12); color: rgba(243, 239, 228, 0.9); font: inherit;
}
:is(.hc-share, .hc-requests)[hidden] { display: none; }
:is(.hc-share, .hc-requests) svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:is(.hc-share, .hc-requests):is(:hover, :focus-visible) { background: rgba(36, 32, 28, 0.92); color: var(--paper); }
:is(.hc-share, .hc-requests):focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
/* The Requests bell: amber while its pop-up is open; its words for assistive technology alone; the badge, how many wait. */
.hc-requests[aria-expanded="true"] { box-shadow: inset 0 0 0 1px var(--accent); color: #ffd59a; }
.hc-requests-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hc-badge {
  position: absolute; top: -5px; right: -5px; box-sizing: border-box; display: grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--accent); box-shadow: 0 0 0 2px #0c0b0a; color: var(--ink); font-size: 10.5px; font-weight: 700; line-height: 1;
}
.hc-badge[hidden] { display: none; }
/* Alone in a chat: the roster gives its room to an invitation to share the chat. */
.hc-alone { display: grid; flex: 1 1 auto; align-content: center; justify-items: center; gap: 6px; min-height: 0; padding: 12px; text-align: center; }
.hc-alone[hidden] { display: none; }
.hc-alone p { margin: 0; color: rgba(243, 239, 228, 0.7); font-size: 12px; }
.hc-alone .hc-alone-head { color: var(--paper); font-size: 13px; font-weight: 700; }
.hc-alone .hc-alone-share { margin-top: 4px; min-height: 36px; padding: 0 16px; }
.panel:has(> .hc-alone:not([hidden])) > .cloud-roster { flex: none; min-height: 0; border-bottom-width: 0; }
/* It continues the roster's slab out to the panel's sides, with no seam between them. */
.panel[data-space="on"] > .hc-alone { margin: -6px -8px 0; border-width: 0; border-radius: 0; }
/* The Requests panel's heading beside its × . */
.hc-pop-top { display: flex; align-items: center; gap: 8px; }
.hc-pop-top > .hc-pop-head { flex: 1 1 auto; min-width: 0; }
.hc-pop-close {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px;
  background: rgba(243, 239, 228, 0.08); color: rgba(243, 239, 228, 0.85); font: inherit; font-size: 18px; line-height: 1; cursor: pointer;
}
.hc-pop-close:is(:hover, :focus-visible) { background: rgba(243, 239, 228, 0.16); color: var(--paper); }
@media (pointer: coarse) { .hc-pop-close { width: 36px; height: 36px; } }
.panel-title:has(> .hc-room-bar:not([hidden])) > :is(h2, h3) { display: none; }
.hc-dock { flex: 0 1 auto; min-height: 0; overflow-y: auto; }
/* Empty, it takes no row, so the panel's gap under the title is not doubled. */
.hc-dock:empty { display: none; }
.hc-chat-notice { flex: none; margin: 0; color: var(--accent-text); font-size: 11px; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6); }
.hc-chat-notice:empty { display: none; }
/* A notice floats, taking no room: over the top of the roster (its host stands in the panel's flow at no height, the
   panel's gap taken back), or over the island view while there is one (chat-hosts.js moves it there), a dark plate
   between the view's corner buttons; each line fades in and out over the six seconds it stands (SHOWN_MS). */
.hc-notice-host { position: relative; z-index: 3; flex: none; height: 0; margin-top: -6px; }
:is(.hc-notice-host, .iv-stage) > .hc-chat-notice {
  position: absolute; z-index: 3; top: 8px; left: 50%; box-sizing: border-box; width: max-content; max-width: calc(100% - 24px);
  transform: translateX(-50%); padding: 6px 10px; border-radius: 6px; background: rgba(20, 14, 8, 0.86); color: var(--paper);
  font-size: 12px; line-height: 1.35; text-align: center; overflow-wrap: anywhere; pointer-events: none;
}
.iv-stage > .hc-chat-notice { max-width: calc(100% - 176px); }
.hc-chat-notice.hc-flash { animation: hc-flash 6s ease forwards; }
@keyframes hc-flash { 0% { opacity: 0; } 5% { opacity: 1; } 88% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hc-chat-notice.hc-flash { animation: none; } }
.hc-invite { display: grid; flex: none; gap: 6px; padding: 10px 12px; color: var(--paper); font-size: 11px; }
.hc-invite:focus { outline: none; }
.hc-invite strong { color: var(--accent-text); font-size: 12px; }
.hc-invite-go, .hc-start-go { display: flex; flex-wrap: wrap; gap: 8px; }
.panel[data-space="on"] .cloud-face { cursor: pointer; }
/* An open request's badge at the portrait's top right (audience-tiles.js `.cloud-badge`, by the tile's `data-request`): a
   round, outlined microphone in amber for one who asked and in green for one invited to speak, an outlined star in the
   purple of Ooga Chat's hosts for an open co-host offer. A host's or co-host's rank is the label under the name. */
.cloud-badge {
  position: absolute; z-index: 2; top: -3px; right: -5px; display: none; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  box-shadow: 0 0 0 2.5px #141110;
}
.cloud-badge svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cloud-tile:is([data-request="asked"], [data-request="invited"], [data-request="cohost"]) .cloud-badge { display: grid; }
.cloud-tile[data-request="asked"] .cloud-badge { background: var(--accent); color: var(--ink); }
.cloud-tile[data-request="invited"] .cloud-badge { background: #22c55e; color: #06210f; }
.cloud-tile[data-request="cohost"] .cloud-badge { background: #b18aff; color: #1d0f3a; }
.cloud-tile[data-request="cohost"] .cloud-badge .badge-mic, .cloud-tile:not([data-request="cohost"]) .cloud-badge .badge-star { display: none; }
/* A dropped speaker's, host's or co-host's tile, kept in place while they reconnect (audience-tiles.js `reconnecting`). */
.cloud-tile[data-reconnecting] :is(.cloud-face, .cloud-name) { opacity: 0.45; }
.cloud-tile[data-reconnecting] .cloud-role { color: rgba(243, 239, 228, 0.6); font-style: italic; }
/* A menu item not open now (chat-hosts.js `disabled`): stone, dimmed, its reason under it. */
.hc-pop .foot-button[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.hc-pop-why { margin-top: -2px; }
.hc-pop, .hc-start, .hc-preview {
  border: 3px solid var(--wood-edge); border-radius: var(--radius); background: var(--planks); color: var(--paper);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.35);
}
.hc-pop { position: fixed; z-index: 980; width: max-content; max-width: min(320px, calc(100vw - 16px)); padding: 8px; }
.hc-pop-slab, .hc-start-slab { display: grid; gap: 6px; padding: 10px; }
.hc-pop-slab > .foot-button, .hc-queue-row .foot-button { min-height: 32px; }
.hc-pop-head { margin: 0; font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.hc-pop-note { margin: 0; font-size: 11px; color: rgba(243, 239, 228, 0.78); }
.hc-start { width: 420px; max-width: calc(100vw - 32px); padding: 14px 16px 16px; font: inherit; }
.hc-start::backdrop, .hc-preview::backdrop { background: rgba(0, 0, 0, 0.6); }
.hc-start h2 { margin: 0 0 10px; font-size: 14px; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.5)); }
.hc-start-label { display: grid; gap: 4px; font-size: 11px; }
.hc-start-title {
  padding: 8px; border: 2px solid var(--stone-dk); border-radius: 6px; background: rgba(0, 0, 0, 0.3); color: var(--paper); font: inherit; font-size: 16px;
}
.hc-start-zones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hc-zone-card {
  display: grid; justify-items: center; gap: 6px; padding: 12px 8px; border: 2px solid var(--stone-dk); border-radius: 8px;
  background: rgba(0, 0, 0, 0.25); color: var(--paper); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
}
.hc-zone-card[aria-checked="true"] { border-color: var(--accent); background: rgba(216, 137, 43, 0.14); }
.hc-zone-card:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.hc-zone-art svg { display: block; width: auto; height: 44px; shape-rendering: crispEdges; }
.hc-start-why { margin: 0; color: #ffb4a6; font-size: 11px; }
.hc-start-why:empty { display: none; }
.hc-start-go { justify-content: flex-end; }
@media (max-width: 399px) {
  .hc-pop { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); top: auto; width: auto; max-width: none; }
  .hc-pop .foot-button, .hc-invite .foot-button, .hc-start .foot-button { min-height: 44px; }
}
/* The Requests pop-up's Removed section, under the requests. */
.hc-pop-section { margin: 6px 0 0; color: rgba(243, 239, 228, 0.5); font-size: 9px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
/* A request's or a removed person's row: their face, their name, then round ✓ and ✕ (a request) or Allow back. */
.hc-queue-face { flex: none; display: grid; place-items: center; width: 26px; height: 26px; overflow: hidden; border-radius: 50%; background: #3a3734; color: var(--paper); font-size: 12px; font-weight: 700; }
.hc-queue-face img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.hc-queue-removed :is(.hc-queue-face, .hc-queue-name) { opacity: 0.6; }
.hc-pop .hc-queue-row .foot-button.hc-round { display: grid; place-items: center; flex: none; width: 32px; height: 32px; min-height: 0; padding: 0; border: 0; border-radius: 50%; box-shadow: none; text-shadow: none; }
.hc-pop .hc-queue-row .hc-round svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.hc-pop .hc-queue-row .foot-button.hc-approve { background: #22c55e; color: #06210f; }
.hc-pop .hc-queue-row .foot-button.hc-approve:is(:hover, :focus-visible) { background: #4ade80; }
.hc-pop .hc-queue-row .foot-button.hc-decline { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(229, 83, 61, 0.75); color: #ff9a8a; }
.hc-pop .hc-queue-row .foot-button.hc-decline:is(:hover, :focus-visible) { background: rgba(229, 83, 61, 0.16); }
.hc-pop .hc-queue-row .foot-button.hc-allow { flex: none; min-height: 30px; padding: 0 10px; border: 0; background: transparent; box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.6); color: #9ff0b8; text-shadow: none; }
.hc-pop .hc-queue-row .foot-button.hc-allow:is(:hover, :focus-visible) { background: rgba(34, 197, 94, 0.14); }
@media (pointer: coarse) { .hc-pop .hc-queue-row .foot-button.hc-round { width: 38px; height: 38px; } .hc-pop .hc-queue-row .foot-button.hc-allow { min-height: 38px; } }
/* A chat's preview (chat-hosts.js): its title with the zone and Open stage tags, its stage in the chat's circles to look at
   only, how many listen and wait, and the two ways in. */
.hc-preview { width: 460px; max-width: calc(100vw - 32px); padding: 14px 16px 16px; font: inherit; }
.hc-preview-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 10px; }
.hc-preview-head h2 { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 14px; overflow-wrap: anywhere; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.5)); }
.hc-preview-stage {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); align-content: start; gap: 10px 4px;
  max-height: min(40vh, 320px); min-height: 92px; margin: 0; padding: 6px 4px; overflow-y: auto; list-style: none;
}
.hc-preview-count { margin: 0; font-size: 11px; color: rgba(243, 239, 228, 0.78); }
.hc-preview .cloud-mic { cursor: default; }
/* The Open stage tag, and the host's switch for it in the Requests pop-up. */
.hc-open-tag { color: #bfeccb; border-color: rgba(34, 197, 94, 0.38); }
.hc-open-tag[hidden] { display: none; }
.hc-open-switch { display: flex; align-items: center; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid rgba(243, 239, 228, 0.1); font-size: 11px; cursor: pointer; }
.hc-open-switch input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
@media (max-width: 399px) {
  .hc-preview .foot-button { min-height: 44px; }
  .hc-open-switch input { width: 22px; height: 22px; }
}
/* The island view (island-view.js) over a Main Island chat's roster: the flat map or the 3D view under the same faces,
   Reset view and the full screen button (its usual icon) in its upper corners and Go there in its lower left.
   In a short panel (the island's sheet) the view gives way first, down to a stage 96px tall, so one row of
   the roster, the emoji bar and the footer stay in sight; the picture keeps its shape, letterboxed in the stage. */
.hc-room-strip { flex: 0 1 auto; min-height: 96px; display: flex; flex-direction: column; }
.hc-room-strip[hidden], .iv[hidden] { display: none; }
.iv { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; gap: 4px; }
/* The fold button in the chat's title, a framed island on a filled chip with no border (so the title's row stays
   short), amber while the view is open: folded, the strip is gone and the
   roster takes its place. The view meets the roster with no gap (the panel's own 10px is taken back) and no line between:
   who walks there is said to screen readers alone. */
.iv-fold {
  flex: none; display: grid; place-items: center; width: 30px; height: 22px; padding: 0; border: 0;
  border-radius: 6px; background: rgba(243, 239, 228, 0.14); color: rgba(243, 239, 228, 0.75); cursor: pointer;
}
.iv-fold[hidden] { display: none; }
.iv-fold[aria-pressed="true"] { color: #ffd59a; background: rgba(216, 137, 43, 0.38); }
.iv-fold svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.iv-fold:hover { background: rgba(243, 239, 228, 0.24); }
.iv-fold[aria-pressed="true"]:hover { background: rgba(216, 137, 43, 0.52); }
.iv-fold:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.iv-stage[hidden] { display: none; }
.hc-room-strip:has(> .iv[data-folded="true"]) { display: none; }
.hc-room-strip { margin-bottom: -6px; }
.hc-room-strip .iv-stage { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.hc-room-strip:not([hidden]):not(:has(> .iv[data-folded="true"])) + .cloud-roster { border-top-left-radius: 0; border-top-right-radius: 0; }
.iv-note { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (pointer: coarse) { .iv-fold { width: 38px; height: 26px; } }
.panel[data-space="on"] > .cloud-roster { min-height: 104px; }
.iv-stage {
  position: relative; flex: 0 1 auto; width: 100%; aspect-ratio: 4 / 3; min-height: 96px; max-height: 200px; overflow: hidden;
  border: 2px solid var(--stone-dk); border-radius: 9px 7px 10px 8px; background: #1f6aa5; box-shadow: var(--tablet-shadow);
}
.iv-map, .iv-gl { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.iv-stage[data-live="on"] .iv-map { background: transparent; }
/* Until the view has something to show (island-view.js `waiting`): dark, with a ring turning in its middle. */
.iv-stage[data-wait] { background: #07080b; }
.iv-stage[data-wait]::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 28px; height: 28px; margin: -16px 0 0 -16px;
  border: 3px solid rgba(243, 239, 228, 0.18); border-top-color: #b18aff; border-radius: 50%; animation: iv-wait 0.9s linear infinite;
}
@keyframes iv-wait { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { .iv-stage[data-wait]::after { animation-duration: 2.4s; } }
/* The 3D view takes the drag, the pinch and the wheel itself. */
.iv-stage[data-live="on"] { touch-action: none; cursor: grab; }
.iv-stage[data-live="on"]:active { cursor: grabbing; }
.iv-reset, .iv-full-button {
  position: absolute; top: 6px; min-height: 28px; padding: 0 8px; border: 2px solid var(--wood-edge); border-radius: 6px;
  background: var(--stone); color: var(--paper); font: inherit; font-size: 11px; font-weight: 700; cursor: pointer;
}
.iv-reset { left: 6px; }
/* Full screen's button keeps tight round its icon, the same 24px square at every width, in the strip and in full screen. */
.iv-full-button { right: 6px; display: grid; place-items: center; width: 24px; height: 24px; min-height: 0; padding: 0; border-width: 0; border-radius: 5px; }
.iv-full-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; }
.iv-reset[hidden], .iv-full-button[hidden] { display: none; }
/* Over the view they stay faint, a dark glass the view shows through, and firm up under the pointer or focus. */
.iv-reset, .iv-full-button { border-color: transparent; background: rgba(12, 10, 8, 0.32); color: rgba(243, 239, 228, 0.82); backdrop-filter: blur(2px); }
.iv-reset:hover, .iv-full-button:hover, .iv-reset:focus-visible, .iv-full-button:focus-visible { background: rgba(12, 10, 8, 0.62); color: var(--paper); }
.iv-reset:focus-visible, .iv-full-button:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
/* The chat's land on its island view, in the view's glass, just left of the full-screen button (or in that corner where
   the page offers no full screen); the title's own tag stands aside while it shows. */
.iv-land-tag {
  position: absolute; z-index: 2; top: 6px; right: 6px; display: grid; place-items: center; box-sizing: border-box; height: 24px; padding: 0 8px;
  border-radius: 5px; background: rgba(12, 10, 8, 0.45); color: rgba(243, 239, 228, 0.9); font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
  line-height: 1; text-transform: uppercase; backdrop-filter: blur(2px);
}
.iv-land-tag[hidden] { display: none; }
.iv-full-button:not([hidden]) ~ .iv-land-tag { right: 36px; }
.panel.hc-land-in-view[data-space="on"] > .panel-title > .panel-chip:not(.hc-requests) { display: none; }
/* Join on island over the island, in its lower left corner, in the same dark glass as the view's own buttons rather
   than a wood slab over the scene. */
.iv-stage > .hc-go { position: absolute; left: 6px; bottom: 6px; min-height: 28px; padding: 0 10px; font-size: 11px; }
.iv-stage > .hc-go, .iv-stage > .hc-go:disabled {
  border-color: rgba(243, 239, 228, 0.16); background: rgba(12, 10, 8, 0.45); color: rgba(243, 239, 228, 0.92);
  box-shadow: none; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6); backdrop-filter: blur(2px);
}
.iv-stage > .hc-go:is(:hover, :focus-visible):not(:disabled) { background: rgba(12, 10, 8, 0.68); color: var(--paper); }
.iv-stage > .hc-go:disabled { color: rgba(243, 239, 228, 0.55); }
.iv-stage > .hc-go[hidden] { display: none; }
@media (max-width: 399px) { .iv-reset, .iv-stage > .hc-go { min-height: 44px; } .iv-stage { max-height: 180px; } }
/* Full screen (island-view.js `fullscreen`): the view in a layer over the page, its panel's empty strip folded away, and
   the page's own panel placed beside it by the page (Ooga Chat's ooga-chat.css). A screen taller than it is wide puts
   the view over the panel. */
.iv-full-host { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; right: var(--iv-side, min(420px, 42vw)); display: flex; background: var(--bg, #14100c); }
.iv-full-host > .iv { flex: 1 1 auto; padding: 0; }
/* The split's handle, an unmarked strip centred on the line between the view and the chat's panel, over both
   (island-view.js): dragged, or moved with the arrows, to give the view more or less of the screen. Nothing shows until
   a pointer is over it (its cursor changes and a thin purple line lies over the seam), it has the keyboard's focus or it is being dragged. */
.iv-split { position: fixed; z-index: 42; top: 0; bottom: 0; right: calc(var(--iv-side, min(420px, 42vw)) - 7px); width: 14px; cursor: col-resize; touch-action: none; }
.iv-split::after { content: ""; position: absolute; top: 0; bottom: 0; left: 6px; width: 2px; background: transparent; transition: background-color 120ms; }
.iv-split:hover::after, .iv-split:focus-visible::after, .iv-split[data-drag]::after { background: #b18aff; }
.iv-split:focus-visible { outline: none; }
@media (max-aspect-ratio: 1 / 1) {
  .iv-split { top: calc(var(--iv-split, 55dvh) - 11px); right: 0; bottom: auto; left: 0; width: auto; height: 22px; cursor: row-resize; }
  .iv-split::after { top: 10px; right: 0; bottom: auto; left: 0; width: auto; height: 2px; }
}
/* Its grabber, a pill on the seam's middle (island-view.js `hint`): shown a few seconds as full screen opens, then fading,
   and back while touched, dragged, hovered or focused. */
.iv-split::before {
  content: ""; position: absolute; top: 50%; left: 50%; width: 5px; height: 40px; margin: -20px 0 0 -2.5px; border-radius: 3px;
  background: rgba(243, 239, 228, 0.6); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); opacity: 0; transition: opacity 400ms ease;
}
.iv-split:is([data-hint], [data-drag], :hover, :focus-visible)::before { opacity: 1; transition-duration: 150ms; }
@media (max-aspect-ratio: 1 / 1) { .iv-split::before { width: 40px; height: 5px; margin: -2.5px 0 0 -20px; } }
@media (prefers-reduced-motion: reduce) { .iv-split::after, .iv-split::before { transition: none; } }
/* The view fills its side to the edges, square and with no border, meeting the panel beside or under it with no gap. */
.iv-full-host .iv-stage { flex: 1 1 auto; aspect-ratio: auto; max-height: none; min-height: 0; border-width: 0; border-radius: 0; box-shadow: none; }
html.iv-full .hc-room-strip { display: none; }
/* On a screen taller than it is wide (a phone held upright) the view runs edge to edge across the top. */
@media (max-aspect-ratio: 1 / 1) { .iv-full-host { right: 0; bottom: auto; height: var(--iv-split, 55dvh); } }
/* In a chat the island view and the roster of faces run out to the panel's sides (its 8px padding taken back), square,
   meeting with no gap, at every width, in both apps' panels. */
.panel[data-space="on"] > :is(.hc-room-strip, .cloud-roster) { margin-right: -8px; margin-left: -8px; border-right-width: 0; border-left-width: 0; border-radius: 0; }
.panel[data-space="on"] > .hc-room-strip .iv-stage { border-right-width: 0; border-left-width: 0; border-radius: 0; }
/* In a chat on a narrow screen the footer is one row: the buttons, each as wide as its words (Unmute, Join voice,
   Request to speak, End chat), then the links (Leave chat); any note a button carries goes under them. */
@media (max-width: 479px) {
  .panel[data-space="on"] .cloud-foot { flex-wrap: wrap; gap: 6px 8px; }
  .panel[data-space="on"] .cloud-foot-actions { display: contents; }
  .panel[data-space="on"] .cloud-foot .foot-button { order: 1; flex: 1 1 auto; min-width: 0; padding: 0 6px; letter-spacing: 0.04em; }
  .panel[data-space="on"] .cloud-foot .link { order: 2; flex: none; }
  .panel[data-space="on"] .cloud-foot > :not(.cloud-foot-who, .cloud-foot-actions) { order: 3; flex-basis: 100%; }
  .panel[data-space="on"] .cloud-foot > .cloud-foot-who { order: 4; }
}

/* The Requests panel dropped from the chat's bar (chat-hosts.js `dock`, laid over the view by the rules on the chat
   bar), scrolling itself when long. Placed last so it wins over the floating pop-up's phone sheet. */
.hc-pop.hc-docked { position: static; z-index: auto; width: auto; max-width: none; margin: 6px 0 0; padding: 0; inset: auto; }
/* It takes the chat bar's dark rather than a wood frame, so it reads as part of the bar it drops from. */
.hc-pop.hc-docked { border: 0; border-radius: 0; background: #0c0b0a; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45); }
.hc-pop.hc-docked .hc-pop-slab { max-height: min(40vh, 320px); overflow-y: auto; }

/* Review fixes (desktop and phone). The invite and co-host offer cards are slabs but never stretch to fill the panel. */
.panel > .hc-invite { flex: none; align-content: start; }
/* A chat's counts keep on one line. */
.hc-chat-row-count { white-space: nowrap; }
@media (max-width: 399px) {
  /* The preview's ways in, stacked full width with the amber one first. */
  .hc-preview .hc-start-go { flex-direction: column-reverse; }
  .hc-preview .hc-start-go .foot-button { width: 100%; }
}
/* Sign out stays in a chat on its own line under the buttons (cloud-foot-who), well away from Leave chat; Leave chat and
   Back to chats are real tap targets on a touch screen. */
@media (pointer: coarse) {
  .panel[data-space] :is(.hc-room-back, .hc-leave) { min-height: 40px; padding: 0 8px; }
}
/* On a narrow screen a chat keeps one whole row of its roster, names and roles included, under a smaller island view. */
@media (max-width: 479px) {
  .panel[data-space="on"] > .cloud-roster { min-height: 116px; }
  .panel[data-space="on"] .iv-stage { max-height: 132px; }
}
/* The pop-ups' buttons by what they do, as every pop-up's are: the one amber action, red for what removes someone or
   ends the chat, stone for the rest (Cancel, Not now, Decline, a tile menu's other choices). The tile menu's Cancel
   stands apart at its foot. */
:is(.hc-pop, .hc-start, .hc-preview, .hc-invite) .foot-button:not(.foot-primary, .hc-danger) { background: var(--stone); }
:is(.hc-pop, .hc-start, .hc-preview, .hc-invite) .foot-button:not(.foot-primary, .hc-danger):is(:hover, :focus-visible):not(:disabled, [aria-disabled="true"]) { background: var(--stone-lt); }
.hc-danger { background: linear-gradient(#ef6a55, var(--danger)); color: #fff; }
.hc-danger:is(:hover, :focus-visible) { background: linear-gradient(#f5806d, #ef5a44); }
.hc-pop-cancel { margin-top: 4px; }
