/* ===== AUTH + HEADER ACCOUNT ===== */

.header-inner {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
}

.header-actions {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 5;
}

/* Hide old absolute socials in header to avoid overlap */
.header .socials { display: none !important; }

.btn-login {
  background: #fff;
  color: #000;
  border: none;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 10px 20px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
  white-space: nowrap;
}
.btn-login:hover {
  background: #f0f0f0;
  box-shadow: 0 0 24px rgba(255,255,255,0.2);
  transform: translateY(-1px);
}

/* Account / credits — only when logged in */
.account-box { display: none; position: relative; }
body.is-logged-in .account-box { display: block; }
body.is-logged-in .header-actions > .btn-login { display: none !important; }
body:not(.is-logged-in) .header-actions > .btn-login { display: inline-block !important; }

/* Shop nav only when logged in */
.nav-shop { display: none !important; }
body.is-logged-in .nav-shop { display: inline-block !important; }

.account-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
  font-family: inherit;
  color: #fff;
}
.account-trigger:hover,
.account-box.open .account-trigger {
  border-color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.07);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 8px 28px rgba(0,0,0,0.35);
}
.account-credits-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.4);
  display: block;
  text-align: left;
}
.account-credits-value {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}
.account-arrow {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  transition: transform 0.25s ease;
}
.account-box.open .account-arrow { transform: rotate(180deg); }

.account-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 230px;
  background: #121212;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  box-shadow: 0 20px 50px rgba(0,0,0,0.55);
  overflow: hidden;
}
.account-box.open .account-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.account-dropdown a,
.account-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 14px 18px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: background 0.15s;
}
.account-dropdown a:hover,
.account-dropdown button:hover { background: rgba(255,255,255,0.06); }
.account-dropdown a:last-child,
.account-dropdown button:last-child { border-bottom: none; }
.account-dropdown .logout-btn { color: rgba(255,255,255,0.45); }

/* ===== LOGIN OVERLAY ===== */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  pointer-events: none;
}
.login-overlay.open {
  visibility: visible;
  pointer-events: auto;
}
.login-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 30%, rgba(255,255,255,0.06), transparent 55%),
    radial-gradient(ellipse 70% 50% at 80% 70%, rgba(255,255,255,0.04), transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(255,255,255,0.03), transparent 45%),
    #070707;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.login-backdrop::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 50%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 50%, #000 20%, transparent 75%);
}
.login-overlay.open .login-backdrop { opacity: 1; }

.login-panel {
  position: relative;
  z-index: 2;
  width: min(400px, calc(100% - 32px));
  background: rgba(18, 18, 18, 0.92);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  padding: 44px 36px 32px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform: translateY(20px) scale(0.98);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.22,1,0.36,1), opacity 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  box-shadow: 0 24px 64px rgba(0,0,0,0.55);
}
.login-overlay.open .login-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.login-panel:hover {
  border-color: rgba(255,255,255,0.22);
  box-shadow:
    0 24px 64px rgba(0,0,0,0.55),
    0 0 0 1px rgba(255,255,255,0.06),
    0 0 40px rgba(255,255,255,0.04);
}

.login-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: rgba(255,255,255,0.45);
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
  padding: 8px 10px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.login-close:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.25);
}

.login-logo { text-align: center; margin-bottom: 18px; }
.login-logo img { height: 44px; width: auto; }
.login-panel h2 {
  text-align: center;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.6px;
  margin-bottom: 22px;
  color: #fff;
}
.login-info {
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 24px;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255,255,255,0.5);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.login-info:hover {
  border-color: rgba(255,255,255,0.28);
  box-shadow: 0 0 24px rgba(255,255,255,0.04);
}
.login-info strong {
  display: block;
  color: #fff;
  font-size: 13px;
  margin-bottom: 4px;
}

.btn-discord {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  color: #000;
  border: none;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.2px;
  padding: 15px 18px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, box-shadow 0.25s, transform 0.15s;
}
.btn-discord:hover {
  background: #f2f2f2;
  box-shadow: 0 0 32px rgba(255,255,255,0.18);
  transform: translateY(-1px);
}
.btn-discord svg { width: 20px; height: 20px; flex-shrink: 0; }

.login-terms {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 11px;
  line-height: 1.55;
  color: rgba(255,255,255,0.35);
  text-align: center;
}
.login-terms a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Gate pages */
.auth-gate {
  margin-left: var(--sidebar-width);
  min-height: 55vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  position: relative;
  background:
    radial-gradient(ellipse 70% 50% at 30% 40%, rgba(255,255,255,0.05), transparent 55%),
    radial-gradient(ellipse 60% 40% at 75% 65%, rgba(255,255,255,0.03), transparent 50%),
    #080808;
}
.auth-gate::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}
.auth-gate-box {
  position: relative;
  z-index: 1;
  max-width: 420px;
  width: 100%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(16,16,16,0.9);
  border-radius: 24px;
  padding: 44px 36px;
  text-align: center;
  backdrop-filter: blur(16px);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.auth-gate-box:hover {
  border-color: rgba(255,255,255,0.28);
  box-shadow: 0 0 40px rgba(255,255,255,0.05), 0 20px 50px rgba(0,0,0,0.4);
}
.auth-gate-box h2 {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 12px;
  letter-spacing: -0.4px;
}
.auth-gate-box p {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  line-height: 1.65;
  margin-bottom: 26px;
}
/* Gate box login button always visible inside gate */
.auth-gate-box .btn-login {
  display: inline-block !important;
}

body:not(.is-logged-in) .requires-auth { display: none !important; }
body.is-logged-in .auth-gate { display: none !important; }

@media (max-width: 900px) {
  .header-actions { right: 16px; }
  .btn-login { padding: 8px 14px; font-size: 11px; }
  .account-credits-label { display: none; }
  .login-panel { padding: 36px 24px 28px; border-radius: 20px; }
}
