/* ============================================================
   The Sports Commons — free sports streams. Mobile-first, legit, warm.
   ============================================================ */
:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --text: #14161c;
  --muted: #5c6472;
  --border: #e6e8ee;
  --brand: #1f6feb;          /* trustworthy blue */
  --brand-ink: #0b3d91;
  --accent: #e8500e;         /* energetic "watch/free" orange */
  --accent-ink: #b23a06;
  --free: #0f9d58;           /* green = free/legit */
  --cat-womens: #c026a8;
  --cat-amateur: #0f9d58;
  --cat-emerging: #e8850e;
  --cat-other: #6b7280;
  --shadow: 0 1px 2px rgba(20,22,28,.06), 0 6px 20px rgba(20,22,28,.06);
  --radius: 14px;
  --wrap: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1017; --surface: #171a22; --text: #eef0f5; --muted: #9aa3b2;
    --border: #262a35; --brand: #4b90ff; --brand-ink: #8fb8ff; --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--text); background: var(--bg);
  line-height: 1.55; font-size: 16px; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 12px; top: 12px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  background: var(--brand); color: #fff; font-size: 13px; }
.brand-name { font-size: 1.15rem; letter-spacing: -.02em; }
.site-nav { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: .95rem; }
.site-nav a { color: var(--muted); padding: 8px 10px; border-radius: 8px; }
.site-nav a:hover { color: var(--text); text-decoration: none; background: color-mix(in srgb, var(--brand) 8%, transparent); }
.nav-cta { color: var(--brand) !important; }
@media (max-width: 560px) {
  .site-nav a:not(.nav-cta) { display: none; }
}

/* ---------- hero ---------- */
.hero { background:
    radial-gradient(1200px 400px at 15% -10%, color-mix(in srgb, var(--brand) 18%, transparent), transparent),
    radial-gradient(900px 380px at 90% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent);
  border-bottom: 1px solid var(--border); padding: 54px 0 46px; }
.hero-eyebrow { font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: .74rem;
  color: var(--free); margin: 0 0 12px; }
.hero-title { font-size: clamp(1.8rem, 4.6vw, 3rem); margin: 0 0 14px; max-width: 18ch; font-weight: 850; }
.hero-sub { font-size: clamp(1rem, 2vw, 1.18rem); color: var(--muted); max-width: 62ch; margin: 0 0 24px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .95rem;
  padding: 11px 18px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-watch { background: var(--accent); color: #fff; width: 100%; justify-content: center; }
.btn-watch:hover { background: var(--accent-ink); }
.btn-lg { font-size: 1.05rem; padding: 15px 26px; }

/* ---------- filters ---------- */
.section { padding: 32px 20px 60px; }
.filters { display: flex; flex-wrap: wrap; gap: 18px 32px; padding: 16px 0 6px; margin-bottom: 8px; }
.filter-group { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.filter-label { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-right: 2px; }
.chip { font: inherit; font-size: .85rem; font-weight: 600; padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; }
.chip:hover { color: var(--text); border-color: var(--brand); }
.chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.cat-chip.is-active { color: #fff; }
.no-results { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 20px; text-align: center; color: var(--muted); }

/* ---------- sections & grid ---------- */
.stream-section { margin-top: 34px; }
.section-heading { display: flex; align-items: center; gap: 10px; font-size: 1.35rem; margin: 0 0 16px; }
.section-heading .count { font-size: .8rem; font-weight: 700; color: var(--muted); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; }
.section-heading-muted { color: var(--muted); font-size: 1.1rem; margin-top: 40px; }
.card-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.card-grid-narrow { grid-template-columns: 1fr; }
.card-grid-muted { opacity: .72; }

/* ---------- card ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .12s ease, box-shadow .12s ease; }
/* .card sets display:flex, which would override the UA `[hidden]{display:none}`
   rule and leave filtered-out cards visible — restore hiding with higher
   specificity so the JS `card.hidden = true` filter actually hides them. */
.card[hidden] { display: none; }
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(20,22,28,.12); }
.card-media { position: relative; display: block; aspect-ratio: 16/9; background: #0b0d12; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: #333a; font-size: 2rem; }
.card-body { padding: 14px 15px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-league { font-size: .78rem; color: var(--muted); margin: 0; font-weight: 600; }
.card-league a { color: var(--muted); }
.card-title { font-size: 1rem; margin: 0; font-weight: 750; }
.card-title a { color: var(--text); }
.card-time { font-size: .9rem; font-weight: 600; margin: 0; color: var(--text); }
.card-body .btn-watch { margin-top: auto; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .68rem; font-weight: 800;
  letter-spacing: .03em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; }
.badge-cat { color: #fff; }
.cat-womens { background: var(--cat-womens); }
.cat-amateur { background: var(--cat-amateur); }
.cat-emerging { background: var(--cat-emerging); }
.cat-other { background: var(--cat-other); }
.chip.cat-womens.is-active { background: var(--cat-womens); border-color: var(--cat-womens); }
.chip.cat-amateur.is-active { background: var(--cat-amateur); border-color: var(--cat-amateur); }
.chip.cat-emerging.is-active { background: var(--cat-emerging); border-color: var(--cat-emerging); }
.card-media .badge { position: absolute; top: 10px; }
.card-media .badge-cat { left: 10px; }
.badge-live { right: 10px; background: #e11d48; color: #fff; animation: pulse 1.8s infinite; }
.badge-cancelled { background: #6b7280; color: #fff; }
.badge-done { background: var(--border); color: var(--muted); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.geo-badge { font-size: .78rem; font-weight: 700; color: var(--accent-ink);
  background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 8px; padding: 6px 10px; margin: 0; }
@media (prefers-color-scheme: dark) { .geo-badge { color: #ffb27a; } }

/* ---------- empty / prose ---------- */
.empty-state { text-align: center; padding: 60px 20px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); margin-top: 24px; }
.empty-state h2 { margin: 0 0 8px; }
.prose { padding: 44px 20px 70px; max-width: 760px; }
.prose h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 0 0 18px; }
.prose h2 { margin: 34px 0 10px; font-size: 1.3rem; }
.prose .lead { font-size: 1.2rem; color: var(--text); }
.prose ul { padding-left: 1.2em; }
.prose li { margin: 6px 0; }
.submit-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; margin: 24px 0; }
.submit-placeholder { background: color-mix(in srgb, var(--brand) 8%, transparent); border-radius: 10px; padding: 16px; }

/* ---------- event page ---------- */
.event-page, .league-page { padding: 28px 20px 70px; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 18px; }
.event-kicker { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .85rem;
  color: var(--muted); font-weight: 600; margin: 0 0 12px; }
.event-title, .league-title { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 8px; font-weight: 850; }
.event-sub { color: var(--muted); font-size: 1.05rem; margin: 0 0 8px; }
.event-grid { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 40px; margin-top: 24px; align-items: start; }
@media (max-width: 880px) { .event-grid { grid-template-columns: 1fr; } }
.event-thumb { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 22px; }
.watch-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; text-align: center; margin-bottom: 22px; }
.watch-box .btn { width: 100%; justify-content: center; }
.watch-sub, .watch-note { color: var(--muted); font-size: .9rem; margin: 12px 0 0; }
.report-line { font-size: .82rem; margin: 14px 0 0; }
.event-facts { display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px 20px; margin: 0 0 24px; }
.event-facts > div { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.event-facts > div:last-child { border-bottom: 0; }
.event-facts dt { font-weight: 700; color: var(--muted); font-size: .9rem; margin: 0; }
.event-facts dd { margin: 0; }
.geo-strong { color: var(--accent-ink); font-weight: 700; }
@media (prefers-color-scheme: dark) { .geo-strong { color: #ffb27a; } }
.league-context { border-top: 1px solid var(--border); padding-top: 20px; }
.league-context h2 { font-size: 1.15rem; margin: 0 0 8px; }
.aside-heading { font-size: 1rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 14px; }
.league-blurb { font-size: 1.15rem; color: var(--text); max-width: 68ch; }
.league-links { font-size: .95rem; margin: 8px 0; }

/* ---------- browse by sport ---------- */
.browse-sports { margin-top: 56px; border-top: 1px solid var(--border); padding-top: 28px; }
.browse-sports .section-heading { margin-bottom: 4px; }
.browse-sports .muted { margin: 0 0 16px; }
.sport-links { display: flex; flex-wrap: wrap; gap: 10px; }
.sport-link { display: inline-flex; align-items: center; font-weight: 700; font-size: .95rem;
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); }
.sport-link:hover { border-color: var(--brand); color: var(--brand); text-decoration: none;
  background: color-mix(in srgb, var(--brand) 7%, transparent); }
.btn-back { font-size: .9rem; }
.sport-league-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 10px; }
.sport-league-list li { margin: 0; }
.sport-league-list a { display: inline-flex; padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--border); font-size: .9rem; font-weight: 600; }
.sport-league-list a:hover { border-color: var(--brand); text-decoration: none; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 34px 0 44px; margin-top: 20px; }
.footer-mission { max-width: 70ch; color: var(--text); }
.footer-legal { color: var(--muted); font-size: .9rem; max-width: 70ch; }
.footer-meta { font-size: .88rem; color: var(--muted); margin-top: 16px; }

/* ---------- search + new filters ---------- */
.search-row { display: flex; gap: 10px; align-items: center; padding-top: 20px; flex-wrap: wrap; }
.search-input { flex: 1 1 260px; min-width: 0; font: inherit; font-size: 1rem; padding: 12px 16px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.search-input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.btn-reset { padding: 9px 16px; font-size: .9rem; }
.gender-chip.gender-women.is-active { background: var(--cat-womens); border-color: var(--cat-womens); }
.gender-chip.gender-men.is-active { background: var(--brand); border-color: var(--brand); }
.gender-chip.gender-mixed.is-active { background: #7c3aed; border-color: #7c3aed; }
.gender-chip.gender-open.is-active { background: #0d9488; border-color: #0d9488; }

/* ---------- pills on cards / pages ---------- */
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.pill { display: inline-flex; align-items: center; font-size: .7rem; font-weight: 700; padding: 3px 9px;
  border-radius: 999px; border: 1px solid var(--border); color: var(--muted); background: transparent; }
.pill-gender { color: #fff; border: none; }
.gender-women { background: var(--cat-womens); }
.gender-men { background: var(--brand); }
.gender-mixed { background: #7c3aed; }
.gender-open { background: #0d9488; }
.pill-area { color: var(--muted); }
.pill-lang { color: var(--muted); }
.event-kicker .pill { font-size: .72rem; }
