:root {
  --brand: #a6192e;
  --brand-dark: #7a1320;
  --brand-tint: #fbeaec;
  --surface: #ffffff;
  --surface-alt: #f6f5f6;
  --border: #e5e2e3;
  --text: #1a1a1a;
  --muted: #6b6468;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 10, 12, .05), 0 4px 14px rgba(20, 10, 12, .06);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--surface-alt);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; margin-top: 2rem; }
h3 { font-size: 1.05rem; color: var(--muted); font-weight: 600; margin-top: 1.25rem; }
p { margin: 0 0 1em; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.muted { color: var(--muted); font-size: .9rem; }

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; gap: 12px; position: relative; }
.site-logo { display: flex; align-items: center; gap: 10px; color: var(--text); }
.site-logo:hover { text-decoration: none; }
.site-logo-mark { flex: none; border-radius: 8px; }
.logo-fed { font-weight: 800; font-size: 1.05rem; color: var(--text); letter-spacing: -.01em; }

.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); cursor: pointer;
}

.site-nav {
  display: none;
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  flex-direction: column;
  padding: 8px 16px 16px;
}
.site-nav.open { display: flex; }
.site-nav a { padding: 12px 4px; border-bottom: 1px solid var(--border); color: var(--text); font-weight: 500; }
.site-nav a:last-child { border-bottom: none; }
.site-nav a:hover { color: var(--brand); text-decoration: none; }
.site-nav a.active { color: var(--brand); font-weight: 700; }

@media (min-width: 720px) {
  .nav-toggle { display: none; }
  .site-nav {
    display: flex; position: static; flex-direction: row; gap: 4px;
    background: none; border: none; box-shadow: none; padding: 0;
  }
  .site-nav a { border-bottom: none; padding: 8px 12px; border-radius: var(--radius-sm); }
  .site-nav a:hover { background: var(--surface-alt); }
  .site-nav a.active { background: var(--brand-tint); }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(155deg, var(--brand), var(--brand-dark));
  color: #fff;
  margin: 0 0 24px;
  padding: 36px 0 28px;
}
.hero h1 { font-size: 1.9rem; margin-bottom: .3em; }
.hero p { color: rgba(255,255,255,.88); max-width: 560px; margin-bottom: 20px; }

.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.stat-card {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  text-align: center;
}
.stat-card .stat-value { display: block; font-size: 1.4rem; font-weight: 800; }
.stat-card .stat-label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: rgba(255,255,255,.85); margin-top: 2px; }

@media (min-width: 560px) {
  .hero h1 { font-size: 2.3rem; }
  .stat-card .stat-value { font-size: 1.7rem; }
}

/* ---------- Sections & tiles ---------- */
main { min-height: 60vh; padding-bottom: 40px; }
section + section { margin-top: 8px; }

.tile-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr; gap: 10px;
}
.tile-grid li { margin: 0; }
.tile {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
  color: var(--text); font-weight: 600;
}
.tile:hover { border-color: var(--brand); text-decoration: none; }
.tile .muted { font-weight: 400; }

@media (min-width: 640px) {
  .tile-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .tile-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Match cards ---------- */
.match-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.match-card {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; box-shadow: var(--shadow);
  font-size: .92rem;
}
.match-card .match-date { flex: none; width: 100%; color: var(--muted); font-size: .78rem; order: -1; }
.match-card .match-teams { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.match-card .match-teams a { color: var(--text); font-weight: 600; }
.match-card .team-name { overflow-wrap: anywhere; }
.match-card .match-score {
  flex: none; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 999px;
  padding: 3px 10px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.match-card .match-comp { flex: none; width: 100%; color: var(--muted); font-size: .78rem; }

@media (min-width: 640px) {
  .match-card { font-size: .95rem; }
  .match-card .match-date { width: auto; order: 0; flex: none; min-width: 90px; }
  .match-card .match-comp { width: auto; margin-left: auto; }
}

/* ---------- Standings ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 24px; }
.standings-table { width: 100%; min-width: 480px; border-collapse: collapse; background: var(--surface); font-size: .88rem; }
.standings-table th, .standings-table td { padding: 9px 10px; text-align: center; border-bottom: 1px solid var(--border); white-space: nowrap; }
.standings-table thead th { background: var(--surface-alt); color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; position: sticky; top: 0; }
.standings-table td:nth-child(2), .standings-table th:nth-child(2) { text-align: left; }
.standings-table td:nth-child(1) { color: var(--muted); font-weight: 700; }
.standings-table td:first-child, .standings-table th:first-child,
.standings-table td:nth-child(2), .standings-table th:nth-child(2) {
  position: sticky; background: var(--surface);
}
.standings-table td:first-child, .standings-table th:first-child { left: 0; }
.standings-table td:nth-child(2), .standings-table th:nth-child(2) { left: 34px; box-shadow: 2px 0 4px -2px rgba(0,0,0,.1); }
.standings-table thead th:first-child, .standings-table thead th:nth-child(2) { background: var(--surface-alt); }
.standings-table tbody tr:nth-child(odd) td:not(:first-child):not(:nth-child(2)) { background: var(--surface-alt); }
.standings-table tbody tr:nth-child(odd) td:first-child,
.standings-table tbody tr:nth-child(odd) td:nth-child(2) { background: #fbfafa; }
.standings-table tbody tr:first-child td:first-child { border-left: 3px solid var(--brand); }

/* ---------- News ---------- */
.news-teaser { border-bottom: 1px solid var(--border); padding: 16px 0; }
.news-teaser h2 { margin: 0 0 4px; font-size: 1.1rem; }
.news-body { margin: 16px 0; }
.news-article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }

/* ---------- Legal pages ---------- */
.legal-page {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow); max-width: 760px; margin-top: 8px;
}
.legal-page h2 { font-size: 1rem; margin: 1.6em 0 .6em; color: var(--text); }
.legal-page h2:first-of-type { margin-top: 0; }
.legal-page ul { padding-left: 20px; line-height: 1.9; }
.legal-page code { background: var(--surface-alt); border-radius: 4px; padding: 1px 5px; font-size: .85em; }
.legal-updated { color: var(--muted); font-size: .82rem; margin-top: 24px; }

/* ---------- Cookie notice ---------- */
.cookie-notice {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30;
  background: var(--text); color: #fff;
  border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.25);
  padding: 14px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  max-width: 620px; margin: 0 auto;
}
.cookie-notice[hidden] { display: none; }
.cookie-notice p { margin: 0; font-size: .85rem; line-height: 1.5; flex: 1 1 220px; color: rgba(255,255,255,.92); }
.cookie-notice a { color: #fff; text-decoration: underline; }
.cookie-notice button {
  flex: none; background: #fff; color: var(--text); border: none; border-radius: var(--radius-sm);
  padding: 8px 16px; font-weight: 700; font-size: .85rem; cursor: pointer;
}
.cookie-notice button:hover { background: var(--brand-tint); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 32px; padding: 20px 0; color: var(--muted); font-size: .85rem; }
