:root {
  --ink: #1a0f1c;
  --ink-deep: #120a15;
  --lilac: #c9a2f5;
  --lilac-soft: #e3cdfb;
  --pink: #f0b0d8;
  --rose-gold: #e9b6a4;
  --rose-gold-deep: #c98878;
  --text: #f3e8f7;
  --muted: #a48fae;
  --glass: rgba(255, 255, 255, 0.045);
  --glass-line: rgba(226, 200, 246, 0.14);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  padding: 0;
  color: var(--text);
  background: radial-gradient(120% 90% at 50% 0%, #2a1a2e 0%, var(--ink) 45%, var(--ink-deep) 100%);
  font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Soft aurora glow behind everything */
.aurora {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.blob {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
}

.blob-1 {
  width: 46vmax; height: 46vmax;
  top: -16vmax; left: -14vmax;
  background: radial-gradient(circle, #b07de0 0%, rgba(176, 125, 224, 0) 68%);
}

.blob-2 {
  width: 40vmax; height: 40vmax;
  bottom: -16vmax; right: -12vmax;
  background: radial-gradient(circle, #e9a9a0 0%, rgba(233, 169, 160, 0) 68%);
  opacity: 0.45;
}

.blob-3 {
  width: 34vmax; height: 34vmax;
  bottom: 10vmax; left: 8vmax;
  background: radial-gradient(circle, #d7a8e8 0%, rgba(215, 168, 232, 0) 70%);
  opacity: 0.3;
}

.stage {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 38px;
  padding: 48px 22px 60px;
}

.title {
  margin: 0;
  font-size: clamp(30px, 6vw, 58px);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  background: linear-gradient(100deg, var(--lilac-soft) 0%, var(--pink) 55%, var(--lilac) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 26px rgba(201, 162, 245, 0.4));
}

.panel {
  width: min(620px, 100%);
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: clamp(22px, 4vw, 38px);
  border-radius: 30px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
}

/* Link field */
.url {
  width: 100%;
  padding: 20px 26px;
  font: inherit;
  font-size: clamp(15px, 2.2vw, 18px);
  text-align: center;
  color: var(--text);
  background: rgba(18, 10, 21, 0.55);
  border: 1.5px solid rgba(201, 162, 245, 0.55);
  border-radius: 999px;
  outline: none;
  box-shadow: 0 0 22px rgba(176, 125, 224, 0.22), inset 0 0 18px rgba(176, 125, 224, 0.08);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.url::placeholder { color: var(--muted); }

.url:focus {
  border-color: var(--lilac);
  box-shadow: 0 0 34px rgba(201, 162, 245, 0.45), inset 0 0 20px rgba(176, 125, 224, 0.12);
}

/* MP4 / MP3 choice */
.formats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(14px, 3vw, 22px);
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: clamp(18px, 4vw, 30px) 10px;
  font: inherit;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(255, 255, 255, 0.09);
  border-radius: 26px;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.25s, border-color 0.25s, color 0.25s, background 0.25s;
}

.tile:hover { transform: translateY(-2px); border-color: rgba(201, 162, 245, 0.4); color: var(--lilac-soft); }

.tile-icon {
  width: clamp(26px, 5vw, 34px);
  height: clamp(26px, 5vw, 34px);
  fill: currentColor;
  margin-bottom: 2px;
}

.tile-name {
  font-size: clamp(20px, 4vw, 30px);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.tile-sub { font-size: clamp(12px, 2vw, 15px); opacity: 0.85; }

.tile.is-selected {
  color: #fff;
  background: linear-gradient(150deg, #a974e8 0%, #c99cf0 45%, #eeb2d4 100%);
  border-color: rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 34px rgba(201, 162, 245, 0.6), 0 0 70px rgba(201, 162, 245, 0.3);
  transform: translateY(-2px);
}

.tile.is-selected .tile-sub { opacity: 0.95; }

/* Buttons */
.convert, .download {
  display: block;
  width: 100%;
  padding: 18px 24px;
  font: inherit;
  font-size: clamp(16px, 2.4vw, 19px);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  color: #33161a;
  background: linear-gradient(100deg, var(--rose-gold-deep) 0%, #f0c3b2 50%, var(--rose-gold) 100%);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(201, 136, 120, 0.35);
  transition: transform 0.18s, box-shadow 0.25s, opacity 0.2s;
}

.convert:hover:not(:disabled), .download:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(233, 182, 164, 0.45);
}

.convert:disabled { opacity: 0.5; cursor: default; }

.download {
  color: #2b1533;
  background: linear-gradient(100deg, #c9a2f5 0%, #e0b7ef 50%, #f3c3d8 100%);
  box-shadow: 0 12px 34px rgba(201, 162, 245, 0.45);
}

/* Progress */
.progress { display: flex; flex-direction: column; gap: 10px; }

.track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(233, 182, 164, 0.35);
  overflow: hidden;
}

.bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--rose-gold-deep), #f6cebd);
  box-shadow: 0 0 16px rgba(233, 182, 164, 0.55);
  transition: width 0.35s ease;
}

.stage-text {
  margin: 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.error {
  margin: 0;
  text-align: center;
  font-size: 14.5px;
  color: #f4a8bd;
}

@media (max-width: 430px) {
  .stage { gap: 26px; padding: 34px 16px 44px; }
  .panel { gap: 18px; border-radius: 24px; }
  .url { padding: 16px 18px; }
}

[hidden] { display: none !important; }

.gate { gap: 18px; }
