/* =============================================================================
   D&D NPC HUB - STYLE SHEET
   ============================================================================= */

/* --- Design Tokens & Variables --- */
:root {
  --font-display: 'Cinzel', serif;
  --font-display-decorative: 'Cinzel Decorative', serif;
  --font-sans: 'Inter', sans-serif;
  --font-mono: 'Fira Code', monospace;

  /* Harmonious Dark Palette */
  --bg-obsidian: #09090b;
  --bg-card: rgba(22, 22, 26, 0.7);
  --bg-input: rgba(10, 10, 12, 0.9);
  
  /* Glowing Ethereal Accents */
  --accent-gold: #f59e0b;
  --accent-gold-hover: #fbbf24;
  --accent-gold-dark: #d97706;
  --accent-violet: #8b5cf6;
  --accent-violet-dark: #7c3aed;
  --accent-violet-glow: rgba(139, 92, 246, 0.35);
  --accent-gold-glow: rgba(245, 158, 11, 0.25);
  
  /* Border & Parchment Styles */
  --border-metallic: rgba(255, 255, 255, 0.08);
  --border-glowing-gold: rgba(245, 158, 11, 0.4);
  --border-glowing-violet: rgba(139, 92, 246, 0.4);
  --text-primary: #f4f4f5;
  --text-muted: #a1a1aa;
  
  /* Traditional Parchment (for Stat Block) */
  --parchment-bg: #1a1917;
  --parchment-border: #c9ad6a;
  --parchment-text: #eedbb2;
  --parchment-red: #da3e30;
}

/* --- Base Resets & Layout --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-obsidian);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  display: flex;
  justify-content: center;
}

/* Translucent Glowing Background Bleeds */
.ambient-glow {
  position: absolute;
  width: 50vw;
  height: 50vw;
  border-radius: 50%;
  filter: blur(150px);
  pointer-events: none;
  z-index: -1;
  opacity: 0.15;
}

.bg-glow-violet {
  top: -10vw;
  left: -10vw;
  background-color: var(--accent-violet);
}

.bg-glow-amber {
  bottom: -10vw;
  right: -10vw;
  background-color: var(--accent-gold);
}

/* App Wrapper Grid */
.app-container {
  width: 100%;
  max-width: 1400px;
  min-height: 100vh;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* --- Premium Navigation Header --- */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-metallic);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.d20-logo {
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.4));
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.d20-logo:hover {
  transform: rotate(360deg) scale(1.1);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-display-decorative);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #fff 0%, #fbbf24 50%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--text-muted);
}

/* View Switcher Controls (Sliding Pill Toggle) */
.view-selector {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-metallic);
  border-radius: 9999px;
  position: relative;
  padding: 3px;
  height: 46px;
  min-width: 320px;
}

.nav-toggle-btn {
  flex: 1;
  background: transparent;
  border: none;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  z-index: 2;
  transition: color 0.3s ease;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-toggle-btn.active {
  color: var(--bg-obsidian);
}

.toggle-slider {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  background: linear-gradient(135deg, var(--accent-gold-hover) 0%, var(--accent-gold) 100%);
  border-radius: 9999px;
  z-index: 1;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.view-selector:has(#nav-btn-converter.active) .toggle-slider {
  transform: translateX(100%);
}

#settings-trigger-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-metallic);
  color: var(--text-primary);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: none; /* Hidden by default for public security */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

#settings-trigger-btn.visible {
  display: flex; /* Revealed via Developer Easter Egg */
  animation: fadeIn 0.4s ease;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-metallic);
  color: var(--text-primary);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.icon-btn:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--accent-violet);
  color: var(--accent-violet);
  box-shadow: 0 0 12px var(--accent-violet-glow);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* --- Core Workspace Area --- */
.app-workspace {
  flex: 1;
  position: relative;
}

.workspace-section {
  display: none;
  animation: fadeIn 0.5s ease-out forwards;
}

.workspace-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Premium Layout Grid - Generator --- */
.workspace-grid {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 2rem;
  align-items: start;
}

/* Glassmorphic Panel Elements */
.glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-metallic);
  border-radius: 16px;
  padding: 1.75rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  position: relative;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

/* Side Controller Descriptions */
.section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
  color: var(--accent-gold);
  border-bottom: 1px solid rgba(245, 158, 11, 0.15);
  padding-bottom: 0.5rem;
}

.section-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 1.5rem;
}

/* Form Styling */
.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.control-group-row {
  display: flex;
  gap: 1rem;
}

.control-group-row .control-group {
  flex: 1;
}

.control-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
}

.select-field, .input-field {
  background-color: var(--bg-input);
  border: 1px solid var(--border-metallic);
  border-radius: 8px;
  padding: 0.75rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.select-field:focus, .input-field:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 10px var(--accent-gold-glow);
}

.select-field option {
  background-color: var(--bg-obsidian);
  color: var(--text-primary);
}

/* Button UI Elements */
.primary-action-btn {
  background: linear-gradient(135deg, var(--accent-gold-hover) 0%, var(--accent-gold) 100%);
  border: none;
  color: var(--bg-obsidian);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  padding: 1rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
  transition: all 0.3s ease;
}

.primary-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.primary-action-btn:active {
  transform: translateY(0);
}

.dice-icon {
  width: 18px;
  height: 18px;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin: 1.25rem 0;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-metallic);
}

.divider span {
  padding: 0 0.75rem;
}

.secondary-action-btn {
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid var(--accent-violet);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  transition: all 0.3s ease;
}

.secondary-action-btn:hover {
  background: rgba(139, 92, 246, 0.2);
  box-shadow: 0 0 15px var(--accent-violet-glow);
  transform: translateY(-1px);
}

.sparkles-icon {
  width: 16px;
  height: 16px;
  color: #c084fc;
}

.ai-status-hint {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.75rem;
  line-height: 1.3;
}

/* --- Premium Stat Block Design Card --- */
.stat-block-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.stat-block-card {
  background-color: var(--parchment-bg);
  border: 1px solid var(--parchment-border);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(0,0,0,0.8);
  border-radius: 4px;
  position: relative;
  padding: 2.25rem;
  font-family: var(--font-sans);
  color: var(--parchment-text);
  overflow: hidden;
}

.stat-block-header-ribbon {
  height: 6px;
  background-color: var(--parchment-border);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.sb-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.sb-name {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--parchment-border);
  letter-spacing: 0.5px;
}

.sb-meta {
  font-size: 0.9rem;
  font-style: italic;
  margin-top: 0.25rem;
  color: var(--text-muted);
}

.sb-cr-badge {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--parchment-border);
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 48px;
}

.badge-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.badge-value {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-gold);
}

/* Classical Tapered Line Divider (Monster Manual style) */
.tapered-hr {
  border: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--parchment-border) 20%, var(--parchment-border) 80%, transparent 100%);
  margin: 1rem 0;
}

.tapered-hr-bold {
  border: 0;
  height: 5px;
  background: linear-gradient(90deg, transparent 0%, var(--parchment-border) 10%, var(--parchment-border) 90%, transparent 100%);
  margin: 1.25rem 0;
}

.sb-attributes {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.95rem;
}

.sb-attributes strong {
  color: var(--parchment-red);
}

.sb-attribute-val {
  margin-left: 0.5rem;
}

/* Ability Scores Section */
.ability-scores-table {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0;
}

.ability-score-col {
  flex: 1;
  min-width: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0,0,0,0.15);
  border-radius: 4px;
  padding: 0.5rem 0.25rem;
  border: 1px solid rgba(201, 173, 106, 0.15);
}

.ability-abbr {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--parchment-border);
}

.ability-val {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0.15rem 0;
}

.ability-mod {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Core stat block detailed texts */
.sb-details {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.95rem;
}

.sb-details strong {
  color: var(--parchment-red);
  margin-right: 0.5rem;
}

/* Description Lists (Monster Actions) */
.sb-section-header {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--parchment-red);
  border-bottom: 1px solid rgba(218, 62, 48, 0.3);
  padding-bottom: 0.25rem;
  margin: 1rem 0 0.5rem 0;
  letter-spacing: 0.5px;
}

.sb-ability-entry {
  font-size: 0.95rem;
  line-height: 1.45;
  margin-bottom: 0.75rem;
}

.sb-ability-entry strong {
  color: var(--text-primary);
  font-style: italic;
}

.sb-ability-entry em {
  color: var(--text-muted);
}

.sb-bio-entry {
  font-size: 0.9rem;
  line-height: 1.5;
  font-style: italic;
  color: var(--text-muted);
}

/* Stat Block Exports Area */
.stat-block-exports {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.export-btn {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-metallic);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.export-btn:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--accent-gold);
}

.export-icon {
  width: 15px;
  height: 15px;
  color: var(--accent-gold);
}

/* --- =======================================================================
   CONVERTER TAB VIEW STYLES
   ======================================================================= --- */
.workspace-grid-converter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: stretch;
}

.data-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-metallic);
  padding-bottom: 0.75rem;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text-primary);
}

.small-action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-metallic);
  color: var(--text-primary);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.small-action-btn:hover {
  background: var(--accent-gold);
  color: var(--bg-obsidian);
  border-color: var(--accent-gold);
  box-shadow: 0 0 10px var(--accent-gold-glow);
}

.small-action-btn.btn-secondary:hover {
  background: var(--accent-violet);
  color: var(--text-primary);
  border-color: var(--accent-violet);
  box-shadow: 0 0 10px var(--accent-violet-glow);
}

/* Drag Drop Box Zone */
.drag-drop-zone {
  border: 2px dashed rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  background: rgba(255,255,255,0.01);
  cursor: pointer;
  transition: all 0.3s ease;
}

.drag-drop-zone:hover, .drag-drop-zone.active {
  border-color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.03);
}

.upload-arrow-icon {
  width: 32px;
  height: 32px;
  color: var(--accent-gold);
  margin-bottom: 0.5rem;
  transition: transform 0.3s ease;
}

.drag-drop-zone:hover .upload-arrow-icon {
  transform: translateY(-4px);
}

.zone-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.zone-prompt p {
  font-size: 0.9rem;
}

.sub-prompt {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Code Editor Block Containers */
.text-editor-container {
  flex: 1;
  display: flex;
  min-height: 250px;
}

.code-editor {
  width: 100%;
  min-height: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-metallic);
  border-radius: 8px;
  padding: 1rem;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.45;
  outline: none;
  resize: none;
  tab-size: 4;
}

.code-editor:focus {
  border-color: var(--accent-violet);
  box-shadow: 0 0 10px var(--accent-violet-glow);
}

.code-editor.readonly {
  background-color: rgba(10, 10, 12, 0.4);
  color: var(--text-muted);
  cursor: text;
}

.instructions-panel {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-metallic);
  border-radius: 8px;
  padding: 1.25rem;
}

.instructions-panel h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--accent-gold);
  margin-bottom: 0.5rem;
}

.instructions-panel ol {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.instructions-panel li {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.instructions-panel li strong {
  color: var(--text-primary);
}

/* Helper styles */
.hidden-input {
  display: none;
}

.w-full {
  width: 100%;
}

.convert-icon {
  width: 18px;
  height: 18px;
}

/* --- =======================================================================
   SETTINGS DRAWER STYLES
   ======================================================================= --- */
.settings-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  visibility: hidden;
  opacity: 0;
  transition: all 0.4s ease;
}

.settings-drawer.active {
  visibility: visible;
  opacity: 1;
}

.settings-drawer-backdrop {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

.settings-drawer-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 100%;
  max-width: 420px;
  background: rgba(18, 18, 22, 0.95);
  border-left: 1px solid var(--border-metallic);
  backdrop-filter: blur(20px);
  box-shadow: -10px 0 40px rgba(0,0,0,0.8);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  display: flex;
  flex-direction: column;
}

.settings-drawer.active .settings-drawer-panel {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-metallic);
}

.drawer-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--accent-violet);
}

.drawer-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  flex: 1;
  overflow-y: auto;
}

.drawer-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.field-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 0.25rem;
}

.connection-status-msg {
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.75rem;
  text-align: center;
  min-height: 1.2rem;
}

.connection-status-msg.success {
  color: #10b981;
}

.connection-status-msg.error {
  color: #ef4444;
}

.connection-status-msg.testing {
  color: #3b82f6;
}

.settings-saved-success {
  display: none;
  background-color: rgba(16, 185, 129, 0.15);
  border: 1px solid #10b981;
  color: #10b981;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.75rem;
  border-radius: 6px;
  text-align: center;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 0.7; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Print Specific layout styling */
@media print {
  body {
    background: white;
    color: black;
  }
  .app-container {
    padding: 0;
    max-width: 100%;
  }
  .app-header, .control-sidebar, .stat-block-exports, .view-selector, #settings-trigger-btn, .ambient-glow {
    display: none !important;
  }
  .stat-block-container {
    width: 100% !important;
  }
  .stat-block-card {
    border: 2px solid #000 !important;
    background: white !important;
    color: black !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  .sb-name, .badge-value, .sb-section-header {
    color: black !important;
  }
  .sb-attributes strong, .sb-details strong {
    color: black !important;
  }
}

/* --- =======================================================================
   RESPONSIVE DESIGN ADAPTATIONS
   ======================================================================= --- */
@media (max-width: 992px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  .workspace-grid-converter {
    grid-template-columns: 1fr;
  }
  .text-editor-container {
    min-height: 200px;
  }
}

@media (max-width: 576px) {
  .app-container {
    padding: 1rem;
  }
  .app-header {
    flex-direction: column;
    align-items: stretch;
  }
  .brand-text {
    align-items: center;
  }
  .logo-area {
    justify-content: center;
  }
  .view-selector {
    min-width: 100%;
  }
  .stat-block-card {
    padding: 1.25rem;
  }
  .sb-name {
    font-size: 1.6rem;
  }
  .ability-scores-table {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
}

/* =============================================================================
   D&D NPC FORGE - PREMIUM PLATFORM STYLING
   ============================================================================= */

.hidden {
  display: none !important;
}

/* --- AUTHENTICATION HEADER ELEMENTS --- */
.auth-header-area {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.small-btn {
  padding: 0.5rem 1rem !important;
  font-size: 0.8rem !important;
  min-height: auto !important;
}

.user-menu-container {
  position: relative;
}

.user-avatar-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.user-avatar-btn:hover {
  transform: scale(1.05);
}

.avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-metallic);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-violet);
  font-weight: 700;
  font-size: 1.1rem;
  font-family: var(--font-display);
  position: relative;
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.2);
}

/* Gold branding for premium subscriber menus */
.premium-active .avatar-circle {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

.premium-star {
  display: none;
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: var(--accent-gold);
  color: #0b0713;
  font-size: 0.55rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.premium-active .premium-star {
  display: flex;
}

/* USER DROPDOWN PANELS */
.user-dropdown-panel {
  position: absolute;
  top: 50px;
  right: 0;
  width: 240px;
  background: rgba(15, 10, 25, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-metallic);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
  z-index: 1000;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-dropdown-panel.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-header {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dropdown-email {
  font-size: 0.8rem;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.tier-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  text-align: center;
  align-self: flex-start;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tier-badge.free {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.tier-badge.premium {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  text-shadow: 0 0 5px rgba(245, 158, 11, 0.3);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-metallic);
  margin: 0.4rem 0;
}

.dropdown-item {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.6rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.dropdown-item svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-light);
}

.dropdown-item.premium-highlight {
  color: var(--accent-gold);
  font-weight: 600;
  background: rgba(245, 158, 11, 0.05);
}

.dropdown-item.premium-highlight:hover {
  background: rgba(245, 158, 11, 0.1);
  text-shadow: 0 0 5px rgba(245, 158, 11, 0.3);
}

.dropdown-item.logout:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

/* --- CLOUD NPC VAULT DRAWERS --- */
.vault-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2000;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.4s;
}

.vault-drawer.active {
  pointer-events: auto;
  visibility: visible;
}

.vault-drawer-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.vault-drawer.active .vault-drawer-backdrop {
  opacity: 1;
}

.vault-drawer-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 400px;
  height: 100%;
  background: rgba(15, 10, 25, 0.95);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-metallic);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 10px 0 25px rgba(0, 0, 0, 0.6);
}

.vault-drawer.active .vault-drawer-panel {
  transform: translateX(0);
}

.vault-loading, .vault-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
  gap: 1rem;
}

.vault-loading svg {
  width: 32px;
  height: 32px;
  animation: spin 1.5s linear infinite;
  color: var(--accent-violet);
}

.vault-empty svg {
  width: 48px;
  height: 48px;
  opacity: 0.3;
}

.vault-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.vault-item-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-radius: 6px;
  border: 1px solid var(--border-metallic);
  transition: all 0.2s ease;
}

.vault-item-card:hover {
  border-color: rgba(245, 158, 11, 0.3);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.1);
  transform: translateY(-2px);
}

.vault-item-info {
  flex: 1;
  cursor: pointer;
}

.vault-item-name {
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 0.2rem;
  transition: color 0.2s ease;
}

.vault-item-card:hover .vault-item-name {
  color: var(--accent-gold);
}

.vault-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.vault-item-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vault-item-delete svg {
  width: 16px;
  height: 16px;
}

.vault-item-delete:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

/* --- THE COVENANT AUTH MODALS --- */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.3s;
}

.auth-modal.active {
  pointer-events: auto;
  visibility: visible;
}

.auth-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.auth-modal.active .auth-modal-backdrop {
  opacity: 1;
}

.auth-modal-panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: rgba(20, 15, 30, 0.95);
  border: 1px solid var(--border-metallic);
  border-radius: 12px;
  padding: 2.5rem;
  transform: scale(0.9);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7), 0 0 20px rgba(124, 58, 237, 0.15);
  z-index: 10;
}

.auth-modal.active .auth-modal-panel {
  transform: scale(1);
  opacity: 1;
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  opacity: 0.6;
}

.modal-close-btn:hover {
  opacity: 1;
}

.auth-form-tab {
  display: none;
}

.auth-form-tab.active {
  display: block;
}

.auth-modal-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--accent-gold);
  margin-bottom: 0.5rem;
  text-align: center;
}

.auth-modal-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-error-msg {
  color: #ef4444;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 1rem;
  text-align: center;
}

.auth-switch-prompt {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 1.5rem;
}

.auth-switch-prompt a {
  color: var(--accent-violet);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.auth-switch-prompt a:hover {
  color: var(--accent-gold);
  text-decoration: underline;
}

/* --- THE GOLD-GLOWING STRIPE PRICING MODALS --- */
.premium-pricing-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.4s;
}

.premium-pricing-modal.active {
  pointer-events: auto;
  visibility: visible;
}

.pricing-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.premium-pricing-modal.active .pricing-backdrop {
  opacity: 1;
}

.pricing-panel {
  position: relative;
  width: 90%;
  max-width: 780px;
  background: rgba(18, 12, 28, 0.96);
  border-radius: 12px;
  padding: 3rem;
  transform: scale(0.9);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10;
}

.premium-pricing-modal.active .pricing-panel {
  transform: scale(1);
  opacity: 1;
}

.premium-box-glow {
  border: 1px solid var(--accent-gold) !important;
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.2), 0 20px 40px rgba(0,0,0,0.8) !important;
}

.pricing-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.gold-badge {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 12px;
  letter-spacing: 1px;
  display: inline-block;
  margin-bottom: 0.75rem;
}

.pricing-title {
  font-size: 2rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.pricing-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2.5rem;
  align-items: center;
}

.pricing-features h4 {
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 1.25rem;
  border-left: 2px solid var(--accent-gold);
  padding-left: 0.5rem;
}

.pricing-features ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.pricing-features li svg {
  width: 18px;
  height: 18px;
  color: var(--accent-gold);
  flex-shrink: 0;
  margin-top: 2px;
}

.pricing-features li strong {
  color: var(--text-light);
}

.pricing-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-metallic);
  border-radius: 8px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.price-box {
  display: flex;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.price-box .currency {
  font-size: 1.5rem;
  color: var(--accent-gold);
  font-weight: 700;
}

.price-box .amount {
  font-size: 3.5rem;
  color: var(--text-light);
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1;
}

.price-box .period {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-left: 0.25rem;
}

.price-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.gold-btn {
  border-color: var(--accent-gold) !important;
  color: var(--accent-gold) !important;
  font-weight: 700;
  text-shadow: 0 0 5px rgba(245, 158, 11, 0.2);
}

.gold-btn:hover {
  background: var(--accent-gold) !important;
  color: #0b0713 !important;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.4) !important;
}

.stripe-badges {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

/* --- EXPORT VAULT BUTTON STYLING --- */
.vault-btn {
  border-color: var(--accent-violet) !important;
  color: var(--accent-violet) !important;
}

.vault-btn:hover {
  background: var(--accent-violet) !important;
  color: var(--text-light) !important;
}

/* Premium active styling for buttons and cards */
.premium-unlocked {
  border-color: var(--accent-gold) !important;
  color: var(--accent-gold) !important;
}

.premium-unlocked:hover {
  background: var(--accent-gold) !important;
  color: #0b0713 !important;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.4) !important;
}

.success-highlight {
  border-color: #10b981 !important;
  color: #10b981 !important;
  background: rgba(16, 185, 129, 0.15) !important;
}

.premium-toast {
  background-color: rgba(245, 158, 11, 0.15) !important;
  border-color: var(--accent-gold) !important;
  color: var(--accent-gold) !important;
  animation: pulse 2.5s infinite !important;
}

/* Responsive Pricing Adapts */
@media (max-width: 768px) {
  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .pricing-panel {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 90%;
  }
}

/* --- VAULT DRAWER TABS & HOMEBREW STYLING --- */
.drawer-tab-selector {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-metallic);
  border-radius: 6px;
  padding: 2px;
  margin-bottom: 1.5rem;
}

.drawer-tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: var(--font-display);
}

.drawer-tab-btn:hover {
  color: var(--text-light);
}

.drawer-tab-btn.active {
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.3);
  color: var(--accent-violet);
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.1);
}

.premium-active .drawer-tab-btn.active {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--accent-gold);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.1);
}

/* Tab display states */
.vault-tab-content {
  display: none;
  flex-direction: column;
  flex: 1;
}

.vault-tab-content.active {
  display: flex;
}

/* Scroll container for textareas */
.homebrew-scroller-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow-y: auto;
  padding-right: 0.5rem;
  margin-bottom: 1.5rem;
  max-height: calc(100vh - 280px);
}

/* Custom scrollbar for homebrew scroller */
.homebrew-scroller-container::-webkit-scrollbar {
  width: 6px;
}

.homebrew-scroller-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.01);
}

.homebrew-scroller-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.homebrew-scroller-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Custom Textareas */
.textarea-small {
  height: 60px;
  resize: vertical;
  font-family: inherit;
  font-size: 0.8rem !important;
  line-height: 1.4;
  padding: 0.5rem 0.75rem !important;
}

.textarea-medium {
  height: 100px;
  resize: vertical;
  font-family: inherit;
  font-size: 0.8rem !important;
  line-height: 1.4;
  padding: 0.5rem 0.75rem !important;
}

.text-accent-gold {
  color: var(--accent-gold) !important;
}


