/* Variáveis de cores para facilitar mudanças */
:root {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-main: #f0f0f0;
    --text-muted: #a0a0a0;
    --accent-color: #e6b800; /* Dourado estilo "tesouro" */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
}

/* --- CABEÇALHO E PESQUISA --- */
header {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('https://i.imgur.com/example-ocean-bg.jpg') center/cover;
    padding: 3rem 1rem;
    text-align: center;
    border-bottom: 3px solid var(--accent-color);
}

header h1 {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.search-bar {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 10px;
}

.input-wrapper {
    position: relative;
    width: 100%;
    max-width: 300px;
}

.input-wrapper input {
    padding: 10px 15px;
    font-size: 1rem;
    border: none;
    border-radius: 5px;
    width: 100%;
}

.search-bar button {
    padding: 10px 20px;
    font-size: 1rem;
    background-color: var(--accent-color);
    color: #000;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s;
}

.search-bar button:hover {
    transform: scale(1.05);
}

/* --- SUGESTÕES DE PESQUISA (AUTOCOMPLETAR) --- */
.suggestions-list {
    position: absolute;
    top: 100%; 
    left: 0;
    width: 100%; 
    background-color: var(--card-bg);
    border: 1px solid var(--accent-color);
    border-top: none;
    border-radius: 0 0 5px 5px;
    max-height: 250px;
    overflow-y: auto;
    list-style: none;
    z-index: 1001; 
    display: none; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.8);
    margin-top: 2px;
}

.suggestions-list li {
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    border-bottom: 1px solid #333;
    transition: background-color 0.2s;
    text-align: left;
}

.suggestions-list li:hover {
    background-color: #333;
}

.suggestions-list li img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top;
}

.suggestions-list li span {
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: bold;
}

/* --- GRELHA PRINCIPAL (CARTÕES) --- */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

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

.card {
    background-color: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
    cursor: pointer; /* Juntei isto aqui! */
}

.card:hover {
    transform: translateY(-5px);
    border: 1px solid var(--accent-color);
}

.card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    object-position: top;
}

.card-info {
    padding: 15px;
}

.card-info h2 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--accent-color);
}

.card-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* --- JANELA MODAL (DETALHES DA PERSONAGEM) --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    overflow: auto;
}

.modal-content {
    background-color: var(--card-bg);
    margin: 5% auto;
    padding: 30px;
    border: 2px solid var(--accent-color);
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    position: relative;
    box-shadow: 0 0 20px rgba(230, 184, 0, 0.2);
}

.close-btn {
    color: var(--text-muted);
    float: right;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: red;
}

.modal-header {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.modal-header img {
    max-width: 250px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

.modal-header h2 {
    color: var(--accent-color);
    font-size: 2rem;
    margin-bottom: 10px;
}

.history-text {
    white-space: pre-line;
    line-height: 1.7;
    color: var(--text-main);
    font-size: 1.05rem;
}

/* --- RODAPÉ --- */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    margin-top: 2rem;
}