:root {
  --bg-glass: rgba(8, 15, 32, 0.78);
  --border-glass: rgba(125, 211, 252, 0.25);
  --accent: #38bdf8;
  --accent-warm: #fbbf24;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --radius: 16px;
}

* {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #030612;
  color: var(--text-main);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

#canvas-container {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
}

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

/* Center subtle reticle on desktop */
#desktop-reticle {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(125, 211, 252, 0.55);
  border-radius: 50%;
  pointer-events: none;
  z-index: 5;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

#desktop-reticle.locked {
  transform: translate(-50%, -50%) scale(1.45);
  border-color: #fde047;
  box-shadow: 0 0 12px rgba(253, 224, 71, 0.65);
}

/* Top bar */
.hud-top {
  position: fixed;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  z-index: 20;
  pointer-events: none;
}

.hud-top > * {
  pointer-events: auto;
}

.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.brand-card {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 380px;
}

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

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, #fde047, #38bdf8);
  box-shadow: 0 0 12px #38bdf8;
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.mode-badge {
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #7dd3fc;
  font-weight: 600;
}

.status-line {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.xr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

button, select {
  font-family: inherit;
  color: var(--text-main);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 15px;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  background: rgba(15, 23, 42, 0.82);
  font-size: 0.85rem;
  font-weight: 650;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover:not(:disabled) {
  background: rgba(30, 41, 59, 0.95);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-ar {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.35), rgba(56, 189, 248, 0.2));
  border-color: #38bdf8;
  color: #e0f2fe;
}

.btn-vr {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.38), rgba(168, 85, 247, 0.22));
  border-color: #a78bfa;
  color: #ede9fe;
}

.btn-gold {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.35), rgba(251, 191, 36, 0.18));
  border-color: #fbbf24;
  color: #fef3c7;
}

.btn-sm {
  padding: 6px 11px;
  font-size: 0.78rem;
  border-radius: 10px;
}

.btn-active {
  background: rgba(56, 189, 248, 0.28);
  border-color: #38bdf8;
}

/* Collapsible Side Control Drawer */
.drawer {
  position: fixed;
  top: 96px;
  left: 14px;
  width: 315px;
  max-height: calc(100vh - 195px);
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 18;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.drawer.collapsed {
  transform: translateX(-340px);
  opacity: 0;
  pointer-events: none;
}

.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7dd3fc;
  font-weight: 700;
}

select, input[type="range"] {
  width: 100%;
}

select {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
  font-size: 0.82rem;
}

.slider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.filter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  cursor: pointer;
}

.check-row input {
  accent-color: #38bdf8;
  width: 15px;
  height: 15px;
}

/* Quick jump chips */
.jump-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(15, 23, 42, 0.72);
  font-size: 0.74rem;
  cursor: pointer;
  color: #e2e8f0;
}

.chip:hover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.22);
}

/* AeroVia Knowledge & Live Launches Hub */
.aerovia-box {
  background: rgba(15, 23, 42, 0.68);
  border: 1px solid rgba(255, 122, 69, 0.35);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.iss-pass-card {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.launch-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.launch-item {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 9px;
  padding: 7px 9px;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.launch-item:hover {
  border-color: #ff7a45;
  background: rgba(255, 122, 69, 0.14);
}

.launch-item-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #f8fafc;
}

.launch-item-sub {
  font-size: 0.72rem;
  color: #94a3b8;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: 2px;
}

.launch-countdown {
  color: #fbbf24;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.aerovia-credit {
  font-size: 0.72rem;
  color: #94a3b8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.aerovia-link {
  color: #7dd3fc;
  text-decoration: none;
  font-weight: 650;
}

.aerovia-link:hover {
  text-decoration: underline;
}

/* Bottom Focus & Inspector Card */
.hud-bottom {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: min(760px, calc(100vw - 28px));
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.focus-card {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.focus-info {
  flex: 1;
  min-width: 220px;
}

.focus-cat {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 750;
  color: #38bdf8;
}

.focus-title {
  font-size: 1.12rem;
  font-weight: 800;
  margin: 2px 0;
}

.focus-meta {
  font-size: 0.8rem;
  color: #cbd5e1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.focus-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.35;
}

.focus-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.controls-bar {
  text-align: center;
  font-size: 0.73rem;
  color: rgba(148, 163, 184, 0.9);
  padding: 4px 10px;
  background: rgba(3, 6, 18, 0.55);
  border-radius: 999px;
  align-self: center;
}

/* Scrollbar */
.drawer::-webkit-scrollbar {
  width: 6px;
}
.drawer::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 6px;
}

@media (max-width: 720px) {
  .drawer {
    width: calc(100vw - 28px);
    max-height: 46vh;
  }
}
