/* Grand Slam theme: navy, court blue, tournament yellow. Fonts are self-hosted (SIL OFL, see public/fonts). */
@font-face { font-family: "Oswald"; font-weight: 500; font-display: swap; src: url("/fonts/oswald-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Oswald"; font-weight: 600; font-display: swap; src: url("/fonts/oswald-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Oswald"; font-weight: 700; font-display: swap; src: url("/fonts/oswald-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-display: swap; src: url("/fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-display: swap; src: url("/fonts/source-sans-3-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 700; font-display: swap; src: url("/fonts/source-sans-3-latin-700-normal.woff2") format("woff2"); }

:root {
  --bg: #eef2f7;
  --surface: #ffffff;
  --text: #0b1f44;
  --muted: #4a5b7a;
  --line: #d5dce8;
  --navy: #0b1f44;
  --navy-line: #23396a;
  --court: #2557b8;
  --grass: #2f6b47;
  --accent: #2557b8;
  --accent-ink: #ffffff;
  --accent-soft: #e3ebf9;
  --ball: #f5e50a;
  --warn: #8a5300;
  --warn-soft: #fff4e0;
  --danger: #a3271f;
  --danger-soft: #fdecea;
  --radius: 2px;
  --shadow: 0 1px 2px rgba(11, 31, 68, 0.08);
  --display: "Oswald", "Arial Narrow", Impact, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.1; margin: 0 0 0.5rem; font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; margin-top: 2rem; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 0.75rem; }
small, .muted { color: var(--muted); }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 560px; }

header.site {
  background: var(--navy);
  color: #ffffff;
}
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
header.site a { color: inherit; text-decoration: none; }
.brand { font-family: var(--display); font-weight: 600; font-size: 1.2rem; text-transform: uppercase; letter-spacing: 0.08em; display: flex; align-items: center; gap: 8px; }
.brand::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--ball); display: inline-block; }
nav.main { display: flex; gap: 4px; flex-wrap: wrap; }
nav.main { align-items: center; }
nav.main a { padding: 8px 10px; font-family: var(--display); font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.9rem; color: #c9d4e6; border-bottom: 3px solid transparent; }
nav.main a:hover { color: #ffffff; }
nav.main a.on { color: #ffffff; border-bottom-color: var(--ball); }
nav.main .btn.secondary { background: transparent; color: #ffffff; border-color: #c9d4e6; }

main { padding: 24px 0 48px; }
footer.site { background: var(--navy); color: #c9d4e6; padding: 20px 0 32px; font-size: 0.9rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px;
  border: 2px solid var(--ball); border-radius: var(--radius);
  background: var(--ball); color: var(--navy);
  font-family: var(--display); font-size: 1rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn.secondary { background: var(--surface); color: var(--navy); border-color: var(--navy); }
.btn.danger { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 0.9rem; }
.btn[disabled], .btn.disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

form.stack { display: grid; gap: 14px; }
label { display: grid; gap: 4px; font-weight: 600; font-size: 0.95rem; }
label .hint { font-weight: 400; color: var(--muted); font-size: 0.85rem; }
input, select, textarea {
  font: inherit; color: inherit;
  width: 100%; min-height: 44px; padding: 8px 12px;
  border: 1px solid #b9c3d6; border-radius: var(--radius); background: var(--surface);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
label.check input { width: 20px; min-height: 20px; }
.row2 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.row3 { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .row2, .row3 { grid-template-columns: 1fr; } }

.flash { padding: 12px 14px; border-radius: var(--radius); border-left: 4px solid currentColor; margin-bottom: 16px; }
.flash.ok { background: var(--accent-soft); }
.flash.err { background: var(--danger-soft); color: var(--danger); }
.flash.warn { background: var(--warn-soft); color: var(--warn); }

.pill {
  display: inline-block; padding: 2px 10px; border-radius: var(--radius);
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; background: var(--accent-soft); color: var(--court);
}
.pill.full { background: #eceeea; color: var(--muted); }
.pill.cancel { background: var(--danger-soft); color: var(--danger); }
.pill.draft { background: var(--warn-soft); color: var(--warn); }

/* Schedule */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 16px; }
.filters a { padding: 8px 14px; border: 1px solid #b9c3d6; text-decoration: none; color: var(--text); background: var(--surface); font-family: var(--display); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.9rem; }
.filters a.on { background: var(--navy); color: #ffffff; border-color: var(--navy); box-shadow: inset 0 -3px 0 var(--ball); }
.weeknav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.weeknav strong { text-align: center; }
.day { margin-bottom: 18px; }
.day h3 { background: var(--navy); color: #ffffff; font-size: 1rem; letter-spacing: 0.12em; padding: 10px 14px; margin-bottom: 6px; border-left: 6px solid var(--ball); }
.session { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.session .info { min-width: 0; }
.session { border-left: 6px solid var(--court); }
.session .time { font-family: var(--display); font-weight: 600; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.session.is-off { border-left-color: #8a9bbd; }
.session.is-off { opacity: 0.6; }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--display); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: #c9d4e6; background: var(--navy); font-weight: 500; }
td form { display: inline; }

.stat { font-family: var(--display); font-size: 2.2rem; font-weight: 600; color: var(--court); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar h1 { margin: 0; }
details summary { cursor: pointer; font-weight: 600; }
details[open] summary { margin-bottom: 12px; }
pre.email { white-space: pre-wrap; font: inherit; font-size: 0.9rem; margin: 8px 0 0; color: var(--muted); }
.pill { white-space: nowrap; }
.stats { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

/* Court hero on the home page: blue hard court with white lines on a green surround. */
.court { background: var(--grass); padding: 14px; margin: 0 -16px 8px; }
.court-inner { background: var(--court); color: #ffffff; border: 3px solid #ffffff; display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.court-inner > div { padding: 24px; }
.court-inner > div + div { border-left: 3px solid #ffffff; display: flex; align-items: center; }
.court .eyebrow { font-family: var(--display); font-weight: 500; text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.85rem; color: var(--ball); margin-bottom: 8px; }
.court h1 { font-size: 2.6rem; line-height: 1; color: #ffffff; }
.court p { color: #e4ecf8; font-size: 1.05rem; }
.court .btn.secondary { background: transparent; color: #ffffff; border-color: #ffffff; }
.next-on { background: var(--navy); padding: 16px; width: 100%; }
.next-on .label { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.8rem; color: #c9d4e6; }
.next-on .what { font-family: var(--display); font-weight: 600; font-size: 1.3rem; text-transform: uppercase; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.next-on .what span:last-child { color: var(--ball); font-variant-numeric: tabular-nums; }
.next-on .meta { color: #c9d4e6; font-size: 0.95rem; }
.grid .card { border-top: 6px solid var(--court); }
@media (min-width: 700px) { .court { margin: 0 0 8px; padding: 28px; } .court-inner > div { padding: 40px; } .court h1 { font-size: 3.6rem; } }
@media (max-width: 699px) { .court-inner { grid-template-columns: 1fr; } .court-inner > div + div { border-left: 0; border-top: 3px solid #ffffff; } }
footer.site a { color: #ffffff; }
