body {
    margin: 0;
    padding: 0;
    background-color: #050505;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: 'Cinzel', serif;
    overflow: hidden;
    color: white;
}

#tsparticles {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none; 
}

.main-container {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100vh;
    justify-content: center;
}

.title, .status-text {
    position: absolute;
    transition: opacity 1s;
    text-transform: uppercase;
    letter-spacing: 4px;
    z-index: 5;
    pointer-events: none;
}

.title {
    top: 30px;
    opacity: 0.5;
    font-size: 1.5rem;
}

.status-text {
    bottom: 50px;
    font-size: 1.1rem;
    color: #a855f7;
    text-shadow: 0 0 15px rgba(168, 85, 247, 0.6);
}

.cards-container {
    position: relative;
    width: 900px; 
    height: 250px;
}

.card {
    width: 160px;
    height: 240px;
    position: absolute;
    top: 0;
    cursor: pointer;
    perspective: 1000px;
    transition: left 0.5s ease-in-out, 
                top 0.5s ease-in-out, 
                transform 0.5s ease-in-out,
                opacity 1s,
                width 0.5s, 
                height 0.5s;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card.selected {
    z-index: 9999 !important;
    top: 50% !important;
    left: 50% !important;
    width: 160px !important; 
    height: 240px !important;
    transform: translate(-50%, -50%) scale(1.8);
    transition: top 1s ease-out, left 1s ease-out, transform 1s ease-out, width 0.5s, height 0.5s;
}

.card.selected.zooming {
    animation: slowZoom 20s linear forwards; 
}

.card.selected .card-inner {
    transition: transform 4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slowZoom {
    0% {
        transform: translate(-50%, -50%) scale(1.8);
    }
    100% {
        transform: translate(-50%, -50%) scale(5.0); 
    }
}

.card.dimmed {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.9);
    overflow: hidden;
    border: 1px solid #333;
}

.card-front {
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover; 
}

.card-front img.reveal-mode {
    object-fit: contain;
}

.card-back {
    background: linear-gradient(135deg, #0f0f0f, #000000);
    transform: rotateY(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #8a2be2;
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.3);
}

.mark {
    font-size: 3rem;
    color: #666;
    opacity: 0.3;
}

@media (max-width: 950px) {
    .cards-container {
        width: 100%;
        height: 500px; 
    }
    
    .card {
        width: 100px;
        height: 150px;
    }

    .mark {
        font-size: 2rem;
    }
}