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

    body {
        font-family: 'Arial', sans-serif;
        background-color: #1a1a1a;
        color: #fff;
        text-align: center;
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100vh;
        flex-direction: column;
    }

    #game-container {
        width: 80%;
        max-width: 900px;
        margin-top: 20px;
    }

    h1 {
        font-size: 36px;
        margin-bottom: 20px;
    }

    canvas {
        background-color: #1e1e1e;
        border: 2px solid #fff;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
        display: block;
        margin: 0 auto;
    }

    p {
        font-size: 22px;
        margin-top: 10px;
        animation : fadeIn 1s ease-in-out;
        position: absolute;
        top: 70px;

    }

    span {
        font-size: 22px;
        color: #ffffff;
        margin-top: 10px;
        animation : fadeIn 1s ease-in-out;
        position: absolute;
        top: 50px;
        left: 20px;
    }

    #score {
        font-size: 26px;
        color: #ffffff;
        animation : fadeIn 1s ease-in-out;
        position: absolute;
        bottom: 1%;
        top: 12px;
    }

    #level {
        font-size: 22px;
        color: #ffffff;
        margin-top: 10px;
        animation : fadeIn 1s ease-in-out;
        position: absolute;
        top: 50px;
        right: 20px;
    }


    .game-button {
        margin-top: 20px;
        padding: 10px 20px;
        font-size: 18px;
        background-color: #4caf50;
        color: #fff;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        transition: background-color 0.3s ease;
    }

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

    .game-button:disabled {
        background-color: #9e9e9e;
        cursor: not-allowed;
    }

    #game-over-screen {
        display: none;
        text-align: center;
    }

    #game-over-screen p {
        font-size: 30px;
        color: #ffffff;
        position: absolute;
        top: -30px;
        text-align: center;
        animation : fadeIn 1s ease-in-out;
    }

    #restartButton {
        background-color: #2196f3;
    }

    #restartButton:hover {
        background-color: #041b59;
    }

    

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

body {
    font-family: Arial, sans-serif;
    background-image : url('waer.jpg');
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    flex-direction: column;
    color: #ecf0f1;
}

/* Game container */
#game-container {
    text-align: center;
    animation: fadeIn 1s ease-in-out;
}

h1 {
    font-size: 2em;
    color: #ffffff;
    margin-bottom: 20px;
}

/* Canvas */
#gameCanvas {
    background-image: url('bk.jpg');
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.7);
}

/* Score, level, and boss health */
p {
    font-size: 1.2em;
    margin: 5px 0;
}

/* Buttons */
.game-button {
    padding: 10px 20px;
    font-size: 1.2em;
    background-color: #e74c3c;
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.game-button:hover {
    background-color: #c0392b;
    transform: scale(1.1);
}

.game-button:active {
    transform: scale(0.95);
}

/* Game Over Screen */
#game-over-screen {
    display: none;
    text-align: center;
    font-size: 1.5em;
    color: #ffffff;
    animation: fadeIn 1s ease-in-out;
    position: absolute;
    top: 50%;
}

#game-over-screen p {
    margin-bottom: 20px;
}

/* Animation for fade-in effect */
@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth UI Transitions */
#startButton, #restartButton {
    animation: bounceIn 1s ease-out;
}

/* Bounce animation for buttons */
@keyframes bounceIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
    100% {
        transform: scale(1);
    }
}

/* Score and Level Animation */
#score, #level, #boss-health {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    0% {
        transform: translateX(-100px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Versi Desktop */
/* ... (CSS yang sudah ada) ... */

/* Versi Mobile */
@media only screen and (max-width: 768px) {
    body {
        font-size: 14px; /* Ukuran font lebih kecil untuk mobile */
    }

    h1 {
        font-size: 24px; /* Ukuran judul lebih kecil */
        margin-bottom: 10px;
    }

    #game-container {
        width: 95%; /* Lebih lebar untuk memanfaatkan layar kecil */
        margin-top: 10px;
    }

    canvas {
        width: 100%; /* Canvas menyesuaikan lebar layar */
        height: auto; /* Tinggi menyesuaikan */
    }

    p, span, #score, #level {
        font-size: 16px; /* Ukuran font lebih kecil untuk teks lainnya */
        position: static; /* Menghilangkan posisi absolut untuk tata letak yang lebih fleksibel */
        margin-top: 5px;
    }

    .game-button {
        padding: 8px 16px; /* Tombol lebih kecil */
        font-size: 16px;
        margin-top: 10px;
    }

    #game-over-screen p {
        font-size: 24px; /* Ukuran font lebih kecil untuk layar game over */
        position: static;
    }

    /* Menyesuaikan animasi untuk mobile */
    @keyframes fadeIn {
        0% {
            opacity: 0;
            transform: translateY(-10px);
        }
        100% {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @keyframes bounceIn {
        0% {
            transform: scale(0.7);
            opacity: 0;
        }
        50% {
            transform: scale(1.05);
            opacity: 1;
        }
        100% {
            transform: scale(1);
        }
    }

    @keyframes slideIn {
        0% {
            transform: translateX(-50px);
            opacity: 0;
        }
        100% {
            transform: translateX(0);
            opacity: 1;
        }
    }
}

#mobile-controls {
    display: none; /* Sembunyikan secara default */
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    height: 150px;
    pointer-events: none; /* Biarkan event sentuh melewati elemen ini */
}

/* Area Joystick */
#joystick-area {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 100px;
    height: 100px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    pointer-events: auto; /* Aktifkan event sentuh */
}

/* Joystick */
#joystick {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    transition: transform 0.1s ease;
}

/* Tombol Tembak */
#shoot-button {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 80px;
    height: 80px;
    background-color: rgba(255, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 16px;
    pointer-events: auto; /* Aktifkan event sentuh */
}

/* Tampilkan kontrol mobile hanya di perangkat dengan lebar layar kecil */
@media only screen and (max-width: 768px) {
    #mobile-controls {
        display: block;
    }
}

#tamatNotification {
    font-family: Arial, sans-serif;
    text-align: center;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    animation: fadeIn 1s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
