/* Shared site header — matches /create-character internal-topbar */
.internal-topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  padding: 10px max(18px, calc((100vw - 1120px) / 2));
  background: rgba(255, 247, 232, 0.92);
  border-bottom: 1px solid rgba(98, 71, 43, 0.2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.internal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #db2b7d;
  font-family: Fredoka, ui-sans-serif, system-ui, sans-serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.internal-brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex: 0 0 auto;
}

.internal-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: Fredoka, ui-sans-serif, system-ui, sans-serif;
}

.internal-link {
  display: none;
  color: #6d5b52;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.internal-link:hover,
.internal-link.is-active {
  color: #9f1c59;
}

.internal-link.is-active {
  font-weight: 700;
}

.internal-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(219, 43, 125, 0.28);
  border-radius: 8px;
  color: #9f1c59;
  background: #fff7fb;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
}

.internal-cta:hover {
  background: #fde7f1;
}

.site-auth {
  display: none;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
}

.site-auth.is-ready {
  display: inline-flex;
}

.auth-login-btn {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  display: inline-flex !important;
  color: #6d5b52;
  font-size: 14px;
  font-weight: 600;
}

.auth-login-btn:hover {
  color: #9f1c59;
}

.auth-muted {
  color: #6d5b52;
  font-size: 13px;
  font-weight: 600;
}

.auth-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.auth-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid rgba(219, 43, 125, 0.25);
}

.auth-avatar--fallback {
  display: inline-block;
  background: linear-gradient(135deg, #f9a8d4, #db2b7d);
}

.auth-logout {
  display: inline-flex !important;
}

body.auth-modal-open {
  overflow: hidden;
}

.auth-modal[hidden] {
  display: none !important;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(32, 20, 14, 0.55);
  backdrop-filter: blur(4px);
}

.auth-modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 400px);
  padding: 28px 24px 24px;
  border-radius: 16px;
  background: #fffaf3;
  border: 1px solid rgba(98, 71, 43, 0.16);
  box-shadow: 0 24px 60px rgba(40, 20, 10, 0.28);
  font-family: Fredoka, ui-sans-serif, system-ui, sans-serif;
}

.auth-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: #6d5b52;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.auth-modal__panel h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  color: #db2b7d;
}

.auth-modal__sub {
  margin: 0 0 20px;
  color: #6d5b52;
  font-size: 0.95rem;
  line-height: 1.45;
}

.auth-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-provider-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
}

.auth-provider-btn__icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.auth-provider-btn--google {
  background: #fff;
  color: #3c4043;
  border-color: rgba(60, 64, 67, 0.22);
}

.auth-provider-btn--google:hover {
  background: #f8f9fa;
}

.auth-provider-btn--facebook {
  background: #1877f2;
  color: #fff;
}

.auth-provider-btn--facebook:hover {
  filter: brightness(1.05);
}

.auth-modal__hint {
  margin: 14px 0 0;
  color: #6d5b52;
  font-size: 0.85rem;
}

@media (min-width: 760px) {
  .internal-link {
    display: inline-flex;
  }

  .site-auth {
    display: none;
  }

  .site-auth.is-ready {
    display: inline-flex;
  }
}

@media (max-width: 759px) {
  .site-auth.is-ready {
    display: inline-flex;
  }
}
