/* ═══════════════════════════════════════════════════════════════════
   Collectible Cards — Animated, Holographic, Neon
   ═══════════════════════════════════════════════════════════════════ */

/* ── Card base ─────────────────────────────────────────────────── */
.mm-card {
    width: 220px;
    border-radius: 14px;
    overflow: hidden;
    font-family: inherit;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    user-select: none;
    background: var(--card-bg, #1a1a2e);
    border: 2px solid var(--card-border, #333);
    /* 3D tilt base — JS drives --rx / --ry */
    transform-style: preserve-3d;
    transform: perspective(600px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)) translateY(0px);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    will-change: transform;
}

/* Hover lift for non-JS fallback */
.mm-card:not(.mm-tilt-active):hover {
    transform: perspective(600px) translateY(-8px) rotate(0.5deg);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.mm-card.mm-card-full {
    width: 100%;
    max-width: 340px;
    cursor: default;
    transform: none !important;
}
.mm-card.mm-card-full:hover { transform: none !important; }

/* ── Mini card (50% scale preview) ─────────────────────────────── */
.mm-card-mini-wrap {
    display: inline-block;
    width: 110px;       /* 220px * 0.5 */
    height: 225px;      /* natural card height * 0.5 — 450px card / 2 */
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    border-radius: 7px;
    text-decoration: none;
    /* clip-path forces clipping even for preserve-3d children */
    clip-path: inset(0 round 7px);
    isolation: isolate;
    contain: layout paint;
}
.mm-card-mini-wrap .mm-card {
    width: 220px;
    transform: scale(0.5) !important;
    transform-origin: top left !important;
    transform-style: flat !important;
    pointer-events: none;
    transition: none !important;
    position: absolute;
    top: 0;
    left: 0;
    animation: none !important;
}
.mm-card-mini-wrap:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,0.4);
    transform: translateY(-3px);
    transition: transform 0.15s, box-shadow 0.15s;
}

/* ── Rarity themes ─────────────────────────────────────────────── */
.mm-card-common {
    --card-bg:        #1c1c1c;
    --card-border:    #555;
    --card-header-bg: #2a2a2a;
    --card-header-fg: #ccc;
    --card-footer-bg: #222;
    --card-footer-fg: #999;
    --stat-fill:      #777;
    --holo-color-a:   rgba(255,255,255,0.04);
    --holo-color-b:   rgba(255,255,255,0.08);
}
.mm-card-uncommon {
    --card-bg:        #0d2b0d;
    --card-border:    #3a7d3a;
    --card-header-bg: #1a4a1a;
    --card-header-fg: #a8e6a8;
    --card-footer-bg: #122012;
    --card-footer-fg: #6abf6a;
    --stat-fill:      #4caf50;
    --holo-color-a:   rgba(76,175,80,0.08);
    --holo-color-b:   rgba(168,230,168,0.15);
}
.mm-card-rare {
    --card-bg:        #0a1a2e;
    --card-border:    #1e6ab5;
    --card-header-bg: #0e2a4a;
    --card-header-fg: #90caf9;
    --card-footer-bg: #091520;
    --card-footer-fg: #5a9fd4;
    --stat-fill:      #2196f3;
    --holo-color-a:   rgba(33,150,243,0.12);
    --holo-color-b:   rgba(144,202,249,0.25);
}
.mm-card-epic {
    --card-bg:        #1a0a2e;
    --card-border:    #7b1fa2;
    --card-header-bg: #2d0e4a;
    --card-header-fg: #e1bee7;
    --card-footer-bg: #150820;
    --card-footer-fg: #ba68c8;
    --stat-fill:      #9c27b0;
    --holo-color-a:   rgba(156,39,176,0.15);
    --holo-color-b:   rgba(225,190,231,0.25);
}
.mm-card-legendary {
    --card-bg:        #1e1000;
    --card-border:    #e65100;
    --card-header-bg: #3e1f00;
    --card-header-fg: #ffe082;
    --card-footer-bg: #1a0d00;
    --card-footer-fg: #ffb74d;
    --stat-fill:      #ff9800;
    --holo-color-a:   rgba(255,152,0,0.15);
    --holo-color-b:   rgba(255,224,130,0.3);
    animation: mm-legendary-glow 2.5s ease-in-out infinite alternate;
}
.mm-card-limited {
    --card-bg:        #0d1828;
    --card-border:    #c0a000;
    --card-header-bg: #1e1600;
    --card-header-fg: #ffd700;
    --card-footer-bg: #150f00;
    --card-footer-fg: #c8a000;
    --stat-fill:      #ffd700;
    --holo-color-a:   rgba(255,215,0,0.18);
    --holo-color-b:   rgba(255,255,180,0.35);
    background: linear-gradient(160deg, #0d1828, #1a0d28, #0d1828) !important;
    border-color: #c0a000 !important;
    animation: mm-limited-border 4s linear infinite;
}

/* ── Rarity glow animations ────────────────────────────────────── */
@keyframes mm-legendary-glow {
    from { box-shadow: 0 0 10px rgba(230,81,0,0.4), 0 0 20px rgba(230,81,0,0.2); }
    to   { box-shadow: 0 0 30px rgba(255,152,0,0.8), 0 0 60px rgba(230,81,0,0.4), 0 0 90px rgba(255,152,0,0.15); }
}

@keyframes mm-limited-border {
    0%   { border-color: #c0a000; box-shadow: 0 0 10px rgba(192,160,0,0.4); }
    25%  { border-color: #ffd700; box-shadow: 0 0 25px rgba(255,215,0,0.7), 0 0 50px rgba(255,215,0,0.2); }
    50%  { border-color: #fff8a0; box-shadow: 0 0 35px rgba(255,248,160,0.6), 0 0 70px rgba(255,215,0,0.2); }
    75%  { border-color: #ffd700; box-shadow: 0 0 25px rgba(255,215,0,0.7), 0 0 50px rgba(255,215,0,0.2); }
    100% { border-color: #c0a000; box-shadow: 0 0 10px rgba(192,160,0,0.4); }
}

/* ── Uncommon green shimmer sweep ──────────────────────────────── */
.mm-card-uncommon .mm-card-art-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 30%, rgba(76,175,80,0.15) 50%, transparent 70%);
    background-size: 200% 200%;
    animation: mm-uncommon-sweep 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 3;
}
@keyframes mm-uncommon-sweep {
    0%   { background-position: 200% 200%; opacity: 0; }
    40%  { opacity: 1; }
    60%  { opacity: 1; }
    100% { background-position: -50% -50%; opacity: 0; }
}

/* ── Unowned / mystery ─────────────────────────────────────────── */
.mm-card-unowned {
    opacity: 0.65;
    filter: grayscale(70%);
}
.mm-card-unowned:hover {
    opacity: 0.82;
    filter: grayscale(40%);
}

/* ── Card header ───────────────────────────────────────────────── */
.mm-card-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.6rem;
    background: var(--card-header-bg, #222);
    border-bottom: 1px solid var(--card-border, #333);
    min-height: 36px;
    position: relative;
    overflow: hidden;
}

.mm-card-type-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.mm-card-name {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--card-header-fg, #eee);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

/* Neon flicker on legendary name */
.mm-card-legendary .mm-card-name {
    color: #ffe082;
    text-shadow: 0 0 6px rgba(255,152,0,0.8), 0 0 12px rgba(255,152,0,0.5);
    animation: mm-neon-flicker 6s ease-in-out infinite;
}
/* Neon glow on epic name */
.mm-card-epic .mm-card-name {
    color: #e1bee7;
    text-shadow: 0 0 6px rgba(186,104,200,0.9), 0 0 14px rgba(156,39,176,0.6);
    animation: mm-epic-pulse 3s ease-in-out infinite alternate;
}
/* Gold glow on limited name */
.mm-card-limited .mm-card-name {
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255,215,0,1), 0 0 18px rgba(255,215,0,0.6);
    animation: mm-gold-pulse 2s ease-in-out infinite alternate;
}

@keyframes mm-neon-flicker {
    0%,19%,21%,23%,25%,54%,56%,100% {
        text-shadow: 0 0 6px rgba(255,152,0,0.8), 0 0 12px rgba(255,152,0,0.5);
    }
    20%,24%,55% {
        text-shadow: none;
        opacity: 0.7;
    }
}
@keyframes mm-epic-pulse {
    from { text-shadow: 0 0 4px rgba(186,104,200,0.7), 0 0 10px rgba(156,39,176,0.4); }
    to   { text-shadow: 0 0 10px rgba(186,104,200,1),  0 0 22px rgba(156,39,176,0.8), 0 0 35px rgba(156,39,176,0.3); }
}
@keyframes mm-gold-pulse {
    from { text-shadow: 0 0 6px rgba(255,215,0,0.8), 0 0 14px rgba(255,215,0,0.4); }
    to   { text-shadow: 0 0 12px rgba(255,215,0,1),   0 0 28px rgba(255,215,0,0.7), 0 0 50px rgba(255,200,0,0.3); }
}

/* Header light streak for rare+ */
.mm-card-rare .mm-card-header::after,
.mm-card-epic .mm-card-header::after,
.mm-card-legendary .mm-card-header::after,
.mm-card-limited .mm-card-header::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
    animation: mm-header-streak 5s ease-in-out infinite;
    pointer-events: none;
}
@keyframes mm-header-streak {
    0%,70%  { left: -100%; opacity: 0; }
    75%     { opacity: 1; }
    100%    { left: 160%; opacity: 0; }
}

/* ── Rarity abbr badge ─────────────────────────────────────────── */
.mm-card-rarity-abbr {
    font-size: 0.65rem;
    font-weight: 900;
    padding: 2px 5px;
    border-radius: 4px;
    flex-shrink: 0;
    letter-spacing: 0.04em;
}
.mm-card-rarity-abbr-common    { background: #555;    color: #fff; }
.mm-card-rarity-abbr-uncommon  { background: #2e7d32; color: #fff; }
.mm-card-rarity-abbr-rare      { background: #1565c0; color: #fff; }
.mm-card-rarity-abbr-epic      { background: #6a1b9a; color: #fff;
    box-shadow: 0 0 6px rgba(156,39,176,0.7); }
.mm-card-rarity-abbr-legendary { background: #e65100; color: #fff;
    box-shadow: 0 0 8px rgba(255,152,0,0.8);
    animation: mm-badge-glow-legendary 2s ease-in-out infinite alternate; }
.mm-card-rarity-abbr-limited   { background: #c0a000; color: #000;
    box-shadow: 0 0 8px rgba(255,215,0,0.9);
    animation: mm-badge-glow-limited 2s ease-in-out infinite alternate; }

@keyframes mm-badge-glow-legendary {
    from { box-shadow: 0 0 4px rgba(255,152,0,0.6); }
    to   { box-shadow: 0 0 12px rgba(255,152,0,1), 0 0 20px rgba(230,81,0,0.5); }
}
@keyframes mm-badge-glow-limited {
    from { box-shadow: 0 0 4px rgba(255,215,0,0.6); }
    to   { box-shadow: 0 0 14px rgba(255,215,0,1), 0 0 24px rgba(255,215,0,0.4); }
}

/* ── Art frame ─────────────────────────────────────────────────── */
.mm-card-art-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: rgba(0,0,0,0.3);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.mm-card-art {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}
/* Art subtle float on hover */
.mm-card:hover .mm-card-art {
    transform: scale(1.04);
}

.mm-card-art-silhouette {
    filter: brightness(0) opacity(0.3);
}

.mm-card-art-placeholder {
    font-size: 4rem;
    opacity: 0.25;
    z-index: 1;
}

/* ── Holographic overlay layers ────────────────────────────────── */

/* Base shimmer — all rare+ */
.mm-card-holo {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    mix-blend-mode: screen;
    border-radius: 0;
    background: linear-gradient(
        115deg,
        transparent 20%,
        var(--holo-color-a, rgba(255,255,255,0.06)) 35%,
        var(--holo-color-b, rgba(255,255,255,0.14)) 45%,
        transparent 55%,
        var(--holo-color-a, rgba(255,255,255,0.06)) 65%,
        transparent 75%
    );
    background-size: 200% 200%;
    animation: mm-holo-slide 3s linear infinite;
    /* JS-driven tilt shift: --hx and --hy */
    background-position: var(--hx, 0%) var(--hy, 0%);
}

@keyframes mm-holo-slide {
    0%   { background-position: var(--hx,0%) var(--hy,0%); }
    100% { background-position: calc(var(--hx,0%) + 200%) calc(var(--hy,0%) + 200%); }
}

/* Rainbow prismatic layer — epic, legendary, limited only */
.mm-card-epic    .mm-card-holo,
.mm-card-legendary .mm-card-holo,
.mm-card-limited   .mm-card-holo {
    background: linear-gradient(
        var(--holo-angle, 115deg),
        rgba(255,0,128,0.12)   0%,
        rgba(255,100,0,0.14)  12%,
        rgba(255,220,0,0.14)  24%,
        rgba(0,230,100,0.14)  36%,
        rgba(0,180,255,0.14)  48%,
        rgba(100,80,255,0.14) 60%,
        rgba(220,0,255,0.14)  72%,
        rgba(255,0,128,0.12)  84%,
        rgba(255,100,0,0.14) 100%
    );
    background-size: 300% 300%;
    animation: mm-rainbow-holo 4s linear infinite;
    mix-blend-mode: screen;
}

@keyframes mm-rainbow-holo {
    0%   { background-position: 0% 0%;   --holo-angle: 100deg; }
    25%  { background-position: 100% 0%; --holo-angle: 125deg; }
    50%  { background-position: 100% 100%; --holo-angle: 150deg; }
    75%  { background-position: 0% 100%; --holo-angle: 125deg; }
    100% { background-position: 0% 0%;   --holo-angle: 100deg; }
}

/* Second prismatic layer for legendary/limited — offset timing */
.mm-card-legendary .mm-card-holo::after,
.mm-card-limited   .mm-card-holo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        60deg,
        transparent 30%,
        rgba(255,255,255,0.2) 45%,
        transparent 60%
    );
    background-size: 200% 200%;
    animation: mm-holo-shine 2s ease-in-out infinite;
    mix-blend-mode: overlay;
}
@keyframes mm-holo-shine {
    0%,100% { background-position: 0% 0%; opacity: 0.4; }
    50%     { background-position: 200% 200%; opacity: 1; }
}

/* ── Scanline overlay — villain & mystery cards ────────────────── */
.mm-card-villain .mm-card-art-frame::before,
.mm-card-mystery .mm-card-art-frame::before {
    /* Uses data attribute set on the card by PHP */
}
.mm-card[data-type="villain"] .mm-card-art-frame::before,
.mm-card[data-type="mystery"] .mm-card-art-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(0,0,0,0.08) 3px,
        rgba(0,0,0,0.08) 4px
    );
    animation: mm-scanlines 8s linear infinite;
    pointer-events: none;
    z-index: 4;
    opacity: 0.6;
}
@keyframes mm-scanlines {
    0%   { background-position: 0 0; }
    100% { background-position: 0 40px; }
}

/* ── Glitch effect on villain cards ────────────────────────────── */
.mm-card[data-type="villain"]:hover .mm-card-art {
    animation: mm-glitch 0.4s steps(2) infinite;
}
@keyframes mm-glitch {
    0%   { clip-path: polygon(0 0,100% 0,100% 35%,0 35%); transform: translate(-3px, 0) scale(1.04); filter: hue-rotate(90deg); }
    25%  { clip-path: polygon(0 35%,100% 35%,100% 65%,0 65%); transform: translate(3px, 0) scale(1.04); filter: hue-rotate(200deg); }
    50%  { clip-path: polygon(0 65%,100% 65%,100% 100%,0 100%); transform: translate(-2px, 0) scale(1.04); filter: hue-rotate(0deg); }
    75%  { clip-path: none; transform: translate(0,0) scale(1.04); filter: none; }
    100% { clip-path: none; transform: scale(1.04); filter: none; }
}

/* ── Floating sparkle dots — limited edition ───────────────────── */
.mm-card-limited .mm-card-art-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(255,215,0,0.9) 1px, transparent 1px),
        radial-gradient(circle, rgba(255,255,200,0.7) 1px, transparent 1px),
        radial-gradient(circle, rgba(255,180,0,0.6)  1px, transparent 1px);
    background-size: 60px 60px, 80px 80px, 50px 50px;
    background-position: 10px 10px, 30px 40px, 50px 20px;
    animation: mm-sparkle-drift 6s linear infinite;
    pointer-events: none;
    z-index: 3;
    opacity: 0.7;
}
@keyframes mm-sparkle-drift {
    0%   { background-position: 10px 10px,   30px 40px,  50px 20px;  opacity: 0.4; }
    25%  { opacity: 0.9; }
    50%  { background-position: 40px 50px,   70px 10px,  20px 60px;  opacity: 0.6; }
    75%  { opacity: 0.9; }
    100% { background-position: 10px 10px,   30px 40px,  50px 20px;  opacity: 0.4; }
}

/* ── Mystery ? overlay ─────────────────────────────────────────── */
.mm-card-mystery-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    background: rgba(0,0,0,0.18);
}
.mm-card-mystery-q {
    font-size: 4.5rem;
    font-weight: 900;
    color: rgba(255,255,255,0.18);
    line-height: 1;
    text-shadow: 0 2px 12px rgba(0,0,0,0.5);
    animation: mm-mystery-blink 3s ease-in-out infinite;
    user-select: none;
}

/* ── Mystery stats placeholder ─────────────────────────────────── */
.mm-card-stats-mystery {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.4em;
    color: rgba(255,255,255,0.15);
    animation: mm-mystery-blink 3s ease-in-out infinite;
}

/* ── Dupe badge ─────────────────────────────────────────────────── */

.mm-card-dupe-badge {
    position: absolute;
    top: 6px;
    right: 8px;
    background: rgba(0,0,0,0.75);
    color: #ffd700;
    font-size: 0.78rem;
    font-weight: 900;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid #ffd700;
    z-index: 6;
    letter-spacing: 0.02em;
    animation: mm-badge-pop 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes mm-badge-pop {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* ── Flavor text ───────────────────────────────────────────────── */
.mm-card-flavor {
    font-size: 0.72rem;
    font-style: italic;
    color: var(--card-header-fg, #aaa);
    opacity: 0.8;
    padding: 0.4rem 0.65rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    line-height: 1.4;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mm-card-flavor-mystery {
    letter-spacing: 0.4em;
    opacity: 0.3;
    animation: mm-mystery-blink 3s ease-in-out infinite;
}
@keyframes mm-mystery-blink {
    0%,100% { opacity: 0.3; }
    50%     { opacity: 0.15; }
}

/* ── Stats ─────────────────────────────────────────────────────── */
.mm-card-stats {
    padding: 0.5rem 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
    background: rgba(0,0,0,0.2);
}

.mm-card-stat {
    display: grid;
    grid-template-columns: 52px 1fr 20px;
    align-items: center;
    gap: 0.4rem;
}

.mm-card-stat-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.5);
}

.mm-card-stat-bar {
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 999px;
    overflow: hidden;
}

.mm-card-stat-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.8s cubic-bezier(0.34,1.2,0.64,1);
    position: relative;
}
/* Animated shimmer on stat bars */
.mm-card-stat-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: mm-bar-shimmer 2.5s ease-in-out infinite;
    border-radius: 999px;
}
@keyframes mm-bar-shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.mm-stat-stealth .mm-card-stat-fill {
    background: linear-gradient(90deg, #1565c0, #42a5f5);
    box-shadow: 0 0 6px rgba(66,165,245,0.5);
}
.mm-stat-cunning .mm-card-stat-fill {
    background: linear-gradient(90deg, #6a1b9a, #ab47bc);
    box-shadow: 0 0 6px rgba(171,71,188,0.5);
}
.mm-stat-luck    .mm-card-stat-fill {
    background: linear-gradient(90deg, #e65100, #ffa726);
    box-shadow: 0 0 6px rgba(255,167,38,0.5);
}

.mm-card-stat-num {
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    text-align: right;
}

/* ── Footer band ───────────────────────────────────────────────── */
.mm-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0.65rem;
    background: var(--card-footer-bg, #111);
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 0.65rem;
    color: var(--card-footer-fg, #888);
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.mm-card-series {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    font-style: italic;
}

.mm-card-rarity-stars {
    flex-shrink: 0;
    letter-spacing: -0.05em;
    color: var(--card-footer-fg, #888);
}
/* Animated stars for legendary+ */
.mm-card-legendary .mm-card-rarity-stars,
.mm-card-limited   .mm-card-rarity-stars {
    animation: mm-star-twinkle 1.5s ease-in-out infinite alternate;
}
@keyframes mm-star-twinkle {
    from { text-shadow: none; opacity: 0.8; }
    to   { text-shadow: 0 0 6px currentColor, 0 0 12px currentColor; opacity: 1; }
}

.mm-card-limit {
    flex-shrink: 0;
    font-weight: 700;
    color: var(--card-footer-fg, #888);
}

/* ── Lore panel (full mode) ────────────────────────────────────── */
.mm-card-lore {
    padding: 0.75rem 0.85rem;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.6;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.25);
}
.mm-card-lore strong {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.35);
    margin-bottom: 0.35rem;
}
.mm-card-lore p { margin: 0; }

/* ── Card earn / reveal animation ─────────────────────────────── */
.mm-card-reveal {
    animation: mm-card-flip-reveal 0.7s cubic-bezier(0.34,1.2,0.64,1) both;
}
@keyframes mm-card-flip-reveal {
    0%   { transform: perspective(600px) rotateY(-90deg) scale(0.8); opacity: 0; }
    60%  { transform: perspective(600px) rotateY(8deg)  scale(1.05); opacity: 1; }
    100% { transform: perspective(600px) rotateY(0deg)  scale(1);    opacity: 1; }
}

/* Duplicate shake */
.mm-card-dupe-shake {
    animation: mm-dupe-shake 0.5s cubic-bezier(0.36,0.07,0.19,0.97) both;
}
@keyframes mm-dupe-shake {
    10%,90%  { transform: perspective(600px) translateX(-2px); }
    20%,80%  { transform: perspective(600px) translateX(4px);  }
    30%,50%,70% { transform: perspective(600px) translateX(-6px); }
    40%,60%  { transform: perspective(600px) translateX(6px);  }
}

/* ══════════════════════════════════════════════════════════════════
   Collection Room grid & modal
   ══════════════════════════════════════════════════════════════════ */

.mm-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    justify-items: center;
}

/* Card modal overlay */
.mm-card-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: mm-fade-in 0.15s ease;
    cursor: pointer;
    /* subtle vignette */
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.95) 100%);
}

.mm-card-modal-inner {
    cursor: default;
    animation: mm-pop-in 0.25s cubic-bezier(0.34,1.3,0.64,1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-height: 90vh;
    overflow-y: auto;
}

.mm-card-modal-close {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    font-size: 1rem;
    padding: 0.4rem 1.2rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.mm-card-modal-close:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
}

@keyframes mm-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes mm-pop-in {
    from { transform: scale(0.8) translateY(20px); opacity: 0; }
    to   { transform: scale(1)   translateY(0px);  opacity: 1; }
}

/* ── JS sparkle particle (injected by cards.js) ────────────────── */
.mm-sparkle-particle {
    position: fixed;
    pointer-events: none;
    border-radius: 50%;
    z-index: 9999;
    animation: mm-sparkle-fly 0.8s ease-out forwards;
}
@keyframes mm-sparkle-fly {
    0%   { transform: translate(0,0) scale(1);   opacity: 1; }
    100% { transform: translate(var(--sx),var(--sy)) scale(0); opacity: 0; }
}
