/* ---------- Schriften (selbst gehostet, offline verfügbar) ---------- */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800; font-display: swap;
}

/* ---------- Farben: dunkler "Bühnen"-Look als Standard ---------- */
:root {
  --bg: #0f0d0b;
  --surface: #1a1714;
  --surface-2: #24201b;
  --surface-3: #312b24;
  --text: #f5efe6;
  --muted: #a69c8e;
  --line: #2e2923;
  --accent: #ff9f43;
  --accent-ink: #1c1006;
  --accent-soft: rgba(255, 159, 67, .14);
  --wave: #6e6254;
  --ok: #4ade80;
  --warn: #facc15;
  --danger: #f87171;
  --glow: 0 10px 40px -6px rgba(255, 159, 67, .55);
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 10px 30px -10px rgba(0,0,0,.6);
  --stage: radial-gradient(900px 480px at 15% -12%, rgba(255, 159, 67, .13), transparent 65%),
           radial-gradient(700px 420px at 100% 0%, rgba(255, 120, 60, .07), transparent 60%);
  --radius: 16px;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f2ea;
  --surface: #ffffff;
  --surface-2: #efe9de;
  --surface-3: #e4dccd;
  --text: #1c1712;
  --muted: #6f6557;
  --line: #e3dbcd;
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --accent-soft: #fbe6d9;
  --wave: #c4b7a1;
  --ok: #15803d;
  --warn: #a16207;
  --danger: #b91c1c;
  --glow: 0 10px 30px -8px rgba(194, 65, 12, .45);
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 10px 30px -12px rgba(60,40,10,.18);
  --stage: radial-gradient(900px 480px at 15% -12%, rgba(194, 65, 12, .08), transparent 65%);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background: var(--stage), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg .fill, svg.fill { fill: currentColor; stroke: none; }
h1, h2, .display { font-family: var(--font-display); letter-spacing: -.02em; }
h1 { font-size: clamp(30px, 6vw, 44px); line-height: 1.05; font-weight: 750; margin: 10px 0 8px; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); font-size: 14px; margin: 4px 0; }
.empty { color: var(--muted); padding: 24px 0; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
kbd { font-family: var(--font-mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; font-size: 11px; color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Layout ---------- */
.layout { min-height: 100vh; }
.view { max-width: 820px; margin: 0 auto; padding: calc(12px + var(--safe-t)) 16px calc(110px + var(--safe-b)); }
.only-desktop { display: none; }

@media (min-width: 960px) {
  .layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; }
  .view { width: 100%; padding: 20px 32px 48px; }
  .player { position: sticky; top: 0; height: 100vh; border-left: 1px solid var(--line); }
  .grab, .p-close, .p-cover-wrap, .mini { display: none !important; }
  .only-desktop { display: inline-block; }
}

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.brand img { width: 32px; height: 32px; border-radius: 9px; box-shadow: var(--glow); }
.back { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; color: var(--accent); font-weight: 600; padding: 8px 0; }
.desc { color: var(--muted); margin: 0 0 8px; }

/* ---------- Buttons & Badges ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 8px 18px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); font-weight: 600; text-decoration: none;
  transition: transform .15s var(--ease), border-color .15s, background .15s, box-shadow .2s;
}
.btn:hover { border-color: var(--muted); }
.btn:active, .icon-btn:active, .marker:active, .card:active, .restart:active { transform: scale(.97); }
.btn:disabled { opacity: .8; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: var(--glow); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 34px; padding: 4px 12px; font-size: 14px; }
.muted-in { color: var(--muted); font-weight: 400; font-size: 14px; }
.btn.primary .muted-in { color: inherit; opacity: .8; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.badge svg { width: 16px; height: 16px; }
.badge.ok { color: var(--ok); }
.badge.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border: 0; border-radius: 999px; background: transparent; color: var(--text); text-decoration: none;
  transition: background .15s, transform .15s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.small { width: 36px; height: 36px; color: var(--muted); }
.icon-btn.txt { font-family: var(--font-mono); font-weight: 600; font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px 0 20px; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.view.anim .card, .view.anim .track { animation: fadeUp .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms); }

/* ---------- Playlist-Karten ---------- */
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); margin-top: 16px; }
.card {
  display: flex; flex-direction: column; gap: 12px; padding: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  text-decoration: none; transition: transform .2s var(--ease), border-color .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); box-shadow: var(--shadow); }
.card-cover { width: 100%; aspect-ratio: 1; border-radius: 14px; display: block; box-shadow: var(--shadow); }
.card-body { display: flex; flex-direction: column; gap: 4px; padding: 0 4px 4px; flex: 1; }
.card-title { font-family: var(--font-display); font-weight: 700; font-size: 18px; line-height: 1.2; }
.card-desc { color: var(--muted); font-size: 14px; }
.card-meta { margin-top: auto; padding-top: 4px; display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 13px; }
.dot-ok { color: var(--ok); font-weight: 600; }
.dot-ok::before { content: "● "; }

.install, .storage {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 16px; padding: 16px 18px; border-radius: var(--radius); font-size: 15px;
}
.install { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.storage { justify-content: flex-start; flex-wrap: nowrap; align-items: flex-start; margin-top: 32px; background: var(--surface); border: 1px solid var(--line); }
.storage svg { color: var(--accent); margin-top: 2px; }

/* ---------- Playlist-Ansicht ---------- */
.pl-hero { display: flex; align-items: flex-end; gap: 20px; margin-top: 12px; }
.pl-cover { width: clamp(112px, 26vw, 176px); aspect-ratio: 1; border-radius: 18px; box-shadow: var(--shadow), var(--glow); flex: none; }
.pl-info { min-width: 0; }
.pl-info h1 { margin: 4px 0 6px; overflow-wrap: anywhere; }

.tracks { list-style: none; margin: 0; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.track { display: flex; align-items: center; gap: 14px; padding: 8px 6px 8px 8px; cursor: pointer; border-radius: 14px; transition: background .15s; }
.track:hover { background: var(--surface-2); }
.track.active { background: var(--accent-soft); }
.track.active .t-title { color: var(--accent); }
.track.unavailable { opacity: .4; cursor: not-allowed; }
.t-cover { position: relative; width: 48px; height: 48px; flex: none; border-radius: 10px; overflow: hidden; }
.t-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.t-cover .eq { position: absolute; inset: 0; display: flex; justify-content: center; align-items: flex-end; gap: 3px; padding: 12px; background: rgba(0,0,0,.45); }
.t-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.t-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-sub { color: var(--muted); font-size: 13px; }
.eq i { width: 4px; background: var(--accent); height: 40%; border-radius: 2px; }
body.playing .eq i { animation: eq .9s infinite ease-in-out alternate; }
body.playing .eq i:nth-child(2) { animation-delay: -.3s; }
body.playing .eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { from { height: 20%; } to { height: 100%; } }

/* ---------- Player ---------- */
.player {
  background: var(--surface);
  padding: 20px 22px calc(28px + var(--safe-b));
  display: flex; flex-direction: column; gap: 26px;
  overflow-y: auto; overscroll-behavior: contain;
}
.p-main, .p-side { display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 959px) {
  .player {
    position: fixed; inset: 0; z-index: 30;
    background: var(--stage), var(--bg);
    transform: translateY(102%); transition: transform .38s var(--ease);
    padding-top: calc(8px + var(--safe-t));
  }
  body.player-open .player { transform: none; }
  body.player-open { overflow: hidden; }
  .p-cover-sm { display: none; }
}
.grab { width: 40px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 0 auto -10px; flex: none; }
.player-head { display: flex; align-items: center; gap: 12px; }
.player-head .p-close svg { width: 26px; height: 26px; }
.p-cover-sm { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; box-shadow: var(--shadow); flex: none; }
.p-meta { min-width: 0; flex: 1; }
.p-playlist { color: var(--accent); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player h2 { margin: 2px 0 0; font-size: 22px; line-height: 1.15; font-weight: 700; overflow-wrap: anywhere; }

.practice-btn {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); font-size: 13px; font-weight: 600;
  transition: transform .15s var(--ease), border-color .15s;
}
.practice-btn:hover { border-color: var(--accent); }
.practice-btn svg { width: 16px; height: 16px; }
.practice-btn .i-exit, .practice-btn .t-exit { display: none; }
body:not(.has-track) .practice-btn { opacity: .5; pointer-events: none; }

.p-cover-wrap { display: grid; place-items: center; padding: 4px 0; }
.p-cover {
  width: min(76vw, 34vh, 340px); aspect-ratio: 1; border-radius: 22px; object-fit: cover;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.7);
  transform: scale(.9); transition: transform .5s var(--ease), box-shadow .5s;
}
body.playing .p-cover { transform: none; box-shadow: 0 30px 60px -20px rgba(0,0,0,.7), var(--glow); }

.p-clock { display: none; flex-direction: column; gap: 4px; }
.clock-section { font-family: var(--font-display); font-weight: 750; font-size: clamp(24px, 3.4vw, 40px); line-height: 1.1; color: var(--accent); }
.clock-time { font-family: var(--font-mono); font-weight: 600; font-size: clamp(64px, 11vw, 150px); line-height: .95; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }

.wave { position: relative; height: 92px; cursor: pointer; touch-action: none; border-radius: 10px; }
.wave canvas { width: 100%; height: 100%; display: block; }
.times { display: flex; justify-content: space-between; color: var(--muted); font-family: var(--font-mono); font-size: 12px; margin-top: -10px; }

.controls { display: flex; align-items: center; justify-content: space-between; gap: 6px; max-width: 360px; width: 100%; margin: 0 auto; }
.controls .icon-btn { width: 52px; height: 52px; }
.play-btn {
  display: grid; place-items: center; width: 78px; height: 78px; border-radius: 50%; flex: none;
  border: 0; background: var(--accent); color: var(--accent-ink); box-shadow: var(--glow);
  transition: transform .15s var(--ease), box-shadow .3s;
}
.play-btn:hover { transform: scale(1.04); }
.play-btn:active { transform: scale(.94); }
.play-btn svg { width: 34px; height: 34px; }
.i-pause { display: none; }
body.playing .i-play { display: none; }
body.playing .i-pause { display: block; }

.section { display: flex; flex-direction: column; gap: 10px; }
.label { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.label .turtle { width: 20px; height: 20px; color: var(--accent); }
.speed-value { margin-left: auto; font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--muted); }
.speed-value.slow { color: var(--accent); }
.hint { color: var(--muted); font-size: 12px; margin-top: -4px; }
.toggle { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-family: system-ui, sans-serif; font-size: 14px; font-weight: 500; color: var(--muted); cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.switch { width: 36px; height: 22px; border-radius: 11px; background: var(--surface-3); position: relative; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text); transition: transform .25s var(--ease); }
.toggle input:checked + .switch { background: var(--accent); }
.toggle input:checked + .switch::after { transform: translateX(14px); background: var(--accent-ink); }
.toggle input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }

.speed { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface-2); border-radius: 14px; padding: 4px; }
.speed-thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 5);
  border-radius: 10px; background: var(--accent); box-shadow: var(--glow);
  transition: transform .35s cubic-bezier(.3, 1.3, .5, 1);
}
.speed button {
  position: relative; z-index: 1; border: 0; background: transparent; border-radius: 10px; padding: 11px 0;
  font-family: var(--font-mono); font-weight: 600; font-size: 14px; color: var(--muted); transition: color .2s;
}
.speed button.on { color: var(--accent-ink); }

.restart {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 13px 16px; border-radius: 14px; border: 1px dashed color-mix(in srgb, var(--accent) 60%, transparent);
  background: var(--accent-soft); text-align: left; transition: transform .15s var(--ease);
}
.restart span { flex: 1; min-width: 0; }
.restart svg { color: var(--accent); }
body:not(.has-track) .restart { opacity: .5; }

.markers { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.marker {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 12px 14px 14px; border-radius: 14px; text-align: left;
  border: 1px solid var(--line); background: var(--surface-2);
  transition: transform .15s var(--ease), border-color .2s, background .2s;
}
.marker:hover { border-color: var(--sec); }
.marker.enter { animation: fadeUp .4s var(--ease) both; animation-delay: calc(var(--i) * 40ms); }
.m-top { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; }
.m-top kbd { margin-left: auto; }
.m-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sec); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--sec) 25%, transparent); }
.m-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-time { color: var(--muted); font-size: 12px; }
.m-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; }
.m-bar i { display: block; height: 100%; width: 0; background: var(--sec); }
.marker.current { background: color-mix(in srgb, var(--sec) 16%, var(--surface-2)); border-color: var(--sec); }
.marker.start { box-shadow: inset 0 0 0 2px var(--sec); }

[hidden] { display: none !important; }

/* ---------- Tonart ---------- */
.pitch { display: flex; align-items: center; gap: 10px; }
.pitch-btn {
  width: 48px; height: 48px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2);
  font-size: 24px; font-weight: 500; line-height: 1; transition: transform .15s var(--ease), border-color .15s;
}
.pitch-btn:hover:not(:disabled) { border-color: var(--accent); }
.pitch-btn:active:not(:disabled) { transform: scale(.94); }
.pitch-btn:disabled { opacity: .35; cursor: default; }
.pitch-display { display: flex; flex-direction: column; align-items: center; min-width: 70px; }
.pitch-num { font-size: 26px; font-weight: 600; line-height: 1; }
.pitch-unit { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 3px; }
.pitch .btn { margin-left: auto; }

/* ---------- Gesangs-Crossfader ---------- */
.fader { --fx: .5; position: relative; padding: 6px 0 0; }
.fader input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 40px; background: transparent; margin: 0; cursor: pointer; touch-action: none;
}
.fader input[type=range]::-webkit-slider-runnable-track {
  height: 10px; border-radius: 5px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--surface-3) 50%, #a78bfa 100%);
}
.fader input[type=range]::-moz-range-track { height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--accent) 0%, var(--surface-3) 50%, #a78bfa 100%); }
.fader input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 30px; height: 30px; margin-top: -10px; border-radius: 9px;
  background: var(--text); border: 3px solid var(--surface); box-shadow: 0 4px 14px rgba(0,0,0,.45);
}
.fader input[type=range]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 9px; background: var(--text); border: 3px solid var(--surface); }
.fader::before { content: ""; position: absolute; left: 50%; top: 14px; width: 2px; height: 22px; margin-left: -1px; background: var(--muted); opacity: .5; pointer-events: none; }
.fader-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-weight: 600; margin-top: -2px; }
.fader.off { opacity: .4; }
.toggle.left { margin-left: 0; font-size: 13px; }

/* ---------- Songstruktur: Bearbeiten & eigene Cues ---------- */
.edit-btn {
  margin-left: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: transparent;
  font-family: system-ui, sans-serif; font-size: 12px; font-weight: 600; color: var(--muted);
}
.edit-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.own-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.own-title { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 700; font-size: 15px; margin-right: auto; }
.own-title svg { width: 18px; height: 18px; color: var(--muted); }
.marker.own { border-style: dashed; border-color: color-mix(in srgb, var(--text) 30%, transparent); background: transparent; }
.marker.own:hover { border-color: var(--text); }
.own-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px dashed var(--text); flex: none; }
.fchip {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; font-family: system-ui, sans-serif;
  font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-soft); vertical-align: 1px;
}
.mrow-edit {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; grid-column: 1 / -1;
  padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line);
}
.mrow-edit .m-name { flex: 1; min-width: 80px; }
.mrow-edit.own { border-style: dashed; }
.mrow-edit.own .field { flex: 1; min-width: 140px; width: auto; padding: 8px 10px; }
.mrow-edit .nudge { display: flex; gap: 4px; }
.mrow-edit .nudge button { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 8px; font-size: 12px; font-family: var(--font-mono); }
.fctl { display: flex; align-items: center; gap: 4px; }
.p-side.editing .markers { grid-template-columns: 1fr; }
.field { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); }
.field:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

/* ---------- Dialog, Hinweise, Teilen ---------- */
.dlg {
  width: min(460px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 22px; padding: 0;
  background: var(--surface); color: var(--text); box-shadow: 0 30px 80px -20px rgba(0,0,0,.7);
}
.dlg::backdrop { background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.dlg[open] { animation: fadeUp .3s var(--ease); }
#dlg-body { position: relative; padding: 22px; display: flex; flex-direction: column; gap: 12px; }
#dlg-body h2 { margin: 0; font-size: 22px; }
.dlg-close { position: absolute; top: 10px; right: 10px; }
.code-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.code-box .mono { font-size: 20px; font-weight: 600; color: var(--accent); overflow-wrap: anywhere; }
.code-box .share-url { font-size: 13px; }
.code-form { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.status { color: var(--muted); font-size: 14px; margin: 0; }
.status.ok { color: var(--ok); }
.status.err { color: var(--danger); }
.toast {
  position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); z-index: 100; transform: translate(-50%, 20px);
  padding: 10px 16px; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s var(--ease); max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.share-card { margin-top: 16px; padding: 22px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); }
.share-card h1 { margin: 6px 0 4px; }
.share-list { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 6px; }
.share-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.share-list li b { flex: 1; }

/* ---------- Übe-Modus (Notenständer) ---------- */
body.practice { overflow: hidden; }
body.practice .player {
  position: fixed; inset: 0; z-index: 50; height: auto; transform: none; border: 0;
  background: var(--stage), var(--bg);
  padding: calc(20px + var(--safe-t)) clamp(16px, 4vw, 48px) calc(24px + var(--safe-b));
  display: grid; grid-template-columns: 1fr; align-content: start; gap: 28px;
}
@media (orientation: landscape) and (min-width: 700px) {
  body.practice .player { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); }
}
body.practice .grab, body.practice .p-close, body.practice .p-cover-wrap, body.practice .p-cover-sm, body.practice .mini { display: none !important; }
body.practice .p-clock { display: flex; }
body.practice .practice-btn { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-size: 15px; padding: 10px 16px; }
body.practice .practice-btn .i-exit, body.practice .practice-btn .t-exit { display: inline; }
body.practice .practice-btn .i-enter, body.practice .practice-btn .t-enter { display: none; }
body.practice .wave { height: clamp(110px, 18vh, 170px); }
body.practice .controls { max-width: 460px; }
body.practice .controls .icon-btn { width: 64px; height: 64px; }
body.practice .play-btn { width: 104px; height: 104px; }
body.practice .play-btn svg { width: 44px; height: 44px; }
body.practice .speed button { padding: 16px 0; font-size: 17px; }
body.practice .restart { padding: 20px; font-size: 20px; }
body.practice .markers { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
body.practice .marker { min-height: 100px; padding: 16px 18px 18px; justify-content: space-between; }
body.practice .m-name { font-family: var(--font-display); font-size: clamp(20px, 2.4vw, 28px); font-weight: 700; }
body.practice .m-dot { width: 14px; height: 14px; }
body.practice .m-time { font-size: 15px; }
body.practice .m-bar { height: 5px; }

/* ---------- Mini-Player als schwebende Pille (Handy) ---------- */
.mini {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 20;
  max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 6px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 12px 40px -10px rgba(0,0,0,.6);
  text-align: left; animation: fadeUp .35s var(--ease);
}
.mini[hidden] { display: none; }
.mini-cover { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex: none; }
body.playing .mini-cover { animation: spin 14s linear infinite; }
.mini-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mini-title { font-weight: 650; overflow: hidden; white-space: nowrap; }
.mini-title span { display: inline-block; }
.mini-title.marquee span { animation: marquee var(--dur, 8s) ease-in-out infinite alternate; }
@keyframes marquee { 0%, 15% { transform: none; } 85%, 100% { transform: translateX(var(--dist)); } }
.mini-sub { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-speed { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 3px 8px; border-radius: 999px; flex: none; }
.mini-speed[hidden] { display: none; }
.mini-play { position: relative; display: grid; place-items: center; width: 50px; height: 50px; flex: none; color: var(--accent-ink); }
.mini-play::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--accent); }
.mini-play svg:not(.ring) { position: relative; width: 20px; height: 20px; }
.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring-bg { stroke: var(--surface-3); }
.ring-fg { stroke: var(--accent); stroke-dasharray: 138.23; stroke-dashoffset: 138.23; stroke-linecap: round; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Admin ---------- */
.adm { max-width: 980px; margin: 0 auto; padding: 16px 16px 64px; }
.adm .tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; margin: 12px 0 20px; width: fit-content; }
.adm .tabs button { border: 0; background: transparent; padding: 8px 18px; border-radius: 9px; font-weight: 600; }
.adm .tabs button.on { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.panel h2 { margin: 0 0 12px; font-size: 18px; }
.field { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.field:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 28px 16px; border: 2px dashed var(--line); border-radius: var(--radius);
  color: var(--muted); text-align: center; cursor: pointer;
}
.drop.over, .drop:hover { border-color: var(--accent); color: var(--text); }
.drop input { display: none; }
.uploads { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.uploads li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); width: 0; }
.rows { display: grid; gap: 0; }
.row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 180px; }
.row .meta { color: var(--muted); font-size: 13px; white-space: nowrap; }
.editor-now { font-size: 40px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.editor audio { width: 100%; }
.mrow { display: grid; grid-template-columns: auto minmax(120px, 1fr) 110px auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.mrow .nudge { display: flex; gap: 2px; }
.mrow .nudge button { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .mrow { grid-template-columns: auto 1fr 96px; }
  .mrow .nudge { grid-column: 1 / -1; justify-content: flex-end; }
}
.status { color: var(--muted); font-size: 14px; }
.status.ok { color: var(--ok); }
.status.err { color: var(--danger); }
.pl-tracks { list-style: none; padding: 0; margin: 12px 0; counter-reset: n; }
.pl-tracks li { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-top: 1px solid var(--line); counter-increment: n; }
.pl-tracks li::before { content: counter(n); width: 24px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.pl-tracks li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline .field { flex: 1; min-width: 160px; width: auto; }
.login { max-width: 360px; margin: 12vh auto; }


.row .meta[data-wave]::after { content: " · " attr(data-wave); color: var(--accent); }
.adm .field { background: var(--surface-2); }
.adm h1, .adm .brand { font-family: var(--font-display); }
.row-stems { flex-basis: 100%; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.stem-state { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.stem-state.ok { color: var(--ok); }
.stem-state.err { color: var(--danger); }
.stems-all { margin-bottom: 8px; justify-content: space-between; }
.pl-cover-edit { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.pl-cover-edit img { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; box-shadow: var(--shadow); }
.pl-cover-edit img.placeholder { opacity: .35; }
.pl-cover-edit .hint { flex-basis: 100%; }
.crop-canvas { display: block; margin: 0 auto; border-radius: 14px; touch-action: none; cursor: grab; background: #000; }
.crop-canvas:active { cursor: grabbing; }
.crop-zoom { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.crop-zoom input { flex: 1; accent-color: var(--accent); }
.upl { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; font-size: 14px; }

/* ---------- Meine Cues (oben im Player) ---------- */
.own-sec .own-head { margin-top: 0; }
.own-head .label { margin-right: auto; }
.own-head .label svg { width: 18px; height: 18px; color: var(--muted); }
.own-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.own-list:empty { display: none; }
.cue { display: flex; align-items: stretch; gap: 4px; min-width: 0; }
.cue.enter { animation: fadeUp .4s var(--ease) both; animation-delay: calc(var(--i) * 40ms); }
.cue .marker.own { flex: 1; min-width: 0; }
.cue-edit { align-self: center; flex: none; }
.cue.editing {
  grid-column: 1 / -1; flex-direction: column; gap: 10px; padding: 12px;
  border: 1px dashed color-mix(in srgb, var(--text) 35%, transparent); border-radius: 14px; background: var(--surface-2);
}
.cue-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cue-row .field { flex: 1; min-width: 140px; width: auto; }
.cue-lbl { width: 42px; font-size: 13px; font-weight: 600; color: var(--muted); }
.cue-t { min-width: 64px; font-size: 14px; }
.cue .nudge { display: flex; gap: 4px; flex-wrap: wrap; }
.cue .nudge button { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 9px; font-size: 12px; font-family: var(--font-mono); }
.cue.editing > .btn.danger { align-self: flex-start; }
body.practice .own-list { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
body.practice .cue .marker.own { min-height: 84px; padding: 16px 18px; }
body.practice .cue .m-name { font-family: var(--font-display); font-size: clamp(18px, 2vw, 24px); font-weight: 700; }
.fader-orig { border: 0; background: none; padding: 2px 8px; border-radius: 999px; font: inherit; font-weight: 600; color: var(--muted); }
.fader-orig:hover { color: var(--text); background: var(--surface-2); }
.fader.off .fader-orig { pointer-events: none; }
.sort-toggle { margin: 10px 0 0; }
