/* AhilyanagarDJ's Music — Persistent mobile shell v12.5.1 hotfix */
:root{
  --adc-mobile-nav-height:72px;
  --adc-mobile-mini-height:68px;
  --adc-mobile-edge:10px;
}

.adc-mobile-view-shell{display:none}

@media(max-width:900px){
  /* One fixed navigation bar on every main mobile view. */
  .mobile-bottom-nav,
  .mobile-bottom-nav.adc-shared-bottom-nav,
  .mobile-bottom-nav.adc-persistent-bottom-nav{
    position:fixed!important;
    left:0!important;
    right:0!important;
    bottom:0!important;
    width:100%!important;
    height:calc(var(--adc-mobile-nav-height) + env(safe-area-inset-bottom))!important;
    min-height:calc(var(--adc-mobile-nav-height) + env(safe-area-inset-bottom))!important;
    padding:8px 12px calc(6px + env(safe-area-inset-bottom))!important;
    margin:0!important;
    z-index:9992!important;
    box-sizing:border-box!important;
  }

  /* Home and account-page mini players now share exactly the same geometry. */
  .mobile-mini-player:not(.hidden),
  .adc-global-mini:not(.hidden),
  body.has-mobile-bottom .adc-global-mini:not(.hidden),
  .page-home .mobile-mini-player:not(.hidden),
  .page-search .adc-global-mini:not(.hidden),
  .page-library .adc-global-mini:not(.hidden){
    position:fixed!important;
    left:var(--adc-mobile-edge)!important;
    right:var(--adc-mobile-edge)!important;
    bottom:calc(var(--adc-mobile-nav-height) + env(safe-area-inset-bottom) - 1px)!important;
    width:auto!important;
    height:var(--adc-mobile-mini-height)!important;
    min-height:var(--adc-mobile-mini-height)!important;
    max-height:var(--adc-mobile-mini-height)!important;
    margin:0!important;
    padding:7px 9px!important;
    border-radius:9px!important;
    box-sizing:border-box!important;
    display:grid!important;
    grid-template-columns:32px 52px minmax(0,1fr) 40px 40px!important;
    align-items:center!important;
    gap:8px!important;
    transform:none!important;
    z-index:9993!important;
  }
  .mobile-mini-player.hidden,
  .adc-global-mini.hidden{display:none!important}
  .mobile-mini-player>img,
  .adc-global-mini>img{
    width:52px!important;
    height:52px!important;
    min-width:52px!important;
    border-radius:6px!important;
    object-fit:cover!important;
  }
  .mobile-mini-player .mini-meta,
  .adc-global-mini-meta{
    min-width:0!important;
    overflow:hidden!important;
    display:block!important;
  }
  #mini-title,#mini-artist,#global-mini-title,#global-mini-artist{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    overflow:hidden!important;
    white-space:nowrap!important;
    text-overflow:ellipsis!important;
    transform:none!important;
  }
  #mini-title,#global-mini-title{font-size:13px!important;line-height:1.25!important;font-weight:800!important}
  #mini-artist,#global-mini-artist{font-size:11px!important;line-height:1.25!important;margin-top:3px!important;color:#e0cec4!important;opacity:.86}
  .mobile-mini-player .mini-like,
  .mobile-mini-player .mini-play,
  .adc-global-mini .global-mini-heart,
  .adc-global-mini .global-mini-toggle{
    width:40px!important;
    height:40px!important;
    min-width:40px!important;
    display:grid!important;
    place-items:center!important;
    padding:0!important;
    margin:0!important;
    font-size:22px!important;
    line-height:1!important;
  }
  /* Keep the previous transparent icon style on every page. */
  .mobile-mini-player .mini-like,
  .mobile-mini-player .mini-play,
  .adc-global-mini .global-mini-heart,
  .adc-global-mini .global-mini-toggle{
    border:0!important;
    outline:0!important;
    background:transparent!important;
    color:#fff!important;
    box-shadow:none!important;
    border-radius:50%!important;
    appearance:none!important;
    -webkit-appearance:none!important;
  }

  /* Conditional marquee: only JS-applied when text really overflows. */
  #mini-title.adc-mini-marquee,
  #mini-artist.adc-mini-marquee,
  #global-mini-title.adc-mini-marquee,
  #global-mini-artist.adc-mini-marquee{
    text-overflow:clip!important;
    animation:adcMiniTextMarquee var(--adc-marquee-duration,8s) ease-in-out 1s infinite!important;
    will-change:text-indent;
  }
  @keyframes adcMiniTextMarquee{
    0%,14%{text-indent:0}
    64%,82%{text-indent:calc(var(--adc-marquee-distance,0px) * -1)}
    100%{text-indent:0}
  }

  /* Main content always clears both fixed layers. */
  .page-home .listener-main,
  .account-page.has-mobile-bottom .account-wrap{
    padding-bottom:calc(var(--adc-mobile-nav-height) + var(--adc-mobile-mini-height) + env(safe-area-inset-bottom) + 24px)!important;
  }

  /* Persistent view layer. Home stays alive underneath; Search/Library live in retained frames. */
  .adc-mobile-view-shell{
    position:fixed;
    z-index:9000;
    top:0;
    left:0;
    right:0;
    bottom:calc(var(--adc-mobile-nav-height) + env(safe-area-inset-bottom));
    background:#0a0908;
    overflow:hidden;
  }
  .adc-mobile-view-shell:not(.hidden){display:block!important}
  .adc-shell-frame{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    border:0;
    background:#0a0908;
    display:block;
  }
  .adc-shell-frame.hidden{display:none!important}

  /* Embedded Search/Library pages render only their page content. Parent owns player + nav. */
  body.adc-shell-embedded{
    min-height:100dvh!important;
    padding:0!important;
    background:#0a0908!important;
    overflow-x:hidden!important;
  }
  body.adc-shell-embedded .account-wrap{
    width:100%!important;
    max-width:none!important;
    min-height:100dvh!important;
    padding-bottom:calc(var(--adc-mobile-mini-height) + 28px)!important;
  }
  body.adc-shell-embedded .adc-global-mini,
  body.adc-shell-embedded .mobile-bottom-nav{display:none!important}

  body.player-sheet-open .mobile-mini-player,
  body.player-sheet-open .adc-global-mini{opacity:0!important;pointer-events:none!important}
}

@media(prefers-reduced-motion:reduce){
  #mini-title.adc-mini-marquee,
  #mini-artist.adc-mini-marquee,
  #global-mini-title.adc-mini-marquee,
  #global-mini-artist.adc-mini-marquee{animation:none!important;text-indent:0!important;text-overflow:ellipsis!important}
}


/* v12.5: one shell player, drawer/overlay stacking, close control, retained content pages */
@media(max-width:900px){
  .mobile-mini-player .mini-close,
  .adc-global-mini .global-mini-close{
    width:30px!important;height:30px!important;min-width:30px!important;padding:0!important;margin:0!important;
    border:0!important;border-radius:50%!important;background:transparent!important;color:#fff!important;box-shadow:none!important;
    display:grid!important;place-items:center!important;font-size:22px!important;line-height:1!important;cursor:pointer!important;
  }
  .mobile-mini-player .mini-close:active,.adc-global-mini .global-mini-close:active{transform:scale(.94)}
  .mobile-mini-player,.adc-global-mini{overflow:hidden!important}
  .mobile-mini-player .mini-meta,.adc-global-mini-meta{min-width:0!important}

  /* Drawer intentionally sits above persistent controls while playback continues. */
  .adc-drawer-backdrop{z-index:11010!important}
  .adc-navigation-drawer{z-index:11020!important}

  /* Drawer destination pages cover the shell, not the audio element. */
  .adc-mobile-overlay{
    position:fixed!important;inset:0!important;z-index:11030!important;background:#0a0908!important;
    display:block!important;overflow:hidden!important;
  }
  .adc-mobile-overlay.hidden{display:none!important}
  .adc-shell-overlay-frame{width:100%!important;height:100%!important;border:0!important;background:#0a0908!important;display:block!important}

  /* Generic retained content stays behind the one mini-player + bottom nav. */
  .adc-shell-frame[data-shell-tab="content"]{background:#0a0908!important}
  body.adc-shell-content-open .listener-main{visibility:hidden!important;pointer-events:none!important}

  /* Embedded drawer/account pages do not create their own fixed controls. */
  body.adc-shell-embedded .adc-global-mini,
  body.adc-shell-embedded .mobile-mini-player,
  body.adc-shell-embedded .mobile-bottom-nav,
  body.adc-shell-embedded .desktop-player{display:none!important}
  body.adc-shell-embedded .adc-overlay-account-back{display:flex!important;margin:0 0 8px!important}

  /* Release artwork can be any source ratio; display remains a clean square crop. */
  .music-card img,.quick-card img,.track-main img,.library-item img,.now-panel-cover-wrap img,
  .mobile-mini-player>img,.adc-global-mini>img,.full-cover-wrap img,.artist-album-card img,
  .entity-image img,.adc-discovery-card img{object-fit:cover!important;object-position:center center!important}
}

/* v12.5.1: hard normalization — one geometry regardless of page-specific CSS. */
@media(max-width:900px){
  body.page-home .mobile-mini-player:not(.hidden),
  body.page-search .adc-global-mini:not(.hidden),
  body.page-library .adc-global-mini:not(.hidden),
  .mobile-mini-player.adc-persistent-mini:not(.hidden),
  .adc-global-mini:not(.hidden){
    left:10px!important;
    right:10px!important;
    width:auto!important;
    height:68px!important;
    min-height:68px!important;
    max-height:68px!important;
    bottom:calc(72px + env(safe-area-inset-bottom) - 1px)!important;
    padding:7px 9px!important;
    margin:0!important;
    border-radius:9px!important;
    border:1px solid rgba(255,255,255,.07)!important;
    background:linear-gradient(90deg,#7f210d,#a93314)!important;
    box-shadow:0 10px 28px rgba(0,0,0,.42)!important;
    grid-template-columns:30px 52px minmax(0,1fr) 40px 40px!important;
    gap:8px!important;
    align-items:center!important;
  }
  .mobile-mini-player button,
  .adc-global-mini button{
    border:0!important;background:transparent!important;color:#fff!important;
    box-shadow:none!important;outline:0!important;-webkit-appearance:none!important;appearance:none!important;
  }
  .mobile-mini-player .mini-close,
  .adc-global-mini .global-mini-close{font-size:24px!important}
  .mobile-bottom-nav,
  .mobile-bottom-nav.adc-shared-bottom-nav,
  .mobile-bottom-nav.adc-persistent-bottom-nav{
    top:auto!important;bottom:0!important;transform:none!important;border-radius:0!important;
  }
}
