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

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

.game-container {
    width: 100%;
    max-width: 500px;
    text-align: center;
}

.header {
    margin-bottom: 20px;
}

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

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

.score-box {
    background-color: #bbada0;
    padding: 10px 20px;
    border-radius: 3px;
    color: white;
    position: relative;
    display: inline-block;
    min-width: 80px;
}

.score-label {
    font-size: 13px;
    text-transform: uppercase;
}

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

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

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

.grid-cell {
    background-color: #cdc1b4;
    border-radius: 3px;
    width: 100%;
    height: 100%;
}

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

.tile-2 { background-color: #eee4da; color: #776e65; }
.tile-4 { background-color: #ede0c8; color: #776e65; }
.tile-8 { background-color: #f2b179; color: #f9f6f2; }
.tile-16 { background-color: #f59563; color: #f9f6f2; }
.tile-32 { background-color: #f67c5f; color: #f9f6f2; }
.tile-64 { background-color: #f65e3b; color: #f9f6f2; }
.tile-128 { background-color: #edcf72; color: #f9f6f2; font-size: 30px; }
.tile-256 { background-color: #edcc61; color: #f9f6f2; font-size: 30px; }
.tile-512 { background-color: #edc850; color: #f9f6f2; font-size: 30px; }
.tile-1024 { background-color: #edc53f; color: #f9f6f2; font-size: 25px; }
.tile-2048 { background-color: #edc22e; color: #f9f6f2; font-size: 25px; }

.game-message {
    margin-top: 20px;
    font-size: 18px;
    min-height: 25px;
}

.game-controls {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.btn {
    background-color: #8f7a66;
    color: #f9f6f2;
    border: none;
    border-radius: 3px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #9f8a76;
}

.instructions {
    margin-top: 20px;
    font-size: 16px;
    line-height: 1.5;
}

.game-over-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    border-radius: 6px;
    z-index: 10;
}

.game-over-content {
    text-align: center;
}

.game-over-text {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 20px;
}

@media (max-width: 480px) {
    h1 {
        font-size: 36px;
    }
    
    .tile {
        font-size: 28px;
    }
    
    .tile-128, .tile-256, .tile-512 {
        font-size: 24px;
    }
    
    .tile-1024, .tile-2048 {
        font-size: 20px;
    }
  }
