/* Cleaned & Organized CSS for Datapunk Game */

/* ========================= */
/* FONT IMPORT */
/* ========================= */
@font-face {
  font-family: "Skrappa";
  src: url("fonts/SKRAPPA-Bold.woff2") format("woff2"),
       url("fonts/SKRAPPA-Bold.ttf") format("truetype");
  font-weight: bold;
  font-style: normal;
}

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600&display=swap');

:root {
  --font-skrappa: "Skrappa";
  --neon: #51ffd6;
}

/* ========================= */
/* GLOBAL */
/* ========================= */
body {
  margin: 0;
  padding: 0;
  background: #000;
  font-family: 'Montserrat', sans-serif;
  color: var(--neon);
}

/* ========================= */
/* LANDING PAGE */
/* ========================= */
#landing {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
  background: #000;
  overflow: hidden;
  z-index: 999;
}

.landing-title {
  position: absolute;
  top: 6%;
  width: 100%;
  text-align: center;
  z-index: 3;
}

.landing-title h1 {
  font-family: var(--font-skrappa);
  font-size: 80px;
  color: #fff;
  letter-spacing: 3px;
  margin: 0;
}

.landing-title h2 {
  font-family: var(--font-skrappa);
  font-size: 36px;
  color: #fff;
  letter-spacing: 1px;
}

/* Main NFT */
.main-nft {
  width: 280px;
  border: 4px solid var(--neon);
  border-radius: 18px;
  box-shadow: 0 0 25px var(--neon);
  background: #000;
  transition: transform 0.1s ease-out;
  animation: floatNFT 4s ease-in-out infinite;
}

.center-card {
  position: relative;
  margin-top: 140px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 2;
}

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

/* Background NFT loop */
.bg-nft-loop {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0.22;
  z-index: 1;
}

.bg-nft-loop .row {
  display: flex;
  width: max-content;
  gap: 25px;
  animation: slideRow 20s linear infinite;
}

.bg-nft-loop img {
  width: 180px;
  height: 220px;
  border-radius: 16px;
  object-fit: cover;
  filter: brightness(0.9) saturate(1.2);
}

@keyframes slideRow {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ========================= */
/* BUTTONS */
/* ========================= */
.start-btn {
  position: absolute;
  bottom: 40px;
  padding: 16px 40px;
  font-size: 20px;
  font-weight: bold;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: var(--neon);
  color: #000;
  box-shadow: 0 0 20px var(--neon), 0 0 40px var(--neon);
  transition: 0.3s;
}

.start-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 35px #000, 0 0 70px #000;
}

/* ========================= */
/* HEADER */
/* ========================= */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
}

.brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 20px;
  font-weight: 600;
}

.back-btn {
  padding: 6px 14px;
  background: #00f5d4;
  border-radius: 8px;
  color: #000;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 0 10px #00f5d4;
  transition: 0.2s;
}

.back-btn:hover {
  transform: scale(1.05);
}

/* Wallet */
.wallet-btn,
.wallet-info {
  padding: 10px 18px;
  background: var(--neon);
  border-radius: 12px;
  color: #000;
  font-weight: 600;
  cursor: pointer;
  transition: 0.25s;
}

.wallet-btn:hover {
  transform: scale(1.05);
}

.wallet-info { display: none; }
#connectBtn { display: none !important; }

/* ========================= */
/* LAYOUT */
/* ========================= */
.container {
  padding-top: 120px;
  max-width: 900px;
  width: 100%;
  margin: auto;
}

/* Score HUD */
.score-container {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 5px;
  margin-bottom: 40px; /* ini yang membuat kartu turun */
}


.score-box {
  padding: 12px 18px;
  font-size: 20px;
  font-weight: bold;
  color: var(--neon);
  background: rgba(0,255,200,0.12);
  border-radius: 12px;
  border: 1px solid rgba(0,255,200,0.4);
  box-shadow: 0 4px 12px rgba(0,255,200,0.25);
  transition: 0.2s;
}

.score-box:hover { transform: translateY(-4px); }

/* ========================= */
/* GAME BOARD */
/* ========================= */
.board {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 10px;
}

/* Cards */
.card {
  width: 100%;
  height: 139px;
  border-radius: 18px;
  position: relative;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.5s;
}

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

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 18px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.card-front { transform: rotateY(180deg); }

.card-back {
  background-image: url("images/background.jpg");
}

.card.flipped { transform: rotateY(180deg); }

/* ========================= */
/* POPUP (LEVEL 1–8)         */
/* ========================= */
.popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75); /* diperbaiki */
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 200;
}

.popup-box {
  background: #05352c;
  padding: 35px 28px;
  border-radius: 18px;
  width: 320px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 15px;
  border: 2px solid #39ffb0; /* biar lebih match neon */
}

.btn {
  padding: 10px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, #39ffb0, #45a0ff);
  color: #000;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

.btn:hover {
  transform: scale(1.05);
}

#nextLevelBtn {
  display: none;
}

/* FINAL POPUP */
.final-popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 300;
}

.final-box {
  background: #05352c;
  padding: 40px 30px;
  border-radius: 18px;
  text-align: center;
  color: #51ffd6;
  box-shadow: 0 0 20px #51ffd6;
}

.hidden {
  display: none !important;
}

#finalRestart {
  padding: 10px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #39ffb0, #45a0ff);
  color: #000;
  font-weight: bold;
  cursor: pointer;
}


/* ========================= */
/* FOOTER */
/* ========================= */
.footer {
  text-align: center;
  padding: 30px;
  margin-top: 60px;
  color: rgba(255,255,255,0.5);
  font-size: 14px;
}

/* ========================= */
/* RESPONSIVE */
/* ========================= */
@media (max-width: 600px) {
  .board { gap: 10px; }
  .card {
    width: 80px;
    height: 110px;
  }
  .landing-title h1 { font-size: 36px; }
  .start-btn {
    font-size: 18px;
    padding: 10px 20px;
  }
}

@media (max-width: 400px) {
  .card {
    width: 70px;
    height: 95px;
  }
}
