/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ===== Container principal ===== */
.sudoku-container {
  max-width: 500px;
  margin: 20px auto;
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ===== Grid do Sudoku ===== */
.sudoku-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 2px;
  background-color: #333;
  border: 2px solid #333;
  margin-bottom: 15px;
}

.sudoku-grid .cell {
  background-color: #f9f9f9;
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  cursor: pointer;
  border: 1px solid #ccc;
  transition: background 0.2s, color 0.2s;
  user-select: none;
}

.sudoku-grid .cell.selected {
  background-color: #d1eaff;
}

.sudoku-grid .cell.prefilled {
  font-weight: bold;
  color: #000;
}

.sudoku-grid .cell.error {
  color: #f00;
}

/* Bordas mais grossas a cada 3 células */
.sudoku-grid .cell:nth-child(3n) {
  border-right: 2px solid #333;
}

.sudoku-grid .cell:nth-child(n+19):nth-child(-n+27),
.sudoku-grid .cell:nth-child(n+46):nth-child(-n+54) {
  border-bottom: 2px solid #333;
}

/* ===== Barra de informações ===== */
.info-bar {
  display: flex;
  justify-content: space-around;
  width: 100%;
  max-width: 500px;
  margin-bottom: 15px;
  font-weight: bold;
  font-size: 0.9rem;
  color: #333;
}

/* ===== Barra de ações ===== */
.action-bar {
  display: flex;
  justify-content: space-around;
  width: 100%;
  margin-bottom: 10px;
}

.circle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background-color: #007bff;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s;
}

.circle-btn:hover {
  background-color: #0056b3;
}

/* ===== Number Pad ===== */
.number-pad {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 5px;
  width: 100%;
  max-width: 500px;
  margin-bottom: 20px;
}

.number-pad button {
  width: 100%;
  aspect-ratio: 1;
  border: none;
  background-color: #f0f0f0;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
}

.number-pad button:hover {
  background-color: #ddd;
}

/* ===== Overlay (pausa / vitória) ===== */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 100;
  justify-content: center;
  align-items: center;
}

.overlay-content {
  background: #fff;
  padding: 20px 30px;
  text-align: center;
  border-radius: 8px;
}

.overlay button {
  margin-top: 15px;
  padding: 8px 15px;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  background-color: #007bff;
  color: #fff;
  border-radius: 5px;
}

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

/* ===== Header ===== */
.sudoku-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 500px;
  margin: 0 auto 10px auto;
  padding: 10px;
}

.sudoku-header .logo {
  font-size: 1.2rem;
  font-weight: bold;
}

.sudoku-header button {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
}

/* ===== Responsivo ===== */
@media (max-width: 400px) {
  .circle-btn {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }

  .number-pad button {
    font-size: 0.9rem;
  }

  .sudoku-grid .cell {
    font-size: 1rem;
  }
}
