/* ============ VARIABLES ============ */
:root {
  --bg-dark: #141414;
  --bg-darker: #0c0c0c;
  --bg-card: #1c1c1c;
  --orange: #ff5b16;
  --orange-light: #ff7a3d;
  --white: #ffffff;
  --gray-200: #e8e8e8;
  --gray-400: #a3a3a3;
  --gray-600: #6b6b6b;
  --border: #2c2c2c;
  --radius: 14px;
  --max-width: 1200px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-dark);
  color: var(--white);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; }
img { max-width: 100%; display: block; }

/* ============ HEADER ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(12, 12, 12, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.logo-img {
  height: 40px;
  width: auto;
  display: block;
}

@media (max-width: 640px) {
  .logo-img { height: 32px; }
}

.main-nav {
  display: flex;
  gap: 32px;
}

.main-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-400);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: color .2s;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--white);
  border-bottom-color: var(--orange);
}

.header-right { display: flex; align-items: center; gap: 16px; }

.badge-lock {
  font-size: 13px;
  color: var(--gray-400);
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  padding: 6px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--white);
  display: block;
}

/* ============ HERO ============ */
.hero {
  position: relative;
  overflow: hidden;
  padding: 56px 0 0;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 140% at 15% 10%, #241a12 0%, var(--bg-darker) 55%, var(--bg-dark) 100%);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.02) 0px, rgba(255,255,255,0.02) 1px, transparent 1px, transparent 34px),
    linear-gradient(180deg, rgba(12,12,12,0.1) 0%, rgba(12,12,12,0.6) 70%, var(--bg-dark) 100%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 48px;
  align-items: center;
  padding-top: 40px;
  padding-bottom: 56px;
}

.eyebrow {
  color: var(--orange-light);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero-title-img {
  width: 100%;
  max-width: 420px;
  height: auto;
}

.hero-sub {
  margin-top: 18px;
  font-size: 17px;
  color: var(--gray-200);
  max-width: 420px;
}

.btn-primary {
  margin-top: 28px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--orange);
  color: var(--white);
  font-weight: 700;
  font-size: 15px;
  padding: 14px 26px;
  border-radius: 999px;
  transition: transform .15s, background .15s;
}
.btn-primary:hover { background: var(--orange-light); transform: translateY(-1px); }
.play-ico { font-size: 12px; }

.hero-meta {
  margin-top: 14px;
  font-size: 13px;
  color: var(--gray-600);
}

.hero-video-frame {
  position: relative;
  aspect-ratio: 16/10;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000 center/cover no-repeat; /* la imagen real la pone script.js según el capítulo destacado */
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.play-btn-xl {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  color: #111;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s, background .2s;
  z-index: 2;
}
.play-btn-xl:hover { transform: translate(-50%, -50%) scale(1.08); background: var(--white); }

.hero-video-caption {
  position: absolute;
  left: 22px;
  bottom: 18px;
  z-index: 2;
}

.chip {
  display: inline-block;
  background: var(--orange);
  color: var(--white);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.hero-video-caption h3 {
  font-size: 20px;
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.video-embed { position: absolute; inset: 0; z-index: 3; }
.video-embed iframe { width: 100%; height: 100%; border: 0; }

/* ============ STATS BAR ============ */
.stats-bar {
  background: var(--bg-darker);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stats-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 28px 24px;
}

.stat {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.stat-ico {
  font-size: 20px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255,91,22,0.12);
  color: var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat strong { display: block; font-size: 15px; margin-bottom: 2px; }
.stat span { font-size: 13px; color: var(--gray-400); }

/* ============ CHAPTERS ============ */
.chapters { padding: 64px 0; }

.chapters-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
}
.chapters-head p {
  margin-top: 8px;
  color: var(--gray-400);
  font-size: 15px;
}

.chapters-grid {
  display: flex;
  justify-content: center;
}

.chapter-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 4/3;
  background: var(--bg-card) center/cover no-repeat;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color .2s, transform .2s;
}
.chapter-card:hover { transform: translateY(-3px); }
.chapter-card.locked { cursor: default; }

.chapter-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.85) 100%);
}

/* Tarjeta bloqueada ("Próximo"): un poco más oscura y con la miniatura difuminada
   (además de la imagen difuminada que subas, aplicamos un blur extra por si acaso). */
.chapter-card.locked::after { background: rgba(0,0,0,0.55); }
.chapter-card.locked { filter: saturate(0.7); }

/* Botón de play centrado (arriba de la tarjeta queda vacío, esto flota en medio) */
.chapter-play-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: transform .15s, background .15s;
}
.chapter-card:hover .chapter-play-center { transform: translate(-50%, -50%) scale(1.08); background: var(--white); }

/* Toda la información vive abajo de la tarjeta */
.chapter-info {
  position: absolute;
  left: 20px;
  bottom: 18px;
  right: 20px;
  z-index: 2;
}
.chapter-info-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.chapter-info h4 { font-size: 20px; font-weight: 800; }
.chapter-desc {
  margin-top: 6px;
  font-size: 14px;
  color: var(--gray-200);
  max-width: 90%;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.status-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}
.status-label.is-available { background: var(--orange); color: var(--white); }
.status-label.is-next { background: rgba(255,255,255,0.12); color: var(--gray-200); }

/* Flechas de navegación, ahora debajo de la tarjeta */
.chapters-nav-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 24px;
}

.chapters-arrow {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--white);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  flex-shrink: 0;
  transition: background .15s;
}
.chapters-arrow:hover { background: #262626; }

.chapters-current-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-400);
  letter-spacing: 0.5px;
  min-width: 64px;
  text-align: center;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 999px;
  transition: border-color .15s;
}
.btn-outline:hover { border-color: var(--orange); }

/* ============ MADE BY US ============ */
.made-by-us {
  background: var(--bg-darker);
  border-top: 1px solid var(--border);
  padding: 56px 0;
}

.made-by-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.made-by-copy { display: flex; align-items: center; gap: 16px; }
.heart { font-size: 32px; }
.made-by-copy h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 800; line-height: 1.2; }

.made-by-divider {
  width: 1px;
  height: 48px;
  background: var(--border);
}

.made-by-text {
  color: var(--gray-400);
  font-size: 14px;
  max-width: 260px;
  flex: 1;
}

.made-by-tag {
  height: 90px;
  width: auto;
  margin-left: auto;
}

/* ============ BANNER EXTRA ============ */
.extra-banner {
  background: var(--bg-dark);
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  display: block;
}

.extra-banner-img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
}

/* ============ MODAL ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal.open { display: flex; }

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

.modal-box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 920px;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: var(--white);
  font-size: 16px;
}

.modal-video {
  position: relative;
  aspect-ratio: 16/9;
  background: #000;
}
.modal-video iframe { width: 100%; height: 100%; border: 0; }

.modal-info { padding: 18px 22px; }
.modal-info h3 { font-size: 18px; font-weight: 800; margin-top: 6px; }
.modal-desc {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--gray-200);
  max-width: 640px;
}

/* ============ FOOTER ============ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-inner p { font-size: 13px; color: var(--gray-600); }

.footer-copyright {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--gray-600);
  text-align: center;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 860px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }
  .badge-lock { display: none; }

  .hero-inner {
    grid-template-columns: 1fr;
    padding-top: 20px;
  }

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

  .chapters-grid { grid-template-columns: repeat(2, 1fr); }

  .made-by-inner { flex-direction: column; align-items: center; text-align: center; }
  .made-by-divider { display: none; }
  .made-by-tag { margin-left: auto; margin-right: auto; height: 130px; }

  .hero-copy { text-align: center; }
  .hero-title-img { margin: 0 auto; }

  .extra-banner { padding: 24px 0; }
  .extra-banner .container { max-width: none; padding: 0; }
  .extra-banner-img { width: 100%; height: auto; max-width: none; object-fit: initial; }
}

@media (max-width: 520px) {
  .chapters-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .hero-title-img { max-width: 280px; }
  .made-by-tag { height: 100px; }
}

/* ===== AVISO "NUEVO CAPÍTULO DISPONIBLE" ===== */
.new-chapter-banner {
  display: none;
  position: sticky;
  top: 0;
  z-index: 500;
  background: linear-gradient(90deg, #ff7a1a, #ffb347);
  color: #1a1206;
  padding: 10px 24px;
}
.new-chapter-banner-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  text-align: center;
}
.new-chapter-banner-text {
  font-size: 14px;
  line-height: 1.4;
}
.new-chapter-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-banner {
  background: #1a1206;
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-banner-close {
  background: transparent;
  border: none;
  color: #1a1206;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.65;
  padding: 4px;
}
.btn-banner-close:hover { opacity: 1; }

/* Insignia "Nuevo capítulo" dentro de la tarjeta del capítulo más reciente */
.chapter-card.single.is-newest { position: relative; }
.new-badge {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(90deg, #ff7a1a, #ffb347);
  color: #1a1206;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 4px 10px;
  border-radius: 999px;
  animation: newBadgePulse 1.8s ease-in-out infinite;
}
@keyframes newBadgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@media (max-width: 640px) {
  .new-chapter-banner-inner { flex-direction: column; gap: 8px; }
  .chapter-info-top { flex-wrap: wrap; gap: 6px; }
}

/* ===== FILA DE CAPÍTULOS ESTILO NETFLIX ===== */
.chapters-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 6px 2px 16px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.chapters-row::-webkit-scrollbar { height: 8px; }
.chapters-row::-webkit-scrollbar-track { background: transparent; }
.chapters-row::-webkit-scrollbar-thumb { background: #3a2f22; border-radius: 999px; }

.chapter-poster {
  position: relative;
  flex: 0 0 240px;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-color: #1a1206;
  scroll-snap-align: start;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
.chapter-poster:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 14px 28px rgba(0,0,0,0.5); }
.chapter-poster.locked { cursor: default; filter: grayscale(0.9) brightness(0.4); }
.chapter-poster.locked:hover { transform: none; box-shadow: 0 6px 18px rgba(0,0,0,0.35); }
.chapter-poster.is-newest { outline: 2px solid #ff7a1a; outline-offset: -2px; }

.chapter-poster::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.85) 100%);
  pointer-events: none;
}

.poster-chip { position: absolute; top: 10px; left: 10px; z-index: 2; font-size: 10px; padding: 3px 8px; }
.poster-new-badge { position: absolute; top: 10px; right: 10px; z-index: 2; font-size: 10px; padding: 3px 8px; }
.poster-play, .poster-lock {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  font-size: 22px;
  color: #fff;
  opacity: 0.9;
}
.poster-lock { font-size: 26px; opacity: 0.85; }

.poster-info { position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: 2; }
.poster-info h4 {
  font-size: 13px;
  margin: 0 0 4px;
  color: #fff;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.poster-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.poster-meta .status-label { font-size: 10px; }
.poster-views { font-size: 11px; color: #d8cfc2; opacity: 0.85; }

@media (max-width: 640px) {
  .chapter-poster { flex-basis: 200px; }
}
