/* Gift wrapping for the reveal card (the game app, the gift maker's preview and the homepage).
   A .wr layer sits inside a positioned, rounded parent; site/assets/wrap.js fills it. Colors come from the
   theme tokens, sizes from --wr-r (corner radius), --wr-tag, --wr-bow, --wr-band and --wr-seal.
   Calm unfolds and fades, 1.1-1.5 seconds. A Fingerprint Creative Inc. game. */
.wr{position:absolute;inset:0;border-radius:inherit;z-index:3;cursor:pointer;--wr-paper:color-mix(in srgb,var(--accent) 9%,var(--bg));--wr-deep:color-mix(in srgb,var(--accent) 20%,var(--bg));--r:var(--wr-r,28px)}
.wr[hidden]{display:none}
.wr>*{position:absolute;pointer-events:none}
.wr p.wr-tag{left:0;right:0;bottom:22%;margin:0 auto;width:max-content;max-width:80%;text-align:center;font-family:var(--font-display,var(--display));font-variation-settings:var(--dvar,'opsz' 72);font-size:var(--wr-tag,24px);line-height:1.2;color:var(--ink);z-index:2}
.wr-ribbon p.wr-tag,.wr-blanket p.wr-tag,.wr-paper-kind p.wr-tag{background:var(--bg);border:1px solid var(--edge);border-radius:12px;padding:.35em .8em;box-shadow:var(--raise-sm)}
@keyframes wr-out{to{opacity:0}}
@keyframes wr-shrink{to{opacity:0;transform:scale(.6)}}
@keyframes wr-slip-y{to{opacity:0;transform:translateY(14px)}}
@keyframes wr-slip-x{to{opacity:0;transform:translateX(14px)}}
@keyframes wr-flap{to{transform:rotateX(180deg)}}
@keyframes wr-drop{to{opacity:0;transform:translateY(24%)}}
@keyframes wr-open-l{to{opacity:0;transform:perspective(900px) rotateY(-100deg)}}
@keyframes wr-open-r{to{opacity:0;transform:perspective(900px) rotateY(100deg)}}
@keyframes wr-corner{to{opacity:0;transform:var(--fold)}}
@keyframes wr-fleck{0%{opacity:0;transform:translate(0,-8px) rotate(0)}20%{opacity:.9}100%{opacity:0;transform:translate(var(--dx),150px) rotate(var(--r))}}
@keyframes wr-quiet{from{opacity:0}to{opacity:1}}
/* ribbon: the bow loosens, the ribbon slips away, the paper fades, a few flecks drift down */
.wr-ribbon{overflow:hidden}
.wr-ribbon .wr-paper{inset:0;border-radius:inherit;background:var(--wr-paper);border:1px solid var(--edge);animation:wr-out .5s ease-out 1.1s both}
.wr-ribbon .wr-y{top:0;bottom:0;left:calc(50% - var(--wr-band,18px) / 2);width:var(--wr-band,18px);background:var(--accent);animation:wr-slip-y .45s ease-in .75s both}
.wr-ribbon .wr-x{left:0;right:0;top:calc(38% - var(--wr-band,18px) / 2);height:var(--wr-band,18px);background:var(--accent);animation:wr-slip-x .45s ease-in .75s both}
.wr-ribbon .wr-bow{left:calc(50% - var(--wr-bow,132px) / 2);top:calc(38% - var(--wr-bow,132px) * .38);width:var(--wr-bow,132px);height:calc(var(--wr-bow,132px) * .727);color:var(--accent);animation:wr-shrink .4s ease-in .5s both}
.wr-ribbon p.wr-tag{animation:wr-out .35s ease-out .45s both}
.wr-flecks{inset:0 0 auto;height:0;overflow:visible}
.wr-flecks i{position:absolute;top:0;width:7px;height:7px;border-radius:2px;background:var(--c);opacity:0;animation:wr-fleck 1.6s ease-out both}
/* envelope: the seal lifts, the flap opens, the envelope slips away */
.wr-envelope .wr-env,.wr-letter .wr-env{inset:0;border-radius:inherit;background:var(--wr-paper);border:1px solid var(--edge);animation:wr-drop .5s ease-in 1.25s both;perspective:900px}
.wr-flap{position:absolute;left:0;right:0;top:0;height:52%;transform-origin:top;animation:wr-flap .6s ease-in-out .7s both}
.wr-flap::before{content:"";position:absolute;inset:0;background:var(--wr-deep);clip-path:polygon(0 0,100% 0,50% 100%);border-radius:var(--r) var(--r) 0 0}
.wr-seal{left:calc(50% - var(--wr-seal,44px) / 2);top:calc(52% - var(--wr-seal,44px) * .55);width:var(--wr-seal,44px);height:var(--wr-seal,44px);border-radius:50%;background:var(--accent);box-shadow:inset 0 0 0 5px color-mix(in srgb,var(--accent) 70%,var(--bg));animation:wr-shrink .35s ease-in .45s both;z-index:2}
.wr-envelope p.wr-tag,.wr-letter p.wr-tag{animation:wr-out .3s ease-out .45s both}
.wr-letter .wr-flap::before{background:color-mix(in srgb,var(--ink) 7%,var(--bg))}
.wr-letter .wr-env{background:var(--bg)}
/* blanket: two soft knit halves open outward */
.wr-half{top:0;bottom:0;width:50%;background:repeating-linear-gradient(90deg,var(--wr-paper) 0 10px,var(--wr-deep) 10px 12px),var(--wr-paper);border:1px solid var(--edge);outline:1.5px dashed color-mix(in srgb,var(--accent) 45%,var(--bg));outline-offset:-12px}
.wr-l{left:0;border-radius:var(--r) 0 0 var(--r);transform-origin:left;animation:wr-open-l .8s ease-in-out .6s both}
.wr-r{right:0;border-radius:0 var(--r) var(--r) 0;transform-origin:right;animation:wr-open-r .8s ease-in-out .6s both}
.wr-blanket p.wr-tag{animation:wr-out .3s ease-out .4s both}
/* holiday paper: patterned paper folds back at the four corners */
.wr-q{width:50%;height:50%;background:radial-gradient(circle,var(--accent) 1.6px,transparent 2.2px) 0 0/20px 20px,repeating-linear-gradient(45deg,var(--wr-paper) 0 12px,var(--wr-deep) 12px 14px);animation:wr-corner .75s ease-in-out .6s both}
.wr-q1{left:0;top:0;border-radius:var(--r) 0 0 0;transform-origin:0 0;--fold:perspective(900px) rotate3d(1,-1,0,95deg)}
.wr-q2{right:0;top:0;border-radius:0 var(--r) 0 0;transform-origin:100% 0;--fold:perspective(900px) rotate3d(1,1,0,95deg)}
.wr-q3{left:0;bottom:0;border-radius:0 0 0 var(--r);transform-origin:0 100%;--fold:perspective(900px) rotate3d(-1,-1,0,95deg)}
.wr-q4{right:0;bottom:0;border-radius:0 0 var(--r) 0;transform-origin:100% 100%;--fold:perspective(900px) rotate3d(-1,1,0,95deg)}
.wr-paper-kind p.wr-tag{animation:wr-out .3s ease-out .4s both}
.wr-paused,.wr-paused *{animation-play-state:paused!important}
