/* ========== DESIGN SISTEMA - AELDARI (DUAL STATE) ========== */
@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative&family=Spectral:wght@400;700&family=Metamorphous&family=Marcellus&family=Exo+2:wght@300;400;600&display=swap');

:root {
    /* Asuryani Palette */
    --aeldari-gold: #d4af37;
    --aeldari-white: #f5f5f0;
    --aeldari-cyan: #00e5ff;
    --asuryani-bg: #0a0a1a;

    /* Drukhari Palette */
    --drukhari-red: #c41e3a;
    --drukhari-green: #39ff14;
    --drukhari-purple: #4b0082;
    --drukhari-bg: #050505;
}

body {
    margin: 0;
    font-family: 'Exo 2', sans-serif;
    transition: background 0.8s ease, color 0.5s;
    overflow-x: hidden;
}

body.theme-asuryani {
    background-color: #000;
    color: var(--aeldari-white);
    background-image: url('fundoasuryani.png') !important;
    background-size: 100vw 100vh !important;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center;
    cursor: url('../Index/mouseasuryani.cur'), auto;
}

/* Cor verde para os títulos Asuryani na Hero Section conforme pedido */
.theme-asuryani .faction-hero .lore-title.asuryani-only,
.theme-asuryani .faction-hero p.asuryani-only {
    color: var(--drukhari-green) !important;
    text-shadow: 0 0 20px rgba(57, 255, 20, 0.6);
}

body.theme-drukhari {
    background-color: var(--drukhari-bg);
    color: #cecece;
    background-image: url('fundodrukari.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center;
    cursor: url('mousedrukari2.cur'), auto;
}

/* ========== TOGGLE SWITCH ========== */
.toggle-wrapper {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(0, 0, 0, 0.9);
    padding: 10px 30px;
    border-radius: 50px;
    border: 2px solid var(--aeldari-gold);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.theme-drukhari .toggle-wrapper {
    border-color: var(--drukhari-green);
    box-shadow: 0 0 15px var(--drukhari-green);
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--aeldari-cyan);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--drukhari-purple);
}

input:checked+.slider:before {
    transform: translateX(26px);
}

/* ========== SECTIONS ========== */
.faction-hero {
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.theme-drukhari .faction-hero {
    border-bottom: none;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.6);
}

.section-wrapper {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
}

.lore-card {
    background: transparent;
    padding: 0;
    position: relative;
    box-shadow: none;
    margin: 40px auto;
}

.theme-drukhari .lore-card {
    background: transparent;
    padding: 0;
    position: relative;
    box-shadow: none;
}


.theme-drukhari .lore-card::before,
.theme-drukhari .lore-card::after {
    content: '';
    position: absolute;
    top: 20px;
    width: 0;
    height: 0;
    border-style: solid;
}

.theme-drukhari .lore-card::before {
    left: -5px;
    border-width: 10px 10px 10px 0;
    border-color: transparent #4b0082 transparent transparent;
}

.theme-drukhari .lore-card::after {
    right: -5px;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent #4b0082;
}

/* Bordas de Cristal Inari/Asuryani */
.theme-asuryani .lore-card {
    background: transparent;
    padding: 0;
    position: relative;
    box-shadow: none;
}


.theme-asuryani .lore-card::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle, #00ffff, #008080);
    box-shadow: 0 0 8px #00ffff;
    border: 1px solid #d4af37;
    z-index: 5;
}

.lore-title {
    font-size: 3.5rem;
    text-align: center;
    margin-bottom: 30px;
}

.inner-content {
    background: transparent;
    padding: 60px 100px;
    position: relative;
    border-radius: 5px;
    transition: all 0.5s ease;
}

/* Fundo Asuryani (Luz/Mármore) */
.theme-asuryani .inner-content {
    background: transparent !important;
    backdrop-filter: none;
    border: 55px solid transparent; 
    border-image: url('bordaasuryani3editada.png') 160 stretch; 
    border-image-repeat: round;
    padding: 70px 90px;
    width: auto;
    color: #0c1a2c;
    position: relative;
    z-index: 1;
}

/* Fundo controlado: Não toca as jades dos cantos */
.theme-asuryani .inner-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(245, 245, 240, 0.98);
    border-radius: 0;
    z-index: -1;
    box-shadow: inset 0 0 30px rgba(212, 175, 55, 0.1);
}

.theme-asuryani .lore-text, 
.theme-asuryani .lore-text p,
.theme-asuryani .lore-text strong,
.theme-asuryani .section-label {
    color: #000 !important; 
    position: relative;
    z-index: 2;
}

/* Garantindo que Arsenal e Defesa usem o mesmo fundo limpo */
.theme-asuryani .bg-variant-2 .inner-content::before {
    background: rgba(245, 245, 240, 0.98);
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Fundo Drukhari (Sombra/Veneno) */
.theme-drukhari .inner-content {
    background: rgba(10, 0, 15, 0.7);
    backdrop-filter: blur(10px);
    border: 55px solid transparent;
    border-image: url('bordadrukari1editada.png') 150 stretch;
    border-image-repeat: round;
    padding: 60px 80px;
    background-clip: padding-box;
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
        url('fundodrukari.png');
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.9);
    width: auto;
}

.lore-text {
    font-size: 1.2rem; /* Base */
    line-height: 1.6;
    text-align: justify;
    transition: all 0.5s ease;
}

/* Texto Asuryani */
.theme-asuryani .lore-text {
    font-family: 'Spectral', serif;
    color: #0c1a2c; /* Azul cobalto escuro para leitura perfeita no claro */
}

/* Texto Drukhari */
.theme-drukhari .lore-text {
    font-family: 'Metamorphous', serif;
    color: #e0f2e0; /* Verde ácido creme para leitura no escuro */
}

/* Capitulares Aeldari */
.lore-text::first-letter {
    float: left;
    font-size: 5rem;
    line-height: 0.8;
    padding: 10px 15px 5px 0;
}

.theme-asuryani .lore-text::first-letter {
    font-family: 'Cinzel Decorative', serif;
    color: var(--aeldari-gold);
}

.theme-drukhari .lore-text::first-letter {
    font-family: 'Metamorphous', serif;
    color: var(--drukhari-green);
    text-shadow: 0 0 10px var(--drukhari-green);
}

.theme-asuryani .lore-title,
.theme-asuryani .section-label,
.theme-asuryani .card-label {
    font-family: 'Cinzel Decorative', serif;
}

.theme-drukhari .lore-title,
.theme-drukhari .section-label,
.theme-drukhari .card-label {
    font-family: 'Marcellus', serif;
    letter-spacing: 2px;
}

/* GALLERY (Fixed Grid) */
.aeldari-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* Cards maiores */
    gap: 25px;
    margin-top: 40px;
}

.gallery-card {
    background: none !important; 
    border: 65px solid transparent; /* Bordas muito mais grossas e imponentes */
    border-image: url('bordaasuryani3editada.png') 160 stretch;
    border-image-repeat: round;
    padding: 0; 
    transition: 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden; 
    border-radius: 40px; /* Arredondamento maior para acompanhar a borda */
    box-shadow: none !important;
}

.gallery-card-img-wrapper {
    width: 100%;
    height: 450px; /* Altura aumentada para cards maiores */
    overflow: hidden; 
    background: none !important;
}

.theme-drukhari .gallery-card {
    border-image: url('bordadrukari2editada.png') 150 stretch;
    border-radius: 15px;
    background: transparent !important;
    overflow: hidden;
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.15); /* Zoom aumentado para cobrir sob a borda grossa */
    filter: brightness(1); 
    transition: 0.5s transform ease;
}

.gallery-card:hover img {
    transform: scale(1.15); /* Efeito dinâmico ao passar o mouse */
    filter: brightness(1.1);
}

/* Ajuste específico para o Dire Avenger (img 5) */
.gallery-card.dire-avenger-fix img {
    object-position: top center;
}

.card-label {
    text-align: center;
    padding: 10px 5px;
    margin: 0;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: #d4af37; /* Dourado Nobre Asuryani */
    font-weight: 600;
    letter-spacing: 1px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9); /* Sombra para legibilidade total */
    background: transparent; 
    position: relative;
    z-index: 2;
}

.dru-label {
    color: var(--drukhari-green);
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.5), 2px 2px 4px rgba(0, 0, 0, 0.9);
}

/* ARSENAL & DEFENSE */
.aeldari-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 50px;
    margin: 150px auto;
    max-width: 1000px; /* Restaurado */
}

.aeldari-section.reverse {
    flex-direction: column;
}

.aeldari-content {
    width: 100%;
}

.aeldari-img {
    width: 100%;
    height: 500px;
    padding: 0;
    background: transparent !important; /* Eradicando fundo branco */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Vital para o corte das fotos */
    border-radius: 40px; /* Curva que segue os ornamentos */
    position: relative;
}

/* Moldura Asuryani */
.theme-asuryani .aeldari-img {
    border: 35px solid transparent;
    border-image: url('bordaasuryani3editada.png') 160 stretch;
    border-image-repeat: round;
    padding: 20px;
    background: transparent !important;
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.1);
}

/* Moldura Drukhari (Aumentando a visibilidade) */
.theme-drukhari .aeldari-img {
    border: 35px solid transparent;
    border-image: url('bordadrukari2editada.png') 150 stretch;
    border-image-repeat: round;
    /* Drop shadow para destacar a borda negra no fundo escuro */
    filter: drop-shadow(0 0 10px rgba(57, 255, 20, 0.7));
    box-shadow: 0 0 40px rgba(57, 255, 20, 0.2);
}

.aeldari-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.1); /* Faz a imagem mergulhar sob o arredondamento da borda */
}

/* Textos específicos maiores: Arsenal/Defesa e Legado */
.bg-variant-2 .lore-text {
    font-size: 1.3rem;
}

.legacy-chamber .lore-text {
    font-size: 1.3rem;
}

/* LEGACY SECTION (Leader) */
.legacy-chamber {
    margin-top: 120px;
}

.legacy-card {
    background: transparent;
    padding: 0;
    border: none;
}

.theme-drukhari .legacy-card {
    border: none;
    padding: 0;
}

.legacy-content {
    display: flex;
    align-items: center;
    gap: 60px;
    margin-top: 30px;
}

.legacy-content img {
    border: 45px solid transparent; /* Moldura de legado maior */
    border-image: url('bordaasuryani3editada.png') 160 stretch;
    border-image-repeat: round;
    width: 420px; /* Foto maior no legado */
    padding: 0;
    border-radius: 40px;
    overflow: hidden;
    position: relative;
    background: none !important;
    box-shadow: 0 0 25px rgba(0, 229, 255, 0.3);
}

.theme-drukhari .legacy-content img {
    border-image: url('bordadrukari2editada.png') 150 stretch;
    box-shadow: 0 0 25px rgba(57, 255, 20, 0.4);
}

/* BACK BUTTON */
.back-btn {
    display: inline-block;
    margin: 60px auto;
    padding: 15px 50px;
    background: rgba(0, 0, 0, 0.85); /* Fundo sólido para legibilidade */
    border: 2px solid var(--aeldari-gold);
    color: var(--aeldari-gold);
    font-family: 'Cinzel', serif;
    text-decoration: none;
    transition: 0.4s;
    font-size: 1.2rem;
    border-radius: 4px;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

.theme-drukhari .back-btn {
    background: rgba(10, 0, 20, 0.9); /* Roxo preto Drukhari */
    border-color: var(--drukhari-green);
    color: var(--drukhari-green);
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.2);
}

.back-btn:hover {
    background: var(--aeldari-gold);
    color: #000;
    box-shadow: 0 0 20px var(--aeldari-gold);
}

.theme-drukhari .back-btn:hover {
    background: var(--drukhari-green);
    color: #000;
    box-shadow: 0 0 20px var(--drukhari-green);
}

footer {
    text-align: center;
    padding: 60px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========== MOBILE ADAPTATION: THE AELDARI PATH ========== */
@media (max-width: 900px) {
    .toggle-wrapper {
        padding: 5px 15px;
        font-size: 0.8rem;
        gap: 10px;
    }

    .aeldari-section,
    .legacy-content {
        flex-direction: column !important;
        gap: 30px;
    }

    .lore-title {
        font-size: 2rem;
        margin-bottom: 20px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    /* FIX: Coluna Estreita (Aeldari) */
    .theme-asuryani .inner-content,
    .theme-drukhari .inner-content {
        border-width: 20px; /* Reduzido de 55px */
        padding: 30px 15px;
    }

    .lore-text {
        font-size: 1rem;
        line-height: 1.4;
    }

    .lore-text::first-letter {
        font-size: 3rem; /* Reduzido de 5rem */
        padding: 5px 10px 0 0;
    }

    /* Borders Sections */
    .gallery-card {
        border-width: 20px; /* Reduzido de 65px */
        border-radius: 20px;
    }

    .gallery-card-img-wrapper {
        height: 300px;
    }

    .aeldari-gallery {
        grid-template-columns: 1fr; /* Coluna única */
    }

    .aeldari-img {
        border-width: 15px; /* Reduzido de 35px */
        height: 350px;
    }

    .legacy-content img {
        width: 100%;
        max-width: 300px;
        border-width: 15px; /* Reduzido de 45px */
    }

    /* Back Button */
    .back-btn {
        width: 90%;
        padding: 15px;
        font-size: 0.9rem;
    }
}

/* ========== DYNAMIC ASSETS (Visibility Fix) ========== */
/* Esconder elementos que não pertencem ao tema atual sem forçar 'display: block' nos visíveis */

/* No tema Asuryani (padrão), escondemos tudo que é Drukhari */
body.theme-asuryani .drukhari-only {
    display: none !important;
}

/* No tema Drukhari, escondemos tudo que é Asuryani */
body.theme-drukhari .asuryani-only {
    display: none !important;
}

/* ========== AELDARI EFFECTS: DIVINE & PROFANE ========== */

/* 1. Asuryani: Brilho Celestial Intenso no Topo */
body.theme-asuryani::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 500px;
    background: radial-gradient(circle at top, rgba(0, 255, 238, 0.3) 0%, rgba(212, 175, 55, 0.1) 40%, transparent 80%);
    pointer-events: none;
    z-index: 999; /* Garante que fica no topo de tudo */
    animation: divine-glow 4s infinite alternate ease-in-out;
}

@keyframes divine-glow {
    from { opacity: 0.5; filter: blur(5px); }
    to { opacity: 1; filter: blur(15px); }
}

/* 2. Asuryani: Penas (Mais densas e brilhantes) */
.feather {
    position: fixed;
    top: -50px;
    background: radial-gradient(ellipse at center, #fff 20%, #e0f2f2 100%);
    width: 25px;
    height: 8px;
    border-radius: 50% 50% 20% 20%;
    opacity: 0.8;
    pointer-events: none;
    z-index: 1000;
    filter: drop-shadow(0 0 5px rgba(255,255,255,0.8));
    animation: feather-fall linear forwards;
}

@keyframes feather-fall {
    0% { transform: translateY(0) rotate(0deg) translateX(0); }
    25% { transform: translateY(25vh) rotate(90deg) translateX(var(--drift)); }
    50% { transform: translateY(50vh) rotate(180deg) translateX(0); }
    75% { transform: translateY(75vh) rotate(270deg) translateX(calc(var(--drift) * -1)); }
    100% { transform: translateY(110vh) rotate(360deg) translateX(var(--drift)); }
}

/* 3. Drukhari: Fumaça Venenosa Densa */
.smoke-particle {
    position: fixed;
    bottom: -100px;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(80px); /* Aumentei o blur para parecer fumaça real */
    pointer-events: none;
    z-index: 10; /* Subi o index para garantir que apareça sobre o fundo */
    opacity: 0;
    animation: smoke-rise linear forwards;
}

@keyframes smoke-rise {
    0% { transform: translateY(0) scale(1) rotate(0deg); opacity: 0; }
    20% { opacity: 0.7; } /* Fumaça mais opaca */
    80% { opacity: 0.5; }
    100% { transform: translateY(-700px) scale(3) rotate(90deg); opacity: 0; }
}