/*
 * Mystery Offer – Scratch Modal
 * Prefix: mystery-
 */

/* ── Modal overlay & container ── */
.mystery-modal .mystery-overlay {
   background: rgba(0, 0, 0, 0.72);
   backdrop-filter: blur(4px);
   -webkit-backdrop-filter: blur(4px);
   z-index: 10000;
}

.mystery-modal .mystery-container {
   max-width: 420px;
   width: 92%;
   padding: 0;
   border-radius: 18px;
   overflow: hidden;
   background: #faf8f4;
   position: relative;
   box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

/* ── X close – matching newsletter modal style ── */
.mystery-modal .mystery-close {
   position: absolute;
   right: 16px;
   top: 16px;
   z-index: 20;
   background: #f8f6ef;
   border: 0;
   border-radius: 50%;
   width: 32px;
   height: 32px;
   display: flex;
   align-items: center;
   justify-content: center;
   cursor: pointer;
   font-size: 16px;
   transition: background 0.2s;
}

.mystery-modal .mystery-close:before {
   content: "\2715";
}

.mystery-modal .mystery-close:hover {
   background: #eae8e2;
}

/* ── Content area ── */
.mystery-modal .mystery-content {
   margin: 0;
   padding: 44px 32px 36px;
   text-align: center;
}

/* Logo */
.mystery-logo-wrap {
   margin-bottom: 28px;
}

.mystery-logo {
   max-width: 170px;
   height: auto;
   margin: 0 auto;
   display: block;
}

/* Title */
.mystery-title {
   font-size: 36px;
   font-weight: 900;
   letter-spacing: 0.04em;
   text-transform: uppercase;
   color: #111;
   margin: 0 0 8px;
   line-height: 1.1;
}

.mystery-subtitle {
   font-size: 15px;
   font-weight: 500;
   color: #555;
   margin: 0 0 28px;
}

/* ── Scratch card area ── */
.mystery-scratch-wrap {
   position: relative;
   width: 100%;
   max-width: 320px;
   margin: 0 auto;
   aspect-ratio: 1.6 / 1;
   border-radius: 14px;
   overflow: hidden;
   cursor: grab;
   -webkit-user-select: none;
   user-select: none;
   touch-action: none;
   box-shadow:
      0 4px 20px rgba(180, 140, 60, 0.25),
      inset 0 0 0 2px rgba(200, 170, 80, 0.3);
}

.mystery-scratch-wrap:active {
   cursor: grabbing;
}

/* Canvas sits on top */
#mystery-canvas {
   position: absolute;
   inset: 0;
   width: 100%;
   height: 100%;
   z-index: 5;
   border-radius: 14px;
   transition: opacity 0.4s ease;
}

#mystery-canvas.mystery-canvas--revealed {
   opacity: 0;
   pointer-events: none;
}

/* Reveal content behind canvas */
.mystery-reveal {
   position: absolute;
   inset: 0;
   display: flex;
   flex-direction: column;
   align-items: center;
   justify-content: center;
   gap: 4px;
   z-index: 1;
   background: linear-gradient(160deg, #fff9f0, #fff4e0, #fff9f0);
   padding: 20px;
}

.mystery-reveal__emoji {
   font-size: 42px;
   line-height: 1;
   margin-bottom: 4px;
   opacity: 0;
   transform: scale(0.3);
}

.mystery-reveal__emoji.mystery-emoji--animate {
   animation: mystery-gift-bounce 0.5s ease forwards;
}

.mystery-reveal__title {
   font-size: 18px;
   font-weight: 800;
   text-transform: uppercase;
   letter-spacing: 0.06em;
   color: #26692a;
   opacity: 0;
}

.mystery-reveal__title.mystery-text--animate {
   animation: mystery-fade-in 0.4s ease 0.2s forwards;
}

.mystery-reveal__headline {
   font-size: 32px;
   font-weight: 900;
   text-transform: uppercase;
   letter-spacing: 0.02em;
   color: #111;
   line-height: 1.1;
   opacity: 0;
}

.mystery-reveal__headline.mystery-text--animate {
   animation: mystery-fade-in 0.4s ease 0.35s forwards;
}

@keyframes mystery-gift-bounce {
   0% {
      transform: scale(0.3);
      opacity: 0;
   }

   50% {
      transform: scale(1.2);
   }

   100% {
      transform: scale(1);
      opacity: 1;
   }
}

@keyframes mystery-fade-in {
   from {
      opacity: 0;
      transform: translateY(8px);
   }

   to {
      opacity: 1;
      transform: translateY(0);
   }
}

/* ── Post-reveal section ── */
.mystery-post-reveal {
   margin-top: 24px;
   animation: mystery-fade-up 0.4s ease both;
}

@keyframes mystery-fade-up {
   from {
      opacity: 0;
      transform: translateY(12px);
   }

   to {
      opacity: 1;
      transform: translateY(0);
   }
}

.mystery-added-note {
   font-size: 14px;
   font-weight: 600;
   color: #26692a;
   margin: 0 0 18px;
   line-height: 1.4;
}

/* ── Claim button with bounce animation ── */
.mystery-claim-btn {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   gap: 8px;
   width: 100%;
   max-width: 320px;
   padding: 18px 32px;
   background: #111;
   color: #fff;
   font-size: 18px;
   font-weight: 800;
   letter-spacing: 0.08em;
   text-transform: uppercase;
   border: 2px solid #111;
   border-radius: 0;
   cursor: pointer;
   transition: background 0.2s, color 0.2s, transform 0.15s;
   animation: mystery-btn-bounce 1.2s ease-in-out infinite;
}

@keyframes mystery-btn-bounce {

   0%,
   100% {
      transform: translateY(0);
   }

   30% {
      transform: translateY(-8px);
   }

   50% {
      transform: translateY(0);
   }

   65% {
      transform: translateY(-4px);
   }

   80% {
      transform: translateY(0);
   }
}

.mystery-claim-btn:hover {
   background: #fff;
   color: #111;
   animation: none;
   transform: translateY(0);
}

.mystery-claim-btn:active {
   transform: scale(0.97);
   animation: none;
}

/* ── Confetti canvas ── */
.mystery-confetti-canvas {
   position: fixed;
   inset: 0;
   width: 100%;
   height: 100%;
   z-index: 100000;
   pointer-events: none;
   display: none;
}

.mystery-confetti-canvas.mystery-confetti--active {
   display: block;
}

/* ── Responsive ── */
@media (max-width: 480px) {
   .mystery-modal .mystery-container {
      width: 96%;
      border-radius: 14px;
   }

   .mystery-modal .mystery-content {
      padding: 36px 20px 28px;
   }

   .mystery-modal .mystery-close {
      right: 12px;
      top: 12px;
   }

   .mystery-title {
      font-size: 28px;
   }

   .mystery-subtitle {
      font-size: 14px;
      margin-bottom: 20px;
   }

   .mystery-reveal__headline {
      font-size: 26px;
   }

   .mystery-reveal__title {
      font-size: 15px;
   }

   .mystery-claim-btn {
      padding: 16px 24px;
      font-size: 16px;
   }

   .mystery-logo {
      max-width: 140px;
   }

   .mystery-logo-wrap {
      margin-bottom: 20px;
   }
}