/* --- Variáveis Globais e Configuração Base --- */
:root {
    --primary-color: #4f46e5;
    --primary-light: #c7d2fe;
    --correct-color: #16a34a;
    --incorrect-color: #dc2626;
    --bg-color: #111827;
    --card-bg-color: #1f2937;
    --text-color: #f9fafb;
    --muted-text-color: #9ca3af;
    --border-color: #374151;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* --- Container Principal --- */
.quiz-container {
    width: 100%;
    max-width: 1500px;
    background-color: var(--card-bg-color);
    border-radius: 20px;
    padding: clamp(20px, 5vw, 40px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.screen {
    text-align: center;
}

.hidden {
    display: none;
}

/* --- Botões --- */
.btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    margin-top: 20px;
}

.btn:hover {
    background-color: #4338ca;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--border-color);
    color: var(--muted-text-color);
}
.btn-secondary:hover {
    background-color: var(--border-color);
    color: var(--text-color);
}


/* --- Tela de Categorias --- */
#category-screen h1 {
    font-size: clamp(2em, 5vw, 3em);
    margin-bottom: 15px;
}
#category-screen p {
    font-size: 1.2em;
    color: var(--muted-text-color);
    max-width: 600px;
    margin: 0 auto 40px;
}

.category-grid {
    display: grid;
    /* AJUSTE: Cards menores para caberem mais */
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.category-card {
    background-color: var(--border-color);
    border: 2px solid transparent;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}
.category-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
}
.category-card h2 {
    font-size: 1.2em; /* AJUSTE: Fonte um pouco menor */
    margin-bottom: 8px;
    color: var(--text-color);
}
.category-card p {
    font-size: 0.9em;
    color: var(--muted-text-color);
}

/* --- Tela do Quiz --- */
.quiz-header {
    margin-bottom: 30px;
}
#progress-text {
    font-size: 1em;
    font-weight: 600;
    color: var(--muted-text-color);
    margin-bottom: 10px;
}
.progress-bar-container {
    width: 100%;
    height: 10px;
    background-color: var(--border-color);
    border-radius: 5px;
}
#progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--primary-color);
    border-radius: 5px;
    transition: width 0.3s ease-in-out;
}
#question-text {
    font-size: clamp(1.5em, 4vw, 2.2em);
    margin-bottom: 40px;
    min-height: 60px;
}
.options-grid {
    display: grid;
    /* AJUSTE: Cards menores para caberem mais */
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}
.option-card {
    background-color: var(--border-color);
    border: 2px solid transparent;
    border-radius: 15px;
    padding: 20px; /* AJUSTE: Padding menor */
    font-size: 1.1em; /* AJUSTE: Fonte um pouco menor */
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80px; /* AJUSTE: Altura mínima menor */
}
.option-card:hover {
    border-color: var(--primary-color);
    transform: scale(1.03);
}
.option-card.correct {
    background-color: var(--correct-color);
    border-color: var(--correct-color);
    color: white;
    transform: scale(1.05);
}
.option-card.incorrect {
    background-color: var(--incorrect-color);
    border-color: var(--incorrect-color);
    color: white;
    animation: shake 0.5s;
}
.option-card.disabled {
    pointer-events: none;
    opacity: 0.7;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* --- Tela de Resultados --- */
#result-summary {
    border: 2px solid var(--primary-color);
    background-color: rgba(79, 70, 229, 0.1);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 20px;
}

#results-screen h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}
#final-score {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 15px;
}
#result-message {
    font-size: 1.1em;
}

/* --- Media Queries --- */
@media (max-width: 600px) {
    .options-grid, .category-grid {
        grid-template-columns: 1fr;
    }
    #question-text {
        font-size: 1.3em;
    }
}