/* =============================================================================
 * Stash — layout.css   (owner: Shell)
 * App frame, safe areas, screen switching, and the layouts of every Shell
 * screen (boot, title, menu, opponents, pass-and-play setup) and overlay
 * (settings, how to play, stats, pause, confirms). The UI kit lives in
 * pixel.css; the in-game screen belongs to game.css / board.css.
 *
 * <html data-layout="phone|phone-land|tablet|desk"> is set by App from the
 * visible viewport (UX doc §2.1); CSS keys off it rather than media queries.
 * <html data-motion="reduced"> kills Shell animations (setting or system).
 * ========================================================================== */

:root {
  --sa-top: env(safe-area-inset-top, 0px);
  --sa-right: env(safe-area-inset-right, 0px);
  --sa-bottom: env(safe-area-inset-bottom, 0px);
  --sa-left: env(safe-area-inset-left, 0px);
  --gutter: 16px;
}

/* ------------------------------------------------------------------ frame -- */
html, body {
  position: fixed;
  inset: 0;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--c-ink);
}
#app {
  position: fixed;
  left: 0; top: 0; right: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  touch-action: manipulation;              /* no double-tap zoom */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
html[style*="--vh"] #app { height: var(--vh); }
input, textarea { -webkit-user-select: text; user-select: text; }
img, canvas { -webkit-user-drag: none; }
.hidden { display: none !important; }

.noscript { position: fixed; inset: 16px; margin: auto; max-width: 420px; height: max-content; text-align: center; z-index: 5; }

/* --------------------------------------------------------------- screens -- */
.screen {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  padding: var(--sa-top) var(--sa-right) var(--sa-bottom) var(--sa-left);
}
.screen.active { display: flex; animation: scr-in 160ms steps(4, end) both; }
.screen:focus { outline: none; }
@keyframes scr-in { from { transform: translateY(8px); } to { transform: none; } }

/* Game owns everything inside; this is just the empty, full-viewport box. */
#screen-game {
  position: fixed;
  inset: 0;
  z-index: 2;
  padding: var(--sa-top) var(--sa-right) var(--sa-bottom) var(--sa-left);
  background: var(--c-ink);
}
#screen-game.active { display: block; animation: none; }

/* scrolling panes are the only places that scroll */
.sheet-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

/* ---------------------------------------------------------- backdrop scene -- */
.scene {
  position: absolute;
  left: 0; top: 0;
  z-index: 0;
  display: block;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}
#app[data-scene="off"] .scene { visibility: hidden; }
/* menus sit on the dockyard, dimmed with a 50% ink checker (pure palette dither) */
#screen-menu, #screen-opponents, #screen-local {
  background: var(--img-scrim) 0 0 / 4px 4px repeat;
}

/* ------------------------------------------------------------------ boot -- */
#screen-boot { background: var(--c-ink); }
#screen-boot.active { display: flex; align-items: center; justify-content: center; animation: none; }
.boot-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 24px;
  width: min(440px, calc(100% - 32px));
  text-align: center;
}
.boot-logo { line-height: 0; }
.boot-coins { display: flex; gap: 16px; }
.boot-coin { width: 48px; height: 48px; line-height: 0; }
.boot-coin canvas:last-child { display: none; }
.boot-coin.on canvas:first-child { display: none; }
.boot-coin.on canvas:last-child { display: block; animation: coin-pop 160ms steps(2, end); }
@keyframes coin-pop { from { transform: translateY(-8px); } to { transform: none; } }
.boot-msg { margin: 0; color: var(--c-fog); min-height: 24px; }
.boot-error { width: 100%; }
.boot-error:empty { display: none; }
.boot-panel { text-align: left; }
.boot-panel p { margin: 0 0 12px; }
.boot-h { margin: 0 0 16px; font-size: 16px; line-height: 24px; }
.boot-code {
  margin: 0 0 12px;
  font: 16px/24px var(--font-ui);
  color: var(--c-gold-light);
  -webkit-user-select: text; user-select: text;
}
.boot-code code { font: inherit; }
.boot-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }

/* ----------------------------------------------------------------- title -- */
#screen-title { --sky: 50vh; --water: 76vh; }
#screen-title.active { display: block; animation: none; }
.title-wrap { position: absolute; inset: 0; pointer-events: none; }
.title-gate {
  position: absolute; inset: 0;
  margin: 0; padding: 0; border: 0;
  background: none;
  cursor: pointer;
  pointer-events: auto;
}
.title-gate:focus-visible { outline: none; }
.title-hero {
  position: absolute;
  left: 16px; right: 16px;
  top: calc(var(--sky) * 0.46);
  transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  text-align: center;
}
.title-logo { margin: 0; line-height: 0; }
.title-word { animation: title-drop 320ms steps(4, end) both; filter: drop-shadow(0 6px 0 var(--c-ink)); }
@keyframes title-drop { from { transform: translateY(-24px); } to { transform: none; } }
.title-tag {
  margin: 0;
  max-width: 32em;
  text-wrap: balance;
  color: var(--c-mist);
  line-height: 24px;
  text-shadow: 0 2px 0 var(--c-ink);
}
.title-start {
  position: absolute;
  left: 16px; right: 16px;
  top: calc((var(--water) + 100%) / 2 - 36px);
  margin: 0;
  text-align: center;
  color: var(--c-white);
  font-size: 16px; line-height: 24px;
  text-shadow: 0 2px 0 var(--c-ink), 2px 0 0 var(--c-ink), -2px 0 0 var(--c-ink), 0 -2px 0 var(--c-ink);
  animation: blink 1200ms steps(1, end) infinite;
}
.title-gate:focus-visible ~ .title-start { color: var(--c-amber); }
@keyframes blink { 0%, 64% { opacity: 1; } 65%, 100% { opacity: 0; } }
.title-foot {
  position: absolute;
  left: 16px; right: 16px;
  bottom: 16px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
}
.title-meta { margin: 0; display: flex; gap: 16px; color: var(--c-steel); text-shadow: 0 2px 0 var(--c-ink); }
.title-foot .sound-btn { pointer-events: auto; }
:root[data-layout="desk"] .title-start { font-size: 24px; line-height: 32px; text-shadow: 0 3px 0 var(--c-ink), 3px 0 0 var(--c-ink), -3px 0 0 var(--c-ink), 0 -3px 0 var(--c-ink); }
:root[data-layout="phone"] .title-credit,
:root[data-layout="phone-land"] .title-credit { display: none; }
:root[data-layout="phone-land"] .title-hero { gap: 8px; }

/* ------------------------------------------------------- shared headings -- */
.scr-head {
  flex: none;
  display: flex; align-items: center; gap: 16px;
  width: 100%; max-width: 1120px;
  margin: 0 auto;
  padding: 16px var(--gutter) 8px;
}
.scr-title { margin: 0; font-size: 24px; line-height: 32px; text-shadow: 0 3px 0 var(--c-ink); }
:root[data-layout="phone"] .scr-title,
:root[data-layout="phone-land"] .scr-title { font-size: 16px; line-height: 24px; text-shadow: 0 2px 0 var(--c-ink); }
:root[data-layout="phone"] .back-btn .btn-label { display: none; }
:root[data-layout="phone"] .back-btn { min-width: var(--px-btn-h); width: var(--px-btn-h); padding-left: 0; padding-right: 0; }

/* buttons with a sub-line (menu) */
.px-btn .btn-label { display: block; }
.px-btn .btn-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.px-btn.tall { gap: 4px; }
.px-btn .btn-sub {
  display: block;
  font: 16px/16px var(--font-body);
  text-transform: none;
  font-weight: 400;
  color: var(--c-mist);
  white-space: normal;
}
.px-btn.primary .btn-sub { color: var(--c-ink); }
.px-btn.is-unavailable .btn-sub { color: var(--c-pink); }
.px-btn.tall { min-height: 64px; }

/* ------------------------------------------------------------------ menu -- */
#screen-menu.active { flex-direction: column; align-items: center; justify-content: center; }
.menu-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 32px;
  width: min(360px, calc(100% - 32px));
}
.menu-logo { margin: 0; line-height: 0; filter: drop-shadow(0 4px 0 var(--c-ink)); }
.menu-list { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.menu-row { display: flex; gap: 12px; }
.menu-row > .px-btn { flex: 1 1 0; min-width: 0; }
.menu-corner { position: absolute; top: calc(var(--sa-top) + 16px); right: calc(var(--sa-right) + 16px); }
:root[data-layout="phone"] #screen-menu.active { justify-content: flex-end; }
:root[data-layout="phone"] .menu-wrap { flex: 1 1 auto; justify-content: space-between; gap: 24px; padding: max(56px, 8vh) 0 24px; }
:root[data-layout="phone-land"] .menu-wrap { flex-direction: row; width: min(760px, calc(100% - 96px)); gap: 32px; }
:root[data-layout="phone-land"] .menu-list { gap: 8px; }
:root[data-layout="phone-land"] .px-btn.tall { min-height: 56px; }

/* ------------------------------------------------------- opponent select -- */
#screen-opponents.active, #screen-local.active { flex-direction: column; }
.opp-body {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 24px;
  width: 100%; max-width: 1120px;
  margin: 0 auto;
  padding: 8px var(--gutter) 24px;
}
.opp-nudge {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin: 0;
}
.opp-nudge p { margin: 0; color: var(--c-mist); text-shadow: 0 2px 0 var(--c-ink); }
.opp-grid {
  --tgt: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}
.opp-card {
  -webkit-appearance: none; appearance: none;
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 16px 8px;
  border: 8px solid var(--c-quay);
  border-image-source: var(--img-panel);
  border-image-slice: var(--px-slice) fill;
  border-image-width: 8px;
  background: var(--c-quay) padding-box;
  box-shadow: 0 4px 0 var(--c-ink);
  color: var(--c-mist);
  font: 16px/24px var(--font-body);
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  image-rendering: pixelated;
}
.opp-card > * { pointer-events: none; }
.opp-card.sel { transform: translateY(-4px); box-shadow: 0 8px 0 var(--c-ink); }
.opp-card:focus-visible { outline: 2px solid var(--c-white); outline-offset: 6px; }
.opp-corners { position: absolute; inset: -10px; display: none; }
.opp-card.sel .opp-corners { display: block; }
.opp-card.sel .opp-corners { animation: corner-pulse 1000ms steps(1, end) infinite; }
.opp-corners i { position: absolute; width: var(--tgt); height: var(--tgt); background: 0 0 / 100% 100% no-repeat; image-rendering: pixelated; }
.opp-corners .tl { left: 0; top: 0; background-image: var(--tgt-tl); }
.opp-corners .tr { right: 0; top: 0; background-image: var(--tgt-tr); }
.opp-corners .bl { left: 0; bottom: 0; background-image: var(--tgt-bl); }
.opp-corners .br { right: 0; bottom: 0; background-image: var(--tgt-br); }
@keyframes corner-pulse { 0%, 49% { margin: 0; } 50%, 100% { margin: -2px; } }
.opp-pwrap { position: relative; line-height: 0; }
.opp-portrait { display: block; box-shadow: 0 0 0 2px var(--c-ink); }
.opp-card.sel .opp-portrait { animation: bob 1200ms steps(1, end) infinite; }
.opp-card.picked .opp-portrait { animation: none; transform: translateY(-4px); }
@keyframes bob { 0%, 49% { transform: none; } 50%, 100% { transform: translateY(-2px); } }
.opp-tag { position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%); }
.opp-text { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; width: 100%; }
.opp-name {
  font: 16px/24px var(--font-display);
  text-transform: uppercase;
  color: var(--c-white);
  text-shadow: 0 2px 0 var(--c-ink);
  min-height: 48px;
  display: flex; align-items: center; justify-content: center;
  overflow-wrap: anywhere;
}
.opp-card.sel .opp-name { color: var(--c-amber); }
.opp-title { font: 16px/16px var(--font-ui); text-transform: uppercase; color: var(--c-fog); margin-top: -8px; }
.opp-lamps { display: inline-flex; gap: 4px; line-height: 0; }
.opp-line { color: var(--c-mist); min-height: 96px; }
.opp-rec { color: var(--c-fog); }
.opp-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.opp-foot .px-btn { max-width: 400px; }
.opp-detail-line { display: none; margin: 0; color: var(--c-mist); text-shadow: 0 2px 0 var(--c-ink); text-align: center; }

/* tablet: 2×2 */
:root[data-layout="tablet"] .opp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 640px; margin: 0 auto; width: 100%; }
:root[data-layout="tablet"] .opp-line { min-height: 0; }

/* phone: a list of rows, the line goes under the list */
:root[data-layout="phone"] .opp-grid { grid-template-columns: 1fr; gap: 8px; --tgt: 12px; }
:root[data-layout="phone"] .opp-body { justify-content: flex-start; gap: 16px; padding-top: 8px; padding-bottom: 16px; }
:root[data-layout="phone"] .opp-card { flex-direction: row; align-items: center; gap: 12px; padding: 4px 8px 4px 4px; text-align: left; }
:root[data-layout="phone"] .opp-card.sel { transform: none; box-shadow: 0 4px 0 var(--c-ink); }
:root[data-layout="phone"] .opp-corners { inset: -6px; }
:root[data-layout="phone"] .opp-text { align-items: flex-start; gap: 4px; }
:root[data-layout="phone"] .opp-name { font: 16px/16px var(--font-ui); min-height: 0; justify-content: flex-start; }
:root[data-layout="phone"] .opp-title { margin-top: 0; }
:root[data-layout="phone"] .opp-line { display: none; }
:root[data-layout="phone"] .opp-rec { font-size: 16px; line-height: 16px; }
:root[data-layout="phone"] .opp-pwrap { position: static; }
:root[data-layout="phone"] .opp-tag { left: auto; top: auto; right: 8px; bottom: 8px; transform: none; }
@media (max-height: 739px) {
  :root[data-layout="phone"] .opp-title { display: none; }
  :root[data-layout="phone"] .opp-nudge { display: none; }
  :root[data-layout="phone"] .opp-detail-line { min-height: 0; }
}
:root[data-layout="phone"] .opp-detail-line { display: block; min-height: 72px; text-align: left; text-shadow: none; padding: 4px 8px; }
:root[data-layout="phone"] .opp-foot { margin-top: auto; }
:root[data-layout="phone"] .opp-foot .px-btn { max-width: none; }
:root[data-layout="phone"] .opp-nudge { justify-content: space-between; }

/* phone landscape: one compact row */
:root[data-layout="phone-land"] .opp-grid { gap: 12px; }
:root[data-layout="phone-land"] .opp-body { gap: 16px; padding-bottom: 12px; }
:root[data-layout="phone-land"] .opp-card { padding: 8px 4px; gap: 4px; }
:root[data-layout="phone-land"] .opp-name { font: 16px/16px var(--font-ui); min-height: 32px; }
:root[data-layout="phone-land"] .opp-line,
:root[data-layout="phone-land"] .opp-title,
:root[data-layout="phone-land"] .opp-nudge { display: none; }
:root[data-layout="phone-land"] .opp-tag { display: none; }

/* --------------------------------------------------------- pass and play -- */
.local-body {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 16px;
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 8px var(--gutter) 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.local-panel { padding: 8px 8px 4px; }
.local-count .px-tab { gap: 8px; }
.local-chips { display: inline-flex; gap: 2px; line-height: 0; }
.local-chips .px-chip { width: 16px; height: 16px; }
.local-note { margin: 8px 0 8px; color: var(--c-fog); }
.local-names { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.local-row { display: flex; align-items: center; gap: 12px; }
.local-input {
  flex: 1 1 auto; min-width: 0;
  height: 48px;
  padding: 0 8px;
  border: 8px solid var(--c-ink);
  border-image-source: var(--img-well);
  border-image-slice: var(--px-slice) fill;
  border-image-width: 8px;
  background: var(--c-ink) padding-box;
  color: var(--c-white);
  font: 16px/24px var(--font-body);
  border-radius: 0;
  -webkit-appearance: none; appearance: none;
  outline: none;
}
.local-input::placeholder { color: var(--c-steel); opacity: 1; }
.local-input:focus { box-shadow: 0 0 0 2px var(--c-amber); }
.local-privacy { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 4px; color: var(--c-mist); }
.local-privacy .px-icon { margin-top: 3px; }
.local-foot { display: flex; }
:root[data-layout="desk"] .local-names,
:root[data-layout="tablet"] .local-names,
:root[data-layout="phone-land"] .local-names { grid-template-columns: 1fr 1fr; }
:root[data-layout="phone-land"] .local-body { justify-content: flex-start; width: min(720px, 100%); }

/* --------------------------------------------------------------- overlays -- */
#overlay-root { position: relative; z-index: 100; }
.px-scrim.overlay {
  padding: calc(8px + var(--sa-top)) calc(8px + var(--sa-right)) calc(8px + var(--sa-bottom)) calc(8px + var(--sa-left));
  touch-action: none;
}
.px-modal { -webkit-user-select: none; user-select: none; }
.px-modal.wide { max-width: 720px; }
.px-modal.sheet { display: flex; flex-direction: column; overflow: hidden; }
.px-modal.sheet .sheet-body {
  flex: 1 1 auto; min-height: 0;
  margin: 0 -8px; padding: 0 8px 8px;
}
.px-modal.sheet .px-modal-actions { flex: none; margin-top: 16px; }
.dlg-head { position: relative; flex: none; }
.dlg-head .px-modal-title { padding: 0 48px; }
.dlg-head:empty { display: none; }
.dlg-x { position: absolute; right: -8px; top: -8px; }
.px-modal-body p { margin: 0 0 8px; }
:root[data-layout="phone"] .dlg-x { top: -4px; right: -4px; }
:root[data-layout="phone"] .px-modal-title { font-size: 16px; line-height: 24px; text-shadow: 0 2px 0 var(--c-ink); min-height: 40px; display: flex; align-items: center; justify-content: center; }
:root[data-layout="phone"] .px-modal { padding: 16px; }
:root[data-layout="phone"] .px-modal.sheet { width: 100%; max-width: none; height: 100%; }
:root[data-layout="phone-land"] .px-modal.sheet { max-width: 640px; height: 100%; }
:root[data-layout="phone-land"] .px-modal { padding: 16px; }

/* settings */
.set-group { margin: 0 0 24px; }
.set-group > .px-eyebrow { margin: 0 0 4px; color: var(--c-amber); }
.set-row { display: flex; flex-direction: column; border-bottom: 2px solid var(--c-slate); padding: 4px 0; }
.set-row:last-child { border-bottom: 0; }
.set-toggle { width: 100%; justify-content: flex-start; }
.set-label { font: 16px/16px var(--font-ui); text-transform: uppercase; color: var(--c-white); margin: 0; text-align: left; }
.set-toggle .set-label { margin-right: auto; }
.set-row.slider { flex-direction: row; align-items: center; gap: 16px; min-height: 52px; }
.set-row.slider .set-label { flex: 0 0 136px; }
.set-slider { flex: 1 1 auto; display: flex; align-items: center; gap: 12px; min-width: 0; }
.set-slider .px-slider { min-width: 0; }
.set-val { width: 24px; text-align: right; color: var(--c-white); }
.set-row.seg { padding: 12px 0 8px; gap: 8px; }
.set-seg .px-tab { min-width: 0; }
.set-note { margin: 4px 0 4px; color: var(--c-fog); font: 16px/24px var(--font-body); }
.set-btns { flex-direction: column; gap: 12px; padding: 8px 0; border-bottom: 0; }
.set-credits p.set-note { margin: 0 0 4px; }
:root[data-layout="phone"] .set-row.slider { flex-wrap: wrap; gap: 0 16px; }
:root[data-layout="phone"] .set-row.slider .set-label { flex: 1 0 100%; padding-top: 8px; }
.settings-dlg { max-width: 560px; }

/* how to play */
.howto-dlg .sheet-body:focus-visible { outline: 2px solid var(--c-white); outline-offset: -2px; }
.how-top { display: flex; justify-content: center; margin: 4px 0 16px; }
.how-top:empty { display: none; }
.how-card { margin: 0 0 8px; }
.how-card .how-h { margin: 0 0 12px; }
.how-dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.how-dl dt { color: var(--c-amber); padding-top: 4px; }
.how-dl dd { margin: 0; color: var(--c-mist); }
:root[data-layout="phone"] .how-dl { grid-template-columns: 1fr; gap: 0; }
:root[data-layout="phone"] .how-dl dd { margin-bottom: 8px; }
.how-sec { margin: 24px 0 0; }
.how-h { margin: 0 0 8px; color: var(--c-amber); font-size: 16px; line-height: 16px; }
.how-diag { margin: 12px 0; line-height: 0; overflow-x: auto; }
.how-diag canvas { box-shadow: 0 0 0 2px var(--c-ink); }
.how-t { margin: 0; color: var(--c-mist); }
.how-loot { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.how-loot li { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.how-loot-name { color: var(--c-white); }
.how-loot-val { color: var(--c-fog); white-space: nowrap; }
:root[data-layout="phone"] .how-loot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.how-bots { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.how-bots li { display: flex; gap: 12px; align-items: flex-start; }
.how-bots li canvas { flex: none; box-shadow: 0 0 0 2px var(--c-ink); }
.how-bots p { margin: 0; }
.how-bot-name { color: var(--c-white); margin-bottom: 4px !important; }

/* stats */
.stats-dlg { max-width: 560px; }
.stats-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 16px; }
:root[data-layout="phone"] .stats-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-tile { display: flex; flex-direction: column; gap: 4px; padding: 8px; min-width: 0; }
.stat-v { color: var(--c-white); font-size: 16px; line-height: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-l { color: var(--c-fog); font: 16px/16px var(--font-body); }
.stats-table { width: 100%; border-collapse: collapse; font: 16px/16px var(--font-ui); text-transform: uppercase; }
.stats-table caption { text-align: left; caption-side: top; }
.stats-table th, .stats-table td { padding: 8px 4px; border-bottom: 2px solid var(--c-slate); text-align: right; color: var(--c-white); font-weight: 400; }
.stats-table thead th { color: var(--c-fog); }
.stats-table th[scope="row"], .stats-table thead th:first-child { text-align: left; }
.stats-table th[scope="row"] { display: flex; align-items: center; gap: 8px; }
.stats-table th[scope="row"] canvas { width: 24px; height: 24px; box-shadow: 0 0 0 2px var(--c-ink); }
.stats-empty { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 16px 0; text-align: center; }
.stats-local { margin-top: 12px !important; color: var(--c-mist); }

/* pause, confirms, small dialogs */
.pause-dlg { max-width: 380px; }
.pause-list { display: flex; flex-direction: column; gap: 12px; }
.tut-offer { display: flex; align-items: center; gap: 16px; }
.tut-offer canvas { flex: none; box-shadow: 0 0 0 2px var(--c-ink); }
.tut-offer p { margin: 0; color: var(--c-white); }
.waiting { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 8px 0; text-align: center; }
.waiting p { margin: 0; color: var(--c-white); }
.waiting-coins { display: inline-flex; gap: 8px; line-height: 0; }
.waiting-coins canvas { animation: bob 800ms steps(1, end) infinite; }
.waiting-coins canvas:nth-child(2) { animation-delay: 200ms; }
.waiting-coins canvas:nth-child(3) { animation-delay: 400ms; }
.waiting-coins canvas:nth-child(4) { animation-delay: 600ms; }

/* ----------------------------------------------------------------- toasts -- */
#toast-root {
  position: fixed;
  z-index: 300;
  left: 50%;
  bottom: calc(var(--sa-bottom) + 24px);
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}
:root[data-layout="phone"] #toast-root,
:root[data-layout="phone-land"] #toast-root { bottom: auto; top: calc(var(--sa-top) + 56px); }

/* -------------------------------------------------------- reduced motion -- */
:root[data-motion="reduced"] .screen.active,
:root[data-motion="reduced"] .title-word,
:root[data-motion="reduced"] .title-start,
:root[data-motion="reduced"] .boot-coin canvas,
:root[data-motion="reduced"] .opp-card .opp-portrait,
:root[data-motion="reduced"] .opp-card.sel .opp-corners,
:root[data-motion="reduced"] .waiting-coins canvas { animation: none !important; }
:root[data-motion="reduced"] .opp-card.sel { transform: none; }
