/* Reset básico e configurações globais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1a1a1a; /* Fundo escuro */
    color: #f0f0f0; /* Texto claro */
    line-height: 1.6;
}

/* Configuração da Fonte de Ícones Local */
@font-face {
    font-family: 'Material Symbols';
    src: url('fonts/googlefonts.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

.icon {
    font-family: 'Material Symbols';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    display: inline-block;
    line-height: 1;
    text-transform: none;
    vertical-align: middle;
    margin-right: 8px;
    -webkit-font-smoothing: antialiased;
}

/* Cabeçalho */
header {
    background-color: #2c2c2c;
    padding: 3rem 1rem;
    text-align: center;
    border-bottom: 4px solid #e74c3c; /* Detalhe em vermelho/laranja */
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* Navbar e Botão Voltar (Específico para páginas internas) */
.navbar {
    /* position: relative; removido pois não usamos mais absoluto dentro dele */
    display: flex;
    justify-content: center; /* Centraliza o Logo */
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Nova barra de navegação superior (fora do header) */
.top-nav {
    padding: 1rem 0;
    width: 100%;
}

.navbar .site-logo {
    margin-bottom: 0; /* Remove margem extra quando estiver na navbar */
}

.back-link {
    position: static; /* Removemos o absolute para ele ocupar seu próprio espaço */
    display: inline-flex;
    align-items: center;
    background-color: #3a3a3a;
    color: #f0f0f0;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid #555;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.back-link:hover {
    background-color: #e74c3c;
    border-color: #e74c3c;
    color: #fff;
    transform: translateX(-3px);
}

.site-logo {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.2;
}

@media (max-width: 600px) {
    .site-logo {
        font-size: 1.8rem; /* Diminui a fonte no celular para não quebrar linha */
    }
}

header p {
    font-size: 1.1rem;
    color: #bdc3c7;
}

/* Layout Principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Grid de Personagens */
.character-list,
.adventure-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding-bottom: 3rem;
}

/* Card do Personagem */
.character-card,
.adventure-card {
    background-color: #2c2c2c;
    border-radius: 8px;
    padding: 0; /* Remove padding para a imagem encostar na borda */
    border: 1px solid #333;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
    display: block; /* Garante comportamento de bloco para o link */
    text-decoration: none; /* Remove sublinhado do link */
}

/* Efeito Hover */
.character-card:hover,
.adventure-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.5);
    border-color: #e74c3c;
}

/* Títulos */
.character-card .card-title,
.adventure-card .card-title {
    color: #e74c3c;
    font-size: 1.4rem;
    font-weight: bold;
    display: block;
    margin-bottom: 0.8rem;
    transition: color 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center; /* Centraliza o texto na página inicial */
}

.character-card:hover .card-title,
.adventure-card:hover .card-title {
    color: #ff6b6b;
}

/* Textos descritivos */
.character-card p,
.adventure-card p {
    font-size: 0.95rem;
    color: #aaaaaa;
    margin-top: 0.5rem;
    line-height: 1.5;
    text-align: center; /* Centraliza a descrição também */
}

/* Imagens */
.card-img {
    width: 100%;
    height: auto;
    display: block;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    /* Remove margin-bottom antiga pois agora temos padding no conteudo */
}

/* Container para o texto dentro do card (para dar espaçamento após remover padding geral) */
.card-content {
    padding: 1.5rem;
}

/* --- Estilos da Página de Personagem (Ignara) --- */

/* Hero Section (Topo com Imagem e Nome) */
.profile-header {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 2rem;
    margin-bottom: 3rem;
}

.profile-info {
    text-align: right; /* Alinha o texto à direita para balancear com o botão voltar */
}

@media (min-width: 768px) {
    .profile-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }
    .profile-info {
        flex: 1;
        padding-top: 0;
        margin-left: auto; /* Empurra para a direita */
    }
}

.character-name {
    font-size: 2.2rem; /* Tamanho reduzido para o cabeçalho */
    color: #e74c3c;
    margin-bottom: 0.2rem;
    line-height: 1.1;
}

.character-class {
    font-size: 1.1rem; /* Tamanho reduzido */
    color: #bdc3c7;
    margin-bottom: 0.5rem;
    font-weight: 300;
}

/* Tratamento da Imagem com Transparência */
.character-img-container {
    position: relative;
    width: 100%;
    max-width: 300px; /* Tamanho ideal para mobile */
    margin: 0 auto;
}

@media (min-width: 768px) {
    .character-img-container {
        max-width: 450px; /* Maior em computadores para preencher o espaço */
        margin: 0 auto;
    }
}

.character-img {
    width: 100%;
    height: auto;
    /* Drop shadow colorido para destacar a transparência no fundo escuro */
    filter: drop-shadow(0 0 20px rgba(231, 76, 60, 0.3));
    transition: filter 0.3s ease;
}

.character-img:hover {
    filter: drop-shadow(0 0 30px rgba(231, 76, 60, 0.6));
}

/* Navegação por Abas */
.tabs-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #333;
    padding-bottom: 1rem;
    flex-wrap: wrap;
}

.tab-btn {
    background: transparent;
    border: none;
    color: #888;
    font-size: 1.1rem;
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    font-family: inherit;
}

.tab-btn:hover {
    background-color: #2c2c2c;
    color: #fff;
}

.tab-btn.active {
    background-color: #e74c3c;
    color: #fff;
}

/* Conteúdo das Abas */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
    max-width: 900px; /* Limita a largura do conteúdo para não ficar esticado demais em monitores */
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Estilos da Linha do Tempo */
.timeline {
    position: relative;
    padding-left: 2rem;
    border-left: 2px solid #333;
    margin-left: 1rem;
}

.timeline-item {
    margin-bottom: 2rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.6rem;
    top: 0.4rem;
    width: 1rem;
    height: 1rem;
    background-color: #e74c3c;
    border-radius: 50%;
    border: 3px solid #1a1a1a;
}

.timeline-title {
    font-size: 1.2rem;
    color: #e74c3c;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.timeline-desc {
    background-color: #2c2c2c;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #333;
    color: #ccc;
}

.timeline-img {
    display: block;
    width: 100%;
    max-width: 700px; /* Aumentado para desktop, mas ainda limitado */
    height: auto;
    margin-top: 1rem;
    border-radius: 4px;
    border: 1px solid #444;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Placeholder do Diário */
.diary-placeholder {
    text-align: center;
    padding: 4rem 2rem;
    border: 2px dashed #333;
    border-radius: 12px;
    color: #666;
}

.diary-placeholder .icon {
    font-size: 48px;
    display: block;
    margin: 0 auto 1rem auto;
    color: #444;
}

/* Estilos para as Entradas do Diário */
.diary-entry {
    background-color: #2c2c2c;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #333;
    margin-bottom: 1.5rem;
}

.diary-entry h3 {
    color: #e74c3c;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.diary-entry p {
    color: #ccc;
}

/* Estilos para a aba Características */
.traits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.trait-card {
    background-color: #2c2c2c;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #e74c3c;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.trait-title {
    color: #e74c3c;
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* Estilização Moderna para a Aba História */
#history article {
    line-height: 1.9; /* Aumenta o espaçamento entre linhas para leitura confortável */
    font-size: 1.05rem;
    color: #e0e0e0;
}

#history article h2 {
    margin-top: 3.5rem; /* Espaço generoso antes dos títulos */
    margin-bottom: 1.2rem;
    font-size: 1.8rem;
    color: #e74c3c;
    letter-spacing: -0.5px;
}

#history article p {
    margin-bottom: 1.8rem; /* Espaçamento claro entre parágrafos */
}

/* --- Estilos Específicos para The Gorge (Operativos) --- */
.operatives-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.operative-card {
    background-color: #333;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #444;
}

.operative-card img {
    width: 100%;
    height: 300px; /* Altura fixa para manter uniformidade */
    object-fit: cover;
    object-position: top;
    display: block;
}

.operative-info {
    padding: 1.2rem;
}

.operative-info strong {
    color: #e74c3c;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* --- Estilos para a Seção de Sistema (The Gorge) --- */
.system-info {
    background-color: #2c2c2c;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid #333;
    margin-top: 2rem; /* Espaço entre a descrição da aventura e esta seção */
}

.system-info .section-title {
    text-align: center;
    font-size: 1.8rem;
    color: #e74c3c;
    margin-bottom: 2rem;
    border-bottom: 2px solid #444;
    padding-bottom: 1rem;
}

.system-section h4 {
    color: #e74c3c;
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.system-section > ul {
    list-style: none; /* Remove marcadores padrão */
    padding-left: 0;
    color: #ccc;
    line-height: 1.8;
}

.system-section > ul > li {
    margin-bottom: 0.75rem;
    background-color: #333;
    padding: 0.8rem 1.2rem;
    border-radius: 4px;
    border-left: 3px solid #e74c3c;
}

.system-section > ul > li strong {
    color: #f0f0f0;
}

.section-divider {
    border: 0;
    height: 1px;
    background-color: #444;
    margin: 2.5rem 0;
}

.character-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.character-stat-card {
    background-color: #333;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #444;
}

.character-stat-card h5 {
    color: #e74c3c;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.character-stat-card ul {
    list-style: none;
    padding: 0;
    color: #ccc;
    line-height: 1.7;
}

.character-stat-card ul li {
    margin-bottom: 0.5rem;
}

.character-stat-card ul li strong {
    color: #f0f0f0;
}