body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  position: relative; /* Penting untuk pseudo-element */
  overflow-x: hidden; /* Hindari scroll horizontal */
}

body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover; /* Menyesuaikan gambar dengan ukuran layar */
  background-position: center; /* Menyelaraskan gambar ke tengah */
  background-attachment: fixed; /* Membuat gambar tetap saat scroll */
  opacity: 0.5; /* Transparansi gambar latar belakang */
  z-index: -1; /* Menempatkan pseudo-element di belakang konten */
  transition: background-image 0.5s ease; /* Transisi lembut saat refresh */
  background-image: var(--background-image);
}

.content {
  text-align: center;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}


.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  max-width: 1200px;
  padding: 20px;
  grid-auto-flow: dense;
}

.gallery img {
  width: 100%;
  height: auto;
  border-radius: 15px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  object-fit: cover;
  animation: fadeIn 1.5s ease-out forwards;
  opacity: 0; /* Gambar dimulai transparan */
  transform: scale(0.9); /* Gambar dimulai dalam keadaan lebih kecil */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Atur ukuran gambar secara acak */
.gallery img:nth-child(3n) {
  grid-column: span 2;
}

.gallery img:nth-child(5n) {
  grid-row: span 2;
}

.gallery img:nth-child(7n) {
  grid-column: span 2;
  grid-row: span 2;
}

/* Efek hover */
.gallery img:hover {
  transform: scale(1.1); /* Zoom saat gambar di-hover */
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2); /* Bayangan lebih besar */
  z-index: 1;
}

/* Animasi masuk */
@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Animasi dengan jeda untuk setiap gambar */
.gallery img:nth-child(1) { animation-delay: 0.1s; }
.gallery img:nth-child(2) { animation-delay: 0.2s; }
.gallery img:nth-child(3) { animation-delay: 0.3s; }
.gallery img:nth-child(4) { animation-delay: 0.4s; }
.gallery img:nth-child(5) { animation-delay: 0.5s; }
.gallery img:nth-child(6) { animation-delay: 0.6s; }
.gallery img:nth-child(7) { animation-delay: 0.7s; }
.gallery img:nth-child(8) { animation-delay: 0.8s; }
.gallery img:nth-child(9) { animation-delay: 0.9s; }
.gallery img:nth-child(10) { animation-delay: 1s; }
.gallery img:nth-child(11) { animation-delay: 1.1s; }
.gallery img:nth-child(12) { animation-delay: 1.2s; }

/* Responsivitas dengan media queries */
@media (max-width: 1024px) {
  .gallery {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* Gambar lebih kecil */
    gap: 15px;
  }
}

@media (max-width: 768px) {
  .gallery {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); /* Kolom lebih rapat */
    gap: 10px;
  }

  .gallery img {
    border-radius: 10px; /* Sudut gambar lebih kecil */
  }
}

@media (max-width: 480px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr); /* 2 kolom saja */
    gap: 8px;
  }

  .gallery img {
    border-radius: 8px;
  }
}

#playPauseButton {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #2196F3;
  color: white;
  border: none;
  width: 40px;  
  height: 40px;  
  border-radius: 50%; 
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px; 
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#playPauseButton:hover {
  background-color: #1E88E5;
}

/* Menempatkan tombol di kanan bawah */
.controlButton {
  position: fixed;
  right: 20px;
  background-color: #FFD700; /* Warna kuning */
  color: white;
  border: none;
  width: 40px;  /* Ukuran tombol fix */
  height: 40px;  /* Ukuran tombol fix */
  border-radius: 50%;  /* Membuat tombol berbentuk bulat */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;  /* Ukuran ikon */
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

/* Hover effect untuk tombol */
.controlButton:hover {
  background-color: #FFC107; /* Warna kuning lebih terang saat hover */
}

/* Posisi tombol scroll */
#scrollButton {
  bottom: 80px;  /* Di atas tombol Play/Pause */
}