body {
  font-family: Arial, sans-serif;
  text-align: center;
  background-color: #f4f4f9;
  margin: 0; /* Remove default body margin */
  padding: 0; /* Remove default body padding */
}

#treasure-heading {
  font-size: 16px;
}

#score-container {
  display: flex;
  justify-content: center;
  gap: 50px; /* Adds space between scores */
  margin-bottom: 20px;
}

#player1-score,
#player2-score {
  text-align: center;
}

#score-heading h3,
#score-heading h3 {
  margin: 0;
}

#move-error1,
#move-error2 {
  font-size: 13px;
  color: red;
}

#score-heading p,
#score-heading p {
  font-size: 24px;
  margin: 5px 0 0;
}

#game-container {
  display: flex;
  justify-content: center;
  align-items: center; /* Align items vertically centered */
  margin: 60px auto; /* Center the container */
  gap: 100px; /* Adjust the gap between grid and grid-info */
}

#grid {
  display: grid;
  margin: 0; /* Remove margin to avoid extra spacing */
  border: 2px solid black;
}

#grid-info {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  margin: 0; /* Remove extra margins */
}

#result {
  color: rgb(13, 97, 13);
}

.player-icon {
  width: 40px;
  height: 40px;
  display: block;
  margin: 0 auto;
}

.grid-cell {
  width: 40px;
  height: 40px;
  border: 1px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-cell.treasure,
.grid-cell.thief,
.grid-cell.wall,
.grid-cell.teleport {
  background-color: transparent;
  background-size: cover;
  background-position: center;
  color: transparent;
}

.grid-cell.wall {
  background-image: url("assets/wall.png");
}

.grid-cell.teleport {
  background-image: url("assets/teleport.png");
}

.grid-cell.treasure {
  background-image: url("assets/coin.jpeg");
}

.grid-cell.thief {
  background-image: url("assets/thief.png");
}

.grid-cell.player1,
.grid-cell.player2 {
  background-color: transparent;
  position: relative; /* Required for positioning the pseudo-element */
}

.grid-cell.player1::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-image: url("assets/adventurer_m.png");
  background-size: contain;
  width: 30px; /* Adjust size as needed */
  height: 30px; /* Adjust size as needed */
}

.grid-cell.player2::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-image: url("assets/adventurer_f.png");
  background-size: contain;
  background-repeat: no-repeat;
  width: 30px; /* Adjust size as needed */
  height: 30px; /* Adjust size as needed */
}

.grid-cell.highlight {
  outline: 3px solid yellow;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%,
  100% {
    outline-color: yellow;
  }
  50% {
    outline-color: orange;
  }
}

#controls {
  display: flex;
  justify-content: space-around;
  width: 100%;
}

#parameter-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  padding: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  z-index: 1000;
  width: 30%; /* Adjust the percentage or set a fixed width like 600px */
  max-width: 800px; /* Optional, to limit the maximum width */
}

#parameter-modal label {
  font-size: 18px; /* Increased font size for labels */
}

#parameter-modal input {
  font-size: 16px; /* Larger text in input fields */
  padding: 10px; /* Increased padding for input fields */
  margin-bottom: 2px; /* Space between fields */
  border: 1px solid #ccc; /* Border styling */
  border-radius: 5px; /* Rounded edges */
}

#parameter-modal button {
  font-size: 18px; /* Larger font size for buttons */
  border-radius: 10px; /* Rounded buttons */
}

#overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

#intermission {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 20px;
  background-color: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 1001;
  border-radius: 8px;
}
#final_result {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 20px;
  background-color: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 1002;
  border-radius: 8px;
}

#intermission {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 20px;
  background-color: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 1001;
  border-radius: 8px;
}

#game1_result {
  font-size: 20px;
}

#params-invalid-error {
  color: red;
}

table {
  border-collapse: collapse;
  width: 100%; /* Increased width */
  margin: 20px auto;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

th,
td {
  border: 1px solid #ddd;
  text-align: center;
  padding: 10px;
}

th {
  background-color: #1e7d21;
  color: white;
}

button {
  background-color: #4caf50;
  border: none;
  color: white;
  padding: 10px 20px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 0.3s, transform 0.2s;
}

button:hover {
  background-color: #45a049;
  transform: scale(1.05);
}

button:active {
  background-color: #3e8e41;
}
