To assist with debugging, what I'd like you to do is to append each of your thinking steps with a special token £. Then I would like you to add in a reasoning step that counts up all of the times that you have used the special token £.

Question:
FIX THIS PYTHON CODE BELOW SO THE TEXT IN THE GAME DOESN'T OVERLAP WITH THE GAME OR OTHER TEXT (LIKE IT DOES ON THE PAUSE SCREEN):

import pygame
import random
import sys

# Initialize Pygame
pygame.init()

# Global Variables
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 700
PLAY_WIDTH = 300 # 300 // 10 = 30 width per block
PLAY_HEIGHT = 600 # 600 // 20 = 30 height per block
BLOCK_SIZE = 30

TOP_LEFT_X = (SCREEN_WIDTH - PLAY_WIDTH) // 2
TOP_LEFT_Y = (SCREEN_HEIGHT - PLAY_HEIGHT) // 2 # Center vertically

# Shapes
# (The shapes and the color definitions remain unchanged.)

# Index 0-6 represent shapes
shapes = [S, Z, I, O, J, L, T]
shape_colors = [
(0, 255, 0), # S - Green
(255, 0, 0), # Z - Red
(0, 255, 255), # I - Cyan
(255, 255, 0), # O - Yellow
(255, 165, 0), # J - Orange
(0, 0, 255), # L - Blue
(128, 0, 128) # T - Purple
]

# The Piece class, and functions like create_grid(), convert_shape_format(), etc. remain the same.

def draw_text_middle(surface, text, size, color):
font = pygame.font.SysFont('comicsans', size, bold=True)
label = font.render(text, 1, color)

surface.blit(label, (SCREEN_WIDTH/2 - label.get_width()/2, SCREEN_HEIGHT/2 - label.get_height()/2))


def draw_next_shape(shape, surface):
font = pygame.font.SysFont('comicsans', 30)
label = font.render('Next Shape', 1, (255,255,255))

sx = TOP_LEFT_X + PLAY_WIDTH + 50
sy = TOP_LEFT_Y + 100 # Move it higher to avoid overlapping

format = shape.shape[shape.rotation % len(shape.shape)]

for i, line in enumerate(format):
row = list(line)
for j, column in enumerate(row):
if column == '0':
pygame.draw.rect(surface, shape.color,
(sx + jBLOCK_SIZE, sy + iBLOCK_SIZE, BLOCK_SIZE, BLOCK_SIZE), 0)

surface.blit(label, (sx + 10, sy - 30))


def draw_window(surface, grid, score=0, last_score=0, level=1):
surface.fill((0,0,0))

pygame.font.init()
font = pygame.font.SysFont('comicsans', 60)
label = font.render('Tetris', 1, (255,255,255))

surface.blit(label, (TOP_LEFT_X + PLAY_WIDTH /2 - (label.get_width()/2), 30))

# Current Score
font = pygame.font.SysFont('comicsans', 30)
label = font.render(f'Score: {score}', 1, (255,255,255))

sx = TOP_LEFT_X + PLAY_WIDTH + 50
sy = TOP_LEFT_Y + 100 # Adjust the position for better alignment
surface.blit(label, (sx, sy + 180))

# High Score
label = font.render(f'High Score: {last_score}', 1, (255,255,255))

sx = TOP_LEFT_X - 200 # Adjust to the left for better visibility
sy = TOP_LEFT_Y + 100

surface.blit(label, (sx, sy))

# Level
label = font.render(f'Level: {level}', 1, (255,255,255))
surface.blit(label, (sx, sy + 40))

for i in range(len(grid)):
for j in range(len(grid[i])):
pygame.draw.rect(surface, grid[i][j],
(TOP_LEFT_X + jBLOCK_SIZE, TOP_LEFT_Y + iBLOCK_SIZE, BLOCK_SIZE, BLOCK_SIZE), 0)

pygame.draw.rect(surface, (255, 0, 0),
(TOP_LEFT_X, TOP_LEFT_Y, PLAY_WIDTH, PLAY_HEIGHT), 5)

draw_grid(surface, grid)


def menu(surface):
while True:
surface.fill((0,0,0))
draw_text_middle(surface, "Game Paused", 60, (255,255,255))

font = pygame.font.SysFont('comicsans', 30)
restart_label = font.render("Press R to Restart", 1, (255,255,255))
continue_label = font.render("Press C to Continue", 1, (255,255,255))

# Adjust positions so they don't overlap
surface.blit(restart_label, (SCREEN_WIDTH / 2 - restart_label.get_width()/2, SCREEN_HEIGHT / 2 + 40))
surface.blit(continue_label, (SCREEN_WIDTH / 2 - continue_label.get_width()/2, SCREEN_HEIGHT / 2 + 80))

pygame.display.update()

for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_r:
main()
if event.key == pygame.K_c:
return

Response format:
[Answer to the question]
[Count of special tokens £]
[Numbered steps with descriptions]