:root {
  --bg: #0a0a12;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-border: rgba(255, 255, 255, 0.08);
  --text: #eef0f6;
  --text-dim: #9aa0b4;
  --accent: #8b5cf6;
  --accent-2: #06b6d4;
  --accent-grad: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
  --radius: 18px;
}

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

html { color-scheme: dark; }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(600px 400px at 20% -10%, rgba(139, 92, 246, 0.22), transparent 70%),
    radial-gradient(700px 500px at 90% 10%, rgba(6, 182, 212, 0.14), transparent 70%),
    radial-gradient(500px 500px at 50% 110%, rgba(139, 92, 246, 0.1), transparent 70%);
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Hero */
.hero { text-align: center; padding: 24px 0 8px; }

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--surface-border);
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 20px;
}

.title {
  font-size: clamp(2.6rem, 8vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.title .accent {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  margin-top: 14px;
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  color: var(--text-dim);
  max-width: 480px;
  margin-inline: auto;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 28px;
  backdrop-filter: blur(12px);
  animation: rise 0.4s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 22px;
}

.hidden { display: none !important; }

/* Dropzone */
.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 44px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.dropzone:hover, .dropzone:focus-visible {
  border-color: var(--accent);
  background: rgba(139, 92, 246, 0.06);
  outline: none;
}

.dropzone.dragover {
  border-color: var(--accent-2);
  background: rgba(6, 182, 212, 0.08);
  transform: scale(1.01);
}

.dropzone-icon {
  width: 44px;
  height: 44px;
  color: var(--accent);
  margin-bottom: 14px;
}

.dropzone-title { font-size: 1.05rem; font-weight: 600; }
.dropzone-hint { color: var(--text-dim); font-size: 0.9rem; margin-top: 4px; }
.dropzone-hint .link { color: var(--accent-2); font-weight: 500; }

/* File info */
.file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--surface-border);
}

.file-meta { display: flex; align-items: center; gap: 12px; min-width: 0; }
.file-icon { width: 26px; height: 26px; color: var(--accent-2); flex-shrink: 0; }
.file-name { font-weight: 600; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-detail { font-size: 0.8rem; color: var(--text-dim); }

.btn-ghost {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.btn-ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

/* Sliders */
.slider-row { margin-bottom: 22px; }

.slider-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.slider-label label { font-weight: 500; font-size: 0.92rem; }

.slider-value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--accent-2);
  background: rgba(6, 182, 212, 0.1);
  padding: 2px 10px;
  border-radius: 999px;
}

.slider-hint { font-size: 0.78rem; color: var(--text-dim); margin-top: 6px; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-grad);
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.5);
  transition: transform 0.15s;
}

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

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #8b5cf6;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.5);
  cursor: pointer;
}

/* Input preview */
.input-preview {
  width: 100%;
  max-height: 220px;
  margin-top: 14px;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  background: #000;
}

/* Format toggle */
.format-row { margin-bottom: 6px; }

.format-label {
  font-weight: 500;
  font-size: 0.92rem;
  margin-bottom: 8px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--surface-border);
}

.segment {
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-dim);
  background: none;
  border: none;
  border-radius: 9px;
  padding: 10px 12px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, box-shadow 0.15s;
}

.segment:hover:not(:disabled):not(.active) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.segment.active {
  color: #fff;
  background: var(--accent-grad);
  box-shadow: 0 2px 12px rgba(139, 92, 246, 0.4);
}

.segment:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Buttons */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 24px;
  margin-top: 8px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
  background: var(--accent-grad);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.35);
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 28px rgba(139, 92, 246, 0.5); }
.btn-primary:active { transform: none; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary svg { width: 20px; height: 20px; }

.btn-download { margin-top: 20px; }

/* Progress */
.progress { margin-top: 20px; }

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--accent-grad);
  transition: width 0.2s ease;
}

.progress-label {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: center;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 16px 10px;
  text-align: center;
}

.stat.highlight {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.35);
}

.stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.stat.highlight .stat-value {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Players */
.players {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.player-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.player audio { width: 100%; }

.player video {
  width: 100%;
  max-height: 260px;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  background: #000;
}

/* Footer */
.footer {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-dim);
  padding-top: 16px;
}

/* Responsive */
@media (max-width: 600px) {
  .container { padding-top: 32px; }
  .card { padding: 20px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .players { grid-template-columns: 1fr; }
}
