/* =========================================================
   player.css — premium fake-wave + volume (desktop inline / mobile popover)
========================================================= */

.player-container{
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.player{
  display: flex;
  align-items: center;
  gap: 24px;
  background: transparent;
  padding: 24px 32px;
  border: none;
  box-shadow: none;
}

.player-info{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  background: transparent;
  padding: 20px 40px;
  border: none;
  box-shadow: none;
}

/* =========================================================
   Title + Artists
========================================================= */

.player-title{
  font-size: 22px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.015em;
  text-shadow: 0 1px 3px rgba(0,0,0,.3);

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 64vw;
}

.player-artists{
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  letter-spacing: 0.01em;
  font-weight: 400;
}

.player-artist-link{
  color: rgba(255,255,255,.9);
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,.4);
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color .2s ease, text-decoration-color .2s ease;
  white-space: nowrap;
}
.player-artist-link:hover{
  color: #fff;
  text-decoration-color: rgba(255,255,255,.8);
}

.player-feat{
  color: rgba(255,255,255,.6);
  font-size: 13px;
  font-style: italic;
  margin: 0 4px;
}

.player-separator{
  color: rgba(255,255,255,.4);
  font-size: 13px;
  font-weight: 300;
}

/* =========================================================
   Logo + Play button
========================================================= */

.player-logo-container{
  position: relative;
  width: 140px;
  height: 140px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
}

.player-logo{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.player-logo.playing{ animation: rotateLogo 8s linear infinite; }
.player-logo.paused{ animation: none; }

@keyframes rotateLogo{
  from{ transform: rotate(0deg); }
  to{ transform: rotate(360deg); }
}

.player-logo-play-btn{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 999px;

  border: 2px solid rgba(255,255,255,.9);
  background: rgba(0,0,0,.6);
  color: #fff;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;
  cursor: pointer;
  z-index: 10;
}

.player-logo-play-btn:hover{
  background: rgba(0,0,0,.8);
  border-color: #fff;
  transform: translate(-50%, -50%) scale(1.06);
}

.player-logo-play-btn svg{
  width: 24px;
  height: 24px;
}

/* =========================================================
   Time labels
========================================================= */

.player-time-current,
.player-time-total{
  font-size: 13px;
  color: rgba(255,255,255,.9);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 44px;
}

.player-time-current{ text-align: left; }
.player-time-total{ text-align: right; }

/* =========================================================
   Fake waveform + seek (range invisible)
========================================================= */

.player-waveform{
  flex: 1;
  min-width: 0;
  height: 34px;
  display: flex;
  align-items: center;
  position: relative;
  padding: 6px 0;
}

.wave-visual{
  position: absolute;
  inset: 6px 0;
  min-width: 120px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  z-index: 2;
  --p: 0;
}

.wave-layer{
  position: absolute;
  inset: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 2px;
  column-gap: 2px;
  align-items: end;
  justify-content: space-between;
}

.wave-bar{
  height: calc(var(--h, .5) * 100%);
  border-radius: 999px;
}

.wave-layer.unplayed .wave-bar{
  background: rgba(255,255,255,.12);
}

.wave-layer.played{
  clip-path: inset(0 calc((1 - var(--p)) * 100%) 0 0 round 999px);
}
.wave-layer.played .wave-bar{
  background: rgba(255,255,255,.95);
}

#progressBar{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
  z-index: 3;
}

#progressBar::-webkit-slider-thumb{
  appearance: none;
  width: 0;
  height: 0;
}
#progressBar::-moz-range-thumb{
  width: 0;
  height: 0;
  border: 0;
}

/* =========================================================
   Volume (desktop inline)
========================================================= */

.player-volume{
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.vol-open-btn{
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.35);
  color: rgba(255,255,255,.92);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.vol-open-btn:hover{
  background: rgba(0,0,0,.55);
  border-color: rgba(255,255,255,.28);
  transform: translateY(-0.5px);
}

.vol-ico{ width: 18px; height: 18px; }

.vol-pop{
  position: static;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}

.vol-mute-btn{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.35);
  color: rgba(255,255,255,.92);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#volumeBar{
  width: 170px;
  height: 8px;
  border-radius: 999px;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255,255,255,.12);
  box-shadow: 0 0 0 1px rgba(255,255,255,.10) inset;
  outline: none;
}

#volumeBar::-webkit-slider-runnable-track{
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
}

#volumeBar::-webkit-slider-thumb{
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,1);
  border: 0;
  cursor: pointer;
  margin-top: -2px;
  box-shadow: 0 10px 24px rgba(0,0,0,.45);
}

#volumeBar::-moz-range-track{
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
}

#volumeBar::-moz-range-thumb{
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,1);
  border: 0;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0,0,0,.45);
}

/* =========================================================
   Mobile portrait: volume vira popover
========================================================= */

@media (max-width: 900px) and (orientation: portrait){
  .vol-open-btn{ display: flex; }

  .vol-pop{
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);

    width: 180px;
    padding: 12px;
    border-radius: 12px;

    background: rgba(0,0,0,.55);
    border: 1px solid rgba(255,255,255,.14);
    box-shadow: 0 18px 40px rgba(0,0,0,.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
  }

  .player-volume.open .vol-pop{
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  #volumeBar{ width: 120px; }
}

/* =========================================================
   Mobile portrait: título em até 2 linhas (sem "...")
========================================================= */

@media (max-width: 900px) and (orientation: portrait){
  #playerTitle{
    white-space: normal;
    overflow: hidden;
    text-overflow: clip;

    display: -webkit-box;
    -webkit-box-orient: vertical;

    -webkit-line-clamp: 2;
    line-clamp: 2; /* versão padrão */

    font-size: clamp(14px, 4.2vw, 18px);
    line-height: 1.15;
    max-width: 92vw;
  }
}