/* Global styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive, sans-serif;
    background: linear-gradient(135deg, #3f1e65, #764ea3, #1D0E2F);
    color: white;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    flex-grow: 1;
}

header {
    text-align: center;
    padding: 10px;
}

.glowing-text {
    color: #fff;
    font-size: 3rem;
    text-shadow: 0 0 10px #ff00ff, 0 0 20px #ff00ff, 0 0 30px #ff00ff;
}

#card-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 30px 0;
    min-height: 300px;
}

.card {
    width: 150px;
    height: 225px;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.card .front, .card .back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
    border: 2px solid #fff;
}

.card .front {
    background: url('https://preview.redd.it/look-for-opinions-on-my-2-playing-card-back-designs-look-to-v0-r4rle6ipe3fc1.png?width=640&crop=smart&auto=webp&s=d4f570073deff1e24df650d8369aaaaae3b7ba39') no-repeat center center;
    background-size: cover;
}

.card .back {
    background: none;
    transform: rotateY(180deg);
    backface-visibility: hidden;
    border-radius: 8px;
    border: 2px solid #fff;
    background-size: cover;
}

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

#card-info {
    display: none;
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    max-width: 300px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    box-shadow: 0 0 15px #ff00ff;
}

#card-info.glowing {
    animation: glow 1s infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 0 0 10px #ff00ff, 0 0 20px #ff00ff, 0 0 30px #ff00ff;
    }
    to {
        text-shadow: 0 0 20px #ff00ff, 0 0 30px #ff00ff, 0 0 40px #ff00ff;
    }
}

#back-home {
   margin-top: 30px;
    display: inline-block;
    padding: 10px 20px;
    background-color: #5c9bed;
    color: white;
    border-radius: 10px;
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#back-home:hover {
    background-color: #98d9c8;
    box-shadow: 0 0 10px #98d9c8, 0 0 20px #5c9bed;
}

footer {
    position: fixed;
    bottom: 20px;
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
    color: white;
}

.sparkle {
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
    clip-path: polygon(
        50% 0%, 61% 35%, 98% 35%, 
        68% 57%, 79% 91%, 50% 70%, 
        21% 91%, 32% 57%, 2% 35%, 
        39% 35%
    );
    pointer-events: none;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.8));
    z-index: 9999;
    transform: scale(0);
    animation: sparkle-animation 1s ease-out forwards;
}

@keyframes sparkle-animation {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.7;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

