html {
  color-scheme: dark;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  transition: background-color 200ms ease, border-color 200ms ease, backdrop-filter 200ms ease;
  border-bottom: 1px solid transparent;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgb(15 13 11 / 0.9) 0%, rgb(15 13 11 / 0) 100%);
  pointer-events: none;
  transition: opacity 200ms ease;
}

.site-header.is-solid {
  background: rgb(15 13 11 / 0.55);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  border-bottom-color: rgb(255 255 255 / 0.12);
}

.site-header.is-solid::before {
  opacity: 0;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.header-search {
  position: relative;
  display: grid;
  flex: 0 1 13.5rem;
  min-width: 0;
  margin-left: auto;
  min-height: 2.5rem;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.45rem;
  border-radius: 0.65rem;
  border: 1px solid rgb(255 255 255 / 0.14);
  background: rgb(255 255 255 / 0.075);
  padding: 0.24rem 0.6rem;
  color: rgb(248 198 93);
  box-shadow: 0 18px 44px rgb(0 0 0 / 0.24);
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.header-search:focus-within {
  border-color: rgb(248 198 93 / 0.76);
  background: rgb(255 255 255 / 0.1);
  box-shadow: 0 0 0 4px rgb(248 198 93 / 0.13), 0 18px 44px rgb(0 0 0 / 0.3);
}

.header-search input {
  min-width: 0;
  border: 0;
  background: transparent;
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
  outline: 0;
}

.header-search input::placeholder {
  color: rgb(168 162 158);
}

.search-suggest {
  position: absolute;
  top: calc(100% + 0.55rem);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: min(70vh, 26rem);
  overflow-y: auto;
  padding: 0.4rem;
  border-radius: 0.9rem;
  border: 1px solid rgb(255 255 255 / 0.1);
  background: rgb(23 18 15 / 0.98);
  box-shadow: 0 26px 60px rgb(0 0 0 / 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.search-suggest-item {
  display: grid;
  width: 100%;
  grid-template-columns: 2.9rem minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border: 0;
  border-radius: 0.6rem;
  background: transparent;
  text-align: left;
  color: white;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.search-suggest-item:hover,
.search-suggest-item:focus-visible {
  background: rgb(255 255 255 / 0.07);
  outline: 0;
}

.srp-poster {
  overflow: hidden;
  aspect-ratio: 2 / 3;
  border-radius: 0.4rem;
  background: rgb(255 255 255 / 0.06);
}

.srp-poster img {
  height: 100%;
  width: 100%;
  object-fit: cover;
}

.srp-detail {
  min-width: 0;
}

.srp-name {
  display: block;
  overflow: hidden;
  font-size: 0.98rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.srp-infor {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.2rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgb(168 162 158);
}

.srp-dot {
  height: 0.28rem;
  width: 0.28rem;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.6;
}

.search-suggest-empty {
  padding: 0.85rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgb(168 162 158);
}

@media (min-width: 768px) {
  .header-search {
    flex: 1 1 auto;
    max-width: 30rem;
    min-width: 20rem;
    min-height: 2.9rem;
    gap: 0.65rem;
    padding: 0.28rem 0.8rem;
  }
}

.primary-action,
.secondary-action {
  display: inline-flex;
  min-height: 2.8rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.5rem;
  padding: 0 1rem;
  font-weight: 900;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.icon-action {
  width: 2.8rem;
  padding: 0;
}

.primary-action {
  border: 1px solid rgb(248 198 93 / 0.72);
  background: rgb(248 198 93);
  color: rgb(28 25 23);
  box-shadow: 0 16px 40px rgb(248 198 93 / 0.18);
}

.primary-action:hover {
  background: rgb(255 214 118);
  transform: translateY(-1px);
}

.quality-badge {
  display: inline-flex;
  min-height: 1.7rem;
  align-items: center;
  border-radius: 0.35rem;
  background: rgb(248 198 93);
  padding: 0 0.5rem;
  color: rgb(28 25 23);
  font-size: 0.75rem;
  font-weight: 950;
  text-transform: uppercase;
}

.secondary-action {
  border: 1px solid rgb(255 255 255 / 0.12);
  background: rgb(255 255 255 / 0.07);
  color: white;
}

.secondary-action:hover {
  border-color: rgb(248 198 93 / 0.45);
  background: rgb(255 255 255 / 0.11);
  transform: translateY(-1px);
}

/* Reserve horizontal gestures for the swipe handler so a horizontal drag is
   delivered as pointer events (and not stolen by the browser as a scroll, which
   fires pointercancel); vertical drags still scroll the page. */
#hero {
  touch-action: pan-y;
}

.hero-backdrop-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  opacity: 0;
  transform: translate3d(0, 0, 0);
  transition: transform 620ms cubic-bezier(0.22, 0.72, 0.16, 1), opacity 620ms ease;
  will-change: transform, opacity;
}

.hero-backdrop.active {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.hero-backdrop.prep-next {
  opacity: 1;
  transform: translate3d(100%, 0, 0);
}

.hero-backdrop.prep-prev {
  opacity: 1;
  transform: translate3d(-100%, 0, 0);
}

.hero-backdrop.exit-left {
  opacity: 0;
  transform: translate3d(-34%, 0, 0);
}

.hero-backdrop.exit-right {
  opacity: 0;
  transform: translate3d(34%, 0, 0);
}

.hero-copy {
  animation-duration: 520ms;
  animation-timing-function: cubic-bezier(0.22, 0.72, 0.16, 1);
}

.hero-copy.swipe-next {
  animation-name: hero-copy-next;
}

.hero-copy.swipe-prev {
  animation-name: hero-copy-prev;
}

@keyframes hero-copy-next {
  from {
    opacity: 0;
    transform: translate3d(2rem, 0, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes hero-copy-prev {
  from {
    opacity: 0;
    transform: translate3d(-2rem, 0, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-backdrop,
  .hero-copy {
    animation: none;
    transition: none;
  }
}

.hero-carousel {
  position: relative;
  margin-inline: -1rem;
  padding: 1rem 1rem 0;
}

.hero-carousel::before {
  position: absolute;
  inset: -4rem 0 -0.5rem;
  z-index: -1;
  content: "";
  background: linear-gradient(180deg, transparent, rgb(15 13 11 / 0.62) 48%, rgb(15 13 11 / 0.9));
  pointer-events: none;
}

.carousel-dots {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.1rem;
}

.carousel-dot {
  display: grid;
  width: 2.4rem;
  height: 1.15rem;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  background: transparent;
  padding: 0;
}

.carousel-dot > span {
  display: none;
}

.carousel-dot::before {
  content: "";
  width: 100%;
  height: 0.28rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.3);
  transition: background-color 200ms ease;
}

.carousel-dot:hover::before {
  background: rgb(255 255 255 / 0.55);
}

.carousel-dot.active::before {
  background: rgb(248 198 93);
}

.home-row + .home-row {
  margin-top: 2.4rem;
}

.detail-page {
  position: relative;
  min-height: calc(100vh - 4.25rem);
  overflow: hidden;
  background: rgb(15 13 11);
}

/* Ambient page backdrop removed — keep the detail page a clean flat dark. */
.detail-backdrop {
  display: none;
}

.detail-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 32%, rgb(15 13 11 / 0.35) 38%, rgb(15 13 11) 100%),
    linear-gradient(0deg, rgb(15 13 11) 3%, rgb(15 13 11 / 0) 55%, rgb(15 13 11 / 0.6));
}

.detail-shell {
  position: relative;
  z-index: 1;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.75rem 1rem 3.5rem;
  display: grid;
  gap: 1.75rem;
}

@media (min-width: 640px) {
  .detail-shell {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

.detail-back {
  width: fit-content;
}

.detail-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100dvh - 6.5rem);
  margin-inline: auto;
  overflow: hidden;
  border-radius: 0.9rem;
  border: 1px solid rgb(255 255 255 / 0.16);
  background-color: black;
  box-shadow: 0 30px 80px rgb(0 0 0 / 0.55);
}

/* Small screens: let the player span the full device width for the largest
   possible viewing area (break out of the detail-shell side padding). */
@media (max-width: 639px) {
  .detail-player {
    margin-inline: -1rem;
    width: calc(100% + 2rem);
    max-height: none;
    border-radius: 0;
    border-inline: 0;
  }
}

.detail-player::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.5);
  transition: opacity 180ms ease;
}

.detail-player.is-playing::after {
  opacity: 0;
  pointer-events: none;
}

.detail-player-frame {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.detail-player-frame iframe,
.detail-player-frame video {
  width: 100%;
  height: 100%;
  border: 0;
  background: black;
}

.detail-player-frame video {
  object-fit: contain;
}

.detail-player-play {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: auto;
  display: grid;
  width: 5rem;
  height: 5rem;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgb(248 198 93);
  color: rgb(28 25 23);
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.5);
  cursor: pointer;
  transition: transform 160ms ease;
}

.detail-player-play svg {
  width: 2rem;
  height: 2rem;
}

.detail-player-play:hover {
  transform: scale(1.06);
}

.detail-player.is-playing .detail-player-play {
  display: none;
}

.detail-info {
  position: relative;
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .detail-info {
    grid-template-columns: 15rem minmax(0, 1fr);
    align-items: start;
  }
}

.detail-title {
  margin: 0;
  color: white;
  font-size: clamp(2rem, 5vw, 3.75rem);
  font-weight: 900;
  line-height: 1.02;
}

.detail-meta {
  margin-top: 0.75rem;
  color: rgb(214 211 209);
  font-weight: 700;
}

.detail-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.detail-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 0.14);
  background: rgb(255 255 255 / 0.06);
  padding: 0.2rem 0.65rem;
  color: rgb(214 211 209);
  font-size: 0.8rem;
  font-weight: 800;
}

.detail-stat svg {
  width: 0.9rem;
  height: 0.9rem;
  color: rgb(248 198 93);
}

.detail-stat-quality {
  border-color: transparent;
  background: rgb(248 198 93);
  color: rgb(28 25 23);
  font-weight: 950;
  text-transform: uppercase;
}

.detail-description {
  margin-top: 1rem;
  max-width: 48rem;
  color: rgb(214 211 209);
  line-height: 1.7;
}

.detail-actions {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.detail-status {
  margin-top: 1rem;
  color: rgb(168 162 158);
  font-size: 0.85rem;
  font-weight: 600;
}

.detail-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.detail-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  color: rgb(168 162 158);
  font-size: 0.85rem;
  font-weight: 700;
}

.detail-breadcrumb a {
  color: rgb(214 211 209);
  text-decoration: none;
}

.detail-breadcrumb a:hover {
  color: rgb(248 198 93);
}

.detail-breadcrumb .crumb-sep {
  color: rgb(120 113 108);
}

.detail-breadcrumb .crumb-current {
  max-width: 22rem;
  overflow: hidden;
  color: white;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.episodes {
  display: grid;
  gap: 1rem;
}

/* display:grid above overrides the UA [hidden] rule, so movies (which set
   hidden=true) still showed the "Episodes" heading. Re-assert the hide. */
.episodes[hidden] {
  display: none;
}

.episodes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.episodes-head h2 {
  margin: 0;
  color: white;
  font-size: 1.4rem;
  font-weight: 950;
}

.season-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.season-tab {
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 0.14);
  background: rgb(255 255 255 / 0.06);
  padding: 0.35rem 0.9rem;
  color: rgb(214 211 209);
  font-size: 0.85rem;
  font-weight: 800;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.season-tab:hover {
  border-color: rgb(248 198 93 / 0.5);
  color: white;
}

.season-tab.active {
  border-color: transparent;
  background: rgb(248 198 93);
  color: rgb(28 25 23);
  font-weight: 950;
}

.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.6rem;
}

.episode-item {
  display: grid;
  gap: 0.15rem;
  border-radius: 0.6rem;
  border: 1px solid rgb(255 255 255 / 0.1);
  background: rgb(255 255 255 / 0.05);
  padding: 0.6rem 0.75rem;
  text-align: left;
  color: rgb(214 211 209);
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.episode-item:hover {
  border-color: rgb(248 198 93 / 0.5);
  background: rgb(255 255 255 / 0.09);
  transform: translateY(-1px);
}

.episode-item.active {
  border-color: rgb(248 198 93);
  background: rgb(248 198 93 / 0.16);
  color: white;
}

.episode-skeleton {
  gap: 0.5rem;
  pointer-events: none;
}

.skeleton-line {
  display: block;
  height: 0.7rem;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgb(255 255 255 / 0.06) 25%,
    rgb(255 255 255 / 0.14) 37%,
    rgb(255 255 255 / 0.06) 63%
  );
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

.skeleton-num {
  width: 40%;
}

.skeleton-title {
  width: 80%;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-line {
    animation: none;
  }
}

.episode-num {
  color: rgb(248 198 93);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.episode-title {
  overflow: hidden;
  font-size: 0.85rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-select {
  display: grid;
  gap: 0.85rem;
  padding: 1.25rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid rgb(255 255 255 / 0.1);
  background: rgb(255 255 255 / 0.04);
}

.server-notice {
  margin: 0;
  text-align: center;
  color: rgb(214 211 209);
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0.85;
}

.server-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.server-item {
  display: block;
  flex: 1 1 12rem;
  max-width: 20rem;
}

.server-link {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border-radius: 0.7rem;
  border: 1px solid rgb(255 255 255 / 0.12);
  background: rgb(17 25 38 / 0.65);
  padding: 0.7rem 1.05rem;
  color: rgb(214 211 209);
  font-weight: 800;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.server-link svg {
  width: 1rem;
  height: 1rem;
}

.server-kicker {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  opacity: 0.6;
}

.server-link:hover {
  border-color: rgb(248 198 93 / 0.45);
  color: white;
}

.server-link.active {
  border-color: rgb(248 198 93);
  background: rgb(248 198 93 / 0.16);
  color: white;
}

.server-link.active svg {
  color: rgb(248 198 93);
}

.detail-poster {
  width: min(100%, 15rem);
  aspect-ratio: 2 / 3;
  border-radius: 0.75rem;
  border: 3px solid rgb(255 255 255 / 0.2);
  background: rgb(33 25 21);
  object-fit: cover;
  box-shadow: 0 24px 70px rgb(0 0 0 / 0.45);
}

.detail-facts {
  display: grid;
  max-width: 54rem;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.detail-fact {
  display: grid;
  gap: 0.15rem;
  border-top: 1px solid rgb(255 255 255 / 0.1);
  padding-top: 0.65rem;
}

.detail-fact dt {
  color: rgb(248 198 93);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.detail-fact dd {
  min-width: 0;
  color: rgb(214 211 209);
  font-weight: 700;
  line-height: 1.5;
}

@media (min-width: 768px) {
  .detail-fact {
    grid-template-columns: 8rem minmax(0, 1fr);
    gap: 1rem;
  }
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-heading h2 {
  margin: 0.15rem 0 0;
  color: white;
  font-size: clamp(1.45rem, 3vw, 2.1rem);
  font-weight: 950;
  line-height: 1.05;
}

.segmented-control {
  display: inline-flex;
  gap: 0.25rem;
  border-radius: 0.65rem;
  border: 1px solid rgb(255 255 255 / 0.1);
  background: rgb(255 255 255 / 0.06);
  padding: 0.25rem;
}

.segmented-control button {
  min-height: 2.25rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  padding: 0 0.8rem;
  color: rgb(214 211 209);
  font-size: 0.85rem;
  font-weight: 900;
}

.segmented-control button:hover,
.segmented-control button.active {
  background: rgb(248 198 93);
  color: rgb(28 25 23);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem 0.9rem;
  padding: 0.15rem 0 0.7rem;
}

@media (min-width: 640px) {
  .media-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .media-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .media-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

/* French source carousels: horizontal scrollers (the EN rails are wrap grids
   capped at ~10; genre rows here run to ~24, so they scroll sideways). */
.rail-scroller {
  display: flex;
  gap: 0.9rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.15rem 0.1rem 0.7rem;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgb(248 198 93 / 0.5) transparent;
  -webkit-overflow-scrolling: touch;
}

.rail-scroller::-webkit-scrollbar {
  height: 8px;
}

.rail-scroller::-webkit-scrollbar-thumb {
  background: rgb(255 255 255 / 0.14);
  border-radius: 9px;
}

.rail-scroller > .rail-poster {
  flex: 0 0 clamp(8rem, 38vw, 10.5rem);
  scroll-snap-align: start;
}

@media (min-width: 768px) {
  .rail-scroller > .rail-poster {
    flex-basis: clamp(9.5rem, 18vw, 11.5rem);
  }
}

/* First-launch source picker (EN / FR). Fullscreen, remote-navigable. */
.source-picker {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 6vw;
  background: radial-gradient(circle at 18% 0%, rgba(248, 198, 93, 0.16), transparent 40%),
    radial-gradient(circle at 85% 10%, rgba(210, 73, 64, 0.14), transparent 38%), #0f0d0b;
}

.source-picker-card {
  width: min(720px, 100%);
  text-align: center;
}

.source-picker-logo {
  height: 3.6rem;
  width: auto;
  margin-bottom: 1rem;
}

.source-picker-card h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0 0 0.5rem;
}

.source-picker-card p {
  color: #a99e90;
  font-size: 1.02rem;
  margin: 0 0 2rem;
}

.source-picker-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
  max-width: 560px;
  margin: 0 auto;
}

.source-option {
  display: grid;
  gap: 0.35rem;
  justify-items: center;
  padding: 1.6rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgb(255 255 255 / 0.14);
  background: rgb(255 255 255 / 0.05);
  color: #f6f3ee;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.source-option .flag {
  font-size: 2.4rem;
  line-height: 1;
}

.source-option strong {
  font-size: 1.25rem;
  font-weight: 900;
}

.source-option small {
  color: #a99e90;
  font-size: 0.85rem;
  font-weight: 700;
}

.source-option:hover,
.source-option:focus,
.source-option:focus-visible {
  outline: none;
  transform: translateY(-2px);
  border-color: rgb(248 198 93 / 0.8);
  background: rgb(248 198 93 / 0.12);
  box-shadow: 0 0 0 4px rgb(248 198 93 / 0.22), 0 18px 44px rgb(0 0 0 / 0.4);
}

@media (max-width: 480px) {
  .source-picker-options {
    grid-template-columns: 1fr;
  }
}

.rails-loading {
  padding: 2.5rem 0.2rem;
  color: rgb(168 162 158);
  font-weight: 700;
}

/* Refresh button in the header (force a full re-scrape). */
.header-refresh {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 0.14);
  background: rgb(255 255 255 / 0.06);
  color: rgb(214 208 201);
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}
.header-refresh:hover {
  color: white;
  background: rgb(255 255 255 / 0.1);
}
.header-refresh:active i {
  transform: rotate(180deg);
  transition: transform 300ms ease;
}

/* EN | FR language pill in the header. */
.lang-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 0.15rem;
  padding: 0.2rem;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 0.14);
  background: rgb(255 255 255 / 0.06);
}

.lang-option {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.34rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: rgb(214 208 201);
  background: transparent;
  transition: background-color 150ms ease, color 150ms ease;
}

.lang-option:hover {
  color: white;
}

.lang-option.active {
  color: rgb(28 25 23);
  background: rgb(248 198 93);
}

.rail-poster {
  display: block;
  min-width: 0;
  border: 0;
  background: transparent;
  color: white;
  text-align: left;
  text-decoration: none;
}

.rail-poster:hover {
  color: white;
  text-decoration: none;
}

.rail-art {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  border-radius: 0.65rem;
  border: 1px solid rgb(255 255 255 / 0.1);
  background: rgb(33 25 21);
  box-shadow: 0 18px 42px rgb(0 0 0 / 0.28);
}

.rail-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 180ms ease, transform 180ms ease;
}

.rail-poster:hover .rail-art img {
  filter: brightness(1.08);
  transform: scale(1.04);
}

.rail-art .rail-badge {
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  z-index: 2;
  border-radius: 0.4rem;
  background: rgb(248 198 93);
  padding: 0.24rem 0.4rem;
  color: rgb(28 25 23);
  font-size: 0.72rem;
  font-weight: 950;
  box-shadow: 0 0 24px rgb(0 0 0 / 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.rail-art::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgb(0 0 0 / 0.45);
  opacity: 0;
  transition: opacity 180ms ease;
}

.rail-poster:hover .rail-art::after {
  opacity: 1;
}

.rail-play {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: auto;
  display: grid;
  width: 3.25rem;
  height: 3.25rem;
  place-items: center;
  border-radius: 999px;
  background: rgb(248 198 93);
  color: rgb(28 25 23);
  opacity: 0;
  transform: scale(0.82);
  box-shadow: 0 12px 30px rgb(0 0 0 / 0.55);
  transition: opacity 180ms ease, transform 180ms ease;
}

.rail-play svg {
  width: 1.4rem;
  height: 1.4rem;
}

.rail-poster:hover .rail-play {
  opacity: 1;
  transform: scale(1);
}

.rail-poster strong,
.rail-poster small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-poster strong {
  margin-top: 0.7rem;
  font-weight: 950;
}

.rail-poster small {
  margin-top: 0.18rem;
  color: rgb(168 162 158);
  font-size: 0.82rem;
  font-weight: 700;
}

.rail-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.22rem;
}

.rail-meta small {
  margin-top: 0;
  min-width: 0;
}

.rail-type {
  flex: 0 0 auto;
  border: 1px solid rgb(255 255 255 / 0.22);
  border-radius: 0.3rem;
  padding: 0.04rem 0.34rem;
  color: rgb(214 211 209);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.modal-close {
  position: absolute;
  right: 0.75rem;
  top: 0.75rem;
  z-index: 2;
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border-radius: 0.5rem;
  border: 1px solid rgb(255 255 255 / 0.1);
  background: rgb(255 255 255 / 0.08);
  color: white;
}

.modal-close:hover {
  border-color: rgb(248 198 93 / 0.45);
  background: rgb(255 255 255 / 0.13);
}

dialog::backdrop {
  background: rgb(0 0 0 / 0.74);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* ---------------------------------------------------------------------------
   TV / remote (D-pad) navigation
   TV browsers move focus with arrow keys instead of a pointer, so make keyboard
   focus clearly visible and mirror the pointer-only hover affordances onto
   :focus. Uses hex colors + :focus (not :focus-visible) for the widest engine
   support. Harmless on desktop.
--------------------------------------------------------------------------- */
a:focus,
button:focus,
input:focus,
[tabindex]:focus {
  outline: 3px solid #f8c65d;
  outline-offset: 2px;
}

/* When spatial navigation scrolls a focused item into view, keep it clear of
   the sticky header (top) and the viewport edges. */
.rail-poster,
#posterGrid a,
.season-tab,
.episode-item,
.server-link,
.carousel-dot,
.primary-action,
.secondary-action,
.segmented-control button {
  scroll-margin-top: 6.5rem;
  scroll-margin-bottom: 2rem;
}

/* Grid poster + rail cards: lift the focus ring onto the artwork and reveal the
   same play/dim treatment as hover so the focused card reads clearly. */
#posterGrid a:focus {
  outline: none;
}

#posterGrid a:focus > span:first-child {
  outline: 3px solid #f8c65d;
  outline-offset: 3px;
}

.rail-poster:focus {
  outline: none;
}

.rail-poster:focus .rail-art {
  outline: 3px solid #f8c65d;
  outline-offset: 3px;
}

.rail-poster:focus .rail-art img {
  filter: brightness(1.08);
  transform: scale(1.04);
}

.rail-poster:focus .rail-art::after {
  opacity: 1;
}

.rail-poster:focus .rail-play {
  opacity: 1;
  transform: scale(1);
}

/* ------------------------------------------------------------------ */
/* TV mode (Android WebView / webOS). Class set by app.js when TV_MODE. */
/* ------------------------------------------------------------------ */

/* backdrop-filter: blur() over scrolling content forces a full-frame repaint
   every frame — the TV box GPU can't keep up, so scrolling stutters. Swap the
   frosted glass for a cheap opaque bar on TV. */
html.tv .site-header.is-solid {
  background: #100e0c;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* Fill the initial view. The TV viewport is ~720px tall (1080p / dpr scale),
   taller than the hero's 35rem floor, which left dead space above the fold and
   made the backdrop read as a floating panel. Stretch it to the full height so
   the cinematic art bleeds edge-to-edge on load. */
html.tv #hero > .relative {
  min-height: 100vh;
}

/* Fit the whole player inside the screen with margin all round so it's fully
   visible (and safe from TV overscan) without scrolling — height-driven 16:9,
   centered. Capped at 60vh so the control bar never lands on the panel edge. */
html.tv .detail-player {
  width: auto;
  height: min(calc(100vh - 13rem), 60vh);
  max-height: none;
  max-width: 100%;
  aspect-ratio: 16 / 9;
}

/* Put the Trending "Movies / TV Shows" toggle in the vertical D-pad path:
   stacked under the heading and left-aligned, directly above its rail. Right-
   aligned it was unreachable — Up from a rail card snapped to the search bar. */
html.tv .section-heading {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
}

/* Show the tile is selected so the user knows to press OK to take control. */
html.tv .detail-player:focus,
html.tv .detail-player:focus-visible {
  outline: 3px solid #f8c65d;
  outline-offset: 4px;
}

/* In player mode the fullscreen video must cover everything — the sticky header
   otherwise paints over the top of it from a higher stacking context. */
html.player-focus .site-header {
  display: none;
}

/* Player mode: blow the player up to fill the whole screen for immersive,
   conflict-free remote control of the embedded video. */
html.tv .detail-player.player-immersive {
  position: fixed;
  inset: 0;
  z-index: 60;
  width: 100vw;
  height: 100vh;
  max-width: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  aspect-ratio: auto;
  box-shadow: none;
}

/* Tiny reminder banner while in player mode. */
.player-hint {
  position: fixed;
  z-index: 61;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.78);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  border: 1px solid rgb(255 255 255 / 0.22);
  pointer-events: none;
}
.player-hint[hidden] {
  display: none;
}

/* ================================================================== */
/* Dedicated 10-foot TV interface (built by app.js initTV under ?tv=1). */
/* Purpose-built for a D-pad remote — not the adapted web layout above.  */
/* ================================================================== */
#tvApp {
  --pad: 3.75rem;
  position: relative;
  z-index: 2;
  min-height: 100vh;
  color: var(--tv-text, #f6f3ee);
}
#tvApp {
  --tv-bg: #0f0d0b;
  --tv-surface: #1b1611;
  --tv-surface-2: #241d16;
  --tv-gold: #f8c65d;
  --tv-ember: #d24940;
  --tv-text: #f6f3ee;
  --tv-muted: #a99e90;
  --tv-line: rgba(255, 255, 255, 0.10);
  --tv-line-2: rgba(255, 255, 255, 0.18);
}

/* Global focus ring for every focusable in the TV UI. */
#tvApp :focus {
  outline: none;
}
#tvApp .tv-focusable:focus,
#tvApp .tv-focusable:focus-visible {
  outline: 3px solid var(--tv-gold);
  outline-offset: 3px;
}

/* Cards: ring the poster artwork only (not the title/meta text below), matching
   the poster's rounded corners — a full-card ring looked awkward. */
#tvApp .tv-card:focus,
#tvApp .tv-card:focus-visible {
  outline: none;
}
#tvApp .tv-card:focus .tv-poster,
#tvApp .tv-card:focus-visible .tv-poster {
  outline: 3px solid var(--tv-gold);
  outline-offset: 3px;
}

/* ---- top bar ---- */
.tv-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.6rem var(--pad);
  background: linear-gradient(180deg, rgba(15, 13, 11, 0.9), transparent);
  pointer-events: none;
}
.tv-topbar .tv-logo {
  display: flex;
  align-items: center;
}
.tv-topbar .tv-logo img {
  height: 3.4rem;
  width: auto;
}
.tv-topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.tv-lang-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  height: 3.6rem;
  padding: 0.3rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--tv-line);
  cursor: pointer;
}
.tv-lang-btn span {
  min-width: 3.2rem;
  padding: 0 0.7rem;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 1.35rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.55);
}
.tv-lang-btn span.on {
  background: var(--tv-gold);
  color: #1c1917;
}
.tv-search-btn {
  pointer-events: auto;
  display: grid;
  place-items: center;
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--tv-line);
  color: var(--tv-text);
  cursor: pointer;
}
.tv-search-btn svg {
  width: 1.8rem;
  height: 1.8rem;
}

/* ---- screens ---- */
.tv-screen[hidden] {
  display: none;
}

/* ---- home: hero ---- */
.tv-home {
  display: flex;
  flex-direction: column;
}
.tv-hero {
  position: relative;
  height: 60vh;
  min-height: 24rem;
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 var(--pad) 2rem;
}
.tv-hero-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center 18%;
  background-color: #17110c;
}
.tv-hero-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(15, 13, 11, 0.95), rgba(15, 13, 11, 0.55) 45%, rgba(15, 13, 11, 0.15) 72%),
    linear-gradient(0deg, var(--tv-bg) 1%, rgba(15, 13, 11, 0) 55%);
}
.tv-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 46rem;
}
.tv-eyebrow {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--tv-gold);
}
.tv-hero h1 {
  margin: 0.5rem 0 0;
  font-size: 3.8rem;
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.tv-hero p {
  margin: 0.9rem 0 0;
  font-size: 1.25rem;
  line-height: 1.45;
  color: #ded7cd;
  max-width: 34rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tv-hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}
.tv-dots {
  display: flex;
  gap: 0.55rem;
  margin-top: 1.4rem;
}
.tv-dots i {
  width: 1.5rem;
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  transition: width 200ms ease, background 200ms ease;
}
.tv-dots i.on {
  width: 2.4rem;
  background: var(--tv-gold);
}

.tv-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font: inherit;
  font-weight: 800;
  font-size: 1.2rem;
  padding: 0.85rem 1.6rem;
  border-radius: 0.7rem;
  border: 1px solid var(--tv-line-2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--tv-text);
  cursor: pointer;
}
.tv-btn svg {
  width: 1.4rem;
  height: 1.4rem;
}
.tv-btn.primary {
  background: var(--tv-gold);
  color: #23190b;
  border-color: var(--tv-gold);
}

/* ---- home: rails ---- */
.tv-rails {
  flex: 1;
  padding: 0.5rem 0 3rem;
}
.tv-rail {
  margin-top: 2rem;
  padding: 0 var(--pad);
}
.tv-rail h2 {
  margin: 0 0 0.9rem;
  font-size: 1.7rem;
  font-weight: 850;
  letter-spacing: -0.01em;
}
.tv-row {
  display: flex;
  gap: 1.1rem;
  overflow-x: auto;
  scrollbar-width: none;
  /* room so the focus ring + scale-up aren't clipped at the row edges */
  padding: 0.7rem 0.5rem;
  scroll-padding-inline: 0.5rem;
  scroll-behavior: smooth;
}
.tv-row::-webkit-scrollbar {
  display: none;
}
.tv-card {
  flex: none;
  width: 12.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--tv-text);
  text-align: left;
  cursor: pointer;
}
.tv-poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 0.8rem;
  overflow: hidden;
  border: 1px solid var(--tv-line);
  background: #241d16;
}
.tv-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tv-poster .tv-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 0.35rem;
  background: var(--tv-gold);
  color: #23190b;
}
.tv-card-title {
  margin-top: 0.6rem;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tv-card-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.2rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--tv-muted);
  font-variant-numeric: tabular-nums;
}
.tv-card-meta .star {
  color: var(--tv-gold);
}
.tv-card:focus .tv-poster {
  transform: scale(1.04);
}
.tv-card .tv-poster {
  transition: transform 160ms ease;
}

/* ---- detail (movie) ---- */
.tv-detail {
  position: relative;
  min-height: 100vh;
}
.tv-detail-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center 15%;
}
.tv-detail-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(15, 13, 11, 0.96), rgba(15, 13, 11, 0.6) 55%, rgba(15, 13, 11, 0.3)),
    linear-gradient(0deg, var(--tv-bg), rgba(15, 13, 11, 0) 72%);
}
.tv-detail-inner {
  position: relative;
  z-index: 1;
  padding: 8rem var(--pad) 3rem;
  display: grid;
  grid-template-columns: 16rem 1fr;
  gap: 2.6rem;
}
.tv-detail-poster {
  aspect-ratio: 2 / 3;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--tv-line-2);
  background: #241d16;
}
.tv-detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tv-detail h1 {
  margin: 0;
  font-size: 3.4rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  text-wrap: balance;
}
.tv-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.1rem;
}
.tv-pill {
  font-size: 1rem;
  font-weight: 800;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--tv-line);
  color: #e6ddd2;
}
.tv-pill.hd {
  background: var(--tv-gold);
  color: #23190b;
  border-color: var(--tv-gold);
}
.tv-pill .star {
  color: var(--tv-gold);
}
.tv-desc {
  margin: 1.2rem 0 0;
  font-size: 1.2rem;
  line-height: 1.55;
  color: #cfc7bc;
  max-width: 52rem;
}
.tv-servers {
  margin-top: 2rem;
}
.tv-servers h3 {
  margin: 0 0 1rem;
  font-size: 1.4rem;
  font-weight: 850;
}
.tv-server-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
}
.tv-server {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.3rem;
  border-radius: 0.9rem;
  background: var(--tv-surface);
  border: 1px solid var(--tv-line);
  min-width: 17rem;
  cursor: pointer;
  color: var(--tv-text);
  text-align: left;
}
.tv-server .ic {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.6rem;
  background: rgba(248, 198, 93, 0.14);
  color: var(--tv-gold);
  flex: none;
}
.tv-server .ic svg {
  width: 1.4rem;
  height: 1.4rem;
}
.tv-server .nm b {
  display: block;
  font-size: 1.2rem;
  font-weight: 850;
}
.tv-server .nm span {
  font-size: 0.85rem;
  color: var(--tv-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.tv-server .go {
  margin-left: auto;
  font-size: 1rem;
  font-weight: 800;
  color: var(--tv-gold);
}
.tv-note {
  position: relative;
  z-index: 1;
  margin: 1.4rem 0 0;
  font-size: 1.1rem;
  color: var(--tv-muted);
}

/* ---- series detail: seasons | episodes columns ---- */
.tv-series {
  position: relative;
  z-index: 1;
  padding: 6.5rem var(--pad) 3rem;
}
.tv-series-head h1 {
  margin: 0;
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  text-wrap: balance;
}
.tv-series-desc {
  margin: 0.9rem 0 0;
  font-size: 1.15rem;
  line-height: 1.5;
  color: #cfc7bc;
  max-width: 60rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tv-series-cols {
  display: grid;
  grid-template-columns: 18rem 1fr;
  gap: 2rem;
  margin-top: 1.6rem;
  align-items: start;
}
.tv-col > h3 {
  margin: 0 0 0.9rem;
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--tv-muted);
}
.tv-season-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.tv-season {
  text-align: left;
  padding: 0.9rem 1.1rem;
  border-radius: 0.7rem;
  background: var(--tv-surface);
  border: 1px solid var(--tv-line);
  color: var(--tv-text);
  font: inherit;
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
}
/* "selected" = subtle fill + gold left bar; "focused" = the gold outline ring.
   Keeping them distinct so the ring clearly reads as the cursor. */
.tv-season.on {
  background: var(--tv-surface-2);
  box-shadow: inset 3px 0 0 var(--tv-gold);
}
.tv-episode-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 44vh;
  overflow-y: auto;
  scrollbar-width: none;
  /* room so the focus ring (outline-offset) isn't clipped at the scroll edges */
  padding: 5px 6px;
}
.tv-episode-list::-webkit-scrollbar {
  display: none;
}
.tv-episode {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
  padding: 0.75rem 1rem;
  border-radius: 0.8rem;
  background: var(--tv-surface);
  border: 1px solid var(--tv-line);
  color: var(--tv-text);
  font: inherit;
  cursor: pointer;
}
.tv-episode.on {
  background: var(--tv-surface-2);
  box-shadow: inset 3px 0 0 var(--tv-gold);
}
.tv-ep-n {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--tv-gold);
  min-width: 2.2rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.tv-ep-t {
  font-size: 1.15rem;
  font-weight: 700;
}
.tv-series-servers {
  margin-top: 1.8rem;
}

/* ---- search ---- */
.tv-search {
  padding: 5.5rem var(--pad) 2.5rem;
}
.tv-search-left {
  display: flex;
  flex-direction: column;
}
.tv-search-query {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.8rem;
  margin-bottom: 1.6rem;
  font-size: 2rem;
  font-weight: 800;
}
.tv-search-query .q:empty::before {
  content: "Search titles";
  color: var(--tv-muted);
  font-weight: 700;
}
.tv-search-query .caret {
  width: 3px;
  height: 2rem;
  background: var(--tv-gold);
  animation: tvBlink 1s steps(2) infinite;
}
@keyframes tvBlink {
  50% { opacity: 0; }
}
.tv-search-grid {
  display: grid;
  grid-template-columns: 29rem 1fr;
  gap: 3rem;
  align-items: start;
}
.tv-kbd {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.tv-kbd-row {
  display: flex;
  gap: 0.5rem;
}
.tv-key {
  flex: 1;
  min-width: 0;
  height: 3rem;
  display: grid;
  place-items: center;
  border-radius: 0.55rem;
  border: 1px solid var(--tv-line);
  background: var(--tv-surface);
  color: var(--tv-text);
  font: inherit;
  font-size: 1.25rem;
  font-weight: 800;
  cursor: pointer;
}
.tv-key-space { flex: 5; }
.tv-key-del { flex: 2; }
.tv-key-clear { flex: 2; }
.tv-results-head {
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--tv-muted);
  margin-bottom: 1rem;
}
.tv-results {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.4rem 1.1rem;
  max-height: 74vh;
  overflow-y: auto;
  scrollbar-width: none;
  /* symmetric room so the focus ring + scale-up aren't clipped on any edge */
  padding: 10px 12px;
}
.tv-results::-webkit-scrollbar {
  display: none;
}
/* result cards fill their grid cell rather than the fixed rail width */
.tv-results .tv-card {
  width: auto;
}
.tv-result {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0.85rem;
  border-radius: 0.8rem;
  background: var(--tv-surface);
  border: 1px solid var(--tv-line);
  color: var(--tv-text);
  text-align: left;
  cursor: pointer;
}
.tv-result-art {
  width: 3.4rem;
  aspect-ratio: 2 / 3;
  border-radius: 0.4rem;
  overflow: hidden;
  flex: none;
  background: #241d16;
}
.tv-result-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tv-result-info b {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
}
.tv-result-info span {
  font-size: 0.95rem;
  color: var(--tv-muted);
  font-weight: 700;
}

/* ---- fullscreen player ---- */
.tv-player {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #000;
}
.tv-player-frame {
  position: absolute;
  inset: 0;
}
.tv-player-frame iframe,
.tv-player-frame video {
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}
.tv-player-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 0.8rem;
  text-align: center;
  color: var(--tv-muted);
  font-size: 1.2rem;
  font-weight: 700;
}
.tv-player-hint {
  position: absolute;
  top: 1.6rem;
  right: 2rem;
  z-index: 2;
  font-size: 1.05rem;
  font-weight: 800;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid var(--tv-line-2);
  color: #fff;
  opacity: 0;
  transition: opacity 160ms ease;
}
.tv-player-hint.show {
  opacity: 1;
}

/* Remote-driven controls for the native <video>. */
.tv-vctl {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 4rem 3rem 2rem;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.85));
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
  z-index: 5;
}
.tv-vctl.show {
  opacity: 1;
}
.tv-vctl-row {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}
.tv-vctl-state {
  min-width: 2rem;
  font-size: 1.6rem;
  line-height: 1;
  text-align: center;
}
.tv-vctl-bar {
  flex: 1;
  height: 0.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  overflow: hidden;
}
.tv-vctl-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--tv-gold);
}
.tv-vctl-time {
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  color: #ddd;
  white-space: nowrap;
}

/* Virtual cursor for cross-origin embeds: arrows move it, OK "clicks". */
.tv-cursor {
  position: absolute;
  width: 2.4rem;
  height: 2.4rem;
  margin: -1.2rem 0 0 -1.2rem;
  border: 3px solid #fff;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.55), 0 2px 10px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 150ms ease, left 90ms linear, top 90ms linear;
  pointer-events: none;
  z-index: 6;
}
.tv-cursor::after {
  content: "";
  position: absolute;
  inset: 35%;
  border-radius: 50%;
  background: var(--tv-gold);
}
.tv-cursor.show {
  opacity: 1;
}
.tv-cursor.tap {
  animation: tvCursorTap 260ms ease;
}
@keyframes tvCursorTap {
  0% { transform: scale(1); }
  40% { transform: scale(0.72); }
  100% { transform: scale(1); }
}

/* One-shot hint shown when an embed starts. */
.tv-ctl-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: rgba(12, 12, 16, 0.85);
  color: #eee;
  font-size: 0.95rem;
  opacity: 0;
  transition: opacity 200ms ease;
  pointer-events: none;
  z-index: 6;
}
.tv-ctl-hint.show {
  opacity: 1;
}

/* Toast on home: "press Back again to exit". */
.tv-exit-hint {
  position: fixed;
  bottom: 2.4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  background: rgba(12, 12, 16, 0.88);
  border: 1px solid var(--tv-line-2);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  opacity: 0;
  transition: opacity 160ms ease;
  pointer-events: none;
}
.tv-exit-hint.show {
  opacity: 1;
}
