body, html {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #f0f0f0;
}

h1 {
    margin-top: 0; /* Remove default margin */
    font-size: 5em;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(4, 100px);
    grid-template-rows: repeat(5, 100px);
    gap: 10px;
    overflow-x: auto; /* Allow horizontal scrolling */
}

.grid-row {
    display: contents;
}

.box {
    width: 100%;
    height: 100%;
    background-color: #3498db;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    color: white;
    box-sizing: border-box;
    caret-color: transparent;
    border-radius: 15%;
}

.box input[type="text"] {
    width: 80%; /* Adjust as needed */
    height: 80%; /* Adjust as needed */
    font-size: inherit;
    text-align: center;
    border: none;
    background: transparent;
}

/* CSS for Submit Button */
.submit-container {
    justify-content: flex-end; /* Align the container to the right */
    margin: 5%; /* Adjust margin as needed */
}

.submit-button {
    width: 100px; /* Same width as box */
    height: 100px; /* Same height as box */
    background-color: #2ecc71; /* Green color */
    font-size: 24px;
    color: white;
    cursor: pointer;
    box-sizing: border-box;
    border: none;
    padding: 0; /* Remove default padding */
    position: relative; /* Added for positioning */
    border-radius: 15%;
}

/* Additional styling for button hover effect */
.submit-button:hover {
    background-color: #27ae60; /* Darker green color on hover */
}

/* CSS for editable rows */
.editable-row {
    opacity: 1; /* Make editable rows fully visible */
}

/* CSS for non-editable boxes within non-editable rows */
.grid-row:not(.editable-row) .box {
    opacity: 0.5; /* Apply grayed-out effect */
    pointer-events: none; /* Disable pointer events */
}

.submitted-row {
    opacity: 1;
}

.container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Align content to the top */
    align-items: center;
    margin-top: 5%; /* Adjust margin to create space between grids */
    height: 100%;
    width: 100%;
    min-width: 100%;
    min-height: 100%;
    overflow-x: auto; /* Allow horizontal scrolling */
}

.number-grid {
    display: grid;
    grid-template-columns: repeat(10, 100px);
    grid-template-rows: repeat(1, 100px);
    gap: 10px;
    margin-top: 5%;
}

.number-box {
     width: 100px; /* Same width as box */
    height: 100px; /* Same height as box */
    background-color: #3498db; /* Green color */
    font-size: 24px;
    color: white;
    cursor: pointer;
    box-sizing: border-box;
    border: none;
    padding: 0; /* Remove default padding */
    position: relative; /* Added for positioning */
    border-radius: 15%;
}

/* Focused box styling for mobile */
.box.focused {
    border: 3px solid #ffffff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

/* Mobile-specific adjustments */
@media screen and (max-width: 768px) {
    body, html {
        height: auto;
        min-height: 100%;
        overflow-y: auto;
    }
    
    .container {
        margin-top: 10px;
        height: auto;
        min-height: 100%;
    }
    
    /* Reduce the size of everything */
    .grid-container {
        grid-template-columns: repeat(4, 60px);
        grid-template-rows: repeat(5, 60px);
        gap: 5px;
    }
    
    .number-grid {
        grid-template-columns: repeat(5, 60px);
        grid-template-rows: repeat(2, 60px);
        gap: 5px;
        margin-top: 15px;
    }
    
    .number-box {
        width: 60px;
        height: 60px;
        font-size: 20px;
    }
    
    .box {
        width: 100%;
        height: 100%;
        font-size: 20px;
    }
    
    .submit-button {
        width: 100px;
        height: 50px;
        margin-top: 10px;
    }
    
    h1 {
        font-size: 3em;
        margin-bottom: 10px;
    }
}

/* Even smaller screens like iPhone SE */
@media screen and (max-width: 380px) {
    .grid-container {
        grid-template-columns: repeat(4, 50px);
        grid-template-rows: repeat(5, 50px);
    }
    
    .number-grid {
        grid-template-columns: repeat(5, 50px);
        grid-template-rows: repeat(2, 50px);
    }
    
    .number-box, .box {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
}