:root {
  --color1: #f6aecb;
  --color2: #9bfc35;
}
body {
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #e5e5e5;
  overflow: hidden;
  position: relative;
   /* overflow: hidden; */
  position: fixed;
  width: 100%;
  height: 100%;
  
}

.wrapper {
  margin: 0;
  padding: 0;
  display: flex
;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #e5e5e5;
  overflow: hidden;
  position: relative;
  /* overflow: hidden; */
  position: fixed;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in;
}

        /* Full-screen loading overlay */
        #loading-screen {
          position: fixed;
          top: 0;
          left: 0;
          width: 100%;
          height: 100%;
          background: rgba(255, 255, 255, 0.9);
          display: flex;
          justify-content: center;
          align-items: center;
          z-index: 9999;
      }

      /* CSS Animated Spinner */
      .spinner {
          width: 50px;
          height: 50px;
          border: 6px solid #ccc;
          border-top-color: #3498db;
          border-radius: 50%;
          animation: spin 1s linear infinite;
      }

      @keyframes spin {
          0% { transform: rotate(0deg); }
          100% { transform: rotate(360deg); }
      }

.background-above {
  position: absolute;
  width: 100vw;
  height: 100%;
  z-index: 5;
  pointer-events: none
}
.pack-above {
  position: absolute;
  z-index: 6;
  bottom: 0%;
  /* width: 100vw; */
  text-align: center;
  left: 50%;
  transform: translateX(-50%);
  /* background-color: red; */
}
.background-below {
  position: absolute;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none
}

.grey-fade {
  background: linear-gradient(to bottom, #0bb9fb, transparent);

  width: 100%;
    height: 80%;
    position: absolute;
    opacity: 0;
    pointer-events: none;
    z-index: 5;
}

.rainbow-fade {
  width: 100%;
  height: 105%;
  position: absolute;
  overflow: hidden;
  background: linear-gradient(45deg, rgba(197, 45, 238, 1) 0%, rgba(253, 29, 29, 1) 50%, rgba(252, 176, 69, 1) 100%);
  animation: gradientSwitchRainbow 2s ease 1;
  background-size: 150% 150%;
  opacity: 0;
  display: none;
}

/* .rainbow-fade::before,
.rainbow-fade::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 15px;
  animation: gradientSwitchRainbow 2s ease 1;
} */

/* .rainbow-fade::before {
  background-image: linear-gradient(45deg, rgba(197, 45, 238, 1) 0%, rgba(253, 29, 29, 1) 50%, rgba(252, 176, 69, 1) 100%);
  z-index: 1;
} */

/* .rainbow-fade::after {
  background-image: radial-gradient(circle at bottom, rgba(238, 174, 202, 1) 0%, rgba(148, 187, 233, 1) 100%);
  z-index: 2;
  opacity: 0;
} */

@keyframes gradientSwitchRainbow {
  0% {
    opacity: 0;
    background-position: 0% 50%;
  }
  20% {
    opacity: 1;
    background-position: 100% 50%;
  }
  80% {
    opacity: 1;
    background-position: 50% 100%;
  }
  100% {
    opacity: 0;
    background-position: 0% 50%;
  }
}

.pack-container {
  position: absolute;
  /* left: 20px; */
  /* top: 50%; */
  /* transform: translateY(-50%); */
  z-index: 3;
  /* left: 50%; */
  bottom: 0%;
  /* transform: translateX(-50%); */
  width: 100vw;
  text-align: center;
  transition: transform 0.5s ease-in-out, box-shadow 0.2s ease-out;
  scale: 1;
}

.pack-container.load {
  transform: scale(0.6) translateY(-50%);
  transition: none;

}

.pack {
  width: 120px;
  height: 180px;
  position: relative;
  perspective: 1000px;
  margin: 0 auto;
}

.pack-top,
.pack-bottom,
.swipe-area {
  position: absolute;
  width: 100%;
  /* background-color: #ffcb05;
    border: 2px solid #3c5aa6; */
  box-sizing: border-box;
  
}

.pack-top {
  height: 15%; /* Top half is 15% of the pack height */
  top: 0;
  border-radius: 10px 10px 0 0;
  overflow: hidden; /* Ensure the ::before element doesn't overflow */
  height: 20.5%;
  background-image: url(img/assets/top.png);
  background-size: 100%;
  background-repeat: no-repeat;
  border-radius: 23px 23px 0px 0px;
}

.pack-top::before {
  content: "";
  width: var(--curl-width, 0);
  height: var(--curl-height, 0);
  position: absolute;
  left: -3px;
  top: -2px;
  box-shadow: 4px -2px 4px rgba(0, 0, 0, 0.4);
  /* background: linear-gradient(142deg, #1a1a1a 48%, #aaa 57%, #bbb 63%, white); */
  background: linear-gradient(142deg, #e5e5e5 48%, #cc1ad7 57%, #e452ed 63%, #e97df0);
  /* transform: skew(-6deg); */
  /* transition: width 0.3s ease-out, height 0.3s ease-out; */
}

.pack-bottom {
  height: 127%;
  top: 24.2%;
  border-radius: 0 0 10px 10px;
  background-image: url(img/assets/bot.png);
  background-size: 100%;
  background-repeat: no-repeat;
}

.swipe-area {
  height: 5%; /* Swipe area is 10% of the pack height */
  top: 20.5%; /* Positioned between the top and bottom */
  /* background-color: rgba(255, 255, 255, 0.2); */
  cursor: pointer;
  /* overflow: hidden; */
  position: relative;
  z-index: 6; /* Ensure swipe area is above other elements */

  background-image: url(img/mid.png);
  background-size: 100%;
  background-repeat: no-repeat;

  /* overflow-y: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none; */
}

.swipe-dot {
  width: 10px;
  height: 10px;
  background-color: white;
  border-radius: 50%;
  position: absolute;
  top: 41%;
  left: 10%;
  transform: translateY(-50%);
  
  pointer-events: none;
  box-shadow: 0px 0px 9px 9px white;
  opacity: 0;
  /* display: none !important; */
}
.swipe-dot.animate {
  animation: swipeDotAnimation 3s ease infinite;
}
.swipe-area-extend {
  position: absolute;
  width: calc(120%);
  height: 18%;
  left: -10%;
  top: calc( 20% - 40px);
  cursor: pointer;
}

@keyframes swipeDotAnimation {
  0% {
    left: 0%;
    opacity: 1;
  }

  50% {
    left: 98.5%;
    opacity: 1;
    /* transform: translateX(-100%); */
  }
  65% {
    left: 98.5%;
    opacity: 0;
    /* transform: translateX(-100%); */
  }
  95% {
    left: 0%;
    opacity: 0;
    /* transform: translateX(-100%); */
  }
  100% {
    left: 0%;
    opacity: 0;
    /* transform: translateX(-100%); */
  }
}
.burst-line {
  position: absolute;
  width: 120%;
  height: 350%;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  opacity: 0;
  background: #ffffff;
  box-shadow: 0px 0px 60px 30px #ffffff, 0px 0px 100px 60px #ff00ff, 0px 0px 140px 90px #00ffff;
  display: none;
  animation: swipeBurst 0.5s ease-out 1;
  z-index: 4;
  transform: translateX(-50%) translateY(-50%);
}

@keyframes swipeBurst {
  0% {
    height: 350%;
    width: 120%;
    opacity: 1;
  }
  33% {
    height: 120%;
    width: 140%;
    opacity: 1;
    /* transform: translateX(-100%); */
  }
  66% {
    height: 50%;
    width: 160%;
  }
  100% {
    height: 0%;
    width: 180%;
    opacity: 0;
    /* transform: translateX(-100%); */
  }
}

.progress-bar {
  position: relative;
  top: 23%;
  /* left: -15px; */
  width: 0;
  height: 10px;
  background-color: white;
  transform: translateY(-50%);
  /* transition: width 0.3s ease-out; */
  pointer-events: none;
  box-shadow: gold 0 0 30px 30px;
  box-shadow: 0px 0px 60px 30px #ffffff, 0px 0px 100px 60px #ff00ff, 0px 0px 140px 90px #00ffff;
  opacity: 0;
  
  /* opacity: 1 !important; */
}

.progress-bar:after {
  content: '';
  position: absolute;
  right: -13px;
  /* width: 20px; */
  /* height: 20px; */
  color: green;
  z-index: 3;
  top: 50%;
  display: block;
  /* box-shadow: 0 0 0 14px var(--color-second), 0 0 0 10px var(--color-second), 0 0 20px var(--color-basic), 0 0 4px 8px var(--color-basic), 0 0 30px 40px var(--color-basic);  opacity: 1;
  border-radius: 50%;
  --color-basic: #f7b32b;
  --color-second: #f7b32b22;
  background: radial-gradient(circle, white 30%, var(--color-basic) 70%); */
  box-shadow: 0 0 0 14px var(--color-second), 0 0 0 10px var(--color-second), 0 0 20px var(--color-basic), 0 0 4px 8px var(--color-basic), 0 0 90px 70px var(--color-basic);
  opacity: 1;
  border-radius: 50%;
  --color-basic: #ff00ff;
  --color-second: transparent;
  background: radial-gradient(circle, white 30%, var(--color-basic) 70%);
  right: 0px;
  box-shadow: 0px 0px 35px 30px white;
}

.glow {
  position: absolute;
  width: 20px;
  height: 20px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.8),
    transparent 70%
  );
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease-out;
  transform: translate(-50%, -50%);
}

.swipe-indicator {
  position: absolute;
  top: -60px;

  left: 50%;
  /* transform: translateX(-50%); */
  /* color: white; */
  /* font-size: 14px; */
  opacity: 0;
  transition: opacity 0.1s ease-out;
  writing-mode: initial;
  left: calc(50% - 77px);
  width: 300px;
  left: calc(50% - 150px);
  text-align: center;
}

.pack:hover .swipe-indicator {
  opacity: 1;
}

.card-container {
  position: fixed;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1000px;
  z-index: 2;
}

.card {
  width: 150px;
  height: 200px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
  box-shadow: -5px -5px 20px 5px var(--color1), 5px 5px 20px 5px var(--color2),
    -7px -7px 10px -5px transparent, 7px 7px 10px -5px transparent,
    0 0 5px 0px rgba(255, 255, 255, 0), 0 55px 35px -20px rgba(0, 0, 0, 0.5);
  border-radius: 25px;
  /* overflow: hidden; */
}
.card.inScreen {
  transform: translateY(0);
}
.card:hover {
  box-shadow: -5px -5px 20px 5px var(--color1), 5px 5px 20px 5px var(--color2),
    -7px -7px 10px -5px transparent, 7px 7px 10px -5px transparent,
    0 0 5px 0px rgba(255, 255, 255, 0), 0 55px 35px -20px rgba(0, 0, 0, 0.5);
}
.card:after {
  opacity: 1;
  background-image: url("/img/sparkles.webp"), url(img/holo.png),
    linear-gradient(
      125deg,
      #ff008450 15%,
      #fca40040 30%,
      #ffff0030 40%,
      #00ff8a20 60%,
      #00cfff40 70%,
      #cc4cfa50 85%
    );
  background-position: 50% 50%;
  background-size: 160%;
  background-blend-mode: overlay;
  z-index: 2;
  filter: brightness(1) contrast(1);
  transition: all 0.33s ease;
  mix-blend-mode: color-dodge;
  opacity: 0.9;
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  border-radius: 37px;
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  backface-visibility: hidden;
  overflow: hidden;
}

.card-front {
  /* background-color: #ffcb05; Fallback color for front */
  /* box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); */
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 16px;
  text-align: center;
  z-index: 1;
}

.card-back {
  background-color: #3c5aa6; /* Fallback color for back */
  transform: rotateY(180deg);
}

.card-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.holographic-background {
  /* position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255, 0, 0, 0.2), rgba(0, 255, 0, 0.2), rgba(0, 0, 255, 0.2));
    background-size: 200% 200%;
    animation: holographic 5s infinite linear;
    opacity: 0.5;
    z-index: 1; */
}

@keyframes holographic {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.spotlight {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.5),
    transparent 30%
  );
  transform-origin: center;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease-out;
  border-radius: 37px;
  overflow: hidden;
}

#animateButton {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 10px 20px;
  font-size: 16px;
  background-color: #ff6f61;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  height: 0px;
  width: 0px;
}

#animateButton:hover {
  background-color: #ff4a3d;
}
.drag-text {
  position: absolute;
  top: -60px;

  left: calc(50% - 85px);
  /* color: white; */
  /* font-size: 14px; */
  opacity: 0;
  transition: opacity 0.3s ease-out;
  width: 300px;
  left: calc(50% - 150px);
  text-align: center;
}

.floating {
  animation: float 3s ease-in-out infinite;
}
.floating-card {
  animation: floatCard 3s ease-in-out infinite;
}
.floating-card .floating-card-shine:after {
  animation: floatCardShine 3s ease-in-out infinite;
}

.rotato {
  animation: rotatoFloat 4s ease 0s 1;
}
.rotato-shine:after {
  animation: rotatoShine 4s ease 0s 1;
}
.cardIntro {
  animation: cardIntro 4s ease 0s 1;
}
@keyframes tearAway {

  15% {
    transform: translateY(-51px) translateX(60px) rotateX(45deg) rotate(20deg) scale(0.8);
  }

  60% {
    transform: translateY(-30px) translateX(220px) rotateX(180deg) rotate(20deg) scale(0.5);
  }
  85% {
    transform: translateY(122px) translateX(280px) rotateX(250deg) rotate(30deg) scale(0.3);
  }
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(5px);
    
  }
}
@keyframes floatCard {
  0%,
  100% {
    transform: translateY(0px) rotateY(0deg);
  }
  50% {
    transform: translateY(5px) rotateY(2deg);
    
  }
}
@keyframes floatCardShine {
  0%,
  100% {
    background-position: center, 0% 31%, calc(42%* -1) calc(31%* -1), 42% 31%;
  }
  50% {
    background-position: center, 0% 31%, calc(45%* -1) calc(31%* -1), 45% 31%;
    
  }
}
@keyframes cardIntro {
  0%
  {
    transform: translateY(100vh) rotateX(0) rotateY(0) translateZ(0) scale(1);
  }
  5%,
  10% {
    transform: translateY(0) rotateX(0) rotateY(0) translateZ(0) scale(1);
  }
  14%,
  18% {
    transform: translateY(0) rotateX(0) rotateY(360deg) translateZ(0) scale(1);
  }
  30%,
  42% {
    transform: translateY(0) rotateX(0) rotateY(360deg) translateZ(0) scale(1.2);
    /* --background-x: 52%; */
  }
  90%, 100% {
    transform: translateY(0) rotateX(0) rotateY(360deg) translateZ(0) scale(1);
    /* --background-x: 42%; */
  }
}

.card.moveIn {
  animation: moveIn 1s ease-in-out;
}

.card.spin {
  animation: spin360 1s ease-in-out;
}

.card.scale {
  animation: scaleUpDown 0.5s ease-in-out;
}

/* Move card back into position */
@keyframes moveIn {
  0% { transform: translateY(100%); }
  100% { transform: translateY(0); }
}

/* Reset rotation before spin */
@keyframes resetRotation {
  0% { transform: rotateX(0) rotateY(0) translateZ(0); }
  100% { transform: rotateX(0) rotateY(0) translateZ(0); }
}

/* 360-degree spin */
@keyframes spin360 {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}

/* Enlarge and shrink */
@keyframes scaleUpDown {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@keyframes rotatoFloat {
  0%,
  100% {
    transform: rotateZ(0deg) rotateX(0deg) rotateY(0deg);
     /* --background-x: 42%; */
  }
  5%,
  10% {
    transform: rotateZ(0deg) rotateX(3deg) rotateY(-5deg);
    /* --background-x: 32%; */
  }
  14%,
  18% {
    transform: rotateZ(0deg) rotateX(-3deg) rotateY(12deg);
    /* --background-x: 42%; */
  }
  30%,
  42% {
    transform: rotateZ(3deg) rotateX(11deg) rotateY(15deg); 
    /* --background-x: 52%; */
  }
  52% {
    transform: rotateZ(-3deg) rotateX(-12deg) rotateY(-18deg);
    /* --background-x: 42%; */
  }
}
@keyframes rotatoShine {
  0%,
  100% {
    background-position: center, 0% 31%, calc(42%* -1) calc(31%* -1), 42% 31%;

  }
  5%,
  10% {
    /* 42%: 32%; */
    background-position: center, 0% 31%, calc(32%* -1) calc(31%* -1), 32% 31%;

  }
  14%,
  18% {
    /* 42%: 42%; */
    background-position: center, 0% 31%, calc(42%* -1) calc(31%* -1), 42% 31%;

  }
  30%,
  42% {
    /* 42%: 52%; */
    background-position: center, 0% 31%, calc(62%* -1) calc(31%* -1), 62% 31%;
  }
  52% {
    /* 42%: 42%; */
    background-position: center, 0% 31%, calc(52%* -1) calc(31%* -1), 52% 31%;
  }
  70% {
    background-position: center, 0% 31%, calc(42%* -1) calc(31%* -1), 42% 31%;
  }
}
* {
  font-family: "Roboto", serif;
  font-optical-sizing: auto;
  font-style: normal;
  color: black;
  font-variation-settings: "wdth" 100;
  font-size: 24px;
  user-select: none; /* Standard */
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* Internet Explorer/Edge */
}

@keyframes shake {
  0% {
    transform: translateX(calc(var(--shake-intensity, 5px) * -1));
  }
  25% {
    transform: translateX(calc(var(--shake-intensity, 5px) * 1));
  }
  50% {
    transform: translateX(calc(var(--shake-intensity, 5px) * -0.5));
  }
  75% {
    transform: translateX(calc(var(--shake-intensity, 5px) * 0.5));
  }
  100% {
    transform: translateX(0);
  }
}

.shake {
  animation: shake 0.3s ease-in-out infinite;
}

@keyframes featherFall {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 1;
  }
  25% {
    transform: translateY(25vh) translateX(15vw) rotate(15deg);
  }
  50% {
    transform: translateY(50vh) translateX(-15vw) rotate(-10deg);
  }
  75% {
    transform: translateY(75vh) translateX(10vw) rotate(5deg);
  }
  100% {
    transform: translateY(100vh) translateX(-5vw) rotate(-10deg);
    opacity: 0;
  }
}

/*  */

.grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr 1fr;
}

.card s {
  position: absolute;
  inset: 0;
  opacity: var(--s-o, 0);
  pointer-events: none;
  transition: --angle 0.2s, opacity 0.6s, background-size 0.3s;
  background-size: var(--s-s, 400%);
  background-image: linear-gradient(
      var(--angle),
      rgba(255, 255, 255, 0.25),
      rgba(255, 255, 255, 0.25) 15%,
      rgba(255, 255, 255, 0.9) 20%,
      rgba(255, 255, 255, 0.9) 25%,
      rgba(255, 255, 255, 0.25) 30%,
      rgba(255, 255, 255, 0.75) 100%
    ),
    linear-gradient(
      calc(var(--angle) - 180deg),
      rgba(255, 255, 255, 0.1),
      rgba(255, 255, 255, 0.1) 15%,
      rgba(255, 255, 255, 0.8) 20%,
      rgba(255, 255, 255, 0.8) 25%,
      rgba(255, 255, 255, 0.1) 30%,
      rgba(255, 255, 255, 0.3) 100%
    ),
    linear-gradient(
      var(--angle),
      rgba(255, 255, 255, 0.25),
      rgba(255, 255, 255, 0.15) 30%,
      rgba(255, 255, 255, 0.75) 33%,
      rgba(255, 255, 255, 0.75) 33%,
      rgba(255, 255, 255, 0.15) 35%,
      rgba(255, 255, 255, 0.25) 100%
    );
}

.card:has(
    + .grid
      i:is(:nth-child(1), :nth-child(2), :nth-child(5), :nth-child(6)):hover
  ) {
  --x: -1;
  --y: 1;
  --angle: 125deg;
}
.card:has(
    + .grid
      i:is(:nth-child(3), :nth-child(4), :nth-child(7), :nth-child(8)):hover
  ) {
  --x: -1;
  --y: -1;
  --angle: 130deg;
}
.card:has(
    + .grid
      i:is(:nth-child(9), :nth-child(10), :nth-child(13), :nth-child(14)):hover
  ) {
  --x: 1;
  --y: 1;
  --angle: 135deg;
}
.card:has(
    + .grid
      i:is(:nth-child(11), :nth-child(12), :nth-child(15), :nth-child(16)):hover
  ) {
  --x: 1;
  --y: -1;
  --angle: 140deg;
}
.card:has(
    + .grid
      i:is(:nth-child(1), :nth-child(4), :nth-child(13), :nth-child(16)):hover
  ) {
  --r: 8deg;
}
.card:has(
    + .grid
      i:is(
        :nth-child(2),
        :nth-child(3),
        :nth-child(5),
        :nth-child(8),
        :nth-child(9),
        :nth-child(12),
        :nth-child(14),
        :nth-child(15)
      ):hover
  ) {
  --r: 4deg;
}
.card:has(
    + .grid
      i:is(:nth-child(6), :nth-child(7), :nth-child(10), :nth-child(11)):hover
  ) {
  --r: 2deg;
}
.card:has(+ .grid :hover) {
  --s-o: 0.5;
  --s-s: 100%;
}
@property --angle {
  syntax: "<angle>";
  inherits: true;
  initial-value: 135deg;
}
@property --background-x {
  syntax: "<number>";
  inherits: false;
  initial-value: 42%;
}
@property --background-y {
  syntax: "<number>";
  inherits: false;
  initial-value: 31%;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  width: 50vmin;
  aspect-ratio: 200/280;
  border-radius: 3vmin;
  /* box-shadow: 0 0 0 0.2vmin black, -2vmin 4vmin 1vmin 0 rgba(0, 0, 0, 0.2);
    background-image: linear-gradient(135deg, black 25%, transparent 25%), linear-gradient(225deg, black 25%, transparent 25%), linear-gradient(45deg, black 25%, transparent 25%), linear-gradient(315deg, black 25%, transparent 25%); */
  background-position: 10px 0px, 10px 0px, 0px 0px, 0px 0px;
  background-size: 20px 20px;
  background-repeat: repeat;
  /* background-color: #1b1b1b; */
  transition: transform 0.2s;
  transform: rotate3d(var(--x), var(--y), 0, var(--r));
}

.card-container {
}
.card-container {
  position: relative;
  perspective: 35rem;
  transition: scale 0.1s;
}
.card-container:has(.grid :hover) {
  scale: 1.05;
}

/* wtf holo */

/*

  V REGULAR

*/

/*

  SHINE LAYERS

*/

.card[data-rarity="rare holo v"]:not(.masked) .card__shine,
.card[data-subtypes="v-union"]:not(.masked) .card__shine {
  filter: brightness(0.7) contrast(2) saturate(0.5);
  will-change: opacity;
}

.card[data-rarity="rare holo v"] .card__shine,
.card[data-rarity="rare holo v"] .card__shine:after,
.card[data-subtypes="v-union"] .card__shine,
.card[data-subtypes="v-union"] .card__shine:after {
  --space: 5%;
  --angle: 133deg;
  --imgsize: 500px;
  will-change: opacity, transform, background-position;;
  background-image: var(--grain),
    repeating-linear-gradient(
      0deg,
      var(--sunpillar-clr-1) calc(var(--space) * 1),
      var(--sunpillar-clr-2) calc(var(--space) * 2),
      var(--sunpillar-clr-3) calc(var(--space) * 3),
      var(--sunpillar-clr-4) calc(var(--space) * 4),
      var(--sunpillar-clr-5) calc(var(--space) * 5),
      var(--sunpillar-clr-6) calc(var(--space) * 6),
      var(--sunpillar-clr-1) calc(var(--space) * 7)
    ),
    repeating-linear-gradient(
      var(--angle),
      #0e152e 0%,
      hsl(180, 10%, 60%) 3.8%,
      hsl(180, 29%, 66%) 4.5%,
      hsl(180, 10%, 60%) 5.2%,
      #0e152e 10%,
      #0e152e 12%
    ),
    radial-gradient(
      farthest-corner circle at var(--pointer-x) var(--pointer-y),
      hsla(0, 0%, 0%, 0.1) 12%,
      hsla(0, 0%, 0%, 0.15) 20%,
      hsla(0, 0%, 0%, 0.25) 120%
    );

  background-blend-mode: screen, hue, hard-light;
  background-size: var(--imgsize) 100%, 200% 700%, 300% 100%, 200% 100%;
  background-position: center, 0% var(--background-y),
    var(--background-x) var(--background-y),
    var(--background-x) var(--background-y);

  filter: brightness(0.8) contrast(2.95) saturate(0.65);
  transition: transform 0.5s ease-in-out;
}

.card[data-rarity="rare holo v"] .card__shine:after,
.card[data-subtypes="v-union"] .card__shine:after {
  content: "";

  background-position: center, 0% var(--background-y),
    calc(var(--background-x) * -1) calc(var(--background-y) * -1),
    var(--background-x) var(--background-y);
  background-size: var(--imgsize) 100%, 200% 400%, 195% 100%, 200% 100%;

  filter: brightness(1) contrast(2.5) saturate(1.75);
  mix-blend-mode: soft-light;
}

/*

  GLARE LAYERS

*/

.card[data-rarity="rare holo v"] .card__glare,
.card[data-subtypes="v-union"] .card__glare {
  background-image: radial-gradient(
    farthest-corner circle at var(--pointer-x) var(--pointer-y),
    hsl(0, 0%, 100%) 0%,
    hsla(210, 3%, 54%, 0.33) 45%,
    hsla(0, 0%, 20%, 0.9) 130%
  );

  opacity: calc(var(--card-opacity) * 0.5);

  mix-blend-mode: hard-light;
  filter: brightness(0.9) contrast(1.75);
}

/*

  BASE STYLES / VARIABLES
*/

/*

  SHINE LAYERS

*/

:root {
  --card-aspect: 0.718;
  --card-radius: 5.55% / 4.5%;
  --card-edge: hsl(47, 100%, 78%);
  --card-back: hsl(205, 100%, 25%);
  --card-glow: hsl(175, 100%, 90%);

  --sunpillar-1: hsl(2, 100%, 73%);
  --sunpillar-2: hsl(53, 100%, 69%);
  --sunpillar-3: hsl(93, 100%, 69%);
  --sunpillar-4: hsl(176, 100%, 76%);
  --sunpillar-5: hsl(228, 100%, 74%);
  --sunpillar-6: hsl(283, 100%, 73%);

  --sunpillar-clr-1: var(--sunpillar-1);
  --sunpillar-clr-2: var(--sunpillar-2);
  --sunpillar-clr-3: var(--sunpillar-3);
  --sunpillar-clr-4: var(--sunpillar-4);
  --sunpillar-clr-5: var(--sunpillar-5);
  --sunpillar-clr-6: var(--sunpillar-6);
}

.card {
  /* place the card on a new transform layer and
  make sure it has hardward acceleration... we gun'need that! */
  -webkit-transform: translate3d(0px, 0px, 0.01px);
  transform: translate3d(0px, 0px, 0.01px);
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  pointer-events: none;

  /* make sure the card is above others if it's scaled up */
  z-index: calc(var(--card-scale) * 2);

  /* every little helps! */
  will-change: transform, visibility, z-index;
}

.card,
.card * {
  /* outline is a little trick to anti-alias */
  /* outline: 1px solid transparent; */
}

.card:not(.interactive) .card__translater,
.card:not(.interactive) .card__rotator,
.card:not(.interactive) .card__shine,
.card:not(.interactive) .card__glare {
  /* if this card is not in a framework, we can add simply
    hover effects when it's not "interactive" */
  transition: all 0.3s ease;
}
.card:not(.interactive):hover {
  --pointer-x: 25% !important;
  --pointer-y: 10% !important;
  --card-scale: 1.1 !important;
  --card-opacity: 1 !important;
  --translate-x: 0px !important;
  --translate-y: -10px !important;
  --rotate-x: 7deg !important;
  --rotate-y: -19deg !important;
  --background-x: 44% !important;
  --background-y: 36% !important;
  --pointer-from-center: 0.9 !important;
  --pointer-from-top: 0.11 !important;
  --pointer-from-left: 0.25 !important;
}

.card.water {
  --card-glow: hsl(192, 97%, 60%);
}
.card.fire {
  --card-glow: hsl(9, 81%, 59%);
}
.card.grass {
  --card-glow: hsl(96, 81%, 65%);
}
.card.lightning {
  --card-glow: hsl(54, 87%, 63%);
}
.card.psychic {
  --card-glow: hsl(281, 62%, 58%);
}
.card.fighting {
  --card-glow: rgb(145, 90, 39);
}
.card.darkness {
  --card-glow: hsl(189, 77%, 27%);
}
.card.metal {
  --card-glow: hsl(184, 20%, 70%);
}
.card.dragon {
  /* --card-glow: hsl(51, 60%, 35%); */
}
.card.fairy {
  --card-glow: hsl(323, 100%, 89%);
}

.card,
.card__rotator {
  aspect-ratio: var(--card-aspect);
  border-radius: var(--card-radius);
}

.card.interacting {
  z-index: calc(var(--card-scale) * 120);
}

.card.active .card__translater,
.card.active .card__rotator {
  /* prevent pinch/double-tap zooms on card */
  touch-action: none;
}

.card__translater,
.card__rotator {
  display: grid;
  perspective: 600px;
  will-change: transform, box-shadow;

  transform-origin: center;
  -webkit-transform-origin: center;
}

.card__translater {
  width: auto;
  position: relative;

  -webkit-transform: translate3d(var(--translate-x), var(--translate-y), 0.1px)
    scale(var(--card-scale));
  transform: translate3d(var(--translate-x), var(--translate-y), 0.1px)
    scale(var(--card-scale));
}

.card__rotator {
  -webkit-transform: rotateY(var(--rotate-x)) rotateX(var(--rotate-y));
  -webkit-transform-style: preserve-3d;
  transform: rotateY(var(--rotate-x)) rotateX(var(--rotate-y));
  transform-style: preserve-3d;

  /* performance */
  pointer-events: auto;
  /* overflow: hidden; <-- this improves perf on mobile, but breaks backface visibility. */
  /* isolation: isolate; <-- this improves perf, but breaks backface visibility on Chrome. */
}

button.card__rotator {
  /* because the card is a button, there's some default
    browser styles which need to be subdued */
  border: none;
  background: transparent;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
}

.card__rotator,
.card.active .card__rotator:focus {
  transition: box-shadow 0.4s ease, opacity 0.33s ease-out;
  box-shadow: 0 0 3px -1px transparent, 0 0 2px 1px transparent,
    0 0 5px 0px transparent, 0px 10px 20px -5px black, 0 2px 15px -5px black,
    0 0 20px 0px transparent;
}

.card.active .card__rotator,
.card__rotator:focus {
  box-shadow: 0 0 3px -1px white, 0 0 3px 1px var(--card-edge),
    0 0 12px 2px var(--card-glow), 0px 10px 20px -5px black,
    0 0 40px -30px var(--card-glow), 0 0 50px -20px var(--card-glow);
}

.card__rotator * {
  width: 100%;
  display: grid;
  grid-area: 1/1;
  aspect-ratio: var(--card-aspect);
  border-radius: var(--card-radius);
  image-rendering: optimizeQuality;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  pointer-events: none;
  overflow: hidden;
}

.card__rotator img {
  height: auto;
  -webkit-transform: translate3d(0px, 0px, 0.01px);
  transform: translate3d(0px, 0px, 0.01px);
}

.card__back {
  background-color: var(--card-back);
  -webkit-transform: rotateY(180deg) translateZ(1px);
  transform: rotateY(180deg) translateZ(1px);
  backface-visibility: visible;
}

.card__front,
.card__front * {
  backface-visibility: hidden;
}

.card__front {
  opacity: 1;
  transition: opacity 0.33s ease-out;
  -webkit-transform: translate3d(0px, 0px, 0.01px);
  transform: translate3d(0px, 0px, 0.01px);
}

.loading .card__front {
  opacity: 0;
}

.loading .card__back {
  -webkit-transform: rotateY(0deg);
  transform: rotateY(0deg);
}

/**
  
Shine & Glare Effects

**/

.card__shine {
  display: grid;
  transform: translateZ(1px);
  overflow: hidden;
  z-index: 3;
  background: transparent;
  background-size: cover;
  background-position: center;
  filter: brightness(0.85) contrast(2.75) saturate(0.65);
  mix-blend-mode: lighten;
  
  opacity: var(--card-opacity);
}

.card__shine:before,
.card__shine:after {
  --sunpillar-clr-1: var(--sunpillar-5);
  --sunpillar-clr-2: var(--sunpillar-6);
  --sunpillar-clr-3: var(--sunpillar-1);
  --sunpillar-clr-4: var(--sunpillar-2);
  --sunpillar-clr-5: var(--sunpillar-3);
  --sunpillar-clr-6: var(--sunpillar-4);

  grid-area: 1/1;
  transform: translateZ(1px);
  border-radius: var(--card-radius);
}

.card__shine:after {
  --sunpillar-clr-1: var(--sunpillar-6);
  --sunpillar-clr-2: var(--sunpillar-1);
  --sunpillar-clr-3: var(--sunpillar-2);
  --sunpillar-clr-4: var(--sunpillar-3);
  --sunpillar-clr-5: var(--sunpillar-4);
  --sunpillar-clr-6: var(--sunpillar-5);

  transform: translateZ(1.2px);
}

.card__glare {
  /* make sure the glare doesn't clip */
  transform: translateZ(1.41px);
  overflow: hidden;

  background-image: radial-gradient(
    farthest-corner circle at var(--pointer-x) var(--pointer-y),
    hsla(0, 0%, 100%, 0.8) 10%,
    hsla(0, 0%, 100%, 0.65) 20%,
    hsla(0, 0%, 0%, 0.5) 90%
  );

  opacity: var(--card-opacity);
  mix-blend-mode: overlay;
}

/**

  Masking Effects

**/

.card.masked .card__shine,
.card.masked .card__shine:before,
.card.masked .card__shine:after {
  /** masking image for cards which are masked **/
  -webkit-mask-image: var(--mask);
  mask-image: var(--mask);
  -webkit-mask-size: cover;
  mask-size: cover;
  -webkit-mask-position: center center;
  mask-position: center center;
}

.card[data-rarity="rare holo"] .card__glare:after,
.card[data-rarity="rare holo cosmos"] .card__glare:after,
.card[data-rarity$="reverse holo"] .card__glare:after {
  clip-path: var(--clip);
}

.card[data-rarity="rare holo"][data-subtypes^="stage"] .card__glare:after,
.card[data-rarity="rare holo cosmos"][data-subtypes^="stage"]
  .card__glare:after,
.card[data-rarity$="reverse holo"][data-subtypes^="stage"] .card__glare:after {
  clip-path: var(--clip-stage);
}

.card[data-rarity="rare holo"][data-supertype="trainer"] .card__glare:after,
.card[data-rarity="rare holo cosmos"][data-supertype="trainer"]
  .card__glare:after,
.card[data-rarity$="reverse holo"][data-supertype="trainer"]
  .card__glare:after {
  clip-path: var(--clip-trainer);
}

.card {
  transition: transform 1s ease-in-out;
  transform: translateY(100vh);
  --grain: url("/img/grain.webp");
  --glittersize: 25%;
  --space: 5%;
  --angle: 133deg;
  --clip: inset(9.85% 8% 52.85% 8%);
  --clip-invert: polygon(
    0% 0%,
    100% 0%,
    100% 100%,
    0% 100%,
    0 47.15%,
    91.5% 47.15%,
    91.5% 9.85%,
    8% 9.85%,
    8% 47.15%,
    0 50%
  );
  --clip-stage: polygon(
    91.5% 9.85%,
    57% 9.85%,
    54% 12%,
    17% 12%,
    16% 14%,
    12% 16%,
    8% 16%,
    8% 47.15%,
    92% 47.15%
  );
  --clip-stage-invert: polygon(
    0% 0%,
    100% 0%,
    100% 100%,
    0% 100%,
    0 47.15%,
    91.5% 47.15%,
    91.5% 9.85%,
    57% 9.85%,
    54% 12%,
    17% 12%,
    16% 14%,
    12% 16%,
    8% 16%,
    8% 47.15%,
    0 50%
  );
  --clip-trainer: inset(14.5% 8.5% 48.2% 8.5%);
  --clip-borders: inset(2.8% 4% round 2.55% / 1.5%);
}

.card__shine,
.card__glare {
  will-change: transform, opacity, background-image, background-size,
    background-position, background-blend-mode, filter;
}
