/* Kinetic Vibes – Gemeinsames Design-System (100% Offline & DSGVO-konform) */

:root {
  --kv-bg: #0b1120;
  --kv-panel: #0f172a;
  --kv-panel-soft: rgba(15, 23, 42, 0.88);
  --kv-surface: #1e293b;
  --kv-border: rgba(51, 65, 85, 0.7);
  --kv-border-subtle: rgba(30, 41, 59, 0.9);
  --kv-text: #f1f5f9;
  --kv-text-muted: #94a3b8;
  --kv-text-dim: #64748b;
  --kv-accent: #38bdf8;
  --kv-accent-hover: #7dd3fc;
  --kv-accent-glow: rgba(56, 189, 248, 0.25);
  --kv-indigo: #818cf8;
  --kv-emerald: #34d399;
  --kv-amber: #fbbf24;
  --kv-rose: #fb7185;
  --kv-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --kv-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

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

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--kv-bg);
  color: var(--kv-text);
  font-family: var(--kv-font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(56, 189, 248, 0.3);
  color: #e0f2fe;
}

/* Dezente Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--kv-bg);
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Range-Slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: #1e293b;
  border: 1px solid rgba(56, 189, 248, 0.16);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  margin-top: -6px;
  height: 18px;
  width: 18px;
  border-radius: 50%;
  background: var(--kv-accent);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
  border: 2px solid var(--kv-panel);
  transition: transform 0.12s ease, background-color 0.12s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: var(--kv-accent-hover);
}

input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: #1e293b;
  border: 1px solid rgba(56, 189, 248, 0.16);
}

input[type="range"]::-moz-range-thumb {
  height: 18px;
  width: 18px;
  border-radius: 50%;
  background: var(--kv-accent);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
  border: 2px solid var(--kv-panel);
  transition: transform 0.12s ease, background-color 0.12s ease;
}

/* Select-Dropdown */
.kv-select {
  background-color: #1e293b;
  color: var(--kv-text);
  border: 1px solid var(--kv-border);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}
.kv-select:focus {
  border-color: var(--kv-accent);
}

/* Toggle Switch */
.kv-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid transparent;
  background: #334155;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.2s ease;
  padding: 0;
}
.kv-switch[aria-checked="true"] {
  background: #0ea5e9;
}
.kv-switch-knob {
  pointer-events: none;
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transform: translateX(0);
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.kv-switch[aria-checked="true"] .kv-switch-knob {
  transform: translateX(20px);
  background: #ffffff;
}

/* Clean-Mode (HUD & Sidebar für YouTube-Aufnahmen ausblenden) */
body.kv-clean-mode .kv-sidebar {
  display: none !important;
}
body.kv-clean-mode .kv-hud {
  opacity: 0 !important;
  pointer-events: none !important;
}
body.kv-clean-mode .kv-stage-main {
  height: 100vh !important;
  width: 100vw !important;
}

/* Dezenter Wiederherstellen-Button im Clean-Mode */
.kv-clean-restore {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 60;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s ease, background-color 0.15s ease;
}
body.kv-clean-mode .kv-clean-restore {
  display: inline-flex;
}
body.kv-clean-mode.kv-mouse-active .kv-clean-restore,
.kv-clean-restore:hover,
.kv-clean-restore:focus-visible {
  opacity: 1;
}

/* Aspect-Ratio Rahmen für 16:9 / 9:16 Video-Aufnahmen */
.kv-stage-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #060a14;
}

.kv-stage-frame {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--kv-bg);
  overflow: hidden;
}

.kv-stage-frame[data-aspect="16:9"] {
  width: min(100%, calc(100% * 16 / 9));
  aspect-ratio: 16 / 9;
  height: auto;
  max-height: 100%;
  border: 1px solid rgba(56, 189, 248, 0.22);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.65);
}

.kv-stage-frame[data-aspect="9:16"] {
  height: min(100%, calc(100% * 16 / 9));
  aspect-ratio: 9 / 16;
  width: auto;
  max-width: 100%;
  border: 1px solid rgba(56, 189, 248, 0.22);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.65);
}

body.kv-clean-mode .kv-stage-frame[data-aspect="16:9"],
body.kv-clean-mode .kv-stage-frame[data-aspect="9:16"] {
  border-color: rgba(56, 189, 248, 0.08);
}

.hidden {
  display: none !important;
}
