:root {
  --bg: #0d0f17;
  --bg2: #0a0c12;
  --panel: #161926;
  --panel-hi: #20243492;
  --line: #262a3c;
  --text: #e8e8f0;
  --muted: #7a7e92;
  --accent: #5ec8c5;
  --accent-hi: #4ab3b0;
  --hot: #e96b8a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: radial-gradient(120% 80% at 50% -10%, #161a2b 0%, var(--bg) 46%, var(--bg2) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 28px 16px 48px;
}

.app {
  width: 100%;
  max-width: 720px;
}

/* ── Header ─────────────────────────────────────────────── */
.head { text-align: center; margin-bottom: 22px; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand .logo-img {
  display: block; width: 38px; height: 38px;
  border-radius: 50%;
  /* The icon has a tonearm, so it shouldn't spin — give it a gentle glow pulse. */
  animation: logoGlow 3.6s ease-in-out infinite;
}
@keyframes logoGlow {
  0%, 100% { filter: drop-shadow(0 0 7px rgba(94, 200, 197, 0.35)); }
  50%      { filter: drop-shadow(0 0 15px rgba(94, 200, 197, 0.6)); }
}
.brand h1 {
  font-size: 30px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.6px;
  background: linear-gradient(95deg, #6ee0dc 0%, #c7f1ec 38%, var(--hot) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 1px 12px rgba(94, 200, 197, 0.28));
}
.brand h1 .tld {
  -webkit-text-fill-color: var(--muted);
  color: var(--muted);
  font-weight: 700;
}
@media (prefers-reduced-motion: reduce) {
  .brand .logo-img { animation: none; filter: drop-shadow(0 0 9px rgba(94, 200, 197, 0.45)); }
}
.tagline {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
  max-width: 560px;
  margin: 12px auto 0;
}
.tagline em { color: var(--accent); font-style: normal; font-weight: 600; }

/* ── Drop zone ──────────────────────────────────────────── */
.drop {
  border: 2px dashed var(--line);
  border-radius: 16px;
  background: var(--panel);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .05s;
}
.drop:hover, .drop:focus-visible {
  border-color: var(--accent);
  background: #1b1f30;
  outline: none;
}
.drop.drag { border-color: var(--accent); background: #1b1f30; transform: scale(1.01); }
.drop-icon { font-size: 40px; color: var(--accent); line-height: 1; margin-bottom: 12px; }
.drop-title { font-size: 17px; font-weight: 600; margin: 0 0 6px; }
.drop-sub { font-size: 13px; color: var(--muted); margin: 0; }
.drop-loading { display: none; flex-direction: column; align-items: center; gap: 14px; }
.drop.loading { cursor: default; border-style: solid; border-color: var(--accent); }
.drop.loading .drop-inner { display: none; }
.drop.loading .drop-loading { display: flex; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid #20243a;
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Player shell ───────────────────────────────────────── */
.player {
  background: linear-gradient(180deg, #14172447, #0e101a86);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255,255,255,0.03);
}
.player.just-loaded { animation: pulseGlow 0.9s ease-out; }
@keyframes pulseGlow {
  0%   { box-shadow: 0 0 0 0 rgba(94, 200, 197, 0); }
  18%  { box-shadow: 0 0 0 4px rgba(94, 200, 197, 0.45); }
  100% { box-shadow: 0 0 0 0 rgba(94, 200, 197, 0); }
}

/* ── Top bar ────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.track { min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.track-name {
  font-size: 15px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.change-link {
  flex: none;
  background: none; border: none; color: var(--muted);
  font-size: 12px; cursor: pointer; padding: 0; text-decoration: underline;
  text-underline-offset: 2px;
}
.change-link:hover { color: var(--accent); }

.pitch-pill {
  flex: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: rgba(94, 200, 197, 0.08);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 14px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-shadow: 0 0 18px rgba(94, 200, 197, 0.16), inset 0 0 12px rgba(94, 200, 197, 0.06);
}
.pitch-pill.kept { border-color: var(--hot); color: var(--hot); box-shadow: 0 0 18px rgba(233, 107, 138, 0.18); }

/* ── Waveform (hero) ────────────────────────────────────── */
.wave-wrap {
  border-radius: 12px;
  background: linear-gradient(180deg, #0c0e16, #0a0c12);
  border: 1px solid #ffffff0d;
  padding: 4px;
  box-shadow: inset 0 1px 12px rgba(0,0,0,0.5);
}
.wave { width: 100%; display: block; touch-action: none; }
.wave-zoom { height: 150px; cursor: ew-resize; }
.wave-over {
  height: 52px;
  cursor: pointer;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #ffffff0e;
}

/* ── Spectrum ───────────────────────────────────────────── */
.spectrum {
  width: 100%;
  height: 110px;
  display: block;
  margin-top: 8px;
  border-radius: 10px;
  background: radial-gradient(120% 140% at 20% 0%, rgba(94, 200, 197, 0.05), transparent 60%), #0b0d15;
  border: 1px solid #ffffff0a;
}

/* ── Seek + clock ───────────────────────────────────────── */
.seekrow { display: flex; align-items: center; gap: 14px; margin: 12px 0 4px; }
.seek { flex: 1; }
.clock {
  flex: none;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  column-gap: 6px;
  align-items: center;
  background: none; border: none; cursor: pointer;
  padding: 2px 4px; border-radius: 8px; text-align: right;
}
.clock:hover { background: #ffffff08; }
.clock-main { grid-column: 1; grid-row: 1; color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.clock-sub  { grid-column: 1; grid-row: 2; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.clock-caret { grid-column: 2; grid-row: 1 / span 2; color: var(--muted); font-size: 13px; }

/* ── Transport ──────────────────────────────────────────── */
.transport {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0 4px;
  min-width: 0;
}
.transport-btns { display: flex; gap: 8px; flex: none; }
.btn-play, .btn-stop {
  appearance: none; border: none; cursor: pointer;
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: filter .12s, transform .04s, box-shadow .12s;
}
.btn-play:active, .btn-stop:active { transform: translateY(1px); }
.btn-play {
  gap: 6px; padding: 0 16px; height: 46px;
  font-size: 15px; color: #08201f;
  background: linear-gradient(135deg, var(--accent), #7ad6c3);
  box-shadow: 0 6px 20px rgba(94, 200, 197, 0.28), inset 0 1px 0 rgba(255,255,255,0.35);
}
.btn-play:hover { filter: brightness(1.06); }
.btn-play .ic-play, .btn-play .ic-pause { opacity: .42; transition: opacity .1s; }
.btn-play:not(.playing) .ic-play { opacity: 1; }
.btn-play.playing .ic-pause { opacity: 1; }
.btn-stop {
  width: 46px; height: 46px; font-size: 13px; color: #fff;
  background: linear-gradient(135deg, #c4566f, #7e2f44);
  box-shadow: 0 6px 18px rgba(196, 86, 111, 0.25), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-stop:hover { filter: brightness(1.08); }

/* speed */
.speedblock { flex: 1 1 0; min-width: 0; }
.speed { width: 100%; min-width: 0; display: block; }
.speedhead { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.speedhead .lbl { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .6px; }
.speed-val { color: var(--accent); font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ticks { position: relative; height: 16px; margin-top: 6px; }
.tick {
  position: absolute; top: 0; transform: translateX(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums;
  padding: 0; white-space: nowrap;
}
.tick:hover { color: var(--text); }
.tick.active { color: var(--accent); font-weight: 700; text-shadow: 0 0 10px rgba(94,200,197,.6); }

/* volume */
.vol { display: flex; align-items: center; gap: 8px; flex: none; width: 116px; }
.vol-ico { font-size: 14px; opacity: .7; flex: none; }
.vol-slider { flex: 1 1 0; min-width: 0; }

/* ── Buttons (generic) ──────────────────────────────────── */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--panel-hi);
  color: var(--text); font-size: 14px; font-weight: 600;
  padding: 10px 16px; border-radius: 10px; cursor: pointer;
  transition: background .12s, border-color .12s, opacity .12s, transform .04s;
}
.btn:hover { background: #2e3346; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }

/* ── Advanced / DJ Controls ─────────────────────────────── */
.adv {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #12141f, #0e1018);
}
.adv-head {
  list-style: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; cursor: pointer;
  color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .6px;
  text-transform: uppercase;
}
.adv-head::-webkit-details-marker { display: none; }
.adv-caret { transition: transform .2s; font-size: 14px; }
.adv[open] .adv-caret { transform: rotate(180deg); }
.adv-body {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 6px 16px 18px;
  flex-wrap: wrap;
}

/* EQ */
.eq { flex: 1; min-width: 280px; }
.eq-presets { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.eq-preset {
  appearance: none; border: 1px solid var(--line); background: #181b29;
  color: var(--muted); font-size: 11px; font-weight: 600;
  padding: 5px 11px; border-radius: 999px; cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.eq-preset:hover { color: var(--text); }
.eq-preset.active {
  color: var(--accent); border-color: var(--accent);
  background: rgba(94,200,197,0.1); box-shadow: 0 0 14px rgba(94,200,197,0.25);
}
.eq-faders { display: flex; justify-content: space-between; gap: 4px; }
.fader-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; }
.fader-lbl { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }

/* vertical fader */
.fader {
  -webkit-appearance: slider-vertical;
  appearance: slider-vertical;
  writing-mode: vertical-lr;
  direction: rtl;
  width: 22px;
  height: 104px;
  padding: 0;
  background: transparent;
  background-image: none;
  cursor: pointer;
}
.fader::-webkit-slider-runnable-track {
  width: 5px; height: 104px; border-radius: 4px;
  background: linear-gradient(180deg, var(--hot), var(--accent));
  opacity: .85;
}
.fader::-moz-range-track {
  width: 5px; height: 104px; border-radius: 4px;
  background: linear-gradient(180deg, var(--hot), var(--accent));
  opacity: .85;
}
.fader::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 11px; border-radius: 3px;
  background: linear-gradient(180deg, #f4f6fb, #c3c9d8);
  border: 1px solid #00000040;
  box-shadow: 0 2px 5px rgba(0,0,0,.5);
  margin-left: -8px;
}
.fader::-moz-range-thumb {
  width: 20px; height: 11px; border-radius: 3px;
  background: linear-gradient(180deg, #f4f6fb, #c3c9d8);
  border: 1px solid #00000040;
  box-shadow: 0 2px 5px rgba(0,0,0,.5);
}

/* knobs */
.knobs { display: flex; gap: 20px; flex: none; }
.knob-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.knob {
  --p: 0;
  position: relative;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #20243a, #11131d 72%);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.65), 0 3px 8px rgba(0,0,0,.45);
  cursor: ns-resize;
  touch-action: none;
  transition: box-shadow .15s;
}
.knob:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.knob::before {
  content: "";
  position: absolute; inset: -6px;
  border-radius: 50%;
  background: conic-gradient(from 225deg,
    var(--accent) 0deg,
    var(--hot) calc(var(--p) * 2.7deg),
    #22263a calc(var(--p) * 2.7deg) 270deg,
    transparent 270deg 360deg);
  -webkit-mask: radial-gradient(circle, transparent 55%, #000 56%);
          mask: radial-gradient(circle, transparent 55%, #000 56%);
  opacity: .9;
}
.knob.lit { box-shadow: inset 0 2px 6px rgba(0,0,0,.65), 0 0 22px rgba(94,200,197,.35); }
.knob-ind {
  position: absolute; left: 50%; top: 7px;
  width: 3px; height: 14px; margin-left: -1.5px;
  background: #e8e8f0; border-radius: 2px;
  transform-origin: 50% 23px;
  transform: rotate(calc(-135deg + var(--p) * 2.7deg));
  box-shadow: 0 0 6px rgba(255,255,255,.4);
}
.knob-lbl { color: var(--muted); font-size: 11px; font-weight: 600; }

/* toggles */
.toggles { display: flex; flex-direction: column; gap: 14px; flex: none; }
.toggle { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; color: var(--text); user-select: none; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .sw {
  position: relative; width: 42px; height: 24px; border-radius: 999px;
  background: #20243a; border: 1px solid var(--line);
  transition: background .15s;
}
.toggle .sw::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #c3c9d8; transition: transform .15s, background .15s;
}
.toggle input:checked + .sw { background: linear-gradient(90deg, var(--accent), var(--hot)); border-color: transparent; }
.toggle input:checked + .sw::after { transform: translateX(18px); background: #fff; }
.toggle input:focus-visible + .sw { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Export ─────────────────────────────────────────────── */
.exportrow { display: flex; justify-content: center; margin-top: 18px; }
.btn-export {
  appearance: none; cursor: pointer;
  min-width: 280px; padding: 14px 28px; font-size: 15px; font-weight: 600;
  border-radius: 12px;
  background: linear-gradient(180deg, #eef1f7, #aeb6c6);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #1a1d29;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 6px 20px rgba(0, 0, 0, 0.4);
  transition: filter .12s, transform .04s;
}
.btn-export:hover { filter: brightness(1.04); }
.btn-export:active { transform: translateY(1px); }
.btn-export:disabled { filter: grayscale(0.4) brightness(0.85); cursor: default; }

.status {
  min-height: 18px; margin: 12px 0 0;
  font-size: 13px; color: var(--muted); text-align: center;
}
.status.err { color: var(--hot); }

/* ── Range inputs (shared: seek, speed, volume) ─────────── */
input[type="range"]:not(.fader) {
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 6px;
  background-color: #20243a;
  background-image: linear-gradient(90deg, var(--accent), var(--hot));
  background-size: var(--pct, 0%) 100%;
  background-repeat: no-repeat;
  cursor: pointer;
}
input[type="range"]:not(.fader)::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: #f4f6fb; border: none;
  box-shadow: 0 0 0 4px rgba(94, 200, 197, 0.25), 0 2px 6px rgba(0, 0, 0, 0.45);
}
input[type="range"]:not(.fader)::-moz-range-thumb {
  width: 18px; height: 18px; border: none; border-radius: 50%;
  background: #f4f6fb;
  box-shadow: 0 0 0 4px rgba(94, 200, 197, 0.25), 0 2px 6px rgba(0, 0, 0, 0.45);
}
input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* ── Privacy + shortcuts ────────────────────────────────── */
.privacy { text-align: center; color: var(--muted); font-size: 13px; margin: 18px 0 6px; }
.keys { text-align: center; color: var(--muted); font-size: 12px; margin: 0 0 8px; }
kbd {
  background: #20243a; border: 1px solid var(--line); border-radius: 5px;
  padding: 1px 6px; font-size: 11px; font-family: inherit;
}

/* ── SEO content ────────────────────────────────────────── */
.content {
  margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line);
  color: #c5c8d6; line-height: 1.65; font-size: 15px;
}
.content h2 { color: var(--text); font-size: 19px; margin: 30px 0 10px; }
.content h2:first-child { margin-top: 0; }
.content h3 { color: var(--text); font-size: 15.5px; margin: 18px 0 4px; }
.content p { margin: 0 0 12px; }
.content ol, .content ul { margin: 0 0 12px; padding-left: 22px; }
.content li { margin: 0 0 8px; }
.content strong { color: var(--text); }
.uses { list-style: none; padding-left: 0; }
.uses li {
  padding: 10px 14px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; margin-bottom: 8px; font-size: 14px;
}
.faq h3 { color: var(--accent); }

/* ── Footer ─────────────────────────────────────────────── */
.foot {
  text-align: center; margin-top: 36px; padding-top: 20px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 560px) {
  .transport { flex-wrap: wrap; }
  .speedblock { order: 3; flex-basis: 100%; }
  .vol { margin-left: auto; }
  .adv-body { flex-direction: column; }
  .eq, .knobs, .toggles { width: 100%; }
  .knobs { justify-content: center; }
  .toggles { flex-direction: row; justify-content: center; }
  .btn-export { min-width: 0; width: 100%; }
}
