:root {
  --bg: #07070d;
  --bg-card: rgba(16, 19, 31, 0.92);
  --bg-strong: #121725;
  --text: #f7f7fb;
  --text-muted: #a7acbb;
  --accent: #EC4899;
  --accent-2: #7c3aed;
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}

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

body {
  background:
    radial-gradient(circle at top left, rgba(236, 72, 153, 0.15), transparent 28%),
    linear-gradient(135deg, #06070b 0%, #0b0f1d 100%);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Header --- */
.site-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  padding: 0.75rem 1.2rem;
  width: 100%;
  background: var(--bg-card);
  border-bottom: 1px solid #2a2a33;
  border-radius: 00px;
}

.logo {
  font-size: 2rem;
  font-weight: bold;
  color: var(--text);
  text-decoration: none;
}

.logo span {
  color: var(--accent);
}

.header-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  width: auto;
}

.genre-select-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 520px;
}

.genre-select-wrapper label {
  color: var(--text-muted);
  font-size: 0.95rem;
  white-space: nowrap;
}

#genre-select {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.85rem;
  border-radius: 6px;
  border: 1px solid #2a2a33;
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
}

#search-bar {
  background: var(--bg);
  border: 1px solid #2a2a33;
  color: var(--text);
  padding: 0.55rem 1rem;
  border-radius: 6px;
  width: min(340px, 100%);
  margin-left: auto;
}

/* --- Main --- */
main {
  flex: 1;
  padding: 2rem 1.25rem 3rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.section-title {
  margin-bottom: 1rem;
  font-weight: 600;
}

.serie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.25rem;
}

.serie-actions .action-button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.85rem 1.4rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.serie-actions .action-button:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-1px);
}

.serie-actions .action-button.secondary {
  background: #3a66c0;
}

.serie-actions .action-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Catalogue --- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.2rem;
}

.video-card {
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease;
  color: inherit;
  text-decoration: none;
}

.video-card:hover {
  transform: translateY(-4px);
}

.video-card:focus-visible,
.hero-item:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.video-card img {
  width: 100%;
  height: 100%;
  aspect-ratio: 9 / 16 !important;
  object-fit: cover;
  display: block;
  background: #0A0A0F;
}

.video-card .video-info {
  padding: 0.7rem;
}

.video-card .video-info h3 {
  font-size: 0.95rem;
  font-weight: 500;
}

.watching-section {
  max-width: 1200px;
  margin: 0 auto 2rem;
  padding: 1rem 0;
}

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

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

.watching-card {
  position: relative;
  background: var(--bg-card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);
  max-width: 220px;
}

.watching-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.watching-card img {
  width: 100%;
  height: 100%;
  aspect-ratio: 9 / 16 !important;
  object-fit: cover;
  display: block;
  max-height: 220px;
}

.watching-card-body {
  padding: 0.85rem;
}

.watching-card-body h3 {
  margin: 0 0 0.45rem;
  font-size: 0.98rem;
  line-height: 1.3;
}

.watching-card-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.watching-card-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.watching-remove {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: rgba(18, 18, 28, 0.92);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

.watching-remove:hover {
  background: rgba(236, 72, 153, 0.95);
}

.watching-empty {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.3rem;
}

/* --- Hero Carousel (coverflow 16/9) --- */
.hero-slider {
  width: 100%;
  margin-bottom: 3rem;
}

.hero-carousel {
  position: relative;
  width: 100%;
  height: 420px;
  margin-bottom: 1.2rem;
  /* Réglages du coverflow : largeur de la miniature centrale et écartement des voisines */
  --poster-w: 240px;
  --gap-1: 220px;
  --gap-2: 340px;
  --gap-3: 460px;
  --gap-4: 580px;
  --scale-1: 0.68; /* size of the neighbor thumbnails */
  --scale-2: 0.56;
}

.hero-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-item {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--poster-w);
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  border: none;
  padding: 0;
  background: #0A0A0F;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.55);
  transition: transform 0.5s cubic-bezier(0.22, 0.68, 0, 1), opacity 0.5s ease, filter 0.5s ease;
}

.hero-item img {
  width: 100%;
  height: 100%;
  aspect-ratio: 9 / 16 !important;
  object-fit: cover;
  display: block;
}

.hero-item.pos-0 {
  transform: translate(-50%, -50%) scale(1);
  z-index: 5;
  opacity: 1;
}

.hero-item.pos-1 {
  transform: translate(calc(-50% + var(--gap-1)), -50%) scale(var(--scale-1));
  z-index: 4;
  opacity: 0.85;
  filter: brightness(0.7);
}

.hero-item.pos--1 {
  transform: translate(calc(-50% - var(--gap-1)), -50%) scale(var(--scale-1));
  z-index: 4;
  opacity: 0.85;
  filter: brightness(0.7);
}

.hero-item.pos-2 {
  transform: translate(calc(-50% + var(--gap-2)), -50%) scale(var(--scale-2));
  z-index: 3;
  opacity: 0.55;
  filter: brightness(0.55);
}

.hero-item.pos--2 {
  transform: translate(calc(-50% - var(--gap-2)), -50%) scale(var(--scale-2));
  z-index: 3;
  opacity: 0.55;
  filter: brightness(0.55);
}

/* Même taille que pos-2 / pos--2, juste plus loin du centre : comble l'espace sur les côtés */
.hero-item.pos-3,
.hero-item.pos-4 {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.hero-item.pos-4 {
  transform: translate(calc(-50% + var(--gap-4)), -50%) scale(var(--scale-2));
}

/* Masquer la troisième vignette à droite pour n'afficher qu'une vignette de moins */
.hero-item.pos-3 {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translate(-50%, -50%) scale(0.36) !important;
}

.hero-item.pos--3,
.hero-item.pos--4 {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.hero-item.pos--4 {
  transform: translate(calc(-50% - var(--gap-4)), -50%) scale(var(--scale-2));
}

.hero-item.pos-hidden {
  transform: translate(-50%, -50%) scale(0.4);
  z-index: 1;
  opacity: 0;
  pointer-events: none;
}

.hero-item.pos-0:hover {
  transform: translate(-50%, -50%) scale(1.03);
}

.hero-info {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  padding: 0 1.5rem;
}

.hero-info h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.hero-info .meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

.hero-info p.synopsis {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 1.2rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-info-btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 0.7rem 1.8rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.hero-info-btn:hover {
  opacity: 0.9;
}

.hero-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.2rem;
}

.hero-nav-btn {
  background: rgba(255, 255, 255, 0.08);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-nav-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.4);
}

.hero-dots {
  display: flex;
  gap: 0.5rem;
}

.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  border: none;
  cursor: pointer;
  transition: background 0.3s ease;
}

.hero-dot.active {
  background: var(--accent);
  width: 30px;
  border-radius: 5px;
}

.catalogue-section {
  margin-top: 2rem;
}

/* Rows (Netflix-like) */
.rows-container {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.row-section {
  position: relative;
}

.row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.row-header h3 {
  font-size: 1.1rem;
  margin: 0;
}

.row-nav {
  display: flex;
  gap: 0.45rem;
}

.row-nav-left, .row-nav-right {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: none;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  cursor: pointer;
}

.row-track-wrap {
  overflow: hidden;
}

.row-track {
  display: flex;
  gap: 0.8rem;
  padding-bottom: 4px;
  overflow-x: auto;
  scroll-behavior: smooth;
}

.row-track::-webkit-scrollbar { height: 8px; }
.row-track::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 999px; }

.row-item {
  min-width: 220px;
  max-width: 220px;
  flex: 0 0 auto;
}

.row-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16 !important;
  object-fit: cover;
  display: block;
}

/* Search suggestions */
.search-suggestions {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 68px; /* place lower under the header */
  width: min(760px, 94%);
  background: linear-gradient(180deg, rgba(8,9,14,0.98), rgba(6,8,14,0.95));
  border: 1px solid rgba(255,255,255,0.06);
  margin-top: 8px;
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.6);
  z-index: 1000;
  max-height: 360px;
  overflow: auto;
  padding: 6px;
}

.search-suggestions .suggest-item {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.7rem;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  border-radius: 8px;
}

.search-suggestions .suggest-item:hover { background: rgba(255,255,255,0.03); }

.suggest-thumb {
  width: 64px;
  height: 90px;
  aspect-ratio: 9 / 16 !important;
  object-fit: cover;
  border-radius: 6px;
  flex: 0 0 auto;
  display: block;
}
.suggest-meta { display: flex; flex-direction: column; }
.suggest-title { font-weight: 600; }
.suggest-sub { color: var(--text-muted); font-size: 0.85rem; margin-top: 3px; }

/* Selected suggestion */
.search-suggestions .suggest-item.selected {
  background: linear-gradient(90deg, rgba(124,58,237,0.12), rgba(236,72,153,0.06));
  outline: 2px solid rgba(124,58,237,0.12);
}

.genre-filter-section {
  margin: 0;
  padding: 0.5rem;
  background: transparent;
  border: none;
  width: auto;
  box-shadow: none;
  position: relative;
}

.type-filter-section {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-left: 1rem;
}

.type-filter-section .filter-chip {
  min-width: 100px;
  height: 44px;
  justify-content: center;
  padding: 0 0.9rem;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  font-size: 0.9rem;
}

.genre-dropdown {
  position: relative;
}

.genre-dropdown-btn {
  min-width: 100px;
  width: 100px;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0 0.9rem;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  backdrop-filter: blur(10px);
}

.genre-dropdown-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: scale(1.02);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.14);
}

.genre-dropdown-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  right: auto;
  transform: translateX(-50%) translateY(-10px);
  width: max-content;
  min-width: 500px;
  max-width: 620px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  background: rgba(6, 8, 14, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  padding: 1rem;
  box-shadow: 0 24px 42px rgba(0, 0, 0, 0.28);
  z-index: 999;
  pointer-events: none;
}

.genre-dropdown:hover .genre-dropdown-panel,
.genre-dropdown:focus-within .genre-dropdown-panel,
.genre-dropdown-panel:hover {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.genre-filter-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.genre-dropdown-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.85rem;
}

.filter-chip {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 36px;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.filter-chip:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 10px 16px rgba(0, 0, 0, 0.12);
}

.filter-chip.active,
.filter-chip.filter-clear:hover {
  border-color: var(--accent);
  background: rgba(236, 72, 153, 0.18);
}

.filter-chip-icon {
  display: inline-flex;
  width: 1.25rem;
  height: 1.25rem;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.genre-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.45rem 0 0;
}

.genre-tags span {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 0.75rem;
}

.serie-genres {
  margin-bottom: 0.8rem;
  color: var(--accent);
  font-size: 0.95rem;
}

/* --- Fiche série --- */
.detail-hero {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  padding: 1.2rem;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 18px 18px 0 0;
  background: rgba(16, 19, 31, 0.96);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  max-width: 980px;
  margin: 0 auto;
}

.detail-poster-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 0 0 300px;
  width: 300px;
}

.detail-poster-wrap img {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 9 / 16 !important;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.detail-content {
  display: grid;
  gap: 0.6rem;
  width: 100%;
  max-width: 680px;
  align-content: center;
  text-align: left;
}

.detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.detail-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(236, 72, 153, 0.2);
  color: #ffd6e8;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.detail-badge.secondary {
  background: rgba(124, 58, 237, 0.18);
  color: #e7dcff;
}

.detail-content h1 {
  font-size: clamp(1.5rem, 2.7vw, 2.1rem);
  margin-bottom: 0;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
  color: var(--text-muted);
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.82rem;
}

.meta-pill.muted {
  color: var(--text-muted);
}

.detail-synopsis {
  max-width: 58ch;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 0;
}

.detail-section {
  background: rgba(16, 19, 31, 0.96);
  border: 1px solid var(--border);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  padding: 0.85rem;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.18);
  max-width: 980px;
  margin: 0 auto;
}

#episodes-section {
  border-radius: 0;
  border-bottom: none;
  box-shadow: none;
}

.detail-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.detail-section-header h2 {
  font-size: 0.98rem;
}

.detail-count {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* OMDb detail block */
.omdb-content {
  background: var(--bg-strong);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--text);
}
.omdb-poster {
  width: 200px;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: var(--shadow);
  margin-right: 1rem;
}
.omdb-images {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.6rem;
}
.detail-plot p {
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.action-button.small {
  padding: 0.45rem 0.8rem;
  font-size: 0.9rem;
  border-radius: 6px;
}

/* --- Page lecture --- */
.player-container {
  position: relative;
  width: 100%;
  max-width: 900px;
  aspect-ratio: 16/9;
  margin: 0 auto 1.5rem auto;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

.player-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

#video-title {
  max-width: 900px;
  margin: 0 auto 0.5rem auto;
}

#video-desc {
  max-width: 900px;
  margin: 0 auto;
  color: var(--text-muted);
}


.player-nav-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.9rem 0 0.9rem;
}

.player-nav-buttons .action-button {
  min-width: 170px;
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.85rem 1.4rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.player-nav-buttons .action-button:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-1px);
}

.player-nav-buttons .action-button.secondary {
  background: #3a66c0;
}

.player-nav-buttons .action-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.meta-saisons {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}


/* --- Onglets saisons --- */
.saisons-tabs {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}

.saison-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.saison-tab:hover {
  transform: translateY(-1px);
  border-color: rgba(236, 72, 153, 0.35);
}

.saison-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
}

/* --- Liste d'épisodes --- */
.episodes-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.episode-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.episode-row:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(236, 72, 153, 0.25);
}

.episode-numero {
  color: #ffd6e8;
  font-weight: 700;
  min-width: 2.8rem;
}

@media (max-width: 760px) {
  main {
    padding: 1rem 0.9rem 2rem;
  }

  .detail-hero {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    gap: 1rem;
  }

  .detail-poster-wrap {
    width: 100%;
    flex-basis: auto;
  }

  .detail-poster-wrap img {
    width: min(220px, 72vw);
    max-width: 220px;
  }

  .detail-content {
    width: 100%;
    max-width: none;
  }

  .detail-content h1 {
    font-size: 1.7rem;
  }

  .detail-synopsis {
    max-width: none;
    font-size: 0.88rem;
  }

  .detail-section-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* --- Infos sous le lecteur --- */
.video-infos {
  max-width: 900px;
  margin: 0 auto;
}

.retour-serie {
  display: inline-block;
  margin-bottom: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

.retour-serie:hover {
  text-decoration: underline;
}

/* --- Commentaires d'épisode --- */
.commentaires {
  max-width: 900px;
  margin: 2.5rem auto 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid #2a2a33;
}

.commentaires-titre {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

#commentaires-compteur {
  color: var(--text-muted);
  font-weight: 400;
}

.commentaire-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.8rem;
}

.commentaire-input,
.commentaire-textarea {
  background: var(--bg-card);
  border: 1px solid #2a2a33;
  color: var(--text);
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  width: 100%;
}

.commentaire-input:focus,
.commentaire-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.commentaire-input {
  max-width: 260px;
}

.commentaire-textarea {
  resize: vertical;
  line-height: 1.5;
}

.commentaire-form-bas {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.commentaire-form-bas button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.commentaire-form-bas button:hover:not(:disabled) {
  opacity: 0.9;
}

.commentaire-form-bas button:disabled {
  opacity: 0.5;
  cursor: default;
}

.commentaire-erreur {
  color: #ff6b6b;
  font-size: 0.85rem;
  min-height: 1rem;
}

.commentaires-liste {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.commentaire {
  background: var(--bg-card);
  border-radius: 6px;
  padding: 0.8rem 1rem;
}

.commentaire-meta {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.commentaire-pseudo {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
}

.commentaire-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.commentaire-texte {
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.commentaires-vide {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* --- Footer --- */
.site-footer {
  text-align: center;
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid #2a2a33;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  align-items: center;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.admin-link:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .site-header {
    justify-content: center;
  }

  .header-center {
    position: static;
    order: 3;
    width: 100%;
    transform: none;
    flex-wrap: wrap;
  }

  #search-bar {
    width: min(320px, 55%);
  }

  .genre-dropdown-panel {
    min-width: min(500px, calc(100vw - 2rem));
  }
}

@media (max-width: 600px) {
  main {
    padding: 1rem;
  }

  .site-header,
  .header-center,
  .type-filter-section {
    gap: 0.5rem;
  }

  .logo {
    font-size: 1.6rem;
  }

  #search-bar {
    order: 2;
    width: 100%;
  }

  .type-filter-section {
    margin-left: 0;
  }

  .type-filter-section .filter-chip {
    min-width: auto;
  }

  .hero-carousel {
    height: 260px;
    --poster-w: 130px;
    --gap-1: 100px;
    --gap-2: 175px;
    --gap-3: 240px;
    --gap-4: 300px;
  }

  .hero-info h2 {
    font-size: 1.5rem;
  }

  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

/* === Fond Option 1 : quadrillage diagonal discret === */
html {
  background-color: #08090d;
  background-image:
    linear-gradient(45deg, transparent 49%, rgba(104, 58, 116, 0.20) 50%, transparent 51%),
    linear-gradient(-45deg, transparent 49%, rgba(104, 58, 116, 0.20) 50%, transparent 51%);
  background-size: 56px 56px;
  background-attachment: fixed;
}

body {
  background-color: #08090d;
  background-image:
    linear-gradient(45deg, transparent 49%, rgba(104, 58, 116, 0.20) 50%, transparent 51%),
    linear-gradient(-45deg, transparent 49%, rgba(104, 58, 116, 0.20) 50%, transparent 51%);
  background-size: 56px 56px;
  background-attachment: fixed;
}

/* === Modernisation recherche + responsive mobile === */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: min(360px, 30vw);
  min-width: 260px;
  height: 44px;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(8, 9, 13, 0.82);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 8px 24px rgba(0,0,0,.18);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, background .2s ease;
  backdrop-filter: blur(14px);
}

.search-box:focus-within {
  border-color: rgba(236, 72, 153, .75);
  background: rgba(12, 12, 20, .96);
  box-shadow: 0 0 0 3px rgba(236, 72, 153, .10), 0 0 28px rgba(236, 72, 153, .12);
}

.search-icon {
  flex: 0 0 auto;
  width: 42px;
  text-align: center;
  color: #b9bac5;
  font-size: 1.5rem;
  line-height: 1;
  transform: rotate(-20deg);
  pointer-events: none;
}

#search-bar {
  width: 100%;
  height: 100%;
  min-width: 0;
  margin: 0;
  padding: 0 0.55rem 0 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: .9rem;
}

#search-bar::placeholder {
  color: #777985;
}

#search-bar::-webkit-search-cancel-button {
  filter: invert(1) opacity(.65);
}

.search-shortcut {
  flex: 0 0 auto;
  margin-right: 7px;
  padding: 4px 7px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 7px;
  background: rgba(255,255,255,.05);
  color: #858693;
  font: 600 .68rem/1 "Segoe UI", Arial, sans-serif;
  white-space: nowrap;
  cursor: pointer;
}

.search-shortcut:hover {
  color: var(--text);
  background: rgba(255,255,255,.09);
}

@media (max-width: 1100px) {
  .site-header {
    padding-inline: 1rem;
  }

  .logo {
    font-size: 1.75rem;
  }

  .header-center {
    gap: .45rem;
  }

  .type-filter-section {
    margin-left: .35rem;
  }

  .type-filter-section .filter-chip,
  .genre-dropdown-btn {
    min-width: 88px;
    width: 88px;
  }

  .search-box {
    width: min(310px, 26vw);
    min-width: 220px;
  }
}

@media (max-width: 900px) {
  .site-header {
    position: sticky;
    top: 0;
    justify-content: space-between;
    align-items: center;
    padding: .7rem .85rem;
    gap: .65rem;
  }

  .header-center {
    position: static;
    left: auto;
    top: auto;
    transform: none;
    order: 3;
    flex: 1 0 100%;
    width: 100%;
    justify-content: center;
    flex-wrap: nowrap;
  }

  .search-box {
    order: 2;
    width: min(360px, 40vw);
    min-width: 220px;
  }

  .genre-dropdown-panel {
    max-width: calc(100vw - 1.5rem);
  }
}

@media (max-width: 600px) {
  .site-header {
    display: grid;
    grid-template-columns: 1fr;
    padding: .7rem .75rem .8rem;
    gap: .65rem;
  }

  .logo {
    justify-self: center;
    font-size: 1.65rem;
    line-height: 1;
  }

  .search-box {
    grid-row: 2;
    width: 100%;
    min-width: 0;
    height: 46px;
    margin: 0;
    border-radius: 15px;
  }

  .search-icon {
    width: 40px;
  }

  .search-shortcut {
    padding: 5px 7px;
  }

  .header-center {
    grid-row: 3;
    width: 100%;
    flex: none;
    gap: .45rem;
    justify-content: stretch;
  }

  .genre-filter-section {
    padding: 0;
    flex: 1;
  }

  .genre-dropdown,
  .genre-dropdown-btn,
  .type-filter-section,
  .type-filter-section .filter-chip {
    width: 100%;
    min-width: 0;
  }

  .type-filter-section {
    display: flex;
    flex: 2;
    margin: 0;
    gap: .4rem;
  }

  .type-filter-section .filter-chip {
    height: 42px;
    padding-inline: .5rem;
  }

  .genre-dropdown-btn {
    height: 42px;
    padding-inline: .5rem;
  }

  .genre-dropdown-panel {
    position: fixed;
    top: auto;
    left: .75rem;
    right: .75rem;
    bottom: .75rem;
    width: auto;
    min-width: 0;
    max-width: none;
    max-height: 70vh;
    transform: translateY(12px);
    border-radius: 18px;
    padding: .85rem;
  }

  .genre-dropdown:hover .genre-dropdown-panel,
  .genre-dropdown:focus-within .genre-dropdown-panel,
  .genre-dropdown-panel:hover {
    transform: translateY(0);
  }

  main {
    padding: 1rem .75rem 1.5rem;
  }

  .hero-slider {
    margin-bottom: 2rem;
  }

  .hero-carousel {
    height: 255px;
    --poster-w: 132px;
    --gap-1: 92px;
    --gap-2: 158px;
    --gap-3: 220px;
    --gap-4: 275px;
    overflow: hidden;
    border-radius: 18px;
  }

  .hero-item {
    border-radius: 12px;
  }

  .hero-nav {
    gap: .7rem;
    margin-bottom: .9rem;
  }

  .hero-nav-btn {
    width: 38px;
    height: 38px;
  }

  .hero-dots {
    gap: .35rem;
    max-width: 150px;
    overflow: hidden;
  }

  .hero-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
  }

  .hero-dot.active {
    width: 22px;
  }

  .hero-info {
    padding: 0 .5rem;
  }

  .hero-info h2 {
    font-size: 1.45rem;
    margin-bottom: .45rem;
  }

  .hero-info .meta {
    margin-bottom: .6rem;
  }

  .hero-info p.synopsis {
    font-size: .86rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .hero-info-btn {
    padding: .7rem 1.5rem;
    border-radius: 10px;
  }

  .catalogue-section {
    margin-top: 1.5rem;
  }

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

  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
  }

  .video-card {
    border-radius: 10px;
  }

  .video-card .video-info {
    padding: .55rem;
  }

  .video-card .video-info h3 {
    font-size: .82rem;
    line-height: 1.25;
  }

  .genre-tags {
    gap: .25rem;
  }

  .genre-tags span {
    font-size: .66rem;
    padding: .2rem .4rem;
  }

  .serie-fiche {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .serie-fiche img {
    width: min(190px, 60vw);
  }

  .serie-infos {
    min-width: 0;
    width: 100%;
  }

  .serie-actions {
    justify-content: center;
  }

  .player-container {
    border-radius: 10px;
  }

  .commentaire-form-bas {
    align-items: stretch;
    flex-direction: column;
  }

  .commentaire-input {
    max-width: none;
  }

  .commentaire-form-bas button {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .logo {
    font-size: 1.5rem;
  }

  .header-center {
    gap: .3rem;
  }

  .type-filter-section .filter-chip,
  .genre-dropdown-btn {
    font-size: .78rem;
  }

  .hero-carousel {
    height: 230px;
    --poster-w: 118px;
    --gap-1: 82px;
    --gap-2: 140px;
    --gap-3: 190px;
    --gap-4: 240px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .search-box,
  .hero-item,
  .video-card {
    transition: none;
  }
}

/* Compte utilisateur Firebase */
.site-header .user-menu {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-width: 180px;
  margin-left: 1rem;
}
.site-header .user-menu-button {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}
.site-header .user-menu-button:hover {
  background: rgba(236, 72, 153, 0.14);
  border-color: rgba(236, 72, 153, 0.4);
  transform: translateY(-1px);
}
.site-header .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.9), rgba(255, 120, 180, 0.85));
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}
.site-header .user-name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.95rem;
  font-weight: 600;
}
.site-header .user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 220px;
  padding: 0.9rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.45);
  z-index: 15;
}
.site-header .user-menu-email {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 0.85rem;
  word-break: break-word;
}
.site-header .user-menu-panel button {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.9rem;
  background: rgba(236, 72, 153, 0.1);
  color: var(--text);
}
.site-header .user-menu-panel button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
@media (max-width: 900px) {
  .site-header .user-menu .user-name { display: none; }
}
