@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Manrope:wght@400;500;600;700&display=swap');

:root {
    --bg: #0b0b0e;
    --surface: #141418;
    --surface-2: #1c1c22;
    --surface-3: #24242c;
    --border: rgba(255, 255, 255, 0.09);
    --text: #f2f2f4;
    --muted: #9a9aa5;
    --accent: #1db954;
    --accent-hover: #1ed760;
    --accent-dark: #0f8f41;
    --error: #f87171;
    --success: #4ade80;
    --radius: 12px;
    --player-h: 88px;
    --sidebar-w: 260px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Manrope', sans-serif;
    line-height: 1.5;
    overflow: hidden;
}

h1, h2, h3, .logo { font-family: 'Space Grotesk', sans-serif; }
a { color: inherit; text-decoration: none; }
button { font-family: 'Manrope', sans-serif; }

h1 { font-size: 1.9rem; margin-bottom: 4px; }
h2 { font-size: 1.35rem; margin-bottom: 16px; }
h3 { font-size: 1rem; margin-bottom: 8px; }

button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- Shell ---------- */

.app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ---------- Globalbar (Logo, Home, Suche, Konto) ---------- */

.globalbar {
    height: 64px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 16px;
    background: #000;
}

.globalbar-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-width: 0;
}

.globalbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.round-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--muted);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, transform 0.1s;
}
.round-btn svg { width: 18px; height: 18px; }
.round-btn:hover { color: var(--text); transform: scale(1.05); }
.round-btn.active,
.round-btn-home.active { color: var(--text); background: var(--surface-3); }

.globalbar-avatar {
    display: block;
    margin-left: 6px;
    flex-shrink: 0;
    border-radius: 50%;
    transition: transform 0.1s;
}
.globalbar-avatar:hover { transform: scale(1.06); }
.globalbar-avatar .avatar { width: 30px; height: 30px; }

.app-body {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    padding: 0 8px 8px;
    gap: 8px;
}

/* ---------- Sidebar (reine Bibliothek, wie im Original) ---------- */

.sidebar {
    background: #070709;
    display: flex;
    flex-direction: column;
    padding: 14px 8px 14px 14px;
    gap: 0;
    border-radius: 14px;
    min-width: 0;
    min-height: 0;
}

.lib-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 10px 14px 6px;
}
.lib-panel-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    color: var(--muted);
    font-size: 0.95rem;
    transition: color 0.15s;
}
.lib-panel-title:hover { color: var(--text); }
.lib-panel-title .side-icon { width: 20px; height: 20px; }
.lib-create-btn {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted);
    padding: 6px 10px;
    border-radius: 20px;
    transition: background 0.15s, color 0.15s;
}
.lib-create-btn:hover { background: var(--surface); color: var(--text); }

.lib-filter-chips { display: flex; gap: 8px; padding: 0 6px 12px; flex-wrap: wrap; }
.chip-pill {
    background: var(--surface-2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    transition: background 0.15s;
    white-space: nowrap;
}
.chip-pill:hover { background: var(--surface-3); }
.chip-pill.active { background: var(--text); color: #000; }

.lib-sort-row {
    padding: 0 10px 8px 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
}

.lib-scroll-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding-right: 4px; }

.lib-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 6px;
    border-radius: 6px;
    transition: background 0.12s;
    min-width: 0;
}
.lib-row:hover { background: var(--surface); }
.lib-row-cover {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}
.lib-row-cover-liked {
    background: linear-gradient(135deg, #4d3ec9, #b7c6f2);
    display: grid;
    place-items: center;
}
.lib-row-cover-fallback { background: linear-gradient(135deg, var(--accent-dark), #1a1a20); }
.lib-row-text { min-width: 0; display: flex; flex-direction: column; }
.lib-row-title {
    font-size: 0.88rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lib-row-sub {
    font-size: 0.76rem;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}

.tiny-toast {
    position: fixed;
    left: 50%;
    bottom: 110px;
    transform: translate(-50%, 16px);
    background: #fff;
    color: #000;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 10px 18px;
    border-radius: 6px;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
}
.tiny-toast.show { opacity: 1; transform: translate(-50%, 0); }

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
}
.logo-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.side-nav { display: flex; flex-direction: column; gap: 4px; }

.side-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.15s, background 0.15s;
}
.side-link:hover { color: var(--text); background: var(--surface); }
.side-link.active { color: var(--text); background: rgba(29, 185, 84, 0.12); }
.side-link.active:hover { background: rgba(29, 185, 84, 0.16); }
.side-icon { width: 22px; height: 22px; flex-shrink: 0; }

.side-nav-second { border-top: 1px solid var(--border); padding-top: 14px; }

.side-spacer { flex: 1; }

.side-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
}
.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent-dark);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.side-user-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-btn {
    color: var(--muted);
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: color 0.15s, background 0.15s;
}
.logout-btn:hover { color: var(--text); background: var(--surface-2); }
.logout-btn svg { width: 18px; height: 18px; }

.side-auth {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 14px;
    border-radius: 12px;
    background: linear-gradient(165deg, rgba(29, 185, 84, 0.12), rgba(29, 185, 84, 0.02) 70%);
    border: 1px solid rgba(29, 185, 84, 0.22);
}
.side-auth-text { font-size: 0.8rem; line-height: 1.4; color: var(--muted); margin: 0 0 2px; }
.btn-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 9px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.15s, transform 0.15s, color 0.15s;
}
.btn-auth::before { font-size: 0.95rem; line-height: 1; }
.btn-auth-primary { background: var(--accent); color: #fff; }
.btn-auth-primary:hover { background: #1ed760; transform: translateY(-1px); }
.btn-auth-primary::before { content: '👉'; }
.btn-auth-secondary { background: rgba(255, 255, 255, 0.04); color: var(--text); border: 1px solid var(--border); }
.btn-auth-secondary:hover { background: var(--surface-2); color: var(--accent); transform: translateY(-1px); }
.btn-auth-secondary::before { content: '+'; font-weight: 800; }

.auth-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    text-align: center;
}
.auth-head .auth-badge {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 1.7rem;
    color: #fff;
    background: linear-gradient(145deg, #1ed760, var(--accent-dark));
    box-shadow: 0 10px 26px rgba(29, 185, 84, 0.35);
    margin-bottom: 4px;
}
.auth-head h1 { margin: 0; font-size: 1.7rem; }
.auth-head p { margin: 0; color: var(--muted); font-size: 0.92rem; max-width: 320px; }
.auth-box .form-card { text-align: left; }

/* ---------- Main ---------- */

.main-wrap {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border-radius: 14px;
    background: linear-gradient(180deg, #101013, var(--bg) 340px);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    gap: 12px;
    flex-shrink: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent);
}
.nav-btns { display: flex; gap: 10px; }
.nav-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: var(--text);
    cursor: pointer;
    display: grid;
    place-items: center;
}
.nav-btn:hover { background: var(--surface-3); }
.nav-btn svg { width: 18px; height: 18px; }

.topbar-search {
    flex: 1;
    max-width: 420px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface-2);
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 9px 14px;
    transition: background 0.15s, border-color 0.15s;
}
.topbar-search:focus-within { background: var(--surface-3); border-color: rgba(255, 255, 255, 0.18); }
.topbar-search-icon { width: 17px; height: 17px; color: var(--muted); flex-shrink: 0; }
.topbar-search input {
    flex: 1;
    min-width: 0;
    background: none;
    border: none;
    color: var(--text);
    font-family: 'Manrope', sans-serif;
    font-size: 0.88rem;
}
.topbar-search input:focus { outline: none; }
.topbar-search input::placeholder { color: var(--muted); }

.btn-upload {
    background: var(--surface-2);
    color: var(--text);
    font-weight: 600;
    font-size: 0.88rem;
    padding: 8px 18px;
    border-radius: 999px;
    border: 1px solid var(--border);
    transition: background 0.15s;
}
.btn-upload:hover { background: var(--surface-3); }

.content {
    flex: 1;
    overflow-y: auto;
    padding: 8px 28px 130px;
    scrollbar-color: var(--surface-3) transparent;
}
.content::-webkit-scrollbar { width: 13px; }
.content::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    background-clip: padding-box;
    border: 3px solid transparent;
    border-radius: 999px;
}
.content::-webkit-scrollbar-thumb:hover { background-color: #333c48; background-clip: padding-box; }

.section { margin-bottom: 36px; }
.section.narrow { max-width: 420px; margin-left: auto; margin-right: auto; }
.section.centered { text-align: center; }

.filter-pills { display: flex; gap: 8px; padding: 4px 0 20px; flex-wrap: wrap; }
.pill {
    background: var(--surface-2);
    padding: 7px 15px;
    border-radius: 20px;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text);
    transition: background 0.15s, transform 0.1s;
}
.pill:hover { background: var(--surface-3); }
.pill.active { background: var(--text); color: #000; }
.pill:active { transform: scale(0.96); }

.quickpick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 32px; }
@media (min-width: 900px) { .quickpick-grid { grid-template-columns: repeat(4, 1fr); } }
.quickpick-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    overflow: hidden;
    height: 64px;
    min-width: 0;
    position: relative;
    cursor: pointer;
    transition: background 0.15s;
}
.quickpick-item:hover { background: rgba(255, 255, 255, 0.13); }
.quickpick-item:hover .quickpick-play { opacity: 1; transform: translateY(0); }
.quickpick-cover {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    display: grid;
    place-items: center;
}
.quickpick-cover-fallback { background-image: none; background: linear-gradient(135deg, var(--accent-dark), #1a1a20); }
.quickpick-cover-liked { background: linear-gradient(135deg, #4d3ec9, #b7c6f2); }
.quickpick-title {
    font-size: 0.88rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    padding-right: 12px;
}
.quickpick-play {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    margin-right: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.15s, transform 0.15s;
}
.quickpick-play svg { width: 15px; height: 15px; }

.hero {
    background: linear-gradient(135deg, rgba(29, 185, 84, 0.16), rgba(29, 185, 84, 0.03) 55%, transparent);
    border-radius: 16px;
    padding: 30px 32px;
}
.hero h1 { margin-bottom: 10px; }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.section-header h2 { margin-bottom: 0; }

.empty-hint { color: var(--muted); }
.empty-hint a { color: var(--accent); font-weight: 600; }
.empty-hint a:hover { text-decoration: underline; }

/* ---------- Buttons ---------- */

.btn-primary {
    background: var(--accent);
    color: #04120a;
    border: none;
    padding: 12px 28px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
}
.btn-primary:hover { background: var(--accent-hover); transform: scale(1.03); }

.btn-secondary {
    background: none;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 10px 22px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.btn-secondary:hover { background: var(--surface-2); border-color: var(--muted); }

.btn-small { color: var(--muted); font-weight: 600; font-size: 0.88rem; }
.btn-small:hover { color: var(--text); }

.btn-danger {
    border: 1px solid rgba(248, 113, 113, 0.4);
    background: none;
    color: var(--error);
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-danger:hover { background: rgba(248, 113, 113, 0.12); }

/* ---------- Forms ---------- */

.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.form-card label,
.settings-card label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.88rem;
    color: var(--muted);
}
.form-card input, .form-card select,
.settings-card input, .settings-card select {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 11px 14px;
    color: var(--text);
    font-family: 'Manrope', sans-serif;
    font-size: 1rem;
}
.form-card input:focus, .form-card select:focus,
.settings-card input:focus, .settings-card select:focus { outline: none; border-color: var(--accent); }

.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
input[type="file"] {
    background: var(--surface-2);
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 20px 16px;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.88rem;
    width: 100%;
    transition: border-color 0.15s, background 0.15s;
}
input[type="file"]:hover { border-color: var(--accent); background: var(--surface); }
input[type="file"]::file-selector-button {
    border: none;
    background: var(--accent);
    color: #04120a;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 8px 16px;
    border-radius: 999px;
    margin-right: 14px;
    cursor: pointer;
}

.dropzone {
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 26px 20px;
    text-align: center;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: rgba(29, 185, 84, 0.06); }
.dropzone svg { width: 26px; height: 26px; color: var(--accent); }
.dropzone-title { color: var(--text); font-weight: 600; }
.dropzone small { font-size: 0.78rem; }

.upload-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }

.url-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px 14px;
    background: var(--surface-2);
    border: 1px dashed var(--border);
    border-radius: 10px;
}
.url-or { font-size: 0.82rem; color: var(--text-muted, var(--text)); }
.url-input-row { display: flex; gap: 8px; }
.url-input-row input {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface, #fff);
    color: var(--text);
}
.url-hint { font-size: 0.75rem; color: var(--text-muted, var(--text)); }
.upload-row {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.upload-row-top { display: flex; align-items: center; gap: 10px; }
.upload-row-top .row-btn svg { width: 13px; height: 13px; display: block; }
.upload-file-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.88rem;
    font-weight: 600;
}
.upload-status { font-size: 0.76rem; color: var(--muted); }
.upload-row.done .upload-status { color: var(--success); }
.upload-row.error .upload-status { color: var(--error); }
.progressbar {
    height: 6px;
    border-radius: 999px;
    background: var(--surface-3);
    overflow: hidden;
}
.progressfill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 999px;
    transition: width 0.2s;
}
.upload-note { font-size: 0.78rem; color: var(--muted); margin-top: 10px; }

.step-label {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}
.cover-box { display: flex; gap: 20px; align-items: flex-start; }
.cover-box > div:first-child { flex: 1; min-width: 0; }
.cover-hint { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 8px; }
.cover-preview-wrap { width: 112px; flex-shrink: 0; text-align: center; }
.cover-preview-wrap[hidden] { display: none; }
.cover-preview-wrap img {
    width: 112px;
    height: 112px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
    display: block;
    margin-bottom: 6px;
}
.cover-status { font-size: 0.7rem; color: var(--muted); }
.cover-status.ok { color: var(--success); }
.cover-status.err { color: var(--error); }

.inline-form { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form input, .inline-form select {
    flex: 1;
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text);
    font-family: 'Manrope', sans-serif;
}

.form-footnote { text-align: center; margin-top: 16px; color: var(--muted); font-size: 0.88rem; }
.form-footnote a { color: var(--accent); font-weight: 600; }
/* Button, der wie ein Link aussieht (z. B. POST-Abmelden). */
.linklike { background: none; border: none; padding: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; min-height: 44px; }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 0.9rem; }
.alert-success { background: rgba(74, 222, 128, 0.12); color: var(--success); }
.alert-error { background: rgba(248, 113, 113, 0.12); color: var(--error); }

/* ---------- Cards (Cover-Grid) ---------- */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 20px;
}

.music-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    position: relative;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.music-card:hover {
    background: var(--surface-2);
    transform: translateY(-3px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}
.music-card.active { background: var(--surface-2); box-shadow: 0 0 0 2px var(--accent) inset; }

.music-cover {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    object-fit: cover;
    background: linear-gradient(135deg, #2b2b33, #141418);
}
.music-cover-fallback {
    background: linear-gradient(135deg, var(--accent-dark), #1a1a20);
}
.music-card-play {
    position: absolute;
    right: 18px;
    bottom: 58px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--accent);
    color: #04120a;
    display: grid;
    place-items: center;
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}
.music-card:hover .music-card-play { opacity: 1; transform: translateY(0); }
.music-card-play svg { width: 18px; height: 18px; }

.btn-play-all { padding: 8px 18px; font-size: 0.85rem; }

.music-card-title {
    font-weight: 600;
    font-size: 0.92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.music-card-sub { color: var(--muted); font-size: 0.82rem; }
.music-card-plays { color: var(--muted); font-size: 0.7rem; opacity: 0.85; }

/* ---------- Song-Tabelle ---------- */

.song-table { display: flex; flex-direction: column; gap: 2px; }

.song-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 10px 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.song-head-thumb { width: 38px; flex-shrink: 0; }
.song-head-mid { flex: 1; min-width: 0; }
.song-head-like, .song-head-actions { width: 30px; flex-shrink: 0; }

.sort-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    font-size: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    padding: 0;
    transition: color 0.15s;
}
.sort-btn:hover { color: var(--text); }
.sort-btn.active { color: var(--accent); }

.song-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.12s;
}
.song-row:hover { background: var(--surface); }
.song-row.active { background: var(--surface-2); }

.song-index {
    width: 22px;
    height: 22px;
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    flex-shrink: 0;
    position: relative;
    display: grid;
    place-items: center;
}
.song-index-play { display: none; color: var(--text); }
.song-index-play svg { width: 13px; height: 13px; display: block; }
.song-row:hover .song-index-num { display: none; }
.song-row:hover .song-index-play { display: flex; }
.song-row.active .song-index-num { color: var(--accent); font-weight: 700; }

.song-thumb {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}
.song-thumb-fallback { background: linear-gradient(135deg, #2b2b33, #17171c); }

.song-meta { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.song-title {
    font-weight: 600;
    font-size: 0.92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.song-artist { color: var(--muted); font-size: 0.82rem; }
.song-uploader { color: var(--muted); font-size: 0.82rem; white-space: nowrap; }
.song-duration {
    color: var(--muted);
    font-size: 0.82rem;
    min-width: 40px;
    text-align: right;
    flex-shrink: 0;
}

.like-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.05rem;
    color: var(--muted);
    padding: 6px;
    flex-shrink: 0;
    opacity: 0;
    transition: color 0.15s, transform 0.15s, opacity 0.15s;
}
.song-row:hover .like-btn,
.like-btn.liked { opacity: 1; }
.like-btn:hover { color: var(--text); transform: scale(1.15); }
.like-btn.liked { color: var(--accent); }

.row-action { display: flex; align-items: center; flex-shrink: 0; }
.row-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: color 0.15s, background 0.15s;
}
.row-btn:hover { color: var(--text); background: var(--surface-3); }
.row-btn.danger:hover { color: var(--error); }
.row-btn svg { width: 15px; height: 15px; display: block; }

.dl-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; color: var(--muted); opacity: 0; }
.song-row:hover .dl-btn { opacity: 1; }
.dl-btn:hover { color: var(--accent); background: var(--surface-3); }
.dl-btn svg { width: 16px; height: 16px; }

/* Drag & Drop */
.drag-handle {
    color: var(--muted);
    cursor: grab;
    user-select: none;
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}
.song-row.dragging { opacity: 0.45; }
.song-row.drag-over { box-shadow: inset 0 3px 0 var(--accent); }

/* Playlist-Karte mit Loeschen */
.playlist-card-with-delete { position: relative; }
.playlist-card-link-inner { display: flex; flex-direction: column; gap: 8px; }
.card-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    transition: opacity 0.15s;
}
.playlist-card-with-delete:hover .card-delete { opacity: 1; }
.music-cover-liked {
    background: linear-gradient(135deg, #7c5cff, #1db954);
}
.rename-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rename-form input {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    color: var(--text);
    font-family: 'Manrope', sans-serif;
    font-size: 0.9rem;
}
.rename-form input:focus { outline: none; border-color: var(--accent); }

/* ---------- Playlist-Detail ---------- */

.playlist-hero {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    margin: -8px -28px 28px;
    padding: 48px 28px 28px;
    flex-wrap: wrap;
    background: linear-gradient(180deg, rgba(29, 185, 84, 0.35), rgba(29, 185, 84, 0.06) 60%, transparent);
}
.playlist-hero-cover {
    width: 200px;
    height: 200px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-dark), #1a1a20);
    display: grid;
    place-items: center;
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}
.playlist-hero-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}
.playlist-hero-cover.round { border-radius: 50%; }
.playlist-hero-cover.round img { border-radius: 50%; }
.verified-badge { display: inline-flex; align-items: center; gap: 4px; }
.playlist-hero-text h1 { font-size: 3rem; line-height: 1.08; letter-spacing: -0.02em; font-weight: 800; }
.playlist-hero-text p { color: var(--muted); margin-top: 8px; }

.playlist-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; }

.play-btn-big {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #04120a;
    font-size: 1.4rem;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform 0.15s, background 0.15s;
}
.play-btn-big:hover { background: var(--accent-hover); transform: scale(1.06); }
.play-btn-big svg { width: 22px; height: 22px; }

.hero-more-wrap { position: relative; }
.hero-more-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: color 0.15s, background 0.15s;
}
.hero-more-btn:hover { color: var(--text); background: var(--surface-2); }
.hero-more-btn svg { width: 22px; height: 22px; }
.hero-more-menu {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    min-width: 220px;
    background: #282828;
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
    z-index: 20;
}
.hero-more-menu.show { opacity: 1; visibility: visible; transform: translateY(0); }
.hero-more-item {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--text);
    font-family: 'Manrope', sans-serif;
    font-size: 0.86rem;
    font-weight: 600;
    padding: 10px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.12s;
}
.hero-more-item:hover { background: var(--surface-3); }
.hero-more-item.danger { color: var(--error); }
#rename-form { margin-top: 14px; }

/* ---------- Suche ---------- */

.search-form { margin-bottom: 28px; }
.search-input {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 14px 24px;
    color: var(--text);
    font-family: 'Manrope', sans-serif;
    font-size: 1.05rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.search-input:focus { outline: none; border-color: var(--accent); }
.search-input::placeholder { color: var(--muted); }

.artist-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    transition: background 0.15s;
}
.artist-card:hover { background: var(--surface-2); }
.artist-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-dark), #2a2a32);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.artist-name { font-weight: 600; }
.artist-count { color: var(--muted); font-size: 0.82rem; }

/* ---------- Now-Playing-Strip ---------- */

.now-strip { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 24px; }
.now-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 0.86rem;
}
.now-item em { color: var(--accent); font-style: normal; font-weight: 600; }
.now-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ---------- Player-Bar ---------- */

.player-bar {
    position: fixed;
    bottom: 8px;
    left: calc(var(--sidebar-w) + 8px);
    right: 8px;
    height: var(--player-h);
    background: rgba(14, 14, 17, 0.92);
    border: 1px solid var(--border);
    border-radius: 14px;
    backdrop-filter: blur(14px);
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    padding: 0 20px;
    gap: 16px;
    z-index: 20;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.45);
}

.player-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.player-art {
    width: 54px;
    height: 54px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--surface-2);
}
.player-art img { width: 100%; height: 100%; object-fit: cover; }
.player-info { display: flex; flex-direction: column; min-width: 0; }
#player-title { font-weight: 600; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#player-artist { color: var(--muted); font-size: 0.78rem; }

.player-center { display: flex; flex-direction: column; align-items: center; gap: 6px; }

.player-buttons { display: flex; align-items: center; gap: 16px; }
.ctl {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    display: grid;
    place-items: center;
    padding: 4px;
    transition: color 0.15s, transform 0.15s;
}
.ctl:hover { color: var(--text); }
.ctl.on { color: var(--accent); }
.ctl svg { width: 20px; height: 20px; }
.ctl-main {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #fff;
    color: #04120a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.ctl-main svg { width: 20px; height: 20px; }
.ctl-main .icon-pause { display: none; }
.ctl-main.playing { background: var(--accent); color: #fff; }
.ctl-main.playing .icon-play { display: none; }
.ctl-main.playing .icon-pause { display: block; }
.ctl-main:hover { transform: scale(1.05); }

.volume-icon { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.volume-icon:hover { color: var(--text); }

#repeat-btn[data-state="one"]::after {
    content: '1';
    position: absolute;
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--accent);
    margin-top: 14px;
}

/* --- QoL: Als-Nächstes-Anzeige, Skip-Buttons, Mute, Queue-Menü --- */
.player-next {
    color: var(--accent);
    font-size: 0.72rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ctl-skip {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}
.ctl-skip:hover { color: var(--text); }
#mute-btn.muted { color: var(--accent); }

.queue-add-btn { font-weight: 700; color: var(--muted); }
.queue-add-btn:hover { color: var(--text); }
.song-row .queue-add-btn { align-self: center; }
.music-card .queue-add-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    font-size: 0.8rem;
    z-index: 2;
}
.queue-menu {
    position: fixed;
    z-index: 9999;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    padding: 4px;
    display: flex;
    flex-direction: column;
    min-width: 170px;
}
.queue-menu button {
    background: none;
    border: none;
    color: var(--text);
    font-size: 0.8rem;
    text-align: left;
    padding: 8px 10px;
    border-radius: 7px;
    cursor: pointer;
}
.queue-menu button:hover { background: var(--surface-3); color: var(--accent); }

/* --- QoL: Equalizer + Sleep-Timer (Einstellungen) --- */
.eq-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 14px 0 6px; }
.eq-band { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.eq-band input[type="range"] {
    width: 100%;
    writing-mode: vertical-lr;
    direction: rtl;
    height: 130px;
    margin: 0;
}
.eq-band-label { font-size: 0.68rem; color: var(--muted); }
.eq-value { font-size: 0.75rem; color: var(--text); font-variant-numeric: tabular-nums; }
.eq-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.eq-preset-btn {
    background: var(--surface-3);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.eq-preset-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.eq-preamp-row { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; max-width: 420px; }
.eq-preamp-label { font-size: 0.75rem; color: var(--muted); min-width: 64px; }
.eq-preamp-row input[type="range"] { flex: 1; }
.eq-preamp-val { min-width: 58px; text-align: right; }
.eq-reset-row { margin-top: 10px; }
.sleep-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sleep-info { font-size: 0.78rem; color: var(--accent); margin-top: 6px; min-height: 1em; }

.seek-row { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 640px; }
.seek-row span { color: var(--muted); font-size: 0.74rem; min-width: 34px; text-align: center; }

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    background:
        linear-gradient(to right,
            var(--accent) 0%,
            var(--accent) var(--fill, 0%),
            var(--surface-3) var(--fill, 0%),
            var(--surface-3) 100%);
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    transition: transform 0.15s;
}
input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.2); }
input[type="range"]::-moz-range-track {
    height: 4px;
    background: transparent;
    border: none;
}
input[type="range"]::-moz-range-progress {
    height: 4px;
    border-radius: 2px;
    background: var(--accent);
}
input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: none;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    transition: transform 0.15s;
}
input[type="range"]:hover::-moz-range-thumb { transform: scale(1.2); }

#seek-bar { flex: 1; }
#volume-bar { width: 100px; }

.player-right { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }

/* ---------- Queue-Panel ---------- */

.queue-panel {
    position: fixed;
    bottom: calc(var(--player-h) + 18px);
    right: 24px;
    width: 360px;
    max-height: 46vh;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    z-index: 19;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5);
}
.queue-panel[hidden] { display: none; }
.queue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.queue-list { overflow-y: auto; padding: 8px; }
.queue-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.86rem;
}
.queue-thumb {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--surface-3);
}
.queue-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.queue-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.queue-item:hover { background: var(--surface-3); }
.queue-item.active { color: var(--accent); font-weight: 600; }

/* ---------- Login/Register ---------- */

.auth-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background:
        radial-gradient(1100px 520px at 50% -12%, rgba(29, 185, 84, 0.14), transparent 65%),
        var(--bg);
}
.auth-box { width: 100%; max-width: 400px; text-align: center; }
.auth-box .logo { justify-content: center; margin-bottom: 28px; font-size: 1.6rem; }
.auth-box .form-card { text-align: left; }
.auth-box h1 { margin-bottom: 20px; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    :root { --sidebar-w: 72px; }
    .side-link span, .logo span, .side-user-name-link, .side-user, .side-nav-second { display: none; }
    .logo { justify-content: center; padding: 0; }
    .side-link { justify-content: center; padding: 10px; }
    .side-auth { padding: 10px; gap: 6px; }
    .side-auth-text { display: none; }
    .btn-auth { font-size: 0.72rem; padding: 8px 4px; }
    .side-link.active::before { display: none; }
    .player-bar { grid-template-columns: 1fr 1.4fr 0.6fr; }
    .song-uploader { display: none; }
    #volume-bar { width: 60px; }
}

@media (max-width: 640px) {
    .content { padding: 8px 14px 170px; }
    /* Handy-Shell: Sidebar wird horizontale Leiste oben, Content darunter. */
    .app-body { grid-template-columns: 1fr; padding: 0 6px 6px; overflow-y: auto; }
    .sidebar { order: -1; max-height: 132px; overflow: hidden; padding: 10px 10px 6px; }
    .lib-scroll-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
    .lib-scroll-list .lib-row { flex: 0 0 auto; min-width: 200px; }
    .lib-filter-chips { overflow-x: auto; }
    /* Globalbar bricht auf zwei Zeilen um: Suche volle Breite. */
    .globalbar { flex-wrap: wrap; height: auto; min-height: 64px; padding: 10px 12px; gap: 10px; row-gap: 8px; }
    .globalbar-center { order: 3; flex-basis: 100%; }
    .topbar-search { max-width: none; }
    .btn-upload { padding: 8px 12px; font-size: 0.8rem; }
    /* Player: links angedockt, kompakt mit Titel statt leer. */
    .player-bar { left: 8px; grid-template-columns: 1fr; grid-template-rows: auto auto; height: auto; padding: 10px 14px; gap: 6px; }
    .player-left { display: flex; }
    .player-art { width: 40px; height: 40px; }
    /* Queue-Button bleibt auf dem Handy erreichbar (oben rechts in der Bar),
       nur Mute/Volume entfallen dort. */
    .player-right { display: block; position: absolute; top: 6px; right: 10px; }
    #mute-btn, #volume-bar, .volume-icon { display: none; }
    .player-next, .ctl-skip { display: none; }
    .player-buttons { gap: 20px; }
    .ctl, .row-btn { min-width: 44px; min-height: 44px; }
    .queue-panel { right: 8px; left: 8px; width: auto; }
    /* Song-Tabellen: Kopf + Neben-Spalten ausblenden, Zeilen kompakt. */
    .song-table .song-head { display: none; }
    .song-uploader, .song-duration { display: none; }
    .song-row { gap: 10px; padding: 9px 8px; }
    .song-thumb { width: 44px; height: 44px; }
    /* Seek/Volume: Touch-Scroll nicht blockieren, Trefferflächen größer. */
    .player-bar input[type=range], .seek { touch-action: pan-y; }
    .like-btn { min-width: 44px; min-height: 44px; }
    .card-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .playlist-hero-cover { width: 130px; height: 130px; }
    .playlist-hero-text h1 { font-size: 1.6rem; }
    .topbar { padding: 12px 16px; }
    .upload-grid { grid-template-columns: 1fr; }
    .cover-box { flex-direction: column; }
    .cover-preview-wrap { width: 100%; }
    .cover-preview-wrap img { width: 100%; height: auto; max-height: 200px; }
    .import-alle-form { padding: 12px; }
    .import-kopf,
    .import-eintrag { grid-template-columns: 28px 44px minmax(0, 1fr) 88px 120px; gap: 8px; padding: 7px 10px; }
    .import-e-cover { width: 44px; height: 44px; }
    .import-titel,
    .import-kuenstler { white-space: normal; }
    .import-e-aktionen { justify-content: flex-start; }
}

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

/* ---------- Profil ---------- */

.side-user-name-link {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    font-weight: 600;
    transition: color 0.15s;
}
.side-user-name-link:hover { color: var(--accent); }

.avatar-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}
.avatar-lg { width: 64px; height: 64px; font-size: 1.6rem; }

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
}
.stat-num { font-family: 'Space Grotesk', sans-serif; font-size: 1.6rem; font-weight: 700; color: var(--accent); }
.stat-card span:last-child { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* ---------- Profil ---------- */

.profile-hero {
    position: relative;
    overflow: hidden;
    min-height: 200px;
    border-radius: 18px;
    padding: 28px 32px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 26px;
    background:
        radial-gradient(120% 320px at 16% -20%, rgba(255, 255, 255, 0.12), transparent 60%),
        linear-gradient(135deg, var(--pc, #1c2c22), var(--pc2, #0f0f13) 55%, #0f0f13);
    border: 1px solid rgba(29, 185, 84, 0.14);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
}
.profile-banner-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    opacity: 0.55;
}
.profile-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(10, 10, 14, 0.2), rgba(10, 10, 14, 0.72) 80%);
}
.profile-hero > *:not(.profile-banner-img):not(.profile-scrim) { position: relative; z-index: 2; }
.profile-avatar {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--pc, #1ed760), var(--pc2, #0f8f41));
    color: #04120a;
    font-size: 3.2rem;
    font-weight: 700;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    border: 3px solid rgba(255, 255, 255, 0.14);
    overflow: hidden;
}
.profile-avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-hero-text { min-width: 0; flex: 1; }
.profile-badge {
    display: inline-block;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
}
.profile-hero-text h1 { font-size: 2.4rem; line-height: 1.1; word-break: break-word; }
.profile-meta { color: var(--muted); margin-top: 8px; }
.profile-bio { margin-top: 10px; max-width: 54ch; line-height: 1.55; color: rgba(255, 255, 255, 0.88); }
.profile-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.profile-actions .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.profile-actions .btn-primary svg { width: 17px; height: 17px; }
.share-url-row { margin-top: 12px; }
.share-url {
    width: min(100%, 420px);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
    font-size: 0.8rem;
    padding: 9px 12px;
    cursor: text;
}
.share-url:focus { outline: none; border-color: var(--accent); }
.profile-songs { margin-top: 4px; }

.avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }

/* ---------- Profil-Gestaltung (Einstellungen) ---------- */

.profile-edit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 16px; }
.profile-edit-box { display: flex; flex-direction: column; gap: 8px; }
.profile-edit-label { color: var(--muted); font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.thumbnail-wrap { display: grid; }
.thumb-avatar {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: var(--accent-dark);
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
}
.thumb-avatar-letter { color: #fff; font-size: 1.7rem; font-weight: 700; }
.thumb-banner {
    width: 100%;
    max-width: 380px;
    aspect-ratio: 16 / 5;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--border);
}
.profile-edit-box input[type="file"] { padding: 12px 12px; font-size: 0.8rem; }
.media-actions { display: flex; gap: 8px; margin-top: 2px; flex-wrap: wrap; }
.btn-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.btn-mini:hover { color: var(--text); border-color: var(--muted); }
.btn-mini svg { width: 15px; height: 15px; }
.remove-btn.active { color: #ff6b6b; border-color: rgba(255, 107, 107, 0.6); background: rgba(255, 107, 107, 0.08); }
.remove-btn.active:hover { color: #ff8a8a; border-color: #ff6b6b; }
.color-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-top: 16px; }
.color-pick { display: flex; align-items: center; gap: 10px; }
.color-pick input[type="color"] {
    width: 46px;
    height: 34px;
    padding: 2px;
    border-radius: 8px;
    background: var(--surface-3);
    border: 1px solid var(--border);
    cursor: pointer;
}
.color-pick code { color: var(--muted); font-size: 0.8rem; }
.settings-card textarea {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 11px 14px;
    color: var(--text);
    font-family: 'Manrope', sans-serif;
    font-size: 0.92rem;
    resize: vertical;
}
.settings-card textarea:focus { outline: none; border-color: var(--accent); }

@media (max-width: 640px) {
    .profile-hero { flex-direction: column; text-align: center; padding: 24px 20px; }
    .profile-avatar { width: 92px; height: 92px; font-size: 2.6rem; }
    .profile-actions { justify-content: center; }
}

/* ---------- Einstellungen ---------- */

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}
.settings-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 20px 22px;
}
.settings-card h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.02rem;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.settings-card h2 .card-emoji { color: var(--accent); }
.settings-card h2 svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--accent); }
.settings-card.danger {
    border-color: rgba(239, 68, 68, 0.5);
    max-width: 720px;
}
.settings-card.danger h2 { color: var(--error); }
.settings-card.danger h2 svg { color: var(--error); }
.settings-card form { margin: 0; }
.settings-card input,
.settings-card select {
    width: 100%;
}
.settings-card label { margin-bottom: 12px; }
.settings-card .btn-primary,
.settings-card .btn-danger { margin-top: 6px; }

/* Equalizer für aktive Zeile (springt nur bei laufender Wiedergabe) */
.song-row.active .song-index {
    font-size: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}
.song-row.active .song-index-num,
.song-row.active .song-index-play { display: none; }
.song-row.active .song-index::before,
.song-row.active .song-index::after {
    content: '';
    width: 3px;
    border-radius: 2px;
    background: var(--accent);
    height: 12px;
}
body.playing .song-row.active .song-index::before { animation: eq 1s ease-in-out infinite; }
body.playing .song-row.active .song-index::after { animation: eq 1s ease-in-out infinite 0.35s; }
@keyframes eq { 0%, 100% { height: 6px; } 50% { height: 15px; } }

/* ---------- Spotify-Import: Ergebnisse ---------- */
.import-summe { color: var(--muted); font-size: 0.85rem; }

/* "Alle fehlenden herunterladen"-Leiste (wie settings-card) */
.import-alle-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 16px;
    max-width: 900px;
}
.import-alle-feld {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 260px;
    min-width: 200px;
}
.import-alle-feld label { color: var(--muted); font-size: 0.78rem; }
.import-alle-feld input { width: 100%; box-sizing: border-box; }
.import-alle-hinweis {
    flex-basis: 100%;
    margin: 2px 0 0;
    color: var(--error, #e5484d);
    font-size: 0.85rem;
}

/* Ergebnisliste nutzt die normale song-table/song-row-Gestaltung */
.import-table { max-width: 900px; }
.import-zeile { cursor: default; }
.import-head-status { width: 104px; flex-shrink: 0; }
.import-head-aktionen { width: 76px; flex-shrink: 0; }
.import-aktionen {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
.import-da { color: var(--accent); }
.import-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}
.import-pill-ok { color: var(--accent); background: rgba(29, 185, 84, 0.12); }
.import-pill-nein { color: var(--error); background: rgba(229, 72, 77, 0.12); }

/* mobile */
@media (max-width: 640px) {
    .import-head-status,
    .import-head-aktionen { display: none; }
    .import-alle-form { padding: 12px; }
}
@media (max-width: 900px) {
    .import-table .song-head { display: none; }
    .import-zeile { flex-wrap: wrap; row-gap: 2px; }
    .import-zeile .song-meta { flex-basis: 100%; order: 2; }
    .import-zeile .song-index { order: 1; }
    .import-zeile .song-thumb { order: 1; }
    .import-zeile .import-head-status { order: 3; flex: 1; }
    .import-zeile .import-aktionen { order: 3; }
    .import-zeile .song-duration { order: 3; }
}

/* ---------- Sunnify-Downloader (Spotify-Download) ---------- */

.sunnify-progress {
    height: 12px;
    border-radius: 999px;
    background: var(--surface-2);
    overflow: hidden;
    max-width: 640px;
}
.sunnify-progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent, #1db954), #7ed321);
    transition: width 0.4s ease;
}
.sunnify-warnings {
    margin: 12px 0 0;
    padding: 0 0 0 18px;
    color: var(--muted);
    font-size: 0.85rem;
    max-width: 640px;
}
.sunnify-failed {
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
    max-width: 640px;
    display: grid;
    gap: 6px;
}
.sunnify-failed > li {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 12px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--error, #e5484d) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--error, #e5484d) 35%, transparent);
    font-size: 0.9rem;
}
.sunnify-failed-meta {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1 1 100%;
}
.sunnify-failed-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
    flex: 1 1 100%;
}
.sunnify-failed-reason {
    color: var(--muted);
    font-size: 0.82rem;
}
.sunnify-retry {
    margin-top: 10px;
}
.sunnify-raw {
    margin-top: 12px;
    max-width: 640px;
    font-size: 0.8rem;
    color: var(--muted);
}
.sunnify-raw pre {
    margin: 6px 0 0;
    padding: 8px 10px;
    background: var(--surface-2);
    border-radius: 8px;
    overflow-x: auto;
    white-space: pre-wrap;
}
/* Ladezustand des Players (gesetzt per player.js waiting/seeking). */
body.media-loading .player-seek, body.media-loading input[type=range].seek { opacity: .45; cursor: wait; }

/* Flash-Hinweis nach Redirect (z. B. Duplikat in Playlist). */
.flash-note { background: #1DB954; color: #000; font-weight: 700; border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; }
