#main-container {
  margin-top: 20px;
}

header {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px 0;
  background: linear-gradient(135deg, #4a6fa5, #166088);
  color: white;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 10;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
}

.main-content {
  display: block;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: center;
  position: relative;
  z-index: 10;
}

.sudoku-container {
  flex: 1;
  max-width: 700px;
  position: relative;
}

.controls {
  flex: 1;
  max-width: 700px;
  background-color: white;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin-top: 30px;
}

.hero-section h2 {
  width: 100% !important;
}

.controls p {
  margin-bottom: 10px;
}

.sudoku-board {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  gap: 1px;
  background-color: #343a40;
  border: 2px solid #343a40;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 10;
}

.cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  border: 0.3px solid #343a40 !important;
}

.cell.fixed {
  background-color: #e9ecef;
  color: #343a40;
  font-weight: bold;
}

.cell.selected {
  background-color: #b3d9ff;
  color: #000;
}

/* .cell.highlighted {
  background-color: rgba(228, 244, 251, 0.972);
} */

.cell.incorrect {
  color: #ff5252;
}

.cell.correct {
  color: #000;
}

/* Border styling for 3x3 blocks */
.cell:nth-child(3n) {
  border-right: 2px solid #343a40;
}

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

/* .cell:nth-child(n+19):nth-child(-n+27),
.cell:nth-child(n+46):nth-child(-n+54) {
  border-bottom: 0.3px solid #343a40;
} */

.difficulty-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

button {
  padding: 10px 15px;
  border: none;
  border-radius: 5px;
  background-color: #4a6fa5;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 100px;
}

.number-btn {
  min-width: 86px !important;
  margin: 0 auto;
}

button:hover {
  background-color: #166088;
  transform: translateY(-2px);
}

button:active {
  transform: translateY(0);
}

.btn-easy {
  background-color: #8bc34a;
}

.btn-medium {
  background-color: #ffc107;
}

.btn-hard {
  background-color: #ff5252;
}

.btn-solve {
  background-color: #166088;
}

.btn-check {
  background-color: #6c757d;
}

.btn-new {
  background-color: #4a6fa5;
}

.number-pad {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.number-btn {
  font-size: 1.2rem;
  font-weight: bold;
}

.action-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 20px;
}

.stats {
  display: flex;
  justify-content: space-around;
  gap: 20px;
  margin-bottom: 15px;
}

.stat-box {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  text-align: center;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

/* Time box style */
.stat-time {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  font-size: 1.2rem;
  animation: pulse 1.5s infinite;
}

/* Mistakes box style */
.stat-mistakes {
  background: linear-gradient(135deg, #f8d7da, #f5c6cb);
  color: #721c24;
  font-size: 1.1rem;
}

/* Time pulsing effect */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.6);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
  }
}


footer {
  text-align: center;
  margin-top: 40px;
  padding: 20px;
  color: #6c757d;
}

/* Celebration Styles */
.celebration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(0,0,0,0.7), rgba(0,0,0,0.85));
  backdrop-filter: blur(2px);
  z-index: 999999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  flex: 0;
}

.celebration.active {
  opacity: 1;
  pointer-events: all;
}

.celebration-message {
  font-size: 4rem;
  font-weight: bold;
  color: white;
  text-align: center;
  margin-bottom: 2rem;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  transform: scale(0.5);
  opacity: 0;
  animation: zoomIn 0.8s forwards 0.3s;
}

.celebration-submessage {
  font-size: 1.5rem;
  color: white;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeIn 1s forwards 1s;
}

.celebration-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: #f00;
  opacity: 1;
  z-index: 99999999;
}

@keyframes zoomIn {
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}



.glow-text {
  margin-bottom: 50px;
}


.overlay-black {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 999;
}

.content-wrapper {
  position: relative;
  background-color: #fff8e1;
  border: 3px solid #fdd835; 
  border-radius: 12px;
  padding: 20px 30px;
  max-width: 600px;
  margin: 40px auto;
  box-shadow: 0 0 15px rgba(253, 216, 53, 0.5);
  z-index: 1000;
}


/* Responsive Design - Complete Breakpoints */

@media (max-width: 1299px) {
  .main-content {
    max-width: 1100px;
    padding: 20px;
  }

  .sudoku-container {
    max-width: 600px;
  }

  .controls {
    max-width: 600px;
  }

  .sudoku-board {
    max-width: 580px;
    max-height: 580px;
  }

  .cell {
    font-size: 1.4rem;
  }
}

@media (max-width: 992px) {
  .main-content {
    max-width: 900px;
    padding: 15px;
  }

  .sudoku-container {
    max-width: 500px;
  }

  .controls {
    max-width: 500px;
    padding: 20px;
  }

  .sudoku-board {
    max-width: 480px;
    max-height: 480px;
  }

  .cell {
    font-size: 1.3rem;
  }

  .difficulty-buttons,
  .number-pad,
  .action-buttons {
    gap: 8px;
  }

  button {
    padding: 8px 12px;
    font-size: 0.9rem;
  }
}

@media (max-width: 768px) {
  .main-content {
    width: 500px;
    padding: 15px;
  }

  .sudoku-container {
    max-width: 500px;
  }

  .controls {
    max-width: 500px;
    padding: 20px;
  }

  .sudoku-board {
    max-width: 500px;
    max-height: 480px;
  }

  .stats {
    flex-direction: row;
    gap: 20px;
  }

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

  .sudoku-container {
    margin-bottom: 20px;
  }

  .cell {
    font-size: 1.2rem;
  }

  .controls {
    margin-top: 20px;
    padding: 15px;
  }

  .difficulty-buttons {
    flex-direction: row;
    gap: 10px;
  }

  .difficulty-buttons button {
    width: 100%;
  }

  .number-pad {
    grid-template-columns: repeat(4, 1fr);
    max-width: 250px;
  }
  .number-btn{
    width: 105px;
  }

  .action-buttons {
    grid-template-columns: 1fr 1fr 1fr; 
    gap: 10px;
  }

  .celebration-message {
    font-size: 2.5rem;
  }

  .celebration-submessage {
    font-size: 1.2rem;
  }
}

@media (max-width: 600px) {
  #main-container {
    margin: 0 auto;
  }

  .main-content {
    width: 100%;
  }

  header {
    padding: 15px 0;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
  }

  h1 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .sudoku-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
  }

  .sudoku-board {
    width: 100%;
    margin: 0 auto;
  }

  .cell {
    font-size: 1.1rem;
  }

  .controls {
    width: 100%;
  }

  .controls h2 {
    font-size: 1.5rem;
  }

  .controls p {
    font-size: 0.9rem;
  }

  .stat-box {
    padding: 10px;
    font-size: 0.9rem;
  }

  button {
    padding: 10px;
    font-size: 0.85rem;
  }

  .celebration-message {
    font-size: 2rem;
  }

  .celebration-submessage {
    font-size: 1rem;
  }

  .difficulty-buttons {
    flex-direction: row;
    width: 100%;
  }

  .number-pad {
    grid-template-columns: repeat(4, 1fr);
    width: 250px;
  }
  
  .number-btn{
    width: 92px;
  }

  .action-buttons {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (max-width: 480px) {
  #main-container {
    margin: 0 auto;
  }

  .main-content {
    width: 100%;
  }

  .sudoku-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
  }

  .sudoku-board {
    width: 100%;
    max-width: 480px;
    max-height: 480px;
    margin: 0 auto;
  }

  .cell {
    font-size: 0.9rem;
  }

  .controls {
    margin: 20px auto 0;
  }

  header {
    padding: 10px 0;
    margin-bottom: 15px;
    width: 100%;
    box-sizing: border-box;
  }

  h1 {
    font-size: 1.5rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .controls h2 {
    font-size: 1.3rem;
  }

  .controls p {
    font-size: 0.8rem;
  }

  .stat-box {
    padding: 8px;
    font-size: 0.8rem;
  }

  button {
    padding: 8px;
    font-size: 0.8rem;
  }

  .number-pad {
    grid-template-columns: repeat(3, 1fr);
    max-width: 280px;
    gap: 8px;
  }

  .number-pad .number-btn {
    width: 100%;
    height: auto;
    font-size: 1rem;
  }

  .action-buttons {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0px auto 0;
    gap: 8px;
  }

  .difficulty-buttons {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .celebration-message {
    font-size: 1.5rem;
  }

  .celebration-submessage {
    font-size: 0.9rem;
  }
}

@media (max-width: 400px) {

  .sudoku-container,
  .controls {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 10px;
    box-sizing: border-box;
  }
  .controls{
    margin-top: 20px !important;
  }

  .sudoku-board {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
  }

  .number-pad {
    grid-template-columns: repeat(3, 1fr);
    max-width: 100%;
    gap: 6px;
  }

  .number-btn {
    width: 100%;
    font-size: 1rem;
  }

  button {
    padding: 8px 10px;
  }
}

@media (max-width: 350px) {
  #main-container {
    margin: 0 auto;
    padding: 0 5px;
  }

  .main-content {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 5px;
  }

  .sudoku-container,
  .controls {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 5px;
    box-sizing: border-box;
  }

  .sudoku-board {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
  }

  .cell {
    font-size: 0.8rem;
  }
}

@media (max-width: 320px) {
  #main-container {
    margin: 0 auto;
    padding: 0 5px;
  }

  .main-content {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 5px;
  }

  .sudoku-container,
  .controls {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 5px;
    box-sizing: border-box;
  }

  .sudoku-board {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
  }

  .cell {
    font-size: 0.75rem;
  }

  .controls {
    padding: 10px 5px;
  }

  button {
    padding: 6px 8px;
    font-size: 0.75rem;
  }
}



