/* TechnoRevival Radio Player · Final Luxury API Edition · Fixed Bottom Bar
   Ablage-Empfehlung: /assets/css/tr-radio-player.css
   Wichtig: Der Player bleibt unten im Browser sichtbar und scrollt nicht aus dem Viewport. */

.tr-radio-player[data-tr-radio-player] {
  --tr-cyan: #7df9ff;
  --tr-pink: #ff4d73;
  --tr-violet: #8c6bff;
  --tr-gold: #ffd166;
  --tr-bg-1: rgba(9, 12, 24, 0.96);
  --tr-bg-2: rgba(15, 19, 34, 0.9);
  --tr-text: rgba(255, 255, 255, 0.96);
  --tr-muted: rgba(255, 255, 255, 0.68);
  --tr-soft: rgba(255, 255, 255, 0.075);
  --tr-border: rgba(125, 249, 255, 0.18);
  --tr-shadow: rgba(0, 0, 0, 0.3);

  --tr-player-side-gap: clamp(0.5rem, 1.5vw, 1rem);
  --tr-player-bottom-gap: calc(clamp(0.5rem, 1.2vw, 0.9rem) + env(safe-area-inset-bottom, 0px));

  position: fixed !important;
  left: var(--tr-player-side-gap) !important;
  right: var(--tr-player-side-gap) !important;
  bottom: var(--tr-player-bottom-gap) !important;
  top: auto !important;
  z-index: 9999;
  width: auto;
  max-width: calc(100vw - (var(--tr-player-side-gap) * 2));
  margin: 0 auto;
  transform: translateZ(0);

  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(250px, 1.2fr) minmax(300px, 1.55fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-radius: 1.35rem;
  border: 1px solid var(--tr-border);
  color: var(--tr-text);
  background:
    radial-gradient(circle at 8% 50%, rgba(125, 249, 255, 0.16), transparent 34%),
    radial-gradient(circle at 92% 50%, rgba(255, 77, 115, 0.2), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    linear-gradient(135deg, var(--tr-bg-1), var(--tr-bg-2));
  box-shadow:
    0 18px 40px var(--tr-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  isolation: isolate;
}

body.has-tr-radio-player-fixed {
  padding-bottom: calc(var(--tr-radio-player-height, 118px) + 2.2rem + env(safe-area-inset-bottom, 0px)) !important;
}

.tr-radio-player[data-tr-radio-player]::before,
.tr-radio-player[data-tr-radio-player]::after {
  content: '';
  position: absolute;
  pointer-events: none;
  z-index: -1;
}

.tr-radio-player[data-tr-radio-player]::before {
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.06) 50%, transparent 100%);
  transform: translateX(-100%);
  opacity: 0.75;
}

.tr-radio-player[data-tr-radio-player]::after {
  inset: -40% 10%;
  background: conic-gradient(from 180deg, rgba(125, 249, 255, 0.08), rgba(255, 77, 115, 0.08), rgba(140, 107, 255, 0.08), rgba(125, 249, 255, 0.08));
  filter: blur(42px);
  opacity: 0.55;
}

.tr-radio-player.is-playing::before {
  animation: tr-luxury-scan 5s linear infinite;
}

.tr-radio-track {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.tr-radio-cover {
  position: relative;
  width: 72px;
  height: 72px;
  min-width: 72px;
  border-radius: 1.1rem;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background:
    radial-gradient(circle at 30% 30%, rgba(125, 249, 255, 0.36), transparent 30%),
    radial-gradient(circle at 70% 75%, rgba(255, 77, 115, 0.32), transparent 35%),
    linear-gradient(160deg, rgba(19, 27, 49, 0.95), rgba(12, 17, 30, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 30px rgba(0, 0, 0, 0.32),
    0 0 24px rgba(125, 249, 255, 0.16);
  overflow: hidden;
}

.tr-radio-cover::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: conic-gradient(from 0deg, rgba(125, 249, 255, 0.68), rgba(140, 107, 255, 0.56), rgba(255, 77, 115, 0.7), rgba(125, 249, 255, 0.68));
  opacity: 0;
  filter: blur(10px);
  z-index: -1;
  transition: opacity 0.25s ease;
}

.tr-radio-cover::after {
  content: '';
  position: absolute;
  inset: 16%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 18px rgba(125, 249, 255, 0.08);
}

.tr-radio-player.is-playing .tr-radio-cover::before {
  opacity: 1;
  animation: tr-cover-spin 4s linear infinite;
}

.tr-radio-cover span {
  position: relative;
  z-index: 2;
}

.tr-radio-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tr-radio-kicker {
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tr-cyan);
  opacity: 0.92;
}

.tr-radio-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.tr-radio-heading strong {
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.tr-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.26rem 0.58rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.tr-live-dot {
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 999px;
  background: var(--tr-pink);
  box-shadow: 0 0 14px rgba(255, 77, 115, 0.72);
  animation: tr-live-pulse 1.6s ease-in-out infinite;
}

.tr-radio-status-line {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.tr-radio-status {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.9rem;
  color: var(--tr-muted);
}

.tr-radio-eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
  padding: 0.1rem 0;
  flex: 0 0 auto;
}

.tr-radio-eq span,
.tr-signal-bars span {
  display: block;
  border-radius: 999px;
  transform-origin: bottom center;
}

.tr-radio-eq span {
  width: 4px;
  height: 6px;
  background: linear-gradient(180deg, rgba(125, 249, 255, 0.98), rgba(255, 77, 115, 0.9));
  box-shadow: 0 0 10px rgba(125, 249, 255, 0.18);
  opacity: 0.34;
  animation-name: tr-eq-bounce;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-play-state: paused;
}

.tr-radio-player.is-playing .tr-radio-eq span {
  animation-play-state: running;
  opacity: 1;
}

.tr-radio-eq span:nth-child(1) { animation-duration: 0.92s; animation-delay: -0.18s; }
.tr-radio-eq span:nth-child(2) { animation-duration: 1.10s; animation-delay: -0.42s; }
.tr-radio-eq span:nth-child(3) { animation-duration: 0.86s; animation-delay: -0.55s; }
.tr-radio-eq span:nth-child(4) { animation-duration: 1.24s; animation-delay: -0.28s; }
.tr-radio-eq span:nth-child(5) { animation-duration: 0.96s; animation-delay: -0.48s; }
.tr-radio-eq span:nth-child(6) { animation-duration: 1.18s; animation-delay: -0.2s; }
.tr-radio-eq span:nth-child(7) { animation-duration: 0.82s; animation-delay: -0.62s; }
.tr-radio-eq span:nth-child(8) { animation-duration: 1.03s; animation-delay: -0.37s; }
.tr-radio-eq span:nth-child(9) { animation-duration: 0.88s; animation-delay: -0.14s; }
.tr-radio-eq span:nth-child(10) { animation-duration: 1.20s; animation-delay: -0.51s; }

.tr-radio-center {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.tr-radio-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.62rem;
}

.tr-radio-btn {
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.055);
  color: #fff;
  border-radius: 999px;
  min-height: 40px;
  padding: 0.62rem 0.9rem;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    opacity 0.18s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.tr-radio-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 249, 255, 0.36);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18), 0 0 18px rgba(125, 249, 255, 0.09);
}

.tr-radio-btn:focus-visible {
  outline: 2px solid rgba(125, 249, 255, 0.72);
  outline-offset: 3px;
}

.tr-radio-btn:active {
  transform: translateY(0);
}

.tr-button-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
}

.tr-play-btn {
  min-width: 58px;
  min-height: 58px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  background: linear-gradient(135deg, rgba(125, 249, 255, 0.2), rgba(255, 77, 115, 0.22));
  border-color: rgba(125, 249, 255, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 12px 20px rgba(0, 0, 0, 0.22),
    0 0 22px rgba(125, 249, 255, 0.16);
}

.tr-radio-player.is-playing .tr-play-btn {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 14px 24px rgba(0, 0, 0, 0.24),
    0 0 28px rgba(255, 77, 115, 0.22);
}

.tr-radio-progress {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.78);
}

.tr-progress-line {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}

.tr-progress-fill {
  position: absolute;
  inset: 0 auto 0 -35%;
  width: 35%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(125, 249, 255, 0), rgba(125, 249, 255, 0.95), rgba(255, 77, 115, 0.9), rgba(255, 77, 115, 0));
  filter: saturate(120%);
  opacity: 0.95;
}

.tr-radio-player.is-playing .tr-progress-fill {
  animation: tr-live-progress 2.2s linear infinite;
}

.tr-radio-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.tr-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.72rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.tr-pill strong {
  color: #fff;
}

.tr-pill-cyan {
  border-color: rgba(125, 249, 255, 0.24);
  color: var(--tr-cyan);
}

.tr-pill-pink {
  border-color: rgba(255, 77, 115, 0.24);
  color: #ffb0c0;
}

.tr-signal-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 13px;
}

.tr-signal-bars span {
  width: 3px;
  background: linear-gradient(180deg, rgba(125, 249, 255, 0.95), rgba(125, 249, 255, 0.48));
  opacity: 0.45;
  height: 4px;
}

.tr-signal-bars span:nth-child(2) { height: 7px; }
.tr-signal-bars span:nth-child(3) { height: 10px; }
.tr-signal-bars span:nth-child(4) { height: 13px; }

.tr-radio-player.is-playing .tr-signal-bars span {
  animation: tr-signal-flicker 1.2s ease-in-out infinite;
  opacity: 1;
}

.tr-radio-player.is-playing .tr-signal-bars span:nth-child(1) { animation-delay: -0.3s; }
.tr-radio-player.is-playing .tr-signal-bars span:nth-child(2) { animation-delay: -0.15s; }
.tr-radio-player.is-playing .tr-signal-bars span:nth-child(3) { animation-delay: -0.45s; }
.tr-radio-player.is-playing .tr-signal-bars span:nth-child(4) { animation-delay: -0.22s; }

.tr-small-btn {
  min-height: 38px;
  padding: 0.55rem 0.72rem;
}

[data-radio-volume-readout],
[data-radio-time],
[data-radio-status],
[data-radio-listeners] {
  font-variant-numeric: tabular-nums;
}

@keyframes tr-eq-bounce {
  0%, 100% { height: 5px; }
  18% { height: 18px; }
  38% { height: 9px; }
  56% { height: 22px; }
  74% { height: 12px; }
  90% { height: 16px; }
}

@keyframes tr-live-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.22); opacity: 0.72; }
}

@keyframes tr-live-progress {
  0% { transform: translateX(0); }
  100% { transform: translateX(380%); }
}

@keyframes tr-cover-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes tr-luxury-scan {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

@keyframes tr-signal-flicker {
  0%, 100% { opacity: 0.55; transform: scaleY(0.78); }
  50% { opacity: 1; transform: scaleY(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  .tr-radio-player *,
  .tr-radio-player::before,
  .tr-radio-player::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 1080px) {
  .tr-radio-player[data-tr-radio-player] {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .tr-radio-meta {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .tr-radio-player[data-tr-radio-player] {
    --tr-player-side-gap: 0.5rem;
    --tr-player-bottom-gap: calc(0.5rem + env(safe-area-inset-bottom, 0px));
    padding: 0.95rem;
    gap: 0.95rem;
    border-radius: 1.15rem;
  }

  .tr-radio-track {
    align-items: flex-start;
  }

  .tr-radio-cover {
    width: 62px;
    height: 62px;
    min-width: 62px;
    border-radius: 1rem;
  }

  .tr-radio-controls {
    gap: 0.5rem;
  }

  .tr-radio-btn {
    min-height: 38px;
    padding: 0.58rem 0.75rem;
  }

  .tr-play-btn {
    min-width: 54px;
    min-height: 54px;
  }

  .tr-radio-progress {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .tr-radio-meta {
    gap: 0.45rem;
  }
}


/* Laut.fm API Live-Veredelung */
.tr-radio-player.has-api-song .tr-live-badge {
  border-color: rgba(125, 249, 255, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 16px rgba(125, 249, 255, 0.08);
}

.tr-pill-gold {
  border-color: rgba(255, 209, 102, 0.25);
  color: rgba(255, 224, 155, 0.96);
}

.tr-radio-player.has-track-progress .tr-progress-fill {
  inset: 0 auto 0 0;
  width: var(--tr-track-progress, 0%);
  min-width: 10px;
  animation: none !important;
  background: linear-gradient(90deg, rgba(125, 249, 255, 0.92), rgba(140, 107, 255, 0.92), rgba(255, 77, 115, 0.92));
  box-shadow: 0 0 18px rgba(125, 249, 255, 0.18);
  transition: width 0.6s ease;
}

.tr-radio-player.has-track-progress .tr-progress-line::after {
  content: '';
  position: absolute;
  top: 50%;
  left: var(--tr-track-progress, 0%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 0 10px rgba(125, 249, 255, 0.45),
    0 0 18px rgba(255, 77, 115, 0.3);
  opacity: 0.9;
  transition: left 0.6s ease;
}

.tr-radio-cover.has-artwork {
  background:
    linear-gradient(160deg, rgba(9, 12, 24, 0.36), rgba(9, 12, 24, 0.12)),
    var(--tr-cover-art) center / cover no-repeat;
}

.tr-radio-cover.has-artwork::after {
  inset: 0;
  border-radius: inherit;
  border-color: rgba(255, 255, 255, 0.09);
  background: linear-gradient(180deg, rgba(255,255,255,0.08), transparent 55%, rgba(0,0,0,0.2));
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.2);
}

.tr-radio-cover.has-artwork span {
  opacity: 0;
}

.tr-radio-player.is-metadata-loading [data-radio-status] {
  opacity: 0.78;
}

.tr-radio-player.has-api-song [data-radio-status] {
  color: rgba(255, 255, 255, 0.86);
}

@media (max-width: 720px) {
  .tr-pill-gold {
    display: none;
  }
}

/* Smooth/Stabilitäts-Patch: weniger Repaints, weniger GPU-/CPU-Last, Audio zuerst. */
.tr-radio-player[data-tr-radio-player] {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transform: none;
  will-change: auto;
}

.tr-radio-player[data-tr-radio-player]::after {
  filter: blur(28px);
  opacity: 0.34;
}

.tr-radio-player.is-playing::before {
  animation: tr-luxury-scan 9s linear infinite;
  opacity: 0.42;
}

.tr-radio-player.is-playing .tr-radio-cover::before {
  animation: none !important;
  opacity: 0.72;
}

.tr-radio-eq span {
  height: 18px !important;
  transform: scaleY(0.32);
  will-change: transform;
}

.tr-radio-player.is-playing .tr-radio-eq span {
  animation-duration: 1.75s !important;
}

.tr-radio-player.is-playing .tr-progress-fill {
  animation-duration: 6s;
}

.tr-radio-player.is-playing .tr-signal-bars span {
  animation-duration: 2.4s;
}

.tr-radio-player.has-track-progress .tr-progress-fill {
  transition: width 0.28s linear;
}

.tr-radio-player.has-track-progress .tr-progress-line::after {
  transition: left 0.28s linear;
}

.tr-radio-player.is-metadata-loading [data-radio-status] {
  opacity: 1;
}

@keyframes tr-eq-bounce {
  0%, 100% { transform: scaleY(0.32); }
  20% { transform: scaleY(0.82); }
  40% { transform: scaleY(0.45); }
  60% { transform: scaleY(1); }
  80% { transform: scaleY(0.56); }
}

@media (max-width: 720px) {
  .tr-radio-player[data-tr-radio-player] {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .tr-radio-player[data-tr-radio-player]::before,
  .tr-radio-player[data-tr-radio-player]::after,
  .tr-radio-player.is-playing .tr-radio-cover::before,
  .tr-radio-player.is-playing .tr-signal-bars span {
    animation: none !important;
  }

  .tr-radio-player.is-playing .tr-progress-fill {
    animation-duration: 8s;
  }
}
