.container {
  --stack-card-bg: #1a1a1a;
  --stack-card-border: #333;
  --stack-card-text: #e5e5e5;
  --stack-card-muted: #737373;
  --stack-accent: #ef4444;
  --stack-accent-alt: #3b82f6;
  position: relative;
  width: 100%;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.stackContainer {
  position: relative;
  width: 100%;
  max-width: 380px;
  height: 520px;
  perspective: 1000px;
}

.card {
  position: absolute;
  inset: 0;
  background: var(--stack-card-bg);
  border: 1px solid var(--stack-card-border);
  border-radius: 16px;
  overflow: hidden;
  cursor: grab;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s ease,
              opacity 0.3s ease;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  user-select: none;
  touch-action: none;
}

.card:hover {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.topCard {
  z-index: 10;
}

.stackedCard {
  pointer-events: none;
  background: linear-gradient(145deg, #1a1a1a, #0f0f0f);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.dragging {
  cursor: grabbing;
  transition: none;
}

.cardImage {
  position: relative;
  width: 100%;
  height: 280px;
  overflow: hidden;
}

.cardImage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.dragging .cardImage img {
  transform: scale(1.05);
}

.imageOverlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 50%,
    rgba(0, 0, 0, 0.8) 100%
  );
}

.cardContent {
  padding: 1.5rem;
  color: var(--stack-card-text);
}

.cardTitle {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.75rem 0;
  color: #fff;
  letter-spacing: -0.02em;
}

.cardBody {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--stack-card-muted);
}

.swipeHints {
  position: absolute;
  bottom: 1rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 2rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.topCard:hover .swipeHints {
  opacity: 1;
}

.swipeHint {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: #fff;
}

.swipeHint:first-child {
  color: var(--stack-accent);
}

.swipeHint:last-child {
  color: var(--stack-accent-alt);
}

.progressDots {
  display: flex;
  gap: 0.5rem;
  margin-top: 2rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #333;
  transition: all 0.3s ease;
}

.activeDot {
  width: 24px;
  border-radius: 4px;
  background: var(--stack-card-muted);
}

.pastDot {
  background: var(--stack-accent);
  opacity: 0.5;
}

.empty {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emptyText {
  color: var(--stack-card-muted);
  font-size: 1rem;
}

/* Glitch effect on swipe */
@keyframes swipeGlitch {
  0% { clip-path: inset(20% 0 60% 0); transform: translate(-2px, 2px); }
  20% { clip-path: inset(60% 0 20% 0); transform: translate(2px, -2px); }
  40% { clip-path: inset(40% 0 40% 0); transform: translate(-2px, 2px); }
  60% { clip-path: inset(80% 0 10% 0); transform: translate(2px, -2px); }
  80% { clip-path: inset(10% 0 80% 0); transform: translate(-2px, 2px); }
  100% { clip-path: inset(30% 0 50% 0); transform: translate(0, 0); }
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(239, 68, 68, 0.1) 50%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.dragging::before {
  opacity: 1;
  animation: shimmer 1s infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Noise texture for cards */
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  mix-blend-mode: overlay;
}
