:root {
  --ink: #f3f0e8;
  --muted: #aeb7ad;
  --line: #323a35;
  --paper: #0d1110;
  --paper-deep: #161c19;
  --panel: #171d1a;
  --panel-strong: #1d2520;
  --green: #50b56f;
  --green-deep: #123323;
  --gold: #d5a847;
  --blue: #79a7c9;
  --rose: #d06f73;
  --shadow: rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(45, 100, 69, 0.26), transparent 34rem),
    linear-gradient(180deg, rgba(21, 27, 24, 0.9), rgba(8, 11, 10, 1)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 80px),
    var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 17, 16, 0.92);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
}

.brand img {
  width: 62px;
  height: 62px;
  object-fit: contain;
}

h1, h2, h3, p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.1;
}

h2 {
  margin-bottom: 14px;
  font-size: 34px;
  line-height: 1.04;
}

h3 {
  font-size: 17px;
  line-height: 1.25;
}

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

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.tab {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.tab.active {
  border-color: rgba(80, 181, 111, 0.32);
  background: rgba(80, 181, 111, 0.14);
  color: #dff4e4;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 22px auto 48px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
  box-shadow: 0 14px 34px var(--shadow);
}

.metric {
  display: flex;
  min-height: 128px;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.metric::after {
  position: absolute;
  right: -18px;
  bottom: -34px;
  color: rgba(255, 255, 255, 0.045);
  content: "19";
  font-size: 98px;
  font-weight: 900;
  line-height: 1;
}

.metric-leader {
  background: linear-gradient(145deg, #1d5135, #102a1f);
  color: #fffdf7;
  border-color: var(--green-deep);
}

.metric-leader .eyebrow,
.metric-leader p {
  color: #e6c86b;
}

.metric strong {
  font-size: 30px;
  line-height: 1;
}

.muted {
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

.mobile-card-list {
  display: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  padding: 11px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

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

tr:last-child td {
  border-bottom: 0;
}

.rank {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #4eb96f;
  color: #07110c;
  font-weight: 800;
}

.rank-1 { background: #55c878; color: #06100a; }
.rank-2 { background: #45a966; color: #07100a; }
.rank-3 { background: #34864f; color: #f1f7ef; }
.rank-4 { background: #2f6644; color: #f1f7ef; }
.rank-5 { background: #3b5145; color: #f1f7ef; }
.rank-6 { background: #3c4440; color: #f1f7ef; }
.rank-7 { background: #343936; color: #f1f7ef; }
.rank-8 { background: #252927; color: #f1f7ef; }

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #252d2a;
  color: #d8ded8;
  font-size: 12px;
  font-weight: 800;
}

.pill.win { background: rgba(80, 181, 111, 0.16); color: #82df9c; }
.pill.loss { background: rgba(208, 111, 115, 0.16); color: #ee9fa2; }
.pill.tie { background: rgba(213, 168, 71, 0.16); color: #ecc96e; }

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: center;
  gap: 28px;
  margin-bottom: 18px;
  padding: 28px;
  border: 1px solid var(--green-deep);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(18, 51, 35, 0.98), rgba(20, 28, 24, 0.96)),
    var(--green-deep);
  color: #fffdf7;
  box-shadow: 0 18px 42px rgba(18, 51, 35, 0.2);
}

.hero-copy h2 {
  max-width: 760px;
  margin: 8px 0 12px;
  font-size: 48px;
}

.hero-subtitle {
  max-width: 640px;
  color: #c8d3c8;
  font-size: 16px;
  line-height: 1.55;
}

.hero-mark {
  display: flex;
  min-height: 180px;
  align-items: center;
  justify-content: center;
}

.hero-mark img {
  width: min(180px, 100%);
  height: auto;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.22));
}

.week-feature {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  background: var(--panel-strong);
}

.recap-grid,
.top-team-grid {
  display: grid;
  gap: 12px;
}

.recap-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.recap-card {
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #121715;
}

.recap-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.recap-card strong {
  display: block;
  margin: 4px 0 8px;
  color: var(--blue);
  font-size: 28px;
}

.top-team-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.team-summary-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--gold);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 26px var(--shadow);
}

.team-summary-main h3 {
  min-height: 42px;
}

.team-points {
  margin-top: 10px;
}

.team-points strong {
  display: block;
  color: #8ee5a5;
  font-size: 32px;
  line-height: 1;
}

.team-points span,
.team-summary-split span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.team-summary-split {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.team-summary-split span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #222a26;
}

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

.select {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 700;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.team-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.empty {
  padding: 48px 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.empty.compact {
  padding: 24px 12px;
}

.link-button,
.ghost-button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.link-button {
  padding: 0;
  color: #dff4e4;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: rgba(80, 181, 111, 0.5);
  text-underline-offset: 4px;
}

.link-button:hover {
  color: #8ee5a5;
}

.ghost-button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-weight: 800;
}

.ghost-button:hover {
  border-color: rgba(80, 181, 111, 0.42);
  color: var(--ink);
}

.player-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.mini-chart {
  min-height: 230px;
}

.chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.chart-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.chart-head strong {
  color: #8ee5a5;
  font-size: 28px;
}

.mini-chart svg {
  width: 100%;
  height: 154px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    #121715;
  background-size: 100% 25%, 20% 100%, auto;
}

.mini-chart polyline {
  fill: none;
  stroke: #8ee5a5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.chart-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.schedule-team {
  color: var(--muted);
  display: inline;
  font-weight: 800;
}

.schedule-team small {
  color: inherit;
  font-size: 12px;
  opacity: 0.72;
}

.schedule-team.win {
  color: #82df9c;
}

.schedule-team.loss {
  color: #ee9fa2;
}

.schedule-team.tie {
  color: #ecc96e;
}

.schedule-card {
  min-height: 238px;
}

.schedule-matchups {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.schedule-matchup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.25;
}

.schedule-matchup:first-child {
  border-top: 0;
}

.schedule-matchup .schedule-team:first-child {
  text-align: right;
}

.versus {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

@media (max-width: 860px) {
  .topbar {
    position: sticky;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 10px 12px;
  }

  .brand {
    min-width: 0;
    gap: 9px;
  }

  .brand img {
    width: 42px;
    height: 42px;
  }

  h1 {
    font-size: 17px;
  }

  h2 {
    font-size: 26px;
  }

  .topbar .eyebrow {
    font-size: 10px;
  }

  .tabs {
    position: static;
    display: flex;
    width: 100%;
    gap: 4px;
    padding-bottom: 2px;
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow-x: auto;
  }

  .tab {
    min-height: 44px;
    flex: 0 0 auto;
    padding: 0 12px;
    border-radius: 6px;
    font-size: 12px;
  }

  .span-4, .span-6, .span-8 {
    grid-column: span 12;
  }

  .span-3 {
    grid-column: span 6;
  }

  .card {
    padding: 13px;
  }

  .metric {
    min-height: 112px;
  }

  .metric strong {
    font-size: 25px;
  }

  .home-hero,
  .week-feature {
    grid-template-columns: 1fr;
  }

  .home-hero {
    gap: 14px;
    padding: 18px;
  }

  .hero-copy h2 {
    margin-bottom: 8px;
    font-size: 30px;
  }

  .hero-subtitle {
    font-size: 14px;
  }

  .hero-mark {
    min-height: 84px;
    justify-content: flex-start;
  }

  .hero-mark img {
    width: 92px;
  }

  .top-team-grid {
    grid-template-columns: 1fr;
  }

  .recap-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  main {
    width: min(100% - 20px, 1180px);
    margin-top: 16px;
  }

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

@media (max-width: 620px) {
  main {
    width: min(100% - 14px, 1180px);
  }

  .table-wrap {
    display: none;
  }

  .mobile-card-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
  }

  .mobile-list-card {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #121715;
  }

  .mobile-card-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-card-main h3 {
    margin-top: 2px;
    font-size: 16px;
  }

  .mobile-card-main > strong {
    color: #8ee5a5;
    font-size: 24px;
  }

  .mobile-stat-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
  }

  .mobile-stat-row span {
    padding: 8px;
    border-radius: 6px;
    background: #1b221f;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
  }

  .mobile-stat-row strong {
    display: block;
    margin-top: 2px;
    color: var(--ink);
    font-size: 15px;
  }

  .player-card-button {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-align: left;
  }

  .player-card-button span {
    color: #8ee5a5;
    font-size: 12px;
    font-weight: 800;
  }

  .player-panel {
    margin-top: 14px;
  }

  .mini-chart {
    min-height: 190px;
  }

  .mini-chart svg {
    height: 128px;
  }

  .schedule-card {
    min-height: 0;
  }

  .schedule-matchup {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .schedule-matchup .schedule-team:first-child {
    text-align: left;
  }

  .versus {
    text-align: left;
  }
}
