/* ==========================================================================
   DoomTV — Estilos del sitio
   Se carga DESPUÉS de app.css (Tailwind) y tiene la última palabra.

   Sigue el sistema del sitio en producción: fondo #141414, rojo de marca
   #E50914 e Inter. Aquí solo vive lo que Tailwind no cubre: navbar, tarjetas
   con overlay, ficha de detalle y accesibilidad del movimiento.
   ========================================================================== */

:root {
  --brand:       #e50914;
  --brand-dark:  #b81d24;
  --brand-light: #ff2d38;

  --dp-void:   #0a0a0a;
  --dp-base:   #141414;
  --dp-surf-1: #1c1c1c;
  --dp-surf-2: #242424;
  --dp-surf-3: #2c2c2c;
  --dp-surf-4: #3c3c3c;

  --dp-text:   #ffffff;
  --dp-muted:  #9ca3af;
  --dp-subtle: #6b7280;

  --dp-accent:   #e50914;
  --dp-accent-l: #ff2d38;
  --dp-accent-d: #b81d24;
  --dp-accent-g: rgba(229, 9, 20, 0.1);
  --dp-red:      #e50914;
  --dp-gold:     #f5c518;
  --dp-blue:     #1f6feb;

  --dp-glow-accent: 0 0 24px rgba(229, 9, 20, 0.35);
  --dp-shadow-deep: 0 20px 50px rgba(0, 0, 0, 0.7);

  /* Curvas: ease-out para todo lo que entra, spring solo en popovers. */
  --dp-ease-out:    cubic-bezier(0.23, 1, 0.32, 1);
  --dp-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --dp-t-fast: 160ms;
  --dp-t-mid:  280ms;
  --dp-t-slow: 400ms;

  --dp-font-body:    'Inter', system-ui, sans-serif;
  --dp-font-display: 'Inter', system-ui, sans-serif;

  --dp-r-inner: 8px;
  --dp-r-card:  12px;
  --dp-r-panel: 14px;
  --dp-r-pill:  999px;
  --dp-r-input: 8px;
}

/* ==========================================================================
   BASE
   ========================================================================== */

body {
  background: var(--dp-base);
  color: #fff;
  font-family: var(--dp-font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(229, 9, 20, 0.4); color: #fff; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--dp-surf-1); }
::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand); }

.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

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

.glass {
  background: rgba(20, 20, 20, 0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/* ==========================================================================
   DISPLAY BASE
   Va en :where() a propósito: así tiene especificidad 0 y cualquier utilidad
   de Tailwind (hidden, lg:hidden, md:inline-flex…) la sobrescribe.

   Sin esto, declarar `display` aquí ganaba a `.lg\:hidden` —misma
   especificidad, pero esta hoja carga después— y el botón del menú
   hamburguesa seguía visible en escritorio.
   ========================================================================== */

:where(.dp-logo)         { display: inline-flex; }
:where(.dp-burger)       { display: grid; }
:where(.dp-btn-primary),
:where(.dp-btn-glass),
:where(.dp-btn-download),
:where(.dp-btn-ghost),
:where(.dp-btn-accent)   { display: inline-flex; }
:where(.dp-genre-chip)   { display: inline-block; }
:where(.dp-season-select){ display: inline-block; }
:where(.dp-to-top)       { display: grid; }

/* ==========================================================================
   NAVBAR
   Uso constante: solo cambian color y fondo, ningún transform.
   ========================================================================== */

#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: linear-gradient(to bottom, rgba(20, 20, 20, 0.95), transparent);
  transition: background var(--dp-t-mid), box-shadow var(--dp-t-mid);
}

#navbar.scrolled {
  background: rgba(20, 20, 20, 0.98);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}

.dp-logo { align-items: center; }
.dp-logo img { height: 36px; width: auto; object-fit: contain; }

.nav-link {
  position: relative;
  font-size: 0.875rem;
  font-weight: 500;
  color: #d1d5db;
  padding: 4px 0;
  white-space: nowrap;
  transition: color var(--dp-t-fast);
}

.nav-link:hover,
.nav-link.active { color: #fff; }

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--brand);
  transition: width var(--dp-t-mid) var(--dp-ease-out);
}

.nav-link:hover::after,
.nav-link.active::after { width: 100%; }

/* ── Buscador ─────────────────────────────────────────────────────────── */
.dp-search-wrap { position: relative; }

.dp-search {
  width: 100%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--dp-r-pill);
  color: #fff;
  font-size: 0.85rem;
  padding: 9px 15px 9px 38px;
  transition: border-color var(--dp-t-fast), background var(--dp-t-fast);
}

.dp-search::placeholder { color: #6b7280; }

.dp-search:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--brand);
}

.dp-search-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  color: #6b7280;
  pointer-events: none;
}

/* ── Desplegables ─────────────────────────────────────────────────────── */
.nav-dropdown-wrapper { position: relative; }

.nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  min-width: 210px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 6px;
  background: rgba(20, 20, 20, 0.98);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--dp-surf-3);
  border-radius: var(--dp-r-card);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.75);
  z-index: 110;
  /* Se abre pocas veces por sesión: animación justificada. */
  animation: dp-dropdown-in var(--dp-t-mid) var(--dp-ease-out) both;
  transform-origin: top left;
}

@keyframes dp-dropdown-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nav-dropdown-panel a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  color: #d1d5db;
  transition: background var(--dp-t-fast), color var(--dp-t-fast);
}

.nav-dropdown-panel a:hover { background: rgba(229, 9, 20, 0.14); color: #fff; }

.dp-mobile-menu {
  background: rgba(20, 20, 20, 0.98);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--dp-surf-3);
  animation: dp-dropdown-in var(--dp-t-mid) var(--dp-ease-out) both;
}

.dp-mobile-menu .nav-link {
  display: block;
  padding: 12px 4px;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dp-burger {
  width: 38px; height: 38px;
  place-items: center;
  border-radius: var(--dp-r-inner);
  color: #fff;
  transition: background var(--dp-t-fast);
}

.dp-burger:hover { background: rgba(255, 255, 255, 0.08); }

/* ==========================================================================
   HÉROE
   ========================================================================== */

.hero-gradient {
  background:
    linear-gradient(to right, rgba(20, 20, 20, 0.95) 40%, rgba(20, 20, 20, 0.3) 100%),
    linear-gradient(to top, rgba(20, 20, 20, 1) 0%, transparent 60%);
}

/* ==========================================================================
   TARJETA DEL CATÁLOGO
   El overlay solo aparece con ratón. En táctil no hay hover que lo revele,
   así que el título vive siempre bajo el póster y nada queda oculto.
   ========================================================================== */

.movie-card img { transition: transform var(--dp-t-slow) ease; }
.movie-overlay { transition: opacity var(--dp-t-mid) ease; }

@media (hover: hover) and (pointer: fine) {
  .movie-card { transition: transform var(--dp-t-mid) var(--dp-ease-out); }
  .movie-card:hover { transform: translateY(-4px); }
  .movie-card:hover .movie-overlay { opacity: 1; }
  .movie-card:hover img { transform: scale(1.05); }
}

@media (hover: none) {
  .movie-overlay { display: none; }
}

/* ==========================================================================
   BOTONES Y CHIPS
   ========================================================================== */

.btn-brand {
  background: var(--brand);
  transition: background var(--dp-t-fast), transform var(--dp-t-fast) var(--dp-ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .btn-brand:hover { background: var(--brand-dark); transform: scale(1.03); }
}

/* :active sí aplica en táctil: confirma que la interfaz recibió el toque. */
.btn-brand:active { transform: scale(0.97); }

.rating-star::before { content: '★'; color: var(--dp-gold); margin-right: 4px; }

.genre-chip {
  transition: background var(--dp-t-fast), border-color var(--dp-t-fast), color var(--dp-t-fast);
}

@media (hover: hover) and (pointer: fine) {
  .genre-chip:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
}

.dp-btn-primary {
  align-items: center; justify-content: center; gap: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 12px 26px;
  border: 0;
  border-radius: var(--dp-r-pill);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(229, 9, 20, 0.28);
  transition: background var(--dp-t-fast), transform var(--dp-t-fast) var(--dp-ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .dp-btn-primary:hover { background: var(--brand-dark); transform: scale(1.03); }
}

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

.dp-btn-glass,
.dp-btn-download {
  align-items: center; justify-content: center; gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 12px 24px;
  border-radius: var(--dp-r-pill);
  cursor: pointer;
  transition: background var(--dp-t-fast), border-color var(--dp-t-fast),
              transform var(--dp-t-fast) var(--dp-ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .dp-btn-glass:hover,
  .dp-btn-download:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.32);
  }
}

.dp-btn-glass:active,
.dp-btn-download:active { transform: scale(0.97); }

.dp-btn-ghost {
  align-items: center; gap: 6px;
  border: 1px solid var(--dp-surf-4);
  color: #d1d5db;
  border-radius: var(--dp-r-pill);
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 500;
  transition: background var(--dp-t-fast), border-color var(--dp-t-fast), color var(--dp-t-fast);
}

.dp-btn-ghost:hover { background: var(--brand); border-color: var(--brand); color: #fff; }

.dp-btn-accent {
  align-items: center; justify-content: center; gap: 7px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 10px 22px;
  border: 0;
  border-radius: var(--dp-r-pill);
  cursor: pointer;
  transition: background var(--dp-t-fast), transform var(--dp-t-fast) var(--dp-ease-out);
}

.dp-btn-accent:hover { background: var(--brand-dark); }
.dp-btn-accent:active { transform: scale(0.97); }

/* ==========================================================================
   FICHA DE DETALLE
   ========================================================================== */

.dp-detail-hero { position: relative; overflow: hidden; }

.dp-detail-backdrop {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center top;
  filter: brightness(0.3);
}

.dp-detail-gradient {
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, rgba(20, 20, 20, 0.96) 35%, rgba(20, 20, 20, 0.45) 100%),
    linear-gradient(to top, var(--dp-base) 0%, transparent 55%),
    linear-gradient(to bottom, rgba(20, 20, 20, 0.9) 0%, transparent 22%);
}

.dp-detail-poster {
  width: 100%;
  border-radius: var(--dp-r-card);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
}

.dp-detail-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 1.1;
  color: #fff;
}

.dp-detail-overview {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #d1d5db;
  max-width: 68ch;
}

/* Logo tipográfico del título, servido por TMDB. */
.dp-title-logo {
  max-width: min(420px, 80%);
  max-height: 130px;
  width: auto; height: auto;
  object-fit: contain;
  object-position: left bottom;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.8));
}

@media (max-width: 768px) {
  .dp-title-logo { max-height: 90px; max-width: 85%; }
}

.dp-genre-chip {
  background: var(--dp-blue);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 500;
  padding: 4px 13px;
  border-radius: var(--dp-r-inner);
  transition: background var(--dp-t-fast);
}

@media (hover: hover) and (pointer: fine) {
  .dp-genre-chip:hover { background: #3b82f6; }
}

/* ── Panel lateral: valoración de TMDB y QR ───────────────────────────── */
.dp-side-panel {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--dp-r-panel);
  padding: 18px;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.dp-tmdb {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: rgba(10, 10, 10, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 14px;
}

.dp-tmdb__brand {
  font-weight: 800;
  font-size: 0.72rem;
  line-height: 1.05;
  color: #fff;
  text-transform: uppercase;
}

.dp-tmdb__ring { position: relative; width: 46px; height: 46px; flex: none; }
.dp-tmdb__ring svg { width: 46px; height: 46px; transform: rotate(-90deg); }

.dp-tmdb__score {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-weight: 700; font-size: 0.86rem; color: #fff;
}

/* ── Bloque "Información" ──────────────────────────────────────────────── */
.dp-info-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.1rem; font-weight: 700; color: #fff;
  margin-bottom: 12px;
}

.dp-info-row { display: flex; gap: 10px; padding: 5px 0; font-size: 0.88rem; line-height: 1.5; }
.dp-info-row dt { flex: none; min-width: 110px; color: var(--dp-muted); }
.dp-info-row dd { margin: 0; color: #e5e7eb; }

.dp-alt-title {
  display: inline-block;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 6px;
  color: #d1d5db;
  font-size: 0.74rem;
  padding: 3px 9px;
  margin: 0 5px 5px 0;
}

/* ── Reparto ──────────────────────────────────────────────────────────── */
.dp-rail > * { flex: none; scroll-snap-align: start; }

/* ── Carrusel de tarjetas ─────────────────────────────────────────────── */
/*
   En la rejilla es la celda la que da el ancho a la tarjeta. En un carrusel
   no hay celda, y sin ancho propio el póster colapsa a cero.

   El ancho sale de la MISMA cuenta que hace .dp-grid —ancho disponible menos
   los huecos, dividido entre las columnas de ese corte— en lugar de unos
   valores en vw calculados a ojo. Con vw quedaba a diez píxeles de la rejilla
   en tablet, y dos filas de pósters casi iguales se nota más que dos
   claramente distintas.

   Las columnas y los huecos replican los de .dp-grid en input.css: si allí
   cambian, hay que cambiarlos aquí.
*/
.dp-rail--cards {
  --dp-cols: 2;
  --dp-gap: 0.75rem;
  gap: var(--dp-gap);
}

.dp-rail--cards > * {
  width: calc((100% - (var(--dp-cols) - 1) * var(--dp-gap)) / var(--dp-cols));
}

@media (min-width: 640px)  { .dp-rail--cards { --dp-cols: 3; --dp-gap: 1rem; } }
@media (min-width: 768px)  { .dp-rail--cards { --dp-cols: 4; } }
@media (min-width: 1024px) { .dp-rail--cards { --dp-cols: 5; } }
@media (min-width: 1280px) { .dp-rail--cards { --dp-cols: 6; } }

/*
   Variante apaisada, para los capítulos: la imagen es 16:9 en vez de un
   póster 2:3, así que caben bastantes menos por fila.

   En móvil son 1,25 columnas a propósito. Con una justa, el carrusel parece
   una tarjeta suelta y nadie adivina que se desliza; el trozo de la siguiente
   asomando es lo que lo dice sin escribirlo.
*/
.dp-rail--wide {
  --dp-cols: 1.25;
  --dp-gap: 0.75rem;
  gap: var(--dp-gap);
}

.dp-rail--wide > * {
  width: calc((100% - (var(--dp-cols) - 1) * var(--dp-gap)) / var(--dp-cols));
}

@media (min-width: 640px)  { .dp-rail--wide { --dp-cols: 2.25; --dp-gap: 1rem; } }
@media (min-width: 768px)  { .dp-rail--wide { --dp-cols: 3; } }
@media (min-width: 1024px) { .dp-rail--wide { --dp-cols: 4; } }
@media (min-width: 1280px) { .dp-rail--wide { --dp-cols: 5; } }

.dp-cast-item { width: 92px; flex: none; }

.dp-cast-photo {
  width: 92px; height: 92px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--dp-surf-2);
  margin-bottom: 8px;
}

.dp-cast-name { font-size: 0.76rem; font-weight: 500; color: #fff; line-height: 1.3; }
.dp-cast-role { font-size: 0.7rem; color: var(--dp-muted); line-height: 1.3; margin-top: 2px; }

/* ==========================================================================
   TEMPORADAS Y EPISODIOS
   Desplegable en vez de carrusel: hay series con más de 30 temporadas.
   ========================================================================== */

.dp-season-select { position: relative; min-width: 240px; }

.dp-season-select select {
  appearance: none; -webkit-appearance: none;
  width: 100%;
  background: var(--dp-surf-1);
  border: 1px solid var(--dp-surf-4);
  border-radius: var(--dp-r-inner);
  color: #fff;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 11px 40px 11px 15px;
  cursor: pointer;
  transition: border-color var(--dp-t-fast);
}

.dp-season-select select:focus { outline: none; border-color: var(--brand); }
.dp-season-select select option { background: var(--dp-surf-1); color: #fff; }

.dp-season-select::after {
  content: '';
  position: absolute;
  right: 16px; top: 50%;
  width: 9px; height: 9px;
  margin-top: -6px;
  border-right: 2px solid var(--dp-muted);
  border-bottom: 2px solid var(--dp-muted);
  transform: rotate(45deg);
  pointer-events: none;
}

.dp-season-count { font-size: 0.85rem; color: var(--dp-muted); }

/* Fila de episodio: estructura plana, sin tarjeta dentro de tarjeta. */
.dp-episode {
  display: flex; gap: 13px; align-items: flex-start;
  width: 100%;
  padding: 10px;
  border-radius: var(--dp-r-card);
  background: var(--dp-surf-1);
  border: 1px solid var(--dp-surf-3);
  text-align: left;
  cursor: pointer;
  transition: background var(--dp-t-fast), border-color var(--dp-t-fast);
}

.dp-episode.active { background: rgba(229, 9, 20, 0.12); border-color: rgba(229, 9, 20, 0.4); }
.dp-episode[data-nolinks='1'] { opacity: 0.45; cursor: not-allowed; }

@media (hover: hover) and (pointer: fine) {
  .dp-episode:hover:not([data-nolinks='1']) {
    background: var(--dp-surf-2);
    border-color: var(--dp-surf-4);
  }
}

.dp-episode__still {
  width: 128px; flex: none;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--dp-r-inner);
  background: var(--dp-surf-2);
}

.dp-episode__code { font-size: 0.72rem; font-weight: 700; color: var(--brand); }
.dp-episode__title { font-size: 0.88rem; font-weight: 500; color: #fff; line-height: 1.35; margin-top: 2px; }

.dp-episode__desc {
  font-size: 0.76rem; color: var(--dp-muted); line-height: 1.5; margin-top: 5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

@media (max-width: 640px) {
  .dp-episode__still { width: 96px; }
  .dp-episode__desc { display: none; }
}

/* ==========================================================================
   SECCIONES Y UTILIDADES
   ========================================================================== */

.dp-section { padding-block: 2.5rem; }
.dp-section-sub { font-size: 0.85rem; color: var(--dp-muted); margin-top: 4px; }

.dp-label {
  display: block; font-size: 0.7rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--dp-subtle); margin-bottom: 6px;
}

.dp-fact-value { font-size: 0.88rem; font-weight: 500; color: #fff; }
.dp-detail-meta { font-size: 0.85rem; color: var(--dp-muted); }

.dp-text-accent { color: var(--brand); }
.dp-text-muted  { color: var(--dp-muted); }
.dp-text-gold   { color: var(--dp-gold); }
.dp-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dp-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.dp-empty { padding: 3rem 0; max-width: 46ch; }
.dp-empty__title { font-size: 1.15rem; font-weight: 700; color: #fff; margin-bottom: 0.5rem; }
.dp-empty__text { font-size: 0.9rem; line-height: 1.6; color: var(--dp-muted); margin-bottom: 1.25rem; }

/* ==========================================================================
   FOOTER
   ========================================================================== */

.dp-footer {
  background: var(--dp-surf-1);
  border-top: 1px solid var(--dp-surf-3);
  padding-block: 2.5rem 1.5rem;
  margin-top: 3rem;
}

.dp-footer-heading {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: #fff; margin-bottom: 0.9rem;
}

.dp-footer a {
  display: inline-block;
  font-size: 0.84rem;
  color: var(--dp-muted);
  transition: color var(--dp-t-fast);
}

.dp-footer a:hover { color: #fff; }

.dp-footer-divider {
  height: 1px; border: 0;
  background: var(--dp-surf-3);
  margin-block: 1.6rem 1.1rem;
}

.dp-footer-legal { font-size: 0.78rem; color: var(--dp-subtle); line-height: 1.6; }

/* ==========================================================================
   SCROLL REVEAL
   El estado oculto vive tras .dp-js, que añade un script del <head>. Sin
   JavaScript el contenido está visible: un revelado nunca debe poder
   esconder el catálogo de forma permanente.
   ========================================================================== */

.dp-reveal {
  transition: opacity var(--dp-t-slow) var(--dp-ease-out),
              transform var(--dp-t-slow) var(--dp-ease-out);
}

.dp-js .dp-reveal { opacity: 0; transform: translateY(16px); }
.dp-js .dp-reveal.is-visible { opacity: 1; transform: translateY(0); }

.dp-reveal--d1 { transition-delay: 50ms; }
.dp-reveal--d2 { transition-delay: 100ms; }
.dp-reveal--d3 { transition-delay: 150ms; }
.dp-reveal--d4 { transition-delay: 200ms; }

/* ── Volver arriba ────────────────────────────────────────────────────── */
.dp-to-top {
  position: fixed;
  bottom: 24px; right: 22px;
  z-index: 200;
  width: 42px; height: 42px;
  place-items: center;
  border: 0; border-radius: 50%;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  transition: opacity var(--dp-t-mid) var(--dp-ease-out),
              transform var(--dp-t-mid) var(--dp-ease-out),
              background var(--dp-t-fast);
}

.dp-to-top.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }

@media (hover: hover) and (pointer: fine) {
  .dp-to-top:hover { background: var(--brand-dark); }
}

/* ── Tooltip ──────────────────────────────────────────────────────────── */
.dp-tooltip {
  position: absolute; z-index: 300;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(10, 10, 10, 0.96);
  border: 1px solid var(--dp-surf-4);
  color: #fff;
  font-size: 0.74rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 125ms var(--dp-ease-out), transform 125ms var(--dp-ease-out);
}

.dp-tooltip.is-visible { opacity: 1; transform: translateY(0); }
.dp-tooltip[data-instant='1'] { transform: none; transition: opacity 0ms; }

/* Imágenes en lazy: el JS las lleva a opacidad 1 al cargar. */
img[loading='lazy'] { transition: opacity 300ms var(--dp-ease-out); }

/* ==========================================================================
   REDUCED MOTION
   Se conservan color y opacidad; se elimina todo movimiento.
   ========================================================================== */

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

  .dp-reveal,
  .dp-js .dp-reveal {
    transform: none !important;
    opacity: 1 !important;
  }

  .movie-card:hover,
  .movie-card:hover img,
  .btn-brand:hover, .btn-brand:active,
  .dp-btn-primary:hover, .dp-btn-primary:active,
  .dp-btn-glass:active, .dp-btn-download:active,
  .dp-to-top, .dp-to-top.is-visible,
  .dp-tooltip {
    transform: none !important;
  }

  .nav-dropdown-panel,
  .dp-mobile-menu { animation: none !important; }
}

/* ==========================================================================
   AJUSTES DEL MENÚ
   Con 19 géneros y 14 años, una lista vertical obligaba a hacer scroll
   dentro del propio desplegable. En columnas caben de una vez.
   ========================================================================== */

/*
   :not(.hidden) es obligatorio: display:grid tiene la misma especificidad
   que la .hidden de Tailwind y, al cargarse esta hoja después, ganaba
   siempre. El resultado era que los dos desplegables se veían a la vez.
*/
.nav-dropdown-panel--grid:not(.hidden) {
  display: grid;
  grid-template-columns: repeat(3, minmax(128px, 1fr));
  gap: 1px 4px;
  min-width: 420px;
  max-height: none;
  overflow: visible;
}

.nav-dropdown-panel--years:not(.hidden) {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px 4px;
  min-width: 250px;
  max-height: none;
  overflow: visible;
}

.nav-dropdown-panel--years a { text-align: center; }

/* El desplegable de la derecha no debe salirse por el borde de la pantalla. */
.nav-dropdown-wrapper:last-of-type .nav-dropdown-panel {
  left: auto;
  right: 0;
  transform-origin: top right;
}

@media (max-width: 1100px) {
  .nav-dropdown-panel--grid:not(.hidden) { grid-template-columns: repeat(2, minmax(120px, 1fr)); min-width: 280px; }
}

/* El navbar mide 64 px: el contenido de cada página arranca justo debajo. */
#navbar { height: auto; }

.dp-mobile-menu .dp-label { padding-left: 4px; }

/* ==========================================================================
   CLASES COMPARTIDAS CON EL PANEL
   El panel de administración reutiliza estos componentes. Se perdieron al
   repintar el sistema de cobre a rojo y sin ellos los formularios del admin
   quedaban sin estilo.
   ========================================================================== */

/* ── Cabeceras de sección ──────────────────────────────────────────────── */
.dp-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.dp-section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
}

/* La barra roja es el marcador de sección del panel. */
.dp-section-title::before {
  content: '';
  width: 3px;
  height: 1.05em;
  flex-shrink: 0;
  background: var(--brand);
  border-radius: var(--dp-r-pill);
}

.dp-section-link {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--brand);
  white-space: nowrap;
  transition: color var(--dp-t-fast);
}

.dp-section-link:hover { color: var(--brand-light); }

/* ── Campos de formulario ──────────────────────────────────────────────── */
.dp-input,
.dp-select {
  width: 100%;
  background: var(--dp-surf-1);
  border: 1px solid var(--dp-surf-4);
  border-radius: var(--dp-r-input);
  color: #fff;
  font-family: inherit;
  font-size: 0.875rem;
  padding: 10px 13px;
  transition: border-color var(--dp-t-fast), box-shadow var(--dp-t-fast);
}

.dp-input::placeholder { color: var(--dp-subtle); }

.dp-input:focus,
.dp-select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.14);
}

.dp-input:disabled,
.dp-select:disabled { opacity: 0.5; cursor: not-allowed; }

.dp-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  cursor: pointer;
}

.dp-select option { background: var(--dp-surf-1); color: #fff; }

textarea.dp-input { line-height: 1.6; }

/* ── Etiquetas y datos ─────────────────────────────────────────────────── */
.dp-fact-label {
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--dp-subtle);
}

.dp-text-subtle { color: var(--dp-subtle); }
.dp-text-accent-l { color: var(--brand-light); }

/* ── Chips ─────────────────────────────────────────────────────────────── */
.dp-chip {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 6px 15px;
  border-radius: var(--dp-r-pill);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--dp-surf-4);
  color: #d1d5db;
  white-space: nowrap;
  transition: background var(--dp-t-fast), border-color var(--dp-t-fast), color var(--dp-t-fast);
}

.dp-chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

@media (hover: hover) and (pointer: fine) {
  .dp-chip:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
}

/* ── Paginación ────────────────────────────────────────────────────────── */
.dp-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.dp-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 11px;
  border-radius: var(--dp-r-inner);
  font-size: 0.82rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--dp-surf-4);
  color: #d1d5db;
  transition: background var(--dp-t-fast), border-color var(--dp-t-fast), color var(--dp-t-fast);
}

.dp-page-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.dp-page-btn[aria-disabled='true'] { opacity: 0.35; pointer-events: none; }

@media (hover: hover) and (pointer: fine) {
  .dp-page-btn:hover:not(.active) { background: var(--dp-surf-2); color: #fff; }
}

/* ── Insignias de la ficha ─────────────────────────────────────────────── */
.dp-rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(245, 197, 24, 0.12);
  border: 1px solid rgba(245, 197, 24, 0.28);
  color: var(--dp-gold);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 5px 13px;
  border-radius: var(--dp-r-pill);
}

.dp-rating-badge::before { content: '★'; }

.dp-detail-tagline {
  font-style: italic;
  font-size: 0.95rem;
  color: #b9b9b9;
}

/* ── Pestañas de temporada (panel) ─────────────────────────────────────── */
.dp-season-tab {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--dp-r-pill);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--dp-surf-4);
  color: #d1d5db;
  white-space: nowrap;
  transition: background var(--dp-t-fast), border-color var(--dp-t-fast), color var(--dp-t-fast);
}

.dp-season-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }

@media (hover: hover) and (pointer: fine) {
  .dp-season-tab:hover:not(.active) { background: var(--dp-surf-2); color: #fff; }
}

/* ── Carga ─────────────────────────────────────────────────────────────── */
.dp-skeleton {
  background: linear-gradient(90deg, var(--dp-surf-1) 25%, var(--dp-surf-3) 50%, var(--dp-surf-1) 75%);
  background-size: 300% 100%;
  animation: dp-shimmer 1.8s linear infinite;
  border-radius: var(--dp-r-inner);
}

/* Movimiento constante ⇒ linear. Es la única animación lineal del sistema. */
@keyframes dp-shimmer {
  from { background-position: 300% 0; }
  to   { background-position: -300% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .dp-skeleton { animation: none !important; background: var(--dp-surf-2); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CANALES DE TV EN DIRECTO
   Un canal no lleva póster vertical: lo que identifica una señal es su logo,
   que suele venir apaisado y con fondo transparente. De ahí la tarjeta
   cuadrada con el logo centrado en vez de la card de película.
   ═══════════════════════════════════════════════════════════════════════════ */

.dp-live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--brand);
    vertical-align: middle;
}

/* El latido es información —dice «esto es directo»—, no decoración.
   Por eso se mantiene, pero desaparece si el sistema pide menos movimiento. */
@media (prefers-reduced-motion: no-preference) {
    .dp-live-dot { animation: dp-pulse 2s cubic-bezier(.4, 0, .2, 1) infinite; }
}

@keyframes dp-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .35; }
}

.dp-channel-grid {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
}

.dp-channel-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: 1.1rem .75rem .9rem;
    min-height: 152px;
    border: 1px solid var(--dp-line);
    border-radius: 12px;
    background: var(--dp-surf-1);
    text-align: center;
    transition: border-color .18s cubic-bezier(.4, 0, .2, 1),
                background-color .18s cubic-bezier(.4, 0, .2, 1);
}

/* Solo con ratón: en táctil el hover se queda pegado tras el toque. */
@media (hover: hover) and (pointer: fine) {
    .dp-channel-card:hover {
        border-color: var(--brand);
        background: var(--dp-surf-2, #232323);
    }
    .dp-channel-card:hover .dp-channel-logo img { opacity: 1; }
}

.dp-channel-card:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.dp-channel-live {
    position: absolute;
    top: .55rem;
    left: .55rem;
    display: inline-flex;
    align-items: center;
    padding: .12rem .4rem;
    border-radius: 4px;
    background: rgba(229, 9, 20, .14);
    color: #ff6b6b;
    font-size: .58rem;
    font-weight: 800;
    letter-spacing: .07em;
}

.dp-channel-live.\!static { position: static; }

.dp-channel-logo {
    display: grid;
    place-items: center;
    width: 100%;
    height: 56px;
}

.dp-channel-logo img {
    max-width: 84%;
    max-height: 56px;
    object-fit: contain;
    opacity: .88;
    transition: opacity .18s cubic-bezier(.4, 0, .2, 1);
}

.dp-channel-initials {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .06);
    color: var(--dp-text-2, #b3b3b3);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: .02em;
}

.dp-channel-name {
    color: var(--dp-text-1, #fff);
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.25;
}

.dp-channel-meta {
    color: var(--dp-text-3, #8c8c8c);
    font-size: .68rem;
}

/* Listado lateral de canales relacionados */
.dp-channel-row {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .55rem .65rem;
    border: 1px solid transparent;
    border-radius: 10px;
    transition: background-color .18s cubic-bezier(.4, 0, .2, 1),
                border-color .18s cubic-bezier(.4, 0, .2, 1);
}

@media (hover: hover) and (pointer: fine) {
    .dp-channel-row:hover {
        border-color: var(--dp-line);
        background: var(--dp-surf-1);
    }
}

.dp-channel-row-logo {
    display: grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .05);
    color: var(--dp-text-3, #8c8c8c);
    font-size: .72rem;
    font-weight: 800;
}

.dp-channel-row-logo img {
    max-width: 82%;
    max-height: 30px;
    object-fit: contain;
}

/* Marco del directo: ocupa el hueco del vídeo antes de que exista el vídeo,
   así al pulsar no se desplaza nada de lo que hay debajo. */
.dp-live-frame {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 9;
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--dp-line);
    border-radius: 14px;
    background:
        radial-gradient(120% 90% at 50% 0%, rgba(229, 9, 20, .10), transparent 62%),
        var(--dp-surf-1);
}

.dp-live-start {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .85rem;
    padding: 1.5rem;
    color: var(--dp-text-1, #fff);
}

.dp-live-start-icon {
    display: grid;
    place-items: center;
    width: 66px;
    height: 66px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    box-shadow: 0 8px 28px rgba(229, 9, 20, .34);
    transition: transform .18s cubic-bezier(.4, 0, .2, 1);
}

@media (hover: hover) and (pointer: fine) {
    .dp-live-start:hover .dp-live-start-icon { transform: scale(1.06); }
}

.dp-live-start-text {
    font-size: .92rem;
    font-weight: 700;
}

/* Fila de filtros por categoría */
.dp-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.dp-chip {
    display: inline-flex;
    align-items: center;
    padding: .38rem .8rem;
    border: 1px solid var(--dp-line);
    border-radius: 999px;
    background: var(--dp-surf-1);
    color: var(--dp-text-2, #b3b3b3);
    font-size: .76rem;
    font-weight: 600;
    transition: border-color .18s cubic-bezier(.4, 0, .2, 1),
                color .18s cubic-bezier(.4, 0, .2, 1);
}

@media (hover: hover) and (pointer: fine) {
    .dp-chip:hover { border-color: var(--brand); color: #fff; }
}

.dp-chip.is-active {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

/* ═══════════════════════════════════════════════════════════════════════════
   COLECCIONES
   La tarjeta muestra un mosaico con las carátulas de dentro, no un bloque de
   color con el nombre encima: las portadas se reconocen de un vistazo y dicen
   más que cualquier etiqueta.
   ═══════════════════════════════════════════════════════════════════════════ */

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

.dp-collection-card {
    display: block;
    overflow: hidden;
    border: 1px solid var(--dp-line);
    border-radius: 14px;
    background: var(--dp-surf-1);
    transition: border-color .18s cubic-bezier(.4, 0, .2, 1),
                transform .18s cubic-bezier(.4, 0, .2, 1);
}

@media (hover: hover) and (pointer: fine) {
    .dp-collection-card:hover { border-color: var(--brand); transform: translateY(-2px); }
    .dp-collection-card:hover .dp-collection-art img { opacity: 1; }
}

.dp-collection-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.dp-collection-art {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--dp-surf-2, #232323);
}

.dp-collection-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .82;
    transition: opacity .18s cubic-bezier(.4, 0, .2, 1);
}

/* Con menos de tres carátulas, la primera ocupa lo que sobra. */
.dp-collection-art img:only-child  { grid-column: 1 / -1; }
.dp-collection-art img:first-child:nth-last-child(2) { grid-column: span 2; }

.dp-collection-empty {
    grid-column: 1 / -1;
    display: grid;
    place-items: center;
    color: var(--dp-text-3, #8c8c8c);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: .04em;
}

.dp-collection-body { display: block; padding: .8rem .9rem 1rem; }

.dp-collection-name {
    display: block;
    color: var(--dp-text-1, #fff);
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.3;
}

.dp-collection-count {
    display: block;
    margin-top: .2rem;
    color: var(--dp-text-3, #8c8c8c);
    font-size: .74rem;
}
