/* =================================
   RESET BÁSICO
================================= */

body {
    margin: 0;
    padding: 0;
    background: #111 url('fondo.avif') repeat;
    color: #fff;
    font-family: 'Steelplate Textura', sans-serif;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    box-sizing: border-box;
}

input[type="radio"] {
    display: none;
}


/* =================================
   CONTENEDOR GENERAL
================================= */

.contenedor-novela {
    max-width: 1200px;
    margin: 60px auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 500px 1fr;
    gap: 40px;
    box-sizing: border-box;
}



/* =================================
   SELECTOR DE PORTADA
================================= */

.selector-portada {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 15px;
}

.selector-portada label {
    flex: 1 1 auto;
    max-width: 120px;
    text-align: center;
    padding: 8px 18px;
    background: #2a0000;
    color: #ffdddd;
    border: 2px solid #7a0000;
    cursor: pointer;
    font-family: 'Creepster', cursive;
    font-size: 20px;
    letter-spacing: 1px;
    text-shadow: 0 0 4px #ff0000;
    box-shadow: 0 0 8px #300 inset;
    transition: .25s ease;
}

.selector-portada label:hover {
    background: #4a0000;
    box-shadow: 0 0 12px #ff0000, 0 0 20px #900 inset;
    transform: scale(1.08);
}

.selector-portada input:checked + label {
    background: #8b0000;
    color: #fff;
    border-color: #ff0000;
    text-shadow: 0 0 8px #ff0000, 0 0 15px #ff4444;
    box-shadow: 0 0 15px #ff0000, 0 0 25px #ff2222 inset;
    animation: temblor .25s infinite alternate;
}

@keyframes temblor {
    from { transform: translateX(0) scale(1.1); }
    to { transform: translateX(2px) scale(1.12); }
}


/* ====================================
   PORTADA CON CARRUSEL AUTOMÁTICO
==================================== */


/* Contenedor */
.portada-novela {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
}

/* Imágenes apiladas */
.portada-novela img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 4px solid #b30000;
    box-shadow: 0 0 15px #000;
    opacity: 0;
}

/* Animaciones: una se apaga, la otra se enciende */
.img-a {
    animation: crossfade-a 20s infinite;
}

.img-b {
    animation: crossfade-b 20s infinite;
}

/* La primera: visible al principio, luego se apaga */
@keyframes crossfade-a {
    0%   { opacity: 1; }
    40%  { opacity: 1; }

    100% { opacity: 0; }
	100% { opacity: 1; } /* vuelve a aparecer suavemente */

}

/* La segunda: apagada al principio, luego aparece */
@keyframes crossfade-b {
    0%   { opacity: 0; }
    50%  { opacity: 1; }
    100% { opacity: 1; }
	100% { opacity: 0; } /* se desvanece para volver a A */

}


/* =================================
   TEXTO
================================= */

.info-novela {
    font-family: Arial, Verdana, sans-serif;
    font-size: 20px;
    line-height: 1.7;
}

.col-izquierda {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.datos-tecnicos {
    list-style: none;
    padding: 0;
    margin: 10px 0 20px;
    font-size: 20px;
    line-height: 1.7;
}

.datos-tecnicos li {
    margin-bottom: 8px;
}

.titulo-bloque {
    font-family: 'Creepster', cursive;
    font-size: 28px;
    color: #ff4444;
    margin: 25px 0 10px;
}


/* =================================
   BOTONES
================================= */

#cerrar {
    display: block;
    margin: 20px auto;
    padding: 20px 28px;
    font-size: 25px;
    background: #0078ff;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    width: fit-content;
}


/* =================================
   ICONOS VOLVER CON LATIDO
================================= */

.icono-volver {
    position: relative;
    display: block;
    margin-left: auto;
    margin-right: 40px;
    margin-top: 20px;
    width: 250px;
    cursor: pointer;

    animation: latido 2.6s infinite ease-in-out;
}

@keyframes latido {
    0%   { transform: scale(1); }
    50%  { transform: scale(0.96); }
    100% { transform: scale(1); }
}


/* =================================
   VALORACIÓN
================================= */
.valoracion-box {
    margin: 25px auto 0 auto;
    padding: 20px;
    width: 90%;
    max-width: 350px;
    border: 3px solid #b30000;
    border-radius: 12px;
    text-align: center;
    background: #1a0000;
    box-shadow: 0 0 10px #900;

}
.valoracion-box input[type="radio"] {
    display: inline-block;
    margin-right: 4px;
}


.valoracion-titulo {
    font-family: 'Creepster', cursive;
    font-size: 28px;
    color: #ff4444;
    margin-bottom: 15px;
}

.estrellas label {
    font-size: 22px;
    margin: 0 8px;
    cursor: pointer;
}

.btn-enviar-valoracion {
    margin-top: 15px;
    padding: 10px 20px;
    background: #e63946;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    color: white;
    transition: .3s;
}

.btn-enviar-valoracion:hover {
    background: #ff4d5a;
    transform: scale(1.05);
}

/* =================================
   FORMULARIO
================================= */

.contenedor-formulario {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.formulario-opinion {
    width: 420px;
    padding: 35px;
    background: #1c1c1c;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(255,0,0,.4);
}

.campo {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

label {
    font-family: 'Creepster', cursive;
    font-size: 1.6rem;
    color: #e63946;
    margin-bottom: 8px;
}

input,
textarea {
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: #2a2a2a;
    color: #fff;
}

.btn-enviar {
    width: 100%;
    padding: 12px;
    background: #e63946;
    border: none;
    border-radius: 6px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: .3s;
}

.btn-enviar:hover {
    background: #ff4d5a;
    transform: scale(1.05);
}
/* =================================
   RANKING
================================= */

main {
   
    margin-top: 0;   
}
#ganadora {
    font-family: 'Creepster', cursive;
	color: yellow;
}


.ranking-lista {
    list-style: none;
    padding: 0;
    margin: 30px auto;
    max-width: 600px;
}

.ranking-item {
    background: #1a0000;
    border: 3px solid #b30000;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 15px;
    font-size: 1.6rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 0 12px #900;
    transition: .3s ease;
}

.ranking-item:hover {
    transform: scale(1.03);
    box-shadow: 0 0 18px #ff0000;
}

.ranking-pos {
    font-family: 'Steelplate Textura', sans-serif !important;
    font-size: 2rem;
    color: #ff4444;
    margin-right: 15px;
}

.ranking-titulo {
    flex: 1;
	font-family: 'Steelplate Textura', sans-serif


}

.ranking-valor {
    font-weight: bold;
    color: #ffdddd;
    text-shadow: 0 0 6px #ff0000;
}

/* =================================
   FOOTER
================================= */

footer {
    margin-top: 20px;
    font-size: 1.9rem;
    color: #bbb;
}


/* =================================
   MEDIA QUERIES
================================= */

@media (min-width:901px){

    .icono-volver-movil{
        display:none;
    }

    .selector-portada{
        max-width:900px;
        margin:0 auto 20px;
        justify-content:space-between;
    }

    .selector-portada label{
        flex:1;
        max-width:none;
        font-size:26px;
        padding:14px 20px;
    }

}

@media (max-width:900px){

    .contenedor-novela{
        grid-template-columns:1fr;
        gap:20px;
        padding:10px;
        margin:20px auto;
    }

    .info-novela,
    .datos-tecnicos{
        font-size:18px;
        line-height:1.6;
    }

    .titulo-bloque{
        font-size:22px;
        margin-top:15px;
    }

    #cerrar{
        font-size:20px;
        padding:14px 20px;
    }

}

@media (max-width:700px){

    .icono-volver{
        display:none;
    }

    .icono-volver-movil{
        display:block;
        margin:20px auto 40px;
        width:150px;
    }

    .selector-portada label{
        font-size:15px;
        padding:6px 10px;
    }

}

@media (max-width:500px){

    .info-novela,
    .datos-tecnicos{
        font-size:16px;
    }

    .titulo-bloque{
        font-size:20px;
    }

    #cerrar{
        font-size:18px;
        padding:12px 18px;
    }

}