/* Lineup module — presents both teams' starting five + bench + coach */

#lineup {
  --lineup-card-radius: 1.2vh;
  --lineup-gap: 1.6vh;
  --lineup-home: var(--lineup-home-color, var(--primary-color, #ff355a));
  --lineup-away: var(--lineup-away-color, var(--secondary-color, #ffffff));
}

#lineup main {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  width: 100%;
  padding: 0 2vh 2vh;
}

.lineup-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5vh 2vh;
  gap: 2vh;
}

.lineup-strip .team-block {
  display: flex;
  align-items: center;
  gap: 1.5vh;
  flex: 1;
}

.lineup-strip .team-block.away {
  flex-direction: row-reverse;
  text-align: right;
}

.lineup-strip .team-block img.team-logo {
  width: 10vh;
  height: 10vh;
  object-fit: contain;
}

.lineup-strip .team-block .team-meta h2 {
  margin: 0;
  font-family: var(--font-family, "Oswald"), sans-serif;
  font-size: 3.2vh;
  line-height: 1;
  text-transform: uppercase;
  color: var(--primary-color, #fff);
}

.lineup-strip .team-block .team-meta .team-code {
  font-size: 2vh;
  opacity: 0.65;
  letter-spacing: 0.2em;
}

.lineup-strip .title {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.lineup-strip .title h1 {
  margin: 0;
  font-size: 3.6vh;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary-color, #fff);
}

.lineup-strip .title h3 {
  margin: 0.4vh 0 0;
  font-size: 1.8vh;
  opacity: 0.7;
  font-weight: 400;
}

.lineup-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--lineup-gap);
  flex: 1;
  min-height: 0;
}

.lineup-team {
  display: flex;
  flex-direction: column;
  gap: var(--lineup-gap);
  min-width: 0;
}

.lineup-team.away .lineup-section,
.lineup-team.away .lineup-coach {
  direction: rtl;
}

.lineup-team.away .lineup-section *,
.lineup-team.away .lineup-coach * {
  direction: ltr;
}

.lineup-section {
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--lineup-card-radius);
  padding: 1.4vh 1.6vh;
  display: flex;
  flex-direction: column;
  gap: 0.8vh;
  border-left: 0.6vh solid var(--team-color, var(--primary-color));
}

.lineup-team.away .lineup-section {
  border-left: none;
  border-right: 0.6vh solid var(--team-color, var(--primary-color));
}

.lineup-section h4 {
  margin: 0;
  font-size: 1.8vh;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.7;
  font-family: var(--secondary-font-family, "Titillium Web"), sans-serif;
}

.players-list {
  display: flex;
  flex-direction: column;
  gap: 0.6vh;
}

.player-row {
  display: flex;
  align-items: center;
  gap: 1.2vh;
  padding: 0.8vh 1vh;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0.8vh;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.player-row.reveal {
  opacity: 1;
  transform: translateY(0);
}

.player-row .jersey {
  font-family: var(--font-family, "Oswald"), sans-serif;
  font-size: 3.4vh;
  font-weight: 700;
  line-height: 1;
  width: 5.5vh;
  text-align: center;
  color: var(--team-color, var(--primary-color));
  flex-shrink: 0;
}

.player-row .identity {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.player-row .identity .name {
  font-size: 2.2vh;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-row .identity .meta {
  font-size: 1.5vh;
  opacity: 0.6;
  letter-spacing: 0.1em;
}

.player-row .portrait {
  width: 5vh;
  height: 5vh;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.player-row.starter {
  background: rgba(255, 255, 255, 0.08);
}

.player-row.starter .jersey {
  font-size: 4vh;
}

.lineup-coach {
  background: var(--team-color, var(--primary-color));
  color: #fff;
  border-radius: var(--lineup-card-radius);
  padding: 1.2vh 1.6vh;
  display: flex;
  align-items: center;
  gap: 1.4vh;
}

.lineup-coach .portrait {
  width: 6vh;
  height: 6vh;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.lineup-coach .role {
  font-size: 1.4vh;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.8;
}

.lineup-coach .name {
  font-size: 2.4vh;
  font-weight: 700;
  text-transform: uppercase;
}

.lineup-vs {
  align-self: center;
  font-family: var(--font-family, "Oswald"), sans-serif;
  font-size: 6vh;
  font-weight: 900;
  letter-spacing: 0.08em;
  opacity: 0.35;
}

/* Mobile fallback — stack teams */
@media (max-width: 1080px) {
  .lineup-grid {
    grid-template-columns: 1fr;
  }
  .lineup-vs {
    font-size: 4vh;
  }
  .lineup-team.away .lineup-section {
    direction: ltr;
    border-right: none;
    border-left: 0.6vh solid var(--team-color, var(--primary-color));
  }
  .lineup-strip .team-block.away {
    flex-direction: row;
    text-align: left;
  }
}
