/* BingeBox desktop-only QA hardening.
   All rules are scoped to >=768px so the locked mobile layout is untouched. */
@media (min-width:768px){
  /* Keep the sharp hero art at the intended 3:4 portrait ratio. */
  .bb-hero-poster{
    width:min(360px,46vw)!important;
    height:auto!important;
    aspect-ratio:3/4!important;
    max-height:100%!important;
    object-fit:cover!important;
  }

  /* Keep desktop spacing aligned to the same 6vw content rhythm. */
  .bb-footer-inner{
    width:100%!important;
    max-width:none!important;
    margin:0!important;
    padding:40px 6vw!important;
  }

  /* Center shelf arrows against responsive 3:4 poster heights. */
  .Slider_pageButtons__jvO9V{
    top:clamp(113px,10.92vw,167px)!important;
  }

  /* Search cards keep a stable two-line title block. */
  .bb-search-card strong{
    min-height:2.7em;
    display:-webkit-box!important;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  /* Use one deterministic desktop UI font stack instead of unloaded Noto Sans. */
  .bb-search-overlay,
  .bb-search-input,
  .bb-data-error,
  .rs-source-backdrop,
  .rs-source-foreground,
  .rs-hover-title,
  .rs-hover-meta,
  .rs-hover-description{
    font-family:Arial,Helvetica,sans-serif!important;
  }

  /* The original card remains visible until the expanded foreground is actually open. */
  .BookItem_bookItem__sK4Qp.rs-hover-active > .BookItem_poster__CsSCp,
  .BookItem_bookItem__sK4Qp.rs-hover-active > .BookItem_bookMeta__dUiSZ{
    visibility:visible!important;
  }
  .BookItem_bookItem__sK4Qp.rs-hover-active:has(.rs-source-foreground.rs-open) > .BookItem_poster__CsSCp,
  .BookItem_bookItem__sK4Qp.rs-hover-active:has(.rs-source-foreground.rs-open) > .BookItem_bookMeta__dUiSZ{
    visibility:hidden!important;
  }

  /* Give catalog loading a visible state instead of a blank black desktop page. */
  html.bb-pending .bb-loading-note{
    display:flex!important;
    align-items:center;
    justify-content:center;
    gap:10px;
  }
  html.bb-pending .bb-loading-note::before{
    content:"";
    width:16px;
    height:16px;
    border:2px solid rgba(255,255,255,.25);
    border-top-color:#fff;
    border-radius:50%;
    animation:bb-desktop-spin .8s linear infinite;
  }

  /* Remove the captured source site's floating control as a CSS safety net. */
  .CommonNavigationLayout_to_top_btn__VLUit{display:none!important}
}

@media (min-width:1001px){
  /* Cap the large recommendation cards without changing the five-column desktop structure. */
  .home_recommendGrid__RUlrd{
    grid-template-columns:repeat(5,minmax(0,250px))!important;
    justify-content:space-between!important;
    align-items:start!important;
  }
}

@media (min-width:768px) and (max-width:1180px){
  /* Preserve the full desktop header while tightening only its spacing. */
  header>div>div{gap:18px!important}
  header [data-capture-node="167"]{gap:16px!important;font-size:14px!important}
  header [data-capture-node="176"]{gap:8px!important}
}

@media (min-width:768px) and (max-width:1100px){
  /* Four columns avoid cramped search results at narrow desktop/tablet widths. */
  .bb-search-results{grid-template-columns:repeat(4,minmax(0,1fr))!important}

  /* Scale the hover overlay with narrow desktop cards instead of forcing 504px. */
  .rs-source-backdrop,
  .rs-source-foreground{
    min-height:clamp(430px,46vw,504px)!important;
  }
}

@keyframes bb-desktop-spin{to{transform:rotate(360deg)}}


/* Recording-driven desktop stabilization — 1364×716 reference. */
@media (min-width:1024px){
  .bb-hero-poster{
    right:7vw!important;
    width:min(320px,24vw)!important;
  }
  section[aria-label="Featured series"]>div:nth-child(3){
    right:7vw!important;
    bottom:32px!important;
    width:38%!important;
  }
  .bb-hero-thumbs{
    gap:8px!important;
    padding:0 2px 2px;
  }
  section[aria-label="Featured series"] button[aria-label^="Preview "]{
    flex:0 0 60px!important;
    width:60px!important;
    height:80px!important;
  }

  .home_floorTitle__cIyIp>a{
    color:rgba(255,255,255,.76)!important;
    font-weight:500!important;
    text-decoration:none!important;
  }
  .home_floorTitle__cIyIp>a:hover{color:#fff!important}

  .Slider_prevButton__5XAPR{left:-10px!important}
  .Slider_nextButton__a5KCv{right:-10px!important}
  .Slider_pageButtonHit__O3oNF{
    width:48px!important;
    height:48px!important;
  }


}

@media (min-width:1024px) and (max-width:1180px){
  .bb-hero-poster{width:min(300px,25vw)!important;right:6vw!important}
  section[aria-label="Featured series"]>div:nth-child(3){width:36%!important;right:6vw!important}
}

/* Expanded glass preview: artwork above readable details; the runtime anchors
   its bottom to the current card so it cannot cover the next shelf. */
@media (min-width:768px) and (hover:hover) and (pointer:fine){
  .rs-source-backdrop,.rs-source-foreground{
    left:var(--rs-panel-left,-15px)!important;
    top:var(--rs-panel-top,-28px)!important;
    width:calc(100% + 30px)!important;
    min-height:0!important;
    height:var(--rs-panel-height,520px)!important;
    border-radius:24px!important;
    transition:opacity .16s ease-out!important;
  }
  .home_main_content__GxekS:has(.rs-hover-active){z-index:2!important}
  .rs-source-backdrop{box-shadow:0 16px 42px rgba(0,0,0,.45)}
  .rs-source-foreground{display:flex;flex-direction:column;overflow:hidden}
  .rs-source-foreground-cover{
    flex:1 1 auto;min-height:0;aspect-ratio:auto;
    transform:none!important;transition:none!important;
  }
  .rs-source-foreground-cover img{object-fit:contain;background:rgba(0,0,0,.12)}
  .rs-source-details{flex:0 0 auto;margin:12px 15px 15px;gap:12px!important;transition:none!important}
  .rs-hover-title{font-weight:600;min-height:0}
  .rs-hover-description{color:rgba(255,255,255,.76)}
  .rs-hover-action:focus-visible{outline:2px solid #fff;outline-offset:3px}
  .Slider_sliderWrapper__66_q7.rs-hover-shelf-active .Slider_sliderContainer__2F8gq{
    overflow-x:clip!important;overflow-y:visible!important;
  }
}
@media (min-width:768px){
  .bb-browse-all{
    display:flex;align-items:center;justify-content:center;
    min-height:48px;min-width:200px;margin:32px auto 0;padding:12px 28px;
    border:1px solid rgba(255,255,255,.24);border-radius:999px;
    background:#202024;color:#fff;font:600 14px/20px Arial,Helvetica,sans-serif;
    cursor:pointer;transition:background .16s ease,border-color .16s ease;
  }
  .bb-browse-all:hover{background:#303036;border-color:rgba(255,255,255,.5)}
  .bb-browse-all:focus-visible{outline:2px solid #fff;outline-offset:4px}
}
@media (prefers-reduced-motion:reduce){
  .rs-source-backdrop,.rs-source-foreground,.rs-source-foreground-cover{transition:none!important}
}
