:root {
  color-scheme: light;
  --bg: #f4f5f2;
  --card: #ffffff;
  --text: #1b1f1c;
  --muted: #5f6b62;
  --line: #dfe3dc;
  --brand: #14532d;
  --brand-text: #ffffff;
  --accent: #166534;
  --mark: #fef3c7;
  --win: #14532d;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 0 12px; }
.top {
  position: sticky; top: 0; z-index: 5;
  background: var(--brand); color: var(--brand-text);
  padding: 10px 0 0;
}
.title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
h1 { font-size: 1.15rem; margin: 0; line-height: 1.2; }
h1 span { font-weight: 400; opacity: .85; }
.season select {
  font: inherit; font-size: .9rem; padding: 5px 6px; border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .35); background: var(--brand); color: var(--brand-text);
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }
h2 { font-size: 1.05rem; margin: 26px 0 8px; }
h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 6px; }

.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.tabs button {
  border: 0; border-radius: 8px 8px 0 0; padding: 9px 2px;
  background: rgba(255, 255, 255, .12); color: inherit;
  font: inherit; font-size: .82rem; line-height: 1.15; cursor: pointer;
}
.tabs button[aria-current="true"] { background: var(--bg); color: var(--text); font-weight: 600; }

.group-title { color: var(--muted); font-size: .9rem; margin: 14px 0 10px; }
.filter { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--muted); margin-bottom: 8px; }
.filter span { min-width: 3.6rem; }
#group-filter { margin-top: 14px; }
.top:has(+ main #group-filter:not([hidden])) { padding-bottom: 10px; }
.filter select {
  flex: 1; min-width: 0; padding: 9px 8px; font: inherit; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
}

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  margin: 0 0 10px; overflow: hidden;
}
.card > header {
  display: flex; justify-content: space-between; gap: 8px; align-items: baseline;
  padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: .88rem;
}
.card > header strong { font-size: .92rem; }
.card > header span { color: var(--muted); text-align: right; }
.card.next { border-color: var(--accent); }
.badge {
  display: inline-block; font-size: .7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--accent); margin-right: 6px;
}

.match {
  display: grid; grid-template-columns: 1fr 4.6rem 1fr; gap: 6px; align-items: center;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.match:last-of-type { border-bottom: 0; }
.home { text-align: right; }
.home, .away { overflow-wrap: anywhere; font-size: .93rem; }
.score {
  text-align: center; font-variant-numeric: tabular-nums; font-weight: 700;
  white-space: nowrap;
}
.score.pending { font-weight: 400; color: var(--muted); font-size: .88rem; }
.score .tries { display: block; font-size: .72rem; font-weight: 400; color: var(--muted); }
.winner { font-weight: 700; color: var(--win); }
.mine { background: var(--mark); }
.flag { display: block; text-align: center; grid-column: 1 / -1; font-size: .75rem; color: var(--muted); }
.note { color: var(--text); }
.rest { padding: 7px 12px; font-size: .84rem; color: var(--muted); border-top: 1px solid var(--line); }
.empty { padding: 10px 12px; color: var(--muted); font-size: .9rem; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 4px; text-align: center; border-bottom: 1px solid var(--line); }
th { font-size: .74rem; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td.team, th.team { text-align: left; overflow-wrap: anywhere; }
td.team button {
  all: unset; cursor: pointer; display: block; width: 100%;
}
td.pts { font-weight: 700; }
td:first-child, th:first-child { padding-left: 10px; color: var(--muted); }
td:last-child, th:last-child { padding-right: 10px; }
@media (max-width: 480px) { .wide { display: none; } }
.caption { font-size: .8rem; color: var(--muted); margin: 6px 2px 0; }

.venue { padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: .88rem; }
.venue:last-child { border-bottom: 0; }
.venue strong { display: block; }
.venue span { display: block; color: var(--muted); }

footer { color: var(--muted); font-size: .8rem; padding-top: 18px; padding-bottom: 40px; }
a { color: var(--accent); }
