/* ==========================================================================
   COSMIC OBSERVER CONSOLE — THEME & STYLES (WITH WAR, DISASTERS & MACRO ZOOM)
   ========================================================================== */

:root {
  --bg-space: #060810;
  --bg-panel: rgba(14, 18, 30, 0.82);
  --bg-card: rgba(22, 28, 46, 0.75);
  --border-dim: rgba(255, 255, 255, 0.08);
  --border-bright: rgba(255, 215, 0, 0.25);
  
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-dim: #64748b;
  --text-gold: #fbbf24;
  --text-cyan: #38bdf8;
  --text-purple: #c084fc;
  --text-red: #ef4444;
  
  --accent-gold: #f59e0b;
  --accent-blue: #38bdf8;
  --accent-green: #10b981;
  --accent-purple: #8b5cf6;
  --accent-rose: #f43f5e;
  --accent-red: #ef4444;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Cinzel', serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  background-color: var(--bg-space);
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  user-select: none;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* ================= Top Navigation Bar ================= */
.top-nav {
  height: 62px;
  background: rgba(10, 14, 24, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
}

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

.brand-glyph {
  font-size: 1.5rem;
  color: var(--text-gold);
  text-shadow: 0 0 16px rgba(251, 191, 36, 0.6);
  animation: pulse-glow 3s infinite alternate ease-in-out;
}

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

.brand-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 2px;
  color: #fff;
}

.brand-sub {
  font-size: 0.62rem;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  font-weight: 600;
}

/* Conflict Status Pill */
.conflict-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: #10b981;
  transition: all 0.3s ease;
}

.conflict-status-pill.war {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.6);
  color: #ef4444;
  animation: pulse-glow 1.5s infinite alternate;
}

.conflict-status-pill.genocide {
  background: rgba(153, 27, 27, 0.4);
  border-color: #dc2626;
  color: #fca5a5;
  box-shadow: 0 0 14px rgba(220, 38, 38, 0.5);
  animation: pulse-glow 0.8s infinite alternate;
}

.conflict-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.casualty-badge {
  background: rgba(0, 0, 0, 0.4);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 0.65rem;
  color: #fff;
}

/* Celestial Status Center */
.celestial-telemetry {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(0, 0, 0, 0.35);
  padding: 6px 14px;
  border-radius: 30px;
  border: 1px solid var(--border-dim);
}

.tele-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tele-icon {
  font-size: 1.1rem;
}

.tele-info {
  display: flex;
  flex-direction: column;
}

.tele-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.8px;
  font-weight: 600;
}

.tele-val {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-primary);
}

.tele-divider {
  width: 1px;
  height: 20px;
  background: var(--border-dim);
}

.highlight-gold {
  color: var(--text-gold);
  font-weight: 600;
}

/* Observer Controls */
.observer-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-pill {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
  border: 1px solid var(--border-dim);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-pill:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-god-portal {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(6, 182, 212, 0.3));
  border: 1px solid rgba(99, 102, 241, 0.6);
  color: #c7d2fe;
  text-decoration: none;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
  font-weight: 600;
}

.btn-god-portal:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.5), rgba(6, 182, 212, 0.5));
  border-color: #818cf8;
  color: #fff;
  box-shadow: 0 0 18px rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  border: none;
  color: #000;
  font-weight: 600;
}

.btn-group {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 20px;
  padding: 2px;
  border: 1px solid var(--border-dim);
}

.btn-speed {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 14px;
  transition: all 0.15s ease;
}

.btn-speed.active, .btn-speed:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

/* ================= Main Viewport ================= */
.main-viewport {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

.sidebar {
  width: 320px;
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-dim);
  display: flex;
  flex-direction: column;
  z-index: 20;
  overflow-y: auto;
  padding: 14px;
}

.right-panel {
  width: 370px;
  border-right: none;
  border-left: 1px solid var(--border-dim);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.panel-header h3 {
  font-family: var(--font-serif);
  font-size: 0.82rem;
  letter-spacing: 1.2px;
  color: var(--text-gold);
  text-transform: uppercase;
}

/* Faction Cards */
.faction-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.faction-card {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: 6px;
  padding: 8px 10px;
}

.faction-card.solari {
  border-left: 3px solid #f59e0b;
}

.faction-card.lunari {
  border-left: 3px solid #8b5cf6;
}

.fac-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
}

.fac-desc {
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Catastrophe Box */
.catastrophe-box {
  background: rgba(20, 15, 25, 0.6);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  padding: 10px;
}

.btn-danger {
  border-color: rgba(239, 68, 68, 0.4) !important;
  color: #fca5a5 !important;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2) !important;
}

.btn-peace {
  border-color: rgba(16, 185, 129, 0.4) !important;
  color: #6ee7b7 !important;
}

.btn-heal {
  border-color: rgba(56, 189, 248, 0.4) !important;
  color: #7dd3fc !important;
}

/* Hierarchy List */
.hierarchy-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 28vh;
  overflow-y: auto;
}

.hierarchy-item {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: 6px;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hierarchy-item:hover, .hierarchy-item.active {
  border-color: var(--accent-gold);
  background: rgba(30, 41, 59, 0.85);
}

.rank-crown {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.05);
}

.rank-crown.chief { background: rgba(245, 158, 11, 0.25); color: var(--accent-gold); }
.rank-crown.sage { background: rgba(139, 92, 246, 0.25); color: var(--accent-purple); }
.rank-crown.builder { background: rgba(56, 189, 248, 0.25); color: var(--accent-blue); }

.h-info { flex: 1; }
.h-name { font-size: 0.78rem; font-weight: 600; color: #fff; }
.h-title { font-size: 0.65rem; color: var(--text-dim); }
.h-score { font-size: 0.68rem; font-family: var(--font-mono); color: var(--text-gold); }

/* ================= Center Simulation Canvas ================= */
.simulation-stage {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at center, #0f172a 0%, #030712 100%);
}

.canvas-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.canvas-container.hidden { display: none; }

#surface-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

#surface-canvas:active {
  cursor: grabbing;
}

/* Camera & Zoom Toolbar */
.camera-toolbar {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(10, 14, 24, 0.92);
  backdrop-filter: blur(12px);
  padding: 6px 12px;
  border-radius: 26px;
  border: 1px solid var(--border-dim);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  z-index: 20;
}

.cam-modes-group, .cam-jumps-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cam-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-dim);
  color: #fff;
  border-radius: 14px;
  padding: 5px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cam-btn:hover, .cam-btn.active {
  background: var(--accent-gold);
  color: #000;
  border-color: var(--accent-gold);
  font-weight: 700;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.cam-divider {
  width: 1px;
  height: 18px;
  background: var(--border-dim);
  margin: 0 4px;
}

.cam-jump {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.68rem;
  padding: 4px 7px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.cam-jump:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

/* Controls Guide HUD */
.controls-guide-hud {
  position: absolute;
  top: 66px;
  left: 14px;
  display: flex;
  gap: 6px;
  background: rgba(10, 14, 24, 0.75);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 14px;
  border: 1px solid var(--border-dim);
  pointer-events: none;
  z-index: 10;
}

.guide-tag {
  font-size: 0.62rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

#three-stage-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  display: block;
}

/* Floating Surface HUD */
.surface-hud {
  position: absolute;
  bottom: 16px;
  left: 16px;
  display: flex;
  gap: 8px;
  background: rgba(10, 14, 24, 0.85);
  backdrop-filter: blur(8px);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-dim);
  pointer-events: none;
}

.hud-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.chip-color { width: 8px; height: 8px; border-radius: 50%; }
.chip-color.meadow { background: #16a34a; }
.chip-color.river { background: #0284c7; }
.chip-color.forest { background: #065f46; }
.chip-color.hearth { background: #ea580c; }
.chip-color.fire { background: #ef4444; }
.chip-color.war { background: #dc2626; }

/* ================= Right Panel: Inspector & Tabs ================= */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border-dim);
  margin-bottom: 12px;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 8px 0;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab-btn.active {
  color: var(--text-gold);
  border-bottom-color: var(--text-gold);
}

.tab-content {
  display: none;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

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

/* Being Card */
.being-card { display: flex; flex-direction: column; gap: 10px; }

.card-header { display: flex; align-items: center; gap: 10px; }

.avatar-ring {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--text-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-gold);
  background: rgba(245, 158, 11, 0.1);
}

.being-meta h2 { font-family: var(--font-serif); font-size: 1.05rem; color: #fff; }

.meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.role-badge { font-size: 0.68rem; color: var(--text-gold); font-weight: 500; }

.faction-pill {
  font-size: 0.6rem;
  text-transform: uppercase;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
}

.faction-pill.solari { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.faction-pill.lunari { background: rgba(139, 92, 246, 0.2); color: #c084fc; }

/* Stream of Consciousness */
.thought-stream-card {
  background: rgba(30, 27, 75, 0.4);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 8px;
  padding: 10px;
}

.stream-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.6rem;
  font-family: var(--font-mono);
  letter-spacing: 1.2px;
  color: var(--accent-purple);
  margin-bottom: 6px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-purple);
  border-radius: 50%;
  animation: pulse-glow 1.5s infinite;
}

blockquote#being-thought {
  font-size: 0.78rem;
  line-height: 1.4;
  font-style: italic;
  color: #e2e8f0;
}

/* Health & Sickness */
.health-container {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-dim);
  border-radius: 6px;
  padding: 8px 10px;
}

.health-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.health-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.health-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ef4444, #10b981);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.sickness-alert {
  margin-top: 6px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.sickness-alert.hidden { display: none; }

/* Needs Grid */
.needs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.need-item {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-dim);
  border-radius: 6px;
  padding: 5px 8px;
}

.need-lbl {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-bottom: 3px;
}

.meter-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.meter-fill { height: 100%; width: 50%; border-radius: 2px; transition: width 0.3s ease; }
.fill-green { background: #10b981; }
.fill-blue { background: #38bdf8; }
.fill-yellow { background: #fbbf24; }
.fill-purple { background: #c084fc; }
.fill-orange { background: #f97316; }
.fill-cyan { background: #06b6d4; }

/* Inventory & Arms */
.inventory-section, .personality-section, .memory-section {
  display: flex;
  flex-direction: column;
}

.section-title {
  font-size: 0.62rem;
  font-family: var(--font-mono);
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 5px;
}

.inv-chips, .trait-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.inv-chip, .trait-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-dim);
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.inv-chip.weapon {
  border-color: #ef4444;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.15);
}

/* Memories */
.memory-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 160px;
  overflow-y: auto;
}

.memory-item {
  background: rgba(0, 0, 0, 0.2);
  border-left: 3px solid var(--accent-gold);
  padding: 5px 8px;
  border-radius: 0 5px 5px 0;
  font-size: 0.68rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

.memory-item.traumatic {
  border-left-color: #ef4444;
  color: #fca5a5;
}

/* Chronicle Feed */
.chronicle-feed {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 75vh;
  overflow-y: auto;
}

.speech-entry {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: 6px;
  padding: 8px 10px;
}

.speech-speaker { font-size: 0.72rem; font-weight: 600; color: var(--text-gold); margin-bottom: 2px; }
.speech-text { font-size: 0.75rem; color: #e2e8f0; line-height: 1.35; }
.speech-meta { font-size: 0.6rem; color: var(--text-dim); margin-top: 4px; display: flex; justify-content: space-between; }

/* Cairns & Graves */
.cairns-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cairn-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid #64748b;
  border-radius: 4px;
  padding: 6px 8px;
}

.cairn-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: #e2e8f0;
}

.cairn-epitaph {
  font-size: 0.65rem;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 2px;
}

/* ================= Bottom Footer Status ================= */
.footer-bar {
  height: 30px;
  background: rgba(6, 8, 16, 0.95);
  border-top: 1px solid var(--border-dim);
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 0.65rem;
  color: var(--text-dim);
  gap: 10px;
  z-index: 100;
}

.status-indicator.live {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
}

.footer-sep { opacity: 0.3; }

@keyframes pulse-glow {
  0% { opacity: 0.6; }
  100% { opacity: 1; text-shadow: 0 0 20px rgba(251, 191, 36, 0.8); }
}

/* ================= 13 Tribes & Role Filters ================= */
.tribes-selector-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-dim);
  border-radius: 8px;
  margin: 6px 0;
}

.tribes-dropdown {
  width: 100%;
  background: rgba(10, 14, 26, 0.95);
  color: var(--text-gold);
  border: 1px solid var(--border-bright);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tribes-dropdown:hover, .tribes-dropdown:focus {
  border-color: var(--text-cyan);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.tribes-dropdown option {
  background: #0f172a;
  color: #f1f5f9;
}

.role-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.role-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-dim);
  color: var(--text-secondary);
  font-size: 0.65rem;
  font-weight: 500;
  padding: 3px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.role-chip:hover {
  background: rgba(56, 189, 248, 0.15);
  color: var(--text-cyan);
  border-color: rgba(56, 189, 248, 0.3);
}

.role-chip.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(56, 189, 248, 0.25));
  border-color: var(--text-gold);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

/* ================= Celestial Observatory HUD Modal ================= */
.observatory-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(840px, 92vw);
  background: rgba(8, 12, 24, 0.94);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 50px rgba(14, 165, 233, 0.2), 0 20px 40px rgba(0, 0, 0, 0.8);
  border-radius: 12px;
  z-index: 1000;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: modal-appear 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.observatory-modal.hidden {
  display: none !important;
}

@keyframes modal-appear {
  0% { opacity: 0; transform: translate(-50%, -46%) scale(0.96); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.obs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-dim);
  padding-bottom: 14px;
}

.obs-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.obs-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.6));
}

.obs-title h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  letter-spacing: 1.5px;
  color: #fff;
  margin-bottom: 2px;
}

.obs-sub {
  font-size: 0.68rem;
  color: var(--text-cyan);
  letter-spacing: 0.5px;
}

.btn-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-dim);
  color: var(--text-secondary);
  font-size: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-close:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--accent-rose);
  color: #fff;
}

.obs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (max-width: 680px) {
  .obs-grid {
    grid-template-columns: 1fr;
  }
}

.obs-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-dim);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s ease;
}

.obs-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
}

.obs-card-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-dim);
}

.obs-val {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 4px 0 2px 0;
}

.highlight-gold {
  color: var(--text-gold);
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

.highlight-cyan {
  color: var(--text-cyan);
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.highlight-purple {
  color: var(--text-purple);
  text-shadow: 0 0 10px rgba(192, 132, 252, 0.3);
}

.highlight-green {
  color: var(--accent-green);
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.obs-subtext {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.obs-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border-dim);
  padding-top: 14px;
}

/* ==========================================================================
   PHOTOREALISTIC PHYSICAL-DIGITAL CHASSIS & OPTICAL VIEWFINDER
   ========================================================================== */
.simulation-stage {
  position: relative;
  border: 12px solid #141721;
  border-image: linear-gradient(135deg, #2a2f42 0%, #151824 50%, #0d0f18 100%) 12;
  box-shadow: 
    inset 0 0 50px rgba(0, 0, 0, 0.9),
    0 10px 40px rgba(0, 0, 0, 0.7);
}

.physical-viewfinder-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 20;
}

/* Corner Precision Hex Bolts */
.bezel-bolt {
  position: absolute;
  width: 14px;
  height: 14px;
  background: radial-gradient(circle at 35% 35%, #e2e8f0 0%, #64748b 45%, #1e293b 85%, #0f172a 100%);
  border-radius: 50%;
  border: 1px solid #475569;
  box-shadow: 
    0 2px 5px rgba(0, 0, 0, 0.8),
    inset 0 1px 2px rgba(255, 255, 255, 0.6);
}
.bezel-bolt::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 2px;
  background: #0f172a;
  transform: translate(-50%, -50%) rotate(45deg);
}
.bolt-tl { top: 8px; left: 8px; }
.bolt-tr { top: 8px; right: 8px; }
.bolt-bl { bottom: 8px; left: 8px; }
.bolt-br { bottom: 8px; right: 8px; }

/* Stamped Metal Chassis Nameplate */
.bezel-nameplate {
  position: absolute;
  top: 8px;
  left: 36px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #2b3040 0%, #171b26 100%);
  padding: 4px 14px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.6),
    inset 0 1px 1px rgba(255, 255, 255, 0.2);
}
.plate-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #fbbf24;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}
.plate-sub {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  color: #94a3b8;
  letter-spacing: 1px;
}

/* Optical Reticle & Glass Crosshairs */
.optical-glass-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}
.reticle-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 140px;
  height: 140px;
  transform: translate(-50%, -50%);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 50%;
}
.reticle-cross-h {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 180px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.4), transparent);
  transform: translate(-50%, -50%);
}
.reticle-cross-v {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1px;
  height: 180px;
  background: linear-gradient(180deg, transparent, rgba(56, 189, 248, 0.4), transparent);
  transform: translate(-50%, -50%);
}
.reticle-ticks-top {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.35);
}

/* Analog Galvanometer Gauges */
.analog-gauges-cluster {
  position: absolute;
  top: 8px;
  right: 36px;
  display: flex;
  gap: 12px;
}
.analog-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: radial-gradient(circle at 50% 50%, #1e2538 0%, #0d101a 100%);
  border: 2px solid #333c54;
  border-radius: 8px;
  padding: 4px 6px 3px 6px;
  box-shadow: 
    0 4px 10px rgba(0, 0, 0, 0.7),
    inset 0 0 8px rgba(0, 0, 0, 0.8);
}
.gauge-dial {
  position: relative;
  width: 44px;
  height: 24px;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
}
.gauge-hub {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 6px;
  height: 6px;
  background: #f59e0b;
  border-radius: 50%;
  transform: translate(-50%, 50%);
  box-shadow: 0 0 4px #f59e0b;
}
.gauge-needle {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 1.5px;
  height: 20px;
  background: #ef4444;
  transform-origin: bottom center;
  transform: rotate(-35deg);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 3px #ef4444;
}
.gauge-label {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #94a3b8;
}

/* ==========================================================================
   SCIENTIFIC PSYCHOLOGY PANEL STYLES
   ========================================================================== */
.psyche-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.psyche-header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-dim);
  padding-bottom: 10px;
}
.psyche-icon {
  font-size: 1.4rem;
}
.psyche-header h4 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 1px;
  color: #fff;
}

/* Kahneman Box */
.kahneman-box {
  background: rgba(13, 17, 28, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.k-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.k-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-dim);
  font-weight: 600;
}
.k-badge {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}
.k-mode-visual {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.k-sys-bar {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.k-sys-tag {
  font-size: 0.65rem;
  color: var(--text-secondary);
}
.k-meter {
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}
.k-fill {
  height: 100%;
  transition: width 0.3s ease;
}
.sys1 .k-fill { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.sys2 .k-fill { background: linear-gradient(90deg, #38bdf8, #6366f1); }
.k-sub-metrics {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* Maslow Pyramid */
.maslow-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.maslow-pyramid {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.maslow-tier {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}
.maslow-tier .m-num {
  font-weight: 700;
  margin-right: 4px;
}
.maslow-tier.active {
  background: rgba(99, 102, 241, 0.18);
  color: #fff;
  border-left-color: #6366f1;
  font-weight: 600;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.2);
}

/* OCEAN Grid */
.ocean-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ocean-grid {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ocean-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ocean-lbl {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}
.ocean-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}
.ocean-fill {
  height: 100%;
  background: linear-gradient(90deg, #06b6d4, #3b82f6);
  transition: width 0.3s ease;
}

/* Deep Traits Cards */
.psyche-deep-traits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.trait-card {
  background: rgba(13, 17, 28, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.t-head {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--text-dim);
}
.t-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
}
.t-desc {
  font-size: 0.62rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* ==========================================================================
   CIVILIZATION EVOLUTION PANEL STYLES
   ========================================================================== */
.evolution-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.evolution-hero {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.08) 0%, rgba(13, 17, 28, 0.9) 100%);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.epoch-badge-strip {
  display: flex;
  align-items: center;
  gap: 10px;
}
.epoch-roman {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 900;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(251, 191, 36, 0.3);
}
.epoch-progress-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.epoch-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}
.epoch-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  transition: width 0.4s ease;
}

/* Tech Tree Grid */
.tech-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}
.tech-node {
  background: rgba(13, 17, 28, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 5px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tech-node.unlocked {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.05);
}
.tech-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
}
.tech-cat {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
}
.tech-status {
  font-size: 0.65rem;
  font-weight: 700;
  font-family: var(--font-mono);
}
.tech-status.done { color: #34d399; }
.tech-status.locked { color: var(--text-dim); }

/* Monuments List */
.monuments-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.monument-card {
  background: rgba(13, 17, 28, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 5px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.monument-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: #38bdf8;
}
.monument-desc {
  font-size: 0.62rem;
  color: var(--text-muted);
}


