body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f0f0f0;
    margin: 0;
    touch-action: manipulation;
}

.container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: center;
    width: 90%;
    max-width: 600px;
}

canvas {
    border: 1px solid #000;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
}

.controls {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    margin-top: 20px;
}

.dpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    width: 150px;
    height: 150px;
}

.dpad button {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 10px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.dpad button:hover {
    background-color: #0056b3;
}

.dpad .up {
    grid-column: 2;
    grid-row: 1;
}

.dpad .down {
    grid-column: 2;
    grid-row: 3;
}

.dpad .left {
    grid-column: 1;
    grid-row: 2;
}

.dpad .right {
    grid-column: 3;
    grid-row: 2;
}

.ab-buttons {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    height: 150px;
}

.ab-buttons button {
    background-color: #dc3545;
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.ab-buttons button:hover {
    background-color: #c82333;
}

#gameOver,
#youWin {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

#gameOver h2,
#youWin h2 {
    margin-bottom: 10px;
}

#gameOver button,
#youWin button {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#gameOver button:hover,
#youWin button:hover {
    background-color: #0056b3;
}
