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

.game-container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

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

.game-header h1 {
    font-size: 80px;
    margin: 0;
    color: #776e65;
}

.scores {
    display: flex;
    gap: 10px;
}

.score-box {
    background: #bbada0;
    padding: 5px 15px;
    border-radius: 5px;
    text-align: center;
    color: white;
}

.score-title {
    font-size: 14px;
    text-transform: uppercase;
}

.score-value {
    font-size: 25px;
    font-weight: bold;
}

.game-intro {
    background: #bbada0;
    color: white;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 16px;
}

.game-board {
    background: #bbada0;
    border-radius: 6px;
    padding: 15px;
    position: relative;
    margin-bottom: 20px;
}

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

.cell {
    background: rgba(238, 228, 218, 0.35);
    border-radius: 3px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 45px;
    font-weight: bold;
    color: #776e65;
}

.tile {
    position: absolute;
    width: calc(25% - 15px);
    height: calc(25% - 15px);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 35px;
    font-weight: bold;
    border-radius: 3px;
    background: #eee4da;
    transition: all 0.1s ease-in-out;
    z-index: 10;
}

.tile-2 {
    background: #eee4da;
}

.tile-4 {
    background: #ede0c8;
}

.tile-8 {
    background: #f2b179;
    color: white;
}

.tile-16 {
    background: #f59563;
    color: white;
}

.tile-32 {
    background: #f67c5f;
    color: white;
}

.tile-64 {
    background: #f65e3b;
    color: white;
}

.tile-128 {
    background: #edcf72;
    color: white;
    font-size: 30px;
}

.tile-256 {
    background: #edcc61;
    color: white;
    font-size: 30px;
}

.tile-512 {
    background: #edc850;
    color: white;
    font-size: 30px;
}

.tile-1024 {
    background: #edc53f;
    color: white;
    font-size: 25px;
}

.tile-2048 {
    background: #edc22e;
    color: white;
    font-size: 25px;
}

.game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(238, 228, 218, 0.73);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.game-over h2 {
    font-size: 60px;
    margin: 0;
    color: #776e65;
}

.game-over p {
    margin: 0;
    font-size: 30px;
    margin-bottom: 30px;
}

.game-controls {
    display: flex;
    justify-content: space-between;
}

button, .back-btn ,a {
    background: #8f7a66;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
}

button:hover, .back-btn:hover ,a:hover {
    background: #9f8b77;
}

@media (max-width: 520px) {
    .game-header h1 {
        font-size: 50px;
    }
    
    .cell, .tile {
        height: 70px;
    }
    
    .tile {
        font-size: 25px;
    }
    
    .tile-128, .tile-256, .tile-512 {
        font-size: 20px;
    }
    
    .tile-1024, .tile-2048 {
        font-size: 18px;
    }
}
