/* Container for the game board */
#board {
  background-color: #003366; /* Deep blue background for a futuristic feel */
  padding: 15px;
  border-radius: 20px; /* Slightly larger radius for the container */
  display: grid;
  grid-template-columns: repeat(var(--gsize, 3), 70px); /* Use CSS Grid for dynamic columns */
  grid-gap: 10px; /* Space between cells */
  box-shadow: 
    inset 5px 5px 10px rgba(0, 0, 0, 0.3),
    inset -5px -5px 10px rgba(255, 255, 255, 0.1);
  border: 2px solid #20B2AA; /* Teal border for accent */
  max-width: fit-content; /* Adjust max-width to fit content */
  margin: 20px auto; /* Center the board */
}

/* Style for the number tiles */
.cell {
  width: 70px; /* Fixed width for tiles */
  height: 70px; /* Fixed height for tiles */
  background: linear-gradient(145deg, #e0e0e0, #f0f0f0); /* Soft gradient for depth */
  border-radius: 15px; /* Rounded corners for modern look */
  border: 1px solid #d1d1d1;
  box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.2), -5px -5px 15px rgba(255, 255, 255, 0.8); /* Enhanced shadow for 3D effect */
  
  /* Font styling */
  font-family: 'Montserrat', sans-serif; /* Modern sans-serif font */
  font-size: 32px; /* Larger font size */
  font-weight: bold;
  color: #1A202C; /* Dark, almost black text for strong contrast */
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1); /* Subtle text shadow */

  /* Interaction styling */
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  display: flex; /* Use flexbox for perfect centering of numbers */
  justify-content: center;
  align-items: center;
}

.cell:hover {
  transform: translateY(-3px); /* Lift effect on hover */
  box-shadow: 8px 8px 20px rgba(0, 0, 0, 0.3), -8px -8px 20px rgba(255, 255, 255, 0.9); /* More pronounced shadow */
  background: linear-gradient(145deg, #f0f0f0, #e0e0e0); /* Invert gradient on hover */
}

.cell:active {
    transform: translateY(0); /* Return to original position on click */
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2), -2px -2px 5px rgba(255, 255, 255, 0.5); /* Subtle press-down effect */
}

/* Style for the empty hole */
.hole {
  width: 70px; /* Match cell size */
  height: 70px;
  background: #6A5ACD; /* Purple color for the hole */
  border-radius: 15px;
  border: none;
  box-shadow: inset 3px 3px 8px rgba(0, 0, 0, 0.4), inset -3px -3px 8px rgba(255, 255, 255, 0.2); /* Inset shadow for depth */
  display: flex; /* Use flexbox for perfect centering */
  justify-content: center;
  align-items: center;
  color: rgba(255, 255, 255, 0.5); /* Faint text for the hole */
  font-size: 24px;
  font-weight: bold;
  font-family: 'Montserrat', sans-serif;
}

/* General body and main content styling for the game page */
body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* Consistent with main site hero section */
    color: #f7fafc; /* Light text for dark background */
    font-family: 'Roboto', sans-serif; /* Modern, readable font */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh; /* Ensure body takes full viewport height */
    margin: 0;
    padding: 20px;
    box-sizing: border-box; /* Include padding in element's total width and height */
}

h1 {
    color: #FFFFFF; /* White heading */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
}

.game-description {
    color: #E2E8F0; /* Lighter white for paragraphs */
    margin-bottom: 20px;
    text-align: center;
    max-width: 600px;
}

/* Styles for the buttons generated by JS (class=but) */
.but {
    background: linear-gradient(135deg, #20B2AA 0%, #00CED1 100%); /* Teal gradient buttons */
    color: white;
    border: none;
    border-radius: 25px;
    padding: 10px 20px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    margin: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.but:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #00CED1 0%, #20B2AA 100%); /* Invert gradient on hover */
}

.but:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

#fldStatus {
    color: #FFD700; /* Gold color for status messages */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    margin-top: 15px;
    font-size: 1.2em;
}

ol, li {
    color: #E2E8F0; /* Light text for instructions */
    text-align: left;
    margin-left: 20px;
}

/* Style for the success popup */
#optpop {
    background-color: rgba(255, 255, 255, 0.95); /* Semi-transparent white popup */
    border: 1px solid #667eea; /* Blue border */
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    color: #333; /* Dark text for popup content */
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

#optpop button {
    background: #667eea; /* Blue buttons inside popup */
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 18px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 15px;
}

#optpop button:hover {
    background: #764ba2; /* Darker purple on hover */
}

/* Ensure game elements are centered */
main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}


