/**
 * COSMIC TO PLANCK SCALE DESIGN SYSTEM
 * Ultra-premium Sci-Fi Glassmorphism Aesthetic
 * OLED Deep Space Palette, High-DPI Typography, Dynamic Glows
 */

:root {
  --bg-deep: #020409;
  --bg-card: rgba(8, 14, 28, 0.72);
  --bg-card-hover: rgba(13, 22, 44, 0.85);
  --border-glass: rgba(255, 255, 255, 0.12);
  --border-glow: rgba(56, 189, 248, 0.4);

  --accent-cosmic: #8b5cf6;
  --accent-cyan: #38bdf8;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-planck: #d946ef;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --font-bn: 'Hind Siliguri', system-ui, sans-serif;
  --font-en: 'Outfit', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-bn);
}

/* Fullscreen Dual-Engine Viewport Canvases */
#viewport-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  display: block;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}


/* Sci-Fi Vignette & Vignette Mask */
.hud-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 40%, rgba(2, 4, 9, 0.6) 80%, rgba(2, 4, 9, 0.95) 100%);
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.8);
}

/* ================= TOP HUD HEADER ================= */
.hud-top {
  position: absolute;
  top: 16px;
  left: 20px;
  right: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}

.hud-brand, .scale-telemetry, .hud-actions {
  pointer-events: auto;
}

/* Brand badge */
.hud-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-glass);
}

.pulsing-core {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan), 0 0 20px var(--accent-cyan);
  animation: pulseCore 2.5s infinite ease-in-out;
}

@keyframes pulseCore {
  0%, 100% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 16px var(--accent-planck); }
}

.brand-title {
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, #ffffff 10%, #38bdf8 65%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  padding-left: 10px;
}

/* Center Scale Telemetry Bar - Rock-Solid Stable Width & Centered Items */
.scale-telemetry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  padding: 8px 20px;
  border-radius: 30px;
  border: 1px solid var(--border-glass);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 1px rgba(255, 255, 255, 0.2);
  width: 640px;
  max-width: calc(100vw - 420px);
  gap: 16px;
  flex-shrink: 0;
}

.telemetry-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.telemetry-item.main-order {
  width: 130px;
  flex-shrink: 0;
}

.telemetry-item.metric-size {
  width: 180px;
  flex-shrink: 0;
}

.telemetry-item.light-time {
  width: 260px;
  flex-shrink: 0;
}

.telemetry-label {
  font-family: var(--font-en);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
  white-space: nowrap;
}

.telemetry-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.main-order .telemetry-value {
  font-size: 17px;
  color: var(--accent-cyan);
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
}

.telemetry-divider {
  width: 1px;
  height: 26px;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

/* Action Toolbar Buttons */
.hud-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  color: var(--text-main);
  border: 1px solid var(--border-glass);
  padding: 8px 14px;
  border-radius: 12px;
  font-family: var(--font-bn);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hud-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.2);
}

.hud-btn:active {
  transform: translateY(0);
}

.hud-btn.active {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.2);
  color: #ffffff;
}

.hud-btn.icon-only {
  padding: 8px 10px;
  font-size: 15px;
}

.lang-btn {
  font-family: var(--font-en);
  font-weight: 700;
}

/* Sound Wave Animation */
.sound-wave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 14px;
  opacity: 0.3;
}

.sound-wave span {
  width: 2px;
  height: 100%;
  background: var(--accent-cyan);
  border-radius: 2px;
  animation: soundBars 1.2s infinite ease-in-out;
}

.sound-wave span:nth-child(1) { animation-delay: 0.1s; height: 40%; }
.sound-wave span:nth-child(2) { animation-delay: 0.3s; height: 90%; }
.sound-wave span:nth-child(3) { animation-delay: 0.2s; height: 60%; }
.sound-wave span:nth-child(4) { animation-delay: 0.4s; height: 80%; }

@keyframes soundBars {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}

/* ================= DOMAIN BADGE ================= */
.domain-indicator-wrapper {
  position: absolute;
  top: 76px;
  left: 20px;
  z-index: 10;
  pointer-events: none;
}

.domain-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(8, 14, 28, 0.85);
  backdrop-filter: blur(16px);
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--accent-cosmic);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #ffffff;
  transition: all 0.3s ease;
}

/* ================= FLOATING OBJECT DETAILS CARD ================= */
.object-card-container {
  position: absolute;
  top: 114px;
  left: 20px;
  width: 320px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 165px);
  z-index: 10;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  overscroll-behavior: contain;
}

.object-card-container.minimized {
  transform: translateX(calc(-100% - 30px));
  opacity: 0;
  pointer-events: none;
}

/* Floating Restore Object Card Pill Button */
.object-card-restore-pill {
  position: absolute;
  top: 114px;
  left: 20px;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 16, 32, 0.92);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  padding: 7px 14px;
  border-radius: 20px;
  font-family: var(--font-bn);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 15px rgba(56, 189, 248, 0.2);
  transition: all 0.25s ease;
  animation: cardPillPulse 2.5s infinite ease-in-out;
}

.object-card-restore-pill:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7), 0 0 25px rgba(56, 189, 248, 0.45);
}

@keyframes cardPillPulse {
  0%, 100% {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 15px rgba(56, 189, 248, 0.2);
  }
  50% {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 25px rgba(56, 189, 248, 0.45);
  }
}

.object-card {
  position: relative;
  background: rgba(10, 16, 32, 0.94);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 11px 14px 14px 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  width: 100%;
  box-sizing: border-box;
  max-height: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.3) transparent;
  transition: all 0.3s ease;
  overscroll-behavior: contain;
}

.object-card::-webkit-scrollbar {
  width: 4px;
}
.object-card::-webkit-scrollbar-track {
  background: transparent;
}
.object-card::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.3);
  border-radius: 4px;
}
.object-card::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

.object-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.15);
}

.card-glow-border {
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
}

.card-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-title-row h2 {
  font-family: var(--font-bn);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  color: #ffffff;
  margin: 0;
  word-break: break-word;
}

.card-hide-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-dim);
  padding: 3px 8px;
  border-radius: 6px;
  font-family: var(--font-bn);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.card-hide-btn:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.55);
  color: #ffffff;
  transform: translateY(-1px);
}

.card-hide-btn .svg-icon {
  width: 12px;
  height: 12px;
}

.card-meta-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
}

.card-subname {
  font-family: var(--font-en);
  font-size: 11.5px;
  color: var(--text-dim);
  font-weight: 500;
}

.card-dimension-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.35;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  white-space: normal;
  word-break: break-word;
  max-width: 100%;
  box-sizing: border-box;
}

/* Scientific Truth & Force Badges Row */
.card-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -2px;
}

.truth-badge, .force-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
}

.truth-badge.verified {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

.truth-badge.model {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
}

.truth-badge.theoretical {
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #d8b4fe;
}

.truth-badge.speculative {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fda4af;
}

.force-badge {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
}

/* Instrument Ladder Box */
.card-instrument-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 6px 10px;
}

.instrument-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.instrument-content {
  font-size: 11.5px;
  color: var(--text-main);
  line-height: 1.35;
  margin: 0;
}

.card-summary {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}

/* Human Transit Box */
.card-transit-box {
  background: rgba(14, 165, 233, 0.06);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 10px;
  padding: 6px 10px;
}

.transit-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.transit-grid {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.transit-item {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  line-height: 1.35;
}

.transit-mode-tag {
  color: var(--text-dim);
  font-weight: 500;
}

.transit-mode-val {
  color: #bae6fd;
  font-weight: 600;
  text-align: right;
}

/* Misconception Buster Box */
.card-misconception-box {
  background: rgba(239, 68, 68, 0.08);
  border-left: 3px solid #ef4444;
  border-radius: 0 10px 10px 0;
  padding: 7px 10px;
  margin-bottom: 2px;
  animation: misconceptionPulse 3s infinite ease-in-out;
}

@keyframes misconceptionPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(239, 68, 68, 0); }
  50% { box-shadow: 0 0 12px rgba(239, 68, 68, 0.25); }
}

.misconception-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #f87171;
  margin-bottom: 3px;
}

.misconception-content {
  font-size: 11px;
  line-height: 1.4;
  color: #fee2e2;
  margin: 0;
}

/* Schwarzschild Black Hole Radius Box */
.card-blackhole-box {
  background: rgba(147, 51, 234, 0.08);
  border-left: 3px solid #a855f7;
  border-radius: 0 10px 10px 0;
  padding: 10px 12px;
  animation: blackholeHorizonGlow 4s infinite ease-in-out;
}

@keyframes blackholeHorizonGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(168, 85, 247, 0); }
  50% { box-shadow: 0 0 14px rgba(168, 85, 247, 0.25); }
}

.blackhole-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: #c084fc;
  margin-bottom: 4px;
}

.blackhole-content {
  font-size: 12.5px;
  line-height: 1.5;
  color: #f3e8ff;
  margin: 0;
}

/* Fact Box */
.card-fact-box {
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid var(--accent-amber);
  border-radius: 0 10px 10px 0;
  padding: 10px 12px;
}

.fact-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-amber);
  margin-bottom: 4px;
  font-family: var(--font-en);
  letter-spacing: 1px;
}

.fact-content {
  font-size: 12.5px;
  line-height: 1.5;
  color: #fef3c7;
  margin: 0;
}

.card-footer {
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.scroll-hint {
  font-size: 11.5px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ================= RIGHT HUD: FUNDAMENTAL FORCES PANEL ================= */
.force-dominance-panel {
  position: absolute;
  top: 114px;
  right: 20px;
  width: 260px;
  background: rgba(10, 16, 32, 0.94);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 10px 14px;
  z-index: 10;
  pointer-events: auto;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  overscroll-behavior: contain;
}

.force-dominance-panel.minimized {
  transform: translateX(calc(100% + 30px));
  opacity: 0;
  pointer-events: none;
}

.force-panel-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

.force-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
}

.force-header-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.force-hide-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-dim);
  padding: 3px 8px;
  border-radius: 6px;
  font-family: var(--font-bn);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.force-hide-btn:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.55);
  color: #ffffff;
  transform: translateY(-1px);
}

.force-hide-btn .svg-icon {
  width: 12px;
  height: 12px;
}

/* Floating Restore Forces Panel Pill Button */
.force-restore-pill {
  position: absolute;
  top: 114px;
  right: 20px;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 16, 32, 0.92);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #c084fc;
  padding: 7px 14px;
  border-radius: 20px;
  font-family: var(--font-bn);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 15px rgba(168, 85, 247, 0.2);
  transition: all 0.25s ease;
  animation: forcePillPulse 2.5s infinite ease-in-out;
}

.force-restore-pill:hover {
  background: rgba(168, 85, 247, 0.22);
  border-color: #c084fc;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7), 0 0 25px rgba(168, 85, 247, 0.45);
}

@keyframes forcePillPulse {
  0%, 100% {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 15px rgba(168, 85, 247, 0.2);
  }
  50% {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 25px rgba(168, 85, 247, 0.45);
  }
}


.force-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-muted);
  padding: 5px 8px;
  border-radius: 8px;
  transition: all 0.25s ease;
}

.force-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.25s ease;
}

.force-item-row.active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 600;
}

.force-item-row.active[data-force="gravity"] .force-indicator-dot {
  background: #818cf8;
  box-shadow: 0 0 10px #818cf8;
}
.force-item-row.active[data-force="electromagnetism"] .force-indicator-dot {
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
}
.force-item-row.active[data-force="strong"] .force-indicator-dot {
  background: #f43f5e;
  box-shadow: 0 0 10px #f43f5e;
}
.force-item-row.active[data-force="weak"] .force-indicator-dot {
  background: #fbbf24;
  box-shadow: 0 0 10px #fbbf24;
}
.force-item-row.active[data-force="quantum-gravity"] .force-indicator-dot {
  background: #d946ef;
  box-shadow: 0 0 10px #d946ef;
}

/* ================= DYNAMIC SCREEN RULER WIDGET ================= */
.screen-ruler-widget {
  position: absolute;
  right: 24px;
  bottom: 130px;
  background: rgba(8, 14, 28, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 8px 14px;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.ruler-bar {
  display: flex;
  align-items: center;
  width: 140px;
  height: 10px;
  position: relative;
}

.ruler-tick {
  width: 2px;
  height: 8px;
  background: var(--accent-cyan);
}

.ruler-line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-cosmic));
}

.ruler-label {
  font-size: 11px;
  font-weight: 600;
  color: #7dd3fc;
  letter-spacing: 0.3px;
}

/* ================= PLANCK WALL PARADOX BANNER ================= */
.planck-wall-banner {
  position: absolute;
  top: 86px;
  left: 50%;
  transform: translateX(-50%) translateY(-15px);
  background: rgba(159, 18, 57, 0.72);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(244, 63, 94, 0.45);
  border-radius: 30px;
  padding: 6px 16px;
  z-index: 50;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 15px rgba(244, 63, 94, 0.25);
  opacity: 0;
  max-width: min(640px, calc(100vw - 360px));
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.planck-wall-banner.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.planck-banner-content {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  font-size: 11.5px;
  line-height: 1.35;
}

.planck-banner-content strong {
  color: #ffe4e6;
}

/* ================= BOTTOM HUD ================= */
.hud-bottom {
  position: absolute;
  bottom: 14px;
  left: 20px;
  right: 20px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.quick-jump-bar, .timeline-scrubber-panel {
  pointer-events: auto;
}

/* Quick Landmark Jump Bar */
.quick-jump-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-glass);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  max-width: 90vw;
  overflow-x: auto;
  scrollbar-width: none;
}

.quick-jump-bar::-webkit-scrollbar {
  display: none;
}

.jump-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 5px 10px;
  color: var(--text-muted);
  font-family: var(--font-bn);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.jump-btn:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--accent-cyan);
  color: #ffffff;
  transform: translateY(-2px);
}

.jump-btn.active {
  background: rgba(56, 189, 248, 0.22);
  border-color: var(--accent-cyan);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.45), inset 0 0 10px rgba(56, 189, 248, 0.15);
  transform: translateY(-2px);
}

.jump-btn.active svg {
  color: var(--accent-cyan);
  filter: drop-shadow(0 0 6px var(--accent-cyan));
}

.jump-icon {
  font-size: 13px;
}

/* Main Timeline Scrubber Panel */
.timeline-scrubber-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  padding: 8px 18px;
  border-radius: 24px;
  width: 680px;
  max-width: calc(100vw - 40px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.zoom-stepper-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.zoom-stepper-btn:hover {
  background: var(--accent-cyan);
  color: #000;
  box-shadow: 0 0 16px var(--accent-cyan);
}

.slider-track-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  padding-bottom: 20px;
}

.slider-domain-markers {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 20px;
  pointer-events: none;
}

.slider-domain-markers span {
  position: absolute;
  transform: translateX(-50%);
  font-size: 8.5px;
  line-height: 1.1;
  text-align: center;
  color: var(--text-dim);
  font-family: var(--font-bn);
  font-weight: 500;
  white-space: nowrap;
}

.slider-domain-markers span:first-child {
  transform: translateX(0);
  text-align: left;
}

.slider-domain-markers span:last-child {
  transform: translateX(-100%);
  text-align: right;
}

/* Sci-fi range slider input */
#scale-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #818cf8 0%, #38bdf8 50%, #d946ef 100%);
  outline: none;
  cursor: pointer;
}

#scale-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--accent-cyan);
  box-shadow: 0 0 12px var(--accent-cyan), 0 0 20px #ffffff;
  cursor: pointer;
  transition: transform 0.1s ease;
}

#scale-slider::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

.tour-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #0284c7, #6366f1);
  color: #ffffff;
  border: none;
  padding: 10px 18px;
  border-radius: 14px;
  font-family: var(--font-bn);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  transition: all 0.2s ease;
}

.tour-btn:hover {
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.7);
  transform: translateY(-2px);
}

.tour-btn.active {
  background: linear-gradient(135deg, #ef4444, #f59e0b);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
}

/* ================= MODALS (SEARCH & COMPARE) ================= */
.hud-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}

.hud-modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 9, 0.85);
  backdrop-filter: blur(12px);
}

.modal-box {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  padding: 28px;
  width: 580px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(56, 189, 248, 0.2);
  z-index: 2;
}

.compare-box {
  width: 680px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}

.modal-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: #ef4444;
  color: #ffffff;
}

.modal-intro {
  font-size: 13px;
  color: var(--text-muted);
}

.modal-search-input-wrap input {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 12px 18px;
  color: #ffffff;
  font-size: 15px;
  font-family: var(--font-bn);
  outline: none;
  transition: border-color 0.2s ease;
}

.modal-search-input-wrap input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.search-results-list, .compare-results-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  max-height: 50vh;
  padding-right: 6px;
}

.search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-item:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  transform: translateX(4px);
}

.search-item-info h4 {
  font-size: 15px;
  color: #ffffff;
}

.search-sub {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-en);
}

.search-item-info p {
  font-size: 12px;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

.search-order {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-amber);
}

.compare-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.compare-card:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--accent-cosmic);
  transform: translateY(-2px);
}

.compare-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.comp-badge {
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
}

.comp-ratio {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-cyan);
  font-size: 14px;
}

.comp-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ================= RESPONSIVE ADJUSTMENTS ================= */
@media (max-width: 900px) {
  .telemetry-item.light-time {
    display: none;
  }
  .scale-telemetry {
    width: 440px;
    max-width: calc(100vw - 320px);
  }
  .object-card-container {
    width: 300px;
    top: 120px;
  }
  .card-summary {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

@media (max-width: 768px) {
  /* Top HUD Header: Two-Row Mobile Grid Layout */
  .hud-top {
    top: max(8px, env(safe-area-inset-top));
    left: 8px;
    right: 8px;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 6px;
    pointer-events: none;
  }

  .hud-brand {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
  }

  .brand-badge {
    padding: 4px 10px;
    gap: 6px;
  }

  .brand-title {
    font-size: 13px;
    letter-spacing: 1px;
  }

  .brand-sub {
    display: none !important;
  }

  .hud-actions {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 2px 0;
  }

  .hud-actions::-webkit-scrollbar {
    display: none;
  }

  .hud-btn {
    padding: 4px 7px;
    min-width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .hud-btn .btn-label {
    display: none !important;
  }

  .hud-btn .svg-icon {
    width: 16px;
    height: 16px;
  }

  .scale-telemetry {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100% !important;
    max-width: 100% !important;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 5px 12px;
    border-radius: 20px;
    gap: 6px;
  }

  .telemetry-item.main-order {
    width: auto;
    flex: 1;
  }

  .telemetry-item.metric-size {
    width: auto;
    flex: 1.3;
  }

  .telemetry-item.light-time {
    display: none !important;
  }

  .telemetry-label {
    font-size: 8px;
    letter-spacing: 0.5px;
  }

  .telemetry-value {
    font-size: 12.5px;
  }

  .main-order .telemetry-value {
    font-size: 14.5px;
  }

  /* Domain Indicator Badge */
  .domain-indicator-wrapper {
    top: max(86px, calc(env(safe-area-inset-top) + 80px));
    left: 8px;
  }

  .domain-badge {
    font-size: 10px;
    padding: 3px 9px;
    gap: 5px;
  }

  /* Floating Restore Pills on Mobile */
  .object-card-restore-pill {
    top: max(86px, calc(env(safe-area-inset-top) + 80px));
    right: 8px;
    left: auto;
    padding: 5px 11px;
    font-size: 11px;
    gap: 5px;
  }

  .force-restore-pill {
    top: max(120px, calc(env(safe-area-inset-top) + 114px));
    right: 8px;
    padding: 5px 11px;
    font-size: 11px;
    gap: 5px;
  }

  /* Floating Info Card & Forces Panel on Mobile */
  .object-card-container {
    position: absolute !important;
    top: max(116px, calc(env(safe-area-inset-top) + 110px));
    left: 8px;
    right: 8px;
    width: auto !important;
    max-width: calc(100vw - 16px) !important;
    max-height: calc(100vh - 245px);
    z-index: 25;
    margin: 0 !important;
  }

  .object-card {
    padding: 10px 12px 14px 12px;
    gap: 6px;
    border-radius: 16px;
  }

  .card-title-row h2 {
    font-size: 15px;
  }

  .card-summary {
    font-size: 11.5px;
    line-height: 1.4;
  }

  .card-instrument-box, .card-transit-box, .card-misconception-box, .card-blackhole-box {
    padding: 5px 8px;
    font-size: 10.5px;
  }

  .force-dominance-panel {
    position: absolute !important;
    top: max(116px, calc(env(safe-area-inset-top) + 110px));
    left: 8px;
    right: 8px;
    width: auto !important;
    max-width: calc(100vw - 16px) !important;
    max-height: calc(100vh - 245px);
    z-index: 26;
    padding: 8px 12px;
    gap: 5px;
    border-radius: 16px;
  }

  .force-item-row {
    padding: 4px 6px;
    font-size: 11px;
  }

  /* Planck Wall Banner on Mobile */
  .planck-wall-banner {
    top: max(116px, calc(env(safe-area-inset-top) + 110px));
    max-width: calc(100vw - 16px);
    padding: 5px 12px;
    font-size: 10.5px;
    border-radius: 20px;
  }

  .planck-banner-content {
    font-size: 10.5px;
    gap: 6px;
  }

  /* Bottom Controls on Mobile */
  .hud-bottom {
    bottom: max(6px, env(safe-area-inset-bottom));
    left: 6px;
    right: 6px;
    gap: 5px;
  }

  .quick-jump-bar {
    max-width: calc(100vw - 12px);
    padding: 4px 6px;
    gap: 5px;
    border-radius: 16px;
    -webkit-overflow-scrolling: touch;
  }

  .jump-btn {
    padding: 4px 8px;
    font-size: 10px;
    border-radius: 10px;
  }

  .jump-btn svg {
    width: 14px;
    height: 14px;
  }

  .timeline-scrubber-panel {
    width: 100% !important;
    max-width: calc(100vw - 12px) !important;
    padding: 6px 10px;
    border-radius: 20px;
    gap: 6px;
  }

  .zoom-stepper-btn {
    width: 32px;
    height: 32px;
    font-size: 17px;
    flex-shrink: 0;
  }

  .tour-btn {
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 14px;
    flex-shrink: 0;
  }

  .slider-domain-markers {
    display: none !important;
  }

  .slider-track-wrapper {
    padding-bottom: 0;
  }

  /* Screen Field indicator */
  .screen-ruler-hud {
    bottom: 82px;
    right: 8px;
  }

  .ruler-label {
    font-size: 9px;
    padding: 2px 6px;
  }

  .canvas-corner-disclaimer {
    display: none;
  }

  /* Modals on Mobile */
  .modal-box {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    max-height: 86vh;
    padding: 14px;
    gap: 10px;
    border-radius: 18px;
  }

  .compare-box {
    width: calc(100vw - 20px) !important;
  }

  .modal-header h3 {
    font-size: 15px;
  }

  .search-results-list, .compare-results-list {
    max-height: 52vh;
  }
}

/* Extra Compact Phones (iPhone SE / Galaxy A / width <= 420px) */
@media (max-width: 420px) {
  .hud-top {
    gap: 4px;
  }

  .brand-title {
    font-size: 12px;
  }

  .brand-badge {
    padding: 3px 8px;
  }

  .hud-btn {
    min-width: 30px;
    height: 30px;
    padding: 3px 5px;
  }

  .hud-btn .svg-icon {
    width: 14px;
    height: 14px;
  }

  .scale-telemetry {
    padding: 4px 8px;
  }

  .main-order .telemetry-value {
    font-size: 13.5px;
  }

  .metric-size .telemetry-value {
    font-size: 11.5px;
  }

  .tour-btn .btn-text {
    display: none;
  }

  .tour-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
  }
}

/* Mobile Landscape Orientation */
@media (max-height: 520px) and (orientation: landscape) {
  .hud-top {
    top: 4px;
    left: 8px;
    right: 8px;
    display: flex;
    justify-content: space-between;
  }

  .scale-telemetry {
    width: auto !important;
    padding: 4px 10px;
  }

  .object-card-container, .force-dominance-panel {
    top: 48px !important;
    max-height: calc(100vh - 100px) !important;
    width: 290px !important;
  }

  .hud-bottom {
    bottom: 4px;
    gap: 3px;
  }

  .quick-jump-bar {
    padding: 2px 6px;
  }

  .timeline-scrubber-panel {
    padding: 4px 8px;
  }
}

/* ================= SVG ICON SYSTEM ================= */
.svg-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.svg-icon.mini {
  width: 14px;
  height: 14px;
}

.svg-icon.title-icon {
  width: 22px;
  height: 22px;
  color: var(--accent-cyan);
}

.modal-title-with-icon {
  display: flex;
  align-items: center;
  gap: 10px;
}

.domain-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.domain-icon-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.domain-icon-slot svg {
  width: 16px;
  height: 16px;
}

.jump-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.jump-icon svg {
  width: 15px;
  height: 15px;
}

.tour-icon-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tour-icon-slot svg {
  width: 14px;
  height: 14px;
}

.fact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fact-icon svg {
  width: 15px;
  height: 15px;
}

.scroll-hint {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ================= SCALE QUIZ MODAL STYLES ================= */
.quiz-box {
  max-width: 680px;
  width: 92%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.quiz-content-area {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding: 12px 4px;
}

.quiz-question-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.3s ease;
}

.quiz-question-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(56, 189, 248, 0.3);
}

.quiz-q-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quiz-q-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: var(--font-mono);
}

.quiz-q-title {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.45;
  margin: 0;
}

.quiz-options-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 600px) {
  .quiz-options-list {
    grid-template-columns: 1fr;
  }
}

.quiz-option-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-main);
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  outline: none;
  font-family: var(--font-bn);
}

.quiz-option-btn:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  color: #ffffff;
  transform: translateY(-1px);
}

.quiz-option-btn:disabled {
  cursor: default;
  opacity: 0.75;
}

.quiz-option-btn.correct {
  background: rgba(16, 185, 129, 0.25) !important;
  border-color: #10b981 !important;
  color: #a7f3d0 !important;
  font-weight: 700;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.4);
  opacity: 1 !important;
}

.quiz-option-btn.wrong {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: #ef4444 !important;
  color: #fecaca !important;
  font-weight: 700;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.4);
  opacity: 1 !important;
}

.quiz-option-btn.highlight-correct {
  background: rgba(16, 185, 129, 0.18) !important;
  border-color: #10b981 !important;
  color: #6ee7b7 !important;
  font-weight: 600;
  opacity: 1 !important;
}

.quiz-feedback-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-radius: 10px;
  padding: 10px 14px;
  animation: fadeIn 0.3s ease;
}

.quiz-feedback-box.success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #ecfdf5;
}

.quiz-feedback-box.retry {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fffbeb;
}

.quiz-feedback-text strong {
  display: block;
  font-size: 13px;
  margin-bottom: 2px;
}

.quiz-feedback-text p {
  font-size: 12.5px;
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.4;
}

.quiz-jump-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-cosmic));
  border: none;
  border-radius: 8px;
  color: #050b14;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
  font-family: var(--font-bn);
}

.quiz-jump-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 16px rgba(56, 189, 248, 0.5);
}

.quiz-jump-arrow {
  font-family: var(--font-mono);
  font-size: 14px;
}

/* =========================================================================
   CATACLYSMIC GRAVITATIONAL COLLAPSE & BLACK HOLE TELEMETRY HUD
   ========================================================================= */

.collapse-hud-btn {
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(192, 132, 252, 0.4);
  color: #e9d5ff;
}

.collapse-hud-btn:hover {
  background: rgba(168, 85, 247, 0.28);
  border-color: #c084fc;
  box-shadow: 0 0 16px rgba(192, 132, 252, 0.45);
  color: #ffffff;
}

.collapse-hud-btn.active {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  color: #fecaca;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
  animation: pulseCollapseBtn 1.5s infinite ease-in-out;
}

@keyframes pulseCollapseBtn {
  0%, 100% {
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 24px rgba(239, 68, 68, 0.8);
    transform: scale(1.04);
  }
}


/* ================= BLACK HOLE CINEMATIC IMMERSION MODE ================= */
body.black-hole-mode .hud-top,
body.black-hole-mode .domain-indicator-wrapper,
body.black-hole-mode .info-panel,
body.black-hole-mode .object-card-container,
body.black-hole-mode .object-card-restore-pill,
body.black-hole-mode .planck-wall-banner,
body.black-hole-mode .force-dominance-panel,
body.black-hole-mode .force-restore-pill,
body.black-hole-mode .screen-ruler-widget,
body.black-hole-mode .hud-bottom,
body.black-hole-mode .spacetime-strain-container {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateY(28px) !important;
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.45s ease !important;
}

body.black-hole-mode .object-card-restore-pill,
body.black-hole-mode .force-restore-pill {
  display: none !important;
}

body.black-hole-mode .hud-top,
body.black-hole-mode .domain-indicator-wrapper {
  transform: translateY(-28px) !important;
}

body.black-hole-mode .object-card-container {
  transform: translateX(-40px) !important;
}

body.black-hole-mode .force-dominance-panel {
  transform: translateX(40px) !important;
}

/* ================= SPACETIME STRAIN GAUGE ================= */
.spacetime-strain-container {
  position: fixed;
  bottom: 130px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 85;
  pointer-events: none;
  display: flex;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.strain-card {
  background: rgba(15, 10, 30, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(244, 63, 94, 0.5);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(244, 63, 94, 0.35);
  border-radius: 16px;
  padding: 14px 22px;
  width: 450px;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: strainPulseBorder 1.5s infinite ease-in-out;
}

@keyframes strainPulseBorder {
  0%, 100% {
    border-color: rgba(244, 63, 94, 0.5);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(244, 63, 94, 0.3);
  }
  50% {
    border-color: rgba(192, 132, 252, 0.85);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 32px rgba(192, 132, 252, 0.55);
  }
}

.strain-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.strain-pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f43f5e;
  box-shadow: 0 0 10px #f43f5e;
  animation: pulseRedDot 0.8s infinite alternate ease-in-out;
}

@keyframes pulseRedDot {
  from { transform: scale(0.8); opacity: 0.6; }
  to { transform: scale(1.4); opacity: 1; }
}

.strain-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #fecdd3;
  letter-spacing: 0.5px;
  flex: 1;
  font-family: var(--font-bn);
}

.strain-percent {
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.strain-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.strain-fill {
  height: 100%;
  background: linear-gradient(90deg, #f43f5e, #c084fc, #38bdf8);
  box-shadow: 0 0 12px #c084fc;
  border-radius: 9999px;
  transition: width 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}

.strain-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  font-family: var(--font-bn);
  text-align: center;
}

/* ================= BLACK HOLE ACTIVE OVERLAY ================= */
.blackhole-active-overlay {
  position: fixed;
  bottom: 24px;
  right: 24px;
  left: auto;
  transform: translateY(30px);
  z-index: 95;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s ease;
  width: 440px;
  max-width: 92vw;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.blackhole-active-overlay.active {
  display: flex !important;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.blackhole-active-overlay.card-minimized .blackhole-telemetry-panel {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.blackhole-active-overlay.card-minimized .bh-restore-card-pill {
  display: inline-flex !important;
  opacity: 1;
  pointer-events: auto;
}

.blackhole-telemetry-panel {
  background: rgba(8, 5, 20, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(192, 132, 252, 0.4);
  border-radius: 18px;
  padding: 16px 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 35px rgba(168, 85, 247, 0.3), inset 0 0 20px rgba(168, 85, 247, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.bh-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.bh-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #f3e8ff;
  letter-spacing: 0.5px;
}

.pulsing-core.purple {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c084fc;
  box-shadow: 0 0 10px #c084fc;
  animation: pulsePurpleCore 1.6s infinite ease-in-out;
}

@keyframes pulsePurpleCore {
  0%, 100% {
    transform: scale(0.9);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.3);
    opacity: 1;
    box-shadow: 0 0 16px #e9d5ff;
  }
}

.bh-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.bh-overlay-toggle-btn,
.bh-mode-toggle-btn,
.bh-hide-card-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e2e8f0;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  font-family: var(--font-bn);
}

.bh-overlay-toggle-btn:hover,
.bh-mode-toggle-btn:hover {
  background: rgba(192, 132, 252, 0.2);
  border-color: #c084fc;
  color: #ffffff;
}

.bh-overlay-toggle-btn.active {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #bae6fd;
}

.bh-hide-card-btn:hover {
  background: rgba(147, 51, 234, 0.25);
  border-color: #c084fc;
  color: #ffffff;
}

.bh-evaporate-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(168, 85, 247, 0.4));
  border: 1px solid rgba(244, 63, 94, 0.55);
  border-radius: 8px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: var(--font-bn);
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.25);
}

.bh-evaporate-btn:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.45), rgba(168, 85, 247, 0.6));
  border-color: #f43f5e;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(244, 63, 94, 0.45);
}

/* Mass Presets Selector */
.bh-mass-selector {
  display: flex;
  gap: 6px;
  width: 100%;
}

.bh-mass-chip {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 5px 4px;
  color: rgba(233, 213, 255, 0.8);
  font-size: 10.5px;
  font-weight: 600;
  font-family: var(--font-bn);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.bh-mass-chip:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(192, 132, 252, 0.4);
  color: #ffffff;
}

.bh-mass-chip.active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.35), rgba(56, 189, 248, 0.25));
  border-color: #c084fc;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.3);
}

.bh-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 8px 12px;
}

.bh-stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bh-stat-lbl {
  font-size: 10.5px;
  color: rgba(216, 180, 254, 0.7);
  font-weight: 500;
}

.bh-stat-val {
  font-size: 11.5px;
  font-weight: 700;
  color: #ffffff;
  font-family: var(--font-bn);
  word-break: break-word;
}

.bh-notice {
  font-size: 11.5px;
  line-height: 1.45;
  color: rgba(233, 213, 255, 0.85);
  margin: 0;
  padding-left: 8px;
  border-left: 3px solid #c084fc;
  font-family: var(--font-bn);
}

.bh-disclaimer-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(147, 51, 234, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 6px;
  padding: 5px 8px;
  color: rgba(233, 213, 255, 0.9);
  font-size: 10.5px;
  font-family: var(--font-bn);
}

/* Floating Restore Card Pill Button */
.bh-restore-card-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 10, 32, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(192, 132, 252, 0.55);
  border-radius: 9999px;
  padding: 8px 18px;
  color: #f3e8ff;
  font-family: var(--font-bn);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), 0 0 25px rgba(168, 85, 247, 0.35);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.bh-restore-card-pill:hover {
  background: rgba(147, 51, 234, 0.35);
  border-color: #c084fc;
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.9), 0 0 35px rgba(168, 85, 247, 0.6);
}

/* Discreet Permanent Corner Watermark */
.canvas-corner-disclaimer {
  position: fixed;
  bottom: 6px;
  left: 20px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.28);
  font-family: var(--font-bn);
  pointer-events: none;
  z-index: 5;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 768px) {
  .blackhole-active-overlay {
    bottom: 84px;
    right: auto;
    left: 50%;
    transform: translateX(-50%) translateY(30px);
    width: 92vw;
    align-items: center;
  }
  .blackhole-active-overlay.active {
    transform: translateX(-50%) translateY(0);
  }
  .bh-stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .canvas-corner-disclaimer {
    bottom: 60px;
    left: 12px;
    font-size: 9.5px;
  }
}

/* Accessibility: Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .planck-wall-banner {
    animation: none !important;
  }
  .pulse-dot {
    animation: none !important;
  }
}


