/* SPACE MINER - the one stylesheet. Custom properties, no preprocessor.
 *
 * Everything user-facing is sized in REM against a root font-size scaled by
 * --text-scale, so the text-size setting reaches every surface - modals and
 * toasts included - with no per-component work (spec 13.3).
 *
 * The game's look is authored at M8; until then this is the grey-box shell.
 * One warm colour, amber, is reserved entirely for money (spec 12) - the
 * chrome never uses it.
 */

:root {
  --text-scale: 1;
  --bg: #03070f;
  --bg-2: #061426;
  --panel: #0b1a28;
  --panel-edge: #16384f;
  --text: #cfe2ee;
  --text-dim: #7d95a6;
  --conduit: #3fe0ff;
  --money: #ffc247; /* money ONLY */
  --alarm: #ff3d4e;
  /* Acting is BLUE - the house control identity (pillar 10). */
  --act-1: #0c7ffb;
  --act-2: #1d6fd0;

  /* THE CABIN LANGUAGE (owner, 2026-09-28: "update all the buttons and
   * panels to match the one in the avatar picker"): the picker's landed
   * craft set the house style, so its materials live here at the root
   * and every screen cuts its controls and plates from them. */
  --cab-lamp: #f2cf9f;
  --cab-lamp-deep: #b9853f;
  --cab-lip: rgba(214, 218, 222, 0.62);      /* the frame's bright edge */
  --cab-lip-dark: rgba(0, 0, 0, 0.72);       /* the seam beneath it */
  --cab-metal-hi: #7d8288;
  --cab-metal-lo: #40444a;
  --cab-glass: #0e1218;
  --cab-glass-2: #1a2430;
  --cab-text: #ece6dc;
  --cab-dim: #a9a49b;
  --cab-status: #7fd0e6;
  /* the window's shape, generated (tools: scratch avatar_fillet.py): a
   * chamfered rectangle, top cut 0.62rem, bottom cut 0.42rem, and every
   * join between a cut and a straight edge FILLETED (r 0.26rem) rather
   * than sharp (owner, 2026-09-28) - the arcs are short point runs */
  --cab-window: polygon(0 0.728rem, 0.005rem 0.677rem, 0.020rem 0.628rem, 0.044rem 0.583rem, 0.076rem 0.544rem, 0.544rem 0.076rem, 0.583rem 0.044rem, 0.628rem 0.020rem, 0.677rem 0.005rem, 0.728rem 0, calc(100% - 0.728rem) 0, calc(100% - 0.677rem) 0.005rem, calc(100% - 0.628rem) 0.020rem, calc(100% - 0.583rem) 0.044rem, calc(100% - 0.544rem) 0.076rem, calc(100% - 0.076rem) 0.544rem, calc(100% - 0.044rem) 0.583rem, calc(100% - 0.020rem) 0.628rem, calc(100% - 0.005rem) 0.677rem, 100% 0.728rem, 100% calc(100% - 0.528rem), calc(100% - 0.005rem) calc(100% - 0.477rem), calc(100% - 0.020rem) calc(100% - 0.428rem), calc(100% - 0.044rem) calc(100% - 0.383rem), calc(100% - 0.076rem) calc(100% - 0.344rem), calc(100% - 0.344rem) calc(100% - 0.076rem), calc(100% - 0.383rem) calc(100% - 0.044rem), calc(100% - 0.428rem) calc(100% - 0.020rem), calc(100% - 0.477rem) calc(100% - 0.005rem), calc(100% - 0.528rem) 100%, 0.528rem 100%, 0.477rem calc(100% - 0.005rem), 0.428rem calc(100% - 0.020rem), 0.383rem calc(100% - 0.044rem), 0.344rem calc(100% - 0.076rem), 0.076rem calc(100% - 0.344rem), 0.044rem calc(100% - 0.383rem), 0.020rem calc(100% - 0.428rem), 0.005rem calc(100% - 0.477rem), 0 calc(100% - 0.528rem));
  /* the same shape for the larger Start mining / Launch (cuts 0.95 / 0.62, r 0.38) */
  --cab-window-large: polygon(0 1.107rem, 0.007rem 1.033rem, 0.029rem 0.962rem, 0.064rem 0.896rem, 0.111rem 0.839rem, 0.839rem 0.111rem, 0.896rem 0.064rem, 0.962rem 0.029rem, 1.033rem 0.007rem, 1.107rem 0, calc(100% - 1.107rem) 0, calc(100% - 1.033rem) 0.007rem, calc(100% - 0.962rem) 0.029rem, calc(100% - 0.896rem) 0.064rem, calc(100% - 0.839rem) 0.111rem, calc(100% - 0.111rem) 0.839rem, calc(100% - 0.064rem) 0.896rem, calc(100% - 0.029rem) 0.962rem, calc(100% - 0.007rem) 1.033rem, 100% 1.107rem, 100% calc(100% - 0.777rem), calc(100% - 0.007rem) calc(100% - 0.703rem), calc(100% - 0.029rem) calc(100% - 0.632rem), calc(100% - 0.064rem) calc(100% - 0.566rem), calc(100% - 0.111rem) calc(100% - 0.509rem), calc(100% - 0.509rem) calc(100% - 0.111rem), calc(100% - 0.566rem) calc(100% - 0.064rem), calc(100% - 0.632rem) calc(100% - 0.029rem), calc(100% - 0.703rem) calc(100% - 0.007rem), calc(100% - 0.777rem) 100%, 0.777rem 100%, 0.703rem calc(100% - 0.007rem), 0.632rem calc(100% - 0.029rem), 0.566rem calc(100% - 0.064rem), 0.509rem calc(100% - 0.111rem), 0.111rem calc(100% - 0.509rem), 0.064rem calc(100% - 0.566rem), 0.029rem calc(100% - 0.632rem), 0.007rem calc(100% - 0.703rem), 0 calc(100% - 0.777rem));
  /* the plate's shape: the window's top cuts alone, a straight foot */
  --cab-plate: polygon(1rem 0, calc(100% - 1rem) 0, 100% 1rem, 100% 100%, 0 100%, 0 1rem);
  /* the materials, named once */
  --cab-lip-grad: linear-gradient(180deg, var(--cab-lip), rgba(120, 125, 131, 0.55) 55%, rgba(60, 64, 70, 0.7));
  --cab-lip-lit: linear-gradient(180deg, rgba(242, 207, 159, 0.85), rgba(185, 133, 63, 0.6) 55%, rgba(120, 84, 36, 0.7));
  --cab-glass-grad:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 38%),
    linear-gradient(180deg, var(--cab-glass-2), var(--cab-glass) 75%);
  --cab-glass-warm:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(242, 207, 159, 0.28), rgba(242, 207, 159, 0) 70%),
    linear-gradient(180deg, var(--cab-glass-2), var(--cab-glass) 75%);
}

/* ---------------- the cabin language (house-wide) ----------------
 * THE WINDOW AS A CONTROL: two layers. The element is the metal lip (a
 * thin gradient the frame's colour), cut to the chamfered shape; its
 * pseudo-element, inset by the lip, is the glass - dark, with a faint
 * reflection across its top. Nothing thicker than a hairline. The lit
 * state (a chosen pill, the primary action) glows behind its glass.
 * THE PLATE: a frosted, almost transparent panel with no outline - the
 * scene shows through a blur and a whisper of slate; the window's top
 * cuts, no rim. */
.btn-act, .btn-quiet, .btn-launch, .cashout-btn, .toast-action,
.cab-window, .avatar-window, .avatar-arrow, .avatar-pill {
  position: relative;
  isolation: isolate;
  border: 0;
  border-radius: 0;
  clip-path: var(--cab-window);
  background: var(--cab-lip-grad);
  color: var(--cab-text);
  box-shadow: none;
  text-shadow: none;
}
.btn-act::after, .btn-quiet::after, .btn-launch::after, .cashout-btn::after, .toast-action::after,
.cab-window::before, .avatar-window::before, .avatar-arrow::after, .avatar-pill::after {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  clip-path: var(--cab-window);
  background: var(--cab-glass-grad);
  box-shadow: inset 0 0 0 1px var(--cab-lip-dark);
  transition: background 0.18s, box-shadow 0.18s;
}
/* the quiet ones: dark glass that warms under the hand */
.btn-quiet, .cashout-btn, .toast-action {
  font-weight: 400;
  letter-spacing: 0.06em;
}
.btn-quiet:hover::after, .btn-quiet:focus-visible::after,
.cashout-btn:hover::after, .cashout-btn:focus-visible::after,
.toast-action:hover::after, .toast-action:focus-visible::after {
  background: var(--cab-glass-warm);
}
.btn-quiet:active::after, .cashout-btn:active::after, .toast-action:active::after { background: var(--cab-glass); }
/* the primary action: a window lit like the lamps, dark lettering on it */
.btn-act {
  color: #2a1d0e;
  text-shadow: none; /* dark ink on the plate: no glow */
  font-weight: 500;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, rgba(255, 236, 205, 0.95), rgba(200, 150, 80, 0.8) 55%, rgba(120, 84, 36, 0.85));
}
.btn-act::after {
  background: linear-gradient(180deg, #ffe9c8, #f0c483 55%, var(--cab-lamp-deep));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 0 10px rgba(255, 240, 210, 0.35);
}
.btn-act:hover::after { filter: brightness(1.06); }
.btn-act:active { transform: translateY(1px); }
.btn-act:disabled, .btn-quiet:disabled { opacity: 0.55; cursor: default; }
.btn-act:focus-visible, .btn-quiet:focus-visible, .btn-launch:focus-visible,
.cashout-btn:focus-visible, .toast-action:focus-visible { outline: none; }
.btn-act:focus-visible::after, .btn-quiet:focus-visible::after, .btn-launch:focus-visible::after,
.cashout-btn:focus-visible::after, .toast-action:focus-visible::after {
  box-shadow: inset 0 0 0 1px var(--cab-status);
}
/* a window round a field: the wrapper is the lip, the control sits on
 * the glass; the lip warms while the field has focus */
.cab-window, .avatar-window { display: block; padding: 1px; }
/* the name box, once the name is set: dimmed, no caret */
.avatar-window.locked input { color: var(--cab-dim); cursor: default; }
.cab-window input[type="text"], .avatar-window input[type="text"],
.cab-window select, .avatar-window select {
  width: 100%;
  box-sizing: border-box;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--cab-text);
  clip-path: var(--cab-window);
}
.cab-window select, .avatar-window select { color-scheme: dark; }
/* THE OPEN LIST (owner, 2026-10-12: "cant see any of the text inside the
 * drop down"): the select is transparent with pale text, and some browsers
 * paint the opened list white whatever color-scheme says - the options
 * inherited the pale text onto white. Every option carries its own dark
 * ground and light text, and the chosen one a lit band. */
select option, select optgroup { background-color: #10151f; color: #ece6dc; }
select option:checked { background-color: #2a3a52; color: #ffffff; }
select option:disabled { color: #8a8f99; }
.cab-window:focus-within, .avatar-window:focus-within { background: var(--cab-lip-lit); }

.avatar-form, .galaxy-card, .galaxy-filter, .galaxy-mission, .brief-panel, .inter-card, .modal, .settings-card, .store-card, .toast {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  clip-path: var(--cab-plate);
  background: linear-gradient(180deg, rgba(120, 126, 134, 0.14), rgba(60, 64, 70, 0.16));
  backdrop-filter: blur(14px) saturate(1.05);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
  color: var(--cab-text);
  text-shadow: 0 1px 2px #000, 0 0 10px rgba(0, 0, 0, 0.6);
}
/* the plates' headings speak in the cabin's voice */
.inter-card h2, .modal h2, .settings-card h2 {
  font-family: Roboto, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cab-text);
}

html {
  font-size: calc(16px * var(--text-scale));
}

* { box-sizing: border-box; }

/* SCROLLBARS, EVERYWHERE (owner, 2026-10-05, seeing the browser's grey
 * bar beside the settings card: "replace that scroll bar with a more
 * elegant one - everywhere where it exists"): a thin translucent thumb
 * on no track, brightening under the pointer, in the cab's warm grey.
 * Both syntaxes - the standard one (Firefox, newer Chromium) and the
 * WebKit one (Chromium, Safari, Edge on Xbox). */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(169, 164, 155, 0.42) transparent;
}
*::-webkit-scrollbar { width: 7px; height: 7px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-corner { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(169, 164, 155, 0.42);
  border-radius: 999px;
  border: 1px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(214, 206, 192, 0.7); background-clip: padding-box; }
*::-webkit-scrollbar-button { width: 0; height: 0; display: none; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* ---------------- screens ---------------- */

.screen {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.screen.active { display: flex; }

/* ---------------- title ---------------- */

.title-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  padding: 1.5rem;
  /* wide enough to hold the wordmark (min(92vw, 48rem) + the padding):
   * the card is invisible, so its width only decides what fits inside */
  max-width: 52rem;
  /* never taller than the screen: a centred card that outgrows it
   * overflows at BOTH ends with no way to scroll (owner, 2026-09-25,
   * 37 review buttons: "I can not reach the latest ones") */
  max-height: 100%;
  min-height: 0;
  box-sizing: border-box;
  overflow-y: auto;
  /* overflow-y alone made overflow-x scroll too, and the wordmark was
   * wider than the card: a horizontal scrollbar under the title
   * (owner, 2026-09-26: "no need for it") */
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Roboto, shipped (owner, 2026-09-26: "yes, download roboto") - Google's
 * roboto-2 TTFs (Apache 2.0), SUBSET to the game's scripts (Latin,
 * Cyrillic, punctuation; tools/make_font_subset.py) and packed as WOFF2:
 * ~60 KB a weight against ~500 KB (owner, 2026-09-28: "do the font
 * subset"). */
@font-face {
  font-family: Roboto;
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('fonts/Roboto-Regular.woff2?v=390') format('woff2');
}
@font-face {
  font-family: Roboto;
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url('fonts/Roboto-Medium.woff2?v=390') format('woff2');
}

.presents {
  /* the ITZA pyramid, ITZA STUDIOS under it, PRESENT under that more
   * subtly (owner, 2026-09-26: "move the pyramid above itza studios";
   * Roboto, normal spacing - shipped in fonts/, the stack is the
   * fallback while it loads). */
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 0 -0.4rem 0;
  font-family: Roboto, "Segoe UI", system-ui, -apple-system, sans-serif;
  letter-spacing: normal;
  text-transform: uppercase;
  line-height: 1.15;
}
.brand-logo {
  display: block;
  height: 3.4rem;
  width: auto;
  margin-bottom: 0.35rem;
  filter: drop-shadow(0 0 14px rgba(255, 196, 40, 0.35));
}
.presents .studios {
  position: relative;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  text-shadow: 0 0 6px #03070f, 0 0 14px #03070f, 0 1px 3px #000;
}
.presents .present {
  position: relative;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--text);
  opacity: 0.75;
  text-shadow: 0 0 6px #03070f, 0 0 12px #03070f, 0 1px 2px #000;
}

.title-card h1 {
  margin: 0;
  font-size: 3rem;
  letter-spacing: 0.35em;
  padding-left: 0.35em; /* optically recentre the tracked-out wordmark */
  color: var(--text);
  text-shadow: 0 0 24px rgba(63, 224, 255, 0.35);
}

.title-card .wordmark {
  padding: 0;
  letter-spacing: 0;
  text-shadow: none;
  line-height: 0;
}

.wordmark img {
  /* bigger (owner, 2026-09-26: "Space Miner needs to be bigger") */
  width: min(92vw, 48rem);
  height: auto;
  filter: drop-shadow(0 0 24px rgba(63, 224, 255, 0.3));
}

[data-screen="title"],
[data-screen="splash"] {
  background: #03070f url('img/title-bg-wide.png?v=390') center / cover no-repeat;
}

@media (orientation: portrait) {
  [data-screen="title"],
  [data-screen="splash"] {
    background-image: url('img/title-bg-portrait.png?v=390');
  }
}

/* the splash: the whole screen is the button */
[data-screen="splash"] { cursor: pointer; }
.splash-card { gap: 1.6rem; }
.splash-tap {
  margin: 2rem 0 0;
  letter-spacing: 0.3em;
  padding-left: 0.3em;
  text-transform: uppercase;
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  /* it sits over the lit chasm: a dark halo keeps it readable */
  text-shadow: 0 0 6px #03070f, 0 0 14px #03070f, 0 1px 2px #03070f;
  animation: splash-pulse 2.2s ease-in-out infinite;
}
@keyframes splash-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.tagline {
  margin: 0;
  color: var(--text);
  opacity: 0.85;
  /* it sits over the machine on the cliff: a dark halo keeps it legible */
  text-shadow: 0 0 6px #03070f, 0 0 14px #03070f, 0 1px 2px #000;
}

/* LAUNCH (owner, 2026-09-26): the one action on the title, reading as
 * the start of a journey rather than a form button. Since the cabin
 * (2026-09-28) it is the picker's Start mining exactly: the larger
 * window, its glass lit like the lamps, breathing. */
.btn-launch {
  margin-top: 0.6rem;
  padding: 0.95rem 3.4rem;
  clip-path: var(--cab-window-large);
  font-family: Roboto, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  padding-left: calc(3.4rem + 0.22em); /* optically recentre the tracking */
  text-transform: uppercase;
  color: #2a1d0e;
  text-shadow: none;
  background: linear-gradient(180deg, rgba(255, 236, 205, 0.95), rgba(200, 150, 80, 0.8) 55%, rgba(120, 84, 36, 0.85));
  animation: none;
}
.btn-launch::after {
  clip-path: var(--cab-window-large);
  background: linear-gradient(180deg, #ffe9c8, #f0c483 55%, var(--cab-lamp-deep));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 0 14px rgba(255, 240, 210, 0.45);
  animation: cabin-breathe 2.8s ease-in-out infinite;
}
.btn-launch:active { transform: translateY(1px); filter: brightness(1.1); }
.btn-launch:disabled { opacity: 0.55; }
@keyframes cabin-breathe {
  0%, 100% { filter: brightness(0.97); }
  50% { filter: brightness(1.1); }
}
@media (prefers-reduced-motion: reduce) {
  .btn-launch::after { animation: none; }
}

/* THE iGame LABEL keeps the token's own capitals (owner, 2026-10-14):
 * the stat labels are set in capitals, this one is not */
.avatar-stat[data-avatar-stat="igame"] .avatar-stat-label { text-transform: none; }
/* settings: a group's name over its rows (owner, 2026-10-15: my account) */
.setting-group { margin: 0.9rem 0 0.1rem; font-size: 0.95rem; letter-spacing: 0.04em; color: var(--cab-lamp); }

/* settings: a burger, top right of the title (owner, 2026-09-26) and of the
 * miner screen (owner, 2026-10-15) */
.burger {
  position: absolute;
  z-index: 20; /* over the miner screen's panel, which the burger shares a corner with */
  top: calc(1rem + env(safe-area-inset-top));
  right: calc(1rem + env(safe-area-inset-right));
  width: 2.9rem;
  height: 2.9rem;
  min-height: 0;
  padding: 0;
  border-radius: 0.7rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.36rem;
  background: none; /* bare bars (owner: no outline, no background) */
  border: 0;
}
.burger span {
  display: block;
  width: 1.5rem;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  box-shadow: 0 0 6px #03070f, 0 1px 2px #000; /* legible over the sky */
}

/* ---------------- buttons ---------------- */

button {
  font: inherit;
  border: 0;
  border-radius: 0.6rem;
  padding: 0.7rem 2.2rem;
  cursor: pointer;
  color: #fff;
  min-height: 2.75rem; /* touch floor */
}

/* .btn-act (the lit window) and .btn-quiet (dark glass) are cut in the
 * cabin language block at the top of the file; the blue --act-* pair
 * stays for the moment a control needs the old identity. */

/* ---------------- game ---------------- */

[data-screen="game"] { padding: 0; }

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none; /* drag-to-draw owns every gesture on the canvas */
}

/* NO WEBGL: a full-screen notice over the mine, large enough for a TV,
 * with the cure for the console browser (owner, 2026-10-05) */
.fallback {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.9rem;
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text);
  background: rgba(4, 6, 12, 0.94);
}
.fallback[hidden] { display: none; }
.fallback h2 { margin: 0; font-size: 1.7rem; }
.fallback p { margin: 0; max-width: 36rem; font-size: 1.1rem; line-height: 1.45; }
.fallback .fallback-hint { color: var(--cab-dim); }
.fallback .btn-quiet { margin-top: 0.6rem; }

/* DIAGNOSTICS (settings): sections of key / value rows, flowing into
 * columns on a wide screen so a TV shows the whole reading at once */
.settings-card.wide { width: min(92rem, 96vw); }
.diag-panel { margin-top: 0.2rem; }
.diag-panel[hidden] { display: none; }
.diag-rows {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  column-gap: 1.4rem;
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: left;
}
.diag-section {
  grid-column: 1 / -1;
  margin: 0.7rem 0 0.15rem;
  color: var(--cab-dim);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}
.diag-row {
  display: grid;
  grid-template-columns: minmax(8rem, 42%) 1fr;
  gap: 0.6rem;
  padding: 0.12rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.diag-k { color: var(--cab-dim); }
.diag-v { word-break: break-word; }

/* ---------------- HUD ----------------
 * A frosted plate along the top, in two groups (docs/COMBAT-OXYGEN-SPEC.md
 * 6): THE TALLY - the three buckets kept visibly distinct (spec 10) - and
 * THE SUIT - pipe, oxygen, ammo, the hopper and the finds. On a wide
 * screen the groups share one row; on a phone they stack, in landscape
 * between the screen's edge and the cash-out window, in portrait under
 * it. Every size is rem, so the text-size setting reaches it. */
/* THE HUD: a row of PANELS, each gauge its own cab window (owner,
 * 2026-10-01). Docked at the surface they stand side by side; floating
 * down the mine they are gone, and each flashes in on its own (data-show)
 * when something matters (ui/hudFlash.js). The row keeps the height it
 * had docked (min-height, set by hud.js) so the camera's top inset never
 * jumps as panels come and go. */
.hud {
  position: absolute;
  top: calc(0.6rem + env(safe-area-inset-top));
  left: 0;
  right: 0;
  margin: 0 auto;
  width: fit-content;
  /* the cash-out window owns the right corner; the same room is left on
   * the other side so the row stays in the middle */
  max-width: calc(100% - 16rem);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 0.35rem 0.5rem;
  padding: 0;
  pointer-events: none;
}
.hud-group {
  display: contents;
}
/* the panels stand alone, docked or floating - no plate, no frost
 * (owner, 2026-10-01: "there's no need for that frosted background") */
.hud-cell[hidden] { display: none; }
.hud-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-width: 3.4rem;
  /* every panel the same height - the bars' and the numbers' alike
   * (owner, 2026-10-01: "should be same height") */
  min-height: 3.25rem;
  padding: 0.32rem 0.75rem 0.3rem;
  box-sizing: border-box;
}
/* floating: a panel is gone unless it is flashing in */
.hud[data-mode="float"] .hud-panel[data-show="0"] { display: none; }
.hud[data-mode="float"] .hud-panel[data-show="1"] { animation: hud-pop 0.26s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
@keyframes hud-pop {
  0% { transform: scale(0.55); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
/* the urgent panels glow the way they feel */
.hud-panel#hud-oxygen-cell[data-band="low"]::before { box-shadow: inset 0 0 0 1px var(--cab-lip-dark), inset 0 0 12px rgba(255, 196, 80, 0.35); }
.hud-panel#hud-oxygen-cell[data-band="critical"]::before,
.hud-panel#hud-ammo-cell[data-empty="1"]::before,
.hud-panel#hud-time-cell[data-rating="slow"]::before { box-shadow: inset 0 0 0 1px var(--cab-lip-dark), inset 0 0 14px rgba(255, 61, 78, 0.45); }
@media (prefers-reduced-motion: reduce) {
  .hud[data-mode="float"] .hud-panel[data-show="1"] { animation: none; }
}
.hud-label {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap; /* "In cable" is one line, whatever the tracking */
  color: var(--cab-dim);
}
.hud-val {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--cab-text);
}
.hud-cell-wide { min-width: 5.5rem; }
.hud-track {
  display: block;
  width: 5rem;
  height: 0.55rem;
  margin: auto 0 0.45rem;
  /* a sliver of the window's glass: hairline seam, no rim */
  background: var(--cab-glass);
  box-shadow: inset 0 0 0 1px var(--cab-lip-dark);
  overflow: hidden;
}

.pipe-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: #46c46a;
  transition: width 0.15s linear;
}
.pipe-fill[data-band="worn"] { background: #d8c14a; }
.pipe-fill[data-band="critical"] { background: var(--alarm); }

/* OXYGEN: the air's own pale blue while there is plenty; LOW turns the
 * bar and its label yellow; CRITICAL turns them red and the whole cell
 * beats. Urgent at a glance, in the corner of the eye. */
.oxygen-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--cab-status);
  transition: width 0.15s linear;
}
.oxygen-fill[data-band="low"] { background: #d8c14a; }
.oxygen-fill[data-band="critical"] { background: var(--alarm); }
#hud-oxygen-cell[data-band="low"] .hud-label { color: #d8c14a; }
#hud-oxygen-cell[data-band="critical"] .hud-label { color: var(--alarm); font-weight: 700; }
#hud-oxygen-cell[data-band="critical"] .hud-track { box-shadow: inset 0 0 0 1px var(--alarm); }
#hud-oxygen-cell[data-band="low"] { animation: hud-urgent 1.6s ease-in-out infinite; }
#hud-oxygen-cell[data-band="critical"] { animation: hud-urgent 0.55s ease-in-out infinite; }
@keyframes hud-urgent {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* THE LEVEL CLOCK: under par green, within the buffer amber, past it red */
#hud-time-cell[data-rating="fast"] .hud-val, .inter-time[data-rating="fast"] strong { color: #7dff9a; }
#hud-time-cell[data-rating="ontime"] .hud-val, .inter-time[data-rating="ontime"] strong { color: #ffd27a; }
#hud-time-cell[data-rating="slow"] .hud-val, .inter-time[data-rating="slow"] strong { color: var(--alarm); }
.inter-time[hidden] { display: none; }
.inter-rating { margin: 0; text-align: center; color: var(--cab-dim); font-size: 0.9rem; }

/* AMMO: an empty gun reads red */
#hud-ammo-cell[data-empty="1"] .hud-val { color: var(--alarm); }

/* THE HOPPER'S SHARE: the number, white when the bin is full (the bin
 * itself stands on the surface beside the machine) */
#hud-hopper-pct[data-full="1"] { color: #ffffff; text-shadow: 0 0 6px rgba(255, 255, 255, 0.6); }

/* THE FINDS: an outline while unfound, solid once found */
.hud-finds {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: 1.26rem; /* the value line's height, so the cells align */
}
.find-glyph {
  display: block;
  width: 1.1rem;
  height: 1.1rem;
  overflow: visible;
  fill: none;
  stroke: var(--cab-dim);
  stroke-width: 1.5;
  stroke-linejoin: round;
  opacity: 0.8;
  transition: fill 0.3s, stroke 0.3s, opacity 0.3s;
}
.find-glyph[data-found="1"] {
  fill: var(--cab-text);
  stroke: var(--cab-text);
  opacity: 1;
}

.hud-pot { color: var(--money); }        /* the pot is the thing they care about */
.hud-transit { color: var(--conduit); }  /* in-transit rides the cable's colour  */

/* A PHONE IN LANDSCAPE (short): everything a size down, so two rows of
 * HUD cost the mine as little of its height as they can */
@media (max-height: 30rem) {
  .hud { top: calc(0.35rem + env(safe-area-inset-top)); gap: 0.15rem 1rem; padding: 0.3rem 0.9rem 0.3rem; }
  .hud-group { gap: 0.15rem 0.8rem; }
  .hud-cell { min-width: 2.6rem; }
  .hud-cell-wide { min-width: 4rem; }
  .hud-label { font-size: 0.55rem; }
  .hud-val { font-size: 0.92rem; }
  .hud-track { width: 3.8rem; height: 0.5rem; margin-top: 0.3rem; }
  .find-glyph { width: 1rem; height: 1rem; }
  .hud-finds { min-height: 1.1rem; }
}
/* A PHONE IN PORTRAIT (narrow): the plate takes the screen's width and
 * sits UNDER the cash-out window, never beside it */
@media (max-width: 36rem), (orientation: portrait) {
  .hud {
    top: calc(3.3rem + env(safe-area-inset-top));
    max-width: calc(100% - 1rem);
    gap: 0.25rem 0.9rem;
    padding: 0.4rem 0.7rem 0.35rem;
  }
  .hud-group { gap: 0.25rem 0.7rem; }
  .hud-cell { min-width: 2.6rem; }
  .hud-cell-wide { min-width: 3.8rem; }
  .hud-label { font-size: 0.56rem; }
  .hud-val { font-size: 0.95rem; }
  .hud-track { width: 3.6rem; }
}

/* ---------------- the strip: fire and the power slots ----------------
 * TOUCH ONLY (docs/COMBAT-OXYGEN-SPEC.md 5). The left CFG.CONTROL_STRIP
 * of the screen (js/ui/controls.js sets the width from the config). The
 * strip itself is air - taps fall through to the canvas, which ignores
 * them there; only the buttons take a finger. SEMI-TRANSPARENT: the mine
 * shows through them (owner, 2026-09-29). */
.controls[hidden] { display: none; }
/* THE CONTROLS live in the LOWER HALF of the screen (CFG.CONTROL_AREA;
 * owner, 2026-10-01) - the strip is the left fifth of that half */
.controls {
  position: absolute;
  left: 0;
  top: 50%;
  bottom: 0;
  width: 20%;
  display: block;
  pointer-events: none;
  z-index: 2;
}
/* the UPPER HALF: the power slots, stacked from the middle upward */
.power-slots[hidden] { display: none; }
.power-slots {
  position: absolute;
  left: env(safe-area-inset-left);
  right: 0;
  top: env(safe-area-inset-top);
  height: 50%;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem;
}
.power-btn {
  pointer-events: auto;
  position: relative;
  isolation: isolate;
  width: min(100%, 4.2rem);
  height: 3.4rem;
  min-height: 0;
  padding: 0;
  clip-path: var(--cab-window);
  background: var(--cab-lip-grad);
  color: var(--cab-text);
  opacity: 0.55;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.power-btn::after {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  clip-path: var(--cab-window);
  background: var(--cab-glass-grad);
  box-shadow: inset 0 0 0 1px var(--cab-lip-dark);
}
.power-btn[data-active="1"] { opacity: 0.8; }
.power-count { font-size: 0.9rem; font-variant-numeric: tabular-nums; }
/* the LOWER HALF: the fire button fills it, up to a thumb's reach */
.fire-zone {
  position: absolute;
  left: env(safe-area-inset-left);
  right: 0;
  bottom: env(safe-area-inset-bottom);
  height: 50%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0.5rem;
}
.fire-btn[hidden] { display: none; }
.fire-btn {
  pointer-events: auto;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  width: 100%;
  max-width: 11rem;
  height: 100%;
  max-height: 11rem;
  min-height: 0;
  padding: 0;
  /* a cabin window, the large cut */
  border-radius: 0;
  clip-path: var(--cab-window-large);
  background: var(--cab-lip-grad);
  color: var(--cab-text);
  opacity: 0.55;
  transition: opacity 0.15s;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.fire-btn::after {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  clip-path: var(--cab-window-large);
  background: var(--cab-glass-grad);
  box-shadow: inset 0 0 0 1px var(--cab-lip-dark);
  transition: background 0.15s;
}
/* ACTIVE: the window is lit, like the primary action's */
.fire-btn[data-active="1"] {
  opacity: 0.8;
  color: #2a1d0e;
  background: linear-gradient(180deg, rgba(255, 236, 205, 0.95), rgba(200, 150, 80, 0.8) 55%, rgba(120, 84, 36, 0.85));
}
.fire-btn[data-active="1"]::after {
  background: linear-gradient(180deg, #ffe9c8, #f0c483 55%, var(--cab-lamp-deep));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 0 10px rgba(255, 240, 210, 0.35);
}
.fire-btn:focus-visible { outline: none; }
.fire-btn:focus-visible::after { box-shadow: inset 0 0 0 1px var(--cab-status); }
.fire-glyph {
  display: block;
  width: 2.3rem;
  height: 2.3rem;
  pointer-events: none;
}
.fire-ammo {
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  pointer-events: none;
}
/* an empty gun: the count reads red, lit or not */
.fire-btn[data-empty="1"] .fire-ammo { color: var(--alarm); font-weight: 700; }
@media (max-width: 36rem), (orientation: portrait) {
  /* a narrow strip: a tall, slim window */
  .fire-zone { padding: 0.35rem; }
  .fire-btn { clip-path: var(--cab-window); max-height: 9rem; }
  .fire-btn::after { clip-path: var(--cab-window); }
  .fire-glyph { width: 1.8rem; height: 1.8rem; }
  .fire-ammo { font-size: 1rem; }
}

/* ---------------- the lesson ----------------
 * Planets 1 to 3, while the crew walks on: the two areas of the touch
 * screen, breathing gently, one line each. Gone at the first input - the
 * screen is clean in play. Taps pass straight through it. */
.lesson[hidden] { display: none; }
.lesson {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;   /* the control area: the lower half (CFG.CONTROL_AREA) */
  bottom: 0;
  display: flex;
  pointer-events: none;
  z-index: 2;
}
.lesson-area {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem;
  text-align: center;
  animation: lesson-breathe 2.2s ease-in-out infinite;
}
.lesson-strip {
  flex: 0 0 auto;
  width: 20%;
  background: rgba(242, 207, 159, 0.14);
  box-shadow: inset 0 0 0 2px rgba(242, 207, 159, 0.6);
}
.lesson-field {
  flex: 1 1 auto;
  background: rgba(127, 208, 230, 0.1);
  box-shadow: inset 0 0 0 2px rgba(127, 208, 230, 0.55);
  /* half a beat behind the strip, so the eye reads them as two */
  animation-delay: 1.1s;
}
.lesson-line {
  margin: 0;
  font-family: Roboto, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 1.15rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cab-text);
  text-shadow: 0 1px 2px #000, 0 0 12px rgba(0, 0, 0, 0.8);
}
.lesson-strip .lesson-line { font-size: 0.8rem; letter-spacing: 0.08em; }
@keyframes lesson-breathe {
  0%, 100% { opacity: 0.95; }
  50% { opacity: 0.4; }
}
/* the keyboard's and the joystick's line: one plate, low in the middle */
.lesson-hint[hidden] { display: none; }
.lesson-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(2rem + env(safe-area-inset-bottom));
  margin: 0 auto;
  width: fit-content;
  max-width: calc(100% - 2rem);
  display: block;
  padding: 0.55rem 1.1rem;
  text-align: center;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  color: var(--cab-text);
  text-shadow: 0 1px 2px #000, 0 0 10px rgba(0, 0, 0, 0.6);
  clip-path: polygon(0.6rem 0, calc(100% - 0.6rem) 0, 100% 0.6rem, 100% 100%, 0 100%, 0 0.6rem);
  background: linear-gradient(180deg, rgba(60, 64, 70, 0.34), rgba(20, 24, 30, 0.42));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
  z-index: 2;
  animation: lesson-breathe 2.2s ease-in-out infinite;
}
/* THE COACH (js/ui/coach.js): one line at the top of the mine, under the
 * HUD, body-sized on the lesson's plate; gone in five seconds */
.coach-line[hidden] { display: none; }
.coach-line {
  position: absolute;
  left: 1rem;
  right: 1rem;
  top: calc(7.5rem + env(safe-area-inset-top));
  margin: 0 auto;
  width: fit-content;
  max-width: calc(100% - 2rem);
  padding: 0.55rem 1.2rem;
  text-align: center;
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--cab-text);
  text-shadow: 0 1px 2px #000, 0 0 10px rgba(0, 0, 0, 0.6);
  clip-path: polygon(0.6rem 0, calc(100% - 0.6rem) 0, 100% 0.6rem, 100% 100%, 0 100%, 0 0.6rem);
  background: linear-gradient(180deg, rgba(60, 64, 70, 0.4), rgba(20, 24, 30, 0.52));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
  z-index: 2;
  animation: coach-in 0.35s ease-out both;
}
@keyframes coach-in {
  from { opacity: 0; transform: translateY(-0.4rem); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .coach-line { animation: none; }
  .lesson-area, .lesson-hint { animation: none; }
  #hud-oxygen-cell[data-band="low"], #hud-oxygen-cell[data-band="critical"] { animation: none; }
}

/* ---------------- cash out and the interstitial ----------------
 * Cash out sits top-right, OUTSIDE the thumb arc, so it is never hit by
 * accident. The interstitial is a full overlay with the pot and the two
 * multipliers - numbers only, no persuasion. */
.cashout-btn {
  position: absolute;
  top: calc(0.6rem + env(safe-area-inset-top));
  right: calc(0.8rem + env(safe-area-inset-right));
  /* a small window, dark glass, the lamp's colour on the lettering */
  color: var(--cab-lamp);
  padding: 0.5rem 0.95rem;
  min-height: 2.3rem;
  font-size: 0.85rem;
}
.cashout-btn:hover { color: var(--cab-text); }
/* THE HIDDEN TRAP: an author display rule beats the UA [hidden] rule, so
 * without this override the overlay is ALWAYS displayed - invisible in
 * intent, but eating every tap on the game (shipped in v9, found by the
 * owner: "neither can be clicked"). Any element that pairs a display rule
 * with the hidden attribute needs this. */
.inter[hidden] { display: none; }
.inter {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  /* dimmed, not blacked: the frosted card needs the mine behind it */
  background: rgba(1, 3, 8, 0.55);
  z-index: 30;
}
.inter-card {
  padding: 1.6rem;
  width: min(20rem, 88vw);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  text-align: center;
}
.inter-card h2 { margin: 0; font-size: 1.35rem; }
.inter-planet {
  margin: -0.4rem 0 0 0;
  color: var(--cab-dim);
  letter-spacing: 0.08em;
}

.inter-rows, .cash-rows { display: flex; flex-direction: column; gap: 0.5rem; }
.inter-row, .cash-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-variant-numeric: tabular-nums;
}
.inter-row span, .cash-row span { color: var(--cab-dim); }
.cash-row[hidden] { display: none; } /* the left-down-there row, only when something is (v362) */
.inter-pot, .cash-bank { color: var(--money); }
.cash-forfeit { color: var(--alarm); }
.inter-actions { display: flex; gap: 0.7rem; justify-content: center; flex-wrap: wrap; }

/* ---------------- floaters and the blowout flash ----------------
 * DOM so they inherit the text-size scale and locale formatting. Amber
 * stays money-only; losses are alarm red. */
.floater {
  position: fixed;
  transform: translate(-50%, -50%);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  z-index: 50;
  transition: translate 1.2s ease-out, opacity 1.2s ease-out;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}
.floater-loss { color: var(--alarm); }
.floater-gain { color: var(--money); }
/* a score is not money: the HUD's own white */
.floater-score { color: var(--cab-text); }
.floater.rise { translate: 0 -3.2rem; opacity: 0; }

/* THE WEALTH COUNTER (ui/wealth.js): a gold coin, "+gained" and the
 * level's wealth, popping in small to big under the HUD */
.wealth {
  position: fixed;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.8rem 0.3rem 0.4rem;
  pointer-events: none;
  z-index: 52;
  clip-path: var(--cab-window);
  background: linear-gradient(180deg, rgba(255, 236, 205, 0.92), rgba(200, 150, 80, 0.85) 55%, rgba(120, 84, 36, 0.9));
  color: #2a1d0e;
  font-weight: 700;
  text-shadow: none; /* dark ink on the plate: no glow */
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.35s ease-out, transform 0.35s ease-out;
}
.wealth[hidden] { display: none; }
.wealth-gone { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
.wealth-pop { animation: wealth-pop 0.42s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
@keyframes wealth-pop {
  0% { transform: translate(-50%, -50%) scale(0.4); }
  60% { transform: translate(-50%, -50%) scale(1.18); }
  100% { transform: translate(-50%, -50%) scale(1); }
}
.wealth-coin, .wealth-flyer {
  display: inline-block;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3c4 0%, #ffd25a 35%, #c98a1e 70%, #7a4e0e 100%);
  box-shadow: inset 0 0 0 2px rgba(120, 78, 14, 0.55), 0 0 10px rgba(255, 210, 90, 0.7);
}
.wealth-plus { font-size: 1.25rem; }
.wealth-total { font-size: 0.85rem; opacity: 0.85; }
.wealth-flyer {
  position: fixed;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 53;
  transition: left 0.38s cubic-bezier(0.3, 0, 0.6, 1), top 0.38s cubic-bezier(0.3, 0, 0.6, 1), transform 0.38s ease-in;
}
.wealth-flyer-go { transform: translate(-50%, -50%) scale(0.6); }
@media (prefers-reduced-motion: reduce) {
  .wealth-pop { animation: none; }
  .wealth-flyer { transition: none; }
}

.blowout-flash {
  position: fixed;
  inset: 0;
  background: #fff;
  opacity: 0.4;
  pointer-events: none;
  z-index: 55;
  transition: opacity 0.6s ease-out;
}
.blowout-flash.gone { opacity: 0; }

/* ---------------- settings ---------------- */

/* the settings plate floats on the title's sky - it opens from the
 * title's burger, so the frost has that scene to show through */
#screen-settings {
  background: #03070f url('img/title-bg-wide.png?v=390') center / cover no-repeat;
}
@media (orientation: portrait) {
  #screen-settings { background-image: url('img/title-bg-portrait.png?v=390'); }
}
.settings-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: min(22rem, 90vw);
  max-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.3rem 1.3rem 1.2rem;
}

.settings-card h2 { margin: 0 0 0.2rem; font-size: 1.25rem; text-align: center; }
.settings-card .btn-quiet { width: 100%; }
#btn-install[hidden] { display: none; }
.settings-card .btn-quiet + .btn-quiet { margin-top: -0.4rem; }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.setting-row > span {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cab-dim);
}
/* the field's window takes the select's old share of the row */
.setting-row .cab-window { flex: 0 1 55%; max-width: 55%; }

select {
  font: inherit;
  padding: 0.45rem 0.6rem;
  min-height: 2.3rem;
  cursor: pointer;
}

/* ---------------- modals and toasts ---------------- */

.scrim {
  position: fixed;
  inset: 0;
  /* dimmed, not blacked: the frosted card needs the scene behind it */
  background: rgba(1, 3, 8, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.modal {
  padding: 1.5rem;
  width: min(22rem, 90vw);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  text-align: center;
}
.modal h2 { margin: 0; font-size: 1.35rem; }

.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(1.5rem + env(safe-area-inset-bottom));
  padding: 0.7rem 1rem;
  display: flex;
  gap: 0.8rem;
  align-items: center;
  z-index: 60;
  transition: opacity 0.5s;
}
.toast.gone { opacity: 0; }

.toast-action {
  color: var(--cab-lamp);
  padding: 0.4rem 0.9rem;
  min-height: 2.1rem;
}

/* ---------------- RTL ----------------
 * Text and readouts mirror with direction; anything PHYSICAL (a control
 * placed by hand side) carries [data-physical] so no logical-property
 * rule can flip it (spec 11). The reel and clamp thumb buttons that used
 * it were removed (owner, 2026-09-26). */
[data-physical] { direction: ltr; }

/* ---------------- the galaxy (planet choice) ---------------- */

[data-screen="galaxy"] {
  padding: 0;
  overflow: hidden;
}

.galaxy-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #03070f;
}

.galaxy-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none; /* the map owns every gesture: pan, pinch, tap */
}

.galaxy-back {
  position: absolute;
  top: calc(0.8rem + env(safe-area-inset-top));
  left: calc(0.8rem + env(safe-area-inset-left));
  min-height: 2.2rem;
  padding: 0.4rem 0.9rem;
}

.galaxy-hint {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: calc(0.9rem + env(safe-area-inset-bottom));
  margin: 0;
  text-align: center;
  color: var(--cab-text);
  font-size: 0.95rem;
  text-shadow: 0 1px 3px #000, 0 0 10px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  transition: opacity 0.3s ease;
}
/* a star is picked: the how-to fades under the card */
.galaxy-stage.galaxy-picked .galaxy-hint { opacity: 0; }

/* THE FINDER (docs/CAMPAIGN-SPEC.md 6): the bar at the top, campaign only */
.galaxy-mission {
  position: absolute;
  z-index: 3;
  top: calc(0.8rem + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.45rem 1.1rem;
  max-width: min(32rem, 70vw);
  white-space: nowrap;
}
.galaxy-mission[hidden] { display: none; }
.galaxy-mission-text { display: flex; align-items: baseline; gap: 0.45rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.galaxy-mission-text[hidden], .galaxy-mission-done[hidden] { display: none; }
.galaxy-mission-label { font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--cab-dim); }
.galaxy-mission-name { font-size: 1.1rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cab-text); }
.galaxy-mission-done { font-size: 0.95rem; color: var(--cab-lamp); white-space: normal; }
.galaxy-mission-arrow {
  width: 0;
  height: 0;
  border: 0.6rem solid transparent;
  opacity: 0.22;
  transition: opacity 0.25s ease;
}
.galaxy-mission-left { border-right-color: var(--cab-lamp); border-left: 0; }
.galaxy-mission-right { border-left-color: var(--cab-lamp); border-right: 0; }
.galaxy-mission-arrow.lit { opacity: 1; animation: mission-pulse 1.1s ease-in-out infinite; }
@keyframes mission-pulse {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(var(--mission-nudge, 0)); }
}
.galaxy-mission-left.lit { --mission-nudge: -0.35rem; }
.galaxy-mission-right.lit { --mission-nudge: 0.35rem; }
/* the down arrow, under the bar, once the star is about in the middle */
.galaxy-mission-down {
  position: absolute;
  z-index: 3;
  top: calc(3.4rem + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  padding: 0;
  border: 0.8rem solid transparent;
  border-top: 1.1rem solid var(--cab-lamp);
  border-bottom: 0;
  background: none;
  cursor: pointer;
  filter: drop-shadow(0 0 0.4rem rgba(255, 210, 120, 0.7));
  animation: mission-down 1.1s ease-in-out infinite;
}
.galaxy-mission-down[hidden] { display: none; }
.galaxy-mission-down:focus-visible { outline: none; filter: drop-shadow(0 0 0.6rem var(--cab-text)); }
@keyframes mission-down {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 0.35rem); }
}
@media (max-width: 40rem) {
  .galaxy-mission { gap: 0.6rem; padding: 0.35rem 0.8rem; max-width: 82vw; }
  .galaxy-mission-name { font-size: 0.95rem; }
}
@media (prefers-reduced-motion: reduce) {
  .galaxy-mission-arrow.lit, .galaxy-mission-down { animation: none; }
}

/* the planet card: beside the focused star on wide screens, along the
 * bottom on phones */
/* THE CARD IS THE DOSSIER, and sits like the brief's did (owner,
 * 2026-10-01: "that's just too small for that panel window with
 * description - everything's too tight for no good reason. Since
 * clicking on any planet the planet is centered, this popup window could
 * be sitting center on the bottom 1/2 of the screen and look more like
 * the original did"): centred, in the lower half under the picked
 * star, the brief panel's width and serif, centred text. */
.galaxy-card {
  position: absolute;
  left: 50%;
  /* the focused star rides up to 28% of the height (js/ui/galaxy.js
   * CARD_LIFT); the card takes the room below it */
  top: 40%;
  transform: translateX(-50%);
  width: min(52rem, 90vw);
  max-height: calc(60% - 2.4rem - env(safe-area-inset-bottom));
  overflow-y: auto;
  /* TWO COLUMNS (owner, 2026-10-01): the words on the left, the meters
   * on the right, Descend across the bottom */
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(12rem, 2fr);
  grid-template-areas: "text worth" "go go";
  column-gap: 1.4rem;
  row-gap: 0.8rem;
  padding: 1.1rem 1.4rem 1.2rem;
  text-align: left;
}
.galaxy-card[hidden] { display: none; }
/* THE ACT LINE on the card: small, lamp-coloured, above the dossier */
.galaxy-act { margin: 0; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cab-lamp); }
.galaxy-act[hidden] { display: none; }
.galaxy-text { grid-area: text; display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.galaxy-name { margin: 0; font-size: 1.5rem; }
.galaxy-meta { margin: 0; color: var(--cab-dim); font-size: 0.9rem; }
.galaxy-status { margin: 0; font-size: 0.9rem; color: var(--cab-status); }
.galaxy-fastest { margin: 0.3rem 0 0; font-size: 0.86rem; color: var(--cab-lamp); font-variant-numeric: tabular-nums; }
.galaxy-fastest[hidden] { display: none; }
.galaxy-card .btn-act { grid-area: go; justify-self: center; min-width: 14rem; margin: 0; }
/* the dossier on the card: the brief's serif, at the brief's size */
.galaxy-lede,
.galaxy-block p {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Noto Serif", serif;
  text-shadow: 0 0.06rem 0.45rem rgba(0, 0, 0, 0.7);
  max-width: 48ch;
}
.galaxy-lede { font-size: 1.02rem; line-height: 1.45; margin-top: 0.1rem; }
.galaxy-block { display: flex; flex-direction: column; gap: 0.15rem; }
.galaxy-block p { font-size: 0.94rem; line-height: 1.4; }
.galaxy-block h3 {
  margin: 0;
  color: var(--cab-status);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.85;
}

/* THE DIFFICULTY FILTER (owner, 2026-10-01): the meter, top right */
/* the meter alone - no plate, no border, small and half-seen, so it does
 * not spoil the sky (owner, 2026-10-01); whole when open or pointed at */
.galaxy-filter-btn {
  position: absolute;
  top: calc(0.8rem + env(safe-area-inset-top));
  right: calc(0.8rem + env(safe-area-inset-right));
  width: 1.8rem;
  height: 2.8rem;
  padding: 0.3rem 0.5rem;
  margin: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  z-index: 3;
  background: none;
  border: 0;
  box-shadow: none;
  clip-path: none;
  opacity: 0.55;
  transition: opacity 200ms;
}
.galaxy-filter-btn:hover,
.galaxy-filter-btn:focus-visible,
.galaxy-filter-btn[aria-expanded="true"] { opacity: 1; }
.galaxy-meter-icon {
  position: relative;
  display: block;
  width: 0.55rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff3d4e 0%, #ffc247 50%, #3fc85a 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5);
}
.galaxy-meter-icon[hidden] { display: none; }
.galaxy-meter-mark {
  position: absolute;
  left: -0.25rem;
  right: -0.25rem;
  height: 0.28rem;
  top: 0;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0.35rem rgba(255, 255, 255, 0.9);
  transform: translateY(-50%);
}
/* the card under the meter: the words on the left, the gauge slider on
 * the right under the meter it continues; the two centred on each other */
.galaxy-filter {
  position: absolute;
  top: calc(4.5rem + env(safe-area-inset-top));
  right: calc(0.8rem + env(safe-area-inset-right));
  z-index: 3;
  display: flex;
  gap: 1.2rem;
  align-items: center;
  width: min(23rem, calc(100vw - 2rem));
  padding: 1rem 1rem 1rem 1.3rem;
}
.galaxy-filter[hidden] { display: none; }
.galaxy-filter-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.galaxy-filter-text h3 {
  margin: 0;
  color: var(--cab-status);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.galaxy-filter-text p { margin: 0; font-size: 0.9rem; line-height: 1.45; color: var(--cab-text); }
.galaxy-filter-slide {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  width: 3.4rem;
}
.galaxy-filter-end { font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cab-dim); }
/* THE GAUGE SLIDER: the range turned on its side inside a box of the
 * height it will have, its track the same green-amber-red gauge as the
 * meter, its thumb a white mark like the meter's */
.galaxy-filter-track {
  position: relative;
  width: 1.6rem;
  height: 10rem;
}
.galaxy-filter-range {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10rem;
  height: 1.6rem;
  margin: 0;
  transform: translate(-50%, -50%) rotate(-90deg);
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
.galaxy-filter-range::-webkit-slider-runnable-track {
  height: 0.9rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #3fc85a 0%, #ffc247 50%, #ff3d4e 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5);
}
.galaxy-filter-range::-moz-range-track {
  height: 0.9rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #3fc85a 0%, #ffc247 50%, #ff3d4e 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5);
}
.galaxy-filter-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 0.5rem;
  height: 1.5rem;
  margin-top: -0.3rem;
  border: 0;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0.4rem rgba(255, 255, 255, 0.9), 0 0 0 1px rgba(0, 0, 0, 0.5);
}
.galaxy-filter-range::-moz-range-thumb {
  width: 0.5rem;
  height: 1.5rem;
  border: 0;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0.4rem rgba(255, 255, 255, 0.9), 0 0 0 1px rgba(0, 0, 0, 0.5);
}

/* THE WORTH and THE INTEREST on the card (docs/QUEUE-SPEC.md 2) */
.galaxy-worth {
  grid-area: worth;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-left: 1.2rem;
  border-left: 1px solid var(--panel-edge);
  align-self: start;
}
.galaxy-worth[hidden] { display: none; }
.galaxy-worth h3 {
  margin: 0.2rem 0 0;
  color: var(--cab-status);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.85;
}
.galaxy-meter {
  width: 100%;
  height: 0.65rem;
  margin: 0.15rem 0 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--panel-edge);
  overflow: hidden;
}
.galaxy-meter-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #c98a2a, var(--cab-lamp));
  box-shadow: 0 0 0.6rem rgba(255, 210, 120, 0.5);
  transition: width 400ms ease-out;
}
.galaxy-worth-text, .galaxy-fee, .galaxy-take, .galaxy-bounty, .galaxy-interest {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.35;
}
.galaxy-worth-text { color: var(--cab-dim); }
.galaxy-fee { color: var(--cab-text); }
.galaxy-take { color: var(--cab-lamp); font-variant-numeric: tabular-nums; }
.galaxy-bounty { color: var(--cab-lamp); font-weight: 600; }
.galaxy-bounty[hidden] { display: none; }
.galaxy-interest { display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 0.5rem; color: var(--cab-dim); }
.galaxy-interest-dots { display: inline-flex; gap: 0.2rem; }
.galaxy-interest-dots[hidden] { display: none; }
.galaxy-interest-dots i {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--cab-status);
  box-shadow: 0 0 0.4rem rgba(120, 200, 255, 0.6);
}
.galaxy-interest-dots i.mining { background: var(--cab-lamp); box-shadow: 0 0 0.4rem rgba(255, 210, 120, 0.7); }

/* a phone: docked at the bottom, edge to edge, the text a touch smaller */
@media (max-width: 40rem) {
  .galaxy-card {
    left: 1rem;
    right: 1rem;
    top: auto;
    bottom: calc(2.6rem + env(safe-area-inset-bottom));
    transform: none;
    width: auto;
    max-height: 60vh;
  }
  .galaxy-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "text" "worth" "go";
    row-gap: 0.6rem;
  }
  .galaxy-worth { padding-left: 0; border-left: 0; padding-top: 0.5rem; border-top: 1px solid var(--panel-edge); }
  .galaxy-name { font-size: 1.3rem; }
  .galaxy-lede { font-size: 0.9rem; }
  .galaxy-block p { font-size: 0.86rem; }
}

/* ---------------- planet brief + the dive ---------------- */
/* THE PLANET IS THE SCREEN (owner, 2026-09-22): the world fills the
 * view and the dossier floats ON it - a contrasting serif over a
 * semi-transparent panel, so the writing stays readable wherever the
 * painting is bright. */

[data-screen="brief"] {
  align-items: stretch;
  overflow: hidden;
  padding: 0;
}
/* THE MISSION BRIEF (docs/CAMPAIGN-SPEC.md 5): an overlay over the cleared
 * maze (or the galaxy); the panel scrolls by touch or wheel with no bar */
.mission-overlay {
  position: fixed;
  inset: 0;
  z-index: 35; /* over the interstitial (30), under a modal (40) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem;
  background: rgba(1, 3, 8, 0.62);
}
.mission-overlay[hidden] { display: none; }
.mission-panel.brief-panel { width: min(38rem, 94vw); max-height: calc(100vh - 1.6rem); max-height: calc(100dvh - 1.6rem); display: flex; flex-direction: column; overflow: hidden; }
/* the words scroll inside under the thin translucent bar (the owner's
 * 2026-10-05 rule), a fade at the foot; Find it stays put */
.mission-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 0.9rem; padding-bottom: 1rem; text-align: left;
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 1rem), transparent); mask-image: linear-gradient(180deg, #000 calc(100% - 1rem), transparent); }
/* THE LAYOUT (docs/VOICE-GUIDE.md 3): the kicker and the name centred;
 * every section a short label over left-aligned body text at the body
 * size (never a small dim line); Control's line set apart as a quote; the
 * hints a clean list; the setback closes the panel. Nothing inside the
 * body scrolls on its own - the pad turns the body (js/input/padNav.js) */
.mission-head { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; text-align: center; }
.mission-panel .brief-kicker { display: block; font-size: 0.9rem; letter-spacing: 0.16em; }
.mission-sections { display: flex; flex-direction: column; gap: 0.9rem; }
.mission-section { display: flex; flex-direction: column; gap: 0.3rem; margin: 0; }
.mission-label { margin: 0; font-family: Roboto, "Segoe UI", system-ui, -apple-system, sans-serif; font-size: 0.9rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cab-status); }
.mission-section p, .mission-hints li { margin: 0; font-family: Georgia, "Times New Roman", "Noto Serif", serif; font-size: 1rem; line-height: 1.5; color: var(--cab-text); text-shadow: 0 0.06rem 0.45rem rgba(0, 0, 0, 0.7); }
.mission-quote { margin: 0; padding: 0.15rem 0 0.15rem 0.9rem; border-left: 0.2rem solid var(--cab-lamp); }
.mission-quote p { color: var(--cab-lamp); font-style: italic; font-size: 1.05rem; }
.mission-hints { margin: 0; padding-left: 1.2rem; list-style: disc; }
.mission-hints li { margin: 0 0 0.35rem; }
.mission-hints li::marker { color: var(--cab-status); }
.mission-setback { margin: 0.2rem 0 0; padding-top: 0.7rem; border-top: 1px solid rgba(236, 230, 220, 0.25); font-family: Georgia, "Times New Roman", "Noto Serif", serif; font-style: italic; font-size: 1rem; line-height: 1.5; color: var(--cab-text); text-shadow: 0 0.06rem 0.45rem rgba(0, 0, 0, 0.7); }
.mission-panel .inter-actions { margin-top: 0.3rem; }
/* a phone held upright, or a short screen: the panel keeps the whole
 * height (the planet brief's narrower rules are not for the overlay) and
 * the words keep the body size */
@media (max-width: 42rem), (orientation: portrait) {
  .mission-panel.brief-panel { width: 100%; max-height: calc(100vh - 1.6rem); max-height: calc(100dvh - 1.6rem); }
}
@media (max-height: 30rem) {
  .mission-panel.brief-panel { width: min(40rem, 96vw); padding: 0.7rem 0.95rem; }
  .mission-panel .brief-kicker { display: block; }
  .mission-body { gap: 0.7rem; }
  /* a phone on its side: Find it and Back side by side, so the words
   * get the height (the review: 4 screens of scrolling stacked) */
  .mission-panel .inter-actions { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 0.6rem; align-items: stretch; }
  .mission-panel .inter-actions > button { width: auto; flex: 1 1 0; margin-top: 0; position: static; }
}
/* the TV (the big-but-short tier, Xbox 1152x567): wider, so less to scroll */
@media (min-width: 60rem) and (max-height: 48rem) and (orientation: landscape) {
  .mission-panel.brief-panel { width: min(46rem, 90vw); }
}

.brief-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* the deep field behind the world; the whole sheet drifts a little so
 * the twinkle is not the only motion */
.brief-stars {
  position: absolute;
  inset: -2%;
  overflow: hidden;
  pointer-events: none;
  animation: brief-sky-drift 150s ease-in-out infinite alternate;
}

.brief-star {
  position: absolute;
  border-radius: 50%;
  background: #e6f4ff;
  opacity: var(--dim, 0.3);
  animation: brief-twinkle var(--dur, 4s) ease-in-out infinite alternate;
}

.brief-star-bright {
  background: #ffffff;
  box-shadow: 0 0 0.38rem rgba(150, 220, 255, 0.85);
}

@keyframes brief-twinkle {
  from { opacity: var(--dim, 0.3); transform: scale(0.8); }
  to { opacity: var(--lit, 0.9); transform: scale(1.18); }
}

@keyframes brief-sky-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-1.6%, 1%, 0); }
}

.brief-art {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  /* CENTRED (owner, 2026-09-22) - the world sits in the middle of the
   * screen and the dossier floats on it */
  justify-content: center;
}

/* THE LINE (js/ui/line.js): the astronauts waiting, top right of the mine */
.line {
  position: absolute;
  top: calc(0.6rem + env(safe-area-inset-top));
  right: calc(0.8rem + env(safe-area-inset-right));
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  pointer-events: none;
}
.line[hidden] { display: none; }
.line-strip {
  position: relative;
  height: 3.4rem;
  min-width: 3.2rem;
  transition: width 500ms ease;
}
.line-figure {
  position: absolute;
  left: 0;
  top: 0;
  width: 2.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  transition: transform 600ms cubic-bezier(0.3, 0.8, 0.3, 1), opacity 500ms;
  will-change: transform;
}
.line-figure.gone { opacity: 0; }
.line-figure svg { width: 1.7rem; height: 2.3rem; filter: drop-shadow(0 0.1rem 0.3rem rgba(0, 0, 0, 0.8)); }
.line-figure .helmet { fill: #cfd8e3; }
.line-figure .visor { fill: #1a2434; }
.line-figure .suit { fill: #9aa7b8; }
.line-figure.me .suit { fill: var(--cab-lamp); }
.line-figure.me .helmet { fill: #f6e2b2; }
.line-figure.mining .suit { fill: #6fb6ff; }
.line-figure.mining svg { animation: line-work 900ms ease-in-out infinite alternate; }
@keyframes line-work { from { transform: translateY(0) rotate(-4deg); } to { transform: translateY(0.1rem) rotate(4deg); } }
.line-name {
  max-width: 3.4rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.58rem;
  color: var(--cab-dim);
  text-shadow: 0 0.06rem 0.3rem rgba(0, 0, 0, 0.9);
}
.line-figure.me .line-name { color: var(--cab-lamp); }
.line-place, .line-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--cab-text);
  text-shadow: 0 0.06rem 0.4rem rgba(0, 0, 0, 0.9);
  text-align: right;
  max-width: 18rem;
}
.line-note { color: var(--cab-lamp); }
.line-note[hidden] { display: none; }
.line-leave { pointer-events: auto; min-height: 2rem; padding: 0.3rem 0.8rem; font-size: 0.8rem; }
@media (prefers-reduced-motion: reduce) {
  .line-figure { transition: none; }
  .line-figure.mining svg { animation: none; }
}

/* THE NATION (docs/NATIONS-SPEC.md): the flags, the one chosen lit */
/* THE SCREEN ITSELF SCROLLS (owner, 2026-10-10: "I'm trying to scroll on
 * the flag page but not possible"): a nested scroll box is missed by a
 * console's stick-scroll and by a thumb that lands beside it; the whole
 * screen scrolling is caught anywhere. The buttons stay at the foot. */
#screen-nation {
  background: #03070f url('img/title-bg-wide.png') center / cover no-repeat;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  align-items: flex-start;
}
@media (orientation: portrait) {
  #screen-nation { background-image: url('img/title-bg-portrait.png'); }
}
.nation-card {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: min(64rem, 94vw);
  padding: 1.2rem 1.3rem 0;
}
.nation-card h2 { margin: 0; font-size: 1.3rem; text-align: center; }
.nation-lede { margin: 0; text-align: center; font-size: 1rem; color: var(--cab-text); }
/* THE FINDER FLOATS (owner, 2026-10-10): the search box stays put at the
 * top of the screen and the flags scroll under it, the way the buttons
 * stay put at the foot. Same sticky trick, same fade so the flags
 * passing beneath do not fight the box. */
.nation-find {
  position: sticky;
  top: 0;
  z-index: 2;
  /* THE LIST'S OWN HEADER (owner, 2026-10-13: "what is that ugly bar
   * behind the search box"): no full-width band - the box sits at the top
   * of the list panel, the same width and ground, rounded above, and the
   * rows scroll under it */
  width: min(44rem, 100%);
  box-sizing: border-box;
  margin: 0 auto -0.8rem;
  padding: 0.8rem 1rem 0.6rem;
  background: rgb(6, 10, 20); /* opaque: the rows scroll under it unseen */
  border-radius: 0.6rem 0.6rem 0 0;
}
.nation-search { display: block; width: min(24rem, 100%); margin: 0 auto; }
.nation-search input { width: 100%; box-sizing: border-box; padding: 0.55rem 0.8rem; font-size: 1rem; }
/* THE CHOICE, BIG (owner, 2026-10-12: the page was "too cluttered, not an
 * easy page to choose a flag from"): the lit country large at the top */
.nation-chosen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0 0.2rem;
}
.nation-chosen.empty .nation-chosen-name { color: var(--cab-dim); font-size: 1.05rem; }
.nation-chosen-name { font-size: 1.5rem; letter-spacing: 0.02em; text-align: center; }
.nation-flag.nation-flag-big {
  width: 7.2rem;
  height: 5.4rem;
  border-radius: 0.35rem;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0.4rem 1.4rem rgba(0, 0, 0, 0.55);
  background-size: calc(16 * 7.2rem) auto;
  background-position: calc(var(--flag-col, 0) * -7.2rem) calc(var(--flag-row, 0) * -5.4rem);
}
.nation-else { margin: 0.4rem 0 0; text-align: center; font-size: 1rem; color: var(--cab-text); }
/* A PLAIN A-Z LIST: one column, two on a wide screen; rows, not tiles */
.nation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: 2rem;
  width: min(44rem, 100%);
  box-sizing: border-box;
  margin: 0 auto;
  padding: 0.2rem 1rem 0.8rem;
  /* a soft dark ground: the names never sit on the bright art behind */
  background: rgba(6, 10, 20, 0.9);
  border-radius: 0 0 0.6rem 0.6rem;
}
@media (min-width: 52rem) {
  .nation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.nation-letter {
  grid-column: 1 / -1;
  margin: 0.9rem 0 0.2rem;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid rgba(242, 207, 159, 0.35);
  color: var(--cab-lamp);
  font-size: 1rem;
  letter-spacing: 0.2em;
}
.nation-letter[hidden] { display: none; }
.nation-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  /* a row grows with its name; a long one wraps (owner, 2026-10-10) */
  height: auto;
  min-height: 3.2rem;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
  padding: 0.45rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 0.45rem;
  background: transparent;
  color: var(--cab-text);
  font-size: 1.05rem;
  text-align: left;
  cursor: pointer;
}
.nation-item:hover, .nation-item:focus-visible { background: rgba(255, 255, 255, 0.07); }
.nation-item .nation-flag {
  width: 3rem;
  height: 2.25rem;
  background-size: calc(16 * 3rem) auto;
  background-position: calc(var(--flag-col, 0) * -3rem) calc(var(--flag-row, 0) * -2.25rem);
}
.nation-item[hidden] { display: none; }
.nation-item[aria-selected="true"] { border-color: var(--cab-lamp); background: rgba(242, 207, 159, 0.16); box-shadow: 0 0 0.8rem rgba(255, 210, 120, 0.35); }
/* a flag is a tile of img/flags.png (js/i18n/flags.js: 16 across, 4x3):
 * the sheet sized so one tile is the box, shifted by --flag-col/--flag-row
 * (set by paintFlag) */
.nation-flag {
  display: block;
  width: 2.4rem;
  height: 1.8rem;
  border-radius: 0.2rem;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
  flex: 0 0 auto;
  background-image: var(--flag-sheet);
  background-repeat: no-repeat;
  background-size: calc(16 * 2.4rem) auto;
  background-position: calc(var(--flag-col, 0) * -2.4rem) calc(var(--flag-row, 0) * -1.8rem);
}
.nation-flag[hidden] { display: none; }
.nation-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  padding: 0.7rem 0 calc(0.9rem + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(3, 7, 15, 0), rgba(3, 7, 15, 0.92) 35%);
}
.nation-go { margin-top: 0; }
.nation-current { display: inline-flex; align-items: center; gap: 0.5rem; }
@media (min-width: 60rem) and (max-height: 48rem) and (orientation: landscape) {
  .nation-card { gap: 0.5rem; padding: 0.7rem 1rem; }
  .nation-find { padding: 0.6rem 0.8rem 0.5rem; }
  .nation-flag.nation-flag-big { width: 5.6rem; height: 4.2rem; background-size: calc(16 * 5.6rem) auto;
    background-position: calc(var(--flag-col, 0) * -5.6rem) calc(var(--flag-row, 0) * -4.2rem); }
  .nation-item { padding: 0.35rem 0.5rem; font-size: 1rem; }
}

/* THE PAD EVERYWHERE (js/input/padNav.js): the control the pad is on
 * wears a lamp-coloured ring and a SLOW PULSING GLOW (owner, 2026-10-09:
 * "the same slow pulsating glow that indicates its already selected"),
 * and while the pad is driving the mouse cursor is away (a pointer move
 * brings it back) */
/* DRAWN INSIDE THE SHAPE (owner on the Xbox, 2026-10-10: "I don't see
 * any button showing up with the glow"): every button is cut to the
 * cabin window by a clip-path, and an outline or an outer shadow lies
 * outside the box, so the clip cut the glow away. An inset ring, an
 * inset glow and a brightness pulse are all inside the clipped box. */
.pad-focus {
  outline: none;
  /* STRONG, AND SHAPED (owner on the TV, 2026-10-10: "too subtle", then
   * "what are those clipped areas?"): a hard ring is a rectangle and the
   * cabin window's cut corners sliced bites out of it. So no bands: a
   * SOFT inner glow that follows any shape, a brightness pulse, the
   * lettering blazing, and the button breathing a size larger (a
   * transform is not clipped). The pulse is a breath, not a strobe
   * (owner: "too strong, bring it down a notch" - the low end stays lit,
   * the high end eased). */
  box-shadow: inset 0 0 2.2rem 0.3rem rgba(255, 225, 150, 0.85);
  filter: brightness(1.2);
  transform: scale(1.03);
  animation: pad-glow 2.2s ease-in-out infinite;
}
@keyframes pad-glow {
  0%, 100% { box-shadow: inset 0 0 1.6rem 0.2rem rgba(255, 220, 140, 0.7); filter: brightness(1.12); transform: scale(1.02); }
  50% { box-shadow: inset 0 0 2.6rem 0.4rem rgba(255, 240, 200, 0.95); filter: brightness(1.35); transform: scale(1.045); }
}
@media (prefers-reduced-motion: reduce) {
  .pad-focus { animation: none; }
}

.pad-driving,
.pad-driving * {
  cursor: none !important;
}

/* THE PAD'S KEYS (the controller notice, index.html tpl-notice-console;
 * the bar that stood along the foot of the mine is gone - owner,
 * 2026-10-09): the pad's own letters in the pad's own colours, then the
 * word. */
.notice-keys {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 1.2rem;
  margin: 0;
  text-align: left;
  font-size: 0.95rem;
  color: #2a1d0e;
}
.notice-keys .pad-item:first-child { grid-column: 1 / -1; }
.pad-item { display: inline-flex; align-items: center; gap: 0.5rem; }
.pad-item[hidden] { display: none; }
.pad-key[hidden] { display: none; }
.pad-stick[hidden] { display: none; }
.pad-key {
  display: inline-grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0;
  color: #0b0d10;
  background: #d9dde3;
  text-shadow: none;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.5);
}
.pad-key-a { background: #7bc943; }
.pad-key-b { background: #e8473c; color: #fff; }
.pad-key-x { background: #3d8fe6; color: #fff; }
.pad-key-y { background: #f3c531; }
.pad-key-menu { font-size: 1.05rem; }
.pad-stick {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #6a6e74 0 36%, #2b2e33 40% 68%, #16181b 72%);
  box-shadow: inset 0 0 0 2px #8a8f96, 0 0 0 1px rgba(0, 0, 0, 0.5);
}

.title-fullscreen {
  margin-top: 0.6rem;
}
/* installed where no Fullscreen API exists (iOS): nothing to offer */
.title-fullscreen[hidden] { display: none; }

/* THE CONSOLE NOTE (js/ui/consoleNote.js): how to hand the pad to the
 * game on a console's browser. Body-sized, on the lesson's frosted
 * plate; never small dim text. */
.console-note[hidden] { display: none; }
.console-note {
  max-width: 34rem;
  margin: 0.6rem auto 0;
  padding: 0.7rem 1.1rem;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--cab-text);
  text-shadow: 0 1px 2px #000;
  clip-path: polygon(0.6rem 0, calc(100% - 0.6rem) 0, 100% 0.6rem, 100% 100%, 0 100%, 0 0.6rem);
  background: linear-gradient(180deg, rgba(60, 64, 70, 0.4), rgba(20, 24, 30, 0.52));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.console-note p { margin: 0; }
.console-note p + p { margin-top: 0.35rem; }
.console-note-settings { margin: 0 0 0.8rem; text-align: left; max-width: none; }

/* THE NOTICE (js/ui/notice.js): the Launch button's plate, dark ink,
 * unfurling - a bright line runs out sideways, rolls down into the
 * plate, and the words come up on it. Reusable: any modal box given
 * .notice wears this. */
.scrim.notice-scrim { animation: notice-dim 0.45s ease-out both; }
.modal.notice {
  width: min(30rem, 92vw);
  padding: 1.4rem 1.8rem 1.5rem;
  gap: 0.9rem;
  clip-path: var(--cab-window-large);
  color: #2a1d0e;
  text-shadow: none;
  background: linear-gradient(180deg, #ffe9c8, #f0c483 55%, var(--cab-lamp-deep));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 0 14px rgba(255, 240, 210, 0.45), 0 0 2.5rem rgba(255, 220, 160, 0.35);
  transform-origin: 50% 0;
  animation: notice-unfurl 1s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}
.modal.notice h2 { color: #2a1d0e; font-size: 1.3rem; letter-spacing: 0.06em; text-transform: uppercase; }
.modal.notice .notice-body { margin: 0; font-size: 1.02rem; line-height: 1.45; color: #2a1d0e; }
.modal.notice > * { animation: notice-ink 0.45s ease-out 0.7s both; }
.notice-ok {
  padding: 0.7rem 2.2rem;
  clip-path: var(--cab-window);
  border: 0;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cab-lamp);
  background: linear-gradient(180deg, rgba(60, 42, 20, 0.95), rgba(28, 19, 9, 0.98));
  cursor: pointer;
}
.notice-ok:hover, .notice-ok:focus-visible { color: #fff2dc; }
/* THE TRANSMISSION and THE OPENING on the plate (js/story/turns.js) */
.trans-from { margin: 0; font-size: 0.85rem; letter-spacing: 0.14em; text-transform: uppercase; color: #5a4020; }
.trans-head { display: flex; align-items: center; justify-content: center; gap: 0.9rem; }
.trans-head:empty { display: none; }
.trans-portrait { width: 5.2rem; height: 5.2rem; object-fit: cover; border-radius: 50%; box-shadow: 0 0 0 2px rgba(42, 29, 14, 0.6); }
.trans-portrait[hidden] { display: none; }
.trans-still[hidden] { display: none; }
.trans-still { max-width: 100%; max-height: 11rem; object-fit: cover; clip-path: var(--cab-window); }
.trans-body { display: flex; flex-direction: column; gap: 0.55rem; }
.trans-body p { margin: 0; font-size: 1.02rem; line-height: 1.45; color: #2a1d0e; }
.trans-choice-title { font-weight: 700; letter-spacing: 0.06em; }
.trans-choices { display: flex; gap: 0.7rem; flex-wrap: wrap; justify-content: center; }
.trans-choices[hidden] { display: none; }
.trans-choice-title[hidden] { display: none; }
.inter-actions[hidden] { display: none; }
/* the d-pad picture under the controller notice */
.notice-dpad { display: flex; align-items: center; justify-content: center; gap: 0.9rem; margin: 0; text-align: left; }
.notice-dpad svg { width: 3.6rem; height: 3.6rem; flex: 0 0 auto; }
.notice-dpad .notice-body { flex: 0 1 auto; }
@keyframes notice-dim {
  from { background: rgba(1, 3, 8, 0); }
  to { background: rgba(1, 3, 8, 0.55); }
}
@keyframes notice-unfurl {
  0% { transform: scaleX(0.04) scaleY(0.04); filter: brightness(2); }
  45% { transform: scaleX(1) scaleY(0.04); filter: brightness(1.7); }
  100% { transform: scaleX(1) scaleY(1); filter: brightness(1); }
}
@keyframes notice-ink {
  from { opacity: 0; transform: translateY(0.4rem); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .scrim.notice-scrim, .modal.notice, .modal.notice > * { animation: none; }
}

/* THE HYPERDRIVE (js/ui/warp.js): its canvas lies over the whole page
 * for the length of the jump - over the galaxy and over the brief the
 * screens switch to beneath it */
.warp-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 60;
  pointer-events: auto; /* the jump owns the screen: no Back mid-flight */
}

/* the arrival (owner, 2026-10-01: "the transition between the hyperdrive
 * and the actual planet could use improvement"): the planet grows out of
 * the jump's centre through the braking streaks - timed to
 * WARP.ARRIVE_MS in js/ui/warp.js. The dossier was read on the galaxy
 * card, so on the way through the brief is the planet alone (.auto)
 * and the descent begins by itself (owner: "it will slow when the planet
 * appears momentarily and then it will begin automatically its
 * descent straight into the game"). */
.brief-stage.warp-arrive .brief-art {
  animation: warp-arrive 650ms cubic-bezier(0.2, 0.8, 0.25, 1) both; /* = WARP.ARRIVE_MS */
}

.brief-stage.warp-arrive .brief-overlay {
  animation: warp-panel 600ms 550ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

.brief-stage.auto .brief-overlay {
  display: none;
}

/* transform and opacity only: a filter animating over a 1728x972 painting
 * is a full re-render per frame on an Xbox (owner, 2026-10-09) */
@keyframes warp-arrive {
  from { transform: scale(0.05); opacity: 0.2; }
  40% { opacity: 1; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes warp-panel {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .brief-stage.warp-arrive .brief-art,
  .brief-stage.warp-arrive .brief-overlay { animation: none; }
}

.brief-orbital {
  /* dominant, but leaving a rim of sky so the star field reads around
   * it (owner: stars around this planet) */
  width: min(86vmin, 100%);
  height: min(86vmin, 100%);
  object-fit: contain;
  animation: brief-drift 16s ease-in-out infinite alternate;
}
/* the planet's glow: a gradient behind it, drawn once - not a drop-shadow
 * filter re-rendered on every frame of the drift (owner, 2026-10-09) */
.brief-art::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(96vmin, 110%);
  height: min(96vmin, 110%);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(90, 190, 230, 0.22) 0%, rgba(90, 190, 230, 0.1) 48%, rgba(90, 190, 230, 0) 70%);
  pointer-events: none;
}

.brief-orbital.missing {
  display: none;
}
/* another planet's painting is still on the element: unseen until the
 * new one has loaded (js/planetBrief.js, 2026-10-09) */
.brief-orbital.swapping {
  opacity: 0;
}

/* no orbital painting yet: a plain lit disc, never a broken image */
.brief-art.no-art::before {
  content: "";
  width: min(80vmin, 90%);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%,
      rgba(150, 170, 190, 0.85), rgba(40, 52, 68, 0.9) 58%,
      rgba(8, 12, 20, 0.95) 100%);
  box-shadow: 0 0 4rem rgba(90, 190, 230, 0.2);
}

.brief-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  /* THE WRITING IS CENTRED on the world (owner, 2026-09-22) */
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  pointer-events: none; /* the panel takes its own events back */
}

.brief-panel {
  pointer-events: auto;
  width: min(31rem, 54%);
  text-align: center;
  max-height: 100%;
  overflow-y: auto;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  /* the frosted plate (cabin language); the planet still reads behind
   * the words through the blur */
}

/* CONTROL'S DIRECTIVE on the brief: the passage, scrolling inside the
 * panel on a short screen; the setback stands last */
.brief-directive div { display: flex; flex-direction: column; gap: 0.35rem; max-height: 11rem; overflow-y: auto; }
.brief-directive p { margin: 0; }
.brief-directive .brief-pre { color: var(--cab-lamp); }
.brief-kicker {
  margin: 0;
  color: var(--cab-status);
  font-size: 0.74rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

/* the CONTRASTING face: the app speaks in system sans, the planet's
 * dossier speaks in serif - and every local platform has one */
.brief-name {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Noto Serif", serif;
  font-size: clamp(1.6rem, 4.2vmin, 2.6rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.05;
  text-shadow: 0 0.12rem 0.6rem rgba(0, 0, 0, 0.75);
}

.brief-lede,
.brief-block p {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Noto Serif", serif;
  text-shadow: 0 0.06rem 0.45rem rgba(0, 0, 0, 0.7);
}

.brief-lede {
  font-size: 1.02rem;
  line-height: 1.45;
}

.brief-block {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

/* centred text needs its own measure or the ragged edges wander */
.brief-lede,
.brief-block p {
  max-width: 34ch;
  margin-inline: auto;
}

.brief-block h3 {
  margin: 0;
  color: var(--cab-status);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.85;
}

.brief-block p {
  font-size: 0.94rem;
  line-height: 1.4;
}

.brief-panel .btn-act {
  width: 100%;
  margin-top: 0.35rem;
  /* the dive button is never below the fold (the picker's scar) */
  position: sticky;
  bottom: 0;
}

@keyframes brief-drift {
  from { transform: scale(1) translateY(0); }
  to { transform: scale(1.02) translateY(-0.6%); }
}

/* THE DIVE VEIL: the planet, growing, over a frozen scene. Opaque space
 * behind it - early on the disc is small and the black IS the sky. */
.planet-zoom {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
  background: #03070f;
}

.planet-zoom-layer {
  position: absolute;
  object-fit: contain;
  will-change: transform, opacity;
}

@media (max-width: 42rem), (orientation: portrait) {
  /* portrait: the planet still owns the screen, the dossier sits along
   * the bottom of it */
  /* portrait: the planet keeps the top of the screen, the dossier
   * sits along the bottom - nothing overlaps the mine scar */
  .brief-orbital {
    width: min(92vmin, 96%);
    height: min(92vmin, 96%);
  }

  .brief-overlay {
    align-items: flex-end;
    justify-content: center;
    padding: 0.8rem;
  }

  .brief-panel {
    width: 100%;
    max-height: 58%;
  }
}

@media (max-height: 30rem) {
  .brief-overlay {
    padding: 0.6rem;
  }

  .brief-panel {
    width: min(30rem, 62%);
    padding: 0.7rem 0.85rem;
    gap: 0.4rem;
  }

  .brief-kicker {
    display: none;
  }

  .brief-lede {
    font-size: 0.92rem;
  }

  .brief-block p {
    font-size: 0.86rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brief-orbital,
  .brief-stars,
  .brief-star {
    animation: none;
  }
}

/* ---------------- avatar picker (v2) ----------------
 * THE CABIN (owner, 2026-09-28): the landed craft's crew compartment,
 * Cindra's basalt through the rear window, the miner on the empty floor.
 * Everything on the screen is cut from the plate's own materials and the
 * rear window's own shape - CHAMFERED, the top corners cut on the
 * diagonal, a thin bright metal lip round dark glass - and kept quiet:
 * hairline frames, deep glass with a faint reflection, a chosen state
 * that glows behind its glass rather than filling it, a panel that hugs
 * its content. (Owner on the first cut: "looking cheap rather than
 * premium" - thick bevels and solid gold fills were the reason.) */
#screen-avatar {
  background: #0a0f16 url('img/avatar-cabin.jpg?v=390') center / cover no-repeat;
  /* the --cab-* materials and the window polygons moved to :root
   * (2026-09-28) when the cabin became the house style */
}
#screen-avatar::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, rgba(3, 7, 15, 0), rgba(3, 7, 15, 0.32) 100%),
    linear-gradient(180deg, rgba(3, 7, 15, 0.38), rgba(3, 7, 15, 0) 28%, rgba(3, 7, 15, 0) 72%, rgba(3, 7, 15, 0.42));
  pointer-events: none;
}
#screen-avatar.active { align-items: stretch; justify-content: stretch; }
.avatar-shell {
  position: relative;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: calc(0.9rem + env(safe-area-inset-top)) calc(1.2rem + env(safe-area-inset-right))
    calc(0.9rem + env(safe-area-inset-bottom)) calc(1.2rem + env(safe-area-inset-left));
  overflow: hidden;
}
.avatar-heading { flex: 0 0 auto; text-align: center; }
.avatar-heading h2 {
  margin: 0;
  font-family: Roboto, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: 1.45rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cab-text);
  text-shadow: 0 1px 3px #000, 0 0 18px rgba(0, 0, 0, 0.6);
}

.avatar-layout {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: row;
  gap: 1.4rem;
  align-items: stretch;
}

/* THE STAGE: the figure on the cabin floor, the name under the feet */
.avatar-stage {
  position: relative;
  flex: 1 1 58%;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 3.8rem 3.2rem;
  outline: none;
}
.avatar-stage::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2.7rem;
  width: min(52%, 20rem);
  height: 0.9rem;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.25) 50%, rgba(0, 0, 0, 0) 75%);
  pointer-events: none;
}
.avatar-stage:focus-visible .avatar-stand { outline: 1px solid var(--cab-status); outline-offset: 6px; }
.avatar-stand {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  transition: transform 0.9s ease-in-out;
  will-change: transform;
}
.avatar-stand.shift-left { transform: translateX(-1.5%); }
.avatar-stand.shift-right { transform: translateX(1.5%); }
.avatar-figure {
  width: 100%;
  height: 100%;
  transform-origin: 50% 100%;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.avatar-body {
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: 50% 100%;
  --avatar-fade: 180ms;
}
.avatar-figure.alive { animation: avatar-sway 7s ease-in-out -2.6s infinite; }
.avatar-figure.alive .avatar-body { animation: avatar-breathe 4s ease-in-out infinite; }
@keyframes avatar-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.008); }
}
@keyframes avatar-sway {
  0%, 100% { transform: rotate(-0.6deg); }
  50% { transform: rotate(0.6deg); }
}
.avatar-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 100%;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.55));
  pointer-events: none;
}
.avatar-image.missing { visibility: hidden; }
.avatar-image-next { opacity: 0; }
.avatar-body.fading .avatar-image-next { opacity: 1; transition: opacity var(--avatar-fade) ease-in-out; }
.avatar-body.missing::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  height: 88%;
  aspect-ratio: 1 / 2.6;
  transform: translateX(-50%);
  border-radius: 46% 46% 12% 12% / 22% 22% 6% 6%;
  background: linear-gradient(180deg, rgba(214, 218, 222, 0.16), rgba(214, 218, 222, 0.04));
  box-shadow: inset 0 0 0 1px rgba(214, 218, 222, 0.25);
}
.avatar-body.missing::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  height: 14%;
  aspect-ratio: 1 / 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(214, 218, 222, 0.16);
  box-shadow: inset 0 0 0 1px rgba(214, 218, 222, 0.25);
}

/* THE WINDOW AS A CONTROL: two layers. The element is the metal lip
 * (a thin gradient the frame's colour), cut to the chamfered shape; its
 * pseudo-element, inset by the lip, is the glass - dark, with a faint
 * reflection across its top. Nothing thicker than a hairline. */
/* THE WINDOW AS A CONTROL (.avatar-window, .avatar-arrow, .avatar-pill)
 * is cut in the cabin language block at the top of the file; here only
 * the picker's own sizes and states. */

.avatar-arrow {
  position: absolute;
  z-index: 2;
  top: 50%;
  width: 3.4rem;
  height: 2.5rem;
  min-height: 0;
  padding: 0;
  margin-top: -2.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}
.avatar-arrow::before {
  content: "";
  width: 0.62rem;
  height: 0.62rem;
  border-left: 1.5px solid var(--cab-text);
  border-bottom: 1.5px solid var(--cab-text);
  transform: rotate(45deg);
  margin-left: 0.3rem;
  opacity: 0.9;
}
.avatar-arrow-prev { left: 0; }
.avatar-arrow-next { right: 0; }
.avatar-arrow-next::before { transform: rotate(-135deg); margin-left: -0.3rem; }
.avatar-arrow:hover::after, .avatar-arrow:focus-visible::after {
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(242, 207, 159, 0.28), rgba(242, 207, 159, 0) 70%),
    linear-gradient(180deg, var(--cab-glass-2), var(--cab-glass) 75%);
}
.avatar-arrow:active::after { background: var(--cab-glass); }
.avatar-arrow:focus-visible { outline: none; }
.avatar-caption {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  text-align: center;
  pointer-events: none;
}
.avatar-charname {
  margin: 0;
  font-family: Roboto, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cab-text);
  text-shadow: 0 1px 3px #000, 0 0 16px rgba(0, 0, 0, 0.7);
}
/* the roster position, for screen readers alone (owner, 2026-10-08: the
 * count under the feet goes; the teaser takes its place) */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* THE TEASER (owner, 2026-10-08): the introduction's first line under the
 * name, cut to one line with an ellipsis - a door, not a read */
.avatar-teaser {
  display: block;
  width: min(92%, 26rem);
  margin: 0.25rem auto 0;
  padding: 0.1rem 0.4rem;
  pointer-events: auto;
  cursor: pointer;
  background: none;
  border: 0;
  color: var(--cab-lamp);
  font-family: Georgia, "Times New Roman", "Noto Serif", serif;
  font-size: 0.95rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  text-shadow: 0 1px 3px #000, 0 0 12px rgba(0, 0, 0, 0.7);
}
.avatar-teaser:hover, .avatar-teaser:focus-visible { color: var(--cab-text); outline: none; text-decoration: underline; }
.avatar-teaser:empty { display: none; }
/* the slip is open: its door waits under it */
.avatar-stage.intro-open .avatar-teaser { visibility: hidden; }

/* THE INTRODUCTION (owner, 2026-10-08: "some people will want to read,
 * but many wont") opens from the middle of the figure on a frosted pane
 * when the teaser is tapped. The pane is AS TALL AS ITS WORDS and no
 * taller (owner, 2026-10-10: "under the last bit of text it should
 * close up" - the figure shows beneath); only a long one fills the
 * lower half and scrolls by touch or wheel with no bar, the fade at the
 * foot saying there is more. A tap anywhere closes it. */
.avatar-intro[hidden] { display: none; }
.avatar-intro {
  position: absolute;
  z-index: 3;
  /* over the figure, a readable column wide - never the whole stage
   * (owner, 2026-10-15: on a wide screen the lines ran the full width) */
  left: 50%;
  transform: translateX(-50%);
  width: min(100% - 0.8rem, 34rem);
  top: 50%;
  max-height: 50%;
  box-sizing: border-box;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 0.9rem 1rem 1.6rem;
  font-family: Georgia, "Times New Roman", "Noto Serif", serif;
  font-size: 0.98rem;
  line-height: 1.45;
  color: var(--cab-text);
  background: rgba(10, 13, 18, 0.74);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  border-top: 2px solid var(--cab-lamp);
  border-radius: 0.7rem;
  text-shadow: 0 0.06rem 0.4rem rgba(0, 0, 0, 0.8);
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 1.6rem), transparent);
  mask-image: linear-gradient(180deg, #000 calc(100% - 1.6rem), transparent);
  cursor: pointer;
}
.avatar-intro::-webkit-scrollbar { display: none; }
.avatar-intro p { margin: 0 0 0.6rem; }
.avatar-intro p:last-child { margin-bottom: 0; }
.avatar-intro-close {
  float: right;
  margin: -0.3rem -0.3rem 0.3rem 0.6rem;
  padding: 0.2rem 0.65rem;
  background: none;
  border: 1px solid rgba(169, 164, 155, 0.5);
  border-radius: 1rem;
  color: var(--cab-dim);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.avatar-intro-close:hover, .avatar-intro-close:focus-visible { color: var(--cab-text); border-color: var(--cab-text); outline: none; }

/* THE PANEL: a cabin wall plate that hugs its content, centred beside
 * the figure; its top corners cut like the window's */
.avatar-form {
  position: relative;
  align-self: center;
  flex: 0 1 20rem;
  min-width: 16rem;
  max-height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.1rem 1.1rem 1rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* a FROSTED, almost transparent plate, no outline (owner, 2026-09-28):
   * the cabin shows through a blur and a whisper of slate; the window
   * shape's top cuts, no rim - cut in the cabin language block */
}
}
.avatar-field { display: flex; flex-direction: column; gap: 0.45rem; }
.avatar-field-label {
  font-size: 0.66rem;
  color: var(--cab-dim);
  text-transform: uppercase;
  letter-spacing: 0.22em;
}
/* THE NAME NUDGE: Start mining with nothing typed points at the window */
.avatar-nudge {
  position: relative;
  display: block;
  margin-top: 0.6rem;
  padding: 0.55rem 0.8rem;
  /* READABLE (owner, 2026-10-08: "not easy to read on the eyes"): the
   * panel's own sans at body size, dark on the plate, room between lines */
  font-family: Roboto, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
  color: #0b0703;
  background: #f6dcb2;
  text-shadow: none; /* the panel's glow is for light lettering; here it smears */
  -webkit-font-smoothing: antialiased;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  animation: nudge-in 260ms ease-out;
}
.avatar-nudge::before {
  content: "";
  position: absolute;
  left: 1.1rem;
  top: -0.45rem;
  border: 0.45rem solid transparent;
  border-top: 0;
  border-bottom-color: #f6dcb2;
}
.avatar-nudge[hidden] { display: none; }
.avatar-window.needs-name { animation: needs-name 900ms ease-in-out 3; }
/* THE SLIDER NUDGE (owner, 2026-10-08): Go to work with the slider
 * untouched lights it and its label */
.avatar-field.needs-exp .avatar-field-label { color: var(--cab-lamp); }
.avatar-field.needs-exp input[type="range"] { animation: needs-exp 900ms ease-in-out 3; }
@keyframes needs-exp {
  0%, 100% { filter: none; }
  50% { filter: drop-shadow(0 0 0.5rem var(--cab-lamp)) brightness(1.5); }
}
@keyframes nudge-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
@keyframes needs-name {
  0%, 100% { background: var(--cab-lip-grad); }
  50% { background: var(--cab-lip-lit); }
}
.avatar-hidden-value {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.avatar-form input[type="text"] {
  font: inherit;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  padding: 0.55rem 0.9rem;
  min-height: 2.5rem;
}
.avatar-form input[type="text"]:focus { outline: none; }
.avatar-form input[type="text"]::placeholder { color: var(--cab-dim); opacity: 0.7; }

/* pills: the sex and the background; the chosen one is a window LIT from
 * inside - a warm glow behind its glass, a warmer lip, lamp-coloured text */
.avatar-pills { display: flex; flex-wrap: wrap; gap: 0.45rem; }
[data-avatar-pills="background"] .avatar-pill { flex: 1 1 calc(50% - 0.25rem); }
.avatar-pill {
  flex: 1 1 auto;
  min-height: 2.3rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  color: var(--cab-dim);
  transition: color 0.18s, background 0.18s;
}
.avatar-pill:hover { color: var(--cab-text); }
.avatar-pill.on {
  color: var(--cab-lamp);
  background: linear-gradient(180deg, rgba(242, 207, 159, 0.9), rgba(185, 133, 63, 0.65) 55%, rgba(110, 78, 34, 0.75));
}
.avatar-pill.on::after {
  background:
    radial-gradient(ellipse 80% 90% at 50% 0%, rgba(242, 207, 159, 0.34), rgba(242, 207, 159, 0.04) 70%),
    linear-gradient(180deg, #1c1a16, #0f0e0c 75%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 236, 200, 0.18);
}
.avatar-pill:focus-visible { outline: none; color: var(--cab-text); }
.avatar-pill:focus-visible::after { box-shadow: inset 0 0 0 1px var(--cab-status); }
.avatar-bg-desc { margin: -0.1rem 0 0; font-size: 0.92rem; color: var(--cab-text); min-height: 1.2em; letter-spacing: 0.01em; }
/* badges: earned ones lit, the rest waiting - nothing here is a button */
.avatar-pill[aria-disabled="true"] { cursor: default; }
.avatar-pill[aria-disabled="true"]:not(.on) { color: rgba(169, 164, 155, 0.55); }
.avatar-pill[aria-disabled="true"]:not(.on):hover { color: rgba(169, 164, 155, 0.55); }

/* the experience slider: a hairline track, the stop dots, the tier's name */
.avatar-exp-line { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; }
.avatar-exp-name {
  color: var(--cab-lamp);
  font-family: Roboto, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  text-align: right;
}
.avatar-form input[type="range"] {
  width: 100%;
  margin: 0.15rem 0 0;
  accent-color: var(--cab-lamp);
  min-height: 1.6rem;
}
.avatar-ticks {
  display: flex;
  justify-content: space-between;
  padding: 0 0.45rem;
  margin-top: -0.25rem;
}
.avatar-ticks i {
  width: 0.28rem;
  height: 0.28rem;
  border-radius: 50%;
  background: rgba(214, 218, 222, 0.35);
}

/* THE RECORD: six tiles, glyph over number over label; an empty stat
 * is the glyph alone, dimmed, with a dash - the look of having nothing
 * yet; with play the numbers arrive and the glyph brightens */
.avatar-record { display: flex; flex-direction: column; gap: 0.5rem; }
/* THE SUPPLY DEPOT's door sits on the record's own line: no height spent */
.avatar-record-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.avatar-store-btn { flex: 0 0 auto; min-height: 1.9rem; padding: 0.25rem 0.8rem; font-size: 0.78rem; }
.avatar-record-doors { display: flex; gap: 0.4rem; }

/* THE DIARY (js/ui/diary.js): pages in the dossier's serif, newest first */
.diary-card { width: min(46rem, 94vw); }
.diary-list { display: flex; flex-direction: column; gap: 1rem; }
.diary-page {
  padding: 0.9rem 1rem 1rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border-left: 2px solid var(--cab-lamp);
  font-family: Georgia, "Times New Roman", "Noto Serif", serif;
  text-align: left;
}
.diary-page h3 { margin: 0; font-family: Roboto, "Segoe UI", system-ui, -apple-system, sans-serif; font-size: 0.95rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cab-lamp); }
.diary-where { margin: 0.15rem 0 0.6rem; font-size: 0.9rem; color: var(--cab-dim); letter-spacing: 0.04em; }
.diary-page p { margin: 0 0 0.55rem; font-size: 0.95rem; line-height: 1.45; }
.diary-page p:last-child { margin-bottom: 0; }
.diary-sign { color: var(--cab-dim); font-style: italic; }
.avatar-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}
.avatar-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.55rem 0.3rem 0.45rem;
  clip-path: var(--cab-window);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 40%), rgba(10, 13, 18, 0.45);
  text-align: center;
}
.avatar-stat-icon { width: 1.35rem; height: 1.35rem; color: var(--cab-lamp); display: block; }
.avatar-stat-icon svg { width: 100%; height: 100%; fill: currentColor; }
.avatar-stat-value {
  font-family: Roboto, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 1.05rem;
  color: var(--cab-text);
  letter-spacing: 0.03em;
  line-height: 1.1;
}
.avatar-stat-label { font-size: 0.68rem; color: var(--cab-dim); text-transform: uppercase; letter-spacing: 0.12em; }
.avatar-stat.empty .avatar-stat-icon { color: rgba(214, 218, 222, 0.28); }
.avatar-stat.empty .avatar-stat-value { color: rgba(214, 218, 222, 0.35); }

/* the way on: the LAUNCH window (cabin language block), filling the panel */
.avatar-continue.btn-launch {
  margin-top: 0.4rem;
  width: 100%;
  padding: 0.95rem 2rem;
}

/* PORTRAIT: one thumb-scrollable page, the figure about half the height */
@media (orientation: portrait) {
  .avatar-shell { overflow-y: auto; height: auto; min-height: 100%; }
  .avatar-layout { flex-direction: column; gap: 0.8rem; }
  .avatar-stage { flex: 0 0 auto; height: 50vh; min-height: 18rem; padding: 0.4rem 3.4rem 3.2rem; }
  .avatar-form { flex: 0 0 auto; align-self: stretch; overflow: visible; min-width: 0; max-height: none; }
}
/* SHORT SCREENS: drop the subtitle, compress the chrome; the panel
 * scrolls inside and Start mining stays in reach */
@media (max-height: 30rem) {
  .avatar-heading h2 { font-size: 1.05rem; }
  .avatar-shell { gap: 0.3rem; padding-top: 0.4rem; padding-bottom: 0.4rem; }
  /* as tall as its contents and centred (owner, 2026-10-15: "a massive
   * amount of empty space at the bottom and at the same time placed so
   * high up"); taller than the screen, it scrolls inside as before */
  .avatar-form { gap: 0.55rem; padding: 0.7rem 0.9rem; align-self: center; max-height: 100%; }
  .avatar-continue.btn-launch { position: sticky; bottom: 0; margin-top: auto; }
  .avatar-stage { padding-bottom: 2.6rem; }
  .avatar-charname { font-size: 0.9rem; }
}
@media (prefers-reduced-motion: reduce) {
  .avatar-figure.alive, .avatar-figure.alive .avatar-body { animation: none; }
  .avatar-stand { transition: none; }
  .avatar-body.fading .avatar-image-next { transition: none; }
}

/* ---------------- sign in (js/chain/account.js) ----------------
 * The cabin again: the same backdrop as the miner screen, the frosted
 * plate, window-shaped fields and pills. Nothing here is new material. */
#screen-signin {
  background: #0a0f16 url('img/avatar-cabin.jpg?v=390') center / cover no-repeat;
}
#screen-signin::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, rgba(3, 7, 15, 0), rgba(3, 7, 15, 0.32) 100%),
    linear-gradient(180deg, rgba(3, 7, 15, 0.38), rgba(3, 7, 15, 0) 28%, rgba(3, 7, 15, 0) 72%, rgba(3, 7, 15, 0.42));
  pointer-events: none;
}
.signin-card {
  position: relative;
  flex: 0 1 24rem;
  width: min(24rem, 92vw);
  max-height: calc(100% - 2rem);
  gap: 0.85rem;
}
.signin-card h2 {
  margin: 0;
  font-family: Roboto, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-weight: 500;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  text-align: center;
  color: var(--cab-text);
}
.signin-lede, .signin-note { margin: 0; font-size: 0.95rem; line-height: 1.45; color: var(--cab-text); }
/* the one warning that matters: no reset, no recovery */
.signin-note { color: var(--cab-lamp); }
/* THE NOTES PULSE (owner, 2026-11-16, for every app): a lamp-gold frame
 * with a small circled i, a slow pulse of a ring and a wash so the eye
 * goes to them; a tap opens the note large (account.js wireNotes). The
 * two notes beat out of step. */
.signin-pulse {
  display: block;
  position: relative;
  box-sizing: border-box;
  padding: 0.55rem 0.7rem 0.55rem 2rem;
  border: 1px solid rgba(240, 196, 92, 0.6);
  border-radius: 0.5rem;
  background: rgba(240, 196, 92, 0.07);
  cursor: pointer;
  animation: signin-pulse 2.6s ease-in-out infinite;
}
.signin-pulse:nth-of-type(2), .signin-note.signin-pulse { animation-delay: 0.9s; }
.signin-pulse::before {
  content: "i";
  position: absolute;
  left: 0.6rem;
  top: 0.6rem;
  width: 1rem;
  height: 1rem;
  border: 1px solid var(--cab-lamp);
  border-radius: 50%;
  font: italic 700 0.7rem/1rem Georgia, serif;
  text-align: center;
  color: var(--cab-lamp);
}
.signin-pulse:hover, .signin-pulse:focus-visible { outline: none; border-color: var(--cab-lamp); }
@keyframes signin-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(240, 196, 92, 0.45); background: rgba(240, 196, 92, 0.07); }
  50% { box-shadow: 0 0 0 5px rgba(240, 196, 92, 0); background: rgba(240, 196, 92, 0.2); }
}
@media (prefers-reduced-motion: reduce) {
  .signin-pulse { animation: none; background: rgba(240, 196, 92, 0.14); }
}
/* the note, large */
.signin-note-big { font-size: clamp(1.1rem, 4.6vw, 1.3rem); line-height: 1.5; text-align: left; color: var(--cab-text); }
.signin-toggle { display: flex; gap: 0.45rem; }
.signin-toggle .avatar-pill { flex: 1 1 0; }
.signin-pw { position: relative; }
.signin-card input[type="text"], .signin-card input[type="password"], .signin-card textarea {
  width: 100%;
  box-sizing: border-box;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--cab-text);
  font: inherit;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  padding: 0.55rem 0.9rem;
  min-height: 2.5rem;
  clip-path: var(--cab-window);
}
.signin-pw input { padding-right: 2.7rem; }
.signin-card textarea { resize: vertical; line-height: 1.4; }
.signin-card input:focus, .signin-card textarea:focus { outline: none; }
.signin-card input::placeholder, .signin-card textarea::placeholder { color: var(--cab-dim); opacity: 0.7; }
.signin-card input.err { box-shadow: inset 0 0 0 1px var(--alarm); }
.signin-eye {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  padding: 0.35rem;
  border: 0;
  background: none;
  color: var(--cab-dim);
  cursor: pointer;
}
.signin-eye svg { width: 100%; height: 100%; display: block; }
/* Edge draws its own reveal-password eye inside every password box, so
 * on the Xbox two eyes sat side by side (owner, 2026-10-10: "there seems
 * to be 2 eye icons, how come?"). The game's eye is the one. */
.signin-pw input::-ms-reveal, .signin-pw input::-ms-clear { display: none; }
.signin-eye .eye-off, .signin-eye.on .eye-on { display: none; }
.signin-eye.on .eye-off { display: block; }
.signin-eye:hover, .signin-eye.on { color: var(--cab-lamp); }
.avatar-field[hidden] { display: none; }
.signin-advanced[hidden] { display: none; }
.signin-err { margin: 0; font-size: 0.82rem; line-height: 1.4; color: var(--alarm); }
/* THE CASE BOX UNDER THE USERNAME (owner, 2026-10-21): it belongs to the
 * window above it, so it hangs close under it and the card's full gap
 * falls before the password label */
.signin-strict { margin-top: -0.4rem; line-height: 1.4; color: var(--cab-text); }
/* THE CARD SCROLLS, ITS ROWS DO NOT SHRINK (owner's photo, 2026-10-10:
 * "Performing proof of work... 20% - 15s" on the button cut to one line
 * on the Xbox): the card is a column with a ceiling, and a column's
 * children shrink to fit it - the busy button, two lines of text, was
 * squeezed to its one-line floor. Rows keep their size; the card
 * scrolls when the screen is short. */
.signin-card > * { flex-shrink: 0; }
.signin-go { width: 100%; }
/* the busy word is a sentence, not a title: plain case, light tracking,
 * so it fits one line, and a long one wraps whole */
.signin-go.busy { opacity: 0.85; cursor: progress; text-transform: none; letter-spacing: 0.04em; font-size: 0.98rem; padding-left: 1.4rem; padding-right: 1.4rem; line-height: 1.3; }
.signin-link {
  align-self: center;
  padding: 0;
  border: 0;
  background: none;
  color: var(--cab-status);
  font: inherit;
  font-size: 0.78rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.signin-advanced { display: flex; flex-direction: column; gap: 0.7rem; }
.signin-back {
  position: absolute;
  top: calc(0.8rem + env(safe-area-inset-top));
  left: calc(0.8rem + env(safe-area-inset-left));
  min-height: 2.2rem;
  padding: 0.4rem 0.9rem;
}
/* the account line on the miner screen */
.avatar-account { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem; }
/* THE MODE BUTTONS (docs/CAMPAIGN-SPEC.md 3): two pills, the current pressed */
.avatar-modes { display: flex; gap: 0.4rem; flex: 1 1 auto; }
.avatar-modes[hidden] { display: none; }
.avatar-modes .avatar-pill { flex: 1 1 0; }
/* THE MODE POPUP: two cards side by side; stacked on a phone */
.modal:has(.mode-cards) { width: min(44rem, 94vw); }
.mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; text-align: left; }
.mode-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.9rem 1rem 1rem;
  border: 1px solid var(--panel-edge);
  border-radius: 0.6rem;
  background: rgba(0, 0, 0, 0.18);
}
.mode-card h3 { margin: 0; font-size: 1.15rem; letter-spacing: 0.04em; }
.mode-card .modal-body { flex: 1 1 auto; }
.mode-card .btn-act, .mode-card .btn-quiet { align-self: stretch; }
@media (max-width: 40rem) {
  .mode-cards { grid-template-columns: 1fr; }
}
/* THE CAMPAIGN on the card: Control's line where Drop in would be */
.galaxy-notthis { grid-area: go; justify-self: center; margin: 0; color: var(--cab-lamp); font-size: 1rem; text-align: center; }
.galaxy-notthis[hidden] { display: none; }
.avatar-account-btn { flex: 0 0 auto; min-height: 2.1rem; padding: 0.35rem 0.9rem; font-size: 0.82rem; }
/* the modals' prose and the one active tap */
.modal-body { margin: 0; font-size: 1rem; line-height: 1.45; color: var(--cab-text); }
.modal-check { display: flex; gap: 0.5rem; align-items: flex-start; text-align: left; font-size: 0.95rem; }
/* PLAY WITHOUT AN ACCOUNT (js/guest.js): the work's meter and counter;
 * the interstitial's one-level note */
.guest-meter { width: 100%; height: 0.8rem; accent-color: var(--cab-lamp); }
.guest-count { margin: -0.5rem 0 0; font-size: 1rem; color: var(--cab-lamp); font-variant-numeric: tabular-nums; }
.inter-note { margin: 0; font-size: 1rem; line-height: 1.4; color: var(--cab-lamp); }
.modal-check input { width: 1.1em; height: 1.1em; margin-top: 0.15em; accent-color: var(--cab-lamp); }

/* ---------------- THE ASSAY OFFICE (js/ui/store.js) ----------------
 * The house counter: cards on a shelf. Hidden entries are not drawn at
 * all (owner, 2026-10-06) - the lede says how many more exist. */
/* THE DEPOT'S OWN PAINTING (owner, 2026-10-09: "a nice background image
 * of a place where there's all sorts of things"; docs/art-briefs/
 * STORE-DEPOT.md, GPT paints it): img/depot.jpg over the title sky,
 * which shows through until the painting is there */
#screen-store {
  background: #03070f url('img/depot.jpg') center / cover no-repeat, #03070f url('img/title-bg-wide.png') center / cover no-repeat;
}
@media (orientation: portrait) {
  #screen-store { background-image: url('img/depot-portrait.jpg'), url('img/title-bg-portrait.png'); }
}
.store-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  width: min(60rem, 94vw);
  max-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.3rem 1.3rem 1.2rem;
}
.store-card h2 { margin: 0; font-size: 1.25rem; text-align: center; }
.store-lede { margin: 0; text-align: center; color: var(--cab-text); font-size: 1rem; }
.store-lede:empty { display: none; }
.store-note { margin: 0; text-align: center; font-size: 1rem; }
.store-note[hidden] { display: none; }
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.8rem;
}
.store-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.8rem 0.9rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.store-item h3 { margin: 0; font-size: 1rem; }
.store-desc { margin: 0; font-size: 0.86rem; color: var(--cab-dim); flex: 1; }
.store-meta { margin: 0; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--cab-dim); }
.store-price { margin: 0; font-size: 1.05rem; display: flex; align-items: center; gap: 0.5rem; }
.store-token {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  color: #0c1a16;
  background: #7fe3d2;
  text-shadow: none;
}
.store-buy { width: 100%; }
/* the icon (img/gear/<id>.png, GPT) and the locked shelf */
.store-icon { width: 3.2rem; height: 3.2rem; object-fit: contain; align-self: center; }
.store-locked { opacity: 0.72; }
.store-locked .store-icon { filter: grayscale(0.6); }
.store-how { margin: 0; font-size: 0.95rem; line-height: 1.35; color: var(--cab-lamp); }
.store-card .btn-quiet { width: 100%; }

/* THE GEAR on the fee popup: tick boxes for what is held */
.fee-gear { text-align: left; }
.fee-gear[hidden] { display: none; }
.fee-gear-list { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.3rem; }
.fee-gear-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; }

/* DUEL PLANETS: the card's warning, and the fee popup's */
.galaxy-duel {
  margin: 0.2rem 0 0;
  padding: 0.3rem 0.6rem;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  color: #ffd9d4;
  background: rgba(214, 72, 60, 0.22);
  border-left: 3px solid #e0564a;
  border-radius: 3px;
}
.galaxy-duel[hidden] { display: none; }
.fee-duel { color: #ffd9d4; }
.fee-duel[hidden] { display: none; }

/* THE RAISE on the fee popup */
.fee-raise { text-align: left; }
.fee-raise[hidden] { display: none; }
.fee-raise-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; }
.fee-raise-slide { margin-top: 0.3rem; }
.fee-raise-slide[hidden] { display: none; }
.fee-raise-slide input[type="range"] { width: 100%; }

/* THE DUEL (docs/CHALLENGE-SPEC.md 5-6; js/ui/duel.js): the warning over
 * the mine, and the two fight meters - yours blue, theirs red */
.duel-banner {
  position: absolute;
  left: 50%;
  top: 32%;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.5rem 1.1rem;
  max-width: 90vw;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  text-align: center;
  color: #ffe3df;
  background: rgba(120, 20, 16, 0.78);
  border: 1px solid #e0564a;
  border-radius: 4px;
  z-index: 3;
  pointer-events: none;
}
.duel-banner[hidden] { display: none; }
.duel-meters {
  position: absolute;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  gap: 1.2rem;
  z-index: 3;
  pointer-events: none;
}
.duel-meters[hidden] { display: none; }
.duel-meter { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: #e8eef6; }
.duel-meter-name { min-width: 3.5rem; max-width: 7rem; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duel-track { display: inline-block; width: 7rem; height: 0.6rem; background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 2px; overflow: hidden; }
.duel-fill { display: block; height: 100%; width: 100%; background: #3fe0ff; transition: width 0.15s linear; }
.duel-meter-other .duel-fill { background: #ff5a4a; }
.duel-meter-val { min-width: 2rem; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .duel-track { width: 4.5rem; }
  .duel-meter-name { min-width: 2.5rem; max-width: 4.5rem; }
  .duel-banner { font-size: 0.95rem; top: 28%; }
}
/* a power slot wears its name above its count (the jet pack) */
.power-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1rem; }
.power-label { font-size: 0.6rem; letter-spacing: 0.04em; text-transform: uppercase; }

/* BIG BUT SHORT (the owner's Xbox, 2026-10-07: a 1280x720 screen that the
 * console's browser hands the page as 1152 x 567 CSS px - "the panels for
 * selecting things are cut off and need scrolling - that shouldn't be
 * necessary when there's so much screen available"): a landscape viewport
 * at least 60rem wide and under 48rem tall. The root font follows the
 * height (never under 13px), and the miner panel and the planet card take
 * a compact layout, so everything is on the screen with nothing to scroll.
 * A phone in landscape is narrower than 60rem and keeps its own rules.
 * (2026-10-09: the same console in TRUE FULL SCREEN hands the page
 * 1280 x 720 CSS px - the owner's photo of the miner panel cut above "Go
 * to work" - so the tier reaches to 48rem, which also takes in a
 * 1366 x 768 laptop in full screen, where the panel scrolled by a line.) */
@media (min-width: 60rem) and (max-height: 48rem) and (orientation: landscape) {
  html { font-size: calc(clamp(13px, 2.5vh, 16px) * var(--text-scale)); }
  /* the miner screen: the record in one row, the hints gone, tight gaps */
  .avatar-heading h2 { font-size: 1.1rem; }
  .avatar-shell { gap: 0.3rem; padding-top: 0.5rem; padding-bottom: 0.5rem; }
  .avatar-form { gap: 0.5rem; padding: 0.7rem 0.9rem; align-self: center; max-height: 100%; flex-basis: 25rem; }
  .avatar-field { gap: 0.3rem; }
  .avatar-record { gap: 0.3rem; }
  .avatar-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.3rem; }
  .avatar-stat { padding: 0.35rem 0.1rem 0.3rem; gap: 0.1rem; }
  .avatar-stat-icon { width: 1.1rem; height: 1.1rem; }
  .avatar-stat-value { font-size: 0.95rem; }
  .avatar-stat-label { font-size: 0.6rem; letter-spacing: 0.08em; }
  .avatar-account { gap: 0.4rem; }
  .avatar-continue.btn-launch { margin-top: 0; }
  .avatar-stage { padding-bottom: 2.4rem; }
  /* the planet card: a little higher, a little tighter */
  .galaxy-card { top: 37%; max-height: calc(63% - 1.2rem - env(safe-area-inset-bottom)); width: min(62rem, 92vw); padding: 0.8rem 1.1rem 0.9rem; row-gap: 0.5rem; }
  .galaxy-lede, .galaxy-block p { max-width: none; }
  .galaxy-name { font-size: 1.25rem; }
  .galaxy-lede { font-size: 0.95rem; }
  .galaxy-block p { font-size: 0.88rem; }
}
.setting-row[hidden] { display: none; } /* the Screen row, where the device cannot turn (v370) */

/* BACK TO FULL SCREEN (js/ui/fsRestore.js; owner, 2026-10-13): a small
 * square of four corner marks, top right, just below the corner so it
 * never sits on the menu button or Cash out */
.fs-restore {
  position: fixed;
  z-index: 60;
  top: calc(4.4rem + env(safe-area-inset-top));
  right: calc(1rem + env(safe-area-inset-right));
  width: 2.6rem;
  height: 2.6rem;
  min-height: 0;
  padding: 0;
  border-radius: 0.6rem;
  border: 1px solid rgba(242, 207, 159, 0.55);
  background: rgba(6, 10, 20, 0.82);
  box-shadow: 0 0 0.8rem rgba(255, 210, 120, 0.25);
  cursor: pointer;
}
.fs-restore[hidden] { display: none; }
.fs-restore span {
  position: absolute;
  inset: 0.6rem;
  background:
    linear-gradient(var(--cab-lamp), var(--cab-lamp)) left top / 0.55rem 2px no-repeat,
    linear-gradient(var(--cab-lamp), var(--cab-lamp)) left top / 2px 0.55rem no-repeat,
    linear-gradient(var(--cab-lamp), var(--cab-lamp)) right top / 0.55rem 2px no-repeat,
    linear-gradient(var(--cab-lamp), var(--cab-lamp)) right top / 2px 0.55rem no-repeat,
    linear-gradient(var(--cab-lamp), var(--cab-lamp)) left bottom / 0.55rem 2px no-repeat,
    linear-gradient(var(--cab-lamp), var(--cab-lamp)) left bottom / 2px 0.55rem no-repeat,
    linear-gradient(var(--cab-lamp), var(--cab-lamp)) right bottom / 0.55rem 2px no-repeat,
    linear-gradient(var(--cab-lamp), var(--cab-lamp)) right bottom / 2px 0.55rem no-repeat;
}

/* NO MONEY WITHOUT AN ACCOUNT (owner, 2026-10-13): a guest's run shows no
 * pot, surface or hose money, no pot on the cleared screen and no money
 * rows in the cash-out popup - nothing is earned without an account */
body.guest-run .hud [data-panel="pot"],
body.guest-run .hud [data-panel="surface"],
body.guest-run .hud [data-panel="transit"],
body.guest-run .inter-money,
body.guest-run .cash-rows { display: none; }
