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

#game-container {
    position: relative;
    width: 95vw;
    max-width: 550px;
    aspect-ratio: 11 / 15;
}


canvas {
    display: block;
    width: 100%;
    height: auto;
    border: 2px solid #333;
    background-color: #fff;
}


#score-display {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 20px;
    font-weight: bold;
}

#next-ball {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 16px;
    padding: 5px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 5px;
}

#game-over {
    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;
    display: none;
}

#restart-button {
    margin-top: 10px;
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#restart-button:hover {
    background-color: #45a049;
}

.con {
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    #game-container {
        height: auto;
        aspect-ratio: 11 / 15; /* 550 / 750 */
    }
}

/* Small screens (phones) – make it full height */
@media (max-width: 767px) {
    #game-container {
        height: 100vh;
        max-height: 100vh;
        width: auto;
    }

    canvas {
        height: 100vh;
        width: auto;
    }

    #score-display,
    #next-ball {
        font-size: 4vw;
    }

    #restart-button {
        font-size: 5vw;
    }

    #game-over h2,
    #final-score {
        font-size: 5.5vw;
    }
}