/* Startseite: Plattenspieler links, Titel und Songliste rechts */
:root {
  --deck-h: min(88vh, 940px);
  /* Seitenverhältnis des sichtbaren Deck-Ausschnitts (GEO.view in js/deck-draw.js) */
  --deck-w: calc(var(--deck-h) * 956 / 1001);
  /* 532px = Titel, Reiter, Player und Opis Signatur darunter */
  --list-h: min(calc(100vh - 532px), 380px);
  /* Platz rechts für die Verschenken-Karte (128px breit + 32px Abstand + Luft) */
  --gift-space: 190px;
}

/* ---------- Plattenspieler ---------- */
.deck {
  position: absolute;
  left: 0;
  top: 50%;
  height: var(--deck-h);
  aspect-ratio: var(--deck-ratio, 956 / 1001);
  transform: translateY(-50%);
  cursor: pointer;
}

.deck-base,
.deck-arm {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.deck-base {
  filter: drop-shadow(0 30px 50px rgba(0, 0, 0, 0.6));
}

/* Start/Stop-Knopf unten: Hover zeigt Linie (hoch, dann waagerecht) und Beschriftung */
.deck-base .ss-line {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 0.45s var(--ease-out) 0.12s;
}

.deck-base .ss-label {
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.2s ease, transform 0.25s ease;
}

.deck-base .ss-knob {
  transition: stroke 0.25s ease;
}

.deck-base .ss:hover .ss-line,
.deck:focus-visible .ss-line {
  stroke-dashoffset: 0;
  transition-delay: 0s;
}

.deck-base .ss:hover .ss-label,
.deck:focus-visible .ss-label {
  opacity: 1;
  transform: none;
  transition: opacity 0.3s ease 0.38s, transform 0.35s var(--ease-out) 0.38s;
}

.deck-base .ss:hover .ss-knob,
.deck:focus-visible .ss-knob {
  stroke: var(--accent);
}

.deck-arm {
  pointer-events: none;
  filter: drop-shadow(6px 10px 7px rgba(0, 0, 0, 0.55));
  transition: filter 0.5s var(--ease-out);
}

.deck-arm.lifted {
  filter: drop-shadow(16px 24px 14px rgba(0, 0, 0, 0.42));
}

.record-pos {
  position: absolute;
  left: var(--rec-left);
  top: var(--rec-top);
  width: var(--rec-size);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
}

/* ---------- Rechte Seite ---------- */
.side {
  position: absolute;
  left: calc(var(--deck-w) + 4vw);
  right: max(4vw, var(--gift-space));
  top: 50%;
  max-width: 640px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
}

.titlebox {
  position: relative;
  height: calc(clamp(44px, 4.6vw, 84px) * 0.95 + 46px);
  margin-bottom: 26px;
}

.tt {
  position: absolute;
  inset: 0 0 auto 0;
}

.tt h1 {
  font-size: clamp(44px, 4.6vw, 84px);
  white-space: nowrap;
  overflow: hidden;
  padding: 0.06em 0 0.05em;
}

.tt h1 .c {
  display: inline-block;
  white-space: pre;
}

/* Der Name gleitet als Ganzes: Buchstaben einzeln bewegt + Farbverlauf (background-clip:text)
   zeichnet Chrome/Brave verschmiert. Keine Unschärfe-Effekte. */
.tt h1 {
  transition: transform 0.6s cubic-bezier(0.2, 0.75, 0.25, 1), opacity 0.45s ease;
}

.tt.enter h1 {
  transform: translateY(35%);
  opacity: 0;
}

.tt .meta {
  margin-top: 12px;
  font-size: 15px;
  color: var(--soft);
  transition: opacity 0.35s ease 0.2s;
}

.tt.enter .meta,
.tt.leave .meta {
  opacity: 0;
}

/* Alter Titel verschwindet schnell und vollständig, bevor etwas Neues erscheint */
.tt.leave h1,
.tt.leave .meta {
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* "Platte wird geladen …" erscheint erst, wenn der alte Titel raus ist */
.tt.loading .meta {
  margin-top: 0;
  padding-top: calc(clamp(44px, 4.6vw, 84px) * 0.35);
  font-size: 16px;
  font-style: italic;
  animation: loading-in 0.4s ease 0.45s both, loading-pulse 1.6s ease-in-out 0.85s infinite;
}

.tt.loading.leave .meta {
  animation: none;
}

@keyframes loading-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes loading-pulse {
  50% { opacity: 0.45; }
}

.skel {
  display: block;
  border-radius: 6px;
  background: linear-gradient(90deg, #1a1a1c 0, #2a2a2d 40%, #1a1a1c 80%) 0 0 / 300% 100%;
  animation: sheen 1.3s linear infinite;
}

@keyframes sheen {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -200% 0;
  }
}

/* Reiter */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  align-items: center;
  margin-bottom: 10px;
  min-height: 34px;
}

.tabs .tab {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.tabs .tab:hover {
  color: var(--text);
}

.tabs .tab.on {
  color: var(--text);
  border-color: var(--accent);
}

/* Eigene Suche als Reiter, mit X löschbar */
.tab-saved {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tab-x {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 10px;
  color: var(--muted);
  transition: background 0.2s, color 0.2s;
}

.tab-x:hover,
.tab-x:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
}

.shuf {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--soft);
  padding: 6px 12px;
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}

.shuf:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.shuf svg {
  width: 15px;
  height: 15px;
}

.shuf.go svg {
  animation: spin 0.8s linear infinite;
}

body.searching .shuf {
  display: none;
}

/* Suche */
.find {
  display: none;
  position: relative;
  margin: 4px 0 8px;
}

body.searching .find {
  display: block;
}

.find svg {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--muted);
}

.find input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(15, 15, 15, 0.8);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  padding: 0 44px 0 42px;
  outline: 0;
  transition: border-color 0.2s;
}

.find input:focus {
  border-color: var(--accent);
}

.find input::-webkit-search-cancel-button {
  display: none;
}

.find .clr {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--muted);
  font-size: 12px;
  display: none;
}

.find.has .clr {
  display: block;
}

/* Liste */
.listarea {
  height: var(--list-h);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #222 transparent;
  padding-right: 6px;
  margin-right: -6px;
}

body.searching .listarea {
  height: calc(var(--list-h) - 58px);
}

.listarea.more {
  -webkit-mask-image: linear-gradient(#000 calc(100% - 46px), transparent);
  mask-image: linear-gradient(#000 calc(100% - 46px), transparent);
}

.rows {
  list-style: none;
}

.rows li {
  display: grid;
  grid-template-columns: 30px 44px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 7px 8px 7px 0;
  border-radius: 8px;
  cursor: pointer;
}

.rows li:hover {
  background: rgba(255, 255, 255, 0.035);
}

.rows .n {
  position: relative;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.rows .n svg {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 14px;
  height: 14px;
  opacity: 0;
  fill: var(--text);
}

.rows li:hover .n s,
.rows li.on .n s {
  opacity: 0;
}

.rows .n s {
  text-decoration: none;
}

.rows li:not(.live):hover .ic-play,
.rows li.on:not(.live) .ic-play {
  opacity: 1;
}

.rows li.on.live .ic-bars {
  opacity: 1;
  fill: var(--accent);
}

.rows li.on.live:hover .ic-bars {
  opacity: 0;
}

.rows li.on.live:hover .ic-pause {
  opacity: 1;
}

.rows li.on.live .ic-bars rect {
  animation: eq 1s ease-in-out infinite;
  transform-origin: 50% 100%;
}

.rows li.on.live .ic-bars rect:nth-child(2) {
  animation-delay: -0.35s;
}

.rows li.on.live .ic-bars rect:nth-child(3) {
  animation-delay: -0.7s;
}

@keyframes eq {
  0%,
  100% {
    transform: scaleY(0.35);
  }
  50% {
    transform: scaleY(1);
  }
}

.rows img {
  width: 44px;
  height: 44px;
  border-radius: 3px;
  display: block;
  object-fit: cover;
  background: var(--surface2);
  transition: transform 0.3s var(--ease-out);
}

.rows li:hover img {
  transform: scale(1.06);
}

.rows b {
  display: block;
  font-weight: 500;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rows li.on b {
  color: var(--accent);
}

.rows .ar {
  display: block;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rows em {
  font-style: normal;
  font-size: 13px;
  color: var(--soft);
  font-variant-numeric: tabular-nums;
}

.rows li.on em {
  color: var(--accent);
}

.rows .msg {
  display: block;
  color: var(--muted);
  font-size: 15px;
  padding: 16px 0;
  cursor: default;
}

.rows .msg:hover {
  background: none;
}

.rows li.sk {
  cursor: default;
}

.rows li.sk .ph {
  width: 44px;
  height: 44px;
}

.rows li.sk .b1 {
  height: 11px;
  width: 42%;
  margin-bottom: 7px;
}

.rows li.sk .b2 {
  height: 9px;
  width: 26%;
}

.rows li.sk .tm {
  width: 30px;
  height: 10px;
}

.rows.land li {
  animation: land 0.5s var(--ease-out) both;
  animation-delay: calc(var(--k) * 55ms);
}

@keyframes land {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* Vorschläge in der Suche */
.recs {
  display: none;
}

body.searching .recs.on {
  display: block;
}

.recs h4 {
  font-size: 15px;
  font-weight: 400;
  color: var(--soft);
  margin: 6px 0 14px;
}

.recs .crate {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 18px;
}

.recs .rec {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-align: left;
}

.recs .rec img {
  flex: none;
  width: 60px;
  height: 60px;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 8px 16px -10px rgba(0, 0, 0, 0.6);
  transition: transform 0.4s var(--ease-out);
}

.recs .rec:hover img {
  transform: translateX(4px) rotate(-3deg);
}

.recs .rec b {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
}

.recs .rec span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Spotify-Bereich */
.listen {
  margin-top: 22px;
}

.preview-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(204, 51, 204, 0.25);
  border-radius: 14px;
  background: var(--accent-soft);
  font-size: 14px;
  color: var(--soft);
}

.preview-hint[hidden] {
  display: none;
}

.preview-hint .btn {
  padding: 0.55rem 1.2rem;
}

.embed {
  min-height: 80px;
  border-radius: 12px;
  overflow: hidden;
}

.embed iframe {
  display: block;
  border: 0;
}

.fatal {
  font-size: 15px;
  color: var(--soft);
}

/* ---------- Schmal (Handy, Tablet) ---------- */
@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  :root {
    --deck-h: 100vw;
    --list-h: auto;
  }

  .deck {
    position: relative;
    top: 0;
    transform: none;
    margin-top: -14vw;
  }

  .side {
    position: relative;
    left: 0;
    right: 0;
    top: 0;
    transform: none;
    padding: 0 20px 150px;
    max-width: none;
  }

  .listarea,
  body.searching .listarea {
    height: auto;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .recs .crate {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .madeby {
    position: static;
    text-align: center;
    padding: 10px 0 120px;
  }
}
