body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
  background-color: #f0f0f0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(20, 5vw);
  grid-template-rows: repeat(5, 5vw);
  gap: 2px;
  background: #fff;
  padding: 5px;
  border-radius: 5px;
  /* Removed modifications for full-screen dimensions */
  /* width: 100vw; */
  /* height: calc(100vh - 60px); */
}

.cell {
  width: 5vw;
  height: 5vw;
  border: 1px solid #ddd;
  position: relative;
  cursor: pointer;
}

.piece {
  width: 80%;
  height: 80%;
  border-radius: 50%;
  position: absolute;
  top: 10%;
  left: 10%;
  transition: transform 0.2s;
}

.player1 {
  background-color: #ff4444;
}

.player2 {
  background-color: #4444ff;
}

.selected {
  transform: scale(1.2);
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.valid-move {
  background-color: #e0ffe0;
}

.turn-display {
  position: fixed;
  /* Keep fixed at top */
  top: 0;
  /* Anchor to top */
  left: 0;
  /* Stretch full width */
  right: 0;
  padding: 10px 0;
  /* Vertical padding */
  margin-bottom: 0;
  /* Remove original margin */
  font-size: 3vw;
  font-weight: bold;
  text-align: center;
  background: white;
  /* Ensure readability */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  /* Visual separation */
  z-index: 1000;
  /* Keep above other content */
}

.rules-display {
  position: fixed;
  /* Keep fixed at top */
  bottom: 0;
  /* Anchor to top */
  left: 0;
  /* Stretch full width */
  right: 0;
  padding: 10px 10px;
  /* Vertical padding */
  margin-bottom: 0;
  /* Remove original margin */
  font-size: 2.5vw;
  text-align: left;
  background: white;
  /* Ensure readability */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  /* Visual separation */
  z-index: 1000;
  /* Keep above other content */
}

.mode-toggle {
  position: fixed;
  top: 40px; /* Position below turn display */
  right: 10px;
  padding: 8px 16px;
  background-color: #f0f0f0;
  border: 2px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  z-index: 1000;
}

.mode-toggle:hover {
  background-color: #e0e0e0;
}

.turn-display.player1 {
  color: red;
}

.turn-display.player2 {
  color: blue;
}

.test-button {
  position: fixed;
  padding: 8px 16px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  z-index: 1000;
}

#test-self-jump {
  top: 40px;
  left: 10px;
}

#reset-board {
  top: 40px;
  left: 150px;
}

.test-info {
  position: fixed;
  top: 80px;
  left: 10px;
  padding: 10px;
  background-color: #fff9c4;
  border: 1px solid #fbc02d;
  border-radius: 4px;
  font-size: 14px;
  z-index: 1000;
}

@media (max-width: 600px) {
  .grid {
    /* Update grid cell sizes and reduce outer margin */
    grid-template-columns: repeat(20, 6vw);
    grid-template-rows: repeat(5, 6vw);
    transform: rotate(90deg);
    transform-origin: center center;
    margin: ;
  }

  .cell {
    /* Increase cell dimensions to match new grid size */
    width: 5vw;
    height: 5vw;
    overflow: visible;
  }

  .rules-display {
    display: none;
  }

  body {
    height: auto;
    min-height: 100vh;
  }

  .test-button, .test-info {
    font-size: 12px;
    padding: 6px 12px;
  }
  
  #reset-board {
    left: 120px;
  }
  
  .test-info {
    top: 70px;
  }
}

@media (min-width: 1200px) {
  .grid {
    grid-template-columns: repeat(20, 3vw);
    grid-template-rows: repeat(5, 3vw);
  }

  .cell {
    width: 3vw;
    height: 3vw;
  }
}