/* === Race for the Shield === */

.race-for-the-shield {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}

.race-for-the-shield__header {
  text-align: center;
  color: var(--color-text-muted, #94a0b2);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.race-for-the-shield__table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.race-for-the-shield__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  white-space: nowrap;
}

.race-for-the-shield__th {
  padding: 0.5rem 0.6rem;
  text-align: left;
  color: var(--color-text-muted, #94a0b2);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--color-border, #2a3444);
}

.race-for-the-shield__th--numeric {
  text-align: center;
}

.race-for-the-shield__th--bar {
  min-width: 120px;
}

.race-for-the-shield__th--bold {
  color: var(--color-text, #e0e4ea);
}

.race-for-the-shield__header-ligature {
  font-variant-ligatures: common-ligatures;
  font-feature-settings: "liga" 1;
  font-size: 0.7em;
  vertical-align: super;
  line-height: 0;
}

/* Rows */
.race-for-the-shield__row {
  border-bottom: 1px solid var(--color-border, #2a3444);
  transition: background 0.15s;
}

.race-for-the-shield__row:hover {
  background: var(--color-surface, #141a22);
}

.race-for-the-shield__row--home-line {
  border-bottom: 2px solid #4caf50;
}

.race-for-the-shield__row--playoff-line {
  border-bottom: 2px solid #42a5f5;
}

/* Cells */
.race-for-the-shield__td {
  padding: 0.5rem 0.6rem;
  color: var(--color-text, #e0e4ea);
}

.race-for-the-shield__td--rank {
  text-align: center;
  color: var(--color-text-muted, #94a0b2);
  width: 2rem;
}

.race-for-the-shield__td--numeric {
  text-align: center;
}

.race-for-the-shield__td--bold {
  font-weight: 700;
}

.race-for-the-shield__td--status {
  text-align: center;
  width: 2.5rem;
}

.race-for-the-shield__td--bar {
  padding: 0.5rem 0.8rem;
}

/* Team link */
.race-for-the-shield__team-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  color: var(--color-text, #e0e4ea);
  text-decoration: none;
}

.race-for-the-shield__team-link:hover {
  color: var(--team-secondary, #21c6d9);
}

.race-for-the-shield__team-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.race-for-the-shield__team-abbr {
  display: none;
}

/* Status badges */
.race-for-the-shield__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.race-for-the-shield__badge--shield {
  color: #ffd700;
  background: rgb(255 215 0 / 15%);
}

.race-for-the-shield__badge--home {
  color: #4caf50;
  background: rgb(76 175 80 / 15%);
}

.race-for-the-shield__badge--playoff {
  color: #42a5f5;
  background: rgb(66 165 245 / 15%);
}

.race-for-the-shield__badge--eliminated {
  color: #ef5350;
  background: rgb(239 83 80 / 15%);
}

/* Gap coloring */
.race-for-the-shield__gap--positive {
  color: #4caf50;
}

.race-for-the-shield__gap--negative {
  color: #ef5350;
}

.race-for-the-shield__gap--zero {
  color: var(--color-text-muted, #94a0b2);
}

/* Points range bar */
.race-for-the-shield__bar {
  position: relative;
  height: 6px;
  background: var(--color-surface, #141a22);
  border-radius: 3px;
  overflow: hidden;
  min-width: 80px;
}

.race-for-the-shield__bar-potential {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgb(66 165 245 / 20%);
  border-radius: 3px;
}

.race-for-the-shield__bar-current {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgb(66 165 245 / 60%);
  border-radius: 3px;
}

/* Legend */
.race-for-the-shield__legend {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1.5rem;
  padding: 0.75rem;
  color: var(--color-text-muted, #94a0b2);
  font-size: 0.75rem;
}

.race-for-the-shield__legend > span {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.race-for-the-shield__legend .race-for-the-shield__badge {
  width: auto;
  height: auto;
  padding: 0.125rem 0.375rem;
  font-size: 0.625rem;
  flex-shrink: 0;
}

/* Footnotes */
.race-for-the-shield__footnotes {
  margin-top: 1rem;
  padding: 0.75rem;
  color: var(--color-text-faint, #6b7a8e);
  font-size: 0.75rem;
  line-height: 1.6;
}

.race-for-the-shield__footnotes p {
  margin-bottom: 0.25rem;
}

/* No data */
.race-for-the-shield__no-data {
  text-align: center;
  color: var(--color-text-muted, #94a0b2);
  padding: 3rem 1rem;
  font-size: 1rem;
}

/* === Responsive === */
@media (width <= 768px) {
  .race-for-the-shield {
    padding: 0.5rem;
  }

  .race-for-the-shield__table {
    font-size: 0.78rem;
  }

  .race-for-the-shield__team-name {
    display: none;
  }

  .race-for-the-shield__team-abbr {
    display: inline;
  }

  .race-for-the-shield__td--bar {
    display: none;
  }

  .race-for-the-shield__th--bar {
    display: none;
  }

  .race-for-the-shield__td--team {
    position: sticky;
    left: 0;
    background: var(--color-bg, #0a0e14);
    z-index: 1;
  }

  .race-for-the-shield__th--team {
    position: sticky;
    left: 0;
    background: var(--color-bg, #0a0e14);
    z-index: 1;
  }
}
