/* RESET & BASE */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #f2f2f2, #e0e0e0);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  color: #333;
}

/* full-page prismatic glint */
#bg-glint {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: -1;
  pointer-events: none;
  background: transparent;
}

/* APP SHELL */
.app-container {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  overflow: hidden;
}
header {
  text-align: center;
  padding: 1.5rem;
  background: #fafafa;
  border-bottom: 1px solid #ddd;
}
header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
header p {
  font-size: 0.95rem;
  color: #666;
}
main {
  padding: 1.5rem;
}
footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.8rem;
  color: #999;
  background: #fafafa;
  border-top: 1px solid #ddd;
}

/* PACK IMAGE & ANIMATION */
.pack-wrapper {
  text-align: center;
  margin-bottom: 1.5rem;
}
.pack {
  width: 180px;
  cursor: pointer;
  transition: transform 0.3s;
  animation-fill-mode: forwards;
}
.pack:hover {
  transform: scale(1.05);
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-10px); }
  40%,80% { transform: translateX(10px); }
}
.pack.shaking {
  animation: shake 0.6s;
}
.pack.opened {
  transition: transform 0.5s ease-in;
}

/* REVEALED CARDS */
#cards-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}
.card {
  width: 120px;
  height: 170px;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  perspective: 600px;
  opacity: 0;
  transform: rotateY(90deg);
  transition: transform 0.6s ease-out, opacity 0.4s ease-out;
  position: relative;
}
.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card.revealed {
  transform: rotateY(0deg);
  opacity: 1;
}

/* OPEN ANOTHER PACK BUTTON */
.open-again {
  display: block;
  margin: 1rem auto;
  padding: 0.5rem 1rem;
  background: #4CAF50;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.open-again:hover {
  background: #45A049;
}

/* COLLECTED CARDS STRIP */
.collected-section {
  margin-top: 1.5rem;
  border-top: 1px solid #ddd;
  padding-top: 1rem;
}
.collected-section h2 {
  font-size: 1.2rem;
  text-align: center;
  margin-bottom: 0.75rem;
  position: relative;
}
.collected-counter {
  position: absolute;
  top: 0; right: 0;
  font-weight: 600;
  font-size: 0.9rem;
  color: #333;
}
#collected-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.collected-card {
  position: relative;
  width: 80px;
  height: 113px;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 5px rgba(0,0,0,0.1);
  cursor: pointer;
}
.collected-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.count-badge {
  position: absolute;
  top: 4px; right: 4px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 4px;
  border-radius: 4px;
}

/* INSPECTION MODAL */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  align-items: center;
  justify-content: center;
}
.modal.show {
  display: flex;
}
.modal-content {
  position: relative;
  background: #fff;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  text-align: center;
  max-width: 90%;
  width: 300px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.modal-content .close {
  position: absolute;
  top: 8px; right: 12px;
  font-size: 1.4rem;
  color: #888;
  cursor: pointer;
}
.modal-content .close:hover {
  color: #333;
}
.modal-content h3 {
  margin: 0.5rem 0 0.25rem;
}
.modal-content p {
  margin: 0;
  color: #555;
  font-size: 0.95rem;
}

/* INSPECTED CARD CONTAINER */
.modal-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 240px;
  margin: 0 auto 1rem;
}
.modal-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  position: relative;
  z-index: 0;
}

/* Sparkle overlay on inspected Legendary cards */
.sparkle-video-inspect {
  position: absolute;
  top: 2px; left: 2px;
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  z-index: 4;
  mix-blend-mode: screen;
}

/* Foil‐gradient overlay */
/* (Common/Uncommon = Icy Silver; Rare = rainbow) */
.modal-card .foil-overlay {
  position: absolute;
  inset: 0;
  border-radius: 4px;
  pointer-events: none;
  z-index: 2;
  background-size: 300% 300%;
  animation: foilGradient 7s ease infinite;
}
.modal-card.rare .foil-overlay {
  mix-blend-mode: color-dodge;
  opacity: 0.2;
  background-image:
    linear-gradient(115deg,
      transparent 0%, #00e7ff 20%, #ff00e7 40%,
      #00e7ff 60%, #ff00e7 80%, transparent 100%);
}
.modal-card.common .foil-overlay,
.modal-card.uncommon .foil-overlay {
  mix-blend-mode: screen;
  opacity: 0.5;
  background-image:
    linear-gradient(115deg,
      transparent            0%,
      rgba(200,230,255,0.3) 20%,
      rgba(240,255,255,0.3) 40%,
      rgba(200,230,255,0.3) 60%,
      rgba(240,255,255,0.3) 80%,
      transparent           100%);
}
@keyframes foilGradient {
  0%   { background-position:50% 50%; }
  25%  { background-position:0% 0%; }
  50%  { background-position:100% 100%; }
  75%  { background-position:0% 0%; }
  100% { background-position:50% 50%; }
}

/* Texture overlay on every card & inspected card */
.card, .collected-card, .modal-card {
  position: relative;
}
.card::after, .collected-card::after, .modal-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../images/card-texture.png') repeat;
  opacity: 0.1;
  pointer-events: none;
  border-radius: inherit;
  z-index: 1;
}

/* VanillaTilt glare for common/uncommon pack cards */
.js-tilt {
  position: relative;
}
.js-tilt-glare {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  overflow: hidden;
  pointer-events: none;
  border-radius: inherit;
}
.js-tilt-glare-inner {
  position: absolute;
  top: 50%; left: 50%;
  width: 200%; height: 200%;
  background: radial-gradient(rgba(255,255,255,0.4), rgba(255,255,255,0) 70%);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.2s ease-out;
}
.js-tilt:hover .js-tilt-glare-inner {
  opacity: 1;
}

#tsparticles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;       /* match your .modal’s z-index */
  pointer-events: none;
}

/* make the “Congratulations” modal wider */
#complete-modal .modal-content {
  width: 400px;       /* or whatever fixed width you prefer */
  max-width: 90%;     /* still responsive on small viewports */
  padding: 2rem;      /* a bit more breathing room */
}

/* enlarge the nobu image but keep it inside */
.complete-image {
  width: 400px;       /* bigger diameter */
  height: 400px;
  object-fit: cover;
  border-radius: 0%;
  display: block;
  margin: 0 auto 1rem;
  max-width: 100%;    /* never overflow */
}