/* ============================================================================
   Lucky Chest — homepage-only interactive reward widget
   Ported from the approved prototype. Self-contained, no dependencies.
   All classes namespaced .lcw- to avoid collisions with theme styles.
   ========================================================================== */
.lcw-root{
  --gold:#E8C25A; --gold-hi:#FBE9A8; --gold-deep:#B8862B;
  position:fixed; inset:0; z-index:99990; pointer-events:none;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.lcw-root *{ box-sizing:border-box; }

/* chest — fixed bottom-right */
.lcw-chest{
  position:fixed; right:22px; bottom:18px; width:132px; height:104px; cursor:pointer;
  pointer-events:auto;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,.5)) drop-shadow(0 0 10px rgba(232,194,90,.28));
  transition: transform 720ms cubic-bezier(.5,.05,.2,1), filter .3s ease;
  z-index:99992; -webkit-tap-highlight-color:transparent; touch-action:manipulation;
  perspective:700px; animation:lcw-breathe 3.4s ease-in-out infinite;
}
.lcw-chest:hover{ filter:drop-shadow(0 0 20px rgba(255,214,90,.75)) drop-shadow(0 8px 16px rgba(0,0,0,.5)); transform:translateY(-3px) scale(1.04); }
.lcw-chest.lcw-shake{ animation:lcw-shake .8s cubic-bezier(.36,.07,.19,.97) !important; }
.lcw-chest.lcw-tapped{ animation:lcw-tap .26s ease !important; }
.lcw-chest.lcw-center{
  transform: translate(calc(-50vw + 22px + 50%), calc(50% + 18px - 50vh)) scale(1.9);
  cursor:default;
}
.lcw-chest svg{ width:100%; height:100%; display:block; }

@media (max-width:640px){
  .lcw-chest{ width:104px; height:82px; right:14px; bottom:12px; }
  .lcw-chest.lcw-center{ transform: translate(calc(-50vw + 14px + 50%), calc(50% + 12px - 50vh)) scale(1.5); }
}

/* progress ring */
.lcw-ring{position:fixed; right:22px; bottom:18px; width:132px; height:104px; pointer-events:none; z-index:99991;}
@media (max-width:640px){ .lcw-ring{ width:104px; height:82px; right:14px; bottom:12px; } }
.lcw-ring svg{position:absolute; inset:0; width:100%; height:100%;}

/* celebration overlay */
.lcw-overlay{position:fixed; inset:0; pointer-events:none; z-index:99991; overflow:hidden;}
.lcw-p{position:absolute; top:-8%; will-change:transform,opacity;}
.lcw-coin{border-radius:50%;
  background:radial-gradient(circle at 34% 30%, #FFF7CE 0%, #F4CB55 42%, #D19E33 78%, #A5761F 100%);
  box-shadow:0 0 7px rgba(244,203,85,.75), inset 0 0 0 1px rgba(154,108,28,.6), inset 2px 3px 4px rgba(255,248,216,.6);
  position:relative;}
.lcw-coin::after{content:"$"; position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  font:800 60% Georgia,serif; color:rgba(154,108,28,.85);}
.lcw-diamond{background:linear-gradient(135deg,#BDF0FF,#7EC8E3); transform:rotate(45deg);
  box-shadow:0 0 8px rgba(126,200,227,.8);}
.lcw-confetti{border-radius:2px;}
.lcw-spark{border-radius:50%; box-shadow:0 0 8px 2px currentColor;}

/* burst flash + rays */
.lcw-flash{position:fixed; inset:0; z-index:99991; pointer-events:none;
  background:radial-gradient(circle at 88% 86%, rgba(255,247,214,.95), rgba(255,214,90,.4) 22%, transparent 46%);
  animation:lcw-flash .55s ease-out forwards;}
.lcw-rays{position:fixed; right:72px; bottom:60px; width:520px; height:520px; z-index:99991;
  transform:translate(50%,50%); pointer-events:none; mix-blend-mode:screen;
  background:repeating-conic-gradient(from 0deg at 50% 50%,
    rgba(255,236,160,.5) 0deg, rgba(255,236,160,.5) 5deg, transparent 5deg, transparent 18deg);
  -webkit-mask:radial-gradient(circle, #000 0%, #000 18%, transparent 62%);
  mask:radial-gradient(circle, #000 0%, #000 18%, transparent 62%);
  animation:lcw-rays 3s linear forwards;}
@media (max-width:640px){ .lcw-rays{ right:52px; bottom:44px; width:360px; height:360px; } }

/* modal */
.lcw-scrim{position:fixed; inset:0; z-index:99995; display:grid; place-items:center; padding:20px;
  background:rgba(8,4,16,.72); backdrop-filter:blur(4px); animation:lcw-fade .3s ease; pointer-events:auto;}
.lcw-modal{position:relative; width:100%; max-width:420px; text-align:center; color:#EDE7F6;
  background:linear-gradient(160deg,#221436,#160c26); border:1px solid rgba(232,194,90,.5);
  border-radius:20px; padding:34px 28px 30px; box-shadow:0 30px 80px rgba(0,0,0,.6),0 0 0 1px rgba(255,255,255,.03) inset;
  animation:lcw-rise .45s cubic-bezier(.34,1.56,.64,1);}
.lcw-badge{width:64px; height:64px; margin:-58px auto 8px; border-radius:50%;
  background:radial-gradient(circle at 34% 30%,#FBE9A8,#E8C25A 60%,#B8862B);
  display:grid; place-items:center; font-size:30px; box-shadow:0 10px 26px rgba(232,194,90,.5);}
.lcw-kicker{font-size:12px; letter-spacing:.28em; text-transform:uppercase; color:var(--gold);}
.lcw-offer{font-size:26px; font-weight:800; margin:10px 0 2px; line-height:1.15; color:var(--gold);}
.lcw-casino{color:#C9BFE0; font-size:15px; margin-bottom:22px;}
.lcw-cta{display:inline-block; width:100%; padding:14px 20px; border:none; cursor:pointer;
  border-radius:12px; font-weight:800; font-size:15px; color:#2A1A06; text-decoration:none;
  background:linear-gradient(180deg,#FBE9A8,#E8C25A); box-shadow:0 8px 22px rgba(232,194,90,.4);
  transition:transform .12s ease, box-shadow .2s ease;}
.lcw-cta:hover{ transform:translateY(-1px); box-shadow:0 12px 28px rgba(232,194,90,.55); }
.lcw-again{margin-top:12px; background:none; border:none; color:#9C90C0; font-size:13px; cursor:pointer;
  text-decoration:underline; text-underline-offset:3px;}
.lcw-again:hover{ color:#EDE7F6; }
.lcw-terms{margin-top:14px; font-size:11px; color:#7C7196; line-height:1.5;}
.lcw-close{position:absolute; top:12px; right:14px; background:none; border:none; color:#8478a4;
  font-size:20px; cursor:pointer; line-height:1;}
.lcw-close:hover{ color:#EDE7F6; }

/* keyframes */
@keyframes lcw-breathe{ 0%,100%{transform:translateY(0) scale(1);} 50%{transform:translateY(-2px) scale(1.015);} }
@keyframes lcw-shake{ 10%,90%{transform:translateX(-1px) rotate(-2deg);} 20%,80%{transform:translateX(2px) rotate(3deg);}
  30%,50%,70%{transform:translateX(-4px) rotate(-4deg);} 40%,60%{transform:translateX(4px) rotate(4deg);} 100%{transform:none;} }
@keyframes lcw-tap{ 0%{transform:scale(1);} 40%{transform:scale(1.14) translateY(-4px);} 100%{transform:scale(1);} }
@keyframes lcw-fade{ from{opacity:0;} to{opacity:1;} }
@keyframes lcw-flash{ from{opacity:1;} to{opacity:0;} }
@keyframes lcw-rays{ 0%{opacity:0; transform:translate(50%,50%) scale(.4) rotate(0deg);}
  14%{opacity:.9;} 100%{opacity:0; transform:translate(50%,50%) scale(1.15) rotate(90deg);} }
@keyframes lcw-rise{ from{opacity:0; transform:translateY(26px) scale(.94);} to{opacity:1; transform:none;} }
@keyframes lcw-fall{ 0%{opacity:0; transform:translateY(-20px) translateX(0) rotate(0);}
  8%{opacity:1;} 90%{opacity:1;} 100%{opacity:0; transform:translateY(105vh) translateX(var(--drift)) rotate(var(--rot));} }

@media (prefers-reduced-motion: reduce){
  .lcw-chest{animation:none !important;}
  .lcw-rays,.lcw-overlay{display:none !important;}
}
