/* ---------- home / create ---------- */
/* Regathering owns this lobby -- the body of this UI stays about playing
   Magic, and no other project's concepts belong in it. Cross-site navigation
   is the one deliberate exception, confined to the #hd-nav switcher in the
   header: accounts are now shared across halfdreamt.us, so a player signed in
   here is signed in on the sibling games and needs a way across. That bar is
   served by the halfdreamt-web repo, not defined here. */
main:has(.home-shell), main:has(.auth-shell) {
  max-width: 1480px; padding-top: 22px;
}
.home-shell {
  --home-ink: #f5f1ff;
  --home-accent: #a99cf7;
  display: grid; grid-template-columns: 226px minmax(0, 1fr); gap: 24px;
  align-items: start;
}
.home-rail {
  position: sticky; top: 22px; min-height: calc(100vh - 68px);
  display: flex; flex-direction: column; padding: 18px 14px;
  background: linear-gradient(180deg, rgba(34,39,54,.96), rgba(24,28,39,.96));
  border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0,0,0,.22);
}
.rail-brand { display: flex; align-items: center; gap: 10px;
  padding: 3px 8px 22px; color: var(--home-ink); }
.rail-brand b { display: block; font-size: 14px; }
.rail-brand small { display: block; margin-top: 1px; color: var(--faint);
  font-size: 10.5px; font-weight: 500; }
.rail-label { padding: 0 8px 7px; color: var(--faint); font-size: 10px;
  font-weight: 750; text-transform: uppercase; letter-spacing: .12em; }
.rail-link {
  width: 100%; border-color: transparent; background: transparent;
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  color: var(--dim); text-align: left;
}
.rail-link:hover { color: var(--text); background: var(--panel3); }
.rail-mark { width: 30px; height: 30px; flex: 0 0 30px; display: grid;
  place-items: center; border-radius: 9px; color: #171522; font-weight: 900;
  background: linear-gradient(145deg, #c2b9ff, #7aa2f7); }
.rail-nav { display: grid; gap: 2px; }
.rail-link { font-size: 12.5px; min-height: 36px; }
.rail-link .rail-icon { width: 20px; color: var(--faint); text-align: center; }
.home-content { min-width: 0; }
.home-hero {
  position: relative; overflow: hidden; min-height: 238px;
  padding: clamp(24px, 4vw, 48px); margin-bottom: 14px;
  display: flex; flex-direction: column; align-items: flex-start;
  justify-content: center; border: 1px solid rgba(187,154,247,.28);
  border-radius: 22px;
  background:
    radial-gradient(circle at 86% 16%, rgba(122,162,247,.22), transparent 24%),
    radial-gradient(circle at 70% 88%, rgba(187,154,247,.16), transparent 32%),
    linear-gradient(135deg, #24283b 0%, #1a1e2d 54%, #161923 100%);
  box-shadow: 0 24px 70px rgba(0,0,0,.26);
}
.home-hero::after {
  content: ""; position: absolute; width: 320px; height: 320px; right: -92px;
  top: -150px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%;
  box-shadow: 0 0 0 44px rgba(187,154,247,.025),
              0 0 0 92px rgba(122,162,247,.02);
  pointer-events: none;
}
.home-hero h2 { position: relative; margin: 0 0 8px; color: var(--home-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(36px, 6vw, 66px); font-weight: 500; line-height: .98;
  letter-spacing: -.045em; }
.home-hero p { position: relative; max-width: 610px; margin: 0 0 20px;
  color: #c4c7d3; font-size: clamp(14px, 1.5vw, 17px); line-height: 1.55;
  text-wrap: balance; }
/* Card-coverage line: dimmer and smaller than the tagline above it, and it
   overrides that rule's 20px bottom margin so it reads as a footnote to the
   tagline rather than a second paragraph. */
.home-hero p.hero-coverage { margin: -14px 0 18px; color: var(--dim);
  font-size: clamp(11px, 1.1vw, 13px); letter-spacing: .01em; }
.home-hero p.hero-coverage[hidden] { display: none; }
.hero-actions { position: relative; display: flex; gap: 9px; flex-wrap: wrap; }
.hero-actions button { min-height: 44px; padding: 10px 16px; }
.hero-actions button[hidden] { display: none; }
.density-toggle { color: var(--dim); }
.home-dashboard { display: grid; grid-template-columns: minmax(0, 1fr);
  gap: 14px; align-items: start; }
.home-primary, .home-side { min-width: 0; }
.home-side { position: static; }
.home-card-head { display: flex; align-items: flex-start; gap: 12px;
  justify-content: space-between; margin-bottom: 14px; }
.home-card-head h2 { margin: 0 0 3px; color: var(--home-ink); font-size: 18px; }
.home-card-head p { margin: 0; color: var(--faint); font-size: 12px; }
.home-step { display: grid; place-items: center; flex: 0 0 30px; width: 30px;
  height: 30px; border-radius: 50%; background: rgba(187,154,247,.13);
  border: 1px solid rgba(187,154,247,.3); color: var(--plan);
  font-size: 11px; font-weight: 800; }
#game-setup { border-color: rgba(187,154,247,.22);
  box-shadow: 0 14px 40px rgba(0,0,0,.14); }
#game-setup > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 48px; cursor: pointer; list-style: none; user-select: none;
}
#game-setup > summary::-webkit-details-marker { display: none; }
.game-setup-summary strong { display: block; color: var(--home-ink);
  font-size: 18px; }
.game-setup-summary small { display: block; margin-top: 3px;
  color: var(--faint); font-size: 12px; font-weight: 500; }
.setup-chevron { flex: 0 0 30px; width: 30px; height: 30px;
  display: grid; place-items: center; border-radius: 50%;
  background: rgba(187,154,247,.13);
  border: 1px solid rgba(187,154,247,.3); color: var(--plan); }
.setup-chevron::before { content: "›"; font-size: 22px; line-height: 1;
  transform: rotate(0deg); transition: transform .16s ease; }
#game-setup[open] .setup-chevron::before { transform: rotate(90deg); }
.game-setup-body { margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--border); }
.game-options { margin: 10px 0 14px; border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border); padding: 9px 0; }
.game-options > summary { color: var(--dim); font-size: 11px; font-weight: 700; }
.game-options .optrow { margin-bottom: 2px; }
.game-options input[type="checkbox"] { width: auto; min-height: 0; }
.newseat::before { content: attr(data-seat); flex: 0 0 52px; color: var(--faint);
  font-size: 10px; font-weight: 750; letter-spacing: .06em;
  text-transform: uppercase; }
.home-side .card, .home-primary .card { margin-bottom: 14px; }
.home-section-title { margin: 20px 2px 10px; color: var(--dim);
  font-size: 10.5px; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; }
.home-wide { margin-top: 14px; }
.home-shell.compact .home-hero { min-height: 184px; padding-top: 26px; padding-bottom: 26px; }
.home-shell.compact .home-hero h2 { font-size: clamp(34px, 5vw, 52px); }
.home-shell.compact .home-hero p, .home-shell.compact #game-setup .hint { display: none; }
.home-shell.compact .card { padding: 12px; margin-bottom: 10px; }
.home-shell.compact .newseat select,
.home-shell.compact .newseat input { min-height: 34px; padding-top: 6px; padding-bottom: 6px; }

/* ---------- multi-game home: the Magic / Netrunner switcher ----------
   Regathering hosts more than one game now, so the home page picks one first.
   The switcher is a pure CLIENT-SIDE tab: both setup cards stay in the DOM
   and the inactive one is [hidden], so flipping between them never refetches
   anything and never disturbs the Magic form's seat rows (which hold real
   user state). The choice is remembered per browser in localStorage. */
.gameswitch { display: flex; gap: 4px; padding: 4px; margin-bottom: 14px;
  background: var(--panel2); border: 1px solid var(--border);
  border-radius: 12px; }
.gameswitch button { flex: 1 1 0; min-height: 40px; padding: 8px 12px;
  border: 1px solid transparent; border-radius: 9px; background: transparent;
  color: var(--dim); font-size: 13px; font-weight: 700; cursor: pointer;
  font-family: inherit; }
.gameswitch button:hover { color: var(--text); background: var(--panel3); }
.gameswitch button[aria-selected="true"] { background: var(--panel);
  border-color: var(--border); color: var(--home-ink); }
/* #nr-setup mirrors #game-setup's summary/chevron chrome. Restated rather
   than widening the #game-setup selectors so a change here can never reach
   the Magic card. */
#nr-setup { border-color: rgba(125,207,255,.24);
  box-shadow: 0 14px 40px rgba(0,0,0,.14); }
#nr-setup > summary { display: flex; align-items: center;
  justify-content: space-between; gap: 12px; min-height: 48px;
  cursor: pointer; list-style: none; user-select: none; }
#nr-setup > summary::-webkit-details-marker { display: none; }
#nr-setup[open] .setup-chevron::before { transform: rotate(90deg); }
.home-shell.compact #nr-setup .hint { display: none; }
.nrrow { display: flex; gap: 8px; margin-bottom: 8px; align-items: center;
  flex-wrap: wrap; }
/* REQUIRED, not decoration: the custom-decklist row is toggled with
   el.hidden, and an author `display: flex` outranks the UA's
   [hidden]{display:none} — without this the textarea is on screen for every
   deck choice. Same trap as `.mrrow [hidden]` (ISS-wt87-1). */
.nrrow[hidden] { display: none; }
.nrrow > label { flex: 0 0 74px; color: var(--faint); font-size: 10px;
  font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.nrrow select, .nrrow input { flex: 1 1 240px; min-width: 0; width: auto;
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 10px; font-size: 14px;
  font-family: inherit; min-height: 40px; }
.nrrow select.nrkind { flex: 0 0 110px; }
.nrrow select option:disabled { color: var(--faint); }
.nrrow select optgroup { color: var(--text); font-style: normal; }
/* the selected deck's own description, under its select */
.nrcap { margin: -4px 0 10px 82px; color: var(--dim); font-size: 12px;
  line-height: 1.45; }
.nrcap[hidden] { display: none; }
@media (max-width: 560px) { .nrcap { margin-left: 0; } }
.nrrow textarea { flex: 1 1 100%; width: 100%; min-height: 140px;
  padding: 10px 12px; resize: vertical; background: #151925;
  color: var(--text); border: 1px solid var(--border2); border-radius: 10px;
  font-family: ui-monospace, "Cascadia Code", monospace; font-size: 13px;
  line-height: 1.6; }
.nrbad { margin-top: 8px; color: var(--bad); font-size: 13px; }
.nrbad[hidden] { display: none; }
/* Netrunner ends in states Magic has no badge class for */
.badge.nr-tag { color: var(--plan); border-color: var(--plan); }
.badge.st-turn_limit, .badge.st-abandoned { color: var(--warn);
  border-color: var(--warn); }
