@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Lato:wght@300;400;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Lato', sans-serif;
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
    min-height: 100vh;
    padding: 40px 20px;
    color: #2c2c2c;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ==================== HEADER ==================== */
.header {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeInDown 0.8s ease-out;
}

.header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    margin-bottom: 10px;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #ff6b6b, #ffd93d, #6bcf7f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    font-size: 1.1rem;
    color: #666;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ==================== FILTROS ==================== */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 40px;
    justify-content: center;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.filter-btn {
    padding: 10px 24px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    text-transform: capitalize;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.filter-btn.active {
    color: white;
    border-color: transparent;
}

.filter-btn.active[data-type="fuego"] {
    background: linear-gradient(135deg, #ff6b6b, #ff5252);
}

.filter-btn.active[data-type="agua"] {
    background: linear-gradient(135deg, #4ecdc4, #45b7aa);
}

.filter-btn.active[data-type="planta"] {
    background: linear-gradient(135deg, #6bcf7f, #52a651);
}

.filter-btn.active[data-type="electrico"] {
    background: linear-gradient(135deg, #ffd93d, #ffc700);
}

.filter-btn.active[data-type="psiquico"] {
    background: linear-gradient(135deg, #d98ef0, #c66cc7);
}

.filter-btn.active[data-type="todos"] {
    background: linear-gradient(135deg, #666, #333);
}

/* ==================== GRID DE CARTAS ==================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    animation: fadeIn 0.8s ease-out 0.4s both;
}

/* ==================== TARJETA ==================== */
.card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    animation: scaleIn 0.6s ease-out backwards;
}

.card:nth-child(1) { animation-delay: 0.5s; }
.card:nth-child(2) { animation-delay: 0.55s; }
.card:nth-child(3) { animation-delay: 0.6s; }
.card:nth-child(4) { animation-delay: 0.65s; }
.card:nth-child(5) { animation-delay: 0.7s; }
.card:nth-child(6) { animation-delay: 0.75s; }

.card:hover {
    transform: translateY(-12px) rotateY(8deg) scaleX(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.card-image {
    width: 100%;
    height: 280px;
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    position: relative;
    overflow: hidden;
}

.card-image::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 3s infinite;
}

.card-content {
    padding: 24px;
}

.card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    margin-bottom: 8px;
    color: #2c2c2c;
}

.card-type {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 16px;
    color: white;
}

.card-type.fuego {
    background: linear-gradient(135deg, #ff6b6b, #ff5252);
}

.card-type.agua {
    background: linear-gradient(135deg, #4ecdc4, #45b7aa);
}

.card-type.planta {
    background: linear-gradient(135deg, #6bcf7f, #52a651);
}

.card-type.electrico {
    background: linear-gradient(135deg, #ffd93d, #ffc700);
}

.card-type.psiquico {
    background: linear-gradient(135deg, #d98ef0, #c66cc7);
}

.card-info {
    font-size: 0.9rem;
    color: #888;
    line-height: 1.6;
}

.card-number {
    font-weight: 700;
    color: #2c2c2c;
}

/* ==================== MENSAJE DE NO CARTAS ==================== */
.no-cards {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 1.2rem;
}

/* ==================== ANIMACIONES ==================== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2.5rem;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 20px;
    }

    .card-image {
        height: 200px;
        font-size: 60px;
    }

    .filters {
        gap: 8px;
    }

    .filter-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}