/* MTG Grid Background Animation Styles */
.mtg-grid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0f0f0f 100%);
}

.mtg-grid-container {
    position: relative;
    width: 100%;
    height: 100%;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.mtg-grid-container:hover {
    opacity: 1;
}

.mtg-grid-cell {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    transition: all 0.3s ease;
    pointer-events: auto;
    cursor: pointer;
}

.mtg-grid-cell:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
}

.mtg-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: scale(0.8) rotateY(-180deg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.9), rgba(40, 40, 40, 0.9));
}

.mtg-card.revealing {
    opacity: 1;
    transform: scale(1) rotateY(0deg);
}

.mtg-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.mtg-card-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    text-align: center;
    font-weight: 500;
}

.mtg-card-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.15),
        transparent
    );
    transform: translateX(-100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Grid glow effect */
.mtg-grid-cell::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.mtg-grid-cell:hover::before {
    opacity: 1;
}

/* Responsive grid adjustments */
@media (max-width: 1200px) {
    .mtg-grid-cell {
        border-color: rgba(255, 255, 255, 0.06);
    }

    .mtg-grid-cell:hover {
        border-color: rgba(255, 255, 255, 0.12);
    }
}

@media (max-width: 768px) {
    .mtg-grid-cell {
        border-radius: 8px;
        border-color: rgba(255, 255, 255, 0.05);
    }

    .mtg-grid-cell:hover {
        border-color: rgba(255, 255, 255, 0.1);
    }

    .mtg-card {
        border-radius: 8px;
    }

    .mtg-grid-cell::before {
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    .mtg-grid-cell {
        border-radius: 6px;
        border-color: rgba(255, 255, 255, 0.04);
    }

    .mtg-grid-cell:hover {
        border-color: rgba(255, 255, 255, 0.08);
    }

    .mtg-card {
        border-radius: 6px;
    }

    .mtg-grid-cell::before {
        border-radius: 6px;
    }
}
