/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
  /* Card dimensions */
  --cardWidth: 300px;
  --cardHeight: 450px;
  --cardDepth: 3px;
  --halfWidth: calc(var(--cardWidth) / 2);
  --halfHeight: calc(var(--cardHeight) / 2);
  --halfDepth: calc(var(--cardDepth) / 2);
  
  /* Colors */
  --primary-bg: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
  --secondary-bg: #000000;
  --accent-color: #4fb3d9;
  --accent-glow: #64b5f6;
  --text-primary: #ffffff;
  --text-secondary: #333;
  --overlay-bg: rgba(0, 0, 0, 0.7);
  
  /* Card rarity colors */
  --normal-color: #2196f3;
  --normal-light: #bbdefb;
  --rare-color: #9c27b0;
  --rare-light: #e1bee7;
  --special-color: #e91e63;
  --special-light: #f8bbd9;
  --legendary-color: #ff9800;
  --legendary-light: #ffe0b2;
  
  /* Transitions */
  --transition-fast: 0.3s ease;
  --transition-medium: 0.5s ease;
  --transition-slow: 0.8s ease;
  
  /* Fonts */
  --font-primary: 'Orbitron', 'Exo 2', sans-serif;
  --font-secondary: 'Exo 2', sans-serif;
}

/* ===== RESET & BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-secondary);
  line-height: 1.6;
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-bg);
  background-attachment: fixed;
  touch-action: manipulation;
  overflow: hidden;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* ===== HELP BUTTON STYLES ===== */
.help-button-container {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 10000;
}

.help-button {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: linear-gradient(145deg, #2c3e50, #34495e);
  border: 2px solid var(--accent-color);
  color: var(--text-primary);
  font-size: 18px;
  font-weight: bold;
  font-family: var(--font-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.help-button:hover {
  background: linear-gradient(145deg, #34495e, #3c5a78);
  box-shadow: 0 6px 20px rgba(79, 179, 217, 0.4);
  transform: translateY(-2px);
}

.help-tooltip {
  position: absolute;
  top: 55px;
  left: 0;
  background: rgba(20, 20, 40, 0.95);
  border: 1px solid var(--accent-color);
  border-radius: 10px;
  padding: 15px;
  min-width: 280px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-fast);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.help-button:hover + .help-tooltip,
.help-tooltip:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.tooltip-content p {
  color: var(--text-primary);
  font-size: 14px;
  margin: 8px 0;
  font-family: var(--font-secondary);
  line-height: 1.4;
}

.tooltip-content p:first-child {
  margin-top: 0;
}

.tooltip-content p:last-child {
  margin-bottom: 0;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, rgba(79, 179, 217, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* ===== MAIN LAYOUT ===== */
.main-content {
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.gallery-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100vh;
  justify-content: center;
  position: relative;
}

.gallery-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.floating-particles {
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.3), transparent),
              radial-gradient(2px 2px at 40px 70px, rgba(79, 179, 217, 0.4), transparent),
              radial-gradient(1px 1px at 90px 40px, rgba(255, 255, 255, 0.6), transparent),
              radial-gradient(1px 1px at 130px 80px, rgba(79, 179, 217, 0.3), transparent);
  animation: sparkleFloat 8s ease-in-out infinite;
}

@keyframes sparkleFloat {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
    opacity: 1;
  }
}

.card-container {
  position: relative;
  width: var(--cardWidth);
  height: var(--cardHeight);
  background-color: transparent;
  margin: 0 auto;
  user-select: none;
  perspective: 1000px;
  z-index: 10;
}

.card-glow-effect {
  position: absolute;
  top: -20px;
  left: -20px;
  right: -20px;
  bottom: -20px;
  background: radial-gradient(ellipse at center, rgba(79, 179, 217, 0.3) 0%, transparent 70%);
  border-radius: 20px;
  opacity: 0;
  transition: opacity var(--transition-medium);
  pointer-events: none;
  z-index: -1;
}

.card-container:hover .card-glow-effect {
  opacity: 1;
}

.effect {
  position: absolute;
  width: var(--cardWidth);
  height: var(--cardHeight);
  background-color: white;
  margin: 0 auto;
  user-select: none;
  z-index: 1;
}

.scene {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15), 0 8px 16px rgba(0, 0, 0, 0.1);
}

.scene.top {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2), 0 16px 32px rgba(0, 0, 0, 0.15);
}


@keyframes fastShake {
  0%, 100% {
    transform: translateX(0) rotate(1.5deg);
    scale: 1;
  }
  12.5% {
    transform: translateX(-3px) rotate(-1.5deg);
    scale: 1.1;
  }
  25% {
    transform: translateX(3px) rotate(1.5deg);
  }
  37.5% {
    transform: translateX(-3px) rotate(-1.5deg);
  }
  50% {
    transform: translateX(3px) rotate(1.5deg);
  }
  62.5% {
    transform: translateX(-3px) rotate(-1.5deg);
  }
  75% {
    transform: translateX(3px) rotate(1.5deg);
    scale:1;
  }
  87.5% {
    transform: translateX(-1.5px) rotate(0deg);
  }
  95% {
    transform: translateX(1.5px) rotate(-0deg);
  }
}

.scene.active {
    opacity: 1;
    transform: translateX(0);
}

.scene.exit {
    opacity: 0;
    transform: translateX(-100%);
}

.card {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  cursor: grab;
  transition: transform 0.1s ease-out;
  transition: transform 0.3s ease;
}

.reveal-cover-special {
  position: absolute;
  width: 150%;
  height: 150%;
  background: linear-gradient(45deg, #db43e3, #db43e3);
  transform: rotate(45deg);
  z-index: 1;
  box-shadow: 0 0 20px #db43e3;
}

.reveal-cover-legendary {
  position: absolute;
  width: 150%;
  height: 150%;
  background: linear-gradient(45deg, #ffd700, #ffd700);
  transform: rotate(0deg);
  z-index: 1;
  box-shadow: 0 0 20px #ffd700;
}

.reveal-glow-special {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #db43e3, #db43e3);
  z-index: 2;
  box-shadow: 0 0 20px #db43e3, 0 0 40px #db43e3, 0 0 60px #db43e3;
  opacity: 0;
  animation: glow 1.5s infinite alternate, fadeIn 1s forwards;
}

@keyframes glow {
  0% {
    box-shadow: 0 0 5px #db43e3, 0 0 10px #db43e3, 0 0 15px #db43e3, 0 0 20px #db43e3;
  }
  50% {
    box-shadow: 0 0 10px #db43e3, 0 0 20px #db43e3, 0 0 30px #db43e3, 0 0 40px #db43e3;
  }
  100% {
    box-shadow: 0 0 5px #db43e3, 0 0 10px #db43e3, 0 0 15px #db43e3, 0 0 20px #db43e3;
  }
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

.reveal-glow-legendary {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #db43e3, #db43e3);
  z-index: 2;
  box-shadow: 0 0 20px #db43e3, 0 0 40px #db43e3, 0 0 60px #db43e3;
  animation: changeColor 7s forwards, glow-legendary 1.5s infinite alternate 5s, fadeIn 1s forwards;
}

@keyframes changeColor {
  to {
    background: linear-gradient(0deg, #ffd700, #ffd700);
    box-shadow: 0 0 20px #ffd700, 0 0 40px #ffd700, 0 0 60px #ffd700;
  }
}
@keyframes glow-legendary {
  0% {
    box-shadow: 0 0 5px #ffd700, 0 0 10px #ffd700, 0 0 15px #ffd700, 0 0 20px #ffd700;
  }
  50% {
    box-shadow: 0 0 10px #ffd700, 0 0 20px #ffd700, 0 0 30px #ffd700, 0 0 40px #ffd700;
  }
  100% {
    box-shadow: 0 0 5px #ffd700, 0 0 10px #ffd700, 0 0 15px #ffd700, 0 0 20px #ffd700;
  }
}


.reveal-cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, 
      rgba(255,255,255,0) 0%,
      rgba(255,255,255,0.2) 50%,
      rgba(255,255,255,0) 100%);
  animation: sweep 0.3s ease-out 0.8s forwards;
}

.reveal-cover-top-special {
  top: -50%;
  right: -25%;
  transform-origin: bottom left;
  animation: slideTopOut 0.8s cubic-bezier(0.45, 0, 0.55, 1) 1s forwards;
}

.reveal-cover-bottom-special {
  bottom: -50%;
  left: -25%;
  transform-origin: top right;
  animation: slideBottomOut 0.8s cubic-bezier(0.45, 0, 0.55, 1) 1s forwards;
}

.reveal-cover-left-legendary {
  top: -25%;
  right: -25%;
  transform-origin: bottom left;
  animation: slideLeftOut 1.5s cubic-bezier(0.45, 0, 0.55, 1) 1.5s forwards;
}

.reveal-cover-right-legendary {
  bottom: -25%;
  left: -25%;
  transform-origin: top right;
  animation: slideRightOut 1.5s cubic-bezier(0.45, 0, 0.55, 1) 1.5s forwards;
}


@keyframes slideTopOut {
  to {
      transform: rotate(45deg) translateX(150%);
      box-shadow: 0 0 40px rgba(37, 99, 235, 0.8);
  }
}

@keyframes slideBottomOut {
  to {
      transform: rotate(45deg) translateX(-150%);
      box-shadow: 0 0 40px rgba(37, 99, 235, 0.8);
  }
}

@keyframes slideLeftOut {
  to {
      transform:translateX(150%);
      box-shadow: 0 0 40px rgba(37, 99, 235, 0.8);
  }
}

@keyframes slideRightOut {
  to {
      transform:translateX(-150%);
      box-shadow: 0 0 40px rgba(37, 99, 235, 0.8);
  }
}

@keyframes sweep {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}
.card.flipped {
  transform: rotateY(180deg); /* Rotate 180 degrees to show back */
}

  .card:active {
    cursor: grabbing;
  }

  .card__face {
    width: var(--cardDepth);
    height: 100%;
    background: #ddd;
    position: absolute;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-family: Arial, sans-serif;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
  }

  .back-img,
  .front-img {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    object-fit: cover;
    pointer-events: none;
    cursor: not-allowed;
    user-select: none;  /* Prevent text selection on images */
    -webkit-user-drag: none; /* Prevent dragging in WebKit browsers */
    -khtml-user-drag: none; /* Prevent dragging in Konqueror */
    -moz-user-drag: none; /* Prevent dragging in Firefox */
    -o-user-drag: none; /* Prevent dragging in Opera */
   pointer-events: none; /* Prevent all mouse events on the images */
  }

  .back-img {
    border: 10px solid transparent;
    box-sizing: border-box;
    background-clip: padding-box;
  }

  .card__face--front,
  .card__face--back {
    width: 100%;
    height: 100%;
  }

  .card__face--front {
    transform: translateZ(calc(var(--halfDepth)));
    background: linear-gradient(45deg, #ff6b6b, #ff8787);
    color: white;
    overflow: hidden;
    position: relative;
  }

  .card__face--back {
    transform: rotateY(180deg) translateZ(calc(var(--halfDepth)))
    translateY(calc(-1 * var(--cardHeight)));
    background: linear-gradient(45deg, #ffffff, #ffffff);
    color: white;
    backface-visibility: visible;
  }

  .card__face--left {
    transform-origin: left;
    transform: rotateY(-90deg) translateX(calc(-1 * var(--halfDepth)))
      translateY(calc(-1 * var(--cardHeight)));
    left: 0;
    border-radius: 10px 0 0 10px;
  }

  .card__face--right {
    transform-origin: right;
    transform: rotateY(90deg) translateX(calc(var(--halfDepth))) 
      translateY(calc(-1 * var(--cardHeight)));
    right: 0;
    border-radius: 0 10px 10px 0;
  }

  .card__face--top,
  .card__face--bottom {
    width: 100%;
    height: var(--cardDepth);
    background: #bbb;
  }

  .card__face--top {
    transform-origin: top;
    transform: rotateX(90deg) translateY(calc(-1 * var(--halfDepth)));
    top: 0;
    border-radius: 10px 10px 0 0;
  }

  .card__face--bottom {
    transform-origin: bottom;
    transform: rotateX(-90deg) translateY(calc(var(--halfDepth)));
    bottom: 0;
    border-radius: 0 0 10px 10px;
  }

  /* Hiệu ứng holographic */
  /* .card__face--front::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
      125deg,
      transparent 0%,
      rgba(255, 255, 255, 0.459) 30%,
      rgba(227, 55, 215, 0.5) 50%,
      rgba(255, 255, 255, 0.1) 70%,
      transparent 100%
    );
    background-size: 200% 200%;
    animation: holographic 2.5s linear infinite;
    pointer-events: none;
  } */

  /* Hiệu ứng sparkles */
  /* .card__face--front::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
      radial-gradient(circle at 50% 50%, white 1%, transparent 1%),
      radial-gradient(circle at 30% 20%, white 1%, transparent 1%),
      radial-gradient(circle at 70% 30%, white 1%, transparent 1%),
      radial-gradient(circle at 20% 60%, white 1%, transparent 1%),
      radial-gradient(circle at 80% 70%, white 1%, transparent 1%);
    background-size: 100% 100%;
    opacity: 0;
    mix-blend-mode: overlay;
    animation: sparkle 5s linear infinite;
    pointer-events: none;
  } */

  .gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
      45deg,
      rgba(255, 0, 0, 0.2),
      rgba(0, 255, 0, 0.2),
      rgba(0, 0, 255, 0.2)
    );
    mix-blend-mode: color;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
  }

  .card:hover .gradient-overlay {
    opacity: 1;
  }

  .menu-button { /* Style the button as needed */
    background-color: transparent;
    font-weight: bold; /* Màu vàng nhẹ, tạo cảm giác sang trọng */
    color: #ffffff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
  }

/* ===== MAIN LAYOUT ===== */


  @keyframes holographic {
    0% {
      background-position: 0% 0%;
    }
    100% {
      background-position: 200% 200%;
    }
  }

  @keyframes sparkle {
    0%, 100% {
      opacity: 0;
    }
    50% {
      opacity: 0.5;
    }
  }

/* Normal Card */
.normal {
  position: relative;
  background: linear-gradient(transparent 0%,
    90deg,
    #0000FF 0%,
    #ADD8E6 50%,
    #0000FF 100%
  );
  background-size: 200% 100%;
  background-position: 0% 0%;
  animation: blueGradient 3s linear infinite;
}
@keyframes blueGradient {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 100% 0%;
  }
}

.normal::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(173, 216, 230, 0.4) 45%,
    rgba(255, 255, 255, 0.5) 50%,
    rgba(173, 216, 230, 0.4) 55%,
    transparent 100%
  );
  background-size: 300% 300%;
  background-position: 0% 0%;
  animation: blueShine 2s linear infinite;
}
@keyframes blueShine {
  0% {
    background-position: 0% 0;
  }
  100% {
    background-position: 100% 0;
  }
}
  


/* Rare Card */
.rare {
  position: relative;
  background-blend-mode: lighten;
}

.rare::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    180deg,
    transparent 80%,
    rgba(153, 50, 204, 0.4) 90%
  );
  background-size: 100% 100%;
}


/* Removed purpleGradient and purpleShine animations */

/* Special Card */
.special {
  position: relative;
}

.special::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    -180deg,
    transparent 0%,
    rgba(255, 255, 255, 0.459) 40%,
    rgba(227, 55, 215, 0.5) 60%,
    rgba(232, 45, 213, 0.751) 80%,
    transparent 100%
  );
  background-size: 200% 200%;
  animation: holographic 2s cubic-bezier(0.455, 0.01, 0.515, 0.995) infinite;
  pointer-events: none;
}

.special::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 50% 50%, white 1%, transparent 1%),
    radial-gradient(circle at 30% 20%, white 1%, transparent 1%),
    radial-gradient(circle at 70% 30%, white 1%, transparent 1%),
    radial-gradient(circle at 20% 60%, white 1%, transparent 1%),
    radial-gradient(circle at 80% 70%, white 1%, transparent 1%);
  background-size: 100% 100%;
  opacity: 0;
  mix-blend-mode: overlay;
  animation: sparkle 5s linear infinite;
  pointer-events: none;
}

/* Legendary Card */
.legendary {
  position: relative;
  background: linear-gradient(transparent 0%,
    90deg,
    #ffd700 0%,
    #f7ef8a 20%,
    #b27e11 40%,
    #ffd700 60%,
    #ffef00 80%,
    #ffd700 100%
  );
  background-size: 200% 100%;
  animation: goldenGradient 3s linear infinite;
}

@keyframes goldenGradient {
  0% {
    background-position: 100% 0%;
  }
  100% {
    background-position: -100% 0%;
  }
}

.legendary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(193, 193, 80, 0.4) 45%,
    rgba(255, 233, 64, 0.824) 50%,
    rgba(255, 255, 255, 0.4) 55%,
    transparent 100%
  );
  background-size: 200% 200%;
  animation: goldShine 2s ease-out infinite;
}

@keyframes goldShine {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Add to existing style.css */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  line-height: 1.6;
  overflow: hidden;
}

.navbar {
  align-self: bottom;
  background: #333;
  padding: 1rem 2rem;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
  background: #555;
}

.section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#home {
  background: #f5f5f5;
  text-align: center;
}



#about {
  background: #f5f5f5;
  text-align: center;
}

/* ===== MENU BAR ===== */
.menu-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 15%;
  background: linear-gradient(135deg, rgba(26, 26, 46, 0.95), rgba(15, 52, 96, 0.95));
  backdrop-filter: blur(20px);
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-primary);
  border-top: 2px solid rgba(79, 179, 217, 0.3);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
  z-index: 100;
}

.menu-grid {
  height: 100%;
  width: 100%;
  max-width: 800px;
  padding: 15px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: center;
}

.menu-button {
  position: relative;
  background: linear-gradient(135deg, rgba(79, 179, 217, 0.2), rgba(100, 181, 246, 0.1));
  border: 2px solid rgba(79, 179, 217, 0.3);
  color: var(--text-primary);
  padding: 15px 10px;
  border-radius: 15px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all var(--transition-fast);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  backdrop-filter: blur(10px);
  min-height: 70px;
  width: 100%;
}

.menu-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left var(--transition-medium);
}

.menu-button:hover::before {
  left: 100%;
}

.menu-button:hover {
  background: linear-gradient(135deg, rgba(79, 179, 217, 0.4), rgba(100, 181, 246, 0.3));
  border-color: var(--accent-glow);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(79, 179, 217, 0.3);
}

.menu-button:active {
  transform: translateY(-1px);
}

.btn-icon {
  font-size: 20px;
  filter: drop-shadow(0 0 10px rgba(79, 179, 217, 0.5));
}

.btn-text {
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.btn-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(79, 179, 217, 0.6) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all var(--transition-fast);
  pointer-events: none;
}

.menu-button:hover .btn-glow {
  width: 200px;
  height: 200px;
}
/* ===== INVENTORY POPUP ===== */
.inventory-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--overlay-bg);
  backdrop-filter: blur(15px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 20px;
  box-sizing: border-box;
}

.inventory-popup.show {
  opacity: 1;
  visibility: visible;
}

.inventory-popup-content {
  width: 90%;
  height: 90%;
  max-width: 1200px;
  max-height: 90vh;
  background: linear-gradient(135deg, rgba(26, 26, 46, 0.95), rgba(15, 52, 96, 0.90));
  border: 2px solid rgba(79, 179, 217, 0.3);
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(20px);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease;
  opacity: 0;
  margin: auto;
}

.inventory-popup.show .inventory-popup-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.inventory-header {
  padding: 25px 30px;
  background: linear-gradient(135deg, rgba(15, 52, 96, 0.8), rgba(26, 26, 46, 0.8));
  border-bottom: 2px solid rgba(79, 179, 217, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.inventory-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(79, 179, 217, 0.1), transparent);
  animation: headerShimmer 3s ease-in-out infinite;
  pointer-events: none;
}

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

.inventory-title-section {
  display: flex;
  align-items: center;
  gap: 15px;
}

.inventory-title {
  font-family: var(--font-primary);
  font-size: 28px;
  font-weight: 900;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  text-shadow: 0 0 20px rgba(79, 179, 217, 0.5);
}

.title-icon {
  font-size: 32px;
  filter: drop-shadow(0 0 10px rgba(79, 179, 217, 0.8));
  animation: iconFloat 2s ease-in-out infinite;
}

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

.title-accent {
  background: linear-gradient(135deg, var(--accent-color), var(--accent-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.inventory-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

.clear-inventory-btn {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  border: 2px solid #e74c3c;
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  font-family: var(--font-primary);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 12px;
}

.clear-inventory-btn:hover {
  background: linear-gradient(135deg, #c0392b, #a93226);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(231, 76, 60, 0.4);
}

.btn-icon {
  font-size: 14px;
}

.close-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--transition-fast);
  backdrop-filter: blur(10px);
}

.close-btn:hover {
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.8), rgba(192, 57, 43, 0.8));
  border-color: #e74c3c;
  transform: rotate(90deg) scale(1.1);
}

.close-icon {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-primary);
  line-height: 1;
}

.inventory-popup::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  z-index: -1;
}

.inventory-popup-content-inner {
  flex: 1;
  overflow-y: auto;
  padding: 25px;
  -webkit-mask-image: linear-gradient(to bottom, black 95%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 95%, transparent 100%);
}

.inventory-popup-content-inner::-webkit-scrollbar {
  width: 8px;
}

.inventory-popup-content-inner::-webkit-scrollbar-track {
  background: rgba(79, 179, 217, 0.1);
  border-radius: 4px;
}

.inventory-popup-content-inner::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--accent-color), var(--accent-glow));
  border-radius: 4px;
}

.inventory-popup-content-inner::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--accent-glow), var(--accent-color));
}

.cards-section {
  margin-bottom: 35px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.inventory-popup.show .cards-section {
  opacity: 1;
  transform: translateY(0);
}

.inventory-popup.show .cards-section:nth-child(1) {
  transition-delay: 0.1s;
}

.inventory-popup.show .cards-section:nth-child(2) {
  transition-delay: 0.2s;
}

.inventory-popup.show .cards-section:nth-child(3) {
  transition-delay: 0.3s;
}

.inventory-popup.show .cards-section:nth-child(4) {
  transition-delay: 0.4s;
}

.section-title {
  font-family: var(--font-primary);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  padding: 15px 20px;
  background: linear-gradient(135deg, rgba(79, 179, 217, 0.2), rgba(100, 181, 246, 0.1));
  border: 2px solid rgba(79, 179, 217, 0.3);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.section-title::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.section-title:hover::before {
  left: 100%;
}

.rarity-icon {
  font-size: 24px;
  margin-right: 10px;
  filter: drop-shadow(0 0 8px rgba(79, 179, 217, 0.6));
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { 
    transform: scale(1); 
    filter: drop-shadow(0 0 8px rgba(79, 179, 217, 0.6));
  }
  50% { 
    transform: scale(1.1); 
    filter: drop-shadow(0 0 12px rgba(79, 179, 217, 0.8));
  }
}

.card-count {
  background: linear-gradient(135deg, var(--accent-color), var(--accent-glow));
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-primary);
  box-shadow: 0 4px 15px rgba(79, 179, 217, 0.3);
}

.inventory {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 25px;
  user-select: none;
}

.inventory-card {
  position: relative;
  aspect-ratio: 2/3;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  overflow: hidden;
  transition: all var(--transition-fast);
  background: linear-gradient(135deg, rgba(79, 179, 217, 0.1), rgba(100, 181, 246, 0.05));
  border: 2px solid rgba(79, 179, 217, 0.2);
  opacity: 0;
  transform: scale(0.8) translateY(20px);
  animation: cardFadeIn 0.5s ease forwards;
}

.inventory-popup.show .inventory-card {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Staggered animation delays for cards */
.inventory-card:nth-child(1) { animation-delay: 0.1s; }
.inventory-card:nth-child(2) { animation-delay: 0.15s; }
.inventory-card:nth-child(3) { animation-delay: 0.2s; }
.inventory-card:nth-child(4) { animation-delay: 0.25s; }
.inventory-card:nth-child(5) { animation-delay: 0.3s; }
.inventory-card:nth-child(6) { animation-delay: 0.35s; }
.inventory-card:nth-child(7) { animation-delay: 0.4s; }
.inventory-card:nth-child(8) { animation-delay: 0.45s; }
.inventory-card:nth-child(9) { animation-delay: 0.5s; }
.inventory-card:nth-child(10) { animation-delay: 0.55s; }

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.card-holder {
  position: relative;
  border-radius: 12px;
  width: 100%;
  height: 100%;
  aspect-ratio: 2/3;
  transition: all var(--transition-fast);
}

.card-holder:hover {
  transform: translateY(-8px) scale(1.05);
  box-shadow: 0 15px 35px rgba(79, 179, 217, 0.4);
}

.duplicate-circle {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(240, 240, 240, 0.95));
  border: 2px solid rgba(79, 179, 217, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  color: var(--text-secondary);
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

/* ===== SKELETON CARDS ===== */
.skeleton-card {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 2/3;
  background: linear-gradient(135deg, rgba(79, 179, 217, 0.1), rgba(100, 181, 246, 0.05));
  border: 2px dashed rgba(79, 179, 217, 0.3);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: default;
  transition: all var(--transition-fast);
  opacity: 0.6;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.skeleton-card:hover {
  opacity: 0.8;
  border-color: rgba(79, 179, 217, 0.5);
  transform: translateY(-2px);
}

.skeleton-icon {
  font-size: 32px;
  color: rgba(79, 179, 217, 0.4);
  margin-bottom: 8px;
  filter: drop-shadow(0 0 10px rgba(79, 179, 217, 0.3));
}

.skeleton-text {
  font-family: var(--font-primary);
  font-size: 12px;
  font-weight: 600;
  color: rgba(79, 179, 217, 0.6);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.skeleton-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(79, 179, 217, 0.1) 50%,
    transparent 70%
  );
  background-size: 200% 200%;
  animation: skeletonShimmer 3s ease-in-out infinite;
  border-radius: 10px;
  pointer-events: none;
}

@keyframes skeletonShimmer {
  0% {
    background-position: -200% -200%;
  }
  50% {
    background-position: 200% 200%;
  }
  100% {
    background-position: -200% -200%;
  }
}

/* Rarity-specific skeleton cards */
.skeleton-card.normal {
  border-color: rgba(33, 150, 243, 0.3);
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.1), rgba(187, 222, 251, 0.05));
}

.skeleton-card.normal .skeleton-icon {
  color: rgba(33, 150, 243, 0.4);
}

.skeleton-card.normal .skeleton-text {
  color: rgba(33, 150, 243, 0.6);
}

.skeleton-card.rare {
  border-color: rgba(156, 39, 176, 0.3);
  background: linear-gradient(135deg, rgba(156, 39, 176, 0.1), rgba(225, 190, 231, 0.05));
}

.skeleton-card.rare .skeleton-icon {
  color: rgba(156, 39, 176, 0.4);
}

.skeleton-card.rare .skeleton-text {
  color: rgba(156, 39, 176, 0.6);
}

.skeleton-card.special {
  border-color: rgba(233, 30, 99, 0.3);
  background: linear-gradient(135deg, rgba(233, 30, 99, 0.1), rgba(248, 187, 217, 0.05));
}

.skeleton-card.special .skeleton-icon {
  color: rgba(233, 30, 99, 0.4);
}

.skeleton-card.special .skeleton-text {
  color: rgba(233, 30, 99, 0.6);
}

.skeleton-card.legendary {
  border-color: rgba(255, 152, 0, 0.3);
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.1), rgba(255, 224, 178, 0.05));
}

.skeleton-card.legendary .skeleton-icon {
  color: rgba(255, 152, 0, 0.4);
}

.skeleton-card.legendary .skeleton-text {
  color: rgba(255, 152, 0, 0.6);
}

/* ===== RARITY SPECIFIC STYLES ===== */
.normal-section {
  border-color: var(--normal-color);
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.2), rgba(187, 222, 251, 0.1));
}

.normal-section .rarity-icon {
  color: var(--normal-color);
  filter: drop-shadow(0 0 8px var(--normal-color));
}

.normal-section .card-count {
  background: linear-gradient(135deg, var(--normal-color), var(--normal-light));
}

.rare-section {
  border-color: var(--rare-color);
  background: linear-gradient(135deg, rgba(156, 39, 176, 0.2), rgba(225, 190, 231, 0.1));
}

.rare-section .rarity-icon {
  color: var(--rare-color);
  filter: drop-shadow(0 0 8px var(--rare-color));
}

.rare-section .card-count {
  background: linear-gradient(135deg, var(--rare-color), var(--rare-light));
}

.special-section {
  border-color: var(--special-color);
  background: linear-gradient(135deg, rgba(233, 30, 99, 0.2), rgba(248, 187, 217, 0.1));
}

.special-section .rarity-icon {
  color: var(--special-color);
  filter: drop-shadow(0 0 8px var(--special-color));
}

.special-section .card-count {
  background: linear-gradient(135deg, var(--special-color), var(--special-light));
}

.legendary-section {
  border-color: var(--legendary-color);
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.2), rgba(255, 224, 178, 0.1));
}

.legendary-section .rarity-icon {
  color: var(--legendary-color);
  filter: drop-shadow(0 0 8px var(--legendary-color));
}

.legendary-section .card-count {
  background: linear-gradient(135deg, var(--legendary-color), var(--legendary-light));
}

.normal-cards .rare-cards .special-cards .legendary-cards
{
  display: none;
}
.inventory-text
{
  font-size: 20px;
  font-weight: bold;
  color: #333;
  margin: 10px;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Large tablets and small desktops */
@media (max-width: 1200px) {
  :root {
    --cardWidth: 280px;
    --cardHeight: 420px;
  }
  
  .menu-bar {
    height: 12%;
  }
  
  .inventory {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
  }
}

/* Medium tablets */
@media (max-height: 800px) and (max-width: 1024px){
  :root{
    --cardWidth: 280px;
    --cardHeight: 420px;
  }
  
  .inventory {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
  
  .menu-bar {
    height: 14%;
  }
  
  .inventory-popup-content {
    width: 92%;
    height: 92%;
  }
}

/* Large tablets in portrait */
@media(max-width: 1024px) and (min-height: 1200px) {
  :root{
    --cardWidth: 400px;
    --cardHeight: 600px;
  }

  .back-img{
    border: 16px solid transparent;
  }

  .inventory {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
  
  .menu-button {
    padding: 18px 12px;
    min-height: 80px;
  }
  
  .btn-icon {
    font-size: 24px;
  }
  
  .btn-text {
    font-size: 14px;
  }
}

/* Standard tablets and large phones */
@media (max-width: 768px) {
  :root {
    --cardWidth: 260px;
    --cardHeight: 390px;
  }

  .back-img {
    border: 10px solid transparent;
  }

  .main-content {
    padding: 0 10px;
  }

  .inventory-popup-content {
    width: 96%;
    height: 94%;
    border-radius: 12px;
  }
  
  .inventory {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
  }
  
  .menu-bar {
    height: 16%;
  }
  
  .menu-grid {
    padding: 12px;
    gap: 15px;
  }
  
  .menu-button {
    padding: 14px 10px;
    font-size: 11px;
    min-height: 65px;
    border-radius: 12px;
  }
  
  .btn-icon {
    font-size: 18px;
  }
  
  .btn-text {
    font-size: 10px;
  }
  
  .inventory-title {
    font-size: 22px;
  }
  
  .section-title {
    font-size: 18px;
    padding: 12px 16px;
  }
  
  .inventory-header {
    padding: 20px 25px;
  }
  
  .clear-inventory-btn {
    padding: 10px 16px;
    font-size: 11px;
  }
}

/* Small phones */
@media (max-width: 480px) {
  :root {
    --cardWidth: 240px;
    --cardHeight: 360px;
  }
  
  .help-button-container {
    top: 15px;
    left: 15px;
  }
  
  .help-button {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  
  .help-tooltip {
    min-width: 260px;
    padding: 12px;
  }
  
  .tooltip-content p {
    font-size: 13px;
  }
  
  .inventory {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
  }
  
  .menu-bar {
    height: 18%;
  }
  
  .menu-grid {
    padding: 10px;
    gap: 12px;
  }
  
  .menu-button {
    padding: 12px 8px;
    font-size: 10px;
    min-height: 60px;
    border-radius: 10px;
  }
  
  .btn-icon {
    font-size: 16px;
  }
  
  .btn-text {
    font-size: 9px;
  }
  
  .inventory-title {
    font-size: 20px;
  }
  
  .inventory-header {
    padding: 18px 20px;
  }
  
  .section-title {
    font-size: 16px;
    padding: 10px 14px;
  }
  
  .clear-inventory-btn {
    padding: 8px 14px;
    font-size: 10px;
  }
  
  .close-btn {
    width: 36px;
    height: 36px;
  }
  
  .close-icon {
    font-size: 20px;
  }
}

/* Extra small phones */
@media (max-width: 425px) {
  :root {
    --cardWidth: 220px;
    --cardHeight: 330px;
  }
  
  .inventory {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
  }
  
  .menu-grid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding: 8px;
  }
  
  .menu-button {
    padding: 10px 6px;
    font-size: 9px;
    min-height: 55px;
  }
  
  .btn-icon {
    font-size: 14px;
  }
  
  .btn-text {
    font-size: 8px;
  }
  
  .inventory-header {
    padding: 15px;
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .inventory-controls {
    justify-content: center;
  }
  
  .inventory-title {
    font-size: 18px;
  }
  
  .section-title {
    font-size: 15px;
    padding: 8px 12px;
  }
}

/* Very small screens */
@media (max-width: 375px) {
  :root {
    --cardWidth: 200px;
    --cardHeight: 300px;
  }
  
  .inventory {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
  }
  
  .menu-bar {
    height: 20%;
  }
  
  .inventory-popup-content {
    width: 98%;
    height: 96%;
  }
  
  .inventory-title {
    font-size: 16px;
  }
  
  .section-title {
    font-size: 14px;
    padding: 6px 10px;
  }
}

/* Landscape orientation fixes */
@media (max-height: 500px) and (orientation: landscape) {
  .menu-bar {
    height: 25%;
  }
  
  .menu-button {
    min-height: 50px;
    padding: 8px 6px;
  }
  
  .btn-icon {
    font-size: 14px;
  }
  
  .btn-text {
    font-size: 8px;
  }
  
  .inventory-popup-content {
    height: 98%;
  }
}

/* Touch device optimizations */
@media (pointer: coarse) {
  .menu-button {
    min-height: 60px;
    padding: 15px 10px;
  }
  
  .inventory-card {
    min-height: 80px;
  }
  
  .close-btn {
    min-width: 44px;
    min-height: 44px;
  }
  
  .clear-inventory-btn {
    min-height: 44px;
    padding: 12px 18px;
  }
}

