/* OliStream design system (Stars & Stripes: navy lead, red second color). Light by default, dark when the phone is in dark mode. */
:root {
  --bg: #f5f6fa; --surface: #ffffff; --surface-2: #eceff6; --line: #dce0ec;
  --text: #0e1a3a; --muted: #59627f; --faint: #8a92ab;
  --accent: #1e3a8a; --accent-hover: #172f73; --accent-ink: #ffffff; --accent-soft: #e6ebf7; --brand2: #c8102e;
  --live: #e11d48; --ok: #15803d; --ok-soft: #e8f6ee; --warn: #b45309; --warn-soft: #fff7e6;
  --danger: #b91c1c; --danger-soft: #fdecec;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 2px 6px rgba(16, 24, 40, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1230; --surface: #121c44; --surface-2: #19255a; --line: #24305f;
    --text: #f2f4fb; --muted: #a7b0d1; --faint: #7681a6;
    --accent: #86a8ff; --accent-hover: #a9c0ff; --accent-ink: #0a1230; --accent-soft: #17224f; --brand2: #ff5468;
    --ok: #4ade80; --ok-soft: #12261a; --warn: #fbbf24; --warn-soft: #2a2110;
    --danger: #f87171; --danger-soft: #2c1517;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
h1 { font-size: 24px; line-height: 1.25; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 18px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 0; }
p { margin: 0 0 10px; }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.wrap { max-width: 720px; margin: 0 auto; padding: 16px 16px 48px; }
.stack > * + * { margin-top: 14px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .inner { max-width: 720px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand img { width: 26px; height: 26px; }
/* wordmark: b + ball (the "o") + net posts (the "ll") + stream */
.wm { font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1; white-space: nowrap; color: var(--text); }
/* OliStream wordmark: the ball is a capital O (cap height), then "li", then "Stream" in red. */
.wm-o { display: inline-block; width: .8em; height: .8em; vertical-align: -.06em; margin: 0 .03em 0 0; }
.wm-st { color: var(--brand2); }
.nav { display: flex; gap: 4px; margin-left: 8px; flex: 1; }
.nav a { padding: 7px 12px; border-radius: 99px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; }
.nav a.on { background: var(--surface-2); color: var(--text); }
.who { font-size: 14px; color: var(--muted); white-space: nowrap; }
@media (max-width: 520px) { .who-name { display: none; } .nav { margin-left: 0; } }
@media (max-width: 430px) { .brand-text { display: none; } }

/* ---------- cards ---------- */
.card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); }
.card.tap { display: block; color: inherit; text-decoration: none; transition: border-color .15s; }
.card.tap:hover { border-color: var(--faint); }
.card + .card { margin-top: 10px; }
.section-label { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase;
  letter-spacing: .06em; margin: 26px 0 10px; }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step-num { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.step-body { flex: 1; min-width: 0; }

/* ---------- text ---------- */
.muted { color: var(--muted); font-size: 14px; }
.faint { color: var(--faint); font-size: 13px; }
.big { font-size: 20px; font-weight: 700; }
.err { color: var(--danger); font-size: 14px; min-height: 1.2em; }
.ok-text { color: var(--ok); }
.vs { color: var(--muted); font-weight: 500; }
.link-box { font: 13px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; background: var(--surface-2);
  border-radius: 8px; padding: 8px 10px; word-break: break-all; color: var(--muted); margin: 8px 0; }

/* ---------- forms ---------- */
label { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
label .opt { font-weight: 400; color: var(--faint); }
input, select, textarea { width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.hint { font-size: 13px; color: var(--faint); margin-top: 6px; }

/* ---------- buttons ---------- */
button, .btn { appearance: none; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 16px;
  font-family: inherit; font-size: 15px; font-weight: 600; line-height: 1.2; white-space: nowrap; cursor: pointer; background: var(--surface); color: var(--text);
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; }
button:hover, .btn:hover { background: var(--surface-2); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.primary:hover, .btn.primary:hover { background: var(--accent-hover); }
button.danger, .btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
button.danger:hover { background: var(--danger-soft); }
button.ghost, .btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
button.small, .btn.small { min-height: 34px; padding: 6px 12px; font-size: 14px; }
button.wide, .btn.wide { width: 100%; }
button:disabled { opacity: .5; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn-row > * { flex: 1 1 auto; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px;
  border-radius: 99px; background: var(--surface-2); color: var(--muted); letter-spacing: .03em; white-space: nowrap; }
.badge.live { background: var(--live); color: #fff; }
.badge.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse 1.4s infinite; }
.badge.replay { background: #2563eb; color: #fff; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- match list ---------- */
.card.tap.match-card, .match-card { display: flex; gap: 12px; align-items: center; }
.match-card .main { flex: 1; min-width: 0; }
.match-card .title { font-weight: 700; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-card .chev { color: var(--faint); font-size: 22px; }
.empty { text-align: center; padding: 34px 16px; }
.empty .icon { font-size: 40px; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 99px; font-weight: 600; font-size: 14px; z-index: 50; box-shadow: 0 6px 20px rgba(0,0,0,.25);
  max-width: calc(100% - 32px); text-align: center; }

/* ---------- auth pages ---------- */
.auth { max-width: 420px; margin: 0 auto; padding: 48px 16px; }
.auth .brand { justify-content: center; font-size: 22px; margin-bottom: 22px; }
.auth .brand img { width: 34px; height: 34px; }

/* rows with an info block and a group of actions (replays, people) */
.acts { display: flex; gap: 8px; flex: none; }
