/* The cookie is a letter: lift the flap, then reveal the message. */
.mini-body[data-screen="cookie"] .mini-shell{padding:0 0 calc(var(--nav-height) + var(--safe-bottom));min-height:var(--tg-height,100svh)}
.mini-body[data-screen="cookie"] .cookie-page{height:calc(var(--tg-height,100svh) - var(--nav-height) - var(--safe-bottom));min-height:calc(var(--tg-height,100svh) - var(--nav-height) - var(--safe-bottom))}
.cookie-page.opened .cookie-scene{min-height:var(--cookie-scene-min,250px)}
.cookie-page.opened .fortune-paper p{white-space:pre-line;overflow-wrap:anywhere}
.cookie-page.opened:not(.revealing) :is(.cookie-big,.envelope-flap,.envelope-pocket,.envelope-closed,.fortune-paper){animation:none!important}
.envelope-stack{position:absolute;inset:0;display:block;perspective:850px;filter:drop-shadow(0 20px 18px #101f8550)}
.envelope-stack img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none}
.envelope-open{opacity:0}
.envelope-flap{clip-path:inset(0 0 61% 0);transform-origin:50% 39%;backface-visibility:hidden}
.envelope-pocket{clip-path:inset(38% 0 0 0)}
.cookie-page.opened .cookie-big{transform:translateY(78px) scale(.85);pointer-events:none}
.cookie-page.opened .envelope-open{opacity:1}
.cookie-page.opened .envelope-closed{opacity:0}
.cookie-page.opened .fortune-paper{top:max(34%,calc(var(--cookie-letter-height,0px)/2 + 6px));border-radius:12px;padding:22px 24px 18px;transform:translateY(-50%) rotate(-2deg)}
.cookie-page.opened .fortune-paper p{font-size:var(--cookie-note-size,22px);line-height:1.32;margin:10px 0 17px}
.cookie-page.opened .cookie-orbit{opacity:.4}
@media(prefers-reduced-motion:no-preference){
 .cookie-page.opened .cookie-big{animation:envelope-settle 700ms var(--ease) both}
 .cookie-page.opened .envelope-flap{animation:envelope-unfold 550ms var(--ease) both}
 .cookie-page.opened .envelope-pocket{animation:envelope-pocket-in 220ms ease-out both}
 .cookie-page.opened .envelope-closed{animation:envelope-cover-out 230ms ease-out both}
 .cookie-page.opened .fortune-paper{animation:letter-emerge 750ms var(--ease) both}
}
@keyframes envelope-unfold{from{transform:rotateX(-170deg);opacity:0}35%{opacity:1}to{transform:rotateX(0);opacity:1}}
@keyframes envelope-pocket-in{from{opacity:0}to{opacity:1}}
@keyframes envelope-cover-out{from{opacity:1}to{opacity:0}}
@keyframes envelope-settle{from{transform:translateY(0) scale(1)}to{transform:translateY(78px) scale(.85)}}
@keyframes letter-emerge{0%,20%{opacity:0;transform:translateY(30%) rotate(0) scale(.7)}55%{opacity:1}100%{opacity:1;transform:translateY(-50%) rotate(-2deg) scale(1)}}
@media(max-height:700px){
 .cookie-page.opened .cookie-big{transform:translateY(53px) scale(.75)}
 .cookie-page.opened .fortune-paper{top:max(33%,calc(var(--cookie-letter-height,0px)/2 + 6px));padding:16px 20px 14px}
 .cookie-page.opened .fortune-paper p{font-size:var(--cookie-note-size,18px);margin:8px 0 13px}
 .cookie-page.opened .fortune-mark{font-size:17px}
 @keyframes envelope-settle{from{transform:translateY(0) scale(1)}to{transform:translateY(53px) scale(.75)}}
}
.mini-body[data-screen="cookie"] .cookie-page.compact-envelope{padding-top:calc(16px + var(--safe-top));padding-bottom:13px}
.cookie-page.compact-envelope .cookie-heading{margin-top:16px}
.cookie-page.compact-envelope .cookie-heading h1{font-size:35px}
.cookie-page.compact-envelope .cookie-heading p{margin-top:9px;font-size:12px}
.cookie-page.compact-envelope .fortune-paper{padding:16px 20px 14px}
.cookie-page.compact-envelope .fortune-paper p{margin:8px 0 13px}
.cookie-page.compact-envelope .fortune-mark{font-size:17px}
.cookie-page.compact-envelope .cookie-action .btn{min-height:52px;font-size:13px}
.cookie-page.compact-envelope .tiny-copy{margin-top:10px;font-size:10px}

/* Keep the full note, invitation and caption inside the Telegram viewport. */
.mini-body[data-screen="cookie"] .mini-shell{min-height:var(--cookie-viewport-height,var(--tg-height,100svh))}
.mini-body[data-screen="cookie"] .cookie-page.opened{display:grid;grid-template-rows:auto minmax(0,1fr) auto;justify-items:center;align-items:stretch;row-gap:12px;height:var(--cookie-page-height,calc(var(--tg-height,100svh) - var(--nav-height) - var(--safe-bottom)));min-height:0;padding:calc(16px + var(--safe-top)) 24px 14px}
.cookie-page.opened .cookie-heading{margin:0;align-self:start}
.cookie-page.opened .cookie-heading h1{font-size:36px}
.cookie-page.opened .cookie-heading p{font-size:12px;margin-top:8px}
.cookie-page.opened .cookie-scene{min-height:0;max-height:none;height:100%;align-self:stretch}
.cookie-page.opened .cookie-big{position:absolute;top:calc((100% - var(--cookie-envelope-tail,64px))/2 + var(--cookie-letter-height,200px)/2 + var(--cookie-envelope-tail,64px) - var(--cookie-art-height,200px));width:clamp(225px,75vw,340px);height:var(--cookie-art-height,200px);min-height:0;transform:none}
.cookie-page.opened .fortune-paper{top:calc((100% - var(--cookie-envelope-tail,64px))/2);padding:20px 22px 17px}
.cookie-page.opened .fortune-paper p{font-size:var(--cookie-note-size,20px);line-height:1.32;margin:10px 0 15px}
.cookie-page.opened .cookie-orbit{width:min(85%,330px)}
.cookie-page.opened .cookie-action{display:grid;justify-items:center;row-gap:10px;padding:0}
.cookie-page.opened .cookie-action>.claim-reward{min-height:44px}
.cookie-page.opened .cookie-action .reward-strip{display:inline-flex;align-items:center;gap:5px;margin:0;min-height:32px}
.cookie-page.opened .cookie-action .btn{min-height:48px;font-size:13px;padding:12px 17px;border-radius:15px}
.cookie-page.opened .cookie-action .tiny-copy{margin:0;font-size:11px;line-height:1.4}
.cookie-page.opened .cookie-action .tiny-copy span{display:block}
.mini-body[data-screen="cookie"] .cookie-page.opened.compact-envelope{padding-top:calc(12px + var(--safe-top));padding-bottom:10px;row-gap:10px}
.cookie-page.opened.compact-envelope .cookie-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.cookie-page.opened.compact-envelope .cookie-heading h1{font-size:27px;letter-spacing:-1px;white-space:nowrap}
.cookie-page.opened.compact-envelope .cookie-heading p{font-size:11px;line-height:1.3;margin:0;max-width:180px;text-align:right}
.cookie-page.opened.compact-envelope .fortune-paper{padding:15px 18px 13px}
.cookie-page.opened.compact-envelope .fortune-paper p{margin:8px 0 12px}
.cookie-page.opened.compact-envelope .fortune-mark{font-size:16px}
.cookie-page.opened.compact-envelope .cookie-action{grid-template-columns:112px minmax(0,1fr);align-items:center;gap:8px}
.cookie-page.opened.compact-envelope .cookie-action>:first-child{min-width:0;width:100%;margin:0;font-size:10px;padding:8px 6px;min-height:44px;justify-content:center}
.cookie-page.opened.compact-envelope .cookie-action .reward-strip .icon{width:14px;height:14px}
.cookie-page.opened.compact-envelope .cookie-action .btn{min-height:44px;padding:10px 12px;font-size:12px;border-radius:13px}
.cookie-page.opened.compact-envelope .cookie-action .tiny-copy{grid-column:1/-1}
.mini-body[data-screen="cookie"] .cookie-page.opened.short-envelope{padding-left:16px;padding-right:16px;padding-top:calc(8px + var(--safe-top));padding-bottom:8px;row-gap:8px}
.cookie-page.opened.short-envelope .cookie-heading h1{font-size:24px}
.cookie-page.opened.short-envelope .fortune-paper{padding:12px 16px 10px}
.cookie-page.opened.short-envelope .fortune-paper p{margin:6px 0 8px}
.cookie-page.opened.short-envelope .fortune-mark{font-size:13px}
.cookie-page.opened.short-envelope .fortune-sign{font-size:7px}
.cookie-page.opened.short-envelope .cookie-action{grid-template-columns:104px minmax(0,1fr)}
.cookie-page.opened.short-envelope .cookie-action .btn{padding:10px;font-size:11px}
.cookie-page.opened.short-envelope .cookie-spark{font-size:24px}
@keyframes envelope-settle{from{transform:translateY(-12px) scale(.95)}to{transform:none}}
