/* ============================================================================
   Zona del anime (/episodios): guía de episodios.
   Prefijos: .ep- (pilar "en qué orden ver") y .eps- (hub de cada saga).
   ========================================================================== */
.ep { --ep-line: color-mix(in srgb, var(--brand-deep) 55%, var(--border-color)); padding: 20px 0 60px; }
.ep-crumb { font-size: .85rem; color: var(--text-muted); margin: 6px 0 18px; }
.ep-crumb a { color: var(--accent-text); text-decoration: none; }
.ep-crumb a:hover { text-decoration: underline; }

/* Hero */
.ep-hero { position: relative; overflow: hidden; border-radius: 26px 8px 26px 8px; padding: 40px 34px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 20%, var(--bg-card)), var(--bg-card) 70%);
    border: 1px solid var(--border-color); box-shadow: var(--shadow-md); margin-bottom: 26px; }
.ep-hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%); pointer-events: none; }
.ep-kicker { display: inline-block; font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--accent-text); margin-bottom: 10px; }
.ep-hero h1 { font-family: var(--font-display, sans-serif); font-weight: 800; font-size: clamp(1.9rem, 5vw, 3rem);
    line-height: 1.05; margin: 0 0 14px; color: var(--text-main); max-width: 18ch; position: relative; }
.ep-hero p { font-size: 1.1rem; line-height: 1.6; color: var(--text-main); max-width: 62ch; margin: 0 0 18px; position: relative; }
.ep-facts { display: flex; flex-wrap: wrap; gap: 10px; position: relative; }
.ep-fact { display: inline-flex; align-items: center; gap: 8px; background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 11px 3px 11px 3px; padding: 8px 13px; font-weight: 700; font-size: .9rem; color: var(--text-main); }
.ep-fact b { color: var(--accent-text); font-size: 1.05rem; }

/* Respuesta rápida */
.ep-quick { background: var(--bg-card); border: 1px solid var(--border-color); border-left: 6px solid var(--accent);
    border-radius: 16px 5px 16px 5px; padding: 22px 24px; margin-bottom: 34px; box-shadow: var(--shadow-sm); }
.ep-quick h2 { font-family: var(--font-display, sans-serif); font-weight: 800; font-size: 1.15rem; margin: 0 0 4px; color: var(--text-main); }
.ep-quick .sub { color: var(--text-muted); font-size: .92rem; margin: 0 0 16px; }
.ep-quick ol { list-style: none; counter-reset: paso; margin: 0; padding: 0; display: grid; gap: 8px;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.ep-quick li { counter-increment: paso; display: flex; align-items: center; gap: 11px; padding: 9px 12px;
    background: color-mix(in srgb, var(--accent) 6%, var(--bg-card)); border: 1px solid var(--border-color);
    border-radius: 10px 3px 10px 3px; }
.ep-quick li a { text-decoration: none; color: var(--text-main); font-weight: 700; font-size: .95rem; }
.ep-quick li a:hover { color: var(--accent-text); }
.ep-quick li::before { content: counter(paso); flex: 0 0 auto; width: 27px; height: 27px; border-radius: 50%;
    background: var(--accent); color: var(--on-brand); font-weight: 800; font-size: .85rem;
    display: inline-flex; align-items: center; justify-content: center; }

/* Timeline */
.ep-sec-title { font-family: var(--font-display, sans-serif); font-weight: 800; font-size: 1.6rem; color: var(--text-main); margin: 40px 0 6px; }
.ep-sec-intro { color: var(--text-muted); max-width: 66ch; margin: 0 0 22px; line-height: 1.55; }
.ep-time { position: relative; margin: 0; padding: 0; display: grid; gap: 18px; }
.ep-node { position: relative; }
.ep-dot { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px 3px 9px 3px;
    background: var(--ep-c); color: #fff; display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font-display, sans-serif); font-weight: 800; font-size: 1rem;
    box-shadow: 0 3px 0 color-mix(in srgb, var(--ep-c) 60%, #000); }
.ep-card { position: relative; display: flex; gap: 18px; align-items: stretch; width: 100%; background: var(--bg-card); border: 1px solid var(--border-color);
    border-left: 5px solid var(--ep-c); border-radius: 16px 5px 16px 5px; padding: 16px 18px; box-shadow: var(--shadow-sm);
    transition: transform .15s, box-shadow .15s; }
.ep-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
/* Póster a la IZQUIERDA, con el número de saga superpuesto en su esquina. */
.ep-card-poster { flex: 0 0 108px; position: relative; align-self: flex-start; border-radius: 12px 3px 12px 3px; overflow: hidden;
    border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); background: var(--ep-c); min-height: 70px; line-height: 0; text-decoration: none; }
.ep-card-poster img { width: 108px; height: 162px; object-fit: cover; display: block; }
.ep-card-poster .ep-dot { position: absolute; top: 8px; left: 8px; z-index: 2; width: 32px; height: 32px; border: 2px solid #fff; }
.ep-card-main { flex: 1 1 auto; min-width: 0; }
@media (max-width: 560px) { .ep-card { gap: 12px; } .ep-card-poster { flex-basis: 84px; } .ep-card-poster img { width: 84px; height: 126px; } }
.ep-card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 4px; }
.ep-card h3 { font-family: var(--font-display, sans-serif); font-weight: 800; font-size: 1.3rem; margin: 0; }
.ep-card h3 a { color: var(--text-main); text-decoration: none; }
.ep-card h3 a:hover { color: var(--ep-c); }
.ep-alias { font-size: .88rem; color: var(--text-muted); font-style: italic; }
.ep-years { margin-left: auto; font-weight: 800; font-size: .85rem; color: var(--ep-c); white-space: nowrap; }
.ep-start { display: inline-block; font-size: .72rem; font-weight: 800; color: #fff; background: var(--ep-c);
    padding: 2px 9px; border-radius: 7px 2px 7px 2px; }
.ep-blurb { color: var(--text-main); line-height: 1.6; margin: 8px 0 14px; max-width: 68ch; }
.ep-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.ep-chip { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; color: var(--text-main);
    background: color-mix(in srgb, var(--ep-c) 10%, var(--bg-card)); border: 1px solid color-mix(in srgb, var(--ep-c) 30%, var(--border-color));
    padding: 4px 10px; border-radius: 8px 2px 8px 2px; }
.ep-chip i { color: var(--ep-c); }
.ep-card-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; align-items: center; }
.ep-more { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; font-size: .88rem; color: var(--ep-c); text-decoration: none; }
.ep-more:hover { text-decoration: underline; }
.ep-watch { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: .85rem; color: var(--text-muted); text-decoration: none; }
.ep-watch:hover { color: var(--ep-c); text-decoration: underline; }

/* Bloques de contenido (compartidos pilar + saga) */
.ep-block { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 18px 6px 18px 6px;
    padding: 26px 28px; margin: 18px 0; box-shadow: var(--shadow-sm); }
.ep-block h2 { font-family: var(--font-display, sans-serif); font-weight: 800; font-size: 1.45rem; margin: 0 0 12px; color: var(--text-main); }
.ep-block p { line-height: 1.65; color: var(--text-main); max-width: 70ch; margin: 0 0 12px; }
.ep-block p:last-child { margin-bottom: 0; }
.ep-block strong { color: var(--accent-text); }
.ep-block ul { margin: 4px 0 0; padding-left: 1.15em; }
.ep-block ul li { line-height: 1.6; margin: 6px 0; color: var(--text-main); }
.ep-block ul li::marker { color: var(--accent-text); }
.ep-watch-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-top: 6px; }
.ep-watch-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--border-color);
    border-radius: 12px 3px 12px 3px; background: color-mix(in srgb, var(--accent) 5%, var(--bg-card)); text-decoration: none; }
.ep-watch-card i { font-size: 1.4rem; color: var(--accent-text); flex: 0 0 auto; margin-top: 2px; }
.ep-watch-card b { display: block; color: var(--text-main); font-size: .98rem; }
.ep-watch-card span { color: var(--text-muted); font-size: .84rem; line-height: 1.4; }

/* FAQ */
.ep-faq { display: grid; gap: 10px; margin-top: 6px; }
.ep-faq details { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px 4px 12px 4px; overflow: hidden; }
.ep-faq summary { cursor: pointer; padding: 15px 18px; font-weight: 800; color: var(--text-main); list-style: none;
    display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ep-faq summary::-webkit-details-marker { display: none; }
.ep-faq summary::after { content: "+"; font-size: 1.4rem; color: var(--accent-text); font-weight: 800; }
.ep-faq details[open] summary::after { content: "\2212"; }
.ep-faq .a { padding: 0 18px 16px; color: var(--text-main); line-height: 1.6; max-width: 72ch; }

/* CTA */
.ep-cta { text-align: center; margin: 34px 0 0; padding: 28px; border-radius: 18px 6px 18px 6px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--bg-card)), var(--bg-card));
    border: 1px solid var(--brand-deep); }
.ep-cta p { font-size: 1.05rem; color: var(--text-main); margin: 0 0 14px; }
.ep-btn { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-display, sans-serif); font-weight: 800;
    padding: 12px 22px; border-radius: 12px 4px 12px 4px; background: var(--accent); color: var(--on-brand);
    text-decoration: none; box-shadow: 0 4px 0 var(--brand-deep); transition: transform .15s, box-shadow .15s; }
.ep-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--brand-deep); }

/* ===== Hub de saga (.eps-) ===== */
.eps { --ep-c: var(--accent); padding: 20px 0 60px; }
.eps-hero { position: relative; overflow: hidden; border-radius: 26px 8px 26px 8px; padding: 38px 34px; margin-bottom: 24px;
    color: #fff; background: linear-gradient(135deg, var(--ep-c), color-mix(in srgb, var(--ep-c) 55%, #000));
    box-shadow: var(--shadow-md); }
.eps-hero::after { content: ""; position: absolute; right: -50px; bottom: -70px; width: 220px; height: 220px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.18), transparent 70%); pointer-events: none; }
.eps-num { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 34px; height: 34px; padding: 0 13px;
    border-radius: 9px 3px 9px 3px; background: rgba(255,255,255,.22); font-family: var(--font-display, sans-serif); font-weight: 800;
    font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; margin-bottom: 12px; }
.eps-hero h1 { font-family: var(--font-display, sans-serif); font-weight: 800; font-size: clamp(1.8rem, 5vw, 2.8rem);
    margin: 0 0 6px; line-height: 1.05; position: relative; }
.eps-hero .alias { font-size: 1rem; opacity: .9; font-style: italic; margin: 0 0 14px; position: relative; }
.eps-badges { display: flex; flex-wrap: wrap; gap: 8px; position: relative; }
.eps-badge { display: inline-flex; align-items: center; gap: 7px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28);
    padding: 6px 12px; border-radius: 9px 3px 9px 3px; font-weight: 700; font-size: .85rem; }
.eps-start { background: #fff; color: var(--ep-c); }

.eps-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 900px) { .eps-grid { grid-template-columns: 1fr 300px; align-items: start; } }
.eps-intro p { font-size: 1.06rem; line-height: 1.7; color: var(--text-main); margin: 0 0 14px; }
.eps-ficha { background: var(--bg-card); border: 1px solid var(--border-color); border-top: 5px solid var(--ep-c);
    border-radius: 14px 4px 14px 4px; padding: 18px 20px; box-shadow: var(--shadow-sm); }
.eps-ficha h2 { font-family: var(--font-display, sans-serif); font-weight: 800; font-size: 1.05rem; margin: 0 0 12px; color: var(--text-main); }
.eps-ficha dl { margin: 0; display: grid; gap: 10px; }
.eps-ficha .row { display: flex; flex-direction: column; gap: 2px; }
.eps-ficha dt { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.eps-ficha dd { margin: 0; font-weight: 700; color: var(--text-main); font-size: .95rem; }

.eps-mons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.eps-mon { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 90px; text-decoration: none;
    padding: 10px 6px; border: 1px solid var(--border-color); border-radius: 12px 3px 12px 3px; background: color-mix(in srgb, var(--ep-c) 6%, var(--bg-card));
    transition: transform .15s, box-shadow .15s, border-color .15s; }
.eps-mon:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); border-color: var(--ep-c); }
.eps-mon img { width: 62px; height: 62px; object-fit: contain; }
.eps-mon span { font-size: .78rem; font-weight: 700; color: var(--text-main); text-align: center; }

.eps-list li { margin: 8px 0; }
.eps-nav { display: flex; gap: 12px; margin-top: 26px; }
.eps-nav a { flex: 1; display: flex; flex-direction: column; gap: 3px; padding: 14px 18px; text-decoration: none;
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px 4px 12px 4px; transition: border-color .15s, transform .15s; }
.eps-nav a:hover { border-color: var(--accent); transform: translateY(-2px); }
.eps-nav .dir { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.eps-nav .name { font-weight: 800; color: var(--text-main); }
.eps-nav .next { text-align: right; }

/* Temporadas (en el hub de saga) */
.eps-temps { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-top: 8px; }
.eps-temp { display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-decoration: none;
    background: color-mix(in srgb, var(--ep-c) 6%, var(--bg-card)); border: 1px solid var(--border-color);
    border-radius: 12px 3px 12px 3px; transition: transform .15s, box-shadow .15s, border-color .15s; }
.eps-temp:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--ep-c); }
.eps-temp-n { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px 3px 9px 3px; background: var(--ep-c); color: #fff;
    font-family: var(--font-display, sans-serif); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.eps-temp-b { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.eps-temp-b b { color: var(--text-main); font-size: .92rem; line-height: 1.25; }
.eps-temp-b small { color: var(--text-muted); font-size: .8rem; }
.eps-temp > i { color: var(--ep-c); margin-left: auto; }

/* Lista de episodios (página de temporada) */
.eps-eplist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 12px; counter-reset: none; }
.eps-ep { display: flex; gap: 14px; min-height: 112px; background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 14px 4px 14px 4px; overflow: hidden; box-shadow: var(--shadow-sm); }
.eps-ep-media { position: relative; flex: 0 0 170px; width: 170px; align-self: stretch;
    background: color-mix(in srgb, var(--ep-c) 12%, var(--bg-card)); }
.eps-ep-media img { width: 170px; height: 100%; object-fit: cover; display: block; }
.eps-ep-media.is-empty img { display: none; }
.eps-ep-media .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display, sans-serif); font-weight: 800; font-size: 1.4rem; color: var(--ep-c); opacity: .5; }
.eps-ep-num { position: absolute; left: 8px; top: 8px; background: rgba(0,0,0,.7); color: #fff; font-weight: 800; font-size: .74rem;
    padding: 2px 8px; border-radius: 6px 2px 6px 2px; }
.eps-ep-body { padding: 12px 16px 14px; min-width: 0; }
.eps-ep-body h2 { font-family: var(--font-display, sans-serif); font-weight: 800; font-size: 1.05rem; margin: 0 0 5px; color: var(--text-main); }
.eps-ep-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.eps-ep-date { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; color: var(--ep-c); }

/* Etiquetas de relleno / canon (AnimeFillerList) */
.eps-tag { display: inline-block; font-size: .72rem; font-weight: 800; padding: 2px 9px; border-radius: 7px 2px 7px 2px;
    border: 1px solid transparent; letter-spacing: .01em; }
.eps-tag.is-canon { background: color-mix(in srgb, #2e7d32 15%, var(--bg-card)); color: #2e7d32; border-color: color-mix(in srgb, #2e7d32 35%, transparent); }
.eps-tag.is-relleno { background: color-mix(in srgb, #c0392b 14%, var(--bg-card)); color: #c0392b; border-color: color-mix(in srgb, #c0392b 32%, transparent); }
.eps-tag.is-mixto { background: color-mix(in srgb, #e08a1e 16%, var(--bg-card)); color: #b56a09; border-color: color-mix(in srgb, #e08a1e 36%, transparent); }
.eps-fillsum .eps-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.eps-credit { text-align: center; font-size: .72rem; line-height: 1.5; color: var(--text-muted); margin: 16px auto 0; max-width: 72ch; opacity: .75; }
.eps-ep-body p { margin: 4px 0 0; color: var(--text-main); font-size: .9rem; line-height: 1.55; }
@media (max-width: 560px) {
    .eps-ep { flex-direction: column; }
    .eps-ep-media { flex-basis: auto; width: 100%; height: auto; aspect-ratio: 16/9; }
    .eps-ep-media img { width: 100%; height: 100%; }
}

@media (max-width: 640px) {
    .ep-hero, .eps-hero { padding: 28px 20px; }
    .ep-block { padding: 20px; }
    .ep-years { margin-left: 0; width: 100%; }
    .eps-nav { flex-direction: column; }
}
