:root {
  --bg: #0b0b0d;
  --bg-elevated: #16161a;
  --bg-hover: #202024;
  --border: #26262b;
  --text: #ececee;
  --text-dim: #8a8a92;
  --accent: #6e5bff;
  --accent-hover: #8375ff;
  --danger: #ff5f5f;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding-bottom: 90px; /* Platz fuer Player-Leiste */
}

a { color: inherit; }
.dim { color: var(--text-dim); font-size: 13px; }
.hidden { display: none !important; }

/* --- Topbar --- */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(11,11,13,0.9);
  backdrop-filter: blur(8px);
  z-index: 50;
}
.logo { display: flex; align-items: center; flex-shrink: 0; }
.logo img { height: 36px; width: auto; display: block; }

.searchwrap { flex: 1; max-width: 640px; }
#search {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 14px;
}
#search:focus { outline: 1px solid var(--accent); }

.topright { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.account-menu-wrap { position: relative; }
.account-menu {
  position: absolute;
  top: calc(100% + 6px); right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 160px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  z-index: 200;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
.account-menu button, .account-menu a {
  background: none; border: none; color: var(--text);
  text-align: left; padding: 8px 10px; border-radius: 6px;
  font-size: 13px; cursor: pointer; text-decoration: none;
}
.account-menu button:hover, .account-menu a:hover { background: var(--bg-hover); }
#menu-logout { color: #f87171; }
.icon-link {
  text-decoration: none;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--bg-elevated);
  font-size: 13px;
}
.icon-link:hover { background: var(--bg-hover); }
button.icon-link { border: none; color: var(--text); cursor: pointer; font: inherit; }
button.icon-link:focus-visible { outline: 1px solid var(--accent); outline-offset: 1px; }

.telegram-btn {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 6px 6px 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
}
.telegram-btn:hover { border-color: #29a9eb; }
.telegram-icon {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--text);
}

.btn-ghost {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
}
.btn-ghost:hover { background: var(--bg-hover); }
.btn-ghost.full { width: 100%; margin-top: 12px; }

.btn-primary {
  background: var(--accent);
  border: none;
  color: white;
  padding: 10px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-hover); }

/* --- Producer-Groesse Toggle (Alle/Solo/Duo/3+) --- */
.producerBarWrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.producerBarWrap .searchwrap { flex: 1 1 320px; max-width: 480px; }
.starters-btn {
  background: var(--bg-elevated);
  border: 1px solid rgba(217,119,6,0.35);
  color: #c98a4b;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}
.starters-btn:hover { border-color: #d97706; color: #e0a05a; }
.starters-btn.active { background: rgba(217,119,6,0.22); border-color: #d97706; color: #f0b06a; }
.producer-toggle { display: flex; gap: 6px; background: var(--bg-elevated); padding: 4px; border-radius: 999px; border: 1px solid var(--border); }
.ptbtn {
  background: none; border: none; color: var(--text-dim);
  padding: 6px 14px; border-radius: 999px; font-size: 13px; cursor: pointer;
}
.ptbtn:hover { color: var(--text); }
.ptbtn.active { background: var(--accent); color: white; }

/* --- Layout --- */
.layout { display: flex; gap: 24px; padding: 24px; align-items: flex-start; }

.filters {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}
.filters h3 { margin-top: 0; font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); }
.filter-block { margin-bottom: 20px; }
.filter-block h4 { font-size: 12px; color: var(--text-dim); margin: 0 0 8px; font-weight: 500; }

.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}
.chip:hover { background: var(--bg-hover); }
.chip.active { background: var(--accent); border-color: var(--accent); color: white; }
.chip.exclude-active { background: var(--danger); border-color: var(--danger); color: white; }

.range-row { display: flex; align-items: center; gap: 6px; }
.range-row input {
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 13px;
}

#key-select, #producer-input {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 13px;
}

main { flex: 1; min-width: 0; }

/* --- Home rows --- */
.row { margin-bottom: 32px; }
.row h2 { font-size: 16px; margin: 0 0 12px; }
.row-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.row-scroll::-webkit-scrollbar { height: 6px; }
.row-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.card {
  flex: 0 0 200px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
}
.card:hover { background: var(--bg-hover); border-color: var(--accent); }
.thumb-producer {
  position: absolute;
  bottom: 6px; left: 8px;
  color: rgba(255,255,255,0.55);
  font-size: 10px;
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.title-line { display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; min-width: 0; }
.title-line .title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-line .meta-inline { font-size: 11px; color: var(--text-dim); white-space: nowrap; flex-shrink: 0; }
.card .tags { display: flex; flex-wrap: wrap; gap: 4px; }
.card .tag { font-size: 10px; padding: 2px 6px; border-radius: 999px; background: var(--bg); color: var(--text-dim); }

/* --- List (search results) --- */
.list-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-size: 13px; color: var(--text-dim); }
#sort-select { padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text); }

.sample-list { display: flex; flex-direction: column; gap: 4px; }
.sample-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
}
.sample-row:hover { background: var(--bg-elevated); }
.sample-row {
  position: relative;
  padding: 8px 14px;
}
.sample-row.selected, .sample-row.playing { background: var(--bg-elevated); }

.thumb {
  width: 44px; height: 44px;
  border-radius: 8px;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.thumb .play-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 12px;
  opacity: 0;
  transition: opacity .15s;
}
.sample-row:hover .thumb .play-btn { opacity: 1; }
.sample-row.playing .thumb .play-btn {
  opacity: 1;
  background: rgba(0,0,0,0.45);
  box-shadow: 0 0 0 2px #fff, 0 0 16px rgba(255,255,255,0.4);
}

.sample-row .title { flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sample-row .producer { font-size: 12px; color: var(--accent); width: 110px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sample-row .meta { font-size: 12px; color: var(--text-dim); width: 140px; flex-shrink: 0; }
.sample-row .tags { display: none; gap: 4px; width: 220px; flex-shrink: 0; }
@media (min-width: 900px) { .sample-row .tags { display: flex; flex-wrap: wrap; } }
.sample-row .tag { font-size: 10px; padding: 2px 6px; border-radius: 999px; background: var(--bg-elevated); color: var(--text-dim); }

.row-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.btn-similar {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
}
.btn-similar:hover { border-color: var(--accent); color: var(--text); }
.may-fit-heading { margin: 16px 0 8px; }
.may-fit-heading h2 { font-size: 13px; font-weight: 600; color: var(--text-dim); }
.icon-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  font-size: 13px;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }
.icon-btn.active { color: var(--accent); border-color: var(--accent); }

.card .card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 8px; }
.card .btn-similar { font-size: 10px; padding: 3px 9px; }
.card-bottom-icons { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.card .icon-btn { width: 26px; height: 26px; font-size: 11px; }
.card .thumb { width: 100%; height: 90px; border-radius: 8px; margin-bottom: 10px; }
.card .thumb .play-btn { width: 38px; height: 38px; }
.card .producer-name { color: var(--accent); }

.mehr-karte {
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border-style: dashed;
}
.mehr-karte:hover { background: var(--bg-elevated); border-color: var(--accent); }
.mehr-karte-inner { color: var(--text-dim); font-size: 14px; font-weight: 600; }
.mehr-karte:hover .mehr-karte-inner { color: var(--accent); }

/* --- Footer --- */
.site-footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  padding: 24px 0 90px;  /* unten Platz fuer die fixe Player-Leiste */
}
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--text); }

/* --- Player (groesser) --- */
.player-bar {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: min(920px, 96%);
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-bottom: none;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 100;
  min-height: 36px;
}
.player-info { width: 240px; flex-shrink: 0; }
#player-title { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#player-sub { font-size: 13px; margin-top: 2px; }
.sampled-warnung {
  font-size: 11px; color: #ef4444; margin-top: 3px;
  border: 1px solid rgba(239,68,68,0.5); border-radius: 6px;
  padding: 2px 8px; display: inline-block;
}
#audio-el { flex: 1; height: 44px; color-scheme: dark; border-radius: 8px; }
.player-actions { display: flex; gap: 10px; flex-shrink: 0; }
.player-actions .btn-ghost { padding: 10px 18px; font-size: 14px; }

/* --- Artist-Suche Banner --- */
.artist-banner {
  display: flex; gap: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}
.artist-banner img, .artist-banner-noimg {
  width: 72px; height: 72px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}
.artist-banner-noimg {
  background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.artist-banner-info { flex: 1; min-width: 0; }
.artist-banner-name { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.artist-banner-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 13px; }
.artist-banner-row .chip { font-size: 12px; padding: 3px 10px; cursor: default; }
.artist-banner-row .chip.meintest-du { cursor: pointer; }
.artist-banner-row .chip.meintest-du:hover { background: var(--accent); color: white; }
.artist-banner-row .chip.similar-artist:hover { background: var(--accent); color: white; }

/* --- Limit-Popup --- */
.limit-toast {
  position: fixed;
  bottom: 110px; left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 20px;
  max-width: 380px;
  text-align: center;
  z-index: 300;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
.limit-toast p { margin: 0 0 10px; font-size: 14px; }
.limit-toast .btn-primary { width: 100%; }

/* --- Sampled-Warnung beim Download (nicht nur im Player) --- */
.sampled-toast {
  position: fixed;
  bottom: 110px; left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  font-size: 13px;
  padding: 10px 16px;
  max-width: 380px;
  text-align: center;
  z-index: 300;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

/* --- Modal --- */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
}
.modal-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 340px;
  position: relative;
}
.modal-box h3 { margin-top: 0; }
.modal-box form { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.modal-box input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
.modal-actions { display: flex; gap: 8px; }
.modal-close { position: absolute; top: 12px; right: 14px; background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 16px; }
.error { color: var(--danger); font-size: 13px; }

.btn-google {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: white; color: #1f1f1f;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  margin-top: 14px;
}
.btn-google:hover { background: #f2f2f2; }

.consent-row {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12px; color: var(--text-dim);
  cursor: pointer;
}
.consent-row input { margin-top: 3px; accent-color: var(--accent); flex-shrink: 0; }
.consent-row a { color: var(--accent); }

@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .filters { width: 100%; position: static; }
  .topbar { flex-wrap: wrap; }
}
