body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: #f4f4f4;
    color: #333;
}

.container {
    background-color: #fff;
    padding: 30px 40px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 600px;
    width: 90%;
}

h1 {
    color: #4CAF50;
    margin-bottom: 30px;
    font-size: 2.2em;
}

/* Telas (Menu, Jogo, Fim) */
.screen {
    display: none; /* Esconde todas as telas por padrão */
}

.screen.active {
    display: block; /* Mostra a tela ativa */
}

/* --- Menu Principal Estilos --- */
#main-menu h2 {
    color: #333;
    margin-bottom: 25px;
}

.difficulty-options button {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    cursor: pointer;
    margin: 5px;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.difficulty-options button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.difficulty-options button.selected {
    background-color: #28a745; /* Cor para dificuldade selecionada */
    border: 2px solid #218838;
}

#start-game-button {
    background-color: #4CAF50;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.4em;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

#start-game-button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

/* Estilo para a área dos botões de reset */
.reset-options {
    margin-top: 25px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.reset-button {
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    margin: 8px 10px;
    transition: background-color 0.3s ease;
}

#reset-progress-button {
    background-color: #ffc107; /* Amarelo */
    color: #333;
}

#reset-progress-button:hover {
    background-color: #e0a800;
}

#reset-highscore-button.danger {
    background-color: #f44336; /* Vermelho */
}

#reset-highscore-button.danger:hover {
    background-color: #d32f2f;
}


/* --- Área do Jogo Estilos --- */
#game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

#scoreboard-progress {
    display: flex;
    gap: 20px;
    align-items: center;
}

#exit-game-button {
    background-color: #6c757d;
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

#exit-game-button:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}


#score {
    font-size: 1.5em;
    font-weight: bold;
    color: #4CAF50;
}

#time-left {
    font-size: 1.5em;
    font-weight: bold;
    color: #FF5722;
}

/* Barra de Progresso da Dificuldade */
#difficulty-progress-bar {
    width: 100%;
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    margin-bottom: 20px;
    overflow: hidden;
}

#difficulty-progress-fill {
    height: 100%;
    width: 0%; /* Controlado pelo JS */
    background-color: #4CAF50; /* Cor de preenchimento */
    border-radius: 5px;
    transition: width 0.3s ease-out;
}


/* Mapa de Multiplicação */
#multiplication-map-container {
    position: relative; /* Container para o tooltip */
    margin-bottom: 25px;
}

#multiplication-map {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.map-item {
    width: 45px;
    height: 45px;
    background-color: #ccc;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: white;
    font-size: 1.1em;
    border: 2px solid #bbb;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    cursor: pointer; /* Indica que é clicável */
    user-select: none; /* Impede a seleção de texto ao clicar */
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.1s ease;
}

.map-item:hover {
    transform: scale(1.1);
}

/* Cores do mapa */
.map-item.gray { background-color: #ccc; border-color: #bbb; }
.map-item.green { background-color: #28a745; border-color: #218838; }
.map-item.yellow { background-color: #ffc107; border-color: #e0a800; }
.map-item.red { background-color: #dc3545; border-color: #c82333; }

/* Tooltip do Mapa */
#map-tooltip {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9em;
    pointer-events: none; /* Não interfere com o mouse */
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
    white-space: nowrap; /* Impede quebra de linha */
    visibility: hidden; /* Começa escondido para medição */
}

#map-tooltip.show {
    opacity: 1;
    visibility: visible;
}


#question {
    font-size: 1.8em;
    margin-bottom: 25px;
    color: #555;
    font-weight: bold;
}

#answer-input {
    padding: 12px 15px;
    font-size: 1.2em;
    width: calc(100% - 30px);
    margin-bottom: 20px;
    border: 2px solid #ddd;
    border-radius: 5px;
    transition: border-color 0.3s ease;
}

#answer-input:focus {
    border-color: #4CAF50;
    outline: none;
}

#action-button {
    background-color: #4CAF50;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    min-width: 150px;
}

#action-button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

#action-button:active {
    transform: translateY(0);
}

#action-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
}

#feedback {
    margin-top: 20px;
    font-size: 1.2em;
    min-height: 25px;
}

.correct {
    color: #28a745;
}

.incorrect {
    color: #dc3545;
}

/* --- Tela de Fim de Jogo Estilos --- */
#end-screen h2 {
    color: #4CAF50;
    margin-bottom: 20px;
}

#end-message {
    font-size: 1.3em;
    color: #555;
    margin-bottom: 15px;
}

#end-score-details {
    margin-bottom: 25px;
    font-size: 1.1em;
}

#end-score-details p {
    margin: 8px 0;
}

#end-score-details .final-score {
    font-size: 1.4em;
    font-weight: bold;
    color: #007bff;
}

#end-score-details .high-score {
    font-size: 1.2em;
    font-weight: bold;
}


#next-difficulty-button, #back-to-menu-button {
    background-color: #007bff;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 1.2em;
    cursor: pointer;
    margin: 10px;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

#next-difficulty-button:hover, #back-to-menu-button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.hidden {
    display: none !important;
}

