/* Category filters use fill and text only; no blue selection or focus frame. */
.ranking-tabs button,
.ranking-tabs button:hover,
.ranking-tabs button:active,
.ranking-tabs button:focus,
.ranking-tabs button:focus-visible,
.ranking-tabs button.active {
  border-color: transparent !important;
  outline: 0 !important;
  box-shadow: none !important;
  transform: none !important;
  -webkit-tap-highlight-color: transparent;
}

.ranking-tabs button.active {
  background: #f1f5f9 !important;
  color: #334155 !important;
}

/* A selected work changes instantly to its OTT color without a gray/black flash. */
.ranking-row.ranking-rotating,
.ranking-row.ranking-rotating.is-spotlight {
  background: #fff;
  transform: none !important;
  transition:
    border-color 240ms ease,
    border-radius 240ms ease,
    margin 240ms ease,
    padding 240ms ease !important;
}

.ranking-row.ranking-rotating.is-spotlight {
  border-color: #d8e2ec;
}

.ranking-row.spotlight-netflix.is-spotlight { border-color: #e50914 !important; }
.ranking-row.spotlight-disney.is-spotlight { border-color: #1595c8 !important; }
.ranking-row.spotlight-tving.is-spotlight { border-color: #ff174f !important; }
.ranking-row.spotlight-wavve.is-spotlight { border-color: #126dff !important; }
.ranking-row.spotlight-watcha.is-spotlight { border-color: #ff2f76 !important; }
.ranking-row.spotlight-laftel.is-spotlight { border-color: #7857ff !important; }

.ranking-row.spotlight-netflix .ranking-description-panel { background: #fff3f4 !important; }
.ranking-row.spotlight-disney .ranking-description-panel { background: #eef8fc !important; }
.ranking-row.spotlight-tving .ranking-description-panel { background: #fff2f6 !important; }
.ranking-row.spotlight-wavve .ranking-description-panel { background: #f0f4ff !important; }
.ranking-row.spotlight-watcha .ranking-description-panel { background: #fff2f7 !important; }
.ranking-row.spotlight-laftel .ranking-description-panel { background: #f5f2ff !important; }

.ranking-description-panel {
  transition:
    max-height 280ms cubic-bezier(.22, .68, .22, 1),
    padding 280ms cubic-bezier(.22, .68, .22, 1),
    opacity 180ms ease !important;
}

.ranking-list {
  contain: layout paint;
  overflow-anchor: none;
  transition: none !important;
}

.ranking-tabs {
  scroll-behavior: smooth;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.ranking-tabs::-webkit-scrollbar {
  display: none;
}

.ranking-tabs button {
  flex: 0 0 auto;
  scroll-margin-inline: 40vw;
}

.ranking-poster,
.ranking-poster:hover,
.ranking-poster:active,
.ranking-poster:focus,
.ranking-poster:focus-visible,
.ranking-content,
.ranking-content:hover,
.ranking-content:active,
.ranking-content:focus,
.ranking-content:focus-visible {
  outline: 0 !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
  -webkit-tap-highlight-color: transparent;
}

.ranking-content,
.ranking-content:hover,
.ranking-content:active,
.ranking-content:focus,
.ranking-content:focus-visible {
  background: transparent !important;
}

.ranking-poster,
.ranking-full .ranking-poster {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9 !important;
  background: #edf1f5;
}

.ranking-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 800px) {
  .home .ranking-preview .ranking-row.ranking-rotating {
    grid-template-columns: 28px 92px minmax(0, 1fr) !important;
  }

  .home .ranking-preview .ranking-poster {
    width: 92px !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    border-radius: 7px;
  }

  .ranking-full .ranking-row.ranking-rotating {
    grid-template-columns: 40px 104px minmax(0, 1fr) !important;
  }

  .ranking-full .ranking-poster {
    width: 104px !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
  }
}

@media (max-width: 380px) {
  .home .ranking-preview .ranking-row.ranking-rotating {
    grid-template-columns: 26px 82px minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  .home .ranking-preview .ranking-poster {
    width: 82px !important;
  }

  .ranking-full .ranking-row.ranking-rotating {
    grid-template-columns: 34px 92px minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  .ranking-full .ranking-poster {
    width: 92px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ranking-tabs {
    scroll-behavior: auto;
  }
}
@media (max-width: 800px) {
  :is(.home, .ranking-page) .content-detail-modal {
    inset: 0;
    padding: 0;
    align-items: flex-end;
    overflow: hidden;
  }

  :is(.home, .ranking-page) .content-detail-dialog {
    width: 100%;
    height: calc(100dvh - max(64px, env(safe-area-inset-top)));
    max-height: calc(100dvh - max(64px, env(safe-area-inset-top)));
    overflow: hidden !important;
    border-radius: 24px 24px 0 0;
    background: #fff;
    transform: translate3d(0, 102%, 0);
    transition: transform 260ms cubic-bezier(.22, .8, .26, 1);
    will-change: transform;
  }

  :is(.home, .ranking-page) .content-detail-modal.open .content-detail-dialog {
    transform: translate3d(0, 0, 0);
  }

  :is(.home, .ranking-page) .content-detail-dialog.is-dragging {
    transition: none !important;
  }

  :is(.home, .ranking-page) .content-sheet-head {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    align-items: center;
    min-height: 58px;
    padding: 9px 14px 0;
  }

  :is(.home, .ranking-page) .content-sheet-head > i {
    display: block;
  }

  :is(.home, .ranking-page) .content-sheet-head > span {
    display: block;
    grid-column: 2;
    text-align: center;
  }

  :is(.home, .ranking-page) .content-sheet-head .content-detail-close {
    position: static;
    grid-column: 3;
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    margin: 0;
    padding: 0;
    place-self: center;
    border-radius: 50%;
    line-height: 1;
  }

  :is(.home, .ranking-page) .content-sheet-head .content-detail-close:hover,
  :is(.home, .ranking-page) .content-sheet-head .content-detail-close:active,
  :is(.home, .ranking-page) .content-sheet-head .content-detail-close:focus,
  :is(.home, .ranking-page) .content-sheet-head .content-detail-close:focus-visible {
    border: 0;
    outline: 0;
    background: #f1f4f7;
    box-shadow: none;
    filter: none;
    transform: none;
    -webkit-tap-highlight-color: transparent;
  }

  :is(.home, .ranking-page) .content-detail-hero figure.playing {
    display: block;
    width: 100%;
    min-height: 0;
    max-height: none;
    margin: 0;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    background: #0b111b;
  }

  :is(.home, .ranking-page) .content-detail-hero figure.playing iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
  }

  :is(.home, .ranking-page) #content-detail-body {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: max(28px, env(safe-area-inset-bottom));
    background: #fff;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  :is(.home, .ranking-page) .content-detail-hero {
    align-items: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ranking-row.ranking-rotating,
  .ranking-description-panel,
  .ranking-list,
  :is(.home, .ranking-page) .content-detail-dialog {
    transition: none !important;
  }
}

.content-cast-list {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 2px 0 7px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.content-cast-list::-webkit-scrollbar {
  display: none;
}

.content-cast-list > :is(div, span) {
  display: block;
  min-width: max-content;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  scroll-snap-align: start;
}

.content-cast-list > :is(div, span):not(:last-child)::after {
  margin: 0 9px;
  color: #a4afbd;
  content: "·";
}

.content-cast-list i,
.content-cast-list small {
  display: none;
}

.content-cast-list p,
.content-cast-list b,
.content-cast-list > span {
  display: inline;
  color: #3d4958;
  font-size: 13px;
  font-weight: 650;
}
