/* pueski.de/musik – ruhig und dunkel wie die Startseite, ein warmes Akzentlicht für das, was gerade läuft. */
:root {
  --bg: #0b0f17;
  --panel: #111723;
  --panel2: #161e2c;
  --line: rgba(170, 195, 230, 0.12);
  --ink: #eef2f8;
  --muted: #9aa8bb;
  --dim: #6d7a8d;
  --accent: #ffb454;
  --accent2: #ff7a59;
  --bar-h: 96px;
  --text: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(ellipse 70% 50% at 20% 0%, rgba(255, 180, 84, 0.08), transparent 70%), var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--text);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom));
  overflow-x: hidden;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Kopf ---------- */
.top {
  display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 12px 28px;
  max-width: 1280px; margin: 0 auto; padding: 28px 24px 20px;
}
.back { grid-column: 1 / -1; color: var(--muted); text-decoration: none; font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; }
.back:hover { color: var(--ink); }
.back::before { content: '← '; }
h1 { margin: 0; font-size: clamp(34px, 5vw, 48px); line-height: 1; letter-spacing: -0.02em; }
.sub { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.search {
  grid-column: 3; display: flex; align-items: center; gap: 10px; min-width: 280px;
  padding: 10px 14px; border-radius: 12px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line);
}
.search svg { width: 18px; height: 18px; fill: var(--muted); flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; }
.search:focus-within { box-shadow: inset 0 0 0 1px var(--accent); }

/* ---------- Alben und Stücke ---------- */
.layout {
  display: grid; grid-template-columns: 320px 1fr; gap: 24px;
  max-width: 1280px; margin: 0 auto; padding: 0 24px 24px;
}
.albums {
  position: sticky; top: 16px; align-self: start;
  max-height: calc(100vh - var(--bar-h) - 32px); overflow: auto;
  padding: 8px; border-radius: 16px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line);
  scrollbar-width: thin; scrollbar-color: #2a3548 transparent;
}
.alb {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 8px; border: 0; border-radius: 10px; background: transparent; text-align: left; cursor: pointer;
}
.alb:hover { background: var(--panel2); }
.alb[aria-current="true"] { background: rgba(255, 180, 84, 0.12); }
.alb .t { display: flex; flex-direction: column; min-width: 0; }
.alb strong { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alb span { color: var(--dim); font-size: 13px; }
.alb.playing strong { color: var(--accent); }
.group { margin: 14px 8px 6px; color: var(--dim); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }
.group:first-child { margin-top: 6px; }

/* Albumbild: Cover, wenn vorhanden, sonst ein Farbfeld aus dem Namen */
.cov {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px;
  background-size: cover; background-position: center;
  color: rgba(255, 255, 255, 0.92); font-weight: 800; font-size: 14px; letter-spacing: -0.02em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}
.cov.big { width: 148px; height: 148px; border-radius: 14px; font-size: 38px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45); }

.album-head { display: flex; align-items: flex-end; gap: 24px; padding: 8px 0 22px; }
.album-head h2 { margin: 0; font-size: clamp(26px, 4vw, 40px); line-height: 1.1; letter-spacing: -0.02em; word-break: break-word; }
.album-head p { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.album-head .go {
  margin-top: 16px; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border: 0; border-radius: 99px; background: var(--accent); color: #231400;
  font-weight: 700; cursor: pointer; transition: transform 0.15s;
}
.album-head .go:hover { transform: scale(1.04); }
.album-head .go svg { width: 18px; height: 18px; fill: currentColor; }

.list { list-style: none; margin: 0; padding: 0; }
.tr {
  display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 12px;
  width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; text-align: left; cursor: pointer;
}
.tr:hover { background: var(--panel); }
.tr .n { color: var(--dim); font-size: 14px; text-align: right; font-variant-numeric: tabular-nums; }
.tr .t { display: flex; flex-direction: column; min-width: 0; }
.tr strong { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr span { color: var(--dim); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr .d { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.tr.current strong, .tr.current .n { color: var(--accent); }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.eq i { width: 3px; background: var(--accent); border-radius: 1px; animation: eq 0.9s infinite ease-in-out; }
.eq i:nth-child(2) { animation-delay: -0.3s; } .eq i:nth-child(3) { animation-delay: -0.6s; }
.paused .eq i { animation-play-state: paused; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }
.empty { padding: 40px 12px; color: var(--muted); }

/* ---------- Wiedergabeleiste ---------- */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; gap: 20px;
  min-height: var(--bar-h); padding: 12px 24px calc(12px + env(safe-area-inset-bottom));
  background: rgba(10, 14, 22, 0.92); backdrop-filter: blur(14px); box-shadow: 0 -1px 0 var(--line);
}
.now { display: flex; align-items: center; gap: 14px; min-width: 0; }
.art { flex: none; width: 56px; height: 56px; border-radius: 10px; background: var(--panel2); background-size: cover; background-position: center; }
.meta { display: flex; flex-direction: column; min-width: 0; }
.meta strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta span { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.controls { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.buttons { display: flex; align-items: center; gap: 14px; }
.ic { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.ic svg { width: 22px; height: 22px; fill: var(--muted); }
.ic:hover svg { fill: var(--ink); }
.ic[aria-pressed="true"] svg { fill: var(--accent); }
.play {
  display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%;
  background: var(--ink); cursor: pointer; transition: transform 0.15s;
}
.play:hover { transform: scale(1.06); }
.play svg { width: 24px; height: 24px; fill: #0b0f17; }
.play .i-pause, .playing .play .i-play { display: none; }
.playing .play .i-pause { display: block; }
.seek { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 560px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.seek span { width: 44px; } .seek span:first-child { text-align: right; }
.vol { justify-self: end; display: flex; align-items: center; gap: 10px; width: min(180px, 100%); }
.vol svg { width: 20px; height: 20px; fill: var(--muted); flex: none; }

/* Schieberegler */
input[type="range"] { -webkit-appearance: none; appearance: none; flex: 1; height: 18px; background: transparent; cursor: pointer; --p: 0%; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--accent) var(--p), #2a3446 var(--p)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: #2a3446; }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; border-radius: 50%; background: var(--ink); }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--ink); }

/* ---------- Schmal ---------- */
@media (max-width: 900px) {
  .top { grid-template-columns: 1fr; }
  .search { grid-column: 1; min-width: 0; }
  .layout { grid-template-columns: 1fr; }
  .albums { position: static; max-height: none; display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 8px; }
  .group { display: none; }
  .alb { flex: none; flex-direction: column; align-items: flex-start; width: 124px; }
  .alb .cov { width: 108px; height: 108px; font-size: 28px; }
  .alb strong { width: 108px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .bar { grid-template-columns: 1fr auto; gap: 8px 12px; --bar-h: 128px; }
  .controls { grid-column: 1 / -1; grid-row: 2; }
  .vol { display: none; }
  .buttons { gap: 8px; }
  body { --bar-h: 132px; }
}
@media (max-width: 560px) {
  .top, .layout { padding-left: 16px; padding-right: 16px; }
  .album-head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .cov.big { width: 120px; height: 120px; }
  .tr { grid-template-columns: 28px 1fr auto; padding: 10px 6px; }
  .bar { padding-left: 16px; padding-right: 16px; }
}
@media (prefers-reduced-motion: reduce) { .eq i { animation: none; height: 10px; } }
