#farmer-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    backdrop-filter: blur(2px);
}

#farmer-modal {
    background: #fff;
    border-radius: 14px;
    padding: 30px;
    width: 90%;
    max-width: 480px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .2);
    font-family: inherit;
    text-align: center;
    border: 3px solid #f7d700;
    /* farmer yellow */
}

#farmer-modal .fm-close {
    position: absolute;
    top: -30px;
    right: -60px;
    border: none;
    width: 11px;
    height: 9px;
    font-size: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.2s;
    z-index: 1;
}




#custom-modal {
    background: #fff;
    border-top: 2px dashed #371b02;
    padding: 3px 0px;
}

#custom-modal p {
    margin: 0 auto;
    font-size: 1.1rem;
    padding: 0 8px;
    color: #000;
}

#custom-modal a {
    color: #111;
    text-decoration: underline;
}

#custom-modal a:hover {
    color: #fff;
    text-decoration: underline;
}

#custom-modal p span.vidsotok {
    font-weight: 600;
    color: #000000;
}

#custom-modal p span.promo {
    font-weight: 600;
    color: #000000;
    padding: 2px 5px;
    border: 1px dashed #c41e63;
    display: inline-block;
    margin: 3px 8px;
}

#custom-modal button {
    margin: 0;
    padding: 0 !important;
    line-height: 0;
    min-height: auto !important;
    font-weight: 400;
    font-size: .75rem;
    margin-right: 0.9em;
}

@media (max-width:580px) {
    #custom-modal p {
        font-size: .85rem;
        text-align: center;
    }

    #custom-modal button {
        font-size: 0rem;
        margin-right: 0.9rem;
    }
}

#custom-modal button span {
    font-size: .8rem;
    line-height: 2;
    background: #000;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.3em;
    height: 1.3em;
    border-radius: 99px;
}


.fm-flower {
    position: absolute;
    background-repeat: no-repeat;
    background-size: contain;
    width: 110px;
    height: 110px;
    pointer-events: none;
    opacity: 0.9;
}


#farmer-modal .flower-top {
    top: -45px;
    left: -55px;
    background-image: url('/wp-content/themes/flatsome-child/addons/popup/modal/flower-top.svg');
    transform: rotate(-10deg);
}


#farmer-modal .flower-bottom {
    bottom: -45px;
    right: -55px;
    background-image: url('/wp-content/themes/flatsome-child/addons/popup/modal/flower-bottom.svg');
    transform: rotate(8deg);
}

@media (max-width: 480px) {
    .fm-flower {
        width: 75px;
        height: 75px;
    }

    #farmer-modal .flower-top {
        top: -30px;
        left: -25px;
    }

    #farmer-modal .flower-bottom {
        bottom: -30px;
        right: -35px;
    }
}

/* ========================================
   карточка стирачка
   ======================================== */

.fm-lottery {
    padding: 10px 0;
}

.fm-lottery-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #222;
    margin: 0 0 20px 0;
    line-height: 1.3;
}

/* Scratch area container — custom circle cursor */
.fm-scratch-area {
    position: relative;
    width: 260px;
    height: 180px;
    margin: 0 auto 15px auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.12),
        inset 0 0 0 2px #f7d700;
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ccircle cx='16' cy='16' r='14' fill='rgba(255,215,0,0.5)' stroke='%23c9b037' stroke-width='2'/%3E%3Ccircle cx='16' cy='16' r='6' fill='rgba(255,255,255,0.7)'/%3E%3C/svg%3E") 16 16, pointer;
    user-select: none;
    -webkit-user-select: none;
}

/* Результат на канвасі */
.fm-scratch-result {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fffde7 0%, #fff9c4 50%, #fff176 100%);
    padding: 15px;
    gap: 6px;
}

.fm-discount-text {
    font-size: 2.4rem;
    font-weight: 900;
    color: #d32f2f;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.08);
    line-height: 1.1;
}

.fm-discount-congrats {
    font-size: 1.1rem;
    color: #555;
    font-weight: 600;
    margin-top: 4px;
}

/* ========== Купон (після стирачки) ========== */
.fm-coupon-panel {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    padding: 18px 20px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid #a5d6a7;
    border-radius: 12px;
    animation: fm-panel-slide-in 0.5s ease forwards;
}

.fm-coupon-panel.visible {
    display: flex;
}

.fm-coupon-panel-title {
    font-size: 0.9rem;
    color: #2e7d32;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.fm-coupon-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.8);
    border: 2px dashed #2e7d32;
    border-radius: 8px;
}

.fm-coupon-code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.3rem;
    font-weight: 800;
    color: #1b5e20;
    letter-spacing: 2px;
    user-select: all;
    -webkit-user-select: all;
}

/* Copy button */
.fm-copy-btn {
    background: linear-gradient(135deg, #2e7d32, #388e3c);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.fm-copy-btn:hover {
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(46, 125, 50, 0.3);
}

.fm-copy-btn.copied {
    background: linear-gradient(135deg, #4caf50, #66bb6a) !important;
}

/* Conditions & Expiry */
.fm-coupon-condition,
.fm-coupon-expiry {
    font-size: 0.8rem;
    color: #555;
    font-weight: 500;
}

.fm-coupon-condition {
    color: #e65100;
}

.fm-coupon-expiry {
    color: #c62828;
    font-weight: 600;
}
.fm-scratch-image{
    width:80px;
    height:80px;
    object-fit:contain;
    display:block;
    margin:-5px auto 0;
}

/* Canvas overlay */
#farmer-scratch-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    touch-action: none;
}

/* Hint text */
.fm-scratch-hint {
    font-size: 0.85rem;
    color: #888;
    margin: 0;
    font-style: italic;
    transition: opacity 0.4s ease;
}

.fm-scratch-hint.hidden {
    opacity: 0;
}

/* Reveal animation */
.fm-scratch-area.revealed #farmer-scratch-canvas {
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.fm-scratch-area.revealed .fm-scratch-result {
    animation: fm-result-pop 0.5s ease forwards;
}

@keyframes fm-result-pop {
    0% {
        transform: scale(0.9);
        opacity: 0.7;
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fm-panel-slide-in {
    0% {
        transform: translateY(15px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 480px) {
    .fm-scratch-area {
        width: 220px;
        height: 155px;
    }

    .fm-discount-text {
        font-size: 1.8rem;
    }

    .fm-coupon-code {
        font-size: 1.1rem;
    }

    .fm-lottery-title {
        font-size: 1.2rem;
    }

    .fm-coupon-panel {
        padding: 14px 12px;
    }

    .fm-coupon-row {
        flex-wrap: wrap;
        justify-content: center;
    }
}