/* Z3RSim lobby: the "Atlas" look. Paper and ink, one Triforce gold.
   Everything here is scoped to .lobby (the #view-menu element) or to
   body.lobby-on (set by showView while the menu is up), so none of it reaches
   the game, the win screen or the editor, which keep style.css's dark theme.
   The palette is re-declared on .lobby so style.css's shared helpers that read
   variables (.muted, .sr-only) come out right here without extra rules. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("assets/fonts/inter-var.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 600; font-display: swap; src: url("assets/fonts/fraunces-600.woff2") format("woff2"); }

.lobby {
  --paper: #F4EFE6;
  --paper-deep: #ECE5D7;
  --panel: #FFFDF8;
  --inset: #F8F4EC;
  --hair: #E4DDCF;
  --hair-strong: #D3CAB8;
  --ink: #1B1A17;
  --ink-2: #3A372F;
  --muted: #6B665C;
  --gold: #B8901F;
  --gold-hover: #A88318;
  --gold-soft: #F4E8C6;
  --gold-ink: #6E5410;
  --moss: #3B7149;
  --rust: #9A3B1E;
  --rust-soft: #F8E7DF;
  --rust-ink: #6E2812;
  --on-accent: #1B1A17;
  --accent: var(--gold);
  --accent-hover: var(--gold-hover);
  --accent-soft: var(--gold-soft);
  --ring: #8A6A10;
  --control: var(--panel);
  --raised: var(--panel);
  --placeholder: #6E695F;
  --disabled-ink: #B3AB9B;
  --option-off: #9A9285;
  --switch-off: #CFC6B4;
  --switch-knob: #fff;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 7.5l5 5 5-5' fill='none' stroke='%236B665C' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  color-scheme: light;

  --r-panel: 14px;
  --r-ctl: 12px;
  --r-chip: 999px;
  --shadow-panel: 0 1px 1px rgba(60, 45, 20, .05), 0 2px 6px rgba(60, 45, 20, .06);
  --shadow-thumb: 0 1px 2px rgba(60, 45, 20, .12), 0 2px 6px rgba(60, 45, 20, .06);
  --shadow-accent: 0 1px 2px rgba(80, 60, 10, .25), 0 3px 8px rgba(120, 90, 20, .18);
  --shadow-dock: 0 -4px 16px rgba(60, 45, 20, .08);
  --shadow-knob: 0 1px 3px rgba(0, 0, 0, .2);

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-title: "Fraunces", Georgia, serif;
  --font-mono: "DM Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* Dark: the same Atlas page after sundown. Warm umber surfaces, one gold, no
   glow. The <html data-theme> attribute is set by the inline script in
   index.html's <head> before first paint (saved choice, else the system's),
   and only the lobby reads it; the game is dark in both themes.
   Elevation runs page < inset < panel < control < raised. */
:root[data-theme="dark"] .lobby {
  --paper: #15130F;
  --paper-deep: #171410;
  --panel: #1E1B16;
  --inset: #191712;
  --hair: #332E25;
  --hair-strong: #7A6F5C;
  --ink: #EFE8DA;
  --ink-2: #D3CBBB;
  --muted: #A89F8D;
  --gold: #D4AA3A;
  --gold-hover: #DFB84F;
  --gold-soft: #3A3120;
  --gold-ink: #E6C462;
  --moss: #7DB38B;
  --rust: #E58A73;
  --rust-soft: #3A221B;
  --rust-ink: #F4C3B5;
  --on-accent: #1B1A17;
  --ring: #E6C462;
  --control: #26221B;
  --raised: #37322A;
  --placeholder: #958C7B;
  --disabled-ink: #5E574A;
  --option-off: #7A7264;
  --switch-off: #7A6F5C;
  --switch-knob: #F1EBDF;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 7.5l5 5 5-5' fill='none' stroke='%23A89F8D' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --shadow-panel: 0 1px 2px rgba(0, 0, 0, .28);
  --shadow-thumb: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-accent: 0 1px 2px rgba(0, 0, 0, .45);
  --shadow-dock: 0 -6px 18px rgba(0, 0, 0, .35);
  --shadow-knob: 0 1px 3px rgba(0, 0, 0, .45);
  color-scheme: dark;
}
:root[data-theme="dark"] body.lobby-on { background: #15130F; }
/* a theme change lands all at once, not control by control */
:root.theme-swap .lobby *, :root.theme-swap .lobby *::before, :root.theme-swap .lobby *::after { transition: none !important; }
:root[data-theme="dark"]:has(body.lobby-on) { color-scheme: dark; }
/* a locked travel card's picture sits further back on umber */
:root[data-theme="dark"] .lobby .tcard.locked img { opacity: .35; }

/* the page behind the lobby; the aurora and the game's header are the game's */
body.lobby-on { background: #F4EFE6; }
body.lobby-on .bg-blobs, body.lobby-on .bg-noise, body.lobby-on #topbar { display: none; }
html:has(body.lobby-on) { scroll-behavior: smooth; scroll-padding-top: 72px; }

/* style.css lays every .view out as a padded flex column; the lobby is a page */
#view-menu.lobby {
  display: block; max-width: none; margin: 0; padding: 0; gap: 0;
  background: var(--paper); color: var(--ink);
  font: 400 16px/1.5 var(--font-body); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  min-height: 100vh;
}
.lobby ::selection { background: var(--accent-soft); color: var(--ink); }
.lobby h1, .lobby h2, .lobby h3, .lobby h4 { font-family: var(--font-body); color: var(--ink); }
.lobby input, .lobby select, .lobby button { font: inherit; color: inherit; }
.lobby button { cursor: pointer; }
.lobby button:disabled { cursor: not-allowed; }
.lobby a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--hair-strong); text-underline-offset: 3px; }
.lobby a:hover { text-decoration-color: currentColor; }
.lobby :focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
.lobby p, .lobby li, .lobby dd { text-wrap: pretty; }
.lobby .num { font-variant-numeric: tabular-nums; }
.lobby .hash { font-family: var(--font-mono); font-size: .94em; letter-spacing: 0; }
.lobby cite { font-style: italic; }
.lobby .ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- top bar */
.lobby .ltop { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 94%, transparent); border-bottom: 1px solid var(--hair); }
.lobby .ltop-in { max-width: 1120px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.lobby .lbrand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px; }
.lobby .lmark { width: 22px; height: 22px; fill: var(--gold); }
.lobby .lbrand-name { font-weight: 600; font-size: 18px; letter-spacing: -.01em; font-family: var(--font-body); }
.lobby .ltopnav { display: flex; gap: 4px; }
.lobby .ltopnav a, .lobby .ltopnav button {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: none;
  text-decoration: none; font-weight: 500; font-size: 15px; color: var(--ink-2);
}
.lobby .ltopnav a:hover, .lobby .ltopnav button:hover { background: var(--paper-deep); color: var(--ink); }

/* theme switch: Auto / Light / Dark on a wide screen; one icon that cycles on a phone */
.lobby .ltopnav { margin-left: auto; }
.lobby .theme { display: flex; gap: 2px; padding: 2px; border-radius: 12px; background: var(--paper-deep); }
.lobby .theme > button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 0 10px;
  border: 0; border-radius: 10px; background: none; font-weight: 500; font-size: 14px; color: var(--muted);
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.lobby .theme > button:hover:not([aria-pressed="true"]) { color: var(--ink); }
.lobby .theme > button[aria-pressed="true"] { background: var(--raised); color: var(--ink); box-shadow: var(--shadow-thumb); }
.lobby .theme .ic { width: 17px; height: 17px; }

/* ---------------------------------------------------------------- page */
.lobby .lpage { max-width: 1120px; margin: 0 auto; padding: 48px 24px 64px; }
.lobby .intro { max-width: 640px; margin-bottom: 28px; }
.lobby .intro h1 { font: 600 clamp(32px, 4.2vw, 46px)/1.08 var(--font-title); letter-spacing: -.012em; margin: 0 0 12px; text-wrap: balance; font-variation-settings: "opsz" 96; }
.lobby .intro p { margin: 0; color: var(--muted); font-size: 17px; max-width: 54ch; }
.lobby .llayout { display: grid; grid-template-columns: minmax(0, 660px) minmax(0, 300px); gap: 56px; align-items: start; }

.lobby .lpanel { background: var(--panel); border: 1px solid var(--hair); border-radius: var(--r-panel); box-shadow: var(--shadow-panel); }
.lobby .setup { padding: 20px 24px 8px; }

/* ---------------------------------------------------------------- source control */
.lobby .source-bar { display: flex; gap: 12px; align-items: stretch; }
.lobby .seg { display: flex; background: var(--paper-deep); border-radius: var(--r-ctl); padding: 3px; gap: 2px; }
.lobby .source-bar .seg { flex: 1; }
.lobby .seg > button {
  flex: 1; min-height: 44px; padding: 0 14px; border: 0; border-radius: calc(var(--r-ctl) - 3px); background: transparent;
  font-weight: 500; font-size: 15px; color: var(--ink-2); white-space: nowrap;
  transition: background-color .18s var(--ease), box-shadow .18s var(--ease), color .18s var(--ease);
}
.lobby .seg > button:hover:not(.on) { color: var(--ink); background: color-mix(in srgb, var(--raised) 45%, transparent); }
.lobby .seg > button.on { background: var(--raised); color: var(--ink); box-shadow: var(--shadow-thumb); font-weight: 600; }
.lobby .seg-link {
  display: inline-flex; align-items: center; gap: 7px; min-height: 50px; padding: 0 18px;
  border: 1px solid var(--hair-strong); border-radius: var(--r-ctl); background: transparent; font-weight: 500; font-size: 15px; color: var(--ink-2);
  transition: border-color .18s var(--ease), background-color .18s var(--ease);
}
.lobby .seg-link:hover { border-color: var(--ink-2); color: var(--ink); }
.lobby .seg-link.on { background: var(--raised); border-color: var(--ink); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-thumb); }
.lobby .source-explain { margin: 10px 2px 0; color: var(--muted); font-size: 15px; min-height: 1.5em; }

.lobby .source-body { padding-top: 18px; display: grid; gap: 18px; }
.lobby .source-body > .rules-slot:empty { display: none; }

/* ---------------------------------------------------------------- buttons */
.lobby .btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; min-width: 180px; padding: 0 28px;
  border: 0; border-radius: var(--r-ctl); background: var(--accent); color: var(--on-accent);
  font-weight: 600; font-size: 17px; letter-spacing: -.005em;
  box-shadow: var(--shadow-accent);
  transition: background-color .15s var(--ease), transform .15s var(--ease);
}
.lobby .btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.lobby .btn-primary:active:not(:disabled) { transform: translateY(1px); }
.lobby .btn-primary:disabled { background: var(--hair); color: var(--muted); box-shadow: none; }
/* busy: a seed is being rolled or fetched; the label says which */
.lobby .btn-primary.busy:disabled { background: var(--gold-soft); color: var(--gold-ink); cursor: progress; }
.lobby .btn-primary.busy::after {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--gold-ink) 30%, transparent); border-top-color: var(--gold-ink);
  animation: lobby-spin .8s linear infinite;
}
@keyframes lobby-spin { to { transform: rotate(360deg); } }
.lobby .btn-quiet {
  min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--hair-strong); background: var(--control);
  font-weight: 500; font-size: 15px; color: var(--ink);
}
.lobby .btn-quiet:hover { border-color: var(--ink-2); }
.lobby .btn-quiet.danger { color: var(--rust); border-color: color-mix(in srgb, var(--rust) 40%, var(--hair)); }
.lobby .btn-text, .lobby .btn-link, .lobby .linkish {
  min-height: 44px; padding: 0 4px; border: 0; background: none; font-weight: 500; font-size: 15px; color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--hair-strong); text-underline-offset: 4px;
}
.lobby .btn-text:hover, .lobby .btn-link:hover, .lobby .linkish:hover { text-decoration-color: currentColor; }
.lobby .btn-link { justify-self: start; }

/* ---------------------------------------------------------------- fields */
.lobby .field { display: grid; gap: 6px; }
.lobby .field label { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.lobby input[type="text"], .lobby input[type="search"], .lobby select {
  min-height: 46px; width: 100%; padding: 0 14px; border: 1px solid var(--hair-strong); border-radius: 10px;
  background: var(--control); color: var(--ink); font-size: 16px; font-family: var(--font-body);
}
.lobby input::placeholder { color: var(--placeholder); }
.lobby input:focus, .lobby select:focus { outline: none; }
.lobby input:focus-visible, .lobby select:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; border-color: transparent; border-radius: 10px; }
.lobby select {
  appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: var(--select-arrow);
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
.lobby select option:disabled { color: var(--option-off); }
.lobby .hint { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.lobby .hint:empty { display: none; }
.lobby .seedword { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.lobby .seedword .field { order: -1; flex: 1 0 100%; max-width: 420px; }

/* ---------------------------------------------------------------- chips */
.lobby .chip-group { display: grid; gap: 8px; }
.lobby .group-label { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink-2); letter-spacing: 0; }
.lobby .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lobby .chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: var(--r-chip);
  border: 1px solid var(--hair-strong); background: var(--control); font-size: 15px; font-weight: 500; color: var(--ink-2); white-space: nowrap;
  transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
.lobby .chip:hover { border-color: var(--ink-2); color: var(--ink); }
.lobby .chip.on, .lobby .chip.on:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; padding-left: 12px; }
.lobby .chip .ic { width: 16px; height: 16px; stroke-width: 2.2; }
.lobby .chip-custom { cursor: default; }
.lobby .chip-again { justify-self: start; }

/* ---------------------------------------------------------------- rules */
.lobby .rules { display: grid; gap: 12px; }
.lobby .rules-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 6px 6px 16px; background: var(--inset); border-radius: var(--r-ctl); }
.lobby .rules-line p { margin: 0; font-size: 15px; color: var(--ink-2); }
.lobby .rules-line p b { color: var(--ink); font-weight: 600; }
.lobby .inset { background: var(--inset); border-radius: var(--r-ctl); overflow: hidden; }
.lobby .inset-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding: 8px 8px 8px 16px; min-height: 60px; }
.lobby .inset-row + .inset-row, .lobby .inset-hint + .inset-row { border-top: 1px solid var(--hair); }
.lobby .inset-label { font-size: 15px; font-weight: 500; }
.lobby .inset-hint { margin: -6px 0 0; padding: 0 16px 10px; font-size: 14px; color: var(--muted); }
.lobby .seg-small > button { min-height: 44px; font-size: 14px; padding: 0 12px; }
.lobby .inset .seg { background: var(--paper-deep); }
.lobby .stepper { display: inline-flex; align-items: center; gap: 4px; }
.lobby .stepper button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--hair-strong); background: var(--control); display: grid; place-items: center; color: var(--ink); padding: 0; }
.lobby .stepper button:hover:not(:disabled) { border-color: var(--ink-2); }
.lobby .stepper button:disabled { color: var(--disabled-ink); border-color: var(--hair); }
.lobby .stepper output { min-width: 96px; text-align: center; font-weight: 600; font-size: 15px; }

/* ---------------------------------------------------------------- customize */
.lobby .disclosure { border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); margin: 0 -24px; padding: 0 24px; }
.lobby .disclosure-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 0; border: 0; background: none; font-weight: 600; font-size: 16px; text-align: left; }
.lobby .disclosure-head .count { font-weight: 500; color: var(--gold-ink); }
.lobby .chev { transition: transform .2s var(--ease); color: var(--muted); }
.lobby [aria-expanded="true"] > .chev { transform: rotate(180deg); }
.lobby .disclosure-body { display: grid; gap: 18px; padding: 4px 0 22px; }
.lobby .axis { display: grid; gap: 8px; }
.lobby .axis-label { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.lobby .axis-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.lobby .switch-list { background: var(--inset); border-radius: var(--r-ctl); }
.lobby .switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 12px 10px 16px; min-height: 60px; cursor: pointer; }
.lobby .switch-row + .switch-row { border-top: 1px solid var(--hair); }
.lobby .switch-row > span { display: grid; gap: 2px; }
.lobby .switch-row b { font-weight: 500; font-size: 15px; }
.lobby input[role="switch"] {
  appearance: none; -webkit-appearance: none; flex: none; width: 51px; height: 31px; border-radius: 999px; background: var(--switch-off); position: relative; margin: 0; cursor: pointer;
  transition: background-color .2s var(--ease);
}
.lobby input[role="switch"]::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: var(--switch-knob);
  box-shadow: var(--shadow-knob); transition: transform .2s var(--ease);
}
.lobby input[role="switch"]:checked { background: var(--accent); }
.lobby input[role="switch"]:checked::after { transform: translateX(20px); }
.lobby .warn { display: flex; gap: 10px; margin: 0; padding: 12px 14px; border-radius: var(--r-ctl); background: var(--rust-soft); color: var(--rust-ink); font-size: 14px; line-height: 1.45; }
.lobby .warn .ic { margin-top: 1px; }
.lobby .save-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 4px 0 14px; }
.lobby .save-row input { flex: 1; min-width: 160px; }

/* ---------------------------------------------------------------- avianart */
.lobby .search { position: relative; }
.lobby .search .ic { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.lobby .search input { padding-left: 42px; }
.lobby .av-list { position: relative; max-height: 312px; overflow: auto; border: 1px solid var(--hair); border-radius: var(--r-ctl); background: var(--panel); overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--hair-strong) transparent; }
.lobby .av-list:empty { display: none; }
.lobby .av-group h4 { position: sticky; top: 0; z-index: 1; margin: 0; padding: 8px 16px; background: var(--inset); border-bottom: 1px solid var(--hair); font-size: 13px; font-weight: 600; color: var(--muted); }
.lobby .av-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 0 16px; border: 0; border-bottom: 1px solid var(--hair); background: none; text-align: left; font-size: 15px; }
.lobby .av-group:last-child .av-row:last-child { border-bottom: 0; }
.lobby .av-row:hover:not(.on) { background: var(--inset); }
.lobby .av-row.on { background: var(--accent-soft); font-weight: 600; }
.lobby .av-row.on .ic { color: var(--gold-ink); }
.lobby .av-picked { display: grid; gap: 4px; padding: 12px 16px; background: var(--inset); border-radius: var(--r-ctl); font-size: 15px; }
.lobby .av-picked:empty { display: none; }
.lobby .av-picked span { color: var(--ink-2); font-size: 14px; }
.lobby .av-picked.bad { background: var(--rust-soft); color: var(--rust-ink); }
.lobby .empty { padding: 16px; margin: 0; color: var(--muted); font-size: 15px; }
.lobby .ro-note { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------------------------------------------------------------- link */
.lobby .recog { display: flex; gap: 8px; align-items: flex-start; margin: -8px 0 0; color: var(--muted); font-size: 14px; }
.lobby .recog.ok { color: var(--moss); font-weight: 500; }
.lobby .recog.ok .hash { color: var(--ink); }
.lobby .recog.bad { color: var(--rust); }
.lobby .recog .ic { margin-top: 1px; }
.lobby .recog .btn-link { min-height: 0; padding: 0; color: inherit; font-size: inherit; }

/* ---------------------------------------------------------------- travel */
.lobby .travel { display: grid; gap: 10px; padding-top: 22px; }
.lobby .travel-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lobby .tcard {
  display: grid; grid-template-rows: auto 1fr; padding: 0; border: 1px solid var(--hair-strong); border-radius: var(--r-ctl); background: var(--control);
  text-align: left; overflow: hidden; transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.lobby .tcard img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; image-rendering: pixelated; border-bottom: 1px solid var(--hair); }
.lobby .tcard-text { display: grid; align-content: start; gap: 2px; padding: 12px 14px 14px; font-size: 14px; color: var(--ink-2); }
.lobby .tcard-text b { font-size: 16px; font-weight: 600; color: var(--ink); }
.lobby .tcard:hover:not(.on):not(.locked) { border-color: var(--ink-2); }
.lobby .tcard.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.lobby .tcard.on .tcard-text b::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 8px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.lobby .tcard.locked { cursor: not-allowed; background: var(--inset); }
.lobby .tcard.locked img { filter: grayscale(1) contrast(.9); opacity: .45; }
.lobby .lock-reason { display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; color: var(--ink); font-weight: 500; }
.lobby .lock-reason .ic { width: 16px; height: 16px; margin-top: 2px; }
.lobby .glitch-row { background: var(--inset); border-radius: var(--r-ctl); }

/* ---------------------------------------------------------------- launch */
.lobby .launch { display: grid; gap: 14px; justify-items: start; padding: 22px 0 18px; margin-top: 22px; border-top: 1px solid var(--hair); }
.lobby .receipt { margin: 0; font-size: 16px; color: var(--ink); max-width: 58ch; }
.lobby .receipt.pending { color: var(--muted); }
.lobby .start-note { margin: -4px 0 0; color: var(--muted); font-size: 14px; }
.lobby .start-error { margin: -4px 0 0; padding: 12px 14px; border-radius: var(--r-ctl); background: var(--rust-soft); color: var(--rust-ink); font-size: 14px; line-height: 1.5; max-width: 58ch; }
.lobby .start-error .linkish { min-height: 0; padding: 0; font-size: inherit; color: inherit; }
.lobby .quiet-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; padding: 4px 0 8px; border-top: 1px solid var(--hair); font-size: 14px; }
.lobby .quiet-row .btn-text { font-size: 14px; }
.lobby .quiet-row .btn-text.stress { color: var(--rust); font-weight: 600; }
.lobby .quiet-row .btn-text.armed { color: var(--rust); }
.lobby .quiet-row > .muted { flex: 1 1 auto; text-align: right; }

/* ---------------------------------------------------------------- resume */
.lobby .resume { padding: 24px; margin-bottom: 16px; }
.lobby .resume h2 { margin: 0 0 16px; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.lobby .resume-facts { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 12px 32px; margin: 0 0 22px; }
.lobby .resume-facts dt { font-size: 13px; color: var(--muted); }
.lobby .resume-facts dd { margin: 2px 0 0; font-weight: 500; }
.lobby .resume-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lobby .newrun-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding: 0 20px; margin-bottom: 16px;
  border: 1px solid var(--hair); border-radius: var(--r-panel); background: var(--panel); font-weight: 600; font-size: 16px; color: var(--ink);
}
.lobby .newrun-toggle:hover { border-color: var(--hair-strong); }

/* ---------------------------------------------------------------- side */
.lobby .col-side { padding-top: 8px; position: sticky; top: 84px; }
.lobby .col-side h2 { margin: 0 0 14px; font-size: 18px; font-weight: 600; }
.lobby .steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: s; }
.lobby .steps li { counter-increment: s; position: relative; padding-left: 40px; font-size: 15px; color: var(--ink-2); }
.lobby .steps li::before {
  content: counter(s); position: absolute; left: 0; top: -1px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--gold-ink); font-weight: 600; font-size: 14px;
}
.lobby .steps b { display: block; color: var(--ink); font-weight: 600; }
.lobby .side-note { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--hair); font-size: 14px; color: var(--muted); }

/* ---------------------------------------------------------------- footer, dock */
.lobby .lfooter { max-width: 1120px; margin: 0 auto; padding: 24px 24px 48px; border-top: 1px solid var(--hair); color: var(--muted); font-size: 14px; }
.lobby .lfooter p { margin: 0 0 8px; max-width: 64ch; }
.lobby .lfooter a { color: var(--ink-2); }
.lobby .dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--hair);
  box-shadow: var(--shadow-dock); transform: translateY(110%); transition: transform .22s var(--ease); visibility: hidden;
}
.lobby .dock.on { transform: none; visibility: visible; }
.lobby .dock-receipt { flex: 1; margin: 0; font-size: 13px; line-height: 1.35; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lobby .dock .btn-play { min-width: 112px; min-height: 48px; width: auto; }

/* ---------------------------------------------------------------- toasts and the leaderboard over the lobby */
body.lobby-on .toast { background: #1B1A17; border-color: #1B1A17; color: #FBF8F1; font-family: "Inter", system-ui, sans-serif; font-size: 14px; border-radius: 12px; box-shadow: 0 6px 24px rgba(0, 0, 0, .18); }
body.lobby-on .toast .big { color: #E9C860; }
body.lobby-on .toast a { color: #F4E8C6; text-decoration: underline; }
body.lobby-on #modal-backdrop {
  --card: #FFFDF8; --card-edge: #E4DDCF; --ink: #1B1A17; --muted: #6B665C;
  --gold: #6E5410; --mint: #6E5410; --violet: #8A6A10; --good: #3B7149;
  background: rgba(40, 32, 18, .42); font-family: "Inter", system-ui, sans-serif; color: #1B1A17;
}
body.lobby-on #modal-backdrop .card { backdrop-filter: none; box-shadow: 0 12px 40px rgba(40, 30, 10, .2); }
body.lobby-on #modal-backdrop h3, body.lobby-on .lb-cat { font-family: "Inter", system-ui, sans-serif; font-weight: 600; }
body.lobby-on .lb-filters select { background: #FFFDF8; color: #1B1A17; border-color: #D3CAB8; min-height: 44px; font-size: 14px; }
body.lobby-on .lb-row { background: #F8F4EC; }
body.lobby-on .lb-row.first { border-color: #B8901F; }
body.lobby-on #modal-backdrop .chip.close { min-width: 44px; min-height: 44px; background: #F8F4EC; }
body.lobby-on #modal-backdrop :focus-visible { outline-color: #8A6A10; }

/* the same two over the dark lobby: a raised umber card, gold numbers */
:root[data-theme="dark"] body.lobby-on .toast { background: #2C2820; border-color: #4A4337; color: #EFE8DA; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); }
:root[data-theme="dark"] body.lobby-on .toast .big { color: #E6C462; }
:root[data-theme="dark"] body.lobby-on .toast a { color: #EFE8DA; }
:root[data-theme="dark"] body.lobby-on #modal-backdrop {
  --card: #1E1B16; --card-edge: #332E25; --ink: #EFE8DA; --muted: #A89F8D;
  --gold: #E6C462; --mint: #E6C462; --violet: #E6C462; --good: #7DB38B;
  background: rgba(5, 4, 2, .62); color: #EFE8DA; color-scheme: dark;
}
:root[data-theme="dark"] body.lobby-on #modal-backdrop .card { box-shadow: 0 12px 40px rgba(0, 0, 0, .5); }
:root[data-theme="dark"] body.lobby-on .lb-filters select { background: #26221B; color: #EFE8DA; border-color: #7A6F5C; }
:root[data-theme="dark"] body.lobby-on .lb-row { background: #191712; }
:root[data-theme="dark"] body.lobby-on .lb-row.first { border-color: #D4AA3A; }
:root[data-theme="dark"] body.lobby-on #modal-backdrop .chip.close { background: #26221B; border-color: #7A6F5C; color: #EFE8DA; }
:root[data-theme="dark"] body.lobby-on #modal-backdrop :focus-visible { outline-color: #E6C462; }

/* ---------------------------------------------------------------- narrower */
@media (max-width: 980px) {
  .lobby .llayout { grid-template-columns: minmax(0, 1fr); gap: 32px; max-width: 660px; }
  .lobby .col-side { padding-top: 0; position: static; }
}
@media (max-width: 720px) {
  html:has(body.lobby-on) { scroll-padding-top: 64px; }
  .lobby .ltop-in { padding: 0 12px 0 16px; height: 56px; }
  .lobby .ltopnav a, .lobby .ltopnav button { padding: 0 8px; font-size: 14px; }
  .lobby .ltopnav { gap: 2px; }
  /* one button showing the current theme; tapping it moves to the next */
  .lobby .ltop-in { gap: 4px; }
  .lobby .theme { background: none; padding: 0; }
  .lobby .theme > button { min-height: 44px; padding: 0; justify-content: center; }
  .lobby .theme > button:not([aria-pressed="true"]) { display: none; }
  .lobby .theme > button[aria-pressed="true"] { background: none; box-shadow: none; color: var(--ink-2); }
  .lobby .theme > button:hover { background: var(--paper-deep); }
  .lobby .theme .tlabel { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .lobby .lpage { padding: 24px 16px 40px; }
  .lobby .intro { margin-bottom: 20px; }
  .lobby .intro p { font-size: 16px; }
  .lobby .setup { padding: 14px 14px 4px; }
  .lobby .resume { padding: 18px 16px; }
  .lobby .disclosure { margin: 0 -14px; padding: 0 14px; }
  .lobby .source-bar { gap: 8px; }
  .lobby .seg > button { padding: 0 8px; font-size: 14px; }
  .lobby .seg-link { padding: 0 12px; font-size: 14px; }
  /* chip rows are the one thing allowed to scroll sideways */
  .lobby .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px; padding: 0 14px 2px; scrollbar-width: none; scroll-padding: 0 14px; }
  .lobby .chips::-webkit-scrollbar { display: none; }
  .lobby .axis-row { grid-template-columns: 1fr; }
  .lobby .inset-row { padding: 10px 10px 10px 14px; }
  .lobby .inset-row .seg { width: 100%; }
  .lobby .rules-line { padding-left: 14px; }
  .lobby .travel-cards { gap: 10px; }
  .lobby .tcard-text { padding: 10px 12px 12px; }
  .lobby .btn-play { width: 100%; }
  .lobby .resume-facts { grid-template-columns: 1fr 1fr; gap: 12px 20px; }
  .lobby .resume-actions .btn-primary { flex: 1; }
  .lobby .quiet-row > .muted { text-align: left; flex-basis: 100%; order: 9; padding-bottom: 6px; }
  .lobby .quiet-row { gap: 0 10px; }
  .lobby .quiet-row .btn-text { padding: 0 2px; }
  body.lobby-on #toasts { bottom: 88px; }
}
@media (max-width: 380px) {
  .lobby .ltop-in { padding: 0 8px 0 14px; }
  .lobby .ltopnav a, .lobby .ltopnav button { padding: 0 6px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .lobby *, .lobby *::before, .lobby *::after { transition-duration: 0s !important; }
  html:has(body.lobby-on) { scroll-behavior: auto; }
  .lobby .btn-primary.busy::after { animation: none; }
}
