:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --text: #0e1525;
  --muted: #5b6474;
  --line: #e3e6eb;
  --brand: #0a7d5a;
  --brand-soft: #e3f4ee;
  --on-brand: #ffffff;
  --live: #d92d3a;
  --live-soft: #fde8ea;
  --focus: #2f6fed;
  --fav: #e8a317;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(16 24 40 / 4%), 0 1px 3px rgb(16 24 40 / 6%);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f17;
    --surface: #121825;
    --surface-2: #1a2131;
    --text: #e8ebf1;
    --muted: #9aa3b4;
    --line: #242c3c;
    --brand: #3cc497;
    --brand-soft: #123327;
    --on-brand: #04140e;
    --live: #ff5c68;
    --live-soft: #3a1418;
    --focus: #7aa5ff;
    --fav: #f5b83d;
    --shadow: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0b0f17;
  --surface: #121825;
  --surface-2: #1a2131;
  --text: #e8ebf1;
  --muted: #9aa3b4;
  --line: #242c3c;
  --brand: #3cc497;
  --brand-soft: #123327;
  --on-brand: #04140e;
  --live: #ff5c68;
  --live-soft: #3a1418;
  --focus: #7aa5ff;
  --fav: #f5b83d;
  --shadow: none;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* Header */

.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; }
.brand-mark rect { fill: var(--brand); }
.brand-mark path { fill: none; stroke: var(--on-brand); stroke-width: 2.4; stroke-linecap: round; }
.brand-mark .play { fill: var(--on-brand); stroke-width: 1.5; stroke-linejoin: round; }
.brand-name { font-size: 19px; font-weight: 650; letter-spacing: -0.02em; }
.brand-name span { color: var(--brand); }
.regions { display: flex; gap: 2px; font-size: 14px; }
.regions a { padding: 5px 10px; border-radius: 999px; color: var(--muted); text-decoration: none; }
.regions a:hover { color: var(--text); background: var(--surface-2); }
.regions a.is-current { color: var(--text); background: var(--surface-2); font-weight: 600; }

/* Day strip */

.days {
  display: flex;
  gap: 6px;
  margin: 20px -16px 0;
  padding: 0 16px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.days::-webkit-scrollbar { display: none; }
.day {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 74px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-decoration: none;
  line-height: 1.25;
}
.day:hover { border-color: var(--muted); }
.day-name { font-size: 14px; font-weight: 600; }
.day-sub { font-size: 12px; color: var(--muted); }
.day.is-current { background: var(--text); border-color: var(--text); color: var(--bg); }
.day.is-current .day-sub { color: inherit; opacity: 0.75; }

/* Headings and chips */

.page-title { margin: 28px 0 14px; font-size: clamp(26px, 4.5vw, 34px); line-height: 1.15; letter-spacing: -0.025em; font-weight: 700; }

.sports { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.chip:hover { background: var(--line); }
.chip-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip.is-current { background: var(--brand); color: var(--on-brand); }
.chip.is-current .chip-count { color: inherit; opacity: 0.8; }

/* Sections */

.block { margin-top: 28px; }
.block-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.block-count { font-weight: 500; opacity: 0.8; }
details.block > summary { list-style: none; cursor: pointer; }
details.block > summary::-webkit-details-marker { display: none; }
details.block > summary .block-title::after { content: "▾"; font-size: 12px; transition: transform 0.15s; }
details.block:not([open]) > summary .block-title::after { transform: rotate(-90deg); }

.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 var(--live); animation: pulse 2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 60%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

/* Event list */

.events {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.events > li { margin-top: -1px; border-top: 1px solid var(--line); }
.event {
  display: grid;
  grid-template-columns: 64px minmax(220px, 1fr) auto;
  gap: 4px 16px;
  align-items: center;
  padding: 14px 16px;
  position: relative;
}
.event:hover { background: var(--surface-2); }
/* The title link covers the whole row; the sport and competition links sit above it. */
.ev-title { color: inherit; text-decoration: none; }
.ev-title::after { content: ""; position: absolute; inset: 0; }
.ev-title:focus-visible { outline: none; }
.ev-title:focus-visible::after { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: 4px; }
.ev-meta a { position: relative; z-index: 1; color: inherit; text-decoration: none; }
.ev-meta a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.event.is-featured { background: color-mix(in srgb, var(--brand-soft) 55%, var(--surface)); box-shadow: inset 3px 0 0 var(--brand); }
.event.is-featured:hover { background: var(--brand-soft); }
.badge-featured {
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ev-blurb {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}
.ev-more { font-size: 13px; font-weight: 600; color: var(--brand); }
.event.is-finished { opacity: 0.6; }
.ev-time { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.badge-live {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--live);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ev-main { display: flex; flex-direction: column; min-width: 0; }
.ev-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin: 0; font-size: 13px; color: var(--muted); }
.ev-status { color: var(--live); font-weight: 600; }
.ev-title { font-size: 16px; font-weight: 600; line-height: 1.35; }
.ev-where { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 360px; }

.ic-sport { width: 16px; height: 16px; color: var(--c, var(--muted)); opacity: 1; stroke-width: 1.9; }
.chip .ic-sport { width: 15px; height: 15px; }
.chip.is-current .ic-sport { color: inherit; }
.sport-football { --c: #16a34a; }
.sport-ice-hockey { --c: #0284c7; }
.sport-handball { --c: #ea580c; }
.sport-bandy { --c: #0891b2; }
.sport-floorball { --c: #7c3aed; }
.sport-basketball { --c: #d97706; }
.sport-tennis { --c: #65a30d; }
.sport-golf { --c: #15803d; }
.sport-motorsport { --c: #dc2626; }
.sport-cycling { --c: #db2777; }
.sport-athletics { --c: #c2410c; }
.sport-winter-sports { --c: #2563eb; }
.sport-combat-sports { --c: #9f1239; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ic-sport { filter: brightness(1.35) saturate(0.9); }
}
:root[data-theme="dark"] .ic-sport { filter: brightness(1.35) saturate(0.9); }

.bc {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.bc em { font-style: normal; font-size: 11px; font-weight: 650; color: var(--brand); }
.bc-from { font-size: 11px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }

.ic { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: 0.75; }
.bc-stream .ic path { fill: currentColor; }

.empty {
  margin: 20px 0 0;
  padding: 28px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 640px) {
  .event { grid-template-columns: 52px 1fr; }
  .ev-where { grid-column: 2; justify-content: flex-start; margin-top: 6px; }
  .ev-time { font-size: 16px; }
  .sports { flex-wrap: nowrap; margin: 0 -16px 8px; padding: 0 16px 4px; overflow-x: auto; scrollbar-width: none; }
  .sports::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
}

/* Filters and favourites (app.js) */

.tools { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-top: 4px; }
.chip-outline { background: transparent; border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.chip-outline:hover { background: var(--surface-2); }
.chip-outline[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--text); }
.chip .ic { opacity: 0.8; }
.services { flex: 1 1 100%; }
.services > summary { list-style: none; display: inline-flex; }
.services > summary::-webkit-details-marker { display: none; }
.services[open] > summary { background: var(--surface-2); }
.services-panel {
  margin-top: 8px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.services-help { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.services-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 16px; }
.service { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.service input { width: 16px; height: 16px; accent-color: var(--brand); }
.tools:has(.services:not([open])) .services { flex: 0 0 auto; }

.bc .ic-check { display: none; }
.bc.is-mine { border-color: var(--brand); background: var(--brand-soft); }
.bc.is-mine .ic-check { display: block; color: var(--brand); opacity: 1; stroke-width: 2.4; }

.ev-title .ic-fav { display: none; width: 14px; height: 14px; margin-left: 6px; vertical-align: -1px; fill: var(--fav); stroke: var(--fav); opacity: 1; }
li.is-fav .ev-title .ic-fav { display: inline-block; }
.block-title .ic-star, .chip-outline[aria-pressed="true"] .ic-star { fill: var(--fav); stroke: var(--fav); opacity: 1; }
.follow { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-top: 14px; }
.follow .calendar[open] { flex-basis: 100%; }

/* Event page */

.crumbs { margin: 20px 0 0; font-size: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.event-page > .ev-meta { margin-top: 20px; }
.event-page .page-title { margin-top: 6px; }
.when { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; font-size: 18px; font-weight: 600; }
.status { padding: 2px 9px; border-radius: 999px; background: var(--surface-2); font-size: 13px; }
.status-live { background: var(--live-soft); color: var(--live); }
.venue { margin: 6px 0 0; color: var(--muted); }

.watch { display: grid; gap: 16px; }
.watch-label { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.watch-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.watch-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.watch-item + .watch-item { border-top: 1px solid var(--line); }
.watch-name { font-weight: 600; }
.watch-sub { font-size: 13px; color: var(--muted); }
.watch-from { font-size: 13px; font-weight: 600; }
.event-page .ev-meta { flex-wrap: wrap; }
.lead { margin-top: 18px; }
.lead p { font-size: 17px; }
.access-free { color: var(--brand); font-weight: 600; }
.venue a, .src { color: var(--muted); text-underline-offset: 2px; }
.venue a:hover, .src:hover { color: var(--text); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn .ic { opacity: 1; }

.prose { max-width: 65ch; }
.prose p { margin: 0 0 1em; font-size: 17px; line-height: 1.65; }

.notfound { padding: 40px 0; }

/* Footer */

.site-footer { margin-top: 56px; padding: 28px 0 44px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.site-footer p { margin: 0 0 4px; }

/* Views, listings and search */

.views { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 2px 0 10px; font-size: 14px; }
.views a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; }
.views a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.block-title a { color: inherit; text-decoration: none; }
.block-title a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.link-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.link-chips .chip { text-decoration: none; }
.pager { display: flex; justify-content: space-between; gap: 8px; margin-top: 20px; }
.pager .chip { text-decoration: none; }
.ev-with { margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--brand); }
.watch-name a { color: inherit; text-decoration: none; }
.watch-name a:hover { text-decoration: underline; text-underline-offset: 2px; }

.search { margin: 4px 0 8px; }
.search-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.search-input:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
.search-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 16px; margin: 0; padding: 0; list-style: none; }
.search-list a { display: flex; align-items: center; gap: 8px; padding: 7px 0; color: var(--text); text-decoration: none; }
.search-sport { margin-left: auto; color: var(--muted); font-size: 13px; }
.search-list a:hover { text-decoration: underline; text-underline-offset: 2px; }
.ev-night { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.site-footer a { color: inherit; text-underline-offset: 2px; }
.about { padding-top: 8px; }

/* How to watch and the subscription picker */

.coverage-intro { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.coverage-list { margin: 0; padding: 0; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.coverage-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; font-weight: 500; }
.coverage-list li + li { border-top: 1px solid var(--line); }
.coverage-count { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.coverage-more { margin: 10px 0 0; font-size: 14px; }
.coverage-more a { color: var(--brand); text-decoration: none; font-weight: 600; }
.picker-group { margin: 20px 0 0; padding: 0; border: 0; }
.picker-group legend { display: flex; padding: 0; }
.picker-summary { margin: 0 0 10px; font-size: 17px; font-weight: 600; }

/* Calendar subscriptions */

.calendar > summary { list-style: none; display: inline-flex; }
.calendar > summary::-webkit-details-marker { display: none; }
.calendar[open] > summary { background: var(--surface-2); }
.calendar-panel {
  flex-basis: 100%;
  margin-top: 8px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.calendar-panel p { margin: 0 0 10px; }
.calendar-url { font-size: 13px; padding: 8px 10px; }
.favs-calendar { margin-top: 10px; }

/* Report an error */

.report { margin-top: 32px; font-size: 14px; }
.report > summary { cursor: pointer; color: var(--muted); text-underline-offset: 2px; text-decoration: underline; }
.report form { display: grid; gap: 8px; max-width: 560px; margin-top: 10px; }
.report textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; resize: vertical; }
.report .btn { justify-self: start; border: 0; cursor: pointer; font: inherit; font-weight: 600; }
.report-status { margin: 10px 0 0; font-weight: 600; color: var(--brand); }
.report-hp { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }

/* Changes */

.badge-changed { margin-left: 4px; padding: 1px 7px; border-radius: 5px; background: var(--live-soft); color: var(--live); font-size: 11px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; white-space: nowrap; }
.change-list { margin: 0; padding: 12px 16px 12px 32px; background: var(--live-soft); border-radius: var(--radius); }
.change-list li { margin: 2px 0; }

/* Alerts */

.push { flex-basis: 100%; }
.push-help { margin: 6px 0 0; }
.push [aria-pressed="true"] .ic { color: var(--brand); opacity: 1; }
.answer { margin: 0 0 14px; }

/* Country chooser at / */

.root { max-width: 520px; padding-top: 48px; }
.root .page-title { display: flex; align-items: center; gap: 12px; }
.root .brand-mark { width: 40px; height: 40px; }
.root-countries { display: grid; gap: 10px; margin: 28px 0 0; padding: 0; list-style: none; }
.root-countries a { display: grid; gap: 2px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); text-decoration: none; }
.root-countries a:hover { border-color: var(--brand); }
.root-countries strong { font-size: 18px; }
.root-countries span { color: var(--muted); font-size: 14px; }

/* Rights on league pages */

.rights-list { margin: 0 0 10px; padding: 0; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.rights-list li { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 11px 16px; }
.rights-list li + li { border-top: 1px solid var(--line); }
.rights-channels { color: var(--muted); font-size: 14px; }
.rights-scope { margin-top: 2px; font-size: 14px; color: var(--muted); }
.rights-access { flex: none; font-size: 14px; color: var(--muted); }
.rights-access.access-free { color: var(--brand); font-weight: 600; }
.share-row { margin: 10px 0 0; }
.share-row .calendar-url { margin-top: 8px; }
