/* Tarot Sanctum Styles */

/* 3D Perspective Container */
.tarot-card {
    perspective: 1000px;
    width: 200px;
    height: 350px;
    position: relative;
    transform-style: preserve-3d;
    cursor: default;
    /* Changed by JS */
}

/* Card Inner Container - The flipper */
.tarot-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    border-radius: 12px;
}

/* Flip Action */
.tarot-card.flipped .tarot-card-inner {
    transform: rotateY(180deg);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
}

/* Front and Back common styling */
.tarot-card-front,
.tarot-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* Safari */
    border-radius: 12px;
    overflow: hidden;
    box-sizing: border-box;
}

/* Back (Initial visible side) - Pattern */
.tarot-card-back {
    transform: rotateY(0deg);
    z-index: 2;
    background:
        repeating-linear-gradient(45deg,
            transparent,
            transparent 10px,
            rgba(212, 175, 55, 0.03) 10px,
            rgba(212, 175, 55, 0.03) 20px),
        radial-gradient(circle at 30% 30%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(114, 47, 55, 0.2) 0%, transparent 50%),
        linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Inner frame for back */
.tarot-card-back::before {
    content: '';
    position: absolute;
    inset: 12px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 8px;
    pointer-events: none;
}

/* Front (Hidden initially) - Meaning */
.tarot-card-front {
    transform: rotateY(180deg);
    z-index: 1;
    background: radial-gradient(circle at center, #2e2e42 0%, #0f172a 100%);
    border: 1px solid rgba(212, 175, 55, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Card Hover Effects */
.tarot-card:not(.flipped):hover .tarot-card-inner {
    transform: translateY(-5px);
    box-shadow: 0 15px 25px -5px rgba(0, 0, 0, 0.6), 0 0 15px rgba(212, 175, 55, 0.2);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {

    /* Stack cards vertically on mobile */
    #tarot-section .flex-col>.relative.flex {
        flex-direction: column;
        gap: 2rem;
        min-height: auto;
    }

    /* Adjust card size for mobile stack to be readable but not huge */
    .tarot-card,
    .deck-stack,
    .slot-placeholder {
        width: 200px;
        height: 320px;
    }

    /* Adjust deck position if needed or hide it when spread? */
    /* The central deck might overlap if we just stack. 
       Actually, the structure puts slots in containers. 
       We need to make sure the container allows stacking. */

    #central-deck {
        /* On mobile, maybe keep it until shuffle, then it disappears */
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
}