body {
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f0f0f0;
    margin: 0;
    color: #333;
    text-align: center;
}

#game-container {
    position: relative; /* Añadido para posicionar el botón de volver */
    background-color: #fff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 600px;
}

#range-selection-container {
    background-color: #fff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative; /* Añadido para posicionar el botón de volver */
}

h1 {
    color: #007bff;
    margin-bottom: 20px;
}

button {
    background-color: #007bff;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin: 5px;
}

button:hover {
    background-color: #0056b3;
}

#back-to-ranges-button {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 5px 10px;
    font-size: 0.8em;
    background-color: #6c757d;
    color: white;
    border-radius: 5px;
    text-decoration: none;
}

#back-to-ranges-button:hover {
    background-color: #5a6268;
}

.back-button {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 10px 15px;
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 5px;
}

.back-button:hover {
    background-color: #5a6268;
}

#options-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}

#options-container button {
    flex: 1 1 calc(33% - 20px); /* 3 buttons per row, with spacing */
    max-width: 180px;
    margin: 10px;
    font-size: 1.5em;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#options-container button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

#message {
    margin-top: 20px;
    font-size: 1.3em;
    font-weight: bold;
}

#message.correct {
    color: #28a745;
}

#message.incorrect {
    color: #dc3545;
}

.hidden {
    display: none !important;
}

#score-container, #level-container {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: #555;
}

#score, #level {
    font-weight: bold;
    color: #007bff;
}

.correct-animation {
    animation: correct-feedback 0.5s ease-out;
}

.incorrect-animation {
    animation: incorrect-feedback 0.5s ease-out;
}

@keyframes correct-feedback {
    0% { transform: scale(1); background-color: #28a745; }
    50% { transform: scale(1.1); background-color: #28a745; }
    100% { transform: scale(1); }
}

@keyframes incorrect-feedback {
    0% { transform: scale(1); background-color: #dc3545; }
    50% { transform: scale(0.9); background-color: #dc3545; }
    100% { transform: scale(1); }
}

#next-button {
    margin-top: 20px;
    background-color: #28a745;
}

#next-button:hover {
    background-color: #218838;
}

.level-up-animation {
    animation: level-up 1s ease-out;
}

@keyframes level-up {
    0% { transform: scale(1); color: #007bff; }
    50% { transform: scale(1.2); color: #ffc107; }
    100% { transform: scale(1); color: #007bff; }
}

.level-complete-message {
    color: #28a745;
    font-size: 1.8em;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

#range-buttons-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 20px;
}

#range-buttons-container button {
    padding: 15px 25px;
    font-size: 1.2em;
    color: black;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#range-buttons-container button:hover {
    opacity: 0.9;
}