@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #121118;
  --surface: #1a1825;
  --surface2: #242233;
  --border: rgba(214, 217, 239, 0.08);
  --text: #f5f5f7;
  --muted: #9b97ad;
  --accent: #e8c39a;
  --accent-hover: #f0d4b4;
  --accent-dark: #c9a07a;
  --accent-glow: rgba(232, 195, 154, 0.35);
  --gradient-hero: linear-gradient(0deg, #121118 0%, rgba(18, 17, 24, 0.6) 40%, rgba(18, 17, 24, 0.2) 100%);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-pop: 0 16px 40px rgba(0, 0, 0, 0.55);

  /* Liquid glass (style Apple) sur le thème actuel */
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-bg-strong: rgba(255, 255, 255, 0.1);
  --glass-bg-tint: rgba(26, 24, 37, 0.55);
  --glass-border: rgba(255, 255, 255, 0.16);
  --glass-border-soft: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.38);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 var(--glass-highlight);
  --glass-blur: blur(22px) saturate(180%);
  --glass-radius: 18px;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root {
    --glass-bg: rgba(26, 24, 37, 0.92);
    --glass-bg-strong: rgba(36, 34, 51, 0.95);
    --glass-bg-tint: rgba(26, 24, 37, 0.95);
  }
}

html {
  scrollbar-color: var(--surface2) var(--bg);
}

body {
  font-family: "Inter", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(232, 195, 154, 0.14), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(201, 160, 122, 0.08), transparent 50%),
    radial-gradient(800px 480px at 50% 100%, rgba(232, 195, 154, 0.06), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.glass-panel {
  background: var(--glass-bg-tint);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border-soft);
  box-shadow: var(--glass-shadow);
}

.hidden {
  display: none !important;
}

::selection {
  background: var(--accent);
  color: #121118;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--surface2);
  border-radius: 999px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: #2f2c42;
}

/* Navbar Véluma Stream */

.ps-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.85rem 1.25rem;
  padding-top: max(0.85rem, env(safe-area-inset-top, 0px));
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08),
    rgba(18, 17, 24, 0.55) 40%,
    rgba(18, 17, 24, 0.72)
  );
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border-soft);
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.ps-logo {
  font-size: 1.35rem;
  font-weight: 800;
  background-image: linear-gradient(
    120deg,
    var(--accent-dark) 0%,
    var(--accent) 28%,
    var(--accent-hover) 50%,
    var(--accent) 72%,
    var(--accent-dark) 100%
  );
  background-size: 220% 100%;
  background-position: 0% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-decoration: none;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  transition: filter 0.2s;
  animation: ps-logo-sheen 7s ease-in-out infinite;
}

.ps-logo-stream {
  margin-left: 0.28em;
  font-weight: 650;
  letter-spacing: 0.02em;
  opacity: 0.82;
}

.ps-logo:hover {
  filter: brightness(1.15);
  animation-duration: 3.2s;
}

@keyframes ps-logo-sheen {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ps-logo {
    animation: none;
    background-position: 50% 50%;
  }
}

.ps-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0 0.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  margin-left: auto;
}

.ps-burger span {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 999px;
  background: var(--text);
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.ps-nav.menu-open .ps-burger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.ps-nav.menu-open .ps-burger span:nth-child(2) {
  opacity: 0;
}

.ps-nav.menu-open .ps-burger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.ps-search-wrap {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.ps-search {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.ps-search:focus {
  outline: none;
  border-color: rgba(232, 195, 154, 0.55);
  background: rgba(255, 255, 255, 0.1);
  box-shadow:
    0 0 0 3px rgba(232, 195, 154, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.ps-search::placeholder {
  color: var(--muted);
}

.search-suggest {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  right: 0;
  z-index: 200;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02) 45%),
    var(--glass-bg-tint);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  max-height: 360px;
  overflow-y: auto;
  animation: fadeUp 0.18s ease;
}

.search-suggest.hidden {
  display: none;
}

.search-suggest-empty {
  padding: 0.85rem 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.search-suggest-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.12s;
}

.search-suggest-item:hover,
.search-suggest-item:focus-visible {
  background: var(--surface2);
  outline: none;
}

.search-suggest-thumb {
  flex-shrink: 0;
  width: 42px;
  height: 63px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
}

.search-suggest-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-suggest-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.search-suggest-text strong {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-suggest-text span {
  font-size: 0.78rem;
  color: var(--muted);
}

.ps-nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.nav-link {
  position: relative;
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  display: inline-block;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link.active {
  color: var(--text);
  background: var(--surface);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 0.15rem;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
}

.ps-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: 0.75rem;
}

.data-source-badge {
  font-size: 0.72rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-icon {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: color 0.15s, border-color 0.15s;
}

.btn-icon:hover {
  color: var(--text);
  border-color: var(--accent);
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.panel.active.ps-enter {
  animation: psAppear 0.4s ease both;
}

.ps-appear {
  animation: psAppear 0.5s ease both;
  animation-delay: var(--appear-delay, 0ms);
}

.hero-section.ps-appear {
  animation-duration: 0.6s;
}

.poster-card,
.top10-item,
.franchise-studio-card,
.history-item,
.poster-grid-item {
  animation: psPopIn 0.4s ease both;
  animation-delay: var(--appear-delay, 0ms);
}

.page-wrap,
.profile-card,
.filter-bar,
.profile-guest {
  animation: psAppear 0.45s ease both;
}

.profile-card:nth-child(2) {
  animation-delay: 0.08s;
}

.modal:not(.hidden) .modal-content {
  animation: psPopIn 0.3s ease both;
}

.modal:not(.hidden) .modal-backdrop {
  animation: psFade 0.25s ease both;
}

.nav-link {
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link:hover {
  transform: translateY(-1px);
}

.pagination-btn,
.filter-select,
.section-more,
.btn {
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.pagination-btn:hover:not(:disabled),
.section-more:hover,
.btn:hover {
  transform: translateY(-1px);
}

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

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

@keyframes psFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@media (prefers-reduced-motion: reduce) {
  .panel.active.ps-enter,
  .ps-appear,
  .hero-section.ps-appear,
  .poster-card,
  .top10-item,
  .franchise-studio-card,
  .history-item,
  .poster-grid-item,
  .page-wrap,
  .profile-card,
  .filter-bar,
  .profile-guest,
  .modal:not(.hidden) .modal-content,
  .modal:not(.hidden) .modal-backdrop {
    animation: none !important;
  }

  .watch-hero-bg {
    transform: none !important;
    will-change: auto;
  }

  .nav-link:hover,
  .pagination-btn:hover:not(:disabled),
  .section-more:hover,
  .btn:hover {
    transform: none !important;
  }
}

/* Téléviseurs : alléger le compositing autour de la vidéo (évite image saccadée, son OK) */
html.tv-device .main-video {
  transform: translateZ(0);
  backface-visibility: hidden;
}

html.tv-device .ps-player-ui,
html.tv-device .ps-player-controls,
html.tv-device .ps-player-top-gradient {
  transition: none !important;
}

html.tv-device .ps-player-spinner {
  animation: none;
  border-top-color: var(--accent);
  opacity: 0.85;
}

html.tv-device .watch-player-stage {
  isolation: isolate;
}

html.tv-device .watch-hero-bg {
  transform: none !important;
  will-change: auto;
}

html.tv-animation .ps-player-ui {
  /* Moins de overlays = moins de re-composite pendant le decode High Profile */
  contain: layout style;
}

html.tv-animation .main-video {
  object-fit: contain;
  image-rendering: auto;
}

html.hi-browser .ps-player-spinner {
  animation: none;
}

html.hi-browser .watch-player-modal .watch-player-stage {
  /* Hi Browser WebView : moins de layers CSS au-dessus de la vidéo */
  transform: translateZ(0);
}

/* Free TV / Freebox : focus télécommande + UI plus grosse */
html.free-tv .ps-player-btn,
html.free-tv .ps-player-select,
html.free-tv .ps-player-lang-btn {
  min-height: 2.6rem;
  min-width: 2.6rem;
  font-size: 0.95rem;
}

html.free-tv .ps-player-btn:focus-visible,
html.free-tv .ps-player-select:focus-visible,
html.free-tv .ps-player-lang-btn:focus-visible,
html.free-tv .episode-btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

html.free-tv .ps-caption-line {
  font-size: clamp(1.15rem, 2.8vw, 1.7rem);
}

html.free-tv .watch-player-modal .watch-player-stage:not(.watch-player-stage--immersive) {
  transform: translateZ(0);
}

/* Free TV en immersif : zéro effet lourd au-dessus de la vidéo */
html.free-tv .watch-player-stage--immersive .ps-player-top-gradient,
html.tv-device .watch-player-stage--immersive .ps-player-top-gradient,
html.ps-fs-lite .ps-player-top-gradient {
  display: none;
}

html.free-tv .watch-player-stage--immersive .ps-player-controls,
html.tv-device .watch-player-stage--immersive .ps-player-controls {
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Plein écran Free TV : overlays au minimum (natif ou immersif) */
html.ps-fs-lite .ps-player-captions {
  display: none !important;
}

html.ps-fs-lite .ps-player-ui--idle .ps-player-controls,
html.ps-fs-lite .ps-player-ui--idle .ps-player-big-play {
  opacity: 0 !important;
  pointer-events: none !important;
}

html.ps-fs-lite .ps-player-spinner {
  display: none;
}

/*
 * Navigateur TV en UA mobile : tv-boot.js force width=1280.
 * On empêche quand même les media-queries « téléphone » de casser le layout.
 */
html.tv-desktop .ps-burger {
  display: none !important;
}

html.tv-desktop .ps-nav {
  gap: 1.25rem;
  padding: 0.85rem 1.25rem;
}

html.tv-desktop .ps-nav-links {
  display: flex !important;
  position: static !important;
  flex-direction: row !important;
  width: auto !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

html.tv-desktop .watch-player-modal .watch-player-stage {
  max-height: min(72vh, 820px);
}

html.tv-desktop .ps-content {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.ps-content {
  padding: 0 1.25rem 3rem;
  max-width: 1536px;
  margin: 0 auto;
}

/* Accueil : sections en pleine largeur (rails / studios / carrousels) */
#panel-home > .ps-content {
  max-width: none;
  width: 100%;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

@media (min-width: 1024px) {
  .ps-content {
    padding-left: 3.5rem;
    padding-right: 3.5rem;
  }

  #panel-home > .ps-content {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media (min-width: 1536px) {
  .ps-content {
    padding-left: 6.5rem;
    padding-right: 6.5rem;
  }

  #panel-home > .ps-content {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }
}

/* Hero carousel */

.hero-section {
  position: relative;
  width: 100%;
  height: 72vh;
  min-height: 480px;
  max-height: 820px;
  margin-bottom: 2rem;
}

.hero-carousel {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hero-slides {
  width: 100%;
  height: 100%;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  cursor: pointer;
}

.hero-slide.active {
  opacity: 1;
  z-index: 1;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  transform: scale(1.06);
  transition: transform 8s ease-out;
}

.hero-slide.active .hero-bg {
  transform: scale(1.02);
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(18, 17, 24, 0.75) 0%, transparent 45%),
    var(--gradient-hero);
}

.hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 2rem 1.25rem 4rem;
  max-width: 680px;
}

@media (min-width: 1024px) {
  .hero-content {
    padding-left: 3.5rem;
    padding-bottom: 5rem;
  }
}

@media (min-width: 1536px) {
  .hero-content {
    padding-left: 6.5rem;
  }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.85rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: rgba(18, 17, 24, 0.55);
  border: 1px solid rgba(232, 195, 154, 0.35);
  backdrop-filter: blur(6px);
}

.hero-title {
  font-size: clamp(1.9rem, 4.5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 0.85rem;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}

.hero-synopsis {
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1.25rem;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.25);
}

.btn-hero {
  padding: 0.7rem 1.75rem;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 999px;
  box-shadow: 0 6px 24px var(--accent-glow);
}

.btn-hero::before {
  content: "▶";
  font-size: 0.75em;
  margin-right: 0.55rem;
}

.btn-hero:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px var(--accent-glow);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: none;
  background: rgba(26, 24, 37, 0.7);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s, background 0.15s;
}

.hero-carousel:hover .hero-arrow {
  opacity: 1;
}

.hero-arrow:hover {
  background: rgba(26, 24, 37, 0.95);
}

.hero-arrow-left { left: 1rem; }
.hero-arrow-right { right: 1rem; }

.hero-dots {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 0.5rem;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  padding: 0;
  transition: background 0.25s, width 0.25s;
}

.hero-dot.active {
  background: var(--accent);
  width: 22px;
}

.hero-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
}

/* Rails / carrousels */

.ps-rail-section {
  margin-bottom: 2.5rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  position: relative;
  padding-left: 0.85rem;
}

.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.12em;
  bottom: 0.12em;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
}

.section-subtitle {
  margin: 0.35rem 0 0;
  padding-left: 0.85rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.35;
}

.section-more {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.15s;
}

.section-more:hover {
  color: var(--accent);
}

.rail-wrap {
  position: relative;
}

.rail-wrap:hover .rail-btn:not(.hidden) {
  opacity: 1;
}

.rail {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  list-style: none;
  padding: 0.25rem 0;
}

.rail::-webkit-scrollbar {
  display: none;
}

.rail-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-tint);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.rail-btn:hover {
  background: var(--glass-bg-strong);
  border-color: rgba(232, 195, 154, 0.5);
}

.rail-btn.hidden {
  display: none;
}

.rail-btn-left { left: -0.5rem; }
.rail-btn-right { right: -0.5rem; }

.poster-card {
  flex: 0 0 auto;
  width: clamp(130px, 14vw, 180px);
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: var(--surface);
  outline: 1px solid var(--glass-border-soft);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  transition: transform 0.25s ease, box-shadow 0.25s ease, outline-color 0.25s ease;
}

.poster-card:hover {
  transform: translateY(-4px) scale(1.04);
  z-index: 2;
  box-shadow: var(--shadow-pop), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  outline-color: rgba(232, 195, 154, 0.55);
}

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

/* Accueil : affiches paysage + titre / meta sous l'image (pas le reste de l'UI) */
#panel-home .poster-card.poster-landscape {
  width: clamp(200px, 18vw, 280px);
  aspect-ratio: auto;
  height: auto;
  background: transparent;
  outline: none;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
}

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

#panel-home .poster-card.poster-landscape .poster-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  outline: 1px solid var(--glass-border-soft);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  transition: outline-color 0.2s ease, box-shadow 0.2s ease;
}

#panel-home .poster-card.poster-landscape:hover .poster-thumb {
  outline-color: rgba(232, 195, 154, 0.5);
  box-shadow: var(--shadow-pop);
}

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

#panel-home .poster-card.poster-landscape .poster-caption {
  padding: 0.55rem 0.05rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

#panel-home .poster-card.poster-landscape .poster-title {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#panel-home .poster-card.poster-landscape .poster-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--muted);
}

#panel-home .poster-card.poster-landscape .poster-meta-type,
#panel-home .poster-card.poster-landscape .poster-meta-sep {
  color: var(--accent);
  font-weight: 600;
}

#panel-home .poster-card.poster-landscape .poster-meta-rest {
  color: var(--muted);
}

#panel-home .poster-card.poster-landscape.no-img .poster-thumb {
  background:
    radial-gradient(circle at 30% 20%, rgba(232, 195, 154, 0.08), transparent 55%),
    linear-gradient(160deg, var(--surface2), var(--surface));
}

#panel-home .poster-card.poster-landscape .continue-progress {
  bottom: 0;
}

.poster-card.no-img,
.poster-grid-img.no-img,
.search-suggest-thumb.no-img {
  background:
    radial-gradient(circle at 30% 20%, rgba(232, 195, 154, 0.08), transparent 55%),
    linear-gradient(160deg, var(--surface2), var(--surface));
}

.poster-card.no-img img,
.poster-grid-img.no-img img {
  opacity: 0;
}

.poster-card.no-img .poster-overlay,
.poster-grid-img.no-img .poster-overlay {
  opacity: 1;
  background: none;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.poster-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.25) 45%, transparent 65%);
  opacity: 0;
  transition: opacity 0.25s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.15rem;
  padding: 0.75rem;
}

.poster-card:hover .poster-overlay {
  opacity: 1;
}

.poster-title {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
}

/* Top 10 */

.rail-top10 {
  gap: 1.25rem;
}

.top10-item {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.top10-rank {
  font-size: clamp(3.5rem, 7vw, 6rem);
  font-weight: 800;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2px rgba(255, 255, 255, 0.28);
  min-width: 2.5rem;
  text-align: center;
  transition: -webkit-text-stroke-color 0.2s, transform 0.2s;
}

.top10-item:hover .top10-rank {
  transform: scale(1.06);
}

.top10-item:hover .top10-rank {
  -webkit-text-stroke-color: var(--accent);
}

.top10-poster {
  width: clamp(100px, 12vw, 140px);
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  transition: transform 0.2s;
}

.top10-item:hover .top10-poster {
  transform: scale(1.05);
}

.top10-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Franchises & studios phares — pleine largeur */

.franchise-studios-section {
  margin: 0 0 2.5rem;
  max-width: none;
  width: 100%;
}

.franchise-studios-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1.25rem;
  width: 100%;
}

@media (max-width: 1100px) {
  .franchise-studios-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .franchise-studios-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.franchise-studio-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 160px;
  padding: 1.75rem 1.25rem;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.14), transparent 42%),
    var(--studio-bg, rgba(26, 24, 37, 0.72));
  background-color: rgba(26, 24, 37, 0.35);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--glass-radius);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
  box-shadow: var(--glass-shadow);
}

.franchise-studio-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(255, 255, 255, 0.22), transparent 45%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 60%);
  pointer-events: none;
}

.franchise-studio-card:hover {
  transform: translateY(-4px);
  border-color: rgba(232, 195, 154, 0.45);
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.franchise-studio-card img {
  position: relative;
  z-index: 1;
  max-width: 170px;
  max-height: 72px;
  object-fit: contain;
  transition: filter 0.2s ease;
}

/* Logos TMDB monochromes noirs → blancs sur fond sombre / marque */
.franchise-studio-card.studio-logo-invert img {
  filter: brightness(0) invert(1);
  opacity: 0.96;
}

/* Star Wars / Lucasfilm → jaune signature */
.franchise-studio-card.studio-logo-yellow img {
  filter: brightness(0) saturate(100%) invert(83%) sepia(61%) saturate(1200%) hue-rotate(359deg) brightness(104%) contrast(104%);
  opacity: 1;
}

.franchise-studio-card.studio-bg-dark {
  border-color: rgba(255, 255, 255, 0.14);
}

.franchise-studio-card.studio-bg-dark::before {
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(255, 255, 255, 0.16), transparent 45%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 60%);
}

.franchise-studio-card img.hidden {
  display: none;
}

.franchise-studio-fallback {
  position: relative;
  z-index: 1;
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
}

.franchise-studio-card img:not(.hidden) + .franchise-studio-fallback {
  display: none;
}

.franchise-studio-count {
  position: relative;
  z-index: 1;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.65);
}

.franchise-highlight {
  animation: franchisePulse 1.5s ease;
}

@keyframes franchisePulse {
  0%, 100% { box-shadow: none; }
  30% { box-shadow: 0 0 0 3px rgba(232, 195, 154, 0.45); }
}

/* Catalogue & recherche */

.page-wrap {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.page-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 2rem;
  padding: 0.85rem 1rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)),
    var(--glass-bg-tint);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--glass-radius);
  box-shadow: var(--glass-shadow);
}


.filter-select,
.filter-input {
  background-color: rgba(18, 17, 24, 0.5);
  border: 1px solid var(--glass-border-soft);
  color: var(--text);
  padding: 0.5rem 2rem 0.5rem 0.85rem;
  border-radius: 12px;
  font-size: 0.88rem;
  cursor: pointer;
  appearance: none;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239b97ad' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  transition: border-color 0.15s, background-color 0.15s;
}

.filter-select:hover,
.filter-select:focus {
  border-color: var(--accent);
  outline: none;
}

.filter-chip {
  background: rgba(18, 17, 24, 0.45);
  border: 1px solid var(--glass-border-soft);
  color: var(--muted);
  padding: 0.5rem 0.9rem;
  border-radius: 12px;
  font-size: 0.88rem;
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.filter-chip:hover {
  border-color: var(--accent);
  color: var(--text);
}

.filter-chip.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(232, 195, 154, 0.12);
}

.filter-input {
  width: 72px;
}

.search-advanced .filter-input {
  width: auto;
  min-width: 8.5rem;
  flex: 1 1 8.5rem;
  appearance: none;
  background-image: none;
  padding-right: 0.85rem;
  cursor: text;
}

.search-advanced .search-adv-q {
  flex: 2 1 12rem;
  min-width: 12rem;
}

.btn-search-adv {
  padding: 0.5rem 1rem;
  font-size: 0.88rem;
}

.search-advanced .btn-ghost {
  padding: 0.5rem 0.85rem;
  font-size: 0.88rem;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.pagination-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

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

.pagination-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #121118;
  font-weight: 600;
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-meta {
  color: var(--muted);
  font-size: 0.82rem;
  margin-left: 0.35rem;
}

.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1.25rem;
}

.poster-grid-item {
  cursor: pointer;
}

.poster-grid-img {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  outline: 1px solid transparent;
  transition: transform 0.25s ease, box-shadow 0.25s ease, outline-color 0.25s ease;
}

.poster-grid-item:hover .poster-grid-img {
  transform: translateY(-4px) scale(1.03);
  box-shadow: var(--shadow-pop);
  outline-color: rgba(232, 195, 154, 0.5);
}

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

.poster-meta {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 0.2rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

select, input[type="text"], input[type="number"] {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

input[type="number"] {
  width: 70px;
}

.btn {
  background: var(--accent);
  color: #121118;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.btn:hover {
  background: var(--accent-hover);
}

.btn:active {
  transform: scale(0.97);
}

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

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

.btn-player {
  flex: 1;
  text-align: center;
  text-decoration: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.modal-content {
  position: relative;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02) 40%),
    var(--glass-bg-tint);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-detail {
  display: flex;
  gap: 1.5rem;
}

.modal-detail img {
  width: 140px;
  border-radius: 8px;
  flex-shrink: 0;
}

.modal-detail h2 {
  margin-bottom: 0.75rem;
}

.modal-detail .overview {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 1rem 0;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.tag {
  background: var(--surface2);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--muted);
}

.players-section {
  margin-top: 1.25rem;
}

.players-section h3 {
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
}

.player-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 220px;
  overflow-y: auto;
}

.player-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.75rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.player-item a {
  color: var(--accent-hover);
  text-decoration: none;
  font-size: 0.85rem;
  word-break: break-all;
}

.player-item a:hover {
  text-decoration: underline;
}

.player-meta {
  color: var(--muted);
  font-size: 0.75rem;
}

.empty-players {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.loader {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 50;
  box-shadow: var(--shadow-card);
}

.loader::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--accent-glow);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}

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

.loader.hidden {
  display: none;
}

.empty {
  color: var(--muted);
  padding: 3rem 2rem;
  text-align: center;
  grid-column: 1 / -1;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.015);
}

/* Page lecteur / watch */

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

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

.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-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: 10060 !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;
}

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.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.4rem 0.9rem;
  border-radius: 6px;
  /* 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: rgba(0, 0, 0, 0.78);
  text-shadow: none;
}

.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;
}

.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.35rem 0.8rem;
  border-radius: 8px;
  background: rgba(12, 10, 18, 0.9);
  color: #f5f5f7;
  font-size: clamp(1rem, 2.3vw, 1.35rem);
  font-weight: 650;
  line-height: 1.35;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
  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 0.25s ease;
  pointer-events: none;
}

.ps-player-controls,
.ps-player-big-play,
.ps-player-next,
.ps-player-loader {
  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 0.25s ease;
}

.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 0.15s ease, background 0.15s 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: 0.75rem;
  padding: 1.5rem;
  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: 14px;
  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: 999px;
  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: 0.75rem;
  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: 0.25rem;
  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: 8px;
  padding: 0.28rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

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

.ps-player-lang-btn.is-active {
  color: #121118;
  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: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s 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-volume-wrap {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.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: 8px;
  padding: 0.35rem 0.55rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.ps-player-select:focus {
  outline: none;
  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: 999px;
}

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

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

.watch-player-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  color: var(--muted);
}

.watch-content {
  position: relative;
  z-index: 2;
  padding-top: 4.5rem;
  padding-bottom: 3rem;
}

.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: 14px;
  overflow: hidden;
  background: #0a0a0f;
  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: 0.75rem;
}

.watch-player-modal {
  z-index: 220;
  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: #05050a;
  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: 999px;
  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: #05050a;
  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: #05050a;
  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: 14px;
  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: 2rem;
  margin-bottom: 2.5rem;
  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: 0.75rem;
  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: #67d391;
  color: #8be5ab;
  background: rgba(58, 172, 100, 0.16);
}

#dislike-btn.is-active {
  border-color: #e27d7d;
  color: #f0a0a0;
  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: 12px;
  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: 8px;
  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: 0.5rem;
  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: 8px;
  background: var(--surface2);
  color: var(--text);
}

.list-picker-status {
  margin: 0.55rem 0 0;
  color: #8be5ab;
  font-size: 0.82rem;
}

.list-picker-status.is-error {
  color: #f0a0a0;
}

.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: 9px;
  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: 1rem;
  border-top: 1px solid var(--border);
}

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

.profile-list .rail {
  padding-bottom: 0.25rem;
}

.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: 10px;
  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;
  color: rgba(245, 245, 247, 0.32);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}

.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: 10px;
  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: 0.5rem;
  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: 1rem;
}

.watch-ratings {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.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: 0.75rem;
  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: 1rem;
}

.season-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.season-tab {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.65rem 1.3rem;
  min-height: 44px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s 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: #121118;
}

.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: 14px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  animation: watchPopIn 0.4s 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-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: 0.25rem;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  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: #f0c35a;
  border-color: rgba(240, 195, 90, 0.35);
}

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

.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-loading,
.detail-error {
  color: var(--muted);
  text-align: center;
  padding: 4rem 1rem;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

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

.rating-badge {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  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: 20px;
  font-size: 0.8rem;
  color: var(--muted);
}

.empty-players {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Panel admin */

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-topbar-label {
  color: var(--muted);
  font-size: 0.85rem;
}

.admin-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.admin-login-card {
  width: min(100%, 380px);
}

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

.admin-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-header h1 {
  font-size: 1.8rem;
  margin-bottom: 0.35rem;
}

.admin-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.admin-tab {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.95rem;
  margin-bottom: -1px;
  padding: 0.65rem 1rem;
  transition: color 0.15s, border-color 0.15s;
}

.admin-tab:hover {
  color: var(--text);
}

.admin-tab.active {
  border-bottom-color: var(--accent);
  color: var(--text);
  font-weight: 600;
}

.admin-panel.hidden {
  display: none;
}

.admin-users-toolbar {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.admin-search-field {
  flex: 1;
  max-width: 320px;
  min-width: 200px;
}

.admin-users-pagination {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

.admin-page-info {
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-user-backdrop {
  background: rgba(0, 0, 0, 0.55);
  inset: 0;
  position: fixed;
  z-index: 90;
}

.admin-user-backdrop.hidden,
.admin-user-panel.hidden {
  display: none;
}

.admin-user-panel {
  background: var(--surface);
  border-left: 1px solid var(--border);
  bottom: 0;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.25);
  max-width: 100%;
  overflow-y: auto;
  padding: 1.25rem;
  position: fixed;
  right: 0;
  top: 0;
  width: min(520px, 100vw);
  z-index: 100;
}

.admin-user-panel-head {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.admin-user-panel-head h2 {
  font-size: 1.2rem;
  margin: 0;
}

.admin-user-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.admin-user-meta p {
  margin: 0.35rem 0;
}

.admin-user-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.admin-user-panel h3 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
}

.admin-subtitle {
  color: var(--muted);
  font-size: 0.95rem;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stat-label {
  color: var(--muted);
  font-size: 0.82rem;
}

.stat-value {
  font-size: 1.6rem;
  color: var(--accent);
}

.stat-value.status-ok {
  color: #7ddea8;
}

.stat-value.status-fail {
  color: #ff8f8f;
}

.stat-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.admin-auto-card {
  margin-bottom: 1.5rem;
}

.admin-auto-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.admin-auto-head h2 {
  margin-bottom: 0.25rem;
}

.admin-auto-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 0.85rem;
}

.admin-auto-meta strong {
  color: var(--text);
}

.admin-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem;
  margin-bottom: 1rem;
}

.admin-card h2 {
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

.admin-card-wide {
  min-height: 280px;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.admin-field input,
.admin-field select {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font-size: 0.9rem;
}

.admin-field input:focus,
.admin-field select:focus {
  outline: none;
  border-color: var(--accent);
}

.admin-field-inline {
  align-items: center;
  flex-direction: row;
  gap: 0.5rem;
}

.admin-field-inline input[type="checkbox"] {
  width: auto;
}

.job-fields.hidden {
  display: none;
}

.admin-form-status {
  font-size: 0.82rem;
  color: var(--muted);
  min-height: 1.2rem;
}

.admin-actions {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--surface2);
  color: var(--muted);
}

.admin-badge.status-running {
  background: rgba(232, 195, 154, 0.15);
  color: var(--accent);
}

.admin-badge.status-done,
.admin-pill.status-ok {
  background: rgba(88, 196, 132, 0.15);
  color: #7ddea8;
}

.admin-badge.status-error,
.admin-pill.status-error,
.admin-pill.status-fail {
  background: rgba(255, 107, 107, 0.15);
  color: #ff8f8f;
}

.admin-pill.status-empty {
  background: rgba(155, 151, 173, 0.15);
  color: var(--muted);
}

.active-job.empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.active-job-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.admin-progress {
  height: 8px;
  background: var(--surface2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.75rem;
}

.admin-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
  transition: width 0.3s ease;
}

.admin-progress-label {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.admin-active-titles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.admin-titles-block h3 {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-titles-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.admin-title-chip {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.admin-title-chip.status-running {
  border-color: rgba(125, 222, 168, 0.35);
  background: rgba(125, 222, 168, 0.06);
  animation: admin-pulse 1.6s ease-in-out infinite;
}

.admin-title-chip.status-done,
.admin-title-chip.status-ok {
  border-color: rgba(125, 222, 168, 0.2);
}

.admin-title-chip.status-error,
.admin-title-chip.status-fail {
  border-color: rgba(255, 143, 143, 0.35);
  background: rgba(255, 143, 143, 0.06);
}

.admin-title-name {
  font-size: 0.86rem;
  color: var(--text);
  font-weight: 500;
}

.admin-title-meta {
  font-size: 0.74rem;
  color: var(--muted);
}

.admin-title-id {
  color: var(--accent);
  text-decoration: none;
}

.admin-title-id:hover {
  text-decoration: underline;
}

.admin-title-empty {
  color: var(--muted);
  font-size: 0.8rem;
  font-style: italic;
}

@keyframes admin-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}

.admin-logs {
  margin-top: 1rem;
  background: #0d0c12;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem;
  min-height: 160px;
  max-height: 260px;
  overflow: auto;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #d5d2e3;
  white-space: pre-wrap;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  color: var(--muted);
  font-weight: 600;
}

.admin-table a {
  color: var(--accent);
  text-decoration: none;
}

.admin-pill {
  display: inline-flex;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
}

.admin-empty {
  color: var(--muted);
  padding: 0.75rem 0;
}

.admin-files {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-file-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.86rem;
}

.admin-file-meta {
  color: var(--muted);
  white-space: nowrap;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  font: inherit;
}

.btn-nav {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  white-space: nowrap;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border-soft);
  color: var(--muted);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--glass-border);
  background: rgba(255, 255, 255, 0.1);
}

.nav-user-label {
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-notifications {
  position: relative;
}

.nav-notif-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 12px;
  border: 1px solid var(--glass-border-soft);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.nav-notif-btn:hover,
.nav-notif-btn[aria-expanded="true"] {
  color: var(--text);
  border-color: var(--accent);
}

.nav-notif-badge {
  position: absolute;
  top: -0.3rem;
  right: -0.3rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: var(--accent);
  color: #121118;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.1rem;
  text-align: center;
}

.nav-notif-panel {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  width: min(22rem, calc(100vw - 1.5rem));
  max-height: min(70vh, 26rem);
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02) 45%),
    var(--glass-bg-tint);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  z-index: 80;
  overflow: hidden;
}

.nav-notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.nav-notif-head strong {
  font-size: 0.95rem;
}

.nav-notif-mark {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
}

.nav-notif-mark:hover {
  color: var(--accent-hover);
}

.nav-notif-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.nav-notif-empty {
  margin: 0;
  padding: 1.25rem 1rem;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.nav-notif-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s;
}

.nav-notif-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.nav-notif-item.unread {
  background: rgba(232, 195, 154, 0.08);
}

.nav-notif-poster {
  width: 42px;
  height: 62px;
  border-radius: 6px;
  background: var(--bg) center/cover no-repeat;
  border: 1px solid var(--border);
}

.nav-notif-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.nav-notif-body strong {
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-notif-body span {
  font-size: 0.8rem;
  color: var(--muted);
}

.nav-notif-body small {
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.85;
}

.auth-modal-content {
  max-width: 420px;
  padding: 1.75rem;
}

.auth-title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
}

.auth-subtitle {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.auth-field input {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  font: inherit;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--accent);
}

.auth-submit {
  width: 100%;
  margin-top: 0.25rem;
}

.auth-error {
  color: #ff8a8a;
  font-size: 0.85rem;
  margin: 0;
}

.auth-switch {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}

.auth-link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
}

.profile-page {
  max-width: 900px;
}

.watch-personal-wrap {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.watch-personal-wrap .ps-rail-section:first-child {
  margin-top: 0;
}

.watch-personal-empty {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.5rem 0 1rem;
}

.profile-guest {
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
}

.profile-guest p {
  color: var(--muted);
  margin-bottom: 1rem;
}

.profile-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 420px;
}

.profile-notif-prefs {
  margin: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.profile-notif-prefs legend {
  padding: 0 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.profile-check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
}

.profile-check input {
  margin-top: 0.2rem;
  accent-color: var(--accent);
}

.profile-success {
  color: #7ddea0;
  font-size: 0.85rem;
  margin: 0;
}

.profile-history {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-item {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem;
  border-radius: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
}

.history-thumb {
  position: relative;
  display: block;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 2/3;
}

.history-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-title {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.history-title:hover {
  color: var(--accent);
}

.history-meta,
.history-date {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.continue-card {
  position: relative;
}

.continue-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  z-index: 2;
}

.continue-progress span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.history-thumb .continue-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}


/* Touch: titres posters toujours visibles (pas de hover) */
@media (hover: none) {
  .poster-overlay {
    opacity: 1;
  }

  .poster-card:hover,
  .poster-grid-item:hover .poster-grid-img,
  .franchise-studio-card:hover,
  .top10-item:hover .top10-poster,
  .top10-item:hover .top10-rank,
  .episode-btn:hover {
    transform: none;
  }

  .poster-card:hover {
    box-shadow: none;
    outline-color: transparent;
  }

  .poster-grid-item:hover .poster-grid-img {
    box-shadow: none;
    outline-color: transparent;
  }
}

/* Tablette / mobile large : navbar burger + admin */
@media (max-width: 900px) {
  .ps-nav {
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .ps-burger {
    display: flex;
  }

  .ps-search-wrap {
    order: 3;
    max-width: 100%;
    width: 100%;
  }

  .search-suggest {
    max-height: min(50vh, 320px);
  }

  .ps-nav-links {
    display: none;
    order: 4;
    width: 100%;
    flex-direction: column;
    gap: 0.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
  }

  .ps-nav.menu-open .ps-nav-links {
    display: flex;
    animation: fadeUp 0.2s ease;
  }

  .ps-nav.menu-open .ps-nav-links .nav-link {
    padding: 0.85rem 0.9rem;
    font-size: 1rem;
    min-height: 44px;
  }

  .ps-nav.menu-open .ps-nav-links .nav-link.active::after {
    display: none;
  }

  .ps-nav.menu-open .ps-nav-links .nav-link.active {
    background: var(--surface);
    color: var(--accent);
  }

  .ps-nav-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    width: 100%;
    margin-left: 0;
    margin-top: 0.35rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border);
  }

  .nav-user-label {
    display: block;
    max-width: none;
    padding: 0.35rem 0.9rem 0.15rem;
    font-size: 0.85rem;
  }

  .nav-notifications {
    width: 100%;
    padding: 0.35rem 0.9rem;
  }

  .nav-notif-btn {
    width: 100%;
    justify-content: flex-start;
    gap: 0.55rem;
    height: 2.6rem;
    padding: 0 0.85rem;
  }

  .nav-notif-btn::after {
    content: "Notifications";
    font-size: 0.92rem;
  }

  .nav-notif-panel {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    top: auto;
    bottom: 0.75rem;
    width: auto;
    max-height: 60vh;
  }

  .btn-nav {
    width: 100%;
    padding: 0.75rem 0.9rem;
    font-size: 0.95rem;
    min-height: 44px;
    justify-content: center;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-header {
    flex-direction: column;
  }

  .admin-user-panel {
    width: 100vw;
  }

  .admin-active-titles {
    grid-template-columns: 1fr;
  }

  .admin-topbar {
    flex-wrap: wrap;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
  }

  .admin-topbar-actions {
    flex-wrap: wrap;
    width: 100%;
    justify-content: space-between;
  }

  .admin-tabs {
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    gap: 0;
  }

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

  .admin-tab {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 0.75rem 0.9rem;
    min-height: 44px;
  }

  .admin-users-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-search-field {
    max-width: none;
    min-width: 0;
    width: 100%;
  }

  .admin-auto-head {
    flex-direction: column;
  }

  .admin-table {
    font-size: 0.78rem;
  }

  .admin-table th,
  .admin-table td {
    padding: 0.55rem 0.4rem;
  }

  .admin-table-actions {
    flex-direction: column;
  }
}

@media (max-width: 768px) {
  .ps-content {
    padding-left: 1rem;
    padding-right: 1rem;
    padding-bottom: 2.5rem;
  }

  .ps-search,
  .auth-field input,
  .profile-form input,
  select,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"] {
    font-size: 16px;
  }

  .page-wrap {
    padding-top: 1.25rem;
    padding-bottom: 2rem;
  }

  .page-head {
    flex-wrap: wrap;
    margin-bottom: 1.1rem;
  }

  .page-title {
    font-size: 1.45rem;
  }

  .section-title {
    font-size: 1.05rem;
  }

  .ps-rail-section {
    margin-bottom: 1.75rem;
  }

  .history-item {
    grid-template-columns: 72px 1fr;
    gap: 0.75rem;
  }

  .history-item .history-remove {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .hero-section {
    height: 56vh;
    height: 56dvh;
    min-height: 280px;
    max-height: 520px;
    margin-bottom: 1.25rem;
  }

  .hero-content {
    padding: 1.25rem 1rem 3.25rem;
    max-width: 100%;
  }

  .hero-badge {
    font-size: 0.72rem;
    margin-bottom: 0.55rem;
  }

  .hero-title {
    font-size: clamp(1.45rem, 7vw, 2.1rem);
    margin-bottom: 0.55rem;
  }

  .hero-synopsis {
    font-size: 0.85rem;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    margin-bottom: 0.9rem;
  }

  .btn-hero {
    padding: 0.65rem 1.35rem;
    font-size: 0.9rem;
    min-height: 44px;
  }

  .hero-dots {
    bottom: 1rem;
  }

  .hero-arrow,
  .rail-btn {
    display: none;
  }

  .rail {
    gap: 0.75rem;
    padding-left: 0;
    padding-right: 0;
    scroll-padding-inline: 0;
    -webkit-overflow-scrolling: touch;
  }

  .poster-card {
    width: clamp(110px, 32vw, 150px);
  }

  #panel-home .poster-card.poster-landscape {
    width: clamp(170px, 62vw, 260px);
  }

  .profile-list .poster-card.poster-landscape {
    width: clamp(230px, 78vw, 310px);
  }

  .profile-list-create {
    flex-direction: column;
  }

  .top10-rank {
    font-size: clamp(2.5rem, 12vw, 4rem);
    min-width: 1.75rem;
    -webkit-text-stroke-width: 1.5px;
  }

  .top10-poster {
    width: clamp(90px, 26vw, 120px);
  }

  .top10-item {
    gap: 0.4rem;
  }

  .franchise-studios-section {
    margin-bottom: 1.75rem;
  }

  .franchise-studios-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .franchise-studio-card {
    min-height: 120px;
    padding: 1.1rem 0.75rem;
    gap: 0.45rem;
  }

  .franchise-studio-card img {
    max-width: 120px;
    max-height: 48px;
  }

  .franchise-studio-fallback {
    font-size: 0.95rem;
  }

  .franchise-studio-count {
    font-size: 0.75rem;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    padding: 0.75rem;
    margin-bottom: 1.25rem;
  }

  .filter-select,
  .filter-input {
    width: 100%;
    min-height: 44px;
    font-size: 1rem;
    padding: 0.65rem 2.25rem 0.65rem 0.85rem;
  }

  .filter-input {
    width: 100%;
  }

  .filters {
    flex-direction: column;
    align-items: stretch;
  }

  .filters select,
  .filters input[type="text"],
  .filters input[type="number"] {
    width: 100%;
    min-height: 44px;
    font-size: 1rem;
  }

  .poster-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.75rem;
  }

  .poster-title {
    font-size: 0.72rem;
  }

  .poster-meta {
    font-size: 0.65rem;
  }

  .poster-overlay {
    padding: 0.5rem;
  }

  .pagination {
    gap: 0.35rem;
    margin-top: 1.5rem;
  }

  .pagination-btn {
    min-height: 40px;
    min-width: 40px;
    padding: 0.45rem 0.7rem;
  }

  .pagination-meta {
    width: 100%;
    text-align: center;
    margin-left: 0;
    margin-top: 0.35rem;
  }

  .modal {
    align-items: flex-end;
    padding: 0;
  }

  .modal-content {
    width: 100%;
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    padding: 1.25rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
    max-height: 92vh;
    max-height: 92dvh;
  }

  .auth-modal-content {
    max-width: 100%;
    padding: 1.5rem 1.1rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  }

  .modal-detail {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
  }

  .modal-detail img {
    width: 110px;
  }

  .modal-detail .overview {
    text-align: left;
  }

  .detail-tags {
    justify-content: center;
  }

  .loader {
    left: 1rem;
    right: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    justify-content: center;
  }

  .watch-player-modal {
    padding: 0;
    align-items: stretch;
  }

  .watch-player-modal-content {
    width: 100%;
    max-width: none;
    max-height: none;
    min-height: 100dvh;
    border-radius: 0;
    padding: 0;
  }

  .watch-player-modal .watch-player-stage {
    max-height: min(42vh, 360px);
    min-height: 0;
    aspect-ratio: 16 / 9;
    border-radius: 0;
  }

  .watch-player-modal .watch-player-info,
  .watch-player-modal .watch-episodes {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }

  .watch-player-modal .watch-episodes {
    min-height: min(48vh, 460px);
  }

  .watch-player-modal .episode-btn {
    max-width: 100%;
    width: 100%;
  }

  .watch-player-stage {
    max-height: none;
    aspect-ratio: 16 / 9;
  }

  .watch-player-info {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.65rem 1rem;
    gap: 0.35rem;
  }

  .ps-player-right {
    width: 100%;
    justify-content: flex-end;
  }

  .ps-player-volume {
    width: 56px;
  }

  .ps-player-time {
    min-width: auto;
  }

  .watch-now-playing {
    font-size: 0.85rem;
    width: 100%;
  }

  .watch-content {
    padding-top: 3.25rem;
    padding-bottom: 2.5rem;
  }

  .watch-hero {
    min-height: clamp(320px, 58vh, 520px);
    margin-bottom: -1.75rem;
  }

  .watch-hero-bg {
    background-position: center top;
  }

  .watch-hero-shade {
    background:
      linear-gradient(
        180deg,
        rgba(18, 17, 24, 0.16) 0%,
        rgba(18, 17, 24, 0.28) 42%,
        rgba(18, 17, 24, 0.72) 78%,
        var(--bg) 100%
      ),
      linear-gradient(90deg, rgba(18, 17, 24, 0.4), rgba(18, 17, 24, 0.12));
  }

  .watch-hero-inner {
    padding-top: 3.5rem;
    padding-bottom: 2.5rem;
    text-align: center;
  }

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

  .watch-hero .watch-ratings,
  .watch-hero .detail-tags,
  .watch-hero .watch-actions {
    justify-content: center;
  }

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

  .watch-overview {
    text-align: left;
    font-size: 0.9rem;
  }

  .watch-ratings,
  .detail-tags {
    justify-content: center;
  }

  .season-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.35rem;
    margin-bottom: 1rem;
  }

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

  .season-tab {
    flex: 0 0 auto;
    min-height: 46px;
    padding: 0.65rem 1.2rem;
    font-size: 0.95rem;
  }

  .episode-list {
    flex-direction: column;
  }

  .episode-btn {
    max-width: 100%;
    width: 100%;
    min-height: 72px;
    padding: 1rem 1.1rem;
  }

  .watch-player-modal .episode-btn {
    max-width: 100%;
    width: 100%;
  }

  .profile-card {
    padding: 1rem 1.1rem;
  }

  .profile-form {
    max-width: none;
  }

  .profile-guest {
    padding: 1.5rem 1rem;
  }

  .admin-page {
    padding: 1rem 1rem 2.5rem;
  }

  .admin-header h1 {
    font-size: 1.4rem;
  }

  .admin-stats {
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
  }

  .stat-card {
    padding: 0.85rem;
  }

  .stat-value {
    font-size: 1.35rem;
  }

  .admin-card {
    padding: 0.95rem;
  }

  .admin-file-row {
    flex-direction: column;
    gap: 0.25rem;
  }

  .admin-users-pagination {
    flex-wrap: wrap;
    gap: 0.65rem;
  }
}

@media (max-width: 480px) {
  .ps-logo {
    font-size: 1.15rem;
  }

  .ps-nav {
    gap: 0.5rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .ps-content {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .hero-section {
    height: 52vh;
    height: 52dvh;
    min-height: 240px;
  }

  .hero-content {
    padding: 1rem 0.75rem 2.75rem;
  }

  .hero-synopsis {
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .poster-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.55rem;
  }

  .poster-card {
    width: clamp(100px, 38vw, 130px);
  }

  .franchise-studios-grid {
    grid-template-columns: 1fr;
  }

  .franchise-studio-card {
    min-height: 100px;
    flex-direction: row;
    justify-content: flex-start;
    padding: 0.85rem 1rem;
    gap: 0.85rem;
  }

  .franchise-studio-card img {
    max-width: 90px;
    max-height: 40px;
  }

  .admin-stats {
    grid-template-columns: 1fr;
  }

  .page-title {
    font-size: 1.3rem;
  }

  .watch-title {
    font-size: 1.35rem;
  }
}

/* Landscape téléphone : player plus haut */
@media (max-width: 900px) and (orientation: landscape) {
  .hero-section {
    height: 85vh;
    height: 85dvh;
    min-height: 220px;
    max-height: none;
  }

  .watch-player-stage {
    max-height: 100dvh;
    aspect-ratio: auto;
    height: min(100dvh, calc(100vw * 9 / 16 + 80px));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .ps-nav,
  .filter-bar,
  .modal-content,
  .franchise-studio-card,
  .nav-notif-panel,
  .search-suggest,
  .rail-btn,
  .ps-search {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
