/**
 * Eduplayify Template: memory_pairs (3D Card Flip)
 */
.mp-player-wrap {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}
.mp-player-header {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1e293b;
}
.mp-player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px;
    perspective: 1000px;
    padding: 10px;
}
.mp-player-card {
    height: 140px;
    cursor: pointer;
    position: relative;
    user-select: none;
    perspective: 1000px;
}
.mp-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    border-radius: 12px;
}
.mp-player-card.is-flipped .mp-card-inner,
.mp-player-card.is-matched .mp-card-inner {
    transform: rotateY(180deg);
}
.mp-player-card.is-matched {
    cursor: default;
}
.mp-player-card.is-matched .mp-card-inner {
    box-shadow: 0 0 0 3px #10b981, 0 10px 15px -3px rgba(16,185,129,0.2);
}
.mp-card-front, .mp-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-sizing: border-box;
}
.mp-card-front {
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
    color: #ffffff;
    font-size: 2.2rem;
    border: 2px solid #818cf8;
}
.mp-card-back {
    background: #ffffff;
    color: #1e293b;
    transform: rotateY(180deg);
    border: 2px solid #e2e8f0;
    overflow: hidden;
}
.mp-card-img {
    max-width: 90%;
    max-height: 75px;
    object-fit: contain;
    border-radius: 6px;
    margin-bottom: 4px;
}
.mp-card-label {
    display: block;
    width: 100%;
    max-height: 100%;
    overflow: hidden;
    box-sizing: border-box;
    padding: 0 2px;
    text-align: center;
    font-size: 18px;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.25;
    word-break: break-word;
}

/* مصيدة غير بديهية: grid غائب في IE11 — flex بديل فقط عند غياب grid.
   و3D flip بلا preserve-3d يعرض الوجهين معًا، لذا نخفي الخلفي ونلغي الدوران */
@supports not (display: grid) {
    .mp-player-grid { display: flex; flex-wrap: wrap; }
    .mp-player-card { flex: 1 1 130px; max-width: 180px; margin: 8px; }
}
@supports not (transform-style: preserve-3d) {
    .mp-card-inner { transform: none !important; }
    .mp-card-back { transform: none; position: static; min-height: 140px; display: none; }
    .mp-player-card.is-flipped .mp-card-back,
    .mp-player-card.is-matched .mp-card-back { display: flex; }
    .mp-player-card.is-flipped .mp-card-front,
    .mp-player-card.is-matched .mp-card-front { display: none; }
}