/* ==========================================================================
 * Lecteur video et page de visionnage
 *
 * Partiel de style.css. Charge dans l'ordre numerique par les templates :
 * l'ordre est significatif, ne pas permuter les <link>.
 * ========================================================================== */

/* Page lecteur / watch */

.watch-body {
  background: var(--bg);
}

.watch-page {
  min-height: calc(100vh - 60px);
}

.watch-body .site-footer {
  margin-top: 0;
}

.watch-player-wrap {
  background: #000;
  width: 100%;
  animation: watchFadeUp 0.55s ease both;
}

.watch-player-wrap--theater .watch-content {
  display: none;
}

.watch-player-wrap--theater .watch-player-stage {
  max-height: calc(100vh - 120px);
}

.watch-player-fs-root {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  background: #000;
}

.watch-player-stage {
  position: relative;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  max-height: 72vh;
  background: #000;
  overflow: hidden;
}

.watch-player-stage:fullscreen,
.watch-player-stage:-webkit-full-screen {
  max-height: none;
  max-width: none;
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  transform: none !important;
  isolation: auto !important;
  border-radius: 0 !important;
}

/* Plein écran CSS (Free TV) — sélecteurs forts pour battre .watch-player-modal .stage */
.watch-player-stage.watch-player-stage--immersive,
.watch-player-modal .watch-player-stage.watch-player-stage--immersive,
body > .watch-player-stage.watch-player-stage--immersive {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  z-index: var(--z-immersive) !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  aspect-ratio: auto !important;
  flex: none !important;
  border-radius: 0 !important;
  background: #000 !important;
  overflow: hidden !important;
  transform: none !important;
  isolation: auto !important;
}

.watch-player-fs-root:fullscreen,
.watch-player-fs-root:-webkit-full-screen,
.watch-player-fs-root.watch-player-fs-root--immersive,
body > .watch-player-fs-root.watch-player-fs-root--immersive {
  position: fixed !important;
  inset: 0 !important;
  z-index: var(--z-immersive) !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: none !important;
  margin: 0 !important;
  background: #000 !important;
}

.watch-player-fs-root:fullscreen .watch-player-stage,
.watch-player-fs-root:-webkit-full-screen .watch-player-stage,
.watch-player-fs-root--immersive .watch-player-stage {
  flex: 1 1 auto !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

.watch-player-fs-root:fullscreen .watch-episodes,
.watch-player-fs-root:-webkit-full-screen .watch-episodes,
.watch-player-fs-root--immersive .watch-episodes,
html.ps-is-series .watch-player-fs-root:fullscreen .watch-episodes,
html.ps-is-series .watch-player-fs-root:-webkit-full-screen .watch-episodes,
html.ps-is-series .watch-player-fs-root--immersive .watch-episodes {
  display: none !important;
}

html:not(.ps-is-series) #episodes-section,
html:not(.ps-is-series) .ps-player-next {
  display: none !important;
}

html.ps-immersive-fs,
html.ps-immersive-fs body {
  overflow: hidden !important;
}

.watch-player-stage:fullscreen .main-video,
.watch-player-stage:-webkit-full-screen .main-video,
.watch-player-stage.watch-player-stage--immersive .main-video,
body > .watch-player-stage.watch-player-stage--immersive .main-video {
  position: absolute !important;
  inset: 0 !important;
  transform: none !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  z-index: 0;
  background: #000;
}

.watch-player-stage:fullscreen .ps-player-ui,
.watch-player-stage:-webkit-full-screen .ps-player-ui,
.watch-player-stage.watch-player-stage--immersive .ps-player-ui,
body > .watch-player-stage.watch-player-stage--immersive .ps-player-ui {
  position: absolute !important;
  inset: 0 !important;
  z-index: 2;
}

.watch-player-stage:fullscreen .ps-player-captions,
.watch-player-stage:-webkit-full-screen .ps-player-captions,
.watch-player-stage--immersive .ps-player-captions {
  bottom: 9%;
  left: 0;
  right: 0;
  width: min(88%, 1100px);
  margin: 0 auto;
  transform: none; /* pas de translateX : moins de composite */
  gap: 0.3rem;
}

.watch-player-stage:fullscreen .ps-caption-line,
.watch-player-stage:-webkit-full-screen .ps-caption-line,
.watch-player-stage--immersive .ps-caption-line {
  padding: 0.15rem 0.35rem;
  border-radius: 0;
  /* Plus petit qu'avant : gros texte FS tuait le GPU Freebox */
  font-size: clamp(1.15rem, 2.4vw, 1.85rem);
  line-height: 1.3;
  background: transparent;
  text-shadow:
    0 0 2px #000,
    0 1px 2px #000,
    0 0 8px rgba(0, 0, 0, 0.9),
    1px 1px 0 #000,
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000;
}

.watch-player-stage:fullscreen .ps-player-next,
.watch-player-stage:-webkit-full-screen .ps-player-next,
.watch-player-stage--immersive .ps-player-next {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.watch-player-stage .main-video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

.main-video::cue {
  opacity: 0;
}

.main-video::-webkit-media-controls,
.main-video::-webkit-media-controls-enclosure {
  display: none !important;
}

.watch-player-stage .ps-player-captions,
.ps-player-captions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12%;
  margin: 0 auto;
  transform: none;
  width: min(92%, 960px);
  z-index: 6;
  pointer-events: none;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
}

.ps-player-captions.hidden {
  display: none !important;
}

.ps-caption-line {
  display: inline-block;
  max-width: 100%;
  padding: 0.1rem 0.25rem;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: clamp(1rem, 2.3vw, 1.35rem);
  font-weight: 650;
  line-height: 1.35;
  text-shadow:
    0 0 2px #000,
    0 1px 2px #000,
    0 0 8px rgba(0, 0, 0, 0.9),
    1px 1px 0 #000,
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000;
  white-space: pre-wrap;
}

.ps-player-ui {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: var(--text);
  z-index: 2;
  transition: opacity var(--dur-slow) ease;
  pointer-events: none;
}

.ps-player-controls,
.ps-player-big-play,
.ps-player-next,
.ps-player-loader,
.ps-player-episodes {
  pointer-events: auto;
}

.ps-player-top-gradient {
  pointer-events: none;
}

.watch-player-stage,
.watch-player-stage .main-video,
.watch-player-stage .ps-player-ui {
  /* Le pointeur reste disponible même lorsque les contrôles se masquent. */
  cursor: default;
}

.ps-player-ui--idle:not(:hover) .ps-player-controls,
.ps-player-ui--idle:not(:hover) .ps-player-top-gradient {
  opacity: 0;
  pointer-events: none;
}

.ps-player-top-gradient {
  position: absolute;
  inset: 0 0 auto;
  height: 35%;
  background: linear-gradient(180deg, rgba(18, 17, 24, 0.55), transparent);
  pointer-events: none;
}

.ps-player-controls {
  position: relative;
  padding: 0.35rem 0.85rem 0.75rem;
  background: linear-gradient(0deg, rgba(18, 17, 24, 0.96) 0%, rgba(18, 17, 24, 0.72) 55%, transparent 100%);
  transition: opacity var(--dur-slow) ease;
}

.ps-player-episodes {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  width: min(22rem, 92vw);
  padding: 1rem 0.9rem 5.75rem;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(18, 17, 24, 0.72), rgba(10, 10, 14, 0.94)),
    rgba(12, 11, 16, 0.88);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  transform: translateX(104%);
  transition: transform 0.22s ease;
}

.ps-player-episodes.is-open {
  transform: none;
}

.ps-player-episodes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.ps-player-episodes-head strong {
  font-size: 0.95rem;
}

.ps-player-season-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.ps-player-season-tabs .season-tab {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
}

.ps-player-episode-list {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0.4rem;
}

.ps-player-episode-list .episode-btn {
  width: 100%;
  min-width: 0;
  max-width: none;
  min-height: 0;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  padding: 0.7rem 0.8rem;
  animation: none;
}

.ps-player-episode-list .episode-btn-title {
  flex: 1 1 100%;
}

.ps-player-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 17, 24, 0.35);
  z-index: 3;
}

.ps-player-spinner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid rgba(232, 195, 154, 0.18);
  border-top-color: var(--accent);
  animation: ps-spin 0.85s linear infinite;
}

@keyframes ps-spin {
  to { transform: rotate(360deg); }
}

.ps-player-big-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 76px;
  height: 76px;
  border: none;
  border-radius: 50%;
  background: rgba(18, 17, 24, 0.72);
  color: var(--accent);
  box-shadow: 0 0 0 1px rgba(232, 195, 154, 0.35), 0 12px 40px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  z-index: 2;
  transition: transform var(--dur-fast) ease, background var(--dur-fast) ease;
}

.ps-player-big-play:hover {
  transform: translate(-50%, -50%) scale(1.05);
  background: rgba(26, 24, 37, 0.88);
}

.ps-player-big-play svg {
  width: 34px;
  height: 34px;
  margin-left: 4px;
}

.ps-player-next {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-6);
  background: rgba(18, 17, 24, 0.82);
  backdrop-filter: blur(8px);
  z-index: 4;
  text-align: center;
}

.ps-player-next--early {
  inset: auto 1rem 4.5rem auto;
  width: min(340px, calc(100% - 2rem));
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  padding: 0.9rem 1rem;
  gap: 0.45rem;
  border-radius: var(--radius-card);
  border: 1px solid rgba(232, 195, 154, 0.22);
  background: rgba(18, 17, 24, 0.92);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  animation: psAppear 0.28s ease both;
}

.ps-player-next--early .ps-player-next-title {
  font-size: 0.72rem;
}

.ps-player-next--early .ps-player-next-label {
  font-size: 0.98rem;
  max-width: none;
}

.ps-player-next--early .ps-player-next-actions {
  justify-content: flex-start;
  width: 100%;
}

.ps-player-next--early .ps-player-next-countdown {
  font-size: 0.78rem;
}

.ps-player-next-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.ps-player-next-label {
  font-size: 1.15rem;
  font-weight: 700;
  max-width: 520px;
}

.ps-player-next-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
}

.ps-player-next-countdown {
  font-size: 0.85rem;
  color: var(--muted);
}

@media (max-width: 768px) {
  .ps-player-next--early {
    inset: auto 0.65rem 3.8rem 0.65rem;
    width: auto;
  }
}

.ps-player-progress-wrap {
  position: relative;
  padding: 0.65rem 0 0.45rem;
}

.ps-player-progress-track {
  position: relative;
  height: 5px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.ps-player-progress-buffer,
.ps-player-progress-played {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  border-radius: inherit;
  width: 0;
}

.ps-player-progress-buffer {
  background: rgba(255, 255, 255, 0.22);
}

.ps-player-progress-played {
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
  box-shadow: 0 0 12px var(--accent-glow);
}

.ps-player-seek {
  position: absolute;
  inset: 0.35rem 0 0;
  width: 100%;
  height: 18px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.ps-player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.ps-player-left,
.ps-player-right {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.ps-player-lang-versions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-right: 0.15rem;
}

.ps-player-lang-versions.hidden {
  display: none;
}

.ps-player-lang-btn {
  border: 1px solid rgba(232, 195, 154, 0.28);
  background: rgba(18, 17, 24, 0.55);
  color: var(--muted);
  border-radius: var(--radius-sm);
  padding: 0.28rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}

.ps-player-lang-btn:hover {
  color: var(--text);
  border-color: rgba(232, 195, 154, 0.55);
}

.ps-player-lang-btn.is-active {
  color: var(--ink);
  background: var(--accent);
  border-color: var(--accent);
}

.ps-player-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border: none;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
}

.ps-player-btn:hover {
  background: rgba(232, 195, 154, 0.12);
  color: var(--accent-hover);
}

.ps-player-btn.is-active {
  color: var(--accent);
  background: rgba(232, 195, 154, 0.16);
}

.ps-player-btn.is-dimmed:not(.is-active) {
  opacity: 0.72;
}

.ps-player-btn svg {
  width: 1.15rem;
  height: 1.15rem;
}

.ps-player-episodes-btn {
  width: auto;
  min-width: 2.2rem;
  height: auto;
  min-height: 2.2rem;
  padding: 0.2rem 0.65rem 0.2rem 0.45rem;
  gap: 0.4rem;
  background: rgba(232, 195, 154, 0.12);
  border: 1px solid rgba(232, 195, 154, 0.28);
}

.ps-player-episodes-btn-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.ps-player-episodes-btn-label {
  font-size: 0.78rem;
  font-weight: 700;
}

.ps-player-episodes-btn-now {
  font-size: 0.68rem;
  color: var(--accent);
  font-weight: 600;
}

.ps-player-episodes-hint {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
}

.ps-player-volume-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.ps-player-volume {
  width: 72px;
  accent-color: var(--accent);
  cursor: pointer;
}

.ps-player-time {
  font-size: 0.78rem;
  color: rgba(245, 245, 247, 0.88);
  min-width: 92px;
  font-variant-numeric: tabular-nums;
}

.ps-player-select {
  background: rgba(26, 24, 37, 0.92);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.55rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.ps-player-select:focus:not(:focus-visible) {
  outline: none;
}

.ps-player-select:focus {
  border-color: var(--accent);
}

.ps-player-playing .ps-player-big-play {
  opacity: 0;
  pointer-events: none;
}

.watch-player-info {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
  border-bottom: 1px solid var(--border);
}

.watch-now-playing {
  font-weight: 600;
  font-size: 0.9rem;
  flex: 1;
  min-width: 12rem;
}

.watch-lang-versions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.watch-lang-versions.hidden {
  display: none !important;
}

.watch-lang-versions .ps-player-lang-btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-pill);
}

.watch-subtitles-select {
  min-width: 9rem;
}

.watch-status {
  font-size: 0.8rem;
  color: var(--muted);
}

.watch-content {
  position: relative;
  z-index: 2;
  padding-top: 4.5rem;
  padding-bottom: var(--space-12);
}

.watch-hero {
  position: relative;
  min-height: clamp(360px, 62vh, 640px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
  margin-bottom: -2.5rem;
  animation: watchFadeUp 0.55s ease both;
}

.watch-hero-bg,
.watch-hero-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.watch-hero-bg {
  top: -12%;
  bottom: -18%;
  height: auto;
  background-color: var(--surface);
  background-image: var(--watch-poster);
  background-size: cover;
  background-position: center 20%;
  transform: translate3d(0, 0, 0) scale(1.08);
  will-change: transform;
  filter: saturate(1.08) brightness(1.04) contrast(1.02);
  z-index: 0;
  image-rendering: auto;
  /* Fondu doux vers le bas (évite la coupure nette) */
  -webkit-mask-image: linear-gradient(
    180deg,
    #000 0%,
    #000 48%,
    rgba(0, 0, 0, 0.65) 72%,
    rgba(0, 0, 0, 0.2) 88%,
    transparent 100%
  );
  mask-image: linear-gradient(
    180deg,
    #000 0%,
    #000 48%,
    rgba(0, 0, 0, 0.65) 72%,
    rgba(0, 0, 0, 0.2) 88%,
    transparent 100%
  );
}

.watch-hero-bg::after {
  content: "";
  position: absolute;
  inset: -6%;
  background-image: var(--watch-poster);
  background-size: cover;
  background-position: center 20%;
  filter: blur(18px) saturate(1.1) brightness(0.9);
  opacity: 0.28;
  z-index: -1;
}

.watch-hero-shade {
  z-index: 1;
  background:
    linear-gradient(
      180deg,
      rgba(18, 17, 24, 0.18) 0%,
      rgba(18, 17, 24, 0.08) 28%,
      rgba(18, 17, 24, 0.35) 58%,
      rgba(18, 17, 24, 0.78) 82%,
      var(--bg) 100%
    ),
    linear-gradient(
      90deg,
      rgba(18, 17, 24, 0.72) 0%,
      rgba(18, 17, 24, 0.38) 38%,
      rgba(18, 17, 24, 0.08) 70%,
      rgba(18, 17, 24, 0.18) 100%
    );
}

.watch-hero--empty .watch-hero-bg {
  background:
    radial-gradient(circle at 30% 20%, rgba(232, 195, 154, 0.16), transparent 50%),
    var(--surface);
}

.watch-hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  padding-top: 4.5rem;
  padding-bottom: 3.25rem;
}

.watch-hero .watch-header-text {
  max-width: 640px;
}

.watch-hero .watch-title {
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

.watch-hero .watch-type,
.watch-hero .detail-tags .tag,
.watch-hero .rating-badge {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.watch-hero .rating-badge,
.watch-hero .detail-tags .tag {
  background: rgba(18, 17, 24, 0.45);
  border-color: var(--glass-border-soft);
}

.watch-trailer.watch-appear,
#episodes-section.watch-appear,
#related-sections.watch-appear {
  animation: watchFadeUp 0.55s ease both;
}

.watch-trailer.watch-appear {
  animation-delay: 0.1s;
}

#episodes-section.watch-appear {
  animation-delay: 0.14s;
}

#related-sections.watch-appear {
  animation-delay: 0.2s;
}

.watch-trailer[hidden] {
  display: none !important;
}

.trailer-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--backdrop-player);
  border: 1px solid var(--border);
}

.trailer-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.watch-related[hidden] {
  display: none;
}

.watch-related .ps-rail-section {
  margin-top: var(--space-3);
}

.watch-player-modal {
  z-index: var(--z-overlay);
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}

.watch-player-modal.hidden,
.watch-player-modal[hidden] {
  display: none !important;
}

.watch-player-modal .modal-backdrop {
  background: rgba(0, 0, 0, 0.92);
}

.watch-player-modal-content {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  min-height: 100dvh;
  min-height: 100vh;
  padding: 0;
  margin: 0;
  overflow: auto;
  border-radius: 0;
  border: none;
  box-shadow: none;
  background: var(--backdrop-deep);
  display: flex;
  flex-direction: column;
}

.watch-player-modal .watch-modal-close {
  top: max(0.75rem, env(safe-area-inset-top, 0px));
  right: max(0.75rem, env(safe-area-inset-right, 0px));
  z-index: 30;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--glass-border-soft);
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
}

.watch-player-modal .watch-player-wrap {
  background: #000;
  animation: none;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.watch-player-modal .watch-player-stage {
  position: relative;
  z-index: 1;
  max-width: none;
  width: 100%;
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
  max-height: min(52vh, 560px);
  aspect-ratio: 16 / 9;
  border-radius: 0;
  outline: none;
  background: #000;
  overflow: hidden;
  isolation: isolate;
}

.watch-player-modal .watch-player-stage .main-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.watch-player-modal .watch-player-stage .ps-player-ui {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
}

.watch-player-modal .watch-player-info {
  padding: 0.75rem 1.5rem 0.5rem;
  flex-shrink: 0;
  background: var(--backdrop-deep);
  position: relative;
  z-index: 2;
}

.watch-player-modal .watch-episodes {
  margin-top: 0;
  padding: 1rem 1.5rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  flex: 1 1 auto;
  min-height: min(42vh, 420px);
  overflow: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--backdrop-deep);
  position: relative;
  z-index: 3;
}

.watch-player-modal .season-tabs {
  gap: 0.65rem;
  margin-bottom: 1.15rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 0.35rem;
}

.watch-player-modal .season-tab {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0.7rem 1.35rem;
  font-size: 0.98rem;
}

.watch-player-modal .episode-list {
  gap: 0.85rem;
}

.watch-player-modal .episode-btn {
  min-width: 180px;
  max-width: 260px;
  min-height: 92px;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-card);
  gap: 0.35rem;
}

.watch-player-modal .episode-btn-num {
  font-size: 1rem;
}

.watch-player-modal .episode-btn-title {
  font-size: 0.88rem;
}

.watch-player-modal--theater .watch-player-modal-content,
.watch-player-modal.watch-player-modal--theater .watch-player-modal-content {
  width: 100%;
  max-width: none;
  max-height: none;
}

.watch-player-modal--theater .ps-caption-line,
.watch-player-wrap--theater .ps-caption-line {
  font-size: clamp(1.2rem, 2.4vw, 1.75rem);
}

.watch-player-modal--theater .watch-player-stage,
.watch-player-modal.watch-player-modal--theater .watch-player-stage {
  max-height: min(62vh, 720px);
}

html.watch-modal-open,
body.watch-modal-open {
  overflow: hidden;
}

.watch-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-8);
  margin-bottom: var(--space-10);
  align-items: start;
}

.watch-synopsis-block {
  margin: 0.5rem 0 2.25rem;
  max-width: 820px;
  animation: watchFadeUp 0.55s ease both;
  animation-delay: 0.12s;
}

.watch-synopsis-block .watch-overview {
  max-width: none;
  font-size: 1rem;
  line-height: 1.75;
  color: rgba(245, 245, 247, 0.88);
}

.watch-trailer {
  margin: 0 0 2.25rem;
}

.watch-trailer.watch-appear {
  display: block;
}

.watch-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin: 1rem 0 1.15rem;
}

#watch-play-btn {
  min-width: 10.5rem;
}

#watch-play-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

#watch-play-btn.is-watching {
  background: var(--surface2);
  color: var(--text);
  box-shadow: none;
}

#watch-play-btn.is-watching::before {
  content: "●";
  font-size: 0.65em;
}

#favorite-btn.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.reaction-btn {
  min-width: 7.5rem;
}

#like-btn.is-active {
  border-color: var(--success-border);
  color: var(--success-strong);
  background: rgba(58, 172, 100, 0.16);
}

#dislike-btn.is-active {
  border-color: var(--danger-border);
  color: var(--danger-soft);
  background: rgba(191, 69, 69, 0.16);
}

.reaction-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.list-picker {
  width: min(100%, 28rem);
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(12, 10, 18, 0.96);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.36);
}

.list-picker-options {
  display: grid;
  gap: 0.35rem;
  max-height: 15rem;
  overflow: auto;
}

.list-picker-option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.list-picker-option:hover {
  background: rgba(255, 255, 255, 0.06);
}

.list-picker-option input {
  accent-color: var(--accent);
}

.list-picker-option small {
  color: var(--muted);
}

.list-picker-create {
  display: flex;
  gap: var(--space-2);
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border);
}

.list-picker-create input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--text);
}

.list-picker-status {
  margin: 0.55rem 0 0;
  color: var(--success-strong);
  font-size: 0.82rem;
}

.list-picker-status.is-error {
  color: var(--danger-soft);
}

.profile-list-create {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 1.15rem;
}

.profile-list-create input {
  flex: 1;
  min-width: 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface2);
  color: var(--text);
}

.profile-lists {
  display: grid;
  gap: 1.3rem;
}

.profile-list {
  min-width: 0;
  padding-top: 0.2rem;
}

.profile-list + .profile-list {
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.profile-list-title {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
}

.profile-list .rail {
  padding-bottom: var(--space-1);
}

.profile-list .poster-card.poster-landscape {
  width: clamp(260px, 30vw, 380px);
  height: auto;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.profile-list .poster-card.poster-landscape:hover {
  transform: translateY(-3px);
  box-shadow: none;
  outline: none;
}

.profile-list .poster-card.poster-landscape .poster-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-control);
  background: var(--surface2);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
}

.profile-list .poster-card.poster-landscape .poster-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-list .poster-card.poster-landscape .poster-caption {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.6rem 0.05rem 0;
}

.profile-list .poster-card.poster-landscape .poster-title {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
}

.profile-list .poster-card.poster-landscape .poster-meta-line {
  color: var(--muted);
  font-size: 0.78rem;
}

.user-rating {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin: 0.45rem 0 0.2rem;
}

.user-rating-label {
  margin-right: 0.35rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.rating-star {
  padding: 0.1rem;
  border: 0;
  background: transparent;
  /* Doit rester lisible sur fond sombre : en dessous de ~0.55 l'étoile vide
     devient indiscernable du fond et le widget ne se lit plus comme cliquable. */
  color: rgba(245, 245, 247, 0.55);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  transition: color var(--dur-fast) ease, transform var(--dur-fast) ease;
}

.rating-star:hover,
.rating-star.is-active {
  color: var(--accent);
  transform: scale(1.08);
}

.rating-clear {
  margin-left: 0.45rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
}

.calendar-help {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.calendar-events {
  display: grid;
  gap: 0.55rem;
}

.calendar-event {
  display: grid;
  grid-template-columns: minmax(6rem, 8rem) 1fr;
  gap: 0.85rem;
  align-items: center;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  text-decoration: none;
}

.calendar-event:hover {
  border-color: var(--accent);
  background: rgba(232, 195, 154, 0.08);
}

.calendar-event time {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 650;
}

.calendar-event-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.calendar-event-main small {
  margin-top: 0.2rem;
  color: var(--muted);
}

.filter-number {
  width: 8.5rem;
}

.watch-type {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.watch-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: var(--space-4);
}

.watch-ratings {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.rating-badge.accent {
  color: var(--accent);
  border-color: rgba(232, 195, 154, 0.3);
}

.watch-overview {
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.95rem;
  max-width: 720px;
}

.watch-actors,
.watch-production {
  margin-top: var(--space-3);
  font-size: 0.8rem;
  color: var(--muted);
  max-width: 720px;
  line-height: 1.5;
}

.watch-actors span {
  color: var(--text);
  font-weight: 600;
  margin-right: 0.35rem;
}

.watch-hero .watch-title {
  font-size: clamp(1.85rem, 4.2vw, 3rem);
  margin-bottom: 0.85rem;
}

.watch-episodes[hidden] {
  display: none !important;
}

.watch-episodes {
  margin-top: var(--space-4);
}

.season-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: var(--space-5);
}

.season-tab {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.65rem 1.3rem;
  min-height: 44px;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--dur-base) ease, background var(--dur-base) ease, color var(--dur-base) ease, transform var(--dur-base) ease;
}

.season-tab:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-1px);
}

.season-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
}

.episode-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.episode-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  min-width: 170px;
  max-width: 250px;
  min-height: 88px;
  padding: 0.95rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--dur-base) ease, background var(--dur-base) ease, transform var(--dur-base) ease, box-shadow var(--dur-base) ease;
  animation: watchPopIn var(--dur-slower) ease both;
  animation-delay: var(--appear-delay, 0ms);
}

.episode-btn:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.episode-btn.active {
  background: rgba(232, 195, 154, 0.12);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-glow);
}

.episode-btn.is-unavailable {
  opacity: 0.55;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.episode-btn.is-unavailable:hover {
  transform: none;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.episode-btn.is-unavailable .episode-btn-num {
  color: var(--muted);
}

.episode-btn-num {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
}

.episode-btn-title {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.episode-btn-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: var(--space-1);
}

.source-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.4rem;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
}

.source-badge.best {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.source-badge.premium {
  color: var(--warning);
  border-color: rgba(240, 195, 90, 0.35);
}

.source-badge.dim {
  color: var(--muted);
}

.source-badge.unavailable {
  color: var(--danger);
  border-color: var(--danger-border);
  background: var(--danger-glow);
}

.episode-btn.is-best {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

@keyframes watchFadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes watchPopIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes watchPosterIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .watch-player-wrap,
  .watch-content > .watch-header,
  .watch-trailer.watch-appear,
  #episodes-section.watch-appear,
  #related-sections.watch-appear,
  .watch-poster,
  .episode-btn {
    animation: none !important;
  }
}

.detail-error {
  color: var(--muted);
  text-align: center;
  padding: 4rem 1rem;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
  margin-bottom: var(--space-4);
}

.tag {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-xl);
  font-size: 0.75rem;
  color: var(--muted);
}

.rating-badge {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-xl);
  font-size: 0.8rem;
  color: var(--muted);
}

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--accent);
  background: var(--surface2);
}

.btn-small {
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
}

.badge {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-xl);
  font-size: 0.8rem;
  color: var(--muted);
}


