html,body{
  overflow:hidden;
}

body {
  font-family: sans-serif;
  text-align: center;
  background-color: #faf8ef;
  color: #776e65;
}

#game-board {
  width: 400px;
  height: 400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  background-color: #bbada0;
  padding: 5px;
  border-radius: 10px;
}

.tile {
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: bold;
  border-radius: 5px;
  transition: all 0.2s ease-in-out;
  animation: pop 0.2s;
}

@keyframes pop {
  0% {
    transform: scale(0.6);
  }
  100% {
    transform: scale(1);
  }
}

/* タイルごとの色指定 */
.tile-0    { background-color: #cdc1b4; color: transparent; }
.tile-2    { background-color: #eee4da; color: #776e65; }
.tile-4    { background-color: #ede0c8; color: #776e65; }
.tile-8    { background-color: #f2b179; color: white; }
.tile-16   { background-color: #f59563; color: white; }
.tile-32   { background-color: #f67c5f; color: white; }
.tile-64   { background-color: #f65e3b; color: white; }
.tile-128  { background-color: #edcf72; color: white; font-size: 24px; }
.tile-256  { background-color: #edcc61; color: white; font-size: 24px; }
.tile-512  { background-color: #edc850; color: white; font-size: 24px; }
.tile-1024 { background-color: #edc53f; color: white; font-size: 20px; }
.tile-2048 { background-color: #edc22e; color: white; font-size: 20px; }



.tile {
  position: relative;
  transition: transform 0.15s ease-in-out;
  animation: appear 0.2s ease;
}

@keyframes appear {
  0% {
    transform: scale(0.5);
    opacity: 0.5;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.merged {
  animation: merge 0.2s ease;
}

@keyframes merge {
  0% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}
