:root {
  --bg: #121012;
  --surface: #1c1919;
  --surface-raised: #242020;
  --ink: #f2ece4;
  --muted: #9c8f83;
  --line: #332c2c;

  /* Overridden per-team by team.html; sensible default for index.html */
  --accent: #e0393c;
  --accent-strong: #841617;
  --accent-on-strong: #f2ece4;

  --grade-a: #3ddc84;
  --grade-b: #5eb1ff;
  --grade-c: #ffd166;
  --grade-d: #ff6b6e;
}

* { box-sizing: border-box; }

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Georgia", "Iowan Old Style", serif;
  padding: 48px 24px 80px;
}

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
}

/* ---------- site nav ---------- */

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 28px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
}

.site-nav a {
  color: var(--muted);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  color: var(--ink);
}

.site-nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- footer ---------- */

.site-footer {
  max-width: 1080px;
  width: 100%;
  margin: 56px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-family: "Helvetica Neue", Arial, sans-serif;
}

.site-footer p {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.site-footer p:last-child {
  margin-bottom: 0;
}

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

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer .disclaimer {
  color: #6b6058;
}

/* ---------- shared header ---------- */

.eyebrow {
  font-family: "Helvetica Neue", Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 6px;
}

h1 {
  margin: 0;
  font-size: 40px;
  letter-spacing: -0.01em;
}

.subhead {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--muted);
  margin-top: 10px;
  max-width: 620px;
  line-height: 1.5;
}

/* ---------- landing page: team grid ---------- */

header.page-header {
  border-bottom: 3px solid var(--accent);
  padding-bottom: 20px;
  margin-bottom: 28px;
}

.search-input {
  display: block;
  width: 100%;
  max-width: 340px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 14px;
  margin-bottom: 20px;
  color: var(--ink);
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
}

.search-input::placeholder {
  color: var(--muted);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.conf-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.conf-tab {
  flex-shrink: 0;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  white-space: nowrap;
}

.conf-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-on-strong);
}

/* ---------- homepage: hero + headline strip ---------- */

.hero {
  max-width: 1080px;
  margin: 0 auto 32px;
  padding-bottom: 28px;
  border-bottom: 3px solid var(--accent);
}

.hero h1 {
  font-size: 48px;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.hero .subhead {
  max-width: 640px;
  font-size: 15px;
}

.headline-strip {
  max-width: 1080px;
  margin: 0 auto 32px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.headline-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 8px;
  padding: 18px;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.headline-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.headline-label {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 10px;
}

.headline-main {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
}

.headline-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.headline-main .chip {
  display: inline-block;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  vertical-align: middle;
}

.headline-sub {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.headline-flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.headline-flow img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.headline-flow .flow-arrow {
  margin: 0 1px;
}

.headline-stat {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  color: var(--ink);
}

.section-label {
  max-width: 1080px;
  margin: 0 auto 14px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* Sits inline with the conference pills inside #conf-tabs, styled to match
   their height/shape instead of the full-width search box elsewhere. */
.search-input-inline {
  width: 180px;
  max-width: 100%;
  padding: 9px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
}

.search-input-inline::placeholder { color: var(--muted); }
.search-input-inline:focus { outline: none; border-color: var(--accent); }

@media (max-width: 720px) {
  .headline-strip { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 32px; }
  .search-input-inline { width: 100%; }
}

@media (max-width: 420px) {
  .headline-strip { grid-template-columns: 1fr; }
}

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

.team-card {
  /* min-width: 0 overrides the grid item's default min-width: auto, which otherwise
     sizes to the content's min-content width (the pill row) and blows out the
     1fr track, pushing the grid wider than its container on narrow screens. */
  min-width: 0;
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.team-card:hover {
  transform: translateY(-2px);
  border-color: var(--card-accent, var(--accent));
}

.team-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.team-logo-chip {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--card-accent-bg, var(--surface-raised));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.team-logo-chip img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.grade-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.grade-pill {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 5px;
}

.grade-pill-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.grade-pill.grade-a { color: var(--grade-a); border-color: var(--grade-a); }
.grade-pill.grade-b { color: var(--grade-b); border-color: var(--grade-b); }
.grade-pill.grade-c { color: var(--grade-c); border-color: var(--grade-c); }
.grade-pill.grade-d { color: var(--grade-d); border-color: var(--grade-d); }

.team-name {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
}

.ap-rank {
  display: inline-block;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--grade-c);
  background: var(--surface-raised);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 999px;
  vertical-align: middle;
}

.team-mascot {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.team-counts {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
  display: flex;
  gap: 14px;
}

.team-counts .in { color: var(--grade-a); }
.team-counts .out { color: var(--grade-d); }

/* ---------- team detail page ---------- */

.back-link {
  display: inline-block;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 24px;
}

.back-link:hover { color: var(--ink); }

.team-header {
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 3px solid var(--accent);
  padding-bottom: 24px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.team-header-logo {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--surface-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.team-header-logo img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.team-header-text h1 {
  color: var(--accent);
}

.team-header-mascot {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

.grade-block-row {
  margin-left: auto;
  display: flex;
  gap: 28px;
}

.grade-block {
  text-align: right;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

.grade-block .grade-big {
  font-size: 36px;
  font-weight: 800;
}

.grade-block .grade-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.grade-block .grade-label .label-note,
.unit-grade-label .label-note {
  text-transform: none;
  letter-spacing: normal;
  opacity: 0.7;
}

.grade-block .net-rating {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

#meta {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  color: var(--muted);
  margin: 16px 0 32px;
}

/* unit grades */

.unit-block {
  margin-bottom: 24px;
}

.unit-block-title {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 10px;
}

.unit-grades {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.unit-grade {
  flex: 1;
  min-width: 160px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px 20px;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

.unit-grade-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}

.unit-grade-big {
  font-size: 28px;
  font-weight: 800;
}

.unit-grade-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* toggle */

.toggle-row {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

.toggle-btn {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.toggle-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-on-strong);
}

/* transfer cards (reused list style) */

#cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 4px;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

a.card {
  transition: transform 0.12s ease, border-color 0.12s ease;
}

a.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

/* rankings.html cards: grid instead of space-between flex, so the name column is a
   fixed width and every row's origin logo lines up at the same x position instead of
   drifting left/right depending on how long each player's name happens to be. */
.transfer-card {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr auto;
  align-items: center;
  gap: 16px;
}

/* team.html outgoing list: draft picks and presumed-graduated players get a
   lighter row background than regular portal transfers, so both non-transfer
   departure types read as "different from a normal transfer" at a glance. The
   rank badge keeps the team's own accent color throughout -- only the row
   background changes. */
.card.departure-draft,
.card.departure-graduated {
  border-left-color: var(--muted);
  background: #332d28;
}

.rank {
  position: absolute;
  top: -10px;
  left: -10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-on-strong);
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.name-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.name {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

.origin {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  color: var(--muted);
}

.transfer-flow {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 120px;
  gap: 10px;
  flex-wrap: wrap;
}

.transfer-flow a {
  display: block;
}

.flow-team {
  display: flex;
  align-items: center;
  gap: 8px;
}

.flow-team span {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  color: var(--muted);
  max-width: 110px;
}

.flow-team a:hover span {
  color: var(--ink);
}

.flow-logo {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.flow-logo img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.flow-arrow {
  color: var(--muted);
  font-size: 16px;
  flex-shrink: 0;
}

.stats {
  font-family: "Helvetica Neue", Arial, sans-serif;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

/* AP Top 25 tab: two full grade+rating blocks (Incoming, Net) need more room
   between them than a plain grade+value pair, or they read as one cramped
   cluster instead of two distinct stats. */
.stats-wide {
  gap: 56px;
}

.stats-wide .stat {
  min-width: 70px;
}

.stat { text-align: right; }

.stat .value { font-size: 16px; font-weight: 600; }
.stat .value.stars { color: var(--grade-c); }

.stat .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.stat .sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

#empty, #error {
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: var(--muted);
  padding: 20px 24px;
  border: 1px dashed var(--line);
  border-radius: 4px;
}

/* ---------- mobile ---------- */

@media (max-width: 640px) {
  body {
    padding: 24px 16px 56px;
  }

  h1 {
    font-size: 28px;
  }

  .eyebrow {
    font-size: 11px;
  }

  .subhead {
    font-size: 13px;
    max-width: none;
  }

  header.page-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
  }

  .team-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .team-card {
    padding: 14px;
  }

  .team-logo-chip {
    width: 44px;
    height: 44px;
  }

  .team-logo-chip img {
    width: 30px;
    height: 30px;
  }

  .team-name {
    font-size: 16px;
  }

  .grade-pill {
    font-size: 11px;
    padding: 4px 8px;
  }

  .team-header {
    gap: 14px;
    padding-bottom: 16px;
  }

  .team-header-logo {
    width: 64px;
    height: 64px;
  }

  .team-header-logo img {
    width: 44px;
    height: 44px;
  }

  .team-header-text h1 {
    font-size: 26px;
  }

  .grade-block-row {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }

  .grade-block {
    text-align: left;
  }

  .grade-block .grade-big {
    font-size: 28px;
  }

  .unit-grade {
    min-width: 0;
    flex: 1 1 100%;
  }

  .toggle-row {
    gap: 6px;
  }

  .toggle-btn {
    flex: 1;
    padding: 12px 10px;
    text-align: center;
  }

  .card {
    padding: 16px;
    gap: 10px;
  }

  .name {
    font-size: 17px;
  }

  .stats {
    gap: 14px;
    width: 100%;
    justify-content: flex-start;
  }

  .stat {
    text-align: left;
  }

  .transfer-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .transfer-flow {
    padding-left: 0;
  }
}

@media (max-width: 380px) {
  .team-grid {
    grid-template-columns: 1fr;
  }
}
