/* Song-Block: Plattenhülle mit Cover, beim Abspielen gleitet die Platte heraus und dreht sich. */

.zw-song-wrap {
  max-width: 560px;
  margin: 50px auto;
}

.zw-song {
  --zw-song-accent: var(--color-accent, #E74620);
  --zw-song-progress: 0%;
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 24px 28px 24px 24px;
  background-color: #f7f7f7;
  font-family: "OpenSans-Regular", sans-serif;
  color: #404040;
}

/* --- Platte und Hülle ------------------------------------------------- */

.zw-song__record {
  position: relative;
  flex: 0 0 auto;
  width: 172px;
  height: 128px;
}

.zw-song__sleeve {
  position: absolute;
  top: 0;
  left: 0;
  width: 128px;
  height: 128px;
  background-color: #e7e7e7;
  background-size: cover;
  background-position: center;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
  transform: rotate(-3deg);
  transition: transform 400ms ease;
  z-index: 2;
}

/* Ohne Cover: schlichte Hülle in Akzentfarbe mit Notenzeichen */
.zw-song__sleeve--plain {
  background-color: var(--zw-song-accent);
}
.zw-song__sleeve--plain::after {
  content: "\266A";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 54px;
  line-height: 1;
}

.zw-song__disc {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle at center, #1d1d1d 0 1px, #2b2b2b 1px 3px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  transform: translateX(14px);
  transition: transform 500ms cubic-bezier(.2, .8, .2, 1);
  z-index: 1;
}

/* Lichtreflex auf der Platte */
.zw-song__disc::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 30deg, transparent 0 40deg, rgba(255, 255, 255, 0.12) 60deg, transparent 80deg 220deg, rgba(255, 255, 255, 0.08) 240deg, transparent 260deg);
}

.zw-song__disc-label {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background-color: var(--zw-song-accent);
  background-size: cover;
  background-position: center;
  animation: zw-song-spin 3.2s linear infinite;
  animation-play-state: paused;
}

/* Mittelloch */
.zw-song__disc-label::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background-color: #f7f7f7;
}

.zw-song.is-playing .zw-song__disc {
  transform: translateX(46px);
}
.zw-song.is-playing .zw-song__disc-label {
  animation-play-state: running;
}
.zw-song.is-playing .zw-song__sleeve {
  transform: rotate(0deg);
}

@keyframes zw-song-spin {
  to { transform: rotate(360deg); }
}

/* --- Titel und Bedienung ---------------------------------------------- */

.zw-song__body {
  flex: 1 1 auto;
  min-width: 0;
}

.zw-song__title {
  margin: 0 0 14px;
  font-family: "OpenSans-Bold", sans-serif;
  font-size: 20px;
  line-height: 1.25;
  color: #404040;
  overflow-wrap: anywhere;
}

.zw-song__controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.zw-song__play {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: var(--zw-song-accent);
  color: #fff;
  cursor: pointer;
  transition: transform 150ms ease, filter 150ms ease;
}
.zw-song__play:hover {
  filter: brightness(0.92);
}
.zw-song__play:active {
  transform: scale(0.95);
}
.zw-song__play:focus {
  outline: 0;
}
.zw-song__play:focus-visible {
  outline: 2px solid #404040;
  outline-offset: 3px;
}
.zw-song__play svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}
.zw-song__icon-pause,
.zw-song.is-playing .zw-song__icon-play {
  display: none;
}
.zw-song.is-playing .zw-song__icon-pause {
  display: block;
}

.zw-song__track {
  flex: 1 1 auto;
  min-width: 0;
}

/* Fortschrittsleiste (doppelte Klasse, damit die Theme-Regel für input[type=range] nicht greift) */
.zw-song .zw-song__seek {
  display: block;
  width: 100%;
  height: 14px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.zw-song__seek:focus-visible {
  outline: 2px solid #404040;
  outline-offset: 2px;
}
.zw-song__seek::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--zw-song-accent) var(--zw-song-progress), #d6d6d6 var(--zw-song-progress));
}
.zw-song__seek::-moz-range-track {
  height: 3px;
  border-radius: 2px;
  background: #d6d6d6;
}
.zw-song__seek::-moz-range-progress {
  height: 3px;
  border-radius: 2px;
  background: var(--zw-song-accent);
}
.zw-song__seek::-webkit-slider-thumb {
  width: 13px;
  height: 13px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: var(--zw-song-accent);
  -webkit-appearance: none;
  appearance: none;
}
.zw-song__seek::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 0;
  border-radius: 50%;
  background: var(--zw-song-accent);
}

.zw-song__times {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 13px;
  color: #696969;
  font-variant-numeric: tabular-nums;
}

/* Kleiner Equalizer, läuft nur beim Abspielen */
.zw-song__bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 12px;
}
.zw-song__bars i {
  display: block;
  width: 3px;
  height: 3px;
  background-color: var(--zw-song-accent);
  opacity: 0.35;
}
.zw-song.is-playing .zw-song__bars i {
  opacity: 1;
  animation: zw-song-bar 900ms ease-in-out infinite alternate;
}
.zw-song.is-playing .zw-song__bars i:nth-child(2) { animation-delay: -300ms; }
.zw-song.is-playing .zw-song__bars i:nth-child(3) { animation-delay: -600ms; }
.zw-song.is-playing .zw-song__bars i:nth-child(4) { animation-delay: -150ms; }

@keyframes zw-song-bar {
  from { height: 3px; }
  to   { height: 12px; }
}

/* --- KI-Hinweis --------------------------------------------------------- */

.zw-song-wrap .zw-song__ai {
  width: auto;
  max-width: none;
  margin: 8px 0 0;
  padding: 0;
  text-align: left;
  font-size: 11px;
  line-height: 1.4;
  color: #8a8a8a;
}

/* --- Leerer Block im Editor --------------------------------------------- */

.zw-song--empty {
  display: block;
  max-width: 560px;
  margin: 20px auto;
  padding: 20px;
  border: 1px dashed #bbb;
  font-size: 14px;
  color: #696969;
  text-align: center;
}

/* --- Schmale Bildschirme ------------------------------------------------ */

@media screen and (max-width: 575px) {
  .zw-song {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    padding: 22px 20px;
  }
  .zw-song__record {
    align-self: center;
  }
  .zw-song__title {
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .zw-song__disc,
  .zw-song__sleeve {
    transition: none;
  }
  .zw-song__disc-label,
  .zw-song.is-playing .zw-song__bars i {
    animation: none;
  }
}
