:root {
  --page: #f2f2f0;
  --surface: #ffffff;
  --surface-soft: #f7f7f5;
  --ink: #1f2328;
  --muted: #626a73;
  --line: #c9ccd1;
  --line-dark: #9da3aa;
  --header: #30343a;
  --header-2: #454b53;
  --accent: #8f2d2d;
  --accent-2: #246b55;
  --link: #1d4e89;
  --link-hover: #8f2d2d;
  --table-head: #e5e7ea;
  --gold: #f0c45a;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(31, 35, 40, .08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.42;
  letter-spacing: 0;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 36px;
  border: 1px solid #6d2020;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  padding: 7px 12px;
  cursor: pointer;
}

button:hover {
  background: #742424;
}

.secondary-button {
  border-color: var(--line-dark);
  background: #e8eaed;
  color: var(--ink);
}

.secondary-button:hover {
  background: #d7dade;
}

.text-button {
  min-height: 30px;
  border-color: var(--line);
  background: #fff;
  color: var(--link);
  padding: 4px 10px;
}

.text-button:hover {
  background: #f0f2f4;
}

.site-shell {
  width: min(1240px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--surface);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.site-header {
  border-bottom: 1px solid var(--line-dark);
  background: var(--surface);
}

.utility-bar {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  color: #f7f7f7;
  background: var(--header);
  font-size: 12px;
}

.utility-brand,
.utility-action {
  color: #fff;
  font-weight: 700;
}

.utility-action {
  margin-left: auto;
}

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 420px);
  gap: 24px;
  align-items: end;
  padding: 22px 18px 18px;
  background: #f5f5f3;
}

.masthead.compact {
  align-items: center;
}

.kicker {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.12;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(30px, 5vw, 46px);
}

h2 {
  font-size: 18px;
}

.deck {
  max-width: 760px;
  margin: 7px 0 0;
  color: #444b54;
  font-size: 15px;
}

.masthead-tools {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px;
}

.field {
  display: grid;
  gap: 4px;
}

.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 7px 9px;
}

.primary-nav {
  display: flex;
  flex-wrap: wrap;
  background: var(--header-2);
  border-bottom: 4px solid var(--accent);
}

.primary-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 9px 14px;
  border-right: 1px solid rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.primary-nav a:hover {
  background: #262a30;
  text-decoration: none;
}

.page-grid {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 270px;
  gap: 14px;
  padding: 14px;
}

.sidebar,
.rail,
.content-column {
  min-width: 0;
}

.panel {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel > h2,
.section-head {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  background: var(--table-head);
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  font-size: 18px;
}

.quiet {
  color: var(--muted);
  font-size: 12px;
}

.link-stack,
.season-list,
.leader-list,
.fact-list {
  padding: 8px 10px 10px;
}

.link-stack a,
.season-list button {
  width: 100%;
  min-height: 31px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px dotted #d7dade;
  color: var(--link);
  font-size: 13px;
}

.link-stack a {
  padding: 6px 0;
}

.season-list button {
  border-width: 0 0 1px;
  border-radius: 0;
  background: transparent;
  color: var(--link);
  padding: 6px 0;
  text-align: left;
}

.season-list button:hover,
.season-list button.is-active {
  color: var(--accent);
  background: transparent;
  text-decoration: underline;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border: 1px solid #c7d3df;
  border-radius: 999px;
  background: #eef4f8;
  color: #34485c;
  padding: 2px 7px;
  font-size: 11px;
  white-space: nowrap;
}

.season-title-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfbfa;
  padding: 16px;
  box-shadow: var(--shadow);
}

.season-title-band h2 {
  font-size: 30px;
}

.season-title-band p:last-child {
  margin-bottom: 0;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.stat-box {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 9px;
}

.stat-box strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  line-height: 1;
}

.stat-box span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.standings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 10px;
}

.division-table h3 {
  margin: 0 0 7px;
  color: var(--accent-2);
  font-size: 17px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ref-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  border: 1px solid var(--line);
  background: var(--table-head);
  color: #2f343a;
  padding: 7px 8px;
  text-align: left;
  white-space: nowrap;
}

.ref-table td {
  border: 1px solid var(--line);
  padding: 7px 8px;
  vertical-align: top;
}

.ref-table tbody tr:nth-child(even) td {
  background: var(--surface-soft);
}

.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.winner {
  color: var(--accent);
  font-weight: 700;
}

.boxscore-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
}

.boxscore-grid a,
.report-pill {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfbfb;
  padding: 7px 9px;
  font-size: 13px;
}

.boxscore-grid a:hover,
.report-pill:hover {
  border-color: var(--line-dark);
  background: #f2f5f7;
  text-decoration: none;
}

.empty {
  color: var(--muted);
  text-align: center;
}

.leader-item {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 9px;
  min-height: 84px;
  padding: 9px 0;
  border-bottom: 1px dotted #d7dade;
}

.leader-item:last-child {
  border-bottom: 0;
}

.leader-photo,
.leader-fallback {
  width: 60px;
  height: 76px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  background: #e8eaed;
  object-fit: cover;
  object-position: center top;
}

.leader-fallback {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
}

.leader-category {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.leader-name {
  display: inline-block;
  margin-top: 2px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 700;
}

.leader-value {
  margin-top: 3px;
  font-size: 12px;
}

.leader-value strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
}

.leader-note {
  color: var(--muted);
  font-size: 11px;
}

.fact-list {
  margin: 0;
}

.fact-list div {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dotted #d7dade;
}

.fact-list div:last-child {
  border-bottom: 0;
}

.fact-list dt {
  color: var(--muted);
  font-weight: 700;
}

.fact-list dd {
  margin: 0;
}

.search-results {
  border-color: #aab8c5;
}

.search-result-table .tag {
  margin-left: 6px;
}

.site-footer {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: #eceeed;
  color: var(--muted);
  font-size: 12px;
}

.site-footer a {
  margin-left: auto;
}

.updater-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 46%);
  gap: 14px;
  padding: 14px;
}

.drop-zone {
  min-height: 118px;
  display: grid;
  place-items: center;
  margin: 10px;
  border: 2px dashed var(--line-dark);
  border-radius: var(--radius);
  background: #f7f9fa;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.drop-zone input {
  width: 1px;
  height: 1px;
  opacity: 0;
  position: absolute;
  pointer-events: none;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 10px 10px;
}

#seasonBlock {
  width: calc(100% - 20px);
  min-height: 520px;
  margin: 10px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  padding: 10px;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 1050px) {
  .page-grid {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .rail {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
  }

  .rail .panel {
    margin-bottom: 0;
  }
}

@media (max-width: 820px) {
  .masthead,
  .season-title-band,
  .updater-grid {
    grid-template-columns: 1fr;
  }

  .masthead-tools {
    grid-template-columns: 1fr;
  }

  .page-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
  }

  .sidebar .panel {
    margin-bottom: 0;
  }

  .standings-grid,
  .boxscore-grid,
  .rail {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 13px;
  }

  .utility-bar {
    flex-wrap: wrap;
  }

  .utility-action {
    margin-left: 0;
  }

  .masthead {
    padding: 16px 12px;
  }

  h1 {
    font-size: 31px;
  }

  .season-title-band h2 {
    font-size: 24px;
  }

  .page-grid,
  .updater-grid {
    padding: 10px;
  }

  .sidebar,
  .stat-strip {
    grid-template-columns: 1fr;
  }
}
