/* LoadTronic Hörproben-Player (lt-player.js): ▶ auf den Beat-Karten + Glas-Leiste unten.
   Glas wie die Navigation; geschlossen ist die Leiste display:none (Safari 26 färbt sonst seine Leisten ein). */

/* ---------- ▶ auf der Karte (unten rechts auf dem Cover) ---------- */
.lt-play{
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 4;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.8);
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.72));
  -webkit-backdrop-filter: blur(14px) saturate(1.6);
  backdrop-filter: blur(14px) saturate(1.6);
  color: #2b6db3;
  box-shadow: 0 8px 22px rgba(8,22,52,.24);
  cursor: pointer;
  opacity: 0;
  transform: scale(.8);
  pointer-events: none;                          /* erst klickbar, wenn es eine Hörprobe gibt */
  transition: opacity .25s ease, transform .2s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.lt-play.is-ready{ opacity: 1; transform: none; pointer-events: auto; }
/* in einer Liste/Zeile statt auf einem Cover (Drum-Kit-Beispiele, 404-Seite) */
.lt-play.lt-play--inline{ position: relative; right: auto; bottom: auto; flex: none; box-shadow: 0 4px 12px rgba(8,22,52,.16); border-color: rgba(11,18,32,.08); }
.lt-play.is-ready:hover{ transform: scale(1.08); box-shadow: 0 10px 26px rgba(8,22,52,.3); }
.lt-play:focus-visible{ outline: 3px solid #20B5E1; outline-offset: 3px; }
.lt-play svg{ width: 20px; height: 20px; display: block; }
.lt-play .lt-ico-pause,
.lt-play .lt-eq{ display: none; }
.lt-play.is-playing{
  background: linear-gradient(135deg, #20B5E1, #3F68AE);
  color: #fff;
  border-color: rgba(255,255,255,.5);
}
.lt-play.is-playing .lt-ico-play{ display: none; }
.lt-play.is-playing .lt-eq{ display: flex; }
@media (hover: hover){
  .lt-play.is-playing:hover .lt-eq{ display: none; }
  .lt-play.is-playing:hover .lt-ico-pause{ display: block; }
}
/* läuft gerade: fünf kleine Balken wie im Logo */
.lt-eq{ align-items: center; gap: 2px; height: 18px; }
.lt-eq i{
  display: block;
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: currentColor;
  transform-origin: 50% 50%;
  animation: ltEq .9s ease-in-out infinite;
}
.lt-eq i:nth-child(1){ animation-delay: -.45s; }
.lt-eq i:nth-child(2){ animation-delay: -.15s; }
.lt-eq i:nth-child(3){ animation-delay: -.6s; }
.lt-eq i:nth-child(4){ animation-delay: -.3s; }
.lt-eq i:nth-child(5){ animation-delay: -.75s; }
@keyframes ltEq{
  0%, 100%{ transform: scaleY(.3); }
  50%{ transform: scaleY(1); }
}
/* lädt: dünner Ring */
.lt-play.is-loading::after,
.lt-player.is-loading .lt-player-main::after{
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #20B5E1;
  animation: ltSpin .8s linear infinite;
}
@keyframes ltSpin{ to{ transform: rotate(360deg); } }

/* ---------- Leiste unten ---------- */
.lt-player{
  display: none;
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom, 14px));
  z-index: 610;                                  /* unter den Shop-Schubladen (620) und allen Popups */
  width: min(980px, calc(100% - 24px));
  box-sizing: border-box;
  padding: 10px 10px 10px 10px;
  border-radius: 22px;
  border: 1px solid rgba(11,18,32,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.86), rgba(255,255,255,.62));
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
  backdrop-filter: blur(22px) saturate(1.6);
  box-shadow: 0 18px 48px rgba(10,25,70,.22), 0 2px 8px rgba(10,25,70,.08);
  color: var(--ink, #0b1220);
  transform: translateX(-50%);
  grid-template-columns: 44px minmax(140px, 270px) auto minmax(120px, 1fr) auto auto 34px;
  grid-template-areas: "cover text ctrl wave time buy close";
  align-items: center;
  column-gap: 12px;
}
.lt-player.is-open{ display: grid; animation: ltPlayerIn .35s cubic-bezier(.2,.8,.2,1) both; }
.lt-player.is-closing{ animation: ltPlayerOut .25s ease both; }
@keyframes ltPlayerIn{ from{ opacity: 0; transform: translate(-50%, 24px) scale(.98); } to{ opacity: 1; transform: translate(-50%, 0); } }
@keyframes ltPlayerOut{ to{ opacity: 0; transform: translate(-50%, 18px) scale(.98); } }

.lt-player-cover{
  grid-area: cover;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  object-fit: cover;
  display: block;
  background: rgba(11,18,32,.06);
}
.lt-player-text{ grid-area: text; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lt-player-title{ font-size: 14px; font-weight: 900; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-player-sub{ font-size: 11.5px; font-weight: 700; color: rgba(11,18,32,.58); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lt-player-ctrl{ grid-area: ctrl; display: flex; align-items: center; gap: 4px; }
.lt-player-btn,
.lt-player-close{
  position: relative;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--ink, #0b1220);
  cursor: pointer;
  transition: background .15s ease, transform .15s ease, opacity .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.lt-player-btn svg{ width: 18px; height: 18px; display: block; }
.lt-player-btn:hover,
.lt-player-close:hover{ background: rgba(11,18,32,.07); }
.lt-player-btn:disabled{ opacity: .3; cursor: default; background: transparent; }
.lt-player-main{
  width: 44px;
  height: 44px;
  color: #fff;
  background: linear-gradient(135deg, #20B5E1, #3F68AE);
  box-shadow: 0 6px 16px rgba(32,120,190,.35);
}
.lt-player-main:hover{ background: linear-gradient(135deg, #20B5E1, #3F68AE); transform: scale(1.05); }
.lt-player-main svg{ width: 20px; height: 20px; }
.lt-player-main .lt-ico-pause{ display: none; }
.lt-player.is-playing .lt-player-main .lt-ico-play{ display: none; }
.lt-player.is-playing .lt-player-main .lt-ico-pause{ display: block; }
.lt-player-btn:focus-visible,
.lt-player-close:focus-visible,
.lt-player-buy:focus-visible,
.lt-player-wave:focus-visible{ outline: 3px solid #20B5E1; outline-offset: 2px; }

/* Wellenform: graue Balken, darüber dieselben in Markenblau, bis zur aktuellen Stelle sichtbar */
.lt-player-wave{
  grid-area: wave;
  position: relative;
  height: 40px;
  cursor: ew-resize;                                /* spulen: klicken oder ziehen */
  touch-action: none;
  border-radius: 8px;
  user-select: none;
  -webkit-user-select: none;
}
/* Abspielmarke: dünne Linie mit Punkt an der aktuellen Stelle */
.lt-wave-kopf{
  position: absolute; top: 2px; bottom: 2px; left: 0; width: 2px; margin-left: -1px;
  border-radius: 2px; background: #1d4f8a; pointer-events: none; z-index: 2;
}
.lt-wave-kopf::after{
  content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border-radius: 50%; background: #fff; border: 2px solid #20B5E1; box-shadow: 0 2px 6px rgba(10,25,70,.25);
  transform: scale(.7); transition: transform .15s ease;
}
.lt-player-wave:hover .lt-wave-kopf::after, .lt-player-wave.is-ziehen .lt-wave-kopf::after{ transform: scale(1); }
/* Zeit unter dem Zeiger / beim Ziehen */
.lt-wave-tip{
  position: absolute; bottom: calc(100% + 6px); left: 0; transform: translateX(-50%);
  padding: 3px 7px; border-radius: 8px; background: var(--ink, #0b1220); color: #fff;
  font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .12s ease; z-index: 3;
}
.lt-player-wave.is-zeigen .lt-wave-tip{ opacity: 1; }
.lt-wave{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 1px;
  pointer-events: none;
}
.lt-wave i{ flex: 1 1 0; min-width: 1px; border-radius: 2px; background: rgba(11,18,32,.18); }
.lt-wave--fg{ clip-path: inset(0 100% 0 0); }
.lt-wave--fg i{ background: linear-gradient(180deg, #20B5E1, #3F68AE); }

.lt-player-time{ grid-area: time; font-size: 12px; font-weight: 800; color: rgba(11,18,32,.6); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lt-player-buy{
  grid-area: buy;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--ink, #0b1220);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.lt-player-buy:hover{ transform: translateY(-1px); box-shadow: 0 6px 16px rgba(11,18,32,.25); }
.lt-player-buy svg{ width: 16px; height: 16px; display: block; }
.lt-player-close{ grid-area: close; width: 34px; height: 34px; color: rgba(11,18,32,.6); }
.lt-player-buy[hidden]{ display: none; }
.lt-player-close svg{ width: 18px; height: 18px; display: block; }

/* Tablet: Zeit ausblenden */
@media (max-width: 900px){
  .lt-player{ grid-template-columns: 44px minmax(90px, 170px) auto minmax(90px, 1fr) auto 34px; grid-template-areas: "cover text ctrl wave buy close"; }
  .lt-player-time{ display: none; }
}
/* Handy: Wellenform als eigene Zeile oben, darunter Cover · Titel · Pause/Weiter · Warenkorb · × */
@media (max-width: 740px){
  .lt-player{
    width: calc(100% - 20px);
    padding: 8px 8px 8px 10px;
    border-radius: 20px;
    grid-template-columns: 40px minmax(0, 1fr) auto auto 32px;
    grid-template-areas: "wave wave wave wave wave" "cover text ctrl buy close";
    row-gap: 6px;
    column-gap: 8px;
  }
  .lt-player-wave{ height: 30px; }
  .lt-player-cover{ width: 40px; height: 40px; border-radius: 10px; }
  .lt-player-prev{ display: none; }
  .lt-player-buy{ width: 40px; height: 40px; padding: 0; justify-content: center; }
  .lt-player-buy span{ display: none; }
  .lt-player-buy svg{ width: 18px; height: 18px; }
  .lt-player-close{ width: 32px; height: 32px; }
}

/* Platz schaffen, solange die Leiste offen ist: Footer verlängern; Shop-Knöpfe „Filter/Warenkorb“ (≤ 1024 px) darüber */
body.lt-player-open footer::after{ content: ""; display: block; height: calc(var(--lt-player-h, 64px) + 24px); }
@media (max-width: 1024px){
  body.lt-player-open .beats-fab-bar{ bottom: calc(max(14px, env(safe-area-inset-bottom, 14px)) + var(--lt-player-h, 64px) + 10px); }
  body.lt-player-open .beats-col--main{ padding-bottom: calc(60px + var(--lt-player-h, 64px) + 10px); }
}

@media (prefers-reduced-motion: reduce){
  .lt-eq i{ animation: none; transform: scaleY(.7); }
  .lt-player.is-open, .lt-player.is-closing{ animation: none; }
  .lt-play.is-loading::after, .lt-player.is-loading .lt-player-main::after{ animation-duration: 2s; }
}
