@import url("/assets/fonts/barlow-800.css");

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 14px 15px 17px;
  border-color: rgba(92, 104, 255, 0.36);
  background:
    linear-gradient(180deg, rgba(3, 14, 38, 0.24), rgba(26, 5, 42, 0.64)),
    url("/assets/brand/gameweek-explained/header/gameweek-explained-tactical-background.svg") center 50% / cover no-repeat;
  box-shadow:
    inset 0 1px 0 rgba(146, 158, 255, 0.15),
    inset 0 -1px 0 rgba(10, 3, 27, 0.62),
    0 18px 55px rgba(4, 8, 24, 0.3);
}

.hero::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 66%, rgba(79, 69, 206, 0.15), transparent 42%),
    linear-gradient(90deg, rgba(2, 9, 27, 0.42), transparent 30%, transparent 70%, rgba(31, 4, 42, 0.46));
  content: "";
  pointer-events: none;
}

.hero::after {
  position: absolute;
  top: 0;
  right: 12%;
  left: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(100, 119, 255, 0.64), transparent);
  content: "";
  pointer-events: none;
}

.hero-row,
.hero-stage {
  position: relative;
  z-index: 1;
}

.hero-row {
  align-items: center;
}

.brand-lockup {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.brand-lockup__portrait {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border: 2px solid rgba(40, 127, 255, 0.58);
  border-radius: 50%;
  object-fit: cover;
  box-shadow:
    0 0 0 3px rgba(2, 18, 44, 0.76),
    0 8px 20px rgba(0, 0, 0, 0.28);
}

.brand-lockup__copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.hero .kicker {
  display: block;
  overflow: hidden;
  width: auto;
  max-width: 100%;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: #f7fbff;
  background: transparent;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  line-height: 1.1;
  text-overflow: ellipsis;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.48);
  white-space: nowrap;
}

.brand-lockup__descriptor {
  overflow: hidden;
  max-width: min(46vw, 440px);
  color: rgba(205, 226, 255, 0.66);
  font-size: 0.62rem;
  font-weight: 720;
  letter-spacing: 0.055em;
  line-height: 1.15;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.season-marker {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 5px;
  min-height: 28px;
  border: 0;
  padding: 4px 1px 4px 6px;
  color: rgba(226, 240, 255, 0.82);
  background: transparent;
  font-size: 0.66rem;
  font-weight: 860;
  letter-spacing: 0.09em;
  line-height: 1;
  cursor: pointer;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.44);
}

.season-marker:hover,
.season-marker[aria-expanded="true"] {
  color: #ffffff;
}

.season-marker[aria-expanded="true"] .season-marker__icon {
  color: var(--gwe-cyan);
}

.season-marker__icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  color: rgba(72, 158, 255, 0.86);
}

.hero-stage {
  display: grid;
  justify-items: center;
  margin-top: 8px;
  padding-bottom: 1px;
}

.hero-title {
  margin: 0;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.44);
}

.hero-title__primary {
  font-family: "Barlow Semi Condensed", "Arial Narrow", "GWE Archivo", "GWE Inter", sans-serif;
  font-size: clamp(2.65rem, 8.6vw, 5.3rem);
  font-weight: 800;
  letter-spacing: -0.018em;
  line-height: 0.9;
}

.hero-title__secondary {
  margin-top: clamp(7px, 1.6vw, 11px);
  color: rgba(227, 240, 255, 0.9);
  font-size: clamp(1.28rem, 4.5vw, 2.55rem);
  font-weight: 760;
  letter-spacing: 0.01em;
  line-height: 1;
}

.shell {
  padding-top: 14px;
}

.gameweek-context {
  display: flex;
  justify-content: center;
  min-height: 1rem;
  margin-top: 9px;
}

.gameweek-context__deadline {
  color: rgba(248, 255, 249, 0.62);
  font-size: 0.64rem;
  font-weight: 820;
  letter-spacing: 0.055em;
  line-height: 1.25;
  text-align: center;
  text-transform: uppercase;
}

/* Equalise the whitespace above and below the Starting XI header at 8px.
   The lower gap is split between header margin and list padding. */
.score-roster {
  margin-top: 8px;
}

[data-endpoint-roster-header] {
  margin: 8px 0 4px;
}

[data-endpoint-starting-xi] .squad-context__list {
  padding-top: 4px;
}

/* Starting-XI header: keep the formation on the same centred row as the title.
   TOTAL / PTS remains a two-line label whose block is centred against this row. */
[data-endpoint-roster-header] > div:first-child {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

[data-endpoint-roster-header] .roster-head__title {
  order: 1;
}

[data-endpoint-roster-header] .roster-head__eyebrow {
  order: 2;
  flex: 0 0 auto;
  margin: 0;
  font-size: 0.82rem;
  line-height: 1;
  transform: translateY(1px);
}

/* Pending score dashes need optical, not merely flex-box, centring. The circles
   remain fixed; only the visible em dash is raised slightly within each token. */
.total-score__token[data-pending="true"],
.squad-context__md1-points[data-pending="true"] {
  color: transparent;
  font-size: 0;
}

.total-score__token[data-pending="true"]::before,
.squad-context__md1-points[data-pending="true"]::before {
  color: rgba(248, 255, 249, 0.72);
  content: "—";
  font-size: 1.15rem;
  line-height: 1;
  transform: translateY(-1px);
}

.total-score__token[data-pending="true"]::before {
  font-size: 1.08rem;
}

/* Reuse the accepted Chapter 1 self-contained substitute-badge contract:
   constrained marks carry their own club code; authentic badges keep the external code. */
html[data-identity-state="constrained"] .squad-context__team {
  justify-content: flex-end;
}

html[data-identity-state="constrained"] .club-identity-pill {
  min-width: 36px;
  max-width: 36px;
  border: 0;
  padding: 0;
  column-gap: 0;
  background: transparent;
}

html[data-identity-state="constrained"] .club-badge-slot,
html[data-identity-state="constrained"] .public-team-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
}

html[data-identity-state="constrained"] .club-code {
  display: none;
}

html[data-identity-state="constrained"] .public-team-mark__code-plate {
  min-width: 28px;
  min-height: 18px;
  padding: 2px 4px;
}

html[data-identity-state="constrained"] .public-team-mark__text {
  display: block;
  font-size: 8px;
  font-weight: 1000;
  line-height: 1;
}

/* Weekly ScoreRoster refinement: enlarge every constrained mark's internal
   three-letter code without changing authentic badge-and-code presentation. */
html[data-identity-state="constrained"] [data-endpoint-score-roster] .public-team-mark__text {
  max-width: 26px;
  font-size: 10px;
  letter-spacing: -0.02em;
}

body.capture-mode .hero {
  padding: 11px 12px 13px;
}

body.capture-mode .brand-lockup__portrait {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
}

body.capture-mode .brand-lockup__descriptor {
  display: none;
}

body.capture-mode .hero-stage {
  margin-top: 5px;
}

body.capture-mode .hero-title__primary {
  font-size: clamp(2.35rem, 10vw, 3.75rem);
}

body.capture-mode .hero-title__secondary {
  font-size: clamp(1.2rem, 5.5vw, 1.85rem);
}

@media (max-width: 760px) {
  .hero {
    padding: 12px 12px 15px;
  }

  .brand-lockup {
    gap: 8px;
  }

  .brand-lockup__portrait {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .brand-lockup__descriptor {
    max-width: 48vw;
    font-size: 0.56rem;
  }

  .hero .kicker {
    font-size: 0.67rem;
    letter-spacing: 0.15em;
  }

  .hero-stage {
    margin-top: 7px;
  }

  .hero-title__primary {
    font-size: clamp(2.3rem, 12vw, 3.7rem);
  }

  .hero-title__secondary {
    font-size: clamp(1.2rem, 6.4vw, 1.9rem);
  }
}

@media (max-width: 560px) {
  body:not(.capture-mode) .page {
    padding-top: clamp(16px, 4.6vw, 20px);
  }
}

@media (max-width: 430px) {
  .hero-row {
    align-items: center;
    gap: 7px;
  }

  .brand-lockup {
    gap: 7px;
  }

  .brand-lockup__portrait {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    border-width: 1px;
    box-shadow:
      0 0 0 2px rgba(2, 18, 44, 0.76),
      0 6px 16px rgba(0, 0, 0, 0.24);
  }

  .hero .kicker {
    font-size: 0.6rem;
    letter-spacing: 0.115em;
  }

  .brand-lockup__descriptor {
    display: none;
  }

  .season-marker {
    min-height: 44px;
    gap: 5px;
    padding: 5px 0 5px 3px;
    font-size: 0.58rem;
    letter-spacing: 0.075em;
    transform: translateY(4px);
  }

  .season-marker__icon {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    stroke-width: 2.4;
  }

  .hero-stage {
    margin-top: 6px;
  }

  .hero-title__primary {
    font-size: clamp(2.15rem, 12vw, 3rem);
  }

  .hero-title__secondary {
    margin-top: 6px;
    font-size: clamp(1.15rem, 6.4vw, 1.55rem);
  }

  .shell {
    padding-top: 10px;
  }
}
