:root {
  --red: #d5122b;
  --red-dark: #a50e22;
  --ink: #1a1a1e;
  --slate: #55555f;
  --bg: #ffffff;
  --bg-alt: #f6f4f0;
  --line: #e7e3dc;
  --shadow: 0 8px 30px rgba(20, 20, 25, 0.08);
  --radius: 16px;
  --maxw: 1100px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-mark { color: var(--red); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
  font-weight: 600;
  font-size: 0.95rem;
}

.lang-toggle {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--slate);
  font-weight: 800;
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all 0.15s;
}
.lang-toggle:hover { border-color: var(--red); color: var(--red); }
.nav-links a { color: var(--slate); transition: color 0.15s; }
.nav-links a:hover { color: var(--red); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
}

/* ---------- Hero ---------- */
.hero {
  background:
    linear-gradient(135deg, rgba(213, 18, 43, 0.92), rgba(120, 8, 24, 0.92)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M0 0h30v30H0zM30 30h30v30H30z' fill='%23ffffff' fill-opacity='0.04'/%3E%3C/svg%3E");
  color: #fff;
}
.hero-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 96px 24px 104px;
  text-align: center;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  font-weight: 700;
  opacity: 0.85;
  margin: 0 0 12px;
}
.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 1.05;
  margin: 0 0 18px;
  letter-spacing: -0.03em;
  font-weight: 800;
}
.hero h1 span { color: #ffd5db; }
.lede {
  max-width: 620px;
  margin: 0 auto 32px;
  font-size: 1.15rem;
  opacity: 0.95;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.98rem;
  transition: transform 0.12s, box-shadow 0.15s, background 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: #fff; color: var(--red-dark); box-shadow: var(--shadow); }
.btn-primary:hover { box-shadow: 0 12px 34px rgba(0,0,0,0.2); }
.btn-ghost { border: 2px solid rgba(255,255,255,0.6); color: #fff; }
.btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,0.1); }

/* ---------- Sections ---------- */
.section { padding: 76px 24px; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: var(--maxw); margin: 0 auto 40px; text-align: center; }
.section-head.subsection { margin-top: 60px; }
.section-head h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0 0 10px;
  letter-spacing: -0.02em;
  font-weight: 800;
}
.section-head p { color: var(--slate); font-size: 1.1rem; margin: 0; }

/* ---------- Cards ---------- */
.grid {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s, box-shadow 0.18s;
  color: var(--ink);
  text-decoration: none;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-link { cursor: pointer; }
.card-link:hover h3 { color: var(--red); }
.card-arrow { font-size: 0.85em; color: var(--slate); }
.card-link:hover .card-arrow { color: var(--red); }
.card-emoji {
  font-size: 2.4rem;
  padding: 26px 22px 0;
}
.card-body { padding: 12px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.card h3 { margin: 6px 0 6px; font-size: 1.2rem; letter-spacing: -0.01em; }
.card p { margin: 0 0 14px; color: var(--slate); font-size: 0.97rem; flex: 1; }
.tag {
  align-self: flex-start;
  background: rgba(213, 18, 43, 0.08);
  color: var(--red-dark);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

/* ---------- Filter chips ---------- */
.filters {
  max-width: var(--maxw);
  margin: 0 auto 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--slate);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--red); color: var(--red); }
.chip.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* Second-level club filter */
.club-filters { margin-top: -16px; }
.chip-club { font-size: 0.86rem; padding: 7px 14px; }
/* "View table" shortcut — an action, not a filter, so it reads differently */
.chip-table {
  font-size: 0.86rem;
  padding: 7px 14px;
  color: var(--red);
  border-color: var(--red);
  text-decoration: none;
  margin-left: 4px;
}
.chip-table:hover { background: var(--red); color: #fff; }
/* "Past results" shortcut — jumps to the archive panel */
.chip-archive {
  font-size: 0.86rem;
  padding: 7px 14px;
  color: var(--slate);
  text-decoration: none;
  margin-left: 4px;
}
.chip-archive:hover { border-color: var(--red); color: var(--red); }
.club-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

/* ---------- Calendar ---------- */
.calendar {
  max-width: 380px;
  margin: 0 auto 40px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 16px 18px;
  background: #fff;
}
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-title { font-weight: 800; font-size: 1rem; text-transform: capitalize; }
.cal-nav {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--slate);
  width: 32px;
  height: 32px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: all 0.15s;
}
.cal-nav:hover { border-color: var(--red); color: var(--red); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--slate);
  text-transform: uppercase;
  padding-bottom: 6px;
  letter-spacing: 0.03em;
}
.cal-day {
  aspect-ratio: 1 / 1;
  border: none;
  background: transparent;
  border-radius: 9px;
  font-size: 0.9rem;
  color: var(--slate);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: default;
  font-family: inherit;
}
.cal-day.empty { visibility: hidden; }
.cal-day.has-games { color: var(--ink); font-weight: 700; cursor: pointer; }
.cal-day.has-games:hover { background: var(--bg-alt); }
.cal-day.selected { background: var(--red); color: #fff; }
.cal-dots { display: flex; gap: 2px; height: 5px; align-items: center; }
.cal-dot { width: 5px; height: 5px; border-radius: 50%; }
.cal-day.selected .cal-dot { background: #fff !important; }
.cal-selected { text-align: center; margin-top: 14px; font-size: 0.9rem; color: var(--ink); font-weight: 600; }
.cal-clear { background: none; border: none; color: var(--red); font-weight: 700; cursor: pointer; font-size: 0.9rem; font-family: inherit; }
.cal-clear:hover { text-decoration: underline; }

/* ---------- Fixtures ---------- */
.fixtures {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fixture {
  display: grid;
  grid-template-columns: 96px 44px 1fr;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 20px;
  transition: box-shadow 0.15s, transform 0.15s;
}
.fixture:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.fx-date {
  display: flex;
  flex-direction: column;
  text-align: center;
  border-right: 1px solid var(--line);
  padding-right: 12px;
}
.fx-day { font-weight: 800; font-size: 0.9rem; color: var(--ink); }
.fx-time { font-size: 0.82rem; color: var(--slate); margin-top: 2px; }
.fx-sport { font-size: 1.6rem; text-align: center; }
.fx-teams { font-size: 1.05rem; font-weight: 600; }
.club-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  font-size: 0.5rem;
  letter-spacing: 0.02em;
  vertical-align: middle;
  margin-right: 5px;
  flex: none;
}
.club-badge-img { object-fit: contain; background: #fff; }
.club-badge-lg { width: 52px; height: 52px; font-size: 1rem; margin-right: 0; }
.club-logo-lg { width: 54px; height: 54px; object-fit: contain; display: block; }
.home-team { color: var(--red-dark); }
.fx-v { color: var(--slate); font-weight: 500; font-size: 0.9rem; margin: 0 4px; }
.fx-meta { color: var(--slate); font-size: 0.88rem; margin-top: 3px; }
.fx-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.fx-cal {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.fx-cal:hover { border-color: var(--red); color: var(--red); }
.fx-tickets {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 13px;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.15s;
}
.fx-tickets:hover { background: var(--red-dark); }

/* Winner poll under each game */
.poll { margin-top: 12px; }
.poll-q { display: block; font-size: 0.78rem; font-weight: 700; color: var(--slate); margin-bottom: 6px; }
.poll-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.poll-opt {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.poll-opt:hover { border-color: var(--red); color: var(--red); }
.poll-opt.picked { background: var(--red); border-color: var(--red); color: #fff; }
.poll-opt.picked:hover { color: #fff; }

/* Finished games — final score */
.fixture.is-final { background: var(--sand, #faf7f2); }
.fx-status {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #fff;
  background: var(--slate);
  padding: 2px 6px;
  border-radius: 999px;
}
.fx-final {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.fx-side { display: inline-flex; align-items: center; }
.fx-side.fx-lose { opacity: 0.55; }
.fx-score {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
}
.fx-score-sep { margin: 0 6px; color: var(--slate); font-weight: 600; }
.fx-pickresult { margin-top: 10px; font-size: 0.82rem; font-weight: 600; color: var(--slate); }
.fx-pickresult .hit { color: #059669; font-weight: 800; }
.fx-pickresult .miss { color: var(--red); font-weight: 800; }

.empty { text-align: center; color: var(--slate); margin-top: 24px; }

/* Archive — collapsible list of past results */
.archive { max-width: 820px; margin: 22px auto 0; }
.archive-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: #fff;
  border: 1px dashed var(--line);
  color: var(--slate);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 13px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.archive-toggle:hover { border-color: var(--red); color: var(--red); }
.archive-caret { font-size: 0.78rem; }
.archive-list { margin-top: 12px; }

/* ---------- League tables ---------- */
.standings { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; }
.st-title { font-size: 1.05rem; font-weight: 800; color: var(--ink); margin-bottom: 10px; }
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.ltable { width: 100%; border-collapse: collapse; min-width: 500px; font-size: 0.9rem; }
.ltable th, .ltable td { padding: 11px 8px; text-align: center; white-space: nowrap; }
.ltable thead th {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--slate);
  border-bottom: 1px solid var(--line);
}
.ltable td { border-bottom: 1px solid var(--line); }
.ltable tbody tr:last-child td { border-bottom: 0; }
.ltable th.st-club, .ltable td.st-club { text-align: left; padding-left: 14px; }
.ltable td.st-club span { vertical-align: middle; font-weight: 600; }
.st-pos { color: var(--slate); font-weight: 700; width: 34px; }
.st-pts { font-weight: 800; color: var(--ink); }
.st-goals { color: var(--slate); }
.ltable tbody tr.st-zg { background: #faf7f2; }
.ltable tbody tr.st-zg td.st-club span { font-weight: 800; }
.st-note { font-size: 0.8rem; color: var(--slate); margin-top: 8px; }

@media (max-width: 560px) {
  .ltable { min-width: 0; }
  .ltable .st-goals { display: none; }   /* drop the goals column on small screens */
}

@media (max-width: 560px) {
  .fixture { grid-template-columns: 76px 1fr; row-gap: 8px; }
  .fx-sport { display: none; }
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 24px;
  text-align: center;
  color: var(--slate);
}
.site-footer p { margin: 4px 0; }
.muted { font-size: 0.88rem; opacity: 0.8; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    gap: 0;
    padding: 8px 24px 16px;
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { padding: 10px 0; border-bottom: 1px solid var(--line); }
}
