/* ===================================================================
   DISCORD AUTHENTICATION & PROFILE SYSTEM
   Aesthetic 1:1 Discord / Novels-Reader Top-Right Profile Architecture
   =================================================================== */

/* Top Right Fixed Navigation Mount */
.nr-auth-top-mount {
  position: fixed;
  top: 1.25rem;
  right: 1.5rem;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .nr-auth-top-mount {
    top: 0.85rem;
    right: 0.85rem;
  }
}

body.reader-page .nr-auth-top-mount {
  display: none !important;
}

/* 1. Sign In Button (Logged Out) */
.discord-signin-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border-radius: 9999px;
  background: rgba(88, 101, 242, 0.14);
  border: 1px solid rgba(88, 101, 242, 0.35);
  color: #f4f4f5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.discord-signin-btn svg {
  width: 17px;
  height: 17px;
  fill: #5865F2;
  transition: fill 0.2s ease, transform 0.2s ease;
}

.discord-signin-btn:hover {
  background: #5865F2;
  border-color: #5865F2;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.45);
}

.discord-signin-btn:hover svg {
  fill: #ffffff;
  transform: scale(1.08);
}

.discord-signin-btn:active {
  transform: scale(0.96);
}

/* 2. User Avatar Trigger (Logged In) */
.discord-profile-wrapper {
  position: relative;
  display: inline-block;
}

.discord-profile-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  outline: none;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.discord-profile-trigger:hover {
  transform: scale(1.06);
}

.discord-profile-trigger:active {
  transform: scale(0.94);
}

.discord-profile-trigger:focus-visible {
  ring: 2px solid #5865F2;
}

.discord-trigger-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: #1e1f22;
  border: 2px solid rgba(88, 101, 242, 0.45);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s ease;
}

.discord-profile-trigger:hover .discord-trigger-avatar {
  border-color: #5865F2;
}

.discord-status-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #23a55a;
  border: 2px solid #07070a;
  box-shadow: 0 0 6px rgba(35, 165, 90, 0.6);
}

/* 3. Discord Dropdown Menu */
.discord-dropdown-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: transparent;
}

.discord-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 310px;
  max-width: calc(100vw - 2rem);
  background: #111214;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  z-index: 1001;
  transform-origin: top right;
  animation: discordDropdownIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #dbdee1;
}

@keyframes discordDropdownIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Banner */
.discord-banner-area {
  height: 115px;
  width: 100%;
  position: relative;
  background-color: #1e1f22;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.discord-banner-fallback {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.45) 0%, rgba(71, 82, 196, 0.3) 50%, #1e1f22 100%);
}

.discord-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 0%, rgba(17, 18, 20, 0.75) 100%);
  pointer-events: none;
}

/* Profile Card Body */
.discord-body-area {
  padding: 0 16px 16px 16px;
  background: #111214;
  position: relative;
}

.discord-avatar-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: -36px;
  margin-bottom: 10px;
}

.discord-large-avatar-box {
  position: relative;
  display: inline-block;
  border-radius: 50%;
  border: 4px solid #111214;
  background: #111214;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.discord-large-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #1e1f22;
}

.discord-large-status-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #23a55a;
  border: 3px solid #111214;
}

.discord-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(88, 101, 242, 0.16);
  border: 1px solid rgba(88, 101, 242, 0.35);
  color: #a5b4fc;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.discord-info-box {
  margin-bottom: 8px;
}

.discord-display-name {
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.discord-username {
  color: #949ba4;
  font-size: 0.82rem;
  font-weight: 500;
  margin-top: 2px;
  font-family: monospace;
}

.discord-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 10px 0;
}

/* Dropdown Menu Actions */
.discord-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.discord-menu-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  border-radius: 12px;
  background: transparent;
  border: none;
  color: #dbdee1;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.14s ease;
  outline: none;
}

.discord-menu-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.discord-menu-btn:active {
  transform: scale(0.98);
}

.discord-menu-btn-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.discord-menu-btn-left svg {
  width: 16px;
  height: 16px;
  color: #949ba4;
  transition: color 0.14s ease;
}

.discord-menu-btn:hover .discord-menu-btn-left svg {
  color: #ffffff;
}

.discord-logout-btn {
  color: #f23f43 !important;
}

.discord-logout-btn svg {
  color: #f23f43 !important;
}

.discord-logout-btn:hover {
  background: #da373c !important;
  color: #ffffff !important;
}

.discord-logout-btn:hover svg {
  color: #ffffff !important;
}

/* 4. Localhost / File Notice Modal */
.discord-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: discordFadeIn 0.2s ease forwards;
}

@keyframes discordFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.discord-modal-box {
  width: 100%;
  max-width: 420px;
  background: #111214;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 1.75rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  text-align: center;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.discord-modal-box h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
}

.discord-modal-box p {
  font-size: 0.88rem;
  color: #949ba4;
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.discord-modal-code {
  display: block;
  background: #1e1f22;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.65rem 1rem;
  border-radius: 12px;
  font-family: monospace;
  font-size: 0.85rem;
  color: #a5b4fc;
  margin-bottom: 1.25rem;
}

.discord-modal-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  background: #5865F2;
  border: none;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.discord-modal-btn:hover {
  background: #4752c4;
}

/* ===================================================================
   5. FULL-SCREEN DISCORD GATEKEEPER OVERLAY (EXACT 1:1 NOVELS-READER)
   Blocks the entire site and library until verified via Discord
   =================================================================== */

.discord-gatekeeper-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  background: #000000;
}

.nr-gk-backdrop-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.nr-gk-backdrop-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.05);
  filter: blur(10px) brightness(0.78) contrast(1.02);
}

.nr-gk-backdrop-dim {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.25);
}

.nr-gk-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 400px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.5rem;
  padding: 2rem 1.75rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  animation: nrGkIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes nrGkIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.nr-gk-logo-wrap {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.nr-gk-logo-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.nr-gk-logo-svg {
  width: 2.75rem;
  height: 2.75rem;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.35));
}

.nr-gk-logo-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.nr-gk-subtitle {
  font-size: 13px;
  color: #d4d4d8;
  font-weight: 400;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  text-align: center;
  max-width: 20rem;
}

.nr-gk-login-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  background: #5865F2;
  color: #ffffff;
  font-weight: 500;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  box-shadow: 0 4px 20px rgba(88, 101, 242, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  border: none;
  outline: none;
  text-decoration: none;
}

.nr-gk-login-btn:hover {
  background: #4752c4;
  box-shadow: 0 6px 25px rgba(88, 101, 242, 0.5);
  transform: translateY(-1px);
}

.nr-gk-login-btn:active {
  transform: scale(0.98);
}

.nr-gk-login-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

.nr-gk-join-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #d4d4d8;
  font-weight: 500;
  padding: 0.625rem 1rem;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  font-size: 0.75rem;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  text-decoration: none;
}

.nr-gk-join-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.nr-gk-join-btn:active {
  background: rgba(255, 255, 255, 0.12);
}

.nr-gk-join-btn svg {
  width: 0.875rem;
  height: 0.875rem;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.nr-gk-join-btn:hover svg {
  opacity: 1;
}


