html, body {
  margin: 0;
  padding: 0;
  font-family: "Poppins", sans-serif;
  background: linear-gradient(180deg, #050505, #111);
  color: #f5f5f5;
  max-width: 100%;
  overflow-x: hidden;
}

/* === HEADER === */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 40px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

header h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.6em;
  color: #ffd700;
  margin: 0;
}

.key-icon {
  width: 60px;
  height: 60px;
  margin-right: 6px;
  vertical-align: middle;
}
.keyfarm-icon {
  width: 35px;          
  height: 35px;
  object-fit: contain;   
}

.title-with-icon {
  display: flex;
  align-items: center;   
  gap: 8px;              
  font-size: 1.4rem;
  font-weight: 600;
  color: #fff;          
}

/* === TOP BUTTONS (CENTER) === */
.top-center-buttons {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 15px;
}

.btn-nft {
  padding: 10px 20px;
  border-radius: 20px;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, #6a11cb, #2575fc);
  box-shadow: 0 0 10px rgba(0,0,0,0.25);
  transition: all 0.25s ease;
  font-weight: bold;
}

.btn-nft:hover {
  transform: scale(1.07);
  box-shadow: 0 0 12px rgba(255,255,255,0.25);
}

.btn-nft.mint,
.btn-nft.buy {
  background: linear-gradient(135deg, #3b82f6, #0000FF);
}

/* === WALLET BUTTON (RIGHT) === */
#homeButton {
  display: block;
  margin: 10px auto 0; 
}

#homeButton,
#walletButton {
  background: #0000FF;
  color: #fff;
  padding: 10px 22px;
  border: none;
  border-radius: 25px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(255,215,0,0.4);
  transition: all 0.3s ease;
}

#walletButton:hover {
  background: #9400D3;
  transform: scale(1.05);
}

.connected {
  box-shadow: 0 0 20px 5px rgba(255, 215, 0, 0.6);
  animation: glow 2s infinite alternate;
}

@keyframes glow {
  from { box-shadow: 0 0 10px rgba(255,215,0,0.4); }
  to   { box-shadow: 0 0 20px rgba(255,215,0,0.8); }
}

/* === MAIN SECTION === */
main {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 40px;
  padding: 60px 40px;
  flex-wrap: wrap;
  box-sizing: border-box;
}

/* === DASHBOARD & NFT DISPLAY === */
#dashboard,
#nft-display {
  background: #222;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.15);
  width: 400px;
  min-height: 520px;
  box-sizing: border-box;
}

#dashboard h3,
#nft-display h3 {
  color: #ffd700;
  margin-top: 0;
}

/* === INFO BOX === */
.info-box {
  background: #333;
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 15px;
}

/* === CLAIM REWARD === */
#nextClaimContainer {
  margin-top: 10px;
  text-align: center;
}

#nextClaimTime {
  font-size: 1.1em;
  font-weight: bold;
  color: #ffd700;
}
#claimBtn {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  background: linear-gradient(90deg, #3b82f6, #0000FF);
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: 0.2s ease;
}

#claimBtn:hover:enabled {
  transform: scale(1.02);
  background: linear-gradient(90deg, #00e6ff, #9400D3);
}

#claimBtn:disabled {
  background: #555;     
  color: #999;          
  cursor: not-allowed;
  opacity: 1;          
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffcc00, #ff6600);
  border-radius: 4px;
  transition: width 1s linear;
}

/* === NFT DISPLAY === */
#nftContainer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
}

.nft-card {
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 0 8px rgba(255,255,255,0.1);
  transition: transform 0.2s ease;
  text-align: center;
}

.nft-card:hover {
  transform: scale(1.05);
}

/* === BUTTONS === */
button {
  background: #0000FF;
  color: #fff;
  padding: 10px 20px;
  border: none;
  border-radius: 15px;
  cursor: pointer;
  font-weight: bold;
  margin-top: 10px;
  transition: all 0.3s ease;
}

button:hover { background: #9400D3; }
button:disabled { background: #666; cursor: not-allowed; }

#refreshBtn {
  all: unset;
  cursor: pointer;
  font-size: 18px;
  margin-left: 6px;
  transition: transform 0.3s ease;
}

#refreshBtn:hover { transform: rotate(90deg); }

/* === COOKIE BANNER === */
#cookieBanner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #222;
  color: #fff;
  padding: 15px;
  text-align: center;
  font-size: 14px;
  display: none;
  z-index: 9999;
}

#cookieBanner button {
  background: #4CAF50;
  color: #fff;
  border: none;
  padding: 8px 16px;
  margin-left: 10px;
  cursor: pointer;
  border-radius: 4px;
}

/* === WALLET MODAL / POPUP === */
#walletModal,
#processingPopup {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

#walletModal.active,
#processingPopup.active {
  display: flex;
}

.spinner {
  margin: 0 auto 15px;
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255,255,255,0.2);
  border-top-color: #ffd700; /* warna emas */
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.wallet-box {
  background: #111;
  border-radius: 15px;
  padding: 25px 20px;
  width: 350px;
  box-shadow: 0 0 20px rgba(255,215,0,0.3);
  text-align: center;
  color: #fff;
  transform: translateY(-120px);
}

.wallet-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  margin: 8px 0;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wallet-option:hover {
  background: rgba(255,215,0,0.15);
  transform: scale(1.03);
}

.wallet-option img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

#closeModal {
  background: #0000FF;
  color: #fff;
  padding: 6px 12px;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 10px;
  border: none;
}

#closeModal:hover { background: #9400D3; }

#processingPopup h3 {
  color: #ffd700;
  margin-bottom: 10px;
}

/* === FALLING KEY === */
.falling-key {
  position: fixed;
  top: -100px;
  pointer-events: none;
  z-index: 999;
  opacity: 0.9;
  animation: fall linear forwards;
}

@keyframes fall {
  0% { transform: translateY(-100px) rotate(0deg) scale(0.8); opacity: 1; }
  100% { transform: translateY(110vh) rotate(360deg) scale(1); opacity: 0; }
}

/* === FOOTER === */
footer {
  text-align: center;
  padding: 20px 0;
  font-size: 0.9em;
  color: #888;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 40px;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  header {
    flex-wrap: wrap;
    flex-direction: row; /* tetap horizontal */
    gap: 8px;
    justify-content: center;
    padding: 10px 15px;
  }

  .top-center-buttons {
    flex-wrap: wrap;
    flex-direction: row;
    gap: 8px;
  }

  #walletButton, #homeButton {
    padding: 8px 16px;
    font-size: 13px;
  }

  .btn-nft {
    padding: 8px 14px;
    font-size: 13px;
  }
}


/* === WALLET POPUP DI LUAR HEADER (mini-chip style) === */
.wallet-popup {
  display: none;
  position: absolute; 
  top: 120px;
  right: 30px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 10px 12px;
  height: 100px;
  width: 190px;
  text-align: center;
  color: #fff;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.25);
  z-index: 1500;
}

.wallet-popup.active {
  display: block;
}

.wallet-popup p {
  margin: 4px 0;
  font-size: 0.8em;
}

/* Tombol container sejajar rapi */
.wallet-popup-buttons {
  display: flex; 
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}

/* === Gaya tombol chip kecil === */
.wallet-popup .home,
.wallet-popup .disconnect {
  border: none;
  min-width: 0;
  flex: 1;
  padding: 3px 6px;
  font-size: 0.7em;
  font-weight: 600;
  border-radius: 20px; 
  cursor: pointer;
  transition: all 0.25s ease;
}

/* === Warna tombol === */
.wallet-popup .home {
  background: #ffd700;
  color: #000;
}

.wallet-popup .home:hover {
  background: #ffeb7f;
  transform: scale(1.08);
}

.wallet-popup .disconnect {
  background: #ff4040;
  color: #fff;
}

.wallet-popup .disconnect:hover {
  background: #ff7070;
  transform: scale(1.08);
}


     /* Splash container */
    #splash {
      position: fixed;
      top: 0; left: 0;
      width: 100%; height: 100%;
      background: #000;
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 9999;
      animation: fadeOut 1s ease forwards;
      animation-delay: 4s;
    }

    #splash img {
      width: 180px;
      animation: glow 1.5s infinite alternate;
    }

    @keyframes glow {
      from { filter: drop-shadow(0 0 10px gold); }
      to { filter: drop-shadow(0 0 25px yellow); }
    }

    @keyframes fadeOut {
      to { opacity: 0; visibility: hidden; }
    }
#mainContent {
  display: none;
  text-align: center;
  padding: 0;
  color: white;
  min-height: 100vh;
  box-sizing: border-box;
}
#mainContent {
  opacity: 0;
  transition: opacity 0.8s ease;
  min-height: 100vh;
}

#mainContent.active {
  display: block;
  opacity: 1;
}
.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.splash-logo {
  width: 150px;
  animation: float 2.5s ease-in-out infinite, glow 1.5s infinite alternate;
}

.loading-text {
  font-size: 1.1em;
  color: #ffd700;
  letter-spacing: 1px;
  font-weight: bold;
  animation: fadeBlink 2s infinite ease-in-out;
}

/* Animasi loading bar */
.loader {
  width: 180px;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.loader::before {
  content: "";
  position: absolute;
  top: 0; left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, #00ffff, #ffd700, #ff00ff);
  animation: loadingMove 1.5s linear infinite;
  border-radius: 3px;
}

@keyframes loadingMove {
  0% { left: -40%; }
  100% { left: 100%; }
}

@keyframes fadeBlink {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.falling-key {
  position: fixed;
  top: -50px;
  pointer-events: none;
  animation-name: fall;
  animation-timing-function: linear;
  z-index: 1000;
}

@keyframes fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

/* Tombol dalam card / container sempit */
#nft-display .top-center-buttons .btn-nft {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 20px;
  min-width: 0;
  flex: 1; 
  text-align: center;
}

/* Container flex rapi untuk 3 tombol */
#nft-display .top-center-buttons {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
