/* Design tokens lifted from linturomusic.com so the collection reads as the
   same site: purple→black→blue field, purple-400→pink-400 accent gradient,
   Inter for UI, Caveat for the linturo wordmark. */
:root {
  --purple-950: #3b0764;
  --purple-900: #581c87;
  --purple-600: #9333ea;
  --purple-500: #a855f7;
  --purple-400: #c084fc;
  --pink-600: #db2777;
  --pink-500: #ec4899;
  --pink-400: #f472b6;
  --blue-900: #1e3a8a;
  --blue-500: #3b82f6;

  --text: #ffffff;
  --muted: #9ca3af;
  --muted-2: #cbd5e1;

  --card: rgba(255, 255, 255, 0.1);
  --card-edge: rgba(192, 132, 252, 0.4);
  --card-edge-hover: rgba(192, 132, 252, 0.75);

  --accent-grad: linear-gradient(to right, var(--purple-400), var(--pink-400));
  --cta-grad: linear-gradient(to right, var(--purple-600), var(--pink-600));

  --amber: #f59e0b;
  --player-h: 88px;
}

* { box-sizing: border-box; }

/* Several components set an explicit display, which would otherwise beat the
   UA rule for the `hidden` attribute we toggle them with. */
[hidden] { display: none !important; }

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: linear-gradient(to bottom right, var(--purple-900), #000000, var(--blue-900));
  background-attachment: fixed;
  padding-bottom: calc(var(--player-h) + 32px);
}

.wrap { width: min(1180px, 92vw); margin: 0 auto; }

.glow {
  position: fixed;
  inset: -25% -10% auto -10%;
  height: 65vh;
  background:
    radial-gradient(55% 60% at 18% 18%, rgba(168, 85, 247, 0.28), transparent 70%),
    radial-gradient(45% 50% at 82% 8%, rgba(236, 72, 153, 0.18), transparent 70%);
  filter: blur(64px);
  pointer-events: none;
  z-index: 0;
}

/* ---------- hero ---------- */
.hero { position: relative; z-index: 1; padding: 76px 0 40px; }
.hero .wrap { position: relative; }

.homeBtn {
  position: absolute;
  top: -34px;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid rgba(192, 132, 252, 0.5);
  backdrop-filter: blur(4px);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}
.homeBtn:hover {
  background: var(--cta-grad);
  border-color: transparent;
  transform: translateY(-1px);
}
.homeBtn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 10px;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* the signature mark: Caveat, gradient-filled */
.wordmark {
  margin: 0;
  font-family: Caveat, Inter, cursive;
  font-size: clamp(64px, 11vw, 122px);
  font-weight: 700;
  line-height: 0.95;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  margin: 10px 0 34px;
  color: var(--muted-2);
  font-size: clamp(14px, 1.6vw, 17px);
  max-width: 48ch;
  line-height: 1.6;
}

.stats { display: flex; flex-wrap: wrap; gap: 14px; margin: 0; }
.stats > div {
  flex: 1 1 128px;
  background: var(--card);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 12px;
  padding: 14px 16px;
  backdrop-filter: blur(4px);
}
.stats dt {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.stats dd {
  margin: 6px 0 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* ---------- toolbar ---------- */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 4, 20, 0.72);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid rgba(168, 85, 247, 0.28);
  margin-bottom: 26px;
}
.toolbar-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  flex-wrap: wrap;
}

.search { position: relative; flex: 1 1 250px; min-width: 210px; }
.search svg {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round;
}
.search input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
  backdrop-filter: blur(4px);
}
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: var(--purple-400); }

.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid rgba(168, 85, 247, 0.35);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted-2);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.14s ease;
}
.chip:hover { color: #fff; border-color: var(--purple-400); }
.chip[aria-pressed="true"] {
  background: var(--cta-grad);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
}

.sort { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.sort select {
  background: rgba(30, 10, 50, 0.9);
  border: 1px solid var(--card-edge);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 11px;
  font: inherit;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.count { color: var(--muted); font-size: 12.5px; margin-bottom: 14px; }

/* ---------- list ---------- */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.row {
  display: grid;
  grid-template-columns: 56px minmax(190px, 1.15fr) minmax(200px, 2fr) auto;
  align-items: center;
  gap: 18px;
  padding: 14px 18px 14px 14px;
  background: var(--card);
  border: 1px solid rgba(168, 85, 247, 0.28);
  border-radius: 12px;
  backdrop-filter: blur(4px);
  transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease;
}
.row:hover { border-color: var(--card-edge-hover); transform: translateY(-1px); }
.row.active {
  border-color: var(--purple-400);
  background: linear-gradient(to right, rgba(147, 51, 234, 0.18), rgba(219, 39, 119, 0.12));
}

.rowPlay {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--cta-grad);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
  box-shadow: 0 4px 18px rgba(147, 51, 234, 0.42);
}
.rowPlay:hover { transform: scale(1.07); box-shadow: 0 6px 24px rgba(219, 39, 119, 0.5); }
.rowPlay svg { width: 17px; height: 17px; fill: currentColor; }
.rowPlay .i-pause { display: none; }
.row.playing .rowPlay .i-play { display: none; }
.row.playing .rowPlay .i-pause { display: block; }

.meta { min-width: 0; }
.title {
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-bottom: 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tags { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.tag {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.22);
  border: 1px solid rgba(192, 132, 252, 0.35);
  color: #e9d5ff;
  font-weight: 600;
  white-space: nowrap;
}
.tag.plain {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}
.tag.guess { opacity: 0.6; }

.wavewrap { position: relative; height: 46px; cursor: pointer; }
.wavewrap canvas { width: 100%; height: 100%; display: block; }

.dur {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
  white-space: nowrap;
}

.empty { color: var(--muted); text-align: center; padding: 50px 0; }

.foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12.5px;
  padding: 48px 0 8px;
  border-top: 1px solid rgba(168, 85, 247, 0.25);
  margin-top: 46px;
}
.foot a {
  text-decoration: none;
  font-weight: 600;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- crate mode (hidden curator) ---------- */
.del { display: none; }
body.crate .row { grid-template-columns: 56px minmax(190px, 1.15fr) minmax(200px, 2fr) auto 34px; }
body.crate .del {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
body.crate .del:hover { background: var(--amber); color: #201400; }
.row.removed { opacity: 0.4; border-style: dashed; }
.row.removed .title { text-decoration: line-through; }

/* Lives inside the sticky toolbar so the two never fight over stacking
   offsets when the toolbar wraps to a second row on narrow screens. */
.cratebar {
  background: rgba(60, 40, 0, 0.9);
  border-top: 1px solid rgba(245, 158, 11, 0.4);
}
.cratebar-inner { display: flex; align-items: center; gap: 12px; padding: 10px 0; flex-wrap: wrap; }
.crate-badge {
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  font-weight: 800; color: #201400; background: var(--amber);
  padding: 4px 9px; border-radius: 999px;
}
.crate-note { font-size: 12.5px; color: #fde68a; }
.crate-actions { margin-left: auto; display: flex; gap: 7px; }
.crate-actions button {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fde68a;
  border-radius: 8px; padding: 7px 12px;
  font: inherit; font-size: 12.5px; cursor: pointer;
}
.crate-actions button:hover { background: var(--amber); color: #201400; }

.toast {
  position: fixed;
  left: 50%; bottom: calc(var(--player-h) + 20px);
  transform: translateX(-50%);
  z-index: 60;
  display: flex; align-items: center; gap: 12px;
  background: rgba(20, 8, 36, 0.96);
  border: 1px solid var(--card-edge);
  color: #fff;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 13px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
}
.toast button {
  background: var(--cta-grad); border: none; color: #fff;
  border-radius: 6px; padding: 5px 11px; font: inherit; font-size: 12px;
  font-weight: 600; cursor: pointer;
}

/* ---------- player ---------- */
.player {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: var(--player-h);
  z-index: 40;
  background: rgba(14, 6, 28, 0.94);
  backdrop-filter: saturate(150%) blur(18px);
  border-top: 1px solid rgba(168, 85, 247, 0.45);
}
.player-inner {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto minmax(220px, 2.4fr) auto;
  align-items: center;
  gap: 20px;
}

.np { display: flex; align-items: center; gap: 12px; min-width: 0; }
.np-art {
  width: 46px; height: 46px;
  border-radius: 9px;
  flex: none;
  background: var(--cta-grad);
}
.np-meta { min-width: 0; }
.np-title { font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.transport { display: flex; align-items: center; gap: 8px; }
.icon {
  background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 6px;
  display: grid; place-items: center;
}
.icon:hover { color: #fff; }
.icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
#btnPrev svg, #btnNext svg { fill: currentColor; stroke: currentColor; }

.play {
  width: 42px; height: 42px; border-radius: 50%;
  border: none; cursor: pointer;
  background: var(--cta-grad); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 4px 16px rgba(147, 51, 234, 0.45);
}
.play:hover { transform: scale(1.05); }
.play svg { width: 16px; height: 16px; fill: currentColor; }
.play .i-pause { display: none; }
.player.playing .play .i-play { display: none; }
.player.playing .play .i-pause { display: block; }

.scrub { display: flex; align-items: center; gap: 12px; min-width: 0; }
.t { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.bigwave { flex: 1; height: 42px; min-width: 0; display: block; cursor: pointer; }

.vol { display: flex; align-items: center; gap: 8px; }
.vol input {
  width: 92px; height: 4px;
  -webkit-appearance: none; appearance: none;
  background: rgba(255,255,255,0.18); border-radius: 999px; outline: none; cursor: pointer;
}
.vol input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--purple-400); cursor: pointer;
}

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .row, body.crate .row { grid-template-columns: 46px 1fr auto; gap: 12px; }
  .wavewrap { display: none; }
  body.crate .del { position: absolute; right: 10px; top: 10px; }
  .row { position: relative; }
  .player-inner { grid-template-columns: 1fr auto; gap: 12px; }
  .scrub, .vol { display: none; }
}
@media (max-width: 560px) {
  .hero { padding: 44px 0 28px; }
  .homeBtn { top: -26px; padding: 8px; }
  .homeBtn span { display: none; }
  .stats > div { flex-basis: calc(50% - 7px); }
  .sort { display: none; }
  .crate-actions { margin-left: 0; }
}
