/* General body and font styling */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: sans-serif;
  text-align: center;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Old table-based layout (preserved just in case) */
table {
  margin: auto;
  border-collapse: collapse;
}

td {
  border: 1px solid #333;
  padding: 20px;
  width: 100px;
  height: 100px;
  cursor: pointer;
  vertical-align: middle;
  text-align: center;
  font-weight: bold;
}

td.marked {
  background-color: #4caf50;
  color: white;
}

/* New image-backed bingo board */
.board-container {
  width: 900px;
  height: 850px;
  background: url('/images/background-scrum.png') no-repeat center center;
  background-size: 85%;
  position: relative;
}

/* Grid-style bingo layout */
.bingo {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 5px;
  width: 85%;
  height: 85%;
  position: absolute;
  top: 95px;
  left: 60px;
  padding: 20px;
  box-sizing: border-box;
}

/* Individual cells */
.cell {
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  font-weight: bold;
  border: 2px solid #333;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
  position: relative; /* required for tooltip positioning */
}

.cell.active {
  background: #cce5ff;
}

/* Custom tooltip styling using data-tooltip */
.cell[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 50%;
  left: 105%;
  transform: translateY(-50%);
  background: #fff8dc; /* tan background */
  color: #000;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.7rem;           /* smaller font */
  white-space: normal;         /* allow wrapping */
  min-width: 220px;
  max-width: 500px;            /* increased max width */
  z-index: 10;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
  border: 1px solid #ccc;
  text-align: left;
}

.cell[data-tooltip]:hover::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 100%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: #fff8dc;
}

.controls {
  position: absolute;
  bottom: 4px;
  left: 0;
  width: 100%;
  padding: 0px 0;
  font-size: 1.4rem; /* Increased from 1rem */
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.controls label {
  font-size: 1.4rem; /* Optional: increase label size explicitly */
}

.controls input[type="radio"] {
  transform: scale(1.3); /* Optional: increase the size of the radio circle */
  margin-right: 8px;
}

.controls button {
  background: #000;
  color: #fff;
  border: 1px solid #fff;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
  margin-top: -5px;
}

.controls button:hover {
  background: #fff;
  color: #000;
}

.suggestion-link {
  color: #fff;
  text-decoration: underline;
  font-size: 1.25rem;
  align-self: center;
  margin-top: -4px;    /* move up slightly */
  margin-left: 8rem;   /* move right about 1 inch (~16px) */
}

.suggestion-link:hover {
  color: #ccc;
}

.version-label {
  position: fixed;
  bottom: 10px;
  right: 15px;
  font-size: 10px;
  color: white;
  opacity: 0.7;
  z-index: 1000;
  font-family: monospace;
  pointer-events: none; /* so it doesn't block clicks underneath */
}

@media (min-width: 769px) {
  .bingo {
    transform: scale(0.84);
    transform-origin: center;
  }

 .controls {
    bottom: 65px; /* moves it up ~1 inch from the bottom */
  }
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
  .board-container {
    width: 100vw;
    height: 90vw;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
  }

  .bingo {
    position: absolute;
    top: 11.25%;
    left: 7.5%;
    right: 7.5%;
    bottom: 10%;
    padding: 5px;
    gap: 3px;
    box-sizing: border-box;
  }

  .cell {
    font-size: 2.0vw;
    padding: 4px;
    min-width: 0;
    min-height: 0;
  }
   
  .controls {
    position: absolute; /* ensure this stays defined */
    bottom: -8px; /* moves it up 1/4 inch from bottom */
    flex-direction: row;           /* stay horizontal */
    flex-wrap: wrap;               /* allow wrap if too tight */
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;             /* smaller font size */
    gap: 0.8rem;                   /* tighter spacing */
    padding: 0.5rem 1rem;
  }

  .controls label {
    font-size: 0.5rem;
    margin: 0;
  }

  .controls input[type="radio"] {
    transform: scale(1);           /* standard size radios */
    margin-right: 4px;
  }

  .controls button {
    font-size: 0.5rem;
    padding: 0.2rem 0.2rem;
    margin-top: 0;
  }

  .suggestion-link {
    font-size: 0.5rem;
    margin-left: 0;
    margin-top: 0;
    text-align: center;
  }
}

@media only screen and (orientation: landscape) and (max-width: 1024px) {
  .board-container {
    width: 95vw;
    height: 95vh;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    margin: 0 auto;
    padding: 0;
  }

  .bingo {
    width: 78vmin; /* slightly larger than 72vmin */
    height: 78vmin;
    top: 40px; /* ~0.5 inch down */
    left: 50%;
    transform: translateX(-50%);
    gap: 2px;
    padding: 0;
  }

  .cell {
    aspect-ratio: 1 / 1;
    font-size: 2.4vmin;
    padding: 0;
  }

  .controls {
    bottom: -8px;
    font-size: 0.6rem;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
  }
  
  .controls label {
    font-size: 0.5rem;
    margin: 0;
  }

  .controls input[type="radio"] {
    transform: scale(1);           /* standard size radios */
    margin-right: 4px;
  }

  .controls button {
    font-size: 0.5rem;
    padding: 0.2rem 0.2rem;
    margin-top: 0;
  }

  .suggestion-link {
    font-size: 0.5rem;
    margin: 0;
  }
}