/* Mystery Scratch Coupon - Frontend Styles */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=DM+Sans:wght@400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600&display=swap');

/* ── Card wrapper ───────────────────────────── */
#mscw-game {
    max-width: 480px;
    margin: 24px auto;
    border-radius: 24px;
    padding: 32px 28px 28px;
    text-align: center;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.1);
}

#mscw-game::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.12) 0%, transparent 60%);
    pointer-events: none;
}

/* ── Header ─────────────────────────────────── */
.mscw-offer-badge {
    display: inline-flex; align-items: center; gap: 5px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 11px; font-weight: 600; color: #fff;
    letter-spacing: 0.5px; text-transform: uppercase;
    margin-bottom: 14px;
}

.mscw-game-title {
    font-family: 'Poppins', sans-serif;
    font-size: 26px !important; font-weight: 800 !important;
    color: #fff !important;
    line-height: 1.25 !important;
    margin: 0 0 8px !important;
}

.mscw-game-subtitle {
    font-size: 14px; color: rgba(255,255,255,0.8);
    margin: 0 0 24px !important;
    font-weight: 400;
}

/* ── Scratch outer shell ─────────────────────── */
.mscw-scratch-outer {
    position: relative;
    width: 100%;
    height: 160px;
    border-radius: 16px;
    overflow: hidden;
    margin: 0 auto 14px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2),
                0 8px 32px rgba(0,0,0,0.35);
    cursor: crosshair;
}

/* ── Reward layer (behind canvas) ───────────── */
.mscw-reward-layer {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, #ff6b35 0%, #f7c948 50%, #ff6b35 100%);
    background-size: 200% 200%;
    animation: mscwShimmer 3s ease infinite;
    display: flex; align-items: center; justify-content: center;
}

@keyframes mscwShimmer {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.mscw-reward-inner { text-align: center; padding: 12px 20px; }
.mscw-reward-emoji { font-size: 30px; margin-bottom: 4px; display: block; }
.mscw-reward-name  {
    font-family: 'Syne', sans-serif;
    font-size: 20px; font-weight: 800; color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2); margin-bottom: 3px;
}
.mscw-reward-code  {
    font-family: 'Courier New', monospace;
    font-size: 18px; font-weight: 700; color: #fff;
    background: rgba(0,0,0,0.2);
    border: 2px dashed rgba(255,255,255,0.6);
    border-radius: 8px; padding: 5px 14px;
    letter-spacing: 3px; display: inline-block; margin-top: 5px;
}

/* ── Canvas (on top of reward layer) ────────── */
#mscw-scratch-canvas {
    position: absolute; inset: 0;
    width: 100% !important;
    height: 100% !important;
    display: block;
    cursor: crosshair;
    touch-action: none;
}

/* ── Hint ────────────────────────────────────── */
.mscw-hint {
    font-size: 13px; color: rgba(255,255,255,0.75);
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin: 0 0 4px;
}
.mscw-hint-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: rgba(255,255,255,0.5);
    animation: mscwPulse 1.5s ease infinite;
}
.mscw-hint-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes mscwPulse {
    0%,100% { opacity: 0.4; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.4); }
}

/* ── Result panel ────────────────────────────── */
#mscw-result {
    display: none;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 16px;
    padding: 20px;
    margin-top: 16px;
    backdrop-filter: blur(10px);
    animation: mscwSlideUp 0.4s ease;
}

@keyframes mscwSlideUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.mscw-result-congrats {
    font-family: 'Poppins', sans-serif;
    font-size: 20px; font-weight: 800; color: #fff;
    margin-bottom: 4px;
}
.mscw-result-discount {
    font-size: 13px; color: rgba(255,255,255,0.75); margin-bottom: 14px;
}
.mscw-result-code-box {
    background: rgba(255,255,255,0.18);
    border-radius: 12px; padding: 12px 16px; margin-bottom: 12px;
}
.mscw-result-code-label {
    font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
    color: rgba(255,255,255,0.6); margin-bottom: 5px;
}
.mscw-result-code-value {
    font-family: 'Courier New', monospace;
    font-size: 24px; font-weight: 700; color: #fff; letter-spacing: 3px;
}

.mscw-copy-btn {
    width: 100%;
    background: #fff;
    color: #1abc9c;
    border: none;
    border-radius: 12px;
    padding: 13px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px; font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.mscw-copy-btn:hover  { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,0,0,0.25); }
.mscw-copy-btn:active { transform: translateY(0); }
.mscw-copy-btn.copied { background: #22c55e !important; color: #fff !important; }

/* ── Popup overlay ───────────────────────────── */
#mscw-popup-overlay {
    display: none;
    position: sticky; inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 16px;
    height: 100vh;
    top: 0;
    left: 0;
}

#mscw-popup-overlay.mscw-open {
    display: flex;
    animation: mscwFadeIn 0.3s ease;
}

@keyframes mscwFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.mscw-popup-inner {
    position: relative;
    width: 100%;
    max-width: 500px;
    animation: mscwPopIn 0.35s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes mscwPopIn {
    from { opacity: 0; transform: scale(0.88) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.mscw-popup-close {
    position: absolute;
    top: -14px; right: -14px;
    width: 32px; height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.95);
    color: #333;
    font-size: 18px; line-height: 1;
    cursor: pointer;
    z-index: 1;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.15s, background 0.15s;
}
.mscw-popup-close:hover { transform: scale(1.1); background: #fff; }

/* ── Admin badge ─────────────────────────────── */
.mscw-admin-badge {
    display: inline-block;
    background: #ff6b6b; color: #fff;
    font-size: 10px; font-weight: 700;
    padding: 3px 9px; border-radius: 20px;
    vertical-align: middle; white-space: nowrap;
    margin-left: 8px; letter-spacing: 0.3px;
}

/* ── Loading state ───────────────────────────── */
.mscw-loading {
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    animation: mscwBlink 1s ease infinite;
}
@keyframes mscwBlink { 0%,100%{opacity:.5} 50%{opacity:1} }

/* ═══════════════════════════════════════════════
   COUPON REMINDER FEATURES
═══════════════════════════════════════════════ */

/* ── Floating Badge (Bottom-right corner) ────── */
#mscw-floating-badge {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999998;
    background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%);
    color: #fff;
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 0 8px 32px rgba(26, 188, 156, 0.4),
                0 0 0 1px rgba(255, 255, 255, 0.1);
    min-width: 260px;
    font-family: 'DM Sans', -apple-system, sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: mscwBadgeSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
               mscwBadgePulse 2s ease-in-out 1s infinite;
    display: none;
}

#mscw-floating-badge.mscw-visible {
    display: block;
}

#mscw-floating-badge:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 40px rgba(26, 188, 156, 0.5);
}

@keyframes mscwBadgeSlideIn {
    from { opacity: 0; transform: translateY(30px) scale(0.9); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes mscwBadgePulse {
    0%, 100% { box-shadow: 0 8px 32px rgba(26, 188, 156, 0.4); }
    50%      { box-shadow: 0 8px 32px rgba(26, 188, 156, 0.7); }
}

.mscw-badge-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}

.mscw-badge-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.mscw-badge-icon {
    font-size: 28px;
    margin-bottom: 6px;
    display: block;
}

.mscw-badge-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 4px;
    line-height: 1.3;
}

.mscw-badge-code {
    font-family: 'Courier New', monospace;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 12px;
    border-radius: 8px;
    margin: 8px 0;
    border: 1px dashed rgba(255, 255, 255, 0.4);
}

.mscw-badge-hint {
    font-size: 11px;
    opacity: 0.85;
    margin: 4px 0 0;
    font-weight: 500;
}

.mscw-badge-copied {
    background: #22c55e !important;
    animation: mscwCopiedPulse 0.4s ease;
}

@keyframes mscwCopiedPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.05); }
}

/* ── Checkout Banner (Full-width at top) ────── */
.mscw-checkout-banner {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    padding: 16px 24px;
    margin: 0 0 24px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.25);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    animation: mscwBannerSlideDown 0.5s ease;
    font-family: 'DM Sans', -apple-system, sans-serif;
    position: relative;
    overflow: hidden;
}

.mscw-checkout-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: mscwBannerShine 3s ease-in-out infinite;
}

@keyframes mscwBannerSlideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes mscwBannerShine {
    0%   { left: -100%; }
    50%, 100% { left: 100%; }
}

.mscw-banner-left {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.mscw-banner-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.mscw-banner-text h3 {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 2px;
    line-height: 1.3;
}

.mscw-banner-text p {
    font-size: 13px;
    margin: 0;
    opacity: 0.9;
}

.mscw-banner-code {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.25);
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
}

.mscw-banner-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mscw-banner-btn {
    background: #fff;
    color: #059669;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'DM Sans', sans-serif;
    white-space: nowrap;
}

.mscw-banner-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mscw-banner-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.mscw-banner-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.mscw-banner-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Mobile responsive */
@media (max-width: 640px) {
    #mscw-floating-badge {
        bottom: 12px;
        right: 12px;
        left: 12px;
        min-width: auto;
        padding: 14px 16px;
    }
    
    .mscw-checkout-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 16px;
    }
    
    .mscw-banner-right {
        width: 100%;
        flex-direction: column;
    }
    
    .mscw-banner-btn {
        width: 100%;
    }
    
    .mscw-banner-close {
        position: absolute;
        top: 10px;
        right: 10px;
    }
}
