body {
    font-family: Arial, sans-serif;
    text-align: center;
    background: #faf8ef;
    margin: 0;
    padding: 0;
    overflow: hidden; /* Prevents scrolling and refresh on swipe */
}



.container {
    width: 320px;
    margin: auto;
    padding-top: 10px; /* Reduced padding from top to bring content closer */
    padding-left: 20px;
    padding-right: 20px;
}

h1 {
    font-size: 25px;
    color: #776e65;
     margin-right: 20px; /* Space between the title and the button */
     margin-top: 0px;
    
} 

.game-controls {
    display: flex; /* Use flexbox */
    align-items: center; /* Align vertically if needed */
    justify-content: space-between; /* Space out the items if you want space between them */
    width: 100%; /* Ensure the container takes up the full width */
}

#newGame {
    margin-left: 10px; /* Adds a little space between the buttons */
    margin-top: 0;
    padding: 10px 20px;
    font-size: 16px;
    background: #8f7a66;
    color: white;
    border: none;
    cursor: pointer;
}

.score-container {
    display: flex;
    justify-content: space-between;
    background: #bbada0;
    padding: 10px;
    border-radius: 5px;
    color: white;
    font-size: 18px;
    margin-top: 10px;
}

#gameBoard {
    width: 300px;
    height: 300px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    background: #bbada0;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
}

.tile {
    width: 60px;
    height: 60px;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    transition: all 0.2s ease-in-out;
}

.how-to-play-container {
  display: flex;               /* Align items horizontally */
  flex-wrap: wrap;             /* Allow wrapping if needed */
  align-items: center;         /* Vertically center the elements */
  text-align: left;            /* Ensure text starts from the left */
}

#howToPlay {
  font-size: 18px;
  text-decoration: underline;
  color: blue;
  margin-right: 5px;           /* Space between the link and the text */
  margin-top: 10px;
}

#howToPlayText {
  font-size: 15px;
  color: #555;
  line-height: 1.5;
  display: inline;
                          
}



#gameBoard {
    margin-top: 20px; /* Added margin to give space between the game board and other elements */
}




/* Different colors for different numbers */
.tile[data-value="2"] { background: #eee4da; color: #776e65; }
.tile[data-value="4"] { background: #ede0c8; color: #776e65; }
.tile[data-value="8"] { background: #f2b179; color: white; }
.tile[data-value="16"] { background: #f59563; color: white; }
.tile[data-value="32"] { background: #f67c5f; color: white; }
.tile[data-value="64"] { background: #f65e3b; color: white; }
.tile[data-value="128"] { background: #edcf72; color: white; }
.tile[data-value="256"] { background: #edcc61; color: white; }
.tile[data-value="512"] { background: #edc850; color: white; }
.tile[data-value="1024"] { background: #edc53f; color: white; }
.tile[data-value="2048"] { background: #edc22e; color: white; }

#gameOverPopup {
    display: none;
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 5px;
}

#playAgain {
    padding: 10px 20px;
    font-size: 18px;
    background: red;
    color: white;
    border: none;
    cursor: pointer;
    margin-top: 10px;
}
