/* One shared navigation bar for every public route. */
body.legacy-public-shell #site-shell .site-header {
  position: sticky !important;
  top: 6px !important;
  z-index: 50 !important;
  padding: 0 clamp(8px, 1.15vw, 16px) !important;
  background: transparent !important;
  backdrop-filter: none !important;
}

body.legacy-public-shell[data-page="ranking"] #site-shell .site-header {
  position: static !important;
  top: auto !important;
  z-index: auto !important;
}

body.legacy-public-shell[data-page="ranking"] #site-shell .site-header .topbar {
  top: 0 !important;
}

@media (max-width: 1120px) {
  body.legacy-public-shell[data-page="ranking"]:not(.astro-ranking-enhanced) #site-shell .site-header .topbar {
    flex-wrap: wrap !important;
  }

  body.legacy-public-shell[data-page="ranking"]:not(.astro-ranking-enhanced) #site-shell .site-header .topbar .mobile-menu-toggle {
    display: none !important;
  }

  body.legacy-public-shell[data-page="ranking"]:not(.astro-ranking-enhanced) #site-shell .site-header .topbar .topbar-actions {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 10px 16px !important;
  }

  body.legacy-public-shell[data-page="ranking"]:not(.astro-ranking-enhanced) #site-shell .site-header .topbar .nav-links {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    width: 100% !important;
    padding-bottom: 2px !important;
  }
}

body.legacy-public-shell #site-shell .site-header .topbar {
  position: relative !important;
  top: 10px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-height: 90px !important;
  margin: 0 !important;
  gap: clamp(12px, 1.6vw, 26px) !important;
  padding: 10px clamp(14px, 2vw, 28px) !important;
  border: 1px solid rgba(47, 143, 255, 0.42) !important;
  border-radius: 20px !important;
  background: rgba(3, 16, 33, 0.92) !important;
  box-shadow: none !important;
  backdrop-filter: blur(12px) !important;
}

body.legacy-public-shell #site-shell .site-header .topbar .brand {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  gap: 11px !important;
  max-width: none !important;
  padding: 0 !important;
  color: #f4f7fc !important;
  text-decoration: none !important;
}

body.legacy-public-shell #site-shell .site-header .topbar .brand-logo,
body.legacy-public-shell #site-shell .site-header .topbar .brand-favicon {
  width: 54px !important;
  height: 54px !important;
  flex: 0 0 54px !important;
  object-fit: contain !important;
}

body.legacy-public-shell #site-shell .site-header .topbar .brand-copy {
  display: grid !important;
  gap: 3px !important;
}

body.legacy-public-shell #site-shell .site-header .topbar .brand-copy strong {
  font-family: "Formula1 Bold", "Formula1", sans-serif !important;
  font-size: clamp(0.82rem, 1.3vw, 1.1rem) !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
}

body.legacy-public-shell #site-shell .site-header .topbar .brand-copy small {
  color: #9fb8d5 !important;
  font-size: 0.62rem !important;
  letter-spacing: 0.17em !important;
  text-transform: uppercase !important;
}

body.legacy-public-shell #site-shell .site-header .topbar .mobile-menu-toggle {
  display: none !important;
}

body.legacy-public-shell #site-shell .site-header .topbar .topbar-actions {
  display: flex !important;
  flex: 1 1 auto !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex-wrap: nowrap !important;
  gap: clamp(12px, 1.6vw, 26px) !important;
  min-width: 0 !important;
  padding: 0 !important;
}

body.legacy-public-shell #site-shell .site-header .topbar .season-switcher {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  flex-wrap: nowrap !important;
  gap: 4px !important;
  margin: 0 !important;
  padding: 4px !important;
  border-color: rgba(88, 147, 220, 0.38) !important;
  border-radius: 13px !important;
  background: rgba(7, 23, 45, 0.88) !important;
}

body.legacy-public-shell #site-shell .site-header .topbar .season-chip {
  min-height: 40px !important;
  padding-inline: 15px !important;
  border-radius: 10px !important;
  font-size: 0.74rem !important;
  letter-spacing: 0.04em !important;
}

body.legacy-public-shell #site-shell .site-header .topbar .season-chip.is-active {
  background: linear-gradient(115deg, #087ff4, #1457d4) !important;
  box-shadow: 0 8px 20px rgba(0, 77, 196, 0.28) !important;
}

body.legacy-public-shell #site-shell .site-header .topbar .nav-links {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: clamp(8px, 1.15vw, 20px) !important;
  min-width: 0 !important;
  padding: 0 !important;
  color: #e2edff !important;
  font-size: clamp(0.68rem, 0.78vw, 0.82rem) !important;
}

body.legacy-public-shell #site-shell .site-header .topbar .nav-links a {
  display: flex !important;
  align-items: center !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 7px 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: inherit !important;
  font-size: inherit !important;
  line-height: 1.15 !important;
  text-align: left !important;
  white-space: nowrap !important;
}

body.legacy-public-shell #site-shell .site-header .topbar .nav-links a.is-current {
  color: #63b8ff !important;
}

body[data-page="piloto-compare"] #site-shell > .pilot-compare-page-frame {
  position: relative;
  isolation: isolate;
  width: calc(100% - clamp(20px, 3vw, 48px));
  margin: clamp(12px, 2vw, 26px) auto 30px;
  padding: 8px 8px 14px;
  overflow: clip;
  border: 1px solid rgba(44, 145, 226, 0.55);
  border-radius: clamp(18px, 2vw, 28px);
  background:
    radial-gradient(circle at 8% 27%, rgba(22, 84, 148, 0.14), transparent 35rem),
    linear-gradient(145deg, rgba(6, 22, 41, 0.98), rgba(4, 13, 26, 0.99) 72%),
    #061426;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.38), inset 0 0 0 1px rgba(255, 255, 255, 0.018);
}

body.legacy-public-shell #site-shell .upcoming-season-header .topbar {
  top: 4px !important;
}

@media (max-width: 1120px) {
  body.legacy-public-shell #site-shell .site-header .topbar {
    min-height: 0 !important;
    flex-wrap: wrap !important;
    border-radius: 18px !important;
  }

  body.legacy-public-shell #site-shell .site-header .topbar .brand {
    flex: 1 1 auto !important;
  }

  body.legacy-public-shell #site-shell .site-header .topbar .mobile-menu-toggle {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    margin-left: auto !important;
  }

  body.legacy-public-shell #site-shell .site-header .topbar .topbar-actions {
    display: none !important;
    width: 100% !important;
    min-width: 0 !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 10px 16px !important;
  }

  body.legacy-public-shell #site-shell .site-header .topbar.is-menu-open .topbar-actions {
    display: flex !important;
  }

  body.legacy-public-shell #site-shell .site-header .topbar .nav-links {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    width: 100% !important;
    padding-bottom: 2px !important;
  }
}

@media (max-width: 760px) {
  body.legacy-public-shell #site-shell > .site-header {
    box-sizing: border-box !important;
    width: calc(100% - 22px) !important;
    margin: 6px auto 0 !important;
  }

  body.legacy-public-shell #site-shell > :is(
    .championship-page-frame,
    .participants-page-frame,
    .pilot-profile-page-frame,
    .pilot-compare-page-frame,
    .favorites-page-frame,
    .stages-page-frame,
    .stage-detail-page-frame,
    .ranking-page-frame,
    .history-page-frame,
    .gallery-page-frame
  ) {
    width: calc(100% - 12px) !important;
    margin: 6px auto 16px !important;
    padding: 5px 4px 10px !important;
  }

  body.legacy-public-shell #site-shell .site-header {
    top: 6px !important;
    padding: 0 4px !important;
  }

  body.legacy-public-shell #site-shell .upcoming-season-header {
    margin-top: -6px !important;
  }

  body.legacy-public-shell #site-shell .site-header .topbar {
    top: 10px !important;
    min-height: 0 !important;
    flex-wrap: wrap !important;
    gap: 8px 12px !important;
    padding: 10px 11px !important;
    border-radius: 16px !important;
  }

  body.legacy-public-shell #site-shell .upcoming-season-header .topbar {
    top: 4px !important;
  }

  body.legacy-public-shell #site-shell .site-header .topbar .brand {
    flex: 1 1 auto !important;
    gap: 8px !important;
    max-width: calc(100% - 95px) !important;
  }

  body.legacy-public-shell #site-shell .site-header .topbar .brand-logo,
  body.legacy-public-shell #site-shell .site-header .topbar .brand-favicon {
    width: 42px !important;
    height: 42px !important;
    flex-basis: 42px !important;
  }

  body.legacy-public-shell #site-shell .site-header .topbar .brand-copy strong {
    font-size: 0.68rem !important;
    letter-spacing: 0.055em !important;
  }

  body.legacy-public-shell #site-shell .site-header .topbar .brand-copy small {
    font-size: 0.35rem !important;
    letter-spacing: 0.14em !important;
  }

  body.legacy-public-shell #site-shell .site-header .topbar .mobile-menu-toggle {
    min-height: 34px !important;
    padding-inline: 11px !important;
    border-radius: 10px !important;
  }

  body.legacy-public-shell #site-shell .site-header .topbar:not(.is-menu-open) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    column-gap: 8px !important;
  }

  body.legacy-public-shell #site-shell .site-header .topbar .brand {
    min-width: 0 !important;
    max-width: none !important;
    flex: 0 1 auto !important;
    gap: 7px !important;
  }

  body.legacy-public-shell #site-shell .site-header .topbar .brand-copy {
    min-width: 0 !important;
    overflow: hidden !important;
  }

  body.legacy-public-shell #site-shell .site-header .topbar .brand-copy strong {
    display: block !important;
    overflow: hidden !important;
    font-size: clamp(0.59rem, 3.2vw, 0.7rem) !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body.legacy-public-shell #site-shell .site-header .topbar .mobile-menu-toggle {
    min-width: 42px !important;
    min-height: 42px !important;
    margin: 0 !important;
    padding-inline: 9px !important;
    justify-self: end !important;
  }

  body.legacy-public-shell #site-shell .site-header .topbar.is-menu-open {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
  }

  body.legacy-public-shell #site-shell .site-header .topbar.is-menu-open .topbar-actions {
    grid-column: 1 / -1 !important;
  }

  body.legacy-public-shell #site-shell .site-header .topbar .season-switcher {
    flex-wrap: wrap !important;
    max-width: 100% !important;
    padding: 4px !important;
  }

  body.legacy-public-shell #site-shell .site-header .topbar .season-chip {
    min-height: 30px !important;
    padding-inline: 9px !important;
    border-radius: 8px !important;
    font-size: 0.66rem !important;
    white-space: nowrap !important;
  }

  body.legacy-public-shell #site-shell .site-header .topbar .nav-links {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  body.legacy-public-shell #site-shell .site-header .topbar .nav-links a {
    justify-content: center !important;
    min-height: 38px !important;
    padding: 5px 3px !important;
    border: 1px solid rgba(120, 168, 241, 0.12) !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.045) !important;
    font-size: 0.58rem !important;
    text-align: center !important;
    white-space: normal !important;
    line-height: 1.15 !important;
  }

  body.legacy-public-shell #site-shell > .upcoming-season-page {
    width: calc(100% - 12px) !important;
    margin: 6px auto !important;
    padding: 5px 4px 10px !important;
  }
}

@media (max-width: 360px) {
  body.legacy-public-shell #site-shell .site-header .topbar .brand {
    flex: 0 1 auto !important;
    max-width: none !important;
  }

  body.legacy-public-shell #site-shell .site-header .topbar .brand-logo,
  body.legacy-public-shell #site-shell .site-header .topbar .brand-favicon {
    width: 38px !important;
    height: 38px !important;
    flex-basis: 38px !important;
  }

  body.legacy-public-shell #site-shell .site-header .topbar .mobile-menu-toggle {
    width: 42px !important;
    min-width: 42px !important;
    padding-inline: 0 !important;
  }

  body.legacy-public-shell #site-shell .site-header .topbar .mobile-menu-toggle-label {
    display: none !important;
  }
}
