:root {
  --bg: oklab(28.416999999999998% 0.00408 0.00686);
  --border: rgba(81, 74, 69, 1);
  --accent: oklch(35.656% 0.08399 38.765);
}

@view-transition {
  navigation: auto;
}

aside {
  view-transition-name: siteHeader;
}

aside>a:first-child img {
  view-transition-name: siteLogo;
}

.headerNav {
  view-transition-name: headerNav;
}

#leagueSelect {
  view-transition-name: leagueSelect;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.25s;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

::view-transition-old(siteHeader),
::view-transition-new(siteHeader),
::view-transition-old(siteLogo),
::view-transition-new(siteLogo),
::view-transition-old(headerNav),
::view-transition-new(headerNav),
::view-transition-old(leagueSelect),
::view-transition-new(leagueSelect) {
  animation-duration: 0.3s;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}

.popup {
  position: fixed;
  z-index: 6;
  inset: 0;
  display: grid;
  place-items: center;
  background: #000000a6;
}

#loading {
  z-index: 999;
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-color: #2e2926;
  display: grid;
  place-items: center;
}

#loading img {
  mask-composite: intersect;
  mask-image: linear-gradient(90deg, #000 90%, transparent), linear-gradient(270deg, #000 90%, transparent), linear-gradient(0deg, #000 90%, transparent), linear-gradient(180deg, #000 90%, transparent);
  max-width: 100vw;
}

.hidden {
  display: none !important;
}

html {
  height: 100%;
  background-color: #2e2926;
}

select {
  border: none;
  border-radius: 5px;
  text-align: center;
  font-size: 1.5rem;
  appearance: none;
  color: white;
}

body {
  background-color: transparent;
  font-family: Centra No2 !important;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url('/img/WSL-BG.jpg');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  z-index: -1;
  pointer-events: none;
}

aside h2 {
  font-family: Centra No2 Black;
  font-feature-settings: normal;
  font-size: 3rem;
  font-variation-settings: normal;
  font-weight: 900;
  color: white;
}

aside {
  height: calc(5rem - 11px);
  display: flex;
  gap: 1rem;
  padding: 0.5rem 1rem;
  align-content: center;
  justify-content: space-between;
  background-color: var(--bg);
  text-align: right;
  overflow: hidden;
  flex-shrink: 0;

  position: relative;
  padding-bottom: calc(0.5rem + 4px);

  & a {
    display: flex;
    align-items: flex-start;
  }

  & .headerNav {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    margin-left: auto;
  }

  & .headerNav a {
    align-items: center;
    color: white;
    text-decoration: none;
    padding: 0.45rem 0.85rem;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    border: 1px solid transparent;
  }

  & .headerNav a:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border);
  }

  & .headerNav a.active {
    background: var(--accent);
    border-color: var(--accent);
  }

  & img {
    height: 3rem;
  }

  &::before {
    content: "";
    background-image: linear-gradient(to right in oklab, rgb(239, 83, 39) 0px, rgb(187, 41, 187) 30%);
    position: absolute;
    width: 100%;
    left: 0;
    top: calc(100% + -4px);
    height: 15px;
  }
}

main a {
  position: relative;

  &::after {
    content: "";
    background-image: url("/img/tab.svg");
    width: 1rem;
    height: 1rem;
    position: absolute;
    right: -1.5rem;
    top: 50%;
    translate: 0 -50%;
    background-color: transparent;
    background-size: contain;
  }
}

option,
select {
  text-align: center;
  text-align-last: center;
  font-family: Centra No2 !important;
  appearance: none;
}

@view-transition {
  navigation: auto;
  types: slide, forwards;
}

html:active-view-transition-type(forwards, backwards) {
  :root {
    view-transition-name: none;
  }

  article {
    view-transition-name: content;
  }

  .pagination {
    view-transition-name: pagination;
  }
}

/* Animation styles for forwards type only */
html:active-view-transition-type(forwards) {
  &::view-transition-old(content) {
    animation-name: slide-out-to-left;
  }

  &::view-transition-new(content) {
    animation-name: slide-in-from-right;
  }
}

/* Animation styles for backwards type only */
html:active-view-transition-type(backwards) {
  &::view-transition-old(content) {
    animation-name: slide-out-to-right;
  }

  &::view-transition-new(content) {
    animation-name: slide-in-from-left;
  }
}

/* Animation styles for reload type only */
/* Shared fixture styles (used by home, dashboard, aws pages) */

.fixTitle {
  font-family: Centra No2 Black;
  font-feature-settings: normal;
  font-size: 3rem;
  font-variation-settings: normal;
  font-weight: 900;
  color: white;
}

.weekBtn {
  padding: 0.5rem 1rem;
  background: none;
  border: 0px solid var(--border);
  font-family: Centra No2;
  white-space: nowrap;
  color: white;

  &:hover {
    background-color: var(--border);
  }

  &.active {
    background-color: white;
    color: var(--bg);
  }
}

.fixData {
  display: grid;
  position: relative;
  isolation: isolate;
  text-align: center;
  color: black;
  border-bottom: 3px solid #dedede;
  padding: 0.5rem;
  column-gap: 0.5rem;
  align-items: center;
  container: fixture / inline-size;
  row-gap: 0.5rem;
  background-color: transparent;
  border-radius: 0.5rem;
  margin-block: 1rem;
  background-position-y: top;
  overflow: hidden;
}

.infoBlock:after,
.fixData::after {
  content: "";
  position: absolute;
  inset: 0;
  background: white;
  z-index: -2;
}

.infoBlock:before,
.fixData::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("/img/wslbg.png");
  background-size: cover;
  mask-image: linear-gradient(rgb(255, 255, 255), rgb(255, 255, 255)), linear-gradient(rgb(255, 255, 255), rgb(255, 255, 255)), linear-gradient(rgb(255, 255, 255), rgb(255, 255, 255)), linear-gradient(to top, rgb(0, 0, 0) 30%, rgba(0, 0, 0, 0) 100%), linear-gradient(rgb(255, 255, 255), rgb(255, 255, 255)), linear-gradient(rgb(255, 255, 255), rgb(255, 255, 255));
  mask-composite: intersect;
  z-index: -1;
}

.infoBlock {
  position: relative;
  isolation: isolate;
  border-bottom: 3px solid #dedede;
  padding: 0.5rem;
  background-color: transparent;
  border-radius: 0.5rem;
  margin-block: 1rem;
  background-position-y: top;
  overflow: hidden;
}

.fixTeams {
  width: 100%;
  font-size: 1.8rem;
  grid-area: team;
  cursor: pointer;
}

.fixTime {
  font-size: 1.3rem;
}

.fixPCR,
.fixTruck,
.fixAssign,
.fixTier {
  grid-area: match;
  border: none;
  border-radius: 5px;
  text-align: center;
  font-size: 2rem;
  appearance: none;
  color: white;
}

.fixTier {
  grid-area: tier;
}

.fixTruck {
  grid-area: truck;
}

.fixPCR {
  grid-area: pcr;
}

.fixA {
  grid-area: teamA;
}

.fixB {
  grid-area: teamB;
}

.fixNotes,
.fixNotes2 {
  flex: 1;
  border: none;
  display: block;
  width: 100%;
  padding: 0.1rem 0.4rem;
  border-radius: 0.25rem;
}

.notesCont {
  display: flex;
  grid-area: notes;
  gap: 0.5rem;
}

.fixLocation {
  color: #92452b;
  font-size: 1.3rem;
}

.fixA,
.fixB {
  height: 3rem;
}

.fixHost {
  max-height: 3rem;
  width: 8rem;
  grid-area: watch;
  /* In the narrow layouts the broadcaster logo lives in a full-width 1fr column;
     anchor it to the right edge so it mirrors the crest on the left instead of
     floating inset with a gap to its right. (No effect where the column is auto.) */
  justify-self: end;
  background-image: url("/img/sources/wsl.png");
  background-position: center;
  background-size: 8rem;
  background-repeat: no-repeat;
  height: 100%;
  margin-inline: 1rem;
}

.fixInfo {
  display: flex;
  justify-content: center;
  grid-area: info;
}

.fixTMNum,
.fixTM,
.fixMMNum,
.fixMM {
  padding-inline: 0.4rem;
  color: white;
  font-size: 1.5rem;
  border-radius: 5px;
  border: none;
}

.fixHost[data-tier="1a"][data-truck="bbc"],
.fixHost[data-tier="1a"][data-truck="bbc-cf"] {
  background-image: url("/img/sources/bbc.svg");
}

.fixHost[data-tier="1b"],
.fixHost[data-tier="1a"][data-truck="sky"],
.fixHost[data-tier="1a"][data-truck="sky-cf"] {
  background-image: url("/img/sources/sky.svg");
}

/* End shared fixture styles */

html:active-view-transition-type(reload) {
  &::view-transition-old(root) {
    animation-name: fade-out, scale-down;
  }

  &::view-transition-new(root) {
    animation-delay: 0.25s;
    animation-name: fade-in, scale-up;
  }
}

/* ── Mobile header (shared aside) ──────────────────────────────────────────
   The 3rem h2 title used to overflow on a phone and, with overflow:hidden +
   space-between, it clipped the title and pushed the nav off-screen. Shrink
   the title and nav so logo + nav always fit, and drop the title entirely on
   the narrowest screens where the logo alone identifies the page. */
@media (max-width: 600px) {
  aside {
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
  }

  aside h2 {
    font-size: 1.5rem;
    flex: 0 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  aside img {
    height: 2.4rem;
  }

  aside .headerNav {
    gap: 0.15rem;
  }

  aside .headerNav a {
    padding: 0.4rem 0.55rem;
    font-size: 0.85rem;
  }
}

/* On the fixture-list pages the logo, week strip and nav already identify the
   page, so reclaim the title's space entirely on phones. Other pages keep their
   title — it shrinks and ellipsises via the rule above so the nav stays put. */
@media (max-width: 600px) {
  body:has(.weeksBar) aside h2#title {
    display: none;
  }
}