/*
 * Simulator shell header
 *
 * This intentionally mirrors the Predictor header measurements. Keep this
 * stylesheet last so legacy tournament themes cannot reshape the shared bar.
 */

:is(
  body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
  body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
  body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
) {
  border-top: 0 !important;
  outline: 0 !important;
}

:is(
  body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
  body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
  body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
) .app-shell {
  border-top: 0 !important;
  outline: 0 !important;
}

:is(
  body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
  body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
  body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
) .sidebar {
  position: sticky !important;
  z-index: 30 !important;
  top: 0 !important;
  display: grid !important;
  grid-template-columns: 1fr auto 1fr !important;
  grid-template-rows: 60px !important;
  width: 100% !important;
  min-height: 60px !important;
  height: 60px !important;
  align-items: center !important;
  gap: 0 !important;
  padding: 0 clamp(16px, 4vw, 44px) !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(190, 237, 255, 0.18) !important;
  outline: 0 !important;
  background: rgba(4, 93, 128, 0.94) !important;
  box-shadow: 0 8px 24px rgba(1, 40, 57, 0.18) !important;
  backdrop-filter: blur(16px) !important;
}

:is(
  body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
  body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
  body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
) .sidebar::before,
:is(
  body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
  body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
  body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
) .sidebar::after {
  display: none !important;
  content: none !important;
}

:is(
  body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
  body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
  body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
) .sidebar :is(
  .mobile-menu,
  .header-new-tournament,
  .legacy-header-back,
  .tournament-status,
  .round-nav,
  #discordButton
) {
  display: none !important;
}

:is(
  body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
  body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
  body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
) .sidebar .brand {
  position: static !important;
  display: block !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: fit-content !important;
  height: auto !important;
  align-self: center !important;
  justify-self: start !important;
  margin: 0 !important;
  color: #fff !important;
  background: none !important;
  filter: none !important;
  transform: none !important;
}

:is(
  body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
  body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
  body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
) .sidebar .brand-mark {
  display: flex !important;
  visibility: visible !important;
  width: 38px !important;
  height: 38px !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 10px !important;
  color: #fff !important;
  line-height: 1 !important;
  text-align: center !important;
  background: #5f8cff !important;
  box-shadow: none !important;
}

:is(
  body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
  body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
  body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
) .sidebar .brand-mark-number {
  font-size: 14px !important;
  font-weight: 800 !important;
  letter-spacing: -0.6px !important;
}

:is(
  body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
  body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
  body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
) .sidebar .brand-mark-label {
  margin-top: 2px !important;
  font-size: 6px !important;
  font-weight: 800 !important;
  letter-spacing: 0.55px !important;
}

:is(
  body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
  body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
  body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
) .main-section-switch {
  position: static !important;
  display: flex !important;
  grid-column: 2 !important;
  grid-row: 1 !important;
  width: auto !important;
  min-width: 0 !important;
  align-items: center !important;
  align-self: center !important;
  justify-self: center !important;
  gap: 5px !important;
  margin: 0 !important;
  padding: 4px !important;
  border: 1px solid rgba(190, 237, 255, 0.24) !important;
  border-radius: 999px !important;
  background: rgba(2, 70, 98, 0.48) !important;
  box-shadow: none !important;
  transform: none !important;
}

:is(
  body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
  body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
  body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
) .main-section-switch a {
  display: flex !important;
  min-height: 38px !important;
  align-items: center !important;
  padding: 9px 15px !important;
  border: 0 !important;
  border-radius: 999px !important;
  color: #c9efff !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  line-height: normal !important;
  text-decoration: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

:is(
  body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
  body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
  body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
) .main-section-switch a.is-active {
  color: #fff !important;
  background: #006e98 !important;
}

:is(
  body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
  body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
  body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
) .sidebar .header-actions {
  position: static !important;
  inset: auto !important;
  display: flex !important;
  grid-column: 3 !important;
  grid-row: 1 !important;
  width: auto !important;
  min-width: 0 !important;
  align-items: center !important;
  align-self: center !important;
  justify-self: end !important;
  gap: 6px !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: auto !important;
  transform: none !important;
}

:is(
  body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
  body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
  body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
) .sidebar .header-actions .utility-button:not(.main-account-button) {
  position: static !important;
  display: inline-flex !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 42px !important;
  height: 42px !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  margin: 0 !important;
  padding: 0 12px !important;
  border: 1px solid rgba(190, 237, 255, 0.24) !important;
  border-radius: 999px !important;
  color: #c9efff !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: normal !important;
  background: rgba(2, 70, 98, 0.48) !important;
  box-shadow: none !important;
  transform: none !important;
}

:is(
  body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
  body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
  body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
) .sidebar .header-actions .utility-button:not(.main-account-button) > span:first-child {
  color: #fff !important;
  font-size: 15px !important;
  line-height: 1 !important;
}

:is(
  body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
  body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
  body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
) .sidebar .header-actions #newsButton {
  margin-right: 0 !important;
}

:is(
  body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
  body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
  body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
) .sidebar .header-actions .main-account-button {
  position: static !important;
  display: inline-flex !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 42px !important;
  height: 42px !important;
  align-items: center !important;
  justify-content: center !important;
  justify-self: end !important;
  gap: 9px !important;
  margin: 0 !important;
  padding: 5px 12px 5px 6px !important;
  overflow: hidden !important;
  border: 1px solid rgba(190, 237, 255, 0.24) !important;
  border-radius: 999px !important;
  color: #fff !important;
  background: rgba(7, 132, 181, 0.72) !important;
  box-shadow: none !important;
  transform: none !important;
}

:is(
  body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
  body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
  body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
) .sidebar .main-account-button .main-account-flag {
  position: static !important;
  display: grid !important;
  width: 38px !important;
  min-width: 38px !important;
  height: 26px !important;
  overflow: hidden !important;
  flex: 0 0 38px !important;
  place-items: center !important;
  margin: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.24) !important;
  border-radius: 5px !important;
  color: #fff !important;
  background: #006e98 !important;
  box-shadow: none !important;
  transform: none !important;
}

:is(
  body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
  body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
  body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
) .sidebar .main-account-button .main-account-flag :is(.country-flag, img, .main-account-flag-image),
:is(
  body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
  body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
  body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
) .sidebar .main-account-button .main-account-flag .main-account-flag-image > img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  object-fit: cover !important;
}

:is(
  body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
  body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
  body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
) .sidebar .main-account-button .main-account-mobile-icon {
  display: none !important;
}

:is(
  body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
  body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
  body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
) .sidebar .main-account-button > span:last-child {
  position: static !important;
  display: inline-block !important;
  overflow: hidden !important;
  max-width: 180px !important;
  margin: 0 !important;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  line-height: normal !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  transform: none !important;
}

@media (hover: hover) and (pointer: fine) {
  :is(
    body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
    body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
    body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
  ) .sidebar .header-actions .utility-button:hover {
    border-color: rgba(190, 237, 255, 0.48) !important;
    background: rgba(2, 70, 98, 0.7) !important;
  }
}

@media (max-width: 1700px) {
  :is(
    body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
    body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
    body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
  ) .sidebar .header-actions .utility-button:not(.main-account-button) {
    width: 42px !important;
    min-width: 42px !important;
    padding: 0 !important;
  }

  :is(
    body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
    body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
    body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
  ) .sidebar .header-actions .utility-button:not(.main-account-button) > span:last-child {
    display: none !important;
  }
}

@media (max-width: 720px) {
  :is(
    body.before-start:not([data-desktop-mode-setup]),
    body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
    body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
  ) .sidebar {
    grid-template-columns: auto minmax(0, 1fr) !important;
    grid-template-rows: 60px 52px !important;
    min-height: 120px !important;
    height: 120px !important;
    padding: 0 10px 8px !important;
    border-bottom: 0 !important;
    background: linear-gradient(to bottom, rgba(4, 93, 128, 0.98) 0 60px, transparent 60px) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  :is(
    body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
    body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
    body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
  ) .sidebar .brand {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  :is(
    body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
    body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
    body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
  ) .sidebar .header-actions {
    grid-column: 2 !important;
    grid-row: 1 !important;
    max-width: calc(100vw - 70px) !important;
    align-self: center !important;
    justify-self: end !important;
    gap: 3px !important;
  }

  :is(
    body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
    body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
    body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
  ) .main-section-switch {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    width: min(100%, 340px) !important;
    align-self: end !important;
    justify-self: center !important;
    margin-top: 7px !important;
  }

  :is(
    body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
    body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
    body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
  ) .main-section-switch a {
    flex: 1 1 0 !important;
    justify-content: center !important;
    text-align: center !important;
  }

  :is(
    body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
    body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
    body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
  ) .sidebar .header-actions .utility-button:not(.main-account-button),
  :is(
    body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
    body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
    body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
  ) .sidebar .header-actions .main-account-button {
    width: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    height: 38px !important;
    justify-content: center !important;
    padding: 0 !important;
  }

  :is(
    body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
    body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
    body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
  ) .sidebar .main-account-button .main-account-flag {
    display: none !important;
  }

  :is(
    body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
    body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
    body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
  ) .sidebar .main-account-button .main-account-mobile-icon {
    display: inline-flex !important;
    width: 21px !important;
    height: 21px !important;
    align-items: center !important;
    justify-content: center !important;
  }

  :is(
    body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
    body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
    body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
  ) .sidebar .main-account-button > span:last-child {
    display: none !important;
  }
}

@media (max-width: 640px) {
  :is(
    body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
    body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
    body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
  ) .main-section-switch a {
    min-height: 36px !important;
    padding: 8px 11px !important;
    font-size: 11px !important;
  }
}

@media (max-width: 380px) {
  :is(
    body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
    body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
    body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
  ) .sidebar .header-actions {
    gap: 1px !important;
  }

  :is(
    body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
    body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
    body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
  ) .sidebar .header-actions .utility-button:not(.main-account-button),
  :is(
    body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
    body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
    body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
  ) .sidebar .header-actions .main-account-button {
    width: 35px !important;
    min-width: 35px !important;
    min-height: 35px !important;
    height: 35px !important;
  }

  :is(
    body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
    body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
    body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
  ) .main-section-switch a {
    min-height: 32px !important;
    padding: 6px !important;
    font-size: 9px !important;
  }
}

/* Tablet shell: keep the primary tabs on their own row before the account
   tools can collide with them. Phones retain the tighter layout below. */
@media (min-width: 721px) and (max-width: 1280px) {
  :is(
    body.before-start:not([data-desktop-mode-setup]),
    body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
    body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
  ) .sidebar {
    grid-template-columns: 1fr auto !important;
    grid-template-rows: 60px 52px !important;
    min-height: 112px !important;
    height: 112px !important;
    padding: 0 clamp(18px, 3vw, 34px) 8px !important;
    border-bottom: 0 !important;
    background: linear-gradient(to bottom, rgba(4, 93, 128, 0.97) 0 60px, transparent 60px) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  :is(
    body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
    body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
    body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
  ) .sidebar .brand {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  :is(
    body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
    body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
    body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
  ) .sidebar .header-actions {
    grid-column: 2 !important;
    grid-row: 1 !important;
    max-width: none !important;
    align-self: center !important;
    justify-self: end !important;
    gap: 4px !important;
  }

  :is(
    body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
    body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
    body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
  ) .main-section-switch {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    width: min(100%, 360px) !important;
    align-self: end !important;
    justify-self: center !important;
    margin: 6px 0 0 !important;
  }

  :is(
    body:is(.before-start:not([data-desktop-mode-setup]), [data-desktop-mode-setup="standard"]),
    body.standard-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active),
    body.custom-tournament-mode-active:not(.before-start):not(.pl-match-mode-active):not(.ucl-match-mode-active)
  ) .main-section-switch a {
    flex: 1 1 0 !important;
    justify-content: center !important;
    text-align: center !important;
  }
}

/* Setup routes hide the primary tabs, so they must not retain the empty
   navigation row used by the tablet simulator homepage. */
@media (max-width: 1280px) {
  body[data-desktop-mode-setup="standard"] .sidebar {
    grid-template-rows: 60px !important;
    min-height: 60px !important;
    height: 60px !important;
    padding-bottom: 0 !important;
    border-bottom: 1px solid rgba(180, 231, 250, 0.22) !important;
    background: rgba(4, 93, 128, 0.98) !important;
    box-shadow: 0 8px 24px rgba(1, 34, 49, 0.22) !important;
    backdrop-filter: blur(16px) !important;
  }
}
