body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background: radial-gradient(circle, #ffffff, #faf8ef);
    color: #776e65;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

.game-container {
    text-align: center;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 360px;
    margin-bottom: 20px;
}

h1 {
    font-size: 60px;
    margin: 0;
}

.score-container {
    background-color: #a39489;
    padding: 10px 25px;
    border-radius: 5px;
    text-align: center;
}

.score-title {
    font-size: 14px;
    color: #eee4da;
}

#score {
    font-size: 25px;
    font-weight: bold;
    color: #ffffff;
}

.info {
    margin-bottom: 20px;
}

.game-board-container {
    position: relative;
}

#game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 15px;
    width: 360px;
    height: 360px;
    background-color: #a39489;
    border-radius: 6px;
    padding: 15px;
    box-sizing: border-box;
}

.tile-background {
    background-color: #d6c9c0;
    border-radius: 3px;
}

.tile {
    position: absolute;
    width: 100px; /* (360 - padding*2 - gap*2) / 3 */
    height: 100px;
    border-radius: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 45px;
    transition: all 0.1s ease-in-out;
}

#game-over-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(238, 228, 218, 0.73);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 60px;
    font-weight: bold;
    color: #776e65;
    border-radius: 6px;
}

#rankingStatus {
    font-size: 16px;
    font-weight: normal;
    margin-top: 10px;
}

#restart-button {
    margin-top: 20px;
    padding: 10px 25px;
    font-size: 20px;
    font-weight: bold;
    color: #f9f6f2;
    background-color: #6c9ecf;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent; /* Prevents flash on mobile tap */
}

.hidden {
    display: none !important;
}

/* Tile Colors */
.tile-1 { background-color: #f2f2f2; color: #776e65; }
.tile-2 { background-color: #e3e3e3; color: #776e65; }
.tile-4 { background-color: #a7d7c5; color: #f9f6f2; }
.tile-8 { background-color: #74b49b; color: #f9f6f2; }
.tile-16 { background-color: #5c946e; color: #f9f6f2; }
.tile-32 { background-color: #6c9ecf; color: #f9f6f2; }
.tile-64 { background-color: #496a81; color: #f9f6f2; }
.tile-128 { background-color: #ffc15e; color: #f9f6f2; }
.tile-256 { background-color: #f79d65; color: #f9f6f2; }
.tile-512 { background-color: #f47a60; color: #f9f6f2; }
.tile-1024 { background-color: #e84a5f; color: #f9f6f2; }
.tile-2048 { background-color: #2a363b; color: #f9f6f2; }

/* Responsive Font Size for larger numbers */
.tile-128, .tile-256, .tile-512 {
    font-size: 35px;
}
.tile-1024, .tile-2048 {
    font-size: 25px;
}