/* ---------- GLOBAL ---------- */
body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: radial-gradient(circle at top, #1a1a1a, #0b0b0b);
  color: #f2f2f2;
  text-align: center;
  padding-bottom: 60px;
  margin: 0;
}

/* ---------- BUTTONS ---------- */
button {
  padding: 14px 30px;
  font-size: 17px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  cursor: pointer;
  margin: 6px;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s;
}

button:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5); }
button:disabled { background: #444; cursor: not-allowed; }

/* ---------- PAGE CONTAINERS ---------- */
.hidden { display: none; }
#controls { margin: 20px auto; }
#openPackCenter {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  margin: 20px 0;
}
#openPackCenter.hidden { display: none; }

/* ---------- Meta Master Link --------- */
#metaLink {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 14px;
  color: #3b82f6;
  text-decoration: none;
  font-weight: 600;
}

#metaLink:hover {
  text-decoration: underline;
}

/* ---------- CARDS ---------- */
#pack, #collection {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(8px, 1.5vw, 15px) clamp(12px, 2vw, 20px);
  justify-items: center;
  padding: 20px;
  max-width: 1800px;
  margin: 0 auto;
}

.card {
  width: 100%;
  max-width: 280px;
  padding: 10px;
  background: linear-gradient(180deg, #1f1f1f, #121212);
  border-radius: 8px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(255,255,255,0.05);
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(.25,.8,.25,1);
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.card.show { opacity: 1; transform: translateY(0) scale(1); }
.card img { 
  width: 100%; 
  height: auto; 
  aspect-ratio: 5 / 7;
  object-fit: contain; 
  border-radius: 4px; 
  box-shadow: 0 4px 15px rgba(0,0,0,0.5); 
}
.card div { margin-top: 8px; font-size: 14px; opacity: 0.85; }

/* ---------- STATS ---------- */
#stats {
  margin-top: 25px;
  background: rgba(20,20,20,0.85);
  padding:16px 22px;
  border-radius:12px;
  display:inline-block;
  text-align:left;
  box-shadow:0 6px 20px rgba(0,0,0,0.6);
}

/* ---------- GLOW ---------- */
.rarity-Common { box-shadow: 0 0 8px rgba(255,255,255,0.15); }
.rarity-Uncommon { box-shadow: 0 0 10px rgba(34,197,94,0.5),0 0 20px rgba(34,197,94,0.25); }
.rarity-Rare { box-shadow: 0 0 12px rgba(59,130,246,0.7),0 0 25px rgba(59,130,246,0.35); }
.rarity-Double-Rare { box-shadow: 0 0 14px rgba(147,51,234,0.8),0 0 30px rgba(147,51,234,0.4); }
.rarity-Illustration-Rare { box-shadow: 0 0 15px rgba(255,215,0,0.9),0 0 35px rgba(255,215,0,0.6); }
.rarity-Ultra-Rare { box-shadow: 0 0 16px rgba(236,72,153,0.9),0 0 40px rgba(236,72,153,0.6); }
.rarity-Special-Illustration-Rare { box-shadow:0 0 18px rgba(255,180,50,1),0 0 45px rgba(255,120,0,0.7); }
.rarity-Hyper-Rare { animation: rainbowGlow 3s linear infinite; }

@keyframes rainbowGlow {
  0%{box-shadow:0 0 18px #ff0000,0 0 35px #ff0000;}
  25%{box-shadow:0 0 18px #00ff00,0 0 35px #00ff00;}
  50%{box-shadow:0 0 18px #00ffff,0 0 35px #00ffff;}
  75%{box-shadow:0 0 18px #ff00ff,0 0 35px #ff00ff;}
  100%{box-shadow:0 0 18px #ff0000,0 0 35px #ff0000;}
}

/* ---------- HIDDEN SPECIAL CARD GLOW HINT ---------- */
.glow-hint {
  position: relative;
  animation: glowHintPulse 2.6s ease-in-out infinite;
}

@keyframes glowHintPulse {
  0% {
    box-shadow: 0 0 6px;
  }
  50% {
    box-shadow: 0 0 18px;
  }
  100% {
    box-shadow: 0 0 6px;
  }
}
#progressBars {
  margin: 15px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 60%;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

#progressBars label {
  font-size: 14px;
  margin-bottom: 4px;
  display: block;
}

progress {
  width: 100%;
  height: 16px;
  border-radius: 8px;
  overflow: hidden;
  -webkit-appearance: none;
}

progress::-webkit-progress-bar {
  background-color: #2c2c2c;
  border-radius: 8px;
}

progress::-webkit-progress-value {
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  border-radius: 8px;
}

/* ---------- RECENT CARDS ---------- */
#recentCardsContainer {
  margin-top: 30px;
  padding: 20px;
  background: rgba(20, 20, 20, 0.85);
  border-radius: 12px;
  display: inline-block;
  width: 90%;
  max-width: 1200px;
}

#recentCards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(8px, 1.5vw, 15px) clamp(12px, 2vw, 20px);
  justify-items: center;
  padding: 20px;
  max-width: 1800px;
  margin: 0 auto;
}

#toggleRecentCards {
  background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f2f2f2;
}

#toggleRecentCards:hover {
  background: linear-gradient(135deg, #3a3a3a, #2a2a2a);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}
