/* The lineup: players as tiles in the colours of their NFL team. Used by the
   roster on the home page and by the gameblitz page. */

/* the roster as a lineup: the positions below each other, the players of a
   position side by side */
.lineup {
  margin-top: 35px;
}

.lineup-group {
  margin-bottom: 36px;
}

.lineup-position {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 16px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lineup-position-code {
  color: var(--orange);
  font-weight: 800;
}

/* a player on the bench: the same tile, a little quieter, marked BN */
.lineup-player.bench {
  position: relative;
  opacity: 0.7;
}

.lineup-bench-tag {
  position: absolute;
  top: 6px;
  right: 10px;
  color: var(--orange);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

/* the players who left the team: closed at first, one line each */
.lineup-retired {
  margin-top: 8px;
}

.lineup-retired > .fold-toggle {
  margin-top: 0;
}

.lineup-retired ul {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.lineup-retired li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px 44px 44px;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.lineup-retired li strong {
  overflow: hidden;
  color: var(--cream);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lineup-retired li span:last-child {
  text-align: right;
}

.lineup-players {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lineup-player {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--dark-2);
}

/* the number on the colour of the NFL team, in place of a photo */
.jersey {
  flex: none;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  outline: 1px solid var(--line);
  border-bottom: 6px solid var(--jersey-stripe, var(--line));
  background: var(--jersey, var(--navy));
  color: var(--jersey-text, var(--cream));
  font-family: "Barlow Condensed", sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}

.jersey.wide {
  font-size: 1.5rem;
  letter-spacing: 0.04em;
}

.lineup-player-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.lineup-player-info strong {
  overflow: hidden;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lineup-player-info > span {
  color: var(--muted);
  font-size: 0.85rem;
}

.lineup-empty {
  margin: 0;
  color: var(--muted);
}

/* small tiles (gameblitz): two next to each other on a phone */
.lineup-players.compact {
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 8px;
}

.compact .lineup-player {
  gap: 8px;
  padding: 6px;
}

.compact .jersey {
  width: 36px;
  height: 36px;
  border-bottom-width: 4px;
  font-size: 1.35rem;
}

.compact .jersey.wide {
  font-size: 0.95rem;
}

.compact .lineup-player-info strong {
  font-size: 1.1rem;
}

.compact .lineup-player-info > span {
  font-size: 0.75rem;
}

/* the second line stays on one line; the mark sits at its end */
.compact .lineup-player-info > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact .lineup-player.bench .lineup-player-info > span {
  padding-right: 1.5rem;
}

.compact .lineup-player[data-tag="BYE"] .lineup-player-info > span {
  padding-right: 2rem;
}

.compact .lineup-bench-tag {
  top: auto;
  right: 7px;
  bottom: 5px;
  font-size: 0.8rem;
}

/* the fantasy points of a player (gameblitz, with live data): at the right of
   the tile, a projection quieter */
.lineup-points {
  flex: none;
  align-self: flex-start;
  margin-left: auto;
  padding-left: 4px;
  color: var(--cream);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.2;
}

.lineup-points.projected {
  color: var(--muted);
  font-size: 1rem;
  font-style: italic;
  font-weight: 500;
}

.lineup-player.bench .lineup-points {
  color: var(--muted);
}

/* the name gives way to the points */
.lineup-player.has-points .lineup-player-info {
  flex: 1 1 auto;
}

.compact .lineup-player[data-tag="IR"] .lineup-player-info > span {
  padding-right: 1.5rem;
}

/* the team in the second line of a small tile: the nickname ("Bears"), on a
   phone the abbreviation ("CHI") */
.lineup-player-info .team-abbr {
  display: none;
}

/* On a phone the small tiles keep the whole first line for the name: the
   points move to the end of the second line, about as big as it and set off
   by their colour; the mark (BN) goes to the top corner. */
@media (max-width: 600px) {
  .compact .lineup-player-info .team-name {
    display: none;
  }

  .compact .lineup-player-info .team-abbr {
    display: inline;
  }

  .compact .lineup-player.has-points {
    position: relative;
  }

  .compact .lineup-player.has-points .lineup-points {
    position: absolute;
    right: 7px;
    bottom: 6px;
    padding-left: 0;
    font-family: Inter, sans-serif;
    font-size: 0.8rem;
    line-height: 1;
  }

  .compact .lineup-player.has-points .lineup-points.projected {
    font-size: 0.75rem;
  }

  .compact .lineup-player.has-points .lineup-player-info > span {
    padding-right: 2.35rem;
  }

  .compact .lineup-player.has-points .lineup-bench-tag {
    top: 5px;
    bottom: auto;
    font-size: 0.7rem;
  }

  .compact .lineup-player.has-points.bench .lineup-player-info strong {
    padding-right: 1.1rem;
  }
}

/* a player of the fantasy opponent (gameblitz): name and points in red, the
   tile itself as ours */
.lineup-player.opponent .lineup-player-info strong,
.lineup-player.opponent .lineup-points {
  color: var(--opponent);
}

.lineup-player.opponent .lineup-points.projected {
  color: var(--opponent-quiet);
}

/* a half high tile in one line (gameblitz: the opponent, the bench): a small
   jersey, the name, the position and the points; on a phone too */
.compact .lineup-player.mini {
  position: relative;
  gap: 6px;
  padding: 3px 6px 3px 3px;
}

.compact .mini .jersey {
  width: 22px;
  height: 22px;
  border-bottom-width: 2px;
  font-size: 0.85rem;
}

.compact .mini .jersey.wide {
  font-size: 0.55rem;
  letter-spacing: 0;
}

.compact .mini .lineup-player-info {
  flex: 1 1 auto;
  flex-direction: row;
  align-items: baseline;
  gap: 5px;
}

.compact .mini .lineup-player-info strong {
  min-width: 0;
  font-size: 0.95rem;
}

.compact .lineup-player.mini .lineup-player-info > span {
  flex: none;
  padding-right: 0;
  font-size: 0.68rem;
}

.compact .lineup-player.mini.has-points .lineup-points,
.compact .lineup-player.mini .lineup-points {
  position: static;
  align-self: center;
  padding-left: 2px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.95rem;
  line-height: 1;
}

.compact .lineup-player.mini .lineup-points.projected {
  font-size: 0.85rem;
}

/* the mark (IR) in place of the position */
.compact .mini .mini-tag {
  color: var(--orange);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.compact .lineup-player.mini.has-points.bench .lineup-player-info strong {
  padding-right: 0;
}

/* on a phone a mini tile is half the width: a little tighter */
@media (max-width: 600px) {
  .compact .lineup-player.mini {
    gap: 5px;
    padding-right: 5px;
  }

  .compact .mini .lineup-player-info {
    gap: 3px;
  }

  .compact .mini .lineup-player-info strong {
    font-size: 0.9rem;
  }

  .compact .lineup-player.mini .lineup-player-info > span {
    font-size: 0.62rem;
  }

  .compact .lineup-player.mini .lineup-points {
    font-size: 0.9rem;
  }
}

/* the injury status of the NFL (gameblitz): a dot on the corner of the
   jersey, yellow to dark red by how bad it is, a suspension violet. It only
   says that there is something to look up in the fantasy app; what it is, is
   in the tooltip. */
.jersey {
  position: relative;
}

.injury-flag {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  outline: 2px solid var(--dark-2);
  background: var(--injury, #8a8794);
  font-size: 0;
}

.injury-flag[data-injury="Q"] { --injury: #f2c94c; }
.injury-flag[data-injury="D"] { --injury: #ff9f1c; }
.injury-flag[data-injury="O"] { --injury: #e5484d; }
.injury-flag[data-injury="IR"] { --injury: #a8323f; }
.injury-flag[data-injury="SUS"] { --injury: #8e7cc3; }

.mini .injury-flag {
  top: -3px;
  right: -3px;
  width: 8px;
  height: 8px;
  outline-width: 1.5px;
}

/* the logo of the player's fantasy team before the jersey (league page) */
.team-badge {
  flex: none;
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.compact .mini .team-badge {
  width: 16px;
  height: 16px;
  margin-right: -2px;
}

/* on a phone a mini tile is half the width: a smaller logo, closer to the
   jersey */
@media (max-width: 600px) {
  .compact .mini .team-badge {
    width: 13px;
    height: 13px;
    margin-right: -3px;
  }

  .compact .lineup-player.mini.has-badge {
    gap: 4px;
    padding-left: 2px;
  }
}
