body {
    background: #181920;
    color: #fff;
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 17px 40px;
    background: #23232b;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    margin-top: 20px;
    max-width: 95%;
    margin-left: auto;
    margin-right: auto;
    text-decoration: none;
  }

section h1 {
    font-size: 2.2rem !important;
    margin: 0 0 1rem 0 !important;
    font-weight: bold;
    line-height: 1.2;
}

.anime-relaciones {
    margin-top: 8px;
    padding: 4px 8px;
    background: rgba(0,0,0,0.10);
    border-radius: 5px;
    font-size: 0.92em;
    max-width: 205px;
}
.relacion-label {
    color: #3fa7ff;
    font-weight: bold;
    margin-right: 4px;
}
.relacion-link {
    color: #fff;
    text-decoration: underline;
    font-size: 0.97em;
}
.relacion-link:hover {
    color: #3fa7ff;
}

.relacion-lista {
    margin: 0;
    padding-left: 1.5em;
    text-align: left;
    list-style-position: outside;
}
.relacion-lista li {
    text-align: left;
}


.header-container {
    max-width: 1200px;
    margin: 20px auto 0 auto;
    padding: 0 10px;
}

.anime-detalle-container {
    max-width: 1200px;
    margin: 40px auto;
    background: #23232b;
    border-radius: 18px;
    box-shadow: 0 4px 32px #00aaff22, 0 1.5px 0 #00aaff44;
    padding: 32px 40px;
    overflow: visible !important;
    border: 2px solid #00aaff33;
    position: relative;
}

.anime-detalle-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #00aaff11 0%, transparent 50%, #00aaff11 100%);
    border-radius: 18px;
    pointer-events: none;
    z-index: -1;
}

.anime-detalle-header {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.anime-detalle-img {
    width: 220px;
    height: 370px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 2px 8px #00aaff33;
    flex-shrink: 0;
}

.anime-detalle-info {
    flex: 1;
    color: #fff;
    min-width: 180px;
    display: flex;
    flex-direction: column;
}

.anime-detalle-titulo {
    color: #00aaff;
    font-size: 2.5rem;
    margin-bottom: 8px;
    font-weight: bold;
}

.anime-detalle-titulo-jp {
    color: #00aaff;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.anime-detalle-meta {
    color: #bdbdbd;
    font-size: 1rem;
    margin-bottom: 10px;
}

.anime-detalle-tags {
    margin: 10px 0 8px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.anime-tag, .genero-link {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 6px;
    margin-right: 3px;
    margin-bottom: 3px;
    border-width: 1px;
}

.anime-detalle-sinopsis {
    color: #bdbdbd;
    margin-bottom: 10px;
    font-size: 0.95rem;
    line-height: 1.5;
    max-height: 20.7em;
    overflow-y: auto;
    padding-right: 5px;
}

.anime-detalle-sinopsis::-webkit-scrollbar {
    width: 4px;
}

.anime-detalle-sinopsis::-webkit-scrollbar-thumb {
    background: #00aaff;
    border-radius: 2px;
}

.anime-detalle-extra {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
}

.anime-score {
    color: #ffe066;
    font-size: 0.9em;
    padding: 2px 6px;
    border-radius: 4px;
}

.anime-votos {
    color: #bdbdbd;
    font-size: 0.7em;
}

.anime-share button {
    background: #23232b;
    border: 1px solid #00aaff;
    color: #00aaff;
    border-radius: 6px;
    padding: 6px 10px;
    margin-right: 4px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background 0.2s;
}

.anime-share button:hover {
    background: #00aaff;
    color: #fff;
}

.episodios-titulo {
    color: #00aaff;
    font-size: 1.5rem;
    margin: 32px 0 18px 0;
    font-weight: bold;
}

.episodios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 170px);
    gap: 16px;
    max-width: 1000px;
    width: 100%;
    box-sizing: border-box;
    padding: 0 8px;
    margin-left: auto;
    margin-right: auto;
    max-height: 690px;
    overflow-y: auto;
    padding-right: 10px;
}

.episodio-card {
    display: block;
    border: 2px solid #00aaff;
    border-radius: 12px;
    margin: 10px;
    text-decoration: none;
    background: #232532;
    transition: 
        box-shadow 0.3s ease,
        transform 0.3s ease,
        border-color 0.3s ease;
    width: 170px;
    height: 140px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 16px #00aaff11;
}

.episodio-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, #00aaff11 0%, transparent 50%, #00aaff11 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.episodio-card-img-contenedor {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.episodio-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: none;
}

.episodio-card:hover {
    box-shadow: 0 8px 32px #00aaff33;
    background: #232532;
    transform: translateY(-4px);
    border-color: #00aaff;
}

.episodio-card:hover::before {
    opacity: 1;
}

.episodio-card-titulo {
    position: absolute;
    left: 10px;
    bottom: 8px;
    color: #00aaff;
    font-weight: bold;
    font-size: 1.1em;
    background: rgba(24,27,35,0.9);
    padding: 4px 12px 4px 8px;
    border-radius: 8px;
    pointer-events: none;
    backdrop-filter: blur(10px);
    border: 1px solid #00aaff33;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 2;
}

.logo-btn {
    padding: 10px 30px;
    font-size: 18px;
    border: none;
    background: none;
    color: #fff;
    font-weight: bold;
    font-style: italic;
    border: 2px solid #00aaff;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.2s, border 0.2s;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-btn:hover {
    color: #00aaff;
    border-color: #00aaff;
    box-shadow: 0 0 10px #00aaff;
}

.logo-img-btn {
    height: 32px;
    width: 32px;
    object-fit: contain;
    filter: brightness(0.8);
}

.logo-titulo {
    text-decoration: underline;
}

.search-container {
    position: relative;
}

.search-bar {
    padding: 8px 15px;
    border: 2px solid #00aaff;
    border-radius: 20px;
    width: 250px;
    font-size: 14px;
    background: #23232b;
    color: #fff;
    transition: all 0.3s ease;
}

.search-bar:focus {
    outline: none;
    border-color: #00aaff;
    box-shadow: 0 0 10px #00aaff;
}

.search-results {
    position: absolute;
    top: 100%;
    right: 0;
    background: #23232b;
    border: 2px solid #00aaff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,170,255,0.3);
    width: 300px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    margin-top: 5px;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 12px 15px;
    border-bottom: 1px solid #00aaff33;
    cursor: pointer;
    transition: background-color 0.2s;
    color: #fff;
}

.search-result-item:hover {
    background-color: #00aaff22;
}

.search-result-item:last-child {
    border-bottom: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 18px;
    text-decoration: none;
}

.directorio-label {
    color: #00aaff;
    font-size: 25px;
    font-weight: 700;
    padding: 0 10px;
    margin-right: 2px;
    letter-spacing: 0.5px;
    background: none;
    border-radius: 0;
    text-decoration: none !important;
    transition: color 0.2s;
    display: inline-block;
}

.directorio-label:hover,
.directorio-label:focus {
    color: #7a7a7a;
    text-decoration: none !important;
}

/* Botones de género minimalistas y bonitos */
.anime-detalle-tags .genero-link {
    display: inline-block;
    background: none;
    color: #00aaff;
    border: 1px solid #00aaff;
    border-radius: 14px;
    padding: 4px 14px;
    margin: 0 5px 7px 0;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border 0.15s;
    text-decoration: none;
    box-shadow: none;
}

.anime-detalle-tags .genero-link:hover {
    background: #00aaff;
    color: #fff;
    border-color: #00aaff;
    text-decoration: none;
}

.barra-terminos {
    display: flex;
    justify-content: flex-start;
    background: #23232b;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.10);
    color: #fff;
    font-size: 1.05rem;
    max-width: 1600px;
    min-width: auto;
    margin: 15px auto 15px auto;
}

.btn-terminos {
    background: #00aaff;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 5px 22px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 2px 8px #00aaff44;
    font-family: 'Segoe UI', Arial, sans-serif;
    text-decoration: none;
    position: static;
    margin-left: 12px !important;
}

.btn-privacidad {
    background: #00aaff;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 5px 22px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 2px 8px #00aaff44;
    font-family: 'Segoe UI', Arial, sans-serif;
    text-decoration: none;
    position: static;
    margin: auto;
    margin-right: 10px;
}

.btn-terminos:hover,
.btn-privacidad:hover {
    background: #008fcc;
    transform: scale(1.05);
}

/* Firefox */
.episodios-grid {
    scrollbar-width: thin;
    scrollbar-color: #00aaff #23232b;
}

/* Indicador visual de scroll en episodios-grid */
.episodios-grid::after {
    content: "";
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 36px;
    pointer-events: none;
    z-index: 2;
}

/* --- Telefono --- */

/* Estilos para el menú móvil */
.menu-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-text {
    color: #00aaff;
    font-size: 1.1rem;
    font-weight: bold;
    letter-spacing: 0.5px;
    user-select: none;
    text-shadow: 0 2px 8px #000000;
    background: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.menu-toggle {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 30px;
    position: relative;
    margin: 0;
    z-index: 10;
}

.menu-toggle::before {
    content: "☰";
    font-size: 1.8rem;
    color: #00aaff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.sidebar-menu {
    left: -250px;
    width: 200px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    height: 100vh;
    background: #23232b;
    z-index: 2002;
    padding: 15px 0;
    transition: left 0.3s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 2px 0 16px #000a;
    overflow-y: auto;
}

.sidebar-menu.active {
    left: 0;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(24, 25, 32, 0.7);
    z-index: 2000;
    cursor: pointer;
}

.sidebar-menu.active ~ .sidebar-overlay {
    display: block;
}

.sidebar-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    margin-top: 5px;
}

.sidebar-logo img {
    width: 55px;
    height: 55px;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 2px 8px #00aaff44;
    background: #181920;
}

.sidebar-logo .sidebar-logo-titulo {
    color: #00aaff;
    font-size: 1.1rem;
    font-weight: bold;
    margin-top: 6px;
    text-align: center;
    text-shadow: 0 2px 8px #000000;
    letter-spacing: 0.5px;
}

.sidebar-search-bar,
.sidebar-directorio {
    display: block;
    margin: 0 auto 15px auto;
    width: 85%;
    max-width: 200px;
    box-sizing: border-box;
}

.sidebar-search-bar {
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid #00aaff;
    background: #181920;
    color: #fff;
    font-size: 0.95rem;
}

.sidebar-directorio {
    color: #00aaff;
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: none;
}

.sidebar-search-results {
    display: none;
    background: #23232b;
    border-radius: 8px;
    border: 2px solid #00aaff;
    max-height: 250px;
    overflow-y: auto;
    color: #fff;
    font-size: 0.97rem;
    margin-top: 0;
    position: relative;
    z-index: 10;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
}

.sidebar-search-results::-webkit-scrollbar {
    display: none;
}

.sidebar-search-results .search-result-item {
    padding: 10px;
    border-bottom: 1px solid #00aaff22;
    transition: background 0.2s;
}

.sidebar-search-results .search-result-item:last-child {
    border-bottom: none;
}

.sidebar-search-results .search-result-item:hover {
    background: #00aaff22;
}

body.body-no-scroll {
    overflow: hidden !important;
    height: 100vh !important;
    position: fixed !important;
    width: 100vw !important;
}

/* Media Queries */
@media screen and (max-width: 768px) {
    .header-container {
        max-width: 98%;
        margin: 10px auto 10px auto;
        padding: 0 2px;
    }
    header {
        position: fixed !important;
        top: 0 !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        z-index: 2000 !important;
        width: 90% !important;
        margin-top: 0 !important;
        padding: 12px 20px !important;
        border-radius: 8px !important;
        max-width: 100vw !important;
      }
    body {
        padding-top: 0;
    }

    .anime-relaciones {
        margin-top: 8px;
        padding: 4px 8px;
        background: rgba(0,0,0,0.10);
        border-radius: 5px;
        font-size: 0.7em;
        max-width: 152px;
    }
    .anime-detalle-container {
        margin: 86px 4px 56px 4px;
        padding: 12px 4px;
    }
    .header-right {
        display: none !important;
    }
    .menu-left {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .logo-btn {
        margin: 0;
        padding: 8px 15px;
        width: auto;
    }
    
    .logo-img-btn {
        height: 32px;
        width: 32px;
        object-fit: contain;
        filter: brightness(0.8);
    }
    .logo-titulo {
        font-size: 14px;
        text-decoration: underline;
    }
    .anime-detalle-header {
        flex-direction: row;
        gap: 15px;
        align-items: flex-start;
        flex-wrap: wrap;
    }
    .anime-detalle-img {
        width: 200px;
        height: 340px;
        margin: 0;
    }
    .anime-detalle-info {
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    .anime-detalle-titulo {
        font-size: 1.3rem;
    }
    .anime-detalle-titulo-jp {
        font-size: 0.7rem;
    }
    .anime-detalle-meta {
        font-size: 0.7rem;
    }
    .anime-detalle-sinopsis {
        font-size: 0.8rem;
        margin-bottom: 10px;
        width: 100%;
    }
    .anime-detalle-extra {
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
    }
    .anime-detalle-tags {
        width: 100%;
        margin-top: 10px;
        display: flex;
        flex-wrap: wrap;
    }
    .anime-detalle-tags {
        font-size: 0.8rem;
        padding: 0px 4px;
        margin-right: 3px;
        margin-bottom: 3px;
        border-radius: 3px;
        line-height: 1;
        border-width: 0.5px;
    }
    .anime-score {
        font-size: 0.6rem;
        padding: 2px 6px;
        border-radius: 4px;
    }
    .anime-score i {
        font-size: 0.7rem;
    }
    .episodios-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        max-width: 100%;
        width: 100%;
        margin: 0 auto;
        padding: 0 4px;
        max-height: none;
        overflow-y: visible;
        overflow-x: hidden;
    }
    .episodio-card {
        width: 100%;
        height: 90px;
        margin: 2px 0;
    }
    .episodio-card-titulo {
        font-size: 0.9em;
    }
    .btn-terminos,
    .btn-privacidad {
        font-size: 0.8rem;
        padding: 4px 12px;
        border-radius: 6px;
    }
    .anime-watch-later-btn {
        width: 120px !important;
        min-width: 160px !important;
        max-width: 100px !important;
        margin: 0 auto 0 auto !important;
        display: block !important;
        font-size: 1rem !important;
    }
    .anime-watch-later-btn.added {
        background: linear-gradient(135deg, #4CAF50, #388E3C) !important;
        color: #fff !important;
        border: 2px solid #388E3C !important;
    }
    .anime-watch-later-section {
        width: 139px !important;
        margin: 3px auto 0 auto !important;
        justify-content: center !important;
        padding: 0 !important;

    }
    .anime-detalle-img {
        width: 140px;
        height: 210px;
        margin: 0 auto 8px auto;
        display: block;
    }
}


@media screen and (min-width: 769px) {
    .menu-left {
        display: none !important;
    }
    .sidebar-menu {
        display: none !important;
    }
}

.episodios-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
    padding: 0 8px;
    box-sizing: border-box;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.episodios-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #00aaff;
    flex-shrink: 0;
}

.episodios-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: visible;
}

.episodios-buscar {
    position: relative;
    max-width: 220px;
    width: 100%;
}

.episodios-ordenar {
    width: 48px;
    justify-content: center;
    margin-left: 0; /* por defecto sin margen; se ajusta vía JS según cantidad de episodios */
}

.episodios-buscar input {
    width: 100%;
    padding: 8px 12px 8px 32px;
    background: #181920;
    border: 1px solid #00aaff;
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
}

.episodios-buscar input::placeholder {
    color: #666;
}

.episodios-buscar i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #00aaff;
    font-size: 0.9rem;
}

.episodios-ordenar {
    background: #23232b;
    border: 1.5px solid #00aaff;
    color: #00aaff;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.episodios-ordenar:hover {
    background: #00aaff;
    color: #fff;
}

/* Selector de bloques (rango) estilo botón de ordenar */
#selectorBloquesPC select,
#selectorBloquesMobile select {
    background: #23232b;
    border: 1.5px solid #00aaff;
    color: #00aaff;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    appearance: none;
    margin-left: 50px;
}



#selectorBloquesPC,
#selectorBloquesMobile {
    display: flex;
    align-items: center;
}

/* Dropdown personalizado con lista scroll de 5 items visibles */
.custom-dropdown {
    position: relative;
    z-index: 1000;
    display: inline-block;
}

.custom-dropdown-toggle {
    background: #23232b;
    border: 1.5px solid #00aaff;
    color: #00aaff;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    margin-left: 50px;
    line-height: 1;
    touch-action: manipulation;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap; /* Evita que 1 - 100 se parta en 2 líneas */
}

.custom-dropdown-toggle:hover {
    background: #00aaff;
    color: #fff;
}

.custom-dropdown-options {
    position: absolute;
    top: calc(100% + 6px);
    left: 50px;
    background: #23232b;
    border: 1.5px solid #00aaff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 170, 255, 0.15);
    max-height: 11.6em; /* ~5 items de altura (1.1em por item aprox) */
    overflow-y: auto;
    min-width: 127px;
    display: none;
    z-index: 10000;
    /* Scrollbar (Firefox) */
    scrollbar-color: #00aaff #23232b;
    scrollbar-width: thin;
}

.custom-dropdown-options.show {
    display: block;
}

.custom-dropdown-item {
    padding: 8px 10px;
    color: #00aaff;
    cursor: pointer;
    white-space: nowrap;
}

.custom-dropdown-item:hover {
    background: #00aaff;
    color: #fff;
}

/* Scrollbar (WebKit) */
.custom-dropdown-options::-webkit-scrollbar {
    width: 10px;
}

.custom-dropdown-options::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 8px;
}

.custom-dropdown-options::-webkit-scrollbar-thumb {
    background: #00aaff;
    border-radius: 8px;
    border: 2px solid #1a1a2e;
}

.custom-dropdown-options::-webkit-scrollbar-thumb:hover {
    background: #0090cc;
}

@media screen and (max-width: 768px) {
    .episodios-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 12px;
        max-width: 100%;
        width: 100%;
        margin: 0 auto;
        padding: 0 6px;
        max-height: 650px; 
        overflow-y: auto;
    }
    .episodios-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 0 6px;
        max-width: 100%;
    }
    .episodios-controls {
        width: 100%;
        justify-content: flex-end;
        gap: 8px;
    }
    .episodios-buscar {
        max-width: 100%;
    }
    .episodios-buscar input {
        width: 85%;
        font-size: 0.8rem;
        padding: 6px 10px 6px 28px;
    }
    .episodios-buscar i {
        font-size: 0.8rem;
        left: 8px;
    }
    .episodios-ordenar {
        font-size: 1.1rem;
        padding: 6px 1px;
    }

    /* Mejorar legibilidad del rango en móvil */
    #bloqueDropdownCustomMobile .custom-dropdown-toggle {
        padding: 8px 12px;
        font-size: 1rem;
        min-width: 96px; /* espacio para "1 - 100" */
        margin-left: 0;
        white-space: nowrap;
    }
    #bloqueDropdownCustomMobile .custom-dropdown-options {
        left: 0;
        min-width: 140px;
        max-width: 80vw;
    }
}


/* Estilos para Autenticación */
.auth-container {
    display: flex;
    align-items: center;
    margin-left: -2px;
}

.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: linear-gradient(135deg, #00aaff, #0088cc);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 170, 255, 0.3);
    width: 40px;
    height: 40px;
}

.auth-btn .google-icon {
    width: 28px;
    height: 28px;
    margin-right: 0;
    filter: blur(100%);
    transition: filter 0.3s ease;
}

.auth-btn:hover {
    background: linear-gradient(135deg, #0088cc, #006699);
    box-shadow: 0 4px 12px rgba(0, 170, 255, 0.4);
    transform: translateY(-1px);
}

.auth-btn:hover .google-icon {
    filter: none;
}

.user-profile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 4px;
    border-radius: 20px;
    transition: background-color 0.3s ease;
}

.user-info:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #00aaff;
    object-fit: cover;
}

.user-name {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu {
    display: none;
    position: absolute;
    top: 115%;
    right: 0;
    background: #2c2c34;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    min-width: 160px;
    overflow: hidden;
    border: 1px solid #00aaff88;
    animation: fadeInScale 0.2s ease-out;
}

.user-menu.show {
    display: block;
}

.user-menu-item {
    display: block;
    padding: 12px 16px;
    color: #e0e0e0;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.user-menu-item:hover {
    background-color: #00aaff44;
    color: #fff;
}

.logout-btn {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    color: #e0e0e0;
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-size: 14px;
    text-align: left;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.logout-btn:hover {
    background: #ff4444;
    color: white;
    transform: none;
}

/* Modal de Autenticación */
.auth-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.auth-modal-content {
    background: #23232b;
    margin: 10% auto;
    padding: 20px 30px;
    border: 1px solid #00aaff;
    border-radius: 15px;
    width: 90%;
    max-width: 380px;
    box-shadow: 0 5px 25px rgba(0,170,255,0.2);
    position: relative;
    animation: slideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.auth-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #00aaff33;
}

.auth-modal-header h2 {
    margin: 0;
    color: #fff;
    font-size: 24px;
    font-weight: 600;
}

.auth-modal-close {
    background: none;
    border: none;
    color: #00aaff;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.3s ease;
}

.auth-modal-close:hover {
    color: #fff;
}

.auth-modal-body {
    padding: 25px;
    text-align: center;
}

.auth-modal-body p {
    color: #ccc;
    margin-bottom: 25px;
    font-size: 16px;
    line-height: 1.5;
}

.auth-divider {
    position: relative;
    margin: 25px 0;
    text-align: center;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #00aaff33;
}

.auth-divider span {
    background: #23232b;
    padding: 0 15px;
    color: #00aaff;
    font-size: 14px;
    font-weight: 500;
}

.auth-guest-btn {
    width: 100%;
    padding: 12px 20px;
    background: transparent;
    color: #00aaff;
    border: 2px solid #00aaff;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.auth-guest-btn:hover {
    background: #00aaff;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 170, 255, 0.3);
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Responsive para autenticación */
@media screen and (max-width: 768px) {
    .auth-container {
        margin-left: 10px;
    }
    
    .auth-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .user-name {
        max-width: 80px;
        font-size: 12px;
    }
    
    .auth-modal-content {
        margin: 10% auto;
        width: 66%;
        height: 58%;
    }
    
    .auth-modal-header {
        padding: 15px 20px;
    }
    
    .auth-modal-header h2 {
        font-size: 20px;
    }
    
    .auth-modal-body {
        padding: 20px;
    }
}

/* Perfil de usuario en el menú lateral */
.sidebar-auth-section {
    width: 85%;
    margin: 15px auto;
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background-color 0.2s;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid transparent;
}

.sidebar-user-info:hover {
    background-color: #00aaff22;
}

.sidebar-user-info.open {
    border-color: #00aaff88;
    background-color: #00aaff11;
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
    border: 1px solid #00aaff;
}

#sidebar-user-name {
    flex-grow: 1;
    color: #00aaff;
    font-size: 1.05rem;
    font-weight: 600;
}

.sidebar-arrow {
    font-size: 0.8rem;
    color: #00aaff;
    transition: transform 0.3s;
}

.sidebar-user-info.open .sidebar-arrow {
    transform: rotate(180deg);
}

#sidebar-user-menu {
    display: none;
    flex-direction: column;
    padding-left: 20px;
    margin-top: 5px;
    border-left: 2px solid #00aaff44;
    margin-left: 30px;
    padding-top: 5px;
    padding-bottom: 5px;
}

#sidebar-user-menu.show {
    display: flex;
}

.sidebar-user-menu-item {
    color: #ccc;
    text-decoration: none;
    font-size: 1rem;
    padding: 10px 15px;
    border-radius: 6px;
    transition: color 0.2s, background-color 0.2s;
    background: none;
    border: none;
    text-align: left;
    width: 100%;
    cursor: pointer;
}

.sidebar-user-menu-item:hover {
    color: #fff;
    background-color: #00aaff22;
}

.sidebar-directorio {
    display: block;
    margin: 0 auto 15px auto;
}

/* Estilos para Autenticación */
.auth-container {
    display: flex;
    align-items: center;
    margin-left: -2px;
}

.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: linear-gradient(135deg, #00aaff, #0088cc);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 170, 255, 0.3);
    width: 40px;
    height: 40px;
}

.auth-btn .google-icon {
    width: 28px;
    height: 28px;
    margin-right: 0;
    filter: blur(100%);
    transition: filter 0.3s ease;
}

.auth-btn:hover {
    background: linear-gradient(135deg, #0088cc, #006699);
    box-shadow: 0 4px 12px rgba(0, 170, 255, 0.4);
    transform: translateY(-1px);
}

.auth-btn:hover .google-icon {
    filter: none;
}

.user-profile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 4px;
    border-radius: 20px;
    transition: background-color 0.3s ease;
}

.user-info:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #00aaff;
    object-fit: cover;
}

.user-name {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu {
    display: none;
    position: absolute;
    top: 115%;
    right: 0;
    background: #2c2c34;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    min-width: 160px;
    overflow: hidden;
    border: 1px solid #00aaff88;
    animation: fadeInScale 0.2s ease-out;
}

.user-menu.show {
    display: block;
}

.user-menu-item {
    display: block;
    padding: 12px 16px;
    color: #e0e0e0;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.user-menu-item:hover {
    background-color: #00aaff44;
    color: #fff;
}

.logout-btn {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    color: #e0e0e0;
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-size: 14px;
    text-align: left;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.logout-btn:hover {
    background: #ff4444;
    color: white;
    transform: none;
}

.watch-later-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 1px solid #fff;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 18px;
    cursor: pointer;
    transition: none;
    opacity: 1;
    transform: scale(1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    animation: none !important;
    transform: scale(1) !important;
}

.watch-later-btn.added {
    background: linear-gradient(135deg, #4CAF50, #388E3C) !important;
    color: #fff !important;
    border: 2px solid #388E3C !important;
}

.anime-watch-later-section {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 16px;
    width: 100%;
}

.anime-watch-later-btn {
    position: static !important;
    width: auto !important;
    height: auto !important;
    font-size: 1.1rem !important;
    padding: 10px 28px !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, #00aaff, #0088cc) !important;
    color: #fff !important;
    border: 2px solid transparent !important;
    box-shadow: 0 2px 8px #00aaff44 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.2s;
    z-index: 10 !important;
    margin: 0 auto !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px;
}

.anime-watch-later-btn:hover:not(.added) {
    background: linear-gradient(135deg, #4CAF50, #388E3C) !important;
    color: #fff !important;
    border: 2px solid #388E3C !important;
}

.anime-watch-later-btn.added {
    background: linear-gradient(135deg, #4CAF50, #388E3C) !important;
    color: #fff !important;
    border: 2px solid #388E3C !important;
}

.anime-watch-later-btn.added:hover {
    background: linear-gradient(135deg, #ff0000, #9b0000) !important;
    color: #fff !important;
    border: 2px solid #9b0000 !important;
}

.anime-detalle-col-izq {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.anime-watch-later-section {
    width: auto;
    margin: 16px 0 0 0;
    display: flex;
    justify-content: flex-start;
    margin-left: 20px;
}

.anime-watch-later-btn {
    width: 220px; /* igual que la imagen en desktop */
    max-width: 100%;
    font-size: 1.1rem;
    padding: 10px 0;
    border-radius: 8px;
    background: linear-gradient(135deg, #00aaff, #0088cc);
    color: #fff;
    border: 2px solid transparent !important;
    box-shadow: 0 2px 8px #00aaff44;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-align: center;
    transition: background 0.2s;
    margin: 0;
    display: block;
}
@media screen and (max-width: 768px) {
    .anime-detalle-img {
        width: 160px;
        height: 280px;
    }
    .anime-watch-later-btn {
        width: 160px;
        font-size: 0.7rem !important;
    }
}
.anime-watch-later-btn:hover {
    background: linear-gradient(135deg, #0088cc, #00aaff);
}

.anime-detalle-flex {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 32px;
    width: 100%;
    flex-wrap: nowrap;
}
.anime-detalle-col-izq {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: auto;
    min-width: 220px;
}
.anime-detalle-col-der {
    flex: 1 1 0%;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 6px;
}
@media screen and (max-width: 900px) {
    .anime-detalle-flex {
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
        justify-content: flex-start;
        max-width: 100%;
        width: 100%;
        margin: 0 auto 12px auto;
        box-sizing: border-box;
    }
    .anime-detalle-col-izq {
        min-width: 80px;
        width: auto;
        align-items: flex-start;
    }
    .anime-detalle-img {
        width: 160px;
        height: 280px;
    }
    .anime-watch-later-btn {
        width: 70px;
        font-size: 0.8rem;
        padding: 5px 0;
    }
    .anime-detalle-col-der {
        min-width: 0;
        width: 100%;
        gap: 3px;
    }
    .anime-detalle-titulo {
        font-size: 0.95rem;
    }
    .anime-detalle-titulo-jp {
        font-size: 0.65rem;
    }
    .anime-detalle-meta {
        font-size: 0.65rem;
    }
    .anime-detalle-sinopsis {
        font-size: 0.7rem;
        margin-bottom: 8px;
        width: 100%;
    }
    .anime-detalle-extra {
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
    }
    .anime-detalle-tags {
        width: 100%;
        margin-top: 6px;
        display: flex;
        flex-wrap: wrap;
        font-size: 0.7rem;
        padding: 0px 1px;
        margin-right: 1px;
        margin-bottom: 1px;
        border-radius: 2px;
        line-height: 1;
        border-width: 0.5px;
    }
    .anime-score {
        font-size: 0.5rem;
        padding: 2px 4px;
        border-radius: 4px;
    }
    .anime-score i {
        font-size: 0.6rem;
    }
    .episodios-section-desktop {
        display: none !important;
    }
    .episodios-section-mobile {
        display: block !important;
    }
}
@media screen and (min-width: 901px) {
    .episodios-section-mobile {
        display: none !important;
    }
    .episodios-section-desktop {
        display: block !important;
    }
}

.episodios-section, .episodios-grid {
    margin-top: 32px;
}


@media (max-width: 600px) {
  #anime-comentarios, .comentarios-section, .chat-modern {
    width: 94vw !important;
    max-width: 98vw !important;
    margin: 12px auto 0 auto !important;
    border-radius: 10px !important;
    box-shadow: 0 1px 6px #00aaff22 !important;
    background: #23232b !important;
    padding: 10px 4px 12px 4px !important;
    z-index: 1 !important;
    border: 1px solid #00aaff22 !important;
  }
  .comentarios-title {
    font-size: 1em !important;
    margin-bottom: 8px !important;
    text-align: center !important;
  }
  .comentarios-form textarea {
    font-size: 0.98em !important;
    padding: 7px !important;
  }
  .chat-list {
    margin-top: 6px !important;
  }
  #anime-comentarios.oculto-movil {
    display: none !important;
  }
}

/* Estilos para Disqus - Asegurar visibilidad */
#disqus_thread, 
.disqus-contenedor,
.anime-detalle-container #disqus_thread {
    display: block;
    visibility: visible !important;
    opacity: 1 !important;
    margin-top: 32px !important;
    margin-bottom: 32px !important;
    background: #23232b !important;
    color: #222 !important;
    min-height: 200px !important;
    width: 100% !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 7px #00aaff !important;
    padding: 16px !important;
    position: relative !important;
    overflow: visible !important;
}

/* Estilos para elementos hijos de Disqus */
#disqus_thread iframe,
#disqus_thread embed,
#disqus_thread object,
#disqus_thread video {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    min-height: 200px !important;
}

/* Asegurar que el contenedor padre no oculte Disqus */
.anime-detalle-container {
    overflow: visible !important;
}

/* Estilos para mobile */
@media screen and (max-width: 768px) {
    #disqus_thread, 
    .disqus-contenedor,
    .anime-detalle-container #disqus_thread {
        margin-top: 24px !important;
        margin-bottom: 24px !important;
        padding: 12px !important;
        min-height: 150px !important;
    }
}

.disqus-contenedor {
    max-width: 1250px;
    margin: 32px auto 48px auto;
    background: #23232b;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.10);
    width: 100%;
    box-sizing: border-box;
    min-height: 200px;
}