:root {
  --green-950: #10261c;
  --green-900: #173628;
  --green-700: #1f6a43;
  --gold: #c6a15a;
  --gold-deep: #8d6b2e;
  --cream: #f4f0e6;
  --paper: #fffcf8;
  --ink: #1b2420;
  --muted: #5d675f;
  --line: #e4dccb;
  --win: #14663a;
  --win-bg: #e4f4ea;
  --loss: #8a3b2b;
  --loss-bg: #f8ebe6;
  --tie: #745816;
  --tie-bg: #f7f0dc;
  --shadow: 0 12px 28px rgba(16, 38, 28, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 420px at 100% -10%, rgba(198, 161, 90, 0.18), transparent 55%),
    var(--cream);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.05rem;
  line-height: 1.5;
}

a { color: var(--green-700); }

a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  background: var(--paper);
  color: var(--ink);
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  z-index: 20;
}

.skip:focus { top: 0.75rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--green-950);
  color: #f6f3ea;
  border-bottom: 3px solid var(--gold);
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.8rem 1.1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
}

.brand-kicker {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #e4cc8d;
}

.brand-name {
  display: block;
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-size: 1.45rem;
  line-height: 1;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.site-nav a {
  color: #f6f3ea;
  text-decoration: none;
  min-height: 44px;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
}

.site-nav a:hover { background: rgba(255, 255, 255, 0.08); }

.site-nav a[aria-current="page"] {
  background: var(--gold);
  color: var(--green-950);
}

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.25rem 1.1rem 3rem;
}

.hero {
  background: linear-gradient(155deg, var(--green-900), #215c40 70%, #2d7a4f);
  color: #f7f4ee;
  border-radius: 20px;
  padding: 1.6rem 1.25rem 1.45rem;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: #ead7a2;
  font-weight: 700;
}

.hero h1 {
  margin: 0.35rem 0 0.45rem;
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-weight: 600;
  font-size: clamp(2.1rem, 7vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.lede {
  margin: 0;
  max-width: 38rem;
  color: #e7efe9;
}

section { margin-top: 2rem; }

h2 {
  margin: 0 0 0.8rem;
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-size: 1.7rem;
  font-weight: 600;
}

h3 {
  margin: 1.25rem 0 0.7rem;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.record {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 0.9rem;
  padding: 0;
  list-style: none;
}

.record li {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
  font-weight: 700;
}

.doc-list,
.matches,
.roster,
.captains {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.doc-list a,
.match,
.roster li,
.captains li {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.doc-list a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  min-height: 52px;
  text-decoration: none;
  color: inherit;
  font-weight: 600;
}

.doc-list a:hover { border-color: #8fbfa4; }

.badge {
  flex: 0 0 auto;
  min-width: 3.2rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: var(--green-900);
  color: #f6f3ea;
  border-radius: 7px;
  padding: 0.28rem 0.4rem;
}

.match {
  display: grid;
  gap: 0.65rem;
  padding: 0.9rem 0.95rem;
}

.match-title {
  margin: 0;
  font-weight: 700;
}

.result {
  margin: 0;
  width: fit-content;
  font-weight: 800;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
}

.result-win { background: var(--win-bg); color: var(--win); }
.result-loss { background: var(--loss-bg); color: var(--loss); }
.result-tie { background: var(--tie-bg); color: var(--tie); }

.scorecard {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: var(--green-900);
  font-weight: 700;
  min-height: 44px;
}

.roster li,
.captains li {
  padding: 0.75rem 0.95rem;
  font-weight: 600;
}

.captain-role {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  padding: 1.5rem 1.1rem 2.2rem;
}

.site-footer p { margin: 0.2rem 0; }

@media (min-width: 720px) {
  .hero { padding: 2.1rem 2rem 1.8rem; }
  .match {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 1rem 1.25rem;
  }
  .doc-list { grid-template-columns: 1fr 1fr; }
  .roster { grid-template-columns: repeat(3, 1fr); }
  .captains { grid-template-columns: repeat(2, minmax(0, 280px)); }
}

@media (max-width: 380px) {
  .site-nav a { padding-inline: 0.6rem; }
}

body.viewer main { max-width: 1200px; }

body.viewer .hero {
  margin-top: 0;
  padding: 1.05rem 1.05rem 0.95rem;
}

body.viewer .hero h1 {
  font-size: clamp(1.55rem, 5.5vw, 2.35rem);
}

body.viewer .download-row { margin: 0.55rem 0 0; }

body.viewer .sheet-tabs { margin: 0.4rem 0 0.55rem; }

.download-row { margin: 0.85rem 0 0; }

.download-row a {
  font-size: 0.92rem;
  font-weight: 700;
}

.sheet-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  position: sticky;
  top: 4.6rem;
  z-index: 6;
  margin: 0.9rem 0 0.75rem;
  padding: 0.35rem 0;
  background: rgba(244, 240, 230, 0.94);
}

.sheet-tabs button {
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--green-900);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 44px;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
}

.sheet-tabs button[aria-selected="true"] {
  background: var(--green-900);
  color: #f6f3ea;
  border-color: var(--green-900);
}

.table-wrap {
  overflow-x: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
}

table.grid {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  font-size: 0.92rem;
}

table.grid caption {
  caption-side: top;
  text-align: left;
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-size: 1.35rem;
  font-weight: 600;
  padding: 0.75rem 0.8rem 0.45rem;
  color: var(--ink);
}

table.grid th,
table.grid td {
  padding: 0.32rem 0.55rem;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid #efe8da;
  text-align: left;
  white-space: nowrap;
  vertical-align: top;
}

table.grid td.num { text-align: right; font-variant-numeric: tabular-nums; }

table.grid td.wrap {
  white-space: normal;
  min-width: 12rem;
  max-width: 28rem;
}

table.grid tbody tr:nth-child(even) td { background: #faf7f1; }

@media (max-width: 720px) {
  table.grid { font-size: 0.82rem; }
  .sheet-tabs { top: 7.25rem; }
}
