body {
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(135deg, #eef1ff, #f9fbff);
    margin: 0;
    padding: 20px;
}

/* TITULOS */

h1 {
    text-align: center;
    margin-bottom: 40px;
}

h2 {
    text-align: center;
    margin-top: 50px;
    color: #333;
}

/* ===== BUSCADOR ===== */

#buscador {
    display: block;
    margin: 20px auto;
    padding: 10px;
    width: 260px;
    border-radius: 10px;
    border: 1px solid #ccc;
    font-size: 15px;
}

/* ===== FILTROS ===== */

.filtros {
    text-align: center;
    margin-bottom: 15px;
}

.filtros select {
    padding: 8px;
    margin: 5px;
    border-radius: 10px;
    border: 1px solid #ccc;
    cursor: pointer;
}

/* ===== CONTADOR ===== */

#contador {
    text-align: center;
    margin-top: 10px;
    font-weight: bold;
    color: #444;
}

/* ===== GRID ===== */

.region {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

/* ===== TARJETAS ===== */

figure {
    background: white;
    border-radius: 15px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
    transition: 0.3s;
    cursor: pointer;
    position: relative;

    display: flex;
    flex-direction: column;
    justify-content: flex-start;

    min-height: 260px;

    transform-style: preserve-3d;
    perspective: 1000px;
}

/* HOVER */

figure:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* ===== IMAGEN ===== */

figure img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    border-radius: 12px;
    transition: 0.3s;
}

/* ZOOM */

figure:hover img {
    transform: scale(1.05);
}

/* ===== NOMBRE ===== */

figcaption {
    margin-top: 10px;
    font-weight: bold;
    font-size: 15px;
    color: #222;
    word-wrap: break-word;
}

figcaption small {
    font-weight: normal;
    display: block;
    margin-top: 4px;
    font-size: 12px;
    opacity: 0.7;
}

/* ===== ELEMENTOS ===== */

.element {
    display: inline-block;
    margin-top: 8px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    color: white;
    box-shadow: 0 0 8px rgba(0,0,0,0.2);
    align-self: center;
}

/* ===== COLORES ELEMENTOS ===== */

.anemo { background: linear-gradient(45deg, #64e3c3, #2fbfa5); }
.pyro { background: linear-gradient(45deg, #ff6a4d, #d9381e); }
.hydro { background: linear-gradient(45deg, #4da6ff, #1b6fd6); }
.electro { background: linear-gradient(45deg, #b266ff, #7c3bd6); }
.cryo { background: linear-gradient(45deg, #9fe8ff, #58c5e6); }
.geo { background: linear-gradient(45deg, #e0b44c, #b88c2b); }
.dendro { background: linear-gradient(45deg, #6ecf68, #3e9f3a); }

/* ===== FAVORITO ===== */

.favorito {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 22px;
    color: gold;
    text-shadow: 0 0 5px rgba(0,0,0,0.3);
    z-index: 2;
}

/* ===== PREVIEW VIDEO ===== */

.previewVideo {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    height: 170px;
    border-radius: 12px;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
}

figure:hover .previewVideo {
    opacity: 1;
}

/* ===== MODAL VIDEO ===== */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.modal-content {
    width: 80%;
    max-width: 800px;
    position: relative;
}

.modal iframe {
    width: 100%;
    height: 450px;
    border-radius: 12px;
}

.cerrar {
    position: absolute;
    top: -30px;
    right: 0;
    font-size: 25px;
    color: white;
    cursor: pointer;
}

/* ===== EFECTO HOLOGRAFICO ===== */

figure::before{
    content:"";
    position:absolute;
    inset:0;
    background:linear-gradient(
        120deg,
        transparent 20%,
        rgba(255,255,255,0.4),
        transparent 80%
    );
    opacity:0;
    transition:0.4s;
    pointer-events:none;
}

figure:hover::before{
    opacity:1;
    animation:holograma 2s linear infinite;
}

@keyframes holograma{
    0%{transform:translateX(-100%)}
    100%{transform:translateX(100%)}
}

/* ===== BRILLO POR ELEMENTO ===== */

figure.anemo { box-shadow:0 0 15px rgba(100,227,195,0.5); }
figure.pyro { box-shadow:0 0 15px rgba(255,106,77,0.6); }
figure.hydro { box-shadow:0 0 15px rgba(77,166,255,0.6); }
figure.electro { box-shadow:0 0 15px rgba(178,102,255,0.6); }
figure.cryo { box-shadow:0 0 15px rgba(159,232,255,0.6); }
figure.geo { box-shadow:0 0 15px rgba(224,180,76,0.6); }
figure.dendro { box-shadow:0 0 15px rgba(110,207,104,0.6); }

/* ===== MODO OSCURO ===== */

@media (prefers-color-scheme: dark){

body{
    background:linear-gradient(135deg,#0b0f1f,#111933);
    color:white;
}

figure{
    background:#1c2442;
    color:white;
}

figcaption{
    color:white;
}

#buscador,
.filtros select{
    background:#1c2442;
    color:white;
    border:1px solid #333;
}

}
