:root {
  --bg: #fff8f1;
  --surface: #ffffff;
  --surface-2: #fdf0e6;
  --text: #2b2140;
  --muted: #7c7190;
  --line: #f1e4d8;
  --accent: #ff5a5f;
  --accent-2: #ff3d8b;
  --accent-3: #7b5cff;
  --accent-text: #ffffff;
  --ok: #17a673;
  --ok-soft: #dcf6ec;
  --err: #e0364b;
  --err-soft: #ffe3e7;
  --hero: linear-gradient(135deg, #ff7a59 0%, #ff3d8b 48%, #7b5cff 100%);
  --cta: linear-gradient(135deg, #ff6a4d, #ff3d8b);
  --radius: 20px;
  --shadow: 0 2px 4px rgb(80 40 90 / 5%), 0 12px 32px -8px rgb(120 50 110 / 14%);
  --shadow-cta: 0 8px 24px -6px rgb(255 61 139 / 55%);
  --c1: #ff6b57; --c2: #ffb020; --c3: #20b9a8; --c4: #7b5cff; --c5: #ff3d8b; --c6: #2f9bff;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17121f;
    --surface: #211a2c;
    --surface-2: #2b2338;
    --text: #f5eefc;
    --muted: #a99cbd;
    --line: #342a44;
    --ok: #3fd39b;
    --ok-soft: #173a2e;
    --err: #ff6b7d;
    --err-soft: #44202a;
    --hero: linear-gradient(135deg, #c2492f 0%, #b8226a 50%, #5236c4 100%);
    --shadow: 0 2px 4px rgb(0 0 0 / 30%), 0 12px 32px -8px rgb(0 0 0 / 50%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, .display { font-family: "Baloo 2", "Nunito", system-ui, sans-serif; letter-spacing: -0.01em; }
a { color: var(--accent-2); }
code { font-size: 0.9em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.wrap { max-width: 820px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }
svg { width: 20px; height: 20px; flex: none; }

/* ------------------------------------------------------------ hero */
.hero {
  position: relative;
  background: var(--hero);
  color: #fff;
  padding: 40px 0 92px;
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  /* confetti */
  content: "";
  position: absolute; inset: 0; z-index: -1; opacity: 0.55;
  background-image:
    radial-gradient(circle at 8% 22%, #ffe066 0 5px, transparent 6px),
    radial-gradient(circle at 18% 78%, #fff 0 3px, transparent 4px),
    radial-gradient(circle at 31% 35%, #7ef0d6 0 4px, transparent 5px),
    radial-gradient(circle at 46% 12%, #fff 0 3px, transparent 4px),
    radial-gradient(circle at 57% 64%, #ffe066 0 4px, transparent 5px),
    radial-gradient(circle at 69% 28%, #fff 0 5px, transparent 6px),
    radial-gradient(circle at 82% 70%, #7ef0d6 0 3px, transparent 4px),
    radial-gradient(circle at 92% 18%, #ffe066 0 4px, transparent 5px),
    radial-gradient(circle at 96% 52%, #fff 0 3px, transparent 4px),
    radial-gradient(circle at 4% 58%, #ffb3d1 0 4px, transparent 5px),
    radial-gradient(circle at 38% 88%, #ffb3d1 0 5px, transparent 6px),
    radial-gradient(circle at 76% 92%, #fff 0 4px, transparent 5px);
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translateY(-10px) translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .hero::before { animation: none; } }
.hero .notes {
  position: absolute; right: -10px; top: 18px; z-index: -1;
  width: 230px; height: 230px; opacity: 0.16; color: #fff;
}
.hero::after {
  /* wavy bottom edge */
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 48px;
  background: var(--bg);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 48' preserveAspectRatio='none'%3E%3Cpath d='M0 24 C150 0 300 48 450 24 S750 0 900 24 S1100 48 1200 20 V48 H0Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 48' preserveAspectRatio='none'%3E%3Cpath d='M0 24 C150 0 300 48 450 24 S750 0 900 24 S1100 48 1200 20 V48 H0Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgb(255 255 255 / 18%);
  border: 1px solid rgb(255 255 255 / 28%);
  backdrop-filter: blur(6px);
  padding: 5px 12px 5px 8px; border-radius: 99px;
  font-weight: 700; font-size: 0.85rem; letter-spacing: 0.02em;
}
.eyebrow svg { width: 18px; height: 18px; }
.hero h1 {
  font-size: clamp(2rem, 6vw, 3rem); line-height: 1.08; font-weight: 600;
  margin: 14px 0 6px; overflow-wrap: anywhere;
  text-shadow: 0 2px 16px rgb(60 0 60 / 25%);
}
.hero .sub { margin: 0 0 22px; opacity: 0.92; font-size: 1.05rem; max-width: 560px; }

/* ------------------------------------------------------------ forms */
.bigform {
  display: flex; gap: 8px; padding: 8px;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: 0 16px 40px -12px rgb(60 0 60 / 40%);
}
.bigform .field { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 0 6px 0 12px; color: var(--muted); }
.bigform input { border: 0 !important; padding: 12px 0 !important; background: transparent !important; }
@media (max-width: 560px) {
  .bigform { flex-direction: column; }
  .bigform .field { padding: 4px 8px; }
}
.hero .msg { color: #fff; font-weight: 600; }
.hero .msg.err { color: #fff; background: rgb(120 0 30 / 35%); display: inline-block; padding: 4px 12px; border-radius: 10px; }
.hero .msg.ok::before { content: "✓ "; }

input[type="text"], input[type="password"] {
  width: 100%; min-width: 0;
  font: inherit; color: var(--text);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}
input::placeholder { color: var(--muted); opacity: 0.8; }
input:focus { border-color: var(--accent-2); }

button, .btn {
  font: inherit; font-weight: 800;
  border: 0; border-radius: 14px;
  padding: 13px 22px;
  cursor: pointer;
  background: var(--cta);
  color: var(--accent-text);
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  white-space: nowrap;
  box-shadow: var(--shadow-cta);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
button:hover, .btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
button:active, .btn:active { transform: translateY(1px); }
button:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: default; pointer-events: none; box-shadow: none; }
button.ghost, .btn.ghost {
  background: var(--surface); color: var(--text);
  box-shadow: none; border: 2px solid var(--line);
  padding: 9px 16px; font-weight: 700;
}
button.ghost.light { background: rgb(255 255 255 / 16%); border-color: rgb(255 255 255 / 35%); color: #fff; }
button.icon, .btn.icon {
  background: transparent; color: var(--muted);
  padding: 9px; border-radius: 12px; line-height: 0; box-shadow: none;
}
button.icon:hover, .btn.icon:hover { background: var(--surface-2); color: var(--text); transform: none; }
button.icon.danger:hover { color: var(--err); background: var(--err-soft); }
.btn.big { padding: 15px 26px; font-size: 1.05rem; border-radius: 16px; }
.btn .count {
  background: rgb(255 255 255 / 25%); border-radius: 99px; padding: 1px 9px; font-size: 0.85rem;
}

.msg { margin: 10px 2px 0; font-size: 0.95rem; color: var(--muted); }
.msg:empty { display: none; }
.msg.err { color: var(--err); }
.msg.ok { color: var(--ok); }

/* ------------------------------------------------------------ main */
main { margin-top: -54px; position: relative; padding-bottom: 96px; }
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 20px 20px 14px;
}
.panel-head h2 { font-size: 1.4rem; font-weight: 600; margin: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface-2); color: var(--muted);
  font-size: 0.82rem; font-weight: 700;
  padding: 3px 10px; border-radius: 99px;
}
.chip svg { width: 14px; height: 14px; }
.chip.busy { background: #fff1d6; color: #b5760b; }
.chip.err { background: var(--err-soft); color: var(--err); }
@media (prefers-color-scheme: dark) { .chip.busy { background: #3e3016; color: #f2c060; } }

ul.items { list-style: none; margin: 0; padding: 0 8px 8px; }
ul.items > li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px;
  border-radius: 14px;
  transition: background 0.15s;
}
ul.items > li + li { border-top: 1px dashed var(--line); }
ul.items > li:hover { background: var(--surface-2); }
ul.items > li:hover + li, ul.items > li.playing + li { border-top-color: transparent; }
ul.items > li.playing { background: color-mix(in srgb, var(--accent-2) 10%, transparent); }

.num {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  font: 600 0.9rem "Baloo 2", sans-serif;
  color: #fff;
  background: var(--c, var(--c1));
}
.thumbwrap { position: relative; flex: none; border: 0; padding: 0; background: none; box-shadow: none; border-radius: 10px; cursor: default; }
.thumbwrap:hover { transform: none; filter: none; }
.thumb { width: 64px; height: 48px; border-radius: 10px; object-fit: cover; display: block; background: var(--surface-2); }
.thumbwrap.can-play { cursor: pointer; }
.thumbwrap.can-play::after {
  content: ""; position: absolute; inset: 0; border-radius: 10px;
  background: rgb(20 0 30 / 45%) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5.5v13a1 1 0 0 0 1.5.86l10.5-6.5a1 1 0 0 0 0-1.72L9.5 4.64A1 1 0 0 0 8 5.5z'/%3E%3C/svg%3E") center / 22px no-repeat;
  opacity: 0; transition: opacity 0.15s;
}
.thumbwrap.can-play:hover::after, li.playing .thumbwrap::after { opacity: 1; }
.grow { flex: 1; min-width: 0; }
.title {
  font-weight: 700; line-height: 1.3; overflow: hidden; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.small { color: var(--muted); font-size: 0.85rem; display: inline-flex; align-items: center; gap: 6px; }
.small.err { color: var(--err); display: block; margin-top: 2px; }
.actions { display: flex; gap: 2px; flex: none; }
@media (max-width: 480px) {
  .thumbwrap { display: none; }
  ul.items > li { gap: 10px; padding: 10px 6px; }
}

.bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.bar > i {
  display: block; height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
  transition: width 0.5s;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.bar.indet > i { width: 35% !important; animation: slide 1.1s infinite ease-in-out, shimmer 1.6s linear infinite; }
@keyframes slide { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }

/* little equalizer shown while a song downloads */
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq i { width: 3px; background: var(--accent-2); border-radius: 2px; animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -0.3s; background: var(--accent); }
.eq i:nth-child(3) { animation-delay: -0.6s; background: var(--accent-3); }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 12px; } }

.badge { font-size: 0.75rem; font-weight: 800; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.badge.err { background: var(--err-soft); color: var(--err); }

.empty { text-align: center; color: var(--muted); padding: 28px 16px 40px; }
.empty svg { width: 96px; height: 96px; display: block; margin: 0 auto 10px; }
.empty b { display: block; color: var(--text); font: 600 1.2rem "Baloo 2", sans-serif; margin-bottom: 4px; }

/* how-it-works */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 20px; }
@media (max-width: 640px) { .steps { grid-template-columns: 1fr; } }
.step { padding: 16px; display: flex; gap: 12px; align-items: flex-start; font-size: 0.92rem; color: var(--muted); }
.step b { display: block; color: var(--text); font: 600 1.02rem "Baloo 2", sans-serif; margin-bottom: 2px; }
.step .ic {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: grid; place-items: center; color: #fff; background: var(--c);
}

/* player */
body.has-player { padding-bottom: 104px; }
.player {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 10;
  max-width: 796px; margin: 0 auto;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-radius: 20px;
  box-shadow: 0 16px 48px -8px rgb(60 0 60 / 35%), 0 0 0 1px var(--line);
  overflow: hidden;
}
.pl-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 12px; }
.pl-now { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.pl-art { position: relative; width: 52px; height: 52px; flex: none; }
.pl-art img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; animation: spin 8s linear infinite; }
.pl-art img:not([src]) { display: none; }
.pl-art .disc { position: absolute; inset: 0; border-radius: 50%; background: var(--hero); display: grid; place-items: center; color: #fff; }
.pl-art img[src] + .disc { inset: 18px; background: var(--surface); box-shadow: 0 0 0 2px rgb(0 0 0 / 15%); }
.pl-art img[src] + .disc svg { display: none; }
.player.paused .pl-art img { animation-play-state: paused; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pl-art img { animation: none; } }
.pl-info { min-width: 0; }
.pl-info .title { font-size: 0.95rem; -webkit-line-clamp: 1; }
.pl-info .small { font-variant-numeric: tabular-nums; }
.pl-controls { display: flex; align-items: center; gap: 4px; flex: none; }
.pl-controls .icon { color: var(--text); }
.pl-controls .icon svg { width: 22px; height: 22px; }
.pl-toggle { position: relative; color: var(--muted) !important; }
.pl-toggle[aria-pressed="true"] { color: var(--accent-2) !important; background: color-mix(in srgb, var(--accent-2) 12%, transparent); }
.pl-toggle[aria-pressed="true"]::after {
  content: ""; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: currentColor;
}
.pl-play { width: 50px; height: 50px; padding: 0; border-radius: 50%; margin: 0 2px; }
.pl-play svg { width: 24px; height: 24px; }

.pl-seek {
  --p: 0%;
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; height: 14px; margin: 0; padding: 0;
  background: transparent; cursor: pointer;
  position: absolute; top: -6px; left: 0;
}
.pl-seek::-webkit-slider-runnable-track {
  height: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3)) 0 / var(--p) 100% no-repeat, var(--surface-2);
}
.pl-seek::-moz-range-track { height: 4px; background: var(--surface-2); }
.pl-seek::-moz-range-progress { height: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.pl-seek::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 3px var(--accent-2); opacity: 0; transition: opacity 0.15s;
}
.pl-seek::-moz-range-thumb {
  width: 12px; height: 12px; border: 0; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 3px var(--accent-2); opacity: 0; transition: opacity 0.15s;
}
.player:hover .pl-seek::-webkit-slider-thumb, .pl-seek:active::-webkit-slider-thumb { opacity: 1; }
.player:hover .pl-seek::-moz-range-thumb, .pl-seek:active::-moz-range-thumb { opacity: 1; }
.player { padding-top: 2px; }
.player > .pl-seek { position: relative; top: 0; margin-top: -2px; }
@media (max-width: 560px) {
  .player { left: 8px; right: 8px; bottom: 8px; }
  .pl-row { gap: 8px; padding: 10px 8px 10px 10px; }
  .pl-art { width: 44px; height: 44px; }
  .pl-art img[src] + .disc { inset: 15px; }
  .pl-controls { gap: 0; }
  .pl-controls .icon { padding: 7px; }
  .pl-play { width: 44px; height: 44px; }
}
@media (max-width: 380px) { .pl-art { display: none; } }

/* ------------------------------------------------------------ admin */
.lists { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.listcard { overflow: hidden; display: flex; flex-direction: column; }
.listcard .top { height: 8px; background: var(--c); }
.listcard .body { padding: 16px 16px 12px; flex: 1; }
.listcard h3 { margin: 0; font: 600 1.25rem/1.2 "Baloo 2", sans-serif; overflow-wrap: anywhere; }
.listcard h3 a { color: inherit; text-decoration: none; }
.listcard h3 a:hover { color: var(--accent-2); }
.linkpill {
  display: flex; align-items: center; gap: 6px;
  margin-top: 12px; padding: 4px 4px 4px 12px;
  background: var(--surface-2); border-radius: 12px;
}
.linkpill span {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 0.82rem ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted);
}
.linkpill button { padding: 6px 12px; font-size: 0.82rem; border-radius: 9px; box-shadow: none; }
.listcard .foot { display: flex; justify-content: flex-end; gap: 2px; padding: 0 8px 8px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 8px 4px 14px; }
.section-title h2 { margin: 0; font-size: 1.4rem; font-weight: 600; }
.login { max-width: 420px; }
.foot-note { color: var(--muted); font-size: 0.88rem; margin: 22px 4px 0; }
.hero h1, .panel-head h2, .section-title h2 { font-weight: 700; }
@media (max-width: 560px) { .panel-head .btn.big { width: 100%; } }

/* ------------------------------------------------------------ selection */
.check { position: relative; display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; cursor: pointer; }
.check input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.check span {
  width: 22px; height: 22px; border-radius: 7px;
  border: 2px solid color-mix(in srgb, var(--muted) 55%, transparent);
  background: var(--surface);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  display: grid; place-items: center;
}
.check:hover span { border-color: var(--accent-2); }
.check input:checked + span, .check input:indeterminate + span {
  background: var(--cta); border-color: transparent;
}
.check input:checked + span::after {
  content: ""; width: 10px; height: 6px; margin-top: -3px;
  border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg);
}
.check input:indeterminate + span::after { content: ""; width: 10px; height: 2.5px; background: #fff; border-radius: 2px; }
.check input:focus-visible + span { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.check:active span { transform: scale(0.9); }
.check.off { visibility: hidden; }
ul.items > li.selected { background: color-mix(in srgb, var(--accent-3) 9%, transparent); }
ul.items > li.selected + li { border-top-color: transparent; }

.selbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 8px 6px; padding: 8px 10px;
  border-radius: 14px;
  background: var(--surface-2);
  position: sticky; top: 8px; z-index: 5;
  transition: background 0.2s, box-shadow 0.2s;
}
.selbar.active {
  background: color-mix(in srgb, var(--accent-3) 14%, var(--surface));
  box-shadow: 0 8px 24px -10px rgb(80 40 160 / 45%);
}
.seltext { flex: 1; min-width: 140px; font-weight: 700; font-size: 0.92rem; color: var(--muted); }
.selbar.active .seltext { color: var(--text); }
.small-btn { padding: 8px 14px !important; font-size: 0.9rem; border-radius: 11px; }
.selbar .ghost.small-btn { background: transparent; }
@media (max-width: 560px) {
  .selbar #selZip { flex-basis: 100%; }
}

/* ------------------------------------------------------------ drag & drop */
.grip {
  flex: none; display: grid; place-items: center;
  width: 22px; height: 36px; margin-right: -6px;
  color: var(--muted); opacity: 0.45;
  cursor: grab; touch-action: none; border-radius: 8px;
}
.grip svg { width: 18px; height: 18px; }
li:hover .grip, .grip:focus-visible { opacity: 1; }
@media (hover: none) { .grip { opacity: 0.8; } }
.is-dragging, .is-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
ul.items > li.dragging {
  position: relative; z-index: 3;
  background: var(--surface);
  box-shadow: 0 14px 34px -10px rgb(80 30 110 / 45%), 0 0 0 2px color-mix(in srgb, var(--accent-2) 45%, transparent);
  border-top-color: transparent;
}
ul.items > li.dragging + li { border-top-color: transparent; }
ul.items > li.dragging .grip { opacity: 1; color: var(--accent-2); }
@media (max-width: 480px) {
  ul.items { padding: 0 4px 6px; }
  ul.items > li { gap: 7px; padding: 10px 4px; }
  .grip { width: 16px; margin-right: -4px; }
  .num { width: 26px; height: 26px; font-size: 0.82rem; border-radius: 8px; }
  .check { width: 24px; }
  .actions { gap: 0; }
  .actions .icon { padding: 6px; }
  .actions svg { width: 18px; height: 18px; }
}
