body {
  font-family: sans-serif;
  display: flex;
  justify-content: center;
  padding: 2rem;
  background: #f4f4f4;
}

.container {
  text-align: center;
  background: white;
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0,0,0,0.1);
}



input.cell {
  outline: none;
}

.buttons button {
  margin: 0.5rem;
  padding: 0.5rem 1rem;
}

.toggle {
  margin-top: 1rem;
}

.selection-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
  gap: 10px;
  margin: 1rem auto;
  width: 100%;
  max-width: 90vmin;
}

.selection-panel .option {
  aspect-ratio: 1 / 1;
  font-size: clamp(1rem, 4vw, 2rem);
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}

.selection-panel .option:hover {
  background-color: #ddd;
}

.cell.editable.active {
  background-color: #c8f7c5 !important; /* verde claro */
}



/* Bordes gruesos entre bloques */
.cell.top-border    { border-top: 2px solid black; }
.cell.left-border   { border-left: 2px solid black; }
.cell.right-border  { border-right: 2px solid black; }
.cell.bottom-border { border-bottom: 2px solid black; }

.cell.initial {
  background-color: #eee; /* solo las iniciales son grises */
  pointer-events: none;
}

.cell.editable {
  background-color: white; /* fondo blanco claro */
}


/* Celdas correctas marcadas por el validador */
.cell.incorrect {
  background-color: #fbb;
}



.game-wrapper {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 12px;
  background-color: #f9f9f9;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.05);
}


.sidebar .buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}


@media (max-width: 768px) {
  .game-wrapper {
    flex-direction: column;
    align-items: center;
  }

  .sidebar {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .sidebar .buttons {
    flex-direction: column;
    width: 100%;
    align-items: center;
  }

  .sidebar .buttons button {
    width: 80%;
    max-width: 300px;
  }

  .toggle {
    text-align: center;
    width: 100%;
  }
}

.board-wrapper {
  overflow-x: auto;
  max-width: 100%;
}


.board {
  width: 100%;
  max-width: 90vmin;
  margin: 1rem auto;
  display: grid;
  gap: 4px;
}


.cell {
  aspect-ratio: 1 / 1;           /* Cuadrada */
  font-size: clamp(0.9rem, 2.5vw, 1.4rem);
  text-align: center;
  vertical-align: middle;
  border: 1px solid #ccc;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 600px) {
  .cell {
    width: 50px;
    height: 50px;
    font-size: 1.4rem;
  }
}


.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-content {
  background-color: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  text-align: center;
  max-width: 300px;
  width: 90%;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background-color: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  text-align: center;
  max-width: 300px;
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: fadeIn 0.3s ease;
}


.modal-content button:hover {
  background-color: #0056b3;
}

.modal-footer button {
  margin-top: 0.5rem;
  padding: 0.5rem 1.2rem;
  border: none;
  background-color: #007bff;
  color: white;
  font-weight: 500;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.modal-footer button:hover {
  background-color: #0056b3;
}


@keyframes fadeIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.container button {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 0.5rem auto;
  padding: 0.8rem 1rem;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.container button:hover {
  background-color: #0056b3;
  transform: translateY(-2px);
}

.container button:active {
  transform: translateY(0);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}
