/* TXSS v39 Scroll + Player Stability Fix
   Prevents cover disappearance / player visual collapse after fast bottom->top scrolling. */
.song-card,
.discover-card,
.discover-card-legacy{
  background:linear-gradient(145deg,rgba(255,45,170,.18),rgba(0,229,255,.10)),#13081f!important;
  transform:translateZ(0);
  backface-visibility:hidden;
  contain:layout paint style;
}
.song-card img,
.discover-card img,
.discover-card-legacy img{
  opacity:1!important;
  visibility:visible!important;
  display:block!important;
  min-width:100%;
  min-height:100%;
  background:#14091f;
  transform:translateZ(0);
  backface-visibility:hidden;
}
#home .song-card,
#home .discover-card,
#home .discover-card-legacy,
#home .song-card img,
#home .discover-card img,
#home .discover-card-legacy img{
  content-visibility:visible!important;
}
#heroCover,
#bottomCover,
#seoPlayerCover{
  opacity:1!important;
  visibility:visible!important;
  transform:translateZ(0);
  backface-visibility:hidden;
}
#heroCover{
  background-color:#12071d!important;
  background-size:cover!important;
  background-position:center!important;
  background-repeat:no-repeat!important;
}
#bottomCover{
  background:#12071d url('assets/default-cover.svg') center/cover no-repeat;
}
.player-card,
.bottom-player{
  transform:translateZ(0);
  backface-visibility:hidden;
  will-change:auto!important;
}
body.txss-fast-scroll-recover .player-card,
body.txss-fast-scroll-recover .bottom-player,
body.txss-fast-scroll-recover .song-card img,
body.txss-fast-scroll-recover .discover-card img,
body.txss-fast-scroll-recover .discover-card-legacy img{
  transition:none!important;
  animation-duration:.001s!important;
}

/* =========================================================
   TXSS v40 Mini Player Alignment Fix
   Reason: v39 used transform:translateZ(0) on .bottom-player.
   Since the real player is left:50%, removing translateX(-50%)
   makes it start from the screen center and overflow to the right.
========================================================= */
.bottom-player{
  position:fixed!important;
  left:50%!important;
  right:auto!important;
  transform:translate3d(-50%,0,0)!important;
  margin-left:0!important;
  margin-right:0!important;
  max-width:calc(100vw - 24px)!important;
  box-sizing:border-box!important;
}

@media(max-width:900px){
  .bottom-player{
    left:50%!important;
    right:auto!important;
    bottom:calc(12px + env(safe-area-inset-bottom,0px))!important;
    transform:translate3d(-50%,0,0)!important;
    width:calc(100vw - 24px)!important;
    max-width:520px!important;
    min-width:0!important;
    margin:0!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
  }
  .bottom-player .now{
    min-width:0!important;
    overflow:hidden!important;
  }
  .bottom-player .now strong,
  .bottom-player .now p{
    max-width:100%!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  .bottom-player .bottom-icons{
    flex-shrink:0!important;
    min-width:max-content!important;
  }
}

@media(max-width:420px){
  .bottom-player{
    width:calc(100vw - 18px)!important;
    max-width:calc(100vw - 18px)!important;
  }
}


/* =========================================================
   TXSS Android WebView mini player position fix v3
   Safe version: does NOT change display/visibility/height or smart-hidden logic.
   Only moves the visible mini player closer to the bottom inside Android WebView.
========================================================= */
@media(max-width:900px){
  html.txss-android-webview .bottom-player:not(.smart-hidden),
  body.txss-android-webview .bottom-player:not(.smart-hidden){
    top:auto !important;
    bottom:0px !important;
    left:50% !important;
    right:auto !important;
    transform:translate3d(-50%,0,0) !important;
  }
}

@media(max-width:420px){
  html.txss-android-webview .bottom-player:not(.smart-hidden),
  body.txss-android-webview .bottom-player:not(.smart-hidden){
    bottom:0px !important;
  }
}
