/*
Revista Universitaria
Ines Toboso Valero
mailto:itv7@ alu @ua.es
*/

/* ======================================
   RESET Y ESTILOS GENERALES
   ====================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body#pi {
    font-family: 'Nunito', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #b5ead7 0%, #a7d7c5 25%, #f9c5d1 50%, #ffdac1 75%, #c7ceea 100%);
    background-attachment: fixed;
    color: #5a6d4b;
    line-height: 1.6;
    font-size: 16px;
    position: relative;
    overflow-x: hidden;
}

/* Elementos decorativos de Animal Crossing */
.ac-leaf {
    position: fixed;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle at 30% 30%, #a8e6cf, #8fd9b6);
    clip-path: polygon(50% 0%, 80% 10%, 100% 35%, 100% 70%, 80% 100%, 20% 100%, 0% 70%, 0% 35%, 20% 10%);
    z-index: -1;
    pointer-events: none;
}

.ac-sparkle {
    position: fixed;
    width: 8px;
    height: 8px;
    background: #ffeb3b;
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
}

/* ======================================
   CONTENEDOR PRINCIPAL - Estilo Isla AC
   ====================================== */

#contenedor {
    max-width: 1200px;
    margin: 30px auto;
    background: #fffef7;
    border-radius: 40px 40px 30px 30px;
    box-shadow: 
        0 15px 50px rgba(90, 109, 75, 0.2),
        inset 0 0 0 8px #f5f5f0,
        inset 0 0 0 12px #e8f4ea;
    padding: 50px 40px;
    position: relative;
    overflow: hidden;
    border: 15px solid transparent;
    background-clip: padding-box;
}

#contenedor::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(255, 223, 186, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

#contenedor::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: -40px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(168, 230, 207, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* Encabezado estilo Animal Crossing - Simplificado */
#contenedor::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 15px;
    background: linear-gradient(90deg, 
        #ff8a8a, #ffd166, #a8e6cf, #8ac6d1, #b5ead7,
        #ffb5a7, #ffdac1, #caffbf, #9bf6ff, #fdffb6);
    border-radius: 40px 40px 0 0;
}

/* ======================================
   SECCIÓN INTRO - Estilo Plaza Central
   ====================================== */

#intro {
    background: linear-gradient(135deg, #c7f9cc 0%, #a7d7c5 100%);
    border-radius: 30px;
    padding: 40px;
    margin-bottom: 40px;
    border: 8px solid #95d5b2;
    position: relative;
    overflow: hidden;
    box-shadow: 
        inset 0 0 30px rgba(255, 255, 255, 0.5),
        0 10px 25px rgba(149, 213, 178, 0.3);
}

#intro::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 25px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
}

#intro::after {
    content: '';
    position: absolute;
    bottom: 15px;
    right: 25px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
}

#titulo h1 {
    font-size: 3.2em;
    color: #2e7d32;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 
        3px 3px 0 rgba(255, 255, 255, 0.7),
        6px 6px 0 rgba(168, 230, 207, 0.3);
    font-weight: 800;
    letter-spacing: 1px;
    position: relative;
    padding-bottom: 20px;
}

#titulo h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 4px;
    background: linear-gradient(90deg, transparent, #8fd9b6, transparent);
    border-radius: 2px;
}

#titulo h1 span {
    display: block;
}

#titulo h2 {
    font-size: 1.7em;
    color: #5c8a4d;
    text-align: center;
    margin-bottom: 30px;
    font-weight: 600;
    font-style: italic;
    background: rgba(255, 255, 255, 0.6);
    padding: 15px 30px;
    border-radius: 20px;
    display: inline-block;
    border: 3px dashed #a8e6cf;
}

#titulo h2 span {
    display: block;
}

#resumen {
    background: rgba(255, 255, 255, 0.8);
    padding: 30px;
    border-radius: 25px;
    margin-top: 30px;
    border: 4px dashed #a8e6cf;
    position: relative;
    backdrop-filter: blur(5px);
}

#resumen::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 30px;
    width: 30px;
    height: 30px;
    background: white;
    border-radius: 50%;
    border: 3px solid #a8e6cf;
}

#resumen p {
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

#resumen p:hover {
    transform: translateX(10px);
}

#resumen p span {
    display: block;
}

#resumen ul {
    list-style: none;
    margin: 20px 0;
    padding-left: 25px;
}

#resumen ul li {
    padding: 10px 0 10px 40px;
    position: relative;
    color: #4a5f3a;
    transition: all 0.3s ease;
    border-bottom: 1px dotted rgba(168, 230, 207, 0.3);
}

#resumen ul li:hover {
    background: rgba(168, 230, 207, 0.1);
    border-radius: 10px;
    padding-left: 45px;
}

#resumen ul li::before {
    content: '';
    position: absolute;
    left: 0;
    width: 8px;
    height: 8px;
    background: #ff9a9e;
    border-radius: 50%;
    top: 15px;
}

#comentario {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 248, 225, 0.9));
    padding: 25px;
    border-radius: 25px;
    margin-top: 25px;
    border-left: 8px solid #ffcc80;
    position: relative;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#comentario:hover {
    transform: translateY(-5px);
    box-shadow: 10px 10px 25px rgba(0, 0, 0, 0.1);
}

#comentario::before {
    content: '';
    position: absolute;
    top: -15px;
    right: 30px;
    width: 30px;
    height: 30px;
    background: white;
    border-radius: 50%;
    border: 3px solid #ffcc80;
}

#comentario p {
    margin-bottom: 15px;
    font-style: italic;
    position: relative;
    padding-left: 20px;
}

#comentario p::before {
    content: '>';
    position: absolute;
    left: 0;
    color: #ffcc80;
    font-size: 1.5em;
}

#comentario p span {
    display: block;
}

#comentario a {
    color: #2e7d32;
    text-decoration: none;
    font-weight: bold;
    border-bottom: 2px dotted #8fd9b6;
    padding-bottom: 2px;
    transition: all 0.3s ease;
    position: relative;
}

#comentario a:hover {
    color: #1b5e20;
    border-bottom-color: #2e7d32;
    padding-left: 5px;
}

#comentario a::after {
    content: '>';
    margin-left: 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#comentario a:hover::after {
    opacity: 1;
}

/* ======================================
   ENLACES INTRA - Estilo Menú AC
   ====================================== */

#enlacesintra {
    background: linear-gradient(135deg, #ffd89b 0%, #ffcc80 100%);
    border-radius: 25px;
    padding: 30px;
    margin-bottom: 40px;
    border: 6px solid #ffb74d;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(255, 179, 77, 0.2);
}

#enlacesintra::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: repeating-linear-gradient(90deg, 
        #ff8a8a, #ffd166 10px, 
        #a8e6cf 20px, #8ac6d1 30px, 
        #b5ead7 40px);
}

#enlacesintra h3.intra {
    font-size: 2em;
    color: #e65100;
    margin-bottom: 25px;
    text-align: center;
    position: relative;
    display: inline-block;
    padding: 0 20px;
}

#enlacesintra h3.intra::before,
#enlacesintra h3.intra::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: #ff8a8a;
    border-radius: 50%;
}

#enlacesintra h3.intra::before {
    left: -10px;
}

#enlacesintra h3.intra::after {
    right: -10px;
}

#enlacesintra h3 span {
    display: block;
}

#enlacesintra ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

#enlacesintra ul li {
    flex: 1 1 220px;
    min-width: 200px;
    transition: transform 0.3s ease;
}

#enlacesintra ul li:hover {
    transform: scale(1.05);
}

#enlacesintra ul li a {
    display: block;
    background: #fff;
    padding: 20px;
    border-radius: 20px;
    text-align: center;
    text-decoration: none;
    color: #e65100;
    font-weight: bold;
    border: 4px solid #ffb74d;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

#enlacesintra ul li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s;
}

#enlacesintra ul li a:hover::before {
    left: 100%;
}

#enlacesintra ul li a:hover {
    background: #ffecb3;
    transform: translateY(-8px) rotate(2deg);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.2);
    border-color: #ff8a8a;
}

/* ======================================
   APARTADOS - Estilo Museo AC
   ====================================== */

#apartados {
    margin-bottom: 40px;
}

#apartados > div {
    background: #f9f7f0;
    border-radius: 25px;
    padding: 35px;
    margin-bottom: 30px;
    border: 6px solid #dcedc8;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
}

#apartados > div:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border-color: #b5ead7;
}

#apartados > div::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: repeating-linear-gradient(90deg, 
        #ff9a9e, #fad0c4 15px, 
        #a1c4fd 30px, #c2e9fb 45px, 
        #ffecd2 60px);
}

#apartados h3 {
    font-size: 2.2em;
    color: #2e7d32;
    margin-bottom: 25px;
    padding-bottom: 15px;
    padding-left: 30px;
    border-bottom: 4px dotted #a8e6cf;
    position: relative;
}

#apartados h3::before {
    content: '';
    position: absolute;
    left: 0;
    width: 12px;
    height: 12px;
    background: #8fd9b6;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
}

#apartados h3 span {
    display: block;
}

#apartados p {
    margin-bottom: 20px;
    text-align: justify;
    line-height: 1.8;
}

#apartados p span {
    display: block;
}

#apartados ul {
    list-style: none;
    margin: 20px 0;
    padding-left: 30px;
}

#apartados ul li {
    padding: 12px 0 12px 35px;
    position: relative;
    color: #4a5f3a;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

#apartados ul li:hover {
    border-left-color: #a8e6cf;
    padding-left: 40px;
    background: rgba(168, 230, 207, 0.05);
}

#apartados ul li::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 15px;
    width: 8px;
    height: 8px;
    background: #8fd9b6;
    border-radius: 50%;
    filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.1));
}

#apartados ul ul {
    margin-top: 15px;
    margin-left: 25px;
    border-left: 2px dashed rgba(168, 230, 207, 0.3);
    padding-left: 20px;
}

#apartados ul ul li::before {
    content: '';
    background: #5c8a4d;
    width: 6px;
    height: 6px;
}

#apartados dl {
    margin: 25px 0;
    background: rgba(255, 255, 255, 0.7);
    padding: 20px;
    border-radius: 15px;
    border: 2px solid #e8f4ea;
}

#apartados dt {
    font-weight: bold;
    color: #2e7d32;
    margin-top: 20px;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 10px;
}

#apartados dt::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #2e7d32;
    border-radius: 50%;
    margin-right: 5px;
}

#apartados dt a {
    color: #2e7d32;
    text-decoration: none;
    border-bottom: 3px solid #a8e6cf;
    padding-bottom: 3px;
    transition: all 0.3s ease;
    position: relative;
}

#apartados dt a:hover {
    color: #1b5e20;
    border-bottom-color: #2e7d32;
    padding-left: 5px;
}

#apartados dd {
    margin-left: 40px;
    margin-top: 10px;
    padding-left: 20px;
    border-left: 4px solid #ffcc80;
    color: #5c8a4d;
    line-height: 1.7;
    position: relative;
    padding-top: 5px;
    padding-bottom: 5px;
}

#apartados dd::before {
    content: '';
    position: absolute;
    left: -35px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #ffcc80;
    border-radius: 50%;
    opacity: 0.7;
}

#apartados dd .autores {
    font-style: italic;
    color: #6a994e;
    font-weight: 600;
}

#apartados dd .editorial {
    color: #7a7a7a;
    background: rgba(0,0,0,0.03);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin: 0 5px;
}

#apartados dd .isbn {
    font-size: 0.9em;
    color: #999;
    background: #f5f5f5;
    padding: 2px 10px;
    border-radius: 12px;
    display: inline-block;
    margin-left: 10px;
    border: 1px solid #e0e0e0;
}

/* ======================================
   ENLACES LATERAL - Estilo NookPhone
   ====================================== */

#enlaces {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

#enlaces > div {
    background: linear-gradient(145deg, #f5f5f0, #ffffff);
    border-radius: 25px;
    padding: 30px;
    border: 6px solid;
    box-shadow: 
        8px 8px 25px rgba(0, 0, 0, 0.1),
        inset 0 0 30px rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

#enlaces > div:hover {
    transform: translateY(-8px);
    box-shadow: 
        15px 15px 35px rgba(0, 0, 0, 0.15),
        inset 0 0 40px rgba(255, 255, 255, 0.9);
}

#enlaces h3 {
    font-size: 1.6em;
    color: #2e7d32;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid;
    position: relative;
    padding-left: 50px;
}

#enlaces h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background: currentColor;
    border-radius: 50%;
    opacity: 0.7;
}

#enlaces h3 span {
    display: block;
}

#enlaces ul {
    list-style: none;
}

#enlaces ul li {
    margin: 15px 0;
    position: relative;
}

#enlaces ul li a {
    display: block;
    padding: 15px 20px;
    background: #fff;
    border-radius: 15px;
    text-decoration: none;
    color: #4a5f3a;
    border: 3px solid;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: 600;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

#enlaces ul li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    transition: left 0.6s;
    z-index: -1;
}

#enlaces ul li a:hover::before {
    left: 100%;
}

#enlaces ul li a:hover {
    transform: translateX(10px);
    padding-left: 30px;
}

#enlaces ul li a.c {
    display: inline;
    padding: 5px 12px;
    font-size: 0.85em;
    color: #7a7a7a;
    border: 2px solid #e0e0e0;
    margin-left: 10px;
    border-radius: 10px;
    background: #f9f9f9;
}

#enlaces ul li a.c:hover {
    background: #e8f4ea;
    transform: scale(1.1);
    border-color: #a8e6cf;
}

/* Colores específicos para cada sección */
#lselecciona {
    border-color: #a8e6cf;
}

#lselecciona h3 {
    color: #2e7d32;
    border-bottom-color: #a8e6cf;
}

#lselecciona ul li a {
    border-color: #a8e6cf;
}

#lselecciona ul li a:hover {
    background: #e8f4ea;
    border-color: #8fd9b6;
}

#lhistorico {
    border-color: #ffd89b;
}

#lhistorico h3 {
    color: #e65100;
    border-bottom-color: #ffd89b;
}

#lhistorico ul li a {
    border-color: #ffd89b;
}

#lhistorico ul li a:hover {
    background: #fff3e0;
    border-color: #ffcc80;
}

#lrecursos {
    border-color: #ffcc80;
}

#lrecursos h3 {
    color: #f57c00;
    border-bottom-color: #ffcc80;
}

#lrecursos ul li a {
    border-color: #ffcc80;
}

#lrecursos ul li a:hover {
    background: #fff8e1;
    border-color: #ffb74d;
}

/* ======================================
   ENLACES VERSIONES - Estilo Viaje Isla
   ====================================== */

#enlacesversiones {
    background: linear-gradient(135deg, #e1bee7 0%, #ce93d8 100%);
    border-radius: 25px;
    padding: 30px;
    border: 6px solid #ba68c8;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(186, 104, 200, 0.2);
}

#enlacesversiones::before {
    content: '';
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    opacity: 0.5;
}

#enlacesversiones h3.versiones {
    font-size: 1.7em;
    color: #6a1b9a;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    display: inline-block;
    padding: 0 25px;
}

#enlacesversiones h3.versiones::before,
#enlacesversiones h3.versiones::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: #ba68c8;
    border-radius: 50%;
}

#enlacesversiones h3.versiones::before {
    left: 0;
}

#enlacesversiones h3.versiones::after {
    right: 0;
}

#enlacesversiones h3 span {
    display: block;
}

#enlacesversiones ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

#enlacesversiones ul li {
    flex: 1 1 180px;
    min-width: 150px;
    transition: transform 0.3s ease;
}

#enlacesversiones ul li:hover {
    transform: translateY(-5px);
}

#enlacesversiones ul li a {
    display: block;
    background: #fff;
    padding: 15px 25px;
    border-radius: 15px;
    text-decoration: none;
    color: #6a1b9a;
    font-weight: bold;
    border: 3px solid #ba68c8;
    transition: all 0.4s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

#enlacesversiones ul li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s;
}

#enlacesversiones ul li a:hover::before {
    left: 100%;
}

#enlacesversiones ul li a:hover {
    background: #f3e5f5;
    transform: scale(1.08);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    border-color: #ab47bc;
}

/* ======================================
   DIVS DECORATIVOS EXTRA - Elementos AC
   ====================================== */

#extraDiv1,
#extraDiv2,
#extraDiv3,
#extraDiv4,
#extraDiv5,
#extraDiv6 {
    display: block;
    position: fixed;
    z-index: -1;
    pointer-events: none;
    opacity: 0.7;
}

#extraDiv1 {
    top: 10%;
    left: 5%;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, #ff9a9e, transparent 70%);
    border-radius: 50%;
}

#extraDiv2 {
    top: 20%;
    right: 10%;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, #a8e6cf, transparent 70%);
    border-radius: 50%;
}

#extraDiv3 {
    bottom: 15%;
    left: 15%;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, #ffd89b, transparent 70%);
    border-radius: 50%;
}

#extraDiv4 {
    top: 60%;
    right: 5%;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #c7ceea, transparent 70%);
    border-radius: 50%;
}

#extraDiv5 {
    bottom: 5%;
    right: 20%;
    width: 90px;
    height: 90px;
    background: radial-gradient(circle, #b5ead7, transparent 70%);
    border-radius: 50%;
}

#extraDiv6 {
    top: 40%;
    left: 10%;
    width: 70px;
    height: 70px;
    background: radial-gradient(circle, #ffdac1, transparent 70%);
    border-radius: 50%;
}

/* ======================================
   RESPONSIVE DESIGN
   ====================================== */

/* Tablets y dispositivos medianos (641px - 1024px) */
@media screen and (max-width: 1024px) {
    #contenedor {
        padding: 35px;
        margin: 20px;
        border-width: 10px;
    }

    #titulo h1 {
        font-size: 2.5em;
    }

    #titulo h2 {
        font-size: 1.4em;
    }

    #apartados h3 {
        font-size: 1.9em;
    }

    #enlaces {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }
}

/* Móviles y dispositivos pequeños (640px - 768px) */
@media screen and (max-width: 768px) {
    body#pi {
        font-size: 15px;
    }

    #contenedor {
        padding: 25px;
        margin: 15px;
        border-radius: 30px;
        border-width: 8px;
    }

    #intro {
        padding: 30px;
    }

    #titulo h1 {
        font-size: 2em;
    }

    #titulo h2 {
        font-size: 1.2em;
        padding: 12px 20px;
    }

    #enlacesintra ul {
        flex-direction: column;
    }

    #enlacesintra ul li {
        flex: 1 1 100%;
    }

    #apartados > div {
        padding: 25px;
    }

    #apartados h3 {
        font-size: 1.6em;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    #apartados h3::before {
        margin: 0 auto;
    }

    #apartados dd {
        margin-left: 20px;
    }

    #enlaces {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    #enlacesversiones ul {
        flex-direction: column;
        align-items: stretch;
    }

    #enlacesversiones ul li {
        width: 100%;
    }

    #enlacesversiones ul li a {
        display: block;
        width: 100%;
        text-align: center;
    }
    
    /* Ocultar algunos elementos decorativos en móvil */
    #extraDiv1,
    #extraDiv2,
    #extraDiv3,
    #extraDiv4,
    #extraDiv5,
    #extraDiv6 {
        display: none;
    }
}

/* Dispositivos muy pequeños (640px) */
@media screen and (max-width: 640px) {
    #contenedor {
        padding: 20px;
        margin: 10px;
        border-radius: 25px;
        border-width: 6px;
    }

    #intro {
        padding: 25px;
    }

    #titulo h1 {
        font-size: 1.7em;
    }

    #titulo h2 {
        font-size: 1.1em;
    }

    #resumen,
    #comentario {
        padding: 20px;
    }

    #enlacesintra {
        padding: 25px;
    }

    #apartados > div {
        padding: 20px;
    }

    #apartados h3 {
        font-size: 1.4em;
    }

    #enlaces > div {
        padding: 25px;
    }
}

/* Pantallas muy grandes (1920px+) */
@media screen and (min-width: 1920px) {
    #contenedor {
        max-width: 1400px;
        padding: 60px;
    }

    #titulo h1 {
        font-size: 3.8em;
    }

    #titulo h2 {
        font-size: 2em;
    }

    #apartados h3 {
        font-size: 2.5em;
    }

    #enlaces {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 30px;
    }
}

/* Animaciones de hojas y destellos */
@media screen and (min-width: 1024px) {
    /* Generar hojas cayendo */
    body#pi::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        pointer-events: none;
        z-index: -1;
    }

    /* Destellos aleatorios */
    body#pi::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: 
            radial-gradient(3px 3px at 10% 20%, #ffeb3b, transparent),
            radial-gradient(4px 4px at 30% 40%, #ff8a8a, transparent),
            radial-gradient(3px 3px at 50% 60%, #a8e6cf, transparent),
            radial-gradient(4px 4px at 70% 80%, #ffd89b, transparent),
            radial-gradient(3px 3px at 90% 30%, #c7ceea, transparent);
        opacity: 0.3;
        pointer-events: none;
        z-index: -1;
    }
}