.gift-flower-trigger { position:absolute;z-index:10;right:0;bottom:12%;width:min(580px,43vw);height:58%;border:0;background:none;padding:0;cursor:pointer; }
.gift-flower-trigger:focus-visible { outline:2px solid #9b6b32;outline-offset:-10px;border-radius:45%; }
.gift-flower-glint { position:absolute;left:48%;top:39%;width:42px;aspect-ratio:1;border-radius:50%;background:radial-gradient(circle,#fffef3 0 8%,#f6ce76c9 14%,#e9b95f59 42%,transparent 70%);box-shadow:0 0 20px #f4cc7977;animation:gift-glint-in .7s ease-out both; }
@keyframes gift-glint-in { from { opacity:0;transform:scale(.5); } to { opacity:1;transform:scale(1); } }
.gift-touch-mark { position:absolute;left:57%;top:43%;display:grid;place-items:center;width:32px;height:32px;border:1px solid #d0a666a8;border-radius:50%;background:#fffaf0e8;color:#ae7c36;box-shadow:0 4px 14px #82653c25; }
.gift-touch-mark svg { width:18px;height:18px; }
.gift-hint { position:absolute;z-index:11;left:69%;bottom:95px;width:min(380px,40vw);margin:0;transform:translateX(-50%);padding:8px 13px;border:1px solid #d7b985a8;border-radius:20px;background:#fffaf0e8;box-shadow:0 5px 17px #674c2521;text-align:center;font-size:clamp(15px,1.45vw,19px);color:#654932;pointer-events:none;animation:gift-hint-in .6s ease-out both; }
@keyframes gift-hint-in { from { opacity:0;translate:0 8px; } to { opacity:1;translate:0 0; } }

.scene-gift { background:radial-gradient(ellipse at 50% 42%,#fffef8 0%,#fff6e5 60%,#f0e3ce 100%); }
body[data-stage="gift"] .paper-grain { display:none; }
.gift-scene-glow { position:absolute;left:50%;top:55%;width:min(780px,86vw);height:65%;transform:translate(-50%,-50%);border-radius:50%;background:radial-gradient(ellipse,#f8dda272 0%,#f5d7a42e 42%,transparent 73%);pointer-events:none; }
.gift-phrase { position:absolute;z-index:8;left:50%;top:11%;width:min(760px,calc(100% - 32px));margin:0;transform:translate(-50%,9px);opacity:0;text-align:center;text-wrap:balance;font-size:clamp(35px,4vw,57px);line-height:1.14;letter-spacing:-.045em;color:#55402f;transition:opacity .45s ease,transform .6s var(--ease); }
.gift-phrase.is-visible { opacity:1;transform:translate(-50%,0); }
.gift-flower { position:absolute;z-index:1;right:4%;top:31%;width:min(425px,36vw);height:auto;opacity:.74;transform:scale(1.07) rotate(2deg);transform-origin:60% 65%;filter:drop-shadow(7px 12px 11px #6b4c3826);transition:opacity 1s ease,transform 1.1s var(--ease);pointer-events:none; }
.scene-gift.has-second .gift-flower { opacity:.47;transform:scale(.98) rotate(0); }
.scene-gift.is-opened .gift-flower { opacity:.28; }
.gift-envelope-place { position:absolute;z-index:5;left:66%;top:64%;opacity:0;transform:translate(-50%,-35%) scale(.78);transition:left 1s var(--ease),top 1s var(--ease),transform 1s var(--ease),opacity .7s ease; }
.scene-gift.is-revealed .gift-envelope-place { opacity:1;transform:translate(-50%,-50%) scale(.92); }
.scene-gift.has-second .gift-envelope-place { left:50%;top:59%;transform:translate(-50%,-50%) scale(1); }
.scene-gift.is-opened .gift-envelope-place { top:60%; }
.gift-envelope { position:relative;width:clamp(250px,28vw,360px);aspect-ratio:1.5;filter:drop-shadow(0 13px 18px #74543839); }
.gift-envelope-back { position:absolute;inset:0;z-index:1;background:linear-gradient(140deg,#f0dec4,#e9cda8);clip-path:polygon(0 4%,50% 0,100% 4%,100% 100%,0 100%);border-radius:4px; }
.gift-envelope-back::after,.gift-envelope-front::after,.gift-envelope-flap::after { content:"";position:absolute;inset:0;background-image:radial-gradient(#896a472b .5px,transparent .8px);background-size:8px 9px;opacity:.38;pointer-events:none; }
.gift-card { position:absolute;z-index:2;left:14%;top:0;width:72%;height:100%;padding:11px;background:#fff;box-shadow:0 3px 12px #634d3e3b;border:1px solid #e6ded0;border-radius:3px;opacity:0;transition:top 1s var(--ease),opacity .28s ease;pointer-events:none; }
.scene-gift.is-opened .gift-card { top:-82%;opacity:1;pointer-events:auto; }
.gift-qr-touch { display:grid;place-items:center;width:100%;height:100%;margin:0;padding:0;border:0;background:#fff;cursor:zoom-in; }
.gift-qr-touch img { display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;filter:none; }
.gift-empty { display:grid;place-items:center;width:100%;height:100%;margin:0;padding:7px;background:#fff;text-align:center;font-size:clamp(13px,1.4vw,17px);line-height:1.3;color:#735f4b; }
.gift-envelope-front { position:absolute;z-index:3;left:0;right:0;bottom:0;height:79%;background:linear-gradient(165deg,#f5e6d0 0%,#ead3b4 70%,#e2c6a4 100%);clip-path:polygon(0 0,50% 44%,100% 0,100% 100%,0 100%);border-radius:0 0 5px 5px; }
.gift-envelope-front::before { content:"";position:absolute;left:0;right:0;top:0;height:100%;background:linear-gradient(137deg,transparent 49.6%,#ba987245 50%,transparent 50.4%),linear-gradient(223deg,transparent 49.6%,#ba987245 50%,transparent 50.4%);opacity:.8; }
.gift-envelope-flap { position:absolute;z-index:4;left:0;top:0;width:100%;height:60%;background:linear-gradient(180deg,#f6e6cd,#e8cfaa);clip-path:polygon(0 0,100% 0,50% 100%);transform-origin:center top;transition:transform .75s var(--ease);box-shadow:0 2px 4px #775b4029; }
.scene-gift.is-opened .gift-envelope-flap { transform:rotateX(180deg);z-index:1; }
.gift-primary-button { min-height:43px;padding:8px 26px;border:1px solid #745437;border-radius:99px;background:#6c4d37;color:#fffaf0;box-shadow:0 6px 17px #62462f30;font-size:18px; }
.gift-primary-button:hover { background:#79583e; }
.gift-open-button { position:absolute;z-index:9;left:50%;bottom:max(38px,env(safe-area-inset-bottom));transform:translateX(-50%); }
.gift-details { position:absolute;z-index:9;left:50%;bottom:max(20px,env(safe-area-inset-bottom));width:min(790px,calc(100% - 28px));transform:translateX(-50%);text-align:center; }
.gift-help,.gift-daily,.gift-load-status { margin:0 0 6px;font-size:15px;line-height:1.26; }
.gift-daily { color:#765637;font-size:14px; }
.gift-load-status { color:#96563f; }
.gift-actions { display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px;margin-top:13px; }
.gift-actions button,.gift-actions a,.gift-update-offer button,.gift-qr-overlay-top button,.gift-qr-overlay-bottom > a { display:inline-flex;align-items:center;justify-content:center;min-height:39px;padding:7px 13px;border:1px solid #b69770;border-radius:99px;background:#fffaf1;color:#584230;text-decoration:none;box-shadow:0 3px 10px #7053371c;font-size:15px;line-height:1.15; }
.gift-actions button:hover,.gift-actions a:hover,.gift-update-offer button:hover,.gift-qr-overlay-top button:hover,.gift-qr-overlay-bottom > a:hover { background:#fff; }
.gift-save-fallback { margin:11px 0 0;font-size:13px;line-height:1.3;color:#735e4d; }
.gift-save-fallback a,.gift-qr-overlay-bottom p a { color:#86533d;text-decoration:underline; }
.gift-update-offer { display:flex;align-items:center;justify-content:center;gap:10px;margin:8px auto 0;color:#674932;font-size:14px; }
.gift-update-offer button { min-height:32px;padding:4px 10px;font-size:13px; }
body[data-stage="gift"] .bee { left:70%;top:52%;transform:translate(-50%,-50%) scale(.45) rotate(-4deg); }
body[data-stage="gift"] .scene-gift.has-second ~ .bee { left:76%;top:54%; }
body[data-stage="gift"] .scene-gift.is-opened ~ .bee { left:78%;top:54%; }

.gift-qr-overlay { position:absolute;z-index:90;inset:0;display:flex;flex-direction:column;align-items:center;gap:9px;padding:max(12px,env(safe-area-inset-top)) 14px max(12px,env(safe-area-inset-bottom));background:#fffefb;overflow-y:auto; }
.gift-qr-overlay-top { display:flex;justify-content:flex-end;width:100%;max-width:850px;flex:none; }
.gift-qr-overlay-top button { min-height:36px; }
.gift-qr-large { display:block;flex:1 1 auto;min-height:0;width:min(90vw,650px);max-height:calc(100dvh - 195px);object-fit:contain;background:#fff;filter:none; }
.gift-qr-overlay-bottom { flex:none;text-align:center;max-width:760px; }
.gift-qr-overlay-bottom p { margin:4px 0;font-size:14px;line-height:1.25;color:#654f3b; }
.gift-qr-overlay-bottom > a { margin-top:9px; }

@media (max-width:700px) {
  .gift-flower-trigger { right:-12%;bottom:22%;width:110vw;height:45%; }
  .gift-flower-glint { left:47%;top:37%; }
  .gift-touch-mark { left:56%;top:42%; }
  .gift-hint { left:50%;bottom:73px;width:calc(100% - 32px);font-size:14px; }
  .gift-phrase { top:12%;font-size:clamp(29px,8vw,40px); }
  .gift-flower { top:34%;right:-15%;width:75vw; }
  .gift-envelope-place { left:65%;top:61%; }
  .scene-gift.has-second .gift-envelope-place { top:60%; }
  .gift-envelope { width:clamp(228px,72vw,270px); }
  .gift-card { padding:9px; }
  .gift-details { bottom:max(12px,env(safe-area-inset-bottom)); }
  .gift-help,.gift-daily { font-size:12px;margin-bottom:4px; }
  .gift-actions { gap:6px;margin-top:8px; }
  .gift-actions button,.gift-actions a { min-height:35px;padding:6px 10px;font-size:12px; }
  .gift-save-fallback { margin-top:7px;font-size:11px; }
  body[data-stage="gift"] .bee { left:71%;top:49%;transform:translate(-50%,-50%) scale(.35) rotate(-4deg); }
  body[data-stage="gift"] .scene-gift.has-second ~ .bee { left:86%;top:52%; }
  body[data-stage="gift"] .scene-gift.is-opened ~ .bee { left:88%;top:51%; }
  .gift-qr-overlay { gap:7px;padding-left:10px;padding-right:10px; }
  .gift-qr-large { width:calc(100vw - 20px);max-height:calc(100dvh - 210px); }
  .gift-qr-overlay-bottom p { font-size:12px; }
}
@media (max-width:375px) and (max-height:640px) {
  .gift-phrase { top:11%;font-size:27px; }
  .scene-gift.is-opened .gift-envelope-place { top:59%; }
  .gift-details { position:relative;left:auto;bottom:auto;width:calc(100% - 20px);transform:none;margin:414px auto 16px; }
  .scene-gift.is-opened { overflow-y:auto; }
  .gift-scene-glow { height:420px; }
  .gift-qr-large { max-height:calc(100dvh - 195px); }
}
@media (prefers-reduced-motion:reduce) {
  .gift-flower-glint,.gift-hint { animation:none; }
  .gift-phrase,.gift-envelope-place,.gift-card,.gift-envelope-flap,.gift-flower { transition-duration:.001ms; }
}
