* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #f5f5f5;
  font-family: Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 10px;
}

.container {
  text-align: center;
  width: 100%;
  max-width: 450px;
}

h1 {
  margin-bottom: 15px;
  color: #333;
  font-size: clamp(1.3rem, 4vw, 1.8rem);
}

#timer {
  font-size: 18px;
  margin-bottom: 10px;
  color: #555;
}

#sudoku-board {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  gap: 1px;
  margin: 0 auto 15px;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 400px;
  border: 2px solid #333;
}

.cell {
  background: white;
  border: 1px solid #ccc;
  font-size: clamp(16px, 4vw, 24px);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s;
}

.cell.fixed {
  background: #f0f0f0;
  font-weight: bold;
  cursor: default;
}

.cell.selected {
  background: #d0f0ff;
}

/* Added highlight style */
.cell.highlight {
  background-color: #fffacd !important;
}

.cell:nth-child(3n) {
  border-right: 2px solid #333;
}

.cell:nth-child(9n) {
  border-right: none;
}

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

#number-pad {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  margin-bottom: 15px;
  max-width: 350px;
  margin-left: auto;
  margin-right: auto;
}

#number-pad button {
  background: #f0f0f0;
  border: 1px solid #ccc;
  font-size: 0.9rem;
  border-radius: 3px;
  cursor: pointer;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

#number-pad button:hover {
  background: #e0e0e0;
}

#number-pad button[data-number="0"] {
  grid-column: span 5;
  aspect-ratio: unset;
  padding: 6px 0;
}

.buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.buttons button {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  background-color: #3498db;
  color: white;
  font-weight: bold;
  cursor: pointer;
  font-size: 0.85rem;
}

.buttons button:hover {
  background-color: #2980b9;
}

@media (max-width: 420px) {
  #number-pad {
    max-width: 300px;
  }

  #number-pad button {
    font-size: 0.75rem;
  }
}
