body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #faf8ef;
    font-family: Arial, sans-serif;
    color: #776e65;
}

.game-container {
    padding: 10px;
    background-color: #bbada0;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    text-align: center;
}

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

.score-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

#score {
    font-size: 2em;
    font-weight: bold;
    margin-left: 10px;
}

.grid {
    width: 400px;
    height: 400px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 10px;
    background-color: #bbada0;
    padding: 10px;
    border-radius: 6px;
}

.cell {
    width: 90px;
    height: 90px;
    background-color: rgba(238, 228, 218, 0.35);
    border-radius: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 2em;
    transition: transform 0.2s ease-in-out;
}

/* 根据方块值设置颜色 */
.val-2 { background-color: #eee4da; }
.val-4 { background-color: #ede0c8; }
.val-8 { background-color: #f2b179; color: #f9f6f2; }
.val-16 { background-color: #f59563; color: #f9f6f2; }
.val-32 { background-color: #f67c5f; color: #f9f6f2; }
.val-64 { background-color: #f65e3b; color: #f9f6f2; }
.val-128 { background-color: #edcf72; color: #f9f6f2; }
.val-256 { background-color: #edcc61; color: #f9f6f2; }
.val-512 { background-color: #edc850; color: #f9f6f2; }
.val-1024 { background-color: #edc53f; color: #f9f6f2; }
.val-2048 { background-color: #edc22e; color: #f9f6f2; }

#result {
    margin-top: 20px;
    font-size: 2em;
    font-weight: bold;
}