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

canvas {
    border: 2px solid #000;
    display: block;
}

.button-container {
    user-select: none;
    position: absolute;
    top: 2%;
    right: 2%;
    display: flex;
    gap: 10px;
    flex-direction: row-reverse; /* Start alignment from the right */
}

.trollbutton {
    background-color: #51545c;
    color: white;
    border: none;
    border-radius: 5%;
    cursor: pointer;
    padding: 0.5em 1em; /* Adjusted padding for reasonable button size */
    visibility: hidden;
}

.inv {
    padding: 0.5em; /* Adjusted padding to prevent oversized buttons */
}

.trollbutton:hover {
    background-color: #373941;
}

.inv-container {
    position: absolute;
    width: 100%;
    bottom: 5%; /* Position near the bottom */
    left: 0;
    display: flex;
    justify-content: space-between; /* Push buttons to opposite sides */
    align-items: center;
    pointer-events: none; /* Disable clicks on container */
}

.inv-container .trollbutton {
    pointer-events: all; /* Re-enable clicks for buttons */
    margin: 0 5%; /* Add spacing from the sides */
    padding: 0.5em 1em; /* Ensure button size is reasonable */
}

.canvas-container {
    position: relative;
    width: 95%;
    max-width: 800px;
    margin: 0 auto; /* Center the container */
    height: auto;
}

@media (max-width: 600px) {
    .canvas-container {
        height: auto;
    }
    canvas {
        width: 100%;
        height: auto;
    }
    .button-container {
        gap: 5px;
    }

    .trollbutton {
        padding: 0.2em 0.4em;
        font-size: 0.9rem;
    }

    .inv-container .trollbutton {
        margin: 0 2%; /* Adjust spacing for smaller screens */
        padding: 0.4em 0.8em; /* Further adjust button size for smaller screens */
    }
}