/* Sports Calendar. Visual system follows Money With AI (moneywithai.net): near-white page,
   thin gray lines, 20px cards, blue gradient primary button, light and dark themes. */
:root {
  --page: #FDFDFD; --card: #FFFFFF; --surface: #F7F7F7; --ink: #242424; --body: #3D3D3D;
  --muted: #6F6F6F; --line: #EFEFEF; --line-2: #E6E6E6; --blue: #006EFF; --blue-50: #EFF6FF;
  --blue-150: #D6E8FC; --green: #17A34A; --green-50: #F3FFEF; --amber: #8A6A00; --amber-50: #FFFBEF;
  --shadow: 0 2px 16px 0 rgba(0, 0, 0, 0.03); --shadow-lg: 0 10px 40px -10px rgba(0, 0, 0, 0.10);
  --r-card: 20px; --r-ctl: 13px;
  --font-display: 'General Sans', 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0B0B0B; --card: #141414; --surface: #1B1B1B; --ink: #F2F2F2; --body: #D8D8D8; --muted: #9A9A9A;
    --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.14); --blue: #8AA9FF; --blue-50: rgba(138,169,255,.12);
    --blue-150: rgba(138,169,255,.30); --green: #7BD0A2; --green-50: rgba(123,208,162,.12); --amber: #E5C05C;
    --amber-50: rgba(229,192,92,.12); --shadow: none; --shadow-lg: 0 0 0 1px rgba(255,255,255,.10); --r-card: 14px; --r-ctl: 10px;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #0B0B0B; --card: #141414; --surface: #1B1B1B; --ink: #F2F2F2; --body: #D8D8D8; --muted: #9A9A9A;
  --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.14); --blue: #8AA9FF; --blue-50: rgba(138,169,255,.12);
  --blue-150: rgba(138,169,255,.30); --green: #7BD0A2; --green-50: rgba(123,208,162,.12); --amber: #E5C05C;
  --amber-50: rgba(229,192,92,.12); --shadow: none; --shadow-lg: 0 0 0 1px rgba(255,255,255,.10); --r-card: 14px; --r-ctl: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--page); color: var(--body); font-family: var(--font-body); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); color: var(--ink); font-weight: 600; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: 56px; line-height: 1.05; }
h2 { font-size: 30px; line-height: 1.15; }
h3 { font-size: 18px; line-height: 1.3; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--card); padding: 8px 12px; z-index: 10; }

/* Header */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1080px; margin: 0 auto; padding: 18px 24px; }
.wordmark { white-space: nowrap; display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--ink); letter-spacing: -0.01em; }
.wordmark:hover { text-decoration: none; }
.wordmark-by { color: var(--muted); font-weight: 500; }
.logo { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(to bottom, #2965EC, #5C89F8); display: grid; place-items: center; box-shadow: 0 2px 10px rgba(75,131,253,.25); }
.site-nav { display: flex; align-items: center; gap: 4px; }
.nav-link { white-space: nowrap; padding: 8px 12px; border-radius: 10px; color: var(--body); font-size: 15px; }
.nav-link:hover, .nav-link[aria-current="page"] { background: var(--surface); color: var(--ink); text-decoration: none; }
.theme-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); color: var(--body); display: grid; place-items: center; cursor: pointer; margin-left: 6px; }
.theme-btn svg { display: none; }
:root[data-theme-pref="light"] .i-sun, :root[data-theme-pref="dark"] .i-moon, :root[data-theme-pref="system"] .i-sys, :root:not([data-theme-pref]) .i-sys { display: block; }

/* Buttons */
.pbtn-wrap { display: inline-block; border-radius: 14px; padding: 1px; background: linear-gradient(to bottom, #5989F0, #578AFA); box-shadow: 0 2px 10.1px 0 rgba(75,131,253,.20); transition: transform 200ms ease; }
.pbtn-wrap:hover { transform: scale(1.03); }
.pbtn { display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; border-radius: 13px; background: linear-gradient(to bottom, #2965EC, #5C89F8); color: #fff; font: 500 16px/1 var(--font-body); height: 46px; padding: 0 22px; }
a.pbtn:hover { text-decoration: none; }
.sbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 13px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font: 500 16px/1 var(--font-body); cursor: pointer; }
.sbtn:hover { background: var(--surface); text-decoration: none; }

/* Hero */
.hero { padding: 56px 0 40px; text-align: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--blue-50); color: var(--blue); font-size: 13px; font-weight: 500; margin-bottom: 20px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-50); }
.lead { max-width: 640px; margin: 18px auto 0; font-size: 18px; color: var(--muted); }
.hero-ctas { display: flex; gap: 12px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.tz-note { margin-top: 18px; font-size: 14px; color: var(--muted); }
.tz-note strong { color: var(--ink); font-weight: 500; }

/* Sections and cards */
.section { padding: 32px 0 24px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head p { margin: 6px 0 0; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r-card); box-shadow: var(--shadow); }
.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sport-card { padding: 22px; display: flex; flex-direction: column; gap: 10px; color: var(--body); min-height: 168px; transition: box-shadow .2s, transform .2s; }
a.sport-card:hover { text-decoration: none; box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.sport-card .icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--surface); }
.sport-card p { margin: 0; color: var(--muted); font-size: 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); width: fit-content; }
.pill-live { color: var(--green); background: var(--green-50); border-color: transparent; }
.pill-tbc { color: var(--amber); background: var(--amber-50); border-color: transparent; }
.step { padding: 22px; }
.step-n { font-family: var(--font-mono); font-size: 13px; color: var(--blue); }
.step p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }

/* Club picker */
.search { width: 100%; max-width: 360px; height: 44px; border-radius: var(--r-ctl); border: 1px solid var(--line-2); background: var(--card); color: var(--ink); padding: 0 14px; font-size: 15px; }
.club-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: var(--body); transition: box-shadow .2s, transform .2s; }
a.club-card:hover { text-decoration: none; box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.club-card .name { font-weight: 600; color: var(--ink); }
.club-card .next { font-size: 13px; color: var(--muted); }
.badge { flex: none; display: block; border-radius: 12px; }
.badge.crest { object-fit: contain; border-radius: 0; background: transparent; }
:root[data-theme="dark"] .badge.crest { filter: drop-shadow(0 0 1px rgba(255,255,255,.75)) drop-shadow(0 0 4px rgba(255,255,255,.15)); }

/* Club and F1 page */
.crumbs { font-size: 14px; color: var(--muted); padding-top: 12px; }
.page-head { display: flex; align-items: center; gap: 18px; padding: 22px 0 8px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; padding: 18px 0 40px; }
.subscribe { padding: 22px; position: sticky; top: 16px; }
.subscribe h2 { font-size: 22px; }
.subscribe p { color: var(--muted); font-size: 14px; margin: 8px 0 16px; }
.sub-list { display: grid; gap: 10px; }
.sub-btn { display: flex; align-items: center; gap: 12px; height: 50px; padding: 0 16px; border-radius: var(--r-ctl); border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font-weight: 500; font-size: 15px; cursor: pointer; text-align: left; font-family: var(--font-body); width: 100%; }
.sub-btn:hover { background: var(--surface); text-decoration: none; }
.sub-btn.primary { border: 0; color: #fff; background: linear-gradient(to bottom, #2965EC, #5C89F8); box-shadow: 0 2px 10.1px rgba(75,131,253,.2); }
.sub-btn.primary:hover { filter: brightness(1.05); }
.sub-btn .k { margin-left: auto; font-size: 12px; opacity: .75; font-weight: 400; }
.sub-foot { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); display: grid; gap: 6px; }
.feed-url { font-family: var(--font-mono); font-size: 12px; word-break: break-all; color: var(--muted); background: var(--surface); border-radius: 8px; padding: 8px 10px; margin-top: 4px; }
.toast { font-size: 13px; color: var(--green); min-height: 18px; margin-top: 8px; }
.next-card { padding: 22px; margin-bottom: 14px; display: grid; gap: 6px; }
.next-card .vs { font-family: var(--font-display); font-size: 26px; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; }
.label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 500; }
.fixtures { padding: 6px 0; }
.fx { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); }
.fx:first-child { border-top: 0; }
.fx .when { font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.fx .when small { display: block; color: var(--muted); font-size: 12px; }
.fx .teams { color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.fx .md { font-size: 12px; color: var(--muted); }
.score { font-family: var(--font-mono); font-size: 14px; color: var(--ink); }
details.past { margin-top: 14px; }
details.past summary { cursor: pointer; padding: 14px 20px; font-weight: 500; color: var(--ink); list-style: none; }
details.past summary::-webkit-details-marker { display: none; }
details.past summary::after { content: '+'; float: right; color: var(--muted); }
details.past[open] summary::after { content: '−'; }

/* F1 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); font-size: 14px; color: var(--body); }
.chip input:checked + span { background: var(--blue-50); border-color: var(--blue-150); color: var(--blue); font-weight: 500; }
.chip input:checked + span::before { content: '✓'; }
.chip input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.race { padding: 18px 20px; }
.race + .race { margin-top: 12px; }
.race-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 8px; }
.race-head span { color: var(--muted); font-size: 13px; }
.sess { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.sess .s-name { color: var(--ink); }
.sess.off { opacity: .4; }

.picker { border: 0; padding: 0; margin: 0 0 16px; }
.picker legend { margin-bottom: 8px; width: 100%; }
.past-inner { padding: 0 14px 14px; }
.sub-btn.disabled { pointer-events: none; opacity: .45; }

/* Prose pages */
.prose { max-width: 720px; padding: 24px 0 48px; }
.prose h1 { font-size: 40px; margin-bottom: 18px; }
.prose h2 { font-size: 22px; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--body); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 28px 0 40px; font-size: 14px; color: var(--muted); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.fine { max-width: 560px; margin: 0; }

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr; }
  .layout { grid-template-columns: 1fr; }
  .subscribe { position: static; order: -1; }
  h1 { font-size: 40px; }
}
@media (max-width: 560px) {
  .wrap, .site-header { padding-left: 16px; padding-right: 16px; }
  .grid-4 { grid-template-columns: 1fr; }
  h1 { font-size: 34px; }
  .hero { padding-top: 32px; }
  .wordmark-by, .nav-hide-sm { display: none; }
  .site-header { gap: 8px; }
  .wordmark { font-size: 16px; gap: 8px; }
  .nav-link { padding: 8px 8px; font-size: 14px; }
  .theme-btn { margin-left: 2px; }
  .fx { grid-template-columns: 1fr auto; padding: 12px 16px; }
  .fx .when { grid-column: 1 / -1; }
  .sess { grid-template-columns: 130px minmax(0, 1fr); }
  .section-head { flex-direction: column; align-items: stretch; }
  .search { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
