/* ========== DESIGN SYSTEM & VARIABLES ========== */
:root {
    --bg-deep: #020205;
    --panel-hex: #1a1a24;
    --panel-light: #b6b6bb;
    --accent-imperium: #c41e3a;
    /* Imperial Red */
    --accent-chaos: #8a2be2;
    /* Chaos Purple */
    --accent-aeldari: #00ced1;
    /* Aeldari Teal */
    --accent-tau: #ffa500;
    /* T'au Orange */
    --accent-orks: #228b22;
    /* Ork Green */
    --accent-necrons: #32cd32;
    /* Necron Green */
    --accent-tyranids: #9400d3;
    /* Tyranid Purple */

    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --glow-strength: 0 0 10px rgba(196, 30, 58, 0.4);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== CONFIGURAÇÕES GERAIS ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-primary);
    font-family: 'Exo 2', sans-serif;
    overflow-x: hidden;
}

.galaxy-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.5)),
        url('fundo20.png') no-repeat center center;
    background-size: cover;
    z-index: -5;
}

/* ========== NAVBAR ========== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 50px;
    background: rgba(0, 0, 0, 0.8);
    border-bottom: 2px solid #c41e3a;
}

.logo {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 900;
    color: #c41e3a;
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #c41e3a;
}

/* ========== HERO SECTION ========== */

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 20px 80px;
    /* aumentei o padding-top */
    min-height: 60vh;
}

/* Logo */
.hero-logo {
    margin-top: 40px;
    /* espaço extra do header */
    margin-bottom: 30px;
}

.hero-logo img {
    width: 700px;
    max-width: 90%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Tagline */
.hero-tagline {
    font-size: 1.3rem;
    color: #ddd;
    margin: 0 0 30px 0;
    text-align: center;
}

/* Audio Player */
.audio-player {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    width: 100%;
}

.audio-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    background: rgba(196, 30, 58, 0.2);
    border: 2px solid #c41e3a;
    border-radius: 25px;
    color: #c41e3a;
    font-family: 'Exo 2', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.audio-btn:hover {
    background: rgba(196, 30, 58, 0.4);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(196, 30, 58, 0.5);
}

.play-icon {
    font-size: 1rem;
}

.audio-text {
    letter-spacing: 0.5px;
}

.btn-explore {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(135deg, #c41e3a, #8b1527);
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: 5px;
    box-shadow: 0 5px 20px rgba(196, 30, 58, 0.5);
    transition: all 0.3s;
}

.btn-explore:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(196, 30, 58, 0.8);
}

.historia-panel {
    background: linear-gradient(180deg, rgba(26, 26, 36, 0.95), rgba(20, 20, 30, 0.98));
    border: 3px solid #4a4a5a;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    padding: 30px 60px;
    /* menos altura (30px), mais largura (60px) */
    margin: 60px auto 80px;
    max-width: 1200px;
    /* aumentei de 900px para 1200px */
}

.historia-panel p {
    color: #ddd;
    font-family: 'Exo 2', sans-serif;
    font-size: 1.7rem;
    /* reduzi um pouco pois vai caber em menos linhas */
    font-weight: 400;
    line-height: 1.7;
    /* reduzi um pouco o espaçamento entre linhas */
    text-align: justify;
    letter-spacing: 0.3px;
    margin: 0;
}

/* ========== SEÇÃO DE FACÇÕES ========== */
#faccao {
    padding: 70px 20px;
}

.section-title {
    text-align: center;
    font-family: 'Cinzel', serif;
    font-size: 3.5rem;
    color: #c41e3a;
    margin-bottom: 120px;
    text-shadow: 0 0 10px rgba(196, 30, 58, 0.6);
}

/* ========== LAYOUT PRINCIPAL (PAINEL + SIDEBAR) ========== */
.layout-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.metal-panel {
    background: linear-gradient(180deg, rgba(182, 182, 187, 0.1), rgba(26, 26, 36, 0.95));
    border: 1px solid #4a4a5a;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), inset 0 0 15px rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

/* ========== PAINEL PRINCIPAL DAS FACÇÕES ========== */
.main-panel {
    max-width: 2200px;
    flex: 1 1 0%;
    padding: 40px;
    position: relative;
    height: 500px;
}

.factions-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.factions-display {
    display: flex;
    width: 200%;
    height: 100%;
    transition: transform 0.6s ease;
}

.faction-page {
    width: 50%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 25px;
    padding: 10px;
    min-height: 0;
}

/* ========== CARDS DAS FACÇÕES ========== */
.faction-card {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #333;
    background: #000;
    display: block;
    text-decoration: none;
    transition: var(--transition-smooth);
    min-height: 0;
}

.faction-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 25px rgba(196, 30, 58, 0.4);
    border-color: var(--accent-imperium);
}


.card-img-box {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0a0a0a;
}

.card-img-box img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center center;
    transition: transform 0.5s ease;
}

.faction-card:hover .card-img-box img {
    transform: scale(1.05);
}

/* Card Império: enquadra mais para cima para mostrar a cabeça do Imperador (sem zoom = sem borda preta) */
.faction-card--imperio .card-img-box img {
    object-position: center 20%;
}
.faction-card--imperio:hover .card-img-box img {
    transform: scale(1.05);
}

.card-title {
    position: absolute;
    bottom: 30px;
    left: 0;
    width: 100%;
    padding: 10px 15px;
    background: transparent;
    /* ← SEM fundo */
    color: #c41e3a;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
    /* adiciona sombra no texto */
}

.card-desc {
    position: absolute;
    bottom: 8px;
    left: 0;
    width: 100%;
    padding: 0 15px;
    font-size: 0.8rem;
    color: #aaa;
}

/* ========== SETAS DE NAVEGAÇÃO (FACÇÕES) ========== */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: #c41e3a;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s;
}

.nav-arrow:hover {
    background: #8b1527;
}

.prev-arrow {
    left: 10px;
}

.next-arrow {
    right: 10px;
}

/* ========== SIDEBAR DE PERSONAGENS (1 personagem por vez, imagem grande) ========== */
.sidebar-panel {
    flex: 0 0 320px;
    height: 500px;
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
}

.sidebar-title {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    color: #c41e3a;
    text-align: center;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.chars-wrapper {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.chars-display {
    display: flex;
    flex-direction: column;
    transition: transform 0.5s ease;
    height: 100%;
}

/* ========== CARDS DE PERSONAGENS (1 por vez, imagem em destaque) ========== */
.char-card {
    flex: 0 0 100%;
    width: 100%;
    min-height: 0;
}

.char-card-link {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 0;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #444;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
    overflow: hidden;
}

.char-card:hover .char-card-link {
    background: rgba(0, 0, 0, 0.85);
    border-color: var(--accent-imperium);
    box-shadow: 0 0 20px rgba(196, 30, 58, 0.25);
}

/* Imagem grande no topo do card */
.char-card .char-img-box {
    flex: 1;
    min-height: 0;
    width: 100%;
    margin-right: 0;
    border-radius: 8px 8px 0 0;
    border: none;
    overflow: hidden;
}

.char-card .char-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 0.4s ease;
}

.char-card:hover .char-img-box img {
    transform: scale(1.03);
}

/* Nome e descrição embaixo da imagem */
.char-card .char-info {
    flex-shrink: 0;
    padding: 12px 10px;
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    border-top: 1px solid #333;
}

.char-info h4 {
    font-size: 1rem;
    color: #fff;
    font-family: 'Cinzel', serif;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.char-info p {
    font-size: 0.8rem;
    color: #aaa;
}

/* ========== SETAS DE NAVEGAÇÃO (PERSONAGENS) ========== */
.side-arrow {
    width: 100%;
    height: 35px;
    background: #c41e3a;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    flex-shrink: 0;
    transition: background 0.3s;
}

.side-arrow:hover {
    background: #8b1527;
}

.up-arrow {
    margin-bottom: 10px;
    border-radius: 5px 5px 0 0;
}

.down-arrow {
    margin-top: 10px;
    border-radius: 0 0 5px 5px;
}

/* ========== SEÇÃO SOBRE ========== */
#sobre {
    padding: 60px 20px;
}

.about-box {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px;
    display: flex;
    align-items: center;
    gap: 30px;
}

.about-logo {
    width: 150px;
    height: 150px;
    object-fit: contain;
    border-radius: 10px;
}

.about-text h2 {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    color: #c41e3a;
    margin-bottom: 15px;
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #ddd;
    margin-bottom: 20px;
}

.gw-link {
    display: inline-block;
    color: #c41e3a;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s;
}

.gw-link:hover {
    color: #fff;
}

/* ========== CONFIGURAÇÕES MAPA ========== */

.mapa-imagem {
    margin-top: 40px;
    margin-bottom: 30px;
    width: 75%;
    max-width: 900px;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
    border: 6px solid #4a4a5a;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

/* ========== FOOTER ========== */
footer {
    text-align: center;
    padding: 30px;
    background: rgba(0, 0, 0, 0.8);
    border-top: 2px solid #c41e3a;
    margin-top: 60px;
}

footer p {
    color: #aaa;
    font-size: 0.9rem;
}

/* ========== AJUSTES PARA MOBILE ========== */
@media (max-width: 768px) {

    /* Navbar mais compacta e empilhada */
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px 20px;
    }

    .nav-links {
        gap: 15px;
        margin-top: 10px;
        flex-wrap: wrap;
    }

    /* Título de seção menor */
    .section-title {
        font-size: 2.2rem;
        margin-bottom: 40px;
    }

    /* Layout geral: painel + sidebar em coluna */
    .layout-container {
        flex-direction: column;
        align-items: stretch;
    }

    .main-panel {
        width: 100%;
        height: auto;
        /* deixa a altura crescer conforme o conteúdo */
        padding: 20px;
    }

    /* Em mobile, cada página de facção vira 1 coluna só */
    .faction-page {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 15px;
    }

    .faction-card {
        max-width: 100%;
        aspect-ratio: 16/9;
        /* um pouco mais alto pra caber melhor */
    }

    /* Sidebar vem depois, largura total, altura fixa para o carrossel de 1 personagem */
    .sidebar-panel {
        flex: 0 0 auto;
        width: 100%;
        height: 420px;
        margin-top: 20px;
    }

    /* Caixa "Sobre o Projeto" empilhada */
    .about-box {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }

    .about-logo {
        width: 120px;
        height: 120px;
    }

    .historia-panel {
        padding: 20px;
        margin: 40px 10px;
    }

    .historia-panel p {
        font-size: 1.1rem;
    }
}