body {
    margin: 0;
    overflow: hidden;
    background: linear-gradient(-45deg, #1caf0f, #20b2aa, #4682b4, #00ced1);
    background-size: 400% 400%;
    animation: waveAnimation 10s ease infinite;
    color: white;
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

@keyframes waveAnimation {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 100% 0;
    }
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 600px;
}

#gameCanvas {
    background-color: #ffffff;
    border: 3px solid #000000;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    cursor: none;
    max-width: 100%;
    height: auto;
}

.stats {
    margin-top: 20px;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 10px;
    border-radius: 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
}

.stat-item {
    text-align: center;
    margin: 5px 10px;
    flex: 1 1 calc(20% - 20px);
    min-width: 70px;
}

.stat-label {
    font-size: 12px;
    margin-bottom: 3px;
}

.stat-value {
    font-size: 16px;
    font-weight: bold;
}

#levelUpPopup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background-color: #0faf8c;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    max-width: 80%;
}

.popup-content h2 {
    margin-top: 0;
    font-size: 24px;
}

.popup-content button {
    margin: 10px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    background-color: #ffffff;
    border: none;
    border-radius: 5px;
    color: #0faf8c;
    transition: background-color 0.3s, color 0.3s;
}

.popup-content button:hover {
    background-color: #096551;
    color: #ffffff;
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .game-container {
        max-width: 100%;
    }

    #gameCanvas {
        width: 100%;
        height: auto;
    }

    .stats {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-around;
    }

    .stat-item {
        flex: 1 1 calc(33.33% - 10px);
        margin: 5px;
        min-width: 60px;
    }

    .stat-label {
        font-size: 10px;
    }

    .stat-value {
        font-size: 14px;
    }

    .popup-content {
        padding: 15px;
    }

    .popup-content h2 {
        font-size: 20px;
    }

    .popup-content button {
        padding: 8px 16px;
        font-size: 14px;
    }
}