body {
  font-family: Arial, sans-serif;
  display: flex;
  justify-content: center;
  background-color: #f0f0f0;
  margin: 0;
  overflow: hidden;
  touch-action: manipulation;
}
.container {
  text-align: center;
  max-width: 100%;
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
}
h1 {
  color: #333;
  font-size: 2em;
  margin: 10px 0;
}
#board {
  display: grid;
  grid-template-columns: repeat(10, 50px);
  width: 512px; /* 10 * 50px + 2 * 2px (outer borders) + 9 * 1px (inner borders) */
  height: 512px;
  margin: 20px auto;
  border: 2px solid #333;
  background-color: #fff;
  box-sizing: border-box;
}
.gem {
  width: 50px;
  height: 50px;
  border: 1px solid #999;
  cursor: pointer;
  touch-action: manipulation;
  pointer-events: auto;
  user-select: none;
  box-sizing: border-box;
}
.gem.red {
  background: url('/gem-matcher/red-gem.png') no-repeat center;
  background-size: 80%;
}
.gem.blue {
  background: url('/gem-matcher/blue-gem.png') no-repeat center;
  background-size: 80%;
}
.gem.green {
  background: url('/gem-matcher/green-gem.png') no-repeat center;
  background-size: 80%;
}
.gem.yellow {
  background: url('/gem-matcher/yellow-gem.png') no-repeat center;
  background-size: 80%;
}
.gem.purple {
  background: url('/gem-matcher/purple-gem.png') no-repeat center;
  background-size: 80%;
}
.gem.orange {
  background: url('/gem-matcher/orange-gem.png') no-repeat center;
  background-size: 80%;
}
.gem.white {
  background: url('/gem-matcher/white-gem.png') no-repeat center;
  background-size: 80%;
}
.gem.selected {
  border: 2px solid #000;
}
#game-over {
  margin-top: 20px;
}
#game-over button {
  padding: 10px 20px;
  font-size: 1em;
  background-color: #333;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  touch-action: manipulation;
}
#leaderboard {
  margin: 20px auto;
  border-collapse: collapse;
  width: 100%;
  max-width: 100%;
}
#leaderboard th, #leaderboard td {
  border: 1px solid #333;
  padding: 8px;
  font-size: 1em;
}
#leaderboard th {
  background-color: #333;
  color: #fff;
}
@media (max-width: 600px) {
  h1 {
    font-size: 1.5em;
  }
  #board {
    grid-template-columns: repeat(10, 40px);
    width: 412px; /* 10 * 40px + 2 * 2px + 9 * 1px */
    height: 412px;
  }
  .gem {
    width: 40px;
    height: 40px;
  }
  #game-over button {
    font-size: 0.9em;
    padding: 8px 15px;
  }
  #leaderboard th, #leaderboard td {
    font-size: 0.9em;
    padding: 5px;
  }
}
