body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: transparent;
    overflow: hidden;
    font-family: 'IM Fell English', Georgia, serif;
}

#tarot-container {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    width: 1200px;
    max-height: 90vh;
    height: auto;
}

.vintage-frame {
    background: url('https://i.ibb.co/pv2sjdmq/cbcc1212bc034ac4855c530d60a897b8-000.png') center/cover;
    padding: 40px;
    border-image: linear-gradient(45deg, #6A0DAD, #4B0082, #2E1A47) 1;
    box-shadow: 0 0 25px rgba(138, 43, 226, 0.8);
    position: relative;
    overflow: hidden;
}

.vintage-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 12, 50, 0.85);
    z-index: 0;
}

#tarot-cards {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
    padding: 20px 0;
}

#tarot-cards img {
    width: 160px;
    height: auto;
    border-radius: 8px;
    border: 4px solid #6A0DAD;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.4);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
    filter: brightness(0.9) sepia(0.2);
    cursor: pointer;
}

#tarot-cards img:hover {
    transform: scale(1.08) translateY(-5px);
    filter: brightness(1.1) sepia(0);
    box-shadow: 0 10px 30px rgba(138, 43, 226, 0.7);
}

.showing-tarot {
    background: rgba(10, 5, 20, 0.9) !important;
}

#close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    background: rgba(138, 43, 226, 0.2);
    border: 2px solid #6A0DAD;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.5);
    backdrop-filter: blur(3px);
}

#close-button:hover {
    background: rgba(138, 43, 226, 0.4);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.7);
}

.close-icon {
    color: #E0AFFF;
    font-size: 28px;
    font-family: 'Cinzel Decorative', cursive;
    line-height: 0;
    text-shadow: 0 0 8px rgba(138, 43, 226, 0.6);
}

.scroll-decoration {
    height: 30px;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='20' viewBox='0 0 100 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 10 C30 0, 70 0, 100 10 C70 20, 30 20, 0 10' fill='none' stroke='%23B8860B' stroke-width='2'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-size: 100px 20px;
    position: absolute;
    left: 0;
    right: 0;
    z-index: 1;
}

.scroll-decoration.top {
    top: 10px;
}

.scroll-decoration.bottom {
    bottom: 10px;
    transform: rotate(180deg);
}

.card-description {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    border-image: linear-gradient(45deg, #4B0082, #6A0DAD, #B366FF) 1;
    box-shadow: 0 0 30px rgba(138, 43, 226, 0.7);
    z-index: 1000;
    padding: 30px;
    text-align: center;
    animation: fadeIn 0.3s ease-out;
}

.card-description::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgb(0 0 0 / 80%);
    z-index: -1;
}

.card-description h2 {
    font-family: 'Cinzel Decorative', cursive;
    color: #E0AFFF;
    margin: 0 0 20px 0;
    font-size: 24px;
    text-shadow: 0 0 8px rgba(138, 43, 226, 0.7);
}

.card-description p {
    color: #D1B3FF;
    font-size: 18px;
    line-height: 1.6;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.close-description {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: rgba(138, 43, 226, 0.2);
    border: 1px solid #d295ff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #d295ff;
    font-size: 20px;
    line-height: 1;
}

.close-description:hover {
    background: rgba(138, 43, 226, 0.4);
    transform: rotate(90deg);
}

#tarot-menu {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    padding: 40px;
    text-align: center;
    border: 10px solid;
    border-image: linear-gradient(45deg, #6A0DAD, #4B0082, #2E1A47) 1;
    box-shadow: 0 0 30px rgba(138, 43, 226, 0.7);
    font-family: 'Cinzel Decorative', cursive;
    animation: menuAppear 0.5s ease-out;
    z-index: 1000;
}

#tarot-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgb(0 0 0 / 80%);
    z-index: -1;
}

#tarot-menu h2 {
    color: #E0AFFF;
    font-size: 28px;
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(138, 43, 226, 0.8);
    position: relative;
    padding-bottom: 15px;
}

#tarot-menu h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #4B0082, transparent);
}

.reading-option {
    display: block;
    width: 100%;
    margin: 20px 0;
    padding: 15px;
    background: rgba(138, 43, 226, 0.2);
    border: 2px solid #6A0DAD;
    color: #E0AFFF;
    font-family: 'IM Fell English', Georgia, serif;
    font-size: 18px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.reading-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(128, 32, 218, 0.1), rgba(138, 43, 226, 0.2));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
    z-index: -1;
}

.reading-option:hover {
    transform: translateY(-2px);
    border-color: #E0AFFF;
    color: #FFFFFF;
    box-shadow: 0 5px 15px rgba(138, 43, 226, 0.4);
}

.reading-option:hover::before {
    transform: scaleX(1);
}

.reading-option:active {
    transform: translateY(1px);
}

@keyframes menuAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.reading-option::after {
    content: '✧';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #ab64dd;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.reading-option:hover::after {
    opacity: 1;
}

#close-menu-button {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    background: rgba(138, 43, 226, 0.2);
    border: 2px solid #6A0DAD;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.5);
}

#close-menu-button:hover {
    background: rgba(138, 43, 226, 0.4);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.7);
}

/* Novos estilos para o efeito de flip */
.tarot-card {
    perspective: 1000px;
    width: 160px;
    height: 260px;
    cursor: pointer;
    position: relative;
    transition: filter 0.3s ease;
    pointer-events: none;
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
    transform: rotateY(0deg); /* Inicia virado para baixo */
}

.tarot-card.revealed .card-inner {
    transform: rotateY(180deg); /* Vira para cima quando revelado */
}

.card-front, 
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 8px;
    border: 4px solid #6A0DAD;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.4);
}

.card-front {
    background: url('images/back.png') center/cover; /* Imagem do verso */
    transform: rotateY(0deg); /* Mantém o verso visível inicialmente */
    z-index: 2;
}

.card-back {
    transform: rotateY(180deg); /* Esconde a frente inicialmente */
    background: #1a0d2e;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ajustes para manter os efeitos de hover */
.tarot-card.revealed:hover .card-back img {
    transform: scale(1.08) translateY(-5px);
    filter: brightness(1.1) sepia(0);
    box-shadow: 0 10px 30px rgba(138, 43, 226, 0.7);
}

.card-back img {
    width: 95%;
    height: 95%;
    object-fit: cover;
    border-radius: 5px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enquanto as cartas estão sendo "entregues" */
.tarot-card:not(.revealed) {
    filter: grayscale(0.8) brightness(0.7);
    cursor: not-allowed;
}

/* Quando liberado para interação */
.tarot-card:not(.revealed):hover {
    filter: grayscale(0.6) brightness(0.9);
}

.tarot-card.reveal-ready {
    filter: none;
    cursor: pointer;
    animation: cardGlowPulse 2s infinite;
    pointer-events: auto;
}

/* Animação de embaralhamento */
#shuffle-overlay {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    pointer-events: none;
}

.shuffle-animation {
    width: 300px;
    height: auto;
    filter: drop-shadow(0 0 15px rgba(138, 43, 226, 0.7));
    image-rendering: -moz-crisp-edges;
    image-rendering: pixelated;
}

/* Efeito de desfoque no fundo */
.shuffle-blur {
    animation: blurEffect 0.5s forwards;
}

/* Novos estilos para partículas */
.particle {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    animation: particleAnim 1.5s ease-out forwards;
}

@keyframes particleAnim {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}

.sparkle {
    background: radial-gradient(circle, rgba(255,255,255,0.8) 20%, rgba(138,43,226,0.4) 70%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.smoke {
    background: rgba(150, 150, 150, 0.3);
    width: 15px;
    height: 15px;
    border-radius: 50%;
    filter: blur(2px);
}

@keyframes blurEffect {
    from { backdrop-filter: blur(0); }
    to { backdrop-filter: blur(5px); }
}

@keyframes cardGlowPulse {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.1); }
    100% { filter: brightness(1); }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes cardGlow {
    from {
        box-shadow: 0 0 15px rgba(140, 0, 255, 0.4);
    }
    to {
        box-shadow: 0 0 30px rgba(140, 0, 255, 0.8);
    }
}

@keyframes frameGlow {
    from {
        box-shadow: 0 0 20px rgba(139, 69, 19, 0.2);
    }
    to {
        box-shadow: 0 0 40px rgba(139, 69, 19, 0.4);
    }
}

@keyframes scrollGlow {
    from {
        opacity: 0.6;
    }
    to {
        opacity: 1;
    }
}

@media (max-width: 1200px) {
    #tarot-cards {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 15px;
    }

    #tarot-cards img {
        width: 120px;
    }
}

@media (max-width: 768px) {
    .vintage-frame {
        padding: 30px 20px;
        border-width: 20px;
    }

    #tarot-cards {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
    }

    #tarot-cards img {
        width: 100px;
        border-width: 3px;
    }

    .scroll-decoration {
        height: 30px;
        background-size: 160px 30px;
    }

    .card-description {
        padding: 30px;
    }

    .card-description h2 {
        font-size: 24px;
    }

    .card-description p {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    #tarot-menu {
        width: 90%;
        padding: 30px 20px;
        border-width: 15px;
    }

    #tarot-menu h2 {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .reading-option {
        font-size: 16px;
        padding: 12px;
        margin: 15px 0;
    }

    #tarot-cards {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 8px;
    }

    #tarot-cards img {
        width: 80px;
    }

    .vintage-frame {
        padding: 20px 15px;
        border-width: 15px;
    }
}