/* ================================================================
   Modulo Coupons — Scratch Card v1.0
   ================================================================ */

/* ── Modal overlay ── */
.mc-modal-overlay {
    position: fixed; inset: 0; z-index: 99999;
    background: rgba(0,0,0,.55);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    opacity: 0; visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}
.mc-modal-overlay.mc-modal--open {
    opacity: 1; visibility: visible;
}

/* ── Modal card ── */
.mc-scratch-modal {
    background: #fff;
    border-radius: var(--mc-radius, 16px);
    width: 100%; max-width: 400px;
    max-height: 92vh;
    /* NO overflow:hidden — it kills CSS 3D transforms (preserve-3d) */
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,.25);
    transform: scale(.92) translateY(16px);
    transition: transform .3s cubic-bezier(.34,1.56,.64,1);
    position: relative;
    /* Use border-radius via clip-path instead of overflow:hidden */
    -webkit-mask-image: -webkit-radial-gradient(white, black);
}
.mc-modal-overlay.mc-modal--open .mc-scratch-modal {
    transform: scale(1) translateY(0);
}

/* ── Modal header ── */
.mc-scratch-header {
    background: var(--mc-primary, #7c3aed);
    padding: 20px 24px 16px;
    text-align: center; color: #fff; position: relative;
}
.mc-scratch-header h3 {
    margin: 0 0 4px; font-size: 20px; font-weight: 700;
}
.mc-scratch-header p {
    margin: 0; font-size: 13px; opacity: .85;
}
.mc-modal-close {
    position: absolute; top: 12px; right: 14px;
    background: rgba(255,255,255,.2); border: none;
    color: #fff; width: 30px; height: 30px; border-radius: 50%;
    font-size: 18px; line-height: 1; cursor: pointer;
    transition: background .2s;
    display: flex; align-items: center; justify-content: center;
}
.mc-modal-close:hover { background: rgba(255,255,255,.35); }

/* ── Scratch area ── */
.mc-scratch-area {
    padding: 24px;
    display: flex; flex-direction: column; align-items: center; gap: 16px;
}

.mc-scratch-hint {
    font-size: 13px; color: #6b7280; text-align: center;
    display: flex; align-items: center; gap: 6px;
}
.mc-scratch-hint svg { flex-shrink: 0; }

/* Canvas wrapper */
.mc-canvas-wrap {
    position: relative;
    width: 100%; max-width: 340px;
    border-radius: var(--mc-radius-sm, 10px);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,.12);
    cursor: crosshair;
    touch-action: none;
    /* Height set by JS to match canvas */
}

/* Result panel — sits INSIDE wrap, canvas overlays it */
.mc-scratch-result-bg {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 6px; padding: 16px;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    width: 100%; height: 100%;
    box-sizing: border-box;
    z-index: 1;
}

/* Spacer so wrap has intrinsic height (JS overrides with explicit px) */
.mc-canvas-wrap::before {
    content: '';
    display: block;
    padding-top: 58.8%; /* 200/340 ratio */
}
.mc-result-amount {
    font-size: 52px; font-weight: 900;
    color: var(--mc-primary, #7c3aed); line-height: 1;
}
.mc-result-label {
    font-size: 13px; color: #6b7280; text-align: center;
}
.mc-result-noluck {
    font-size: 40px; margin-bottom: 4px;
}
.mc-result-noluck-text {
    font-size: 18px; font-weight: 700; color: #9ca3af;
}

#mc-scratch-canvas {
    position: absolute; inset: 0; width: 100%; height: 100%;
    cursor: crosshair; touch-action: none;
    border-radius: var(--mc-radius-sm, 10px);
    z-index: 3; /* above mc-scratch-result-bg (z-index:1) */
}

/* Progress bar */
.mc-scratch-progress-wrap {
    width: 100%; max-width: 340px;
}
.mc-scratch-progress-bar {
    height: 4px; background: #e5e7eb; border-radius: 99px; overflow: hidden;
}
.mc-scratch-progress-fill {
    height: 100%; width: 0%;
    background: var(--mc-primary, #7c3aed);
    border-radius: 99px;
    transition: width .1s linear;
}

/* ── Result section (after reveal) ── */
.mc-scratch-outcome {
    width: 100%; text-align: center;
    padding: 0 24px 24px;
    display: none;
}
.mc-scratch-outcome.mc-outcome--visible { display: block; }

.mc-outcome-code-wrap {
    background: #f5f3ff; border: 2px dashed var(--mc-primary, #7c3aed);
    border-radius: var(--mc-radius-sm, 10px);
    padding: 16px; margin: 12px 0;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.mc-outcome-code {
    font-family: monospace; font-size: 22px; font-weight: 800;
    color: var(--mc-primary, #7c3aed); letter-spacing: 3px;
}
.mc-outcome-copy {
    background: var(--mc-primary, #7c3aed); color: #fff;
    border: none; border-radius: 8px; padding: 8px 14px;
    font-size: 13px; font-weight: 700; cursor: pointer;
    transition: opacity .2s; white-space: nowrap;
}
.mc-outcome-copy:hover { opacity: .85; }

.mc-outcome-min {
    font-size: 13px; color: #6b7280; margin: 4px 0 12px;
}

.mc-outcome-noluck {
    padding: 12px 0; color: #9ca3af; font-size: 15px;
}

/* ── Scratch play button ── */
.mc-scratch-play-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--mc-primary, #7c3aed); color: #fff;
    border: none; border-radius: var(--mc-radius-sm, 10px);
    padding: 13px 28px; font-size: 16px; font-weight: 700;
    cursor: pointer; transition: opacity .2s, transform .15s;
    text-decoration: none;
}
.mc-scratch-play-btn:hover { opacity: .88; transform: translateY(-1px); }
.mc-scratch-play-btn:active { transform: translateY(0); }
.mc-scratch-play-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ── Confetti canvas ── */
#mc-confetti-canvas {
    position: fixed; inset: 0; pointer-events: none; z-index: 100000;
}

/* ── Spin box updated layout ── */
.mc-spin-box {
    display: flex; flex-direction: column;
    align-items: center; text-align: center; gap: 12px;
    padding: 28px 24px;
}
.mc-spin-icon { font-size: 48px; line-height: 1; }
.mc-spin-box h3 { margin: 0; font-size: 20px; font-weight: 700; color: #fff; }
.mc-spin-box p  { margin: 0; color: rgba(255,255,255,.85); font-size: 14px; }
