:root {
  --bg: #f3f4fb; --card: #ffffff; --text: #151625; --muted: #6a6f89; --line: #e4e6f1;
  --chip: #eef0fa; --chip-hover: #e3e6f6;
  --accent: #5b4bdb; --accent-2: #8b3fe0; --accent-text: #ffffff; --err: #c0392b;
  --shadow: 0 1px 2px rgba(30, 30, 80, .06), 0 8px 24px rgba(30, 30, 80, .06);
  --glow: radial-gradient(60rem 28rem at 50% -8rem, rgba(110, 90, 240, .16), transparent 70%);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0e17; --card: #171828; --text: #eceefa; --muted: #9a9eb8; --line: #272942;
    --chip: #222440; --chip-hover: #2c2f54;
    --accent: #8b7bff; --accent-2: #b266ff; --accent-text: #0d0e17; --err: #ff8a7a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
    --glow: radial-gradient(60rem 28rem at 50% -8rem, rgba(130, 100, 255, .22), transparent 70%);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; color: var(--text); background: var(--glow), var(--bg); background-repeat: no-repeat; min-height: 100vh;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif; -webkit-font-smoothing: antialiased;
}
main { max-width: 560px; margin: 0 auto; padding: 20px 16px 48px; }

.top { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 18px; }
.top.center { justify-content: center; }
h1 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; }
h1 span { overflow-wrap: anywhere; }
.logo { border-radius: 9px; flex: none; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin: 0 0 14px;
  box-shadow: var(--shadow);
}
.label {
  margin: 0 0 10px; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: var(--muted);
  display: flex; align-items: center; gap: 8px;
}
.muted { color: var(--muted); margin: 8px 0 0; font-size: .92rem; }
.err { color: var(--err) !important; }
.center { text-align: center; }
.notice {
  margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; font-size: .92rem;
  background: color-mix(in srgb, var(--err) 12%, var(--card)); color: var(--err); border: 1px solid color-mix(in srgb, var(--err) 30%, var(--line));
}

/* now playing */
.hero {
  position: relative; overflow: hidden; padding: 22px 20px 20px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 14%, var(--card)), color-mix(in srgb, var(--accent-2) 9%, var(--card)));
}
.title {
  margin: 4px 0 2px; font-size: clamp(1.15rem, 4.6vw, 1.5rem); line-height: 1.25; font-weight: 700; letter-spacing: -.01em;
  overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.sub { margin: 0; color: var(--muted); font-size: .92rem; overflow-wrap: anywhere; }
.progress { margin-top: 18px; }
.times { display: flex; justify-content: space-between; margin-top: 6px; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
progress { display: block; width: 100%; height: 6px; border: 0; border-radius: 99px; overflow: hidden; appearance: none; -webkit-appearance: none; background: var(--line); }
progress::-webkit-progress-bar { background: var(--line); border-radius: 99px; }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; }
progress::-moz-progress-bar { background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; }

.controls { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px 14px; margin-top: 18px; }
.grp { display: flex; align-items: center; gap: 8px; }
.ctl {
  display: grid; place-items: center; width: 52px; height: 52px; padding: 0; border: 0; border-radius: 50%;
  background: var(--chip); color: var(--text); cursor: pointer; transition: transform .12s, background .12s, opacity .12s;
}
.ctl svg { width: 26px; height: 26px; fill: currentColor; display: block; }
.ctl:hover:not(:disabled) { background: var(--chip-hover); transform: scale(1.06); }
.ctl:active:not(:disabled) { transform: scale(.96); }
.ctl.main { width: 68px; height: 68px; color: var(--accent-text); background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 45%, transparent); }
.ctl.main:hover:not(:disabled) { background: linear-gradient(135deg, var(--accent), var(--accent-2)); filter: brightness(1.08); }
.ctl.main svg { width: 32px; height: 32px; }
.ctl.main span { display: grid; place-items: center; }
.ctl:disabled { opacity: .35; cursor: default; box-shadow: none; }
.hero .muted { min-height: 1.4em; }

/* equaliser, only while playing */
.eq { position: absolute; right: 18px; top: 18px; display: flex; align-items: flex-end; gap: 3px; height: 18px; opacity: .55; }
.eq span { width: 3px; height: 4px; border-radius: 2px; background: var(--accent); }
.hero.playing .eq span { animation: eq 1s ease-in-out infinite; }
.hero.playing .eq span:nth-child(2) { animation-delay: -.3s; }
.hero.playing .eq span:nth-child(3) { animation-delay: -.6s; }
.hero.playing .eq span:nth-child(4) { animation-delay: -.15s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 18px; } }
@media (prefers-reduced-motion: reduce) { .hero.playing .eq span { animation: none; height: 10px; } .ctl { transition: none; } }

/* forms */
form#add { display: flex; gap: 8px; }
input[type=text], input[type=password], input[type=number] {
  flex: 1; width: 100%; min-width: 0; height: 46px; padding: 0 14px; font: inherit; color: inherit;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; outline: none; transition: border-color .12s, box-shadow .12s;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
::placeholder { color: var(--muted); opacity: .8; }
button { font: inherit; }
button.primary {
  height: 46px; padding: 0 20px; border: 0; border-radius: 12px; font-weight: 600; cursor: pointer; color: var(--accent-text);
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); transition: filter .12s, transform .12s;
}
button.primary:hover:not(:disabled) { filter: brightness(1.08); }
button.primary:active:not(:disabled) { transform: scale(.98); }
button.primary:disabled { opacity: .55; cursor: default; }
button.ghost { background: none; border: 0; color: var(--muted); padding: 6px 10px; border-radius: 8px; cursor: pointer; }
button.ghost:hover { color: var(--text); background: var(--chip); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.login { max-width: 380px; margin: 0 auto; }
.login label { display: block; margin-bottom: 8px; font-weight: 600; font-size: .92rem; }
.login button.primary { width: 100%; margin-top: 14px; }

/* queue */
.pill { padding: 1px 8px; border-radius: 99px; font-size: .72rem; letter-spacing: 0; background: var(--chip); color: var(--text); }
.queue { list-style: none; margin: 0; padding: 0; }
.queue li { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.queue li:last-child { border-bottom: 0; padding-bottom: 0; }
.queue li:first-child { padding-top: 2px; }
.queue .n { color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; font-size: .9rem; }
.queue .t { display: flex; flex-direction: column; min-width: 0; }
.queue .name { overflow-wrap: anywhere; line-height: 1.3; }
.queue .by { color: var(--muted); font-size: .8rem; }
.queue .dur { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
#empty { margin-top: 0; }
main:has(.login) { padding-top: 14vh; }

/* accounts, admin tools, settings */
.who { margin-left: auto; margin-right: 6px; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; text-align: right; }
.small { font-size: .82rem; }
.login label.second { margin-top: 14px; }
.login .muted b { color: var(--text); }
code { padding: 1px 5px; border-radius: 6px; background: var(--chip); font-size: .85em; }

.tools { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.tools .vol { flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: .85rem; color: var(--muted); }
.tools .vol b { color: var(--text); font-weight: 600; }
input[type=range] { width: 100%; accent-color: var(--accent); }

.queue li.admin { grid-template-columns: 26px 24px 1fr auto 32px; gap: 8px; }
.rm { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.rm:hover { background: var(--chip); color: var(--err); }

details > summary { cursor: pointer; list-style: none; margin-bottom: 0; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: "\25be"; margin-left: auto; transition: transform .15s; }
details[open] > summary { margin-bottom: 8px; }
details[open] > summary::after { transform: rotate(180deg); }
.settings { display: grid; gap: 14px; margin: 14px 0; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .9rem; }
.field.check { grid-template-columns: auto 1fr; align-items: center; }
.field.check .help { grid-column: 1 / -1; }
.field input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
.field select { height: 46px; padding: 0 12px; font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.help { color: var(--muted); font-size: .8rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* drag handle, picker, seek bar */
.grip { width: 26px; height: 32px; padding: 0; border: 0; background: none; color: var(--muted); cursor: grab; touch-action: none; user-select: none; font-size: 1rem; letter-spacing: -3px; border-radius: 8px; }
.grip:hover { background: var(--chip); color: var(--text); }
.grip:active { cursor: grabbing; }
.queue li.dragging { background: var(--chip); border-radius: 10px; box-shadow: var(--shadow); opacity: .92; }
body[data-role="admin"] #progress { cursor: pointer; }
body[data-role="admin"] #progress progress { height: 8px; }
.choices { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.choices p { margin: 0 0 8px; }
.choicelist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.choice { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 10px 12px; font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.choice:hover:not(:disabled) { border-color: var(--accent); background: var(--chip); }
.choice:disabled { opacity: .5; cursor: default; }
.choice .name { overflow-wrap: anywhere; line-height: 1.3; }
.choice .by { color: var(--muted); font-size: .8rem; }
.tools { flex-wrap: wrap; }
.ctl.sm { width: 38px; height: 38px; background: none; color: var(--muted); }
.ctl.sm svg.line { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ctl.sm:hover:not(:disabled) { color: var(--text); background: var(--chip); }
.ctl.sm.on { color: var(--text); background: var(--chip-hover); }
.volbox { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.volbox svg.line { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.volbox { gap: 6px; }
.volbox input { width: 76px; }
.volbox b { display: none; }
.tools.end { justify-content: center; border-top: 0; margin-top: 6px; padding-top: 0; }

/* soundboard */
.sfxgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; margin-top: 12px; }
.sfx { min-height: 52px; padding: 8px 10px; font: inherit; font-weight: 600; color: var(--text); background: var(--chip); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; overflow-wrap: anywhere; line-height: 1.2; transition: transform .08s, background .12s, border-color .12s; }
.sfx:hover { background: var(--chip-hover); border-color: var(--accent); }
.sfx:active, .sfx.hit { transform: scale(.95); background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-text); border-color: transparent; }
#sfxcard details { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.sfxlist { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 4px; }
.sfxlist li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.sfxlist .n { font-weight: 600; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sfxlist .m { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.sfxform { display: grid; gap: 12px; }
.sfxform h3 { margin: 0; }
.sfxform .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sfxform .three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.sfxform .field input { width: 100%; min-width: 0; }
.sfxform .help { margin: 0; }
@media (max-width: 420px) { .sfxform .two, .sfxform .three { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .sfx { transition: none; } }

/* album art, nav, people, activity, stats */
.herorow { display: flex; align-items: center; gap: 16px; }
.herotext { min-width: 0; flex: 1; }
.art { width: 96px; height: 96px; object-fit: cover; border-radius: 14px; flex: none; box-shadow: var(--shadow); background: var(--chip); }
.art[hidden] { display: none; }
@media (max-width: 420px) { .art { width: 72px; height: 72px; } }
.thumb { width: 56px; height: 32px; object-fit: cover; border-radius: 6px; background: var(--chip); }
.thumb.blank { visibility: hidden; }
.queue li { grid-template-columns: 28px 56px 1fr auto; }
.queue li.admin { grid-template-columns: 26px 24px 56px 1fr auto 32px; }
.choice { display: grid; grid-template-columns: 56px 1fr; column-gap: 12px; row-gap: 2px; align-items: center; }
.choice .thumb { grid-row: span 2; }
.navlink { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .95rem; }
.navlink:hover { color: var(--text); background: var(--chip); }
.peoplelist, .actlist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; }
.peoplelist li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.peoplelist li.blocked .n { text-decoration: line-through; opacity: .7; }
.peoplelist .who2 { display: flex; flex-direction: column; min-width: 0; }
.peoplelist .n { font-weight: 600; overflow-wrap: anywhere; }
.peoplelist .m { color: var(--muted); font-size: .78rem; }
.peoplelist .btns { display: flex; gap: 2px; flex-wrap: wrap; }
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #34c759; }
.actlist li { display: grid; grid-template-columns: 7.5em 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .88rem; align-items: baseline; }
.actlist .when { color: var(--muted); font-size: .78rem; }
.actlist .what { overflow-wrap: anywhere; }
.actlist li.sounds .what b { color: var(--accent); }
@media (max-width: 420px) { .actlist li { grid-template-columns: 1fr; gap: 0; } }
.row.between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--chip); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; color: var(--muted); font: inherit; font-size: .85rem; padding: 5px 10px; border-radius: 8px; cursor: pointer; }
.seg button.on { background: var(--bg); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 12px; }
.tile { background: var(--chip); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.tile b { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: .8rem; }
.rank { list-style: none; margin: 8px 0 0; padding: 0; }
.rank li { display: grid; grid-template-columns: 26px auto 1fr auto; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rank li:last-child { border-bottom: 0; }
.rank li:not(:has(.thumb)) { grid-template-columns: 26px 1fr auto; }
.rank .n { color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.rank .t { overflow-wrap: anywhere; line-height: 1.3; min-width: 0; }
.rank .dur { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; margin-top: 12px; }
.bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.bars .bar { width: 100%; background: linear-gradient(180deg, var(--accent), var(--accent-2)); border-radius: 4px 4px 0 0; }
.bars .lab { font-size: .65rem; color: var(--muted); height: 1em; }
