/* Reset and layout */
body, html {
  margin: 0;
  padding: 0;
  height: 100vh;               /* Full viewport height */
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;            /* Prevent scrolling */
  font-family: Arial, sans-serif;
  background: #f0f0f0;
  text-align: center;
}

/* Board styling */
#board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 90vmin;               /* Responsive square size */
  height: 90vmin;
  max-width: 500px;            /* Max size limit */
  max-height: 500px;
  gap: 10px;
  background-color: #fff;
  border: 2px solid #333;
  border-radius: 10px;
  margin-bottom: 20px;
}

/* Cell styling */
.cell {
  background: #eee;
  font-size: 12vmin;           /* Responsive font size */
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  user-select: none;
  border: 2px solid #333;
  border-radius: 5px;
}

.cell.x {
  color: #e74c3c;
}

.cell.o {
  color: #3498db;
}

/* Modal styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 8px;
  text-align: center;
  min-width: 250px;
  font-size: 1.2em;
}

/* Hide modal when needed */
.hidden {
  display: none;
}
