.anime-page-container,
    .anime-page-container * {
        box-sizing: border-box;
    }

    .anime-page-container {
        font-family: 'Mulish', sans-serif;
        max-width: 1600px;
        width: 95%;
        margin: 28px auto 10px;
        padding: 0 15px;
        color: #333333;
        flex: 1 1 auto;
        min-width: 0;
    }
    body.dark-mode .anime-page-container {
        color: #e2e6f0;
    }

    /* Custom Toast Notification (Replaces ugly browser alerts) */
    .ba-toast-container {
        position: fixed;
        bottom: 24px;
        right: 24px;
        z-index: 99999;
        display: flex;
        flex-direction: column;
        gap: 10px;
        max-width: calc(100vw - 32px);
        pointer-events: none;
    }
    .ba-toast {
        pointer-events: auto;
        background: #1f212b;
        color: #ffffff;
        border-left: 4px solid #1fb0f4;
        border-radius: 8px;
        padding: 12px 16px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
        font-family: 'Mulish', sans-serif;
        font-size: 13.5px;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 12px;
        min-width: 260px;
        max-width: 420px;
        animation: baToastIn 0.22s ease forwards;
    }
    .ba-toast.toast-success {
        border-left-color: #2ecc71;
    }
    .ba-toast.toast-warning {
        border-left-color: #f39c12;
    }
    .ba-toast a.ba-toast-link {
        color: #1fb0f4;
        font-weight: 800;
        text-decoration: underline;
        margin-left: auto;
        white-space: nowrap;
    }
    @keyframes baToastIn {
        from { opacity: 0; transform: translateY(12px); }
        to { opacity: 1; transform: translateY(0); }
    }

    /* Main 2-Column Layout */
    .anime-details-row {
        display: grid;
        grid-template-columns: 270px minmax(0, 1fr);
        gap: 30px;
        align-items: start;
        width: 100%;
    }
    .anime-sidebar-col {
        min-width: 0;
        width: 100%;
    }
    .anime-main-col {
        min-width: 0;
        width: 100%;
    }

    /* Poster & Left Sidebar Controls */
    .anime-poster {
        position: relative;
        width: 100%;
        aspect-ratio: 2 / 3;
        border-radius: 8px;
        overflow: hidden;
        background: var(--ba-surface-2, #e2e8f0);
        margin-bottom: 10px;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
    }
    .anime-poster img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    .vote-bar-wrap {
        display: flex;
        align-items: stretch;
        height: 40px;
        margin-bottom: 10px;
        width: 100%;
    }
    .vote-count-box {
        background: #a67c00;
        color: #ffffff;
        padding: 0 14px;
        font-weight: 800;
        border-radius: 6px 0 0 6px;
        font-size: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        white-space: nowrap;
    }
    .btn-vote-toggle {
        background: #f39c12;
        color: #ffffff;
        font-family: 'Mulish', sans-serif;
        font-weight: 700;
        border-radius: 0 6px 6px 0;
        border: none;
        font-size: 14px;
        padding: 0 12px;
        outline: none;
        height: 100%;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        cursor: pointer;
        transition: filter 0.2s;
    }
    .btn-vote-toggle:hover {
        filter: brightness(0.95);
    }

    .custom-dd-container {
        position: relative;
        width: 100%;
    }
    .custom-dd-menu {
        display: none;
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        z-index: 1000;
        background-color: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
        width: 100%;
        padding: 10px 0;
    }
    .custom-dd-menu.show {
        display: block;
    }
    body.dark-mode .custom-dd-menu {
        background-color: #1f212b;
        border-color: #3b4059;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    }

    /* Star Rating inside #menu-votar */
    #menu-votar {
        padding: 12px;
        text-align: center;
        min-width: 190px;
    }
    .vote-menu-label {
        display: block;
        font-size: 12.5px;
        font-weight: 700;
        color: #6c757d;
        margin-bottom: 8px;
    }
    body.dark-mode .vote-menu-label {
        color: #b0b5c9;
    }
    .star-rating {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 6px;
    }
    .star-rating button.star-btn {
        background: none;
        border: none;
        padding: 2px;
        cursor: pointer;
        color: #cbd5e1;
        font-size: 22px;
        line-height: 1;
        transition: transform 0.15s, color 0.15s;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .star-rating button.star-btn.hovered,
    .star-rating button.star-btn.selected {
        color: #f39c12;
        transform: scale(1.12);
    }
    .star-rating button.star-btn svg.icon-svg {
        width: 22px;
        height: 22px;
        fill: currentColor;
    }

    /* Save Anime Dropdown */
    .btn-save-toggle {
        background: #007bff;
        color: #ffffff;
        font-family: 'Mulish', sans-serif;
        font-weight: 700;
        border-radius: 6px;
        border: none;
        font-size: 14px;
        height: 40px;
        padding: 0 14px;
        outline: none;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        cursor: pointer;
        transition: background 0.2s;
    }
    .btn-save-toggle:hover {
        background: #0069d9;
    }
    .btn-save-toggle.has-saved-status {
        background: #1fb0f4;
    }
    .btn-anime-status {
        color: #333333;
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        text-decoration: none;
        font-size: 13.5px;
        font-weight: 600;
        padding: 9px 16px;
        transition: background 0.18s, color 0.18s;
    }
    .btn-anime-status i,
    .btn-anime-status svg.icon-svg {
        color: #007bff;
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }
    .btn-anime-status:hover {
        background-color: #f1f5f9;
        color: #111111;
    }
    .btn-anime-status.active-status {
        background-color: #e7f1ff;
        color: #0056b3;
        font-weight: 800;
    }
    body.dark-mode .btn-anime-status {
        color: #d1d5db;
    }
    body.dark-mode .btn-anime-status:hover {
        background-color: #2b2e3d;
        color: #ffffff;
    }
    body.dark-mode .btn-anime-status.active-status {
        background-color: rgba(31, 176, 244, 0.2);
        color: #6ed0ff;
    }

    /* Anime Stats Bar */
    .anime-stats {
        background: #4b5563;
        color: #ffffff;
        border-radius: 6px;
        padding: 10px 6px;
        display: flex;
        text-align: center;
        margin-bottom: 10px;
        width: 100%;
    }
    body.dark-mode .anime-stats {
        background: #2b2e3d;
        border: 1px solid #3b4059;
    }
    .anime-stats > div {
        flex: 1;
        font-size: 12px;
        font-weight: 700;
        min-width: 0;
    }
    .anime-stats svg.icon-svg {
        width: 15px;
        height: 15px;
        vertical-align: -2px;
    }

    /* Left Details Card */
    .anime-details {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        font-size: 13.5px;
        line-height: 1.45;
        color: #333333;
        padding: 16px;
        margin-bottom: 20px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    }
    body.dark-mode .anime-details {
        background: #1f212b;
        color: #d1d5db;
        border-color: #3b4059;
    }
    .anime-details .detail-item {
        margin-bottom: 10px;
    }
    .anime-details .detail-item:last-child {
        margin-bottom: 0;
    }
    .anime-details strong {
        color: #111111;
        font-weight: 800;
    }
    body.dark-mode .anime-details strong {
        color: #ffffff;
    }
    .anime-details a {
        color: #1fb0f4;
        text-decoration: none;
    }
    .anime-details a:hover {
        text-decoration: underline;
    }
    .status-box {
        display: inline-block;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        margin-right: 6px;
        vertical-align: middle;
    }

    /* Main Right Column: Title, Synopsis & Tabs */
    .anime-main-title {
        font-size: 28px;
        font-weight: 800;
        color: #212529;
        margin: 0 0 12px 0;
        line-height: 1.25;
    }
    body.dark-mode .anime-main-title {
        color: #ffffff;
    }
    .anime-main-desc {
        font-size: 14px;
        line-height: 1.65;
        color: #4b5563;
        margin: 0 0 22px 0;
        text-align: justify;
    }
    body.dark-mode .anime-main-desc {
        color: #cbd5e1;
    }

    /* Navigation Tabs */
    .custom-tabs-container {
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 6px;
        background: #ffffff;
        margin-bottom: 20px;
        width: 100%;
    }
    body.dark-mode .custom-tabs-container {
        background: #1f212b;
        border-color: #3b4059;
    }
    .custom-tabs-single {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        list-style: none;
        padding: 0;
        margin: 0;
        border: none;
    }
    .custom-tabs-single .nav-item {
        margin: 0;
    }
    .custom-tabs-single .nav-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: none;
        font-size: 14px;
        padding: 9px 20px;
        font-weight: 700;
        color: #334155;
        background: transparent;
        border-radius: 6px;
        text-decoration: none;
        transition: background 0.2s, color 0.2s;
    }
    body.dark-mode .custom-tabs-single .nav-link {
        color: #b0b5c9;
    }
    .custom-tabs-single .nav-link:hover {
        background: #f1f5f9;
        color: #0f172a;
    }
    body.dark-mode .custom-tabs-single .nav-link:hover {
        background: #2b2e3d;
        color: #ffffff;
    }
    .custom-tabs-single .nav-link.active,
    body.dark-mode .custom-tabs-single .nav-link.active {
        background: #f08b00;
        color: #ffffff;
        border-radius: 6px;
    }

    /* Episodes Filter Bar */
    .episodes-filter-container {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        padding: 12px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        gap: 14px;
        margin-bottom: 18px;
        width: 100%;
    }
    body.dark-mode .episodes-filter-container {
        background: #1f212b;
        border-color: #3b4059;
    }
    .ep-filter-range-group {
        display: flex;
        align-items: center;
        gap: 8px;
        height: 40px;
        flex-shrink: 0;
    }
    #chunkSelect {
        min-width: 145px;
        height: 38px;
        padding: 0 12px;
        border: 1px solid #ced4da;
        border-radius: 8px;
        outline: none;
        background: #f8f9fa;
        color: #212529;
        font-family: 'Mulish', sans-serif;
        font-size: 13.5px;
        font-weight: 700;
        cursor: pointer;
    }
    body.dark-mode #chunkSelect {
        background: #2b2e3d;
        border-color: #474c67;
        color: #ffffff;
    }
    #btnAntiSpoiler.anti-spoiler-btn {
        width: 38px;
        height: 38px;
        border-radius: 8px;
        border: 1px solid var(--ba-border);
        background: var(--ba-bg-card);
        color: var(--ba-text-muted);
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        flex-shrink: 0;
        transition: all 0.2s ease;
    }
    #btnAntiSpoiler.anti-spoiler-btn:hover,
    #btnAntiSpoiler.anti-spoiler-btn.active {
        background: #1fb0f4;
        color: #ffffff;
        border-color: #1fb0f4;
    }
    #btnAntiSpoiler svg.icon-svg {
        width: 17px;
        height: 17px;
    }

    .ep-filter-search-group {
        display: flex;
        align-items: stretch;
        flex: 1 1 auto;
        min-width: 0;
        height: 40px;
    }
    #epSearch {
        flex: 1 1 auto;
        min-width: 0;
        height: 40px;
        padding: 0 14px;
        border: 1px solid #ced4da;
        border-right: none;
        border-radius: 6px 0 0 6px;
        outline: none;
        background: #f8f9fa;
        color: #212529;
        font-family: 'Mulish', sans-serif;
        font-size: 13.5px;
    }
    body.dark-mode #epSearch {
        background: #2b2e3d;
        border-color: #474c67;
        color: #ffffff;
    }
    #epInvert {
        background: #343a40;
        color: #ffffff;
        border: none;
        height: 40px;
        padding: 0 18px;
        border-radius: 0 6px 6px 0;
        cursor: pointer;
        font-family: 'Mulish', sans-serif;
        font-size: 13.5px;
        font-weight: 700;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        white-space: nowrap;
        flex-shrink: 0;
        transition: background 0.2s;
    }
    #epInvert:hover {
        background: #23272b;
    }
    #epInvert svg.icon-svg {
        width: 16px;
        height: 16px;
    }

    /* Episodes Grid */
    .episodes-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 16px;
        width: 100%;
    }
    .episode-card {
        position: relative;
        border-radius: 8px;
        background: var(--ba-surface-2, #e2e8f0);
        aspect-ratio: 16 / 9;
        overflow: hidden;
        display: block;
        text-decoration: none;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
        transform: translateZ(0);
        transition: transform 0.22s ease, box-shadow 0.22s ease;
    }
    .episode-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
    }
    .episode-card .ep-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        opacity: 1;
        filter: none;
        transition: transform 0.3s ease;
    }
    .episode-card .ep-img.ep-img-normal {
        display: block;
    }
    .episode-card .ep-img.ep-img-backdrop {
        display: none;
    }
    .episode-card:hover .ep-img {
        transform: scale(1.05);
    }
    /* Anti-Spoiler Mode: muestra la Imagen de Portada (Relación 16:9) del anime general sin sombra ni desenfoque */
    .episodes-grid.anti-spoiler-active .episode-card .ep-img.ep-img-normal {
        display: none;
    }
    .episodes-grid.anti-spoiler-active .episode-card .ep-img.ep-img-backdrop {
        display: block;
        filter: none;
        opacity: 1;
    }
    .ep-overlay {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        transition: opacity 0.25s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 2;
    }
    .episode-card:hover .ep-overlay {
        opacity: 1;
    }
    .ep-badge-num {
        position: absolute;
        top: 8px;
        left: 8px;
        background: #f39c12;
        color: #ffffff;
        font-size: 11px;
        font-weight: 800;
        padding: 3px 9px;
        border-radius: 12px;
        z-index: 3;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
    }
    .ep-empty-search {
        display: none;
        grid-column: 1 / -1;
        text-align: center;
        padding: 32px 16px;
        color: #6c757d;
        background: #f8f9fa;
        border: 1px dashed #ced4da;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 600;
    }
    body.dark-mode .ep-empty-search {
        background: rgba(255, 255, 255, 0.02);
        border-color: #3b4059;
        color: #9aa0b8;
    }

    /* Centered "Ver más" Button Wrapper */
    .ver-mas-wrap {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        margin: 26px 0 10px;
        text-align: center;
    }
    .btn-ver-mas-eps {
        background: #404b5a;
        color: #ffffff;
        border: none;
        border-radius: 6px;
        height: 42px;
        padding: 0 38px;
        font-family: 'Mulish', sans-serif;
        font-size: 14px;
        font-weight: 700;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        transition: background 0.2s, transform 0.15s;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    }
    .btn-ver-mas-eps:hover {
        background: #2d3642;
        transform: translateY(-1px);
    }
    body.dark-mode .btn-ver-mas-eps {
        background: #303446;
        border: 1px solid #474c67;
    }
    body.dark-mode .btn-ver-mas-eps:hover {
        background: #3b4059;
    }

    /* Info & Characters Tabs */
    .info-box-alt {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        padding: 16px;
        border-radius: 8px;
        margin-bottom: 20px;
    }
    body.dark-mode .info-box-alt {
        background: #1f212b;
        color: #d1d5db;
        border-color: #3b4059;
    }
    .info-title {
        font-size: 20px;
        margin-bottom: 15px;
        font-weight: 800;
        color: #212529;
    }
    body.dark-mode .info-title,
    body.dark-mode .trailer-title {
        color: #ffffff;
    }
    .embed-responsive {
        position: relative;
        display: block;
        width: 100%;
        padding: 0;
        overflow: hidden;
    }
    .embed-responsive::before {
        display: block;
        content: "";
        padding-top: 56.25%;
    }
    .embed-responsive .embed-responsive-item,
    .embed-responsive iframe {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border: 0;
    }

    .personajes-grid {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 16px;
        width: 100%;
    }
    .personaje-card {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    body.dark-mode .personaje-card {
        background: #1f212b;
        border-color: #3b4059;
    }

    /* ==========================================================================
       SECCIÓN "TE RECOMENDAMOS" (DISEÑO PREMIUM + EFECTOS + NÚMERO DE VISTAS)
       ========================================================================== */
    .full-width-bottom {
        margin-top: 44px;
        margin-bottom: 20px;
        width: 100%;
    }
    .recommendations-section {
        margin-bottom: 64px;
        padding-bottom: 36px;
        border-bottom: 1px solid #e2e8f0;
        width: 100%;
    }
    body.dark-mode .recommendations-section {
        border-bottom-color: #303240;
    }
    .rec-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 12px;
        margin-bottom: 22px;
    }
    .rec-section-title {
        font-family: var(--ba-font, 'Mulish', sans-serif);
        font-size: 22px;
        font-weight: 800;
        color: var(--ba-text-main, #1e2229);
        margin: 0;
        border-left: 4px solid #1fb0f4;
        padding-left: 12px;
        text-transform: none;
        letter-spacing: -0.2px;
        line-height: 1.25;
    }
    body.dark-mode .rec-section-title {
        color: #f1f5f9;
    }
    .rec-genre-links {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
    }
    .rec-genre-pill {
        display: inline-flex;
        align-items: center;
        padding: 4px 12px;
        border-radius: 999px;
        font-size: 12px;
        font-weight: 700;
        color: #1fb0f4;
        background: rgba(31, 176, 244, 0.1);
        border: 1px solid rgba(31, 176, 244, 0.28);
        text-decoration: none;
        transition: all 0.2s ease;
    }
    .rec-genre-pill:hover {
        background: #1fb0f4;
        color: #ffffff;
        border-color: #1fb0f4;
        text-decoration: none;
    }
    .rec-card-genres {
        font-size: 11px;
        font-weight: 700;
        color: #1fb0f4;
        margin: 0 0 6px 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .rec-grid {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 20px;
        width: 100%;
    }
    .rec-card {
        position: relative;
        display: block;
        aspect-ratio: 2 / 3;
        text-decoration: none;
        border-radius: 12px;
        overflow: hidden;
        background: var(--ba-surface-2, #e2e8f0);
        border: 1px solid var(--ba-border, #e2e8f0);
        box-shadow: var(--ba-shadow-card, 0 4px 16px rgba(15, 23, 42, 0.05));
        transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, border-color 0.25s ease;
        min-width: 0;
        width: 100%;
    }
    .rec-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--ba-shadow-hover, 0 12px 26px rgba(15, 23, 42, 0.16));
        border-color: rgba(31, 176, 244, 0.55);
        text-decoration: none;
    }
    body.dark-mode .rec-card {
        background: var(--ba-surface-2, #e2e8f0);
        border-color: var(--ba-border, #2b2f3f);
        box-shadow: var(--ba-shadow-card, 0 6px 22px rgba(0, 0, 0, 0.35));
    }
    body.dark-mode .rec-card:hover {
        border-color: rgba(31, 176, 244, 0.55);
        box-shadow: var(--ba-shadow-hover, 0 14px 30px rgba(0, 0, 0, 0.52));
    }

    .rec-card > img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform 0.35s ease;
    }
    .rec-card:hover > img {
        transform: scale(1.05);
    }

    .rec-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;
        pointer-events: none;
    }
    .rec-card-title {
        font-family: var(--ba-font, 'Mulish', sans-serif);
        font-size: 13.5px;
        font-weight: 700;
        color: #ffffff;
        margin: 0;
        line-height: 1.3;
        text-align: center;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    body.dark-mode .rec-card-title {
        color: #ffffff;
    }

    /* Comments Section Box with Generous Separation */
    .comments-section {
        clear: both;
        display: flow-root;
        float: none;
        width: 100%;
        margin-top: 0;
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        padding: 28px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    }
    body.dark-mode .comments-section {
        background: #1f212b;
        border-color: #3b4059;
        box-shadow: none;
    }

    /* ==========================================================================
       4 RESOLUCIONES DEL PROYECTO - BREAKPOINTS ESTRICTOS
       ========================================================================== */

    /* 1. Resolución Ultra-Wide / 2K (>= 1634px) */
    @media (min-width: 1634px) {
        .anime-details-row {
            grid-template-columns: 280px minmax(0, 1fr);
            gap: 32px;
        }
        .episodes-grid {
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 18px;
        }
        .rec-grid {
            grid-template-columns: repeat(6, minmax(0, 1fr));
            gap: 22px;
        }
    }

    /* 2B. Resolución Laptop (1200px - 1459px) */
    @media (min-width: 1200px) and (max-width: 1459px) {
        .anime-details-row {
            grid-template-columns: 240px minmax(0, 1fr);
            gap: 24px;
        }
        .episodes-grid {
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 14px;
        }
        .rec-grid {
            grid-template-columns: repeat(6, minmax(0, 1fr));
            gap: 14px;
        }
        .personajes-grid {
            grid-template-columns: repeat(4, minmax(0, 1fr));
        }
    }

    /* 3. Resolución Tablet (768px - 1199px) */
    @media (min-width: 768px) and (max-width: 1199px) {
        .anime-page-container {
            width: 96%;
            margin: 20px auto 10px;
            padding: 0 12px;
        }
        .anime-details-row {
            grid-template-columns: minmax(0, 1fr);
            gap: 24px;
        }
        .anime-sidebar-col {
            display: grid;
            grid-template-columns: 220px minmax(0, 1fr);
            gap: 20px;
            align-items: start;
            background: #ffffff;
            border: 1px solid #e2e8f0;
            border-radius: 10px;
            padding: 18px;
        }
        body.dark-mode .anime-sidebar-col {
            background: #1f212b;
            border-color: #3b4059;
        }
        .anime-sidebar-left-pane {
            min-width: 0;
        }
        .anime-sidebar-right-pane {
            min-width: 0;
        }
        .anime-details {
            margin-bottom: 0;
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 10px 16px;
        }
        .anime-details .detail-item {
            margin-bottom: 0;
        }
        .episodes-grid {
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 14px;
        }
        .rec-grid {
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 16px;
        }
        .personajes-grid {
            grid-template-columns: repeat(4, minmax(0, 1fr));
        }
        .recommendations-section {
            margin-bottom: 48px;
            padding-bottom: 28px;
        }
        .comments-section {
            padding: 22px;
        }
    }

    /* 4. Resolución Móvil (<= 767px) */
    @media (max-width: 767px) {
        .anime-page-container {
            width: 100%;
            margin: 15px auto 10px;
            padding: 0 12px;
        }
        .anime-details-row {
            grid-template-columns: minmax(0, 1fr);
            gap: 20px;
        }
        .anime-poster {
            max-width: 220px;
            margin: 0 auto 12px;
        }
        .anime-details {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 10px 12px;
            padding: 14px;
            margin-bottom: 6px;
        }
        .anime-details .detail-item {
            margin-bottom: 0;
        }
        .anime-main-title {
            font-size: 22px;
            text-align: center;
        }
        .anime-main-desc {
            font-size: 13.5px;
            line-height: 1.55;
        }
        .custom-tabs-single {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 6px;
        }
        .custom-tabs-single .nav-link {
            width: 100%;
            padding: 8px 10px;
            font-size: 13px;
        }
        .episodes-filter-container {
            flex-direction: column;
            align-items: stretch;
            gap: 10px;
            padding: 10px;
        }
        .ep-filter-range-group,
        .ep-filter-search-group {
            width: 100%;
        }
        #chunkSelect {
            flex: 1 1 auto;
            min-width: 0;
        }
        .episodes-grid {
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 10px;
        }
        .ep-badge-num {
            font-size: 10px;
            padding: 2px 7px;
            top: 6px;
            left: 6px;
        }
        .btn-ver-mas-eps {
            width: 100%;
            max-width: 280px;
        }
        .personajes-grid {
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 12px;
        }
        .rec-grid {
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 12px;
        }
        .recommendations-section {
            margin-bottom: 40px;
            padding-bottom: 24px;
        }
        .comments-section {
            padding: 16px 14px;
        }
    }
