:root {
  --bg: #080c12; --surface: #0f1520; --surface2: #151e2d; --surface3: #1b2638;
  --border: rgba(255,255,255,.08); --grid: rgba(255,255,255,.08);
  --accent: #fc4c02; --accent2: #ff6a2f; --text: #f0f2f5; --muted: rgba(255,255,255,.58);
  --red: #f87171; --player-h: 88px; --side-w: 224px;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, "Segoe UI", Roboto, sans-serif; min-height: 100dvh; overflow-x: hidden; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
a.link { color: var(--text); border-bottom: 1px solid var(--border); }
a.link:hover { color: var(--accent2); border-color: var(--accent2); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.pad { padding: 18px 0; }
:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
.icon { flex: none; display: block; }

/* ---------- Bedienelemente ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 600; cursor: pointer; border: .5px solid var(--border);
  border-radius: 999px; padding: 9px 18px; color: var(--text); background: var(--surface2); }
.btn:hover { background: var(--surface3); }
.btn.primary { border: 0; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent2)); }
.btn.primary:hover { filter: brightness(1.08); background: linear-gradient(135deg, var(--accent), var(--accent2)); }
.btn.wide { width: 100%; justify-content: center; border-radius: 10px; padding: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
button.ghost { font: inherit; font-size: 13px; cursor: pointer; background: transparent; border: .5px solid var(--border); color: var(--muted); border-radius: 8px; padding: 6px 12px; }
button.ghost:hover { color: var(--text); background: var(--surface2); }
.inp, input[type=search], .login-card input, select {
  font: inherit; color: var(--text); background: rgba(255,255,255,.05); border: .5px solid var(--border); border-radius: 10px; padding: 10px 14px; outline: none; max-width: 100%; }
.inp:focus, input[type=search]:focus, .login-card input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(252,76,2,.16); }
select { padding-right: 28px; }
select option { background: var(--surface2); color: var(--text); }
.chip { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text); background: var(--surface3); border: .5px solid var(--border); border-radius: 999px; padding: 5px 12px; }
.msg { color: var(--red); font-size: 13px; min-height: 1.3em; }

/* ---------- Anmeldung ---------- */
#login { min-height: 100dvh; display: grid; place-items: center; padding: 16px; background: radial-gradient(900px 500px at 20% 0%, rgba(252,76,2,.10), transparent 60%), var(--bg); }
.login-card { background: var(--surface); border: .5px solid var(--border); border-radius: 18px; padding: 34px; width: min(100%, 390px); display: flex; flex-direction: column; gap: 16px; box-shadow: 0 30px 70px rgba(0,0,0,.55); }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.logo { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.logo-name { font-size: 26px; font-weight: 700; letter-spacing: .01em; }
.logo-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; font-size: 18px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent2)); flex: none; }

/* ---------- Grundlayout ---------- */
#app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100dvh; padding-bottom: var(--player-h); }
#side { position: sticky; top: 0; height: calc(100dvh - var(--player-h)); display: flex; flex-direction: column; gap: 22px; padding: 20px 14px; background: var(--surface); border-right: .5px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; padding: 0 8px; }
#nav { display: flex; flex-direction: column; gap: 4px; }
#nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; }
#nav a:hover { color: var(--text); background: var(--surface2); }
#nav a[aria-current=page] { color: #fff; background: var(--surface3); box-shadow: inset 3px 0 0 var(--accent); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 8px; }
#main { min-width: 0; }
#top { position: sticky; top: 0; z-index: 20; padding: 12px 24px; background: rgba(8,12,18,.88); backdrop-filter: blur(8px); border-bottom: .5px solid var(--border); }
.searchbox input { width: min(100%, 560px); }
#view { padding: 24px 24px 40px; max-width: 1280px; transition: opacity .15s; outline: none; }
#view.loading { opacity: .55; }

h1 { font-size: 28px; line-height: 1.15; letter-spacing: -.01em; }
h2 { font-size: 18px; margin-bottom: 14px; }
h3 { font-size: 15px; margin-bottom: 2px; }
.head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.head .actions { margin-left: auto; }
.sec { margin-top: 30px; }
.foot { margin-top: 10px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.more { display: flex; justify-content: center; padding: 24px 0 8px; }

/* ---------- Kacheln, Raster ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: .5px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.tile .tl { font-size: 12.5px; color: var(--muted); }
.tile .tv { font-size: 26px; font-weight: 700; margin-top: 2px; }
.tile .ts { font-size: 12px; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 18px 16px; }
.album, .artist { position: relative; min-width: 0; border-radius: 12px; padding: 10px; background: transparent; transition: background .15s; }
.album:hover, .artist:hover { background: var(--surface); }
.artist { display: block; text-align: center; }
.album-link { display: block; min-width: 0; }
.t { margin-top: 10px; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cover { position: relative; width: 100%; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: linear-gradient(135deg, var(--surface2), var(--surface3)); box-shadow: 0 8px 20px rgba(0,0,0,.35); }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover.round { border-radius: 50%; }
.cover.ph { display: grid; place-items: center; }
.cover.ph span { font-size: 38px; font-weight: 700; color: rgba(255,255,255,.28); }
.cw { position: relative; }
.album .qp { position: absolute; right: 8px; bottom: 8px; width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); cursor: pointer; opacity: 0; transform: translateY(6px); transition: .15s; box-shadow: 0 6px 16px rgba(0,0,0,.5); }
.album:hover .qp, .album .qp:focus-visible { opacity: 1; transform: none; }
@media (hover: none) { .album .qp { opacity: 1; transform: none; width: 36px; height: 36px; } }

.filters { display: flex; gap: 12px 16px; flex-wrap: wrap; align-items: end; margin-bottom: 22px; }
.filter { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.filters .inp { min-width: min(100%, 280px); }

/* ---------- Kopfbereich Album / Interpret ---------- */
.hero { display: flex; gap: 26px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 26px; }
.hero .cover.big { width: 220px; flex: none; box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.hero-text { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1 1 260px; }
.eyebrow { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.hero h1 { font-size: clamp(26px, 4vw, 44px); overflow-wrap: anywhere; }
.hero .actions { margin-top: 8px; }

/* ---------- Titelliste ---------- */
.tracks { list-style: none; }
.tracks li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.tracks li:hover { background: var(--surface); }
.tracks li.disc { cursor: default; background: none; color: var(--muted); font-size: 12.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding-top: 18px; display: block; }
.tracks .tn { width: 28px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.tracks .eq { display: none; height: 14px; align-items: flex-end; justify-content: center; gap: 2px; }
.tracks .eq i { width: 3px; background: var(--accent2); border-radius: 1px; height: 100%; animation: eq 0.9s ease-in-out infinite; transform-origin: bottom; }
.tracks .eq i:nth-child(2) { animation-delay: -.3s; }
.tracks .eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }
.tracks li.playing .num { display: none; }
.tracks li.playing .eq { display: inline-flex; }
.tracks li.playing.paused .eq i { animation-play-state: paused; transform: scaleY(.5); }
.tracks li.playing .tt { color: var(--accent2); }
.tt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tracks .ts { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Diagramme ---------- */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; }
.card { background: var(--surface); border: .5px solid var(--border); border-radius: 14px; padding: 16px 18px; }
.chart.wide { grid-column: 1 / -1; }
.bars { margin-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 34%) 1fr; gap: 10px; align-items: center; height: 28px; padding: 0 6px; margin: 0 -6px; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.bar-row:hover { background: rgba(255,255,255,.04); }
.bar-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-area { position: relative; height: 100%; }
.bar-fill { position: absolute; left: 0; top: 50%; height: 14px; min-width: 2px; transform: translateY(-50%); background: var(--accent); border-radius: 0 4px 4px 0; transition: background .1s; }
.bar-row:hover .bar-fill, .bar-row:focus-visible .bar-fill { background: var(--accent2); }
.bar-val { position: absolute; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--muted); white-space: nowrap; }
.cols { margin-top: 10px; width: 100%; min-height: 210px; }
.cols svg { display: block; max-width: 100%; }
.cols .grid { stroke: var(--grid); stroke-width: 1; }
.cols .tick { fill: var(--muted); font-size: 11px; }
.cols .col { fill: var(--accent); transition: fill .1s; }
.cols .col.hot { fill: var(--accent2); }
.cols .hit { fill: transparent; }
details.tbl { margin-top: 12px; font-size: 13px; }
details.tbl summary { cursor: pointer; color: var(--muted); width: max-content; }
details.tbl summary:hover { color: var(--text); }
details.tbl table { margin-top: 8px; border-collapse: collapse; width: 100%; max-height: 300px; display: block; overflow: auto; }
details.tbl th, details.tbl td { padding: 4px 10px; text-align: left; border-bottom: .5px solid var(--border); white-space: nowrap; }
details.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
#tip { position: fixed; z-index: 200; pointer-events: none; background: var(--surface3); border: .5px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; box-shadow: 0 8px 24px rgba(0,0,0,.5); max-width: 280px; }
#tip strong { color: #fff; font-size: 14px; }
#tip span { color: var(--muted); }

/* ---------- Player ---------- */
#player { position: fixed; left: 0; right: 0; bottom: 0; height: var(--player-h); z-index: 40; display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 1.4fr) minmax(0, 1fr); align-items: center; gap: 16px; padding: 10px 18px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: .5px solid var(--border); }
.p-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.p-cover { width: 62px; height: 62px; flex: none; border-radius: 6px; overflow: hidden; background: var(--surface2); display: block; }
.p-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-meta { min-width: 0; }
.p-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-center { display: flex; flex-direction: column; gap: 4px; align-items: center; min-width: 0; }
.p-btns { display: flex; align-items: center; gap: 6px; }
.ctl { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.ctl:hover { color: var(--text); background: var(--surface2); }
.ctl.on { color: var(--accent2); }
.ctl.play { width: 44px; height: 44px; color: #0b0f16; background: #fff; }
.ctl.play:hover { background: #fff; transform: scale(1.06); color: #0b0f16; }
.ctl.repeat[data-mode=one]::after { content: "1"; position: absolute; right: 6px; top: 5px; font-size: 9px; font-weight: 800; color: var(--accent2); }
.p-seek { display: flex; align-items: center; gap: 10px; width: 100%; }
.p-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 38px; text-align: center; }
.p-right { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
#player.empty .p-center, #player.empty .p-right .vol { opacity: .45; }
.range { -webkit-appearance: none; appearance: none; flex: 1; min-width: 0; height: 16px; background: transparent; cursor: pointer; --fill: 0%; border: 0; padding: 0; box-shadow: none; }
.range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--text) var(--fill), rgba(255,255,255,.18) var(--fill)); }
.range::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255,255,255,.18); }
.range::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--text); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; margin-top: -4px; opacity: 0; }
.range::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; opacity: 0; }
.range:hover::-webkit-slider-thumb, .range:focus-visible::-webkit-slider-thumb { opacity: 1; }
.range:hover::-moz-range-thumb, .range:focus-visible::-moz-range-thumb { opacity: 1; }
.range:hover::-webkit-slider-runnable-track { background: linear-gradient(to right, var(--accent2) var(--fill), rgba(255,255,255,.18) var(--fill)); }
.range.vol { flex: none; width: 96px; }

/* ---------- Warteschlange ---------- */
#queuePanel { position: fixed; top: 0; right: 0; bottom: var(--player-h); width: min(380px, 100%); z-index: 45; background: var(--surface); border-left: .5px solid var(--border); overflow-y: auto; box-shadow: -16px 0 40px rgba(0,0,0,.4); }
.q-head { position: sticky; top: 0; display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface); border-bottom: .5px solid var(--border); }
.q-head .muted { margin-right: auto; font-size: 12.5px; }
.q-list { list-style: none; }
.q-list li { display: flex; align-items: center; border-bottom: .5px solid rgba(255,255,255,.04); }
.q-list li.cur { background: var(--surface2); box-shadow: inset 3px 0 0 var(--accent); }
.q-list li.done .q-t { color: var(--muted); }
.q-item { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; padding: 9px 14px; background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; }
.q-t, .q-s { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-s { font-size: 12.5px; color: var(--muted); }
.q-x { width: 32px; height: 32px; margin-right: 6px; border: 0; background: none; border-radius: 50%; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.q-x:hover { color: var(--text); background: var(--surface3); }
#queuePanel .pad { padding: 18px 14px; }

/* ---------- Schmale Bildschirme ---------- */
@media (max-width: 860px) {
  :root { --player-h: 128px; }
  #app { grid-template-columns: minmax(0, 1fr); }
  #side { position: sticky; top: 0; z-index: 30; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 8px 12px; border-right: 0; border-bottom: .5px solid var(--border); }
  .brand span:last-child, #nav a span, .side-foot #who { display: none; }
  .brand { padding: 0; }
  #nav { flex-direction: row; gap: 2px; }
  #nav a { padding: 8px 12px; }
  #nav a[aria-current=page] { box-shadow: inset 0 -3px 0 var(--accent); }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; padding: 0; }
  #top { top: 56px; padding: 8px 12px; }
  #view { padding: 16px 14px 28px; }
  h1 { font-size: 24px; }
  .hero .cover.big { width: 150px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px 10px; }
  .album, .artist { padding: 6px; }
  #player { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "left right" "center center"; gap: 4px 10px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
  .p-left { grid-area: left; }
  .p-right { grid-area: right; }
  .p-center { grid-area: center; }
  .p-cover { width: 48px; height: 48px; }
  .range.vol, .p-right #player .vol { display: none; }
  .p-right .vol { display: none; }
  #queuePanel { top: auto; height: 55dvh; width: 100%; border-left: 0; border-top: .5px solid var(--border); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Songradio ---------- */
.radio-btn { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; opacity: 0; }
.tracks li:hover .radio-btn, .tracks li:focus-within .radio-btn, .radio-btn:focus-visible { opacity: 1; }
.radio-btn:hover { color: var(--accent2); background: var(--surface2); }
@media (hover: none) { .radio-btn { opacity: .7; } }
.ctl:disabled { opacity: .35; cursor: default; }
