* {
    margin: 0; padding: 0; box-sizing: border-box;
    user-select: none; -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body, html {
    width: 100%; height: 100%; overflow: hidden;
    background-color: #222;
    font-family: 'Segoe UI', sans-serif;
    overscroll-behavior: none; touch-action: none; 
    display: flex; justify-content: center; align-items: center;
}

#game-container {
    position: relative; width: 100%; height: 100%;
    background-color: #70c5ce;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

canvas { display: block; width: 100%; height: 100%; }

#ui-layer {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}

#score-display {
    position: absolute; top: 10%;
    font-size: 4rem; color: white; font-weight: 900;
    text-shadow: 3px 3px 0 #000; z-index: 10;
    display: none; /* Sembunyikan skor saat di menu */
}

#start-screen, #game-over-screen {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 20px;
    border: 4px solid #000;
    color: #333;
    text-align: center;
    pointer-events: auto;
    box-shadow: 10px 10px 0 rgba(0,0,0,0.2);
    width: 85%; /* Agar tidak terlalu lebar di HP */
    max-width: 350px;
}

h1 { font-weight: 900; margin-bottom: 10px; font-size: 2rem; }
p { font-weight: bold; color: #666; margin-bottom: 20px; }

/* GRID TOMBOL */
.btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 Kolom */
    gap: 10px;
}

.btn {
    border: 3px solid #000;
    padding: 12px;
    font-size: 1rem;
    font-weight: 900;
    border-radius: 10px;
    cursor: pointer;
    color: #fff;
    box-shadow: 0 4px 0 rgba(0,0,0,0.2);
    transition: transform 0.1s;
    text-transform: uppercase;
}

.btn:active { transform: translateY(4px); box-shadow: none; }

/* WARNA TOMBOL */
.btn-easy { background: #2ecc71; }    /* Hijau */
.btn-medium { background: #f1c40f; color: #000; }  /* Kuning */
.btn-hard { background: #e74c3c; }    /* Merah */
.btn-advance { background: #8e44ad; } /* Ungu */
.btn-restart { background: #3498db; width: 100%; margin-top: 10px; } /* Biru */

@media (min-width: 768px) {
    #game-container {
        width: 420px; height: 85vh;
        border-radius: 30px; border: 10px solid #111;
    }
}

/* --- TAMBAHAN UNTUK INFO & MODAL --- */

/* Group Tombol Kecil di Bawah */
.info-group {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.btn-small {
    background: #ecf0f1;
    border: 2px solid #bdc3c7;
    padding: 8px 15px;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 20px;
    cursor: pointer;
    color: #555;
    transition: background 0.2s;
}

.btn-small:hover { background: #dfe6e9; }

/* MODAL SYSTEM (POP-UP) */
.modal {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Latar gelap transparan */
    z-index: 100; /* Paling depan */
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto; /* Bisa diklik */
    backdrop-filter: blur(3px); /* Efek blur keren */
}

.modal-content {
    background: white;
    padding: 25px;
    border-radius: 15px;
    border: 3px solid #333;
    width: 85%;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    animation: popUp 0.3s ease-out;
}

.modal-content h2 { margin-bottom: 15px; color: #2c3e50; border-bottom: 2px solid #eee; padding-bottom: 10px; }
.modal-content ul { text-align: left; padding-left: 20px; margin-bottom: 20px; font-size: 0.9rem; color: #555; }
.modal-content li { margin-bottom: 5px; }

.btn-close {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 50px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 3px 0 #c0392b;
}

.btn-close:active { transform: translateY(2px); box-shadow: none; }

.btn-link {
    background: none; border: none;
    color: #3498db; text-decoration: underline;
    cursor: pointer; font-size: 0.9rem;
}

@keyframes popUp {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}