* {
  user-select: none;
}

body {
  background: linear-gradient(145deg, #e9eef3 0%, #dbe2ea 100%);
  min-height: 100vh;
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

.sudoku-card {
  border-radius: 2rem;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(2px);
  box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.2);
  border: none;
}

.sudoku-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  background-color: #2c3e4e;
  border: 3px solid #1e2f3a;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
  aspect-ratio: 1 / 1;
  max-width: 550px;
  margin: 0 auto;
}

.sudoku-cell {
  background-color: #fef9e8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 500;
  font-family: 'Courier New', 'Fira Code', monospace;
  cursor: pointer;
  transition: all 0.05s linear;
  border: 1px solid #cddde9;
  color: #1f3b4a;
}

.sudoku-cell[data-row="2"]:not([data-col="9"]),
.sudoku-cell[data-row="5"]:not([data-col="9"]) {
  border-bottom: 3px solid #2c3e4e;
}

.sudoku-cell[data-col="2"]:not([data-row="9"]),
.sudoku-cell[data-col="5"]:not([data-row="9"]) {
  border-right: 3px solid #2c3e4e;
}

.sudoku-cell.selected {
  background-color: #ffe0a3;
  box-shadow: inset 0 0 0 2px #f5a623;
  transform: scale(0.98);
  z-index: 2;
}

.sudoku-cell.given {
  color: #1e6f5c;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

.sudoku-cell.user-number {
  color: #2c5282;
  font-weight: 600;
}

.sudoku-cell.conflict {
  background-color: #ffb3b3;
  color: #b00020;
  text-decoration: underline;
}

.sudoku-cell.completed-win {
  background-color: #c8e6c9;
  transition: background-color 0.3s ease;
}

.number-pad {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 20px 0 10px;
}

.pad-btn {
  width: 70px;
  height: 70px;
  font-size: 2rem;
  font-weight: bold;
  border-radius: 40px;
  background: white;
  border: none;
  box-shadow: 0 5px 0 #bac8d9;
  transition: 0.07s linear;
  color: #1f4e6e;
}

.pad-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #bac8d9;
}

.btn-icon-action {
  border-radius: 40px;
  padding: 8px 20px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.difficulty-badge {
  cursor: pointer;
  transition: all 0.2s;
}

.difficulty-badge.active {
  background-color: #0d6efd !important;
  color: white !important;
  box-shadow: 0 0 0 2px white, 0 0 0 4px #0d6efd;
}

.game-header {
  border-bottom: 2px dashed #cbdbe2;
}

footer {
  font-size: 0.8rem;
}

#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.2s;
  text-align: center;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1f4e6e;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6c757d;
}

.achievement-badge {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  background: #f0f0f0;
  color: #adb5bd;
  transition: all 0.3s;
  border: 3px solid #e0e0e0;
  cursor: default;
}

.achievement-badge.unlocked {
  background: #ffd700;
  color: #856404;
  border-color: #ffc107;
  box-shadow: 0 0 15px rgba(255, 193, 7, 0.3);
}

.achievement-badge.unlocked:hover {
  transform: scale(1.1);
}

.achievement-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #f8f9fa;
  transition: all 0.2s;
}

.achievement-item.unlocked {
  background: #fff3cd;
}

.achievement-item .achievement-info {
  flex: 1;
}

.achievement-item .achievement-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.achievement-item .achievement-desc {
  font-size: 0.8rem;
  color: #6c757d;
}

.streak-flame {
  animation: pulse 1s infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

.progress {
  height: 6px;
  border-radius: 3px;
}

@media (max-width: 550px) {
  .sudoku-cell {
    font-size: 1.2rem;
  }

  .pad-btn {
    width: 55px;
    height: 55px;
    font-size: 1.6rem;
  }

  .btn-icon-action {
    padding: 5px 12px;
    font-size: 0.8rem;
  }

  .stat-number {
    font-size: 1.3rem;
  }

  .achievement-badge {
    width: 45px;
    height: 45px;
    font-size: 1.4rem;
  }
}