/* ============ mừng cưới (gift.js): hộp quà 3D bấm mở → bảng QR ============
   Nằm trên giấy kem (lá thư, bảng trượt): canvas trong suốt, bóng hộp vẽ trong cảnh. Ảnh tĩnh nằm dưới canvas làm
   ảnh chờ / dự phòng không WebGL. */
.gift { display: grid; justify-items: center; }
.gift-box { position: relative; display: block; width: min(100%, 520px); margin: 0 auto; padding: 0; border: 0; background: none; cursor: pointer;
  border-radius: 14px; -webkit-tap-highlight-color: transparent; }
.gift-box:focus-visible { outline: 2px solid var(--gold-ok, #E2B866); outline-offset: 4px; }
.gift.open .gift-box { cursor: default; }
.gift-stage { position: relative; display: block; width: 100%; aspect-ratio: 1 / .9; }
.gift-stage > img, .gift-stage > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.gift-still { object-fit: contain; transition: opacity .35s var(--ease, ease); }
.gift-gl { opacity: 0; transition: opacity .35s var(--ease, ease); }
.gift-stage.live .gift-gl { opacity: 1; }
.gift-stage.live .gift-still { opacity: 0; }
/* chữ gợi ý: viên thuốc nhỏ ngay dưới bóng hộp (không đè lên hộp), thở rất chậm */
.gift-hint { display: table; margin: -4px auto 4px; padding: 7px 16px; border-radius: 999px; white-space: nowrap;
  font: 500 14px/1.2 var(--font-ui); letter-spacing: .06em; color: var(--wine, #5E0B15);
  background: color-mix(in srgb, var(--paper, #FBF6EC) 82%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--wine, #5E0B15) 22%, transparent);
  animation: gift-hint 3.2s ease-in-out infinite; pointer-events: none; }
.gift-hint[hidden] { display: none; }
@keyframes gift-hint { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }

/* bảng QR: hiện lên sau khi nắp mở */
.gift-qr { width: 100%; margin-top: 6px; opacity: 0; transform: translateY(10px); transition: opacity .5s var(--ease, ease), transform .5s var(--ease, ease); }
.gift-qr.on { opacity: 1; transform: none; }
.gift-qr[hidden] { display: none; }
.gf-list { display: grid; gap: 16px; }
@media (min-width: 640px) { .gift-qr.two .gf-list { grid-template-columns: 1fr 1fr; } }
.gf { padding: 18px 16px 16px; text-align: center; background: #FFFDF8; border: 1px solid color-mix(in srgb, var(--gold-dark, #B39566) 45%, transparent);
  border-radius: 12px; box-shadow: 0 12px 26px -20px rgba(60,20,10,.5); outline: none; }
.gf:focus-visible { outline: 2px solid var(--gold-ok, #E2B866); outline-offset: 3px; }
.gf-who { margin: 0 0 12px; font: italic 400 22px/1.3 var(--font-display); color: var(--wine); }
.gf-qr { width: min(220px, 64vw); margin: 0 auto; padding: 10px; background: #fff; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.07); }
.gf-qr img { display: block; width: 100%; height: auto; }
.gf-sample { margin: 10px 0 0; font: 500 13px/1.4 var(--font-ui); color: var(--wine-hi); }
.gf-acc { margin: 14px 0 0; display: grid; gap: 6px; text-align: left; }
.gf-acc div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 6px; border-bottom: 1px dashed color-mix(in srgb, var(--line) 75%, transparent); }
.gf-acc dt { flex: none; font: 400 14px/1.4 var(--font-ui); color: var(--ink-muted); }
.gf-acc dd { margin: 0; min-width: 0; font: 500 17px/1.4 var(--font-body); color: var(--ink); text-align: right; overflow-wrap: anywhere; }
.gf-num { font-variant-numeric: tabular-nums; letter-spacing: .05em; }
.gf-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.gf-acts .btn { min-height: 46px; padding: 0 8px; font-size: 14.5px; }

@media (prefers-reduced-motion: reduce) {
  .gift-hint { animation: none; }
  .gift-qr, .gift-still, .gift-gl { transition: none; }
}
