/* ==========================================================================
   AC Store Mall - Faith & Success Gift Box
   Self-contained modal: an animated gift box the visitor taps to open,
   revealing a declaration (confession) of faith and success.
   All selectors are prefixed .acgift- so nothing leaks into the app.
   ========================================================================== */

.acgift-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(16, 87, 60, 0.92), rgba(6, 24, 20, 0.96)),
    rgba(6, 24, 20, 0.95);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .35s ease;
  box-sizing: border-box;
  font-family: inherit;
}
.acgift-overlay[hidden] { display: none; }
.acgift-overlay.is-visible { opacity: 1; }
.acgift-overlay.is-closing { opacity: 0; }

.acgift-overlay *,
.acgift-overlay *::before,
.acgift-overlay *::after { box-sizing: border-box; }

/* --- Card / stage ------------------------------------------------------- */
.acgift-card {
  position: relative;
  width: min(440px, 100%);
  padding: 34px 24px 30px;
  border-radius: 26px;
  text-align: center;
  color: #eafff5;
  background: linear-gradient(180deg, rgba(18, 92, 66, 0.55), rgba(8, 40, 32, 0.65));
  border: 1px solid rgba(212, 175, 55, 0.35);
  box-shadow:
    0 0 0 1px rgba(212, 175, 55, 0.12),
    0 30px 80px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(24px) scale(.94);
  opacity: 0;
  animation: acgiftCardIn .5s cubic-bezier(.2, .9, .25, 1.15) forwards;
}
@keyframes acgiftCardIn {
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.acgift-glow {
  position: absolute;
  left: 50%;
  top: 34%;
  width: 340px;
  height: 340px;
  margin: -170px 0 0 -170px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 214, 102, 0.42), rgba(255, 214, 102, 0) 62%);
  opacity: 0;
  transform: scale(.4);
  transition: opacity .7s ease, transform .9s cubic-bezier(.2, .8, .2, 1);
}
.acgift-card.is-open .acgift-glow { opacity: 1; transform: scale(1.25); }

/* --- The gift box ------------------------------------------------------- */
.acgift-box {
  position: relative;
  width: 168px;
  height: 176px;
  margin: 6px auto 4px;
  cursor: pointer;
  transform-origin: 50% 100%;
  animation: acgiftWiggle 2.6s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
}
.acgift-box:focus-visible {
  outline: 3px solid rgba(255, 214, 102, 0.9);
  outline-offset: 8px;
  border-radius: 12px;
}
@keyframes acgiftWiggle {
  0%, 100% { transform: rotate(0deg); }
  45% { transform: rotate(0deg); }
  50% { transform: rotate(-3.5deg); }
  55% { transform: rotate(3.5deg); }
  60% { transform: rotate(-2.5deg); }
  65% { transform: rotate(2deg); }
  70% { transform: rotate(0deg); }
}

/* box body */
.acgift-body {
  position: absolute;
  left: 8px;
  bottom: 0;
  width: 152px;
  height: 118px;
  border-radius: 8px 8px 10px 10px;
  background: linear-gradient(160deg, #0f7a56 0%, #0a553d 55%, #073527 100%);
  box-shadow:
    inset 0 -14px 24px rgba(0, 0, 0, 0.35),
    inset 0 2px 0 rgba(255, 255, 255, 0.12),
    0 18px 34px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
/* lid */
.acgift-lid {
  position: absolute;
  left: 0;
  top: 34px;
  width: 168px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(160deg, #14a06f 0%, #0c6749 60%, #084330 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.18),
    inset 0 -6px 12px rgba(0, 0, 0, 0.3),
    0 10px 20px rgba(0, 0, 0, 0.4);
  transform-origin: 50% 100%;
  z-index: 3;
  transition: transform .75s cubic-bezier(.3, .8, .25, 1), opacity .6s ease;
}
/* ribbons */
.acgift-ribbon-v {
  position: absolute;
  left: 50%;
  top: 0;
  width: 26px;
  height: 100%;
  margin-left: -13px;
  background: linear-gradient(90deg, #b8860b, #ffd666 45%, #f4c542 55%, #976d0a);
  box-shadow: 0 0 8px rgba(255, 214, 102, 0.35);
  z-index: 4;
}
.acgift-ribbon-h {
  position: absolute;
  left: 0;
  top: 30px;
  width: 100%;
  height: 20px;
  background: linear-gradient(180deg, #b8860b, #ffd666 45%, #f4c542 55%, #976d0a);
  z-index: 2;
}
.acgift-body .acgift-ribbon-v { height: 100%; }
.acgift-lid .acgift-ribbon-v { top: -30px; height: 100px; }

/* bow */
.acgift-bow {
  position: absolute;
  left: 50%;
  top: -30px;
  width: 96px;
  height: 40px;
  margin-left: -48px;
  z-index: 5;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4));
}
.acgift-bow::before,
.acgift-bow::after {
  content: "";
  position: absolute;
  top: 0;
  width: 46px;
  height: 38px;
  background: radial-gradient(circle at 30% 30%, #ffe89a, #f4c542 45%, #c9971a 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  box-shadow: inset 0 -4px 8px rgba(120, 80, 0, 0.4);
}
.acgift-bow::before { left: 0; transform: rotate(-18deg); }
.acgift-bow::after { right: 0; transform: rotate(18deg); }

/* shine sweep */
.acgift-shine {
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  z-index: 6;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-18deg);
  animation: acgiftShine 3.4s ease-in-out infinite;
  pointer-events: none;
  border-radius: 12px;
}
@keyframes acgiftShine {
  0%, 55% { left: -40%; }
  85%, 100% { left: 120%; }
}

/* open state: lid flies off, body settles */
.acgift-card.is-open .acgift-box { animation: none; }
.acgift-card.is-open .acgift-lid {
  transform: translateY(-120px) rotate(-26deg);
  opacity: 0;
}
.acgift-card.is-open .acgift-body {
  transform: translateY(2px) scaleY(.97);
  transition: transform .5s ease;
}

/* light burst behind the box */
.acgift-burst {
  position: absolute;
  left: 50%;
  top: 40px;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: rgba(255, 236, 170, 0.95);
  box-shadow: 0 0 60px 30px rgba(255, 214, 102, 0.65);
  opacity: 0;
  transform: scale(.2);
  pointer-events: none;
  z-index: 1;
  transition: opacity .4s ease, transform .7s cubic-bezier(.2, .8, .2, 1);
}
.acgift-card.is-open .acgift-burst { opacity: 1; transform: scale(3.4); }

/* sparkles around the box */
.acgift-spark {
  position: absolute;
  width: 10px;
  height: 10px;
  background: radial-gradient(circle, #fff6c9, rgba(255, 214, 102, 0) 70%);
  opacity: 0;
  pointer-events: none;
  z-index: 6;
}
.acgift-card.is-open .acgift-spark { animation: acgiftSpark .9s ease-out forwards; }
.acgift-spark.s1 { top: 18px; left: -4px; animation-delay: .05s; }
.acgift-spark.s2 { top: 4px; right: 6px; animation-delay: .18s; }
.acgift-spark.s3 { bottom: 24px; left: 10px; animation-delay: .28s; }
.acgift-spark.s4 { bottom: 8px; right: -2px; animation-delay: .36s; }
@keyframes acgiftSpark {
  0% { opacity: 0; transform: scale(.3) translateY(0); }
  35% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.5) translateY(-28px); }
}

/* --- Confetti (spawned by JS) ------------------------------------------- */
.acgift-confetti {
  position: fixed;
  top: -14px;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 10001;
  will-change: transform, opacity;
  animation: acgiftFall linear forwards;
}
@keyframes acgiftFall {
  0% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0deg); }
  100% { opacity: 0; transform: translate3d(var(--drift, 0px), 105vh, 0) rotate(720deg); }
}

/* --- Hint --------------------------------------------------------------- */
.acgift-hint {
  margin: 14px 0 0;
  font-size: 15px;
  letter-spacing: .3px;
  color: #cdeede;
  animation: acgiftPulse 1.8s ease-in-out infinite;
}
.acgift-card.is-open .acgift-hint { display: none; }
@keyframes acgiftPulse {
  0%, 100% { opacity: .65; }
  50% { opacity: 1; }
}

/* --- Reveal (confession) ------------------------------------------------- */
.acgift-reveal {
  position: relative;
  margin-top: 6px;
  opacity: 0;
  transform: translateY(14px) scale(.96);
}
.acgift-reveal[hidden] { display: none; }
.acgift-reveal.is-shown {
  animation: acgiftRevealIn .6s cubic-bezier(.2, .9, .25, 1.1) forwards;
}
@keyframes acgiftRevealIn {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.acgift-title {
  margin: 2px 0 6px;
  font-size: 21px;
  line-height: 1.25;
  color: #ffe08a;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
.acgift-lead {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #9fd9c1;
}

.acgift-confession {
  margin: 0 auto 18px;
  max-width: 360px;
  padding: 16px 18px;
  border-radius: 14px;
  font-size: 16px;
  line-height: 1.65;
  font-style: italic;
  color: #f4fffb;
  background: rgba(2, 22, 16, 0.45);
  border-left: 4px solid #d4af37;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.acgift-amen {
  appearance: none;
  border: none;
  cursor: pointer;
  padding: 14px 46px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #06301f;
  background: linear-gradient(180deg, #ffe89a, #f4c542 60%, #d9a81f);
  box-shadow: 0 10px 24px rgba(244, 197, 66, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: transform .15s ease, box-shadow .25s ease, filter .2s ease;
}
.acgift-amen:hover { transform: translateY(-2px); box-shadow: 0 16px 30px rgba(244, 197, 102, 0.55); }
.acgift-amen:active { transform: translateY(0) scale(.97); }
.acgift-amen:focus-visible { outline: 3px solid rgba(255, 255, 255, 0.85); outline-offset: 3px; }

.acgift-foot {
  margin: 12px 0 0;
  font-size: 12px;
  color: #9fd9c1;
}

/* --- Close button ------------------------------------------------------- */
.acgift-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  color: #eafff5;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.acgift-close:hover { background: rgba(255, 255, 255, 0.22); transform: rotate(90deg); }
.acgift-close:focus-visible { outline: 3px solid rgba(255, 214, 102, 0.9); outline-offset: 2px; }

/* --- Motion preferences ------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .acgift-box { animation: none; }
  .acgift-shine { animation: none; display: none; }
  .acgift-card,
  .acgift-reveal.is-shown { animation-duration: .01ms; }
  .acgift-card.is-open .acgift-lid { transition-duration: .2s; }
}

@media (max-width: 420px) {
  .acgift-card { padding: 26px 16px 24px; }
  .acgift-confession { font-size: 15px; }
}
