/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: hsl(220, 13%, 9%); /* Dark blue-black background */
    color: hsl(0, 0%, 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* Game container */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 1rem;
}

.title {
    font-size: 2.5rem;
    font-weight: bold;
    color: hsl(48, 100%, 67%); /* Pacman yellow */
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px hsl(48, 100%, 67%);
}

.instructions {
    color: hsl(220, 9%, 65%);
    font-size: 1rem;
}

/* Stats container */
.stats-container {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background-color: hsl(220, 13%, 12%);
    padding: 1.5rem 2rem;
    border-radius: 0.5rem;
    border: 1px solid hsl(221, 83%, 53%);
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-size: 0.875rem;
    color: hsl(220, 9%, 65%);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: hsl(48, 100%, 67%); /* Primary yellow */
}

.stat-value.level {
    color: hsl(221, 83%, 53%); /* Secondary blue */
}

.stat-value.win {
    color: hsl(48, 100%, 67%); /* Primary yellow for win */
}

.stat-value.game-over {
    color: hsl(0, 100%, 60%); /* Red for game over */
}

/* Game board container */
.game-board-container {
    display: inline-block;
    border: 2px solid hsl(221, 83%, 53%);
    border-radius: 0.5rem;
    padding: 0.5rem;
    background-color: hsl(220, 13%, 12%);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Game board */
.game-board {
    display: grid;
    grid-template-columns: repeat(20, 1fr);
    gap: 0;
}

/* Game cells */
.cell {
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.cell.wall {
    background-color: hsl(221, 83%, 53%); /* Blue walls */
    border: 1px solid hsl(221, 83%, 53%);
}

.cell.empty {
    background-color: hsl(220, 13%, 9%);
}

/* Dots */
.dot {
    width: 0.375rem;
    height: 0.375rem;
    background-color: hsl(0, 0%, 95%); /* White dots */
    border-radius: 50%;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Pacman */
.pacman {
    width: 1.25rem;
    height: 1.25rem;
    background-color: hsl(48, 100%, 67%); /* Pacman yellow */
    border-radius: 50%;
    border: 2px solid hsla(48, 100%, 67%, 0.2);
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    position: relative;
    z-index: 10;
}

/* Restart button */
.restart-container {
    margin-top: 1.5rem;
    text-align: center;
}

.restart-button {
    background-color: hsl(48, 100%, 67%);
    color: hsl(220, 13%, 9%);
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 0.375rem;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.restart-button:hover {
    background-color: hsl(48, 100%, 60%);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.restart-button:active {
    transform: translateY(0);
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .stats-container {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stat-card {
        padding: 1rem 1.5rem;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .cell {
        width: 1.25rem;
        height: 1.25rem;
    }
    
    .pacman {
        width: 1rem;
        height: 1rem;
    }
    
    .dot {
        width: 0.25rem;
        height: 0.25rem;
    }
}