/* =====================================================================
 * GL.bet「Sign Up」右上角 +R$3 奖励角标 · 动效（纯 CSS）
 * 尺寸取自 Figma Badge（59×22）：礼物图标 + 红色胶囊 + 实时文字。
 * 用法见 README「奖励角标」。类名前缀 glbd-。
 * ===================================================================== */

.glbd {
  --glbd-cycle: 3.2s;            /* 循环周期 */
  position: absolute;            /* 由外部定位，设计稿：Sign Up 按钮右上角 left:310px top:29px */
  width: 59px;
  height: 22px;
  pointer-events: none;
  animation: glbd-in .6s .3s cubic-bezier(.3, 1.5, .5, 1) backwards;
  transform-origin: 20% 60%;
}

/* 红色胶囊：渐变 + 上白下粉内阴影（Figma 原样） */
.glbd-pill {
  position: absolute;
  left: 4px; top: 3px;
  width: 55px; height: 16px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(91deg, #f5421f 0%, #f64f1c 98%);
  box-shadow: inset 0 .8px 1.6px rgba(255, 255, 255, .7), inset 0 -.8px 1.6px rgba(245, 112, 118, .7);
  transform-origin: 0 50%;
  animation: glbd-pill-in .45s .5s cubic-bezier(.3, 1.3, .5, 1) backwards, glbd-glow var(--glbd-cycle) 1.2s ease-in-out infinite;
}
/* 胶囊扫光 */
.glbd-pill::after {
  content: "";
  position: absolute;
  top: -4px; bottom: -4px; left: -40%;
  width: 34%;
  transform: skewX(-22deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .85), transparent);
  animation: glbd-sheen var(--glbd-cycle) 1.2s ease-in-out infinite;
}
.glbd-t {
  position: absolute;
  left: 18px; top: -1px;
  font: 700 13px/16px "Albert Sans", "Helvetica Neue", Arial, sans-serif;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 .5px 1px rgba(140, 20, 0, .45);
  transform-origin: 30% 55%;
  animation: glbd-txt var(--glbd-cycle) 1.2s ease-in-out infinite;
}

/* 礼物：周期性跳起摇晃 */
.glbd-gift {
  position: absolute;
  left: -1.3px; top: -1.1px;
  width: 25.6px; height: 25.2px;
  max-width: none;
  transform-origin: 50% 85%;
  animation: glbd-shake var(--glbd-cycle) 1.2s ease-in-out infinite;
}

/* 礼物里蹦出的小金币 */
.glbd-coin {
  position: absolute;
  left: 6px; top: 2px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6c4 0 18%, #ffd23e 45%, #e08a00 100%);
  box-shadow: 0 0 4px rgba(255, 200, 60, .9);
  opacity: 0;
  animation: glbd-coin var(--glbd-cycle) 1.2s ease-out infinite;
}

/* 星光 */
.glbd-spark {
  position: absolute;
  width: var(--s, 7px); height: var(--s, 7px);
  opacity: 0;
  background: radial-gradient(circle, #fff 0 22%, #fff2c2 50%, #ffcf5c 78%);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  animation: glbd-twinkle var(--glbd-cycle) var(--d, 1.4s) ease-in-out infinite;
}

/* ---------- 关键帧（一个周期内：礼物跳摇 → 金币蹦出 → 文字跳动 + 扫光 + 发光） ---------- */
@keyframes glbd-in { 0% { opacity: 0; transform: scale(0) rotate(-20deg); } 100% { opacity: 1; transform: none; } }
@keyframes glbd-pill-in { from { transform: scaleX(0); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes glbd-shake {
  0%, 6%, 34%, 100% { transform: none; }
  10% { transform: translateY(-4px) scale(1.14) rotate(-14deg); }
  15% { transform: translateY(-4px) scale(1.14) rotate(12deg); }
  20% { transform: translateY(-3px) scale(1.1) rotate(-9deg); }
  25% { transform: translateY(-1px) scale(1.05) rotate(6deg); }
  30% { transform: translateY(0) scale(.96, 1.04) rotate(-2deg); }
}
@keyframes glbd-coin {
  0%, 12% { opacity: 0; transform: translate(0, 4px) scale(.4); }
  16% { opacity: 1; transform: translate(-2px, -8px) scale(1); }
  30% { opacity: 1; transform: translate(-6px, -15px) scale(.9) rotateY(180deg); }
  42%, 100% { opacity: 0; transform: translate(-9px, -6px) scale(.6) rotateY(360deg); }
}
@keyframes glbd-txt {
  0%, 22%, 44%, 100% { transform: none; }
  30% { transform: scale(1.18); }
  37% { transform: scale(.96); }
}
@keyframes glbd-sheen { 0%, 24% { left: -40%; } 50%, 100% { left: 130%; } }
@keyframes glbd-glow {
  0%, 22%, 52%, 100% { box-shadow: inset 0 .8px 1.6px rgba(255, 255, 255, .7), inset 0 -.8px 1.6px rgba(245, 112, 118, .7), 0 0 0 rgba(255, 80, 30, 0); }
  32% { box-shadow: inset 0 .8px 1.6px rgba(255, 255, 255, .7), inset 0 -.8px 1.6px rgba(245, 112, 118, .7), 0 0 9px 1px rgba(255, 90, 30, .85); }
}
@keyframes glbd-twinkle {
  0%, 20%, 50%, 100% { opacity: 0; transform: scale(.2) rotate(0); }
  32% { opacity: 1; transform: scale(1) rotate(90deg); }
}

@media (prefers-reduced-motion: reduce) {
  .glbd, .glbd * , .glbd *::after { animation: none !important; }
  .glbd-coin, .glbd-spark, .glbd-pill::after { display: none; }
}
