/* player-page.css — Seite „Blunaas Player"
   Große Now-Playing-Karte + gut lesbare, flüssig scrollbare Playlist.
   Mobil-first, große Tippziele (>=44px), an die Design-Tokens angelehnt. */

#blunaa-player-page {
  --bpp-accent: var(--accent, #5b7fa6);
  --bpp-accent-lt: var(--accent-lt, #8aaac8);
  max-width: 980px;
  margin: 0 auto;
}

/* ── Now-Playing-Karte ─────────────────────────────────────── */
.bpp-now {
  background: linear-gradient(135deg, var(--bg-deep, #1c2333), var(--bg-deep2, #242c3d));
  color: #fff;
  border-radius: var(--radius-lg, 18px);
  padding: 1.5rem 1.5rem 1.25rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  position: relative;
  overflow: hidden;
}
.bpp-now::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 15% 0%, rgba(138,170,200,.28), transparent 60%);
  pointer-events: none;
}
.bpp-np-label {
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--bpp-accent-lt); font-weight: 600; margin-bottom: .5rem;
}
.bpp-np-title {
  font-size: clamp(20px, 5vw, 30px); font-weight: 700; line-height: 1.2;
  margin: 0 0 .25rem; word-break: break-word;
}
.bpp-np-artist { font-size: 14px; color: rgba(255,255,255,.72); }

/* Transport-Buttons */
.bpp-transport {
  display: flex; align-items: center; justify-content: center;
  gap: .75rem; margin-top: 1.25rem;
}
.bpp-tbtn {
  border: none; cursor: pointer;
  background: rgba(255,255,255,.1); color: #fff;
  width: 52px; height: 52px; border-radius: 50%;
  font-size: 20px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, transform .1s;
}
.bpp-tbtn:hover { background: rgba(255,255,255,.2); }
.bpp-tbtn:active { transform: scale(.94); }
.bpp-tbtn.play { width: 68px; height: 68px; font-size: 28px; background: var(--bpp-accent); }
.bpp-tbtn.play:hover { background: var(--accent-hover, #4a6d91); }

/* Lautstärke */
.bpp-vol-row {
  display: flex; align-items: center; gap: .6rem;
  margin-top: 1.1rem; color: rgba(255,255,255,.75); font-size: 13px;
}
.bpp-vol-row input[type=range] { flex: 1; accent-color: var(--bpp-accent-lt); height: 28px; }

/* ── Einstell-Leisten ──────────────────────────────────────── */
.bpp-controls { margin-top: 1.25rem; display: grid; gap: .9rem; }
.bpp-ctl-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.bpp-ctl-label {
  font-size: 12px; color: var(--text-muted, #5a6478);
  min-width: 92px; font-weight: 600;
}
.bpp-seg { display: inline-flex; border: 1px solid var(--border, #c5cdd8); border-radius: 10px; overflow: hidden; }
.bpp-seg button, .bpp-chip {
  border: none; background: var(--bg-white, #fff); color: var(--text-main, #1c2333);
  padding: 10px 14px; font-size: 13px; cursor: pointer; min-height: 44px;
  transition: background .15s, color .15s;
}
.bpp-seg button + button { border-left: 1px solid var(--border, #c5cdd8); }
.bpp-seg button.active, .bpp-chip.active {
  background: var(--bpp-accent); color: #fff;
}
.bpp-chip {
  border: 1px solid var(--border, #c5cdd8); border-radius: 10px;
  display: inline-flex; align-items: center; gap: .4rem;
}

/* ── Playlist ──────────────────────────────────────────────── */
.bpp-list-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 1.75rem 0 .5rem;
}
.bpp-list-head h2 { margin: 0; font-size: 18px; }
.bpp-status { font-size: 12px; color: var(--text-muted, #5a6478); }

.bpp-list {
  list-style: none; margin: 0; padding: 0;
  max-height: 62vh; overflow-y: auto;
  -webkit-overflow-scrolling: touch;   /* flüssiges Scrollen auf iOS */
  overscroll-behavior: contain;
  border: 1px solid var(--border, #c5cdd8);
  border-radius: var(--radius-lg, 18px);
  background: var(--bg-white, #fff);
}
.bpp-item {
  display: flex; align-items: center; gap: .85rem;
  padding: 14px 16px; cursor: pointer;
  border-bottom: 1px solid var(--border, #c5cdd8);
  min-height: 44px;
  transition: background .12s;
}
.bpp-item:last-child { border-bottom: none; }
.bpp-item:hover { background: var(--bg-surface, #e8eaee); }
.bpp-item.active { background: rgba(91,127,166,.12); }
.bpp-item.active .bpp-item-title { color: var(--bpp-accent); font-weight: 700; }
.bpp-num {
  flex: 0 0 26px; text-align: center;
  font-size: 13px; color: var(--text-muted, #5a6478);
  font-variant-numeric: tabular-nums;
}
.bpp-item.active .bpp-num { color: var(--bpp-accent); }
.bpp-item-body { display: flex; flex-direction: column; min-width: 0; }
.bpp-item-title {
  font-weight: 600; line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bpp-item-artist {
  font-size: 12px; color: var(--text-muted, #5a6478);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bpp-empty { padding: 22px 16px; color: var(--text-muted, #5a6478); text-align: center; }

/* Schriftgrößen der Liste (Einstellung) */
.bpp-list.bpp-font-s  .bpp-item-title { font-size: 14px; }
.bpp-list.bpp-font-m  .bpp-item-title { font-size: 16px; }
.bpp-list.bpp-font-l  .bpp-item-title { font-size: 18px; }
.bpp-list.bpp-font-xl .bpp-item-title { font-size: 21px; }

/* Dichte kompakt/komfortabel */
.bpp-list.bpp-compact .bpp-item { padding: 9px 14px; }
.bpp-list.bpp-compact .bpp-item-artist { display: none; }

/* Titel darf im Groß-Modus umbrechen statt abzuschneiden */
.bpp-list.bpp-font-l .bpp-item-title,
.bpp-list.bpp-font-xl .bpp-item-title { white-space: normal; }

/* ── Info-Bereich ──────────────────────────────────────────── */
.bpp-tips h3 { margin: 0 0 .5rem; font-size: 15px; }
.bpp-tips ul { margin: 0; padding-left: 1.2rem; }
.bpp-tips li { margin: .35rem 0; font-size: 14px; }

/* Dark-Theme-Anpassung */
body.theme-dark .bpp-seg button,
body.theme-dark .bpp-chip,
body.theme-dark .bpp-list { background: var(--bg-deep2, #242c3d); color: #e9edf3; }
body.theme-dark .bpp-item:hover { background: rgba(255,255,255,.05); }

/* Mobil: mehr Höhe für die Liste, Buttons zentriert */
@media (max-width: 860px) {
  .bpp-list { max-height: 56vh; }
  .bpp-ctl-label { min-width: 100%; }
}

/* Reduzierte Bewegung respektieren */
@media (prefers-reduced-motion: reduce) {
  .bpp-tbtn, .bpp-item { transition: none; }
}

/* ── v6.72: Visualizer, Waveform, Key, Select, Farbe ──────── */

/* Now-Playing Kopfzeile mit Visualizer rechts */
.bpp-now { position: relative; }
.bpp-now-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.bpp-now-info { min-width: 0; flex: 1; }
.bpp-now-side { display: flex; flex-direction: column; align-items: flex-end; gap: .6rem; }

.bpp-viz { display: block; width: 140px; height: 46px; opacity: .95; }

/* Key/BPM-Anzeige */
.bpp-key {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px; padding: 6px 12px; min-height: 34px;
}
.bpp-key .bpp-key-val { font-weight: 800; font-size: 17px; letter-spacing: .02em; color: #fff; }
.bpp-key .bpp-bpm-val { font-size: 12px; color: rgba(255,255,255,.72); }
.bpp-key.empty { opacity: .55; }
.bpp-key.empty .bpp-key-val { font-weight: 600; }

/* Waveform-Seek */
.bpp-wf-row { display: flex; align-items: center; gap: .7rem; margin-top: 1.15rem; }
.bpp-wf-row .bpp-time { font-size: 12px; color: rgba(255,255,255,.72); font-variant-numeric: tabular-nums; min-width: 34px; text-align: center; }
.bpp-waveform {
  flex: 1; height: 56px; width: 100%; cursor: pointer;
  background: rgba(255,255,255,.05); border-radius: 10px; touch-action: none;
}

/* Playlist-Dropdown */
.bpp-select {
  border: 1px solid var(--border, #c5cdd8); border-radius: 10px;
  background: var(--bg-white, #fff); color: var(--text-main, #1c2333);
  padding: 10px 14px; font-size: 14px; min-height: 44px; min-width: 200px;
  max-width: 100%; cursor: pointer;
}
body.theme-dark .bpp-select { background: var(--bg-deep2, #242c3d); color: #e9edf3; }

/* Akzent-Chip (Reverse) — etwas bunter, im Design */
.bpp-chip-accent {
  background: linear-gradient(135deg, var(--accent, #5b7fa6), #7a5ba6);
  color: #fff; border-color: transparent;
}
.bpp-chip-accent:hover { filter: brightness(1.08); }

/* Aktive Chips/Segmente farbiger */
.bpp-chip.active, .bpp-seg button.active {
  background: linear-gradient(135deg, var(--accent, #5b7fa6), #6f7fc0);
  color: #fff; border-color: transparent;
}

/* Key-Tag in der Titelliste */
.bpp-item-key {
  flex: 0 0 auto; margin-left: auto;
  font-size: 12px; font-weight: 700; color: var(--accent, #5b7fa6);
  background: rgba(91,127,166,.12); border-radius: 8px; padding: 2px 8px;
}
.bpp-item.active .bpp-item-key { background: rgba(91,127,166,.25); }

/* Farbiger Rand oben an der Now-Karte */
.bpp-now { border-top: 3px solid transparent; border-image: linear-gradient(90deg, var(--accent, #5b7fa6), #7a5ba6, #8aaac8) 1; }

/* Kleiner Hinweis unter den Tipps */
.bpp-note { margin: .8rem 0 0; font-size: 12.5px; color: var(--text-muted, #5a6478); font-style: italic; }

/* Mobil: Visualizer schmaler, Now-Top umbrechen */
@media (max-width: 620px) {
  .bpp-now-top { flex-direction: column; }
  .bpp-now-side { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
  .bpp-viz { width: 120px; }
  .bpp-select { width: 100%; }
}

/* ── v6.73: Playlist-Suche + „Als Nächstes" ──────────────── */
.bpp-search-row { margin: 0 0 .5rem; }
.bpp-search {
  width: 100%; box-sizing: border-box;
  padding: 11px 14px; min-height: 44px;
  border: 1px solid var(--border, #c5cdd8); border-radius: 12px;
  background: var(--bg-white, #fff); color: var(--text-main, #1c2333);
  font-size: 15px;
}
.bpp-search:focus { outline: none; border-color: var(--accent, #5b7fa6); box-shadow: 0 0 0 3px rgba(91,127,166,.18); }
body.theme-dark .bpp-search { background: var(--bg-deep2, #242c3d); color: #e9edf3; }

.bpp-item-next {
  flex: 0 0 auto; margin-left: .5rem;
  border: 1px solid var(--border, #c5cdd8); background: transparent;
  color: var(--text-muted, #5a6478);
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
  font-size: 16px; line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s, border-color .12s;
}
.bpp-item-next:hover { background: var(--accent, #5b7fa6); color: #fff; border-color: transparent; }
.bpp-list.bpp-compact .bpp-item-next { width: 30px; height: 30px; }

/* ── v6.77: Moderner, kompakter Player-Look ──────────────── */

/* Now-Playing-Kopf: Visualizer/Key kleiner */
.bpp-viz { width: 120px; height: 34px; }
.bpp-key { padding: 4px 10px; min-height: 30px; }
.bpp-key .bpp-key-val { font-size: 15px; }

/* Waveform etwas flacher */
.bpp-waveform { height: 44px; }

/* Moderne Transportleiste: links Modi · Mitte Transport · rechts Loop+Vol */
.bpp-bar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: .5rem; margin-top: 1rem;
}
.bpp-bar-left  { display: flex; align-items: center; gap: .35rem; justify-self: start; }
.bpp-bar-center{ display: flex; align-items: center; gap: .7rem; justify-self: center; }
.bpp-bar-right { display: flex; align-items: center; gap: .5rem; justify-self: end; }

/* Kleine Icon-Buttons (schlicht, ohne Rahmenfläche) */
.bpp-ico {
  width: 34px; height: 34px; border-radius: 9px;
  border: none; background: transparent; cursor: pointer;
  font-size: 16px; line-height: 1; color: var(--text-main, #1c2333);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s, transform .1s, color .12s; opacity: .8;
}
.bpp-ico:hover { background: rgba(120,140,170,.16); opacity: 1; }
.bpp-ico:active { transform: scale(.92); }
.bpp-ico.active { background: rgba(91,127,166,.18); color: var(--bpp-accent); opacity: 1; }
.bpp-ico.sm { width: 30px; height: 30px; font-size: 14px; }
body.theme-dark .bpp-ico { color: #e9edf3; }

/* Play als kompakter Kreis (deutlich kleiner als vorher) */
.bpp-play {
  width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--bpp-accent); color: #fff; font-size: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(91,127,166,.35); transition: transform .1s, filter .12s;
}
.bpp-play:hover { filter: brightness(1.08); }
.bpp-play:active { transform: scale(.94); }

/* Schlanke Lautstärke */
.bpp-vol { display: flex; align-items: center; gap: .35rem; }
.bpp-vol-ico { font-size: 14px; opacity: .7; }
.bpp-vol input[type=range] {
  width: 84px; height: 4px; accent-color: var(--bpp-accent);
  cursor: pointer;
}

/* Werkzeugleiste über der Liste: Auswahl · Suche · Ziel */
.bpp-toolbar { display: flex; align-items: center; gap: .5rem; margin: 0 0 .6rem; }
.bpp-toolbar .bpp-select { min-width: 150px; flex: 0 0 auto; min-height: 40px; padding: 8px 12px; }
.bpp-toolbar .bpp-search { flex: 1; margin: 0; min-height: 40px; }

/* Einklappbare Bereiche (Einstellungen + Tipps) */
.bpp-more, .bpp-tips {
  margin-top: 1rem; border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  background: linear-gradient(135deg, var(--bg-deep, #1c2333), var(--bg-deep2, #242c3d));
  color: #e9edf3; overflow: hidden;
}
body.theme-dark .bpp-more, body.theme-dark .bpp-tips {
  background: linear-gradient(135deg, var(--bg-deep, #1c2333), var(--bg-deep2, #242c3d));
}
.bpp-more > summary, .bpp-tips > summary {
  cursor: pointer; padding: .8rem 1.1rem; font-weight: 600; font-size: 14px;
  list-style: none; user-select: none; color: #fff;
}
body.theme-dark .bpp-more > summary, body.theme-dark .bpp-tips > summary { color: #fff; }
.bpp-more > summary::-webkit-details-marker, .bpp-tips > summary::-webkit-details-marker { display: none; }
.bpp-more > summary::after, .bpp-tips > summary::after { content: " ▾"; opacity: .5; }
.bpp-more[open] > summary::after, .bpp-tips[open] > summary::after { content: " ▴"; }
.bpp-more-body, .bpp-tips-body { padding: 0 1.1rem 1rem; color: rgba(233,237,243,.9); }
.bpp-more-body .bpp-ctl-row { padding: .3rem 0; }
/* Texte in den Klapp-Boxen explizit hell (Design-konform, lesbar) */
.bpp-tips-body li, .bpp-tips-body p, .bpp-more-body, .bpp-more-body .bpp-ctl-label {
  color: rgba(233,237,243,.92);
}
.bpp-tips-body strong, .bpp-more-body strong { color: #fff; }
.bpp-tips-body .bpp-note { color: rgba(233,237,243,.7); }

/* Chips/Segmente kompakter */
.bpp-chip, .bpp-seg button { padding: 6px 11px; min-height: 34px; font-size: 12.5px; }
.bpp-ctl-label { min-width: 96px; font-size: 12.5px; }

/* Mobil: Transportleiste bleibt dreigeteilt, Vol schrumpft */
@media (max-width: 560px) {
  .bpp-vol input[type=range] { width: 56px; }
  .bpp-toolbar { flex-wrap: wrap; }
  .bpp-toolbar .bpp-select { flex: 1 1 100%; }
}

/* v6.78: Auf mobilen Geräten Playlist strikt linksbündig + volle Breite */
@media (max-width: 640px) {
  #bpp-list, .bpp-list { text-align: left; }
  #bpp-list .bpp-item, .bpp-list .bpp-item { text-align: left; justify-content: flex-start; }
  #bpp-list .bpp-item-body { align-items: flex-start; text-align: left; }
  #blunaa-player-page { text-align: left; }
}

/* ── v6.86: Favoriten-Suche (Player-Seite, voller Ausbau) ───────────── */
.bfs {
  margin-top: 1.6rem; padding: 1.1rem 1.2rem;
  border: 1px solid rgba(255,255,255,.1); border-radius: 14px;
  background: linear-gradient(135deg, var(--bg-deep, #1c2333), var(--bg-deep2, #242c3d));
  color: #e9edf3;
}
.bfs-head { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }
.bfs-head h2 { margin: 0; font-size: 18px; color: #fff; }
.bfs-count { font-size: 12px; color: rgba(233,237,243,.6); white-space: nowrap; }
.bfs-sub { margin: .35rem 0 .8rem; font-size: 13px; color: rgba(233,237,243,.75); line-height: 1.45; }
.bfs-sub strong { color: #fff; }

.bfs-input {
  width: 100%; box-sizing: border-box; padding: 12px 14px; min-height: 46px;
  border: 1px solid rgba(255,255,255,.18); border-radius: 12px;
  background: rgba(0,0,0,.28); color: #fff; font-size: 15px;
}
.bfs-input::placeholder { color: rgba(233,237,243,.45); }
.bfs-input:focus { outline: none; border-color: var(--bpp-accent, #5b7fa6); box-shadow: 0 0 0 3px rgba(91,127,166,.25); }

.bfs-results, .bfs-picks { list-style: none; margin: .6rem 0 0; padding: 0; }
.bfs-results { max-height: 320px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.bfs-results:empty { margin: 0; }

.bfs-item, .bfs-pick {
  display: flex; align-items: center; gap: .6rem;
  padding: 9px 10px; border-radius: 10px; cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.bfs-item:hover, .bfs-pick:hover { background: rgba(255,255,255,.06); }
.bfs-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bfs-item-title { font-size: 14px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bfs-item-artist { font-size: 12px; color: rgba(233,237,243,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bfs-item-title mark { background: rgba(122,91,166,.55); color: #fff; padding: 0 2px; border-radius: 3px; }

.bfs-play, .bfs-add, .bfs-mini {
  flex: 0 0 auto; border: 1px solid rgba(255,255,255,.18); background: transparent;
  color: #e9edf3; border-radius: 9px; cursor: pointer;
  width: 34px; height: 34px; font-size: 14px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.bfs-play:hover { background: var(--bpp-accent, #5b7fa6); border-color: transparent; color: #fff; }
.bfs-add:hover  { background: rgb(59,45,101); border-color: transparent; color: #fff; }
.bfs-add.on { background: rgba(45,85,128,.5); border-color: transparent; color: #fff; cursor: default; }
.bfs-mini { width: 30px; height: 30px; font-size: 11px; }
.bfs-mini:hover { background: rgba(255,255,255,.14); }

.bfs-empty { padding: 14px 10px; text-align: center; font-size: 13px; color: rgba(233,237,243,.55); }

.bfs-picks-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-top: 1.2rem; flex-wrap: wrap; }
.bfs-picks-head h3 { margin: 0; font-size: 15px; color: #fff; }
.bfs-picks-actions { display: flex; gap: .4rem; }
.bfs-btn {
  border: none; border-radius: 0; cursor: pointer; padding: 8px 14px; font-size: 13px; font-weight: 600;
  color: #fff; background: linear-gradient(135deg, rgb(59,45,101), rgb(45,85,128));
}
.bfs-btn:hover { filter: brightness(1.12); }
.bfs-btn.ghost { background: transparent; border: 1px solid rgba(255,255,255,.2); font-weight: 500; }
.bfs-pick-num { flex: 0 0 auto; width: 22px; text-align: center; font-size: 12px; color: rgba(233,237,243,.5); font-variant-numeric: tabular-nums; }

@media (max-width: 560px) {
  .bfs { padding: .9rem; }
  .bfs-picks-head { align-items: flex-start; }
  .bfs-mini { width: 28px; height: 28px; }
}
