/* ============================================
   CONSCIOUSNESS MODEL — Design System
   ============================================ */

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

:root {
  --bg-void: #06060e;
  --bg-panel: rgba(10, 10, 25, 0.75);
  --bg-panel-hover: rgba(15, 15, 35, 0.85);
  --border-panel: rgba(255, 255, 255, 0.06);
  --border-panel-hover: rgba(255, 255, 255, 0.12);
  --text-primary: rgba(255, 255, 255, 0.92);
  --text-secondary: rgba(255, 255, 255, 0.50);
  --text-tertiary: rgba(255, 255, 255, 0.28);
  --accent-cyan: #00d4ff;
  --accent-purple: #a855f7;
  --accent-pink: #f472b6;
  --accent-gold: #fbbf24;
  --accent-green: #34d399;
  --accent-red: #ef4444;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-thought: 'Crimson Pro', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
  --panel-radius: 16px;
  --panel-blur: 24px;
  --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s ease;
}

html, body {
  width: 100%; height: 100%; overflow: hidden;
  font-family: var(--font-ui); background: var(--bg-void);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

/* --- Loading / Landing Screen --- */
#loading-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg-void);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 1.2s ease, visibility 1.2s ease, background 1s ease;
}
#loading-screen.landing-ready {
  background: rgba(6, 6, 14, 0.55);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
#loading-screen.fade-out {
  opacity: 0; visibility: hidden;
}
#loading-content {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  text-align: center;
}
#loading-progress {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
#loading-orb {
  width: 60px; height: 60px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--accent-cyan), var(--accent-purple));
  box-shadow: 0 0 40px rgba(0,212,255,0.5), 0 0 120px rgba(168,85,247,0.3);
  animation: loadOrb 2s ease-in-out infinite;
}
@keyframes loadOrb {
  0%, 100% { transform: scale(1); box-shadow: 0 0 40px rgba(0,212,255,0.5), 0 0 120px rgba(168,85,247,0.3); }
  50% { transform: scale(1.2); box-shadow: 0 0 60px rgba(0,212,255,0.7), 0 0 160px rgba(168,85,247,0.4); }
}
#loading-status { min-height: 24px; }
#loading-step {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--accent-cyan); letter-spacing: 0.5px;
}
#loading-bar-track {
  width: 280px; height: 3px; border-radius: 2px;
  background: rgba(255,255,255,0.06); overflow: hidden;
}
#loading-bar-fill {
  height: 100%; width: 0%; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  transition: width 0.3s ease;
}
#loading-count {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-tertiary); margin: 0;
}

/* Landing Page */
#landing-content {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
#landing-title {
  font-size: 42px; font-weight: 300; letter-spacing: 14px;
  color: #fff; margin: 0;
  text-shadow: 0 0 60px rgba(0, 212, 255, 0.3);
}
#landing-subtitle {
  font-family: var(--font-thought); font-style: italic; font-size: 20px;
  color: rgba(200, 210, 230, 0.7); margin: 0 0 8px 0;
}
#landing-description {
  font-family: var(--font-ui); font-size: 13px; font-weight: 300;
  color: rgba(180, 190, 210, 0.45); margin: 0 0 24px 0;
  line-height: 1.6; letter-spacing: 0.3px;
}
#landing-enter {
  padding: 14px 40px; border-radius: 30px;
  border: 1px solid rgba(0, 212, 255, 0.3);
  background: rgba(0, 212, 255, 0.08);
  color: var(--accent-cyan); font-family: var(--font-ui);
  font-size: 14px; font-weight: 500; letter-spacing: 3px;
  cursor: pointer; transition: all 0.3s ease;
}
#landing-enter:hover {
  background: rgba(0, 212, 255, 0.15);
  border-color: rgba(0, 212, 255, 0.5);
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.15);
  transform: scale(1.03);
}
#landing-credit {
  font-family: var(--font-mono); font-size: 10px;
  color: rgba(150, 160, 180, 0.3); margin: 20px 0 0 0;
  letter-spacing: 1px;
}

/* --- Canvas --- */
#consciousness-canvas {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0;
  cursor: crosshair;
}
#brainwave-canvas {
  position: fixed; bottom: 0; left: 0; width: 100%; height: 80px;
  z-index: 1; pointer-events: none; opacity: 0.6;
}

/* --- Depth Indicator --- */
#depth-indicator {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  z-index: 25; pointer-events: none;
  text-align: center;
  padding: 12px 28px; border-radius: 16px;
  background: rgba(6, 6, 18, 0.75);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 212, 255, 0.12);
  transition: opacity 0.5s ease;
}
#depth-layer {
  font-family: var(--font-ui); font-size: 12px; font-weight: 600;
  letter-spacing: 5px; color: var(--accent-cyan);
  margin-bottom: 4px;
}
#depth-description {
  font-family: var(--font-thought); font-style: italic; font-size: 14px;
  color: rgba(220, 225, 240, 0.7);
  margin-bottom: 4px;
}
#depth-zoom {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text-tertiary);
}

/* --- Interaction Hints --- */
#interaction-hints {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 22; pointer-events: none;
  display: flex; align-items: center; gap: 6px;
  padding: 6px 16px; border-radius: 12px;
  background: rgba(6, 6, 18, 0.6);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.04);
  animation: hintsAutoFade 25s ease forwards;
}
#interaction-hints span {
  font-family: var(--font-mono); font-size: 10px;
  color: rgba(180, 190, 210, 0.4); white-space: nowrap;
}
#interaction-hints span + span::before {
  content: '·'; margin-right: 6px;
  color: rgba(255,255,255,0.1);
}
@keyframes hintsAutoFade {
  0%, 80% { opacity: 1; }
  100% { opacity: 0; }
}
/* --- UI Overlay --- */
#ui-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 10; pointer-events: none;
}
#ui-overlay > * { pointer-events: auto; }

/* --- Tooltip --- */
#tooltip {
  position: fixed; z-index: 1000; pointer-events: none;
  max-width: 320px; padding: 14px 16px;
  background: rgba(8, 8, 20, 0.94);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 212, 255, 0.05);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
#tooltip.tooltip-hidden { opacity: 0; transform: translateY(4px); pointer-events: none; }
#tooltip.tooltip-visible { opacity: 1; transform: translateY(0); }
#tooltip-title {
  font-size: 12px; font-weight: 600; color: var(--accent-cyan);
  margin-bottom: 6px; letter-spacing: 0.3px;
}
#tooltip-body {
  font-size: 11.5px; font-weight: 400; color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
}

/* --- Neuron Inspector (click a neuron) --- */
#neuron-inspector {
  position: fixed; z-index: 100; pointer-events: auto;
  width: 260px; padding: 16px;
  background: rgba(8, 8, 22, 0.92);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 212, 255, 0.08);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
#neuron-inspector.hidden {
  opacity: 0; transform: scale(0.95) translateY(6px); pointer-events: none;
}
#neuron-inspector .inspector-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
#neuron-inspector .inspector-title {
  font-size: 13px; font-weight: 600; color: var(--accent-cyan);
}
#neuron-inspector .inspector-close {
  width: 22px; height: 22px; border: none; border-radius: 50%;
  background: rgba(255,255,255,0.06); color: var(--text-secondary);
  font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background var(--transition-fast);
}
#neuron-inspector .inspector-close:hover { background: rgba(255,255,255,0.12); }
#neuron-inspector .inspector-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
}
#neuron-inspector .inspector-row:last-child { border-bottom: none; }
#neuron-inspector .inspector-label {
  font-size: 11px; color: var(--text-secondary);
}
#neuron-inspector .inspector-val {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-primary);
}
#neuron-inspector .inspector-bar {
  width: 100%; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,0.06); margin-top: 4px; overflow: hidden;
}
#neuron-inspector .inspector-bar-fill {
  height: 100%; border-radius: 2px; transition: width 0.15s ease;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
}
#neuron-inspector .inspector-desc {
  font-size: 10.5px; color: var(--text-tertiary); line-height: 1.5;
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.04);
  font-style: italic;
}

/* --- Glassmorphic Panels --- */
.panel {
  background: var(--bg-panel);
  backdrop-filter: blur(var(--panel-blur)); -webkit-backdrop-filter: blur(var(--panel-blur));
  border: 1px solid var(--border-panel); border-radius: var(--panel-radius);
  padding: 16px;
  transition: border-color var(--transition-smooth), background var(--transition-smooth);
}
.panel:hover { border-color: var(--border-panel-hover); background: var(--bg-panel-hover); }

.panel-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--text-secondary);
  margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.panel-icon { font-size: 14px; color: var(--accent-cyan); transition: color var(--transition-smooth); }

/* --- Header --- */
#header {
  position: fixed; top: 0; left: 0; right: 0; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: linear-gradient(180deg, rgba(6,6,14,0.9) 0%, rgba(6,6,14,0) 100%);
  z-index: 20;
}
#header-left { display: flex; align-items: center; gap: 14px; }
#logo-mark { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }
#logo-orb {
  width: 18px; height: 18px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--accent-cyan), var(--accent-purple));
  box-shadow: 0 0 20px rgba(0,212,255,0.4), 0 0 60px rgba(168,85,247,0.2);
  animation: orbPulse 3s ease-in-out infinite;
}
@keyframes orbPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(0,212,255,0.4), 0 0 60px rgba(168,85,247,0.2); }
  50% { transform: scale(1.15); box-shadow: 0 0 30px rgba(0,212,255,0.6), 0 0 80px rgba(168,85,247,0.3); }
}
#title-group h1 { font-size: 14px; font-weight: 600; letter-spacing: 4px; color: var(--text-primary); }
#subtitle { font-size: 10px; font-weight: 300; color: var(--text-tertiary); letter-spacing: 2px; text-transform: uppercase; margin-top: 1px; }
#header-right { display: flex; align-items: center; gap: 10px; }
#state-badge {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 16px;
  background: rgba(0,212,255,0.08); border: 1px solid rgba(0,212,255,0.15);
  transition: all var(--transition-smooth);
}
#state-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-cyan); animation: dotPulse 2s ease-in-out infinite; }
@keyframes dotPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
#state-label { font-size: 10px; font-weight: 600; letter-spacing: 2px; color: var(--accent-cyan); transition: color var(--transition-smooth); }
#phi-display { display: flex; align-items: baseline; gap: 4px; cursor: help; }
#phi-symbol { font-size: 16px; font-weight: 300; color: var(--accent-purple); font-family: var(--font-thought); font-style: italic; }
#phi-readout { font-family: var(--font-mono); font-size: 14px; font-weight: 400; color: var(--text-primary); }

/* --- Left Panel --- */
#left-panel {
  position: fixed; top: 116px; left: 16px; width: 260px;
  display: flex; flex-direction: column; gap: 12px;
  max-height: calc(100vh - 140px); overflow-y: auto; scrollbar-width: none;
}
#left-panel::-webkit-scrollbar { display: none; }

.metrics-grid { display: flex; flex-direction: column; gap: 12px; }
.metric { cursor: help; }
.metric-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.metric-label { font-size: 11px; font-weight: 400; color: var(--text-secondary); }
.metric-value { font-family: var(--font-mono); font-size: 11px; font-weight: 400; color: var(--text-primary); }
.metric-bar { width: 100%; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.06); overflow: hidden; }
.metric-fill {
  height: 100%; border-radius: 2px; width: 0%;
  transition: width 0.3s ease, background var(--transition-smooth);
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
}
#bar-arousal { background: linear-gradient(90deg, var(--accent-green), var(--accent-gold)); }
#bar-awareness { background: linear-gradient(90deg, var(--accent-purple), var(--accent-pink)); }
#bar-activity { background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green)); }
#bar-coherence { background: linear-gradient(90deg, var(--accent-gold), var(--accent-red)); }

/* Profile Panel */
.profile-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.profile-label {
  font-size: 10px; font-weight: 500; color: var(--text-secondary);
  min-width: 28px;
}
.profile-slider {
  flex: 1; height: 4px; -webkit-appearance: none; appearance: none;
  background: rgba(255,255,255,0.08); border-radius: 2px; outline: none;
  cursor: pointer;
}
.profile-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  box-shadow: 0 0 8px rgba(0,212,255,0.3);
  cursor: pointer;
}
.profile-slider::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  box-shadow: 0 0 8px rgba(0,212,255,0.3);
  cursor: pointer;
}
.profile-value {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  color: var(--accent-cyan); min-width: 22px; text-align: right;
}
.profile-toggle {
  display: flex; gap: 4px; flex: 1;
}
.sex-btn {
  flex: 1; padding: 4px 8px; border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px; background: transparent;
  color: var(--text-tertiary); font-family: var(--font-ui);
  font-size: 10px; font-weight: 500; cursor: pointer;
  transition: all var(--transition-fast);
}
.sex-btn:hover { background: rgba(255,255,255,0.04); color: var(--text-secondary); }
.sex-btn.active {
  background: rgba(168,85,247,0.1); border-color: rgba(168,85,247,0.25);
  color: var(--accent-purple);
}
#profile-summary {
  font-family: var(--font-thought); font-style: italic;
  font-size: 11px; color: var(--text-tertiary);
  text-align: center; padding-top: 4px;
  border-top: 1px solid rgba(255,255,255,0.04);
}
.research-link {
  display: block; text-align: center;
  font-family: var(--font-mono); font-size: 9px;
  color: rgba(0,212,255,0.4); text-decoration: none;
  margin-top: 6px; transition: color 0.2s;
}
.research-link:hover { color: var(--accent-cyan); }

#neuron-stats {
  display: flex; justify-content: space-between;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-panel);
}
.stat { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.stat-num { font-family: var(--font-mono); font-size: 16px; font-weight: 600; color: var(--text-primary); }
.stat-label { font-size: 9px; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; color: var(--text-tertiary); }

/* Emotion */
#emotion-wheel { display: flex; justify-content: center; margin: 8px 0; }
#emotion-canvas { border-radius: 50%; }
#emotion-labels { display: flex; justify-content: space-between; margin-top: 8px; }
.emotion-dim { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.dim-name { font-size: 9px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-tertiary); }
.dim-value { font-family: var(--font-mono); font-size: 12px; color: var(--text-primary); }
#emotion-name {
  text-align: center; margin-top: 10px;
  font-family: var(--font-thought); font-style: italic; font-size: 15px;
  color: var(--accent-pink); min-height: 20px; transition: color var(--transition-smooth);
}

/* --- Right Panel --- */
#right-panel {
  position: fixed; top: 116px; right: 16px; width: 280px;
  display: flex; flex-direction: column; gap: 12px;
  max-height: calc(100vh - 140px); overflow-y: auto; scrollbar-width: none;
}
#right-panel::-webkit-scrollbar { display: none; }

/* Thought Stream */
#thoughts-container {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 220px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.thought-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  background: rgba(255,255,255,0.03); border-left: 2px solid var(--accent-cyan);
  animation: thoughtAppear 0.5s ease-out;
}
@keyframes thoughtAppear { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.thought-category { font-size: 14px; flex-shrink: 0; width: 20px; text-align: center; }
.thought-body { flex: 1; }
.thought-text { font-family: var(--font-thought); font-size: 14px; font-style: italic; color: var(--text-primary); line-height: 1.4; }
.thought-meta { font-size: 9px; color: var(--text-tertiary); margin-top: 3px; font-family: var(--font-mono); }

/* Injected thoughts get DRAMATIC styling */
.thought-item.injected {
  border-left: 3px solid var(--accent-gold);
  background: rgba(251, 191, 36, 0.12);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.15), inset 0 0 20px rgba(251, 191, 36, 0.05);
  animation: injectedPulse 2s ease-in-out infinite, thoughtAppear 0.5s ease-out;
}
.thought-item.injected .thought-text { color: #fff; font-weight: 500; }
.thought-item.injected .thought-meta { color: var(--accent-gold); }
@keyframes injectedPulse {
  0%, 100% { box-shadow: 0 0 16px rgba(251, 191, 36, 0.15), inset 0 0 20px rgba(251, 191, 36, 0.05); }
  50% { box-shadow: 0 0 24px rgba(251, 191, 36, 0.25), inset 0 0 30px rgba(251, 191, 36, 0.08); }
}

/* Memory - FIXED VISIBILITY */
#memory-capacity { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); }
#memory-items { display: flex; flex-direction: column; gap: 6px; max-height: 280px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(168,85,247,0.2) transparent; }
.memory-item {
  padding: 10px 14px; border-radius: 8px;
  background: rgba(100, 40, 180, 0.55);
  border: 1px solid rgba(200, 160, 255, 0.65);
  font-family: var(--font-ui); font-size: 15px; font-weight: 700;
  color: #fff !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8), 0 0 16px rgba(200, 160, 255, 0.6);
  animation: memoryForm 0.6s ease-out;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  min-height: 38px;
}
.memory-text {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #fff !important; font-weight: 700;
}
.memory-strength { width: 40px; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.08); overflow: hidden; flex-shrink: 0; }
.memory-strength-fill { height: 100%; background: var(--accent-purple); border-radius: 2px; transition: width 0.3s ease; }
@keyframes memoryForm { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

/* Workspace */
#workspace-content { min-height: 50px; }
.workspace-empty { font-size: 12px; color: var(--text-tertiary); font-style: italic; text-align: center; padding: 12px 0; }
.workspace-broadcast {
  padding: 10px 12px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(0,212,255,0.08), rgba(168,85,247,0.08));
  border: 1px solid rgba(0,212,255,0.15);
  font-family: var(--font-thought); font-size: 15px; text-align: center;
  color: var(--text-primary); animation: broadcastPulse 2s ease-in-out infinite;
}
@keyframes broadcastPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(0,212,255,0); } 50% { box-shadow: 0 0 20px 0 rgba(0,212,255,0.15); } }

/* --- Bottom Controls --- */
#controls-bar {
  position: fixed; top: 8px; left: 50%; transform: translateX(-50%);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
  padding: 8px 14px;
  background: var(--bg-panel);
  backdrop-filter: blur(var(--panel-blur)); -webkit-backdrop-filter: blur(var(--panel-blur));
  border: 1px solid var(--border-panel); border-radius: 16px; z-index: 20;
  max-width: 620px;
}
.controls-section { display: flex; align-items: center; gap: 5px; width: 100%; position: relative; }
.controls-scroll-arrow {
  position: absolute; right: -2px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border: none; border-radius: 50%;
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.3); font-size: 14px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease; z-index: 2;
  box-shadow: -8px 0 12px rgba(6,6,14,0.9);
}
.controls-scroll-arrow:hover {
  background: rgba(0,212,255,0.1); color: var(--accent-cyan);
}
.controls-label {
  font-family: var(--font-mono); font-size: 9px; font-weight: 600;
  letter-spacing: 2px; color: var(--text-tertiary);
  margin-right: 4px; opacity: 0.6; flex-shrink: 0;
}
.controls-divider { display: none; }

/* Stimulus Input — floating bottom-left, matches left panel width */
#stimulus-float {
  position: fixed; bottom: 90px; left: 16px; z-index: 25;
  width: 260px;
}
#stimulus-input-wrapper { position: relative; display: flex; align-items: center; width: 100%; }
#stimulus-input {
  width: 100%; padding: 12px 44px 12px 16px;
  border: 1px solid rgba(255,255,255,0.08); border-radius: 14px;
  background: rgba(8, 8, 22, 0.88);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  color: var(--text-primary);
  font-family: var(--font-ui); font-size: 13px; font-weight: 400; outline: none;
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}
#stimulus-input::placeholder { color: var(--text-tertiary); }
#stimulus-input:focus {
  border-color: rgba(0,212,255,0.3); background: rgba(0,212,255,0.04);
  box-shadow: 0 0 16px rgba(0,212,255,0.1);
}
/* Flash animation when thought injected */
#stimulus-input.injected {
  border-color: rgba(251,191,36,0.6); background: rgba(251,191,36,0.08);
  box-shadow: 0 0 20px rgba(251,191,36,0.2);
}
#inject-btn {
  position: absolute; right: 4px; width: 30px; height: 30px;
  border: none; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: white; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
#inject-btn:hover { transform: scale(1.08); box-shadow: 0 0 16px rgba(0,212,255,0.4); }
#inject-btn:active { transform: scale(0.95); }

/* States scroll */
#states-scroll {
  display: flex; gap: 4px; overflow-x: auto;
  scrollbar-width: none; padding: 2px 18px 2px 0;
  mask-image: linear-gradient(to right, black 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
}
#states-scroll::-webkit-scrollbar { display: none; }
.state-btn {
  padding: 5px 10px; border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px; background: transparent;
  color: var(--text-secondary); font-family: var(--font-ui);
  font-size: 10px; font-weight: 500; cursor: pointer;
  transition: all var(--transition-fast);
  display: flex; align-items: center; gap: 4px; white-space: nowrap; flex-shrink: 0;
}
.state-icon { display: none; }
.state-text { font-size: 11px; }
.state-btn:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.state-btn.active {
  background: rgba(0,212,255,0.1); border-color: rgba(0,212,255,0.25);
  color: var(--accent-cyan); box-shadow: 0 0 12px rgba(0,212,255,0.1);
}
.state-btn.disabled {
  opacity: 0.25; pointer-events: none;
  text-decoration: line-through;
}

/* Mood scroll & buttons */
#moods-scroll {
  display: flex; gap: 4px; overflow-x: auto;
  scrollbar-width: none; padding: 2px 18px 2px 0;
  mask-image: linear-gradient(to right, black 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
}
#moods-scroll::-webkit-scrollbar { display: none; }
.mood-btn {
  padding: 5px 10px; border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px; background: transparent;
  color: var(--text-secondary); font-family: var(--font-ui);
  font-size: 10px; font-weight: 500; cursor: pointer;
  transition: all var(--transition-fast);
  display: flex; align-items: center; gap: 4px; white-space: nowrap; flex-shrink: 0;
}
.mood-btn:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.mood-btn.active {
  background: rgba(244,114,182,0.1); border-color: rgba(244,114,182,0.25);
  color: var(--accent-pink); box-shadow: 0 0 10px rgba(244,114,182,0.08);
}

/* Mood badge in header */
#mood-badge {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 16px;
  background: rgba(244,114,182,0.08); border: 1px solid rgba(244,114,182,0.12);
  font-size: 10px; font-weight: 500; color: var(--accent-pink);
  transition: all var(--transition-smooth);
}

/* Brainwave Label */
#brainwave-label {
  position: fixed; bottom: 16px; right: 20px;
  display: flex; flex-direction: column; align-items: flex-end;
  z-index: 5; cursor: help;
}
#wave-name { font-size: 12px; font-weight: 600; letter-spacing: 1px; color: var(--accent-cyan); opacity: 0.7; }
#wave-freq { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); }

/* --- Info Panel --- */
#info-tooltip { position: fixed; bottom: 16px; left: 20px; z-index: 30; }
#info-toggle {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--border-panel); background: var(--bg-panel);
  backdrop-filter: blur(12px); color: var(--text-secondary);
  font-family: var(--font-thought); font-size: 16px; font-style: italic;
  cursor: pointer; transition: all var(--transition-fast);
}
#info-toggle:hover { background: var(--bg-panel-hover); border-color: var(--border-panel-hover); color: var(--text-primary); }
#info-content {
  position: absolute; bottom: 42px; left: 0; width: 340px;
  padding: 20px; background: var(--bg-panel);
  backdrop-filter: blur(var(--panel-blur)); -webkit-backdrop-filter: blur(var(--panel-blur));
  border: 1px solid var(--border-panel); border-radius: var(--panel-radius);
  transition: opacity var(--transition-smooth), transform var(--transition-smooth);
}
#info-content.info-hidden { opacity: 0; transform: translateY(10px); pointer-events: none; }
#info-content h3 { font-size: 13px; font-weight: 600; margin-bottom: 10px; color: var(--text-primary); }
#info-content p { font-size: 12px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 8px; }
#info-content ul { list-style: none; padding: 0; margin-bottom: 10px; }
#info-content li { font-size: 11px; color: var(--text-secondary); line-height: 1.6; padding: 4px 0; padding-left: 12px; position: relative; }
#info-content li::before { content: '›'; position: absolute; left: 0; color: var(--accent-cyan); }
#info-content strong { color: var(--text-primary); font-weight: 500; }
.info-hint { font-style: italic; color: var(--text-tertiary) !important; font-size: 11px !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* State theme transitions */
body.state-reading .state-btn.active { background: rgba(0,212,255,0.1); border-color: rgba(0,212,255,0.25); color: var(--accent-cyan); }
body.state-running .state-btn.active { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.25); color: var(--accent-red); }
body.state-phone .state-btn.active { background: rgba(129,140,248,0.1); border-color: rgba(129,140,248,0.25); color: #818cf8; }
body.state-tv .state-btn.active { background: rgba(129,140,248,0.1); border-color: rgba(129,140,248,0.25); color: #818cf8; }
body.state-playing .state-btn.active { background: rgba(251,191,36,0.1); border-color: rgba(251,191,36,0.25); color: var(--accent-gold); }
body.state-labour .state-btn.active { background: rgba(249,115,22,0.1); border-color: rgba(249,115,22,0.25); color: #f97316; }
body.state-prayer .state-btn.active { background: rgba(52,211,153,0.1); border-color: rgba(52,211,153,0.25); color: var(--accent-green); }
body.state-sleeping .state-btn.active { background: rgba(99,102,241,0.1); border-color: rgba(99,102,241,0.25); color: #6366f1; }
body.state-daydreaming .state-btn.active { background: rgba(192,132,252,0.1); border-color: rgba(192,132,252,0.25); color: var(--accent-purple); }
body.state-friends .state-btn.active { background: rgba(251,146,60,0.1); border-color: rgba(251,146,60,0.25); color: #fb923c; }
body.state-conversation .state-btn.active { background: rgba(244,114,182,0.1); border-color: rgba(244,114,182,0.25); color: var(--accent-pink); }

/* Responsive */
@media (max-width: 1200px) {
  #left-panel { width: 220px; }
  #right-panel { width: 240px; }
  #controls-bar { max-width: 500px; }
  #stimulus-float { width: 220px; }
}
@media (max-width: 900px) {
  #left-panel, #right-panel { display: none; }
  #controls-bar { max-width: calc(100% - 32px); }
  #stimulus-float { width: calc(100% - 32px); max-width: 320px; }
}
