body {
    font-family: sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: #f0f0f0;
    padding: 10px;
}

.game-container {
    background-color: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 100%;
    max-width: 600px;
}

h1 {
    margin-top: 0;
    font-size: 1.5rem;
}

.problem {
    font-size: 2.5rem;
    margin: 1.5rem 0;
    font-weight: bold;
}

.checkbox-row {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
    gap: 5px;
}

.toggle-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.75rem;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 5px;
    width: 100%;
    max-width: 200px;
}

.toggle-btn:hover {
    background-color: #218838;
}

.checkbox-row input[type="checkbox"] {
    display: none;
}

.checkbox-row label {
    width: 30px;
    height: 30px;
    border: 2px solid #007bff;
    border-radius: 5px;
    margin: 2px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    color: transparent;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.checkbox-row label::before {
    content: attr(data-number);
    color: transparent;
}

.checkbox-row input[type="checkbox"]:checked+label {
    background-color: #007bff;
    color: white;
}

.checkbox-row input[type="checkbox"]:checked+label::before {
    color: white;
}

input[type="number"] {
    width: 100%;
    max-width: 200px;
    padding: 0.5rem;
    font-size: 1.5rem;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-top: 1rem;
}

button {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 0.5rem;
}

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

.feedback {
    margin-top: 1rem;
    font-weight: bold;
    font-size: 1rem;
}

.score {
    font-size: 1.2rem;
    margin-top: 1rem;
}

/* Media queries para dispositivos móviles */
@media (max-width: 600px) {
    .game-container {
        padding: 1rem;
    }

    h1 {
        font-size: 1.2rem;
    }

    .problem {
        font-size: 2rem;
        margin: 1rem 0;
    }

    .checkbox-row {
        max-width: 280px;
        margin-left: auto;
        margin-right: auto;
    }

    .checkbox-row label {
        width: 25px;
        height: 25px;
        font-size: 1rem;
        border-width: 1.5px;
        flex-basis: calc(20% - 4px);
    }

    .checkbox-row label:nth-of-type(5n+1) {
        margin-left: 0;
    }

    .toggle-btn {
        font-size: 0.7rem;
        padding: 0.4rem 0.6rem;
    }

    input[type="number"] {
        font-size: 1.2rem;
        padding: 0.4rem;
    }

    button {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }

    .score {
        font-size: 1rem;
    }
}

@media (max-width: 400px) {
    .game-container {
        padding: 0.8rem;
    }

    h1 {
        font-size: 1rem;
    }

    .problem {
        font-size: 1.5rem;
        margin: 0.8rem 0;
    }

    .checkbox-row {
        max-width: 250px;
    }

    .checkbox-row label {
        width: 22px;
        height: 22px;
        font-size: 0.9rem;
        margin: 1px;
        flex-basis: calc(20% - 2px);
    }

    .toggle-btn {
        font-size: 0.65rem;
        padding: 0.3rem 0.5rem;
    }

    input[type="number"] {
        font-size: 1rem;
    }

    button {
        font-size: 0.85rem;
    }
}