body {
    background: #222;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 7.02cm);
    grid-template-rows: repeat(5, 6.11cm);
    gap: 0.2cm;
    perspective: 1500px;
    opacity: 0.3;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.card {
    width: 7.02cm;
    height: 6.11cm;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s ease;
    cursor: pointer;
}

.card.flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 0.2cm;
}

.card-front {
    background-image: url("../images/fondo.png");
    background-size: 21.06cm 30.55cm;
    background-repeat: no-repeat;
}

.card-back {
    background-size: cover;
    transform: rotateY(180deg);
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.5s ease forwards;
    z-index: 10;
}

.modal-content {
    background: #fff;
    color: #222;
    padding: 2em;
    border-radius: 1em;
    text-align: center;
    max-width: 400px;
    animation: popUp 0.4s ease forwards;
}

.modal-content h2 {
    margin-top: 0;
}

.modal-content button {
    background: #222;
    color: #fff;
    border: none;
    padding: 0.7em 1.5em;
    border-radius: 0.5em;
    cursor: pointer;
    transition: background 0.3s;
}

.modal-content button:hover {
    background: #444;
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popUp {
    from { transform: scale(0.5); }
    to { transform: scale(1); }
}
