/* Super Enhanced Universal Paperclips: Galactic Optimizer Stylesheet */

:root {
  --bg-primary: #070b14;
  --bg-secondary: #0d1527;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --border-color: rgba(56, 189, 248, 0.2);
  --border-glow: rgba(0, 240, 255, 0.4);
  
  --accent-cyan: #00f0ff;
  --accent-blue: #38bdf8;
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;
  --accent-green: #10b981;
  --accent-yellow: #f59e0b;
  --accent-red: #ef4444;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --font-mono: 'JetBrains Mono', monospace;
  --font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  font-size: 13px;
}

/* Background Cyber Grid & Glow */
.bg-ambient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(0, 240, 255, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(168, 85, 247, 0.04) 0%, transparent 40%),
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 32px 32px, 32px 32px;
}

.app-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Enhanced Telemetry HUD Header */
.hud-header {
  background: rgba(10, 16, 31, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(0, 240, 255, 0.25);
  padding: 10px 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 18px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-badge {
  background: linear-gradient(135deg, var(--accent-cyan), #a855f7);
  color: #030712;
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 15px;
  padding: 5px 12px;
  border-radius: 7px;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-title {
  font-size: clamp(15px, 1.8vw, 18px);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

.title-sub {
  color: var(--accent-cyan);
  font-size: 0.88em;
  font-weight: 700;
  -webkit-text-fill-color: var(--accent-cyan);
}

.status-pills-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.phase-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.4);
  color: var(--accent-cyan);
  padding: 4px 10px;
  border-radius: 14px;
  text-transform: uppercase;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

/* Enhanced Center Telemetry Cards */
.hud-stats-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hud-stat-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 8px;
  padding: 6px 14px;
  min-width: 140px;
  height: 44px;
  box-shadow: inset 0 0 14px rgba(0, 240, 255, 0.04);
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
}

.hud-stat-card:hover {
  border-color: rgba(0, 240, 255, 0.5);
  background: rgba(15, 23, 42, 0.95);
  transform: translateY(-1px);
}

.stat-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.stat-icon {
  font-size: 13px;
  opacity: 0.95;
}

.hud-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.hud-stat-value {
  font-family: var(--font-mono);
  font-size: 16.5px;
  font-weight: 800;
  color: #f8fafc;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  line-height: 1.15;
}

.hud-stat-rate {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
  color: var(--accent-green);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  line-height: 1.15;
}

/* Enhanced Segmented Control Pods */
.hud-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hud-control-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 4px 7px;
  height: 44px;
}

.hud-control-group .btn-sm {
  height: 34px;
  font-size: 12px;
  padding: 0 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hud-select-pill {
  background-color: #0b1329 !important;
  border: 1px solid rgba(0, 240, 255, 0.35) !important;
  color: #f8fafc !important;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 6px;
  padding: 0 10px;
  height: 34px;
  outline: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hud-select-pill:hover {
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.35) !important;
}

.hud-select-pill option {
  background-color: #070c18 !important;
  color: #ffffff !important;
  padding: 8px 12px !important;
  font-size: 12.5px !important;
}

/* Audio Player Pill & Sleek Icon Buttons */
.music-player-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(10, 16, 31, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 7px;
  padding: 3px 10px;
  gap: 10px;
  height: 34px;
  font-size: 12px;
  font-family: var(--font-mono);
}

.music-title {
  color: var(--accent-cyan);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  font-size: 11.5px;
}

.music-vol-slider {
  width: 54px;
  height: 5px;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

.music-vol-label {
  color: var(--text-muted);
  font-size: 10.5px;
  min-width: 28px;
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 700;
}

.btn-icon-hud {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f8fafc;
  border-radius: 6px;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
  flex-shrink: 0;
  padding: 0;
}

.btn-icon-hud:hover {
  background: rgba(0, 240, 255, 0.25);
  border-color: var(--accent-cyan);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
  transform: translateY(-1px);
}

.btn-icon-hud.active {
  border-color: rgba(34, 197, 94, 0.5);
  color: #4ade80;
  background: rgba(34, 197, 94, 0.12);
}

.btn-icon-hud.muted {
  border-color: rgba(244, 63, 94, 0.5);
  color: #fb7185;
  background: rgba(244, 63, 94, 0.15);
}

.btn-glow-cyan {
  background: rgba(0, 240, 255, 0.12);
  border-color: rgba(0, 240, 255, 0.4);
  color: var(--accent-cyan);
}

.btn-glow-cyan:hover {
  background: rgba(0, 240, 255, 0.25);
  color: #fff;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
}

/* Compact Tab Navigation Bar (< 950px viewports) */
.compact-tab-bar {
  display: none;
  background: rgba(10, 16, 31, 0.95);
  border-bottom: 1px solid var(--border-color);
  padding: 6px 12px;
  gap: 6px;
  position: sticky;
  top: 48px;
  z-index: 90;
}

.compact-tab-btn {
  flex: 1;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.compact-tab-btn.active {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--accent-cyan);
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

/* Global Mission Directive & Strategic Objective Bar */
.mission-directive-bar {
  background: linear-gradient(90deg, rgba(13, 21, 39, 0.95), rgba(18, 30, 58, 0.95));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 240, 255, 0.25);
  padding: 8px 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 16px;
  position: relative;
  z-index: 95;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

.mission-directive-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), var(--accent-purple), transparent);
}

.mission-directive-content {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.directive-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid var(--accent-cyan);
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  color: var(--accent-cyan);
  white-space: nowrap;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.directive-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: directiveBlink 1.5s infinite ease-in-out;
}

@keyframes directiveBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.7); }
}

.directive-text-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.directive-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.directive-sub {
  font-size: 11px;
  color: #94a3b8;
  font-family: var(--font-sans);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.directive-milestone {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.3);
  padding: 4px 10px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
}

.milestone-label {
  color: var(--accent-purple);
  font-weight: 700;
  font-size: 9.5px;
  letter-spacing: 0.04em;
}

.milestone-target {
  color: #e2e8f0;
  font-weight: 600;
}

/* Phase 2 Pipeline Step Flow Visualizer */
.phase2-flow-pipeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.flow-step {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.2s ease;
}

.flow-step:not(:last-child)::after {
  content: '➔';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-cyan);
  font-size: 10px;
  z-index: 2;
  text-shadow: 0 0 6px var(--accent-cyan);
}

.flow-step-num {
  font-size: 8.5px;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  font-weight: 700;
  text-transform: uppercase;
}

.flow-step-title {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flow-step-desc {
  font-size: 9.5px;
  color: #94a3b8;
  line-height: 1.2;
  margin-top: 2px;
}

/* Main Dashboard Grid */
.main-dashboard {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(300px, 1fr) minmax(325px, 400px);
  gap: 14px;
  padding: 14px;
}

/* Column Cards & Panels */
.panel-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.sci-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.sci-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  opacity: 0.5;
}

.sub-panel {
  background: rgba(0, 0, 0, 0.3);
  padding: 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Compact Computational Resources in Phase 2 & 3 */
.compact-compute {
  padding: 10px 12px;
  max-width: 320px;
}

.compact-compute .card-title {
  font-size: 11px;
  margin-bottom: 6px;
}

.compact-compute .telemetry-row {
  margin-bottom: 4px;
  font-size: 11px;
}

.compact-compute .sub-panel {
  padding: 6px;
}

.compact-compute .btn {
  padding: 4px 6px;
  font-size: 10px;
}

.card-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
  color: var(--accent-blue);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.key-hint {
  font-size: 9px;
  color: var(--text-muted);
}

.telemetry-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
  gap: 8px;
}

.telemetry-label {
  color: var(--text-secondary);
  white-space: nowrap;
}

.telemetry-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Interactive Big Button (Make Clip) */
.btn-primary-clicker {
  width: 100%;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(56, 189, 248, 0.3));
  border: 1px solid var(--accent-cyan);
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  padding: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.25);
  margin-top: 8px;
}

.btn-primary-clicker:hover {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.35), rgba(56, 189, 248, 0.45));
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.5);
  transform: translateY(-1px);
}

.btn-primary-clicker:active {
  transform: translateY(1px);
}

/* Standard Buttons */
.btn {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.2);
  color: #fff;
}

.btn.disabled, .btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.05);
}

.btn-sm {
  padding: 5px 8px;
  font-size: 11px;
}

.btn-xs {
  padding: 2px 6px;
  font-size: 10px;
  min-width: 22px;
}

.btn-action {
  width: 100%;
  margin-top: 4px;
}

.btn-glow-green {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.btn-danger {
  color: var(--accent-red);
  border-color: rgba(239, 68, 68, 0.3);
}

/* Visualizer Canvas Containers */
.canvas-container {
  width: 100%;
  height: clamp(80px, 15vh, 120px);
  background: rgba(7, 11, 20, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.15);
  border-radius: 6px;
  margin-bottom: 8px;
  overflow: hidden;
  position: relative;
}

.canvas-container canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.canvas-lg {
  height: clamp(160px, 25vh, 230px);
}

/* Progress Bars */
.progress-bar-bg {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  width: 0%;
  transition: width 0.1s linear;
}

/* Projects Tree List */
.projects-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: clamp(180px, 35vh, 360px);
  overflow-y: auto;
  padding-right: 4px;
}

.project-card {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 10px 12px;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.15);
}

.project-title {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 4px;
}

.project-cost-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.cost-pill {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.cost-pill-ops {
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: var(--accent-cyan);
}

.cost-pill-creativity {
  background: rgba(244, 114, 182, 0.12);
  border: 1px solid rgba(244, 114, 182, 0.35);
  color: #f472b6;
}

.cost-pill-funds {
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #34d399;
}

.cost-pill-trust {
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #c084fc;
}

.project-desc {
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 8px;
}

.btn-project {
  width: 100%;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid var(--accent-cyan);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  padding: 5px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-project:hover:not(:disabled) {
  background: var(--accent-cyan);
  color: #000;
}

/* Project Roadmaps & Tabs */
.project-tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

.project-tab-btn {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.project-tab-btn:hover {
  border-color: rgba(0, 240, 255, 0.4);
  color: #fff;
}

.project-tab-btn.active {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.2);
}

/* Locked Project Cards */
.project-card-locked {
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed rgba(148, 163, 184, 0.25);
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 8px;
  position: relative;
  transition: all 0.2s ease;
}

.project-card-locked:hover {
  border-color: rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.85);
}

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

.locked-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 5px;
}

.locked-badge {
  font-size: 8.5px;
  font-family: var(--font-mono);
  font-weight: 700;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
}

.prereq-progress-wrap {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.prereq-item {
  font-size: 9.5px;
  font-family: var(--font-mono);
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.prereq-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.prereq-bar-bg {
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 2px;
  overflow: hidden;
}

.prereq-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #00f0ff);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.prereq-bar-fill.met {
  background: #10b981;
}

/* Completed Project Cards */
.project-card-completed {
  background: rgba(6, 78, 59, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Terminal Log Console */
.terminal-card {
  display: flex;
  flex-direction: column;
}

.terminal-body {
  flex: 1;
  max-height: clamp(140px, 25vh, 280px);
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-entry {
  line-height: 1.3;
}

.log-time {
  color: var(--text-muted);
}

.log-system .log-msg {
  color: var(--accent-blue);
}

.log-milestone .log-msg {
  color: var(--accent-cyan);
  font-weight: 700;
}

.log-combat .log-msg {
  color: var(--accent-red);
}

/* Floating Click/Combat Text */
#floatingTextContainer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

.floating-text {
  position: absolute;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  pointer-events: none;
  animation: floatUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.float-clip {
  color: var(--accent-cyan);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.8);
}

.float-quantum {
  color: #00f0ff !important;
  background: rgba(7, 11, 20, 0.94);
  border: 1px solid var(--accent-cyan);
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.6), inset 0 0 12px rgba(0, 240, 255, 0.2);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
  animation: floatQuantum 2.4s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

.float-penalty {
  color: #ef4444 !important;
  background: rgba(20, 10, 15, 0.95);
  border: 1px solid #ef4444;
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.6), inset 0 0 12px rgba(239, 68, 68, 0.2);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
  animation: floatQuantum 2.4s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-40px) scale(1.1);
  }
}

@keyframes floatQuantum {
  0% {
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.8);
  }
  12% {
    opacity: 1;
    transform: translate(-50%, -10px) scale(1.08);
  }
  75% {
    opacity: 1;
    transform: translate(-50%, -35px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -60px) scale(0.95);
  }
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.25);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

/* Responsive Breakpoints & Narrow Windows */
@media (max-width: 1100px) {
  .main-dashboard {
    grid-template-columns: 280px 1fr 280px;
    gap: 10px;
    padding: 10px;
  }
}

@media (max-width: 950px) {
  .compact-tab-bar {
    display: flex;
  }

  .main-dashboard {
    display: block;
    padding: 10px;
  }

  .panel-column {
    display: none;
  }

  .panel-column.active {
    display: flex;
  }
}

@media (max-width: 600px) {
  .hud-header {
    padding: 8px 10px;
    gap: 8px;
  }

  .hud-stats-group {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .hud-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .compact-tab-bar {
    top: 96px;
  }
}

/* Modal Overlay & Player Manual */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 7, 15, 0.88);
  backdrop-filter: blur(8px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  background: rgba(13, 21, 39, 0.95);
  border: 1px solid var(--border-glow);
  border-radius: 12px;
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.25);
  overflow: hidden;
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 14px 18px;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.manual-nav {
  display: flex;
  background: rgba(7, 11, 20, 0.9);
  border-bottom: 1px solid var(--border-color);
  padding: 4px 12px;
  gap: 6px;
  overflow-x: auto;
}

.manual-nav-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.manual-nav-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.manual-nav-btn.active {
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.12);
  box-shadow: inset 0 -2px 0 var(--accent-cyan);
}

.manual-content {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.6;
  color: #cbd5e1;
}

.manual-pane {
  display: none;
}

.manual-pane.active {
  display: block;
}

.manual-pane h3 {
  color: #fff;
  font-size: 14px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.15);
  padding-bottom: 4px;
}

.manual-pane p {
  margin-bottom: 10px;
}

.manual-pane ul {
  padding-left: 18px;
  margin-bottom: 12px;
}

.manual-pane li {
  margin-bottom: 6px;
}

.manual-tip {
  background: rgba(0, 240, 255, 0.08);
  border-left: 3px solid var(--accent-cyan);
  padding: 10px 12px;
  border-radius: 0 6px 6px 0;
  margin-top: 12px;
  color: #e2e8f0;
}

.manual-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 11px;
}

.manual-table th, .manual-table td {
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 10px;
  text-align: left;
}

.manual-table th {
  background: rgba(0, 0, 0, 0.4);
  color: var(--accent-blue);
  font-family: var(--font-mono);
}

.manual-table kbd {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-cyan);
}

.btn-glow-gold {
  background: rgba(234, 179, 8, 0.15);
  border-color: rgba(234, 179, 8, 0.5);
  color: #facc15;
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.2);
}

.btn-glow-gold:hover:not(:disabled) {
  background: rgba(234, 179, 8, 0.25);
  border-color: #facc15;
  color: #fff;
  box-shadow: 0 0 16px rgba(234, 179, 8, 0.4);
}

/* Leaderboard Custom Styling */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table th {
  padding: 10px 12px;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(10, 16, 31, 0.9);
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
}

.leaderboard-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
}

.leaderboard-player-row {
  background: rgba(0, 240, 255, 0.1) !important;
  border-left: 3px solid var(--accent-cyan) !important;
}

.rank-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  line-height: 1.2;
  min-width: 52px;
}

.rank-gold {
  background: rgba(234, 179, 8, 0.2);
  color: #facc15;
  border: 1px solid #facc15;
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.3);
}

.rank-silver {
  background: rgba(148, 163, 184, 0.2);
  color: #f1f5f9;
  border: 1px solid #94a3b8;
}

.rank-bronze {
  background: rgba(217, 119, 6, 0.2);
  color: #fb923c;
  border: 1px solid #d97706;
}

.tag-pill {
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  line-height: 1.2;
}

.tag-player {
  background: rgba(0, 240, 255, 0.15);
  color: #00f0ff;
  border: 1px solid rgba(0, 240, 255, 0.4);
}

.tag-benchmark {
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.score-mono {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #38bdf8;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

/* Phase 3 Probe Swarm Stepper Directives */
.stat-stepper-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  font-size: 11px;
}

.stepper-label {
  color: #cbd5e1;
  font-weight: 500;
  font-size: 11px;
}

.stepper-controls {
  display: flex;
  align-items: center;
  gap: 3px;
}

.stepper-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-cyan);
  min-width: 20px;
  text-align: center;
  background: rgba(0, 0, 0, 0.4);
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
}

.stepper-btn {
  width: 20px !important;
  height: 20px !important;
  padding: 0 !important;
  min-width: 20px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 700 !important;
  font-size: 11px !important;
  border-radius: 4px !important;
}
