* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #faf8ef;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

h1 {
    font-size: 4rem;
    color: #776e65;
    margin-bottom: 10px;
}

.score-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.score-box {
    background: #bbada0;
    padding: 10px 25px;
    border-radius: 6px;
    text-align: center;
    min-width: 100px;
}

.score-label {
    display: block;
    color: #eee4da;
    text-transform: uppercase;
    font-size: 13px;
    font-weight: bold;
}

#current-score,
#high-score {
    color: white;
    font-size: 20px;
    font-weight: bold;
}

.game-container {
    background: #bbada0;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    background: #bbada0;
}

.grid-cell {
    width: 100px;
    height: 100px;
    background-color: rgba(238, 228, 218, 0.35);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 35px;
    font-weight: bold;
    color: #776e65;
    transition: all 0.15s ease;
}

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

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

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

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

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

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

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

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

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

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

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

#restart-btn,
#restart-btn-overlay {
    padding: 10px 25px;
    font-size: 16px;
    background-color: #8f7a66;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#restart-btn:hover,
#restart-btn-overlay:hover {
    background-color: #776e65;
}

#game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(238, 228, 218, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.game-over-content {
    background: white;
    padding: 40px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.game-over-content h2 {
    color: #776e65;
    margin-bottom: 15px;
}

.game-over-content p {
    color: #776e65;
    margin-bottom: 20px;
}

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

.merged-tile {
    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(0.8);
    }

    50% {
        transform: scale(1.2);
    }

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