body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #005;
    overflow: hidden;
    background-image: url('../img/pattern.png');
    background-repeat: repeat;
    background-size: auto;
}

#app {
    position: relative;
    width: 300px;
    height: 400px;
    perspective: 1000px;
}

.card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), width 0.4s cubic-bezier(0.4, 0, 0.2, 1), height 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease, opacity 0.4s ease;
    user-select: none;
    z-index: 10;
}

.card.stack-0 {
    transform: translateY(0) scale(1);
    z-index: 11;
}

.card.stack-1 {
    transform: translateY(20px) scale(0.95);
    z-index: 9;
}

.card.stack-2 {
    transform: translateY(40px) scale(0.90);
    z-index: 8;
}

.card.stack-3 {
    transform: translateY(60px) scale(0.85);
    z-index: 7;
}

.card .front {
    position: absolute;
    left: 50%;
    bottom: 50%;
    width: 100%;
    padding: 1.5em;
    box-sizing: border-box;
    transform: translateX(-50%);
    font-size: 20px;
    color: #555;
    text-align: center;
}

.card .back {
    display: none;
    padding: 1.5em;
    box-sizing: border-box;
    font-size: 24px;
    font-weight: bold;
    color: #000;
    margin-top: 4em;
    text-align: center;
}

.card.revealed .back {
    display: block;
}

.card.swiping {
    transition: transform 0s, background-color 0.2s ease;
}

#deck-count {
    position: absolute;
    top: -1.5em;
    width: 100%;
    text-align: center;
    font-size: 24px;
    color: #fff;
    font-weight: bold;
}

.swipe-left {
    animation: swipeLeft 0.5s forwards;
}

.swipe-right {
    animation: swipeRight 0.5s forwards;
}

@keyframes swipeLeft {
    to {
        transform: translateX(-300px) rotate(-30deg);
        opacity: 0;
        background-color: rgba(144, 238, 144, 0.5);
    }
}

@keyframes swipeRight {
    to {
        transform: translateX(300px) rotate(30deg);
        opacity: 0;
        background-color: rgba(255, 99, 71, 0.5);
    }
}

.zoom {
    animation: zoomForward 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes zoomForward {
    from {
        transform: translateY(20px) scale(0.95);
        z-index: 10;
    }
    to {
        transform: translateY(0) scale(1);
        z-index: 11;
    }
}

.new-card {
    animation: fadeInZoom 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeInZoom {
    from {
        opacity: 0;
        transform: translateY(80px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(60px) scale(0.85);
    }
}