
body {
    background-color: #0f172a;
    font-family: Arial, sans-serif;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    overflow: hidden; /* Supaya tidak scroll */
}

#game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    background: #1e293b;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 12px 24px rgba(0,0,0,0.6);
}

#score {
    font-size: 24px;
    letter-spacing: 1px;
}

canvas {
    background: linear-gradient(135deg, #1e293b, #334155);
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.5);
}

/* Group kedua tombol */
#buttonGroup {
    display: flex;
    gap: 12px;
}

/* Styling dua tombol */
#submitButton, #leaderboardButton {
    background-color: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}
#submitButton:hover, #leaderboardButton:hover {
    background-color: #059669;
}

/* Modal style */
.modal {
    display: none;
    position: fixed;
    z-index: 10;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
}

.modal-content {
    background-color: #1e293b;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 400px;
    border-radius: 8px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}
.close:hover {
    color: white;
}
#leaderboardList {
    list-style: none;
    padding: 0;
}
#leaderboardList li {
    padding: 6px 0;
    border-bottom: 1px solid #334155;
}
.modal-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
#restartButton {
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}
#restartButton:hover {
    background-color: #2563eb;
}
#leaderboardTabs {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
    gap: 10px;
}
.leaderboard-tab {
    background-color: #475569;
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
}
.leaderboard-tab.active,
.leaderboard-tab:hover {
    background-color: #0ea5e9;
}

@media (max-width: 480px) {
    #game-container {
        width: 95%;
        padding: 16px;
    }

    canvas {
        width: 100% !important;
        height: auto !important;
    }

    #buttonGroup {
        flex-direction: column;
        width: 100%;
    }

    #submitButton, #leaderboardButton, #restartButton {
        width: 100%;
        padding: 10px;
        font-size: 14px;
    }

    .modal-content {
        width: 95%;
    }
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0ea5e9;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
    margin: auto;
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }

  .highlight {
    animation: highlightAnim 2s ease forwards;
    background-color: #4ade80; /* Warna hijau muda */
    color: black;
    border-radius: 4px;
  }
  
  @keyframes highlightAnim {
    0% {
      background-color: #4ade80;
      color: black;
    }
    100% {
      background-color: transparent;
      color: white;
    }
  }

  .small-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0ea5e9;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
  }

  .top-score {
    background: linear-gradient(90deg, #facc15, #fbbf24);
    color: black;
    font-weight: bold;
    border-radius: 6px;
    padding: 6px 6px 6px 32px; /* ⬅️ Padding kiri lebih besar! */
    margin-bottom: 4px;
    position: relative;
  }
  
  .toastify {
    opacity: 0;
    transform: translateY(-20px);
    animation: fadeInDown 0.5s forwards, fadeOutUp 0.5s forwards 3.5s;
  }
  
  /* Animasi masuk (fade + slide down) */
  @keyframes fadeInDown {
    0% {
      opacity: 0;
      transform: translateY(-20px);
    }
    100% {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* Animasi keluar (fade + slide up) */
  @keyframes fadeOutUp {
    0% {
      opacity: 1;
      transform: translateY(0);
    }
    100% {
      opacity: 0;
      transform: translateY(-20px);
    }
  }
  