/* ==========================================================================
   ARGON // Interaktive 3D-Partikel-Galaxie — Stylesheet
   Reines CSS mit modernem Dark-Space-Glassmorphism, ohne Frameworks.
   Explizite GPU-Compositing-Layer (z-index: 100 + translateZ(0)) und
   dynamische Viewport-Variablen (--vw, --vh) für perfekte Zentrierung
   und garantierte Sichtbarkeit in allen Desktop- & IDE-Webviews.
   ========================================================================== */

:root {
  --vw: 100vw;
  --vh: 100vh;
  --bg-deep: #03040a;
  --glass-bg: rgba(12, 16, 32, 0.88);
  --glass-border: rgba(120, 180, 255, 0.45);
  --glass-highlight: rgba(255, 255, 255, 0.12);
  --text-primary: #f3f6ff;
  --text-secondary: #b0c0e0;
  --text-muted: #7b8db2;
  --accent-primary: #7c5cff;
  --accent-secondary: #00e5ff;
  --accent-glow: rgba(124, 92, 255, 0.45);
  --status-ok: #00f5a0;
  --status-warn: #ffb830;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

/* Vollbild-WebGL-Canvas exakt auf den sichtbaren Viewport zentriert */
#galaxy-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--vw, 100vw);
  height: var(--vh, 100vh);
  display: block;
  z-index: 1;
  cursor: grab;
  touch-action: none;
}

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

/* ==========================================================================
   Brand-Header oben links
   ========================================================================== */
.brand-header {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 100;
  transform: translateZ(0);
  will-change: transform, opacity;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(8, 12, 26, 0.72);
  border: 1px solid rgba(120, 180, 255, 0.25);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.brand-badge {
  display: inline-flex;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--accent-secondary);
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.35);
  padding: 3px 8px;
  border-radius: 999px;
  margin-bottom: 2px;
}

.brand-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #ffffff;
  text-shadow: 0 0 28px rgba(124, 92, 255, 0.55);
}

.brand-thin {
  font-weight: 300;
  color: #b8c7ea;
}

.catalog-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

.seed-code {
  color: #c8b6ff;
}

.meta-sep {
  color: var(--text-muted);
}

/* ==========================================================================
   Zentrales Status-Toast (für Pause, Reset & Zufalls-Galaxie)
   ========================================================================== */
.status-toast {
  position: fixed;
  top: 20px;
  left: calc(var(--vw, 100vw) * 0.5);
  transform: translate3d(-50%, -8px, 0);
  z-index: 110;
  will-change: transform, opacity;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(12, 16, 32, 0.92);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(120, 180, 255, 0.45);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), 0 0 20px rgba(124, 92, 255, 0.25);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.status-toast.visible {
  opacity: 1;
  transform: translate3d(-50%, 0, 0);
}

.status-toast.paused-banner {
  opacity: 1;
  transform: translate3d(-50%, 0, 0);
  border-color: rgba(255, 184, 48, 0.7);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 24px rgba(255, 184, 48, 0.3);
  color: #ffe299;
}

.toast-icon {
  color: var(--accent-secondary);
  font-size: 13px;
}

/* ==========================================================================
   Dezenter "Menü einblenden"-Button oben rechts (sichtbar wenn Menü ausgeblendet)
   ========================================================================== */
.floating-menu-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 105;
  transform: translateZ(0);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(12, 16, 32, 0.85);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(120, 180, 255, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease, border-color 0.2s ease;
}

.floating-menu-toggle kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-secondary);
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 4px;
  padding: 1px 5px;
}

.floating-menu-toggle:hover {
  border-color: var(--accent-secondary);
  box-shadow: 0 8px 28px rgba(0, 229, 255, 0.25);
}

body.ui-hidden .floating-menu-toggle {
  opacity: 1;
  pointer-events: auto;
}

body.ui-hidden .control-panel {
  opacity: 0;
  pointer-events: none;
  transform: translate3d(24px, 0, 0);
}

/* ==========================================================================
   UI-Panel oben rechts (Glassmorphism + solider Compositing-Layer)
   ========================================================================== */
.control-panel {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 328px;
  max-height: calc(var(--vh, 100vh) - 40px);
  overflow-y: auto;
  z-index: 100;
  transform: translateZ(0);
  will-change: transform, opacity;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(165%);
  -webkit-backdrop-filter: blur(18px) saturate(165%);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.72),
    0 0 24px rgba(0, 229, 255, 0.12),
    inset 0 1px 0 var(--glass-highlight);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(145, 175, 255, 0.22);
}

.panel-header-Right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(145, 175, 255, 0.28);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--accent-secondary);
}

.panel-eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

.state-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 999px;
  transition: all 0.2s ease;
}

.state-running {
  color: var(--status-ok);
  background: rgba(0, 245, 160, 0.14);
  border: 1px solid rgba(0, 245, 160, 0.45);
  box-shadow: 0 0 12px rgba(0, 245, 160, 0.22);
}

.state-paused {
  color: var(--status-warn);
  background: rgba(255, 184, 48, 0.18);
  border: 1px solid rgba(255, 184, 48, 0.55);
  box-shadow: 0 0 12px rgba(255, 184, 48, 0.28);
}

/* Slider-Zeilen */
.sliders-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.control-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.control-label-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.control-label-line label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.control-value {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-secondary);
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.3);
  padding: 2px 8px;
  border-radius: 6px;
}

/* Custom Range Slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(124, 92, 255, 0.78), rgba(0, 229, 255, 0.78));
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--accent-secondary);
  box-shadow: 0 0 12px var(--accent-glow), 0 2px 6px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.14);
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.85), 0 2px 8px rgba(0, 0, 0, 0.65);
}

input[type="range"]:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--accent-secondary);
  outline-offset: 2px;
}

.range-ticks {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  padding: 0 2px;
}

/* Farbschema-Swatches */
.palette-preview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 2px;
}

.swatch {
  height: 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

/* Schnell-Aktionsbuttons (Neu starten & Menü weg) */
.panel-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 4px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.35);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-btn:hover {
  background: rgba(0, 229, 255, 0.22);
  border-color: var(--accent-secondary);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.25);
}

.action-btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(145, 175, 255, 0.28);
}

.action-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(145, 175, 255, 0.55);
  box-shadow: none;
}

.action-btn kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-secondary);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  padding: 1px 5px;
}

/* Shortcuts-Übersicht */
.shortcuts-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(145, 175, 255, 0.22);
}

.shortcut-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: var(--text-secondary);
}

.shortcut-item kbd {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: #e4eeff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 5px;
  padding: 2px 6px;
}

/* ==========================================================================
   FPS- & Telemetrie-HUD unten links
   ========================================================================== */
.hud-panel {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 100;
  transform: translateZ(0);
  will-change: transform;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 13px 18px;
  border-radius: 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(165%);
  -webkit-backdrop-filter: blur(18px) saturate(165%);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.7),
    0 0 20px rgba(0, 229, 255, 0.1),
    inset 0 1px 0 var(--glass-highlight);
}

.hud-fps-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 118px;
}

.fps-indicator {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.fps-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  align-self: center;
}

.fps-good {
  background: var(--status-ok);
  box-shadow: 0 0 10px var(--status-ok);
}

.fps-warn {
  background: var(--status-warn);
  box-shadow: 0 0 10px var(--status-warn);
}

.fps-number {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
}

.fps-unit {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
}

.fps-submetrics {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 6px;
}

.hud-divider {
  width: 1px;
  height: 38px;
  background: rgba(145, 175, 255, 0.25);
}

.hud-telemetry {
  display: flex;
  align-items: center;
  gap: 16px;
}

.telemetry-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.telemetry-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.telemetry-val {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.status-active-text {
  color: var(--status-ok);
}

.status-paused-text {
  color: var(--status-warn);
}

@media (max-width: 760px) {
  .control-panel {
    width: 280px;
    padding: 14px 16px;
  }
  .hud-panel {
    padding: 10px 14px;
    gap: 12px;
  }
}
