/* Center container, prevent overlap, increase z-index */
.card-swap-container {
  position: relative;
  margin: 80px auto 0 auto;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  perspective: 1200px;
  overflow: visible;
  z-index: 20;
  min-height: 420px;
}

/* Card styles */
.card {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 22px;
  border: 2px solid var(--accent-blue, #00bfff);
  background: linear-gradient(135deg, #181818 60%, var(--accent-blue, #00bfff) 100%);
  box-shadow: 0 8px 32px #18181888;
  transform-style: preserve-3d;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  width: 380px !important;
  height: 340px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  overflow: hidden; /* Prevent overflow of content */
  text-align: center;
  box-sizing: border-box;
  word-break: break-word;
}

/* Center animation and increase size */
.card .mb-4 {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card lottie-player {
  margin: 0 auto;
  display: block;
  width: 120px !important;
  height: 120px !important;
}
.card .font-bold {
  font-size: 2rem !important;
  line-height: 2.4rem;
  word-break: break-word;
  white-space: normal;
}
.card .text-base, .card .text-secondary {
  font-size: 1.25rem !important;
  line-height: 1.8rem;
  word-break: break-word;
  white-space: normal;
  /* Prevent overflow */
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Make sure content never overflows horizontally or vertically */
.card * {
  box-sizing: border-box;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
}

/* Responsive adjustments for mobile */
@media (max-width: 900px) {
  .card-swap-container {
    min-height: 340px;
  }
  .card {
    width: 320px !important;
    height: 260px !important;
    padding: 20px 10px;
    font-size: 1rem;
  }
  .card lottie-player {
    width: 80px !important;
    height: 80px !important;
  }
  .card .font-bold {
    font-size: 1.3rem !important;
    line-height: 1.5rem;
  }
  .card .text-base, .card .text-secondary {
    font-size: 0.98rem !important;
    line-height: 1.4rem;
  }
}
@media (max-width: 600px) {
  .card-swap-container {
    min-height: 220px;
  }
  .card {
    width: 210px !important;
    height: 140px !important;
    padding: 8px 4px;
    font-size: 0.85rem;
  }
  .card lottie-player {
    width: 38px !important;
    height: 38px !important;
  }
  .card .font-bold {
    font-size: 0.95rem !important;
    line-height: 1.1rem;
    margin-bottom: 0.2em;
  }
  .card .text-base, .card .text-secondary {
    font-size: 0.78rem !important;
    line-height: 1.1rem;
    margin-bottom: 0;
  }
}