/* TraX — Musik direkt von den Künstlern. Eine Idee trägt alles: die Wellenform
 * ist das Preisschild. Der hörbare Teil leuchtet (Natriumgelb), der Rest bleibt
 * gedämpft, bis bezahlt ist. Lila = WaveBlue / Aktion. Sonst Ruhe. */

@font-face {
  font-family: "Archivo";
  src: url("/trax/fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --nacht: #16122A;
  --flaeche: #211B3B;
  --flaeche-hoch: #2B2450;
  --linie: #3A3266;
  --lila: #6C63FF;
  --lila-hell: #8F88FF;
  --licht: #F5D547;
  --dunkel-welle: #4A4270;
  --text: #EEEAF8;
  --leise: #A8A1C7;
  --warnung: #FF8A8A;
  --unten-h: 60px;
  --spieler-h: 72px;
  --sicher-unten: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--nacht);
  color: var(--text);
  font: 400 16px/1.5 "Archivo", system-ui, sans-serif;
  font-stretch: 100%;
  min-height: 100dvh;
  padding-bottom: calc(var(--unten-h) + var(--sicher-unten) + 16px);
}
body.spielt { padding-bottom: calc(var(--unten-h) + var(--spieler-h) + var(--sicher-unten) + 16px); }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; }
:focus-visible { outline: 3px solid var(--licht); outline-offset: 2px; border-radius: 4px; }

.sprung { position: absolute; left: -999px; top: 8px; background: var(--licht); color: var(--nacht); padding: 8px 12px; z-index: 50; }
.sprung:focus { left: 8px; }

/* ── Kopf ─────────────────────────────────────────────────────────────── */
.kopf {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 10px;
  max-width: 760px; margin: 0 auto;
}
.marke {
  text-decoration: none; font-weight: 800; font-stretch: 125%;
  font-size: 1.6rem; letter-spacing: -0.02em; line-height: 1;
}
.marke span { color: var(--licht); }
.zurueck { margin-right: auto; margin-left: 14px; color: var(--leise); font-size: .88rem; text-decoration: none; border-left: 1px solid var(--linie); padding-left: 14px; }
.zurueck:hover { color: var(--text); }
.konto { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--leise); min-height: 36px; }
.konto .guthaben { font-stretch: 75%; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.konto img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--flaeche-hoch); }

main { max-width: 760px; margin: 0 auto; padding: 4px 16px 24px; outline: none; }
main:focus, main:focus-visible { outline: none; }  /* Fokus nach Seitenwechsel: nur für Screenreader */

/* ── Überschriften: die Breitenachse ist das Stilmittel ─────────────────── */
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.015em; }
h1 { font-size: clamp(2rem, 8vw, 3.2rem); font-stretch: 125%; line-height: 1.02; }
h2 { font-size: 1.25rem; font-stretch: 112%; margin: 28px 0 10px; }
.unterzeile { color: var(--leise); margin: 10px 0 0; max-width: 60ch; }

/* ── Umschalter (Neu / Beliebt, Genres) ─────────────────────────────── */
.reiter { display: flex; gap: 6px; overflow-x: auto; padding: 16px 0 6px; scrollbar-width: none; }
.reiter::-webkit-scrollbar { display: none; }
.reiter button {
  flex: none; border: 1px solid var(--linie); background: transparent; border-radius: 999px;
  padding: 7px 14px; font-size: .9rem; cursor: pointer; color: var(--leise);
}
.reiter button[aria-pressed="true"] { background: var(--text); color: var(--nacht); border-color: var(--text); font-weight: 700; }

/* ── Titel-Zeilen ─────────────────────────────────────────────────────── */
.liste { list-style: none; margin: 8px 0 0; padding: 0; }
.zeile {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 4px 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--flaeche-hoch);
}
.zeile .bild { width: 56px; height: 56px; border-radius: 6px; object-fit: cover; background: var(--flaeche-hoch); grid-row: span 2; }
.zeile .titel { font-weight: 700; font-stretch: 108%; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zeile .wer { color: var(--leise); font-size: .88rem; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zeile .welle { grid-column: 1 / -1; height: 34px; cursor: pointer; }
.zeile .rechts { grid-row: span 2; display: flex; align-items: center; gap: 8px; }
.preis { font-stretch: 75%; font-weight: 700; font-size: .85rem; color: var(--leise); white-space: nowrap; font-variant-numeric: tabular-nums; }
.explizit { display: inline-block; font-size: .7rem; font-weight: 800; border: 1px solid var(--leise); color: var(--leise); border-radius: 3px; padding: 0 4px; margin-left: 6px; vertical-align: 2px; }

/* ── Wellenform (SVG) ─────────────────────────────────────────────────── */
.welle svg { width: 100%; height: 100%; display: block; }
.welle rect { fill: var(--dunkel-welle); }
.welle rect.hoerbar { fill: var(--licht); }
.welle rect.gespielt { fill: var(--text); }
.welle.alles rect { fill: var(--licht); opacity: .55; }
.welle.alles rect.gespielt { fill: var(--licht); opacity: 1; }

/* ── Knöpfe ───────────────────────────────────────────────────────────── */
.rund {
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; flex: none;
  background: var(--text); color: var(--nacht); display: grid; place-items: center;
}
.rund svg { width: 18px; height: 18px; }
.rund.klein { width: 36px; height: 36px; background: var(--flaeche-hoch); color: var(--text); }
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 13px 18px; font-weight: 700; cursor: pointer;
  background: var(--lila); color: #fff; text-decoration: none; min-height: 48px;
}
.knopf:hover { background: var(--lila-hell); }
.knopf.zweit { background: transparent; border: 1px solid var(--linie); color: var(--text); }
.knopf.zweit:hover { border-color: var(--leise); }
.knopf[disabled] { opacity: .5; cursor: default; }
.knopf.breit { width: 100%; }
.textknopf { background: none; border: 0; color: var(--leise); text-decoration: underline; cursor: pointer; padding: 6px 0; font-size: .9rem; }

/* ── Track-Seite ──────────────────────────────────────────────────────── */
.track-kopf { display: grid; gap: 18px; padding-top: 12px; }
.track-bild { width: min(100%, 320px); aspect-ratio: 1; border-radius: 10px; object-fit: cover; background: var(--flaeche-hoch); }
.track-kopf .wer { color: var(--leise); font-size: 1.05rem; text-decoration: none; }
.track-kopf .wer:hover { color: var(--text); }
.grosse-welle { height: 96px; margin: 22px 0 6px; cursor: pointer; }
.wellen-legende { display: flex; justify-content: space-between; font-size: .82rem; color: var(--leise); font-stretch: 80%; }
.wellen-legende b { color: var(--licht); font-weight: 700; }
.kauf { display: grid; gap: 10px; margin-top: 20px; }
.kauf .hinweis { color: var(--leise); font-size: .88rem; margin: 0; }
.beschreibung { white-space: pre-line; color: var(--leise); max-width: 62ch; }
.fakten { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--leise); font-size: .88rem; margin-top: 18px; }

@media (min-width: 700px) {
  .track-kopf { grid-template-columns: 280px 1fr; align-items: end; }
  .track-bild { width: 280px; }
}

/* ── Künstler ─────────────────────────────────────────────────────────── */
.kuenstler-kopf { display: flex; gap: 16px; align-items: center; padding-top: 12px; }
.kuenstler-kopf img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; background: var(--flaeche-hoch); }

/* ── Suche ────────────────────────────────────────────────────────────── */
.suchfeld { width: 100%; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px; padding: 14px 16px; font-size: 1.05rem; margin-top: 12px; }
.suchfeld:focus { border-color: var(--lila); outline: none; }

/* ── Formulare (Studio) ───────────────────────────────────────────────── */
.formular { display: grid; gap: 14px; margin-top: 12px; }
.feld { display: grid; gap: 6px; }
.feld > span { font-size: .9rem; color: var(--leise); }
.feld input[type=text], .feld input[type=number], .feld select, .feld textarea {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; padding: 12px 14px; width: 100%;
}
.feld textarea { min-height: 90px; resize: vertical; }
.feld input:focus, .feld select:focus, .feld textarea:focus { border-color: var(--lila); outline: none; }
.reihe { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.haken { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; }
.haken input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--lila); flex: none; }
.ablage {
  border: 2px dashed var(--linie); border-radius: 14px; padding: 26px 16px; text-align: center; cursor: pointer;
  color: var(--leise); display: grid; gap: 6px; place-items: center;
}
.ablage.drueber { border-color: var(--licht); color: var(--text); }
.ablage strong { color: var(--text); font-stretch: 110%; }
.fortschritt { height: 6px; background: var(--flaeche-hoch); border-radius: 3px; overflow: hidden; }
.fortschritt i { display: block; height: 100%; width: 0; background: var(--licht); transition: width .2s; }
.fehler { color: var(--warnung); font-size: .9rem; margin: 0; }

.status { font-size: .8rem; font-weight: 700; font-stretch: 85%; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.status.verarbeitung { background: var(--flaeche-hoch); color: var(--leise); }
.status.entwurf { background: transparent; border: 1px solid var(--leise); color: var(--leise); }
.status.live { background: var(--licht); color: var(--nacht); }
.status.fehler { background: #4A2233; color: var(--warnung); }

.zahlen { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 12px; }
.zahl { background: var(--flaeche); border-radius: 12px; padding: 14px 16px; }
.zahl b { display: block; font-size: 2rem; font-stretch: 70%; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.zahl span { color: var(--leise); font-size: .88rem; }

/* ── Leere Zustände ───────────────────────────────────────────────────── */
.leer { color: var(--leise); padding: 28px 0; max-width: 46ch; }
.leer strong { display: block; color: var(--text); font-size: 1.15rem; font-stretch: 110%; margin-bottom: 6px; }

/* ── Player-Leiste ────────────────────────────────────────────────────── */
.spieler {
  position: fixed; left: 0; right: 0; bottom: calc(var(--unten-h) + var(--sicher-unten));
  height: var(--spieler-h); background: var(--flaeche); border-top: 1px solid var(--linie);
  display: grid; grid-template-columns: 48px 1fr 44px; gap: 12px; align-items: center; padding: 0 16px; z-index: 20;
}
.spieler[hidden] { display: none; }
.spieler-bild { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; background: var(--flaeche-hoch); }
.spieler-mitte { min-width: 0; display: grid; gap: 4px; }
.spieler-titel { font-weight: 700; font-size: .92rem; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spieler-titel small { color: var(--leise); font-weight: 400; margin-left: 6px; }
.spieler-welle { height: 22px; cursor: pointer; }

/* ── Navigation unten ─────────────────────────────────────────────────── */
.unten {
  position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--unten-h) + var(--sicher-unten));
  padding-bottom: var(--sicher-unten); background: var(--nacht); border-top: 1px solid var(--flaeche-hoch);
  display: grid; grid-template-columns: repeat(3, 1fr); z-index: 21;
}
.unten a { display: grid; place-items: center; text-decoration: none; color: var(--leise); font-weight: 600; font-size: .92rem; }
.unten a[aria-current="page"] { color: var(--text); box-shadow: inset 0 3px 0 var(--licht); }

/* ── Meldung + Dialog ─────────────────────────────────────────────────── */
.meldung {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0;
  bottom: calc(var(--unten-h) + var(--spieler-h) + var(--sicher-unten) + 12px);
  background: var(--text); color: var(--nacht); padding: 11px 16px; border-radius: 10px; font-weight: 600; font-size: .92rem;
  max-width: calc(100vw - 32px); transition: opacity .2s, transform .2s; pointer-events: none; z-index: 40;
}
.meldung.an { opacity: 1; transform: translateX(-50%) translateY(0); }
.meldung.warnung { background: var(--warnung); }

.dialog {
  background: var(--flaeche); color: var(--text); border: 1px solid var(--linie); border-radius: 16px;
  padding: 22px; width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
}
.dialog::backdrop { background: rgba(10, 8, 22, .72); }
.dialog h2 { margin-top: 0; }
.dialog .knoepfe { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.rechtetext { background: var(--nacht); border-radius: 10px; padding: 12px 14px; font-size: .92rem; color: var(--leise); margin: 12px 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media (min-width: 760px) {
  .zahlen { grid-template-columns: repeat(4, 1fr); }
}
