/* Public lineup provenance and availability states.  The snapshot surface
   deliberately reuses match-frozen pitch data, while its amber treatment
   keeps it visually distinct from a live team plan. */

/* The directory has two public surfaces only: lineup and roster.  Keeping the
   tracks here (the last directory stylesheet) prevents older three-panel rules
   from leaving a blank tactical column at any desktop width. */
@media (min-width: 961px) {
  .teams-directory-page .team-selector-panels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr);
  }

  .teams-directory-page .directory-lineup-card {
    grid-column: 1;
    grid-row: 1;
  }

  .teams-directory-page .directory-roster-card {
    grid-column: 2;
    grid-row: 1;
    min-height: 0;
  }
}

@media (min-width: 761px) and (max-width: 960px) {
  .teams-directory-page .team-selector-panels {
    grid-template-columns: minmax(0, 1fr);
  }

  .teams-directory-page .directory-lineup-card,
  .teams-directory-page .directory-roster-card {
    grid-column: 1;
    grid-row: auto;
    contain: none;
  }

  .teams-directory-page .directory-roster-card {
    height: 560px;
  }
}

.teams-directory-page .directory-manage-team-action {
  gap: 9px;
  border-color: rgba(205, 255, 116, .86);
  background: linear-gradient(135deg, #c6ff61, #a8e942);
  box-shadow: 0 9px 25px rgba(157, 225, 50, .2);
  color: #07130b;
}

.teams-directory-page .directory-manage-team-action > span {
  font-size: 18px;
  line-height: 1;
  transition: transform .16s ease;
}

.teams-directory-page .directory-manage-team-action:hover > span,
.teams-directory-page .directory-manage-team-action:focus-visible > span {
  transform: translateX(3px);
}

/* Effective visibility and editability are two compact facts beside the
   lineup title.  They replace the former full-width explanatory banner. */
.teams-directory-page .directory-lineup-header,
.team-page .legacy-lineup-header {
  align-items: center;
}

.teams-directory-page .lineup-header-meta,
.team-page .legacy-lineup-header-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  min-width: 0;
  gap: 7px;
}

.teams-directory-page .lineup-formation-badge {
  color: var(--lime);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.team-page .legacy-lineup-header-meta > b {
  color: var(--lime);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.teams-directory-page .lineup-compact-statuses,
.team-page .lineup-compact-statuses {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.teams-directory-page .lineup-state-tag,
.team-page .lineup-state-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 27px;
  padding: 3px 9px;
  border: 1px solid rgba(153, 184, 201, .38);
  border-radius: 999px;
  background: rgba(29, 66, 87, .36);
  color: #d5e7ef;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  white-space: nowrap;
}

.teams-directory-page .lineup-state-tag.is-public,
.team-page .lineup-state-tag.is-public {
  border-color: rgba(92, 218, 147, .48);
  background: rgba(44, 159, 96, .12);
  color: #aaf0c5;
}

.teams-directory-page .lineup-state-tag.is-hidden,
.team-page .lineup-state-tag.is-hidden {
  border-color: rgba(138, 174, 194, .42);
  background: rgba(54, 91, 111, .18);
  color: #bfd2dc;
}

.teams-directory-page .lineup-state-tag.is-locked,
.team-page .lineup-state-tag.is-locked {
  border-color: rgba(255, 130, 102, .52);
  background: rgba(255, 104, 75, .11);
  color: #ffc0b1;
}

.teams-directory-page .lineup-state-tag.is-editable,
.team-page .lineup-state-tag.is-editable {
  border-color: rgba(183, 243, 74, .42);
  background: rgba(127, 185, 42, .1);
  color: #d7f8a0;
}

.teams-directory-page .lineup-preview-exit,
.team-page .lineup-preview-exit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 29px;
  padding: 2px 9px;
  border: 1px solid rgba(112, 191, 255, .38);
  border-radius: 4px;
  color: #cfeaff;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
  white-space: nowrap;
}

.teams-directory-page .lineup-preview-exit:hover,
.teams-directory-page .lineup-preview-exit:focus-visible,
.team-page .lineup-preview-exit:hover,
.team-page .lineup-preview-exit:focus-visible {
  border-color: var(--lime);
  color: #efffcf;
  outline: 2px solid transparent;
}

/* Public bench uses the same seven-slot reading order as the team workbench,
   without exposing assigned roles, focus, set pieces, or tactical settings. */
.teams-directory-page .public-lineup-bench,
.team-page .public-lineup-bench {
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(142, 181, 200, .2);
  background: linear-gradient(180deg, rgba(7, 25, 37, .94), rgba(4, 16, 25, .98));
}

.teams-directory-page .public-lineup-bench > header,
.team-page .public-lineup-bench > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.teams-directory-page .public-lineup-bench > header > div,
.team-page .public-lineup-bench > header > div {
  display: flex;
  align-items: baseline;
  min-width: 0;
  gap: 8px;
}

.teams-directory-page .public-lineup-bench > header span,
.team-page .public-lineup-bench > header span {
  color: var(--lime);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .14em;
}

.teams-directory-page .public-lineup-bench > header strong,
.team-page .public-lineup-bench > header strong {
  overflow: hidden;
  color: #edf6f2;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teams-directory-page .public-lineup-bench > header b,
.team-page .public-lineup-bench > header b {
  flex: 0 0 auto;
  color: #a9c0cb;
  font-size: 12px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.teams-directory-page .team-bench-row,
.team-page .team-bench-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.teams-directory-page .team-bench-row .bench-card,
.team-page .team-bench-row .bench-card {
  display: grid;
  justify-items: center;
  align-content: start;
  box-sizing: border-box;
  min-width: 0;
  min-height: 82px;
  padding: 7px 4px 6px;
  overflow: hidden;
  border: 1px solid rgba(151, 184, 200, .2);
  border-radius: 7px;
  background: rgba(2, 12, 18, .58);
}

.teams-directory-page .team-bench-row .bench-card.filled,
.team-page .team-bench-row .bench-card.filled {
  border-color: rgba(104, 185, 255, .34);
  background: linear-gradient(180deg, rgba(62, 135, 194, .12), rgba(2, 12, 18, .7));
}

.teams-directory-page .team-bench-row .bench-card.empty,
.team-page .team-bench-row .bench-card.empty {
  border-style: dashed;
  color: #839aa5;
}

.teams-directory-page .bench-card-avatar,
.team-page .bench-card-avatar {
  position: relative;
  display: grid;
  width: clamp(34px, 4.2cqi, 44px);
  height: clamp(34px, 4.2cqi, 44px);
  place-items: center;
  overflow: visible;
  border-radius: 50%;
}

.teams-directory-page .bench-card-avatar > img,
.teams-directory-page .bench-card-avatar > .lineup-avatar-silhouette,
.team-page .bench-card-avatar > img,
.team-page .bench-card-avatar > .lineup-avatar-silhouette {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(226, 241, 234, .44);
  border-radius: 50%;
  object-fit: cover;
}

.teams-directory-page .team-bench-row .bench-card > strong,
.teams-directory-page .team-bench-row .bench-card > small,
.team-page .team-bench-row .bench-card > strong,
.team-page .team-bench-row .bench-card > small {
  display: block;
  width: 100%;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teams-directory-page .team-bench-row .bench-card > strong,
.team-page .team-bench-row .bench-card > strong {
  margin-top: 5px;
  color: #edf6f2;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.teams-directory-page .team-bench-row .bench-card > small,
.team-page .team-bench-row .bench-card > small {
  margin-top: 2px;
  color: #94aab5;
  font-size: 9px;
  font-weight: 750;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.teams-directory-page .team-bench-row .bench-card.empty > strong,
.teams-directory-page .team-bench-row .bench-card.empty > small,
.team-page .team-bench-row .bench-card.empty > strong,
.team-page .team-bench-row .bench-card.empty > small {
  color: #8297a2;
}

.teams-directory-page .team-bench-empty {
  display: grid;
  min-height: 74px;
  place-items: center;
  border: 1px dashed rgba(151, 184, 200, .22);
  border-radius: 7px;
  color: #8fa5b0;
  font-size: 13px;
  font-weight: 750;
}

.teams-directory-page .lineup-source-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 14px;
  min-width: 0;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(151, 193, 214, .25);
  background: rgba(46, 118, 161, .09);
}

.teams-directory-page .lineup-source-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 25px;
  padding: 2px 8px;
  border: 1px solid rgba(112, 191, 255, .44);
  border-radius: 999px;
  color: #aadaff;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .07em;
  line-height: 1.15;
  white-space: nowrap;
}

.teams-directory-page .lineup-source-banner > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.teams-directory-page .lineup-source-banner strong {
  color: #edf7f4;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.3;
}

.teams-directory-page .lineup-source-banner small {
  color: #a9bec8;
  font-size: 13px;
  line-height: 1.45;
}

.teams-directory-page .lineup-source-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.teams-directory-page .lineup-source-actions > a,
.teams-directory-page .lineup-source-actions > button {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(242, 185, 75, .38);
  background: rgba(3, 16, 24, .42);
  color: #ffe5ad;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}

.teams-directory-page .lineup-source-actions > button {
  border-color: rgba(255, 130, 102, .4);
  color: #ffc0b1;
}

.teams-directory-page .lineup-source-actions > a:hover,
.teams-directory-page .lineup-source-actions > a:focus-visible,
.teams-directory-page .lineup-source-actions > button:hover,
.teams-directory-page .lineup-source-actions > button:focus-visible {
  border-color: var(--lime);
  color: #efffcf;
  outline: 2px solid transparent;
}

.teams-directory-page .lineup-source-banner.is-snapshot {
  border-bottom-color: rgba(242, 185, 75, .4);
  background:
    linear-gradient(90deg, rgba(242, 185, 75, .12), rgba(53, 119, 160, .08)),
    #071925;
}

.teams-directory-page .lineup-source-banner.is-snapshot .lineup-source-kicker {
  border-color: rgba(242, 185, 75, .5);
  color: #f7d98f;
}

.teams-directory-page .lineup-source-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.teams-directory-page .lineup-source-title-row > em {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 1px 8px;
  border: 1px solid rgba(255, 139, 112, .46);
  border-radius: 999px;
  background: rgba(255, 112, 82, .08);
  color: #ffb09d;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.15;
  white-space: nowrap;
}

.teams-directory-page .historical-lineup-pitch {
  background-color: #173b35;
  filter: saturate(.88);
}

.teams-directory-page .historical-lineup-pitch::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  border: 2px solid rgba(242, 185, 75, .2);
  content: "";
  pointer-events: none;
}

.teams-directory-page .lineup-unavailable-state {
  gap: 8px;
}

.teams-directory-page .lineup-unavailable-state .lineup-hidden-mark {
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  margin-bottom: 5px;
  border: 1px solid rgba(159, 182, 194, .28);
  border-radius: 50%;
  background: rgba(126, 151, 164, .07);
  color: #8298a4;
  font-size: 23px;
  font-weight: 950;
  letter-spacing: .08em;
}

.teams-directory-page .lineup-unavailable-state > strong {
  color: #dde9eb;
  font-size: 21px;
  letter-spacing: 0;
  line-height: 1.35;
}

.teams-directory-page .lineup-unavailable-state > span:not(.lineup-hidden-mark) {
  color: #91a7b2;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
}

@container (max-width: 600px) {
  .teams-directory-page .directory-lineup-header,
  .team-page .legacy-lineup-header {
    align-items: flex-start;
  }

  .teams-directory-page .lineup-header-meta,
  .team-page .legacy-lineup-header-meta {
    max-width: 66%;
    gap: 5px;
  }

  .teams-directory-page .lineup-formation-badge,
  .team-page .legacy-lineup-header-meta > b {
    width: 100%;
    font-size: 13px;
    text-align: right;
  }

  .teams-directory-page .lineup-state-tag,
  .team-page .lineup-state-tag {
    min-height: 24px;
    padding-inline: 7px;
    font-size: 11px;
  }

  .teams-directory-page .lineup-preview-exit,
  .team-page .lineup-preview-exit {
    min-height: 26px;
    font-size: 11px;
  }

  .teams-directory-page .lineup-source-banner {
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
    padding: 11px 13px;
  }

  .teams-directory-page .lineup-source-kicker {
    min-height: 23px;
  }

  .teams-directory-page .lineup-source-actions {
    justify-content: flex-start;
  }

  .teams-directory-page .lineup-source-actions > a,
  .teams-directory-page .lineup-source-actions > button {
    min-height: 40px;
  }
}

@media (max-width: 760px) {
  .teams-directory-page .team-selector-actions .directory-manage-team-action {
    grid-column: 1 / -1;
    min-height: 48px;
    font-size: 15px;
  }

  .teams-directory-page .lineup-source-banner strong {
    font-size: 15px;
  }

  .teams-directory-page .lineup-source-banner small,
  .teams-directory-page .lineup-source-actions > a,
  .teams-directory-page .lineup-source-actions > button,
  .teams-directory-page .lineup-source-title-row > em {
    font-size: 12px;
  }

  .teams-directory-page .public-lineup-bench,
  .team-page .public-lineup-bench {
    margin: 0;
    padding: 10px;
  }

  .teams-directory-page .directory-pitch {
    box-sizing: border-box;
    width: 100%;
    aspect-ratio: auto;
  }

  .teams-directory-page .team-bench-row,
  .team-page .team-bench-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .teams-directory-page .team-bench-row .bench-card,
  .team-page .team-bench-row .bench-card {
    min-height: 80px;
    padding-inline: 3px;
  }

  .teams-directory-page .team-selector-panels {
    grid-template-columns: minmax(0, 1fr);
  }

  .teams-directory-page .lineup-unavailable-state > strong {
    font-size: 19px;
  }

  .teams-directory-page .lineup-unavailable-state > span:not(.lineup-hidden-mark) {
    font-size: 13px;
  }
}

@media (min-width: 2400px) {
  .teams-directory-page .lineup-formation-badge {
    font-size: 19px;
  }

  .teams-directory-page .lineup-state-tag,
  .teams-directory-page .lineup-preview-exit,
  .team-page .lineup-state-tag,
  .team-page .lineup-preview-exit {
    min-height: 32px;
    padding-inline: 11px;
    font-size: 14px;
  }

  .teams-directory-page .public-lineup-bench,
  .team-page .public-lineup-bench {
    padding: 16px 18px 18px;
  }

  .teams-directory-page .team-bench-row,
  .team-page .team-bench-row {
    gap: 10px;
  }

  .teams-directory-page .team-bench-row .bench-card,
  .team-page .team-bench-row .bench-card {
    min-height: 108px;
    padding-top: 10px;
  }

  .teams-directory-page .team-bench-row .bench-card > strong,
  .team-page .team-bench-row .bench-card > strong {
    font-size: 14px;
  }

  .teams-directory-page .team-bench-row .bench-card > small,
  .team-page .team-bench-row .bench-card > small {
    font-size: 12px;
  }

  .teams-directory-page .lineup-source-banner {
    gap: 14px 18px;
    padding: 16px 20px;
  }

  .teams-directory-page .lineup-source-kicker,
  .teams-directory-page .lineup-source-title-row > em {
    font-size: 14px;
  }

  .teams-directory-page .lineup-source-banner strong {
    font-size: 18px;
  }

  .teams-directory-page .lineup-source-banner small,
  .teams-directory-page .lineup-source-actions > a,
  .teams-directory-page .lineup-source-actions > button {
    font-size: 15px;
  }

  .teams-directory-page .lineup-unavailable-state > strong {
    font-size: 25px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .teams-directory-page .directory-manage-team-action > span {
    transition: none;
  }
}
