/**
 * BlurAnime Unified Design System & Visual Identity (brand-identity.css)
 * Unifica colores, fondos, iconos, etiquetas (badges), tamaños de imagen,
 * tipografía, mayúsculas/minúsculas, bordes, efectos y transiciones en las 18 páginas.
 */

:root {
    --ba-bg-body: #f1f2f6;
    --ba-bg-card: #ffffff;
    --ba-bg-input: #f8fafc;
    --ba-border: #e2e8f0;
    --ba-border-input: #cbd5e1;
    --ba-text-main: #1e2229;
    --ba-text-primary: #1e2229;
    --ba-text-muted: #64748b;
    --ba-text-secondary: #64748b;
    --ba-primary: #1fb0f4;
    --ba-primary-hover: #0d9de0;
    --ba-accent: #fb9351;
    --ba-success: #10b981;
    --ba-danger: #ef4444;
    --ba-radius-card: 12px;
    --ba-radius-lg: 12px;
    --ba-radius-control: 10px;
    --ba-radius-badge: 6px;
    --ba-shadow-card: 0 4px 16px rgba(15, 23, 42, 0.05);
    --ba-shadow-hover: 0 12px 26px rgba(15, 23, 42, 0.16);
    --ba-font: 'Mulish', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html body.dark-mode:not(#_):not(#__) {
    --ba-bg-body: #111217;
    --ba-bg-card: #1a1c24;
    --ba-bg-input: #232632;
    --ba-border: #2b2f3f;
    --ba-border-input: #33384a;
    --ba-text-main: #f1f5f9;
    --ba-text-primary: #f1f5f9;
    --ba-text-muted: #94a3b8;
    --ba-text-secondary: #94a3b8;
    --ba-shadow-card: 0 6px 22px rgba(0, 0, 0, 0.35);
    --ba-shadow-hover: 0 14px 30px rgba(0, 0, 0, 0.52);
}

/* 1. FONDOS, MODELO DE CAJA (BORDER-BOX) Y TIPOGRAFÍA GLOBAL UNIFICADA */
html body:not(#_) #contenedor,
html body:not(#_) #contenedor *,
html body:not(#_) #contenedor *::before,
html body:not(#_) #contenedor *::after {
    box-sizing: border-box;
}

html body:not(#_):not(#__),

html body:not(#_):not(#__).light-mode {
    background-color: #f1f2f6;
    color: var(--ba-text-main);
    font-family: var(--ba-font);
}

html body:not(#_):not(#__).dark-mode {
    background-color: #111217;
    color: var(--ba-text-main);
    font-family: var(--ba-font);
}

html body:not(#_) #contenedor,

html body #contenedor:not(#_) .top-page-wrapper,

html body #contenedor:not(#_) .dir-page-wrapper,

html body #contenedor:not(#_) .hor-page-wrapper,

html body #contenedor:not(#_) .sr-page-wrapper,

html body #contenedor:not(#_) .hb-page-wrapper,

html body #contenedor:not(#_) .st-page-wrapper,

html body #contenedor:not(#_) .tx-page-wrapper,

html body #contenedor:not(#_) .comunidad-page-wrapper,

html body #contenedor:not(#_) .acceso-page-wrapper,

html body #contenedor:not(#_) .dashboard-page-wrapper,

html body #contenedor:not(#_) .author-page-wrapper,

html body #contenedor:not(#_) .std-page-wrapper,

html body #contenedor:not(#_) .err404-page-wrapper {
    background-color: var(--ba-bg-body);
    font-family: var(--ba-font);
}

html body #contenedor:not(#_) h1,
 html body #contenedor:not(#_) h2,
 html body #contenedor:not(#_) h3,
 html body #contenedor:not(#_) h4,
 html body #contenedor:not(#_) h5,
 html body #contenedor:not(#_) h6,

html body #contenedor:not(#_) button,
 html body #contenedor:not(#_) input,
 html body #contenedor:not(#_) select,
 html body #contenedor:not(#_) textarea {
    font-family: var(--ba-font);
}

/* 2. CABECERAS DE PÁGINA Y TÍTULOS (Title Case natural + Barra de Acento Azul) */
html body #contenedor:not(#_) .dir-title,

html body #contenedor:not(#_) .dir-header h1,

html body #contenedor:not(#_) .hor-header h1,

html body #contenedor:not(#_) .top-title,

html body #contenedor:not(#_) .search-results-title,

html body #contenedor:not(#_) .sr-title-row h1,

html body #contenedor:not(#_) .historial-busquedas-title,

html body #contenedor:not(#_) .hist-title,

html body #contenedor:not(#_) .tax-title,

html body #contenedor:not(#_) .com-title,

html body #contenedor:not(#_) .com-header h1,

html body #contenedor:not(#_) .acceso-title,

html body #contenedor:not(#_) .acceso-box h1,

html body #contenedor:not(#_) .acceso-box h2,

html body #contenedor:not(#_) .dash-main-title,

html body #contenedor:not(#_) .dash-main-header h2,

html body #contenedor:not(#_) .std-title-text h1,

html body #contenedor:not(#_) .pedidos-header h1,

html body #contenedor:not(#_) .content-title,

html body #contenedor:not(#_) .studio-name,

html body #contenedor:not(#_) .ep-toolbar-title,

html body #contenedor:not(#_) .ep-title-bar h1 {
    font-family: var(--ba-font);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.2px;
    text-transform: none;
    color: var(--ba-text-main);
}

html body #contenedor:not(#_) .ep-toolbar .ep-toolbar-title,

html body #contenedor:not(#_) .ep-toolbar-title {
    font-size: 18px;
}

html body #contenedor:not(#_) .dir-title,

html body #contenedor:not(#_) .hor-header h1,

html body #contenedor:not(#_) .day-title,

html body #contenedor:not(#_) .std-title-text h1,

html body #contenedor:not(#_) .search-results-title,

html body #contenedor:not(#_) .historial-busquedas-title,

html body #contenedor:not(#_) .hist-title,

html body #contenedor:not(#_) .tax-title,

html body #contenedor:not(#_) .com-title,

html body #contenedor:not(#_) .com-header h1,

html body #contenedor:not(#_) .com-section-title,

html body #contenedor:not(#_) .com-side-card h3,

html body #contenedor:not(#_) .pedidos-header h1,

html body #contenedor:not(#_) .pedidos-section-title,

html body #contenedor:not(#_) .content-title,

html body #contenedor:not(#_) .studio-name,

html body #contenedor:not(#_) .info-title,

html body #contenedor:not(#_) .trailer-title,

html body #contenedor:not(#_) .ba-comments-title,

html body #contenedor:not(#_) .ep-toolbar-title,

html body #contenedor:not(#_) .similar-box-title,

html body #contenedor:not(#_) .acceso-card h1,

html body #contenedor:not(#_) .acceso-card h2,

html body #contenedor:not(#_) .dash-header-title,

html body #contenedor:not(#_) .author-card-title,

html body #contenedor:not(#_) .err404-rec-title {
    border-left: 4px solid var(--ba-primary);
    padding-left: 12px;
    text-transform: none;
}

html body #contenedor:not(#_) .tax-title::before,

html body #contenedor:not(#_) .search-results-title::before,

html body #contenedor:not(#_) .historial-busquedas-title::before,

html body #contenedor:not(#_) .similar-box-title::before,

html body #contenedor:not(#_) .pedidos-section-title::before,

html body #contenedor:not(#_) .com-section-title::before {
    display: none;
}

/* 3. PÍLDORAS DE CONTEO EN CABECERAS */
html body #contenedor:not(#_) .sr-count-pill,

html body #contenedor:not(#_) .hb-count-badge,

html body #contenedor:not(#_) .hist-count-badge,

html body #contenedor:not(#_) .pedidos-count-badge,

html body #contenedor:not(#_) .day-count-pill {
    background: rgba(31, 176, 244, 0.12);
    color: #1fb0f4;
    font-family: var(--ba-font);
    font-size: 12px;
    font-weight: 800;
    border-radius: 20px;
    padding: 4px 12px;
    text-transform: none;
    letter-spacing: 0;
    display: inline-flex;
    align-items: center;
}

/* 4. SISTEMA UNIFICADO DE ETIQUETAS (BADGES) EN LAS 18 PÁGINAS */
/* 4A. Etiqueta de Tipo (SERIE, PELÍCULA, OVA, ONA, ESPECIAL, ANIME) => Azul BlurAnime */
html body #contenedor:not(#_) .badge-serie,

html body #contenedor:not(#_) .badge-pelicula,

html body #contenedor:not(#_) .badge-ova,

html body #contenedor:not(#_) .badge-ona,

html body #contenedor:not(#_) .badge-especial,

html body #contenedor:not(#_) .sr-badge-type,

html body #contenedor:not(#_) .hb-badge-serie,

html body #contenedor:not(#_) .std-badge-type,

html body #contenedor:not(#_) .author-anime-pill,

html body #contenedor:not(#_) .err404-rec-pill,

html body #contenedor:not(#_) .meta-badge.type,

html body #contenedor:not(#_) .ep-meta-pill.type-pill,

html body #contenedor:not(#_) .st-card-badges .badge-tipo {
    background: rgba(31, 176, 244, 0.94);
    color: #ffffff;
    font-family: var(--ba-font);
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-radius: 6px;
    padding: 4px 9px;
    line-height: 1.1;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
}

/* 4B. Etiqueta de Estado EN EMISIÓN => Verde Esmeralda */
html body #contenedor:not(#_) .badge-emision,

html body #contenedor:not(#_) .hor-card-badge,

html body #contenedor:not(#_) .sr-badge-status.airing,

html body #contenedor:not(#_) .std-badge-status,

html body #contenedor:not(#_) .st-card-badges .badge-emision {
    background: rgba(16, 185, 129, 0.94);
    color: #ffffff;
    font-family: var(--ba-font);
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-radius: 6px;
    padding: 4px 9px;
    line-height: 1.1;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
}

/* 4C. Etiqueta de Estado CONCLUIDO / FINALIZADO => Rojo Coral */
html body #contenedor:not(#_) .badge-concluido,

html body #contenedor:not(#_) .badge-estado,

html body #contenedor:not(#_) .sr-badge-status.finished,

html body #contenedor:not(#_) .sr-badge-status:not(.airing),

html body #contenedor:not(#_) .st-card-badges .badge-concluido {
    background: rgba(239, 68, 68, 0.92);
    color: #ffffff;
    font-family: var(--ba-font);
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-radius: 6px;
    padding: 4px 9px;
    line-height: 1.1;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
}

/* 4D. Etiqueta de Episodio / Vistas / Ranking / Nivel => Naranja Cálido */
html body #contenedor:not(#_) .ep-badge,

html body #contenedor:not(#_) .ep-badge-num,

html body #contenedor:not(#_) .badge-views,

html body #contenedor:not(#_) .player-ep-badge,

html body #contenedor:not(#_) .author-lvl-pill,

html body #contenedor:not(#_) .dash-lvl-badge,

html body #contenedor:not(#_) .meta-badge.date {
    background: rgba(251, 147, 81, 0.95);
    color: #ffffff;
    font-family: var(--ba-font);
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-radius: 6px;
    padding: 4px 9px;
    line-height: 1.1;
}

html body #contenedor:not(#_) .badge-views {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
}

html body #contenedor:not(#_) .badge-views svg.icon-svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

html body #contenedor:not(#_) .badges-top {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    z-index: 4;
    pointer-events: none;
}

html body #contenedor:not(#_) .card-badge-views {
    position: absolute;
    top: 38px;
    right: 10px;
    z-index: 4;
    pointer-events: none;
}

@media (max-width: 767px) {
    html body #contenedor:not(#_) .badges-top > span,
    html body #contenedor:not(#_) .sr-badges > span,
    html body #contenedor:not(#_) .std-badge-type,
    html body #contenedor:not(#_) .std-badge-status,
    html body #contenedor:not(#_) .card-badge-views {
        font-size: 9.5px;
        padding: 3px 6px;
    }
    html body #contenedor:not(#_) .card-badge-views {
        top: 34px;
    }
}

/* 5. UNIFICACIÓN TOTAL DE TARJETAS DE PÓSTER (2:3 + OVERLAY DE TÍTULO + BORDES 12PX + ZOOM HOVER) */
html body #contenedor:not(#_) .anime-card,

html body #contenedor:not(#_) .dir-card,

html body #contenedor:not(#_) .sr-card,

html body #contenedor:not(#_) .hb-card,

html body #contenedor:not(#_) .std-anime-card,

html body #contenedor:not(#_) .author-anime-card,

html body #contenedor:not(#_) .err404-rec-card,

html body #contenedor:not(#_) .hor-card,

html body #contenedor:not(#_) .anime-card-image,

html body #contenedor:not(#_) .hist-thumb-wrap {
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

/* Unificar tarjetas con caja inferior (.sr-card, .std-anime-card, .author-anime-card, .err404-rec-card) al diseño Poster Overlay */
html body #contenedor:not(#_) .sr-card,

html body #contenedor:not(#_) .std-anime-card,

html body #contenedor:not(#_) .author-anime-card,

html body #contenedor:not(#_) .err404-rec-card {
    position: relative;
    aspect-ratio: 2 / 3;
    background: var(--ba-surface-2, #e2e8f0);
    border: 1px solid var(--ba-border);
    box-shadow: var(--ba-shadow-card);
    display: block;
}

html body #contenedor:not(#_) .sr-card .sr-thumb-wrap,

html body #contenedor:not(#_) .sr-card .sr-poster-wrap,

html body #contenedor:not(#_) .std-anime-card .std-card-thumb,

html body #contenedor:not(#_) .author-anime-card .author-anime-thumb,

html body #contenedor:not(#_) .err404-rec-card .err404-rec-thumb {
    width: 100%;
    height: 100%;
    aspect-ratio: unset;
}

html body #contenedor:not(#_) .std-anime-card .std-card-body,

html body #contenedor:not(#_) .author-anime-card .author-anime-info,

html body #contenedor:not(#_) .err404-rec-card .err404-rec-info,

html body #contenedor:not(#_) .anime-card-image .dash-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 36px 12px 12px;
    background: linear-gradient(to top, rgba(8, 10, 16, 0.95) 0%, rgba(8, 10, 16, 0.62) 58%, transparent 100%);
    z-index: 3;
    border: none;
}

html body #contenedor:not(#_) .sr-card .sr-title,

html body #contenedor:not(#_) .sr-card .sr-card-title,

html body #contenedor:not(#_) .std-anime-card .std-card-title,

html body #contenedor:not(#_) .author-anime-card .author-anime-title,

html body #contenedor:not(#_) .err404-rec-card .err404-rec-info h3,

html body #contenedor:not(#_) .anime-card-image .dash-card-overlay .anime-card-title {
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
    text-align: center;
}

html body #contenedor:not(#_) .badges-top .author-anime-pill,
html body #contenedor:not(#_) .badges-top .err404-rec-pill,
html body #contenedor:not(#_) .badges-top .hor-card-badge {
    position: static;
}

html body #contenedor:not(#_) .sim-badge.type {
    background: rgba(31, 176, 244, 0.94);
    color: #ffffff;
}

html body #contenedor:not(#_) .sim-badge.status.airing {
    background: rgba(16, 185, 129, 0.94);
    color: #ffffff;
}

html body #contenedor:not(#_) .sim-badge.status:not(.airing) {
    background: rgba(239, 68, 68, 0.92);
    color: #ffffff;
}

html body #contenedor:not(#_) .custom-tabs-single .nav-link.active,
html body.dark-mode #contenedor:not(#_) .custom-tabs-single .nav-link.active,
html body #contenedor:not(#_) .btn-save-toggle {
    background: var(--ba-primary);
    color: #ffffff;
}

html body #contenedor:not(#_) .episodes-grid .episode-card {
    border-radius: 12px;
}

/* Posicionar insignias y título de .sr-card igual que Directorio/Géneros */
html body #contenedor:not(#_) .sr-card {
    position: relative;
}
html body #contenedor:not(#_) .sr-card .sr-card-body {
    position: static;
    padding: 0;
    background: none;
}
html body #contenedor:not(#_) .sr-card .sr-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 4;
    margin: 0;
    pointer-events: none;
}
html body #contenedor:not(#_) .sr-card .sr-title,

html body #contenedor:not(#_) .sr-card .sr-card-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 36px 12px 12px;
    background: linear-gradient(to top, rgba(8, 10, 16, 0.95) 0%, rgba(8, 10, 16, 0.62) 58%, transparent 100%);
    z-index: 3;
}

html body #contenedor:not(#_) .anime-card:hover,

html body #contenedor:not(#_) .dir-card:hover,

html body #contenedor:not(#_) .sr-card:hover,

html body #contenedor:not(#_) .hb-card:hover,

html body #contenedor:not(#_) .std-anime-card:hover,

html body #contenedor:not(#_) .author-anime-card:hover,

html body #contenedor:not(#_) .err404-rec-card:hover,

html body #contenedor:not(#_) .hor-card:hover,

html body #contenedor:not(#_) .anime-card-wrap:hover .anime-card-image,

html body #contenedor:not(#_) .hist-item:hover .hist-thumb-wrap {
    transform: translateY(-5px);
    box-shadow: var(--ba-shadow-hover);
    border-color: rgba(31, 176, 244, 0.55);
}

html body #contenedor:not(#_) .anime-card img,

html body #contenedor:not(#_) .dir-card img,

html body #contenedor:not(#_) .sr-card img,

html body #contenedor:not(#_) .hb-card img,

html body #contenedor:not(#_) .std-anime-card img,

html body #contenedor:not(#_) .author-anime-card img,

html body #contenedor:not(#_) .err404-rec-card img,

html body #contenedor:not(#_) .hor-card img,

html body #contenedor:not(#_) .anime-card-image img,

html body #contenedor:not(#_) .hist-thumb-wrap img {
    transition: transform 0.35s ease;
}

html body #contenedor:not(#_) .anime-card:hover img,

html body #contenedor:not(#_) .dir-card:hover img,

html body #contenedor:not(#_) .sr-card:hover img,

html body #contenedor:not(#_) .hb-card:hover img,

html body #contenedor:not(#_) .std-anime-card:hover img,

html body #contenedor:not(#_) .author-anime-card:hover img,

html body #contenedor:not(#_) .err404-rec-card:hover img,

html body #contenedor:not(#_) .hor-card:hover img,

html body #contenedor:not(#_) .anime-card-wrap:hover .anime-card-image img,

html body #contenedor:not(#_) .hist-item:hover .hist-thumb-wrap img {
    transform: scale(1.05);
}

/* 6. SUPERFICIES DE CONTENEDORES, TARJETAS DE CABECERA Y FILTROS */
html body #contenedor:not(#_) .sr-header-card,

html body #contenedor:not(#_) .historial-busquedas-header,

html body #contenedor:not(#_) .tax-header,

html body #contenedor:not(#_) .com-header,

html body #contenedor:not(#_) .com-composer,

html body #contenedor:not(#_) .com-post-box,

html body #contenedor:not(#_) .com-card,

html body #contenedor:not(#_) .com-side-card,

html body #contenedor:not(#_) .acceso-box,

html body #contenedor:not(#_) .dash-sidebar,

html body #contenedor:not(#_) .dash-main,

html body #contenedor:not(#_) .author-hero-card,

html body #contenedor:not(#_) .author-side-card,

html body #contenedor:not(#_) .author-main-card,

html body #contenedor:not(#_) .std-header-card,

html body #contenedor:not(#_) .err404-hero-card,

html body #contenedor:not(#_) .hist-box,

html body #contenedor:not(#_) .search-container,

html body #contenedor:not(#_) .studio-quick-nav,

html body #contenedor:not(#_) .studio-profile,

html body #contenedor:not(#_) .studio-content {
    background: var(--ba-bg-card);
    border: 1px solid var(--ba-border);
    border-radius: 12px;
    box-shadow: var(--ba-shadow-card);
}

/* 7. INPUTS Y SELECTORES UNIFICADOS */
html body #contenedor:not(#_) input[type="text"],

html body #contenedor:not(#_) input[type="search"],

html body #contenedor:not(#_) input[type="email"],

html body #contenedor:not(#_) input[type="password"],

html body #contenedor:not(#_) select,

html body #contenedor:not(#_) textarea {
    font-family: var(--ba-font);
    border-radius: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

/* 8. BOTONES DE ACCIÓN PRIMARIOS UNIFICADOS (Azul BlurAnime #1fb0f4) */
html body #contenedor:not(#_) .sr-btn-submit,

html body #contenedor:not(#_) .btn-com-post,

html body #contenedor:not(#_) .com-composer-btn,

html body #contenedor:not(#_) .btn-acceso-submit,

html body #contenedor:not(#_) .btn-author-primary,

html body #contenedor:not(#_) .err404-search-btn,

html body #contenedor:not(#_) .btn-err404-primary,

html body #contenedor:not(#_) .search-container button,

html body #contenedor:not(#_) .btn-filter,

html body #contenedor:not(#_) .studio-tab.active,

html body #contenedor:not(#_) .com-tab-btn.active,

html body #contenedor:not(#_) .unified-tabs button.active,

html body #contenedor:not(#_) .acceso-tab-btn.active {
    background: #1fb0f4;
    border-color: #1fb0f4;
    color: #ffffff;
    border-radius: 10px;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(31, 176, 244, 0.25);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

html body #contenedor:not(#_) .sr-btn-submit:hover,

html body #contenedor:not(#_) .btn-com-post:hover,

html body #contenedor:not(#_) .com-composer-btn:hover,

html body #contenedor:not(#_) .btn-acceso-submit:hover,

html body #contenedor:not(#_) .btn-author-primary:hover,

html body #contenedor:not(#_) .err404-search-btn:hover,

html body #contenedor:not(#_) .btn-err404-primary:hover,

html body #contenedor:not(#_) .search-container button:hover,

html body #contenedor:not(#_) .btn-filter:hover {
    background: #0d9de0;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(31, 176, 244, 0.35);
}

/* 9. ICONOS SVG UNIVERSALES */
html body #contenedor:not(#_) i.ti svg.icon-svg {
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    fill: none;
    stroke: currentColor;
}

/* 10. TAMAÑO Y ALINEACIÓN DE CONTENEDOR PRINCIPAL UNIFICADO EN LAS 18 PÁGINAS */
/* #contenedor ya aplica padding-left: 85px en >= 1200px; evitamos doble desplazamiento en los wrappers */
html body #contenedor:not(#_) .sr-page-wrapper,

html body #contenedor:not(#_) .hb-page-wrapper,

html body #contenedor:not(#_) .st-page-wrapper,

html body #contenedor:not(#_) .tx-page-wrapper,

html body #contenedor:not(#_) .comunidad-page-wrapper,

html body #contenedor:not(#_) .dashboard-page-wrapper,

html body #contenedor:not(#_) .author-page-wrapper,

html body #contenedor:not(#_) .std-page-wrapper,

html body #contenedor:not(#_) .err404-page-wrapper,

html body #contenedor:not(#_) .ep-page-wrapper {
    width: 100%;
    margin-left: 0;
    padding-top: 28px;
    box-sizing: border-box;
}

html body #contenedor:not(#_) .custom-container,

html body #contenedor:not(#_) .dir-container,

html body #contenedor:not(#_) .hor-container,

html body #contenedor:not(#_) .top-container,

html body #contenedor:not(#_) .anime-page-container,

html body #contenedor:not(#_) .hist-container,

html body #contenedor:not(#_) .pedidos-container,

html body #contenedor:not(#_) .acceso-page-wrapper {
    margin-top: 28px;
    padding-top: 0;
}

html body #contenedor:not(#_) .tx-page-wrapper .dir-container {
    margin-top: 0;
}

/* Todos los contenedores principales comparten exactamente max-width: 1600px, width: 95%, padding: 0 15px y centrado simétrico */
html body #contenedor:not(#_) .custom-container,

html body #contenedor:not(#_) .dir-container,

html body #contenedor:not(#_) .hor-container,

html body #contenedor:not(#_) .top-container,

html body #contenedor:not(#_) .std-page-container,

html body #contenedor:not(#_) .anime-page-container,

html body #contenedor:not(#_) .ep-container,

html body #contenedor:not(#_) .search-results-container,

html body #contenedor:not(#_) .historial-busquedas-container,

html body #contenedor:not(#_) .hist-container,

html body #contenedor:not(#_) .studio-outer,

html body #contenedor:not(#_) .pedidos-container,

html body #contenedor:not(#_) .comunidad-container,

html body #contenedor:not(#_) .dashboard-container,

html body #contenedor:not(#_) .author-container,

html body #contenedor:not(#_) .err404-container,

html body #contenedor:not(#_) .acceso-page-wrapper {
    box-sizing: border-box;
    max-width: 1600px;
    width: 95%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

/* Tablet (768px - 1199px): 96% ancho, 20px margen superior y 12px de padding lateral uniforme */
@media (min-width: 768px) and (max-width: 1199px) {
    html body #contenedor:not(#_) .sr-page-wrapper,

    html body #contenedor:not(#_) .hb-page-wrapper,

    html body #contenedor:not(#_) .st-page-wrapper,

    html body #contenedor:not(#_) .tx-page-wrapper,

    html body #contenedor:not(#_) .comunidad-page-wrapper,

    html body #contenedor:not(#_) .dashboard-page-wrapper,

    html body #contenedor:not(#_) .author-page-wrapper,

    html body #contenedor:not(#_) .std-page-wrapper,

    html body #contenedor:not(#_) .err404-page-wrapper,

    html body #contenedor:not(#_) .ep-page-wrapper {
        padding-top: 20px;
    }

    html body #contenedor:not(#_) .custom-container,

    html body #contenedor:not(#_) .dir-container,

    html body #contenedor:not(#_) .hor-container,

    html body #contenedor:not(#_) .top-container,

    html body #contenedor:not(#_) .anime-page-container,

    html body #contenedor:not(#_) .hist-container,

    html body #contenedor:not(#_) .pedidos-container,

    html body #contenedor:not(#_) .acceso-page-wrapper {
        margin-top: 20px;
        padding-top: 0;
    }

    html body #contenedor:not(#_) .tx-page-wrapper .dir-container {
        margin-top: 0;
    }

    html body #contenedor:not(#_) .custom-container,

    html body #contenedor:not(#_) .dir-container,

    html body #contenedor:not(#_) .hor-container,

    html body #contenedor:not(#_) .top-container,

    html body #contenedor:not(#_) .std-page-container,

    html body #contenedor:not(#_) .anime-page-container,

    html body #contenedor:not(#_) .ep-container,

    html body #contenedor:not(#_) .search-results-container,

    html body #contenedor:not(#_) .historial-busquedas-container,

    html body #contenedor:not(#_) .hist-container,

    html body #contenedor:not(#_) .studio-outer,

    html body #contenedor:not(#_) .pedidos-container,

    html body #contenedor:not(#_) .comunidad-container,

    html body #contenedor:not(#_) .dashboard-container,

    html body #contenedor:not(#_) .author-container,

    html body #contenedor:not(#_) .err404-container,

    html body #contenedor:not(#_) .acceso-page-wrapper {
        width: 96%;
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* Móvil (<= 767px): 100% ancho, 15px margen superior y 12px de padding lateral uniforme */
@media (max-width: 767px) {
    html body #contenedor:not(#_) .sr-page-wrapper,

    html body #contenedor:not(#_) .hb-page-wrapper,

    html body #contenedor:not(#_) .st-page-wrapper,

    html body #contenedor:not(#_) .tx-page-wrapper,

    html body #contenedor:not(#_) .comunidad-page-wrapper,

    html body #contenedor:not(#_) .dashboard-page-wrapper,

    html body #contenedor:not(#_) .author-page-wrapper,

    html body #contenedor:not(#_) .std-page-wrapper,

    html body #contenedor:not(#_) .err404-page-wrapper,

    html body #contenedor:not(#_) .ep-page-wrapper {
        padding-top: 15px;
    }

    html body #contenedor:not(#_) .custom-container,

    html body #contenedor:not(#_) .dir-container,

    html body #contenedor:not(#_) .hor-container,

    html body #contenedor:not(#_) .top-container,

    html body #contenedor:not(#_) .anime-page-container,

    html body #contenedor:not(#_) .hist-container,

    html body #contenedor:not(#_) .pedidos-container,

    html body #contenedor:not(#_) .acceso-page-wrapper {
        margin-top: 15px;
        padding-top: 0;
    }

    html body #contenedor:not(#_) .tx-page-wrapper .dir-container {
        margin-top: 0;
    }

    html body #contenedor:not(#_) .custom-container,

    html body #contenedor:not(#_) .dir-container,

    html body #contenedor:not(#_) .hor-container,

    html body #contenedor:not(#_) .top-container,

    html body #contenedor:not(#_) .std-page-container,

    html body #contenedor:not(#_) .anime-page-container,

    html body #contenedor:not(#_) .ep-container,

    html body #contenedor:not(#_) .search-results-container,

    html body #contenedor:not(#_) .historial-busquedas-container,

    html body #contenedor:not(#_) .hist-container,

    html body #contenedor:not(#_) .studio-outer,

    html body #contenedor:not(#_) .pedidos-container,

    html body #contenedor:not(#_) .comunidad-container,

    html body #contenedor:not(#_) .dashboard-container,

    html body #contenedor:not(#_) .author-container,

    html body #contenedor:not(#_) .err404-container,

    html body #contenedor:not(#_) .acceso-page-wrapper {
        max-width: 100%;
        width: 100%;
        padding-left: 12px;
        padding-right: 12px;
    }

    html body #contenedor:not(#_) .dir-title,

    html body #contenedor:not(#_) .dir-header h1,

    html body #contenedor:not(#_) .hor-header h1,

    html body #contenedor:not(#_) .top-title,

    html body #contenedor:not(#_) .search-results-title,

    html body #contenedor:not(#_) .sr-title-row h1,

    html body #contenedor:not(#_) .historial-busquedas-title,

    html body #contenedor:not(#_) .hist-title,

    html body #contenedor:not(#_) .tax-title,

    html body #contenedor:not(#_) .com-title,

    html body #contenedor:not(#_) .com-header h1,

    html body #contenedor:not(#_) .acceso-title,

    html body #contenedor:not(#_) .dash-main-title,

    html body #contenedor:not(#_) .dash-main-header h2,

    html body #contenedor:not(#_) .std-title-text h1,

    html body #contenedor:not(#_) .pedidos-header h1,

    html body #contenedor:not(#_) .content-title,

    html body #contenedor:not(#_) .studio-name,

    html body #contenedor:not(#_) .ep-title-bar h1,

    html body #contenedor:not(#_) .home-section-title {
        font-size: 18px;
    }
}

/* ==========================================================================
   11. PÁGINA PRINCIPAL (HOME - index.php + sidebar_right.php) UNIFICADA
   ========================================================================== */

/* 11A. Contenedor y Superficies de Sección en Inicio */
html body #contenedor:not(#_) .home-unified-container > .mb-4,

html body #contenedor:not(#_) .home-unified-container > .home-main-row {
    margin-bottom: 24px;
}

html body #contenedor:not(#_) .home-section-card {
    background: var(--ba-bg-card);
    border: 1px solid var(--ba-border);
    border-radius: 12px;
    box-shadow: var(--ba-shadow-card);
    padding: 24px;
    width: 100%;
    box-sizing: border-box;
}

html body #contenedor:not(#_) .home-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--ba-border);
    width: 100%;
}

html body #contenedor:not(#_) .home-section-title-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}

html body #contenedor:not(#_) .home-section-title {
    font-family: var(--ba-font);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.2px;
    text-transform: none;
    color: var(--ba-text-main);
    border-left: 4px solid var(--ba-primary);
    padding-left: 12px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

html body #contenedor:not(#_) .home-section-title i.ti {
    color: var(--ba-primary);
    font-size: 20px;
    display: inline-flex;
    align-items: center;
}

html body #contenedor:not(#_) .sidebar-header-compact {
    flex-wrap: nowrap;
    gap: 8px;
}

html body #contenedor:not(#_) .home-section-title.sidebar-main-title {
    font-size: 15.5px;
    padding-left: 10px;
    gap: 6px;
    white-space: nowrap;
}

html body #contenedor:not(#_) .home-section-title.sidebar-main-title i.ti {
    font-size: 17px;
}

html body #contenedor:not(#_) .home-btn-ver-todo {
    background: rgba(31, 176, 244, 0.12);
    color: #1fb0f4;
    border: 1px solid rgba(31, 176, 244, 0.28);
    border-radius: 10px;
    padding: 7px 14px;
    font-family: var(--ba-font);
    font-size: 13px;
    font-weight: 800;
    text-transform: none;
    letter-spacing: 0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

html body #contenedor:not(#_) .home-btn-ver-todo:hover {
    background: #1fb0f4;
    color: #ffffff;
    border-color: #1fb0f4;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(31, 176, 244, 0.28);
}

html body #contenedor:not(#_) .home-btn-ver-todo.home-btn-compact {
    padding: 5px 10px;
    font-size: 11.5px;
    flex-shrink: 0;
}

/* 11B. Hero Carousel (#bloque-hero-carrusel) */
html body #contenedor:not(#_) #bloque-hero-carrusel.hero__slider {
    position: relative;
    width: 100%;
    height: 430px;
    border-radius: 12px;
    border: 1px solid var(--ba-border);
    box-shadow: var(--ba-shadow-card);
    overflow: hidden;
    background: var(--ba-surface-2, #e2e8f0);
}

html body #contenedor:not(#_) #bloque-hero-carrusel .hero__items {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 36px 76px 48px;
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: center 22%;
    border-radius: 12px;
    box-sizing: border-box;
}

html body #contenedor:not(#_) #bloque-hero-carrusel .hero__items::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, rgba(10, 12, 18, 0.72) 0%, rgba(10, 12, 18, 0.24) 36%, rgba(10, 12, 18, 0) 60%),
        linear-gradient(90deg, rgba(10, 12, 18, 0.42) 0%, rgba(10, 12, 18, 0.12) 38%, rgba(10, 12, 18, 0) 62%);
    z-index: 1;
    pointer-events: none;
}

html body #contenedor:not(#_) #bloque-hero-carrusel .hero__items::after {
    content: none;
    display: none;
}

html body #contenedor:not(#_) #bloque-hero-carrusel .hero-content-row {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
}

html body #contenedor:not(#_) #bloque-hero-carrusel .hero__text {
    max-width: 720px;
    flex: 1 1 auto;
    min-width: 0;
}

html body #contenedor:not(#_) #bloque-hero-carrusel .hero__text .ainfo {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

html body #contenedor:not(#_) #bloque-hero-carrusel .hero__text .ainfo span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

html body #contenedor:not(#_) #bloque-hero-carrusel .hero__text h2 {
    font-family: var(--ba-font);
    font-size: 32px;
    font-weight: 800;
    line-height: 1.18;
    color: #ffffff;
    margin: 0 0 10px 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.65);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

html body #contenedor:not(#_) #bloque-hero-carrusel .hero__text .hero-synopsis {
    font-family: var(--ba-font);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.55;
    color: rgba(241, 245, 249, 0.88);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

html body #contenedor:not(#_) #bloque-hero-carrusel .hero__btns {
    position: static;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    padding: 0;
}

html body #contenedor:not(#_) #bloque-hero-carrusel .btn-hero-primary,

html body #contenedor:not(#_) #bloque-hero-carrusel .btn-hero-secondary {
    height: 44px;
    padding: 0 20px;
    border-radius: 10px;
    font-family: var(--ba-font);
    font-size: 13.5px;
    font-weight: 800;
    text-transform: none;
    letter-spacing: 0.2px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

html body #contenedor:not(#_) #bloque-hero-carrusel .btn-hero-primary {
    background: #1fb0f4;
    color: #ffffff;
    border: 1px solid #1fb0f4;
    box-shadow: 0 4px 14px rgba(31, 176, 244, 0.38);
}

html body #contenedor:not(#_) #bloque-hero-carrusel .btn-hero-primary:hover {
    background: #0d9de0;
    border-color: #0d9de0;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(31, 176, 244, 0.5);
}

html body #contenedor:not(#_) #bloque-hero-carrusel .btn-hero-secondary {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(8px);
}

html body #contenedor:not(#_) #bloque-hero-carrusel .btn-hero-secondary:hover {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.45);
    transform: translateY(-2px);
}

html body #contenedor:not(#_) #bloque-hero-carrusel .hero-controls {
    position: absolute;
    top: 50%;
    bottom: auto;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    pointer-events: none;
}

html body #contenedor:not(#_) #bloque-hero-carrusel .hero-controls button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(17, 18, 23, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.24);
    color: #ffffff;
    font-size: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
    transition: all 0.22s ease;
    padding: 0;
}

html body #contenedor:not(#_) #bloque-hero-carrusel .hero-controls button i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

html body #contenedor:not(#_) #bloque-hero-carrusel .hero-controls button svg.icon-svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.4;
    transition: transform 0.22s ease;
}

html body #contenedor:not(#_) #bloque-hero-carrusel .hero-controls button:hover {
    background: linear-gradient(135deg, #1fb0f4 0%, #0d8de0 100%);
    border-color: rgba(255, 255, 255, 0.55);
    color: #ffffff;
    box-shadow: 0 8px 22px rgba(31, 176, 244, 0.55);
    transform: scale(1.08);
}

html body #contenedor:not(#_) #bloque-hero-carrusel .hero-controls button:first-child:hover svg.icon-svg {
    transform: translateX(-1.5px);
}

html body #contenedor:not(#_) #bloque-hero-carrusel .hero-controls button:last-child:hover svg.icon-svg {
    transform: translateX(1.5px);
}

html body #contenedor:not(#_) #bloque-hero-carrusel .hero-dots {
    position: absolute;
    top: auto;
    bottom: 14px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    z-index: 15;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(10, 12, 18, 0.48);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

html body #contenedor:not(#_) #bloque-hero-carrusel .hero-dots span {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: all 0.25s ease;
}

html body #contenedor:not(#_) #bloque-hero-carrusel .hero-dots span:hover {
    background: rgba(255, 255, 255, 0.8);
}

html body #contenedor:not(#_) #bloque-hero-carrusel .hero-dots span.active {
    width: 24px;
    background: #1fb0f4;
    box-shadow: 0 0 10px rgba(31, 176, 244, 0.65);
}

/* 11C. Continuar Mirando (#bloque-continuar-mirando + .cw-unified-grid) */
html body #contenedor:not(#_) #recientes_div.cw-unified-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 18px;
    width: 100%;
    margin: 0;
    padding: 0;
}

html body #contenedor:not(#_) #recientes_div.cw-unified-grid .cw-grid-item {
    width: 100%;
    min-width: 0;
    margin: 0;
}

html body #contenedor:not(#_) #recientes_div.cw-unified-grid .hist-thumb-wrap {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: var(--ba-surface-2, #e2e8f0);
    border: 1px solid var(--ba-border);
    box-shadow: var(--ba-shadow-card);
    text-decoration: none;
}

html body #contenedor:not(#_) #recientes_div.cw-unified-grid .hist-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

html body #contenedor:not(#_) #recientes_div.cw-unified-grid .ep-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 4;
}

html body #contenedor:not(#_) #recientes_div.cw-unified-grid .hist-title-overlay {
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    padding: 28px 10px 8px;
    background: linear-gradient(to top, rgba(8, 10, 16, 0.94) 0%, rgba(8, 10, 16, 0.58) 60%, transparent 100%);
    z-index: 2;
}

html body #contenedor:not(#_) #recientes_div.cw-unified-grid .hist-title-overlay h3 {
    margin: 0;
    color: #ffffff;
    font-family: var(--ba-font);
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

html body #contenedor:not(#_) #recientes_div.cw-unified-grid .hist-progress-track {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.28);
    z-index: 3;
}

html body #contenedor:not(#_) #recientes_div.cw-unified-grid .hist-progress-bar {
    height: 100%;
    background: #fb9351;
}

/* 11D. Fila Principal de 2 Columnas: Programación + Animes Recientes */
html body #contenedor:not(#_) .home-main-row {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(300px, 1fr);
    gap: 24px;
    align-items: stretch;
    width: 100%;
}

html body #contenedor:not(#_) #bloque-programacion-principal,

html body #contenedor:not(#_) #bloque-animes-recientes {
    width: 100%;
    max-width: 100%;
    flex: none;
    padding: 0;
    margin: 0;
    min-width: 0;
}

html body #contenedor:not(#_) .home-programacion-box,

html body #contenedor:not(#_) .home-recientes-box {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Filtros de Programación (Pestañas + Días L M M J V S D) */
html body #contenedor:not(#_) .programacion-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding: 0;
    background: transparent;
}

html body #contenedor:not(#_) .programacion-filters .jkanime-pills {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    background: var(--ba-bg-input);
    border: 1px solid var(--ba-border);
    border-radius: 10px;
    padding: 5px;
    margin: 0;
    min-height: 0;
    list-style: none;
}

html body #contenedor:not(#_) .programacion-filters .jkanime-pills .nav-item {
    margin: 0;
}

html body #contenedor:not(#_) .programacion-filters .jkanime-pills .nav-link {
    background: transparent;
    color: var(--ba-text-muted);
    font-family: var(--ba-font);
    font-size: 13px;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: 8px;
    border: none;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}

html body #contenedor:not(#_) .programacion-filters .jkanime-pills .nav-link:hover {
    color: var(--ba-text-main);
    background: rgba(31, 176, 244, 0.1);
}

html body #contenedor:not(#_) .programacion-filters .jkanime-pills .nav-link.active {
    background: #1fb0f4;
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(31, 176, 244, 0.3);
}

html body #contenedor:not(#_) .programacion-filters .days-pills .nav-link {
    min-width: 34px;
    height: 32px;
    padding: 0 10px;
}

html body #contenedor:not(#_) .programacion-filters .anti-spoiler-btn,
html body #contenedor:not(#_) #btnAntiSpoiler.anti-spoiler-btn,
html body #contenedor:not(#_) #btnSbAntiSpoiler.anti-spoiler-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--ba-border);
    background: var(--ba-bg-card);
    color: var(--ba-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    margin-left: 2px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

html body #contenedor:not(#_) #btnAntiSpoiler.anti-spoiler-btn {
    width: 38px;
    height: 38px;
    margin-left: 0;
}

html body #contenedor:not(#_) .programacion-filters .anti-spoiler-btn:hover,
html body #contenedor:not(#_) .programacion-filters .anti-spoiler-btn.active,
html body.anti-spoiler-active #contenedor:not(#_) .programacion-filters .anti-spoiler-btn,
html body #contenedor:not(#_) #btnAntiSpoiler.anti-spoiler-btn:hover,
html body #contenedor:not(#_) #btnAntiSpoiler.anti-spoiler-btn.active,
html body #contenedor:not(#_) #btnSbAntiSpoiler.anti-spoiler-btn:hover,
html body #contenedor:not(#_) #btnSbAntiSpoiler.anti-spoiler-btn.active {
    background: #1fb0f4;
    color: #ffffff;
    border-color: #1fb0f4;
}

/* Cuadrícula de Episodios de Programación (12 tarjetas = 3x4 en Desktop, 4x3 en Laptop/Tablet, 6x2 en Móvil) */
html body #contenedor:not(#_) .home-ep-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    width: 100%;
    margin: 0;
    padding: 0;
}

html body #contenedor:not(#_) #box_movies > .episode-card,
html body #contenedor:not(#_) #box_donghuas > .episode-card,
html body #contenedor:not(#_) #box_ovas > .episode-card,
html body #contenedor:not(#_) .home-ep-grid .episode-card {
    width: 100%;
    max-width: 100%;
    flex: none;
    padding: 0;
    margin: 0;
    min-width: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

html body #contenedor:not(#_) .home-ep-grid .wp-card,
html body #contenedor:not(#_) .home-ep-grid .wp-card:hover {
    border: none;
    background: transparent;
    border-radius: 12px;
    overflow: visible;
    box-shadow: none;
    transform: none;
    transition: none;
    width: 100%;
    margin: 0;
    padding: 0;
    display: block;
}

html body #contenedor:not(#_) .home-ep-grid .ep-card-link {
    display: block;
    width: 100%;
    text-decoration: none;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 12px;
    line-height: 0;
}

html body #contenedor:not(#_) .home-ep-grid .d-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    isolation: isolate;
    transform: translateZ(0);
    background: var(--ba-surface-2, #e2e8f0);
    border: 1px solid var(--ba-border);
    box-shadow: var(--ba-shadow-card);
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

html body.anti-spoiler-active #contenedor:not(#_) #bloque-programacion-principal .home-ep-grid .d-thumb,

html body #contenedor:not(#_) .home-ep-grid.poster-mode .d-thumb {
    aspect-ratio: 2 / 3;
}

html body #contenedor:not(#_) .home-ep-grid .episode-card:hover .d-thumb {
    transform: translateY(-5px);
    box-shadow: var(--ba-shadow-hover);
    border-color: rgba(31, 176, 244, 0.55);
}

html body #contenedor:not(#_) .home-ep-grid .d-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

html body #contenedor:not(#_) .home-ep-grid .d-thumb img.thumb-wide {
    display: block;
}

html body #contenedor:not(#_) .home-ep-grid .d-thumb img.thumb-poster {
    display: none;
}

html body.anti-spoiler-active #contenedor:not(#_) #bloque-programacion-principal .home-ep-grid .d-thumb img.thumb-wide,
html body #contenedor:not(#_) .home-ep-grid.poster-mode .d-thumb img.thumb-wide {
    display: none;
}

html body.anti-spoiler-active #contenedor:not(#_) #bloque-programacion-principal .home-ep-grid .d-thumb img.thumb-poster,
html body #contenedor:not(#_) .home-ep-grid.poster-mode .d-thumb img.thumb-poster {
    display: block;
}

html body #contenedor:not(#_) .home-ep-grid .episode-card:hover .d-thumb img {
    transform: scale(1.05);
}

html body #contenedor:not(#_) .home-ep-grid .ep-card-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(8, 10, 16, 0.95) 0%, rgba(8, 10, 16, 0.45) 52%, rgba(8, 10, 16, 0.1) 100%);
    pointer-events: none;
    z-index: 2;
}

html body #contenedor:not(#_) .home-ep-grid .ep-card-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 6px;
    z-index: 4;
    pointer-events: none;
}

html body #contenedor:not(#_) .home-ep-grid .ep-card-meta-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

html body #contenedor:not(#_) .home-ep-grid .ep-date-pill {
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(4px);
    color: #ffffff;
    font-family: var(--ba-font);
    font-size: 10px;
    font-weight: 700;
    border-radius: 6px;
    padding: 3px 7px;
    line-height: 1.1;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

html body #contenedor:not(#_) .home-ep-grid .ep-card-title {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    margin: 0;
    color: #ffffff;
    font-family: var(--ba-font);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    z-index: 4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 11E. Sidebar Derecha: Animes Recientes (.home-recientes-box) */
html body #contenedor:not(#_) .home-recientes-box .jkanime-sidebar-scroll {
    flex: 1 1 0px;
    height: 0px;
    min-height: 0px;
    max-height: none;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 4px;
}

html body #contenedor:not(#_) .home-recientes-box .custom-sidebar-item {
    background: var(--ba-bg-input);
    border: 1px solid var(--ba-border);
    border-radius: 10px;
    padding: 10px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

html body #contenedor:not(#_) .home-recientes-box .custom-sidebar-item:hover {
    transform: translateX(3px);
    border-color: rgba(31, 176, 244, 0.5);
}

html body #contenedor:not(#_) .home-recientes-box .custom_thumb_home {
    width: 54px;
    height: 78px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: var(--ba-surface-2, #e2e8f0);
    margin: 0;
}

html body #contenedor:not(#_) .home-recientes-box .custom_thumb_home img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

html body #contenedor:not(#_) .home-recientes-box .card-body-home {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
}

html body #contenedor:not(#_) .home-recientes-box .card-title {
    margin: 0 0 6px 0;
    font-size: 13.5px;
    font-weight: 800;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

html body #contenedor:not(#_) .home-recientes-box .card-title a {
    color: var(--ba-text-main);
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

html body #contenedor:not(#_) .home-recientes-box .card-title a:hover {
    color: #1fb0f4;
}

html body #contenedor:not(#_) .home-recientes-box .card-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 5px;
}

html body #contenedor:not(#_) .home-recientes-box .card-text.ep {
    margin: 0;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ba-text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 11F. Top Animes (#bloque-top-animes + .home-top-grid) */
html body #contenedor:not(#_) .home-top-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 20px;
    width: 100%;
}

html body #contenedor:not(#_) .home-top-grid .anime-card,

html body #contenedor:not(#_) .home-top-grid .top-anime-card {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    padding-top: 0;
    aspect-ratio: 2 / 3;
    border-radius: 12px;
    overflow: hidden;
    background: var(--ba-surface-2, #e2e8f0);
    border: 1px solid var(--ba-border);
    box-shadow: var(--ba-shadow-card);
    text-decoration: none;
}

html body #contenedor:not(#_) .home-top-grid .anime-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

html body #contenedor:not(#_) .home-top-grid .badges-top-row {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    z-index: 3;
    pointer-events: none;
}

html body #contenedor:not(#_) .home-top-grid .card-bottom-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 42px 12px 12px;
    background: linear-gradient(to top, rgba(8, 10, 16, 0.95) 0%, rgba(8, 10, 16, 0.65) 55%, transparent 100%);
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
}

html body #contenedor:not(#_) .home-top-grid .rank-number {
    min-width: 34px;
    height: 34px;
    padding: 0 6px;
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(4px);
    color: #ffffff;
    font-family: var(--ba-font);
    font-size: 13.5px;
    font-weight: 800;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

html body #contenedor:not(#_) .home-top-grid .anime-card.is-top-3 .rank-number {
    background: linear-gradient(135deg, #fb9351 0%, #f97316 100%);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 3px 10px rgba(249, 115, 22, 0.4);
}

html body #contenedor:not(#_) .home-top-grid .card-bottom-overlay h3 {
    margin: 0;
    color: #ffffff;
    font-family: var(--ba-font);
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.25;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Ocultar panel secundario cuando está cerrado para evitar fugas en capturas móviles/tablet */
html body:not(#_):not(#__) .secondary-panel:not(.open):not(.active) {
    visibility: hidden;
    pointer-events: none;
}

/* 11G. Adaptabilidad Multi-Resolución de la Página Principal */
/* Laptop (1200px - 1459px, ej. 1366x768): 3 columnas en Continuar Mirando (2x3=6) y 3 columnas en Programación (4x3=12) */
@media (max-width: 1459px) {
    html body #contenedor:not(#_) #recientes_div.cw-unified-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }

    html body #contenedor:not(#_) .home-ep-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }

    html body #contenedor:not(#_) .home-section-card.home-recientes-box {
        padding: 20px 16px;
    }
}

/* Tablet (768px - 1199px, ej. 768x1024): Columna única apilada, 3 cols en Continuar Mirando, 3 cols en Programación, 2 cols en Animes Recientes, 5 cols en Top Animes */
@media (max-width: 1199px) {
    html body #contenedor:not(#_) .home-main-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    html body #contenedor:not(#_) #bloque-hero-carrusel.hero__slider {
        height: 360px;
    }

    html body #contenedor:not(#_) #bloque-hero-carrusel .hero__items {
        padding: 24px 64px 44px;
    }

    html body #contenedor:not(#_) #bloque-hero-carrusel .hero-controls {
        padding: 0 14px;
    }

    html body #contenedor:not(#_) #bloque-hero-carrusel .hero-controls button {
        width: 40px;
        height: 40px;
    }

    html body #contenedor:not(#_) #bloque-hero-carrusel .hero__text h2 {
        font-size: 24px;
    }

    html body #contenedor:not(#_) .home-section-card {
        padding: 20px;
    }

    html body #contenedor:not(#_) .home-recientes-box .jkanime-sidebar-scroll {
        flex: none;
        height: auto;
        min-height: 0;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        max-height: 380px;
    }

    html body #contenedor:not(#_) .home-top-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 14px;
    }
}

/* Móvil (<= 767px, ej. 375x812): 2 columnas simétricas en todas las cuadrículas (3x2=6, 6x2=12, 5x2=10) */
@media (max-width: 767px) {
    html body #contenedor:not(#_) #bloque-hero-carrusel.hero__slider {
        height: 320px;
    }

    html body #contenedor:not(#_) #bloque-hero-carrusel .hero__items {
        padding: 18px 16px 40px;
    }

    html body #contenedor:not(#_) #bloque-hero-carrusel .hero-controls {
        top: 30%;
        padding: 0 12px;
    }

    html body #contenedor:not(#_) #bloque-hero-carrusel .hero-controls button {
        width: 36px;
        height: 36px;
    }

    html body #contenedor:not(#_) #bloque-hero-carrusel .hero-controls button svg.icon-svg {
        width: 18px;
        height: 18px;
    }

    html body #contenedor:not(#_) #bloque-hero-carrusel .hero-content-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    html body #contenedor:not(#_) #bloque-hero-carrusel .hero__text h2 {
        font-size: 20px;
        margin-bottom: 6px;
    }

    html body #contenedor:not(#_) #bloque-hero-carrusel .hero__text .hero-synopsis {
        font-size: 12.5px;
        -webkit-line-clamp: 2;
    }

    html body #contenedor:not(#_) #bloque-hero-carrusel .hero__btns {
        width: 100%;
        gap: 8px;
    }

    html body #contenedor:not(#_) #bloque-hero-carrusel .btn-hero-primary,

    html body #contenedor:not(#_) #bloque-hero-carrusel .btn-hero-secondary {
        flex: 1 1 0;
        height: 38px;
        padding: 0 12px;
        font-size: 12.5px;
    }

    html body #contenedor:not(#_) .home-section-card {
        padding: 14px;
    }

    html body #contenedor:not(#_) .home-section-header {
        flex-wrap: nowrap;
        gap: 8px;
        margin-bottom: 14px;
        padding-bottom: 10px;
    }

    html body #contenedor:not(#_) .home-section-title-group {
        flex: 1 1 auto;
        min-width: 0;
        flex-wrap: nowrap;
        gap: 6px;
    }

    html body #contenedor:not(#_) .home-section-title {
        font-size: 14px;
        padding-left: 8px;
        gap: 5px;
        white-space: nowrap;
    }

    html body #contenedor:not(#_) .home-section-title i.ti {
        font-size: 15px;
        flex-shrink: 0;
    }

    html body #contenedor:not(#_) .home-section-header .sr-count-pill {
        display: none;
    }

    html body #contenedor:not(#_) .home-btn-ver-todo {
        padding: 4px 9px;
        font-size: 11px;
        flex-shrink: 0;
    }

    html body #contenedor:not(#_) #recientes_div.cw-unified-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    html body #contenedor:not(#_) .programacion-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    html body #contenedor:not(#_) .programacion-filters .jkanime-pills {
        width: 100%;
        justify-content: space-between;
    }

    html body #contenedor:not(#_) .programacion-filters .days-pills .nav-link {
        min-width: 30px;
        padding: 0 6px;
        font-size: 12px;
    }

    html body #contenedor:not(#_) .home-ep-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    html body #contenedor:not(#_) .home-ep-grid .ep-card-title {
        font-size: 11.5px;
        bottom: 7px;
        left: 7px;
        right: 7px;
    }

    html body #contenedor:not(#_) .home-ep-grid .ep-date-pill {
        display: none;
    }

    html body #contenedor:not(#_) .home-recientes-box .jkanime-sidebar-scroll {
        flex: none;
        height: auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        max-height: 360px;
    }

    html body #contenedor:not(#_) .home-top-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}


/* ==========================================================================
   12. TOP ANIMES (/top/) — IDENTIDAD VISUAL Y PROTECCIÓN GLOBAL EMOJI SVG
   ========================================================================== */
html body img.emoji,
html body img.wp-smiley {
    width: 1em;
    height: 1em;
    max-width: 1em;
    max-height: 1em;
    display: inline-block;
    vertical-align: -0.1em;
    border: none;
    box-shadow: none;
    margin: 0 0.05em;
    padding: 0;
}

html body #contenedor:not(#_) .top-header-card {
    background: var(--ba-bg-card);
    border: 1px solid var(--ba-border);
    border-radius: 12px;
    box-shadow: var(--ba-shadow-card);
    padding: 22px 24px;
    margin-bottom: 24px;
    width: 100%;
    box-sizing: border-box;
}

html body #contenedor:not(#_) .top-tabs {
    background: var(--ba-bg-input);
    border: 1px solid var(--ba-border);
    border-radius: 10px;
    padding: 5px;
    gap: 6px;
}

html body #contenedor:not(#_) .top-tab {
    border-radius: 8px;
    font-family: var(--ba-font);
    font-size: 13px;
    font-weight: 800;
    gap: 7px;
}

html body #contenedor:not(#_) .top-tab i.ti svg.icon-svg {
    width: 16px;
    height: 16px;
}

html body #contenedor:not(#_) .top-tab.tab-active {
    background: var(--ba-primary);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(31, 176, 244, 0.28);
}

html body #contenedor:not(#_) .top-tab.tab-inactive {
    background: transparent;
    color: var(--ba-text-muted);
}

html body #contenedor:not(#_) .top-tab.tab-inactive:hover {
    background: rgba(31, 176, 244, 0.1);
    color: var(--ba-primary);
}

/* ==========================================================================
   13. EVOLUCIÓN 10 NIVELES ESTILO NETFLIX (UX, DESCUBRIMIENTO, PROGRESO,
       MI LISTA RÁPIDA, MODO CINE, ATAJOS DE TECLADO Y ACCESIBILIDAD)
   ========================================================================== */

/* Nivel 1: Botón central de reproducción en tarjetas de Programación (.ep-hover-play) */
html body #contenedor:not(#_) .home-ep-grid .ep-hover-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.84);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(31, 176, 244, 0.92);
    border: 2px solid rgba(255, 255, 255, 0.85);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    z-index: 5;
    pointer-events: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
    transition: opacity 0.22s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

html body #contenedor:not(#_) .home-ep-grid .ep-hover-play svg.icon-svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    margin-left: 2px;
}

html body #contenedor:not(#_) .home-ep-grid .episode-card:hover .ep-hover-play,
html body #contenedor:not(#_) .home-ep-grid .ep-card-link:focus-visible .ep-hover-play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Nivel 2: Indicador de Episodio Visto (✓ Visto) y Barra de Progreso en Tarjetas */
html body #contenedor:not(#_) .ba-watched-pill {
    background: rgba(16, 185, 129, 0.95);
    color: #ffffff;
    font-family: var(--ba-font);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-radius: 6px;
    padding: 3px 7px;
    line-height: 1.1;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
    z-index: 5;
    pointer-events: none;
}

html body #contenedor:not(#_) .ba-watched-pill svg.icon-svg {
    width: 11px;
    height: 11px;
    stroke-width: 2.6;
}

html body #contenedor:not(#_) .episodes-grid .ep-item .ba-watched-pill {
    position: absolute;
    top: 8px;
    right: 8px;
    left: auto;
}

html body #contenedor:not(#_) .ba-ep-progress-line {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3.5px;
    background: linear-gradient(90deg, #1fb0f4 0%, #10b981 100%);
    z-index: 5;
    pointer-events: none;
}

/* Nivel 3: Acción Rápida "+ Mi Lista" flotante en tarjetas de póster (.ba-quick-fav-btn) */
html body #contenedor:not(#_) .ba-quick-fav-btn {
    position: absolute;
    bottom: 46px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.84);
    border: 1.5px solid rgba(255, 255, 255, 0.45);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 7;
    opacity: 0;
    transform: scale(0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    padding: 0;
}

html body #contenedor:not(#_) .ba-quick-fav-btn svg.icon-svg {
    width: 15px;
    height: 15px;
    stroke-width: 2.5;
    pointer-events: none;
}

html body #contenedor:not(#_) .anime-card:hover .ba-quick-fav-btn,
html body #contenedor:not(#_) .dir-card:hover .ba-quick-fav-btn,
html body #contenedor:not(#_) .hor-card:hover .ba-quick-fav-btn,
html body #contenedor:not(#_) .sr-card:hover .ba-quick-fav-btn,
html body #contenedor:not(#_) .ba-quick-fav-btn.is-in-mylist,
html body #contenedor:not(#_) .ba-quick-fav-btn:focus-visible {
    opacity: 1;
    transform: scale(1);
}

html body #contenedor:not(#_) .ba-quick-fav-btn:hover {
    background: #1fb0f4;
    border-color: #ffffff;
    transform: scale(1.08);
}

html body #contenedor:not(#_) .ba-quick-fav-btn.is-in-mylist {
    background: rgba(16, 185, 129, 0.94);
    border-color: rgba(255, 255, 255, 0.85);
}

/* Nivel 4: Barra de Acción Inteligente "Continuar Episodio X" + Progreso de Temporada en Ficha de Anime */
html body #contenedor:not(#_) .anime-hero-cta-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin: 14px 0 18px;
    padding: 12px 16px;
    background: var(--ba-bg-input);
    border: 1px solid var(--ba-border);
    border-radius: 12px;
}

html body #contenedor:not(#_) .btn-anime-smart-play {
    height: 42px;
    padding: 0 20px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1fb0f4 0%, #0d8de0 100%);
    color: #ffffff;
    font-family: var(--ba-font);
    font-size: 13.5px;
    font-weight: 800;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(31, 176, 244, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    flex-shrink: 0;
}

html body #contenedor:not(#_) .btn-anime-smart-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(31, 176, 244, 0.5);
    color: #ffffff;
}

html body #contenedor:not(#_) .btn-anime-smart-play svg.icon-svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
}

html body #contenedor:not(#_) .anime-season-progress-pill {
    flex: 1 1 200px;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

html body #contenedor:not(#_) .anime-season-progress-pill .asp-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--ba-text-muted);
}

html body #contenedor:not(#_) .anime-season-progress-pill .asp-meta #animeSeasonProgressPct {
    color: var(--ba-primary);
    font-weight: 800;
}

html body #contenedor:not(#_) .anime-season-progress-pill .asp-track {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.22);
    overflow: hidden;
}

html body #contenedor:not(#_) .anime-season-progress-pill .asp-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #1fb0f4 0%, #10b981 100%);
    transition: width 0.35s ease;
}

/* Nivel 5 y 6: Botón "¿Qué veo hoy? (Sorpréndeme)" + Indicador de Atajo [/] en Buscador */
html body .wp-header .form_search2 {
    position: relative;
    display: flex;
    align-items: center;
}

html body .wp-header .ba-search-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    margin-right: 4px;
    border-radius: 5px;
    background: rgba(148, 163, 184, 0.18);
    border: 1px solid rgba(148, 163, 184, 0.32);
    color: var(--ba-text-muted);
    font-family: var(--ba-font);
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    pointer-events: none;
    user-select: none;
    flex-shrink: 0;
}

html body .wp-header .ba-surprise-btn {
    height: 36px;
    padding: 0 13px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.32);
    color: #ffffff;
    font-family: var(--ba-font);
    font-size: 12.5px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

html body .wp-header .ba-surprise-btn:hover {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
}

html body.dark-mode .wp-header .ba-surprise-btn {
    background: rgba(31, 176, 244, 0.14);
    border-color: rgba(31, 176, 244, 0.35);
    color: #1fb0f4;
}

html body.dark-mode .wp-header .ba-surprise-btn:hover {
    background: #1fb0f4;
    border-color: #1fb0f4;
    color: #ffffff;
}

@media (max-width: 1199px) {
    html body .wp-header .ba-surprise-btn,
    html body .wp-header .ba-search-kbd {
        display: none;
    }
}

/* Modal Cinematográfico "¿Qué veo hoy? (Sorpréndeme)" */
html body .ba-surprise-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 10, 16, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

html body .ba-surprise-overlay.active {
    display: flex;
}

html body .ba-surprise-modal {
    width: 100%;
    max-width: 520px;
    background: var(--ba-bg-card);
    border: 1px solid var(--ba-border);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
    overflow: hidden;
    color: var(--ba-text-main);
    font-family: var(--ba-font);
}

html body .ba-surprise-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ba-border);
}

html body .ba-surprise-head h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: var(--ba-text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

html body .ba-surprise-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--ba-border);
    background: var(--ba-bg-input);
    color: var(--ba-text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
}

html body .ba-surprise-body {
    display: flex;
    gap: 18px;
    padding: 20px;
    align-items: center;
}

html body .ba-surprise-poster {
    width: 120px;
    aspect-ratio: 2 / 3;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--ba-surface-2, #e2e8f0);
    border: 1px solid var(--ba-border);
}

html body .ba-surprise-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

html body .ba-surprise-info {
    flex: 1 1 auto;
    min-width: 0;
}

html body .ba-surprise-info h4 {
    margin: 8px 0 6px;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--ba-text-main);
}

html body .ba-surprise-info p {
    margin: 0 0 14px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--ba-text-muted);
}

html body .ba-surprise-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

html body .ba-surprise-play {
    height: 38px;
    padding: 0 16px;
    border-radius: 10px;
    background: #1fb0f4;
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

html body .ba-surprise-reroll {
    height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    background: var(--ba-bg-input);
    border: 1px solid var(--ba-border);
    color: var(--ba-text-main);
    font-family: var(--ba-font);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

/* Nivel 7: Modo Cine ("Apagar Luces" en Páginas de Episodio) */
html body.ba-cinema-mode #contenedor {
    background-color: #07080c;
}

html body.ba-cinema-mode .wp-header,
html body.ba-cinema-mode .mainmenu,
html body.ba-cinema-mode .ep-sidebar,
html body.ba-cinema-mode .anime-info-box,
html body.ba-cinema-mode .comments-box,
html body.ba-cinema-mode .custom-jk-footer {
    opacity: 0.16;
    transition: opacity 0.35s ease;
}

html body.ba-cinema-mode .wp-header:hover,
html body.ba-cinema-mode .mainmenu:hover,
html body.ba-cinema-mode .ep-sidebar:hover {
    opacity: 1;
}

html body.ba-cinema-mode #contenedor:not(#_) #playerBox {
    box-shadow: 0 0 60px rgba(31, 176, 244, 0.25), 0 20px 50px rgba(0, 0, 0, 0.85);
    border-color: rgba(31, 176, 244, 0.45);
}

html body #contenedor:not(#_) .ep-btn.active-cinema,
html body #contenedor:not(#_) .ep-btn.active-watched {
    background: #1fb0f4;
    color: #ffffff;
    border-color: #1fb0f4;
}

/* Nivel 10: Toast Global de Feedback y Accesibilidad :focus-visible */
html body .ba-global-toast-wrap {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10080;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

html body .ba-global-toast {
    background: rgba(15, 23, 42, 0.94);
    color: #ffffff;
    border: 1px solid rgba(31, 176, 244, 0.45);
    border-radius: 10px;
    padding: 10px 16px;
    font-family: var(--ba-font);
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transform: translateY(12px);
    opacity: 0;
    transition: transform 0.22s ease, opacity 0.22s ease;
}

html body .ba-global-toast.show {
    transform: translateY(0);
    opacity: 1;
}

html body #contenedor:not(#_) a:focus-visible,
html body #contenedor:not(#_) button:focus-visible,
html body #contenedor:not(#_) input:focus-visible,
html body #contenedor:not(#_) select:focus-visible {
    outline: 2px solid #1fb0f4;
    outline-offset: 2px;
}
