.tg-gift-stage { --terra:#b45309; --terra-deep:#9a4a08; --terra-soft:#c2703e; --sand:#e8d3ae; --teal-soft:#4f7d7c; --ink:#2d2a26; --muted:#6b6560; }
  .tg-gift-stage{
    position:relative; width:min(560px,94vw); height:520px; margin:10px auto 0;
    perspective:1000px; cursor:pointer; outline:none;
  }
  .tg-gift-shadow{
    position:absolute; left:50%; bottom:96px; width:230px; height:28px; margin-left:-115px;
    background:rgba(0,0,0,.18); border-radius:50%; filter:blur(7px); z-index:0;
  }
  .tg-gift-tilt{
    position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
    transform-style:preserve-3d; transition:transform .18s ease-out; z-index:1;
  }
  .tg-gift-gift{
    position:relative; width:200px; height:200px; transform-style:preserve-3d;
    animation:tgGiftFloat 3.2s ease-in-out infinite;
  }
  @keyframes tgGiftFloat{
    0%,100%{transform:rotateX(-16deg) rotateY(30deg) translateY(0)}
    50%{transform:rotateX(-16deg) rotateY(38deg) translateY(-12px)}
  }

  /* ---------- Thân hộp (khối 180) ---------- */
  .tg-gift-box{position:absolute; left:50%; top:50%; width:180px; height:180px; margin:-90px 0 0 -90px; transform-style:preserve-3d}
  .tg-gift-face{position:absolute; left:0; top:0; width:180px; height:180px; border:1px solid rgba(0,0,0,.08)}
  .tg-gift-face.tg-gift-front{background:linear-gradient(160deg,#e8d3ae,#dcc191); transform:translateZ(90px)}
  .tg-gift-face.tg-gift-back{background:#c9ab7e; transform:rotateY(180deg) translateZ(90px)}
  .tg-gift-face.tg-gift-right{background:#d4b98c; transform:rotateY(90deg) translateZ(90px)}
  .tg-gift-face.tg-gift-left{background:#cbb083; transform:rotateY(-90deg) translateZ(90px)}
  .tg-gift-face.tg-gift-bottom{background:#b39a72; transform:rotateX(-90deg) translateZ(90px)}
  .tg-gift-ribbon-v{
    position:absolute; left:50%; top:0; width:40px; height:100%; margin-left:-20px;
    background:linear-gradient(90deg,var(--terra-deep),var(--terra) 45%,var(--terra-soft));
  }

  /* ---------- Nắp hộp (khối 200 x 50 x 200) ---------- */
  .tg-gift-lid{
    position:absolute; left:50%; top:50%; width:200px; height:50px; margin:-25px 0 0 -100px;
    transform:translateY(-115px); transform-style:preserve-3d;
    transition:transform .9s cubic-bezier(.2,.7,.3,1.25), opacity .6s ease .25s;
  }
  .tg-gift-lid-face{position:absolute; border:1px solid rgba(0,0,0,.08)}
  .tg-gift-lid-face.tg-gift-front,.tg-gift-lid-face.tg-gift-back{width:200px; height:50px; left:0; top:0}
  .tg-gift-lid-face.tg-gift-front{background:linear-gradient(160deg,#e2c69e,#d4b98c); transform:translateZ(100px)}
  .tg-gift-lid-face.tg-gift-back{background:#c9ab7e; transform:rotateY(180deg) translateZ(100px)}
  .tg-gift-lid-face.tg-gift-right,.tg-gift-lid-face.tg-gift-left{width:200px; height:50px; left:0; top:0}
  .tg-gift-lid-face.tg-gift-right{background:#d4b98c; transform:rotateY(90deg) translateZ(100px)}
  .tg-gift-lid-face.tg-gift-left{background:#cbb083; transform:rotateY(-90deg) translateZ(100px)}
  .tg-gift-lid-face.tg-gift-top,.tg-gift-lid-face.tg-gift-bottom{width:200px; height:200px; left:0; top:-75px}
  .tg-gift-lid-face.tg-gift-top{background:linear-gradient(160deg,#ecd6b4,#dcc191); transform:rotateX(90deg) translateZ(25px)}
  .tg-gift-lid-face.tg-gift-bottom{background:#c9ab7e; transform:rotateX(-90deg) translateZ(25px)}
  .tg-gift-lid-face.tg-gift-top .tg-gift-ribbon-h{
    position:absolute; left:0; top:50%; width:100%; height:40px; margin-top:-20px;
    background:linear-gradient(180deg,var(--terra-deep),var(--terra) 45%,var(--terra-soft));
  }
  .tg-gift-bow{position:absolute; left:50%; top:50%; width:70px; height:44px; margin:-22px 0 0 -35px}
  .tg-gift-bow i{position:absolute; top:6px; width:30px; height:24px; border:5px solid var(--terra-deep); border-radius:50%; background:rgba(180,83,9,.25)}
  .tg-gift-bow i:first-child{left:2px; transform:rotate(-28deg)}
  .tg-gift-bow i:nth-child(2){right:2px; transform:rotate(28deg)}
  .tg-gift-bow b{position:absolute; left:50%; top:50%; width:16px; height:16px; margin:-8px 0 0 -8px; background:var(--terra); border-radius:50%; box-shadow:0 1px 2px rgba(0,0,0,.25)}

  /* Trạng thái mở: nắp bay lên + mờ dần */
  .tg-gift-stage.is-open .tg-gift-lid{transform:translateY(-280px) rotateZ(20deg) rotateX(-30deg); opacity:0}

  /* ---------- Thẻ voucher bay lên ---------- */
  .tg-gift-voucher{
    position:absolute; left:50%; top:50%; width:240px; max-width:86vw; z-index:5;
    padding:18px 16px 16px; background:#fff; border-radius:16px;
    box-shadow:0 18px 40px rgba(0,0,0,.25); pointer-events:none;
    transform:translate(-50%,-20%) scale(.55); opacity:0;
    transition:transform .7s cubic-bezier(.2,1.35,.4,1) .3s, opacity .35s ease .3s;
  }
  .tg-gift-stage.is-open .tg-gift-voucher{transform:translate(-50%,-118%) scale(1); opacity:1; pointer-events:auto}
  .tg-gift-v-brand{font-size:11px; font-weight:800; letter-spacing:.22em; color:var(--teal-soft)}
  .tg-gift-v-label{margin-top:6px; font-size:12px; letter-spacing:.3em; color:var(--muted)}
  .tg-gift-v-amount{font-size:54px; font-weight:800; line-height:1.1; color:var(--terra)}
  .tg-gift-v-cond{font-size:14px; color:var(--ink)}
  .tg-gift-v-note{margin-top:4px; font-size:12px; font-style:italic; color:var(--muted)}

  /* ---------- Confetti ---------- */
  .tg-gift-confetti-layer{position:absolute; inset:0; overflow:hidden; pointer-events:none; z-index:6}
  .tg-gift-confetti{position:absolute; top:-12px; display:block; animation:tgGiftConfettiFall var(--dur,2s) ease-in var(--delay,0s) forwards}
  @keyframes tgGiftConfettiFall{to{transform:translate(var(--dx,0),360px) rotate(var(--rot,360deg)); opacity:0}}


/* Scoped integration: typography stays Times New Roman, app state owns all awards. */
.voucher-modal.tg-gift-modal { background: radial-gradient(ellipse at 50% 0%, #fffaf0, #fdf6ec 65%, #f6e8d1); color:#2d2a26; border:1px solid #dbc09b; }
.tg-gift-modal .eyebrow { color:#4f7d7c; }
.tg-gift-modal h2 { color:#2d2a26; }
.tg-gift-modal p, .tg-gift-modal .voucher-condition { color:#6b6560; }
.tg-gift-modal .voucher-close { color:#2d2a26; background:#ecdfc9; z-index:20; }
.tg-gift-modal .voucher-gift-trigger { width:100%; height:340px; display:block; padding:0; margin:0 auto; animation:none; transform:none; background:transparent; filter:none; box-shadow:none; }
.tg-gift-stage { display:block; width:100%; max-width:340px; height:340px; margin:4px auto 0; cursor:inherit; }
.tg-gift-shadow { bottom:34px; width:220px; height:20px; margin-left:-110px; background:rgba(106,81,51,.17); }
.tg-gift-voucher { display:flex; flex-direction:column; gap:5px; padding:16px 14px; color:#2d2a26; background:#fffdfa; border:1px solid #ead3b1; }
.tg-gift-v-amount { font-size:40px; white-space:nowrap; }
.tg-gift-v-code { font-size:16px; font-weight:700; letter-spacing:.08em; color:#9a4a08; }
.tg-gift-v-label { font-size:10px; letter-spacing:.16em; }
.tg-gift-stage.is-open .tg-gift-voucher { transform:translate(-50%,-85%) scale(1); opacity:1; }
.tg-gift-stage.is-open .tg-gift-lid { transform:translateY(-270px) rotateZ(20deg) rotateX(-30deg); opacity:0; }
.tg-gift-stage.is-revealing .tg-gift-lid { animation:tgGiftLidRise .65s cubic-bezier(.2,.7,.3,1.2) both; }
.tg-gift-stage.is-revealing .tg-gift-voucher { animation:tgGiftVoucherRise .65s cubic-bezier(.2,.9,.4,1.1) both; }
@keyframes tgGiftLidRise { from { transform:translateY(-115px); opacity:1; } to { transform:translateY(-270px) rotateZ(20deg) rotateX(-30deg); opacity:0; } }
@keyframes tgGiftVoucherRise { 0%,25% { transform:translate(-50%,-20%) scale(.55); opacity:0; } 100% { transform:translate(-50%,-85%) scale(1); opacity:1; } }
@media(max-width:380px) { .tg-gift-modal .voucher-gift-trigger,.tg-gift-stage { height:300px; } .tg-gift-tilt { transform:scale(.92); } .tg-gift-voucher { width:218px; padding:14px 10px; } .tg-gift-v-amount { font-size:36px; } }
@media(prefers-reduced-motion:reduce) { .tg-gift-gift,.tg-gift-stage.is-revealing .tg-gift-lid,.tg-gift-stage.is-revealing .tg-gift-voucher,.tg-gift-confetti { animation:none; } .tg-gift-tilt,.tg-gift-voucher,.tg-gift-lid { transition:none; } }

.tg-gift-modal h2 { font-size:30px; line-height:1.15; margin:10px 0; }
.tg-gift-modal .voucher-code { font-size:16px; }
.tg-gift-reward-accessible { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.tg-gift-modal .terracotta-button { min-height:48px; font-size:16px; }
