:root {
    --bg: #1a1a2e;
    --bg-card: #16213e;
    --bg-header: #0f3460;
    --text: #e0e0e0;
    --text-muted: #a0a0a0;
    --accent: #e94560;
    --gold: #ffd700;
    --border: #2a2a4a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

header {
    background: var(--bg-header);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

header nav a {
    color: var(--text);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
}

main { max-width: 1200px; margin: 0 auto; padding: 2rem; }

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

footer a { color: var(--accent); }
h1 { margin-bottom: 0.5rem; }
h2 { margin: 1.5rem 0 1rem; color: var(--gold); }

.filters { display: flex; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }

.filters select {
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.card img { width: 100%; aspect-ratio: 1; object-fit: cover; }

.card-info { padding: 0.75rem; display: flex; flex-direction: column; gap: 0.25rem; }
.card-name { font-weight: 600; font-size: 0.9rem; }
.card-stars { color: var(--gold); font-size: 0.8rem; }
.card-element { font-size: 0.75rem; }

.elemento-pyro { color: #ef7938; }
.elemento-hydro { color: #4cc2f1; }
.elemento-anemo { color: #74c2a8; }
.elemento-electro { color: #af8ec1; }
.elemento-dendro { color: #a0c84e; }
.elemento-cryo { color: #9fd6e3; }
.elemento-geo { color: #f0b232; }

.personagem-header { display: flex; gap: 2rem; align-items: flex-start; margin-bottom: 2rem; }
.avatar-icon { width: 160px; height: 160px; border-radius: 16px; border: 2px solid var(--border); }
.personagem-info { flex: 1; }
.titulo { color: var(--text-muted); font-style: italic; margin-bottom: 0.75rem; }
.tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }

.tag {
    padding: 0.25rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
}

.descricao { color: var(--text-muted); line-height: 1.6; }

.dubladores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.dubladores-grid div {
    background: var(--bg-card);
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dubladores-grid strong { color: var(--gold); font-size: 0.8rem; }

.talentos-grid, .constelacoes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.talento-card, .constelacao-card {
    display: flex;
    gap: 1rem;
    align-items: center;
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: border-color 0.2s;
}

.talento-card:hover, .constelacao-card:hover {
    border-color: var(--gold);
}

.talento-card img, .constelacao-card img { width: 56px; height: 56px; border-radius: 8px; }
.talento-tipo { font-size: 0.8rem; color: var(--text-muted); }
.namecard img { max-width: 100%; border-radius: 12px; border: 1px solid var(--border); }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover { color: var(--accent); }

.modal-header {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-right: 2rem;
}

.modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
}

.modal-title {
    color: var(--gold);
    margin: 0;
    font-size: 1.3rem;
}

.modal-tipo {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.modal-body {
    color: var(--text);
    line-height: 1.8;
    font-size: 0.95rem;
}

.modal-body color { font-weight: 600; }

/* AdSense */
.ad-container {
    margin: 2rem 0;
    text-align: center;
    min-height: 90px;
}

@media (max-width: 640px) {
    .personagem-header { flex-direction: column; align-items: center; text-align: center; }
    .tags { justify-content: center; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}