* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 100%);
    color: #fff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-family: 'Press Start 2P', cursive;
    font-size: 3rem;
    color: #FFD700;
    text-shadow: 0 0 10px #FFD700, 0 0 20px #FFD700;
    margin-bottom: 10px;
}

header .subtitle {
    font-size: 1.2rem;
    color: #aaa;
    letter-spacing: 2px;
}

.game-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    margin-bottom: 30px;
}

.game-info {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 15px;
    padding: 25px;
    border: 2px solid #333;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.score-board {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.score-item {
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    border: 2px solid #333;
    transition: all 0.3s;
}

.score-item:hover {
    transform: translateY(-5px);
    border-color: #FFD700;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.score-item .label {
    display: block;
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 8px;
    font-weight: bold;
}

.score-item .value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #FFD700;
    font-family: 'Press Start 2P', cursive;
}

.controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.btn {
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    font-family: 'Roboto', sans-serif;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

.btn:active {
    transform: translateY(1px);
}

.btn-start {
    background: linear-gradient(145deg, #4CAF50, #2E7D32);
    color: white;
}

.btn-pause {
    background: linear-gradient(145deg, #FF9800, #EF6C00);
    color: white;
}

.btn-reset {
    background: linear-gradient(145deg, #f44336, #c62828);
    color: white;
}

.btn-sound {
    background: linear-gradient(145deg, #2196F3, #1565C0);
    color: white;
}

.instructions {
    background-color: rgba(30, 30, 46, 0.8);
    border-radius: 10px;
    padding: 20px;
    border-left: 5px solid #FFD700;
}

.instructions h3 {
    color: #FFD700;
    margin-bottom: 15px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.instructions p {
    margin-bottom: 12px;
    line-height: 1.5;
    color: #ddd;
}

.key {
    display: inline-block;
    background-color: #333;
    color: #FFD700;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    margin: 0 5px;
}

.ghost-icon, .fruit-icon {
    font-size: 1.2rem;
    margin: 0 5px;
}

.red {
    color: #FF5252;
}

.game-container {
    position: relative;
    flex: 1;
    min-width: 600px;
    max-width: 600px;
}

#game-canvas {
    background-color: #000;
    border-radius: 10px;
    border: 5px solid #333;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    display: block;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    z-index: 10;
}

.game-overlay h2 {
    font-family: 'Press Start 2P', cursive;
    font-size: 3rem;
    color: #FFD700;
    margin-bottom: 30px;
    text-align: center;
    text-shadow: 0 0 10px #FFD700;
}

.game-overlay p {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #fff;
    text-align: center;
}

#game-over {
    display: none;
}

#level-complete {
    display: none;
}

#start-screen {
    display: flex;
}

.press-start {
    font-size: 1.8rem;
    margin: 30px 0;
    color: #4CAF50;
    font-weight: bold;
}

.demo-instructions {
    margin-top: 30px;
    width: 80%;
}

.demo-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.pacman-demo {
    width: 30px;
    height: 30px;
    background-color: #FFD700;
    border-radius: 50%;
    margin-right: 20px;
    position: relative;
}

.pacman-demo::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 15px 0 15px 20px;
    border-color: transparent transparent transparent #000;
}

.ghost-demo {
    font-size: 1.8rem;
    margin-right: 20px;
}

.dot-demo {
    width: 10px;
    height: 10px;
    background-color: #FFD700;
    border-radius: 50%;
    margin-right: 25px;
    margin-left: 5px;
}

.power-demo {
    width: 20px;
    height: 20px;
    background-color: #FFD700;
    border-radius: 50%;
    margin-right: 20px;
    margin-left: 0;
    box-shadow: 0 0 10px #FFD700;
}

.fruit-demo {
    font-size: 1.8rem;
    color: #FF5252;
    margin-right: 20px;
}

footer {
    text-align: center;
    padding: 20px;
    color: #777;
    font-size: 0.9rem;
    border-top: 1px solid #333;
    margin-top: 20px;
}

footer p {
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 1100px) {
    .game-wrapper {
        flex-direction: column;
        align-items: center;
    }
    
    .game-info {
        max-width: 600px;
        width: 100%;
    }
    
    .game-container {
        min-width: 100%;
    }
    
    #game-canvas {
        width: 100%;
        height: auto;
    }
}

@media (max-width: 650px) {
    header h1 {
        font-size: 2rem;
    }
    
    .game-info {
        padding: 15px;
    }
    
    .score-board {
        grid-template-columns: 1fr;
    }
    
    .controls {
        grid-template-columns: 1fr;
    }
    
    .game-overlay h2 {
        font-size: 2rem;
    }
    
    .press-start {
        font-size: 1.2rem;
    }
}