/**
 * Desktop hub navigation + responsive hub page layout.
 * Mobile uses the liquid glass tab bar (tab-bar.css).
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Merriweather:wght@700;900&display=swap');

.hub-page-main {
  width: 100%;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
  padding-top: 1.5rem;
}

.hub-mobile-only {
  display: block;
}

.hub-page-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.rank-gold {
  background: linear-gradient(135deg, var(--dg-gold, #D4A650), var(--dg-gold-light, #E5C37E));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--dg-gold-light, #E5C37E);
}

.hub-page-header svg.hub-mobile-header-icon {
  color: var(--dg-gold-light, #E5C37E);
}

.hub-mobile-header-icon {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border-radius: 0.75rem;
  object-fit: cover;
}

.hub-mobile-header-icon--pwa {
  border-radius: 11px;
  box-shadow:
    0 0 0 0.5px rgba(255, 255, 255, 0.12),
    0 4px 14px rgba(212, 166, 80, 0.3);
}

.hub-mobile-header-icon--medals {
  color: var(--dg-gold-light, #E5C37E);
}

.hub-mobile-header-icon--profile {
  color: var(--dg-gold-light, #E5C37E);
}

.hub-desktop-only {
  display: none;
}

.hub-desktop-hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.hub-desktop-hero__title {
  font-family: 'Merriweather', serif;
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 900;
  margin: 0;
  line-height: 1.1;
}

.hub-gold-gradient {
  background: linear-gradient(135deg, #D4A650, #E5C37E);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hub-medals-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dg-hub-nav {
  display: none;
}

/* Never inherit page-local .glass bar styling onto the hub nav */
#dg-hub-nav {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  box-shadow: none;
}

@media (min-width: 900px) {
  .dg-hub-nav {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  /* Home-page fonts: all hub pages + in-game desktop */
  body.dg-hub-site-fonts .dg-hub-nav,
  body.dg-hub-site-fonts .desktop-only,
  body.dg-hub-site-fonts .hub-page-main,
  body.dg-hub-site-fonts main.flex-grow {
    font-family: 'Inter', sans-serif;
  }

  body.dg-hub-site-fonts .desktop-only h1,
  body.dg-hub-site-fonts .desktop-only h2,
  body.dg-hub-site-fonts .desktop-only h3,
  body.dg-hub-site-fonts .hub-page-main h1,
  body.dg-hub-site-fonts .hub-page-main h2,
  body.dg-hub-site-fonts .hub-page-main h3,
  body.dg-hub-site-fonts .hub-desktop-hero__title,
  body.dg-hub-site-fonts main.flex-grow h1,
  body.dg-hub-site-fonts main.flex-grow h2 {
    font-family: 'Merriweather', serif;
  }

  body.dg-hub-site-fonts .dg-hub-nav__title {
    font-family: 'Inter', sans-serif;
  }

  .dg-hub-nav__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease;
  }

  .dg-hub-nav__brand:hover {
    transform: scale(1.03);
  }

  .dg-hub-nav__logo {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    object-fit: cover;
  }

  .dg-hub-nav__logo--game {
    border-radius: 0.5rem;
    box-shadow: none;
  }

  .dg-hub-nav__title {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
  }

  .dg-hub-nav__links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
  }

  .dg-hub-nav__links a {
    color: #f8fafc;
    text-decoration: none;
    transition: color 0.2s ease;
  }

  .dg-hub-nav__links a:hover {
    color: #f59e0b;
  }

  .dg-hub-nav__links a.is-active {
    color: #f59e0b;
    font-weight: 700;
  }

  .hub-page-header {
    display: none !important;
  }

  .hub-desktop-hero {
    margin-bottom: 2.5rem;
  }

  .hub-mobile-only {
    display: none !important;
  }

  .hub-desktop-only {
    display: block;
  }

  .hub-page-main {
    max-width: 72rem;
    padding: 4.5rem 1.5rem 3rem;
  }

  .hub-medals-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
  }

  .hub-profile-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
  }

  .hub-profile-layout .hub-profile-span-full {
    grid-column: 1 / -1;
  }

  body.dg-hub-nav-page .desktop-only > main,
  body.dg-hub-nav-page .hub-page-main {
    padding-top: 5rem;
  }

  body.dg-hub-nav-page main.flex-grow {
    padding-top: 5rem;
  }
}

@media (min-width: 1200px) {
  .hub-medals-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ─── Skip link (keyboard / screen reader) ─────────────────────────── */
.dg-skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 1000;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.dg-skip-link:focus {
  position: fixed;
  left: 1rem;
  top: calc(env(safe-area-inset-top, 0px) + 1rem);
  width: auto;
  height: auto;
  overflow: visible;
}

@media (min-width: 900px) {
  .dg-skip-link:focus {
    top: calc(env(safe-area-inset-top, 0px) + 4.5rem);
  }
}

.dg-hub-nav__links a:focus-visible {
  outline: 2px solid rgb(245 158 11);
  outline-offset: 3px;
  border-radius: 6px;
}

.dg-hub-nav__brand:focus-visible {
  outline: 2px solid rgb(245 158 11);
  outline-offset: 4px;
  border-radius: 10px;
}

#main-content:focus {
  outline: none;
}
