/* Vivid Cinema — final watch-page layout pass.
   Scoped to the watch route; preserves the existing player engine and server controls. */
body.vivid-watch-page,
body.vivid-watch-page * {
  box-sizing: border-box;
}
html:has(body.vivid-watch-page) {
  min-width: 320px;
  overflow-x: clip;
}
body.vivid-watch-page {
  min-width: 320px;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}
body.vivid-watch-page .vivid-watch-app,
body.vivid-watch-page #watch-content {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
body.vivid-watch-page .vivid-watch-hero {
  padding: clamp(12px, 2vw, 24px) clamp(16px, 3.2vw, 42px) 10px;
}
body.vivid-watch-page .vivid-watch-hero .vivid-watch-head {
  width: min(1240px, 100%);
  min-width: 0;
  gap: clamp(12px, 2vw, 24px);
}
body.vivid-watch-page .vivid-watch-hero .vivid-watch-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}
body.vivid-watch-page .vivid-watch-hero .vivid-watch-copy h1 {
  max-width: 100%;
  font-size: clamp(1.15rem, 2.2vw, 1.65rem);
  line-height: 1.22;
  letter-spacing: -.03em;
}
body.vivid-watch-page .vivid-watch-kicker {
  font-size: .64rem;
  line-height: 1.45;
  letter-spacing: .12em;
}
body.vivid-watch-page .vivid-watch-hero .vivid-watch-actions {
  min-width: 0;
  gap: 8px;
}
body.vivid-watch-page .vivid-watch-hero .vivid-watch-play,
body.vivid-watch-page .vivid-watch-hero .vivid-watch-details {
  min-height: 42px;
  padding-inline: 15px;
  font-size: .82rem;
}
body.vivid-watch-page .vivid-player-overlay.vivid-player-inline {
  padding-inline: clamp(16px, 3.2vw, 42px);
}
body.vivid-watch-page .vivid-player-overlay.vivid-player-inline .vivid-player-dialog {
  width: min(1240px, 100%);
  min-width: 0;
  border-radius: 13px;
  overflow: visible;
}
body.vivid-watch-page .vivid-player-overlay.vivid-player-inline .vivid-player-dialog-head {
  min-width: 0;
  gap: 12px;
  padding: 11px clamp(12px, 1.8vw, 20px);
}
body.vivid-watch-page .vivid-player-dialog-heading {
  flex: 1 1 180px;
  min-width: 0;
}
body.vivid-watch-page .vivid-player-dialog-heading > div {
  min-width: 0;
}
body.vivid-watch-page .vivid-player-dialog-head h2 {
  max-width: 100%;
  font-size: .9rem;
}
body.vivid-watch-page .vivid-player-current-source {
  max-width: 100%;
  overflow-wrap: anywhere;
}
body.vivid-watch-page .vivid-player-dialog-actions {
  flex: 0 0 auto;
  min-width: 0;
}
body.vivid-watch-page .vivid-player-overlay.vivid-player-inline .vivid-player-frame {
  width: 100%;
  min-width: 0;
  min-height: 0 !important;
  aspect-ratio: 16 / 9;
  flex: 0 1 auto;
  border-radius: 0;
}
body.vivid-watch-page .vivid-player-overlay.vivid-player-inline .vivid-player-frame iframe,
body.vivid-watch-page .vivid-player-overlay.vivid-player-inline .vivid-player-frame video {
  min-height: 0 !important;
}
body.vivid-watch-page .vivid-player-dialog-foot {
  flex-wrap: wrap;
  padding: 10px clamp(12px, 1.8vw, 20px);
  line-height: 1.45;
}
body.vivid-watch-page .vivid-watch-recommendations {
  width: min(1240px, 100%);
  padding: clamp(24px, 3vw, 36px) clamp(16px, 3.2vw, 42px) calc(32px + env(safe-area-inset-bottom, 0px));
}
body.vivid-watch-page .vivid-watch-recommendations .vivid-section-heading {
  align-items: center;
  margin-bottom: 14px;
}
body.vivid-watch-page .vivid-watch-recommendations .vivid-section-heading > div > span {
  font-size: .61rem;
  letter-spacing: .13em;
}
body.vivid-watch-page .vivid-watch-recommendations h2 {
  font-size: clamp(1.18rem, 2vw, 1.55rem);
  line-height: 1.2;
  letter-spacing: -.03em;
}
body.vivid-watch-page .vivid-watch-rec-rail {
  min-width: 0;
  gap: clamp(10px, 1.2vw, 15px);
  padding: 2px 2px 12px;
  scroll-padding-inline: 2px;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
body.vivid-watch-page .vivid-watch-rec-card {
  flex: 0 0 clamp(116px, 12vw, 158px);
  min-width: 0;
}
body.vivid-watch-page .vivid-watch-rec-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 9px;
}
body.vivid-watch-page .vivid-watch-rec-card strong {
  margin-top: 8px;
  font-size: .8rem;
  line-height: 1.35;
}
body.vivid-watch-page .vivid-watch-rec-card small {
  font-size: .72rem;
}
body.vivid-watch-page .vivid-footer {
  max-width: 100%;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}
body.vivid-watch-page .vivid-server-panel {
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
body.vivid-watch-page .vivid-player-overlay:not(.vivid-player-inline) {
  padding-top: max(12px, env(safe-area-inset-top, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
  padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  padding-left: max(12px, env(safe-area-inset-left, 0px));
}
body.vivid-watch-page .vivid-player-overlay:not(.vivid-player-inline) .vivid-player-dialog-head {
  padding-top: max(12px, env(safe-area-inset-top, 0px));
}
body.vivid-watch-page .vivid-player-overlay:not(.vivid-player-inline) .vivid-player-dialog-foot {
  padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
}
body.vivid-watch-page :is(a, button) {
  -webkit-tap-highlight-color: transparent;
}
body.vivid-watch-page :is(a, button):focus-visible {
  outline-offset: 3px;
}

@media (min-width: 1500px) {
  body.vivid-watch-page .vivid-watch-hero .vivid-watch-head,
  body.vivid-watch-page .vivid-player-overlay.vivid-player-inline .vivid-player-dialog,
  body.vivid-watch-page .vivid-watch-recommendations {
    width: min(1240px, 100%);
  }
}
@media (max-width: 760px) {
  body.vivid-watch-page {
    padding-bottom: calc(var(--vivid-mobile-nav-height, 64px) + env(safe-area-inset-bottom, 0px));
  }
  body.vivid-watch-page .vivid-watch-hero {
    padding: 14px 16px 8px;
  }
  body.vivid-watch-page .vivid-watch-hero .vivid-watch-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 12px;
  }
  body.vivid-watch-page .vivid-watch-hero .vivid-watch-copy h1 {
    font-size: clamp(1.12rem, 4.8vw, 1.45rem);
    line-height: 1.22;
  }
  body.vivid-watch-page .vivid-watch-hero .vivid-watch-actions {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    padding: 0;
  }
  body.vivid-watch-page .vivid-watch-hero .vivid-watch-play,
  body.vivid-watch-page .vivid-watch-hero .vivid-watch-details {
    min-height: 40px;
    padding-inline: 15px;
  }
  body.vivid-watch-page .vivid-player-overlay.vivid-player-inline {
    padding-inline: 0;
  }
  body.vivid-watch-page .vivid-player-overlay.vivid-player-inline .vivid-player-dialog {
    width: 100%;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
  }
  body.vivid-watch-page .vivid-player-overlay.vivid-player-inline .vivid-player-dialog-head {
    gap: 8px;
    padding: 10px 12px;
  }
  body.vivid-watch-page .vivid-player-dialog-heading {
    flex-basis: 120px;
  }
  body.vivid-watch-page .vivid-player-dialog-head h2 {
    font-size: .82rem;
  }
  body.vivid-watch-page .vivid-player-current-source {
    max-width: 44vw;
    font-size: .66rem;
    line-height: 1.35;
  }
  body.vivid-watch-page .vivid-player-dialog-actions {
    gap: 6px;
  }
  body.vivid-watch-page .vivid-player-switch {
    min-height: 38px;
    padding-inline: 10px;
    font-size: .73rem;
  }
  body.vivid-watch-page .vivid-player-close {
    width: 38px;
    min-height: 38px;
  }
  body.vivid-watch-page .vivid-watch-recommendations {
    padding: 24px 16px calc(30px + env(safe-area-inset-bottom, 0px));
  }
  body.vivid-watch-page .vivid-watch-rec-card {
    flex-basis: clamp(108px, 31vw, 136px);
  }
  body.vivid-watch-page .vivid-watch-rec-card strong {
    font-size: .78rem;
  }
  body.vivid-watch-page .vivid-watch-rec-rail {
    margin-right: -16px;
    padding-right: 16px;
  }
  body.vivid-watch-page .vivid-player-overlay:not(.vivid-player-inline) {
    padding: 0;
    align-items: center;
  }
  body.vivid-watch-page .vivid-player-overlay:not(.vivid-player-inline) .vivid-player-dialog {
    width: 100%;
    max-width: 100%;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  body.vivid-watch-page .vivid-player-overlay:not(.vivid-player-inline) .vivid-player-dialog-head {
    padding: max(12px, env(safe-area-inset-top, 0px)) 12px 10px;
  }
  body.vivid-watch-page .vivid-player-overlay:not(.vivid-player-inline) .vivid-player-dialog-foot {
    padding: 10px 12px max(12px, env(safe-area-inset-bottom, 0px));
  }
}
@media (max-width: 390px) {
  body.vivid-watch-page .vivid-watch-hero {
    padding-inline: 14px;
  }
  body.vivid-watch-page .vivid-watch-hero .vivid-watch-copy h1 {
    font-size: 1.08rem;
  }
  body.vivid-watch-page .vivid-player-dialog-heading {
    flex-basis: 95px;
  }
  body.vivid-watch-page .vivid-player-dialog-eyebrow {
    font-size: .5rem;
    letter-spacing: .09em;
  }
  body.vivid-watch-page .vivid-player-switch {
    gap: 5px;
    padding-inline: 8px;
  }
  body.vivid-watch-page .vivid-watch-recommendations {
    padding-inline: 14px;
  }
  body.vivid-watch-page .vivid-watch-rec-card {
    flex-basis: 108px;
  }
}
@media (max-width: 350px) {
  body.vivid-watch-page .vivid-player-dialog-head {
    align-items: flex-start;
  }
  body.vivid-watch-page .vivid-player-dialog-heading {
    flex-basis: 100%;
  }
  body.vivid-watch-page .vivid-player-dialog-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
@media (orientation: landscape) and (max-height: 520px) {
  body.vivid-watch-page .vivid-player-overlay:not(.vivid-player-inline) {
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  }
  body.vivid-watch-page .vivid-player-overlay:not(.vivid-player-inline) .vivid-player-dialog-head {
    padding: 5px 12px;
  }
  body.vivid-watch-page .vivid-player-overlay:not(.vivid-player-inline) .vivid-player-frame {
    max-height: calc(100dvh - 90px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }
}
@media (prefers-reduced-motion: reduce) {
  body.vivid-watch-page .vivid-watch-rec-card img {
    transition: none;
  }
}


/* Landscape playback keeps the player viewport itself at 16:9. Constrain the
   dialog width by usable viewport height so its header/footer never force a
   wide iframe into a short, distorted rectangle. */
@media (orientation: landscape) and (min-height: 521px) {
  body.vivid-watch-page .vivid-player-overlay:not(.vivid-player-inline) .vivid-player-dialog {
    width: min(100%, calc(177.78dvh - 284px));
    max-width: 1320px;
  }
  body.vivid-watch-page .vivid-player-overlay:not(.vivid-player-inline) .vivid-player-frame {
    width: 100%;
    max-width: 100%;
    max-height: none;
    aspect-ratio: 16 / 9;
    flex: 0 1 auto;
  }
}
@media (orientation: landscape) and (max-height: 520px) {
  body.vivid-watch-page .vivid-player-overlay:not(.vivid-player-inline) {
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  }
  body.vivid-watch-page .vivid-player-overlay:not(.vivid-player-inline) .vivid-player-dialog {
    width: 100%;
    max-width: 100%;
    max-height: 100dvh;
  }
  body.vivid-watch-page .vivid-player-overlay:not(.vivid-player-inline) .vivid-player-frame {
    width: min(100%, calc(177.78dvh - 200px));
    max-width: 100%;
    max-height: none;
    aspect-ratio: 16 / 9;
    flex: 0 1 auto;
    align-self: center;
  }
}


/* Vivid watch experience refresh — shared finish for both independent players.
   Keep provider controls native when an embed does not expose a playback API. */
body.vivid-watch-page .vivid-watch-hero {
  min-height: clamp(300px, 34vw, 440px);
}
body.vivid-watch-page .vivid-watch-backdrop {
  background-image:
    linear-gradient(90deg, rgba(6,7,10,.97) 0%, rgba(6,7,10,.78) 43%, rgba(6,7,10,.36) 76%, rgba(6,7,10,.64) 100%),
    linear-gradient(0deg, #08090c 0%, rgba(8,9,12,.14) 60%, rgba(8,9,12,.24) 100%),
    var(--watch-backdrop);
}
body.vivid-watch-page .vivid-watch-head {
  width: min(1440px, 100%);
  min-height: clamp(300px, 34vw, 440px);
  padding-top: clamp(32px, 5vw, 72px);
  padding-bottom: clamp(26px, 4vw, 48px);
}
body.vivid-watch-page .vivid-watch-head h1 {
  max-width: 900px;
  font-size: clamp(2rem, 4.7vw, 4.8rem);
  line-height: .98;
  letter-spacing: -.055em;
}
body.vivid-watch-page .vivid-player-overlay.vivid-player-inline .vivid-player-dialog {
  width: min(1500px, 100%);
}
body.vivid-watch-page .vivid-player-dialog-head {
  min-height: 74px;
  padding-block: 17px;
}
body.vivid-watch-page .vivid-player-dialog-heading h2 {
  font-size: clamp(.96rem, 1.5vw, 1.2rem);
  letter-spacing: -.025em;
}
body.vivid-watch-page .vivid-player-overlay.vivid-player-inline .vivid-player-frame {
  aspect-ratio: 16 / 9;
  min-height: 0;
  border-radius: 0;
}
body.vivid-watch-page .vivid-player-main {
  overflow: clip;
  border-color: rgba(255,255,255,.12);
  border-radius: 16px;
  background: #000;
  box-shadow: 0 24px 72px rgba(0,0,0,.38), 0 1px 0 rgba(255,255,255,.035) inset;
}
body.vivid-watch-page .vivid-player-frame iframe,
body.vivid-watch-page .vivid-player-frame video {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
}
body.vivid-watch-page .vivid-player-frame video {
  object-fit: contain;
  accent-color: #e50914;
}
body.vivid-watch-page .vivid-player-status {
  max-width: min(560px, calc(100% - 32px));
  line-height: 1.55;
  text-wrap: pretty;
}
body.vivid-watch-page .vivid-player-dialog-foot {
  color: #969ba6;
  font-size: .76rem;
}
body.vivid-watch-page .vivid-player-dialog-foot a {
  color: #e8eaf0;
  text-decoration: none;
}
body.vivid-watch-page .vivid-player-dialog-foot a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
body.vivid-watch-page .vivid-player-source,
body.vivid-watch-page .vivid-tflix-server {
  min-height: 58px;
  border-radius: 10px;
}
body.vivid-watch-page .vivid-player-source:focus-visible,
body.vivid-watch-page .vivid-tflix-server:focus-visible,
body.vivid-watch-page .vivid-tflix-select:focus-visible,
body.vivid-watch-page .vivid-tflix-next:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
body.vivid-watch-page .vivid-tflix-player {
  margin-top: clamp(28px, 4vw, 54px);
}
body.vivid-watch-page .vivid-tflix-card {
  border-color: rgba(255,255,255,.1);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.24);
}
body.vivid-watch-page .vivid-tflix-screen {
  aspect-ratio: 16 / 9;
  min-height: 0;
  border-radius: 12px;
}
body.vivid-watch-page .vivid-tflix-screen iframe {
  width: 100%;
  height: 100%;
}
body.vivid-watch-page .vivid-tflix-sidebar {
  gap: 14px;
}
body.vivid-watch-page .vivid-tflix-panel {
  border-color: rgba(255,255,255,.09);
  background: linear-gradient(145deg, #14151b, #0c0d11);
}
body.vivid-watch-page .vivid-watch-rec-card img {
  transition: transform .22s ease, border-color .22s ease, filter .22s ease;
}
body.vivid-watch-page .vivid-watch-rec-card:hover img {
  filter: brightness(1.08);
}
body.vivid-watch-page button:disabled,
body.vivid-watch-page [aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .52;
}
@media (max-width: 760px) {
  body.vivid-watch-page .vivid-watch-hero,
  body.vivid-watch-page .vivid-watch-head {
    min-height: 0;
  }
  body.vivid-watch-page .vivid-watch-head {
    padding-top: 26px;
    padding-bottom: 26px;
  }
  body.vivid-watch-page .vivid-player-dialog-head {
    min-height: 62px;
    padding: 12px var(--watch-gutter);
  }
  body.vivid-watch-page .vivid-player-main {
    border-radius: 10px;
  }
  body.vivid-watch-page .vivid-player-overlay.vivid-player-inline .vivid-player-frame {
    aspect-ratio: 16 / 9;
  }
  body.vivid-watch-page .vivid-player-overlay.vivid-player-inline .vivid-player-dialog-foot {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  body.vivid-watch-page .vivid-tflix-layout {
    padding: 10px;
  }
  body.vivid-watch-page .vivid-tflix-screen {
    border-radius: 9px;
  }
  body.vivid-watch-page .vivid-tflix-server {
    min-height: 56px;
  }
}
@media (max-width: 420px) {
  body.vivid-watch-page .vivid-player-dialog-heading h2 {
    max-width: 42vw;
    font-size: .9rem;
  }
  body.vivid-watch-page .vivid-player-dialog-eyebrow {
    font-size: .57rem;
    letter-spacing: .1em;
  }
  body.vivid-watch-page .vivid-player-overlay.vivid-player-inline .vivid-player-frame {
    aspect-ratio: 16 / 10;
  }
  body.vivid-watch-page .vivid-watch-rec-card {
    flex-basis: 132px;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.vivid-watch-page .vivid-watch-rec-card img,
  body.vivid-watch-page .vivid-player-source,
  body.vivid-watch-page .vivid-tflix-server {
    transition: none;
  }
}


/* Player 1 server list: JS positions this menu using viewport coordinates.
   Keep it viewport-fixed so the dropdown is not offset/clipped by the header,
   and make the server list itself the touch-scroll container. */
body.vivid-watch-page .vivid-server-panel:not([hidden]) {
  position: fixed !important;
  display: flex !important;
  flex-direction: column;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  z-index: 10000 !important;
  box-sizing: border-box;
}
body.vivid-watch-page .vivid-server-panel[hidden] {
  display: none !important;
}
body.vivid-watch-page .vivid-server-panel-heading {
  flex: 0 0 auto;
}
body.vivid-watch-page .vivid-server-panel .vivid-player-source {
  flex: 0 0 auto;
}


/* Player 1 provider warnings live below the video, never over the stream. */
body.vivid-watch-page .vivid-player-main > .vivid-player-status {
  position: static !important;
  inset: auto !important;
  display: block;
  width: auto;
  max-width: none;
  margin: 12px 14px 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(20, 24, 32, .96);
  text-align: center;
}
body.vivid-watch-page .vivid-player-main > .vivid-player-status[hidden],
body.vivid-watch-page .vivid-player-main > .vivid-player-try-next[hidden] {
  display: none !important;
}
body.vivid-watch-page .vivid-player-main > .vivid-player-try-next {
  position: static !important;
  display: block;
  width: fit-content;
  max-width: calc(100% - 28px);
  margin: 10px 14px 14px auto;
}


/* EmbedWave's native controls are rendered inside its cross-origin iframe.
   Give that provider a conventional 16:9 viewport on narrow phones so its
   own controls/settings have the expected player dimensions. */
@media (max-width: 420px) {
  body.vivid-watch-page .vivid-player-frame.is-embedwave {
    aspect-ratio: 16 / 9 !important;
  }
}
