/* Colours and sizes follow @pl/ui-theme */
.pl-splash {
  --primary-color: #37003c;
  --secondary-color: #ff2882;
  --light-color: #ebebe6;
  --splash-font-family:
    PremierLeague, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans',
    'Liberation Sans', Arial, sans-serif;
  --text-secondary: #5a505f;
  --divider: #e0e0e0;
  --skeleton-bg: var(--light-color);
  --skeleton-pulse: rgba(0, 0, 0, 0.2);

  /* Side bar, as pl-side-bar's fill modes; vanilla and light by default */
  --side-bar-width: 275px;
  --side-bar-mini-width: 70px;
  --side-bar-surface: #ffffff;
  --side-bar-skeleton: var(--light-color);
  --side-bar-skeleton-pulse: rgba(0, 0, 0, 0.2);
  --tertiary-color: #12e6ff;
  --quaternary-color: #db25ff;

  /* contentAppearance: 'inset', as pl-shell's --pl-shell-inset-* */
  --inset-background: #ebebe6;
  --inset-gap: 12px;
  --inset-radius: 14px;
  --inset-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);

  &,
  & * {
    box-sizing: border-box;
  }

  overflow: hidden;
  font-family: var(--splash-font-family);
  margin: 0;
  padding: 0;
  position: relative;

  .splash__container {
    background-color: #ffffff;
  }

  .skeleton__screen {
    display: flex;
    height: 100vh;
    height: 100dvh;
  }

  /* Side bar */
  .skeleton__sidebar {
    --skeleton-bg: var(--side-bar-skeleton);
    --skeleton-pulse: var(--side-bar-skeleton-pulse);

    width: var(--side-bar-width);
    flex-shrink: 0;
    background: var(--side-bar-surface);
    display: flex;
    flex-direction: column;
    padding: 32px 20px 68px;
    gap: 15px;
    border: 0;
    border-right: 3px solid transparent;
    border-image: linear-gradient(to bottom, var(--tertiary-color), var(--quaternary-color)) 1;
  }

  .skeleton__sidebar-header {
    display: flex;
    gap: 12px;
    flex: 0 0 auto;
  }

  .skeleton__sidebar-header-row {
    width: 80%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
  }

  .skeleton__sidebar-header-circle {
    height: 32px;
    width: 32px;
  }

  .skeleton__sidebar-header-heavy-line {
    width: 128px;
    height: 12px;
  }

  .skeleton__sidebar-header-short-line {
    width: 90px;
    height: 8px;
  }

  .skeleton__sidebar-items {
    display: flex;
    flex-direction: column;
    gap: 35px;
    margin-top: 32px;
    flex: 1 1 auto;
    padding-left: 1px;
  }

  .skeleton__sidebar-row {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .skeleton__sidebar-icon {
    height: 24px;
    width: 24px;
  }

  .skeleton__sidebar-item-line {
    height: 16px;
    width: 128px;
  }

  .skeleton__sidebar-footer {
    flex: 0 0 auto;
    width: 100%;
    margin-top: 10px;
    display: flex;
    justify-content: center;
  }

  .skeleton__sidebar-footer-line {
    width: 128px;
    height: 12px;
  }

  /* sideBarSearch: pl-global-search's spotlight button, under the header */
  .skeleton__sidebar-search {
    flex: 0 0 auto;
    height: 36px;

    .skeleton__wrapper {
      border-radius: 10px;
    }

    & + .skeleton__sidebar-items {
      margin-top: 16px;
    }
  }

  /* sideBarFooter: 'profile', the row beside the collapse toggle */
  .skeleton__sidebar:has(.skeleton__sidebar-footer--profile) {
    padding-bottom: 14px;
  }

  .skeleton__sidebar-footer--profile {
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    padding-right: 44px;
  }

  .skeleton__sidebar-avatar {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
  }

  .skeleton__sidebar-profile-lines {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
  }

  .skeleton__sidebar-profile-name {
    width: 96px;
    height: 10px;
  }

  .skeleton__sidebar-profile-email {
    width: 128px;
    max-width: 100%;
    height: 8px;
  }

  /* Content */
  .skeleton__content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--primary-color);
  }

  .skeleton__content-main {
    height: 100%;
    width: 100%;
    display: flex;
    gap: 24px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 20px 48px;
  }

  /* Header */
  .search-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    width: 100%;
    min-height: 50px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--divider);
  }

  .skeleton__content-search-line {
    width: 200px;
    height: 24px;
  }

  .skeleton__content-search-circle {
    height: 32px;
    width: 32px;
    margin-right: 20px;
  }

  .skeleton__menu-icon {
    display: none;
    width: 24px;
    height: 24px;
    margin: 0 auto 0 16px;
  }

  /* Logo and title */
  .skeleton__logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
  }

  .skeleton__logo-image {
    max-width: 116px;
    width: auto;
    height: 48px;
    object-fit: contain;
  }

  .skeleton__logo-separator {
    width: 2px;
    height: 50px;
    background-color: var(--primary-color);
  }

  .skeleton__logo-title {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 24px;
    margin: 16px 0;
  }

  /* Spinner, as pl-loader */
  .spinner__wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 1em;
  }

  .spinner__icon {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--secondary-color);
    animation: pl-splash-spin 0.6s linear infinite;
  }

  .skeleton__subtext {
    font-weight: bold;
    font-size: 20px;
    color: var(--primary-color);
  }

  /* Skeleton blocks, as pl-skeleton-loader */
  .skeleton__wrapper {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    background-color: var(--skeleton-bg);
    animation: pl-splash-pulse 1.6s ease-in-out infinite;
  }

  .skeleton__sidebar-header-circle .skeleton__wrapper,
  .skeleton__content-search-circle .skeleton__wrapper,
  .skeleton__sidebar-avatar .skeleton__wrapper {
    border-radius: 50%;
  }

  /* The page in a rounded card on a tinted background; phones keep the flush page, as pl-shell does */
  @media screen and (min-width: 768px) {
    .search-bar--menu-only {
      display: none;
    }

    &.pl-splash--inset {
      .splash__container {
        background-color: var(--inset-background);
      }

      .skeleton__sidebar {
        border-right: 0;
      }

      /* Its items are pills, 8px from the edges, and the search button lines up with them */
      .skeleton__sidebar-search {
        margin-inline: -12px;
      }

      .skeleton__content {
        gap: var(--inset-gap);
        padding: var(--inset-gap);
      }

      .skeleton__sidebar + .skeleton__content {
        padding-left: 0;
      }

      .search-bar {
        --skeleton-bg: rgba(0, 0, 0, 0.07);

        background-color: transparent;
        border-bottom: 0;
      }

      .skeleton__content-main {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
        background-color: #ffffff;
        border: 1px solid var(--divider);
        border-radius: var(--inset-radius);
        box-shadow: var(--inset-shadow);
      }
    }

    /* A light side bar sits on the page's tint, so its blocks darken that instead */
    &.pl-splash--inset.pl-splash--vanilla,
    &.pl-splash--inset.pl-splash--light {
      --side-bar-surface: var(--inset-background);
      --side-bar-skeleton: rgba(0, 0, 0, 0.07);
    }
  }

  /* pl-side-bar is a mini rail on tablets and hidden on phones */
  @media screen and (min-width: 768px) and (max-width: 991px) {
    .skeleton__sidebar {
      width: var(--side-bar-mini-width);
      padding: 32px 0 68px;
      align-items: center;
    }

    .skeleton__sidebar-header-row,
    .skeleton__sidebar-item-line,
    .skeleton__sidebar-footer:not(.skeleton__sidebar-footer--profile),
    .skeleton__sidebar-profile-lines {
      display: none;
    }

    /* Collapsed, the search button is an icon and the profile row its avatar */
    .skeleton__sidebar-search {
      width: 40px;
    }

    .skeleton__sidebar-footer--profile {
      justify-content: center;
      padding-right: 0;
    }

    &.pl-splash--inset .skeleton__sidebar-search {
      margin-inline: 0;
    }
  }

  @media screen and (max-width: 767px) {
    .skeleton__sidebar {
      display: none;
    }

    .skeleton__menu-icon {
      display: block;
    }

    .skeleton__content-main {
      padding: 0.5em;
      gap: 0.2em;
    }

    .skeleton__logo-title {
      font-size: 20px;
    }

    .skeleton__subtext {
      font-size: 16px;
      color: var(--text-secondary);
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .skeleton__wrapper {
      animation: none;
    }

    .spinner__icon {
      animation-duration: 1.5s;
    }
  }
}

.pl-splash--premierleague {
  --side-bar-surface: #37003c;
  --side-bar-skeleton: rgba(255, 255, 255, 0.15);
  --side-bar-skeleton-pulse: rgba(255, 255, 255, 0.3);
  --tertiary-color: #05f0ff;
  --quaternary-color: #ff2882;
}

.pl-splash--efl {
  --side-bar-surface: linear-gradient(180deg, #2d3a80 0%, #283270 55%, #1d2559 100%);
  --side-bar-skeleton: rgba(255, 255, 255, 0.15);
  --side-bar-skeleton-pulse: rgba(255, 255, 255, 0.3);
  --tertiary-color: #001489;
  --quaternary-color: #ba0c2f;
}

.pl-splash--dark {
  --side-bar-surface: #1b1b1f;
  --side-bar-skeleton: rgba(255, 255, 255, 0.15);
  --side-bar-skeleton-pulse: rgba(255, 255, 255, 0.3);
}

@keyframes pl-splash-pulse {
  50% {
    background-color: var(--skeleton-pulse);
  }
}

@keyframes pl-splash-spin {
  to {
    transform: rotate(360deg);
  }
}
