.player-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bg-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: grayscale(1) blur(30px);
  opacity: 0.35;
  transition: background-image 0.6s ease;
  pointer-events: none;
}

.player-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(-45deg, #5ba0b4, #54923b, #0b718c, #5ba0b4);
  background-size: 400% 400%;
  animation: bgShift 12s ease infinite;
}

@keyframes bgShift {
  0% { background-position: 0% 50%; }
  25% { background-position: 50% 0%; }
  50% { background-position: 100% 50%; }
  75% { background-position: 50% 100%; }
  100% { background-position: 0% 50%; }
}

.glass {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(48px) saturate(1.3);
  -webkit-backdrop-filter: blur(48px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  box-shadow:
    0 12px 48px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.player-header {
  position: relative;
  z-index: 2;
}

.station-call {
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.04em;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.header-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  font-size: 1.5rem;
  color: #a78bfa;
  font-weight: 300;
}

.brand-text {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
}

.mode-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 100px;
  padding: 3px;
  gap: 2px;
}

.mode-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 5px 14px;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
  text-decoration: none;
  display: inline-block;
}

.mode-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.mode-btn:hover:not(.active) {
  color: rgba(255, 255, 255, 0.7);
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 100px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  animation: pulseDot 1.4s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.7); }
}

.live-text {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #ef4444;
}

.main-content {
  position: relative;
  z-index: 2;
  flex: 1;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

/* ===== Hero Card (horizontal, image + text) ===== */
.hero-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 1.75rem 2rem;
  transition: transform 0.3s ease, flex-direction 0.3s ease;
  margin-bottom: 1.5rem;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  box-shadow: none;
}

.hero-card--vertical {
  flex-direction: column;
  text-align: center;
}

.hero-art-wrapper {
  position: relative;
  width: 220px;
  height: 220px;
  flex-shrink: 0;
}

.hero-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
  position: relative;
  z-index: 1;
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.5),
    0 2px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.hero-art-ring {
  position: absolute;
  inset: -8px;
  border-radius: 28px;
  background: conic-gradient(from 0deg, #a78bfa, #6366f1, #ec4899, #a78bfa);
  opacity: 0.3;
  z-index: 0;
  animation: spinRing 10s linear infinite;
}

.hero-label {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #fff;
  padding: 5px 14px;
  border-radius: 100px;
  background: rgba(167, 139, 250, 0.1);
  margin-bottom: 0.6rem;
  border: 1px solid #FFC;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 0.3rem;
  color: #fff;
  letter-spacing: -0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.hero-artist {
  font-size: 1.1rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0;
}

.track-airtime {
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 0.4rem;
  margin-bottom: 0;
  display: none;
}

.hero-card--vertical .hero-info {
  text-align: center;
}

.hero-card--vertical .track-airtime {
  display: block;
}

.show-btn {
  display: none;
  margin-top: 0.8rem;
  padding: 6px 18px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ddd;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.show-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* ===== Skeleton Loading ===== */
.skel-img {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
}

.skel-text {
  margin-top: 0.6rem;
  text-align: center;
}

.skel-text .placeholder {
  border-radius: 8px;
  width: 85% !important;
  max-width: 300px;
  margin-left: auto !important;
  margin-right: auto !important;
}

.skel-title {
  height: 2.875rem;
  border-radius: 100px;
  margin: 0 auto 0.3rem;
  width: 100%;
  max-width: 350px;
}

.skel-recent-img {
  width: 72px !important;
  height: 72px !important;
  border-radius: 12px !important;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
}

#skelRecent .placeholder {
  border-radius: 8px;
}

.skel-img.hide,
.skel-text.hide,
.skel-title.hide,
#skelRecent.hide {
  display: none;
}

#albumArt, #trackTitle, #trackArtist {
  transition: opacity 0.3s ease;
}

/* ===== Sidebar (Recently Played) ===== */
.sidebar-card {
  padding: 1.5rem;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  box-shadow: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 1rem;
}

.sidebar-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  margin: 0;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-title::before,
.sidebar-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  min-width: 80px;
}

.sidebar-count {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 10px;
  border-radius: 100px;
}

.sidebar-list {
  margin: 0;
}

.recent-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.recent-item:hover {
  transform: scale(1.05);
}

.recent-art {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.recent-info {
  flex: 1;
  min-width: 0;
}

.recent-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.recent-artist {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  margin-top: 2px;
}

/* ===== Ad Popup ===== */
.ad-popup {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  max-width: 420px;
  width: calc(100% - 2rem);
  padding: 0;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(32px) saturate(1.3);
  -webkit-backdrop-filter: blur(32px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  min-height: 70px;
  bottom: 0;
  opacity: 0;
  pointer-events: none;
  transition: bottom 0.6s ease, opacity 0.6s ease;
}

.ad-popup.visible {
  bottom: calc(100% + 12px);
  opacity: 1;
  pointer-events: auto;
  z-index: 900;
}

.ad-popup-link {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 36px 10px 10px;
  text-decoration: none;
  cursor: pointer;
  border-radius: inherit;
  transition: background 0.2s ease;
}

.ad-popup-link:hover {
  background: rgba(255, 255, 255, 0.75);
}

.ad-popup-img {
  width: 76.8px;
  height: 48px;
  border-radius: .3rem;
  object-fit: cover;
  flex-shrink: 0;
}

.ad-popup-info {
  flex: 1;
  min-width: 0;
}

.ad-popup-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ad-popup-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #0f766e;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.ad-popup-arrow {
  color: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.ad-popup-link:hover .ad-popup-arrow {
  transform: translateX(3px);
}

.ad-popup-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.15);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  z-index: 3;
  padding: 0;
}

.ad-popup-close:hover {
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
}

.ad-popup.hidden {
  display: none;
}

/* ===== Player Controls ===== */
.player-controls {
  margin-top: 1.5rem;
  padding: 0.75rem 1.5rem;
}

@media (min-width: 768px) {
  .player-controls {
    position: relative;
    width: fit-content;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(48px) saturate(1.3);
    -webkit-backdrop-filter: blur(48px) saturate(1.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3);
    border-radius: 100px;
  }
}

.controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.station-call {
  display: none;
}

.header-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.cast-btn.casting {
  color: #a78bfa;
}

.control-btn {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.05);
}

.control-btn:active {
  transform: scale(0.95);
}

#playBtn {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #a78bfa, #6366f1);
  transition: box-shadow 0.3s ease;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#playBtn:hover {
  background: linear-gradient(135deg, #b99cfb, #7c7af2);
}

#playBtn.playing {
  box-shadow: 0 0 30px rgba(167, 139, 250, 0.7), 0 0 80px rgba(99, 102, 241, 0.4);
  animation: pulseGlow 1.8s ease-in-out infinite;
}

#playBtn.playing::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.25) 45%, transparent 60%);
  background-size: 200% 100%;
  background-position: 200% 0;
  animation: sheen 5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 30px rgba(167, 139, 250, 0.7), 0 0 80px rgba(99, 102, 241, 0.4); transform: scale(1); }
  50% { box-shadow: 0 0 50px rgba(52, 211, 153, 0.8), 0 0 120px rgba(16, 185, 129, 0.5); transform: scale(1.08); }
}

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

.mute-btn {
  width: 40px;
  height: 40px;
}

.volume-wrap {
  display: flex;
  align-items: center;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 90px;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  transition: transform 0.15s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
}

#audioPlayer {
  display: none;
}

/* ===== Download Section ===== */
.download-section {
  text-align: center;
  padding: 2rem 1rem 3rem;
  position: relative;
  z-index: 2;
  background-color: transparent!important;
}

.download-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 1rem;
}

.download-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.download-links a {
  display: block;
  transition: transform 0.2s ease, opacity 0.2s ease;
  opacity: 0.8;
}

.download-links a:hover {
  transform: translateY(-2px);
  opacity: 1;
}

.download-links img {
  height: 36px;
  width: auto;
  display: block;
  border-radius: 6px;
}

/* ===== Responsive ===== */
@media (max-width: 767.98px) {
  .hero-card {
    position: relative;
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
  }

  .hero-label {
    position: absolute;
    top: calc(10px + 220px - 12px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    font-size: 0.55rem;
    padding: 4px 10px;
    background: rgba(167, 139, 250, 0.6);
  }

  .hero-art-wrapper {
    width: 220px;
    height: 220px;
  }

  .hero-title {
    font-size: 1.6rem;
  }

  .hero-card {
    padding: 10px;
    margin-bottom: 0;
  }

  .sidebar-title::before,
  .sidebar-title::after {
    min-width: 30px;
  }

  .sidebar-card {
    min-height: auto;
    padding-top: 10px;
  }

  .main-content {
    padding-bottom: 6rem;
  }

  .player-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 100;
    margin-top: 0;
    border-radius: 20px 20px 0 0;
    padding: 0.75rem 1rem;
    width: 100%;
    border-radius: 0rem!important;
  }

  .controls-row {
    flex-wrap: nowrap;
    gap: 0.75rem;
    justify-content: center;
  }

  #playBtn {
    order: 1;
  }

  .station-call {
    display: none;
  }

  #muteBtn {
    order: 3;
  }

  #castBtn {
    order: 4;
  }

  .share-wrap {
    order: 5;
  }

  #donateBtn {
    order: 6;
  }

  .volume-wrap {
    display: none;
  }
}

@media (max-width: 575.98px) {
  .mode-btn {
    font-size: 0.65rem;
    padding: 4px 10px;
  }

  .hero-art-wrapper {
    width: 200px;
    height: 200px;
  }

  .hero-title {
    font-size: 1.4rem;
  }

  .hero-card--vertical .hero-title {
    font-size: 1.4rem;
  }

  .hero-artist {
    font-size: 1rem;
  }

  .hero-label {
    top: calc(10px + 200px - 12px);
  }

  .hero-card {
    padding: 10px;
  }

  .main-content {
    padding-bottom: 5.5rem;
  }

  .player-controls {
    padding: 0.5rem 1rem;
  }

  .controls-row {
    gap: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-art-ring,
  .live-dot,
  .hero-card,
  .recent-item {
    animation: none !important;
    transition: none !important;
  }
}

.section-divider {
  width: 60%;
  margin: 0 auto;
  border: 0;
  border-top: 1px solid rgba(255,255,255,0.15);
  opacity: 1;
}

.hero-card,
.sidebar-card {
  animation: fadeUp 0.5s ease both;
}

.sidebar-card {
  animation-delay: 0.1s;
}

.player-controls {
  animation: fadeUp 0.5s ease both;
  animation-delay: 0.2s;
  margin-left: auto;
  margin-right: auto;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.flex-center-x{
    display: flex; flex-direction: column; justify-content: center;
}

.share-wrap {
  position: relative;
}

.share-popup {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  transform-origin: bottom center;
  background: rgba(30, 30, 50, 0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 4px 6px;
  display: flex;
  gap: 2px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.share-popup.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) scale(1);
}

.share-option {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.share-option:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.share-option svg {
  width: 16px;
  height: 16px;
}