:root {
  --asphalt: #17191c;
  --panel: #212429;
  --panel-raised: #2a2e34;
  --line: #363b42;
  --chalk: #f1ede4;
  --steel: #929ba5;
  --orange: #ff6b1a;
  --orange-ink: #1a0d05;
  --hazard: #f2c230;
  --win: #7bd389;
  --loss: #f06b6b;
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --radius: 4px;
  --wrap: 1120px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--asphalt);
  color: var(--chalk);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
a { color: var(--orange); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* Masthead */
.masthead { padding-top: 28px; border-bottom: 3px solid var(--orange); }
.masthead .wrap:first-child {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: end;
}
.wordmark {
  margin: 0;
  font-weight: 900;
  font-stretch: 125%;
  font-size: clamp(64px, 11vw, 132px);
  line-height: 0.82;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--orange);
}
.masthead-side { padding-bottom: 10px; max-width: 520px; }
.season { margin: 0 0 6px; color: var(--steel); }
.smack {
  margin: 0;
  font-weight: 700;
  font-stretch: 112%;
  font-size: 22px;
  line-height: 1.2;
  min-height: 1.2em;
}
.tabs { display: flex; gap: 2px; margin-top: 22px; overflow-x: auto; }
.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--steel);
  font: inherit;
  font-weight: 600;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
  white-space: nowrap;
}
.tab:hover { color: var(--chalk); }
.tab.is-active { color: var(--chalk); border-bottom-color: var(--chalk); }
.tab:focus-visible, .button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--hazard);
  outline-offset: 2px;
}

/* Views */
main { padding: 28px 20px 48px; }
.view { display: none; }
.view.is-active { display: block; }
h2 {
  margin: 0 0 14px;
  font-weight: 800;
  font-stretch: 112%;
  font-size: 28px;
  letter-spacing: -0.01em;
}
h3 { margin: 18px 0 8px; font-size: 17px; font-weight: 700; }
.lede { color: var(--steel); margin: -6px 0 18px; max-width: 64ch; }
.muted { color: var(--steel); }
.small { font-size: 13px; }
.two-col { display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; }
.row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.inline-control { color: var(--steel); font-size: 14px; display: flex; gap: 8px; align-items: center; }

select, input[type="text"] {
  font: inherit;
  color: var(--chalk);
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 10px;
}
.button {
  font: inherit;
  font-weight: 700;
  background: var(--orange);
  color: var(--orange-ink);
  border: 0;
  border-radius: var(--radius);
  padding: 8px 16px;
  cursor: pointer;
}
.button:disabled { opacity: 0.5; cursor: default; }

/* Tables */
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--steel); font-weight: 600; font-size: 13px; }
td.num, th.num { text-align: right; }
tr.me td { background: rgba(255, 107, 26, 0.08); }
.rank { color: var(--steel); width: 2ch; }
.team-cell { display: flex; gap: 10px; align-items: center; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--panel-raised); object-fit: cover; flex: none; }
.team-name { font-weight: 700; }
.owner { color: var(--steel); font-size: 13px; display: block; }
.streak-w { color: var(--win); }
.streak-l { color: var(--loss); }

/* Matchup cards */
.matchup {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.matchup.is-live { border-left-color: var(--orange); }
.matchup .side { min-width: 0; }
.matchup .side.right { text-align: right; }
.matchup .pts { font-size: 26px; font-weight: 800; line-height: 1.1; }
.matchup .pts.leading { color: var(--chalk); }
.matchup .pts.trailing { color: var(--steel); }
.matchup .vs { color: var(--steel); font-size: 13px; }
.matchup .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.matchup .sub { color: var(--steel); font-size: 13px; }

/* Roster */
.roster-head { display: flex; gap: 14px; align-items: center; margin: 6px 0 16px; }
.roster-head .avatar { width: 48px; height: 48px; }
.roster-head .record { color: var(--steel); }
.slot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.player-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.slot { color: var(--steel); font-size: 12px; font-weight: 700; }
.pos-QB { color: #e88ab8; } .pos-RB { color: #7bd389; } .pos-WR { color: #6fb6f0; }
.pos-TE { color: #f2c230; } .pos-K { color: #b8a5e8; } .pos-DEF { color: #a0a8b0; }
.player-name { font-weight: 600; }
.player-meta { color: var(--steel); font-size: 13px; }
.flag { font-size: 12px; font-weight: 700; padding: 2px 6px; border-radius: 3px; background: var(--panel-raised); }
.flag.bad { background: rgba(240, 107, 107, 0.18); color: var(--loss); }
.flag.warn { background: rgba(242, 194, 48, 0.18); color: var(--hazard); }
.flag.good { background: rgba(123, 211, 137, 0.18); color: var(--win); }

/* Analyzer */
.controls { display: flex; flex-wrap: wrap; gap: 24px; margin-bottom: 18px; background: var(--panel); padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); }
.controls label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--steel); min-width: 180px; }
.controls output { color: var(--chalk); font-weight: 700; margin-left: 6px; }
input[type="range"] { accent-color: var(--orange); }
.spectrum { position: relative; height: 10px; background: linear-gradient(90deg, #6fb6f0 0%, var(--panel-raised) 50%, var(--orange) 100%); border-radius: 5px; min-width: 140px; }
.spectrum i { position: absolute; top: -4px; width: 18px; height: 18px; border-radius: 50%; background: var(--chalk); border: 3px solid var(--asphalt); transform: translateX(-50%); }
.label-contend { color: var(--orange); font-weight: 700; }
.label-rebuild { color: #6fb6f0; font-weight: 700; }
.label-middle { color: var(--steel); font-weight: 700; }
.age-bar { display: inline-flex; gap: 3px; }
.age-bar span { width: 26px; text-align: center; font-size: 12px; padding: 2px 0; border-radius: 3px; background: var(--panel-raised); }

/* Trophies */
.trophy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.trophy {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.trophy.has-title { border-top: 4px solid var(--hazard); }
.trophy .years { font-size: 30px; font-weight: 900; font-stretch: 118%; color: var(--hazard); line-height: 1.1; margin: 8px 0 2px; }
.trophy .years.none { color: var(--steel); font-size: 18px; font-weight: 600; }
.trophy .silver { color: var(--steel); font-size: 14px; }

/* Chat */
.chat { max-width: 720px; }
.chat-log { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; height: 440px; overflow-y: auto; }
.msg { padding: 6px 0; border-bottom: 1px solid var(--line); }
.msg:last-child { border-bottom: 0; }
.msg .who { font-weight: 700; margin-right: 8px; }
.msg .when { color: var(--steel); font-size: 12px; float: right; }
.msg .what { display: block; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-compose { display: grid; grid-template-columns: 160px 1fr auto; gap: 8px; margin-top: 10px; }

.footer { padding: 24px 20px 40px; color: var(--steel); font-size: 14px; border-top: 1px solid var(--line); }

@media (max-width: 800px) {
  .masthead .wrap:first-child { grid-template-columns: 1fr; gap: 12px; }
  .two-col, .slot-grid { grid-template-columns: 1fr; }
  .chat-compose { grid-template-columns: 1fr; }
  .matchup .pts { font-size: 22px; }
}
@media (prefers-reduced-motion: no-preference) {
  .tab, .button { transition: color 120ms, background-color 120ms; }
}
