/* plom.uk: one hand-written stylesheet, no build step.
   Sections: tokens, base, shell (sidebar / top bar), page pieces, cards, rows,
   player (bar + sheet), toast, admin, motion. The old Tailwind look is kept: the
   palette below is Tailwind's slate / indigo / purple with the same hex values. */

/* ---------------------------------------------------------------- tokens */
:root {
  color-scheme: dark;

  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --slate-950: #020617;
  --indigo-300: #a5b4fc;
  --indigo-400: #818cf8;
  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;
  --indigo-700: #4338ca;
  --indigo-900: #312e81;
  --purple-300: #d8b4fe;
  --purple-400: #c084fc;
  --purple-500: #a855f7;
  --purple-600: #9333ea;
  --purple-900: #581c87;
  --pink-300: #f9a8d4;
  --gold: #eab308;
  --orange: #ea580c;
  --green: #22c55e;
  --red: #f87171;

  --bg: var(--slate-950);
  --surface: var(--slate-900);
  --line: var(--slate-800);
  --text: var(--slate-100);
  --muted: var(--slate-400);
  --faint: var(--slate-500);

  --sidebar-w: 288px;
  --topbar-h: 64px;
  --player-h: 80px;
  --radius: 16px;

  --font: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgb(99 102 241 / .3); }
h1, h2, h3, h4, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; opacity: .5; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--indigo-400); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 100; padding: 8px 14px; border-radius: 8px;
  background: var(--indigo-600); color: #fff; transform: translateY(-200%);
}
.skip-link:focus { transform: none; }
.noscript { padding: 16px; text-align: center; color: var(--muted); font-size: 14px; }

.icon {
  width: 1em; height: 1em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.icon--fill { fill: currentColor; }

/* No-JavaScript baseline: controls that need JS are hidden, extras for no-JS shown. */
.no-js [data-needs-js] { display: none !important; }
.js [data-nojs-only] { display: none !important; }

/* ----------------------------------------------------------------- shell */
.logo {
  position: relative; display: grid; place-items: center; flex: none;
  padding: 12px; border-radius: 12px; overflow: hidden; color: #fff;
  background: linear-gradient(135deg, var(--purple-600), var(--indigo-600));
  box-shadow: 0 10px 15px -3px rgb(168 85 247 / .2);
}
.logo .icon { font-size: 24px; }
.logo__phones { position: absolute; right: 8px; bottom: 6px; font-size: 16px !important; color: #e9d5ff; opacity: .4; transform: rotate(12deg); }
.logo--small { padding: 8px; border-radius: 8px; box-shadow: none; }
.logo--small .icon { font-size: 16px; }

.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
  display: flex; flex-direction: column; width: var(--sidebar-w);
  background: var(--bg); border-right: 1px solid var(--surface); overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 16px; margin-bottom: 16px; }
.brand__text { display: grid; line-height: 1; }
.brand__top { font-size: 18px; font-weight: 700; letter-spacing: -.025em; color: #fff; }
.brand__sub { font-size: 14px; font-weight: 700; letter-spacing: -.025em; color: var(--purple-400); }

.nav { display: grid; gap: 4px; padding: 0 12px; }
.nav--admin { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgb(30 41 59 / .5); margin-inline: 12px; padding-inline: 0; }
.nav__item {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 8px;
  color: var(--muted); font-weight: 500; transition: background-color .2s, color .2s;
}
.nav__item .icon { font-size: 20px; }
.nav__item:hover { background: var(--slate-800); color: #fff; }
.nav__item[aria-current="page"],
body[data-nav="home"] .nav__item[data-nav="home"],
body[data-nav="music"] .nav__item[data-nav="music"],
body[data-nav="videos"] .nav__item[data-nav="videos"],
body[data-nav="top100"] .nav__item[data-nav="top100"],
body[data-nav="upload"] .nav__item[data-nav="upload"],
body[data-nav="manage"] .nav__item[data-nav="manage"] {
  background: var(--indigo-600); color: #fff; box-shadow: 0 10px 15px -3px rgb(49 46 129 / .2);
}
.sidebar__foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); }
.foot-card {
  padding: 16px; border-radius: 12px; border: 1px solid var(--line);
  background: rgb(15 23 42 / .5); text-align: center; font-size: 12px; color: var(--faint);
}

.topbar { display: none; }
.scrim {
  position: fixed; inset: 0; z-index: 55; background: rgb(0 0 0 / .8);
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s;
}

main#page { margin-left: var(--sidebar-w); min-height: 100vh; outline: none; }
.page { max-width: 1280px; margin: 0 auto; padding: 16px; }
.page--narrow { max-width: 560px; }
@media (min-width: 768px) { .page { padding: 32px; } }
@media (min-width: 1024px) { .page { padding: 40px; } }

body.has-player main#page { padding-bottom: calc(var(--player-h) + env(safe-area-inset-bottom) + 16px); }
body.has-player .sidebar { bottom: var(--player-h); }

@media (max-width: 767px) {
  :root { --player-h: 64px; }

  .topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: var(--topbar-h);
    display: flex; align-items: center; justify-content: space-between; padding: 0 16px;
    background: rgb(2 6 23 / .8); border-bottom: 1px solid var(--surface);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  }
  .topbar__brand { display: flex; align-items: center; gap: 8px; }
  .topbar__name { font-size: 14px; font-weight: 700; color: #fff; }

  main#page { margin-left: 0; padding-top: 80px; }
  .page { padding-top: 16px; }

  .scrim { z-index: 61; }
  .sidebar {
    z-index: 62; max-width: 85vw; border-right-color: var(--surface);
    transform: translateX(-100%); visibility: hidden;
    transition: transform .3s ease, visibility 0s .3s;
  }
  body.has-player .sidebar { bottom: 0; }
  .sidebar.is-open { transform: none; visibility: visible; transition: transform .3s ease; }
  .scrim.is-open { opacity: 1; visibility: visible; transition: opacity .3s; }
}

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  color: var(--muted); font-size: 20px; transition: background-color .2s, color .2s;
}
.icon-btn:hover { background: var(--slate-800); color: #fff; }
.icon-btn--lg { font-size: 22px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px; border-radius: 8px; border: 1px solid transparent;
  background: var(--indigo-600); color: #fff; font-size: 14px; font-weight: 500;
  transition: background-color .2s, border-color .2s, color .2s;
}
.btn:hover { background: var(--indigo-700); }
.btn .icon { font-size: 16px; }
.btn--sm { padding: 5px 10px; font-size: 13px; }
.btn--outline { background: var(--surface); border-color: var(--line); color: var(--slate-300); }
.btn--outline:hover { background: var(--slate-800); color: #fff; }
.btn--ghost { background: transparent; color: var(--muted); }
.btn--ghost:hover { background: var(--slate-800); color: #fff; }
.btn--danger { background: #b91c1c; }
.btn--danger:hover { background: #991b1b; }

/* ------------------------------------------------------------- page bits */
.hero {
  position: relative; overflow: hidden; padding: 20px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--purple-900) 0%, var(--indigo-900) 50%, var(--slate-900) 100%);
  border: 1px solid rgb(168 85 247 / .2); box-shadow: 0 20px 25px -5px rgb(0 0 0 / .1);
}
@media (min-width: 768px) { .hero { padding: 24px; } }
.hero__deco { position: absolute; inset: 0; opacity: .1; overflow: hidden; pointer-events: none; }
.deco { position: absolute; animation: bounce 3s infinite; }
.deco .icon { font-size: 32px; }
.deco--1 { top: 16px; left: 32px; color: var(--purple-400); transform: rotate(12deg); }
.deco--2 { top: 24px; right: 48px; color: var(--indigo-400); animation-duration: 3.5s; animation-delay: .5s; }
.deco--2 .icon { font-size: 24px; }
.deco--3 { bottom: 16px; left: 25%; color: var(--purple-300); animation-duration: 4s; animation-delay: 1s; }
.deco--4 { bottom: 20px; right: 25%; color: var(--indigo-300); animation-duration: 3.2s; animation-delay: 1.5s; }
.deco--4 .icon { font-size: 24px; }
.hero__row { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 16px; }
@media (min-width: 768px) { .hero__row { flex-direction: row; } }
.hero__brand { display: flex; align-items: center; gap: 16px; }
.hero__icon {
  display: grid; place-items: center; padding: 12px; border-radius: 12px; color: #fff; flex: none;
  background: linear-gradient(135deg, var(--purple-500), var(--indigo-600)); box-shadow: 0 10px 15px -3px rgb(0 0 0 / .1);
}
.hero__icon .icon { font-size: 32px; }
.hero__title {
  font-size: 24px; font-weight: 700; line-height: 1.25; color: transparent;
  background: linear-gradient(90deg, var(--purple-300), var(--pink-300), var(--indigo-300));
  -webkit-background-clip: text; background-clip: text;
}
@media (min-width: 768px) { .hero__title { font-size: 30px; } }
.hero__tag { margin-top: 4px; font-size: 12px; font-weight: 500; color: var(--purple-300); }

.search { position: relative; width: 100%; }
@media (min-width: 768px) { .search { width: 384px; } }
.search__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); z-index: 1; font-size: 16px; color: var(--purple-300); pointer-events: none; }
.search__input {
  width: 100%; height: 40px; padding: 0 16px 0 40px; border-radius: 12px; font-size: 14px; color: #fff;
  background: rgb(255 255 255 / .1); border: 1px solid rgb(168 85 247 / .3);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: background-color .2s, border-color .2s;
}
.search__input::placeholder { color: rgb(216 180 254 / .5); }
.search__input:focus { outline: none; background: rgb(255 255 255 / .2); border-color: rgb(192 132 252 / .5); }
.search__go { position: absolute; right: 6px; top: 6px; }
.no-js .search__input { padding-right: 84px; }

.library { margin-top: 40px; }
.library__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 32px; }
.library__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 24px; font-weight: 700; color: #fff; }
.section-title .icon { font-size: 24px; color: var(--indigo-500); }
.tabs { display: inline-flex; padding: 4px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.tab { padding: 6px 12px; border-radius: 6px; font-size: 14px; font-weight: 500; color: var(--muted); transition: background-color .2s, color .2s; }
.tab:hover { color: #fff; }
.tab[aria-pressed="true"] { background: #fff; color: var(--slate-950); box-shadow: 0 1px 2px rgb(0 0 0 / .2); }
.more { margin-top: 24px; text-align: center; }
.more a { color: var(--indigo-300); text-decoration: underline; }
.about { margin-top: 56px; max-width: 70ch; color: var(--muted); }
.about__title { margin-bottom: 8px; font-size: 18px; font-weight: 600; color: var(--slate-200); }

.pagehead { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 32px; }
.pagehead__icon { display: grid; place-items: center; padding: 12px; border-radius: var(--radius); flex: none; }
.pagehead__icon .icon { font-size: 32px; }
.pagehead__icon--indigo { background: rgb(99 102 241 / .1); color: var(--indigo-400); }
.pagehead__icon--purple { background: rgb(168 85 247 / .1); color: var(--purple-400); }
.pagehead__icon--gold { padding: 16px; color: #fff; background: linear-gradient(135deg, #ca8a04, var(--orange)); }
.pagehead__text { flex: 1 1 280px; min-width: 0; }
.pagehead__title { font-size: 30px; font-weight: 700; line-height: 1.2; color: #fff; }
.pagehead__title--lg { font-size: 36px; }
.pagehead__intro { margin-top: 4px; max-width: 62ch; color: var(--muted); }
.pagehead__action { margin-left: auto; }

.empty {
  padding: 80px 16px; text-align: center; color: var(--faint);
  border: 1px dashed var(--line); border-radius: 24px; background: rgb(15 23 42 / .5);
}
.empty--tall { display: grid; justify-items: center; gap: 16px; background: rgb(15 23 42 / .3); }
.empty__icon { font-size: 64px; color: var(--slate-700); }

.notfound { padding: 96px 0; text-align: center; }
.notfound__code { font-size: 72px; font-weight: 300; line-height: 1; color: var(--slate-600); }
.notfound__title { margin-top: 16px; font-size: 24px; font-weight: 500; color: #fff; }
.notfound__text { margin: 12px 0 28px; color: var(--muted); }

/* ----------------------------------------------------------------- cards */
.grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.stretched::after { content: ""; position: absolute; inset: 0; }
.stretched:focus-visible { outline: none; }

.card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / .1);
  transition: transform .3s, border-color .3s, box-shadow .3s;
  animation: rise .4s both;
}
.card:hover { transform: translateY(-5px); border-color: var(--slate-700); box-shadow: 0 20px 25px -5px rgb(99 102 241 / .1); }
.card:has(.stretched:focus-visible), .row:has(.stretched:focus-visible) { outline: 2px solid var(--indigo-400); outline-offset: 2px; }
.card.is-current { border-color: rgb(99 102 241 / .6); }

.card__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--slate-800); }
.card__media > img { width: 100%; height: 100%; object-fit: cover; opacity: .8; transition: opacity .5s, transform .5s; }
.card:hover .card__media > img { opacity: 1; transform: scale(1.05); }
.card__badge {
  position: absolute; top: 12px; right: 12px; padding: 4px 8px; border-radius: 6px;
  background: rgb(0 0 0 / .6); border: 1px solid rgb(255 255 255 / .1);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #fff;
}
.card__overlay {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgb(0 0 0 / .4); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .3s; pointer-events: none;
}
.card:hover .card__overlay, .card:focus-within .card__overlay { opacity: 1; }
.card__playicon {
  display: grid; place-items: center; padding: 16px; border-radius: 50%; background: #fff; color: #000;
  font-size: 24px; box-shadow: 0 20px 25px -5px rgb(0 0 0 / .3); transform: scale(.9); transition: transform .3s;
}
.card:hover .card__playicon { transform: scale(1); }
.card__add, .row__add {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-size: 18px; color: #fff;
  background: rgb(0 0 0 / .6); border: 1px solid rgb(255 255 255 / .1);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: background-color .2s;
}
.card__add { position: absolute; top: 12px; left: 12px; z-index: 2; }
.card__add:hover, .row__add:hover { background: var(--indigo-600); }
.card__body { padding: 20px; }
.card__title { font-size: 18px; font-weight: 600; line-height: 1.4; color: #fff; transition: color .2s; }
.card:hover .card__title { color: var(--indigo-400); }
.card__artist { margin-top: 4px; font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__meta { display: flex; align-items: center; gap: 16px; margin-top: 16px; padding-top: 16px; border-top: 1px solid rgb(30 41 59 / .5); }
.card__date { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--faint); }
.card__date .icon { font-size: 12px; }
.chip { padding: 4px 8px; border-radius: 999px; background: var(--slate-800); color: var(--muted); font-size: 12px; }

.art { display: grid; place-items: center; align-content: center; gap: 8px; width: 100%; height: 100%; color: #fff; }
.art__initials { font-size: 36px; font-weight: 700; line-height: 1; color: rgb(255 255 255 / .9); }
.art .icon { font-size: 32px; color: rgb(255 255 255 / .6); }
.art--video { background: var(--slate-800); }
.art--video .icon { color: var(--slate-700); }
.card:hover .art--video .icon { color: var(--indigo-400); }
.grad-0 { background: linear-gradient(135deg, #9333ea, #4f46e5); }
.grad-1 { background: linear-gradient(135deg, #db2777, #e11d48); }
.grad-2 { background: linear-gradient(135deg, #2563eb, #0891b2); }
.grad-3 { background: linear-gradient(135deg, #16a34a, #059669); }
.grad-4 { background: linear-gradient(135deg, #ea580c, #d97706); }
.grad-5 { background: linear-gradient(135deg, #dc2626, #db2777); }
.grad-6 { background: linear-gradient(135deg, #0d9488, #0891b2); }
.grad-7 { background: linear-gradient(135deg, #7c3aed, #9333ea); }

/* ------------------------------------------------------------------ rows */
.rows { overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line); background: rgb(15 23 42 / .5); }
.row {
  position: relative; display: flex; align-items: center; gap: 16px; padding: 16px;
  border-bottom: 1px solid rgb(30 41 59 / .5); transition: background-color .2s;
  animation: row-in .4s both; animation-delay: calc(var(--i, 0) * 20ms);
}
.row:last-child { border-bottom: 0; }
.row:hover { background: rgb(30 41 59 / .5); }
.row.is-current { background: rgb(79 70 229 / .15); }
.row__rank { flex: none; width: 48px; text-align: center; font-size: 18px; font-weight: 700; color: var(--slate-600); }
.rank--1 { color: var(--gold); }
.rank--2 { color: var(--slate-400); }
.rank--3 { color: var(--orange); }
.row__thumb { position: relative; flex: none; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--slate-800); }
.row__thumb > img { width: 100%; height: 100%; object-fit: cover; }
.row__thumb .art__initials { font-size: 20px; }
.row__overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgb(0 0 0 / .4); color: #fff; font-size: 24px; opacity: 0; transition: opacity .2s; }
.row:hover .row__overlay { opacity: 1; }
.row__main { flex: 1; min-width: 0; }
.row__title { font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .2s; }
.row:hover .row__title { color: var(--indigo-400); }
.row__artist { font-size: 14px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__stat { display: flex; align-items: center; gap: 8px; flex: none; color: var(--muted); }
.row__stat .icon { font-size: 16px; }
.row__stat strong { font-weight: 500; }
.row__stat span { font-size: 12px; color: var(--slate-600); }
.row__add { position: relative; z-index: 2; flex: none; background: var(--slate-800); }
@media (max-width: 560px) {
  .row { gap: 10px; padding: 12px; }
  .row__rank { width: 28px; font-size: 15px; }
  .row__thumb { width: 52px; height: 52px; }
  .row__stat span { display: none; }
}

/* ----------------------------------------------------------------- admin */
.page--form { max-width: 760px; margin-inline: 0; }
@media (min-width: 1280px) { .page--form { margin-inline: auto; } }

.panel { padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); background: rgb(15 23 42 / .5); }
.panel + .panel, .flash + .panel, .panel + .flash { margin-top: 20px; }
.panel__title { margin-bottom: 4px; font-size: 18px; font-weight: 600; color: #fff; }

.form { display: grid; gap: 20px; }
.form__row { display: grid; gap: 16px; }
@media (min-width: 720px) { .form__row { grid-template-columns: 1.2fr 1.2fr .8fr; } }
.form__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.form--danger { border-color: rgb(127 29 29 / .6); }
.field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.label { font-size: 14px; font-weight: 500; color: var(--slate-300); padding: 0; }
.hint { font-size: 12px; color: var(--faint); }
.input {
  width: 100%; padding: 10px 14px; border-radius: 10px; font-size: 15px; color: #fff;
  background: var(--slate-950); border: 1px solid var(--slate-700);
  transition: border-color .2s, box-shadow .2s;
}
.input::placeholder { color: var(--slate-600); }
.input:focus { outline: none; border-color: var(--indigo-400); box-shadow: 0 0 0 3px rgb(99 102 241 / .25); }
.input--sm { padding: 6px 10px; font-size: 14px; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--slate-400) 50%), linear-gradient(135deg, var(--slate-400) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
textarea.input { resize: vertical; min-height: 84px; }
.file { width: 100%; font-size: 14px; color: var(--muted); }
.file::file-selector-button {
  margin-right: 12px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--slate-700);
  background: var(--slate-800); color: var(--slate-200); font: inherit; cursor: pointer; transition: background-color .2s;
}
.file::file-selector-button:hover { background: var(--slate-700); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.check input { width: 16px; height: 16px; accent-color: var(--indigo-500); }
.btn--block { width: 100%; padding: 10px 16px; }

.coverchoice { gap: 10px; }
.check--block {
  align-items: flex-start; padding: 10px 12px; border-radius: 12px; cursor: pointer; color: var(--slate-200);
  background: var(--slate-950); border: 1px solid var(--slate-800); transition: border-color .2s, background-color .2s;
}
.check--block:hover { border-color: var(--slate-600); }
.check--block:has(input:checked) { border-color: var(--indigo-500); background: rgb(79 70 229 / .15); }
.check--block input { margin-top: 3px; flex: none; }
.coveropt { display: flex; align-items: center; gap: 12px; min-width: 0; }
.coveropt .hint { display: block; margin-top: 2px; }
.coveropt .coveredit__thumb { width: 56px; height: 56px; }
.coverchoice .file { width: calc(100% - 28px); margin-left: 28px; }

/* A cover thumbnail you can click to enlarge (see admin-zoom.js). */
.zoomable { padding: 0; border: 0; font: inherit; color: inherit; cursor: zoom-in; }
.zoomable:hover { outline: 2px solid var(--indigo-400); outline-offset: 1px; }
.zoomable:focus-visible { outline: 2px solid var(--indigo-400); outline-offset: 2px; }
.zoom {
  padding: 0; border: 0; background: transparent; color: var(--slate-200);
  max-width: none; max-height: none; overflow: visible;
}
.zoom::backdrop { background: rgb(2 6 23 / .88); backdrop-filter: blur(4px); }
.zoom__img { display: block; border-radius: 12px; background: var(--slate-800); box-shadow: 0 20px 60px rgb(0 0 0 / .6); cursor: zoom-out; }
.zoom__info { margin: 12px 0 0; text-align: center; font-size: 13px; color: var(--slate-300); }
.zoom__close { position: absolute; top: 8px; right: 8px; background: rgb(2 6 23 / .65); color: #fff; }

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice__opt input { position: absolute; opacity: 0; pointer-events: none; }
.choice__opt span {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 12px;
  background: var(--slate-950); border: 1px solid var(--slate-700); color: var(--muted); font-weight: 500;
  cursor: pointer; transition: background-color .2s, border-color .2s, color .2s;
}
.choice__opt span:hover { color: #fff; border-color: var(--slate-600); }
.choice__opt input:checked + span { background: rgb(79 70 229 / .2); border-color: var(--indigo-500); color: #fff; }
.choice__opt input:focus-visible + span { outline: 2px solid var(--indigo-400); outline-offset: 2px; }

.dropzone { padding: 16px; border: 2px dashed var(--slate-700); border-radius: 12px; background: var(--slate-950); display: grid; gap: 8px; transition: border-color .2s, background-color .2s; }
.dropzone.is-over { border-color: var(--indigo-400); background: rgb(49 46 129 / .2); }

.flash { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: 12px; font-size: 14px; margin-bottom: 20px; }
.flash .icon { margin-top: 3px; flex: none; }
.flash--ok { background: rgb(34 197 94 / .1); border: 1px solid rgb(34 197 94 / .3); color: #86efac; }
.flash--error { background: rgb(248 113 113 / .1); border: 1px solid rgb(248 113 113 / .3); color: #fca5a5; }
.panel .flash { margin: 0; }

.success { display: grid; justify-items: center; gap: 8px; text-align: center; margin-bottom: 20px; }
.success__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: rgb(34 197 94 / .15); color: var(--green); font-size: 28px; }
.success__title { font-size: 22px; font-weight: 700; color: #fff; }
.success p { color: var(--muted); }
.success__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 8px; }

.progress { display: flex; align-items: center; gap: 12px; }
.progress__bar { flex: 1; height: 8px; border-radius: 999px; background: var(--slate-800); overflow: hidden; }
.progress__bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--purple-500), var(--indigo-400)); transition: width .15s; }
.progress__text { min-width: 40px; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); }

.admin-cards { display: grid; gap: 16px; }
@media (min-width: 720px) { .admin-cards { grid-template-columns: 1fr 1fr; } }
.admin-card {
  display: flex; align-items: center; gap: 16px; padding: 20px; border-radius: var(--radius);
  background: rgb(15 23 42 / .5); border: 1px solid var(--line); transition: border-color .2s, background-color .2s;
}
.admin-card:hover { border-color: rgb(79 70 229 / .6); background: rgb(30 41 59 / .5); }
.admin-card__icon { display: grid; place-items: center; flex: none; padding: 12px; border-radius: 12px; color: #fff; font-size: 24px; background: linear-gradient(135deg, var(--purple-600), var(--indigo-600)); }
.admin-card__text { display: grid; flex: 1; min-width: 0; }
.admin-card__text strong { color: #fff; font-weight: 600; }
.admin-card__text span { font-size: 14px; color: var(--faint); }
.admin-card__go { color: var(--slate-600); font-size: 20px; }
.admin-card:hover .admin-card__go { color: var(--indigo-400); }

.mrow { display: flex; align-items: center; gap: 16px; padding: 16px; border-bottom: 1px solid rgb(30 41 59 / .5); transition: background-color .2s; }
.mrow:last-child { border-bottom: 0; }
.mrow:hover { background: rgb(30 41 59 / .5); }
.mrow__main { flex: 1; min-width: 0; }
.mrow__title { font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow__desc { font-size: 14px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chips .chip { padding: 2px 8px; }

.coveredit { display: flex; align-items: center; gap: 16px; }
.coveredit__thumb { width: 88px; height: 88px; }
.coveredit__controls { display: grid; gap: 10px; flex: 1; min-width: 0; }

.users { display: grid; gap: 4px; }
.urow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 0; border-top: 1px solid rgb(30 41 59 / .6); }
.urow:first-of-type { border-top: 0; }
.urow__name { display: flex; align-items: center; gap: 8px; flex: 1 1 180px; color: #fff; }
.urow__form { display: flex; align-items: center; gap: 8px; margin: 0; }

body.bare { display: block; }
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 380px); justify-content: center; align-content: center; justify-items: center; gap: 16px; padding: 24px; }
.login__card { display: grid; gap: 16px; width: 100%; }
.login__card .logo { justify-self: center; }
.login__title { text-align: center; font-size: 22px; font-weight: 700; color: #fff; }
.login__back { font-size: 14px; }
.login__back a { color: var(--indigo-300); }

/* ---------------------------------------------------------------- player */
.player { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; pointer-events: none; }
.player > * { pointer-events: auto; }

.bar {
  position: relative; z-index: 1; display: grid; align-items: center; gap: 16px;
  grid-template-columns: minmax(180px, 1fr) minmax(320px, 2fr) minmax(200px, 1fr);
  height: calc(var(--player-h) + env(safe-area-inset-bottom)); padding: 0 16px env(safe-area-inset-bottom);
  background: rgb(2 6 23 / .94); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.bar__progress { display: none; position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: var(--slate-800); }
.bar__progress i { display: block; height: 100%; width: 0; background: var(--indigo-400); }
.bar__now { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 6px; margin: -6px; border-radius: 12px; text-align: left; }
.bar__now:hover { background: rgb(30 41 59 / .5); }
.thumb { position: relative; display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 8px; overflow: hidden; background: rgb(49 46 129 / .4); color: var(--indigo-400); font-size: 20px; }
.thumb > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bar__text { display: grid; min-width: 0; }
.bar__text strong { font-size: 14px; font-weight: 500; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar__text span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar__center { display: grid; gap: 2px; justify-items: center; min-width: 0; }
.bar__right { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }

.transport { display: flex; align-items: center; justify-content: center; gap: 8px; }
.play-btn {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; font-size: 22px;
  background: var(--indigo-600); color: #fff; box-shadow: 0 10px 15px -3px rgb(49 46 129 / .4);
  transition: background-color .2s, transform .15s;
}
.play-btn:hover { background: var(--indigo-500); }
.play-btn:active { transform: scale(.95); }
.play-btn--sm { width: 40px; height: 40px; font-size: 18px; background: #fff; color: var(--slate-950); box-shadow: none; }
.play-btn--sm:hover { background: var(--slate-200); }
.play-btn .i-pause, .player.is-playing .play-btn .i-play { display: none; }
.player.is-playing .play-btn .i-pause { display: block; }
.icon-btn .i-muted, .player.is-muted .icon-btn .i-vol { display: none; }
.player.is-muted .icon-btn .i-muted { display: block; }
.player.no-volume .volume { display: none; }
.player.is-busy .play-btn { opacity: .7; }

.seek { display: flex; align-items: center; gap: 10px; width: 100%; }
.seek--bar { max-width: 560px; }
.time { flex: none; min-width: 36px; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--faint); }
.time:first-child { text-align: right; }
.volume { display: flex; align-items: center; gap: 4px; }
.volume .range { width: 96px; }
.queue-toggle { position: relative; }
.badge {
  position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--indigo-600); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}
.badge:empty { display: none; }

/* Range sliders: explicit colours on every part (no theme variables). --fill is set by player-ui.js. */
.range {
  -webkit-appearance: none; appearance: none; flex: 1; width: 100%; height: 24px; margin: 0;
  background: transparent; cursor: pointer; --fill: 0%;
}
.range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--indigo-400) var(--fill), var(--slate-700) var(--fill)); }
.range::-moz-range-track { height: 4px; border-radius: 2px; background: var(--slate-700); }
.range::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--indigo-400); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: #fff; border: 2px solid var(--indigo-500); }
.range::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--indigo-500); }
.range:focus-visible { outline: 2px solid var(--indigo-400); outline-offset: 2px; }

/* The sheet: now playing + queue. Desktop: a docked panel above the bar. Phones: full screen. */
.sheet {
  position: fixed; z-index: 2; right: 16px; bottom: calc(var(--player-h) + 12px); display: flex; flex-direction: column;
  width: 420px; max-width: calc(100vw - 32px); max-height: min(70vh, 640px); overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / .6);
  opacity: 0; visibility: hidden; transform: translateY(16px);
  transition: opacity .25s, transform .25s, visibility 0s .25s;
}
.sheet.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity .25s, transform .25s; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 0 16px; }
.sheet__heading { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.stage { position: relative; aspect-ratio: 16 / 9; margin: 8px 12px 0; border-radius: 12px; overflow: hidden; background: #000; }
.stage__video, .stage__cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.stage__video { visibility: hidden; }
.player[data-type="video"] .stage__video { visibility: visible; object-fit: contain; }
.player[data-type="video"] .stage__cover, .player[data-type="video"] .stage__fallback { display: none; }
.stage__fallback { position: absolute; inset: 0; display: grid; place-items: center; font-size: 56px; color: var(--indigo-400); background: rgb(49 46 129 / .4); }
.sheet__now { display: grid; padding: 12px 16px 0; }
.sheet__title { font-size: 16px; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet__artist { font-size: 14px; color: var(--muted); }
.sheet__controls { display: none; padding: 8px 16px 0; }

.queue { display: flex; flex: 1; flex-direction: column; min-height: 0; margin-top: 12px; border-top: 1px solid var(--line); }
.queue__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 6px 16px; }
.queue__title { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.queue__count { color: var(--faint); font-weight: 400; }
.queue__actions { display: flex; gap: 2px; }
.queue__list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 8px; overscroll-behavior: contain; }
.qrow { position: relative; display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 10px; }
.qrow.is-current { background: rgb(79 70 229 / .2); }
.qrow.is-dragging { z-index: 2; background: var(--slate-800); box-shadow: 0 10px 25px rgb(0 0 0 / .5); }
.qrow.is-bad .qrow__text strong { color: var(--red); text-decoration: line-through; }
.qrow__grip, .qrow__remove { display: grid; place-items: center; flex: none; width: 32px; height: 40px; border-radius: 8px; color: var(--faint); font-size: 18px; }
.qrow__grip { touch-action: none; cursor: grab; }
.qrow__grip:hover, .qrow__remove:hover { color: #fff; background: var(--slate-800); }
.qrow__main { display: flex; align-items: center; flex: 1; gap: 10px; min-width: 0; padding: 0 4px; border-radius: 8px; text-align: left; }
.qrow__main .thumb { width: 40px; height: 40px; font-size: 16px; }
.qrow__text { display: grid; min-width: 0; }
.qrow__text strong { font-size: 14px; font-weight: 500; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrow__text span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrow.is-current .qrow__text strong { color: var(--indigo-300); }

@media (max-width: 767px) {
  .bar { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding-inline: 12px; }
  .bar__progress { display: block; }
  .bar__center .seek--bar, .bar__center [data-ctl="prev"], .bar__right { display: none; }
  .bar__center { justify-items: end; }

  .sheet {
    inset: 0; width: auto; max-width: none; max-height: none; border: 0; border-radius: 0;
    padding-top: env(safe-area-inset-top); transform: translateY(100%); opacity: 1;
  }
  .sheet.is-open { transform: none; }
  /* A square cover sized by height (auto side margins stop a flex child stretching, so width must follow the height). */
  .stage { aspect-ratio: 1 / 1; height: min(36vh, calc(100vw - 24px)); width: auto; margin-inline: auto; }
  .player[data-type="video"] .stage { aspect-ratio: 16 / 9; width: calc(100% - 24px); height: auto; }
  .sheet__now { text-align: center; }
  .sheet__controls { display: grid; gap: 4px; }
  .sheet__controls .transport { gap: 20px; }
  .sheet__controls .volume { justify-content: center; }
  .sheet__controls .volume .range { max-width: 220px; }
  .sheet__controls .seek { max-width: none; }
}

/* ----------------------------------------------------------------- toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 70; max-width: min(90vw, 420px); padding: 10px 16px;
  border-radius: 10px; background: var(--slate-800); border: 1px solid var(--slate-700); color: #fff; font-size: 14px;
  box-shadow: 0 10px 25px rgb(0 0 0 / .5); text-align: center;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
body.has-player .toast { bottom: calc(var(--player-h) + env(safe-area-inset-bottom) + 16px); }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Page navigation progress (nav.js): a thin bar that appears only if a page is slow to arrive. */
html.is-navigating::before {
  content: ""; position: fixed; top: 0; left: 0; z-index: 100; height: 3px; width: 100%;
  background: linear-gradient(90deg, var(--purple-500), var(--indigo-400)); transform-origin: left;
  animation: nav-progress 1.2s ease-out forwards;
}

/* ---------------------------------------------------------------- motion */
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes row-in { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: none; } }
@keyframes bounce { 0%, 100% { transform: translateY(-25%); } 50% { transform: none; } }
@keyframes nav-progress { from { transform: scaleX(.05); } to { transform: scaleX(.9); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .card:hover { transform: none; }
  .card:hover .card__media > img { transform: none; }
}
