*, *::before, *::after { box-sizing: border-box; }

/* ── ICONS ── */
.icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }

:root {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --bg:        #0a0a0a;
  --surface:   #141414;
  --surface2:  #1a1a1a;
  --border:    #252525;
  --border2:   #333333;
  --text:      #e8eef6;
  --muted:     #8a9bb8;
  --accent:    #c9a84c;     /* Gold – klassische Ästhetik */
  --accent2:   #2a2a2a;     /* Dunkelgrau */
  --sidebar-w: 260px;
}

body { margin: 0; background: var(--bg); color: var(--text); display: flex; height: 100vh; overflow: hidden; touch-action: pan-x pan-y; }

/* ── TOP SEARCH BAR ── */
#topBar {
  position: absolute; top: 0; left: var(--sidebar-w); right: 0;
  height: 64px; background: rgba(10, 10, 10, 0.55);
  backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; padding: 0 28px; z-index: 40;
}
.search-wrapper { position: relative; width: 100%; max-width: 600px; }
.search-wrapper input {
  width: 100%; background: rgba(26,26,26,.8); border: 1px solid rgba(255,255,255,.08);
  padding: 10px 16px 10px 40px; font-size: 15px; border-radius: 12px;
  color: white; outline: none; transition: border-color .2s, box-shadow .2s;
}
.search-wrapper input:focus { border-color: var(--accent); box-shadow: 0 0 16px rgba(201,168,76,.2); }
.search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  opacity: 0.5; display: flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; z-index: 1; pointer-events: none;
}
.search-clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--muted); cursor: pointer;
  padding: 4px; display: none; line-height: 0;
  width: 24px; height: 24px;
  align-items: center; justify-content: center;
}
.search-clear:hover { color: var(--text); }

/* ── LOGIN SCREEN ── */
#loginScreen {
  position: fixed; inset: 0; background: var(--bg);
  display: none; align-items: center; justify-content: center;
  z-index: 100; overflow: hidden;
}
#loginScreen::before {
  content: ""; position: absolute; width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(201,168,76,.2) 0%, transparent 70%);
  top: 20%; left: 50%; transform: translate(-50%, -50%);
  filter: blur(60px); pointer-events: none;
}
#loginScreen::after {
  content: ""; position: absolute; width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(26,58,110,.2) 0%, transparent 70%);
  bottom: 10%; right: 15%;
  filter: blur(60px); pointer-events: none;
}
.login-box {
  background: rgba(20,20,20,.8); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px; padding: 40px 34px; width: 400px;
  display: grid; gap: 16px; position: relative; z-index: 1;
  box-shadow: 0 24px 64px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.04);
}
.login-logo { font-size: 24px; font-weight: 800; margin-bottom: 4px; display: flex; align-items: center; gap: 10px; justify-content: center; color: var(--accent); }
.login-label { font-size: 12px; color: var(--muted); margin-bottom: 2px; font-weight: 500; }
.login-box input { width: 100%; }
.login-box .accent { background: linear-gradient(135deg, #c9a84c, #a08030); border: none; color: #000; font-weight: 700; box-shadow: 0 4px 16px rgba(201,168,76,.35); transition: transform .1s, box-shadow .1s; }
.login-box .accent:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(201,168,76,.45); }
.login-box .accent:active { transform: translateY(1px); }

/* ── SIDEBAR ── */
#sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(20,20,20,.65) 0%, rgba(10,10,10,.8) 100%);
  backdrop-filter: blur(24px) saturate(1.5); -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border-right: 1px solid rgba(255,255,255,.08);
  display: flex;
  flex-direction: column;
  padding: 0px 0px 16px;
  height: 100vh;
  overflow: hidden;
}
.sidebar-logo {
  font-size: 22px; font-weight: 700;
  padding: 20px 12px 20px;
  display: flex; align-items: center; gap: 12px;
  color: var(--accent);
  width: 100%; box-sizing: border-box;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-radius: 12px;
  cursor: pointer; font-size: 16px; font-weight: 600;
  color: var(--muted);
  transition: background 120ms, color 120ms;
  border: none; background: none; text-align: left; width: 100%;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: var(--text); }
.nav-item.active { background: linear-gradient(90deg, #c9a84c, #a08030); color: #000; box-shadow: 0 4px 20px rgba(201,168,76,.35), inset 0 1px 0 rgba(255,255,255,.1); }
.nav-item.active .nav-icon { opacity: 1; }
.nav-icon { opacity: .6; width: 20px; display: inline-flex; align-items: center; justify-content: center; }

.sidebar-bottom { display: flex; flex-direction: column; gap: 8px; }
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  font-size: 13px; color: var(--muted);
}
.btn-logout-sidebar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  cursor: pointer; font-size: 14px; color: var(--muted);
  border: none; background: none; text-align: left; width: 100%;
  transition: background 120ms, color 120ms;
}
.btn-logout-sidebar:hover { background: rgba(239,68,68,.1); color: #fca5a5; }

/* ── MAIN CONTENT ── */
#appShell { display: none; flex: 1; overflow: hidden; }
#appShell.visible { display: flex; }

#content {
  flex: 1; overflow-y: auto; padding: 28px 28px 40px;
  margin-top: 64px;
}

/* ── PAGE HEADER ── */
.page-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 32px;
}
.page-title { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.page-sub { font-size: 14px; color: var(--muted); margin-top: 4px; }
.spacer { flex: 1; }

/* ── SHARED INPUTS / BUTTONS ── */
input, button, select {
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border2); border-radius: 10px; padding: 10px 12px;
  font-size: 14px;
}
button { cursor: pointer; }
button.primary { background: var(--surface); border-color: var(--border); }
button.primary:hover { background: var(--surface2); }
button.accent { background: rgba(201,168,76,.15); border-color: rgba(201,168,76,.4); color: var(--accent); }
button.accent:hover { background: rgba(201,168,76,.25); }
button:disabled { opacity: .45; cursor: not-allowed; }

/* ── COMPOSER / RELEASE GRID ── */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.card {
  border: none; border-radius: 7px; overflow: hidden;
  background: none;
  display: flex; flex-direction: column; position: relative;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.cover {
  position: relative; width: 100%; aspect-ratio: 1/1; overflow: hidden;
  background: var(--surface);
  display:flex; align-items:center; justify-content:center;
  color:var(--muted); font-size: 12px;
}
.cover img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display:block; }
.cover-fade {
  position: absolute; bottom: -1px; left: -1px; right: -1px; height: calc(50% + 2px);
  background: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,.4) 50%, transparent 100%);
  pointer-events: none;
}
.card > .artist-name {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 10px 10px 9px; z-index: 1;
  display: flex; flex-direction: column; line-height: 1.2; overflow: hidden;
}
.artist-name { display: flex; flex-direction: column; line-height: 1.2; overflow: hidden; }
.artist-first { font-size: 10px; font-weight: 400; color: rgba(255,255,255,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artist-last {
  font-family: 'Bodoni Moda', serif; font-weight: 500;
  font-size: 15px; letter-spacing: 0.04em;
  color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.artist-sub { font-size: 11px; color: var(--muted); }
.card .meta {
  padding: 8px 6px 10px;
  display: flex; flex-direction: column; gap: 2px;
  overflow: hidden;
}
.card .meta .artist-name {
  font-size: 12px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block; line-height: 1.3;
}

/* ── RELEASE ROWS ── */
.release-list { display: grid; gap: 8px; }
.release-card {
  border-radius: 12px; overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.06); border-left: 4px solid rgba(201,168,76,.3);
  cursor: pointer; transition: background .15s ease;
}
.release-card:hover { background: rgba(255,255,255,.03); }
.release-card.in-library { border-left-color: #22c55e; }
.release-top { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 10px; }
.release-cover { width: 56px; height: 56px; flex-shrink: 0; border-radius: 6px; overflow: hidden; background: var(--bg); display:flex; align-items:center; justify-content:center; color:var(--muted); }
.release-cover img { width:100%; height:100%; object-fit:cover; display:block; }
.release-info { flex:1; min-width:0; display:grid; gap:4px; }
.release-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.release-meta { display:flex; gap:4px; flex-wrap:wrap; align-items:center; font-size: 12px; color: var(--muted); }

/* ── SETTINGS ── */
.settings-section {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px; padding: 24px; margin-bottom: 32px;
  max-width: 640px;
}
.settings-section-title {
  font-size: 15px; font-weight: 700;
  color: var(--text); margin-bottom: 16px;
}
.settings-hint { font-size: 12px; color: var(--muted); }
.settings-status { font-size: 13px; color: var(--muted); }

.input-group { position: relative; width: 100%; }
.input-group input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border2);
  padding: 14px 16px; font-size: 15px; border-radius: 12px;
  transition: border-color 0.2s; color: var(--text);
}
.input-group input:focus { border-color: var(--accent); outline: none; }
.input-icon {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none; opacity: 0.6;
  display: flex; align-items: center; justify-content: center;
}

/* ── SUB TABS ── */
.sub-tabs { display: flex; gap: 4px; margin-bottom: 24px; }
.sub-tab {
  padding: 8px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  cursor: pointer; border: 1px solid var(--border2);
  background: none; color: var(--muted); transition: all 120ms;
}
.sub-tab:hover { background: rgba(255,255,255,.05); color: var(--text); }
.sub-tab.active { background: var(--accent); color: #000; border-color: transparent; }

/* ── SYNC WIDGET ── */
.sync-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 10px 20px 20px; text-align: center; gap: 24px;
}
.btn-sync-big {
  background: linear-gradient(135deg, var(--accent), #a08030);
  color: #000; border: none;
  padding: 16px 36px; border-radius: 99px;
  font-size: 16px; font-weight: 700;
  box-shadow: 0 4px 12px rgba(201,168,76,.3);
  transition: transform 0.1s, box-shadow 0.1s;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
}
.btn-sync-big:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(201,168,76,.4); }
.btn-sync-big:active { transform: translateY(1px); }
.btn-sync-big:disabled { background: #374151; color: #9ca3af; box-shadow: none; cursor: default; transform: none; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 20px; left: calc(var(--sidebar-w) + 20px);
  background: rgba(20,20,20,.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.08);
  padding: 12px 18px; border-radius: 12px; display:none;
  font-size: 13px; font-weight: 500; z-index: 50;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  animation: toast-in .25s ease;
}
.toast.success { border-color: rgba(34,197,94,.4); background: rgba(10,30,20,.92); }
.toast.error { border-color: rgba(239,68,68,.4); background: rgba(30,10,10,.92); }
.toast.warning { border-color: rgba(251,146,60,.4); background: rgba(30,20,10,.92); }
@keyframes toast-in { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }

/* ── EMPTY STATE ── */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-text { font-size: 15px; }

/* ── SKELETON LOADING ── */
@keyframes skeleton-pulse { 0%, 100% { opacity: .06; } 50% { opacity: .12; } }
.skeleton { animation: skeleton-pulse 1.5s ease-in-out infinite; background: #fff; border-radius: 8px; }
.skeleton-card { border-radius: 7px; overflow: hidden; position: relative; background: var(--surface); }
.skeleton-cover { aspect-ratio: 1/1; background: #fff; opacity: .06; }
.skeleton-fade { position: absolute; bottom: 0; left: 0; right: 0; height: 50%; background: linear-gradient(to top, rgba(0,0,0,.5) 0%, transparent 100%); }
.skeleton-name { position: absolute; bottom: 10px; left: 10px; display: flex; flex-direction: column; gap: 5px; }
.skeleton-text { height: 10px; width: 36px; border-radius: 4px; }
.skeleton-text-lg { height: 14px; width: 56px; border-radius: 4px; }

/* ── VIEW TRANSITIONS ── */
.view-panel { opacity: 0; transition: opacity .15s ease; }
.view-panel.active { opacity: 1; }

@keyframes card-in { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.card-animate { animation: card-in .35s ease both; }

/* ── THEMED MODAL ── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 100; display: none; align-items: center; justify-content: center; }
.modal-backdrop.open { display: flex; }
.modal-box {
  background: rgba(20,20,20,.92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.08); border-radius: 16px;
  padding: 24px; max-width: 380px; width: 90%;
  box-shadow: 0 16px 48px rgba(0,0,0,.5);
  animation: modal-in .2s ease;
}
.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.modal-text { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.modal-actions button { padding: 8px 18px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid var(--border2); }
.modal-cancel { background: var(--surface2); color: var(--text); }
.modal-confirm { background: var(--accent); border-color: var(--accent); color: #000; }
.modal-danger { background: #dc2626; border-color: #dc2626; color: #fff; }
@keyframes modal-in { from { opacity:0; transform:scale(.95); } to { opacity:1; transform:scale(1); } }

/* ── SCROLL TO TOP ── */
.scroll-top {
  position: fixed; bottom: 24px; right: 24px; z-index: 60;
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #a08030); border: none; color: #000;
  font-size: 18px; cursor: pointer; display: none;
  align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(201,168,76,.4);
  transition: opacity .2s, transform .2s;
}
.scroll-top:hover { transform: scale(1.1); }
.scroll-top.visible { display: flex; }

/* ── SEARCH FAB (mobile only) ── */
.search-fab {
  display: none; /* hidden on desktop, shown via mobile media query */
  position: fixed; z-index: 60;
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #a08030); border: none; color: #000;
  cursor: pointer;
  align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(201,168,76,.4);
  transition: opacity .2s, transform .2s;
  -webkit-tap-highlight-color: transparent;
}
.search-fab:active { transform: scale(0.92); }

/* ── SEARCH OVERLAY (mobile) ── */
.search-overlay {
  position: fixed; inset: 0; z-index: 110;
  background: var(--bg);
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.32, .72, 0, 1);
  visibility: hidden;
}
.search-overlay.open {
  transform: translateY(0);
  visibility: visible;
}
.search-overlay-bar {
  display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 12px 12px;
  background: rgba(10, 10, 10, 0.95);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.search-overlay-bar .search-wrapper { flex: 1; }
.search-overlay-cancel {
  background: none; border: none; color: var(--accent);
  font-size: 15px; font-weight: 600; cursor: pointer;
  white-space: nowrap; padding: 8px 4px;
  -webkit-tap-highlight-color: transparent;
}
.search-overlay-body {
  flex: 1; overflow-y: auto; padding: 12px;
  -webkit-overflow-scrolling: touch;
}

/* ── DOWNLOAD BUTTON ── */
.btn-download {
  font-size: 12px; padding: 7px 14px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #a08030);
  border: 1px solid rgba(201,168,76,.5); color: #000; font-weight: 600;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  cursor: pointer; transition: opacity .15s;
}
.btn-download:hover { opacity: .85; }
.btn-download:disabled { opacity: .45; cursor: not-allowed; }
.btn-download.done { background: linear-gradient(135deg, #22c55e, #16a34a); border-color: rgba(34,197,94,.5); }

/* ── RELEASE DETAIL (Apple Classical Style) ── */
.rd-loading { text-align: center; padding: 40px; color: var(--muted); }

.rd-hero {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding-bottom: 24px;
  position: relative;
}
.rd-back {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent); color: var(--bg); border: none;
  font-size: 22px; font-weight: 600; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: opacity .15s;
  -webkit-tap-highlight-color: transparent;
}
.rd-back:active { opacity: .7; }
@media (hover: hover) { .rd-back:hover { opacity: .85; } }
.rd-hero .rd-back { position: absolute; top: 0; left: 0; }
.rd-cover {
  width: 240px; height: 240px; border-radius: 14px; overflow: hidden;
  background: var(--surface); box-shadow: 0 12px 40px rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.rd-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rd-cover-placeholder { color: var(--muted); }

.rd-composer {
  font-size: 14px; color: var(--accent); font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
}
.rd-work {
  font-size: 20px; font-weight: 800; margin-top: 4px;
  max-width: 500px;
}
.rd-interpreten {
  font-size: 13px; color: rgba(255,255,255,.55); margin-top: 6px;
  max-width: 400px;
}
.rd-meta {
  font-size: 12px; color: rgba(255,255,255,.35); margin-top: 4px;
}

.rd-play-all {
  margin-top: 16px; padding: 10px 28px; border-radius: 99px;
  background: linear-gradient(135deg, var(--accent), #a08030);
  border: none; color: #000; font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; box-shadow: 0 4px 16px rgba(201,168,76,.35);
  transition: transform .1s, box-shadow .1s;
}
.rd-play-all:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(201,168,76,.45); }
.rd-play-all:active { transform: translateY(1px); }

/* ── Track Rows ── */
.rd-tracklist { overflow: hidden; }
.rd-track {
  display: grid; grid-template-columns: 32px 1fr auto;
  gap: 10px; padding: 14px 4px; align-items: center;
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: background .12s;
}
.rd-track:last-child { border-bottom: none; }
.rd-track.playable { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.rd-track.playable:active { background: rgba(255,255,255,.05); }
@media (hover: hover) { .rd-track.playable:hover { background: rgba(255,255,255,.04); } }
.rd-track.playing { background: rgba(201,168,76,.08); }
.rd-track.playing .rd-track-title { color: var(--accent); font-weight: 700; }
.rd-track.playing .rd-track-num { color: var(--accent); }

.rd-track-num { font-size: 14px; color: rgba(255,255,255,.4); text-align: right; font-variant-numeric: tabular-nums; }
.rd-track-title { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-track-dur { font-size: 12px; color: rgba(255,255,255,.3); font-variant-numeric: tabular-nums; }

.rd-section-heading { padding: 24px 4px 10px; }
.rd-section-heading:first-child { padding-top: 4px; }
.rd-tracklist + .rd-section-heading { padding-top: 28px; }
.rd-section-composer {
  font-size: 11px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px;
  display: flex; align-items: center; gap: 6px;
}
.rd-section-no-composer { margin-bottom: 2px; }
.rd-section-edit {
  background: none; border: none; cursor: pointer; padding: 2px;
  color: var(--muted); opacity: 0; transition: opacity .15s;
}
.rd-section-heading:hover .rd-section-edit { opacity: .6; }
.rd-section-edit:hover { opacity: 1 !important; color: var(--accent); }
.rd-section-work {
  font-family: 'Bodoni Moda', Georgia, serif;
  font-size: 17px; font-weight: 500; color: var(--text);
  letter-spacing: .01em; line-height: 1.3;
}

/* ── Footer Actions (diskret) ── */
.rd-footer {
  display: flex; gap: 12px; justify-content: center;
  margin-top: 24px; padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.04);
}
.rd-action-btn {
  font-size: 12px; padding: 8px 16px; border-radius: 8px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.5); font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; transition: background .15s, color .15s;
}
.rd-action-btn:hover { background: rgba(255,255,255,.08); color: rgba(255,255,255,.7); }
.rd-action-btn:disabled { opacity: .4; cursor: not-allowed; }
.rd-action-danger:hover { background: rgba(239,68,68,.12); color: #f87171; border-color: rgba(239,68,68,.2); }

@media (max-width: 768px) {
  .rd-cover { width: 200px; height: 200px; }
  .rd-work { font-size: 17px; }
  .rd-track { padding: 13px 2px; grid-template-columns: 28px 1fr auto; }
  .rd-track-title { font-size: 14px; }
}

/* ── REQUEST BADGE ── */
.request-badge { display: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #000; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.request-badge.active { display: inline-block; }
.nav-item .request-badge { margin-left: 6px; vertical-align: middle; }
.btab .request-badge { position: absolute; top: 2px; right: calc(50% - 20px); }
.sub-tab .request-badge { margin-left: 4px; vertical-align: middle; font-size: 10px; min-width: 16px; height: 16px; line-height: 16px; padding: 0 4px; }

/* ── REQUEST CARDS ── */
.request-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.request-card { border: 1px solid rgba(255,255,255,.06); border-radius: 14px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.request-cover { width: 100%; aspect-ratio: 1/1; overflow: hidden; background: var(--bg); position: relative; }
.request-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.request-info { padding: 10px 12px 8px; }
.request-title { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.request-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.request-actions { display: flex; gap: 8px; padding: 0 12px 12px; }

/* ── SEARCH HIGHLIGHT ── */
mark { background: rgba(201,168,76,.3); color: var(--text); border-radius: 2px; padding: 0 1px; }

/* ── SOURCE BADGE ── */
.source-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em;
}
.source-badge.local { background: rgba(34,197,94,.2); color: #4ade80; }
.source-badge.musicbrainz { background: rgba(147,130,245,.2); color: #a5b4fc; }
.source-badge.tidal { background: rgba(14,165,233,.2); color: #38bdf8; }

/* ── PLEX SSO & SETUP ── */
.btn-plex {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 14px; border-radius: 12px;
  background: linear-gradient(135deg, #e5a00d, #cc7b19);
  color: #000; font-weight: 700; font-size: 15px;
  border: none; cursor: pointer;
  box-shadow: 0 4px 16px rgba(229,160,13,.3);
  transition: transform .1s, box-shadow .1s;
}
.btn-plex:hover { transform: translateY(-1px); }
.btn-plex:active { transform: translateY(1px); }

.btn-link {
  display: block; width: 100%; text-align: center;
  background: none; border: none; color: var(--muted);
  font-size: 13px; cursor: pointer; padding: 8px;
  text-decoration: underline; text-underline-offset: 3px;
}
.btn-link:hover { color: var(--text); }

.login-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--muted); font-size: 12px; margin: 4px 0;
}
.login-divider::before, .login-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border2);
}

.setup-wizard .setup-step { display: grid; gap: 14px; }
.setup-progress { display: flex; justify-content: center; gap: 8px; padding-top: 16px; }
.setup-progress .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border2); transition: background .3s; }
.setup-progress .dot.active { background: var(--accent); }

.setup-server-list { display: grid; gap: 10px; }
.setup-server-card {
  display: block; width: 100%; text-align: left;
  padding: 16px 18px; border-radius: 12px;
  background: rgba(255,255,255,.04); border: 1px solid var(--border2);
  color: var(--text); cursor: pointer; transition: border-color .15s, background .15s;
}
.setup-server-card:hover { border-color: var(--accent); background: rgba(201,168,76,.08); }
.setup-server-card:disabled { opacity: .5; cursor: not-allowed; }

/* ── DOWNLOAD ACTIVITY BADGE ── */
.download-badge { position: absolute; top: 4px; right: calc(50% - 18px); width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: none; animation: badge-pulse 1.5s ease infinite; }
.download-badge.active { display: block; }
@keyframes badge-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
.btab { position: relative; }

/* ── PWA PULL-TO-REFRESH ── */
.ptr-indicator {
  position: fixed; top: env(safe-area-inset-top, 0px); left: 0; right: 0; z-index: 35;
  display: flex; align-items: center; justify-content: center;
  height: 0; overflow: hidden;
  background: linear-gradient(180deg, rgba(201,168,76,.15) 0%, transparent 100%);
  transition: height .2s ease; pointer-events: none;
}
.ptr-indicator.pulling { transition: none; }
.ptr-spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid rgba(201,168,76,.2); border-top-color: var(--accent);
  opacity: 0; transform: scale(.6); transition: opacity .2s, transform .2s;
}
.ptr-indicator.visible .ptr-spinner { opacity: 1; transform: scale(1); }
.ptr-indicator.refreshing .ptr-spinner { animation: ptr-spin .6s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* ── BOTTOM TAB BAR ── */
#bottomNav { display: none; }

/* ── MOBILE ── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  input, select, textarea { font-size: 16px !important; }
  #sidebar { display: none !important; }
  #bottomNav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 80;
    background: rgba(10,10,10,.75); border-top: 1px solid rgba(255,255,255,.06);
    backdrop-filter: blur(24px) saturate(1.5); -webkit-backdrop-filter: blur(24px) saturate(1.5);
    justify-content: space-around; align-items: stretch;
    padding: 0 0 env(safe-area-inset-bottom, 0px);
  }
  .btab {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    gap: 2px; padding: 8px 0; border: none; background: none;
    color: var(--muted); font-size: 10px; font-weight: 600;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .btab.active { color: var(--accent); filter: drop-shadow(0 0 6px rgba(201,168,76,.4)); }
  .btab-icon { display: flex; align-items: center; justify-content: center; }
  .btab-icon .icon { width: 22px; height: 22px; }
  .btab-label { font-size: 10px; }

  #topBar { display: none !important; }

  /* Status-bar blur backdrop (Notch-Bereich) */
  body::before {
    content: ""; position: fixed; top: 0; left: 0; right: 0;
    height: env(safe-area-inset-top, 0px);
    background: rgba(10,10,10,.75);
    backdrop-filter: blur(24px) saturate(1.5); -webkit-backdrop-filter: blur(24px) saturate(1.5);
    z-index: 9999; pointer-events: none;
  }

  html { overflow-x: hidden; width: 100%; }
  body { overflow-x: hidden; overflow-y: auto; height: auto; min-height: 100dvh; width: 100%; max-width: 100vw; }
  #appShell { overflow: visible; min-height: 100dvh; max-width: 100vw; }
  #content {
    margin-top: 0;
    padding: calc(16px + env(safe-area-inset-top, 0px)) 12px calc(72px + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden; overflow-y: visible; max-width: 100vw;
    will-change: transform;
  }

  .toast { bottom: calc(68px + env(safe-area-inset-bottom, 0px)); left: 12px; }
  .search-fab {
    display: flex;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px)); right: 16px;
  }
  .scroll-top {
    bottom: calc(72px + 60px + env(safe-area-inset-bottom, 0px)); right: 16px;
  }

  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .card-animate { animation: none; opacity: 1; transform: none; }
  .login-box { width: calc(100% - 32px); max-width: 380px; padding: 28px 20px; }
  .page-title { font-size: 18px; }
  .sub-tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .sub-tabs::-webkit-scrollbar { display: none; }
  .sub-tab { white-space: nowrap; flex-shrink: 0; }
  .settings-section { padding: 14px; }

  .request-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }

  @media (max-width: 768px) {
    .modal-backdrop { align-items: flex-end; }
    .modal-box { border-radius: 16px 16px 0 0; max-width: 100%; width: 100%; animation: sheet-up .25s ease; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
    @keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
  }
}

@keyframes btn-spin { to { transform: rotate(360deg); } }
.btn-loading { pointer-events: none; opacity: .7; }
.btn-loading::after { content: ""; display: inline-block; width: 12px; height: 12px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: btn-spin .6s linear infinite; margin-left: 6px; vertical-align: middle; }

/* ── DISCOVERY VIEW ── */

.disc-spotlight-title, .disc-epoch-title {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); margin-bottom: 16px;
}
.disc-epoch-title { margin-top: 40px; }

/* Spotlight rows — portrait left, text right */
.disc-spotlight-row {
  display: flex; overflow: hidden;
  border-radius: 14px;
  background: var(--surface); border: 1px solid rgba(255,255,255,.06);
  margin-bottom: 12px;
  transition: border-color .2s;
  min-height: 140px;
}
.disc-spotlight-row:hover { border-color: rgba(201,168,76,.25); }

.disc-spotlight-portrait {
  width: auto; height: calc(100% - 28px); aspect-ratio: 1; flex-shrink: 0;
  object-fit: cover; background: var(--bg);
  display: block; border-radius: 50%;
  margin: 14px 0 14px 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
}
.disc-spotlight-body {
  flex: 1; min-width: 0; padding: 16px 18px;
  display: flex; flex-direction: column; justify-content: center;
}
.disc-spotlight-epoch {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); font-weight: 600;
}
.disc-spotlight-name {
  font-family: 'Bodoni Moda', serif; font-weight: 500;
  font-size: 20px; letter-spacing: 0.12em;
  color: #fff; line-height: 1.1; margin-top: 2px;
}
.disc-spotlight-life {
  font-size: 11px; color: rgba(255,255,255,.35); margin-top: 3px;
}
.disc-spotlight-divider {
  width: 28px; height: 1px; background: rgba(201,168,76,.35);
  margin: 10px 0;
}
.disc-spotlight-work-genre {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--accent); font-weight: 600; margin-bottom: 3px;
}
.disc-spotlight-work-title {
  font-size: 14px; font-weight: 700; color: var(--text);
  line-height: 1.3;
}
.disc-spotlight-work-sub {
  font-size: 11px; color: var(--muted); margin-top: 2px;
}

/* Epoch timeline */
.disc-epoch-timeline {
  position: relative;
  padding-left: 24px;
}
.disc-epoch-timeline::before {
  content: '';
  position: absolute; left: 5px; top: 8px; bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, rgba(201,168,76,.0), rgba(201,168,76,.35) 10%, rgba(201,168,76,.35) 90%, rgba(201,168,76,.0));
}

.disc-epoch-row {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 4px;
  border: none; background: none; cursor: pointer;
  width: 100%; text-align: left;
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: background .12s;
  position: relative;
}
.disc-epoch-row:last-child { border-bottom: none; }
.disc-epoch-row:hover { background: rgba(255,255,255,.03); }
.disc-epoch-row:active { background: rgba(255,255,255,.05); }

.disc-epoch-dot {
  position: absolute; left: -21px; top: 50%; transform: translateY(-50%);
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(201,168,76,.4);
  flex-shrink: 0;
}

.disc-epoch-text {
  display: flex; flex-direction: column; gap: 3px;
}

.disc-epoch-label {
  font-family: 'Bodoni Moda', serif; font-weight: 500;
  font-size: 22px; letter-spacing: 0.08em; color: #fff;
  line-height: 1.2;
}

.disc-epoch-years {
  font-size: 12px; color: rgba(255,255,255,.3);
  letter-spacing: 0.06em;
}

/* Composer grid (inside epoch) */
.disc-section-back {
  display: flex; align-items: center; gap: 10px; margin-bottom: 20px;
}
.disc-section-title { font-size: 18px; font-weight: 700; }

.disc-composer-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.disc-composer-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 8px 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid rgba(255,255,255,.06);
  cursor: pointer; transition: border-color .2s, box-shadow .2s;
}
.disc-composer-card:hover {
  border-color: rgba(201,168,76,.3);
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.disc-composer-portrait-wrap {
  width: 80px; height: 80px; border-radius: 50%; overflow: hidden;
  background: var(--bg); margin-bottom: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
}
.disc-composer-portrait-wrap img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.disc-composer-name {
  font-family: 'Bodoni Moda', serif; font-weight: 500;
  font-size: 14px; letter-spacing: 0.1em;
  color: #fff; text-align: center; line-height: 1.2;
}
.disc-composer-life {
  font-size: 10px; color: var(--muted); margin-top: 3px; text-align: center;
}

/* Composer hero + works */
.disc-composer-hero {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; margin-bottom: 28px;
}
.disc-hero-portrait {
  width: 120px; height: 120px; border-radius: 50%;
  object-fit: cover; background: var(--bg);
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.disc-hero-name {
  font-family: 'Bodoni Moda', serif; font-weight: 500;
  font-size: clamp(22px, 6vw, 40px); letter-spacing: 0.14em;
  color: #fff; margin-top: 16px;
}
.disc-hero-dates {
  font-size: 13px; color: var(--muted); margin-top: 4px;
}

.disc-genre-title {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--accent); margin: 24px 0 10px;
  display: flex; align-items: center; gap: 6px;
}
.disc-genre-sub {
  font-size: 12px; font-weight: 600; color: var(--muted);
  margin: 16px 0 6px; padding-left: 2px;
}
.disc-works-list {
  background: var(--surface); border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px; overflow: hidden;
}
.disc-work-row {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background .12s;
}
.disc-work-row:last-child { border-bottom: none; }
.disc-work-row:hover { background: rgba(255,255,255,.03); }
.disc-work-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.disc-work-title .icon { color: var(--accent); flex-shrink: 0; }
.disc-work-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.disc-work-meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.disc-work-genre-tag {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); background: rgba(255,255,255,.06);
  padding: 2px 8px; border-radius: 4px; font-weight: 600;
}
.disc-work-popular { border-left: 3px solid var(--accent); }
.disc-work-popular .disc-work-title { color: var(--accent); }

/* Work row accordion */
.disc-work-row[data-work] { cursor: pointer; }
.disc-work-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.disc-work-info { flex: 1; min-width: 0; }
.disc-work-chevron {
  color: var(--muted); flex-shrink: 0;
  transition: transform .2s ease;
  transform: rotate(180deg);
}
.disc-work-open .disc-work-chevron { transform: rotate(0deg); }
.disc-work-open { background: rgba(255,255,255,.03); }

/* Releases panel inside accordion */
.disc-work-releases {
  overflow: hidden;
  max-height: 0;
  transition: max-height .3s ease;
}
.disc-work-open .disc-work-releases {
  max-height: 2000px;
  padding-top: 10px;
}

.disc-releases-loading, .disc-releases-empty {
  font-size: 12px; color: var(--muted);
  padding: 12px 0; text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.disc-releases-loading .icon { animation: btn-spin .8s linear infinite; }

.disc-releases-section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--accent);
  padding: 8px 0 4px; margin-top: 4px;
}
.disc-releases-section-label:first-child { margin-top: 0; }

.disc-release-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.disc-release-card:last-child { border-bottom: none; }

.disc-release-cover {
  width: 48px; height: 48px; border-radius: 6px; overflow: hidden;
  background: rgba(255,255,255,.05); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.disc-release-cover img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.disc-release-info {
  flex: 1; min-width: 0; cursor: pointer;
}
.disc-release-title {
  font-size: 13px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.disc-release-composer {
  font-size: 11px; color: var(--muted); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.disc-release-meta {
  font-size: 10px; color: var(--muted); margin-top: 1px;
}
.disc-release-actions {
  flex-shrink: 0; display: flex; gap: 4px;
}
.disc-release-actions button {
  background: none; border: 1px solid rgba(255,255,255,.12);
  color: var(--muted); border-radius: 8px;
  width: 32px; height: 32px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.disc-release-actions button:hover {
  color: var(--accent); border-color: var(--accent);
}

/* Discovery mobile */
@media (max-width: 768px) {
  /* Spotlight mobile tweaks */
  .disc-spotlight-portrait { margin-left: 12px; margin-top: 12px; margin-bottom: 12px; height: calc(100% - 24px); }
  .disc-spotlight-body { padding: 14px 14px; }
  .disc-spotlight-name { font-size: 17px; letter-spacing: 0.1em; }
  .disc-spotlight-work-title { font-size: 13px; }

  /* Epochen timeline mobile */
  .disc-epoch-title { margin-top: 28px; }
  .disc-epoch-timeline { padding-left: 22px; }
  .disc-epoch-row { padding: 15px 4px; }
  .disc-epoch-label { font-size: 19px; }
  .disc-epoch-dot { left: -19px; }

  /* Composer grid: exactly 3 columns, full width */
  .disc-composer-grid {
    grid-template-columns: repeat(3, 1fr); gap: 10px;
  }
  .disc-composer-card { padding: 14px 6px 12px; }
  .disc-composer-portrait-wrap { width: 64px; height: 64px; }
  .disc-composer-name { font-size: 12px; letter-spacing: 0.06em; }
  .disc-composer-life { font-size: 9px; }

  /* Composer hero */
  .disc-hero-portrait { width: 88px; height: 88px; }
  .disc-hero-name { letter-spacing: 0.1em; }
  .disc-hero-dates { font-size: 12px; }

  /* Works */
  .disc-section-back { gap: 8px; }
  .disc-section-title { font-size: 16px; }
  .disc-genre-title { font-size: 12px; }
  .disc-work-row { padding: 10px 12px; }
  .disc-work-title { font-size: 13px; }
  .disc-work-sub { font-size: 11px; }
  .disc-release-cover { width: 42px; height: 42px; }
  .disc-release-title { font-size: 12px; }
}

/* ── AUDIO PLAYER ── */
#player-bar {
  position: fixed; bottom: 0; left: var(--sidebar-w); right: 0;
  background: rgba(10, 10, 10, 0.97);
  backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border-top: 1px solid rgba(255,255,255,.08);
  z-index: 70;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}
#player-bar.visible { transform: translateY(0); }

.player-progress-wrap {
  position: absolute; top: -6px; left: 0; right: 0; height: 12px;
  cursor: pointer; z-index: 2;
}
.player-progress-wrap::before {
  content: ""; position: absolute; top: 4px; left: 0; right: 0; height: 3px;
  background: rgba(255,255,255,.08); border-radius: 2px;
}
.player-progress-bar {
  position: absolute; top: 4px; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--accent), #d4b85a);
  border-radius: 2px; transition: width 0.1s linear;
  pointer-events: none;
}
#player-bar.seeking .player-progress-bar { transition: none; }

.player-progress-thumb {
  position: absolute; top: 0px; left: 0%;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(201,168,76,.5);
  transform: translateX(-50%) scale(0);
  transition: transform .15s ease;
  pointer-events: none;
}
.player-progress-wrap:hover .player-progress-thumb,
#player-bar.seeking .player-progress-thumb {
  transform: translateX(-50%) scale(1);
}
#player-bar.seeking .player-progress-wrap::before { height: 4px; top: 3.5px; }
#player-bar.seeking .player-progress-bar { height: 4px; top: 3.5px; }

.player-content {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px; height: 64px;
}

.player-track-info { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.player-cover {
  width: 44px; height: 44px; border-radius: 8px; overflow: hidden;
  background: var(--surface); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: var(--muted);
}
.player-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.player-meta { min-width: 0; }
.player-title {
  font-size: 13px; font-weight: 700; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 300px;
}
.player-subtitle {
  font-size: 11px; color: var(--muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 300px;
}

.player-controls { display: flex; align-items: center; gap: 8px; }
.player-btn {
  background: none; border: none; color: var(--muted); cursor: pointer;
  padding: 8px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  transition: color .15s, background .15s;
}
.player-btn:hover { color: var(--text); background: rgba(255,255,255,.06); }
.player-btn-play {
  width: 44px; height: 44px; background: var(--accent) !important;
  color: #000 !important; border-radius: 50%;
  box-shadow: 0 2px 12px rgba(201,168,76,.35);
}
.player-btn-play:hover { background: #d4b85a !important; }
.player-btn-play .icon { margin-left: 2px; }

.player-time { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.player-time-sep { opacity: .4; }

/* Loading state */
#player-bar.loading .player-cover::after {
  content: ""; position: absolute; inset: 0;
  border: 2px solid rgba(201,168,76,.2); border-top-color: var(--accent);
  border-radius: 8px; animation: btn-spin .8s linear infinite;
}
#player-bar.loading .player-cover { position: relative; }

/* Tracklist play button & highlighting */
.track-play-btn {
  background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 2px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: color .15s;
  width: 24px; height: 24px; flex-shrink: 0;
}
.track-play-btn:hover { color: var(--accent); }

.track-row { transition: background .15s; border-radius: 4px; }
.track-row:hover { background: rgba(255,255,255,.03); }
.track-row.playing { background: rgba(201,168,76,.08); }
.track-row.playing .track-play-btn { color: var(--accent); }
.track-row.playing .track-title { color: var(--accent); font-weight: 700; }
.track-row .track-num { transition: opacity .15s; }
.track-row:hover .track-num { opacity: 0; }
.track-row:hover .track-play-btn { opacity: 1; }

.track-num-wrap {
  position: relative; width: 30px; display: flex; align-items: center; justify-content: flex-end;
}
.track-num-wrap .track-play-btn {
  position: absolute; inset: 0; opacity: 0; width: 100%; justify-content: flex-end;
}
.track-row:hover .track-num-wrap .track-play-btn { opacity: 1; }
.track-row.playing .track-num { opacity: 0; }
.track-row.playing .track-num-wrap .track-play-btn { opacity: 1; }

/* Body padding when player is active */
body.player-active #content { padding-bottom: 110px; }
body.player-active .toast { bottom: 90px; }
body.player-active .scroll-top { bottom: 90px; }

/* ── FULL-SCREEN PLAYER ── */
#full-player {
  position: fixed; inset: 0; z-index: 200;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform .5s cubic-bezier(.25, 1, .5, 1);
  -webkit-user-select: none; user-select: none;
  will-change: transform, opacity;
}
#full-player.open { transform: translateY(0); }

/* Queue layer — sits behind the player, full height */
.fp-queue-layer {
  position: absolute; inset: 0;
  padding: 48vh 20px env(safe-area-inset-bottom, 16px);
  z-index: 0;
  overflow: hidden;
}
.fp-queue-bg {
  position: absolute; inset: -40px;
  background-size: cover; background-position: center;
  filter: blur(60px) saturate(1.4) brightness(.25);
  z-index: 0;
}
.fp-queue-layer::after {
  content: ""; position: absolute; inset: 0;
  background: #0a0a0a;
  z-index: 0;
}
.fp-queue-list {
  position: relative; z-index: 1;
  height: 100%; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-top: 8px;
}

/* Player layer — slides up to reveal queue */
.fp-player-layer {
  position: absolute; inset: 0;
  background: #0a0a0a;
  border-radius: 16px 16px 0 0;
  z-index: 1;
  transition: transform .6s cubic-bezier(.25, 1, .5, 1);
  overflow: hidden;
  will-change: transform;
}
.fp-bottom-fade {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 45%; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(10,10,10,0.4) 40%, rgba(10,10,10,0.85) 70%, #0a0a0a 100%);
  will-change: transform;
}
#full-player.open .fp-player-layer { border-radius: 0; }
#full-player.swiping .fp-player-layer { border-radius: 16px 16px 0 0; }
#full-player.queue-open .fp-player-layer {
  transform: translateY(-55%);
}

.fp-inner {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center;
  padding: calc(env(safe-area-inset-top, 20px) + 12px) 24px calc(env(safe-area-inset-bottom, 20px) + 16px);
}

/* Blurred cover background */
.fp-bg {
  position: absolute; inset: -40px; z-index: 0;
  background-size: cover; background-position: center;
  filter: blur(60px) saturate(1.4) brightness(.35);
  opacity: 0; transition: opacity .5s ease;
  will-change: transform;
}
.fp-bg.has-image { opacity: 1; }
.fp-inner { position: relative; z-index: 2; }

.fp-drag-handle {
  width: 100%; display: flex; justify-content: center;
  padding: 8px 0 16px; cursor: pointer; flex-shrink: 0;
}
.fp-drag-pill {
  width: 36px; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,.25);
}

.fp-cover-wrap { flex-shrink: 0; }
.fp-cover {
  width: min(75vw, 340px); height: min(75vw, 340px);
  border-radius: 16px; overflow: hidden;
  background: var(--surface); flex-shrink: 0;
  box-shadow: 0 16px 48px rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease;
}
.fp-cover:active { transform: scale(.97); }
.fp-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fp-cover-placeholder { color: var(--muted); }

.fp-info {
  text-align: center; margin-top: 24px; width: 100%;
  max-width: 340px; flex-shrink: 0;
}
.fp-movement {
  font-size: 18px; font-weight: 800; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.fp-work {
  font-size: 13px; color: rgba(255,255,255,.45); margin-top: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-weight: 500; letter-spacing: 0.02em;
}
.fp-performer {
  font-size: 13px; color: rgba(255,255,255,.6); margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.fp-seek {
  width: 100%; max-width: 340px; margin-top: 24px; flex-shrink: 0;
}
.fp-seek-wrap {
  position: relative; height: 24px; cursor: pointer;
  display: flex; align-items: center;
}
.fp-seek-wrap::before {
  content: ""; position: absolute; left: 0; right: 0; top: 10px;
  height: 4px; background: rgba(255,255,255,.12); border-radius: 2px;
}
.fp-seek-bar {
  position: absolute; top: 10px; left: 0; height: 4px; width: 0%;
  background: var(--accent); border-radius: 2px;
  pointer-events: none;
}
.fp-seek-thumb {
  position: absolute; top: 5px; left: 0%;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 10px rgba(201,168,76,.5);
  transform: translateX(-50%);
  pointer-events: none;
}

.fp-times {
  display: flex; justify-content: space-between;
  font-size: 11px; color: rgba(255,255,255,.45); margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.fp-controls {
  display: flex; align-items: center; gap: 20px;
  margin-top: 24px; flex-shrink: 0;
}
.fp-btn {
  background: none; border: none; color: var(--text); cursor: pointer;
  padding: 10px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  transition: background .15s, transform .1s; position: relative;
}
.fp-btn:active { transform: scale(.9); }
.fp-btn-skip { padding: 14px; }
.fp-btn-sm {
  color: rgba(255,255,255,.5); padding: 10px;
}
.fp-btn-sm.active { color: var(--accent); }
.fp-btn-play {
  width: 72px; height: 72px;
  background: var(--accent) !important; color: #000 !important;
  border-radius: 50%;
  box-shadow: 0 4px 24px rgba(201,168,76,.4);
}
.fp-btn-play:active { transform: scale(.93); background: #d4b85a !important; }

/* Repeat Badge (1 / W) */
.repeat-badge {
  position: absolute; top: 2px; right: 2px;
  font-size: 9px; font-weight: 800; color: var(--accent);
  line-height: 1;
}
.repeat-work-badge {
  color: var(--accent);
  font-family: 'Bodoni Moda', serif;
  font-size: 10px; font-weight: 700;
}

/* Secondary controls row (repeat + codec + queue) */
.fp-secondary {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; max-width: 340px; margin-top: 12px; flex-shrink: 0;
}
.fp-codec {
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255,255,255,.3); white-space: nowrap;
}

/* Composer name */
.fp-composer {
  margin-top: auto; flex-shrink: 0;
  font-family: 'Bodoni Moda', serif; font-weight: 500;
  font-size: clamp(24px, 8vw, 52px); letter-spacing: 0.14em;
  color: #fff; text-align: center;
  line-height: 1.1; padding: 0 8px;
  max-width: 100%; white-space: nowrap;
}

/* ── QUEUE LIST (behind player layer) ── */
.fp-queue-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 12px; border-radius: 12px; cursor: pointer;
  transition: background .12s;
  -webkit-tap-highlight-color: transparent;
}
.fp-queue-item:active { background: rgba(255,255,255,.07); }
.fp-queue-num {
  color: rgba(255,255,255,.25); font-size: 14px; width: 26px;
  text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums;
}
.fp-queue-title {
  font-size: 15px; color: rgba(255,255,255,.7); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
}
.fp-queue-empty {
  padding: 32px; text-align: center; color: rgba(255,255,255,.25); font-size: 14px;
}

/* ── PLAYER MOBILE ── */
@media (max-width: 768px) {
  #player-bar {
    left: 12px; right: 12px;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    border-radius: 22px;
    border: 1px solid rgba(201,168,76,.20);
    border-top: 1px solid rgba(201,168,76,.20);
    box-shadow: 0 4px 24px rgba(0,0,0,.4), 0 2px 12px rgba(201,168,76,.08),
                inset 0 0 30px rgba(201,168,76,.04);
    overflow: hidden;
  }
  .player-content { padding: 10px 16px; height: 68px; gap: 12px; position: relative; z-index: 2; }
  .player-cover {
    width: 48px; height: 48px; border-radius: 10px;
    box-shadow: 0 0 0 1.5px rgba(201,168,76,.25), 0 2px 8px rgba(0,0,0,.3);
  }
  .player-title {
    font-size: 13px; max-width: 160px;
    display: block; overflow: hidden; white-space: nowrap;
  }
  .player-meta { min-width: 0; overflow: hidden; }
  .player-title.marquee {
    animation: marquee 8s linear infinite;
    text-overflow: unset; max-width: none; width: max-content;
  }
  @keyframes marquee {
    0%, 15%  { transform: translateX(0); }
    50%, 65% { transform: translateX(calc(-100% + 160px)); }
    100%     { transform: translateX(0); }
  }
  .player-subtitle { font-size: 11px; max-width: 160px; }
  .player-time { display: none; }
  .player-btn-play { width: 42px; height: 42px; }
  #playerPrev { display: none; }

  /* Progress als Gold-Schimmer über die ganze Pill */
  .player-progress-wrap {
    top: 0; left: 0; right: 0; bottom: 0; height: auto;
    border-radius: 22px; z-index: 1; cursor: default;
  }
  .player-progress-wrap::before { display: none; }
  .player-progress-bar {
    top: 0; height: 100%; border-radius: 22px;
    background: linear-gradient(90deg, rgba(201,168,76,.06), rgba(201,168,76,.14));
    box-shadow: inset -8px 0 16px -8px rgba(201,168,76,.2);
  }
  .player-progress-thumb { display: none; }

  /* Tracklist: Play-Buttons immer sichtbar auf Mobile (kein Hover) */
  .track-num-wrap .track-num { display: none; }
  .track-num-wrap .track-play-btn { position: static; opacity: 1; width: 30px; }

  body.player-active #content {
    padding-bottom: calc(164px + env(safe-area-inset-bottom, 0px));
  }

  body.player-active .toast {
    bottom: calc(64px + 68px + env(safe-area-inset-bottom, 0px) + 16px);
  }
  body.player-active .search-fab {
    bottom: calc(64px + 68px + env(safe-area-inset-bottom, 0px) + 16px);
  }
  body.player-active .scroll-top {
    bottom: calc(64px + 68px + 60px + env(safe-area-inset-bottom, 0px) + 16px);
  }

  /* Full player mobile tweaks */
  .fp-inner { padding-left: 20px; padding-right: 20px; }
  .fp-cover { width: min(80vw, 360px); height: min(80vw, 360px); }
  .fp-seek, .fp-info, .fp-secondary, .fp-composer { max-width: min(80vw, 360px); }
  .fp-controls { gap: 16px; }
  .fp-btn-play { width: 66px; height: 66px; }
  .fp-queue-layer { padding-left: 16px; padding-right: 16px; }
}

/* ── COMPOSER VIEW TOGGLE ── */
.cv-toggle {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.cv-toggle-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.cv-toggle-btn.active {
  background: var(--accent);
  color: #000;
}

/* ── CLASSIC MODE (Kompakte Zeilen → Navigation) ── */
.cv-classic {
  display: flex !important;
  flex-direction: column;
  gap: 0;
}
.cv-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .12s;
}
.cv-row:last-child { border-bottom: none; }
.cv-row:active { background: rgba(255,255,255,.03); }
.cv-row-cover {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cv-row-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cv-row-info {
  flex: 1;
  min-width: 0;
}
.cv-row-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cv-row-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.cv-row-chevron {
  flex-shrink: 0;
  color: var(--muted);
}

/* ── GRID MODE (Nur Cover) ── */
.cv-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.cv-grid-card {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border-radius: 10px;
  overflow: hidden;
  transition: transform .12s;
}
.cv-grid-card:active { transform: scale(.97); }
.cv-grid-cover {
  width: 100%;
  aspect-ratio: 1/1;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cv-grid-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ─── Composer-Biografie (Wikipedia) ─────────────────────── */
.cv-bio {
  margin: 4px 0 20px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}
.cv-bio-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.cv-bio-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}
.cv-bio-text.clamped {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cv-bio-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
}
.cv-bio-toggle {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.cv-bio-link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}
.cv-bio-link:hover { color: var(--text); }

/* ─── Weiterhören (Continue Listening) ───────────────────── */
.cw-section { margin-bottom: 24px; }
.cw-heading {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.cw-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cw-row::-webkit-scrollbar { display: none; }
.cw-card {
  flex: 0 0 140px;
  cursor: pointer;
}
.cw-card.loading { opacity: 0.5; }
.cw-cover {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.cw-cover img { width: 100%; height: 100%; object-fit: cover; }
.cw-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.25);
}
.cw-progress-bar { height: 100%; background: var(--accent); }
.cw-title {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cw-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Hörstatistik ───────────────────────────────────────── */
.stats-summary { display: flex; gap: 24px; margin-bottom: 20px; }
.stats-kpi-value { font-size: 22px; font-weight: 700; color: var(--accent); }
.stats-kpi-label { font-size: 12px; color: var(--muted); }
.stats-heading {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 22px 0 10px;
}
.stats-row { margin-bottom: 12px; }
.stats-row-head { display: flex; justify-content: space-between; gap: 12px; }
.stats-row-label {
  font-size: 14px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.stats-row-value { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.stats-row-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.stats-bar {
  height: 5px; border-radius: 3px;
  background: var(--surface2);
  margin-top: 5px;
  overflow: hidden;
}
.stats-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; }

/* ─── Werk-Vergleichsansicht ─────────────────────────────── */
.wd-list { display: flex; flex-direction: column; gap: 14px; max-width: 720px; margin: 0 auto; padding: 0 16px 40px; }
.wd-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 14px;
}
.wd-card-head { display: flex; gap: 14px; align-items: center; }
.wd-cover {
  width: 84px; height: 84px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.wd-cover img { width: 100%; height: 100%; object-fit: cover; }
.wd-card-info { flex: 1; min-width: 0; }
.wd-card-performers { font-size: 14px; font-weight: 600; color: var(--text); }
.wd-card-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.wd-card-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.wd-play, .wd-toggle, .wd-open {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  padding: 6px 12px;
  border-radius: 16px;
  border: 1px solid var(--border2);
  background: none;
  color: var(--text);
  cursor: pointer;
}
.wd-play { background: var(--accent); border-color: var(--accent); color: #0a0a0a; }
.wd-tracks { margin-top: 12px; }

/* Badge „N Aufnahmen" in der Composer-Detailansicht */
.cv-work-badge {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 1px 8px;
  vertical-align: middle;
  cursor: pointer;
}
/* Klickbarer Werk-Header in der Tracklist */
.rd-work-link { cursor: pointer; }
.rd-work-link:hover { color: var(--accent); }
