/* Pytune — donker thema in de geest van Clementine: leisteen met oranje accent */

:root {
  --bg: #14171c;
  --bg-2: #1c2027;
  --bg-3: #252a33;
  --lijn: #2f3540;
  --tekst: #e8eaed;
  --dempt: #9aa3af;
  --accent: #f29530;
  --accent-2: #ffb25c;
  --gevaar: #f08a7a;
  --groen: #7fc99a;
  --speler-hoogte: 84px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  padding-bottom: calc(var(--speler-hoogte) + 1.5rem);
  background: var(--bg);
  color: var(--tekst);
  font: 15px/1.5 var(--sans);
}
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
h1 { font-size: 1.7rem; line-height: 1.2; margin: 0; font-weight: 650; }
h2 { font-size: 1.15rem; margin: 0 0 .6rem; }
code { background: var(--bg-3); padding: .05rem .35rem; border-radius: 4px; font-size: .9em; }
.dempt { color: var(--dempt); }
.verborgen { position: absolute; left: -9999px; }
[hidden] { display: none !important; }
.inline { display: inline; margin: 0; }

/* ---------- Kop ---------- */

.kop {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem 1.6rem;
  padding: .7rem 1.5rem;
  background: var(--bg-2);
  border-bottom: 1px solid var(--lijn);
}
.merk {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: 1.35rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: .01em;
}
.merk-icoon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--accent);
  color: #2a1a05;
  font-size: 1.1rem;
}
.hoofdnav { display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; }
.hoofdnav a {
  text-decoration: none;
  color: var(--dempt);
  padding: .3rem 0;
  border-bottom: 2px solid transparent;
}
.hoofdnav a:hover { color: var(--tekst); }
.hoofdnav a[aria-current="page"] { color: var(--tekst); border-bottom-color: var(--accent); }
.zoek { display: flex; gap: .5rem; flex: 1 1 18rem; max-width: 36rem; margin-left: auto; }
.zoek input { flex: 1; min-width: 0; }
.gebruiker { display: flex; gap: 1rem; font-size: .9rem; color: var(--dempt); }
.gebruiker a:hover { color: var(--tekst); }

/* ---------- Formulierelementen ---------- */

input, select {
  font: inherit;
  color: var(--tekst);
  background: var(--bg-3);
  border: 1px solid var(--lijn);
  border-radius: 6px;
  padding: .45rem .7rem;
}
input::placeholder { color: var(--dempt); }
input[type="checkbox"] { accent-color: var(--accent); width: 1rem; height: 1rem; padding: 0; }
input[type="range"] { accent-color: var(--accent); padding: 0; background: none; border: 0; }
.knop {
  display: inline-block;
  font: inherit;
  color: var(--tekst);
  background: var(--bg-3);
  border: 1px solid var(--lijn);
  border-radius: 6px;
  padding: .45rem .95rem;
  text-decoration: none;
  cursor: pointer;
  list-style: none;
}
.knop::-webkit-details-marker { display: none; }
.knop:hover { background: #2f3541; }
.knop.primair { background: var(--accent); border-color: var(--accent); color: #2a1a05; font-weight: 650; }
.knop.primair:hover { background: var(--accent-2); }
.knop.gevaar { color: var(--gevaar); border-color: #6b3c33; background: transparent; }
.knop.klein { padding: .25rem .65rem; font-size: .85rem; }

/* ---------- Pagina ---------- */

main { max-width: 1280px; margin: 0 auto; padding: 1.5rem; }
.melding {
  padding: .65rem 1rem;
  margin-bottom: 1rem;
  background: var(--bg-2);
  border-left: 4px solid var(--accent);
  border-radius: 0 6px 6px 0;
}
.melding.success { border-left-color: var(--groen); }

.werkbalk {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.werkbalk p { margin: .25rem 0 0; }
.sorteer { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.4rem; color: var(--dempt); }
.sorteer label { display: flex; align-items: center; gap: .6rem; }
.regel { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0; }
.actiebalk { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1rem; }

.labels { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0 0 1rem; }
.labels a, .labels li > span {
  display: inline-block;
  border: 1px solid var(--lijn);
  border-radius: 999px;
  padding: .1rem .8rem;
  font-size: .9rem;
  text-decoration: none;
}
.filters li { display: flex; gap: .4rem; align-items: center; }
.filters li > span { background: var(--bg-2); }
.filters li > a { border: 0; padding: 0; color: var(--dempt); text-decoration: underline; }

.uitklap { position: relative; }
.uitklap-inhoud {
  position: absolute;
  z-index: 10;
  top: calc(100% + .35rem);
  left: 0;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  min-width: 22rem;
  padding: .9rem;
  background: var(--bg-2);
  border: 1px solid var(--lijn);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}
.uitklap-inhoud form { margin: 0; }
.uitklap-inhoud .regel input { flex: 1; }

.paneel {
  margin: 1.5rem 0;
  padding: 1.1rem 1.2rem;
  background: var(--bg-2);
  border: 1px solid var(--lijn);
  border-radius: 10px;
}
.paneel p { margin: 0 0 .8rem; max-width: 70ch; }
.rasterformulier { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: .8rem 1rem; align-items: end; }
.rasterformulier label { display: flex; flex-direction: column; gap: .3rem; color: var(--dempt); }

.paginas { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; justify-content: center; margin-top: 1.8rem; }
.leeg { text-align: center; padding: 3.5rem 1rem; }
.leeg h1 { margin-bottom: 1rem; }

/* ---------- Tabellen ---------- */

.tabel-wrap { overflow-x: auto; }
.tabel { width: 100%; border-collapse: collapse; }
.tabel th { text-align: left; color: var(--dempt); font-weight: 500; font-size: .85rem; }
.tabel th, .tabel td { padding: .5rem .7rem; border-bottom: 1px solid var(--lijn); }
.tabel .acties { display: flex; gap: .5rem; justify-content: flex-end; }

.nummers tbody tr:hover { background: var(--bg-2); }
.nummers tbody tr.speelt { background: rgba(242, 149, 48, .14); }
.nummers tbody tr.speelt .kol-titel { color: var(--accent-2); font-weight: 600; }
.nummers tbody tr.speelt .speel-knop { color: var(--accent); }
.nummers tbody tr.geselecteerd { background: rgba(94, 150, 255, .14); }
.nummers tbody tr.sleep-boven { box-shadow: inset 0 2px 0 var(--accent); }
.nummers tbody tr.sleep-onder { box-shadow: inset 0 -2px 0 var(--accent); }
.nummers tbody tr.sleept { opacity: .45; }
.nummers td { vertical-align: middle; }
.nummers .kol-vink { width: 2rem; }
.nummers .kol-speel { width: 2.4rem; }
.nummers .kol-nr { width: 2.6rem; text-align: right; font-variant-numeric: tabular-nums; }
.nummers .kol-jaar { width: 3.6rem; }
.nummers .kol-duur { width: 4.4rem; text-align: right; font-variant-numeric: tabular-nums; }
.nummers .kol-acties { width: 6.4rem; text-align: right; white-space: nowrap; }
.nummers .kol-greep { width: 1.6rem; color: var(--dempt); cursor: grab; user-select: none; }
.nummers .kol-titel { font-weight: 500; }
.nummers .kol-artiest a, .nummers .kol-album a { text-decoration: none; color: var(--dempt); }
.nummers .kol-artiest a:hover, .nummers .kol-album a:hover { color: var(--tekst); text-decoration: underline; }
.nummers .kol-titel, .nummers .kol-artiest, .nummers .kol-album { max-width: 22rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.speel-knop, .ikoon-knop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.9rem;
  height: 1.9rem;
  padding: 0 .3rem;
  font: inherit;
  font-size: .9rem;
  color: var(--dempt);
  background: transparent;
  border: 0;
  border-radius: 50%;
  text-decoration: none;
  cursor: pointer;
}
.speel-knop:hover, .ikoon-knop:hover { color: var(--tekst); background: var(--bg-3); }
.gevaar-tekst:hover { color: var(--gevaar); }

.selectiebalk {
  position: sticky;
  top: 3.6rem;
  z-index: 15;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin: 0 0 .8rem;
  padding: .55rem .8rem;
  background: var(--bg-3);
  border: 1px solid #3b4350;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.selectie-tekst { margin-right: auto; }

/* ---------- Namenlijst en albums ---------- */

.namenlijst { columns: 280px; column-gap: 2rem; list-style: none; margin: 0; padding: 0; }
.namenlijst li { break-inside: avoid; padding: .35rem 0; border-bottom: 1px solid var(--lijn); display: flex; justify-content: space-between; gap: 1rem; }
.namenlijst a { text-decoration: none; }
.namenlijst a:hover { text-decoration: underline; }

.albumrooster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1.4rem 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.artiestrooster { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.artiestrooster .album-kaft { border-radius: 50%; }
.artiestrooster .album-titel, .artiestrooster .album-artiest { text-align: center; }
.album { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.album-kaft {
  display: block;
  text-decoration: none;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-3);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .4);
}
.album-kaft img { display: block; width: 100%; height: 100%; object-fit: cover; }
.geen-kaft { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; font-size: 3rem; color: var(--lijn); background: linear-gradient(135deg, #2a303a, #1c2027); }
.album-titel { margin-top: .4rem; font-weight: 600; text-decoration: none; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.album-titel:hover { text-decoration: underline; }
.album-artiest { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Speler ---------- */

.speler {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  height: var(--speler-hoogte);
  padding: .5rem 1.2rem;
  background: #10131700;
  background: linear-gradient(#171b21, #0f1216);
  border-top: 1px solid var(--lijn);
  box-shadow: 0 -6px 20px rgba(0, 0, 0, .45);
}
.sp-info { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.sp-info img { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; flex: none; }
.sp-tekst { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.sp-tekst strong, .sp-tekst span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-midden { display: flex; flex-direction: column; align-items: center; gap: .15rem; min-width: 0; }
.sp-knoppen { display: flex; align-items: center; gap: .5rem; }
.sp-knop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  font: inherit;
  font-size: 1.05rem;
  color: var(--dempt);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.sp-knop:hover { color: var(--tekst); background: var(--bg-3); }
.sp-knop[aria-pressed="true"] { color: var(--accent); }
.sp-knop.sp-groot { width: 2.6rem; height: 2.6rem; background: var(--accent); color: #2a1a05; font-size: 1.1rem; }
.sp-knop.sp-groot:hover { background: var(--accent-2); }
.sp-tijd { display: flex; align-items: center; gap: .6rem; width: 100%; max-width: 38rem; font-size: .8rem; color: var(--dempt); font-variant-numeric: tabular-nums; }
.sp-tijd input { flex: 1; min-width: 0; }
.sp-rechts { display: flex; align-items: center; justify-content: flex-end; gap: .8rem; }
.sp-volume { display: flex; align-items: center; gap: .4rem; }
.sp-volume input { width: 6.5rem; }
.teller {
  display: inline-block;
  min-width: 1.4em;
  padding: 0 .4em;
  border-radius: 999px;
  background: var(--accent);
  color: #2a1a05;
  font-size: .75em;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
}
.teller:empty { display: none; }

.wachtrij {
  position: fixed;
  right: 0;
  bottom: var(--speler-hoogte);
  z-index: 29;
  display: flex;
  flex-direction: column;
  width: min(26rem, 100%);
  max-height: min(70vh, 34rem);
  background: var(--bg-2);
  border: 1px solid var(--lijn);
  border-bottom: 0;
  border-radius: 10px 0 0 0;
  box-shadow: -6px -6px 24px rgba(0, 0, 0, .4);
}
.wachtrij-kop { display: flex; align-items: center; gap: .5rem; padding: .7rem .9rem; border-bottom: 1px solid var(--lijn); }
.wachtrij-kop h2 { margin: 0 auto 0 0; }
.wachtrij ol { margin: 0; padding: 0; list-style: none; overflow-y: auto; }
.wachtrij li { display: flex; align-items: center; gap: .5rem; padding: .35rem .9rem; border-bottom: 1px solid var(--lijn); cursor: pointer; }
.wachtrij li:hover { background: var(--bg-3); }
.wachtrij li.speelt { background: rgba(242, 149, 48, .14); }
.wachtrij li.speelt .wq-titel { color: var(--accent-2); font-weight: 600; }
.wq-tekst { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.wq-tekst span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wq-tekst .dempt { font-size: .8rem; }
.wq-leegtekst { padding: 1.2rem .9rem; color: var(--dempt); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--speler-hoogte) + 1rem);
  z-index: 40;
  transform: translateX(-50%);
  max-width: min(32rem, 92vw);
  padding: .6rem 1rem;
  background: #2b3340;
  border: 1px solid #44505f;
  border-left: 4px solid var(--groen);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}
.toast.fout { border-left-color: var(--gevaar); }

/* ---------- Kleine schermen ---------- */

@media (max-width: 860px) {
  /* Kop: merk + gebruiker op één regel, menu als scrolbare balk, dan zoeken.
     Niet plakkend: op een telefoon is de ruimte voor de lijst kostbaarder. */
  .kop { position: static; padding: .6rem 1rem; gap: .4rem 1rem; }
  .gebruiker { order: 1; margin-left: auto; gap: .8rem; font-size: .85rem; }
  .gebruiker > span { display: none; }
  .hoofdnav { order: 2; flex-basis: 100%; flex-wrap: nowrap; gap: 1.1rem; overflow-x: auto; scrollbar-width: none; }
  .hoofdnav a { white-space: nowrap; }
  .zoek { order: 3; flex-basis: 100%; max-width: none; margin-left: 0; }
  main { padding: 1rem; }
  .sorteer { gap: .5rem 1rem; }
  .selectiebalk { top: 0; }
  .nummers .kol-album, .nummers .kol-jaar, .nummers .kol-nr { display: none; }
  .nummers .kol-titel, .nummers .kol-artiest { max-width: 9rem; }
  .speler { grid-template-columns: 1fr auto; grid-template-areas: "info rechts" "midden midden"; height: auto; min-height: var(--speler-hoogte); row-gap: .2rem; }
  .sp-info { grid-area: info; }
  .sp-rechts { grid-area: rechts; }
  .sp-midden { grid-area: midden; }
  .sp-volume { display: none; }
  :root { --speler-hoogte: 120px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* Lyrics-paneel (zelfde plek als de wachtrij) */
.lyrics .ly-inhoud { overflow-y: auto; padding: .8rem 1.1rem 2rem; }
.ly-kop { display: flex; flex-direction: column; margin-bottom: 1rem; }
.ly-tekst { white-space: pre-wrap; line-height: 1.6; }
.ly-regels p { margin: 0; padding: .25rem 0; line-height: 1.45; color: var(--dempt, #8b93a1); cursor: pointer; transition: color .2s; }
.ly-regels p.nu { color: var(--accent-2, #f29530); font-weight: 600; }
.sp-rechts .knop { white-space: nowrap; }
