/* ================================================================
   Modulo Coupons — Triple Games CSS v3.0
   NO CSS 3D transforms — pure JS opacity/visibility approach
   Compatible with all mobile browsers
   ================================================================ */

.mc-triple-hint {
    text-align: center; font-size: 13px; color: #6b7280;
    margin: 0 0 14px; display: flex; align-items: center;
    justify-content: center; gap: 6px;
}

/* ── 3-card grid ── */
.mc-triple-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px; padding: 0 4px;
}

/* ── Card base — NO 3D transforms ── */
.mc-triple-card {
    aspect-ratio: 2 / 3;
    min-height: 130px;
    cursor: pointer;
    border-radius: var(--mc-radius-sm, 8px);
    position: relative;
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
    transition: transform .2s ease, box-shadow .2s ease;
}

/* Hover lift */
.mc-triple-card:not(.mc-disabled):hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0,0,0,.22);
}

/* ── Front face (visible by default) ── */
.mc-card-front {
    position: absolute; inset: 0;
    border-radius: inherit;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    overflow: hidden;
    transition: opacity .35s ease;
    opacity: 1;
    z-index: 2;
}

/* ── Back face (hidden by default) ── */
.mc-card-back {
    position: absolute; inset: 0;
    border-radius: inherit;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    overflow: hidden;
    background: #fff;
    border: 2px solid #e5e7eb;
    transition: opacity .35s ease;
    opacity: 0;
    z-index: 1;
}

/* ── Revealed state — JS adds .mc-revealed ── */
.mc-triple-card.mc-revealed .mc-card-front { opacity: 0; z-index: 1; }
.mc-triple-card.mc-revealed .mc-card-back  { opacity: 1; z-index: 2; }

.mc-card-back.mc-back--win {
    background: linear-gradient(160deg, #f5f3ff 0%, #ede9fe 100%);
    border-color: var(--mc-primary, #7c3aed);
}
.mc-card-back.mc-back--lose {
    background: #f9fafb;
    border-color: #e5e7eb;
}

.mc-card-amount {
    font-size: clamp(15px, 4.5vw, 22px);
    font-weight: 900; line-height: 1; margin-bottom: 4px;
}
.mc-back--win  .mc-card-amount { color: var(--mc-primary, #7c3aed); }
.mc-back--lose .mc-card-amount { color: #9ca3af; }

.mc-card-sublabel {
    font-size: 9px; text-transform: uppercase;
    letter-spacing: .5px; opacity: .65;
}

.mc-card-win-badge {
    position: absolute; top: -7px; right: -7px;
    background: #f59e0b; color: #fff;
    font-size: 9px; font-weight: 800;
    padding: 2px 5px; border-radius: 99px;
    text-transform: uppercase; letter-spacing: .4px;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
    z-index: 3;
}

/* ── Disabled ── */
.mc-triple-card.mc-disabled {
    opacity: .45; cursor: not-allowed; pointer-events: none;
}

/* ── Pulse ── */
@keyframes mc-pulse-card {
    0%,100% { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-4px) scale(1.03); }
}
.mc-triple-card.mc-pulse { animation: mc-pulse-card 1.5s ease-in-out infinite; }
.mc-triple-card.mc-disabled.mc-pulse { animation: none; }

/* ── Poker card front ── */
.mc-card-front.mc-front--poker {
    background: #faf9f6;
    background-image: radial-gradient(circle at 20% 20%, rgba(255,255,255,.8) 0%, transparent 60%);
    border: 2px solid #c8b87a;
    padding: 4px;
}
.mc-card-front.mc-front--poker::before {
    content: '';
    position: absolute; inset: 4px;
    border: 1px solid #c8b87a; border-radius: 4px;
    pointer-events: none;
}
.mc-poker-corner {
    position: absolute;
    font-size: 10px; font-weight: 800; line-height: 1.1;
    text-align: center; color: #1a1a2e; font-family: 'Georgia', serif;
}
.mc-poker-corner--tl { top: 5px; left: 6px; }
.mc-poker-corner--br { bottom: 5px; right: 6px; transform: rotate(180deg); }
.mc-poker-pattern {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 2px; padding: 24px 10px 24px; width: 100%;
}
.mc-poker-center {
    position: absolute;
    font-size: clamp(28px, 9vw, 42px); opacity: .12; user-select: none;
}

/* ── Scratch canvas (absolute over back face) ── */
.mc-card-scratch-canvas {
    position: absolute; inset: 0;
    width: 100% !important; height: 100% !important;
    z-index: 5;
    border-radius: inherit;
    touch-action: none; cursor: crosshair;
}

/* ── Jewelry box front ── */
.mc-card-front.mc-front--jewelry {
    background: linear-gradient(160deg, #0f0c29, #1a1040, #24243e);
    flex-direction: column; gap: 0; padding-bottom: 6px;
}
.mc-jbox-wrap {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    width: 78%; flex: 1;
}
.mc-jbox-lid {
    width: 100%; position: relative;
    transform-origin: bottom center;
    transition: transform .5s ease;
}
.mc-jbox-lid-top {
    background: var(--mc-primary, #7c3aed);
    border-radius: 4px 4px 0 0; padding-bottom: 28%;
    position: relative; overflow: hidden;
    box-shadow: 0 -2px 8px rgba(0,0,0,.4);
}
.mc-jbox-lid-top::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.25) 0%, transparent 60%);
}
.mc-jbox-ribbon-h {
    position: absolute; top: 50%; left: 0; right: 0;
    height: 14%; transform: translateY(-50%);
    background: rgba(255,255,255,.35);
}
.mc-jbox-ribbon-v {
    position: absolute; left: 50%; top: 0; bottom: 0;
    width: 14%; transform: translateX(-50%);
    background: rgba(255,255,255,.35);
}
.mc-jbox-bow {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    font-size: clamp(12px, 3.5vw, 20px); z-index: 2; line-height: 1;
}
.mc-jbox-lid-front {
    height: 10px; background: var(--mc-primary-dark, #5b21b6);
}
.mc-jbox-base {
    width: 100%;
    background: linear-gradient(160deg, #c8a050, #e8c870, #c8a050);
    border-radius: 0 0 3px 3px; padding-bottom: 45%;
    position: relative; overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,.3);
}
.mc-jbox-shine {
    position: absolute; top: 8%; left: 10%; width: 28%; height: 18%;
    background: rgba(255,255,255,.35); border-radius: 50%;
    transform: rotate(-20deg);
}
.mc-jbox-label {
    color: rgba(255,255,255,.5);
    font-size: 8px; text-transform: uppercase; letter-spacing: 1.5px; margin-top: 3px;
}
/* Lid open animation — JS adds .mc-box-opening */
.mc-triple-card.mc-box-opening .mc-jbox-lid {
    transform: rotateX(-115deg);
}

/* ── Scratch mode — no flip needed ── */
.mc-triple-card.mc-scratch-mode .mc-card-front { display: none; }
.mc-triple-card.mc-scratch-mode .mc-card-back  { opacity: 1; z-index: 1; }

/* ── Account modal context ── */
.mc-scratch-area .mc-triple-grid { width: 100%; box-sizing: border-box; }
.mc-scratch-area .mc-triple-card { min-height: 130px; }

/* ── Glow for jewelry ── */
@keyframes mc-jewelry-glow {
    0%,100% { box-shadow: 0 4px 16px rgba(0,0,0,.15); }
    50%      { box-shadow: 0 8px 28px rgba(191,108,0,.4); }
}
.mc-triple-card.mc-jewelry-card.mc-pulse {
    animation: mc-jewelry-glow 1.5s ease-in-out infinite;
}
