/* Card styles and animations */

.deck-area {
    position: relative;
    width: 100%;
    height: 350px;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    margin-bottom: 30px;
}

.deck {
    position: relative;
    width: 200px;
    height: 280px;
    cursor: pointer;
    transform-style: preserve-3d;
    z-index: 1;
}

.deck.empty {
    opacity: 0.5;
}

.card {
    position: absolute;
    width: 200px;
    height: 280px;
    border-radius: 15px;
    transform-style: preserve-3d;
    transition: transform 0.6s ease, left 0.3s ease, top 0.3s ease;
    cursor: pointer;
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 15px;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.card-back {
    background: linear-gradient(135deg, #e91e63 0%, #9c27b0 100%);
    box-shadow: 0 10px 30px rgba(233, 30, 99, 0.4);
    border: 3px solid rgba(255, 215, 0, 0.5);
}

.card-back::before {
    content: '';
    position: absolute;
    width: 80%;
    height: 90%;
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 10px;
}

.card-back::after {
    content: '\2665';
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.3);
}

.card-front {
    background: #fff5f5;
    transform: rotateY(180deg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 3px solid #e91e63;
}

.card-front .message {
    color: #4a1942;
    font-size: 1.1rem;
    line-height: 1.6;
    text-align: center;
    word-wrap: break-word;
}

.card-front .message.rtl {
    direction: rtl;
    font-family: 'Segoe UI', 'Arial Hebrew', Arial, sans-serif;
}

.card.flipped {
    transform: rotateY(180deg);
}

/* Deck stacking effect */
.deck .card:nth-child(1) { top: 0; left: 0; }
.deck .card:nth-child(2) { top: 2px; left: 2px; }
.deck .card:nth-child(3) { top: 4px; left: 4px; }
.deck .card:nth-child(4) { top: 6px; left: 6px; }
.deck .card:nth-child(5) { top: 8px; left: 8px; }

/* Shuffle animation */
@keyframes shuffleLeft {
    0% { transform: translateX(0) rotate(0deg); }
    50% { transform: translateX(-30px) rotate(-5deg); }
    100% { transform: translateX(0) rotate(0deg); }
}

@keyframes shuffleRight {
    0% { transform: translateX(0) rotate(0deg); }
    50% { transform: translateX(30px) rotate(5deg); }
    100% { transform: translateX(0) rotate(0deg); }
}

.card.shuffle-left {
    animation: shuffleLeft 0.3s ease;
}

.card.shuffle-right {
    animation: shuffleRight 0.3s ease;
}

/* Drawn card area */
.drawn-card-area {
    position: absolute;
    width: 200px;
    height: 280px;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 10;
}

.drawn-card-area .card {
    pointer-events: auto;
    position: relative;
    transform-origin: center;
}

.drawn-card-area .card:hover:not(.flipped) {
    transform: scale(1.02);
    box-shadow: 0 15px 40px rgba(233, 30, 99, 0.6);
}

.drawn-card-area .card.flipped:hover {
    transform: rotateY(180deg) scale(1.02);
}

/* Draw animation */
@keyframes drawCard {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateY(-50px) scale(1.1);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

.card.drawing {
    animation: drawCard 0.5s ease;
}

.deck-complete-message {
    color: #4caf50;
    font-size: 1.3rem;
    text-align: center;
    padding: 30px;
    animation: pulse 2s infinite;
}

/* Couple deck */
.couple-deck {
    width: 140px;
    height: 196px;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.couple-deck:active {
    transform: scale(0.95);
}

.couple-deck .card {
    width: 140px;
    height: 196px;
}

.couple-deck .card-back::after {
    font-size: 2.5rem;
}
