.board-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.puzzle-board {
  position: relative;
  display: grid;
  gap: 6px;
  background: var(--board-bg);
  border-radius: var(--radius-lg);
  padding: 8px;
  box-shadow: var(--shadow-md);
  user-select: none;
  touch-action: none;
}

.puzzle-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-radius: var(--radius-md);
  font-weight: 800;
  color: var(--text-strong);
  cursor: pointer;
  transition: background .15s ease, transform .08s ease;
  box-shadow: var(--shadow-sm);
  aspect-ratio: 1;
  line-height: 1;
}
.puzzle-tile:hover:not(.blank) { background: var(--surface-hover); }
.puzzle-tile:active:not(.blank) { transform: scale(0.93); }
.puzzle-tile.blank {
  background: transparent;
  box-shadow: none;
  cursor: default;
  pointer-events: none;
}
.puzzle-tile.adjacent {
  background: var(--accent-soft);
  color: var(--text-strong);
}
.puzzle-tile.adjacent:hover { background: var(--accent); }
.puzzle-tile.adjacent {
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  color: #fff;
}
.puzzle-tile:not(.blank) {
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.25);
  font-size: clamp(18px, 5vmin, 28px);
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-hover) 100%);
}

.solved-overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: var(--radius-md);
  animation: fadein .3s ease;
  z-index: 10;
}
.solved-overlay[hidden] { display: none; }
.solved-text {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-strong);
}
.solved-sub {
  font-size: 15px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
