/* Reset box sizing */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Container for the grid */
.grid-container {
  display: grid;
  grid-template-columns: repeat(var(--size), 1fr);
  grid-template-rows: repeat(var(--size), 1fr);

  /* Take almost full viewport height minus space for buttons */
  height: calc(100vh - 120px); /* 120px reserved for buttons & margin */
  width: calc(100vh - 120px); /* keep square relative to height */
  max-width: 90vw; /* responsive cap */
  max-height: 90vw;

  margin: 20px auto;
  background-color: #0d0d0d;
  border: 15px solid #c41e3a;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

/* Individual grid cells */
.grid-item {
  border: 1px solid #333;
  background-color: rgb(255, 255, 255);
  transition: background-color 0.2s, transform 0.1s;
  cursor: pointer;
  border-radius: 2px;
}

.grid-item:hover {
  transform: scale(1.02);
  box-shadow: 0 2px 6px rgba(255, 255, 255, 0.2);
}

/* Button container */
.button-container {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  gap: 20px;
}

/* Buttons */
button {
  padding: 12px 20px;
  font-size: 18px;
  font-family: "Comic Sans MS", cursive, sans-serif;
  background-color: #c41e3a;
  color: #fff;
  border: 3px solid #800020;
  border-radius: 12px;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.1s, background-color 0.2s;
}

button:hover {
  background-color: #a8162f;
  transform: translateY(-2px);
}

/* Small devices */
@media (max-width: 600px) {
  .grid-container {
    width: 95vw;
    height: 95vw;
    border-width: 10px;
  }

  button {
    font-size: 16px;
    padding: 10px 16px;
  }
}

/* Ultra large screens */
@media (min-width: 1600px) {
  .grid-container {
    width: 75vmin; /* slightly smaller relative to viewport */
    height: 75vmin;
    border-width: 15px;
  }

  .button-container {
    gap: 30px; /* more spacing between buttons */
  }

  button {
    font-size: 28px; /* bigger buttons */
    padding: 16px 24px;
  }
}
