* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 20px;
    background: #faf8ef;
    font-family: Arial, sans-serif;
    color: #776e65;
}

.game-container {
    width: 100%;
    max-width: 500px;
    margin: auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    margin: 0;
    font-size: 70px;
    font-weight: bold;
    color: #776e65;
}

.score-box {
    background: #bbada0;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-align: center;
    min-width: 90px;
}

.score-box span {
    display: block;
    font-size: 12px;
    font-weight: bold;
}

.score-box strong {
    font-size: 25px;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
}

.game-info p {
    margin: 0;
    font-size: 16px;
}

#new-game {
    border: none;
    background: #8f7a66;
    color: white;
    padding: 12px 18px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

#new-game:hover {
    background: #77665a;
}

.game-board {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #bbada0;
    border-radius: 8px;
    padding: 10px;

    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;

    touch-action: none;
}

.tile {
    background: #cdc1b4;
    border-radius: 5px;

    display: flex;
    justify-content: center;
    align-items: center;

    font-size: 35px;
    font-weight: bold;
}

.tile-2 {
    background: #eee4da;
}

.tile-4 {
    background: #ede0c8;
}

.tile-8 {
    background: #f2b179;
    color: #f9f6f2;
}

.tile-16 {
    background: #f59563;
    color: #f9f6f2;
}

.tile-32 {
    background: #f67c5f;
    color: #f9f6f2;
}

.tile-64 {
    background: #f65e3b;
    color: #f9f6f2;
}

.tile-128 {
    background: #edcf72;
    color: #f9f6f2;
    font-size: 30px;
}

.tile-256 {
    background: #edcc61;
    color: #f9f6f2;
    font-size: 30px;
}

.tile-512 {
    background: #edc850;
    color: #f9f6f2;
    font-size: 30px;
}

.tile-1024 {
    background: #edc53f;
    color: #f9f6f2;
    font-size: 25px;
}

.tile-2048 {
    background: #edc22e;
    color: #f9f6f2;
    font-size: 25px;
}

.instructions {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

@media (max-width: 500px) {

    body {
        padding: 10px;
    }

    h1 {
        font-size: 55px;
    }

    .tile {
        font-size: 28px;
    }

    .tile-128,
    .tile-256,
    .tile-512 {
        font-size: 24px;
    }

    .tile-1024,
    .tile-2048 {
        font-size: 20px;
    }
}