/*
 * © 2026 Shannon Henry. All rights reserved.
 *
 * This software and its associated documentation (the "Power 369 Vortex Enterprise") are the exclusive property of the owner.
 *
 * UNAUTHORIZED COPYING, REPRODUCTION, MODIFICATION, OR DISTRIBUTION OF THIS WORK, OR ANY PORTION OF IT, IS STRICTLY PROHIBITED.
 *
 * This includes, but is not limited to, the proprietary 3-6-9 harmonic architecture, dual-state monitoring protocol, Soul Guide Protocol, Oracle Reading Engine, four-currency economic model, Forge Ratio mechanics, card-economy system, DreamScape Gateway architecture, Zero-Drift Development methodology, Hyper Biological Coding theory, and Constitutional File Theory.
 *
 * For inquiries regarding licensing or permissions, please contact: power369app@gmail.com
 */

/*
   POWER369 STYLES v3.0 — UNIFIED DESIGN SYSTEM
   Consolidated from: Dashboard, Wallet, Sanctuary, Resonance, Forge (UGC)
   
   All pages should load this file via: <link rel="stylesheet" href="css/styles.css">
   Then only page-specific overrides (if any) go in a small inline <style> block.
   
   Components.js injects header + nav HTML — this file provides their styles.
*/

/* ═══════════════════════════════════════════
   1. ROOT VARIABLES
   ═══════════════════════════════════════════ */
:root {
  /* Core Palette */
  --bg: #0a0a0a;
  --bg-alt: #0D0D1A;
  --surface: #111111;
  --surface-light: rgba(255, 255, 255, 0.03);
  --surface-border: #222222;
  --surface-hover: rgba(255, 255, 255, 0.05);

  --gold: #FFD700;
  --gold-dim: #D4AF37;
  --gold-glow: rgba(255, 215, 0, 0.45);
  --blue: #00BFFF;
  --blue-glow: rgba(0, 191, 255, 0.35);
  --amber: #FFA500;
  --red: #DC143C;
  --red-bright: #ff4444;
  --slate: #708090;
  --white: #FFFFFF;
  --silver: #C0C0C0;
  --purple: #8b5cf6;
  --purple-glow: rgba(139, 92, 246, 0.35);

  /* Vortex State Colors */
  --matrix-green: #00ff41;
  --matrix-green-glow: rgba(0, 255, 65, 0.25);
  --warning-yellow: #fdfd96;
  --containment-red: #ff0033;

  /* Typography */
  --font-terminal: 'Courier New', Courier, monospace;
  --font-ui: 'Segoe UI', "Inter", "SF Pro Display", system-ui, -apple-system, sans-serif;

  /* Spacing (3-6-9 aligned) */
  --space-3: 3px;
  --space-6: 6px;
  --space-9: 9px;
  --space-12: 12px;
  --space-18: 18px;
  --space-27: 27px;

  /* Radius */
  --radius-6: 6px;
  --radius-9: 9px;
  --radius-12: 12px;
  --radius-18: 18px;
  --radius-27: 27px;

  /* Shadows */
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-gold: 0 0 16px rgba(255, 215, 0, 0.45);
  --shadow-blue: 0 0 12px rgba(0, 191, 255, 0.35);
  --shadow-red: 0 0 12px rgba(220, 20, 60, 0.4);
  --shadow-green: 0 0 16px rgba(0, 255, 65, 0.25);
  --shadow-purple: 0 0 16px rgba(139, 92, 246, 0.25);
}


/* ═══════════════════════════════════════════
   2. RESET & BASE
   ═══════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background: var(--bg);
  color: #e0e0e0;
  font-family: var(--font-ui);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--gold);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  margin: 0 0 var(--space-12);
  font-weight: 700;
  color: var(--white);
}
h1 { font-size: 30px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }

p, li, label, input, select, textarea {
  font-size: 16px;
  color: var(--silver);
}

label {
  font-size: 14px;
  font-weight: 500;
  color: var(--white);
}


/* ═══════════════════════════════════════════
   3. TOP BAR
   Used by: Dashboard, Forge, Sanctuary, Wallet, Resonance
   ═══════════════════════════════════════════ */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 100%);
  border-bottom: 1px solid var(--surface-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold-dim);
  cursor: default;
  user-select: none;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  background: var(--matrix-green);
  border-radius: 50%;
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px var(--matrix-green); }
  50% { opacity: 0.5; box-shadow: 0 0 12px var(--matrix-green); }
}


/* ═══════════════════════════════════════════
   4. TIER BADGES
   Used by: Dashboard, Forge, components.js header
   ═══════════════════════════════════════════ */
.tier-badge {
  font-size: 0.65rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tier-STANDARD         { background: #333; color: #888; }
.tier-PREMIUM_CREATIVE { background: #1a3a1a; color: var(--matrix-green); }
.tier-PRO_ORACLE       { background: #3a2a1a; color: var(--gold-dim); }
.tier-ADMIN            { background: rgba(255,0,0,0.2); border: 1px solid var(--red-bright); color: var(--red-bright); }


/* ═══════════════════════════════════════════
   5. ATOM TICKER / ECONOMY DISPLAY
   Used by: Dashboard, Wallet, Forge, Resonance
   ═══════════════════════════════════════════ */
.atom-ticker,
.atom-display {
  font-family: "JetBrains Mono", "SF Mono", var(--font-terminal);
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
}

.economy-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: var(--radius-12);
  padding: 12px 14px;
  margin-bottom: 10px;
}

.economy-item { text-align: center; }

.economy-value {
  font-family: var(--font-terminal);
  font-size: 1.3rem;
  font-weight: 700;
}
.economy-value.gold  { color: var(--gold); }
.economy-value.blue  { color: var(--blue); }
.economy-value.green { color: var(--matrix-green); }

.economy-label {
  font-size: 0.65rem;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

/* Treasury bar variant (Wallet, Exchange) */
.treasury-bar {
  display: flex;
  justify-content: center;
  gap: var(--space-18);
  padding: var(--space-12);
  background: var(--surface-light);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-12);
  margin-bottom: var(--space-18);
}

.treasury-item { text-align: center; }

.treasury-value {
  font-size: 1.2rem;
  font-weight: 700;
  font-family: var(--font-terminal);
}
.treasury-value.atoms  { color: var(--matrix-green); }
.treasury-value.ash    { color: var(--slate); }
.treasury-value.tokens { color: var(--gold); }

.treasury-label {
  font-size: 0.7rem;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 1px;
}


/* ═══════════════════════════════════════════
   6. TAB SYSTEM
   Used by: Forge, Exchange, Rooms
   ═══════════════════════════════════════════ */
.tab-bar {
  display: flex;
  gap: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--surface-border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab-btn {
  flex: 1;
  min-width: 80px;
  padding: 14px 12px;
  background: transparent;
  border: none;
  color: #666;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: inherit;
}

.tab-btn.active {
  color: var(--gold-dim);
  border-bottom-color: var(--gold-dim);
  background: rgba(245, 200, 66, 0.05);
}

.tab-btn:hover:not(.active) {
  color: #aaa;
  background: rgba(255, 255, 255, 0.02);
}

.tab-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.tab-btn.admin-tab       { color: var(--red-bright); }
.tab-btn.admin-tab.active { color: var(--red-bright); border-bottom-color: var(--red-bright); background: rgba(255, 68, 68, 0.05); }

.tab-content,
.tab-panel {
  display: none;
  padding: 16px;
  max-width: 1200px;
  margin: 0 auto;
}
.tab-content.active,
.tab-panel.active {
  display: block;
}


/* ═══════════════════════════════════════════
   7. GLASS CARD / SECTION / FORM PANEL
   The core container used on every page
   ═══════════════════════════════════════════ */
.section,
.form-panel,
.glass-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-12);
  padding: 20px;
  box-shadow: var(--shadow-soft);
}

.section {
  background: var(--surface-light);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-18);
  padding: var(--space-18);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-12);
  margin-bottom: var(--space-12);
}

.form-panel h2,
.glass-card h2 {
  font-size: 1rem;
  color: var(--gold-dim);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--surface-border);
}


/* ═══════════════════════════════════════════
   8. BUTTONS
   Unified from Dashboard, Forge, Wallet, Exchange
   ═══════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  padding: 14px 20px;
  border-radius: 8px;
  border: 1px solid transparent;
  min-height: 44px;
  min-width: 44px;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn:active  { transform: scale(0.98); }
.btn:disabled { cursor: not-allowed; opacity: 0.4; }

.btn-primary {
  background: linear-gradient(135deg, #f5c842, #d4a832);
  color: #000;
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(245, 200, 66, 0.4);
}

.btn-secondary {
  background: var(--surface-border);
  color: #888;
  border: 1px solid #333;
}
.btn-secondary:hover:not(:disabled) {
  background: #2a2a2a;
  color: #aaa;
}

.btn-success {
  background: linear-gradient(135deg, var(--matrix-green), #00cc33);
  color: #000;
}
.btn-success:hover:not(:disabled) {
  box-shadow: 0 4px 20px rgba(0, 255, 65, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, var(--red-bright), #cc3333);
  color: var(--white);
}
.btn-danger:hover:not(:disabled) {
  box-shadow: 0 4px 20px rgba(255, 68, 68, 0.4);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}


/* ═══════════════════════════════════════════
   9. INPUTS / FORM FIELDS
   Used by: Forge, Exchange, Sanctuary, Rooms
   ═══════════════════════════════════════════ */
input, select, textarea, .input {
  width: 100%;
  background: var(--bg);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 12px;
  color: #e0e0e0;
  font-size: 0.9rem;
  font-family: inherit;
  min-height: 44px;
  transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus, .input:focus {
  outline: none;
  border-color: var(--gold-dim);
}

input::placeholder, textarea::placeholder, .input::placeholder {
  color: var(--slate);
}

textarea {
  min-height: 80px;
  resize: vertical;
}

.field-group {
  margin-bottom: 16px;
}

.field-group label {
  display: block;
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.field-group .hint {
  font-size: 0.7rem;
  color: #555;
  margin-top: 4px;
}

.field-group .char-count {
  font-size: 0.7rem;
  color: #555;
  text-align: right;
  margin-top: 4px;
}

.form-row {
  display: grid;
  gap: var(--space-12);
}


/* ═══════════════════════════════════════════
   10. BADGES
   ═══════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-9);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.badge-green  { background: rgba(0, 191, 255, 0.2); color: var(--blue); border: 1px solid rgba(0, 191, 255, 0.5); }
.badge-yellow { background: rgba(255, 165, 0, 0.2); color: var(--amber); border: 1px solid rgba(255, 165, 0, 0.5); }
.badge-red    { background: rgba(220, 20, 60, 0.2); color: var(--red); border: 1px solid rgba(220, 20, 60, 0.5); }
.badge-tier   { background: rgba(255, 215, 0, 0.2); color: var(--gold); border: 1px solid rgba(255, 215, 0, 0.6); }


/* ═══════════════════════════════════════════
   11. VORTEX PULSE INDICATOR
   Used by: Dashboard, Resonance, Rooms, Gateway
   ═══════════════════════════════════════════ */
.vortex-pulse-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
  transition: all 0.5s ease;
}

.pulse-sovereign {
  background-color: var(--matrix-green);
  box-shadow: 0 0 8px var(--matrix-green);
  animation: breathe-green 4s infinite ease-in-out;
}
.pulse-monitored {
  background-color: var(--warning-yellow);
  box-shadow: 0 0 8px var(--warning-yellow);
  animation: breathe-yellow 1.5s infinite ease-in-out;
}
.pulse-contained {
  background-color: var(--containment-red);
  box-shadow: 0 0 10px var(--containment-red);
  animation: glitch-red 0.1s infinite;
}


/* ═══════════════════════════════════════════
   12. STATUS MESSAGES / TOASTS
   Used by: Forge, Exchange, Rooms
   ═══════════════════════════════════════════ */
.status-msg {
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 16px;
  font-size: 0.85rem;
  display: none;
}
.status-msg.show { display: block; }
.status-msg.success { background: rgba(0,255,65,0.1); border: 1px solid var(--matrix-green); color: var(--matrix-green); }
.status-msg.error   { background: rgba(255,68,68,0.1); border: 1px solid var(--red-bright); color: var(--red-bright); }
.status-msg.info    { background: rgba(0,191,255,0.1); border: 1px solid var(--blue); color: var(--blue); }

.toast {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--matrix-green);
  color: #e0e0e0;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 11px;
  z-index: 500;
  animation: toastIn 0.3s ease;
  max-width: 90%;
  text-align: center;
}
.toast.error { border-color: var(--red-bright); }

.error-banner {
  padding: var(--space-12);
  border-radius: var(--radius-12);
  border: 1px solid rgba(220, 20, 60, 0.6);
  background: rgba(220, 20, 60, 0.1);
  color: var(--white);
}
.error-banner button { margin-top: var(--space-9); }


/* ═══════════════════════════════════════════
   13. MODAL SYSTEM
   Used by: Forge, Exchange, Rooms, Wallet
   ═══════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(6px);
}
.modal-overlay.show,
.modal-overlay.visible { display: flex; }
.modal-overlay.hidden  { display: none; }

.modal,
.modal-box {
  background: var(--surface);
  border: 1px solid #333;
  border-radius: 16px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-soft);
  animation: modalIn 200ms ease-out;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal-header h2 { color: var(--gold-dim); font-size: 1.1rem; margin: 0; }

.modal-close {
  background: none;
  border: none;
  color: #666;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.modal-close:hover { color: var(--white); }

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-9);
  justify-content: flex-end;
  margin-top: var(--space-18);
}


/* ═══════════════════════════════════════════
   14. SOUL CHARGE BAR
   Used by: Exchange listings, Room card burns
   ═══════════════════════════════════════════ */
.soul-display {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  margin-bottom: var(--space-9);
}
.soul-label {
  font-size: 0.65rem;
  color: var(--slate);
  text-transform: uppercase;
}
.soul-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}
.soul-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}
.soul-fill.mythic  { background: linear-gradient(90deg, var(--gold), #ffdd66); }
.soul-fill.healthy { background: linear-gradient(90deg, var(--matrix-green), #44ff88); }
.soul-fill.warning { background: linear-gradient(90deg, var(--amber), #ffcc44); }
.soul-fill.critical { background: linear-gradient(90deg, var(--red), #ff6666); }

.soul-value {
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 32px;
  text-align: right;
}
.soul-value.mythic  { color: var(--gold); }
.soul-value.healthy { color: var(--matrix-green); }
.soul-value.warning { color: var(--amber); }
.soul-value.critical { color: var(--red); }


/* ═══════════════════════════════════════════
   15. WALLET CARDS
   Used by: Wallet
   ═══════════════════════════════════════════ */
.wallet-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-9);
}

.wallet-card {
  position: relative;
  border-radius: var(--radius-12);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(13, 13, 26, 0.7);
  aspect-ratio: 2 / 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-9);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.wallet-card .slot   { font-size: 12px; color: var(--slate); }
.wallet-card .charge { font-size: 24px; font-weight: 700; color: var(--blue); }
.wallet-card .label  { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--silver); }

.wallet-card.charge-9 { box-shadow: var(--shadow-gold); border-color: rgba(255, 215, 0, 0.6); }
.wallet-card.charge-6 { opacity: 0.85; }
.wallet-card.charge-5,
.wallet-card.charge-4 { border-color: rgba(255, 191, 0, 0.6); animation: crackle 2000ms linear infinite; }
.wallet-card.charge-3 { border-color: rgba(255, 165, 0, 0.8); animation: pulse 1000ms ease-in-out infinite; }
.wallet-card.charge-critical {
  border-color: rgba(220, 20, 60, 0.9);
  color: var(--red);
  animation: criticalPulse 600ms linear infinite;
}
.wallet-card.charge-critical .charge { color: var(--red); }

.wallet-card.secured {
  border-color: rgba(255, 215, 0, 0.85);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.35);
  background: rgba(255, 215, 0, 0.08);
  animation: none;
}
.wallet-card.secured .label { color: var(--gold); }
.wallet-card.secured .shield-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--gold);
  border: 1px solid rgba(255, 215, 0, 0.6);
  border-radius: 999px;
  padding: 2px 6px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.charge-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}
.charge-bar span { display: block; height: 100%; background: var(--blue); }
.wallet-card.charge-9 .charge-bar span        { background: var(--gold); }
.wallet-card.charge-3 .charge-bar span        { background: var(--amber); }
.wallet-card.charge-critical .charge-bar span  { background: var(--red); }


/* ═══════════════════════════════════════════
   16. NE-CARD (Non-Eternal Card Component)
   Used by: Forge preview, Card displays
   ═══════════════════════════════════════════ */
.ne-card {
  --rarity-color: #888;
  --rarity-glow: rgba(136, 136, 136, 0.4);
  width: 100%;
  max-width: 280px;
  aspect-ratio: 2/3;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 0 0 2px var(--rarity-color), 0 0 20px var(--rarity-glow), 0 8px 32px rgba(0, 0, 0, 0.6);
}
.ne-card:hover { transform: translateY(-4px); }
.ne-card.common   { --rarity-color: #a0a0a0; --rarity-glow: rgba(160, 160, 160, 0.3); }
.ne-card.uncommon { --rarity-color: #00ff41;  --rarity-glow: rgba(0, 255, 65, 0.35); }
.ne-card.rare     { --rarity-color: #00bfff;  --rarity-glow: rgba(0, 191, 255, 0.4); }
.ne-card.mythic   { --rarity-color: #ffd700;  --rarity-glow: rgba(255, 215, 0, 0.5); animation: mythicCardPulse 3s ease-in-out infinite; }

.ne-card-art    { position: absolute; inset: 0; background-size: cover; background-position: center; background-color: #1a1a2e; z-index: 1; }
.ne-card-top    { position: absolute; top: 0; left: 0; right: 0; padding: 14px 12px 28px; background: linear-gradient(to bottom, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.4) 60%, transparent 100%); z-index: 2; }
.ne-card-name   { font-size: 1rem; font-weight: 600; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.9); padding-right: 30px; }
.ne-card-bottom { position: absolute; bottom: 0; left: 0; right: 0; padding: 28px 12px 12px; background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.5) 50%, transparent 100%); z-index: 2; }
.ne-card-lore   { font-size: 0.75rem; color: rgba(255,255,255,0.9); line-height: 1.4; font-style: italic; text-shadow: 0 1px 4px rgba(0,0,0,0.9); }
.ne-card-rarity { position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 50%; background: var(--rarity-color); z-index: 3; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: bold; color: #000; box-shadow: 0 0 12px var(--rarity-glow); }
.ne-card-soul   { position: absolute; bottom: 55px; right: 10px; background: rgba(0,0,0,0.75); padding: 4px 8px; border-radius: 4px; font-size: 0.7rem; color: var(--matrix-green); font-weight: bold; z-index: 3; border: 1px solid rgba(0,255,65,0.3); }
.ne-card-watermark { position: absolute; bottom: 6px; right: 8px; font-size: 0.5rem; color: rgba(255,255,255,0.12); letter-spacing: 1px; z-index: 2; font-weight: bold; }

/* =========================================
   ETERNAL CARDS: FULL ART BORDERLESS
   ========================================= */
.ne-card.eternal {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 25px var(--rarity-glow);
  border: none;
}
.ne-card.eternal .ne-card-top {
  background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 100%);
  padding-bottom: 40px; 
}
.ne-card.eternal .ne-card-bottom {
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 100%);
  padding-top: 40px;
}
.ne-card.eternal .ne-card-name,
.ne-card.eternal .ne-card-lore {
  text-shadow: 0px 2px 4px #000, 0px 0px 8px #000;
}


/* ═══════════════════════════════════════════
   17. SANCTUARY
   Used by: Sanctuary
   ═══════════════════════════════════════════ */
.sanctuary-card {
  background: linear-gradient(135deg, rgba(138, 43, 226, 0.1), rgba(75, 0, 130, 0.2));
  border: 2px solid #8a2be2;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}
.sanctuary-card:hover {
  border-color: #a855f7;
  box-shadow: var(--shadow-purple);
}

.oracle-chat {
  background: rgba(30, 30, 30, 0.9);
  border: 1px solid #333;
  border-radius: 12px;
  margin-bottom: 20px;
  overflow: hidden;
}

.chat-messages {
  max-height: 400px;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 120px;
}

.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}
.chat-msg.oracle {
  align-self: flex-start;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #333;
  color: #c9c9c9;
}
.chat-msg.user {
  align-self: flex-end;
  background: rgba(138, 43, 226, 0.3);
  border: 1px solid #8a2be2;
  color: #e0e0e0;
}


/* ═══════════════════════════════════════════
   18. HARMONY COUNTER GRID (Resonance)
   ═══════════════════════════════════════════ */
.harmony-counter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.harmony-counter-grid .all-time { grid-column: 1 / -1; }

.harmony-item {
  background: var(--bg);
  border: 1px solid #1a1a2e;
  border-radius: var(--radius-6);
  padding: 14px 10px;
  text-align: center;
}
.harmony-item .h-val {
  font-family: monospace;
  font-size: 1.4rem;
  color: var(--matrix-green);
}
.harmony-item.all-time .h-val { font-size: 2rem; }
.harmony-item .h-lbl {
  font-size: 0.65rem;
  color: #555;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}


/* ═══════════════════════════════════════════
   19. ORACLE PULSE SECTION
   ═══════════════════════════════════════════ */
.oracle-pulse {
  position: relative;
  overflow: hidden;
}
.oracle-pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.15), transparent 70%);
  opacity: 0;
  transform: scale(0.6);
  pointer-events: none;
}
.oracle-pulse.pulse-active::after {
  animation: oraclePulse 1500ms ease-in-out;
}


/* ═══════════════════════════════════════════
   20. FILTER CHIPS
   Used by: Rooms, Exchange browse
   ═══════════════════════════════════════════ */
.filter-bar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--surface-border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.filter-bar::-webkit-scrollbar { display: none; }

.filter-chip {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 10px;
  color: #aaa;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.filter-chip:hover { border-color: var(--matrix-green); color: #ddd; }
.filter-chip.active { background: var(--matrix-green); color: #000; border-color: var(--matrix-green); font-weight: bold; }


/* ═══════════════════════════════════════════
   21. IMAGE UPLOAD AREA
   Used by: Forge, Room editor
   ═══════════════════════════════════════════ */
.image-upload-area {
  border: 2px dashed #333;
  border-radius: 12px;
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg);
}
.image-upload-area:hover {
  border-color: var(--gold-dim);
  background: rgba(245, 200, 66, 0.03);
}
.image-upload-area.has-image {
  border-style: solid;
  border-color: var(--matrix-green);
}
.image-upload-area input { display: none; }

.upload-icon { font-size: 2rem; margin-bottom: 8px; }
.upload-text { font-size: 0.85rem; color: #888; }
.upload-text strong { color: var(--gold-dim); }

.image-preview-thumb {
  max-width: 100%;
  max-height: 150px;
  border-radius: 8px;
  margin-top: 10px;
}


/* ═══════════════════════════════════════════
   22. COST DISPLAY
   Used by: Forge, Exchange
   ═══════════════════════════════════════════ */
.cost-display {
  background: var(--bg);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  padding: 12px;
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cost-label { font-size: 0.8rem; color: #888; }
.cost-value { font-size: 1.1rem; color: var(--gold-dim); font-weight: bold; }


/* ═══════════════════════════════════════════
   23. DESIGNS / CARD GRIDS
   Used by: Forge my-designs, Discover
   ═══════════════════════════════════════════ */
.designs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.design-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.2s;
}
.design-card:hover { border-color: var(--gold-dim); transform: translateY(-2px); }

.design-card-image {
  aspect-ratio: 2/3;
  background-size: cover;
  background-position: center;
  background-color: #1a1a2e;
}

.design-card-info { padding: 12px; }

.design-card-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.design-card-status {
  font-size: 0.65rem;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
}
.status-draft    { background: #333; color: #888; }
.status-pending  { background: #3a3a1a; color: var(--gold-dim); }
.status-approved { background: #1a3a1a; color: var(--matrix-green); }
.status-rejected { background: #3a1a1a; color: var(--red-bright); }


/* ═══════════════════════════════════════════
   24. LISTING CARDS (Exchange/Marketplace)
   ═══════════════════════════════════════════ */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-12);
}

.listing-card {
  background: var(--surface-light);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-12);
  padding: var(--space-12);
  transition: all 0.3s;
  position: relative;
}
.listing-card:hover { border-color: var(--matrix-green); }

.listing-card.rarity-mythic {
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
  animation: mythicGlow 3s ease-in-out infinite;
}
.listing-card.charge-critical {
  border-color: var(--red);
  box-shadow: 0 0 15px rgba(220, 20, 60, 0.4);
  animation: criticalPulse 1.5s ease-in-out infinite;
}
.listing-card.charge-warning {
  border-color: var(--amber);
  box-shadow: 0 0 10px rgba(255, 165, 0, 0.3);
}

.rarity-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  font-weight: 700;
}
.rarity-badge.common   { background: rgba(128, 128, 128, 0.3); color: var(--slate); }
.rarity-badge.uncommon { background: rgba(0, 255, 65, 0.2); color: var(--matrix-green); }
.rarity-badge.rare     { background: rgba(0, 191, 255, 0.2); color: var(--blue); }
.rarity-badge.mythic   { background: rgba(255, 215, 0, 0.2); color: var(--gold); }

/* Rarity text colors */
.rarity-mythic   { color: #ffd700; }
.rarity-rare     { color: #00bfff; }
.rarity-uncommon { color: #00ff41; }
.rarity-common   { color: #a0a0a0; }


/* ═══════════════════════════════════════════
   25. LOCKED FEATURE OVERLAY
   Used by: Forge
   ═══════════════════════════════════════════ */
.locked-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 12px;
}
.locked-overlay .lock-icon { font-size: 3rem; margin-bottom: 16px; }
.locked-overlay h3 { color: var(--gold-dim); margin-bottom: 8px; }
.locked-overlay p { color: #888; font-size: 0.85rem; text-align: center; max-width: 250px; line-height: 1.5; }
.locked-overlay .upgrade-btn {
  margin-top: 16px;
  padding: 10px 24px;
  background: var(--gold-dim);
  color: #000;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}


/* ═══════════════════════════════════════════
   26. ADMIN SECTIONS
   Used by: Forge admin tab
   ═══════════════════════════════════════════ */
.admin-section {
  background: linear-gradient(135deg, #1a0a0a, var(--bg));
  border: 1px solid #441111;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}
.admin-section h2 {
  color: var(--red-bright);
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #441111;
}
.admin-badge {
  font-size: 0.6rem;
  background: var(--red-bright);
  color: #000;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
}


/* ═══════════════════════════════════════════
   27. PROGRESS BARS
   ═══════════════════════════════════════════ */
.set-progress { margin-top: 16px; }
.set-progress-label {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}
.set-progress-bar {
  height: 8px;
  background: var(--surface-border);
  border-radius: 4px;
  overflow: hidden;
}
.set-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--matrix-green));
  border-radius: 4px;
  transition: width 0.3s;
}


/* ═══════════════════════════════════════════
   28. EMPTY STATES
   Used by: Forge, Exchange, Rooms
   ═══════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #555;
}
.empty-state .icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 { color: #888; margin-bottom: 8px; }
.empty-state .hint {
  margin-top: var(--space-12);
  font-size: 0.8rem;
  color: rgba(255, 215, 0, 0.5);
  font-style: italic;
}


/* ═══════════════════════════════════════════
   29. SPINNER / SKELETON / LOADING
   ═══════════════════════════════════════════ */
.spinner,
.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.06), rgba(255,255,255,0.12), rgba(255,255,255,0.06));
  background-size: 200% 100%;
  animation: shimmer 1200ms ease-in-out infinite;
  border-radius: var(--radius-9);
  min-height: 18px;
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  color: #888;
}


/* ═══════════════════════════════════════════
   30. LAYOUT UTILITIES
   ═══════════════════════════════════════════ */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: var(--space-18);
  padding: var(--space-18);
  padding-bottom: 84px;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
}

.topbar .title-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.muted  { color: var(--slate); }

.grid   { display: grid; gap: var(--space-12); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.stack { display: flex; flex-direction: column; gap: var(--space-12); }
.row   { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-12); }

.status-tag {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.pad-bottom { padding-bottom: 70px; }


/* ═══════════════════════════════════════════
   31. GATEWAY / INDEX PAGE
   ═══════════════════════════════════════════ */
.gateway-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  background: radial-gradient(circle at center, #1a1a2e 0%, #000 100%);
}

.system-title {
  font-family: var(--font-terminal);
  font-size: 3rem;
  letter-spacing: 0.5rem;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 20px var(--blue);
}

.system-subtitle {
  color: var(--slate);
  letter-spacing: 0.2rem;
  text-transform: uppercase;
  font-size: 0.9rem;
  margin-bottom: 3rem;
}

.status-panel {
  border: 1px solid #333;
  background: rgba(0, 0, 0, 0.6);
  padding: 2rem;
  border-radius: var(--radius-12);
  width: 100%;
  max-width: 500px;
  backdrop-filter: blur(10px);
  margin-bottom: 2rem;
  transition: border-color 0.5s ease;
}

.status-label {
  font-family: var(--font-terminal);
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.status-detail {
  font-size: 0.9rem;
  color: var(--silver);
  margin-bottom: 0.5rem;
}

.interference-meter {
  font-family: var(--font-terminal);
  font-size: 0.8rem;
  color: var(--slate);
  margin-top: 1.5rem;
  border-top: 1px solid #333;
  padding-top: 1rem;
}

.enter-btn {
  display: inline-block;
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 1rem 3rem;
  font-family: var(--font-terminal);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: bold;
  text-decoration: none;
  transition: all 0.3s ease;
}
.enter-btn:hover {
  background: var(--gold);
  color: #000;
  box-shadow: 0 0 20px var(--gold);
  text-decoration: none;
}


/* ═══════════════════════════════════════════
   32. NAVIGATION (CSS-only fallback)
   components.js overrides this with its own nav
   ═══════════════════════════════════════════ */
.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(13, 13, 26, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: var(--space-9) var(--space-12);
  display: flex;
  justify-content: space-around;
  gap: var(--space-6);
  z-index: 40;
}

.nav a {
  color: var(--silver);
  font-size: 12px;
  text-align: center;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s;
}
.nav a:hover { color: var(--gold-dim); background: rgba(245, 200, 66, 0.1); }
.nav a.active { color: var(--gold); }


/* ═══════════════════════════════════════════
   33. RED BOX (Bible Section 04.5)
   ═══════════════════════════════════════════ */
body.red-box::before {
  content: "";
  position: fixed;
  inset: 0;
  border: 2px solid rgba(220, 20, 60, 0.8);
  pointer-events: none;
  z-index: 60;
  animation: redBoxPulse 500ms linear 3;
}


/* ═══════════════════════════════════════════
   34. SCROLLBAR
   ═══════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 215, 0, 0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 215, 0, 0.4); }


/* ═══════════════════════════════════════════
   35. DESKTOP BREAKPOINT
   ═══════════════════════════════════════════ */
@media (min-width: 768px) {
  .builder-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
  }
}

@media (min-width: 1024px) {
  .app {
    max-width: 1200px;
    margin: 0 auto;
    padding: calc(var(--space-27) + 54px) var(--space-27) var(--space-27);
  }

  .nav {
    position: fixed;
    top: 0;
    bottom: auto;
    border-top: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    justify-content: flex-start;
    gap: var(--space-18);
    padding: var(--space-12) var(--space-27);
  }
  .nav a { font-size: 14px; }
}


/* ═══════════════════════════════════════════
   36. ALL KEYFRAMES
   ═══════════════════════════════════════════ */
@keyframes breathe-green {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}
@keyframes breathe-yellow {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
@keyframes glitch-red {
  0% { transform: translate(0,0); opacity: 1; }
  25% { transform: translate(-1px, 1px); opacity: 0.8; }
  50% { transform: translate(1px, -1px); opacity: 1; }
  75% { transform: translate(-1px, -1px); opacity: 0.8; }
  100% { transform: translate(0,0); opacity: 1; }
}
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.02); opacity: 1; }
  100% { transform: scale(1); opacity: 0.9; }
}
@keyframes criticalPulse {
  0% { box-shadow: var(--shadow-red); }
  50% { box-shadow: 0 0 24px rgba(220, 20, 60, 0.8); }
  100% { box-shadow: var(--shadow-red); }
}
@keyframes crackle {
  0% { filter: brightness(1); }
  50% { filter: brightness(1.2); }
  100% { filter: brightness(1); }
}
@keyframes oraclePulse {
  0% { opacity: 0; transform: scale(0.6); }
  30% { opacity: 0.15; }
  100% { opacity: 0; transform: scale(1.4); }
}
@keyframes modalIn {
  from { transform: translateY(12px); opacity: 0.7; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes redBoxPulse {
  0% { opacity: 0.2; }
  50% { opacity: 1; }
  100% { opacity: 0.2; }
}
@keyframes shimmer {
  0% { background-position: 0% 0; }
  100% { background-position: -200% 0; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes mythicGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.3); }
  50% { box-shadow: 0 0 35px rgba(255, 215, 0, 0.5); }
}
@keyframes mythicCardPulse {
  0%, 100% { box-shadow: 0 0 0 2px #ffd700, 0 0 20px rgba(255, 215, 0, 0.5), 0 8px 32px rgba(0, 0, 0, 0.6); }
  50% { box-shadow: 0 0 0 2px #ffd700, 0 0 40px rgba(255, 215, 0, 0.7), 0 8px 32px rgba(0, 0, 0, 0.6); }
}
@keyframes rarity-glow {
  0%, 100% { box-shadow: 0 0 12px rgba(255, 215, 0, 0.6); }
  50% { box-shadow: 0 0 24px rgba(255, 215, 0, 0.9); }
}
.ne-card.mythic .ne-card-rarity { animation: rarity-glow 2s ease-in-out infinite; }


/* ═══════════════════════════════════════════
   37. REDUCED MOTION
   ═══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .oracle-pulse::after { display: none; }
}
