:root {
  --app-accent: #e8b84b;
  --app-accent-dark: #caa038;
  --app-accent-glow: rgba(232, 184, 75, 0.40);
  --cover-glow: rgba(232, 184, 75, 0.38);
  --cover-tint: rgba(232, 184, 75, 0.18);
  --bg-color: #0e0e11;
  --surface-color: #151518;
  --text-high: #ffffff;
  --text-medium: rgba(255, 255, 255, 0.72);
  --text-dim: rgba(255, 255, 255, 0.50);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-color);
  color: var(--text-high);
  font-family: "Roboto Condensed", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-spatial-navigation: none;
  user-select: none;
}

.backdrop-container {
  position: fixed;
  inset: -60px;
  overflow: hidden;
  z-index: 0;
}

.backdrop-base {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle 125vmin at var(--art-center-x, 26%) var(--art-center-y, 52%),
      rgba(232, 184, 75, 0.30) 0%,
      rgba(232, 184, 75, 0.16) 36%,
      rgba(232, 184, 75, 0.06) 65%,
      transparent 88%
    ),
    radial-gradient(
      circle 95vmin at 72% 58%,
      rgba(184, 141, 42, 0.12) 0%,
      transparent 72%
    );
  background-color: var(--bg-color);
}

.backdrop-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 45% 45%, transparent 35%, rgba(10, 10, 14, 0.65) 100%);
  z-index: 2;
  pointer-events: none;
}

.backdrop-cover-layer {
  position: absolute;
  inset: -30px;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
  opacity: 0;
  transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.backdrop-cover-layer.visible {
  opacity: 0.85;
}

.backdrop-cover-layer.raw-fallback {
  filter: blur(12px);
}

.scrim-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 18%;
  background: linear-gradient(to bottom, rgba(10, 10, 14, 0.75) 0%, transparent 100%);
  z-index: 3;
}

.scrim-right {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 52%;
  background: linear-gradient(to right, transparent 0%, rgba(10, 10, 14, 0.35) 45%, rgba(10, 10, 14, 0.70) 100%);
  z-index: 3;
}
.scrim-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22%;
  background: linear-gradient(to top, rgba(10, 10, 14, 0.65) 0%, transparent 100%);
  z-index: 3;
}

.tv-stage {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  width: 100%;
  height: 100%;
  padding: 56px 88px;
  animation: oledDrift 300s steps(1, end) infinite alternate;
}

@keyframes oledDrift {
  0% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(3px, 2px, 0); }
  50% { transform: translate3d(-2px, 3px, 0); }
  75% { transform: translate3d(2px, -2px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

.tv-track-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding-bottom: 18px;
  margin-bottom: 22px;
  position: relative;
  flex-shrink: 0;
}

.tv-track-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.5px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 12%,
    rgba(255, 255, 255, 0.18) 28%,
    var(--app-accent) 50%,
    rgba(255, 255, 255, 0.18) 72%,
    rgba(255, 255, 255, 0.08) 88%,
    transparent 100%
  );
  box-shadow: 0 0 16px var(--app-accent-glow);
  transition: box-shadow 0.8s ease;
}
.status-banner {
  position: absolute;
  top: 96px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(26, 26, 32, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-high, #f0f0f0);
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease-in-out;
  z-index: 100;
}

.status-banner.visible {
  opacity: 1;
}

.header-track-info {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.header-track-quality {
  align-self: center;
  flex-shrink: 0;
}

.header-row-primary {
  width: 100%;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.track-number-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: monospace;
  font-size: clamp(14px, 1.3vw, 18px);
  font-weight: 400;
  margin-right: 12px;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.track-number-badge::after {
    content: '.';
}

.track-title-wrapper {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
  position: relative;
  padding-bottom: 10px;
}

.track-title-wrapper.has-marquee {
  mask-image: linear-gradient(to right, black calc(100% - 32px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black calc(100% - 32px), transparent 100%);
}

.track-title-ticker {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  will-change: transform;
}

.track-title-ticker.marquee {
  animation: continuousTicker var(--ticker-duration, 16s) linear infinite;
}

.track-title {
  display: inline-block;
  font-size: clamp(26px, 2.6vw, 36px);
  font-weight: 500;
  color: var(--text-high);
  white-space: nowrap;
  letter-spacing: -0.2px;
}

.track-title-clone {
  display: none;
  padding-left: 36px;
}

.track-title-ticker.marquee .track-title-clone {
  display: inline-block;
}

.header-row-secondary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
}

.header-meta-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
}

.track-artist {
  font-size: clamp(18px, 1.6vw, 22px);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.90);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
}

.track-album {
  font-size: clamp(16px, 1.4vw, 20px);
  font-weight: 400;
  color: var(--text-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 2;
}

.track-divider {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--text-dim);
  flex-shrink: 0;
  margin: 0 4px;
}

.format-chip {
  padding: 4px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@keyframes continuousTicker {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(-1 * var(--ticker-distance, 0px)));
  }
}
.format-text {
  font-size: 13px;
  font-family: monospace;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.92);
}

.tv-main-stage {
  display: flex;
  flex: 1;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: clamp(32px, 4vw, 72px);
  min-height: 0;
  overflow: visible;
  padding: 16px 0 32px 0;
}

.left-hero-section {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.hero-art-container {
  position: relative;
  width: min(46vw, 68vh);
  height: min(46vw, 68vh);
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.75);
  background-color: #1b1b1f;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-album-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.hero-album-art.loaded {
  opacity: 1;
}

.art-placeholder {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #49454f;
}

.right-interactive-section {
  flex: 1;
  min-width: 0;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}

.transport-controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  width: 100%;
  padding: 0;
}

.transport-btn {
  background: transparent;
  border: none;
  position: relative;
  color: var(--text-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.transport-btn-skip {
  width: 46px;
  height: 46px;
}
.transport-btn:disabled,
.transport-btn[aria-disabled="true"],
.transport-btn.disabled {
  opacity: 0.28;
  cursor: not-allowed;
  pointer-events: none;
}

.transport-btn:active {
  transform: scale(0.92);
}

.transport-btn.is-active {
  color: var(--app-accent);
}


.transport-btn:focus-visible,
.transport-btn:focus,
.transport-btn.focused {
  outline: none;
  box-shadow: 0 0 0 3px var(--app-accent), 0 0 20px var(--app-accent-glow);
  transform: scale(1.12);
  color: var(--text-high);
}

.transport-btn.is-active:focus-visible,
.transport-btn.is-active:focus,
.transport-btn.is-active.focused {
  color: var(--app-accent);
}

.play-pause-disc {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: transparent;
  border: none;
  position: relative;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.play-pause-disc::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  padding: 3.5px;
  background: conic-gradient(
    from 140deg at 50% 50%,
    #202126 0deg,
    #cfd4e2 55deg,
    #3f414a 115deg,
    #202126 180deg,
    #cfd4e2 235deg,
    #3f414a 295deg,
    #202126 360deg
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.play-pause-disc svg {
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.90));
}

.play-pause-disc:active {
  transform: scale(0.94);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
}

.play-pause-disc:focus-visible,
.play-pause-disc:focus,
.play-pause-disc.focused {
  outline: none;
  box-shadow:
    0 0 0 2.5px rgba(255, 255, 255, 0.85),
    0 0 32px rgba(255, 255, 255, 0.40),
    0 6px 20px rgba(0, 0, 0, 0.45);
  transform: scale(1.10);
}

.play-pause-disc.buffering {
  animation: pulseBuffering 1.1s ease-in-out infinite;
}

@keyframes pulseBuffering {
  0% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 0.85; }
}

.scrubber-section {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.scrubber-section:focus-visible,
.scrubber-section:focus,
.scrubber-section.focused {
  outline: none;
  background-color: rgba(255, 255, 255, 0.04);
  box-shadow: none;
}

.scrubber-section:focus-visible .scrubber-track,
.scrubber-section:focus .scrubber-track,
.scrubber-section.focused .scrubber-track {
  height: 10px;
  background-color: rgba(255, 255, 255, 0.24);
}

.scrubber-section:focus-visible .scrubber-thumb,
.scrubber-section:focus .scrubber-thumb,
.scrubber-section.focused .scrubber-thumb {
  --thumb-scale: 1.3;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.6), 0 0 16px var(--app-accent-glow);
}

.scrubber-section:focus-visible .scrubber-time,
.scrubber-section:focus .scrubber-time,
.scrubber-section.focused .scrubber-time {
  color: #ffffff;
}

.scrubber-time {
  font-size: 15px;
  font-weight: 600;
  font-family: monospace;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.75);
  min-width: 44px;
}

.scrubber-track {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: visible;
}

.scrubber-fill {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--app-accent), rgba(255, 255, 255, 0.85));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s linear;
}

.scrubber-thumb-track {
  position: absolute;
  inset: 0;
  transform: translateX(var(--thumb-pct, 0%));
  transition: transform 0.25s linear;
}

.scrubber-thumb {
  --thumb-scale: 0;
  position: absolute;
  top: 50%;
  left: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.6), 0 0 14px var(--app-accent-glow);
  transform: translate(-50%, -50%) scale(var(--thumb-scale));
  transition: transform 0.2s ease;
}

.scrubber-section:hover .scrubber-thumb {
  --thumb-scale: 1;
}

.playlist-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
}

.playlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
}

.playlist-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-dim);
}

.playlist-counter {
  font-size: 12px;
  font-family: monospace;
  color: var(--text-dim);
}

.virtual-scroll-container {
  position: relative;
  width: 100%;
  height: clamp(200px, 32vh, 320px);
  overflow: hidden;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  outline: none;
}

.virtual-scroll-container:focus-visible,
.virtual-scroll-container:focus,
.virtual-scroll-container.focused {
  border-color: var(--app-accent, #e8b84b);
  box-shadow: 0 0 16px var(--app-accent-glow);
}

.virtual-scroll-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  will-change: transform;
}

.virtual-track-row {
  position: absolute;
  left: 0;
  right: 0;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
}

.virtual-track-row:hover,
.virtual-track-row.focused {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.20);
}

.virtual-track-row.active {
  background: rgba(232, 184, 75, 0.12);
  border-color: rgba(232, 184, 75, 0.35);
}

.virtual-track-row.pending {
  background: rgba(232, 184, 75, 0.06);
  border-color: rgba(232, 184, 75, 0.28);
}

.virtual-track-row.active .row-track-title {
  color: var(--app-accent, #e8b84b);
  font-weight: 600;
}

.row-index-col {
  width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.row-index-num {
  font-family: monospace;
  font-size: 13px;
  color: var(--text-dim);
}

.playing-equalizer {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 14px;
}

.equalizer-bar {
  width: 3px;
  height: 100%;
  background-color: var(--app-accent, #e8b84b);
  border-radius: 1px;
  transform-origin: bottom;
  animation: eqBounce 0.9s ease-in-out infinite alternate;
}

.equalizer-bar:nth-child(1) { animation-delay: 0.1s; }
.equalizer-bar:nth-child(2) { animation-delay: 0.35s; }
.equalizer-bar:nth-child(3) { animation-delay: 0.2s; }

.virtual-track-row.active .row-index-num { display: none; }
.virtual-track-row:not(.active) .playing-equalizer { display: none; }

@keyframes eqBounce {
  0% { transform: scaleY(0.25); }
  100% { transform: scaleY(1); }
}

.row-info-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.row-track-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-high);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-track-sub {
  font-size: 12px;
  color: var(--text-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-duration-col {
  font-family: monospace;
  font-size: 12px;
  color: var(--text-dim);
  flex-shrink: 0;
}

cast-media-player {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  visibility: hidden;
}

@media (max-height: 720px) {
  .tv-stage {
    padding: 36px 56px;
  }
  .tv-track-header {
    padding-bottom: 20px;
    margin-bottom: 20px;
  }
  .tv-main-stage {
    gap: 36px;
  }
  .right-interactive-section {
    gap: 14px;
  }
  .transport-btn {
    width: 34px;
    height: 34px;
  }
  .transport-btn-skip {
    width: 40px;
    height: 40px;
  }
  .play-pause-disc {
    width: 54px;
    height: 54px;
  }
}
@media (max-width: 860px), (max-aspect-ratio: 1.25/1) {
  .backdrop-base {
    background:
      radial-gradient(
        circle 110vmin at 50% 32%,
        rgba(232, 184, 75, 0.32) 0%,
        rgba(232, 184, 75, 0.16) 38%,
        rgba(232, 184, 75, 0.06) 65%,
        transparent 88%
      ),
      radial-gradient(
        circle 85vmin at 50% 75%,
        rgba(184, 141, 42, 0.12) 0%,
        transparent 70%
      );
  }

  .backdrop-vignette {
    background: radial-gradient(circle at 50% 35%, transparent 35%, rgba(10, 10, 14, 0.65) 100%);
  }

  .tv-stage {
    padding: clamp(16px, 2.5vh, 28px) clamp(20px, 3.5vw, 36px);
  }

  .tv-track-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-bottom: 14px;
    margin-bottom: 16px;
  }

  .header-meta-group {
    justify-content: center;
  }

  .tv-main-stage {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    padding: 0;
  }
  .left-hero-section {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .hero-art-container {
    width: min(52vw, 24vh);
    height: min(52vw, 24vh);
    border-radius: 18px;
    flex-shrink: 0;
  }
  .virtual-scroll-container {
    height: clamp(140px, 26vh, 220px);
  }
  .right-interactive-section {
    width: 100%;
    max-width: 480px;
    gap: 12px;
    align-items: center;
  }
  .transport-controls-row {
    gap: 16px;
  }
  .play-pause-disc {
    width: 52px;
    height: 52px;
  }
  .transport-btn-skip {
    width: 38px;
    height: 38px;
  }
  .transport-btn {
    width: 32px;
    height: 32px;
  }
}

