/**
 * 余额盲盒前台 — uiverse.io 风格组件库
 * 玻璃拟态 / 霓虹描边 / 滑动指示 / 全息卡片 / 扫光按钮
 */

/* ── 星空粒子层 ── */
.bbb-u-sparkles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.bbb-u-sparkles span {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  animation: bbbUSparkle 4s ease-in-out infinite;
}
.bbb-u-sparkles span:nth-child(1) { top: 12%; left: 18%; animation-delay: 0s; }
.bbb-u-sparkles span:nth-child(2) { top: 28%; left: 72%; animation-delay: .8s; }
.bbb-u-sparkles span:nth-child(3) { top: 55%; left: 35%; animation-delay: 1.6s; }
.bbb-u-sparkles span:nth-child(4) { top: 68%; left: 82%; animation-delay: 2.2s; }
.bbb-u-sparkles span:nth-child(5) { top: 42%; left: 8%; animation-delay: .4s; }
.bbb-u-sparkles span:nth-child(6) { top: 78%; left: 55%; animation-delay: 3s; }
.bbb-u-sparkles span:nth-child(7) { top: 8%; left: 88%; animation-delay: 1.2s; }
.bbb-u-sparkles span:nth-child(8) { top: 88%; left: 22%; animation-delay: 2.8s; }
@keyframes bbbUSparkle {
  0%, 100% { opacity: 0; transform: scale(.5); }
  50% { opacity: .85; transform: scale(1.2); box-shadow: 0 0 6px rgba(255,255,255,.8); }
}

/* ── 圆形霓虹按钮（返回） ── */
.bbb-u-btn-circle {
  position: relative;
  overflow: visible !important;
}
.bbb-u-btn-circle::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(139, 92, 246, .35);
  animation: bbbUPulseRing 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes bbbUPulseRing {
  0% { transform: scale(.92); opacity: .8; }
  70%, 100% { transform: scale(1.18); opacity: 0; }
}

/* ── 品牌霓虹环 ── */
.bbb-u-neon-ring {
  position: relative;
  border-radius: 14px;
  padding: 2px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899, #22d3ee, #8b5cf6);
  background-size: 300% 300%;
  animation: bbbUNeonSpin 6s linear infinite;
}
.bbb-u-neon-ring > .bbb-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(7, 5, 15, .9);
  display: flex;
  align-items: center;
  justify-content: center;
}
.bbb-u-neon-ring > .bbb-brand-icon img {
  width: 28px;
  height: 28px;
}
@keyframes bbbUNeonSpin {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── 标题霓虹下划线 ── */
.bbb-u-heading {
  position: relative;
  display: inline-block;
}
.bbb-u-heading::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #8b5cf6, #ec4899, transparent);
  background-size: 200% 100%;
  animation: bbbULineFlow 3s ease infinite;
  border-radius: 2px;
}
@keyframes bbbULineFlow {
  0%, 100% { background-position: 0% 50%; opacity: .6; }
  50% { background-position: 100% 50%; opacity: 1; }
}

/* ── 统计卡片扫光（uiverse shiny card） ── */
.bbb-u-card {
  isolation: isolate;
}
.bbb-u-card-shine {
  position: absolute;
  top: -50%;
  left: -60%;
  width: 50%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
  transform: skewX(-20deg);
  animation: bbbUCardShine 5s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
.bbb-u-card[data-accent="gold"] .val { text-shadow: 0 0 24px rgba(251, 191, 36, .35); }
.bbb-u-card[data-accent="cyan"] .val { color: #22d3ee; text-shadow: 0 0 20px rgba(34, 211, 238, .3); }
.bbb-u-card[data-accent="violet"] .val { color: #c4b5fd; }
.bbb-u-card[data-accent="pink"] .val { color: #f9a8d4; }
.bbb-u-card .lbl,
.bbb-u-card .val { position: relative; z-index: 1; }
@keyframes bbbUCardShine {
  0%, 100% { left: -60%; opacity: 0; }
  45% { opacity: 1; }
  55% { left: 120%; opacity: 1; }
  56% { opacity: 0; }
}

/* ── 进度条条纹动画 ── */
.bbb-u-progress .bbb-quota-fill-bar {
  position: relative;
  overflow: hidden;
}
.bbb-u-progress .bbb-quota-fill-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,.25) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: bbbUProgressStripe 1.8s linear infinite;
}
@keyframes bbbUProgressStripe {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── 盲盒舱科幻角标 ── */
.bbb-u-vault-frame .bbb-u-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: rgba(139, 92, 246, .55);
  border-style: solid;
  pointer-events: none;
  z-index: 3;
}
.bbb-u-vault-frame .bbb-u-corner.tl { top: 12px; left: 12px; border-width: 2px 0 0 2px; border-radius: 4px 0 0 0; }
.bbb-u-vault-frame .bbb-u-corner.tr { top: 12px; right: 12px; border-width: 2px 2px 0 0; border-radius: 0 4px 0 0; }
.bbb-u-vault-frame .bbb-u-corner.bl { bottom: 12px; left: 12px; border-width: 0 0 2px 2px; border-radius: 0 0 0 4px; }
.bbb-u-vault-frame .bbb-u-corner.br { bottom: 12px; right: 12px; border-width: 0 2px 2px 0; border-radius: 0 0 4px 0; }

.bbb-u-scanline {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s;
  z-index: 2;
}
.bbb-u-scanline::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(180deg, transparent, rgba(139, 92, 246, .08), transparent);
  animation: bbbUScan 2.2s ease-in-out infinite;
}
@keyframes bbbUScan {
  0% { top: -40%; }
  100% { top: 100%; }
}
.bbb-page-wrap.is-drawing .bbb-u-scanline { opacity: 1; }
.bbb-page-wrap.is-drawing .bbb-u-scanline::before {
  animation-duration: .85s;
}

/* ── 玻璃操作面板 ── */
.bbb-u-glass-panel {
  position: relative;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, .35),
    inset 0 1px 0 rgba(255, 255, 255, .08),
    inset 0 -1px 0 rgba(139, 92, 246, .12) !important;
}
.bbb-u-glass-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(139,92,246,.35), rgba(255,255,255,.05), rgba(236,72,153,.25));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ── 连抽滑动指示器（uiverse segmented） ── */
.bbb-batch-list {
  position: relative;
}
.bbb-batch-slider {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(124, 108, 255, 0.28));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 6px 16px rgba(124, 108, 255, 0.28);
  transition: transform .32s cubic-bezier(.34, 1.2, .64, 1), width .32s cubic-bezier(.34, 1.2, .64, 1);
  z-index: 0;
  pointer-events: none;
}
.bbb-batch-btn {
  position: relative;
  z-index: 1;
}
.bbb-batch-btn.active {
  background: transparent !important;
  box-shadow: none !important;
  color: #fff !important;
}

/* ── 主按钮粒子光晕 ── */
.bbb-draw-btn-wrap {
  position: relative;
}
.bbb-u-btn-sparks {
  position: absolute;
  inset: -8px;
  pointer-events: none;
  overflow: visible;
  z-index: 0;
}
.bbb-u-btn-sparks i {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #c4b5fd;
  opacity: 0;
  animation: bbbUBtnSpark 3s ease-in-out infinite;
}
.bbb-u-btn-sparks i:nth-child(1) { top: 10%; left: 8%; animation-delay: 0s; }
.bbb-u-btn-sparks i:nth-child(2) { top: 20%; right: 12%; animation-delay: .6s; background: #f9a8d4; }
.bbb-u-btn-sparks i:nth-child(3) { bottom: 15%; left: 20%; animation-delay: 1.2s; background: #67e8f9; }
.bbb-u-btn-sparks i:nth-child(4) { bottom: 8%; right: 18%; animation-delay: 1.8s; }
@keyframes bbbUBtnSpark {
  0%, 100% { opacity: 0; transform: scale(.5); }
  50% { opacity: .9; transform: scale(1.4); box-shadow: 0 0 8px currentColor; }
}

.bbb-u-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .35);
  transform: scale(0);
  animation: bbbURipple .55s ease-out forwards;
  pointer-events: none;
  z-index: 5;
}
.bbb-u-ripple.is-gold {
  background: rgba(251, 191, 36, .42);
}
.bbb-u-ripple.is-violet {
  background: rgba(196, 181, 253, .45);
}
@keyframes bbbURipple {
  to { transform: scale(4); opacity: 0; }
}

/* ── 全息奖池卡片 ── */
.bbb-prize-item.bbb-u-holo {
  --bbb-tilt-x: 0deg;
  --bbb-tilt-y: 0deg;
  position: relative;
  transform: perspective(600px) rotateX(var(--bbb-tilt-x)) rotateY(var(--bbb-tilt-y));
  transform-style: preserve-3d;
}
.bbb-prize-item.bbb-u-holo::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--bbb-holo-angle, 0deg), #8b5cf6, #ec4899, #22d3ee, #fbbf24, #8b5cf6);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .35s;
  pointer-events: none;
  animation: bbbUHoloSpin 4s linear infinite;
}
.bbb-prize-item.bbb-u-holo:hover::after,
.bbb-prize-item.bbb-u-holo.active::after {
  opacity: .85;
}
.bbb-prize-item.bbb-u-holo:hover {
  transform: perspective(600px) rotateX(var(--bbb-tilt-x)) rotateY(var(--bbb-tilt-y)) translateY(-3px);
  border-color: rgba(139, 92, 246, .35);
  box-shadow: 0 10px 28px rgba(139, 92, 246, .18);
}
.bbb-prize-item.bbb-u-holo.active {
  transform: perspective(600px) rotateX(var(--bbb-tilt-x)) rotateY(var(--bbb-tilt-y)) scale(1.04) !important;
  box-shadow: 0 12px 36px rgba(251, 191, 36, .22);
}
@property --bbb-holo-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
@keyframes bbbUHoloSpin {
  to { --bbb-holo-angle: 360deg; }
}

/* ── 记录条目滑入光带 ── */
.bbb-record-item.bbb-u-record {
  overflow: hidden;
}
.bbb-record-item.bbb-u-record::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent);
  pointer-events: none;
}
.bbb-record-item.is-new::after {
  animation: bbbURecordSweep .65s ease forwards;
}
@keyframes bbbURecordSweep {
  to { left: 150%; }
}

/* ── 加载更多 ghost 按钮 ── */
.bbb-records-more.bbb-u-loadmore {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 140px;
}
.bbb-u-loadmore-arrow {
  display: inline-block;
  transition: transform .25s ease;
}
.bbb-records-more.bbb-u-loadmore:hover:not(:disabled) .bbb-u-loadmore-arrow {
  transform: translateY(3px);
  animation: bbbUArrowBounce .6s ease infinite;
}
@keyframes bbbUArrowBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* ── 区块面板霓虹顶边 ── */
.bbb-u-panel {
  position: relative;
  overflow: hidden;
}
.bbb-u-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139,92,246,.6), rgba(236,72,153,.6), transparent);
  animation: bbbUPanelGlow 4s ease infinite;
}
@keyframes bbbUPanelGlow {
  0%, 100% { opacity: .5; }
  50% { opacity: 1; }
}

/* ── 概率徽章 pulse ── */
.bbb-prize-item .tier:not(.consolation) {
  animation: bbbUTierPulse 2.5s ease-in-out infinite;
}
@keyframes bbbUTierPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(139, 92, 246, 0); }
  50% { box-shadow: 0 0 12px rgba(139, 92, 246, .35); }
}

html.bbb-paused .bbb-u-sparkles span,
html.bbb-paused .bbb-u-btn-circle::before,
html.bbb-paused .bbb-u-neon-ring,
html.bbb-paused .bbb-u-card-shine,
html.bbb-paused .bbb-u-btn-sparks i,
html.bbb-paused .bbb-prize-item .tier.jackpot {
  animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {
  .bbb-u-sparkles span,
  .bbb-u-btn-circle::before,
  .bbb-u-neon-ring,
  .bbb-u-heading::after,
  .bbb-u-card-shine,
  .bbb-u-progress .bbb-quota-fill-bar::after,
  .bbb-u-scanline::before,
  .bbb-u-btn-sparks i,
  .bbb-prize-item.bbb-u-holo::after,
  .bbb-u-panel::before,
  .bbb-prize-item .tier:not(.consolation),
  .bbb-prize-item .tier.jackpot,
  .bbb-u-loadmore-arrow {
    animation: none !important;
  }
  .bbb-prize-item.bbb-u-holo {
    transform: none !important;
  }
  .bbb-u-guest-ring::before {
    animation: none !important;
  }
}

.bbb-draw-btn:focus-visible,
.bbb-batch-btn:focus-visible,
.bbb-guest-btn:focus-visible,
.bbb-records-more:focus-visible,
.bbb-back-btn:focus-visible {
  outline: 2px solid rgba(139,92,246,.65);
  outline-offset: 2px;
}

/* ── 大奖徽章 pulse ── */
.bbb-prize-item .tier.jackpot {
  animation: bbbJackpotPulse 2.2s ease-in-out infinite;
}
@keyframes bbbJackpotPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(251, 191, 36, 0); }
  50% { box-shadow: 0 0 16px rgba(251, 191, 36, .4); }
}

/* ── 访客横幅 ── */
.bbb-guest-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0 0 18px;
  padding: 14px 18px 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(139, 92, 246, .3);
  background: linear-gradient(135deg, rgba(88, 28, 135, .18), rgba(15, 10, 30, .82));
  box-shadow: 0 8px 32px rgba(88, 28, 135, .15);
  position: relative;
  overflow: hidden;
}
.bbb-guest-banner::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #8b5cf6, #ec4899);
}
.bbb-guest-banner-icon {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bbb-guest-banner-icon svg {
  width: 22px;
  height: 22px;
  color: #ddd6fe;
  position: relative;
  z-index: 1;
}
.bbb-u-guest-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(139, 92, 246, .45);
  background: radial-gradient(circle at 35% 30%, rgba(139, 92, 246, .28), rgba(15, 10, 30, .65));
  box-shadow: 0 0 18px rgba(139, 92, 246, .3), inset 0 0 10px rgba(139, 92, 246, .12);
}
.bbb-u-guest-ring::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid transparent;
  border-top-color: rgba(236, 72, 153, .55);
  border-right-color: rgba(34, 211, 238, .35);
  animation: bbbGuestRingSpin 5s linear infinite;
}
@keyframes bbbGuestRingSpin {
  to { transform: rotate(360deg); }
}
.bbb-guest-banner-text {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bbb-guest-banner-text strong {
  font-size: 15px;
  color: #f5f3ff;
  font-weight: 600;
}
.bbb-guest-banner-text span {
  font-size: 13px;
  color: rgba(196, 181, 253, .85);
  line-height: 1.45;
}
.bbb-guest-banner-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.bbb-guest-btn {
  position: relative;
  overflow: hidden;
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .14s cubic-bezier(.34, 1.2, .64, 1), box-shadow .2s ease, background .2s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.bbb-guest-btn.is-primary {
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  box-shadow: 0 4px 18px rgba(139, 92, 246, .35);
}
.bbb-guest-btn.is-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(139, 92, 246, .45);
}
.bbb-guest-btn.is-primary:active,
.bbb-guest-btn.is-primary.is-pressing {
  transform: scale(0.96) translateY(0);
  box-shadow: 0 2px 12px rgba(139, 92, 246, .35);
}
.bbb-guest-btn.is-ghost {
  color: #c4b5fd;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(139, 92, 246, .35);
}
.bbb-guest-btn.is-ghost:hover {
  background: rgba(255, 255, 255, .1);
}
.bbb-guest-btn.is-ghost:active,
.bbb-guest-btn.is-ghost.is-pressing {
  transform: scale(0.96);
  background: rgba(255, 255, 255, .14);
}
.bbb-guest-cta-inline {
  margin-top: 12px;
}
.bbb-guest-lock-svg {
  width: 36px;
  height: 36px;
  color: #a78bfa;
  filter: drop-shadow(0 0 10px rgba(139, 92, 246, .45));
}

/* ── Toast 提示 ── */
.bbb-toast-wrap {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10050;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(92vw, 420px);
}
.bbb-toast {
  width: 100%;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
  color: #f8fafc;
  background: rgba(15, 10, 30, .92);
  border: 1px solid rgba(139, 92, 246, .4);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity .28s ease, transform .28s ease;
  backdrop-filter: blur(12px);
}
.bbb-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.bbb-toast.is-success {
  border-color: rgba(52, 211, 153, .5);
  background: linear-gradient(135deg, rgba(6, 78, 59, .92), rgba(15, 10, 30, .92));
}
.bbb-toast.is-error {
  border-color: rgba(248, 113, 113, .55);
  background: linear-gradient(135deg, rgba(127, 29, 29, .88), rgba(15, 10, 30, .92));
}
.bbb-toast.is-warn {
  border-color: rgba(251, 191, 36, .55);
  background: linear-gradient(135deg, rgba(120, 53, 15, .88), rgba(15, 10, 30, .92));
}
.bbb-toast.is-info {
  border-color: rgba(96, 165, 250, .5);
}

/* 覆盖主题站白底 select，保证商城排序文字可见 */
.bbb-mall-sort,
.bbb-mall-sort option {
  background-color: #12151c !important;
  color: #eef0f4 !important;
  color-scheme: dark;
}

@media (max-width: 640px) {
  .bbb-guest-banner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .bbb-guest-banner-actions {
    justify-content: center;
  }
}
