/* ============================================================================
   COLLECTIVE MEMORY v5.0 - COMPLETE STYLES
   All CSS for immersive documentary experience with About Modal & Experimental
   ============================================================================ */

/* ========================================
   BASE STYLES
   ======================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #4ECDC4;
  --secondary: #FFD700;
  --accent: #9D4EDD;
  --dark: #0a0a0a;
  --text: #ffffff;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--dark);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   CANVAS
   ======================================== */
#canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  z-index: 1;
}

#canvas:active {
  cursor: grabbing;
}

/* ========================================
   LOADING SCREEN
   ======================================== */
#loading {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.6s;
}

#loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(78, 205, 196, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ========================================
   WELCOME SCREEN
   ======================================== */
#welcome {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  transition: opacity 0.6s;
}

#welcome.hidden {
  opacity: 0;
  pointer-events: none;
}

#welcome-bg-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.4;
  filter: blur(2px);
}

.welcome-content {
  position: relative;
  text-align: center;
  max-width: 700px;
  padding: 2rem;
  z-index: 2;
}

.welcome-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.welcome-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  margin-bottom: 2rem;
  opacity: 0.9;
  line-height: 1.6;
}

.btn-start {
  background: linear-gradient(135deg, var(--primary) 0%, #3AAFAA 100%);
  border: none;
  color: white;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 1rem 3rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 10px 30px rgba(78, 205, 196, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-start:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 15px 40px rgba(78, 205, 196, 0.5);
}

/* ========================================
   UI CONTAINER
   ======================================== */
#ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.6s;
}

#ui.visible {
  opacity: 1;
}

#ui > * {
  pointer-events: auto;
}

/* ========================================
   TOP BAR (Navigation)
   ======================================== */
#topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: clamp(12px, 2.5vw, 20px) clamp(15px, 3vw, 30px);
  background: linear-gradient(180deg, rgba(0,0,0,0.65) 0%, transparent 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: auto;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex-wrap: wrap;
  gap: clamp(10px, 2vw, 15px);
  z-index: 100;
}

.title-area {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.5vw, 18px);
  flex: 1;
  min-width: 0;
}

.badge {
  padding: clamp(6px, 1.2vw, 7px) clamp(12px, 2.5vw, 14px);
  background: rgba(66, 133, 244, 0.2);
  border: 1px solid rgba(66, 133, 244, 0.4);
  border-radius: 22px;
  font-size: clamp(10px, 2vw, 11px);
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.scene-info { 
  flex: 1; 
  min-width: 0;
  overflow: hidden;
}

.scene-title {
  font-size: clamp(16px, 2.5vw, 24px);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scene-subtitle {
  font-size: clamp(12px, 1.8vw, 13px);
  opacity: 0.75;
  margin-top: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#breadcrumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(11px, 1.8vw, 12px);
  opacity: 0.65;
  margin-top: 8px;
  flex-wrap: wrap;
}

.breadcrumb {
  cursor: pointer;
  transition: all 0.3s;
  padding: 2px 6px;
  border-radius: 4px;
  touch-action: manipulation;
}

.breadcrumb:hover, .breadcrumb:active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

.breadcrumb-separator {
  opacity: 0.4;
  user-select: none;
}

.controls {
  display: flex;
  gap: clamp(6px, 1.5vw, 10px);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn {
  padding: clamp(8px, 1.8vw, 10px) clamp(16px, 3.5vw, 20px);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  color: white;
  cursor: pointer;
  font-size: clamp(12px, 2vw, 13px);
  font-weight: 600;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all 0.3s;
  font-family: inherit;
  white-space: nowrap;
  touch-action: manipulation;
}

.btn:hover, .btn:active {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-mobile-icon {
  min-width: clamp(36px, 7vw, 44px);
}

.btn-exit {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-exit:hover, .btn-exit:active {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.6);
}

/* Old .header styles for compatibility */
.header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
  pointer-events: none;
}

.header > * {
  pointer-events: auto;
}

.scene-info {
  flex: 1;
}

#scene-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 0.3rem;
  color: var(--primary);
}

#scene-subtitle {
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  opacity: 0.8;
}

#breadcrumbs {
  font-size: 0.85rem;
  margin-top: 0.5rem;
  opacity: 0.7;
}

.breadcrumb {
  cursor: pointer;
  transition: all 0.3s;
}

.breadcrumb:hover {
  color: var(--primary);
}

.breadcrumb-separator {
  margin: 0 0.5rem;
  opacity: 0.5;
}

#badge {
  background: var(--accent);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.header-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  backdrop-filter: blur(10px);
}

.btn-icon:hover {
  background: rgba(78, 205, 196, 0.3);
  transform: scale(1.1);
}

#btn-back {
  display: none;
}

/* ========================================
   STATS PANEL
   ======================================== */
.stats {
  position: absolute;
  bottom: 2rem;
  left: 2rem;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.stat-card {
  background: rgba(0, 0, 0, 0.8);
  padding: 1rem 1.5rem;
  border-radius: 15px;
  border: 1px solid rgba(78, 205, 196, 0.3);
  backdrop-filter: blur(10px);
  min-width: 100px;
}

.stat-label {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
}

/* ========================================
   TOOLTIP
   ======================================== */
#tooltip {
  position: fixed;
  background: rgba(0, 0, 0, 0.95);
  padding: 1.2rem;
  border-radius: 15px;
  max-width: 320px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  border: 2px solid var(--primary);
  backdrop-filter: blur(20px);
  z-index: 500;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

#tooltip.visible {
  opacity: 1;
}

.tooltip-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.tooltip-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.tooltip-subtitle {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-bottom: 0.8rem;
}

.tooltip-preview {
  font-size: 0.75rem;
  opacity: 0.6;
  margin-bottom: 0.8rem;
  white-space: pre-line;
}

.tooltip-hover-text {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--primary);
}

/* ========================================
   INTRO VIDEO LAYER
   ======================================== */
#intro-layer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.98);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 850;
  opacity: 0;
  transition: opacity 0.5s;
}

#intro-layer.active {
  display: flex;
}

#intro-layer.visible {
  opacity: 1;
}

#intro-video {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 20px;
  box-shadow: 0 20px 80px rgba(0,0,0,0.9);
}

.intro-controls {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 1rem;
  align-items: center;
  background: rgba(0,0,0,0.9);
  padding: 1rem 2rem;
  border-radius: 50px;
  backdrop-filter: blur(20px);
}

.intro-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s;
}

.intro-btn:hover {
  background: var(--primary);
  transform: scale(1.1);
}

#intro-timeline {
  width: 300px;
  height: 6px;
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
}

#intro-progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s;
}

#intro-time {
  font-size: 0.9rem;
  min-width: 80px;
  text-align: center;
}

/* ========================================
   CONTROL PANELS
   ======================================== */
.panel {
  position: absolute;
  background: rgba(0, 0, 0, 0.92);
  border-radius: 20px;
  padding: 1.5rem;
  border: 2px solid rgba(78, 205, 196, 0.3);
  backdrop-filter: blur(20px);
  max-width: 350px;
  transition: all 0.3s;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

.panel.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
}

.panel.minimized {
  height: 60px;
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(78, 205, 196, 0.2);
}

.panel-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.panel-actions {
  display: flex;
  gap: 0.5rem;
}

.panel-btn {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1.2rem;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s;
}

.panel-btn:hover {
  background: rgba(78, 205, 196, 0.2);
}

#audio-controls {
  bottom: 2rem;
  right: 2rem;
}

#video360-controls {
  top: 120px;
  right: 2rem;
}

#connections-panel {
  top: 50%;
  right: 2rem;
  transform: translateY(-50%);
  max-height: 70vh;
  overflow-y: auto;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
}

.control-label {
  font-size: 0.9rem;
  opacity: 0.8;
  min-width: 80px;
}

input[type="range"] {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.2);
  outline: none;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
}

#volume-display {
  min-width: 35px;
  text-align: right;
  font-weight: 600;
}

.btn-control {
  background: rgba(78, 205, 196, 0.2);
  border: 1px solid rgba(78, 205, 196, 0.5);
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.9rem;
  font-weight: 600;
}

.btn-control:hover {
  background: rgba(78, 205, 196, 0.4);
  transform: scale(1.05);
}

.controls-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.8rem 0;
}

.timeline {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  margin: 1rem 0;
}

.progress-bar {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s;
}

.time-display {
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.7;
  margin-top: 0.5rem;
}

/* ========================================
   AI CHAT
   ======================================== */
#ai-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3a9bdc, #1f6fa1);
  border: none;
  color: white;
  cursor: pointer;
  z-index: 170;
  font-size: 1.6rem;
  box-shadow: 0 8px 30px rgba(58, 155, 220, 0.5);
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

#ai-toggle:hover {
  transform: scale(1.12) rotate(10deg);
  box-shadow: 0 10px 40px rgba(58, 155, 220, 0.7);
}

#ai-toggle.hidden {
  opacity: 0;
  pointer-events: none;
}

#ai-panel {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: min(420px, 90vw);
  height: min(550px, 70vh);
  background: rgba(0, 0, 0, 0.95);
  border-radius: 20px;
  border: 2px solid rgba(58, 155, 220, 0.4);
  backdrop-filter: blur(30px);
  display: flex;
  flex-direction: column;
  z-index: 180;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  transition: all 0.3s;
}

#ai-panel.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9) translateY(20px);
}

#ai-panel.minimized {
  height: 70px;
}

.ai-header {
  padding: 1.2rem;
  border-bottom: 1px solid rgba(58, 155, 220, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ai-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #3a9bdc;
}

.ai-subtitle {
  font-size: 0.8rem;
  opacity: 0.7;
  margin-top: 0.2rem;
}

#ai-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#ai-panel.minimized #ai-content {
  display: none;
}

.message {
  max-width: 85%;
  padding: 0.9rem 1.2rem;
  border-radius: 15px;
  font-size: 0.95rem;
  line-height: 1.5;
  animation: slideIn 0.3s ease-out;
}

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

.message.user {
  background: rgba(58, 155, 220, 0.3);
  align-self: flex-end;
  border: 1px solid rgba(58, 155, 220, 0.5);
}

.message.assistant {
  background: rgba(255, 255, 255, 0.08);
  align-self: flex-start;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.message.thinking {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  font-style: italic;
  opacity: 0.7;
}

.ai-input-area {
  padding: 1rem;
  border-top: 1px solid rgba(58, 155, 220, 0.2);
}

#ai-panel.minimized .ai-input-area {
  display: none;
}

.ai-info-text {
  font-size: 0.75rem;
  opacity: 0.6;
  margin-bottom: 0.8rem;
  text-align: center;
  font-style: italic;
}

.ai-input-row {
  display: flex;
  gap: 0.8rem;
}

.ai-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(58, 155, 220, 0.3);
  border-radius: 20px;
  padding: 0.8rem 1.2rem;
  color: white;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s;
}

.ai-input:focus {
  border-color: #3a9bdc;
  background: rgba(58, 155, 220, 0.1);
}

.ai-send {
  background: linear-gradient(135deg, #3a9bdc, #1f6fa1);
  border: none;
  color: white;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-send:hover:not(:disabled) {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(58, 155, 220, 0.5);
}

.ai-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========================================
   MODALS
   ======================================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.97);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 800;
  opacity: 0;
  transition: opacity 0.4s;
}

.modal.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  position: relative;
  animation: modalZoomIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 95vw;
  max-height: 95vh;
}

@keyframes modalZoomIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-video {
  max-width: 92vw;
  max-height: 75vh;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 20px;
  box-shadow: 0 25px 100px rgba(0,0,0,0.9);
}

.modal-info {
  margin-top: 1.5rem;
  text-align: center;
  max-width: 700px;
}

.modal-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  margin-bottom: 0.8rem;
  color: var(--primary);
}

.modal-desc {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  opacity: 0.9;
  line-height: 1.6;
  margin-bottom: 1.2rem;
}

.modal-metadata {
  margin-top: 1.5rem;
}

.btn-explore-connections {
  background: linear-gradient(135deg, var(--accent), #7b2cbf);
  border: none;
  color: white;
  padding: 0.9rem 2rem;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.3s;
  box-shadow: 0 6px 20px rgba(157, 78, 221, 0.4);
  margin-top: 1rem;
}

.btn-explore-connections:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(157, 78, 221, 0.6);
}

.close-btn {
  position: absolute;
  top: -60px;
  right: 0;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  cursor: pointer;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg) scale(1.15);
}

/* ========================================
   JOURNEY MODAL
   ======================================== */
#journey-modal .modal-content {
  background: rgba(15, 25, 50, 0.98);
  border: 2px solid rgba(78, 205, 196, 0.4);
  border-radius: 25px;
  padding: 3rem;
  max-width: 850px;
  width: 92%;
  max-height: 88vh;
  overflow-y: auto;
  backdrop-filter: blur(30px);
}

.journey-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 2rem;
  text-align: center;
  background: linear-gradient(135deg, #fff 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.journey-summary {
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.8;
  margin-bottom: 2.5rem;
  opacity: 0.95;
}

.journey-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.journey-stats .stat-card {
  background: rgba(255,255,255,0.05);
  padding: 1.5rem;
  border-radius: 15px;
  border: 1px solid rgba(78, 205, 196, 0.3);
}

.stat-detail {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--secondary);
  margin-top: 0.5rem;
}

#exit-actions {
  display: none;
  margin-top: 2.5rem;
  text-align: center;
  gap: 1rem;
}

#exit-actions button {
  margin: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #3AAFAA);
  border: none;
  color: white;
  padding: 1rem 2.5rem;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.3s;
}

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

.btn-secondary-large {
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.3);
  color: white;
  padding: 1rem 2.5rem;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.3s;
}

.btn-secondary-large:hover {
  background: rgba(255,255,255,0.15);
  transform: scale(1.05);
}

/* ========================================
   ABOUT MODAL
   ======================================== */
#about-modal .modal-content {
  background: linear-gradient(135deg, rgba(10, 10, 26, 0.98), rgba(26, 26, 46, 0.98));
  border: 2px solid rgba(102, 126, 234, 0.5);
  border-radius: 25px;
  padding: 3rem;
  max-width: 900px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  backdrop-filter: blur(30px);
  box-shadow: 0 25px 100px rgba(0,0,0,0.9);
}

.about-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  text-align: center;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.about-subtitle {
  text-align: center;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  opacity: 0.9;
  margin-bottom: 2.5rem;
  color: var(--primary);
}

.about-section {
  margin-bottom: 2.5rem;
  padding: 1.8rem;
  background: rgba(255,255,255,0.03);
  border-radius: 15px;
  border-left: 4px solid var(--primary);
}

.about-section h3 {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  margin-bottom: 1rem;
  color: var(--primary);
  font-weight: 700;
}

.about-section p {
  line-height: 1.8;
  opacity: 0.95;
  margin-bottom: 1rem;
  font-size: clamp(0.95rem, 2vw, 1.05rem);
}

.about-section ul {
  margin-left: 1.5rem;
  line-height: 1.8;
}

.about-section li {
  margin-bottom: 0.8rem;
  opacity: 0.9;
}

.about-section strong {
  color: var(--secondary);
  font-weight: 700;
}

.highlight-box {
  background: rgba(78, 205, 196, 0.1);
  border: 2px solid rgba(78, 205, 196, 0.3);
  padding: 1.5rem;
  border-radius: 12px;
  margin: 1.5rem 0;
}

.close-btn-visible {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  z-index: 10;
}

.close-btn-visible:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg) scale(1.1);
}

/* ========================================
   EXPERIMENTAL FEATURES
   ======================================== */
/* Experimental features - button is in nav, no fixed positioning needed */

/* Memory Echoes */
.memory-echo {
  position: fixed;
  width: 4px;
  height: 4px;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.3), transparent);
  border-radius: 50%;
  pointer-events: none;
  animation: fadeEcho 4s ease-out forwards;
  z-index: 10;
}
  position: fixed;
  top: 4.5rem;
  right: 1rem;
  background: rgba(0,0,0,0.95);
  border-radius: 12px;
  padding: 0.8rem;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(102, 126, 234, 0.3);
  display: none;
  z-index: 350;
  min-width: 240px;
  max-width: 280px;
}

.experimental-menu.active {
  display: block;
  animation: slideDown 0.3s ease;
}

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

.experimental-option {
  padding: 0.8rem;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.9rem;
}

.experimental-option:hover {
  background: rgba(102, 126, 234, 0.2);
}

.experimental-option.active {
  background: rgba(102, 126, 234, 0.25);
  border-left: 3px solid #667eea;
}

/* Soundscape Visualizer */
#soundscape-visualizer {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 180px;
  height: 60px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 12px;
  padding: 0.8rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: none;
  z-index: 300;
}

#soundscape-visualizer.active {
  display: block;
  animation: slideUp 0.3s ease;
}

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

.soundscape-bars {
  display: flex;
  align-items: flex-end;
  height: 30px;
  gap: 2px;
}

.soundscape-bar {
  flex: 1;
  background: linear-gradient(to top, rgba(102, 126, 234, 0.6), rgba(118, 75, 162, 0.8));
  border-radius: 2px;
  transition: height 0.15s ease;
  min-height: 2px;
}

.soundscape-label {
  font-size: 0.65rem;
  margin-top: 0.4rem;
  opacity: 0.6;
  text-align: center;
}

/* Mood Board */
#mood-board {
  position: fixed;
  bottom: 100px;
  right: 1rem;
  width: 160px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 12px;
  padding: 0.8rem;
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: none;
  z-index: 300;
}

#mood-board.active {
  display: block;
  animation: slideUp 0.3s ease;
}

.mood-board-title {
  font-size: 0.7rem;
  text-align: center;
  margin-bottom: 0.6rem;
  opacity: 0.7;
}

.mood-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: center;
}

.mood-tag {
  background: rgba(102, 126, 234, 0.2);
  color: rgba(168, 178, 255, 0.9);
  padding: 0.3rem 0.6rem;
  border-radius: 12px;
  font-size: 0.65rem;
  border: 1px solid rgba(102, 126, 234, 0.3);
  animation: floatTag 4s ease-in-out infinite;
  animation-delay: calc(var(--index) * 0.3s);
}

@keyframes floatTag {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-3px);
  }
}

/* Journey Trail */
#journey-trail {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 8;
  opacity: 0.2;
  display: none;
}

#journey-trail canvas {
  width: 100%;
  height: 100%;
}

#emotional-journey {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
  opacity: 0.25;
  display: none;
}

#emotional-journey canvas {
  width: 100%;
  height: 100%;
}

#constellation-view {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a1a2e 100%);
  z-index: 750;
  display: none;
}

#constellation-view.active {
  display: block;
}

.constellation-ui {
  position: absolute;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 10;
}

.constellation-ui h2 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  margin-bottom: 0.8rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.constellation-controls {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: center;
  z-index: 10;
}

.constellation-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 0.8rem 1.5rem;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s;
  backdrop-filter: blur(10px);
  font-weight: 600;
}

.constellation-btn:hover {
  background: rgba(255,255,255,0.2);
  transform: scale(1.05);
}

.constellation-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: transparent;
}

.memory-echo {
  position: absolute;
  width: 8px;
  height: 8px;
  background: radial-gradient(circle, rgba(100, 200, 255, 0.6), transparent);
  border-radius: 50%;
  pointer-events: none;
  animation: fadeEcho 3s ease-out forwards;
}

@keyframes fadeEcho {
  0% { opacity: 0.6; transform: scale(1); }
  100% { opacity: 0; transform: scale(3); }
}

/* ========================================
   CONTENT SIDEBAR
   ======================================== */
.content-sidebar {
  position: fixed;
  right: -320px;
  top: 80px;
  width: 320px;
  max-height: calc(100vh - 100px);
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 2px solid rgba(102, 126, 234, 0.3);
  z-index: 300;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
}

.content-sidebar.open {
  right: 0;
  pointer-events: auto;
}

.sidebar-toggle {
  position: fixed;
  right: 10px;
  top: 140px;
  width: 70px;
  height: 70px;
  background: rgba(102, 126, 234, 0.95);
  border: 3px solid white;
  border-radius: 12px;
  color: white;
  cursor: pointer;
  z-index: 350;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 24px;
  font-weight: bold;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
  padding: 8px;
  pointer-events: auto;
  text-align: center;
  line-height: 1.2;
}

.sidebar-toggle:hover {
  background: rgba(102, 126, 234, 1);
  transform: scale(1.05);
  box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

.sidebar-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.sidebar-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: rgba(102, 126, 234, 1);
  margin: 0;
}

.sidebar-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.sidebar-close:hover {
  background: rgba(255, 0, 0, 0.3);
  transform: rotate(90deg);
}

.sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  pointer-events: auto;
}

.sidebar-story-item {
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(102, 126, 234, 0.3);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  pointer-events: auto;
}

.sidebar-story-item::after {
  content: '▶';
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(102, 126, 234, 0.6);
  font-size: 1.2rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-story-item:hover {
  background: rgba(102, 126, 234, 0.3);
  border-color: rgba(102, 126, 234, 0.7);
  transform: translateX(-8px) scale(1.02);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.sidebar-story-item:hover::after {
  opacity: 1;
}

.sidebar-story-item:active {
  transform: translateX(-6px) scale(0.98);
}

.sidebar-story-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: white;
  margin-bottom: 0.5rem;
  pointer-events: none;
}

.sidebar-story-meta {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  pointer-events: none;
}

.sidebar-empty {
  text-align: center;
  padding: 2rem;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
  font-style: italic;
}

/* Scrollbar styling for sidebar */
.sidebar-list::-webkit-scrollbar {
  width: 6px;
}

.sidebar-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}

.sidebar-list::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.5);
  border-radius: 3px;
}

.sidebar-list::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 126, 234, 0.7);
}

/* ========================================
   NOTIFICATIONS
   ======================================== */
.notification {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: rgba(0, 0, 0, 0.95);
  padding: 1.2rem 2rem;
  border-radius: 15px;
  border: 2px solid var(--primary);
  backdrop-filter: blur(20px);
  z-index: 1100;
  animation: notifSlideIn 0.4s ease-out;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

@keyframes notifSlideIn {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.notification.error {
  border-color: #e74c3c;
}

.notification.success {
  border-color: #2ecc71;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 1rem;
  }
  
  .stats {
    left: 1rem;
    bottom: 1rem;
    gap: 0.8rem;
  }
  
  .stat-card {
    min-width: 80px;
    padding: 0.8rem 1rem;
  }
  
  .panel {
    max-width: 90vw;
  }
  
  #ai-panel {
    bottom: 1rem;
    right: 1rem;
    width: calc(100vw - 2rem);
  }
  
  #ai-toggle {
    bottom: 1rem;
    right: 1rem;
    width: 55px;
    height: 55px;
  }
  
  .modal-content {
    padding: 1.5rem;
  }
  
  #about-modal .modal-content {
    padding: 2rem 1.5rem;
  }
  
  .about-section {
    padding: 1.2rem;
  }
  
  .constellation-controls {
    flex-direction: column;
    width: 90%;
  }
  
  .constellation-btn {
    width: 100%;
  }
  
  #intro-timeline {
    width: 150px;
  }
  
  /* Sidebar mobile adjustments */
  .content-sidebar {
    width: 280px;
    right: -280px;
    top: 70px;
  }
  
  .sidebar-toggle {
    width: 55px;
    height: 55px;
    font-size: 20px;
    top: 120px;
  }
}
