/**
 * Nightbreak Account Manager - Frontend Styles
 * Dark theme matching nightbreak.io aesthetic
 */

/* CSS Custom Properties - matched to nightbreak.io theme */
:root {
  --nb-primary: #e03636;
  --nb-primary-hover: #ff4444;
  --nb-accent: #67c1f5;
  --nb-bg-dark: #1a1a2e;
  --nb-bg-card: #252731;
  --nb-bg-card-hover: #2d2f3a;
  --nb-text: #f5f5f5;
  --nb-text-muted: #b8b8b8;
  --nb-border: #3d3d5c;
  --nb-success: #4caf50;
  --nb-warning: #ff9800;
  --nb-danger: #e03636;
  --nb-patreon: #FF424D;
  --nb-itch: #FA5C5C;
  --nb-free: #4caf50;
  --nb-premium: #e03636;
  --nb-radius: 8px;
  --nb-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Account Page Container - pushed below fixed header */
.nightbreak-account-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px 60px;
  margin-top: 120px;
}

/* Page Header */
.nb-page-header {
  text-align: center;
  margin-bottom: 40px;
}

.nb-page-header h1 {
  color: var(--nb-text);
  font-size: 2.5em;
  margin: 0 0 12px 0;
}

.nb-page-header p {
  color: var(--nb-text-muted);
  font-size: 1.1em;
  margin: 0;
}

/* Base Styles */
.nb-login-prompt,
.nb-user-info,
.nb-content-category,
.nb-token-section {
  background: var(--nb-bg-card);
  border-radius: var(--nb-radius);
  padding: 24px;
  margin-bottom: 24px;
  color: var(--nb-text);
}

.nb-login-prompt h3,
.nb-user-info h4,
.nb-content-category h3,
.nb-token-section h3 {
  color: var(--nb-primary);
  margin-top: 0;
  margin-bottom: 16px;
}

/* Buttons */
.nb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--nb-radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.nb-btn-small {
  padding: 8px 16px;
  font-size: 13px;
}

.nb-btn-primary {
  background: var(--nb-primary);
  color: #fff;
}

.nb-btn-primary:hover {
  background: var(--nb-primary-hover);
  transform: translateY(-1px);
}

.nb-btn-outline {
  background: transparent;
  border: 1px solid var(--nb-border);
  color: var(--nb-text);
}

.nb-btn-outline:hover {
  border-color: var(--nb-primary);
  color: var(--nb-primary);
}

.nb-btn-danger {
  background: var(--nb-danger);
  color: #fff;
}

.nb-btn-danger:hover {
  background: #d32f2f;
}

.nb-btn-disabled {
  background: var(--nb-bg-dark);
  color: var(--nb-text-muted);
  cursor: not-allowed;
}

.nb-btn-patreon {
  background: var(--nb-patreon);
  color: #fff;
}

.nb-btn-patreon:hover {
  background: #e63946;
}

.nb-btn-itch {
  background: var(--nb-itch);
  color: #fff;
}

.nb-btn-itch:hover {
  background: #e04545;
}

.nb-btn-download {
  background: var(--nb-success);
  color: #fff;
}

.nb-btn-download:hover {
  background: #43a047;
}

/* Login Section */
.nb-login-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.nb-login-buttons .nb-btn {
  width: 100%;
  max-width: 300px;
}

/* User Info */
.nb-user-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--nb-border);
}

.nb-user-email {
  font-weight: 600;
  color: var(--nb-text);
}

.nb-linked-accounts {
  margin-top: 0;
}

.nb-accounts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--nb-border);
}

.nb-accounts-header h4 {
  margin: 0;
  color: var(--nb-primary);
}

.nb-account {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--nb-bg-dark);
  border-radius: var(--nb-radius);
  margin-bottom: 8px;
}

.nb-account-linked {
  border-left: 3px solid var(--nb-success);
}

.nb-account-name {
  flex: 1;
  font-weight: 500;
}

.nb-account-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Badges */
.nb-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.nb-badge-success {
  background: var(--nb-success);
  color: #fff;
}

.nb-badge-warning {
  background: var(--nb-warning);
  color: #000;
}

.nb-badge-premium {
  background: var(--nb-premium);
  color: #fff;
}

.nb-badge-free {
  background: var(--nb-free);
  color: #fff;
}

.nb-badge-admin {
  background: #9c27b0;
  color: #fff;
}

.nb-badge-subscribed {
  background: #2196f3;
  color: #fff;
}

.nb-tier {
  color: var(--nb-primary);
  font-weight: 600;
}

.nb-purchases {
  color: var(--nb-text-muted);
  font-size: 12px;
}

/* Content Grid */
.nb-content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.nb-content-card {
  background: var(--nb-bg-dark);
  border-radius: var(--nb-radius);
  padding: 20px;
  border: 1px solid var(--nb-border);
  transition: all 0.2s ease;
}

.nb-content-card:hover {
  border-color: var(--nb-primary);
  transform: translateY(-2px);
  box-shadow: var(--nb-shadow);
}

.nb-content-card.nb-has-access {
  border-left: 3px solid var(--nb-success);
}

.nb-content-card.nb-no-access {
  opacity: 0.8;
}

.nb-card-image {
  margin: -20px -20px 16px -20px;
  border-radius: var(--nb-radius) var(--nb-radius) 0 0;
  overflow: hidden;
}

.nb-card-image img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.nb-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.nb-card-header h4 {
  margin: 0;
  color: var(--nb-text);
  font-size: 16px;
}

.nb-card-desc {
  color: var(--nb-text-muted);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.nb-card-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--nb-text-muted);
}

.nb-version {
  color: var(--nb-primary);
}

.nb-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nb-access-hint {
  font-size: 11px;
  color: var(--nb-text-muted);
  text-align: center;
}

/* Token Section */
.nb-token-info {
  background: var(--nb-bg-dark);
  border-radius: var(--nb-radius);
  padding: 16px;
  margin: 16px 0;
}

.nb-token-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--nb-border);
}

.nb-token-row:last-child {
  border-bottom: none;
}

.nb-label {
  color: var(--nb-text-muted);
  min-width: 100px;
}

.nb-token-masked {
  font-family: monospace;
  background: var(--nb-bg-card);
  padding: 4px 8px;
  border-radius: 4px;
}

.nb-token-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

/* Modal */
/* Bricks-style Modal - matches "What's the difference?" modal */
.nb-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: nbFadeIn 0.2s ease-out;
}

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

.nb-modal.bricks-style {
  background: #52565e;
  border: 2px solid #ff5722;
  border-radius: 10px;
  max-width: 600px;
  width: 90%;
  position: relative;
  animation: nbSlideIn 0.3s ease-out;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

@keyframes nbSlideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.nb-modal.bricks-style .nb-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.nb-modal.bricks-style .nb-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nb-modal.bricks-style .nb-modal-close svg {
  width: 20px;
  height: 20px;
}

.nb-modal.bricks-style h3 {
  color: #ff5722;
  font-size: 24px;
  font-weight: 600;
  margin: 0;
  padding: 24px 32px 0 32px;
  font-family: "Plus Jakarta Sans", sans-serif;
}

.nb-modal-divider {
  height: 2px;
  background: linear-gradient(90deg, #ff5722 0%, transparent 100%);
  margin: 16px 32px;
}

.nb-modal.bricks-style .nb-modal-content {
  padding: 0 32px 24px 32px;
  color: #fff;
  line-height: 1.6;
}

.nb-modal.bricks-style .nb-modal-content p {
  margin: 0 0 12px 0;
  font-size: 15px;
}

.nb-modal.bricks-style .nb-modal-content p:last-child {
  margin-bottom: 0;
}

.nb-modal.bricks-style .nb-modal-content p.nb-modal-note {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nb-modal.bricks-style .nb-modal-content a.nb-platform-link {
  color: #ff5722;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.nb-modal.bricks-style .nb-modal-content a.nb-platform-link:hover {
  border-bottom-color: #ff5722;
}

.nb-modal.bricks-style .nb-modal-actions {
  padding: 0 32px 32px 32px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.nb-modal.bricks-style .nb-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  font-family: "Plus Jakarta Sans", sans-serif;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.nb-modal.bricks-style .nb-btn-primary {
  background: #ff5722;
  color: #fff;
}

.nb-modal.bricks-style .nb-btn-primary:hover {
  background: #ff6e40;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 87, 34, 0.4);
}

.nb-modal.bricks-style .nb-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nb-modal.bricks-style .nb-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.nb-warning {
  color: var(--nb-warning);
  font-weight: 600;
}

.nb-info {
  color: var(--nb-text-muted);
  font-size: 13px;
}

.nb-token-display {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--nb-bg-dark);
  padding: 16px;
  border-radius: var(--nb-radius);
  margin: 16px 0;
}

.nb-token-display code {
  flex: 1;
  font-family: monospace;
  font-size: 14px;
  word-break: break-all;
}

/* Toast Notifications */
.nb-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 16px 24px;
  border-radius: var(--nb-radius);
  color: #fff;
  font-weight: 500;
  z-index: 10001;
  animation: nb-slide-in 0.3s ease;
}

.nb-toast-error {
  background: var(--nb-danger);
}

.nb-toast-success {
  background: var(--nb-success);
}

@keyframes nb-slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Icons (using CSS shapes/unicode) */
.nb-icon-patreon::before {
  content: "P";
  display: inline-block;
  width: 20px;
  height: 20px;
  background: #fff;
  color: var(--nb-patreon);
  border-radius: 50%;
  text-align: center;
  line-height: 20px;
  font-weight: bold;
  font-size: 12px;
}

.nb-icon-itch::before {
  content: "i";
  display: inline-block;
  width: 20px;
  height: 20px;
  background: #fff;
  color: var(--nb-itch);
  border-radius: 4px;
  text-align: center;
  line-height: 20px;
  font-weight: bold;
  font-size: 14px;
}

.nb-icon-download::before {
  content: "↓";
  font-size: 16px;
}

.nb-icon-lock::before {
  content: "🔒";
  font-size: 14px;
}

/* Empty State */
.nb-empty {
  text-align: center;
  color: var(--nb-text-muted);
  padding: 40px;
}

/* Loading State */
.nb-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--nb-text-muted);
}

.nb-loading p {
  margin: 16px 0 0 0;
  font-size: 14px;
}

.nb-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--nb-border);
  border-top-color: var(--nb-primary);
  border-radius: 50%;
  animation: nb-spin 0.8s linear infinite;
}

@keyframes nb-spin {
  to { transform: rotate(360deg); }
}

/* Plugin Group Layout */
.nb-plugin-groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nb-plugin-group {
  background: var(--nb-bg-card);
  border-radius: var(--nb-radius);
  border: 1px solid var(--nb-border);
  overflow: hidden;
}

.nb-plugin-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  cursor: pointer;
  transition: background 0.2s ease;
  user-select: none;
}

.nb-plugin-header:hover {
  background: var(--nb-bg-card-hover);
}

.nb-plugin-expand {
  color: var(--nb-text-muted);
  font-size: 12px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.nb-plugin-group.expanded .nb-plugin-expand {
  transform: rotate(90deg);
}

.nb-plugin-name {
  font-weight: 600;
  color: var(--nb-text);
  font-size: 16px;
  flex: 1;
  min-width: 0;
}

.nb-plugin-summary {
  color: var(--nb-text-muted);
  font-size: 13px;
  white-space: nowrap;
}

.nb-plugin-summary-count {
  color: var(--nb-success);
  font-weight: 600;
}

.nb-plugin-goto {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--nb-border);
  border-radius: var(--nb-radius);
  color: var(--nb-text-muted);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.nb-plugin-goto:hover {
  border-color: var(--nb-primary);
  color: var(--nb-primary);
}

.nb-plugin-items {
  display: none;
  flex-direction: column;
  border-top: 1px solid var(--nb-border);
}

.nb-plugin-group.expanded .nb-plugin-items {
  display: flex;
}

.nb-plugin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px 10px 48px;
  border-bottom: 1px solid var(--nb-border);
  transition: background 0.15s ease;
}

.nb-plugin-item:last-child {
  border-bottom: none;
}

.nb-plugin-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.nb-plugin-item.nb-has-access {
  border-left: 3px solid var(--nb-success);
  padding-left: 45px;
}

.nb-plugin-item-title {
  font-weight: 400;
  color: var(--nb-text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nb-plugin-item.nb-no-access .nb-plugin-item-title {
  color: var(--nb-text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  .nb-content-grid {
    grid-template-columns: 1fr;
  }

  .nb-token-actions {
    flex-direction: column;
  }

  .nb-user-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .nb-plugin-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .nb-plugin-summary {
    order: 4;
    width: 100%;
    padding-left: 36px;
  }

  .nb-plugin-item {
    padding: 10px 16px 10px 36px;
  }

  .nb-plugin-item.nb-has-access {
    padding-left: 33px;
  }
}

/* Plugin Download Button - Full width, distinctive styling */
.nb-plugin-download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  flex-grow: 1;
  flex-basis: 100%;
  padding: 0.75em 1.5em;
  background: linear-gradient(135deg, #9c27b0 0%, #d81b60 100%);
  color: #ffffff;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
  font-weight: 700;
  border: 2px solid #9c27b0;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 4px 12px rgba(156, 39, 176, 0.4);
}

.nb-plugin-download-btn:hover:not(.disabled) {
  background: linear-gradient(135deg, #ab47bc 0%, #ec407a 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(156, 39, 176, 0.6);
}

.nb-plugin-download-btn:active:not(.disabled) {
  transform: translateY(0);
}

.nb-plugin-download-btn.disabled {
  background: #424242 !important;
  border-color: #616161 !important;
  color: #9e9e9e !important;
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.nb-plugin-download-btn.disabled:hover {
  transform: none;
}

.nb-plugin-download-btn i {
  font-size: 18px;
}

/* Button state: not logged in */
.nb-plugin-download-btn.nb-not-logged-in {
  background: linear-gradient(135deg, #9c27b0 0%, #d81b60 100%);
  opacity: 0.9;
}

.nb-plugin-download-btn.nb-not-logged-in:hover {
  opacity: 1;
}

/* Button state: enabled (has access) */
.nb-plugin-download-btn.enabled {
  background: linear-gradient(135deg, #9c27b0 0%, #d81b60 100%);
}

.nb-plugin-download-btn.enabled:hover {
  background: linear-gradient(135deg, #ab47bc 0%, #ec407a 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(156, 39, 176, 0.6);
}

/* Tooltip system for buttons */
.nb-plugin-download-btn[data-tooltip] {
  position: relative;
}

.nb-plugin-download-btn[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: #2d2d2d;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.nb-plugin-download-btn[data-tooltip]::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-2px);
  border: 6px solid transparent;
  border-top-color: #2d2d2d;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000;
}

.nb-plugin-download-btn[data-tooltip]:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(-12px);
}

.nb-plugin-download-btn[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-6px);
}

/* Responsive */
@media (max-width: 478px) {
  .nb-plugin-download-btn {
    font-size: 14px;
    padding: 0.65em 1.2em;
  }

  .nb-plugin-download-btn i {
    font-size: 16px;
  }
}

/* Modal Close Button */
.nb-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--nb-text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.nb-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Responsive */
@media (max-width: 478px) {
  .nb-plugin-download-btn {
    width: 100%;
    font-size: 14px;
    padding: 0.65em 1.2em;
  }
}

/* ============================================================================
   REDESIGN: Immersive Login (Logged-Out)
   ============================================================================ */

.nb-immersive-login {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  position: relative;
}

.nb-login-card {
  background: rgba(37, 39, 49, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--nb-border);
  border-radius: 12px;
  padding: 40px 36px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.nb-login-card .nb-login-logo {
  width: 80px;
  height: auto;
  margin-bottom: 24px;
}

.nb-login-card h2 {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  font-size: 24px;
  color: var(--nb-text);
  margin: 0 0 28px 0;
}

.nb-login-card .nb-login-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.nb-login-card .nb-login-stack .nb-btn {
  width: 100%;
  justify-content: center;
  padding: 14px 24px;
  font-size: 15px;
}

.nb-login-card .nb-divider {
  height: 1px;
  background: var(--nb-border);
  margin: 20px 0;
}

.nb-login-card .nb-login-footer {
  font-size: 14px;
  color: var(--nb-text-muted);
}

.nb-login-card .nb-login-footer a {
  color: #B689C0;
  text-decoration: none;
  font-weight: 600;
}

.nb-login-card .nb-login-footer a:hover {
  text-decoration: underline;
}

/* ============================================================================
   REDESIGN: Identity Bar (Logged-In Top)
   ============================================================================ */

.nb-identity-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--nb-border);
}

.nb-identity-bar .nb-user-tag {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--nb-text);
}

.nb-identity-bar .nb-identity-name {
  display: flex;
  align-items: center;
}

.nb-identity-bar .nb-identity-edit {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

/* ============================================================================
   REDESIGN: Token Hero Card
   ============================================================================ */

.nb-token-hero {
  background: #1a1a2e;
  border: 1px solid var(--nb-border);
  border-radius: 8px;
  padding: 32px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(224, 54, 54, 0.1);
}

.nb-token-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #e03636, #de5a29);
}

.nb-token-hero h3 {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--nb-text);
  margin: 0 0 20px 0;
}

.nb-token-command {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #252731;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.nb-token-command code {
  flex: 1;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 14px;
  color: var(--nb-text);
  word-break: break-all;
}

.nb-token-command .nb-btn-copy {
  flex-shrink: 0;
}

.nb-token-command .nb-btn-copy.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.nb-token-command .nb-btn-copy-wrapper {
  position: relative;
  flex-shrink: 0;
}

.nb-token-command .nb-btn-copy-wrapper .nb-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: #252731;
  border: 1px solid var(--nb-border);
  color: var(--nb-text-muted);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}

.nb-token-command .nb-btn-copy-wrapper:hover .nb-tooltip {
  display: block;
}

.nb-token-info-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--nb-text-muted);
  margin-bottom: 16px;
}

.nb-token-warning {
  border: 1px solid #e0a030;
  background: rgba(224, 160, 48, 0.08);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #e0a030;
  line-height: 1.5;
}

.nb-token-setup {
  font-size: 14px;
  color: var(--nb-text-muted);
  margin-bottom: 16px;
  line-height: 1.6;
}

.nb-token-setup code {
  background: #252731;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--nb-text);
}

.nb-token-footer {
  font-size: 13px;
  color: var(--nb-text-muted);
  padding-top: 16px;
  border-top: 1px solid rgba(61, 61, 92, 0.5);
}

/* ============================================================================
   REDESIGN: Account Section (Two-Column)
   ============================================================================ */

.nb-account-section {
  display: grid;
  grid-template-columns: 55% 45%;
  gap: 24px;
  margin-bottom: 32px;
}

.nb-account-panel {
  background: var(--nb-bg-card);
  border: 1px solid var(--nb-border);
  border-radius: 8px;
  padding: 24px;
}

.nb-account-panel h3 {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--nb-text);
  margin: 0 0 20px 0;
}

.nb-provider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(61, 61, 92, 0.4);
}

.nb-provider-row:last-child {
  border-bottom: none;
}

.nb-provider-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

.nb-provider-icon.patreon { background: #FF424D; }
.nb-provider-icon.itch { background: #FA5C5C; }
.nb-provider-icon.nightbreak { background: #B689C0; }

.nb-provider-info {
  flex: 1;
}

.nb-provider-info .nb-provider-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--nb-text);
}

.nb-provider-info .nb-provider-detail {
  font-size: 12px;
  color: var(--nb-text-muted);
  margin-top: 2px;
}

.nb-setting-block {
  padding: 14px 0;
  border-bottom: 1px solid rgba(61, 61, 92, 0.4);
}

.nb-setting-block:last-child {
  border-bottom: none;
}

.nb-setting-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nb-setting-label {
  font-size: 13px;
  color: var(--nb-text-muted);
  margin-bottom: 2px;
}

.nb-setting-value {
  font-size: 15px;
  color: var(--nb-text);
  font-weight: 500;
}

.nb-setting-edit-link {
  font-size: 13px;
  color: #B689C0;
  cursor: pointer;
  background: none;
  border: none;
  font-weight: 600;
  font-family: inherit;
}

.nb-setting-edit-link:hover {
  text-decoration: underline;
}

.nb-setting-form {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nb-setting-form .nb-form-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.nb-setting-form .nb-input {
  flex: 1;
}

.nb-setting-form .nb-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.nb-setup-prompt {
  background: rgba(182, 137, 192, 0.08);
  border: 1px solid rgba(182, 137, 192, 0.3);
  border-radius: 8px;
  padding: 16px;
  margin-top: 12px;
}

.nb-setup-prompt p {
  font-size: 14px;
  color: var(--nb-text-muted);
  margin: 0 0 12px 0;
}

/* ============================================================================
   REDESIGN: Content Library Card Grid
   ============================================================================ */

.nb-content-library h3 {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--nb-text);
  margin: 0 0 20px 0;
}

.nb-content-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.nb-dlc-card {
  background: #1a1a2e;
  border: 1px solid var(--nb-border);
  border-radius: 8px;
  padding: 16px;
  position: relative;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.nb-dlc-card.has-access {
  border-left-color: var(--nb-success);
}

.nb-dlc-card:hover {
  border-color: var(--nb-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.nb-dlc-card .nb-dlc-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--nb-text);
  margin-bottom: 4px;
  padding-right: 60px;
}

.nb-dlc-card .nb-dlc-plugin {
  font-size: 13px;
  color: var(--nb-text-muted);
}

.nb-dlc-card .nb-dlc-badge {
  position: absolute;
  top: 12px;
  right: 12px;
}

/* ============================================================================
   REDESIGN: Responsive
   ============================================================================ */

@media (max-width: 992px) {
  .nb-account-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nb-login-card {
    padding: 32px 24px;
  }

  .nb-token-hero {
    padding: 24px;
  }

  .nb-token-command {
    flex-direction: column;
    align-items: stretch;
  }

  .nb-token-command .nb-btn-copy-wrapper {
    align-self: flex-end;
  }

  .nb-identity-bar {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .nb-content-cards {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   Account hub: section navigation, content card links, token help
   ============================================================================ */

/* Sticky under the compact site header (84 px on inner pages). */
.nb-hub-nav {
  position: sticky;
  top: 84px;
  z-index: 20;
  margin: 0 0 24px 0;
  background: rgba(26, 26, 46, 0.96);
  border: 1px solid var(--nb-border);
  border-radius: var(--nb-radius);
  backdrop-filter: blur(6px);
}

.nb-hub-nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 6px;
}

.nb-hub-nav-list li {
  margin: 0;
}

.nb-hub-nav-link {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 6px;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--nb-text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}

.nb-hub-nav-link:hover,
.nb-hub-nav-link:focus-visible {
  color: var(--nb-text);
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.nb-hub-nav-link.nb-hub-nav-admin {
  color: var(--nb-primary);
  margin-left: auto;
}

/* Section anchors land below the sticky header and hub nav. */
#nightbreak-dlc,
#nightbreak-token,
#nightbreak-content,
#nightbreak-privacy {
  scroll-margin-top: 150px;
}

/* Content Library: one group per plugin */
.nb-dlc-group {
  margin-bottom: 28px;
}

.nb-dlc-group-title {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--nb-text-muted);
  margin: 0 0 12px 0;
}

.nb-dlc-card .nb-dlc-meta {
  font-size: 12px;
  color: var(--nb-text-muted);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.nb-dlc-card .nb-dlc-excerpt {
  font-size: 13px;
  line-height: 1.5;
  color: var(--nb-text-muted);
  margin: 0 0 10px 0;
}

.nb-dlc-card .nb-dlc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 8px 0 0 0;
  font-size: 13px;
}

.nb-dlc-card .nb-dlc-links a {
  color: var(--nb-accent);
  text-decoration: none;
}

.nb-dlc-card .nb-dlc-links a:hover,
.nb-dlc-card .nb-dlc-links a:focus-visible {
  text-decoration: underline;
}

.nb-dlc-card .nb-dlc-download {
  margin-top: 14px;
}

.nb-dlc-card .nb-dlc-locked-note {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--nb-text-muted);
}

.nb-dlc-card .nb-dlc-stores a {
  color: var(--nb-text);
  font-weight: 600;
  text-decoration: underline;
}

.nb-dlc-card .nb-dlc-stores a + a {
  margin-left: 8px;
}

/* Locked cards stay readable: dim the body (below), not the links. */
.nb-dlc-card.locked {
  border-style: dashed;
}

.nb-dlc-card.locked .nb-dlc-name,
.nb-dlc-card.locked .nb-dlc-excerpt,
.nb-dlc-card.locked .nb-dlc-meta {
  opacity: 0.7;
}

/* Token section help link */
.nb-token-help {
  display: inline-block;
  margin-left: 6px;
  color: var(--nb-accent);
  text-decoration: none;
}

.nb-token-help:hover,
.nb-token-help:focus-visible {
  text-decoration: underline;
}

@media (max-width: 767px) {
  .nb-hub-nav {
    position: static;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nb-hub-nav-list {
    flex-wrap: nowrap;
  }

  .nb-hub-nav-link.nb-hub-nav-admin {
    margin-left: 0;
  }

  #nightbreak-dlc,
  #nightbreak-token,
  #nightbreak-content,
  #nightbreak-privacy {
    scroll-margin-top: 90px;
  }
}

/* ============================================================================
   Plugin pages: download button states and the owned badge
   ============================================================================ */

.nb-plugin-download-btn[data-state="signed-out"] {
  background: linear-gradient(135deg, #9c27b0 0%, #d81b60 100%);
  opacity: 0.9;
}

.nb-plugin-download-btn[data-state="signed-out"]:hover {
  opacity: 1;
}

.nb-plugin-download-btn[data-state="free"] {
  background: linear-gradient(135deg, #9c27b0 0%, #d81b60 100%);
}

.nb-plugin-download-btn[data-state="owned"] {
  background: linear-gradient(135deg, #b32828 0%, var(--nb-primary) 100%);
  border-color: var(--nb-primary);
  box-shadow: 0 4px 12px rgba(224, 54, 54, 0.35);
}

.nb-plugin-download-btn[data-state="owned"]:hover {
  background: linear-gradient(135deg, #c93030 0%, var(--nb-primary-hover) 100%);
  box-shadow: 0 6px 20px rgba(224, 54, 54, 0.5);
}

.nb-plugin-download-btn[data-state="owned"] i {
  color: #3fcf6b;
}

.nb-plugin-download-btn[data-state="locked"] {
  background: #424242;
  border-color: #616161;
  color: #9e9e9e;
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

/* "Owned" badge on a plugin page card: site red with the shell's green dot */
.nb-owned-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  margin: 0 0 8px 0;
  padding: 3px 10px 3px 8px;
  border: 1px solid rgba(224, 54, 54, 0.6);
  border-radius: 999px;
  background: rgba(224, 54, 54, 0.12);
  color: var(--nb-primary);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.4;
}

.nb-owned-badge::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3fcf6b;
  box-shadow: 0 0 0 3px rgb(63 207 107 / .18);
}

/* ============================================================================
   Layout stability (2026-11-24)
   The page starts as a heading and four empty boxes, and the script fills them
   once it knows who is there. Three things moved while that happened, which made
   this the one page of the site with a poor layout-shift score (CLS 0.2 to 0.9):
   - The footer stood right under the empty boxes and was pushed down a screen.
     The page now keeps a screen's height from the start.
   - The heading showed first and was taken away for a signed-out visitor, which
     pulled the sign-in card up. It now waits for the signed-in bar. The script
     still sets the heading's inline display as before; a browser without :has()
     keeps the old order.
   - The sign-in card grew when its owl arrived, because the picture had no
     height until then. Its shape (1016 x 1408) is now known beforehand.
   ============================================================================ */

.nightbreak-account-page {
  min-height: 100vh;
}

@supports selector(:has(*)) {
  .nightbreak-account-page .nb-page-header {
    display: none;
  }

  .nightbreak-account-page:has(.nb-identity-bar) .nb-page-header {
    display: block;
  }
}

.nb-login-card .nb-login-logo {
  aspect-ratio: 1016 / 1408;
}
