:root {
  color-scheme: dark;
  --bg: #09111f;
  --panel: rgba(14, 22, 38, 0.82);
  --panel-strong: rgba(18, 29, 50, 0.94);
  --stroke: rgba(255, 255, 255, 0.09);
  --text: #f4f7fb;
  --muted: #9bacc7;
  --accent: #7ce0c3;
  --accent-strong: #4fd0ff;
  --danger: #ff7b8a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: "Trebuchet MS", "Verdana", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(124, 224, 195, 0.22), transparent 38%),
    radial-gradient(circle at 85% 10%, rgba(79, 208, 255, 0.18), transparent 34%),
    linear-gradient(180deg, #06101d 0%, #0a1426 100%);
  color: var(--text);
  overflow-x: hidden;
}

.backdrop {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(45px);
  opacity: 0.24;
  pointer-events: none;
}

.backdrop-a {
  width: 320px;
  height: 320px;
  left: -90px;
  top: 120px;
  background: #4fd0ff;
}

.backdrop-b {
  width: 240px;
  height: 240px;
  right: -80px;
  bottom: 100px;
  background: #7ce0c3;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 36px;
  display: grid;
  gap: 20px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.hero {
  padding: 28px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 0.72rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 0.95;
}

.lede {
  max-width: 52ch;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 12px;
  width: min(360px, 100%);
}

.stats > div {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  padding: 18px 16px;
  text-align: center;
}

.stats span {
  display: block;
  font-size: 1.9rem;
  font-weight: 700;
}

.stats small {
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
  gap: 20px;
}

.uploader,
.library,
.player {
  padding: 22px;
}

.uploader h2,
.library h2,
.player h2 {
  margin-bottom: 12px;
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

input,
button,
a {
  font: inherit;
}

input[type="text"],
input[type="search"] {
  width: 100%;
  border: 1px solid var(--stroke);
  background: rgba(8, 15, 28, 0.8);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 15px;
  outline: none;
}

input[type="text"]:focus,
input[type="search"]:focus {
  border-color: rgba(124, 224, 195, 0.55);
  box-shadow: 0 0 0 3px rgba(124, 224, 195, 0.15);
}

.filebox {
  border: 1px dashed rgba(124, 224, 195, 0.4);
  border-radius: 18px;
  padding: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.filebox span {
  color: var(--muted);
}

.filebox input {
  padding: 0;
  border: 0;
  background: transparent;
}

button {
  border: 0;
  border-radius: 16px;
  padding: 14px 16px;
  color: #04111c;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  transform: translateY(-1px);
}

.hint,
.toolbar p,
.subtle {
  color: var(--muted);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.toolbar input {
  max-width: 320px;
}

.empty-state {
  padding: 24px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--stroke);
  color: var(--muted);
}

.track-list {
  display: grid;
  gap: 14px;
}

.track-card {
  border: 1px solid var(--stroke);
  background: var(--panel-strong);
  border-radius: 20px;
  padding: 16px;
  display: grid;
  gap: 14px;
  animation: fadeUp 0.35s ease both;
}

.track-main {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 0;
}

.track-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(124, 224, 195, 0.18), rgba(79, 208, 255, 0.18));
  color: var(--accent);
  font-size: 1.15rem;
}

.track-meta h3 {
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.track-meta p,
.track-meta small {
  display: block;
  color: var(--muted);
  margin: 0;
}

.track-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.download-link,
.delete-btn {
  padding: 10px 14px;
  border-radius: 14px;
  text-decoration: none;
  cursor: pointer;
}

.download-link {
  background: rgba(124, 224, 195, 0.12);
  color: var(--text);
  border: 1px solid rgba(124, 224, 195, 0.25);
}

.delete-btn {
  background: rgba(255, 123, 138, 0.12);
  color: #ffd1d6;
  border: 1px solid rgba(255, 123, 138, 0.25);
}

.player {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 18px;
  align-items: center;
}

#audioPlayer {
  width: 100%;
}

audio {
  filter: saturate(1.05);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .hero,
  .player,
  .layout,
  .toolbar {
    grid-template-columns: 1fr;
    display: grid;
  }

  .hero {
    align-items: start;
  }

  .stats {
    width: 100%;
  }

  .toolbar input {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 18px, 1180px);
    margin: 10px auto 24px;
  }

  .hero,
  .uploader,
  .library,
  .player {
    padding: 18px;
  }

  .track-actions {
    flex-direction: column;
  }

  .download-link,
  .delete-btn {
    width: 100%;
    text-align: center;
  }
}
