:root {
  --green: #166534; --green-dark: #14532d; --green-mid: #15803d; --green-light: #dcfce7;
  --ink: #0f172a; --muted: #64748b; --line: #e2e8f0; --bg: #f1f5f9;
  --card: #ffffff; --accent: #ca8a04; --red: #dc2626; --yellow: #facc15;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink);
  font-size: 15px; line-height: 1.55;
}
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Topbar ──────────────────────────────────────────────────────────────── */
#topbar {
  background: linear-gradient(180deg, #1b7040 0%, var(--green-dark) 100%);
  color: #fff;
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px; height: 56px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  flex-wrap: nowrap;
}
.brand {
  display: flex; align-items: center; gap: 9px; color: #fff; flex-shrink: 0;
  text-decoration: none;
}
.brand:hover { text-decoration: none; opacity: 0.92; }
.brand .ball { font-size: 22px; }
.brand strong { display: block; font-size: 16px; letter-spacing: 0.3px; font-weight: 700; }
.brand small { display: block; font-size: 10px; opacity: 0.72; }

/* ── Nav ─────────────────────────────────────────────────────────────────── */
#nav {
  display: flex; align-items: center; gap: 2px; flex: 1;
}
.nav-link {
  color: rgba(255,255,255,0.88);
  padding: 6px 10px; border-radius: 7px; font-size: 13.5px; font-weight: 500;
  text-decoration: none; white-space: nowrap; transition: background 0.13s, color 0.13s;
}
.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,0.16); color: #fff; text-decoration: none;
}

/* Dropdown groups */
.nav-group { position: relative; }
.nav-group-btn {
  background: transparent; border: none;
  color: rgba(255,255,255,0.88); padding: 6px 10px; border-radius: 7px;
  font-size: 13.5px; font-weight: 500; font-family: inherit;
  cursor: pointer; display: flex; align-items: center; gap: 4px; white-space: nowrap;
  transition: background 0.13s, color 0.13s;
}
.nav-group-btn::after { content: "▾"; font-size: 9px; opacity: 0.65; margin-left: 1px; }
.nav-group-btn:hover,
.nav-group.open .nav-group-btn,
.nav-group.active .nav-group-btn { background: rgba(255,255,255,0.16); color: #fff; }

.nav-group-menu {
  display: none;
  position: absolute; top: calc(100% + 8px); left: 0;
  background: #0c3318;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; min-width: 185px; padding: 5px;
  z-index: 200;
  box-shadow: 0 12px 36px rgba(0,0,0,0.45), 0 2px 8px rgba(0,0,0,0.2);
}
.nav-group.open .nav-group-menu { display: block; }

.nav-group-item {
  display: block; padding: 8px 13px; color: #c7f2d8;
  border-radius: 7px; font-size: 13.5px; font-weight: 500;
  transition: background 0.1s, color 0.1s;
}
.nav-group-item:hover, .nav-group-item.active {
  background: rgba(255,255,255,0.12); color: #fff; text-decoration: none;
}

/* Hamburger */
.nav-toggle {
  display: none; background: transparent; border: 1px solid rgba(255,255,255,0.28);
  color: #fff; font-size: 17px; cursor: pointer; padding: 5px 9px; border-radius: 6px;
  flex-shrink: 0; line-height: 1; margin-left: auto; transition: background 0.13s;
}
.nav-toggle:hover { background: rgba(255,255,255,0.12); }

/* User box */
#userbox {
  font-size: 13px; color: rgba(255,255,255,0.88);
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
#userbox .badge { background: var(--accent); color: #fff; }
.user-name { font-weight: 500; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Mobile nav */
@media (max-width: 767px) {
  #topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 8px; }
  .nav-toggle { display: block; }
  #nav {
    display: none; flex-direction: column; align-items: stretch;
    width: 100%; order: 10; gap: 2px;
    border-top: 1px solid rgba(255,255,255,0.12);
    padding-top: 8px; padding-bottom: 6px;
  }
  #nav.open { display: flex; }
  #userbox { order: 11; width: 100%; border-top: 1px solid rgba(255,255,255,0.12); padding-top: 8px; }
  .nav-group { width: 100%; }
  .nav-group-btn { width: 100%; justify-content: space-between; }
  .nav-group-menu {
    position: static !important; box-shadow: none !important;
    background: rgba(0,0,0,0.18) !important;
    border: none !important; border-radius: 8px;
    margin: 4px 0 4px 10px;
  }
  .brand strong { font-size: 15px; }
  .brand small { display: none; }
  #sponsor-header { display: none; }
}
@media (min-width: 768px) {
  #nav { display: flex !important; }
  .nav-toggle { display: none !important; }
}

/* ── Sponsor badge ────────────────────────────────────────────────────────── */
#sponsor {
  display: flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,0.09); border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px; padding: 5px 10px; color: #fff; text-decoration: none;
  flex-shrink: 0; transition: background 0.15s;
}
#sponsor:hover { background: rgba(255,255,255,0.16); text-decoration: none; }
.sponsor-label { font-size: 9px; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 0.6px; line-height: 1; }
#sponsor-img { height: 28px; width: auto; object-fit: contain; filter: brightness(0) invert(1); }
#sponsor-name strong { display: block; font-size: 13px; color: #fff; }
#sponsor-name small  { display: block; font-size: 9px; color: rgba(255,255,255,0.65); }

/* ── Layout ─────────────────────────────────────────────────────────────── */
main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 64px; }
footer {
  text-align: center; color: var(--muted); font-size: 13px;
  padding: 20px; display: flex; flex-direction: column; gap: 4px;
  border-top: 1px solid var(--line); background: var(--card);
}
.footer-sponsor { font-size: 12px; color: var(--muted); }
.footer-sponsor a { color: var(--green); font-weight: 600; }

/* ── Typography ──────────────────────────────────────────────────────────── */
h1 { font-size: 24px; margin: 6px 0 18px; font-weight: 700; letter-spacing: -0.3px; }
h2 { font-size: 18px; margin: 24px 0 10px; font-weight: 600; }
h3 { font-size: 15px; margin: 16px 0 8px; font-weight: 600; }
.loading { color: var(--muted); padding: 48px; text-align: center; }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 4px 16px rgba(0,0,0,0.06);
}
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

/* ── Tables ─────────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; color: var(--muted); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 10px 8px; border-bottom: 2px solid var(--line);
  background: rgba(241,245,249,0.7);
}
td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: center; width: 36px; }
tr.hl td { background: var(--green-light); }
tr:not(.hl):not(.zone-p):not(.zone-po):not(.zone-r):hover td { background: rgba(22,101,52,0.03); }

/* ── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; background: var(--line); color: var(--ink);
}
.badge.green { background: var(--green-light); color: var(--green-dark); }
.badge.red { background: #fee2e2; color: var(--red); }
.badge.amber { background: #fef3c7; color: #92400e; }
.badge.blue { background: #dbeafe; color: #1d4ed8; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
button, .btn {
  background: var(--green); color: #fff; border: none; border-radius: 8px;
  padding: 9px 16px; font-size: 14px; cursor: pointer; font-weight: 600;
  font-family: inherit; transition: filter 0.13s;
}
button:hover:not(:disabled), .btn:hover:not(:disabled) { filter: brightness(1.12); }
button.secondary {
  background: #fff; color: var(--ink); border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05); filter: none !important;
}
button.secondary:hover:not(:disabled) { background: var(--bg); }
button.danger { background: var(--red); }
button.small { padding: 5px 10px; font-size: 12px; }
button:disabled { opacity: 0.5; cursor: default; }

/* ── Forms ──────────────────────────────────────────────────────────────── */
input, select, textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22,101,52,0.12);
}
label {
  display: block; font-size: 12px; font-weight: 600; color: var(--muted);
  margin: 10px 0 4px; text-transform: uppercase; letter-spacing: 0.4px;
}
form .row, .row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 130px; }
.row.tight > * { flex: 0 0 auto; }

/* ── Fixtures ───────────────────────────────────────────────────────────── */
.fixture {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 6px; border-bottom: 1px solid var(--line);
  font-size: 14px; flex-wrap: wrap; transition: background 0.1s;
}
.fixture:last-child { border-bottom: none; }
.fixture:hover { background: rgba(22,101,52,0.025); }
.fixture .teams { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 240px; }
.fixture .teams .home { flex: 1; text-align: right; }
.fixture .teams .away { flex: 1; }
.fixture .score {
  font-weight: 700; background: var(--ink); color: #fff;
  padding: 3px 10px; border-radius: 7px; min-width: 52px; text-align: center;
}
.fixture .score.tbp { background: var(--line); color: var(--muted); font-weight: 500; font-size: 12px; }
.fixture .meta { font-size: 12px; color: var(--muted); width: 100%; padding-left: 4px; }
.crest-sm svg { vertical-align: middle; }

/* ── Status messages ────────────────────────────────────────────────────── */
.error { background: #fee2e2; color: #991b1b; padding: 10px 14px; border-radius: 8px; margin: 10px 0; font-size: 14px; }
.success { background: var(--green-light); color: var(--green-dark); padding: 10px 14px; border-radius: 8px; margin: 10px 0; font-size: 14px; }
.muted { color: var(--muted); font-size: 13px; }

/* ── Tabs ───────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(0,0,0,0.04); filter: none !important; }
.tabs button:hover:not(:disabled) { background: var(--bg); }
.tabs button.active { background: var(--green); color: #fff; border-color: var(--green); box-shadow: 0 2px 8px rgba(22,101,52,0.2); }

/* ── Kit ────────────────────────────────────────────────────────────────── */
.kit-row { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.kit-card { text-align: center; }
.kit-card .label { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ── Team / club header ─────────────────────────────────────────────────── */
.team-header { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* ── Notifications ──────────────────────────────────────────────────────── */
.notif {
  padding: 12px 14px; border-left: 3px solid var(--green);
  background: #fff; border-radius: 0 8px 8px 0; margin-bottom: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.notif.unread { background: var(--green-light); }
.notif .when { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ── Checklist ──────────────────────────────────────────────────────────── */
.checklist { max-height: 340px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.checklist label {
  display: flex; align-items: center; gap: 8px; text-transform: none;
  font-size: 14px; font-weight: 400; color: var(--ink);
  margin: 2px 0; padding: 4px 6px; border-radius: 6px;
}
.checklist label:hover { background: var(--bg); }
.checklist input { width: auto; }

/* ── League zone colouring ──────────────────────────────────────────────── */
tr.zone-p td { background: #dcfce7; }
tr.zone-po td { background: #fef3c7; }
tr.zone-r td { background: #fee2e2; }

/* ── Match card ─────────────────────────────────────────────────────────── */
.mc-player {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 10px; border-bottom: 1px solid var(--line);
  cursor: pointer; user-select: none; font-size: 15px; transition: background 0.1s;
}
.mc-player:active { background: var(--bg); }
.mc-player .mc-mark {
  width: 26px; height: 26px; border: 2px solid var(--line);
  border-radius: 6px; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; flex: 0 0 26px;
}
.mc-player.mc-on .mc-mark { background: var(--green); border-color: var(--green); color: #fff; }
.mc-player[data-state="sub"] .mc-mark { background: var(--accent); border-color: var(--accent); }
.mc-player.mc-suspended {
  opacity: 0.45; cursor: not-allowed;
  background: repeating-linear-gradient(45deg, transparent, transparent 8px, #f8fafc 8px, #f8fafc 16px);
}

/* ── League hero banner ──────────────────────────────────────────────────── */
.league-hero {
  background: linear-gradient(135deg, #0f3d22 0%, #1b7040 55%, #166534 100%);
  border-radius: var(--radius); margin-bottom: 18px; padding: 28px 24px 22px;
  color: #fff; position: relative; overflow: hidden;
}
.league-hero::after {
  content: "⚽"; position: absolute; right: 18px; top: 8px;
  font-size: 110px; opacity: 0.07; pointer-events: none; line-height: 1;
}
.league-hero h1 { margin: 0 0 4px; font-size: 28px; color: #fff; letter-spacing: -0.5px; }
.league-hero .hero-sub { font-size: 13px; color: rgba(255,255,255,0.65); margin: 0 0 16px; }
.hero-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stat {
  background: rgba(255,255,255,0.13); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px; padding: 10px 16px; text-align: center; min-width: 80px;
}
.hero-stat .val { font-size: 24px; font-weight: 800; color: #fff; line-height: 1.1; }
.hero-stat .lbl { font-size: 10px; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }
.hero-stat.amber { background: rgba(202,138,4,0.35); border-color: rgba(202,138,4,0.3); }
.hero-stat.amber .val { color: #fde68a; }

/* ── Bold fixture tile ───────────────────────────────────────────────────── */
.fx-tile {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 10px;
  padding: 13px 16px 13px 12px;
  border-bottom: 1px solid var(--line);
  border-left: 4px solid transparent;
  transition: background 0.12s, border-left-color 0.12s;
  cursor: pointer;
}
.fx-tile:last-child { border-bottom: none; }
.fx-tile:hover { background: rgba(22,101,52,0.04); border-left-color: var(--green-mid); }
.fx-tile.result { border-left-color: var(--green); }
.fx-tile .fxt-team {
  font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 7px;
}
.fx-tile .fxt-team.home { justify-content: flex-end; text-align: right; }
.fx-tile .fxt-team a { color: var(--ink); text-decoration: none; }
.fx-tile .fxt-team a:hover { color: var(--green); text-decoration: underline; }
.fx-tile .fxt-score {
  background: var(--green-mid); color: #fff;
  font-size: 15px; font-weight: 800;
  padding: 6px 16px; border-radius: 20px;
  text-align: center; min-width: 68px; letter-spacing: 1px;
  flex-shrink: 0;
}
.fx-tile .fxt-score.tbp {
  background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 700; letter-spacing: 0;
  border: 2px solid var(--line); border-radius: 20px;
}
.fx-tile .fxt-meta {
  grid-column: 1 / -1; font-size: 12px;
  color: var(--muted); text-align: center; margin-top: -4px;
  display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap;
}
.fxt-comp-badge {
  font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 20px;
  background: var(--green-light); color: var(--green); letter-spacing: 0.2px;
}
.fxt-comp-badge.cup { background: #fef3c7; color: #92400e; }

/* ── Match report card ───────────────────────────────────────────────────── */
.match-card { border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.match-sheets {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--card); border-top: none;
}
.match-sheet { padding: 14px 16px; }
.match-sheet:first-child { border-right: 1px solid var(--line); }
.match-sheet h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.match-sheet table { width: 100%; font-size: 13px; }
.match-sheet td { padding: 3px 2px; vertical-align: middle; }
.match-sheet .ms-num { width: 22px; color: var(--muted); font-size: 12px; text-align: right; padding-right: 6px; }
.match-sheet .ms-name { font-weight: 500; }
.match-sheet .ms-events { font-size: 11px; color: var(--muted); white-space: nowrap; padding-left: 4px; }
.match-sheet .ms-sub { opacity: 0.55; font-style: italic; }
.match-goals { border-top: 1px solid var(--line); padding: 10px 16px; background: var(--card); font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 16px; }
.match-goals span { color: var(--ink); }
@media (max-width: 540px) {
  .match-sheets { grid-template-columns: 1fr; }
  .match-sheet:first-child { border-right: none; border-bottom: 1px solid var(--line); }
}

/* ── Match scoreboard hero ───────────────────────────────────────────────── */
.match-hero {
  background: linear-gradient(135deg, #0f3d22 0%, #1b7040 55%, #166534 100%);
  border-radius: 0; padding: 28px 20px 20px; margin-bottom: 0;
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center;
  color: #fff; position: relative; overflow: hidden;
}
.match-hero::before {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg,rgba(255,255,255,.018) 0,rgba(255,255,255,.018) 1px,transparent 1px,transparent 22px);
  pointer-events: none;
}
.match-hero .mh-team {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; text-align: center; font-size: 16px; font-weight: 700; color: #fff;
}
.match-hero .mh-team a { color: #fff; text-decoration: none; }
.match-hero .mh-team a:hover { text-decoration: underline; }
.match-hero .mh-center { text-align: center; min-width: 120px; }
.match-hero .mh-scoreline {
  font-size: 48px; font-weight: 900; color: #fff;
  letter-spacing: 3px; line-height: 1;
}
.match-hero .mh-extra-score {
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.72);
  letter-spacing: 0.5px; margin-top: 3px;
}
.match-hero .mh-vs {
  font-size: 22px; font-weight: 700; color: rgba(255,255,255,0.45); letter-spacing: 3px;
}
.match-hero .mh-status {
  display: inline-block; margin-top: 10px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  background: rgba(255,255,255,0.15); border-radius: 20px; padding: 3px 12px; color: rgba(255,255,255,0.8);
}
.match-hero .mh-status.played { background: rgba(202,138,4,0.5); color: #fde68a; }
.match-hero .mh-status.postponed,
.match-hero .mh-status.cancelled,
.match-hero .mh-status.abandoned { background: rgba(220,38,38,0.45); color: #fca5a5; }
.match-hero .mh-meta {
  grid-column: 1 / -1; text-align: center;
  font-size: 12px; color: rgba(255,255,255,0.62); margin-top: 4px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 12px;
}
.match-hero .mh-meta a { color: rgba(255,255,255,0.75); }
.match-hero .mh-meta a:hover { color: #fff; }
@media (max-width: 540px) {
  .match-hero { grid-template-columns: 1fr; text-align: center; padding: 20px 14px; }
  .match-hero .mh-team { font-size: 14px; }
  .match-hero .mh-scoreline { font-size: 36px; }
  .match-hero .mh-center { min-width: unset; }
}

/* ── Section colour strip ────────────────────────────────────────────────── */
.section-strip {
  display: flex; align-items: center; gap: 10px;
  margin: 0 -16px 0; padding: 9px 16px;
  background: var(--green); color: #fff;
  border-radius: 0;
}
.section-strip.amber { background: var(--accent); }
.section-strip h2 { margin: 0; font-size: 15px; font-weight: 700; color: #fff; }
.section-strip .section-sub { font-size: 13px; opacity: 0.82; margin-left: 2px; }

/* ── Ref scheduling grid ─────────────────────────────────────────────────── */
.ref-grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ref-grid { border-collapse: collapse; font-size: 12px; width: 100%; }
.ref-grid th {
  background: #f1f5f9; padding: 8px 10px;
  border: 1px solid var(--line); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; text-align: left;
}
.ref-grid th:first-child { position: sticky; left: 0; z-index: 2; background: #f1f5f9; }
.ref-grid td { padding: 6px 8px; border: 1px solid var(--line); vertical-align: top; min-width: 130px; }
.ref-grid .rg-date {
  position: sticky; left: 0; z-index: 1;
  font-weight: 600; white-space: nowrap; background: #f8fafc;
  color: var(--ink); font-size: 12px; min-width: 80px;
}
.rg-totals .rg-date { background: var(--surface); }
.fee-tag { display:inline-block; margin-top:6px; font-size:12px; background:#f0fdf4; color:#166534; border:1px solid #bbf7d0; border-radius:6px; padding:4px 10px; }
.rg-cell { border-radius: 6px; padding: 5px 8px; line-height: 1.35; font-size: 12px; }
.rg-cell.confirmed { background: #dcfce7; color: #14532d; border-left: 3px solid #16a34a; }
.rg-cell.pending   { background: #fef3c7; color: #92400e; border-left: 3px solid #d97706; }
.rg-cell.declined  { background: #fee2e2; color: #991b1b; border-left: 3px solid #dc2626; }
.rg-cell.unavail   { color: var(--muted); font-size: 11px; text-align: center; font-style: italic; }
.rg-empty          { color: var(--line); font-size: 18px; text-align: center; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  main { padding: 14px 10px 50px; }
  h1 { font-size: 21px; }
  .card { padding: 14px; }
  .league-hero { padding: 20px 16px 18px; }
  .league-hero h1 { font-size: 22px; }
  .hero-stat .val { font-size: 20px; }
}

/* ── Print ───────────────────────────────────────────────────────────────── */
@media print {
  /* Hide all chrome */
  #topbar, #nav, #nav-toggle, #userbox,
  .btn, button,
  .flash, #site-notice,
  .fee-tag,
  .fixture .actions,
  [data-yes], [data-no],
  .no-print { display: none !important; }

  body { background: #fff; color: #000; font-size: 11pt; }
  main { padding: 0; max-width: 100%; }

  /* Cards become borderless blocks */
  .card {
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 8px 0;
    break-inside: avoid;
  }

  /* Tables: full-width, no zebra shading, thin borders */
  table { width: 100%; border-collapse: collapse; font-size: 10pt; }
  th, td { border: 1px solid #999; padding: 4px 6px; }
  thead { background: #f0f0f0 !important; }

  /* League table — keep position numbers, drop sticky left */
  .league-table th:first-child,
  .league-table td:first-child { position: static; }

  /* Ref grid — print all columns, drop sticky */
  .ref-grid th:first-child,
  .ref-grid .rg-date { position: static; background: none; }

  /* Team sheet / squad list — break nicely */
  .checklist { column-count: 2; column-gap: 16px; }

  /* Match scoreboard: simplify hero */
  .match-hero { background: none; color: #000; border: 2px solid #000; padding: 12px; border-radius: 0; }
  .match-hero .score { color: #000; font-size: 28pt; }

  /* Keep links readable */
  a { color: #000; text-decoration: none; }
  a[href]::after { content: none; }

  /* Pagination — avoid orphans */
  h1, h2, h3 { break-after: avoid; }
  .fixture, tr { break-inside: avoid; }

  /* Footer branding */
  body::after {
    content: "North West Saturday Morning League — nwsml.ie";
    display: block;
    text-align: center;
    font-size: 9pt;
    color: #666;
    margin-top: 24px;
    border-top: 1px solid #ccc;
    padding-top: 8px;
  }
}
