/* ESPN-desktop look: black masthead, white tab bar with a red marker, light
   gray page, white cards, compact tables. */
:root {
  --page: #edeef0;
  --card: #ffffff;
  --ink: #121213;
  --text: #2b2c2d;
  --muted: #6c6d6f;
  --line: #dcdddf;
  --row: #f6f7f8;
  --red: #d00;
  --red-dark: #b00;
  --win: #008a3e;
  --win-soft: #e6f4ec;
  --loss: #d00;
  --loss-soft: #fde8e8;
  --gold: #a87a00;
  --gold-soft: #fff6db;
  --playoff: #eef4fb;
  color-scheme: light;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 14px/1.45 "Helvetica Neue", Helvetica, Arial, sans-serif;
}
a { color: #06c; text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 72rem; margin: 0 auto; padding-inline: 1rem; }

/* Masthead and tabs */
header.top { background: #000; color: #fff; border-bottom: 3px solid var(--red); }
header.top .wrap { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding-block: 0.7rem; flex-wrap: wrap; }
.brand { color: #fff; font-weight: 900; font-style: italic; font-size: 1.45rem; letter-spacing: -0.02em; }
.brand span { color: var(--red); }
.brand:hover { text-decoration: none; }
.tag { color: #a5a6a7; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
nav.tabs { background: var(--card); border-bottom: 1px solid var(--line); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); }
nav.tabs .wrap { display: flex; overflow-x: auto; gap: 0.25rem; }
nav.tabs a {
  flex: none; padding: 0.8rem 0.85rem 0.65rem; color: var(--text); font-weight: 700; font-size: 0.85rem;
  border-bottom: 3px solid transparent; white-space: nowrap;
}
nav.tabs a:hover { color: var(--ink); text-decoration: none; border-bottom-color: var(--line); }
nav.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--red); }

main.wrap { padding-block: 1.25rem 3rem; }
h1 { font-size: 1.75rem; font-weight: 800; color: var(--ink); margin: 0.25rem 0 0.25rem; letter-spacing: -0.01em; }
.lede { color: var(--muted); margin: 0 0 1rem; max-width: 52rem; }
.note { color: var(--muted); font-size: 0.85rem; }
.muted { color: var(--muted); }
.error { color: var(--loss); font-weight: 700; }
.crumbs { margin: 0; font-size: 0.85rem; color: var(--muted); }

/* Season picker */
.years { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; margin-bottom: 1rem; }
.years span { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--muted); margin-right: 0.3rem; }
.years a {
  padding: 0.25rem 0.75rem; border: 1px solid var(--line); border-radius: 3px; background: var(--card);
  color: var(--text); font-weight: 700; font-size: 0.85rem;
}
.years a:hover { text-decoration: none; border-color: var(--muted); }
.years a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 3px; margin-bottom: 1rem; overflow: hidden; }
.card > h2 {
  margin: 0; padding: 0.7rem 1rem; font-size: 1rem; font-weight: 800; color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.card > p, .card > ul, .card > form, .card > div:not(.scroll), .card > ol { margin: 0.75rem 1rem; }
.card > .lede { margin-top: 0.75rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 32rem), 1fr)); gap: 0 1rem; align-items: start; }

/* Tables */
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.45rem 0.7rem; text-align: left; border-bottom: 1px solid #ebeced; vertical-align: middle; }
th {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted);
  background: var(--card); border-bottom: 1px solid var(--line); white-space: nowrap;
}
tbody tr:nth-child(even) td { background: var(--row); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #eef0f2; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank { color: var(--muted); width: 2rem; }
.big { font-weight: 800; color: var(--ink); }
.when { color: var(--muted); white-space: nowrap; font-size: 0.85rem; }
.vs { font-size: 0.85rem; }
table.compact td { padding-block: 0.4rem; }
tr.in td { background: var(--playoff) !important; }
tr.lotto td { background: var(--gold-soft) !important; }
td.num small { display: block; font-size: 0.72rem; font-weight: 700; }
td.hi { color: var(--win); font-weight: 700; }
td.lo { color: var(--loss); font-weight: 700; }
.up { color: var(--win); }
.down { color: var(--loss); }
.res { font-weight: 800; }
.res.win, .res.win a { color: var(--win); }
.res.loss, .res.loss a { color: var(--loss); }

.team { display: inline-flex; align-items: center; gap: 0.55rem; vertical-align: middle; }
.team b { display: block; font-weight: 700; color: var(--ink); line-height: 1.2; }
.team b a { color: var(--ink); }
.team small { color: var(--muted); font-size: 0.78rem; }
.sub { display: block; margin-left: 2.35rem; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.8rem; }
.sub2 { display: block; color: var(--muted); font-size: 0.78rem; font-weight: 400; }
td b a { color: var(--ink); }
.av { width: 1.8rem; height: 1.8rem; border-radius: 50%; flex: none; background: var(--line); border: 1px solid var(--line); }
.av-blank { display: inline-block; }
.history td { white-space: nowrap; }

.badge {
  display: inline-block; margin-left: 0.4rem; padding: 0.1rem 0.45rem; border-radius: 2px; vertical-align: middle;
  font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--gold); color: #fff;
}
.badge.silver { background: #8a8b8d; }
.badge.red { background: var(--red); }

/* Head-to-head grid */
table.h2h { width: auto; }
table.h2h th, table.h2h td { text-align: center; padding: 0.4rem 0.45rem; font-size: 0.8rem; border: 1px solid #ebeced; }
table.h2h th.rowh { text-align: left; text-transform: none; font-size: 0.82rem; position: sticky; left: 0; background: var(--card); z-index: 1; }
table.h2h th.rot { height: 7.5rem; vertical-align: bottom; text-transform: none; font-size: 0.78rem; }
table.h2h th.rot a { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; color: var(--ink); }
table.h2h th.corner { position: sticky; left: 0; z-index: 2; }
table.h2h td a { color: inherit; font-weight: 700; display: block; }
table.h2h td.win { background: var(--win-soft) !important; color: var(--win); }
table.h2h td.loss { background: var(--loss-soft) !important; color: var(--loss); }
table.h2h td.even { background: #f2f2f3 !important; }
table.h2h td.self { background: #2b2c2d !important; }
table.h2h td.none { color: var(--line); }

/* Rivalry and profile headers */
.matchup {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem;
  background: #000; color: #fff; border-radius: 3px; padding: 1rem 1.25rem; margin: 0.5rem 0 1rem;
}
.matchup .side { display: flex; align-items: center; gap: 0.75rem; font-size: 1.1rem; }
.matchup .side.right { justify-content: flex-end; text-align: right; }
.matchup .side a { color: #fff; }
.matchup .score { font-size: 2.6rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.matchup .mid { color: #a5a6a7; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; text-align: center; }
.matchup .av { width: 2.6rem; height: 2.6rem; }
.profile { display: flex; align-items: center; gap: 1rem; margin: 0.5rem 0 1rem; }
.profile .av { width: 4rem; height: 4rem; }
.profile h1 { margin: 0; }
.profile .lede { margin: 0; }
.stats3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 3px; margin-bottom: 1rem; overflow: hidden; }
.stats3 > div { background: var(--card); padding: 0.75rem 1rem; }
.stats3 span { display: block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.stats3 b { display: block; font-size: 1.4rem; font-weight: 900; color: var(--ink); font-variant-numeric: tabular-nums; }
.stats3 small { color: var(--muted); font-size: 0.78rem; }

/* Buttons and forms */
button {
  font: inherit; font-weight: 700; color: #fff; background: var(--red);
  border: 0; border-radius: 3px; padding: 0.55rem 1.1rem; cursor: pointer;
}
button:hover { background: var(--red-dark); }
form.run { display: grid; gap: 0.75rem; max-width: 22rem; }
form.run label { display: grid; gap: 0.25rem; font-weight: 700; }
form.run label.check { display: flex; gap: 0.5rem; align-items: center; font-weight: 400; }
form.run input[type="password"] { font: inherit; padding: 0.45rem; border: 1px solid var(--line); border-radius: 3px; }
#practice-out { font-size: 1.05rem; font-weight: 700; padding-left: 1.5rem; }
#practice-out small { font-weight: 400; margin-left: 0.4rem; }
tr.hiding td:not(:first-child), tr.hiding td small { visibility: hidden; }

/* Bylaws */
.bylaws { background: var(--card); border: 1px solid var(--line); border-radius: 3px; padding: 1rem 1.25rem 1.5rem; }
.bylaws h2 { font-size: 1.15rem; font-weight: 800; color: var(--ink); margin: 1.75rem 0 0.4rem; padding-bottom: 0.3rem; border-bottom: 2px solid var(--ink); }
.bylaws h3 { font-size: 0.95rem; margin: 1.1rem 0 0.25rem; color: var(--ink); }
.bylaws p { max-width: 50rem; }
.bylaws table { border: 1px solid var(--line); }
table.small { width: auto; min-width: 14rem; }
.toc { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.75rem 0; }
.toc a { padding: 0.25rem 0.7rem; border: 1px solid var(--line); border-radius: 3px; font-size: 0.85rem; font-weight: 700; color: var(--text); }
.pair { display: flex; flex-wrap: wrap; gap: 0 2rem; }
.callout { background: var(--gold-soft); border-left: 4px solid var(--gold); padding: 0.7rem 1rem; }
.titles { padding-left: 1.25rem; }
.titles li { margin: 0.2rem 0; }

footer { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 0 1rem 2rem; }

@media (max-width: 40rem) {
  th, td { padding: 0.4rem 0.45rem; }
  .team small, .sub2 { display: none; }
  .matchup { grid-template-columns: 1fr; text-align: center; }
  .matchup .side, .matchup .side.right { justify-content: center; }
  h1 { font-size: 1.4rem; }
}
