/* ===== Themes (html[data-theme]) ===== */
:root,
[data-theme="daylight"] {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e3e6eb;
  --text: #111827;
  --muted: #6b7280;
  --accent: #1f2937;
  --accent-2: #e11d48;
  --on-accent: #ffffff;
  --header-bg: #ffffff;
  --header-text: #111827;
  --header-muted: #6b7280;
  --header-border: #e3e6eb;
  --header-pattern: none;
  --tile-bg: #ffffff;
  --tile-border: #e3e6eb;
  --included: #047857;
  --included-bg: #ecfdf5;
  --free: #1d4ed8;
  --free-bg: #eff6ff;
  --live: #dc2626;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.07);
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: var(--font-body);
  --head-transform: none;
  --head-weight: 700;
  --head-spacing: -0.01em;
}

[data-theme="paper"] {
  --bg: #f3eee4;
  --surface: #fbf8f2;
  --surface-2: #ece4d4;
  --border: #d9cfbd;
  --text: #1c1917;
  --muted: #78716c;
  --accent: #1c1917;
  --accent-2: #b91c1c;
  --header-bg: #f3eee4;
  --header-text: #1c1917;
  --header-muted: #78716c;
  --header-border: #1c1917;
  --tile-bg: #fbf8f2;
  --tile-border: #d9cfbd;
  --included: #166534;
  --included-bg: #e7efdf;
  --free: #1e3a8a;
  --free-bg: #e4e8f1;
  --live: #b91c1c;
  --radius: 4px;
  --radius-sm: 3px;
  --shadow: none;
  --font-head: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --head-weight: 700;
  --head-spacing: 0;
}

[data-theme="pitch"] {
  --bg: #eef3ef;
  --surface: #ffffff;
  --surface-2: #e6eee8;
  --border: #d3dfd6;
  --text: #0f1f17;
  --muted: #5b6b62;
  --accent: #146c43;
  --accent-2: #f59e0b;
  --header-bg: #11603a;
  --header-text: #ffffff;
  --header-muted: rgba(255, 255, 255, 0.78);
  --header-border: transparent;
  --header-pattern: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 80px, transparent 80px 160px);
  --tile-bg: rgba(255, 255, 255, 0.96);
  --tile-border: transparent;
  --radius: 12px;
  --font-body: "Avenir Next", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: var(--font-body);
}

[data-theme="broadcast"] {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f2f2f2;
  --border: #e2e2e2;
  --text: #0a0a0a;
  --muted: #5f5f5f;
  --accent: #0a0a0a;
  --accent-2: #facc15;
  --header-bg: #0a0a0a;
  --header-text: #ffffff;
  --header-muted: #a3a3a3;
  --header-border: var(--accent-2);
  --tile-bg: #ffffff;
  --tile-border: transparent;
  --radius: 2px;
  --radius-sm: 2px;
  --shadow: none;
  --font-head: "Avenir Next Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --head-transform: uppercase;
  --head-weight: 800;
  --head-spacing: 0.02em;
}

[data-theme="midnight"] {
  color-scheme: dark;
  --bg: #0e1116;
  --surface: #161a22;
  --surface-2: #1d222c;
  --border: #262c38;
  --text: #e8ebf0;
  --muted: #8b93a3;
  --accent: #e8ebf0;
  --accent-2: #f43f5e;
  --on-accent: #0e1116;
  --header-bg: #0e1116;
  --header-text: #e8ebf0;
  --header-muted: #8b93a3;
  --header-border: #262c38;
  --tile-bg: #161a22;
  --tile-border: #262c38;
  --included: #34d399;
  --included-bg: rgba(52, 211, 153, 0.12);
  --free: #60a5fa;
  --free-bg: rgba(96, 165, 250, 0.12);
  --live: #f43f5e;
  --shadow: none;
}

/* ===== League accents (body[data-league]) — layer on top of any theme ===== */
body[data-league="MLS"] { --accent: #1d3fbf; --accent-2: #e4002b; --on-accent: #ffffff; }
body[data-league="NWSL"] { --accent: #0b7d78; --accent-2: #e0457b; --on-accent: #ffffff; }
[data-theme="midnight"] body[data-league="MLS"] { --accent: #6b93ff; --on-accent: #0e1116; }
[data-theme="midnight"] body[data-league="NWSL"] { --accent: #2dd4bf; --on-accent: #0e1116; }
[data-theme="pitch"] body[data-league="MLS"] { --header-bg: #13315c; }
[data-theme="pitch"] body[data-league="NWSL"] { --header-bg: #0b5c58; }

/* ===== Base ===== */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s, color 0.3s;
}
.wrap { max-width: 960px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left)); }
a { color: inherit; }
h2, h3, .brand-name, .hero-title, .day-head span:first-child {
  font-family: var(--font-head);
  text-transform: var(--head-transform);
  letter-spacing: var(--head-spacing);
}

/* ===== Masthead ===== */
.masthead {
  background: var(--header-pattern), var(--header-bg);
  color: var(--header-text);
  border-bottom: 1px solid var(--header-border);
  padding-bottom: 16px;
  transition: background-color 0.3s;
}
[data-theme="broadcast"] .masthead { border-bottom-width: 5px; }
[data-theme="paper"] .masthead { border-bottom: 3px double var(--header-border); }
.mast-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; padding-bottom: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-name .ball { width: 0.74em; height: 0.74em; vertical-align: -0.07em; margin: 0 0.015em; }
.brand-name .ball:first-of-type { margin-left: 0.03em; }
.brand-name { display: block; font-size: 24px; font-weight: var(--head-weight); line-height: 1.1; }
.tagline { display: block; font-size: 13px; color: var(--header-muted); margin-top: 2px; }

/* Kit (theme) switcher */
.kit { position: relative; }
.kit-btn {
  appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 8px; border-radius: 999px; font: inherit; color: var(--header-text);
  background: color-mix(in srgb, var(--header-text) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--header-text) 18%, transparent);
  transition: background 0.2s, transform 0.2s;
}
.kit-btn:hover { background: color-mix(in srgb, var(--header-text) 14%, transparent); }
.kit-btn svg { width: 30px; height: 30px; transition: transform 0.35s cubic-bezier(.3,1.6,.5,1); }
.kit-btn:hover svg, .kit-btn[aria-expanded="true"] svg { transform: rotate(-8deg) scale(1.08); }
.kit-btn .kit-body { fill: var(--accent); stroke: var(--header-text); stroke-width: 1.4; stroke-linejoin: round; }
.kit-btn .kit-trim { fill: none; stroke: var(--accent-2); stroke-width: 2; stroke-linecap: round; }
.kit-label { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.kit-kicker { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--header-muted); }
#kitName { font-size: 13px; font-weight: 700; }
.kit-btn.spin svg { animation: kitspin 0.5s ease; }
@keyframes kitspin { 50% { transform: rotateY(90deg); } }

.popover {
  position: absolute; z-index: 50; top: calc(100% + 8px); right: 0;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 12px 40px rgba(16, 24, 40, 0.18), 0 2px 6px rgba(16, 24, 40, 0.08);
  padding: 14px; animation: pop 0.16s ease-out;
}
@keyframes pop { from { transform: translateY(-4px) scale(0.98); } }
.popover[hidden] { display: none; }
.popover-title { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.popover-hint { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
kbd { font: 600 11px var(--font-body); padding: 1px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; background: var(--surface-2); }

.kit-menu { width: 340px; }
.kit-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.kit-card {
  appearance: none; cursor: pointer; padding: 0; overflow: hidden; text-align: left; font: inherit;
  border-radius: 10px; border: 2px solid var(--border); background: var(--kc-bg); color: var(--text);
  transition: transform 0.15s, border-color 0.15s;
}
.kit-card:hover { transform: translateY(-2px); }
.kit-card[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.kc-head { height: 22px; background: var(--kc-head); display: flex; align-items: center; gap: 4px; padding: 0 6px; }
.kc-head i { width: 14px; height: 8px; border-radius: 2px; background: var(--kc-tile); }
.kc-body { padding: 6px; display: grid; gap: 4px; }
.kc-card { height: 18px; border-radius: 4px; background: var(--kc-surface); border-left: 3px solid var(--kc-accent); }
.kc-name { display: block; padding: 4px 8px 7px; font-size: 11px; font-weight: 700; background: var(--surface); border-top: 1px solid var(--border); }

.league-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.league-tile {
  appearance: none; cursor: pointer; font: inherit; color: var(--text);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 112px; padding: 14px 10px 12px;
  background: var(--tile-bg); border: 1px solid var(--tile-border); border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s;
}
.league-tile:hover { transform: translateY(-2px); }
.league-tile.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
[data-theme="broadcast"] .league-tile.active,
[data-theme="pitch"] .league-tile.active { border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-2); }
[data-theme="broadcast"] .league-tile.active .tile-label { color: var(--text); }
.tile-logos { display: flex; align-items: center; justify-content: center; gap: 14px; height: 64px; }
.tile-logos img { height: 64px; width: auto; max-width: 110px; object-fit: contain; }
.league-tile[data-league="ALL"] .tile-logos img { height: 48px; }
.tile-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.league-tile.active .tile-label { color: var(--accent); }

/* ===== Hero ===== */
.sample-banner { margin-top: 16px; padding: 10px 14px; border-radius: var(--radius-sm); background: #fef3c7; color: #78350f; font-size: 13px; font-weight: 600; }
.hero {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  margin-top: 18px; padding: 22px 24px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 4px solid var(--accent);
}
.hero-logos { display: flex; gap: 16px; align-items: center; flex: none; }
.hero-logos img { height: 96px; width: auto; max-width: 150px; object-fit: contain; }
.hero-logos .mono { width: 96px; height: 96px; font-size: 32px; }
.hero-body { flex: 1; min-width: 220px; }
.hero-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.hero-kicker img { height: 18px; }
.hero-title { margin: 4px 0 8px; font-size: 28px; font-weight: var(--head-weight); line-height: 1.15; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.stat { font-size: 13px; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text); }
.stat b { font-variant-numeric: tabular-nums; }
.stat.live { background: color-mix(in srgb, var(--live) 12%, transparent); color: var(--live); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ===== Panels & controls ===== */
.panel { margin-top: 14px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.services-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
h2 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 12px; }
.pill {
  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 13px var(--font-body); color: var(--text);
  padding: 7px 13px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  transition: background 0.2s, border-color 0.2s;
}
[data-theme="broadcast"] .pill, [data-theme="paper"] .pill { border-radius: var(--radius-sm); }
.pill:hover { background: var(--surface-2); }
.pill .check { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--muted); display: grid; place-items: center; }
.pill.on { border-color: var(--included); background: var(--included-bg); }
.pill.on .check { background: var(--included); border-color: var(--included); }
.pill.on .check::after { content: ""; width: 7px; height: 4px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.pill .tag { font-size: 10px; font-weight: 700; color: var(--free); text-transform: uppercase; letter-spacing: 0.06em; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.included { background: var(--included); }
.dot.free { background: var(--free); }
.dot.other { background: var(--muted); }

.switch { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.track { width: 38px; height: 22px; border-radius: 999px; background: var(--border); position: relative; transition: background 0.2s; }
.thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
.switch input:checked + .track { background: var(--included); }
.switch input:checked + .track .thumb { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

.toolbar { display: grid; grid-template-columns: minmax(200px, 1.6fr) repeat(3, minmax(120px, 1fr)) auto; gap: 8px; margin-top: 14px; }
.field {
  display: flex; align-items: center; gap: 8px; min-width: 0; height: 42px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.field > span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); flex: none; }
.field svg, .icon-btn svg, .text-btn svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.field svg { color: var(--muted); }
.field input, .field select { flex: 1; min-width: 0; height: 100%; background: transparent; border: 0; outline: 0; color: var(--text); font: 500 14px var(--font-body); }
.field select {
  cursor: pointer; appearance: none; -webkit-appearance: none; padding-right: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right center / 12px;
}
.field select option { background: var(--surface); color: var(--text); }
.field input::placeholder { color: var(--muted); }
.icon-btn { appearance: none; cursor: pointer; width: 42px; height: 42px; display: grid; place-items: center; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; transition: transform 0.25s; }
.icon-btn.desc svg { transform: scaleY(-1); }

.results-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 2px 0; }
.results-bar p { margin: 0; font-size: 13px; color: var(--muted); }
.results-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cal { position: relative; }
.cal-pop { width: 300px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-weight: 700; font-family: var(--font-head); }
.icon-btn.sm { width: 32px; height: 32px; min-width: 32px; min-height: 32px; font-size: 18px; line-height: 1; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow { font-size: 10px; font-weight: 700; color: var(--muted); text-align: center; padding: 4px 0; text-transform: uppercase; }
.cal-day {
  appearance: none; position: relative; height: 38px; border: 0; border-radius: 8px; cursor: pointer;
  background: transparent; color: var(--text); font: 500 13px var(--font-body); font-variant-numeric: tabular-nums;
}
.cal-day:hover:not(:disabled) { background: var(--surface-2); }
.cal-day:disabled { color: color-mix(in srgb, var(--muted) 45%, transparent); cursor: default; }
.cal-day.out { visibility: hidden; }
.cal-day.today { font-weight: 800; box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-day.selected { background: var(--accent); color: var(--on-accent); }
.cal-dots { position: absolute; left: 0; right: 0; bottom: 4px; display: flex; justify-content: center; gap: 3px; }
.cal-dots i { width: 5px; height: 5px; border-radius: 50%; }
.dot.mls, .cal-dots i.mls { background: #1d3fbf; }
.dot.nwsl, .cal-dots i.nwsl { background: #0b9e97; }
.cal-day.selected .cal-dots i { background: var(--on-accent); }
.cal-legend { display: flex; align-items: center; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend .text-btn { margin-left: auto; }

.history-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-top: 16px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  font-size: 14px; font-weight: 600;
}
.history-bar[hidden] { display: none; }

.text-btn {
  appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  font: 600 13px var(--font-body); color: var(--accent); background: none; border: 0; padding: 6px 4px;
}
.text-btn:hover { text-decoration: underline; }

/* ===== Schedule ===== */
.day { margin-top: 22px; }
.day-head { display: flex; align-items: baseline; gap: 10px; margin: 0 2px 10px; font-size: 16px; font-weight: var(--head-weight); }
.day-head .count { color: var(--muted); font-weight: 500; font-size: 13px; font-family: var(--font-body); text-transform: none; letter-spacing: 0; }
.day-head.today::before { content: "Today"; align-self: center; font: 700 11px var(--font-body); text-transform: uppercase; letter-spacing: 0.06em; color: var(--on-accent); background: var(--accent); padding: 3px 8px; border-radius: 999px; }
[data-theme="paper"] .day-head { border-bottom: 1px solid var(--text); padding-bottom: 6px; }

.card {
  display: grid; grid-template-columns: 96px 1fr auto; gap: 16px; align-items: start;
  padding: 16px 18px; margin-bottom: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 4px solid transparent;
}
.card.lg-MLS { border-left-color: #1d3fbf; }
.card.lg-NWSL { border-left-color: #0b7d78; }
.card.live { border-color: var(--live); border-left-color: var(--live); }
.card.post { opacity: 0.75; }

.when { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.time { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; color: var(--muted); }
.badge img { height: 20px; width: auto; }
.status { font-size: 12px; color: var(--muted); font-weight: 600; }
.status.live { color: var(--live); display: inline-flex; align-items: center; gap: 6px; }
.status.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 60%, transparent); } 100% { box-shadow: 0 0 0 8px transparent; } }

.teams { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.team { display: flex; align-items: center; gap: 10px; min-width: 0; }
.team img, .team .mono { width: 28px; height: 28px; flex: none; object-fit: contain; }
.team .name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.team a.name:hover { text-decoration: underline; color: var(--accent); }
.team .score { margin-left: auto; font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; }
.team.loser { color: var(--muted); }
.venue { font-size: 12px; color: var(--muted); }
.mono {
  display: grid; place-items: center; border-radius: 50%;
  font: 800 10px var(--font-body); letter-spacing: 0.02em;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}
.cal-btn { align-self: start; }

.watch { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 13px var(--font-body); text-decoration: none; color: var(--text);
  padding: 8px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  transition: background 0.2s, border-color 0.2s;
}
.btn:hover { background: var(--surface-2); }
.btn .hint { font-size: 11px; font-weight: 500; color: var(--muted); }
.btn.included { background: var(--included-bg); border-color: var(--included); color: var(--included); }
.btn.included .hint { color: var(--included); opacity: 0.8; }
.btn.free { background: var(--free-bg); border-color: color-mix(in srgb, var(--free) 50%, transparent); color: var(--free); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.1); background: var(--accent); }
.btn .direct { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 1px 6px; border-radius: 4px; border: 1px solid currentColor; }
.chip-local {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  font: 600 13px var(--font-body); color: var(--text);
  padding: 7px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
}
a.chip-local:hover { border-color: var(--accent); }
.chip-local .hint { font-size: 11px; font-weight: 500; color: var(--muted); }
.chip-local-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); }
.chip-tv { font-size: 12px; color: var(--muted); padding: 8px 12px; border-radius: var(--radius-sm); border: 1px dashed var(--border); }

.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.empty strong { display: block; color: var(--text); font-size: 17px; margin-bottom: 6px; }

.skeleton { height: 120px; border-radius: var(--radius); margin-top: 12px; background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 36px 0 28px; font-size: 12px; color: var(--muted); }

/* ===== Controls drawer (collapses on phones) ===== */
.controls-toggle { display: none; }
.controls > summary::-webkit-details-marker { display: none; }
.active-count[hidden] { display: none; }
.active-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--accent); color: var(--on-accent); }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .controls-toggle {
    display: flex; align-items: center; gap: 10px; list-style: none; cursor: pointer;
    margin-top: 14px; padding: 0 14px; height: 46px;
    font: 600 14px var(--font-body); color: var(--text);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  }
  .controls-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .controls-toggle::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform 0.2s; }
  .controls[open] .controls-toggle::after { transform: rotate(-135deg); }

  /* Compact sticky masthead with logo tabs */
  .masthead { position: sticky; top: 0; z-index: 20; padding-bottom: 10px; }
  .mast-row { padding-top: max(10px, env(safe-area-inset-top)); padding-bottom: 10px; gap: 10px; }
  .brand-name { font-size: 20px; }
  .tagline { display: none; }
  .kit-label { display: none; }
  .kit-btn { padding: 4px; }
  .kit-btn svg { width: 28px; height: 28px; }
  .kit-menu { width: min(320px, calc(100vw - 32px)); }
  .cal-pop { position: fixed; left: 16px; right: 16px; top: auto; bottom: 16px; width: auto; }
  .league-tiles { gap: 6px; }
  .league-tile { min-height: 0; flex-direction: row; gap: 8px; padding: 8px 6px; }
  .tile-logos, .tile-logos img { height: 34px; }
  .league-tile[data-league="ALL"] .tile-logos img { height: 24px; }
  .tile-logos { gap: 6px; }
  .tile-label { font-size: 11px; }
  .tile-label { display: none; }
  .league-tile:hover { transform: none; }

  .day-head, .card { scroll-margin-top: 130px; }
  .hero { margin-top: 12px; padding: 16px; gap: 14px; border-top-width: 3px; }
  .hero-logos img { height: 56px; }
  .hero-logos .mono { width: 56px; height: 56px; font-size: 20px; }
  .hero-title { font-size: 21px; margin-bottom: 6px; }
  .hero-body { min-width: 0; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }

  .panel { padding: 14px; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .toolbar .search { grid-column: 1 / -1; }
  .toolbar .icon-btn { width: 100%; }
  .field input, .field select { font-size: 16px; } /* stops iOS zoom on focus */

  .card { grid-template-columns: 1fr auto; gap: 10px; padding: 14px; }
  .when { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 10px; }
  .team .name { font-size: 16px; }
  .watch { gap: 6px; }
  .watch .btn { flex: 1 1 100%; justify-content: center; min-height: 44px; }
  .chip-tv, .chip-local { flex: 1 1 100%; justify-content: center; text-align: center; min-height: 40px; }
  .results-bar { flex-wrap: wrap; margin-top: 14px; }
  .foot { flex-direction: column; }
}
@media (pointer: coarse) {
  .pill { min-height: 40px; }
  .icon-btn { min-width: 44px; min-height: 44px; }
}
@media (min-width: 641px) and (max-width: 760px) {
  .toolbar { grid-template-columns: 1fr 1fr; }
  .toolbar .search { grid-column: 1 / -1; }
  .toolbar .icon-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
