body.is-red-packet-overlay-open {
  overflow: hidden;
}

.red-packet-launcher {
  position: fixed;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(var(--red-packet-footer-offset, 100px), env(safe-area-inset-bottom));
  z-index: 1100;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(248, 113, 113, 0.36);
  border-radius: 999px;
  background: linear-gradient(145deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow:
    0 18px 46px rgba(220, 38, 38, 0.28),
    0 0 0 6px rgba(239, 68, 68, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.red-packet-launcher[hidden] {
  display: none;
}

.red-packet-launcher:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 22px 54px rgba(220, 38, 38, 0.38),
    0 0 0 7px rgba(239, 68, 68, 0.1);
}

.red-packet-launcher svg {
  width: 29px;
  height: 29px;
  filter: none;
}

.red-packet-overlay[hidden] {
  display: none;
}

.red-packet-overlay {
  position: fixed;
  inset: 0;
  z-index: 1450;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.red-packet-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.red-packet-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 3, 6, 0.76);
  backdrop-filter: blur(9px);
}

.red-packet-panel {
  position: relative;
  width: min(410px, calc(100vw - 48px));
  overflow: hidden;
  border: 1px solid rgba(252, 165, 165, 0.28);
  border-radius: 30px;
  background:
    radial-gradient(circle at 20% 0%, rgba(251, 191, 36, 0.22), transparent 13rem),
    radial-gradient(circle at 90% 10%, rgba(248, 113, 113, 0.3), transparent 15rem),
    linear-gradient(160deg, rgba(69, 10, 10, 0.98), rgba(18, 6, 11, 0.99));
  color: #fff7ed;
  box-shadow: 0 32px 96px rgba(0, 0, 0, 0.66), 0 0 54px rgba(220, 38, 38, 0.18);
  transform: translateY(18px) scale(0.98);
  transition: transform 0.18s ease;
}

.red-packet-overlay.is-open .red-packet-panel {
  transform: translateY(0) scale(1);
}

.red-packet-panel::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #fbbf24, #ef4444, #fb7185);
  content: '';
}

.red-packet-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(254, 202, 202, 0.2);
  border-radius: 999px;
  background: rgba(69, 10, 10, 0.66);
  color: #fee2e2;
  transition: border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.red-packet-close:hover {
  border-color: rgba(251, 191, 36, 0.52);
  color: #fff;
  transform: rotate(4deg);
}

.red-packet-close svg {
  width: 18px;
  height: 18px;
}

.red-packet-content-shell {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  padding: 34px 24px 24px;
  text-align: center;
}

.red-packet-hero {
  position: relative;
  display: grid;
  place-items: center;
  width: 116px;
  height: 116px;
  margin: 4px auto 2px;
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 34px;
  background:
    radial-gradient(circle at 38% 22%, rgba(254, 243, 199, 0.36), transparent 34%),
    linear-gradient(145deg, rgba(185, 28, 28, 0.96), rgba(69, 10, 10, 0.94));
  box-shadow: 0 24px 50px rgba(127, 29, 29, 0.4), inset 0 0 32px rgba(251, 191, 36, 0.08);
}

.red-packet-hero.is-muted {
  filter: saturate(0.75);
  opacity: 0.86;
}

.red-packet-envelope {
  font-size: 4.5rem;
  line-height: 1;
  filter: drop-shadow(0 10px 18px rgba(69, 10, 10, 0.48));
}

.red-packet-spark {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #fbbf24;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.78);
}

.red-packet-spark-one {
  top: 18px;
  right: 16px;
}

.red-packet-spark-two {
  left: 18px;
  bottom: 18px;
  width: 8px;
  height: 8px;
}

.red-packet-kicker {
  color: #fbbf24;
  font-size: 0.73rem;
  font-weight: 950;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.red-packet-content-shell h2 {
  margin: 0;
  color: #fff7ed;
  font-size: clamp(1.65rem, 7vw, 2.25rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.red-packet-content-shell p {
  margin: 0;
  color: rgba(255, 237, 213, 0.78);
  font-size: 0.94rem;
  line-height: 1.55;
}

.red-packet-follow-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 20px;
  background: rgba(69, 10, 10, 0.44);
  text-align: left;
}

.red-packet-follow-card strong {
  color: #fff7ed;
  font-size: 0.96rem;
}

.red-packet-follow-card span {
  color: rgba(255, 237, 213, 0.74);
  font-size: 0.84rem;
  line-height: 1.45;
}

.red-packet-facebook-link,
.red-packet-follow-confirm,
.red-packet-claim {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  border-radius: 15px;
  font-size: 0.9rem;
  font-weight: 950;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.red-packet-facebook-link {
  border: 1px solid rgba(147, 197, 253, 0.36);
  background: rgba(37, 99, 235, 0.18);
  color: #dbeafe;
}

.red-packet-follow-confirm {
  width: 100%;
  border: 1px solid rgba(254, 202, 202, 0.22);
  background: rgba(127, 29, 29, 0.52);
  color: #fee2e2;
  text-align: left;
}

.red-packet-follow-confirm.is-confirmed {
  border-color: rgba(74, 222, 128, 0.48);
  background: rgba(22, 101, 52, 0.34);
  color: #dcfce7;
}

.red-packet-confirm-check {
  position: relative;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(254, 202, 202, 0.36);
  border-radius: 999px;
}

.red-packet-follow-confirm.is-confirmed .red-packet-confirm-check {
  border-color: #4ade80;
  background: #16a34a;
}

.red-packet-follow-confirm.is-confirmed .red-packet-confirm-check::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 10px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  content: '';
  transform: translate(-50%, -58%) rotate(45deg);
}

.red-packet-claim {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(251, 191, 36, 0.55);
  background: linear-gradient(135deg, #facc15, #f97316 48%, #dc2626);
  color: #450a0a;
  box-shadow: 0 18px 40px rgba(220, 38, 38, 0.32);
}

.red-packet-claim:hover,
.red-packet-facebook-link:hover,
.red-packet-follow-confirm:hover {
  transform: translateY(-1px);
}

.red-packet-claim.is-disabled,
.red-packet-claim:disabled {
  border-color: rgba(254, 202, 202, 0.16);
  background: rgba(69, 10, 10, 0.54);
  color: rgba(254, 226, 226, 0.58);
  box-shadow: none;
  cursor: not-allowed;
}

.red-packet-countdown {
  display: grid;
  place-items: center;
  min-height: 86px;
  padding: 15px;
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 22px;
  background: rgba(69, 10, 10, 0.45);
  color: #fbbf24;
  font-size: clamp(2rem, 12vw, 3.45rem);
  font-weight: 950;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 0 30px rgba(251, 191, 36, 0.06);
}

@media (max-width: 640px) {
  .red-packet-launcher {
    right: max(16px, env(safe-area-inset-right));
    bottom: max(var(--red-packet-footer-offset, 86px), env(safe-area-inset-bottom));
    width: 54px;
    height: 54px;
  }

  .red-packet-overlay {
    padding: 12px;
  }

  .red-packet-panel {
    width: 100%;
    border-radius: 26px;
  }

  .red-packet-content-shell {
    padding: 30px 20px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .red-packet-launcher,
  .red-packet-overlay,
  .red-packet-panel,
  .red-packet-facebook-link,
  .red-packet-follow-confirm,
  .red-packet-claim {
    transition: none;
  }
}
