.game-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}

.game-intro {
    margin-bottom: 20px;
    color: #555;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.score-container {
    display: flex;
    gap: 10px;
}

.score-box {
    background-color: #bbada0;
    padding: 5px 15px;
    border-radius: 3px;
    color: white;
    min-width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-label {
    font-size: 10px;
    text-transform: uppercase;
    color: #eee4da;
}

#score,
#best-score {
    font-size: 20px;
    font-weight: bold;
}

.game-board-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    aspect-ratio: 1;
    background-color: #bbada0;
    border-radius: 6px;
    padding: 10px;
    box-sizing: border-box;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 10px;
    width: 100%;
    height: 100%;
}

.tile {
    background-color: #cdc1b4;
    border-radius: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 30px;
    font-weight: bold;
    color: #776e65;
    position: relative;
    transition: transform 0.1s ease-in-out, background-color 0.1s;
}

/* Tile Colors */
.tile[data-value="2"] {
    background-color: #eee4da;
}

.tile[data-value="4"] {
    background-color: #ede0c8;
}

.tile[data-value="8"] {
    background-color: #f2b179;
    color: #f9f6f2;
}

.tile[data-value="16"] {
    background-color: #f59563;
    color: #f9f6f2;
}

.tile[data-value="32"] {
    background-color: #f67c5f;
    color: #f9f6f2;
}

.tile[data-value="64"] {
    background-color: #f65e3b;
    color: #f9f6f2;
}

.tile[data-value="128"] {
    background-color: #edcf72;
    color: #f9f6f2;
    font-size: 25px;
}

.tile[data-value="256"] {
    background-color: #edcc61;
    color: #f9f6f2;
    font-size: 25px;
}

.tile[data-value="512"] {
    background-color: #edc850;
    color: #f9f6f2;
    font-size: 25px;
}

.tile[data-value="1024"] {
    background-color: #edc53f;
    color: #f9f6f2;
    font-size: 20px;
}

.tile[data-value="2048"] {
    background-color: #edc22e;
    color: #f9f6f2;
    font-size: 20px;
}

.tile[data-value="super"] {
    background-color: #3c3a32;
    color: #f9f6f2;
    font-size: 20px;
}

/* For > 2048 */

.tile-new {
    animation: appear 0.2s ease-in-out;
}

.tile-merged {
    animation: pop 0.2s ease-in-out;
}

@keyframes appear {
    0% {
        opacity: 0;
        transform: scale(0);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.game-message {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(238, 228, 218, 0.73);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 10;
}

.game-message.active {
    opacity: 1;
    pointer-events: auto;
}

.game-message p {
    font-size: 40px;
    font-weight: bold;
    color: #776e65;
    margin-bottom: 20px;
}

@media (max-width: 500px) {
    .game-container {
        padding: 10px;
    }

    .tile {
        font-size: 20px;
    }

    .tile[data-value="128"],
    .tile[data-value="256"],
    .tile[data-value="512"] {
        font-size: 18px;
    }

    .tile[data-value="1024"],
    .tile[data-value="2048"] {
        font-size: 14px;
    }
}