/* PirateMedia — site header refresh */
:root {
  --site-header-h: 64px;
  --header-accent: #ff00ff;
  --header-accent-2: #00ffff;
  --header-bg: rgba(6, 6, 10, 0.78);
  --header-bg-scrolled: rgba(6, 6, 10, 0.94);
  --header-border: rgba(255, 255, 255, 0.07);
  --header-text: rgba(255, 255, 255, 0.72);
  --header-text-hover: #fff;
  --header-radius: 999px;
}

@media (max-width: 900px) {
  :root {
    --site-header-h: 60px;
  }
}

/* ── Shell ── */
header.navbar.navbar-new.site-header,
.navbar.navbar-new.site-header {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  height: var(--site-header-h);
  max-height: var(--site-header-h);
  padding: 0;
  gap: 0;
  flex-wrap: nowrap;
  overflow: visible;
  background: var(--header-bg);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  border-bottom: 1px solid var(--header-border);
  box-shadow:
    0 4px 30px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition:
    background 0.35s ease,
    box-shadow 0.35s ease,
    border-color 0.35s ease;
}

header.navbar.navbar-new.site-header::after,
.navbar.navbar-new.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 255, 255, 0.35) 22%,
    rgba(255, 0, 255, 0.55) 50%,
    rgba(0, 255, 255, 0.35) 78%,
    transparent 100%
  );
  pointer-events: none;
  opacity: 0.9;
}

header.navbar.navbar-new.site-header.is-scrolled,
.navbar.navbar-new.site-header.is-scrolled {
  background: var(--header-bg-scrolled);
  border-bottom-color: rgba(255, 0, 255, 0.12);
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.55),
    0 0 48px rgba(255, 0, 255, 0.06);
}

.site-header-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  width: 100%;
  max-width: 1680px;
  height: var(--site-header-h);
  margin: 0 auto;
  padding: 0 clamp(0.75rem, 2.5vw, 1.75rem);
  gap: clamp(0.5rem, 1.2vw, 1.25rem);
  box-sizing: border-box;
}

/* ── Logo ── */
.site-header .logo {
  flex-shrink: 0;
  z-index: 2;
}

.site-header .logo-image {
  height: 38px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(255, 0, 255, 0.2));
  transition: filter 0.25s ease, transform 0.25s ease;
}

.site-header .logo:hover .logo-image {
  filter: drop-shadow(0 0 18px rgba(0, 255, 255, 0.35));
  transform: scale(1.03);
}

/* ── Nav links ── */
.site-header .nav-links-container {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  /* Fade only the left edge (scroll hint); do not clip the last nav item on the right */
  mask-image: linear-gradient(to right, transparent, #000 14px, #000 100%);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 14px, #000 100%);
  padding-right: 4px;
  margin-right: 2px;
}

.site-header--signed-in .nav-links-container {
  margin-right: 6px;
}

.site-header--signed-in .nav-links {
  padding-right: 10px;
}

.site-header .nav-links-container::-webkit-scrollbar {
  display: none;
}

.site-header .nav-links {
  display: flex;
  flex-wrap: nowrap;
  flex-shrink: 0;
  width: max-content;
  gap: 0.2rem;
  margin: 0;
  padding: 0 4px;
  list-style: none;
}

.site-header .nav-links > li {
  flex-shrink: 0;
}

.site-header .nav-item {
  color: var(--header-text);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.42rem 0.72rem;
  white-space: nowrap;
  flex-shrink: 0;
  border-radius: var(--header-radius);
  border: 1px solid transparent;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.site-header .nav-item .nav-svg-icon {
  width: 15px;
  height: 15px;
  opacity: 0.88;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.site-header .nav-item:hover {
  color: var(--header-text-hover);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.site-header .nav-item.active {
  color: #fff;
  background: linear-gradient(
    135deg,
    rgba(255, 0, 255, 0.2) 0%,
    rgba(0, 255, 255, 0.08) 100%
  );
  border-color: rgba(255, 0, 255, 0.35);
  box-shadow: 0 0 22px rgba(255, 0, 255, 0.12);
}

.site-header .nav-item.active .nav-svg-icon {
  color: #f5d0fe;
  opacity: 1;
}

/* ── Actions (Chat + Discord + search) ── */
.site-header .header-actions {
  display: flex !important;
  visibility: visible !important;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  margin-left: auto !important;
  padding-left: 4px;
}

.site-header .header-chat-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-shrink: 0;
  min-height: 40px;
  padding: 0.48rem 0.85rem;
  border-radius: var(--header-radius);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--header-text) !important;
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.site-header .header-chat-btn:hover {
  color: var(--header-text-hover) !important;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(0, 255, 255, 0.35);
}

.site-header .header-chat-btn.is-active {
  color: #fff !important;
  background: linear-gradient(
    135deg,
    rgba(255, 0, 255, 0.2) 0%,
    rgba(0, 255, 255, 0.08) 100%
  );
  border-color: rgba(255, 0, 255, 0.35);
  box-shadow: 0 0 22px rgba(255, 0, 255, 0.12);
}

.site-header .header-chat-icon {
  flex-shrink: 0;
  opacity: 0.9;
}

.site-header .header-discord-btn {
  display: inline-flex !important;
  visibility: visible !important;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.48rem 0.95rem;
  min-height: 40px;
  border-radius: var(--header-radius);
  background: linear-gradient(135deg, #5865f2 0%, #4752c4 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff !important;
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 14px rgba(88, 101, 242, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.site-header .header-discord-btn:hover {
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.5);
  filter: brightness(1.06);
}

.site-header .header-search-box {
  display: flex !important;
  visibility: visible !important;
  align-items: center;
  flex-shrink: 0;
  max-width: min(280px, 28vw);
}

.site-header .header-search-btn {
  display: flex !important;
  visibility: visible !important;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-width: min(200px, 22vw);
  max-width: 280px;
  min-height: 40px;
  padding: 0.45rem 0.5rem 0.45rem 0.85rem;
  border-radius: var(--header-radius);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8125rem;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.site-header .header-search-btn:hover,
.site-header .header-search-btn:focus-visible {
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(0, 255, 255, 0.35);
  box-shadow:
    0 0 0 1px rgba(255, 0, 255, 0.1),
    0 0 28px rgba(0, 255, 255, 0.08);
  outline: none;
}

.site-header .header-search-icon {
  color: rgba(0, 255, 255, 0.75);
  opacity: 1;
  flex-shrink: 0;
}

.site-header .header-search-text {
  flex: 1;
  text-align: left;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-header .header-search-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: 0.15rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--header-accent), #b800b8);
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(255, 0, 255, 0.35);
}

/* ── Mobile menu button ── */
.site-header .mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.site-header .mobile-menu-btn:hover {
  background: rgba(255, 0, 255, 0.1);
  border-color: rgba(255, 0, 255, 0.25);
}

.site-header .mobile-menu-btn span {
  background: linear-gradient(90deg, #fff, rgba(0, 255, 255, 0.9));
}

/* ── Tablet / mobile ── */
@media (max-width: 900px) {
  .site-header .nav-links-container {
    display: none !important;
  }

  /* Override legacy styles.css navbar height (56px) vs bar (60px) — caused menu btn to sit high */
  header.navbar.navbar-new.site-header,
  .navbar.navbar-new.site-header {
    display: block !important;
    height: var(--site-header-h) !important;
    max-height: var(--site-header-h) !important;
    min-height: var(--site-header-h) !important;
    padding: 0 !important;
    gap: 0 !important;
  }

  .site-header .site-header-bar {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    grid-template-areas: "menu logo actions";
    align-items: center;
    height: var(--site-header-h);
    min-height: var(--site-header-h);
    column-gap: 0.4rem;
    padding-left: max(0.65rem, env(safe-area-inset-left));
    padding-right: max(0.65rem, env(safe-area-inset-right));
  }

  .site-header .mobile-menu-btn {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: stretch !important;
    grid-area: menu;
    justify-self: start;
    align-self: center;
    order: unset !important;
    margin: 0 !important;
    position: relative !important;
    top: auto !important;
    transform: none !important;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 9px;
    border-radius: 10px;
    box-sizing: border-box;
    overflow: visible;
  }

  .site-header .mobile-menu-btn span {
    display: block !important;
    width: 100%;
    min-width: 18px;
    height: 2px;
    min-height: 2px;
    flex-shrink: 0;
    border-radius: 2px;
    background: #fff !important;
    opacity: 1 !important;
  }

  .site-header.navbar.navbar-new .logo {
    grid-area: logo;
    flex: none !important;
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    margin: 0 !important;
    height: auto !important;
    justify-self: center;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    pointer-events: auto;
    z-index: 1;
    order: unset !important;
  }

  .site-header .logo a {
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    line-height: 0;
  }

  .site-header .logo-image {
    height: 32px;
    width: auto;
    max-width: min(128px, 38vw);
    object-fit: contain;
    object-position: center;
    transform: none !important;
  }

  .site-header .logo:hover .logo-image {
    transform: none !important;
    filter: drop-shadow(0 0 12px rgba(255, 0, 255, 0.35));
  }

  .site-header .header-actions {
    grid-area: actions;
    order: unset;
    margin-left: 0 !important;
    justify-self: end;
    align-self: center;
    gap: 0.3rem;
    padding-left: 0;
  }

  .site-header .header-discord-text,
  .site-header .header-chat-text {
    display: none;
  }

  .site-header .header-chat-btn {
    min-width: 42px;
    width: 42px;
    padding: 0;
  }

  .site-header .header-discord-btn {
    padding: 0 !important;
    min-width: 42px;
    width: 42px;
    min-height: 42px;
  }

  .site-header .header-search-box {
    max-width: none;
    width: 42px;
  }

  .site-header .header-search-btn {
    min-width: 42px;
    width: 42px;
    max-width: 42px;
    padding: 0;
    justify-content: center;
  }

  .site-header .header-search-text,
  .site-header .header-search-arrow {
    display: none !important;
  }

  .site-header .header-search-icon {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 768px) {
  main,
  .hero-section,
  .sports-page-new,
  .watch-section,
  body > section:first-of-type {
    padding-top: calc(var(--site-header-h) + 6px);
  }
}

/* Signed-in: tighter nav + search so actions fit without clipping */
@media (max-width: 1580px) {
  .site-header--signed-in .nav-item-hide-lg {
    display: none !important;
  }

  .site-header--signed-in .header-search-btn {
    min-width: min(168px, 20vw);
  }

  .site-header--signed-in .header-search-text {
    font-size: 0.75rem;
  }
}

@media (max-width: 1380px) {
  .site-header--signed-in .nav-item-hide-md {
    display: none !important;
  }

  .site-header--signed-in .nav-item--auth .nav-text {
    display: none;
  }

  .site-header--signed-in .nav-item--auth {
    padding: 0.42rem 0.55rem;
  }
}

/* Progressive hide — keeps one row when signed in (extra Dashboard / Leaderboard) */
@media (max-width: 1480px) {
  .site-header:not(.site-header--signed-in) .nav-item-hide-lg {
    display: none !important;
  }
}

@media (max-width: 1320px) {
  .site-header:not(.site-header--signed-in) .nav-item-hide-md {
    display: none !important;
  }

  .site-header .nav-item {
    padding: 0.4rem 0.58rem;
    font-size: 0.78rem;
  }

  .site-header .nav-item .nav-svg-icon {
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 1180px) {
  .site-header .nav-item-hide-sm {
    display: none !important;
  }

  .site-header .nav-item--auth .nav-text {
    display: none;
  }

  .site-header .nav-item--auth {
    padding: 0.42rem 0.55rem;
  }

  .site-header .nav-item--auth .nav-svg-icon {
    margin: 0;
  }
}

/* Hide nav items that already hide on smaller desktops */
@media (max-width: 1200px) {
  .site-header .nav-item-hide-mobile {
    display: none;
  }
}

@media (max-width: 380px) {
  .site-header .header-chat-btn {
    display: none !important;
  }

  .site-header .logo-image {
    max-width: 108px;
    height: 30px;
  }

  .site-header .header-discord-btn,
  .site-header .header-search-btn {
    min-width: 38px !important;
    width: 38px !important;
    height: 38px !important;
  }
}

/* ── Mobile drawer (overrides styles.css) ── */
.site-header .mobile-menu {
  width: min(100%, 360px);
  max-width: 100%;
  background: linear-gradient(180deg, #0c0c12 0%, #08080e 100%) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 12px 0 48px rgba(0, 0, 0, 0.55);
}

.site-header .mobile-menu.active {
  visibility: visible !important;
}

.site-header .mobile-menu-header {
  display: grid !important;
  grid-template-columns: 1fr 44px;
  align-items: center;
  gap: 0.5rem;
  padding: max(12px, env(safe-area-inset-top)) 14px 12px;
  min-height: 56px;
  height: auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 16, 0.98) !important;
}

.site-header .mobile-menu-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-height: 44px;
  padding: 4px 0;
}

.site-header .mobile-menu-brand .logo-image {
  height: 36px !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 160px;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(255, 0, 255, 0.25));
}

.site-header .mobile-menu-close {
  justify-self: end;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.site-header .mobile-menu-close:hover {
  background: rgba(255, 0, 255, 0.12);
  border-color: rgba(255, 0, 255, 0.35);
}

.site-header .mobile-menu-quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 12px 14px 4px;
  flex-shrink: 0;
}

.site-header .mobile-quick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.site-header .mobile-quick-btn--search {
  color: rgba(0, 255, 255, 0.95);
  border-color: rgba(0, 255, 255, 0.25);
}

.site-header .mobile-quick-btn--search:hover {
  background: rgba(0, 255, 255, 0.1);
}

.site-header .mobile-quick-btn--discord {
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.35), rgba(71, 82, 196, 0.25));
  border-color: rgba(88, 101, 242, 0.45);
  color: #fff;
}

.site-header .mobile-menu-section-label {
  margin: 0;
  padding: 0.65rem 18px 0.35rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}

.site-header .mobile-nav {
  display: flex !important;
  flex-direction: column;
  gap: 6px;
  padding: 6px 12px 16px !important;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: transparent !important;
}

.site-header .mobile-nav-item {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 12px 14px !important;
  margin: 0;
  font-size: 0.9375rem !important;
  font-weight: 600;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  color: rgba(255, 255, 255, 0.9) !important;
}

.site-header .mobile-nav-item.active {
  background: linear-gradient(
    135deg,
    rgba(255, 0, 255, 0.18) 0%,
    rgba(0, 255, 255, 0.08) 100%
  ) !important;
  border-color: rgba(255, 0, 255, 0.35) !important;
  color: #fff !important;
}

.site-header .mobile-nav-item .mobile-nav-icon {
  width: 22px;
  height: 22px;
  opacity: 0.85;
}

.site-header .mobile-menu-mirror-banner {
  margin: 8px 12px max(16px, env(safe-area-inset-bottom)) !important;
}
