@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700;800;900&display=swap");

:root {
  --ink: #18202b;
  --muted: #647084;
  --line: #d9e0e8;
  --paper: #f6f4ef;
  --panel: #fffdf8;
  --navy: #12355b;
  --red: #c03a2b;
  --teal: #1c7c7d;
  --gold: #d99b2b;
  --green: #357a4e;
  --shadow: 0 18px 50px rgba(24, 32, 43, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(18, 53, 91, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(18, 53, 91, 0.05) 1px, transparent 1px),
    var(--paper);
  background-size: 34px 34px;
  font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 154px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 26px;
  padding: 22px 16px;
  background: #102a45;
  color: #fff;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 104px;
  min-height: 68px;
  align-self: center;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  padding: 8px;
  font-size: 15px;
  line-height: 1;
  text-align: center;
  font-weight: 900;
  letter-spacing: 0;
}

.rail-nav {
  display: grid;
  gap: 8px;
}

.rail-nav a {
  display: flex;
  align-items: center;
  min-height: 42px;
  width: 100%;
  border-radius: 8px;
  padding: 0 12px;
  color: #dbe8f4;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.rail-nav a.active,
.rail-nav a:hover {
  background: #fff;
  color: var(--navy);
}

main {
  width: min(1480px, 100%);
  min-width: 0;
  margin: 0 auto;
  padding: 30px;
}

.topbar,
.topbar > div,
.season-control,
.score-strip,
.panel,
.range-panel {
  min-width: 0;
  max-width: 100%;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  min-height: 220px;
  padding: 30px;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(16, 42, 69, 0.96), rgba(16, 42, 69, 0.78)),
    radial-gradient(circle at 72% 40%, rgba(217, 155, 43, 0.48), transparent 26%),
    repeating-linear-gradient(90deg, transparent 0 72px, rgba(255, 255, 255, 0.08) 72px 74px),
    #102a45;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar .eyebrow {
  color: #f4bd50;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(38px, 6vw, 78px);
  line-height: 0.98;
  overflow-wrap: break-word;
}

h2 {
  font-size: 20px;
}

.season-control {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: min(430px, 100%);
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.season-control label {
  color: #dbe8f4;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.season-control select {
  width: 100%;
  border-color: rgba(255, 255, 255, 0.28);
}

.quick-years {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.quick-years button {
  min-width: 0;
  border: 0;
  border-radius: 6px;
  padding: 10px 12px;
  color: #fff;
  background: transparent;
  cursor: pointer;
}

.quick-years button.active {
  color: var(--navy);
  background: #fff;
  font-weight: 800;
}

.score-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 18px 0;
}

.range-panel {
  margin-bottom: 18px;
}

.range-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  gap: 16px;
}

.data-note {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.mode-toggle,
.quick-ranges,
.league-toggle {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.mode-toggle button,
.quick-ranges button,
.league-toggle button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.mode-toggle button.active,
.quick-ranges button.active,
.league-toggle button.active {
  color: #fff;
  background: var(--navy);
}

.range-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-width: 280px;
  grid-column: 1 / -1;
}

.range-panel[data-active-mode="single"] .range-fields,
.range-panel[data-active-mode="single"] .quick-ranges {
  display: none;
}

.split-controls-panel[data-active-mode="single"] .split-range-fields,
.split-controls-panel[data-active-mode="single"] .split-quick-ranges {
  display: none;
}

.quick-ranges {
  grid-column: 1 / -1;
  width: fit-content;
}

.league-toggle {
  grid-column: 1 / -1;
  width: fit-content;
}

.team-filter,
.position-filter {
  display: grid;
  grid-template-columns: auto minmax(220px, 320px);
  align-items: center;
  gap: 10px;
  grid-column: 1 / -1;
  width: fit-content;
}

.team-filter label,
.position-filter label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.range-fields label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.range-fields span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.range-fields strong {
  color: var(--ink);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--red);
}

.score-strip article,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 10px 28px rgba(24, 32, 43, 0.07);
}

.score-strip article {
  min-height: 136px;
  padding: 20px;
}

.score-strip span,
.score-strip small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.score-strip strong {
  display: block;
  margin: 12px 0 8px;
  font-size: 38px;
  line-height: 1;
}

.workbench,
.data-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.75fr);
  gap: 18px;
  margin-bottom: 18px;
}

.panel {
  padding: 22px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

select,
input[type="search"] {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

.split-search-card {
  width: min(520px, 100%);
}

.split-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.split-search-form button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  color: #fff;
  background: var(--red);
  font-weight: 800;
  cursor: pointer;
}

.split-summary strong {
  font-size: clamp(24px, 3vw, 34px);
}

.summary-link {
  color: inherit;
  text-decoration: none;
}

.summary-link:hover {
  text-decoration: underline;
}

.split-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.split-mode-toggle,
.split-range-fields,
.split-quick-ranges {
  margin-top: 14px;
}

.split-range-fields {
  grid-template-columns: 1fr 1fr;
}

.split-controls label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.split-status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.split-table-panel table {
  min-width: 860px;
}

.split-total-row {
  background: #eef5f3;
}

.split-total-row td {
  border-bottom-color: #c8d8d5;
  font-weight: 900;
}

.fantasy-type-toggle {
  grid-template-columns: 1fr 1fr;
}

.fantasy-select-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
  grid-column: 1 / -1;
}

.fantasy-select-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.fantasy-summary strong {
  font-size: clamp(24px, 3vw, 34px);
}

.fantasy-note-list {
  display: grid;
  gap: 12px;
}

.fantasy-note-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.fantasy-note-card span,
.fantasy-note-cell {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  white-space: normal;
}

.fantasy-table-panel table {
  min-width: 980px;
}

.news-topic-toggle {
  width: fit-content;
}

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

.news-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  min-height: 136px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.news-card img {
  width: 100%;
  height: 112px;
  object-fit: cover;
  border-radius: 6px;
  background: #e8edf1;
}

.news-source {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.news-card h3 {
  margin: 6px 0 8px;
  font-size: 18px;
  line-height: 1.15;
}

.news-card a {
  color: var(--ink);
  text-decoration: none;
}

.news-card a:hover,
.news-source-link:hover {
  text-decoration: underline;
}

.news-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

.news-source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.news-source-link {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  font-weight: 800;
  text-decoration: none;
}

.team-hub-grid {
  display: grid;
  grid-template-columns: minmax(230px, 0.9fr) repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.team-hub-grid h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.team-profile-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.team-profile-card .club-badge {
  width: 64px;
  height: 64px;
}

.team-profile-card span,
.team-profile-card small,
.team-directory-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.team-profile-card strong {
  display: block;
  margin: 2px 0;
  font-size: 22px;
}

.team-directory-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.team-directory-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.team-directory-card:hover,
.team-directory-card.active {
  border-color: var(--navy);
  box-shadow: 0 8px 24px rgba(24, 32, 43, 0.1);
}

.team-directory-card strong {
  display: block;
  overflow-wrap: anywhere;
}

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

.advanced-grid .leaderboard {
  grid-column: 1;
}

.bar-chart {
  display: grid;
  gap: 11px;
}

.bar-row {
  display: grid;
  grid-template-columns: 154px minmax(100px, 1fr) 58px;
  align-items: center;
  gap: 12px;
  min-height: 36px;
}

.bar-label {
  min-width: 0;
}

.bar-label strong,
.bar-label span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-player-link {
  color: inherit;
  text-decoration: none;
}

.chart-player-link:hover strong {
  text-decoration: underline;
}

.bar-label span,
.comparison span,
.club-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.bar-track {
  height: 14px;
  border-radius: 999px;
  background: #e8edf1;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold));
}

.bar-value {
  text-align: right;
  font-weight: 800;
}

.empty-state,
.empty-row {
  color: var(--muted);
  font-weight: 800;
}

.empty-state {
  padding: 18px 0;
}

.empty-row {
  padding: 22px 12px;
  text-align: left;
}

.team-pickers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.compare-grid {
  display: grid;
  gap: 12px;
}

.comparison {
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  gap: 12px;
}

.comparison strong {
  font-size: 18px;
}

.split-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: #e8edf1;
}

.split-left,
.split-right {
  position: absolute;
  top: 0;
  bottom: 0;
}

.split-left {
  left: 0;
  border-radius: 999px 0 0 999px;
  background: var(--red);
}

.split-right {
  right: 0;
  border-radius: 0 999px 999px 0;
  background: var(--teal);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 690px;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child,
th:nth-child(2),
td:nth-child(2) {
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  cursor: pointer;
}

th button {
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-transform: inherit;
  cursor: pointer;
}

td {
  font-weight: 700;
}

.player-cell,
.player-link {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-link {
  color: inherit;
  text-decoration: none;
}

.player-link:hover span:last-child {
  text-decoration: underline;
}

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff;
  background: var(--navy);
  font-size: 12px;
  font-weight: 800;
}

.club-list {
  display: grid;
  gap: 12px;
}

.club-card {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.club-badge {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  color: #fff;
  background: var(--navy);
  font-weight: 900;
}

.club-card strong {
  display: block;
}

.club-score {
  font-size: 22px;
  font-weight: 900;
}

.park-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.park-tile {
  min-height: 124px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(28, 124, 125, 0.12), rgba(217, 155, 43, 0.16)),
    #fff;
}

.park-tile strong,
.park-tile span {
  display: block;
}

.park-tile span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.park-factor {
  margin-top: 20px;
  font-size: 32px;
  font-weight: 900;
}

.trust-hero {
  min-height: 300px;
}

.trust-panel {
  display: grid;
  gap: 14px;
  max-width: 880px;
  margin-top: 18px;
  font-size: 17px;
  line-height: 1.65;
}

.trust-panel p {
  margin: 0;
  color: var(--muted);
  font-weight: 650;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
  padding: 18px 0 2px;
}

.site-footer a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--navy);
}

.matchup-form-grid,
.matchup-setup-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
  align-items: start;
}

.matchup-form-grid label,
.matchup-setup-column,
.matchup-setup-column label,
.matchup-search {
  display: grid;
  gap: 8px;
}

.matchup-setup-column {
  gap: 14px;
}

.matchup-search {
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: end;
}

.matchup-read {
  display: grid;
  gap: 10px;
  line-height: 1.55;
}

.matchup-read p {
  margin: 0;
  color: var(--muted);
  font-weight: 650;
}

.matchup-read strong {
  color: var(--ink);
}

.matchup-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.advanced-search-wrap {
  display: grid;
  gap: 12px;
  justify-items: end;
}

.advanced-search-wrap > button,
.browse-players-wrap > button {
  justify-self: start;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--navy);
  background: #fff;
  font-weight: 850;
  cursor: pointer;
}

.browse-players-wrap {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.browse-players-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}

.browse-players-grid label {
  display: grid;
  gap: 8px;
}

.matchup-advanced-search {
  display: grid;
  width: min(520px, 100%);
  grid-template-columns: 1fr;
  gap: 14px;
  padding-top: 4px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
    height: auto;
    flex-direction: row;
    justify-content: space-between;
  }

  .rail-nav {
    grid-auto-flow: column;
  }

  .rail-nav a {
    width: auto;
  }

  main {
    padding: 18px;
  }

  .topbar {
    display: grid;
    min-height: 260px;
  }

  .score-strip,
  .range-toolbar,
  .workbench,
  .data-grid,
  .park-grid,
  .matchup-form-grid,
  .matchup-setup-grid,
  .matchup-card-grid,
  .matchup-advanced-search,
  .browse-players-grid,
  .news-grid,
  .team-hub-grid,
  .team-directory-grid {
    grid-template-columns: 1fr 1fr;
  }

  .leaderboard,
  .park-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .rail {
    align-items: center;
    flex-wrap: wrap;
  }

  .rail-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }

  .topbar,
  .panel {
    padding: 18px;
  }

  .season-control,
  .score-strip,
  .range-toolbar,
  .mode-toggle,
  .quick-ranges,
  .league-toggle,
  .team-filter,
  .position-filter,
  .workbench,
  .data-grid,
  .park-grid,
  .matchup-form-grid,
  .matchup-setup-grid,
  .matchup-search,
  .matchup-card-grid,
  .matchup-advanced-search,
  .browse-players-grid,
  .team-hub-grid,
  .team-directory-grid,
  .team-pickers {
    grid-template-columns: 1fr;
  }

  .news-grid,
  .news-card {
    grid-template-columns: 1fr;
  }

  .season-control {
    width: 100%;
  }

  .quick-years {
    grid-template-columns: 1fr 1fr;
  }

  .bar-row {
    grid-template-columns: 104px minmax(70px, 1fr) 48px;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .advanced-search-wrap {
    justify-items: stretch;
  }
}
