/* lobby.css — Couch Campaign's front door and host page (BUILD-PLAN, Phase 6,
 * build 2). The table's own look, the join card's (table_app/static/app.css,
 * .join): its ground, its inks and its letters, so stepping from the door to
 * the table's "Who are you?" changes nothing but the words. Its own file, not
 * the table's: the lobby is a process of its own, and the table's page may be
 * down while the door is up. */

:root {
  color-scheme: dark;
  --ground: #0b0e13;
  --ground-lift: #10151d;
  --ground-card: #151b25;
  --ink: #e9e4da;
  --ink-dim: #a4a9b3;
  --ink-faint: #898f9c;
  --ink-strong: #fff8ea;
  --accent: #d8b67c;
  --rule: #2f3746;
  --warn: #d7725f;
  /* A TV showing the table (the host page). */
  --ok: #9fd3a8;
  --prose: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --label: ui-sans-serif, -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  --step: 1rem;
}

html, body { height: 100%; margin: 0; }

body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--prose);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }

/* The card, as the join screen's: one column, never wider than a phone held
 * upright, so a laptop shows the same thing a phone does. Held at the top,
 * not centred: centred, the tabs moved under the thumb as a tab's panel
 * changed height. */
.door {
  min-height: 100%;
  box-sizing: border-box;
  display: grid;
  place-items: start center;
  padding: max(calc(var(--step) * 1.5), 12vh) calc(var(--step) * 1.5) calc(var(--step) * 1.5);
}

.door__card { width: min(26rem, 100%); display: grid; gap: calc(var(--step) * 0.8); }

.door__eyebrow {
  margin: 0;
  font-family: var(--label);
  font-size: 0.62rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
}

/* The wordmark (wordmark.svg), atop the front door in the eyebrow's place,
 * centred over the card (Bryce, 2026-10-08). */
.door__brand { display: block; justify-self: center; width: min(16rem, 78%); height: auto; margin-bottom: calc(var(--step) * 0.4); }

.door__title { margin: 0; font-family: var(--prose); font-size: 1.5rem; font-weight: 400; color: var(--ink); }

.door__sub {
  margin: calc(var(--step) * 0.6) 0 0;
  font-family: var(--label);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* ── the two tabs ───────────────────────────────────────────────────────
 * Play and Host (Bryce, 2026-10-06, B over A). Labels in the interface's
 * letters, the chosen one in the accent and underlined; the app opens on the
 * one used last. */
.door__tabs {
  display: flex;
  /* Centred under the wordmark, spread apart, each tab as wide as the
   * other (Bryce, 2026-10-08: "a little more intentional"). */
  justify-content: center;
  gap: calc(var(--step) * 2.2);
  border-bottom: 1px solid var(--rule);
  margin-bottom: calc(var(--step) * 0.4);
}

.door__tab {
  font-family: var(--label);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  min-width: 7.5rem;
  padding: calc(var(--step) * 0.65) calc(var(--step) * 0.8);
  text-align: center;
  cursor: pointer;
}

.door__tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }

@media (hover: hover) {
  .door__tab:hover:not([aria-selected="true"]) { color: var(--ink); }
}

.door__panel { display: grid; gap: calc(var(--step) * 0.8); }

/* ── fields and buttons, the join card's ─────────────────────────────── */
.door__form { display: grid; gap: calc(var(--step) * 0.5); }

.door__field {
  width: 100%;
  box-sizing: border-box;
  padding: calc(var(--step) * 0.8) calc(var(--step) * 0.9);
  font-family: var(--label);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--ink);
  background: var(--ground-lift);
  border: 1px solid var(--rule);
  border-radius: 0;
}

.door__field:focus { outline: none; border-color: var(--accent); }
.door__field::placeholder { color: var(--ink-faint); letter-spacing: 0.06em; }

/* The table code, a box a letter (Bryce, 2026-10-08), read off a TV across a
 * room, so typed large. */
.door__boxes { display: grid; grid-template-columns: repeat(4, 1fr); gap: calc(var(--step) * 0.5); }
.door__box {
  box-sizing: border-box;
  width: 100%;
  aspect-ratio: 1 / 1.1;
  font-family: var(--label);
  font-size: 1.7rem;
  text-align: center;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--ground-lift);
  border: 1px solid var(--rule);
  border-radius: 3px;
}
.door__box:focus { outline: none; border-color: var(--accent); }

.btn {
  font-family: var(--label);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: calc(var(--step) * 0.75) calc(var(--step) * 0.9);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.btn--go { color: var(--accent); border-color: var(--accent); }
.btn--stop { color: var(--warn); border-color: var(--warn); }
.btn:disabled { opacity: 0.4; cursor: default; }

@media (hover: hover) {
  .btn:hover:not(:disabled) { color: var(--ink); border-color: var(--ink-faint); }
  .btn--go:hover:not(:disabled) { background: var(--accent); color: var(--ground); }
}

.btn-row { display: flex; gap: calc(var(--step) * 0.5); }
.btn-row > .btn { flex: 1; }

.door__fixed { display: grid; gap: calc(var(--step) * 0.45); padding: calc(var(--step) * 0.3) 0; }
.door__links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: calc(var(--step) * 0.6); }

/* A quiet way somewhere else, as the join card's "back to the table". */
.door__link {
  justify-self: start;
  font-family: var(--label);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: none;
  border: 0;
  padding: 0.2em 0;
  cursor: pointer;
  text-decoration: underline;
}
@media (hover: hover) { .door__link:hover { color: var(--ink-dim); } }
.door__link--warn { color: var(--warn); }

.door__note {
  margin: 0;
  min-height: 1.2em;
  font-family: var(--label);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.door__note[data-tone="warn"] { color: var(--warn); }

/* ── the Host tab's campaigns, rows as the join card's picks ─────────── */
.door__list { list-style: none; margin: 0; padding: 0; display: grid; gap: calc(var(--step) * 0.5); }

.door__pick {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.8em;
  padding: calc(var(--step) * 0.8) calc(var(--step) * 0.9);
  font-family: var(--label);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--ground-lift);
  border: 1px solid var(--rule);
  border-radius: 3px;
  cursor: pointer;
  text-align: left;
}
@media (hover: hover) { .door__pick:hover { border-color: var(--accent); color: var(--accent); } }

.door__state { font-size: 0.6rem; letter-spacing: 0.12em; color: var(--ink-faint); white-space: nowrap; }
.door__state[data-live] { color: var(--accent); }

/* ── a campaign's key, shown once ────────────────────────────────────── */
.door__key {
  margin: 0;
  padding: calc(var(--step) * 1) calc(var(--step) * 0.9);
  display: grid;
  gap: 0.15em;
  font-family: var(--prose);
  font-size: 1.45rem;
  line-height: 1.35;
  color: var(--ink-strong);
  background: var(--ground-card);
  border: 1px solid var(--accent);
  border-radius: 3px;
  list-style: none;
}
.door__key li::before {
  content: counter(list-item);
  display: inline-block;
  width: 1.6em;
  font-family: var(--label);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  vertical-align: 0.25em;
}

/* ── the host page: the campaign's name, its session under it ────────── */
.host__title { font-size: 2.1rem; line-height: 1.15; overflow-wrap: anywhere; }
.host__session {
  margin: calc(var(--step) * -0.45) 0 0;
  font-family: var(--label);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.host__session:empty { display: none; }

/* ── the host page's settings, folded away until asked for ──────────── */
.host__settings { gap: calc(var(--step) * 0.6); padding-top: calc(var(--step) * 0.7); border-top: 1px solid var(--rule); }
.host__settings .door__field { padding: 0.55em 0.7em; font-size: 0.78rem; }
.host__settings .btn { padding: 0.6em 0.9em; }
.host__pair { display: grid; grid-template-columns: 3fr 2fr; gap: calc(var(--step) * 0.5); }
.host__row { display: grid; gap: calc(var(--step) * 0.25); }

/* In pages, as the table's Settings (R-T15): the contents and every page in
 * one cell, the one shown in sight and the height of the section; the rest
 * keep their layout out of sight, taps and Tab alike, so the contents can say
 * what each holds (host.js, syncPages). */
.host__sethead { display: flex; align-items: baseline; gap: 1em; }
.host__settitle {
  margin: 0;
  font-family: var(--prose);
  font-size: 1.15rem;
  color: var(--ink);
}
.host__back {
  padding: 0.2em 0;
  font-family: var(--label);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: none;
  border: 0;
  cursor: pointer;
}
.host__back::before { content: "\2039\00a0"; }
.host__pages { display: grid; }
.host__pages > * { grid-area: 1 / 1; align-self: start; min-width: 0; }
.host__pages > :not(.is-shown) { visibility: hidden; height: 0; overflow: hidden; }
.host__page, .host__group { display: grid; gap: calc(var(--step) * 0.6); }
.host__contents { display: grid; }
.host__item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2em 0.8em;
  padding: calc(var(--step) * 0.75) 0.1em;
  text-align: left;
  color: var(--ink);
  background: none;
  border: 0;
  border-top: 1px solid var(--rule);
  cursor: pointer;
}
.host__item:last-child { border-bottom: 1px solid var(--rule); }
.host__item::after {
  content: "\203A";
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-family: var(--label);
  font-size: 1.1rem;
  color: var(--ink-faint);
}
.host__itemName { font-family: var(--prose); font-size: 1rem; color: var(--ink); }
.host__itemSum { font-family: var(--prose); font-size: 0.8rem; line-height: 1.45; color: var(--ink-dim); }
@media (hover: hover) { .host__item:hover .host__itemName { color: var(--accent); } }
.host__lede {
  margin: 0;
  font-family: var(--label);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  line-height: 1.5;
  color: var(--ink-dim);
}
.host__label {
  font-family: var(--label);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.host__check {
  display: flex;
  gap: 0.6em;
  align-items: center;
  font-family: var(--label);
  font-size: 0.78rem;
  color: var(--ink-dim);
  cursor: pointer;
}
.host__check input { margin: 0; width: 1.05rem; height: 1.05rem; accent-color: var(--accent); }
/* A box with what it does beside it (the new campaign's fixed settings). */
.host__check--told { align-items: flex-start; }
.host__check--told input { margin-top: 0.15rem; flex: none; }
.host__check--told b { display: block; font-weight: 600; font-size: 0.82rem; color: var(--ink); }
.host__check--told small { display: block; margin-top: 0.2rem; font-size: 0.74rem; line-height: 1.45;
                           color: var(--ink-dim); }
.host__rules { resize: vertical; min-height: 4.5em; font-family: var(--label); line-height: 1.45; }
.host__inline { display: flex; gap: calc(var(--step) * 0.5); }
.host__inline .door__field { flex: 1; min-width: 0; }
.host__more { flex-wrap: wrap; justify-content: flex-start; gap: calc(var(--step) * 0.5) calc(var(--step) * 1.1); }
.door__note:empty { display: none; }
.host__delete { border: 1px solid var(--warn); border-radius: 3px;
  padding: calc(var(--step) * 0.9) calc(var(--step) * 1); }
.host__deleteHead { margin: 0; font-family: var(--prose); font-size: 1.2rem; color: var(--warn); }
.host__here { text-transform: none; letter-spacing: 0.02em; font-size: 0.74rem; color: var(--ink-dim); }
.host__fixed { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.2em;
  font-family: var(--label); font-size: 0.78rem; color: var(--ink-dim); }
.host__fixed b { font-weight: 500; color: var(--ink); }
.host__rulestext { font-family: var(--label); font-size: 0.78rem; line-height: 1.45; color: var(--ink-dim);
  white-space: pre-wrap; padding: 0.55em 0.7em; border-left: 2px solid var(--rule); }
.host__line { display: flex; flex-wrap: wrap; gap: 0.2em 0.8em; align-items: baseline; }
select.door__field { appearance: auto; }

/* ── the host page's table code ──────────────────────────────────────── */
.host__code {
  margin: 0;
  padding: calc(var(--step) * 0.9) calc(var(--step) * 0.9) calc(var(--step) * 0.7);
  display: grid;
  justify-items: center;
  gap: 0.2em;
  background: var(--ground-card);
  border: 1px solid var(--rule);
  border-radius: 3px;
}
.host__letters {
  font-family: var(--label);
  font-size: 2.6rem;
  font-weight: 600;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  line-height: 1.2;
  color: var(--ink-strong);
}
.host__url {
  font-family: var(--label);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
}

/* ── the TV's own page (tv.html) ─────────────────────────────────────────
 * Read from the couch: everything sized by the screen's height, so a 720p
 * stick and a 4K set show the same page. The digits beside a big QR (Bryce,
 * 2026-10-10, picture A); paired, the campaigns it shows. */
html.tvpage { font-size: 2.3vh; }
.tvpage body { font-size: 1rem; overflow: hidden; }
.tv { height: 100vh; box-sizing: border-box; display: grid; grid-template-rows: auto 1fr auto;
  justify-items: center; padding: 6vh 6vw 5vh; }
.tv__brand { width: 15rem; height: auto; }
.tv__middle { align-self: center; display: grid; justify-items: center; gap: 1.1rem; text-align: center; }
.tv__eyebrow { margin: 0; font-family: var(--label); font-size: 0.8rem; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--accent); }
.tv__digits { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.tv__digit { width: 5.6rem; aspect-ratio: 1 / 1.15; display: grid; place-items: center;
  font-family: var(--label); font-size: 4.2rem; font-weight: 600; color: var(--ink-strong);
  background: var(--ground-lift); border: 1px solid var(--rule); border-radius: 4px; }
.tv__line { margin: 0; max-width: 30rem; font-family: var(--label); font-size: 1rem; line-height: 1.5;
  color: var(--ink-dim); }
.tv__line b { color: var(--ink); font-weight: 500; }
.tv__foot { margin: 0; max-width: 46rem; text-align: center; font-family: var(--label); font-size: 0.72rem;
  letter-spacing: 0.06em; color: var(--ink-faint); }
.tv__split { align-self: center; display: grid; grid-template-columns: auto auto; gap: 6rem; align-items: center; }
.tv__split .tv__middle { justify-items: start; text-align: left; }
.tv__qrcol { display: grid; justify-items: center; gap: 0.7rem; }
.tv__qr { display: block; width: 17rem; aspect-ratio: 1; border-radius: 6px; }
.tv__titles { display: grid; gap: 0.2rem; }
.tv__title { margin: 0; font-family: var(--prose); font-size: 3.6rem; font-weight: 400; line-height: 1.1;
  color: var(--ink-strong); }

/* A screen taller than it is wide (a phone opening /tv): one column. */
@media (max-aspect-ratio: 1/1) {
  html.tvpage { font-size: 1.6vh; }
  .tv__split { grid-template-columns: auto; gap: 3rem; }
  .tv__split .tv__middle { justify-items: center; text-align: center; }
}

/* ── the host page's TVs ─────────────────────────────────────────────── */
.host__tvline { margin: 0; font-family: var(--label); font-size: 0.8rem; color: var(--ink-dim); }
.host__tvline .door__link { margin-left: 0.3em; }
.host__tvline b { color: var(--ink); font-weight: 500; }
.host__tvs { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.host__tv { display: flex; align-items: baseline; gap: 0.6em; font-family: var(--label); font-size: 0.82rem;
  color: var(--ink); }
.host__tv small { color: var(--ink-dim); font-size: 0.74rem; }
.host__tv .door__link { margin-left: auto; }
.host__on { color: var(--ok) !important; }
.host__digits { display: grid; grid-template-columns: repeat(4, 3.2rem) auto; gap: 0.45rem; align-items: stretch; }
.host__digits .door__box { font-size: 1.5rem; }

/* Google's Cast icon, top right of the host page (picture A). */
.host__card { position: relative; }
.host__cast { position: absolute; top: -0.35rem; right: 0; padding: 0.3rem; line-height: 0;
  font-size: 1.7rem; color: var(--ink); background: none; border: 0; cursor: pointer; }
.host__castIcon { width: 1em; height: 1em; fill: currentColor; }
.host__castOn { display: none; }
.host__cast[data-state="on"] { color: var(--accent); }
.host__cast[data-state="on"] .host__castOn { display: inline; }
.host__cast[data-state="connecting"] { opacity: 0.6; }

/* The TV's look from the host page (Bryce's look B, 2026-10-22): a picture
   of the TV at its text size, the size down and up, its ambience. */
.host__tvlook {
  display: grid; gap: 0.55rem; margin: 0.2rem 0 1rem; padding: 0.9rem 1rem 0.8rem;
  border: 1px solid var(--rule); border-radius: 10px;
}
.host__tvlook[hidden] { display: none; }
.host__tvlook-head { margin: 0; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); }
/* A TV's story is 17 px at its 100% on a screen 1280 wide: the picture's
   words that share of the picture's width, at the TV's size (--tv-story). */
.host__tvpic {
  container-type: inline-size;
  display: grid; align-content: start; aspect-ratio: 16 / 9; padding: 6% 9% 0; overflow: hidden;
  border: 6px solid #1c1f26; border-radius: 8px; background: linear-gradient(180deg, #121722, #0b0e14);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}
.host__tvpic-words { margin: 0; color: #ece4d4; font-family: var(--prose); line-height: 1.62;
                      font-size: calc(var(--tv-story, 1) * 1.328cqw); }
.host__tvrow { display: flex; align-items: center; gap: 0.6rem; }
.host__tvrow > span:first-child { flex: 1; color: var(--ink-dim); }
.host__tvbtn {
  min-width: 3.2rem; padding: 0.55rem 0.7rem; border: 1px solid var(--rule); border-radius: 6px;
  background: none; color: var(--ink); font: inherit; letter-spacing: 0.08em; cursor: pointer;
}
.host__tvbtn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.host__tvbtn:disabled { opacity: 0.4; cursor: default; }
.host__tvsize { min-width: 3.4rem; text-align: center; font-variant-numeric: tabular-nums; }
.host__tvlook-note { margin: 0; font-size: 0.8rem; color: var(--ink-faint); }
