.site-shell-ready header,
.site-shell-ready footer {
  visibility: visible;
}

html:not(.site-shell-ready) header {
  min-height: 64px;
  max-height: 64px;
  overflow: hidden;
  visibility: hidden;
}

html:not(.site-shell-ready) footer {
  visibility: hidden;
}

.site-header {
  width: 100%;
  min-height: 64px;
  box-sizing: border-box;
  padding: 10px clamp(14px, 3vw, 32px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  position: relative;
  z-index: 100;
  color: #fff;
  background: rgba(8, 14, 29, 0.94);
  border-bottom: 1px solid rgba(79, 195, 247, 0.35);
  box-shadow: 0 0 14px rgba(79, 195, 247, 0.55);
  backdrop-filter: blur(12px);
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #82e9ff;
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  justify-self: start;
}

.site-brand:hover,
.site-brand:focus-visible {
  color: #fff;
}

.site-brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  justify-self: center;
}

.site-nav a {
  margin: 0;
  padding: 8px 10px;
  border-radius: 7px;
  color: #dcecff;
  font-size: 0.88rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  color: #82e9ff;
  background: rgba(79, 195, 247, 0.13);
  outline: none;
}

.site-account,
.site-auth-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  justify-self: end;
}

.site-account {
  min-width: max-content;
}

#username-display {
  max-width: 180px;
  overflow: hidden;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-auth-links a,
#logout-btn.site-logout {
  margin: 0;
  padding: 7px 11px;
  border: 1px solid rgba(79, 195, 247, 0.55);
  border-radius: 7px;
  color: #dff7ff;
  background: transparent;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.site-auth-links .site-signup,
#logout-btn.site-logout {
  color: #06111b;
  background: #4fc3f7;
}

.site-auth-links a:hover,
.site-auth-links a:focus-visible,
#logout-btn.site-logout:hover,
#logout-btn.site-logout:focus-visible {
  color: #06111b;
  background: #82e9ff;
  outline: none;
}

.membership-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.035em;
  line-height: 1;
  white-space: nowrap;
}

.membership-badge[hidden],
#userBadge {
  display: none;
}

html[data-site-theme="midnight"] body {
  background: #010205;
}

html[data-site-theme="midnight"] .stars {
  background-color: #010205;
  filter: grayscale(0.7) brightness(0.7);
}

html[data-site-theme="midnight"] .twinkling {
  opacity: 0.28;
}

html[data-site-theme="midnight"] .site-header,
html[data-site-theme="midnight"] .site-footer {
  background: rgba(2, 5, 12, 0.97);
  border-color: rgba(148, 163, 184, 0.3);
  box-shadow: 0 0 14px rgba(71, 85, 105, 0.55);
}

html[data-site-theme="nebula"] body {
  background: #12051f;
}

html[data-site-theme="nebula"] .stars {
  background-color: #12051f;
  filter: hue-rotate(58deg) saturate(1.35);
}

html[data-site-theme="nebula"] .twinkling {
  filter: hue-rotate(55deg);
  opacity: 0.52;
}

html[data-site-theme="nebula"] .site-header,
html[data-site-theme="nebula"] .site-footer {
  background: linear-gradient(90deg, rgba(40, 11, 66, 0.97), rgba(12, 8, 30, 0.97));
  border-color: rgba(192, 132, 252, 0.4);
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.5);
}

html[data-site-theme="nebula"] .site-brand,
html[data-site-theme="nebula"] .site-nav a:hover,
html[data-site-theme="nebula"] .site-nav a:focus-visible,
html[data-site-theme="nebula"] .site-nav a[aria-current="page"],
html[data-site-theme="nebula"] .site-footer a {
  color: #e9d5ff;
}

html[data-site-theme="nebula"] .site-nav a:hover,
html[data-site-theme="nebula"] .site-nav a:focus-visible,
html[data-site-theme="nebula"] .site-nav a[aria-current="page"] {
  background: rgba(168, 85, 247, 0.16);
}

body[data-membership-tier="rock"] .site-header {
  background: linear-gradient(90deg, rgba(35, 41, 52, 0.97), rgba(8, 14, 29, 0.94));
  box-shadow: 0 0 16px rgba(148, 163, 184, 0.82);
}

body[data-membership-tier="rock"] .membership-badge {
  color: #e2e8f0;
  background: rgba(100, 116, 139, 0.3);
}

body[data-membership-tier="stick"] .site-header {
  background: linear-gradient(90deg, rgba(70, 42, 16, 0.97), rgba(8, 14, 29, 0.94));
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.82);
}

body[data-membership-tier="stick"] .membership-badge {
  color: #fde68a;
  background: rgba(146, 64, 14, 0.5);
}

body[data-membership-tier="tree"] .site-header {
  background: linear-gradient(90deg, rgba(6, 60, 44, 0.97), rgba(8, 14, 29, 0.94));
  box-shadow: 0 0 22px rgba(52, 211, 153, 0.82);
}

body[data-membership-tier="tree"] .membership-badge {
  color: #a7f3d0;
  background: rgba(4, 120, 87, 0.52);
}

.site-footer {
  width: 100%;
  box-sizing: border-box;
  margin-top: auto;
  padding: 20px clamp(14px, 3vw, 32px);
  position: relative;
  z-index: 50;
  color: #b9cbe0;
  background: rgba(8, 14, 29, 0.94);
  border-top: 1px solid rgba(79, 195, 247, 0.28);
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.82rem;
}

.site-footer .site-legal-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
}

.site-footer a {
  color: #82e9ff;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: #fff;
  text-decoration: underline;
}

@media (max-width: 1200px) {
  html:not(.site-shell-ready) header {
    min-height: 104px;
    max-height: 104px;
  }

  .site-header {
    grid-template-columns: auto 1fr;
    gap: 8px 14px;
  }

  .site-account,
  .site-auth-links {
    grid-column: 2;
    grid-row: 1;
  }

  .site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 2px 0;
    scrollbar-width: thin;
  }
}

@media (max-width: 560px) {
  .site-header {
    padding: 9px 10px;
  }

  .site-brand span {
    display: none;
  }

  .site-brand img {
    width: 32px;
    height: 32px;
  }

  .site-account {
    min-width: 0;
  }

  #username-display {
    max-width: 92px;
    min-width: 48px;
  }

  .membership-badge {
    max-width: 105px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .site-nav a {
    padding: 7px 8px;
    font-size: 0.8rem;
  }
}
