/* ==========================================================================
   COMBINE-FC — pitch-challenges.css
   DAILY CHALLENGE / WEEKLY CHALLENGE widget on the squad screen
   (js/pitch-challenges.js). Sibling of css/pitch-challenge-play.css, which
   styles the screen this widget launches.

   Structural pattern ported from combine/css/combine-challenges.css — a crew
   row above two constraint cards, each with a left status edge, a locked-in
   score and a five-row board — in FC's own token language. None of COMBINE's
   hex values or accent tokens appear here: the live/active colour in this game
   is matchball green (--c-lime), and the completed state uses --c-ok, which is
   deliberately a cooler green so "done" does not read as "branded".
   ========================================================================== */

#squad-challenges:empty {
  display: none;
}
#squad-challenges {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin: var(--s-5) 0;
}

.fc-challenges__head {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}
.fc-challenges__title {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-text);
}
.fc-challenges__sub {
  font-size: var(--fs-small);
  line-height: 1.6;
  color: var(--c-text-3);
  max-width: 70ch;
}

/* ------ manager name + crew code ------
   One row above both cards, since one identity and one crew serve the daily
   and the weekly board alike. */
.fc-challenges__crew {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--s-2) var(--s-3);
  padding: var(--s-3) var(--s-4);
  border: var(--bw) solid var(--c-line);
  border-radius: var(--r-md);
  background: var(--c-panel);
}
.fc-challenges__field {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}
.fc-challenges__field-label {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.12em;
  color: var(--c-text-3);
}
.fc-challenges__input {
  min-width: 0;
  width: 12ch;
  padding: 6px 8px;
  border: var(--bw) solid var(--c-line-strong);
  border-radius: var(--r-sm);
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}
.fc-challenges__input:focus-visible {
  outline: 2px solid var(--c-lime);
  outline-offset: 1px;
}
/* A crew code is read aloud and typed off a screenshot, so it is always shown
   in the uppercase it is stored in. */
.fc-challenges__input--code {
  width: 9ch;
  text-transform: uppercase;
}
.fc-challenges__crew-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}
.fc-challenges__crew-hint {
  flex: 1 1 18rem;
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--c-text-3);
}

/* ------ the two cards ------ */
.fc-challenges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
}
@media (max-width: 720px) {
  .fc-challenges {
    grid-template-columns: 1fr;
  }
}

.fc-challenge {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  border: var(--bw) solid var(--c-line);
  border-left: 3px solid var(--c-line-strong);
  border-radius: var(--r-md);
  background: var(--c-panel);
}
.fc-challenge--done {
  border-left-color: var(--c-ok);
}
/* An unplayed period — the whole point of the card is the PLAY button. */
.fc-challenge--open {
  border-left-color: var(--c-lime);
}

.fc-challenge__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-2);
}
.fc-challenge__label {
  font-family: var(--font-display);
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  color: var(--c-chalk);
}
.fc-challenge__status {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  color: var(--c-text-3);
}
.fc-challenge--done .fc-challenge__status {
  color: var(--c-ok);
}
.fc-challenge--open .fc-challenge__status {
  color: var(--c-lime);
}

.fc-challenge__text {
  font-size: var(--fs-small);
  line-height: 1.55;
  color: var(--c-text-2);
}

/* Locked-in gauntlet score for a completed period. */
.fc-challenge__score {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.fc-challenge__score-num {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  line-height: 1;
  color: var(--c-lime);
}
.fc-challenge__score-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.1em;
  color: var(--c-text-3);
}

.fc-challenge__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  min-height: 1.75rem;
}
.fc-challenge__streak {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  color: var(--c-flood-bright);
}

/* ------ leaderboard ------ */
.fc-challenge__board {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
  padding-top: var(--s-2);
  border-top: var(--bw) solid var(--c-line);
}
.fc-challenge__board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  color: var(--c-text-3);
}

/* GLOBAL / CREW switch, only rendered once a crew code is set. */
.fc-challenge__board-tabs {
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
}
.fc-challenge__board-tab {
  padding: 2px 6px;
  border: var(--bw) solid var(--c-line);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--c-text-3);
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  letter-spacing: 0.1em;
  cursor: pointer;
}
.fc-challenge__board-tab.is-active {
  border-color: var(--c-lime);
  color: var(--c-lime);
}

/* Squad mode: everyone on this board named an XI out of their own saved
   players, so it is a list of scores rather than a like-for-like race. Said
   once, quietly, under the board head. */
.fc-challenge__board-note {
  font-size: 0.6875rem;
  line-height: 1.5;
  color: var(--c-text-3);
}

.fc-challenge__board-empty {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  color: var(--c-text-3);
}
.fc-challenge__board-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.fc-challenge__board-row {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr) auto;
  gap: var(--s-2);
  padding: 2px 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--c-text-2);
}
.fc-challenge__board-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fc-challenge__board-rank {
  color: var(--c-text-3);
}
.fc-challenge__board-row.is-you {
  color: var(--c-lime);
  font-weight: 600;
}
.fc-challenge__board-row.is-you .fc-challenge__board-rank {
  color: var(--c-lime);
}
