/* RESET & BASE */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html, body {
  width: 100%;
  height: 100%;
  overflow: auto;
}
body {
  font-family: sans-serif;
  /* Set the background image without tint here */
  background: url(images/bg.jpg) no-repeat center center / cover;
  position: relative;
}

/* BACKGROUND OVERLAY: Creates a 50% tint over the background image */
.background-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: -1;
}

/* WELCOME OVERLAY */
#welcomeOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.welcomeContent {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid gold;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  color: #fff;
  max-width: 500px;
}
.welcomeContent h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: gold;
}
.welcomeContent button {
  background: gold;
  border: none;
  border-radius: 6px;
  padding: 0.8rem 1.5rem;
  cursor: pointer;
  font-weight: 600;
  color: #333;
}
.welcomeContent button:hover {
  background: #ecc400;
}

/* HEADER & CONTROLS */
header {
  background: #673ab7;
  color: #fff;
  padding: 1rem;
  text-align: center;
}
#controls {
  background: #7e57c2;
  color: #fff;
  padding: 1rem;
  text-align: center;
}

/* CENTERING THE BOARD WRAPPER */
main {
  text-align: center;
  margin: 20px 0;
}

/* BOARD WRAPPER: Black container for contrast */
.boardWrapper {
  background-color: #000;
  padding: 20px;
  border-radius: 8px;
  display: inline-block;
}

/* BOARD */
#boardContainer {
  display: grid;
  grid-template-columns: repeat(7, 60px); /* Adjusted dynamically in JS */
  gap: 4px;
}

/* Each cell in the board */
/* Do not specify a fallback background so region colors show */
.cell {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* REGION COLOR CLASSES (forced with !important) */
.color1  { background-color: #f44336 !important; }
.color2  { background-color: #ff9800 !important; }
.color3  { background-color: #ffeb3b !important; }
.color4  { background-color: #4caf50 !important; }
.color5  { background-color: #2196f3 !important; }
.color6  { background-color: #9c27b0 !important; }
.color7  { background-color: #3f51b5 !important; }
.color8  { background-color: #00bcd4 !important; }
.color9  { background-color: #795548 !important; }
.color10 { background-color: #e91e63 !important; }
.color11 { background-color: #8bc34a !important; }
.color12 { background-color: #ffc107 !important; }
.color13 { background-color: #009688 !important; }
.color14 { background-color: #ff5722 !important; }
.color15 { background-color: #673ab7 !important; }

/* Marker Classes (for X and Queen) */
.cell.xMark {
  background-image: url(images/x_icon.png);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 60%;
}
.cell.queenMark {
  background-image: url(images/queen_icon.png);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 70%;
}

/* FOOTER: Restyled for readability */
footer {
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 20px;
  text-align: center;
  max-width: 800px;
  margin: 30px auto;
  border-radius: 8px;
  font-size: 1.1em;
}
footer h2 {
  margin-bottom: 15px;
  color: gold;
}
footer ul {
  list-style: none;
  margin: 15px 0;
  padding: 0;
}
footer li {
  margin: 8px 0;
}
footer p {
  margin-top: 15px;
  line-height: 1.5;
}
