

:root {
  --bg-void: #04020D;
  --bg-deep: #070412;
  --bg-mid: #0E0920;
  --bg-surface: #130C28;
  --bg-card: rgba(16, 9, 32, 0.88);
  --bg-input: rgba(22, 12, 42, 0.75);
  --crimson: #9B1B1B;
  --crimson-bright: #C41E3A;
  --crimson-glow: rgba(196, 30, 58, 0.25);
  --gold: #C9A84C;
  --gold-bright: #E6C55A;
  --gold-glow: rgba(201, 168, 76, 0.2);
  --purple-deep: #1D112A;
  --purple-mid: #4A1880;
  --purple-light: #9B6EDB;
  --purple-glow: rgba(74, 24, 128, 0.35);
  --text-primary: #F0E6FF;
  --text-secondary: #C4A8D4;
  --text-muted: #7A5F8A;
  --text-gold: #D4B86A;
  --border-subtle: rgba(140, 90, 200, 0.15);
  --border-gold: rgba(201, 168, 76, 0.3);
  --border-crimson: rgba(196, 30, 58, 0.3);
  --scrollbar-thumb: #2E1550;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Raleway', sans-serif;
  background: var(--bg-void);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── COSMIC BACKGROUND ─── */
#cosmos {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 60% 65% at 5% 42%,  #2E1155 0%, #1C0A38 35%, transparent 65%),
    radial-gradient(ellipse 45% 50% at 96% 38%, #26104A 0%, #160830 40%, transparent 68%),
    radial-gradient(ellipse 30% 25% at 50% 2%,  #1A0B30 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 50% 100%,#160928 0%, transparent 60%),
    radial-gradient(ellipse 30% 35% at 15% 80%, #1E0C35 0%, transparent 60%),
    var(--bg-void);
  pointer-events: none;
  overflow: hidden;
}
/* Star field */
#cosmos::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(1.2px 1.2px at 8%  12%, rgba(255,255,255,0.80) 0%, transparent 100%),
    radial-gradient(1px   1px   at 19%  4%, rgba(255,255,255,0.55) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 32% 22%, rgba(255,255,255,0.65) 0%, transparent 100%),
    radial-gradient(1px   1px   at 48%  8%, rgba(255,255,255,0.50) 0%, transparent 100%),
    radial-gradient(1px   1px   at 63% 18%, rgba(255,255,255,0.60) 0%, transparent 100%),
    radial-gradient(1.2px 1.2px at 77%  6%, rgba(255,255,255,0.70) 0%, transparent 100%),
    radial-gradient(1px   1px   at 91% 14%, rgba(255,255,255,0.45) 0%, transparent 100%),
    radial-gradient(1px   1px   at 5%  55%, rgba(255,255,255,0.38) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 25% 48%, rgba(255,255,255,0.52) 0%, transparent 100%),
    radial-gradient(1px   1px   at 42% 65%, rgba(255,255,255,0.42) 0%, transparent 100%),
    radial-gradient(1px   1px   at 58% 72%, rgba(255,255,255,0.48) 0%, transparent 100%),
    radial-gradient(1.2px 1.2px at 74% 58%, rgba(255,255,255,0.58) 0%, transparent 100%),
    radial-gradient(1px   1px   at 88% 80%, rgba(255,255,255,0.38) 0%, transparent 100%),
    radial-gradient(1px   1px   at 14% 85%, rgba(255,255,255,0.42) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 38% 90%, rgba(255,255,255,0.52) 0%, transparent 100%),
    radial-gradient(1px   1px   at 67% 92%, rgba(255,255,255,0.38) 0%, transparent 100%),
    radial-gradient(1px   1px   at 3%  28%, rgba(255,255,255,0.45) 0%, transparent 100%),
    radial-gradient(1px   1px   at 82% 35%, rgba(255,255,255,0.40) 0%, transparent 100%),
    radial-gradient(2px   2px   at 3%  30%, rgba(220,180,80,0.60)  0%, transparent 100%),
    radial-gradient(2px   2px   at 96% 20%, rgba(220,180,80,0.55)  0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 52%  3%, rgba(220,180,80,0.50)  0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 85% 65%, rgba(200,160,70,0.45)  0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 10% 92%, rgba(200,160,70,0.40)  0%, transparent 100%);
}

/* ─── LAYOUT ─── */
#app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

/* ─── HEADER ─── */
#header {
  padding: 8px 40px 8px 20px;
  border-bottom: 1px solid rgba(100,60,180,0.12);
  background: linear-gradient(180deg, rgba(4,2,13,0.75) 0%, rgba(6,3,16,0.5) 100%);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}

.header-brand {
  display: flex; align-items: center; gap: 20px;
}

.oracle-sigil {
  width: 52px; height: 52px; flex-shrink: 0;
}

.header-text h1 {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--crimson-bright) 50%, var(--purple-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.header-text .subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  margin-top: 4px;
}

/* ─── NAV ─── */
#nav {
  display: flex; gap: 4px; align-items: center;
  background: rgba(10, 4, 24, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: 50px;
  padding: 4px;
}

.nav-btn {
  background: transparent; border: none; cursor: pointer;
  font-family: 'Raleway', sans-serif;
  font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: 50px;
  transition: all 0.3s ease;
  display: flex; align-items: center; gap: 7px;
  text-transform: uppercase;
}
.nav-btn:hover { color: var(--text-secondary); background: rgba(91,31,168,0.2); }
.nav-btn.active {
  color: var(--text-gold);
  background: linear-gradient(135deg, rgba(155,27,27,0.5), rgba(91,31,168,0.5));
  border: 1px solid rgba(201,168,76,0.25);
  box-shadow: 0 0 15px rgba(196,30,58,0.2), inset 0 0 10px rgba(91,31,168,0.1);
}

/* ─── MAIN CONTENT ─── */
#main { flex: 1; padding: 32px 40px; max-width: 1100px; margin: 0 auto; width: 100%; }

/* ─── CARDS ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  overflow: hidden;
}
.card-gold { border-color: var(--border-gold); }
.card-crimson { border-color: var(--border-crimson); }

/* ─── SECTION HEADERS ─── */
.section-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.1rem;
  color: var(--text-gold);
  letter-spacing: 0.12em;
  display: flex; align-items: center; gap: 10px;
}
.section-title::after {
  content: '';
  flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--border-gold), transparent);
}

/* ─── FORMS ─── */
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-label {
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--text-muted);
}
.form-input, .form-select, .form-textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: 'Raleway', sans-serif;
  font-size: 0.9rem;
  padding: 12px 16px;
  transition: all 0.3s;
  outline: none;
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: rgba(91,31,168,0.5);
  box-shadow: 0 0 0 3px rgba(91,31,168,0.1), 0 0 20px rgba(91,31,168,0.1);
}
.form-textarea { resize: vertical; min-height: 100px; line-height: 1.6; }
.form-select { appearance: none; cursor: pointer; }
.form-select option { background: #0F0620; }

/* ─── BUTTONS ─── */
.btn {
  border: none; cursor: pointer; font-family: 'Raleway', sans-serif;
  font-weight: 600; letter-spacing: 0.08em; border-radius: 50px;
  transition: all 0.3s; display: inline-flex; align-items: center; gap: 8px;
  text-transform: uppercase; font-size: 0.8rem;
}
.btn-primary {
  background: linear-gradient(135deg, var(--crimson) 0%, #7B1558 50%, var(--purple-mid) 100%);
  color: var(--text-primary); padding: 12px 28px;
  box-shadow: 0 4px 20px rgba(155,27,27,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 25px rgba(155,27,27,0.45); }
.btn-gold {
  background: linear-gradient(135deg, #8B6914, #C9A84C);
  color: #0D0420; padding: 12px 28px;
  box-shadow: 0 4px 20px rgba(201,168,76,0.2);
}
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 6px 25px rgba(201,168,76,0.35); }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary); padding: 10px 20px;
}
.btn-ghost:hover { border-color: var(--purple-mid); color: var(--purple-light); background: rgba(91,31,168,0.1); }
.btn-sm { padding: 7px 16px !important; font-size: 0.72rem !important; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

/* ─── HYPNOSNYX LOGO ─── */
.header-logo-img {
  height: 140px;
  width: auto;
  object-fit: contain;
  mix-blend-mode: screen;
  filter: brightness(1.1) saturate(1.15);
  display: block;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }

/* ─── JOURNAL VIEW ─── */
#view-journal { }
.journal-layout { display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start; }
.dream-form-card { padding: 28px; }
.dream-form-card .section-title { margin-bottom: 22px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.add-dream-btn { margin-top: 8px; width: 100%; justify-content: center; }

.dreams-list-card { padding: 24px; }
.dreams-list-card .section-title { margin-bottom: 18px; }
.dreams-empty {
  text-align: center; padding: 40px 20px;
  color: var(--text-muted); font-style: italic;
  font-family: 'Cormorant Garamond', serif; font-size: 1rem;
}

.dream-item {
  background: rgba(10, 4, 24, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 12px; padding: 16px; margin-bottom: 10px;
  cursor: pointer; transition: all 0.25s;
}
.dream-item:hover { border-color: rgba(201,168,76,0.25); background: rgba(20, 8, 48, 0.8); }
.dream-item-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.dream-item-title {
  font-family: 'Cormorant Garamond', serif; font-size: 1rem; font-weight: 600;
  color: var(--text-primary); line-height: 1.3;
}
.dream-item-date { font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; margin-top: 2px; }
.dream-item-preview { font-size: 0.8rem; color: var(--text-muted); margin-top: 8px; line-height: 1.5; }
.dream-item-tags { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.dream-tag {
  font-size: 0.65rem; padding: 3px 10px; border-radius: 20px; letter-spacing: 0.08em;
  text-transform: uppercase; font-weight: 600;
}
.tag-recurring { background: rgba(196,30,58,0.2); border: 1px solid rgba(196,30,58,0.3); color: var(--crimson-bright); }
.tag-interpreted { background: rgba(91,31,168,0.2); border: 1px solid rgba(91,31,168,0.3); color: var(--purple-light); }

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(3, 1, 6, 0.85); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: linear-gradient(145deg, #0A0618, #110825);
  border: 1px solid var(--border-gold);
  border-radius: 20px; max-width: 700px; width: 100%;
  max-height: 85vh; overflow-y: auto;
  box-shadow: 0 0 60px rgba(91,31,168,0.3), 0 0 120px rgba(155,27,27,0.15);
  animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header { padding: 28px 28px 0; display: flex; justify-content: space-between; align-items: flex-start; }
.modal-title { font-family: 'Cormorant Garamond', serif; font-size: 1.5rem; font-weight: 600; color: var(--text-gold); }
.modal-date { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.3rem; padding: 4px; }
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 24px 28px 28px; }
.modal-dream-text {
  font-family: 'Cormorant Garamond', serif; font-size: 1.05rem;
  line-height: 1.8; color: var(--text-secondary); font-style: italic;
  background: rgba(10,4,24,0.5); border-radius: 12px; padding: 20px;
  border: 1px solid var(--border-subtle); margin-bottom: 20px;
}
.modal-interp-label {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.modal-interp-label span {
  padding: 2px 10px; border-radius: 20px;
}
.label-spiritual { background: rgba(91,31,168,0.25); color: var(--purple-light); border: 1px solid rgba(91,31,168,0.3); }
.label-psych { background: rgba(196,30,58,0.2); color: var(--crimson-bright); border: 1px solid rgba(196,30,58,0.3); }
.modal-interp-text {
  font-family: 'Cormorant Garamond', serif; font-size: 1rem;
  line-height: 1.8; color: var(--text-primary);
  white-space: pre-wrap;
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-subtle); }

/* ─── INTERPRET VIEW ─── */
#view-interpret { }
.interpret-layout { display: flex; flex-direction: column; height: calc(100vh - 200px); gap: 16px; }
.chat-area {
  flex: 1; overflow-y: auto; padding: 20px;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: 16px; display: flex; flex-direction: column; gap: 20px;
}

.chat-welcome {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; flex: 1; text-align: center; padding: 40px;
}
.chat-welcome .oracle-sigil-lg { margin-bottom: 24px; opacity: 0.7; }
.chat-welcome h2 {
  font-family: 'Cinzel Decorative', serif; font-size: 1.2rem;
  color: var(--text-gold); letter-spacing: 0.1em; margin-bottom: 12px;
}
.chat-welcome p {
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  color: var(--text-muted); font-size: 1rem; line-height: 1.7; max-width: 480px;
}

.msg { display: flex; gap: 14px; align-items: flex-start; animation: msgIn 0.3s ease; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.msg-user { flex-direction: row-reverse; }
.msg-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.msg-avatar-ai {
  background: linear-gradient(135deg, var(--purple-deep), var(--crimson));
  border: 1px solid rgba(201,168,76,0.3);
}
.msg-avatar-user {
  background: linear-gradient(135deg, #1a0535, #2D0050);
  border: 1px solid var(--border-subtle);
}
.msg-bubble {
  max-width: 75%; padding: 14px 18px; border-radius: 16px;
  font-family: 'Cormorant Garamond', serif; font-size: 1.02rem; line-height: 1.75;
}
.msg-bubble-ai {
  background: rgba(30, 10, 60, 0.8); border: 1px solid var(--border-subtle);
  color: var(--text-primary); border-radius: 4px 16px 16px 16px;
}
.msg-bubble-user {
  background: rgba(155, 27, 27, 0.25); border: 1px solid rgba(196,30,58,0.2);
  color: var(--text-secondary); border-radius: 16px 4px 16px 16px;
  font-style: italic;
}

.typing-indicator { display: flex; gap: 5px; padding: 6px 0; align-items: center; }
.typing-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--purple-light); animation: typingPulse 1.2s ease infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingPulse { 0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }

.chat-controls {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: 16px; padding: 16px;
}
.chat-top-row { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.interp-mode-btns { display: flex; gap: 8px; }
.mode-btn {
  font-family: 'Raleway', sans-serif; font-size: 0.72rem;
  font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 7px 14px; border-radius: 20px; cursor: pointer;
  transition: all 0.25s; border: 1px solid transparent;
  background: transparent;
}
.mode-btn-spiritual { color: var(--purple-light); border-color: rgba(91,31,168,0.3); }
.mode-btn-spiritual.active { background: rgba(91,31,168,0.25); border-color: var(--purple-mid); box-shadow: 0 0 10px rgba(91,31,168,0.2); }
.mode-btn-psych { color: var(--crimson-bright); border-color: rgba(196,30,58,0.3); }
.mode-btn-psych.active { background: rgba(196,30,58,0.2); border-color: var(--crimson-bright); box-shadow: 0 0 10px rgba(196,30,58,0.15); }
.mode-btn-both { color: var(--text-gold); border-color: var(--border-gold); }
.mode-btn-both.active { background: rgba(201,168,76,0.15); border-color: var(--gold); box-shadow: 0 0 10px rgba(201,168,76,0.15); }

.chat-input-row { display: flex; gap: 12px; align-items: flex-end; }
.chat-textarea {
  flex: 1; background: var(--bg-input); border: 1px solid var(--border-subtle);
  border-radius: 12px; color: var(--text-primary);
  font-family: 'Cormorant Garamond', serif; font-size: 1rem; font-style: italic;
  padding: 12px 16px; outline: none; resize: none; min-height: 52px; max-height: 160px;
  line-height: 1.6; transition: border-color 0.3s;
}
.chat-textarea:focus { border-color: rgba(91,31,168,0.5); }
.chat-textarea::placeholder { color: var(--text-muted); }
.send-btn {
  width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, var(--crimson), var(--purple-mid));
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; transition: all 0.3s; flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(155,27,27,0.3);
}
.send-btn:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(155,27,27,0.45); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.chat-hint { font-size: 0.72rem; color: var(--text-muted); margin-top: 8px; text-align: center; letter-spacing: 0.05em; }

/* ─── DICTIONARY VIEW ─── */
#view-dictionary { }
.dict-search-card { padding: 28px; margin-bottom: 24px; }
.dict-search-card .section-title { margin-bottom: 20px; }
.dict-search-row { display: flex; gap: 12px; }
.dict-search-row .form-input { flex: 1; }
.dict-result-card { padding: 28px; }
.dict-result-card .section-title { margin-bottom: 18px; }
.dict-symbol-name {
  font-family: 'Cinzel Decorative', serif; font-size: 1.6rem;
  color: var(--text-gold); margin-bottom: 20px; letter-spacing: 0.1em;
}
.dict-section {
  margin-bottom: 24px; padding: 20px;
  background: rgba(10,4,24,0.5); border-radius: 12px;
}
.dict-section-label {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.2em;
  text-transform: uppercase; margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.dict-section-label.spiritual { color: var(--purple-light); }
.dict-section-label.psych { color: var(--crimson-bright); }
.dict-section-label.universal { color: var(--text-gold); }
.dict-section p {
  font-family: 'Cormorant Garamond', serif; font-size: 1.02rem;
  line-height: 1.8; color: var(--text-secondary);
}
.dict-empty { text-align: center; padding: 40px; color: var(--text-muted); font-style: italic; font-family: 'Cormorant Garamond', serif; }
.dict-loading { text-align: center; padding: 30px; }

/* ─── BIRTH CHART VIEW ─── */
#view-birthchart { }
.bc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.bc-card { padding: 28px; }
.bc-card .section-title { margin-bottom: 22px; }
.bc-results-card { max-height: 80vh; overflow-y: auto; }
.bc-form-stack { display: flex; flex-direction: column; gap: 16px; }
.bc-save-row { display: flex; justify-content: flex-end; margin-top: 8px; }
.bc-summary {
  font-family: 'Cormorant Garamond', serif; font-size: 1rem; line-height: 1.9;
  color: var(--text-secondary);
}
.bc-planet { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border-subtle); }
.bc-planet:last-child { border-bottom: none; }
.bc-planet-name { color: var(--text-muted); font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; }
.bc-planet-value { color: var(--text-gold); font-family: 'Cormorant Garamond', serif; font-size: 1rem; font-style: italic; }
.bc-note {
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  color: var(--text-muted); font-size: 0.9rem; line-height: 1.7;
  padding: 16px; background: rgba(91,31,168,0.08); border-radius: 10px;
  border-left: 2px solid rgba(91,31,168,0.3); margin-top: 4px;
}

/* ─── PATTERNS BANNER ─── */
.patterns-banner {
  background: linear-gradient(135deg, rgba(155,27,27,0.15), rgba(91,31,168,0.15));
  border: 1px solid rgba(201,168,76,0.2); border-radius: 12px; padding: 16px 20px;
  margin-bottom: 24px; display: flex; align-items: center; gap: 14px;
}
.patterns-icon { font-size: 1.5rem; flex-shrink: 0; }
.patterns-text { font-family: 'Cormorant Garamond', serif; font-size: 0.95rem; line-height: 1.6; color: var(--text-secondary); }
.patterns-text strong { color: var(--text-gold); font-weight: 600; }

/* ─── PULSE ANIMATION ─── */
@keyframes cosmicPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
.pulse { animation: cosmicPulse 3s ease infinite; }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  #header { padding: 16px 20px; flex-direction: column; gap: 14px; }
  #main { padding: 20px; }
  .journal-layout { grid-template-columns: 1fr; }
  .bc-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  #nav { overflow-x: auto; padding: 4px; gap: 2px; }
  .nav-btn { padding: 8px 12px; font-size: 0.7rem; }
  .nav-btn span.nav-label { display: none; }
}


/* ─── AUTH SCREENS ─── */
#auth-screen {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: radial-gradient(ellipse 60% 65% at 5% 42%, #2E1155 0%, #1C0A38 35%, transparent 65%),
              radial-gradient(ellipse 45% 50% at 96% 38%, #26104A 0%, #160830 40%, transparent 68%),
              var(--bg-void);
}
.auth-box {
  background: rgba(16,9,32,0.95);
  border: 1px solid var(--border-gold);
  border-radius: 24px; padding: 44px 40px;
  width: 100%; max-width: 420px;
  box-shadow: 0 0 80px rgba(91,31,168,0.25), 0 0 160px rgba(155,27,27,0.1);
  backdrop-filter: blur(20px);
}
.auth-logo { display: block; width: 260px; margin: 0 auto 28px; mix-blend-mode: screen; filter: brightness(1.1); }
.auth-tabs { display: flex; border-bottom: 1px solid var(--border-subtle); margin-bottom: 28px; }
.auth-tab {
  flex: 1; background: none; border: none; cursor: pointer;
  font-family: 'Raleway', sans-serif; font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; padding: 12px;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  transition: all 0.25s;
}
.auth-tab.active { color: var(--text-gold); border-bottom-color: var(--gold); }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-divider {
  text-align: center; font-family: 'Cormorant Garamond', serif;
  font-style: italic; color: var(--text-muted); font-size: 0.85rem;
  margin: 4px 0; position: relative;
}
.auth-divider::before, .auth-divider::after {
  content: ''; position: absolute; top: 50%;
  width: 38%; height: 1px; background: var(--border-subtle);
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }
.auth-error {
  background: rgba(196,30,58,0.15); border: 1px solid var(--border-crimson);
  border-radius: 8px; padding: 10px 14px;
  font-size: 0.82rem; color: #F08080; line-height: 1.5; display: none;
}
.auth-success {
  background: rgba(74,128,76,0.15); border: 1px solid rgba(74,168,76,0.3);
  border-radius: 8px; padding: 10px 14px;
  font-size: 0.82rem; color: #90EE90; line-height: 1.5; display: none;
}
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #fff; border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50px; padding: 11px 20px; cursor: pointer;
  font-family: 'Raleway', sans-serif; font-size: 0.82rem; font-weight: 600;
  color: #3c3c3c; letter-spacing: 0.04em;
  transition: all 0.25s; width: 100%;
}
.btn-google:hover { background: #f5f5f5; box-shadow: 0 4px 12px rgba(0,0,0,0.2); transform: translateY(-1px); }

.auth-footer {
  margin-top: 20px; text-align: center;
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-size: 0.82rem; color: var(--text-muted); line-height: 1.6;
}

/* ─── USER MENU ─── */
.user-menu-wrap { position: relative; }
.user-btn {
  background: rgba(30,10,60,0.6); border: 1px solid var(--border-subtle);
  border-radius: 50px; padding: 7px 16px; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  font-family: 'Raleway', sans-serif; font-size: 0.75rem;
  color: var(--text-secondary); transition: all 0.25s;
}
.user-btn:hover { border-color: var(--border-gold); color: var(--text-gold); }
.user-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--crimson), var(--purple-mid));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; color: white; flex-shrink: 0;
}
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: #0F0620; border: 1px solid var(--border-gold);
  border-radius: 12px; min-width: 200px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5); overflow: hidden;
  display: none; z-index: 500;
}
.user-dropdown.open { display: block; }
.user-dropdown-header {
  padding: 14px 16px; border-bottom: 1px solid var(--border-subtle);
}
.user-dropdown-name {
  font-family: 'Cormorant Garamond', serif; font-size: 1rem;
  color: var(--text-gold); font-weight: 600;
}
.user-dropdown-email {
  font-size: 0.72rem; color: var(--text-muted); margin-top: 2px;
}
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; cursor: pointer; transition: background 0.2s;
  font-size: 0.8rem; color: var(--text-secondary);
  border: none; background: none; width: 100%; text-align: left;
  font-family: 'Raleway', sans-serif;
}
.dropdown-item:hover { background: rgba(91,31,168,0.15); color: var(--text-primary); }
.dropdown-item.danger { color: var(--crimson-bright); }
.dropdown-item.danger:hover { background: rgba(196,30,58,0.12); }


/* ─── GUEST BUTTON ─── */
.btn-guest {
  background: transparent;
  border: 1px solid rgba(201,168,76,0.35);
  border-radius: 50px;
  color: var(--text-gold);
  font-family: 'Raleway', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 10px 28px;
  cursor: pointer;
  transition: all 0.3s;
  width: 100%;
}
.btn-guest:hover {
  background: rgba(201,168,76,0.1);
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(201,168,76,0.15);
}

/* ─── VISIBILITY UTILITY ─── */
.hidden { display: none !important; }
#cosmos, #cosmos * { pointer-events: none !important; }

.guest-banner {
  background: linear-gradient(90deg, rgba(155,27,27,0.25), rgba(91,31,168,0.25));
  border-bottom: 1px solid rgba(201,168,76,0.2);
  padding: 8px 40px;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
