/* Listener view. Written for the oldest guest in the room: large type, strong
   contrast, few controls, and every target at least 56 px. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --panel: #f2f4f7;
  --ink: #111418;
  --soft: #4a5260;
  --line: #cfd4dc;
  --accent: #1f5fbf;
  --accent-ink: #ffffff;
  --selected: #e3ecfa;
  --good: #1a7f37;
  --banner: #fff1d6;
  --text: 26px;
}
/* Follows the phone's light or dark setting, unless the guest picks one in
   the menu (data-theme on <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d10;
    --panel: #171b21;
    --ink: #f4f6f8;
    --soft: #b8c0cc;
    --line: #333a44;
    --accent: #86b4ff;
    --accent-ink: #0b0d10;
    --selected: #1c2b44;
    --good: #52c872;
    --banner: #3a2c0c;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d10;
  --panel: #171b21;
  --ink: #f4f6f8;
  --soft: #b8c0cc;
  --line: #333a44;
  --accent: #86b4ff;
  --accent-ink: #0b0d10;
  --selected: #1c2b44;
  --good: #52c872;
  --banner: #3a2c0c;
}
:root[data-theme="light"] { color-scheme: light; }

[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 500 var(--text)/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ── step 1: choose a language ───────────────────────────────── */
.chooser {
  min-height: 100vh; min-height: 100svh;
  max-width: 560px; margin: 0 auto;
  padding: 32px 20px;
  display: flex; flex-direction: column; justify-content: center; gap: 32px;
}
.chooser-title {
  margin: 0; text-align: center; line-height: 1.3;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 28px; font-weight: 700;
}
.chooser-title span + span { font-size: 22px; font-weight: 500; color: var(--soft); }
.choices { display: flex; flex-direction: column; gap: 16px; }
.choice {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 88px; padding: 0 24px;
  border: 2px solid var(--line); border-radius: 18px; background: var(--panel);
  font-size: 32px; font-weight: 700; text-align: left;
}
.choice:hover { border-color: var(--accent); }
.choice-code { font-size: 18px; font-weight: 700; letter-spacing: .08em; color: var(--soft); }
.choice.all { min-height: 60px; font-size: 21px; font-weight: 600; background: transparent; }

/* ── step 2: follow along ───────────────────────────────────── */
.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px 10px 20px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.dot.ok { background: var(--good); }
.bar-title { flex: 1; font-size: 20px; font-weight: 700; color: var(--soft); }
.more {
  flex: none; width: 60px; height: 56px;
  border: 2px solid var(--line); border-radius: 14px; background: var(--panel);
  font-size: 30px; font-weight: 800; line-height: 1;
}
.banner { margin: 0; padding: 12px 20px; background: var(--banner); font-size: 20px; }

.feeds { max-width: 920px; margin: 0 auto; padding: 16px 20px 140px; }
.lines { overflow-wrap: anywhere; }
.line { margin: 0 0 .75em; }
/* Still being spoken: shown, but quieter, so it reads as not yet settled. */
.line.partial { color: var(--soft); }
.waiting { margin: 24px 0; font-size: 22px; color: var(--soft); }
.live { margin: 0; font-size: 20px; color: var(--soft); }
.live::after { content: ""; animation: dots 1.4s steps(4, end) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

.jump {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: max(20px, env(safe-area-inset-bottom));
  padding: 14px 26px; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 20px; font-weight: 700; box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}

/* Every language side by side — desktop only, mainly for monitoring. */
.viewer[data-mode="all"] .feeds {
  max-width: none; height: calc(100vh - 80px); padding: 16px 20px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
}
.viewer[data-mode="all"] .feed {
  display: flex; flex-direction: column; min-height: 0;
  padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px;
}
.viewer[data-mode="all"] .lines { flex: 1; overflow-y: auto; font-size: calc(var(--text) * .72); }
.feed-title { margin: 0 0 10px; font-size: 18px; font-weight: 700; color: var(--soft); }

/* ── menu ───────────────────────────────────────────────────── */
.menu {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: flex-start; justify-content: flex-end;
  padding: 12px; padding-top: max(12px, env(safe-area-inset-top));
  background: rgba(0, 0, 0, .45);
}
.menu-panel {
  width: min(440px, 100%); max-height: calc(100vh - 24px); overflow-y: auto;
  display: flex; flex-direction: column; gap: 16px; padding: 20px;
  border-radius: 18px; background: var(--bg); box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
  font-size: 22px;
}
.menu-panel h2 { margin: 0; font-size: 20px; font-weight: 700; color: var(--soft); }
.menu-langs { display: flex; flex-direction: column; gap: 10px; }
.menu-group { display: flex; flex-direction: column; gap: 10px; }
/* Stacked like the languages: side by side, "Automatyczny" does not fit a phone. */
.theme-buttons { display: flex; flex-direction: column; gap: 10px; }
.menu-langs button, .menu-toggle, .menu-close, .size, .theme-buttons button {
  min-height: 60px; padding: 0 18px;
  border: 2px solid var(--line); border-radius: 14px; background: var(--panel);
  font-size: 22px; font-weight: 600; text-align: left;
}
.menu-langs button[aria-pressed="true"], .menu-toggle[aria-pressed="true"],
.theme-buttons button[aria-pressed="true"] {
  border-color: var(--accent); background: var(--selected);
}
.menu-langs button[aria-pressed="true"]::after,
.theme-buttons button[aria-pressed="true"]::after { content: "  ✓"; }
.menu-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.size-buttons { display: flex; gap: 10px; }
.size { min-width: 76px; text-align: center; font-weight: 700; }
.menu-close {
  text-align: center; border-color: transparent;
  background: var(--accent); color: var(--accent-ink); font-weight: 700;
}
