/* Reseta margens e paddings de todos os elementos para evitar inconsistências */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Estilos básicos para o corpo da página */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #000000;
    color: #f1f5f9; 
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Container principal que centraliza o conteúdo do jogo */
.main-container {
    flex-grow: 1; /* Faz este container ocupar o espaço vertical disponível */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem 0; /* Adiciona um padding vertical para evitar que o conteúdo cole nas bordas */
}

/* Classe utilitária para esconder elementos */
.hidden {
    display: none !important;
}

/* Estilo unificado para as telas principais, incluindo as novas telas de reforço */
#tela-inicial, #tela-carregamento, #tela-jogo, #tela-ranking, 
#tela-desafio, #tela-reforco-serie, #tela-reforco-materia, #tela-reforco-tema {
    width: 90%;
    max-width: 600px; 
    padding: 2rem;
    background-color: #111111;
    border-radius: 12px;
    border: 1px solid #FFD700;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.2);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1rem; /* Adiciona um espaçamento padrão entre os elementos filhos */
}

/* ===== O BLOCO PROBLEMÁTICO FOI REMOVIDO DAQUI ===== */

#tela-inicial {
	align-items: center; 
}


/* --- TELA INICIAL --- */
#tela-inicial h1 {
    margin-bottom: 0.5rem;
    color: #cceeff;
    font-size: 2.5rem; /* Ajustado para melhor visualização em mobile */
    text-shadow: 0 0 5px #00bfff, 
                 0 0 10px #00bfff, 
                 0 0 20px #00bfff, 
                 0 0 40px #0077ff;
}
@media (max-width: 600px) {
    #tela-inicial h1 {
        font-size: 2rem; /* Menor em telas muito pequenas */
    }
}


#nome-jogador {
    width: 100%;
    padding: 0.8rem;
    margin-top: 1rem;
    margin-bottom: 1rem; /* Adicionado para espaçamento */
    border-radius: 8px;
    border: 1px solid #334155;
    background-color: #0f172a;
    color: #f1f5f9;
    font-size: 1rem;
}

.escolha-modo-titulo {
    color: #cbd5e1;
    margin-top: 1rem; /* Ajustado */
    font-size: 1.1rem;
    font-weight: bold;
}

.modo-container {
    display: flex;
    gap: 1.5rem;
    width: 100%;
}

.modo-card {
    flex: 1;
    padding: 1.5rem;
    border: 1px solid #334155;
    border-radius: 12px;
    background-color: #1e293b;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

.modo-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
    border-color: #FFD700;
}

.modo-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.modo-card h3 {
    font-size: 1.4rem;
    color: #f1f5f9;
    margin-bottom: 0.5rem;
}

.modo-card p {
    font-size: 0.9rem;
    color: #94a3b8;
    line-height: 1.4;
}

/* --- TELA DESAFIO (NOVA) --- */
#tela-desafio h2 {
    color: #cceeff;
    font-size: 2.2rem;
    text-shadow: 0 0 5px #00bfff, 0 0 10px #00bfff;
}

#tela-desafio p {
    color: #cbd5e1;
}

#nivel-dificuldade {
    width: 100%;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid #334155;
    background-color: #0f172a;
    color: #f1f5f9;
    font-size: 1rem;
}

#btn-comecar-desafio {
    width: 100%;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #FFFF80;
    background: linear-gradient(145deg, #FFD700, #FFA500);
    color: #202020;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

#btn-comecar-desafio:hover {
    transform: scale(1.02);
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.7);
}

#btn-hall-da-fama {
    width: 100%;
    padding: 0.8rem;
    border-radius: 8px;
    border: 2px solid #f59e0b;
    background-color: transparent;
    color: #f59e0b;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

#btn-hall-da-fama:hover {
    background-color: #f59e0b;
    color: #111;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}


/* --- TELAS DE SELEÇÃO (REFORÇO ESCOLAR) --- */
#tela-reforco-serie h2, #tela-reforco-materia h2, #tela-reforco-tema h2 {
    color: #cceeff;
    font-size: 2.2rem;
    text-shadow: 0 0 5px #00bfff, 0 0 10px #00bfff;
}
@media (max-width: 600px) {
    #tela-reforco-serie h2, #tela-reforco-materia h2, #tela-reforco-tema h2 {
        font-size: 1.8rem; /* Menor em telas muito pequenas */
    }
}


#tela-reforco-serie p, #tela-reforco-materia p, #tela-reforco-tema p {
    color: #cbd5e1;
}

#lista-series-reforco, #lista-materias-reforco, #lista-temas-reforco {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.btn-selecao {
    padding: 1.5rem;
    font-size: 1.1rem;
    font-weight: bold;
    color: #f1f5f9;
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.btn-selecao:hover {
    background-color: #334155;
    border-color: #0ea5e9;
    transform: scale(1.03);
}

.btn-voltar {
    width: 100%;
    padding: 0.8rem;
    border-radius: 8px;
    border: 2px solid #94a3b8;
    background-color: transparent;
    color: #94a3b8;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.btn-voltar:hover {
    background-color: #94a3b8;
    color: #111;
}


/* --- TELA DE CARREGAMENTO --- */
#tela-carregamento:not(.hidden) {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

.spinner {
    width: 80px;
    height: 80px;
    border: 8px solid #334155;
    border-top-color: #f59e0b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#tela-carregamento p {
    font-size: 1.2rem;
    color: #cbd5e1;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}


/* --- TELA DO JOGO --- */
.game-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid #FFD700;
    padding-bottom: 1.5rem;
    gap: 0.5rem;
}

.header-top-row {
    display: flex;
    justify-content: center;
    width: 100%;
}

.header-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.info-box {
    display: flex;
    flex-direction: column;
}

#premio-info-box {
    flex-direction: row;
    align-items: baseline;
    gap: 0.75rem;
}

#premio-info-box span:first-child {
    font-size: 1.1rem;
    color: #cbd5e1;
}

#premio-info-box span:last-child {
    font-size: 1.8rem;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.header-bottom-row .info-box:first-child {
    align-items: flex-start;
}

.header-bottom-row .info-box:last-child {
    align-items: flex-end;
}

.header-bottom-row .info-box span:first-child {
    font-size: 0.9rem;
    color: #94a3b8;
}

.header-bottom-row .info-box span:last-child {
    font-size: 1.2rem;
    font-weight: bold;
    color: #f1f5f9;
}

#game-timer {
    color: #cceeff !important; 
    text-shadow: 0 0 5px #00bfff;
}

.question-area {
    /* O main dentro da tela de jogo já tem essa classe */
}

#materia-pergunta {
    color: #f59e0b;
    font-weight: bold;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 2rem !important; /* Aumentado para garantir espaço consistente */
    border: none;
    padding: 0;
    background-color: transparent;
}

.question-area h2 {
    font-size: 1.3rem;
    line-height: 1.6;
    text-align: center;
    margin-top: 0.5rem;
    margin-bottom: 2rem;
    padding-top: 0.5rem; /* Espaço extra entre matéria e pergunta */
    word-break: break-word;
}

#opcoes-resposta {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.opcao {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    text-align: left;
    background-color: #1e293b;
    border: 1px solid #334155;
    color: #f1f5f9;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.opcao:hover {
    background-color: #334155;
    border-color: #f59e0b;
}

.opcao.selecionada {
    background-color: #f59e0b;
    color: #1e293b;
    font-weight: bold;
    border-color: #FFFF80;
}

.opcao.correta {
    background-color: #16a34a;
    border-color: #4ade80;
    color: #fff;
}

.opcao.errada {
    background-color: #dc2626;
    border-color: #f87171;
    color: #fff;
}

.opcao.eliminada {
    background-color: #4a4a4a;
    border-color: #666666;
    color: #999999;
    text-decoration: line-through;
    cursor: not-allowed;
    opacity: 0.7;
}

.game-footer {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#btn-confirmar {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    font-weight: bold;
    color: #ffffff;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
    background: linear-gradient(145deg, #16a34a, #15803d); 
    border: 2px solid #22c55e;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.5);
}

#btn-confirmar:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 0 25px rgba(34, 197, 94, 0.8);
}

.help-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.help-actions button {
    flex: 1;
    padding: 0.8rem;
    font-size: 1rem;
    font-weight: bold;
    color: #f1f5f9;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

#btn-pular, #btn-eliminar-respostas {
    background: linear-gradient(145deg, #0284c7, #0369a1);
    border: 2px solid #0ea5e9;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.6);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

#btn-pular:hover:not(:disabled),
#btn-eliminar-respostas:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(14, 165, 233, 0.9);
}

#btn-ajuda-ia {
    background: linear-gradient(145deg, #8B5CF6, #6D28D9); 
    border: 2px solid #A78BFA;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.6);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

#btn-ajuda-ia:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.9);
}

.game-footer button:disabled {
    background: #333 !important;
    border-color: #555 !important;
    color: #777 !important;
    cursor: not-allowed;
    box-shadow: none !important;
    text-shadow: none !important;
    transform: none !important;
}

.game-footer button:not(:disabled):active {
    transform: scale(0.98) !important;
}

/* --- TELA DE RANKING --- */
#tela-ranking h2 {
    color: #cceeff;
    font-size: 2.8rem;
    text-shadow: 0 0 5px #00bfff, 0 0 10px #00bfff, 0 0 20px #00bfff;
    margin-bottom: 0.5rem;
}
@media (max-width: 600px) {
    #tela-ranking h2 {
        font-size: 2.2rem; /* Menor em telas muito pequenas */
    }
}


#tela-ranking p {
    color: #cbd5e1;
    margin-bottom: 2rem;
}

#ranking-difficulty-select {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    border: 1px solid #334155;
    background-color: #0f172a;
    color: #f1f5f9;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
}

#ranking-list-container {
    list-style: none;
    padding: 0;
    width: 100%;
    max-height: 40vh;
    overflow-y: auto;
    text-align: left;
}

#ranking-list-container ol,
#ranking-list-container ul {
    list-style: none;
    padding: 0;
    width: 100%;
}

.ranking-item {
    display: flex;
    padding: 0.8rem 1rem;
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    visibility: hidden;
    animation: slideUpFadeIn 0.6s ease-out forwards;
}

@keyframes slideUpFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
        visibility: visible;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        visibility: visible;
    }
}

.ranking-item:hover {
    background-color: #334155;
}

.rank-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.25rem;
}

.rank-main-info {
    display: flex;
    align-items: center;
    width: 100%;
}

.rank-secondary-info {
    font-size: 0.8rem;
    color: #94a3b8;
    text-align: left;
    padding-left: 3.4rem;
}

.player-rank {
    font-size: 1.2rem;
    font-weight: bold;
    color: #94a3b8;
    min-width: 2.4rem;
    text-align: center;
    margin-right: 1rem;
}

.player-name {
    font-weight: bold;
    font-size: 1.1rem;
    flex-grow: 1;
    text-align: left;
}

.player-score {
    color: #f59e0b;
    font-weight: bold;
    font-size: 1.1rem;
}

.ranking-separator {
    height: 2px;
    width: 80%;
    margin: 1.5rem auto;
    background: linear-gradient(to right, transparent, #FFD700, transparent);
    opacity: 0.6;
}

.user-highlight {
    border: 2px solid #FFD700;
    background-color: #334155;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    transform: scale(1.02);
}

#btn-voltar-ranking {
    width: 100%;
    padding: 1rem;
    margin-top: 1.5rem;
    border-radius: 8px;
    border: 2px solid #94a3b8;
    background-color: transparent;
    color: #94a3b8;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

#btn-voltar-ranking:hover {
    background-color: #94a3b8;
    color: #111;
}

/* --- POP-UPS --- */
.popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background-color: #111111;
    border: 1px solid #FFD700;
    border-radius: 12px;
    padding: 2rem;
    max-width: 450px;
    width: 90%; /* Ajustado para melhor responsividade em telas menores */
    text-align: center;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.4);
    position: relative;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

#game-over-popup h3 {
    color: #FF6347;
    font-size: 2.2rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 8px #FF6347;
}

#game-over-popup p {
    color: #cbd5e1;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

#game-over-popup #game-over-score {
    color: #FFD700;
    font-weight: bold;
    font-size: 1.3rem;
}

#game-over-popup #game-over-ranking {
    font-size: 1.1rem;
    color: #FFD700;
    font-weight: bold;
    margin-top: 0.5rem;
    text-shadow: 0 0 4px rgba(255, 215, 0, 0.6);
}

/* Novo estilo para a seção de doação dentro do game-over-popup */
.donation-section {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #475569;
    text-align: center;
}
.pix-qrcode-img {
    max-width: 150px;
    margin: 0 auto; /* Isso centraliza horizontalmente */
    display: block;
    width: 100%; 
    height: auto;
    margin-top: 1.5rem; 
    margin-bottom: 1.5rem; 
}

#game-over-popup #btn-end-game {
    width: 80%;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid #ef4444;
    background-color: transparent;
    color: #ef4444;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    margin-top: 1rem;
}

#game-over-popup #btn-end-game:hover {
    background-color: #ef4444;
    color: #fff;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

#btn-close-ai-popup {
    width: 60%;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid #0ea5e9;
    background: linear-gradient(145deg, #0284c7, #0369a1);
    color: #fff;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.5);
}

#btn-close-ai-popup:hover {
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.8);
}


/* --- RODAPÉ PRINCIPAL DO SITE (ORGANIZADO E FINAL) --- */
.site-footer {
    padding: 1rem;
    text-align: center;
    width: 100%;
}

.site-footer p {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem; /* Espaço entre os elementos */
    color: #94a3b8;
    font-size: 0.8rem;
}

.site-footer .separator {
    color: #4A5568; /* Cinza mais escuro para o separador */
}

.site-footer a {
    color: #FFD700; /* Dourado */
    text-decoration: none;
    font-weight: bold;
    transition: all 0.2s ease-in-out;
}

.site-footer a:hover {
    text-decoration: none;
    color: #FFF; /* Branco ao passar o mouse */
}

.site-footer .fa-instagram {
    margin-left: 4px;
    font-size: 1.1rem; /* Ícone um pouco maior */
    transition: transform 0.2s ease-in-out;
}

.site-footer a:hover .fa-instagram {
    transform: scale(1.2); /* Efeito de zoom no ícone */
}
/* Estilos para o rodapé e modo container em telas menores */
@media (max-width: 600px) {
    .modo-container {
        flex-direction: column;
    }

    .site-footer p {
        flex-direction: column; /* Coloca os itens em coluna */
        align-items: center; /* Centraliza os itens */
        gap: 0.2rem; /* Reduz o espaçamento entre as linhas */
    }

    .site-footer .separator {
        display: none; /* Oculta o separador em telas pequenas */
    }

    .site-footer span {
        display: block; /* Faz cada span ocupar uma linha inteira */
        text-align: center; /* Centraliza o texto de cada linha */
    }

    .site-footer a {
        display: inline-flex; /* Alinha o nome e o ícone na mesma linha */
        align-items: center;
        gap: 0.3rem;
    }
}
/* --- Estilos para o novo Popup de Explicação --- */
#btn-close-explanation {
    width: 60%;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid #0ea5e9;
    background: linear-gradient(145deg, #0284c7, #0369a1);
    color: #fff;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.5);
}

#btn-close-explanation:hover {
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.8);
}
/* --- ESTILOS PARA O NOVO ACCORDION --- */

.accordion-container {
    width: 100%;
    margin-top: 1rem;
}

.accordion-item + .accordion-item {
    border-top: 1px solid #334155;
}

.accordion-header {
    width: 100%;
    background-color: transparent;
    border: none;
    color: #f1f5f9;
    padding: 1rem 0.5rem;
    font-size: 1.2rem;
    font-weight: bold;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.accordion-header i {
    transition: transform 0.3s ease-in-out;
}

.accordion-header.active i {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
    background-color: rgba(0, 0, 0, 0.2);
}

.accordion-content .btn-grid {
    display: grid;
    /* Por padrão (telas pequenas/celular), usamos 1 coluna */
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.5rem;
}

/* Quando a tela tiver no mínimo 768px de largura (tablets e desktops), 
   a regra abaixo será aplicada, sobrepondo a de cima. */
@media (min-width: 768px) {
    .accordion-content .btn-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
/* --- Estilos para o novo Popup de Alerta de Nome --- */
#btn-close-name-alert {
    width: 60%;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid #f59e0b;
    background-color: #f59e0b;
    color: #111;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

#btn-close-name-alert:hover {
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.8);
}

/* Estilo para a chave PIX clicável */
.chave-pix-copiavel {
    cursor: pointer;
    text-decoration: underline; /* Sugere clicabilidade */
    color: #f59e0b; /* Uma cor que se destaque */
    font-weight: bold;
    transition: color 0.2s ease-in-out;
}

.chave-pix-copiavel:hover {
    color: #ffd700; /* Um pouco mais claro no hover */
}

/* Estilo para a mensagem de copiado */
.copy-message {
    display: inline-block; /* Para que margin e padding funcionem */
    margin-top: 0.5rem;
    padding: 0.3rem 0.8rem;
    background-color: #16a34a; /* Verde para sucesso */
    color: #fff;
    border-radius: 5px;
    font-size: 0.85rem;
    opacity: 0; /* Começa invisível */
    transition: opacity 0.3s ease-in-out;
}

.copy-message.show {
    opacity: 1; /* Torna visível */
}