:root {
    --primary-color: #007bff;
    --background-color: #121212;
    --background-color-card: #1e1e1e;
    --background-color-box: #2a2a2a;
    --ui-scale: 1;
    color-scheme: dark;
}

html {
    background-color: var(--background-color);
}

body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: safe center;
    align-items: center;
    min-height: 100dvh;
    margin: 0;
    padding: calc(12px * var(--ui-scale)) 0;
    box-sizing: border-box;
    background-color: var(--background-color);
    font-size: calc(1rem * var(--ui-scale));
}

.container {
    text-align: center;
    background: var(--background-color-card);
    padding: calc(22px * var(--ui-scale));
    margin: calc(14px * var(--ui-scale)) 0;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.row {
    display: flex;
    justify-content: center;
    gap: calc(20px * var(--ui-scale));
    width: calc(100% - calc(40px * var(--ui-scale)));
    margin: 0 calc(20px * var(--ui-scale));
}

#inventoryContainer,
#craftingContainer {
    flex: 1 1 0;
}

#gameOverModal {
    border: none;
    border-radius: 10px;
    padding: calc(32px * var(--ui-scale));
    background: var(--background-color-card);
    color: white;
    text-align: center;
}

#gameOverModal::backdrop {
    background: rgba(0, 0, 0, 0.7);
}

#gameOverModal button {
    margin-top: calc(20px * var(--ui-scale));
    font-size: calc(1.2rem * var(--ui-scale));
    padding: calc(10px * var(--ui-scale));
}

input {
    padding: calc(10px * var(--ui-scale));
    font-size: calc(16px * var(--ui-scale));
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-bottom: calc(10px * var(--ui-scale));
}

button {
    padding: calc(30px * var(--ui-scale));
    font-size: calc(5rem * var(--ui-scale));
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition-duration: 100ms;
    user-select: none;
}

button:hover {
    background-color: rgb(from var(--primary-color) r g b / 80%);
}

ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: calc(10px * var(--ui-scale));
    margin: 0;
    padding: 0;
}

li {
    background: var(--background-color-box);
    padding: calc(20px * var(--ui-scale));
    min-width: 0;
    text-align: center;
    overflow-wrap: anywhere;
}

h2 {
    font-size: calc(1.5rem * var(--ui-scale));
    margin: calc(0.67em * var(--ui-scale)) 0;
}

h3 {
    font-size: calc(1.17rem * var(--ui-scale));
    margin: calc(0.83em * var(--ui-scale)) 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: calc(15px * var(--ui-scale));
}

th,
td {
    padding: calc(12px * var(--ui-scale)) calc(16px * var(--ui-scale));
    text-align: left;
    border-bottom: 1px solid var(--background-color-box);
}

th {
    color: #aaa;
    font-weight: bold;
    text-transform: uppercase;
    font-size: calc(0.85rem * var(--ui-scale));
    letter-spacing: 0.05em;
}

tr {
    cursor: pointer;
    user-select: none;
    transition-duration: 100ms;
}

tr:hover td {
    background: var(--background-color-box);
}

@media (max-width: 900px) {
    :root {
        --ui-scale: 0.75;
    }

    ul {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    :root {
        --ui-scale: 0.55;
    }

    .row {
        flex-direction: column;
        width: calc(100% - calc(24px * var(--ui-scale)));
        margin: 0 calc(12px * var(--ui-scale));
    }

    ul {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
