@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');
body {
    font-family: Montserrat, sans-serif;
    background-color: #4e4e4e;
    color: #ffffff;
}

main {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 20px;
    max-width: 100vw;
    flex-wrap: wrap;
}

main > * {
    flex: 1 1 0;
    max-width: 33.33%;
}

div.stats {
    display: flex;
    justify-content: space-between;
}
div.stat {
    display: inline-block;
    background-color: #d0d0d0;
    color: black;
    padding: 4px;
    margin: 2px;
}

div.stat h1 {
    text-align: center;
    margin: 0;
    padding: 0;
}

div.stat p {
    text-align: center;
    margin: 0;
    padding: 0;
    font-size: 0.8em;
}

#roll-button {
    display: block;
}

#remove-stat-allocations {
    display: block;
    margin: 10px 0;
}

div.stat-totals {
    background-color: #d0d0d0;
    color: black;
    padding: 4px;
    margin: 2px;
}

section {
    margin: 20px;
}

/* Mobile-friendly responsive design */
@media (max-width: 768px) {
    body {
        font-size: 14px;
        padding: 0;
        margin: 0;
    }

    header {
        text-align: center;
        padding: 10px;
    }

    main {
        flex-direction: column;
        padding: 10px;
        max-width: 100%;
    }

    main > * {
        flex: 1 1 100%;
        max-width: 100%;
        margin-bottom: 20px;
    }

    section {
        margin: 10px;
    }

    div.stats {
        flex-direction: column;
        gap: 10px;
    }

    div.stat {
        margin: 5px 0;
        padding: 8px;
        border-radius: 4px;
    }

    div.stat h1 {
        font-size: 1.5em;
    }

    div.stat p {
        font-size: 0.9em;
    }

    select.stat-select {
        width: 100%;
        padding: 5px;
        margin-top: 5px;
        font-size: 14px;
    }

    #roll-button, #remove-stat-allocations {
        width: 100%;
        padding: 12px;
        font-size: 16px;
        margin: 10px 0;
        border-radius: 4px;
        border: none;
        background-color: #007bff;
        color: white;
        cursor: pointer;
    }

    #roll-button:hover, #remove-stat-allocations:hover {
        background-color: #0056b3;
    }

    input[type="number"], input[type="radio"] {
        margin: 5px;
    }

    label {
        display: block;
        margin: 10px 0;
        font-size: 14px;
    }

    div.stat-totals {
        padding: 10px;
        margin: 10px 0;
        border-radius: 4px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 12px;
    }

    header h1 {
        font-size: 1.8em;
        margin: 10px 0;
    }

    section h2 {
        font-size: 1.4em;
        text-align: center;
    }

    div.stats {
        gap: 8px;
    }

    div.stat {
        padding: 6px;
        margin: 3px 0;
    }

    div.stat h1 {
        font-size: 1.3em;
    }

    div.stat p {
        font-size: 0.8em;
    }

    #roll-button, #remove-stat-allocations {
        padding: 10px;
        font-size: 14px;
    }

    section {
        margin: 5px;
    }
}