/* ===========================
   倍倍FIGHT! - Card Styles
   =========================== */

.game-card {
    position: relative;
    width: 140px;
    height: 200px;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    animation: cardEntrance 0.8s ease-out backwards;
}

.game-card:nth-child(1) { animation-delay: 0.1s; }
.game-card:nth-child(2) { animation-delay: 0.2s; }
.game-card:nth-child(3) { animation-delay: 0.3s; }
.game-card:nth-child(4) { animation-delay: 0.4s; }
.game-card:nth-child(5) { animation-delay: 0.5s; }
.game-card:nth-child(6) { animation-delay: 0.6s; }

.game-card:hover:not(.flipped):not(.disabled) {
    transform: translateY(-15px) scale(1.05);
}

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

.game-card.disabled {
    pointer-events: none;
    opacity: 0.7;
}

.game-card.success {
    animation: cardSuccess 0.8s ease-out;
}

.game-card.fail {
    animation: cardFail 1s ease-out forwards;
}

/* Card Faces */
.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Card Back */
.card-back {
    background: linear-gradient(
        135deg,
        #1a0033 0%,
        #6B46C1 50%,
        #1a0033 100%
    );
    background-size: 200% 200%;
    animation: holographic 3s ease infinite;
    border: 3px solid var(--primary-gold);
    position: relative;
    overflow: hidden;
}

.card-back::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(255, 215, 0, 0.1) 10px,
            rgba(255, 215, 0, 0.1) 20px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 10px,
            rgba(255, 215, 0, 0.1) 10px,
            rgba(255, 215, 0, 0.1) 20px
        );
    border-radius: 10px;
}

.card-back::after {
    content: '💰';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    filter: 
        drop-shadow(0 0 20px rgba(255, 215, 0, 0.8))
        drop-shadow(0 0 40px rgba(255, 215, 0, 0.4));
}

.card-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.3;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 215, 0, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(255, 215, 0, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 50% 20%, rgba(255, 215, 0, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(255, 215, 0, 0.3) 0%, transparent 50%);
}

/* Card Front */
.card-front {
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.card-front.correct {
    background: linear-gradient(
        135deg,
        #10B981 0%,
        #059669 100%
    );
    border: 3px solid #34D399;
}

.card-front.incorrect {
    background: linear-gradient(
        135deg,
        #EF4444 0%,
        #DC2626 100%
    );
    border: 3px solid #F87171;
}

.card-symbol {
    font-size: 5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.3));
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.card-label {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Card Glow Effects */
.game-card:hover:not(.flipped):not(.disabled) .card-back {
    box-shadow: 
        0 15px 40px rgba(107, 70, 193, 0.5),
        0 0 60px rgba(255, 215, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.game-card.hint {
    animation: pulse 1s ease-in-out infinite;
}

.game-card.hint .card-back {
    box-shadow: 
        0 0 40px rgba(255, 215, 0, 0.6),
        0 0 60px rgba(255, 215, 0, 0.4),
        0 0 80px rgba(255, 215, 0, 0.2);
}

/* Special Effects for Card Reveal */
.card-reveal-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: particleBurst 0.8s ease-out forwards;
}

.particle.gold {
    background: var(--primary-gold);
    box-shadow: 0 0 6px var(--primary-gold);
}

.particle.green {
    background: var(--accent-emerald);
    box-shadow: 0 0 6px var(--accent-emerald);
}

.particle.red {
    background: var(--accent-red);
    box-shadow: 0 0 6px var(--accent-red);
}

/* Ripple Effect on Click */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

/* Card Shake on Wrong Selection */
.game-card.wrong {
    animation: shake 0.5s ease-in-out;
}

/* Victory Card Animation */
.game-card.victory {
    animation: bounce 1s ease-in-out infinite;
}

.game-card.victory .card-front {
    background: linear-gradient(
        45deg,
        #FFD700,
        #FFA500,
        #FFD700,
        #FFA500
    );
    background-size: 400% 400%;
    animation: holographic 2s ease infinite;
}

/* Card Loading State */
.card-loading {
    position: relative;
}

.card-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 215, 0, 0.2);
    border-top-color: var(--primary-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Mini Cards for History */
.mini-card {
    width: 40px;
    height: 56px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin: 0 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.mini-card.correct {
    background: linear-gradient(135deg, #10B981, #059669);
    border: 1px solid #34D399;
}

.mini-card.incorrect {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    border: 1px solid #F87171;
}

/* Card Hover Tooltip */
.card-tooltip {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.game-card:hover .card-tooltip {
    opacity: 1;
}

/* Special Card Styles */
.game-card.golden {
    animation: neonGlow 2s ease-in-out infinite;
}

.game-card.golden .card-back {
    background: linear-gradient(
        135deg,
        #FFD700 0%,
        #FFA500 50%,
        #FFD700 100%
    );
}

.game-card.rainbow {
    animation: rainbow 3s linear infinite;
}

/* Card Stack Effect */
.card-stack {
    position: relative;
}

.card-stack::before,
.card-stack::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 15px;
    background: inherit;
    z-index: -1;
}

.card-stack::before {
    transform: rotate(-5deg) translateX(-5px);
    opacity: 0.3;
}

.card-stack::after {
    transform: rotate(5deg) translateX(5px);
    opacity: 0.3;
}