/* index.css */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Arial", sans-serif;
}

body {
  background-color: #f8f4e1;
  color: #4e1f00;
}

.main-content {
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

/* Preloader */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #4e1f00;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.preloader-logo {
  width: 120px;
  max-width: 30vw;
  height: auto;
  margin-bottom: 20px;
  display: block;
}

.preloader-glow {
  width: 50px;
  height: 50px;
  background-color: #feba17;
  border-radius: 50%;
  animation: glowPulse 1.5s infinite;
}

@keyframes slideUp {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-100%);
    opacity: 0;
  }
}

#preloader.slide-up {
  animation: slideUp 1s ease forwards;
}

@keyframes glowPulse {
  0% {
    box-shadow: 0 0 10px #feba17;
  }
  50% {
    box-shadow: 0 0 30px #feba17;
  }
  100% {
    box-shadow: 0 0 10px #feba17;
  }
}

/* Scroll Animation */
section {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

section.visible {
  opacity: 1;
  transform: translateY(0px);
}

/* Hero Section */
.hero {
  height: 100vh;
  background: url("../assets/gambar1.png") no-repeat center center/cover;
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-content h1 {
  font-size: 100px;
  text-transform: uppercase;
  color: #feba17;
  text-shadow: 2px 2px 10px rgba(78, 31, 0, 0.8);
}

.hero-content p {
  font-size: 30px;
  margin: 20px 0;
  color: #603705;
}

.hero-content .typewriter {
  overflow: hidden;
  white-space: nowrap;
  animation: typing 3.5s steps(40, end), hide-caret 0s 3.5s forwards;
  border-right: 2px solid #feba17;
}

.hero-content {
  transform: translateY(150px); /* Bisa kamu sesuaikan */
}

/* Animasi mengetik */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

/* Animasi untuk menghilangkan garis setelah selesai */
@keyframes hide-caret {
  to {
    border-right: none;
  }
}

.cta-button {
  padding: 15px 40px;
  font-size: 18px;
  background-color: #feba17;
  border: none;
  color: #4e1f00;
  cursor: pointer;
  border-radius: 5px;
  text-decoration: none;
  transition: background-color 0.3s, transform 0.3s;
}

.cta-button:hover {
  background-color: #74512d;
  color: #f8f4e1;
  transform: scale(1.05);
}

.logo-img {
  height: 70px;
}

.features {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
}

.feature-card {
  background-color: #4e1f00;
  padding: 20px;
  border-radius: 10px;
  width: 250px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
  transform: translateY(-10px) scale(1.03);
  box-shadow: 0 0 20px rgba(254, 186, 23, 0.7);
}

.feature-card h3 {
  font-size: 24px;
  margin-bottom: 10px;
  color: #feba17;
}

.feature-img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 10px;
}

/* Specs Section */
.specs {
  padding: 100px 50px;
  text-align: center;
  background-color: #f8f4e1;
}

.specs h2 {
  font-size: 48px;
  margin-bottom: 20px;
  color: #feba17;
}

.specs p {
  font-size: 18px;
  max-width: 800px;
  margin: 0 auto 30px;
  color: #74512d;
}

.spec-buttons button {
  background-color: #feba17;
  border: none;
  padding: 12px 30px;
  margin: 10px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 8px;
  color: #fff;
  transition: background-color 0.3s ease;
}

.spec-buttons button:hover {
  background-color: #d49100;
}

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

.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 30px;
  border-radius: 10px;
  width: 80%;
  max-width: 600px;
  color: #333;
  text-align: left;
}

.modal-content h3 {
  margin-top: 0;
  color: #feba17;
}

.modal-content ul {
  padding-left: 20px;
}

.modal-content ul li {
  margin-bottom: 10px;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: #000;
}

/* Mechanics Section */
.mechanics {
  padding: 100px 50px;
  text-align: center;
  background-color: #74512d;
  color: #f8f4e1;
}

.mechanics h2 {
  font-size: 48px;
  margin-bottom: 20px;
  color: #feba17;
}

.mechanics p {
  font-size: 18px;
  max-width: 800px;
  margin: 0 auto 40px;
}

.mechanics-grid {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.mechanics-card {
  background-color: #4e1f00;
  padding: 20px;
  border-radius: 10px;
  width: 250px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.mechanics-card:hover {
  transform: translateY(-10px) scale(1.03);
  box-shadow: 0 0 20px rgba(254, 186, 23, 0.7);
}

.mechanics-card h2 {
  font-size: 24px;
  margin-bottom: 10px;
  color: #feba17;
}

.mechanics-card p {
  font-size: 16px;
}

.gameplay-preview {
  max-width: 800px;
  margin: 0 auto;
}

.gameplay-preview video {
  width: 100%;
  border-radius: 10px;
}
.audio-btn-nav {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 8px 12px;
  transition: transform 0.2s;
}

.audio-btn-nav:hover {
  transform: scale(1.2);
}

.audio-btn-nav i {
  pointer-events: none; /* biar icon ga ganggu klik */
}

/* Footer */
footer {
  text-align: center;
  padding: 20px;
  background-color: #4e1f00;
  color: #f8f4e1;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
  .hero {
    background-attachment: scroll;
  }

  .hero-content h1 {
    font-size: 48px;
  }

  .hero-content p {
    font-size: 18px;
  }

  .features,
  .mechanics-grid,
  .news-grid {
    flex-direction: column;
    align-items: center;
  }

  .feature-card,
  .mechanics-card,
  .news-card {
    width: 100%;
    max-width: 300px;
  }

  .story-visual img {
    height: 200px;
  }

  .about,
  .mechanics,
  .latest-news,
  .download {
    padding: 80px 20px;
  }

  .games {
    padding: 80px 20px;
  }

  .games-grid {
    flex-direction: column;
    align-items: center;
  }

  .game-card {
    width: 100%;
    max-width: 300px;
  }

  .modal-content {
    width: 90%;
    padding: 20px;
    max-height: 90vh;
  }
}

/* Game Section */
.games {
  padding: 100px 50px;
  text-align: center;
  background-color: #f8f4e1;
  color: #74512d;
}

.games h2 {
  font-size: 48px;
  margin-bottom: 20px;
  color: #feba17;
}

.games p {
  font-size: 18px;
  max-width: 800px;
  margin: 0 auto 40px;
}

.games-grid {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
}

.game-card {
  background-color: #4e1f00;
  padding: 20px;
  border-radius: 10px;
  width: 250px;
  transition: transform 0.3s, box-shadow 0.3s;
  color: #f8f4e1;
}

.game-card:hover {
  transform: translateY(-10px) scale(1.03);
  box-shadow: 0 0 20px rgba(254, 186, 23, 0.7);
}

.game-img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 10px;
}

.game-card h3 {
  font-size: 24px;
  margin-bottom: 10px;
  color: #feba17;
}

.game-card p {
  font-size: 16px;
  margin-bottom: 15px;
}

.read-more-btn {
  background-color: #feba17;
  border: none;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 5px;
  color: #4e1f00;
  transition: background-color 0.3s, transform 0.3s;
}

.read-more-btn:hover {
  background-color: #d49100;
  transform: scale(1.05);
}

/* Game Popup Styling */
.popup-game-img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 15px;
}

.modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 30px;
  border-radius: 10px;
  width: 80%;
  max-width: 600px;
  max-height: 80vh; /* Limit height to 80% of viewport */
  overflow-y: auto; /* Enable vertical scrolling */
  color: #333;
  text-align: left;
  position: relative;
}

.modal-content p {
  font-size: 16px;
  margin-bottom: 10px;
}

.modal-content ul {
  padding-left: 20px;
  margin-bottom: 10px;
}

.modal-content ul li {
  font-size: 16px;
  margin-bottom: 5px;
}

/* Ensure close button remains visible */
.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  position: sticky;
  top: 10px;
  right: 10px;
  z-index: 1;
}

.close:hover {
  color: #000;
}
