/* Kunden-Player – dunkel wie ein Musik-Player, Akzent = Farbe des Künstlers (--accent) */
:root {
  --accent: #8b5cff;
  --bg: #0b0b0e;
  --text: #fff;
  --dim: rgba(255, 255, 255, .62);
  --faint: rgba(255, 255, 255, .38);
  --line: rgba(255, 255, 255, .1);
  --glass: rgba(255, 255, 255, .08);
  --glass-hi: rgba(255, 255, 255, .14);
  --radius: 18px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
html, body { margin: 0; min-height: 100%; color: var(--text); font: 15px/1.4 var(--font); -webkit-font-smoothing: antialiased; }
body { overflow-x: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
svg { display: block; }

#bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(120% 70% at 50% -10%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 70%),
    radial-gradient(90% 60% at 100% 100%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 30%, #111) 0%, var(--bg) 62%);
  transition: background .6s ease;
}

#app { max-width: 1120px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); min-height: 100dvh; }

.loading { min-height: 80dvh; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--glass-hi); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fade-in { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Cover ---------- */
.cover {
  position: relative; aspect-ratio: 1; width: 100%; border-radius: 14px; overflow: hidden;
  background:
    radial-gradient(80% 80% at 20% 15%, color-mix(in srgb, var(--accent) 85%, #fff 15%), transparent 60%),
    radial-gradient(90% 90% at 90% 100%, color-mix(in srgb, var(--accent) 60%, #000), transparent 70%),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 70%, #000), #0d0d10);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .06);
  display: grid; place-items: center;
}
.cover .glyph { width: 46%; opacity: .92; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .35)); }
.cover .initials { position: absolute; left: 7%; bottom: 6%; font-weight: 800; letter-spacing: -.02em; font-size: clamp(14px, 4vw, 20px); opacity: .75; }

/* ---------- Sperre ---------- */
.lock { min-height: 80dvh; display: grid; place-items: center; }
.lock-card { width: min(380px, 100%); text-align: center; padding: 28px 22px; border-radius: 26px; background: var(--glass); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); border: 1px solid var(--line); }
.lock-card .icon { width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center; background: var(--glass-hi); }
.lock-card h1 { font-size: 21px; margin: 0 0 4px; }
.lock-card p { color: var(--dim); margin: 0 0 18px; }
.field { width: 100%; height: 48px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, .3); padding: 0 14px; outline: none; transition: border-color .2s; }
.field:focus { border-color: color-mix(in srgb, var(--accent) 70%, #fff); }
.btn-primary { height: 48px; border-radius: 999px; background: #fff; color: #000; font-weight: 650; padding: 0 22px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .15s, opacity .2s; }
.btn-primary:active { transform: scale(.97); }
.btn-primary[disabled] { opacity: .45; }
.lock-card .btn-primary { width: 100%; margin-top: 10px; }
.error { color: #ff6b6b; font-size: 13px; min-height: 18px; margin-top: 8px; }

/* ---------- Album / Künstler ---------- */
.collection { max-width: 760px; margin: 0 auto; }
.collection header { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 18px 0 8px; }
.collection header .cover { width: min(270px, 70vw); margin-bottom: 12px; }
.collection h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.collection .by { font-size: 19px; color: var(--dim); }
.collection .details { font-size: 13px; font-weight: 600; color: var(--faint); }
.collection .actions { display: flex; gap: 14px; align-items: center; justify-content: center; margin: 14px 0 6px; }
.circle { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--glass-hi); transition: background .2s, transform .15s; }
.circle:hover { background: rgba(255, 255, 255, .2); }
.circle:active { transform: scale(.94); }
.tracks { margin-top: 10px; border-top: 1px solid var(--line); }
.track { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 11px 6px; border-bottom: 1px solid var(--line); border-radius: 10px; transition: background .15s; }
.track:hover { background: rgba(255, 255, 255, .05); }
.track .no { color: var(--faint); font-variant-numeric: tabular-nums; text-align: center; }
.track .t { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .s { font-size: 12.5px; color: var(--dim); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.track .d { color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; }
.track.playing .t, .track.playing .no { color: color-mix(in srgb, var(--accent) 50%, #fff); }
.eq { display: inline-flex; gap: 2px; height: 12px; align-items: flex-end; }
.eq i { width: 3px; background: currentColor; border-radius: 1px; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; } .eq i:nth-child(3) { animation-delay: -.6s; }
.paused .eq i { animation-play-state: paused; }
@keyframes eq { 0%, 100% { height: 30%; } 50% { height: 100%; } }

.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--glass-hi); font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c, #fff); }

/* ---------- Player ---------- */
.player { display: grid; gap: 28px; grid-template-columns: minmax(0, 470px); justify-content: center; }
@media (min-width: 940px) { .player { grid-template-columns: minmax(0, 470px) minmax(0, 1fr); align-items: start; } .side { position: sticky; top: 20px; } }
.topbar { position: relative; display: flex; align-items: center; justify-content: space-between; height: 40px; margin-bottom: 4px; }
/* Status bewusst klein und ruhig – nur Info, kein Blickfang */
.status-pill { position: absolute; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--glass); color: var(--dim); font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 6px var(--c); }
.topbar .back { display: inline-flex; align-items: center; gap: 4px; color: var(--dim); font-weight: 600; padding: 6px 8px 6px 0; }
.topbar .back:hover { color: #fff; }
.topbar .right { display: flex; gap: 8px; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--dim); background: var(--glass); transition: color .2s, background .2s, transform .15s; }
.icon-btn:hover { color: #fff; background: var(--glass-hi); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.on { color: #000; background: #fff; }

.stage { position: relative; width: min(100%, 42vh); margin: 4px auto 0; }
@media (max-width: 520px) { .stage { width: 100%; } }
.stage .cover { transition: transform .5s cubic-bezier(.2, .8, .2, 1.1); }
.stage.paused .cover { transform: scale(.82); }
.title-row { display: flex; align-items: center; gap: 12px; margin-top: 24px; }
.title-row .names { flex: 1; min-width: 0; }
.title-row h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-row .artist { font-size: 20px; color: rgba(255, 255, 255, .65); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Versionen-Stapel (wie Samply): ein Knopf, Wechsel an derselben Stelle */
.stack-btn { position: relative; width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, .14); transition: background .2s, transform .15s; }
.stack-btn:hover { background: rgba(255, 255, 255, .22); }
.stack-btn:active { transform: scale(.94); }
.stack-btn.on { background: #fff; color: #000; }
.stack-btn .badge { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #fff; color: #000; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.stack-btn.on .badge { background: var(--accent); color: #fff; }
.sheet-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 30; animation: fade .2s ease both; }
.vsheet { position: fixed; z-index: 31; left: 50%; bottom: 24px; transform: translateX(-50%); width: min(420px, calc(100vw - 32px)); max-height: min(70vh, 620px); display: flex; flex-direction: column; border-radius: 22px; background: rgba(28, 28, 32, .82); backdrop-filter: blur(30px) saturate(1.4); -webkit-backdrop-filter: blur(30px) saturate(1.4); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, .55); animation: rise .28s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 24px); } to { opacity: 1; transform: translate(-50%, 0); } }
.vhead { display: flex; align-items: center; gap: 10px; padding: 18px 16px 12px 20px; }
.vhead > div { flex: 1; min-width: 0; }
.vhead h3 { margin: 0; font-size: 17px; }
.vhead p { margin: 2px 0 0; font-size: 12px; color: var(--faint); }
.ab { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .25); font-size: 12.5px; font-weight: 800; letter-spacing: .04em; color: #fff; flex: none; }
.ab:hover { background: var(--glass); }
.vstack { list-style: none; margin: 0; padding: 0 8px 10px; overflow: auto; }
.vstack li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; cursor: pointer; transition: background .15s; }
.vstack li:hover { background: var(--glass); }
.vstack li.on { background: rgba(255, 255, 255, .12); }
.vstack .n { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--glass-hi); font-size: 12.5px; font-weight: 800; color: var(--dim); }
.vstack li.on .n { background: #fff; color: #000; }
.vstack .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vstack .txt b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vstack .txt small { font-size: 12px; color: var(--faint); }
.vstack .cnt { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--dim); }
.vstack .cnt svg { width: 14px; height: 14px; }
.vstack .eq { height: 14px; }
.vstack .eq:not(.live) i { animation-play-state: paused; }
@media (max-width: 520px) {
  .vsheet { left: 0; right: 0; bottom: 0; width: auto; transform: none; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); animation-name: rise-m; }
  @keyframes rise-m { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
}

/* Wellenform */
.wave-wrap { position: relative; margin-top: 20px; height: 62px; cursor: pointer; touch-action: none; }
.wave-wrap canvas { width: 100%; height: 100%; }
.marker { position: absolute; top: -4px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); box-shadow: 0 2px 6px rgba(0, 0, 0, .4); transition: transform .15s; z-index: 2; }
.marker.studio { background: var(--accent); border-color: #fff; }
.marker:hover { transform: scale(1.35); }
.tip { position: absolute; bottom: calc(100% + 8px); transform: translateX(-50%); max-width: 240px; padding: 8px 10px; border-radius: 10px; background: rgba(20, 20, 24, .96); border: 1px solid var(--line); font-size: 12.5px; pointer-events: none; z-index: 5; white-space: normal; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.tip b { display: block; font-size: 11px; color: var(--faint); margin-bottom: 2px; }
.times { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--faint); font-variant-numeric: tabular-nums; }
.times .q { display: inline-flex; align-items: center; gap: 4px; color: var(--dim); font-size: 12px; font-weight: 650; }
.times .q button { padding: 3px 8px; border-radius: 999px; transition: color .2s, background .2s; }
.times .q button:hover { color: #fff; background: var(--glass); }
.times .q .hq { display: inline-flex; align-items: center; gap: 5px; color: var(--faint); }
.times .q .hq.on { color: #fff; background: var(--glass-hi); }

.controls { display: flex; align-items: center; justify-content: space-between; margin: 18px 30px 0; }
.ctl { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 50%; transition: transform .15s, opacity .2s, background .2s; }
.ctl:hover { background: var(--glass); }
.ctl:active { transform: scale(.92); }
.ctl[disabled] { opacity: .3; cursor: default; background: none; }
.ctl svg { width: 34px; height: 34px; }
.ctl.play { width: 76px; height: 76px; }
.ctl.play svg { width: 50px; height: 50px; }
.ctl.small { color: var(--dim); }

.bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 22px; }
.pill-btn { height: 42px; padding: 0 20px; border-radius: 999px; background: var(--glass-hi); display: inline-flex; align-items: center; gap: 8px; font-weight: 650; transition: background .2s, transform .15s; }
.pill-btn:hover { background: rgba(255, 255, 255, .2); }
.pill-btn:active { transform: scale(.97); }
.pill-btn.approve { background: color-mix(in srgb, #30d158 26%, transparent); color: #b7f5c6; }
.pill-btn.approve.done { background: #30d158; color: #00230b; }

/* Kommentare */
.side { min-width: 0; }
.side-card { border-radius: 22px; background: rgba(0, 0, 0, .22); border: 1px solid var(--line); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); padding: 16px; }
.side-card h2 { margin: 0; font-size: 17px; }
.side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.filters { display: flex; gap: 6px; }
.filters button { height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 650; color: var(--dim); background: var(--glass); }
.filters button.on { background: #fff; color: #000; }
.comments { display: grid; gap: 8px; }
.comment { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, .04); transition: background .15s; }
.comment:hover { background: rgba(255, 255, 255, .07); }
.comment.resolved { opacity: .55; }
.comment.resolved .text { text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, .4); }
.time-chip { height: 24px; min-width: 46px; padding: 0 8px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 35%, transparent); color: #fff; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; display: inline-grid; place-items: center; }
.time-chip.none { background: var(--glass); color: var(--faint); }
.comment .who { font-size: 12px; color: var(--faint); display: flex; gap: 6px; flex-wrap: wrap; }
.comment .who b { color: var(--dim); font-weight: 650; }
.comment .text { margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment .del { color: var(--faint); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.comment .del:hover { color: #fff; background: var(--glass); }
.badge-ok { color: #30d158; display: inline-flex; align-items: center; gap: 4px; font-weight: 650; }
.empty { color: var(--faint); text-align: center; padding: 26px 10px; font-size: 14px; }

/* Kommentar schreiben */
.composer { margin-top: 12px; border-radius: 18px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); padding: 10px; display: grid; gap: 8px; animation: fade .2s ease both; }
.composer textarea { width: 100%; min-height: 64px; resize: vertical; border: 0; outline: none; background: transparent; padding: 4px 4px 0; }
.composer .row { display: flex; align-items: center; gap: 8px; }
.composer .row .grow { flex: 1; }
.composer .name { height: 34px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0, 0, 0, .25); padding: 0 10px; outline: none; width: 150px; }
.at { height: 30px; padding: 0 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 35%, transparent); font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.at.off { background: var(--glass); color: var(--faint); }
.send { height: 34px; padding: 0 16px; border-radius: 999px; background: #fff; color: #000; font-weight: 700; }
.send[disabled] { opacity: .4; }

.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); background: rgba(30, 30, 34, .96); border: 1px solid var(--line); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; box-shadow: 0 14px 40px rgba(0, 0, 0, .5); z-index: 50; animation: fade .25s ease both; }

.foot { text-align: center; color: var(--faint); font-size: 12px; margin-top: 34px; }

@media (max-width: 520px) {
  #app { padding-left: 20px; padding-right: 20px; }
  .ctl.play { width: 70px; height: 70px; }
  .bottom .pill-btn { padding: 0 16px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
