/* =========================
   RESET + BASE
========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rubik', sans-serif;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-color: #0b0b0b;
    background-image: url('../img/fondo.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

input[type="radio"] {
    display: none;
}

/* =========================
   VARIABLES
========================= */
:root {
    --black: #0b0b0b;
    --white: #ffffff;
    --gray: #ffffff;
    --prime-default: #ffffff; 
    --transition-fast: 0.3s ease;
}

/* =========================
   HEADER
========================= */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: #000;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #222;
}

.header__icon { width: 50px; }

.header__title {
    height: 60px;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.header__title:hover {
    transform: scale(1.15);
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.5)); 
}

/* Enlace derecho del Header */
.header__link {
    display: flex;
    flex-direction: column; 
    align-items: center;
    text-decoration: none;
    color: var(--white);
    margin-right: 0; 
    transition: transform 0.3s ease;
}

.header__link img {
    width: 35px; 
    height: auto;
    margin-bottom: 2px;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.header__link p {
    font-size: 0.75rem; 
    text-transform: uppercase;
    font-weight: 600;
    margin: 0;
}

.header__link:hover {
    transform: scale(1.1); 
    cursor: pointer;
}

.header__link:hover img {
    opacity: 1;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.8));
}

/* =========================
   INTRO & TÍTULO
========================= */
.intro {
    position: relative;
    padding: 4rem 2rem;
    text-align: center;
    color: #ffffff;
    
    /* Fondo específico */
    background-image: url('../img/fondointro.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    border-bottom: 2px solid #333;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Velo oscuro para lectura */
.intro::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 0;
}

.intro__img, 
.intro__text,
.intro__title {
    position: relative;
    z-index: 1; 
}

.intro__title {
    font-size: 2.5rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 1.5rem;
    color: var(--gray); 
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    animation: fadeInUp 1s ease-out;
}

.intro__text {
    max-width: 900px;
    margin: auto;
    font-size: 1rem;
    color: var(--gray);
    line-height: 1.6;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .intro__title {
        font-size: 1.5rem;
        letter-spacing: 2px;
    }
}

/* =========================
   NAVEGACIÓN DE LOS 13 PRIMES
========================= */
.factions {
    background-color: #000;
    padding: 1.5rem 1rem;
    border-top: 1px solid #1a1a1a;
    border-bottom: 1px solid #1a1a1a;
}

.factions__list {
    display: flex;
    justify-content: center; 
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap; /* Permite que bajen de línea si no caben */
}

.faction {
    display: flex;
    flex-direction: column;   
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    color: #fff;
    text-align: center;
    transition: transform var(--transition-fast), filter var(--transition-fast);
    min-width: 70px;
}

.faction img {
    width: 60px;      
    height: 60px;
    object-fit: contain;
    margin-bottom: 0.5rem;
    transition: filter 0.3s ease, transform 0.3s ease;
    filter: grayscale(100%); /* Gris por defecto */
}

.faction span {
    font-size: 0.7rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 600;
}

.faction:hover {
    transform: scale(1.1);
}
.faction:hover img {
    filter: grayscale(0%);
}

/* =========================
   CONTENEDOR DE FICHAS
========================= */
.faction-content {
    position: relative;
    height: 600px; 
    width: 100%;
    max-width: 1200px;
    margin: 2rem auto;
    overflow: hidden; 
}

.content {
    position: absolute;
    inset: 0;
    padding: 2rem 4rem;
    
    /* Layout */
    display: grid;
    grid-template-columns: 45% 55%; 
    align-items: center;
    gap: 4rem;

    /* Estado inicial: Oculto */
    opacity: 0;
    pointer-events: none;
    transform: translateY(30px) scale(0.98);
    filter: blur(8px);
    z-index: 1;

    transition: opacity 0.5s ease-out, transform 0.5s ease-out, filter 0.5s ease-out;
}

/* Imagen del Prime */
.leader {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.leader img {
    max-width: 100%;
    max-height: 500px; 
    object-fit: contain;
    filter: drop-shadow(0 15px 30px rgba(0,0,0,0.6));
}

/* Estilos de Texto */
.content article h2 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    font-weight: 800;
    line-height: 1;
    color: var(--prime-default);
    text-shadow: 0 0 25px rgba(0, 229, 255, 0.4);
}

.content article p {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--gray);
    text-align: justify;
}

/* =======================================================
   LÓGICA DE ACTIVACIÓN (VISIBILIDAD)
======================================================= */
#p_prima:checked ~ .faction-content .content--prima,
#p_vector:checked ~ .faction-content .content--vector,
#p_alpha:checked ~ .faction-content .content--alpha,
#p_solus:checked ~ .faction-content .content--solus,
#p_micronus:checked ~ .faction-content .content--micronus,
#p_alchemist:checked ~ .faction-content .content--alchemist,
#p_nexus:checked ~ .faction-content .content--nexus,
#p_onyx:checked ~ .faction-content .content--onyx,
#p_amalgamous:checked ~ .faction-content .content--amalgamous,
#p_quintus:checked ~ .faction-content .content--quintus,
#p_liege:checked ~ .faction-content .content--liege,
#p_megatronus:checked ~ .faction-content .content--megatronus,
#p_thirteenth:checked ~ .faction-content .content--thirteenth {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    filter: blur(0);
    z-index: 10;
}

/* =======================================================
   LÓGICA DE COLORES (POR PRIME)
======================================================= */

#p_prima:checked ~ .factions .faction--prima img { filter: drop-shadow(0 0 15px #dffbff) grayscale(0%); transform: scale(1.2); }
#p_prima:checked ~ .factions .faction--prima span { color: #dffbff; text-shadow: 0 0 10px #dffbff; }
.content--prima h2 { color: #dffbff; text-shadow: 0 0 20px rgba(223, 251, 255, 0.4); }

#p_vector:checked ~ .factions .faction--vector img { filter: drop-shadow(0 0 15px #0091ea) grayscale(0%); transform: scale(1.2); }
#p_vector:checked ~ .factions .faction--vector span { color: #0091ea; text-shadow: 0 0 10px #0091ea; }
.content--vector h2 { color: #0091ea; text-shadow: 0 0 20px rgba(0, 145, 234, 0.4); }

#p_alpha:checked ~ .factions .faction--alpha img { filter: drop-shadow(0 0 15px #d81b60) grayscale(0%); transform: scale(1.2); }
#p_alpha:checked ~ .factions .faction--alpha span { color: #d81b60; text-shadow: 0 0 10px #d81b60; }
.content--alpha h2 { color: #d81b60; text-shadow: 0 0 20px rgba(216, 27, 96, 0.4); }

#p_solus:checked ~ .factions .faction--solus img { filter: drop-shadow(0 0 15px #00bcd4) grayscale(0%); transform: scale(1.2); }
#p_solus:checked ~ .factions .faction--solus span { color: #00bcd4; text-shadow: 0 0 10px #00bcd4; }
.content--solus h2 { color: #00bcd4; text-shadow: 0 0 20px rgba(0, 188, 212, 0.4); }

#p_micronus:checked ~ .factions .faction--micronus img { filter: drop-shadow(0 0 15px #00bfa5) grayscale(0%); transform: scale(1.2); }
#p_micronus:checked ~ .factions .faction--micronus span { color: #00bfa5; text-shadow: 0 0 10px #00bfa5; }
.content--micronus h2 { color: #00bfa5; text-shadow: 0 0 20px rgba(0, 191, 165, 0.4); }

#p_alchemist:checked ~ .factions .faction--alchemist img { filter: drop-shadow(0 0 15px #b0bec5) grayscale(0%); transform: scale(1.2); }
#p_alchemist:checked ~ .factions .faction--alchemist span { color: #b0bec5; text-shadow: 0 0 10px #b0bec5; }
.content--alchemist h2 { color: #b0bec5; text-shadow: 0 0 20px rgba(176, 190, 197, 0.4); }

#p_nexus:checked ~ .factions .faction--nexus img { filter: drop-shadow(0 0 15px #e67e22) grayscale(0%); transform: scale(1.2); }
#p_nexus:checked ~ .factions .faction--nexus span { color: #e67e22; text-shadow: 0 0 10px #e67e22; }
.content--nexus h2 { color: #e67e22; text-shadow: 0 0 20px rgba(230, 126, 34, 0.4); }

#p_onyx:checked ~ .factions .faction--onyx img { filter: drop-shadow(0 0 15px #ffd600) grayscale(0%); transform: scale(1.2); }
#p_onyx:checked ~ .factions .faction--onyx span { color: #ffd600; text-shadow: 0 0 10px #ffd600; }
.content--onyx h2 { color: #ffd600; text-shadow: 0 0 20px rgba(255, 214, 0, 0.4); }

#p_amalgamous:checked ~ .factions .faction--amalgamous img { filter: drop-shadow(0 0 15px #ffab00) grayscale(0%); transform: scale(1.2); }
#p_amalgamous:checked ~ .factions .faction--amalgamous span { color: #ffab00; text-shadow: 0 0 10px #ffab00; }
.content--amalgamous h2 { color: #ffab00; text-shadow: 0 0 20px rgba(255, 171, 0, 0.4); }

#p_quintus:checked ~ .factions .faction--quintus img { filter: drop-shadow(0 0 15px #ff3d00) grayscale(0%); transform: scale(1.2); }
#p_quintus:checked ~ .factions .faction--quintus span { color: #ff3d00; text-shadow: 0 0 10px #ff3d00; }
.content--quintus h2 { color: #ff3d00; text-shadow: 0 0 20px rgba(255, 61, 0, 0.4); }

#p_liege:checked ~ .factions .faction--liege img { filter: drop-shadow(0 0 15px #00c853) grayscale(0%); transform: scale(1.2); }
#p_liege:checked ~ .factions .faction--liege span { color: #00c853; text-shadow: 0 0 10px #00c853; }
.content--liege h2 { color: #00c853; text-shadow: 0 0 20px rgba(0, 200, 83, 0.4); }

#p_megatronus:checked ~ .factions .faction--megatronus img { filter: drop-shadow(0 0 15px #d50000) grayscale(0%); transform: scale(1.2); }
#p_megatronus:checked ~ .factions .faction--megatronus span { color: #d50000; text-shadow: 0 0 10px #d50000; }
.content--megatronus h2 { color: #d50000; text-shadow: 0 0 20px rgba(213, 0, 0, 0.4); }

#p_thirteenth:checked ~ .factions .faction--thirteenth img { filter: drop-shadow(0 0 15px #ff6d00) grayscale(0%); transform: scale(1.2); }
#p_thirteenth:checked ~ .factions .faction--thirteenth span { color: #ff6d00; text-shadow: 0 0 10px #ff6d00; }
.content--thirteenth h2 { color: #ff6d00; text-shadow: 0 0 20px rgba(255, 109, 0, 0.4); }

/* =========================
   FOOTER
========================= */
.footer {
    background-color: #000;
    padding: 3rem 0;
    margin-top: auto; 
    border-top: 1px solid #222;
}

.footer__links {
    max-width: 800px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.footer__link {
    text-decoration: none;
    color: var(--white);
    text-align: center;
    transition: transform var(--transition-fast);
}

.footer__link img {
    width: 50px;
    margin-bottom: 0.8rem;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.footer__link:hover {
    transform: translateY(-5px);
}

.footer__link:hover img {
    opacity: 1;
}

/* =========================
   REPRODUCTOR DE AUDIO
========================= */
.audio-player {
    position: fixed; 
    bottom: 20px;    
    right: 20px;     
    z-index: 1000;   
    width: 300px;
    height: 40px;
    opacity: 0.6; 
    filter: invert(1) hue-rotate(180deg); 
    border-radius: 20px;
    transition: opacity 0.3s ease;
}

.audio-player:hover {
    opacity: 1;
    box-shadow: 0 0 15px rgba(0, 128, 255, 0.5); 
}