/* ===========================================
   SCHEDULE NAV
   Sitewide schedule ticker pinned to the bottom of the viewport (desktop + mobile).
   Moved out of the AnnouncementBar header module.
   =========================================== */

/* Tokens the ticker references, scoped here so they can't collide with other modules' :root vars. */
.acfc-schedule-nav {
    --black: #1c1c1c;
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --radius-full: 9999px;
    --acfc-hdr-font: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
    --acfc-hdr-wash: rgba(241, 177, 165, 0.10);
    --acfc-hdr-wash-strong: rgba(241, 177, 165, 0.18);
    --acfc-sol-rosa: #f1b1a5;
    --acfc-sol-rosa-dark: #e0a094;
    --acfc-asphalt-sched: #1c1c1c;
    --acfc-armour: #898c8f;
    --acfc-line: rgba(28, 28, 28, 0.08);
    --acfc-white: #ffffff;
}

/* Pinned bar. z-index sits under the header (9998) and the AppBanner (99990). */
.acfc-schedule-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9990;
    display: block;
    width: 100%;
    margin: 0;
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-sizing: border-box;
}
.acfc-schedule-nav .acfc-header-schedule {
    border: 0;
    position: relative;
    z-index: 1;
}

/* Hidden until script.js has passed the page check and rendered the games, so pages
   that drop the bar never flash an empty white strip. */
.acfc-schedule-nav:not([data-acfc-ready]) {
    display: none;
}

/* Keep the end of the page reachable above the bar. Published by script.js; 0 when the bar is absent. */
body {
    padding-bottom: var(--acfc-bottom-nav-h, 0px);
}

/* Hidden under the full-screen mobile menu (header script toggles body.nav-open). */
@media (max-width: 991px) {
    body.nav-open .acfc-schedule-nav {
        display: none;
    }
}

@media (min-width: 992px) {
    .acfc-schedule-nav .acfc-header-schedule__track {
        scroll-padding-left: 16px;
    }
}

  /* Schedule ticker (moved from the AnnouncementBar header module). Tokens are scoped to .acfc-schedule-nav above. */
  .acfc-header-schedule {
    height: 50px;
    max-height: 50px;
    width: 100%;
    border: 1px solid var(--acfc-line);
    /* Faint vertical gradient so the row has some depth instead of reading as a plain white box. */
    background: linear-gradient(180deg, #ffffff 0%, #fcfbfa 100%);
    color: var(--acfc-asphalt-sched);
    display: flex;
    align-items: stretch;
    font-family: var(--acfc-hdr-font);
  }
  .acfc-header-schedule * { box-sizing: border-box; }
  .acfc-header-schedule__track {
    flex: 1;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: auto;
    scrollbar-width: none;
    /* Proximity snapping tidies up drag releases without fighting the arrow buttons'
       scrollTo({ behavior: 'smooth' }). */
    scroll-snap-type: x proximity;
  }
  .acfc-header-schedule__track::-webkit-scrollbar { display: none; }
  /*
   * Late-season rows often don't fill the track. Equal flex spacers center the
   * remaining games on desktop, then collapse to 0 when the row overflows so the
   * first game stays reachable by scroll (plain justify-content:center would clip it).
   */
  @media (min-width: 992px) {
    .acfc-header-schedule__track::before,
    .acfc-header-schedule__track::after {
      content: "";
      flex: 1 0 0;
      min-width: 0;
      pointer-events: none;
    }
    .acfc-header-schedule__game:first-child {
      border-left: 1px solid var(--acfc-line);
    }
  }
  @media (hover: hover) and (pointer: fine) {
    .acfc-header-schedule__track {
      cursor: grab;
      -webkit-user-select: none;
      user-select: none;
    }
    .acfc-header-schedule__track:active { cursor: grabbing; }
  }
  .acfc-header-schedule__game {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    text-decoration: none;
    color: inherit;
    border-right: 1px solid var(--acfc-line);
    scroll-snap-align: start;
    position: relative;
    transition: background-color 0.2s var(--ease-out);
  }

  /* Rosa top accent + wash — desktop hover only; suppressed on touch/mobile to avoid sticky states. */
  .acfc-header-schedule__game::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: var(--acfc-sol-rosa);
    transform: scaleX(0);
    transition: transform 0.25s var(--ease-out);
    pointer-events: none;
  }

  @media (hover: hover) {
    .acfc-header-schedule__game:not(.acfc-header-schedule__game--coming-soon):hover {
      background-color: var(--acfc-hdr-wash);
    }

    .acfc-header-schedule__game:not(.acfc-header-schedule__game--coming-soon):hover::before {
      transform: scaleX(1);
    }
  }

  .acfc-header-schedule__game:focus-visible::before {
    transform: scaleX(1);
  }

  .acfc-header-schedule__game:focus-visible {
    outline: 2px solid var(--acfc-sol-rosa);
    outline-offset: -2px;
  }
  .acfc-header-schedule__logo {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
    -webkit-user-drag: none;
  }
  .acfc-header-schedule__copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    flex: 0 1 auto;
    max-width: min(200px, 52vw);
  }
  .acfc-header-schedule__line1 {
    font-size: 12px;
    line-height: 1.1;
    font-weight: 600;
    color: var(--acfc-asphalt-sched);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .acfc-header-schedule__line2 {
    font-size: 11px;
    line-height: 1.1;
    font-weight: 600;
    color: var(--acfc-armour);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* Next Home Match and Final Home Match. On desktop with three games left, both treatments sit on the chronological games. */
  .acfc-header-schedule__game--next-home,
  .acfc-header-schedule__game--final-home {
    background: linear-gradient(180deg, rgba(241, 177, 165, 0.34) 0%, rgba(241, 177, 165, 0.14) 100%);
  }
  .acfc-header-schedule__game--next-home .acfc-header-schedule__copy,
  .acfc-header-schedule__game--final-home .acfc-header-schedule__copy {
    max-width: min(280px, 72vw);
  }
  .acfc-header-schedule__game--next-home .acfc-header-schedule__line1,
  .acfc-header-schedule__game--final-home .acfc-header-schedule__line1 {
    display: inline-flex;
    align-items: center;
    color: var(--acfc-asphalt-sched);
  }
  .acfc-header-schedule__game--next-home .acfc-header-schedule__line2,
  .acfc-header-schedule__game--final-home .acfc-header-schedule__line2 {
    color: rgba(28, 28, 28, 0.82);
  }
  .acfc-header-schedule__next-home-label,
  .acfc-header-schedule__final-home-label {
    font-weight: 700;
    letter-spacing: 0.03em;
  }
  .acfc-header-schedule__game--playoffs .acfc-header-schedule__copy {
    max-width: min(240px, 60vw);
  }
  .acfc-header-schedule__playoffs-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
    letter-spacing: 0.01em;
  }
  .acfc-header-schedule__nwsl-logo {
    display: block;
    width: auto;
    height: 18px;
    flex-shrink: 0;
  }
  .acfc-header-schedule__line2-time {
    font-weight: 600;
  }
  /* Kickoff countdown (DD:HH:MM:SS) on the next match's cell. */
  .acfc-header-schedule__countdown {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
  }
  .acfc-header-schedule__cd-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 24px;
    padding: 0 3px;
    border: 1px solid var(--acfc-line);
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    line-height: 1;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--acfc-asphalt-sched);
  }
  .acfc-header-schedule__cd-sep {
    font-size: 12px;
    line-height: 1;
    font-weight: 800;
    color: var(--acfc-asphalt-sched);
  }
  .acfc-header-schedule__game--past:not(a) {
    cursor: default;
  }
  .acfc-header-schedule__line2--score {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    overflow: visible;
    color: var(--acfc-asphalt-sched);
    font-weight: 700;
  }
  .acfc-header-schedule__result {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    min-width: 15px;
    min-height: 15px;
    padding: 0;
    border-radius: 50%;
    background: #e4dfd8;
    color: var(--acfc-asphalt-sched);
    font-size: 8px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
  }
  .acfc-header-schedule__result-glyph {
    display: block;
    line-height: 1;
    /* Trim the em box to the capital's height so W/L/D center optically in the circle. */
    text-box: trim-both cap alphabetic;
  }
  /* Firefox lacks text-box: nudge down to offset the unused descender space. */
  @supports not (text-box: trim-both cap alphabetic) {
    .acfc-header-schedule__result-glyph {
      transform: translateY(0.5px);
    }
  }
  .acfc-header-schedule__result--W {
    background: var(--acfc-sol-rosa);
  }
  .acfc-header-schedule__result--L {
    background: var(--acfc-asphalt-sched);
    color: #fff;
  }
  .acfc-header-schedule__ticket.acfc-header-schedule__ticket--recap {
    background: #fff;
    color: #000;
    border: 1px solid #000;
    box-shadow: none;
  }
  .acfc-header-schedule__ticket.acfc-header-schedule__ticket--recap:hover {
    background: #fff;
    color: #000;
    border-color: #000;
    box-shadow: none;
  }
  .acfc-header-schedule__ticket {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    border-radius: var(--radius-full);
    border: 0;
    padding: 0 12px;
    text-decoration: none;
    font-size: 12px;
    /* An explicit line-height prevents the browser's default "normal" (~1.2) from adding
       unexpected space above and below text at small sizes, which shifted the label off-centre
       inside the pill on mobile even though align-items: center was set. */
    line-height: normal;
    letter-spacing: .04em;
    text-transform: capitalize;
    font-weight: 700;
    color: var(--acfc-asphalt-sched);
    background: var(--acfc-sol-rosa);
    box-shadow: 0 1px 6px rgba(241, 177, 165, 0.5);
    flex-shrink: 0;
    margin: 0 5px;
    transition: background-color 0.2s var(--ease-out), transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
  }
  .acfc-header-schedule__ticket:hover {
    background: var(--acfc-sol-rosa-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(241, 177, 165, 0.65);
  }
  .acfc-header-schedule__game--coming-soon { cursor: default; }
  .acfc-header-schedule__ticket--coming-soon { opacity: 0.75; cursor: default; box-shadow: none; }
  .acfc-header-schedule__ticket--coming-soon:hover {
    background: var(--acfc-sol-rosa);
    transform: none;
    box-shadow: none;
  }
  .acfc-header-schedule__game--live .acfc-header-schedule__copy {
    overflow: visible;
  }
  .acfc-header-schedule__line2--live {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    min-width: 0;
    line-height: 1;
    overflow: visible;
    padding-left: 2px;
    color: var(--acfc-sol-rosa-dark);
    letter-spacing: 0.06em;
  }
  .acfc-header-schedule__line2--live::before {
    content: "";
    display: block;
    flex: none;
    width: 6px;
    height: 6px;
    min-width: 6px;
    max-width: 6px;
    min-height: 6px;
    max-height: 6px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #e10600;
    animation: acfc-header-schedule-live-dot 1.15s ease-in-out infinite;
  }
  @keyframes acfc-header-schedule-live-dot {
    0%,
    100% {
      opacity: 1;
    }
    50% {
      opacity: 0.35;
    }
  }
  .acfc-header-schedule__live-label {
    display: block;
    letter-spacing: .02rem;
    line-height: 1;
    padding-block: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .acfc-header-schedule__ticket--watch {
    text-transform: none;
  }
  .acfc-header-schedule__ticket-icon { display: none; width: 14px; height: 14px; }
  .acfc-header-schedule__ticket-icon path,
  .acfc-header-schedule__arrow svg path,
  .acfc-header-schedule__schedule-link svg path,
  .acfc-header-schedule__schedule-link svg rect {
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
  }
  .acfc-header-schedule__arrow,
  .acfc-header-schedule__schedule-link {
    width: 52px;
    min-width: 52px;
    border: 0;
    border-left: 1px solid var(--acfc-line);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--acfc-asphalt-sched);
    background: var(--acfc-white);
    transition: background-color 0.2s var(--ease-out), color 0.2s var(--ease-out);
  }
  /*
   * Hover-capable pointers only. A tap leaves :hover latched on these buttons until the next tap
   * elsewhere, so on touch the rosa wash read as a stuck "selected" state on whichever arrow was
   * last used. The track's drag-scroll affordance is gated the same way further up.
   */
  @media (hover: hover) {
    .acfc-header-schedule__arrow:not([disabled]):hover,
    .acfc-header-schedule__schedule-link:hover {
      background-color: var(--acfc-hdr-wash-strong);
    }
  }
  .acfc-header-schedule__arrow:focus-visible,
  .acfc-header-schedule__schedule-link:focus-visible {
    outline: 2px solid var(--acfc-sol-rosa);
    outline-offset: -2px;
  }
  .acfc-header-schedule__arrow { cursor: pointer; }
  .acfc-header-schedule__arrow[disabled] { cursor: default; opacity: 0.35; }
  .acfc-header-schedule__arrow svg,
  .acfc-header-schedule__schedule-link svg { width: 18px; height: 18px; }
  .acfc-header-schedule__empty {
    display: inline-flex;
    align-items: center;
    height: 100%;
    font-size: 12px;
    font-weight: 700;
    padding: 0 14px;
    color: var(--acfc-armour);
    white-space: nowrap;
  }
  @media (max-width: 768px) {
    .acfc-header-schedule { height: 44px; max-height: 44px; }
    .acfc-header-schedule__game { padding: 4px 6px; gap: 6px; }
    .acfc-header-schedule__copy { max-width: min(180px, 58vw); gap: 2px !important; }
    .acfc-header-schedule__logo { width: 20px; height: 20px; }
    .acfc-header-schedule__line1 { font-size: 11px; }
    .acfc-header-schedule__line2 { font-size: 10px; }
    .acfc-header-schedule__countdown { gap: 1px; }
    .acfc-header-schedule__cd-box {
      min-width: 18px;
      height: 20px;
      padding: 0 1px;
      border-radius: 4px;
      font-size: 10px;
    }
    .acfc-header-schedule__cd-sep { font-size: 9px; }
    .acfc-header-schedule__line2--live {
      line-height: 1;
    }
    .acfc-header-schedule__line2--live::before {
      width: 5px;
      height: 5px;
      min-width: 5px;
      max-width: 5px;
      min-height: 5px;
      max-height: 5px;
    }
    .acfc-header-schedule__ticket {
      width: 24px;
      min-height: 24px;
      padding: 0;
      border-radius: 6px;
      font-size: 0;
      color: var(--black);
    }
    .acfc-header-schedule__ticket-text { display: none; }
    .acfc-header-schedule__ticket-icon {
      display: block;
      width: 14px;
      height: 14px;
      color: var(--black);
    }
    .acfc-header-schedule__ticket--coming-soon {
      width: auto;
      min-width: 24px;
      max-width: 72px;
      padding: 0 4px;
      font-size: 6px;
      line-height: 1.1;
      letter-spacing: 0.02em;
    }
    .acfc-header-schedule__ticket--coming-soon .acfc-header-schedule__ticket-text {
      display: block;
      white-space: normal;
      text-align: center;
      font-size: 9px;
      padding: 0px 2px;
    }
    .acfc-header-schedule__ticket--watch {
      width: auto;
      min-width: 24px;
      max-width: 56px;
      padding: 0 6px;
      font-size: 9px;
      line-height: 1.1;
      letter-spacing: 0.02em;
      text-transform: none;
    }
    .acfc-header-schedule__ticket--watch .acfc-header-schedule__ticket-text {
      display: block;
      white-space: nowrap;
      font-size: 9px;
    }
    .acfc-header-schedule__ticket--watch .acfc-header-schedule__ticket-icon--watch {
      display: none;
    }
    .acfc-header-schedule__ticket--recap {
      width: auto;
      min-width: 24px;
      max-width: 56px;
      padding: 0 6px;
      font-size: 9px;
      line-height: 1.1;
      letter-spacing: 0.02em;
      text-transform: none;
      background: #fff;
      color: #000;
      border: 1px solid #000;
      box-shadow: none;
    }
    .acfc-header-schedule__ticket--recap .acfc-header-schedule__ticket-text {
      display: block;
      white-space: nowrap;
      font-size: 9px;
      color: #000;
    }
    .acfc-header-schedule__arrow,
    .acfc-header-schedule__schedule-link { width: 42px; min-width: 42px; }

    /* Mobile opens left-aligned on the first upcoming match with every cell at content width,
       so the next cells peek in from the right and signal the row swipes. Past recaps are a
       swipe left. Arrows are hidden since the row swipes. */
    .acfc-header-schedule__arrow { display: none; }
    .acfc-header-schedule__track { scroll-snap-type: x mandatory; }
    .acfc-header-schedule__game--final-home .acfc-header-schedule__copy,
    .acfc-header-schedule__game--playoffs .acfc-header-schedule__copy {
      max-width: none;
    }
    .acfc-header-schedule__game--final-home,
    .acfc-header-schedule__game--playoffs { gap: 5px; }
    .acfc-header-schedule__game--final-home .acfc-header-schedule__ticket,
    .acfc-header-schedule__game--playoffs .acfc-header-schedule__ticket { margin: 0 2px; }
    .acfc-header-schedule__game--playoffs .acfc-header-schedule__line1 {
      white-space: normal;
      line-height: 1.15;
    }
    .acfc-header-schedule__ticket--playoffs {
      width: auto;
      padding: 0 8px;
      font-size: 9px;
      line-height: 1.1;
      letter-spacing: 0.02em;
    }
    .acfc-header-schedule__ticket--playoffs .acfc-header-schedule__ticket-text {
      display: block;
      white-space: nowrap;
      font-size: 9px;
    }
  }

/* ——— Playoff quarterfinal cell (Watch Party + Tickets) ——— */
.acfc-header-schedule__game--qf .acfc-header-schedule__copy {
  max-width: min(200px, 46vw);
}
.acfc-header-schedule__game--qf .acfc-header-schedule__ticket + .acfc-header-schedule__ticket {
  margin-left: 0;
}
.acfc-header-schedule__ticket.acfc-header-schedule__ticket--outline,
.acfc-header-schedule__ticket.acfc-header-schedule__ticket--outline:hover {
  background: #fff;
  color: #000;
  border: 1px solid #000;
  box-shadow: none;
}
@media (max-width: 768px) {
  .acfc-header-schedule__game--qf {
    gap: 5px;
  }
  .acfc-header-schedule__game--qf .acfc-header-schedule__copy {
    max-width: none;
  }
  .acfc-header-schedule__game--qf .acfc-header-schedule__ticket {
    margin: 0 2px;
  }
  .acfc-header-schedule__ticket--outline .acfc-header-schedule__ticket-text {
    color: #000;
  }
}

/* Reduced motion: no smooth/snap scrolling and no decorative movement in the ticker. */
@media (prefers-reduced-motion: reduce) {
    .acfc-header-schedule__track {
        scroll-behavior: auto;
        scroll-snap-type: none;
    }
    .acfc-schedule-nav *,
    .acfc-schedule-nav *::before,
    .acfc-schedule-nav *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
    .acfc-header-schedule__ticket:hover {
        transform: none;
    }
}
