/* Light single-theme tool. Filters + calendar → one full-width board with collapsible sections */
:root {
  color-scheme: light;
  --bg: #f7f8f5; --surface: #ffffff; --fg: #1b231d; --muted: #5f6d63; --line: #dde3da; --soft: #eef3ee;
  --accent: #1f5f8a; --accent-ink: #ffffff; --accent-soft: #e3eef6;
  --pitch: #5b7565; --pitch-ink: #ffffff; --pitch-muted: #dbe5de;
  --green: #2b8547; --green-bg: #e2f3e6;
  --yellow: #806200; --yellow-bg: #fbf0c4; --yellow-dot: #e0b400;
  --red: #b23a2e; --red-bg: #f9e1dd;
  --grey: #7d857f; --grey-bg: #eceeeb;
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box }
html, body { margin: 0 }
body { background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 15px; line-height: 1.45 }
.wrap { max-width: 1200px; margin: 0 auto; padding-block: 20px 56px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 20px }
h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0; text-wrap: balance }
h1 { font-size: clamp(28px, 4.5vw, 40px); line-height: 1.05 }
h2 { font-size: 24px } h3 { font-size: 18px }
a { color: var(--accent) }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
[hidden] { display: none !important }
.label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600 }
.note { font-size: 13px; color: var(--muted); max-width: 85ch; margin: 0 }

/* hero + tabs */
.hero { background: var(--pitch); color: var(--pitch-ink) }
.hero-in { max-width: 1200px; margin: 0 auto; padding-block: 16px 0;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 8px }
.hero h1 { font-family: var(--body); font-weight: 500; font-size: clamp(16px, 2vw, 19px); line-height: 1.4; color: var(--pitch-ink); max-width: 70ch }
.hero .lede { margin: 0; color: var(--pitch-muted); font-size: 16px; max-width: 60ch }
.tabs { display: flex; gap: 4px; margin-top: 10px }
.tabs button { font: inherit; font-family: var(--display); font-size: 18px; font-weight: 700; background: transparent; border: 0;
  padding: 9px 18px 10px; color: var(--pitch-muted); cursor: pointer; border-radius: 8px 8px 0 0 }
.tabs button:hover { color: var(--pitch-ink) }
.tabs button[aria-selected="true"] { background: var(--bg); color: var(--fg) }
.tabs button:focus-visible { outline-color: var(--pitch-ink) }

/* top area */
.top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: 14px; align-items: stretch }
@media (max-width: 800px) { .top { grid-template-columns: minmax(0, 1fr) } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 14px; min-width: 0 }
.filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 12px }
@media (max-width: 640px) { .filters { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
.filterpanel { padding: 18px }
.calpanel { padding: 14px 14px 12px; gap: 10px }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0 }
select { font: inherit; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--fg); width: 100% }
.checks { display: flex; flex-wrap: wrap; gap: 6px }
.check { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px 4px 8px;
  font-size: 14px; cursor: pointer; background: var(--surface); user-select: none; font-variant-numeric: tabular-nums }
.check input { margin: 0; accent-color: var(--accent) }
.check:has(input:checked) { background: var(--accent-soft); border-color: var(--accent) }
.check .cnt { color: var(--muted); font-size: 12px }
.linkbtn { font: inherit; font-size: 13px; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden }
.seg button { font: inherit; font-size: 14px; border: 0; background: var(--surface); padding: 5px 12px; cursor: pointer; color: var(--fg) }
.seg button + button { border-left: 1px solid var(--line) }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink) }
button.primary { font: inherit; font-weight: 600; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 6px; padding: 8px 14px; cursor: pointer }
button.ghost { font: inherit; font-size: 13px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 4px 10px; cursor: pointer; color: var(--fg) }
.load { display: flex; align-items: center; gap: 16px; min-height: 30px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--soft) }
.loadinfo { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px }
.loadinfo .note { min-width: 0 }
#apply { flex: none; padding: 8px 22px }
.bar { flex: 1 1 auto; height: 6px; background: var(--grey-bg); border-radius: 3px; overflow: hidden }
.bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s }

/* calendar */
.cal-head { display: flex; justify-content: space-between; align-items: center }
.cal-head button { font: inherit; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; width: 32px; height: 32px; cursor: pointer; color: var(--fg) }
.cal-head button:disabled { opacity: .35; cursor: default }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; font-variant-numeric: tabular-nums }
.cal .dow { font-size: 11px; color: var(--muted); text-align: center; font-weight: 600 }
.cal button { font: inherit; border: 1px solid transparent; background: var(--bg); border-radius: 6px; padding: 4px 0 3px; cursor: pointer; color: var(--fg);
  display: flex; flex-direction: column; align-items: center; line-height: 1.1; min-height: 32px; justify-content: center }
.cal button .n { font-weight: 600; font-size: 14px }
.cal button.we { background: var(--soft) }
.cal button.out { visibility: hidden }
.cal button.past { opacity: .45 }
.cal button.today .n { text-decoration: underline }
.cal button.inrange { border-color: var(--accent) }
.cal button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink) }

/* results */
.summary { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline }
.summary .big { font-family: var(--display); font-size: 34px; font-weight: 700; color: var(--green); line-height: 1 }
.summary .big.blue { color: var(--accent) }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none }
.dot.g { background: var(--green) } .dot.y { background: var(--yellow-dot) } .dot.r { background: var(--red) }
.dot.u { background: var(--grey-bg); border: 2px solid var(--grey) } .dot.l { background: var(--line) }
.board { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 10px; display: flex; flex-direction: column; gap: 8px }
.empty { font-size: 14px; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: 10px; padding: 18px }
.sec summary { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 10px 14px; list-style: none; border-radius: 8px; background: var(--soft); color: var(--fg) }
.sec[open] summary { margin-bottom: 8px }
.sec.s-g summary { background: var(--green-bg); color: var(--green) }
.sec.s-y summary { background: var(--yellow-bg); color: var(--yellow) }
.sec.s-r summary { background: var(--red-bg); color: var(--red) }
.sec.s-u summary, .sec.s-l summary, .sec.s-o summary { background: var(--grey-bg); color: var(--grey) }
.sec summary::-webkit-details-marker { display: none }
.sec summary .stitle { font-family: var(--display); font-weight: 700; font-size: 20px }
.sec summary .cnt { color: inherit; font-weight: 600; font-variant-numeric: tabular-nums; background: rgba(255, 255, 255, .7); border-radius: 999px; padding: 0 9px; font-size: 13px }
.sec summary::after { content: "›"; margin-left: auto; color: inherit; transition: transform .15s; font-size: 22px; line-height: 1 }
.sec[open] summary::after { transform: rotate(90deg) }
.secbody { padding: 0 4px 6px; display: flex; flex-direction: column; gap: 4px }
.codegroup { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; align-items: start; padding: 6px 0; border-top: 1px dashed var(--line) }
.codegroup:first-child { border-top: 0 }
@media (max-width: 600px) { .codegroup { grid-template-columns: minmax(0, 1fr) } }
.subhead { font-family: var(--body); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin: 0; padding-top: 10px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center }
.subhead .cnt { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 500 }

/* teams (free view) */
.teamgrid { list-style: none; margin: 0; padding: 0 0 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0 28px }
.team { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; font-size: 14px; padding: 7px 0; border-bottom: 1px solid var(--soft); min-width: 0 }
.team .tname { color: var(--fg); text-decoration: none; overflow-wrap: anywhere; font-weight: 500 }
.team .tname:hover { text-decoration: underline }
.team.g .tname, .team.y .tname { font-weight: 600 }
.team .why { grid-column: 2 / -1; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1.5 }
.team .why a { color: inherit; text-decoration: none }
.team .why a:hover { text-decoration: underline; color: var(--fg) }
.team .why b { color: var(--fg); font-weight: 600 }
.team.y .why b { color: var(--yellow) }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none }
.dot.g { background: var(--green) } .dot.y { background: var(--yellow-dot) } .dot.r { background: var(--red) }
.dot.u { background: var(--grey-bg); border: 2px solid var(--grey) } .dot.l { background: var(--line) }
.lvl { font-size: 11px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; white-space: nowrap; font-variant-numeric: tabular-nums }

/* match cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px }
.mcard { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--fg); text-decoration: none; min-width: 0; transition: border-color .12s, box-shadow .12s }
.mcard a { color: inherit; text-decoration: none; border-radius: 6px }
.mcard a:hover .mname, .mcard a.mhead:hover .mtime { text-decoration: underline }
.mcard:hover { border-color: var(--accent) }
.mhead { display: flex; align-items: center; gap: 8px; padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid var(--soft) }
.mtime { font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums }
.mtime small { font-family: var(--body); font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase }
.mser { font-size: 12px; color: var(--muted); text-align: right; margin-left: auto }
.mteam { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; line-height: 1.3; min-height: 44px }
.mname { min-width: 0; overflow-wrap: anywhere; flex: 1; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden }
.code { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--soft); border-radius: 999px; padding: 0 8px; white-space: nowrap; font-variant-numeric: tabular-nums }
.mstate { font-size: 11px; font-weight: 600; color: var(--red); background: var(--red-bg); border-radius: 4px; padding: 1px 6px; white-space: nowrap }

/* multi-select dropdown */
.ms { position: relative }
.ms-btn { font: inherit; width: 100%; text-align: left; padding: 7px 28px 7px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--fg); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative }
.ms-btn::after { content: ""; position: absolute; right: 10px; top: 50%; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-70%) rotate(45deg) }
.ms-btn[aria-expanded="true"] { border-color: var(--accent) }
.ms-pop { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(27, 35, 29, .12); padding: 6px; display: flex; flex-direction: column }
.ms-pop label { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 6px; cursor: pointer; white-space: nowrap; font-size: 14px }
.ms-pop label:hover { background: var(--soft) }
.ms-pop input { margin: 0; accent-color: var(--accent) }
.ms-pop .cnt { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums }
.ms-actions { display: flex; gap: 14px; padding: 6px 8px 2px; border-top: 1px solid var(--soft); margin-top: 4px }

footer { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 14px }
footer .note { max-width: none }
.contact { font-size: 14px; font-weight: 600; color: var(--pitch-ink); background: var(--pitch); border-radius: 6px; padding: 7px 14px; text-decoration: none; margin-left: auto }
.contact:hover { filter: brightness(1.08) }

/* club crests */
.crest { width: 32px; height: 32px; object-fit: contain; flex: none; display: inline-block; align-self: center }

/* day heading + forfeit note */
.dayhead { font-size: 22px }
.team .why.off, .team .why.off a { color: var(--muted) }
.secnote { margin: 0 0 6px 4px }
button.primary:disabled { opacity: .45; cursor: default }
