/* ═══════════════════════════════════════════════════════════════ */
/*  Mirror Match Game — Styles                                     */
/* ═══════════════════════════════════════════════════════════════ */

/* ── Game Button on Appointment Card ── */
.bv2-cust-btn-game {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9) !important;
    color: #fff !important;
    border: none !important;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    transition: all 0.2s ease;
    animation: mmg-pulse 2s infinite;
}
.bv2-cust-btn-game:hover {
    background: linear-gradient(135deg, #7c3aed, #5b21b6) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}
.bv2-cust-btn-game-played {
    background: #f3f0ff !important;
    color: #7c3aed !important;
    border: 1px solid #ddd6fe !important;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

@keyframes mmg-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(139, 92, 246, 0); }
}

/* ── Game Modal Overlay ── */
.mmg-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.mmg-overlay.mmg-visible {
    opacity: 1;
}

.mmg-container {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 640px;
    max-height: 95vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}
.mmg-overlay.mmg-visible .mmg-container {
    transform: scale(1);
}

/* ── Close Button ── */
.mmg-close {
    position: absolute;
    top: 12px; right: 12px;
    width: 36px; height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.08);
    color: #666;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s;
}
.mmg-close:hover {
    background: rgba(0,0,0,0.15);
    color: #333;
}

/* ── Intro Screen ── */
.mmg-intro {
    padding: 40px 32px;
    text-align: center;
}
.mmg-intro-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: mmg-bounce 1s ease infinite;
}
@keyframes mmg-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.mmg-intro h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1e1b4b;
    margin: 0 0 8px;
}
.mmg-intro-discount {
    display: inline-block;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: #fff;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 18px;
    font-weight: 700;
    margin: 12px 0;
}
.mmg-intro-rules {
    text-align: left;
    background: #f8f7ff;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 20px 0;
    font-size: 14px;
    color: #4c1d95;
    line-height: 1.8;
}
.mmg-intro-rules li {
    list-style: none;
    padding-left: 24px;
    position: relative;
}
.mmg-intro-rules li::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: #8b5cf6;
}
.mmg-start-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: #fff;
    border: none;
    padding: 14px 40px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}
.mmg-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
}

/* ── Game Header (Timer + Score) ── */
.mmg-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: linear-gradient(135deg, #f8f7ff, #ede9fe);
    border-radius: 20px 20px 0 0;
}
.mmg-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 700;
    color: #059669;
    transition: color 0.3s;
}
.mmg-timer.mmg-timer-warn {
    color: #d97706;
}
.mmg-timer.mmg-timer-danger {
    color: #dc2626;
    animation: mmg-timer-shake 0.5s ease infinite;
}
@keyframes mmg-timer-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}
.mmg-timer-icon {
    font-size: 24px;
}
.mmg-stats {
    display: flex;
    gap: 16px;
}
.mmg-stat {
    text-align: center;
}
.mmg-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #4c1d95;
}
.mmg-stat-label {
    font-size: 11px;
    color: #7c3aed;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Progress Bar ── */
.mmg-progress-wrap {
    padding: 0 24px;
    background: #f8f7ff;
}
.mmg-progress {
    height: 6px;
    background: #e9e5ff;
    border-radius: 3px;
    overflow: hidden;
}
.mmg-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #6d28d9);
    border-radius: 3px;
    transition: width 0.4s ease;
    width: 0%;
}

/* ── Memorize Phase Banner ── */
.mmg-memorize-banner {
    text-align: center;
    padding: 12px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    font-weight: 600;
    font-size: 15px;
    animation: mmg-glow 1.5s ease infinite;
}
@keyframes mmg-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ── Card Grid ── */
.mmg-grid {
    display: grid;
    gap: 10px;
    padding: 20px 24px;
    justify-items: center;
}
.mmg-grid-3 { grid-template-columns: repeat(3, 1fr); }
.mmg-grid-4 { grid-template-columns: repeat(4, 1fr); }
.mmg-grid-5 { grid-template-columns: repeat(5, 1fr); }

/* ── Card ── */
.mmg-card {
    width: 100%;
    aspect-ratio: 1;
    perspective: 800px;
    cursor: pointer;
    max-width: 120px;
}
.mmg-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
    transform-style: preserve-3d;
}
.mmg-card.mmg-flipped .mmg-card-inner {
    transform: rotateY(180deg);
}
.mmg-card-front,
.mmg-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Back of card (face down) */
.mmg-card-back {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #7c3aed;
}
.mmg-card-back-icon {
    font-size: 32px;
    opacity: 0.6;
}
.mmg-card-back svg {
    width: 40px;
    height: 40px;
    stroke: rgba(255,255,255,0.5);
    fill: none;
    stroke-width: 2;
}

/* Front of card (face up) */
.mmg-card-front {
    transform: rotateY(180deg);
    background: #fff;
    border: 3px solid #e9e5ff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}
.mmg-card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

/* Card states */
.mmg-card.mmg-matched .mmg-card-front {
    border-color: #10b981;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
}
.mmg-card.mmg-matched .mmg-card-inner {
    animation: mmg-match-pop 0.4s ease;
}
@keyframes mmg-match-pop {
    0% { transform: rotateY(180deg) scale(1); }
    50% { transform: rotateY(180deg) scale(1.1); }
    100% { transform: rotateY(180deg) scale(1); }
}
.mmg-card.mmg-wrong .mmg-card-front {
    border-color: #ef4444;
    animation: mmg-wrong-shake 0.4s ease;
}
@keyframes mmg-wrong-shake {
    0%, 100% { transform: rotateY(180deg) translateX(0); }
    25% { transform: rotateY(180deg) translateX(-6px); }
    75% { transform: rotateY(180deg) translateX(6px); }
}

/* Disabled during animation */
.mmg-card.mmg-disabled {
    pointer-events: none;
}

/* ── Match Message ── */
.mmg-match-msg {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 100001;
    pointer-events: none;
    animation: mmg-msg-pop 0.8s ease forwards;
}
@keyframes mmg-msg-pop {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -80%) scale(0.8); opacity: 0; }
}

/* ── Result Screen ── */
.mmg-result {
    padding: 40px 32px;
    text-align: center;
}
.mmg-result-icon {
    font-size: 72px;
    margin-bottom: 16px;
}
.mmg-result h2 {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 8px;
}
.mmg-result-win h2 {
    color: #059669;
}
.mmg-result-lose h2 {
    color: #6b7280;
}
.mmg-result p {
    font-size: 16px;
    color: #6b7280;
    margin: 0 0 20px;
}
.mmg-result-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin: 20px 0;
}
.mmg-result-stat {
    text-align: center;
}
.mmg-result-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #4c1d95;
}
.mmg-result-stat-label {
    font-size: 12px;
    color: #9ca3af;
}

/* ── Coupon Display ── */
.mmg-coupon-box {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 2px dashed #10b981;
    border-radius: 16px;
    padding: 20px;
    margin: 20px 0;
}
.mmg-coupon-label {
    font-size: 13px;
    color: #059669;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}
.mmg-coupon-code {
    font-size: 28px;
    font-weight: 800;
    color: #065f46;
    letter-spacing: 3px;
    font-family: 'Courier New', monospace;
    margin: 8px 0;
    user-select: all;
}
.mmg-coupon-discount {
    font-size: 20px;
    font-weight: 700;
    color: #059669;
    margin: 4px 0;
}
.mmg-coupon-expires {
    font-size: 12px;
    color: #6b7280;
    margin-top: 8px;
}
.mmg-coupon-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #059669;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
    transition: all 0.2s;
}
.mmg-coupon-copy:hover {
    background: #047857;
}
.mmg-coupon-copy.mmg-copied {
    background: #10b981;
}

/* ── Close/Done Button ── */
.mmg-done-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f3f4f6;
    color: #374151;
    border: none;
    padding: 12px 32px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
    transition: all 0.2s;
}
.mmg-done-btn:hover {
    background: #e5e7eb;
}

/* ── Confetti Canvas ── */
.mmg-confetti {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100002;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .mmg-container {
        border-radius: 16px;
        max-height: 98vh;
    }
    .mmg-intro {
        padding: 28px 20px;
    }
    .mmg-intro h2 {
        font-size: 20px;
    }
    .mmg-grid {
        padding: 12px 16px;
        gap: 8px;
    }
    .mmg-card {
        max-width: 90px;
    }
    .mmg-header {
        padding: 12px 16px;
    }
    .mmg-timer {
        font-size: 18px;
    }
    .mmg-result {
        padding: 28px 20px;
    }
    .mmg-coupon-code {
        font-size: 22px;
        letter-spacing: 2px;
    }
}

/* ── Owner Settings: Game Section ── */
.berberim-owner-game-box {
    margin-top: 14px;
    border: 1px solid #e9e5ff;
    border-radius: 12px;
    padding: 16px;
    background: #faf8ff;
}
.berberim-owner-game-box .berberim-game-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: #4c1d95;
    display: flex;
    align-items: center;
    gap: 8px;
}
.berberim-game-fields {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.berberim-game-fields label {
    font-size: 13px;
    color: #555;
}
.berberim-game-fields input[type="number"] {
    width: 80px;
    padding: 6px 8px;
    border: 1px solid #ddd6fe;
    border-radius: 6px;
    font-size: 13px;
}
.berberim-game-photos-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}
.berberim-game-photo-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e9e5ff;
}
.berberim-game-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.berberim-game-photo-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    border: none;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.berberim-game-photo-add {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    border: 2px dashed #c4b5fd;
    background: #f5f3ff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 28px;
    color: #8b5cf6;
    transition: all 0.2s;
}
.berberim-game-photo-add:hover {
    background: #ede9fe;
    border-color: #8b5cf6;
}
.berberim-game-hint {
    font-size: 12px;
    color: #666;
    margin-top: 6px;
}
