.chat-red-packet-card {
  position: relative;
  display: grid;
  width: var(--group-chat-red-packet-card-width, 272px);
  min-width: var(--group-chat-red-packet-card-width, 272px);
  max-width: var(--group-chat-red-packet-card-width, 272px);
  box-sizing: border-box;
  grid-template-columns: 50px minmax(0, 1fr) 16px;
  grid-template-rows: minmax(68px, auto) 27px;
  align-items: center;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgb(255 220 173 / 42%);
  border-radius: 8px 20px 20px;
  background: linear-gradient(135deg, #f85738 0%, #e8322d 50%, #c91f2d 100%);
  box-shadow: 0 12px 28px rgb(172 39 35 / 24%), inset 0 1px rgb(255 255 255 / 20%);
  color: #fff;
  text-align: left;
  isolation: isolate;
}

.chat-red-packet-card:active {
  transform: scale(0.985);
}

.chat-red-packet-card__glow {
  position: absolute;
  z-index: -1;
  top: -65px;
  right: -36px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(255 218 132 / 38%), transparent 68%);
}

.chat-red-packet-card__seal {
  display: grid;
  width: 38px;
  height: 38px;
  justify-self: end;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #c62d26;
  font-size: 20px;
}

.chat-red-packet-card__copy {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 13px 7px 11px 10px;
}

.chat-red-packet-card__copy strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-red-packet-card__copy small {
  color: rgb(255 244 225 / 86%);
  font-size: 10px;
  font-weight: 650;
}

.chat-red-packet-card__chevron {
  color: rgb(255 255 255 / 72%);
  font-size: 25px;
  font-weight: 300;
}

.chat-red-packet-card__footer {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  align-self: stretch;
  padding: 0 12px;
  border-top: 1px solid rgb(124 37 25 / 10%);
  background: rgb(255 250 240 / 96%);
  color: #ad5142;
  font-size: 9px;
  font-weight: 720;
}

.chat-red-packet-card__footer time {
  margin-left: auto;
  padding-left: 8px;
  white-space: nowrap;
  font-size: 9px;
}

.chat-red-packet-card__footer em {
  color: #cc8b66;
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.chat-red-packet-card.is-claimed,
.chat-red-packet-card.is-exhausted,
.chat-red-packet-card.is-expired,
.chat-red-packet-card.is-pending {
  border-color: rgb(214 204 191 / 48%);
  background: linear-gradient(135deg, #cf8c77, #b96e65 54%, #a9585c);
  box-shadow: 0 9px 22px rgb(105 72 67 / 16%);
}

.chat-red-packet-modal {
  --backdrop-opacity: 0.48;
}

.chat-red-packet-modal.is-dialog {
  --width: min(calc(100% - 32px), 430px);
  --height: min(78%, 680px);
  --max-width: 430px;
  --max-height: 680px;
  --border-radius: 26px;
  --box-shadow: 0 24px 76px rgb(55 22 18 / 30%);
}

.chat-red-packet-modal.is-fullscreen {
  --width: 100%;
  --height: 100%;
  --max-width: none;
  --max-height: none;
  --border-radius: 0;
  --box-shadow: none;
  --backdrop-opacity: 0;
}

.chat-red-packet-modal::part(content) {
  overflow: hidden;
  transition:
    width 260ms cubic-bezier(0.22, 0.9, 0.32, 1),
    height 260ms cubic-bezier(0.22, 0.9, 0.32, 1),
    border-radius 220ms ease;
}

.chat-red-packet-sheet {
  --background: #fffaf6;
}

.chat-red-packet-sheet::part(scroll) {
  overflow-y: auto;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.chat-red-packet-modal.is-dialog .chat-red-packet-sheet::part(scroll) {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

.chat-red-packet-sheet__inner {
  min-height: 100%;
  padding: max(4px, env(safe-area-inset-top)) 18px max(26px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 86% 4%, rgb(255 205 137 / 22%), transparent 32%),
    linear-gradient(180deg, #fffaf6 0%, #fff 72%);
}

.chat-red-packet-sheet__header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 46px;
}

.chat-red-packet-sheet__header button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #f6eae4;
  color: #8a5a50;
  font-size: 19px;
}

.chat-red-packet-sheet__hero {
  display: grid;
  justify-items: center;
  padding: 8px 14px 18px;
  text-align: center;
}

.chat-red-packet-sheet__orb {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #c92f28;
  font-size: 33px;
}

.chat-red-packet-sheet__hero small {
  margin-top: 13px;
  color: #c05c45;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.16em;
}

.chat-red-packet-sheet__hero h2 {
  max-width: 290px;
  margin: 7px 0 10px;
  color: #432c29;
  font-size: 21px;
  line-height: 1.35;
}

.chat-red-packet-sheet__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #fff0e5;
  color: #b54f3a;
  font-size: 10px;
  font-weight: 780;
}

.chat-red-packet-sheet__status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e44d35;
  box-shadow: 0 0 0 4px rgb(228 77 53 / 10%);
}

.chat-red-packet-sheet__hero.is-claimed .chat-red-packet-sheet__status,
.chat-red-packet-sheet__hero.is-exhausted .chat-red-packet-sheet__status,
.chat-red-packet-sheet__hero.is-expired .chat-red-packet-sheet__status,
.chat-red-packet-sheet__hero.is-pending .chat-red-packet-sheet__status {
  background: #f1efec;
  color: #81756f;
}

.chat-red-packet-sheet__hero.is-claimed .chat-red-packet-sheet__status i,
.chat-red-packet-sheet__hero.is-exhausted .chat-red-packet-sheet__status i,
.chat-red-packet-sheet__hero.is-expired .chat-red-packet-sheet__status i,
.chat-red-packet-sheet__hero.is-pending .chat-red-packet-sheet__status i {
  background: #9a8e87;
}

.chat-red-packet-sheet__hero.is-opening .chat-red-packet-sheet__status {
  background: #fff6df;
  color: #b56e21;
}

.chat-red-packet-sheet__hero.is-opening .chat-red-packet-sheet__status i {
  background: #e5a438;
  animation: red-packet-status-pulse 0.72s ease-in-out infinite alternate;
}

.chat-red-packet-sheet__loading,
.chat-red-packet-result,
.chat-red-packet-claim {
  display: grid;
  justify-items: center;
  margin-top: 4px;
  padding: 27px 20px;
  border: 1px solid #f0e2da;
  border-radius: 22px;
  background: rgb(255 255 255 / 82%);
  text-align: center;
}

.chat-red-packet-sheet__loading ion-spinner {
  width: 28px;
  height: 28px;
  color: #d54836;
}

.chat-red-packet-sheet__loading strong {
  margin-top: 13px;
  color: #523b36;
  font-size: 14px;
}

.chat-red-packet-sheet__loading span,
.chat-red-packet-result p,
.chat-red-packet-claim p {
  margin: 7px 0 0;
  color: #95837b;
  font-size: 12px;
  line-height: 1.65;
}

.chat-red-packet-sheet__facts {
  display: grid;
  grid-template-columns: 0.8fr 0.8fr 1.4fr;
  margin-bottom: 12px;
  padding: 13px 8px;
  border: 1px solid #f0e1da;
  border-radius: 17px;
  background: rgb(255 255 255 / 78%);
}

.chat-red-packet-sheet__facts span {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 0 8px;
  border-right: 1px solid #efe2dc;
}

.chat-red-packet-sheet__facts span:last-child {
  border-right: 0;
}

.chat-red-packet-sheet__facts small {
  color: #a08d84;
  font-size: 9px;
}

.chat-red-packet-sheet__facts strong {
  overflow: hidden;
  color: #513a35;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-red-packet-sheet__condition {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #f0dfd5;
  border-radius: 13px;
  background: #fff8f3;
  color: #967c71;
  font-size: 11px;
}

.chat-red-packet-sheet__condition strong {
  color: #74483e;
  font-size: 12px;
  text-align: right;
}

.chat-red-packet-sheet__condition-note {
  margin: -4px 0 12px;
  color: #8b96a4;
  font-size: 11px;
  line-height: 1.45;
}

.chat-red-packet-result > ion-icon {
  color: #b0a19a;
  font-size: 43px;
}

.chat-red-packet-result > strong {
  margin-top: 11px;
  color: #4c3834;
  font-size: 17px;
}

.chat-red-packet-result.is-success > ion-icon {
  color: #db4936;
}

.chat-red-packet-result.is-success > small {
  margin-top: 9px;
  color: #a06758;
  font-size: 11px;
  font-weight: 750;
}

.chat-red-packet-result.is-success > strong {
  margin-top: 3px;
  color: #d33f31;
  font-size: 38px;
  font-variant-numeric: tabular-nums;
}

.chat-red-packet-result.is-success > strong span {
  margin-right: 3px;
  font-size: 17px;
}

.chat-red-packet-result.is-warning > ion-icon,
.chat-red-packet-result.is-error > ion-icon {
  color: #d88a3b;
}

.chat-red-packet-result.is-error button,
.chat-red-packet-sheet__error button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 9px 14px;
  border: 1px solid #edc8bd;
  border-radius: 12px;
  background: #fff5ef;
  color: #b64d3e;
  font-size: 11px;
  font-weight: 800;
}

.chat-red-packet-claim {
  padding-top: 20px;
}

.chat-red-packet-claim p {
  max-width: 260px;
  margin-top: 0;
}

.chat-red-packet-claim > button {
  display: grid;
  width: 80px;
  height: 80px;
  margin-top: 18px;
  place-items: center;
  border: 5px solid #fee8b8;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffeebc, #efb84e);
  box-shadow: 0 14px 30px rgb(200 65 43 / 24%), inset 0 2px rgb(255 255 255 / 74%);
  color: #c52e28;
  font-family: serif;
  font-size: 30px;
  font-weight: 800;
}

.chat-red-packet-claim > button:active:not(:disabled) {
  transform: scale(0.96);
}

.chat-red-packet-claim > button:disabled {
  opacity: 0.72;
}

.chat-red-packet-claim > button ion-spinner {
  width: 27px;
  height: 27px;
}

.chat-red-packet-claim > strong {
  margin-top: 10px;
  color: #9e5547;
  font-size: 11px;
}

.chat-red-packet-opening {
  position: relative;
  display: grid;
  min-height: 232px;
  margin-top: 4px;
  padding: 28px 20px 24px;
  overflow: hidden;
  justify-items: center;
  border: 1px solid #f0d7cc;
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 35%, rgb(255 220 153 / 36%), transparent 38%),
    rgb(255 255 255 / 88%);
  text-align: center;
}

.chat-red-packet-opening__stage {
  position: relative;
  display: grid;
  width: 126px;
  height: 126px;
  place-items: center;
  perspective: 620px;
}

.chat-red-packet-opening__halo {
  position: absolute;
  inset: 5px;
  border: 1px solid rgb(232 167 61 / 48%);
  border-radius: 50%;
  box-shadow: 0 0 0 12px rgb(255 213 127 / 10%), 0 0 42px rgb(220 80 42 / 16%);
  animation: red-packet-opening-halo 0.7s ease-out infinite;
}

.chat-red-packet-opening__seal {
  position: relative;
  z-index: 2;
  display: grid;
  width: 84px;
  height: 84px;
  place-items: center;
  border: 5px solid #fee8b8;
  border-radius: 50%;
  background: linear-gradient(145deg, #fff0bd, #efb64b);
  box-shadow: 0 16px 34px rgb(200 65 43 / 25%), inset 0 2px rgb(255 255 255 / 78%);
  color: #c52e28;
  font-family: serif;
  font-size: 31px;
  font-weight: 800;
  backface-visibility: hidden;
  animation: red-packet-opening-flip 0.7s cubic-bezier(0.55, 0.06, 0.45, 0.95) infinite;
}

.chat-red-packet-opening__spark {
  position: absolute;
  z-index: 1;
  color: #edae45;
  font-size: 17px;
  animation: red-packet-opening-spark 0.7s ease-in-out infinite alternate;
}

.chat-red-packet-opening__spark.is-left {
  top: 20px;
  left: 4px;
}

.chat-red-packet-opening__spark.is-right {
  right: 2px;
  bottom: 20px;
  animation-delay: -0.4s;
}

.chat-red-packet-opening > strong {
  margin-top: 4px;
  color: #5b3932;
  font-size: 16px;
}

.chat-red-packet-opening > p {
  margin: 7px 0 0;
  color: #a28378;
  font-size: 11px;
}

.chat-red-packet-participants {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid #f0e1da;
  border-radius: 18px;
  background: rgb(255 255 255 / 82%);
}

.chat-red-packet-participants > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 15px 12px;
  border-bottom: 1px solid #f2e7e1;
}

.chat-red-packet-participants > header strong {
  color: #503a35;
  font-size: 14px;
}

.chat-red-packet-participants > header span {
  color: #a18479;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.chat-red-packet-participants ul {
  padding: 0 15px;
  margin: 0;
  list-style: none;
}

.chat-red-packet-participants li {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 61px;
  border-bottom: 1px solid #f4ebe6;
}

.chat-red-packet-participants li:last-child {
  border-bottom: 0;
}

.chat-red-packet-participants li > img,
.chat-red-packet-participants__avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffe8d6, #f5c778);
  color: #a64a38;
  font-size: 14px;
  font-weight: 800;
  object-fit: cover;
}

.chat-red-packet-participants__identity {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.chat-red-packet-participants__name {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.chat-red-packet-participants__name strong {
  overflow: hidden;
  color: #513b36;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-red-packet-participants__name em {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: #fff0e7;
  color: #c85b43;
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
}

.chat-red-packet-participants__identity small {
  color: #ab9389;
  font-size: 9px;
}

.chat-red-packet-participants__result {
  display: grid;
  justify-items: end;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}

.chat-red-packet-participants__result > strong {
  color: #bf4f39;
  font-size: 12px;
}

.chat-red-packet-participants__result > small {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 7px 3px 5px;
  border: 1px solid rgba(220, 157, 38, 0.58);
  border-radius: 999px;
  background: linear-gradient(135deg, #fff3c6, #ffe4a0);
  box-shadow: 0 3px 9px rgba(190, 124, 13, 0.16);
  color: #945c08;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.chat-red-packet-participants__result ion-icon {
  color: #d18a12;
  font-size: 12px;
}

.chat-red-packet-participants__empty {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 22px 15px;
  color: #aa968d;
  font-size: 11px;
}

@keyframes red-packet-opening-flip {
  0% { transform: rotateY(0deg) scale(1); }
  42% { transform: rotateY(175deg) scale(1.08); }
  58% { transform: rotateY(205deg) scale(1.08); }
  100% { transform: rotateY(360deg) scale(1); }
}

@keyframes red-packet-opening-halo {
  0% { opacity: 0.85; transform: scale(0.78); }
  100% { opacity: 0; transform: scale(1.16); }
}

@keyframes red-packet-opening-spark {
  from { opacity: 0.35; transform: scale(0.72) rotate(-12deg); }
  to { opacity: 1; transform: scale(1.15) rotate(10deg); }
}

@keyframes red-packet-status-pulse {
  from { opacity: 0.48; transform: scale(0.78); }
  to { opacity: 1; transform: scale(1.08); }
}

.chat-red-packet-sheet__error {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid #f0c9bf;
  border-radius: 14px;
  background: #fff3ef;
  color: #aa4d41;
  font-size: 11px;
  line-height: 1.5;
}

.chat-red-packet-sheet__error ion-icon {
  font-size: 19px;
}

.chat-red-packet-sheet__error button {
  grid-column: 1 / -1;
  justify-self: stretch;
  justify-content: center;
  margin-top: 1px;
}

@media (max-width: 370px) {
  .chat-red-packet-card {
    width: min(258px, 74vw);
    min-width: 210px;
  }

  .chat-red-packet-sheet__inner {
    padding-right: 14px;
    padding-left: 14px;
  }

  .chat-red-packet-sheet__facts span {
    padding: 0 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-red-packet-card,
  .chat-red-packet-claim > button,
  .chat-red-packet-opening__halo,
  .chat-red-packet-opening__seal,
  .chat-red-packet-opening__spark,
  .chat-red-packet-sheet__hero.is-opening .chat-red-packet-sheet__status i {
    animation: none;
    transition: none;
  }
}

.tx-player-packet-backdrop{position:fixed;inset:0;z-index:10020;display:flex;justify-content:center;align-items:center;background:#0007;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}.tx-player-packet-backdrop *{box-sizing:border-box}.tx-player-packet-panel{width:min(calc(100% - 32px),430px);max-height:min(85vh,760px);overflow-y:auto;border-radius:26px;background:#fffaf6;box-shadow:0 24px 76px #3716124d;overscroll-behavior:contain}.tx-player-packet-panel.is-fullscreen{width:100%;height:100%;max-height:none;border-radius:0;max-width:600px}.tx-player-packet-panel button{font:inherit;cursor:pointer}.tx-player-packet-panel button:disabled{cursor:wait;opacity:.6}.tx-player-packet-message{display:flex;align-items:flex-start;gap:9px;margin:12px 8px;max-width:100%;text-align:left}.tx-player-packet-message>img{width:34px;height:34px;object-fit:cover;border-radius:6px}.tx-player-packet-message__body{min-width:0;max-width:calc(100% - 43px)}.tx-player-packet-message__name{margin-bottom:5px;color:#8b95a7;font-size:11px}.tx-player-packet-message .chat-red-packet-card{max-width:min(272px,calc(100vw - 76px));min-width:0;width:272px}.tx-player-packet-card-host{display:block;width:272px;max-width:100%}.tx-player-packet-panel .chat-red-packet-sheet__header button{font-size:24px}.tx-player-packet-panel .chat-red-packet-result>span{font-size:36px;color:#cf5b3e}.tx-player-packet-panel .chat-red-packet-participants__result strong{white-space:nowrap}.tx-player-packet-panel .chat-red-packet-opening__stage{margin:auto}.tx-player-packet-panel .chat-red-packet-sheet__facts{margin-bottom:16px}.tx-player-packet-panel .chat-red-packet-result button{padding:10px 18px;border:0;border-radius:8px;background:#f6eae4;color:#a34f39}@media(prefers-reduced-motion:reduce){.tx-player-packet-panel *{animation:none!important;transition:none!important}}.tx-player-packet-panel::-webkit-scrollbar{width:6px;height:6px}.tx-player-packet-panel::-webkit-scrollbar-track{background:transparent}.tx-player-packet-panel::-webkit-scrollbar-thumb{background:#9093994d;border-radius:4px}.tx-player-packet-panel{animation:tx-packet-enter .22s ease-out}@keyframes tx-packet-enter{from{opacity:0;transform:translateY(12px) scale(.98)}to{opacity:1;transform:none}}


.group-chat-red-packet-claim-notice {
  display: flex;
  width: fit-content;
  margin-inline: auto;
  max-width: min(92%, 330px);
  align-self: center;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid rgb(219 192 174 / 42%);
  border-radius: 999px;
  background: rgb(255 250 245 / 90%);
  box-shadow: 0 5px 16px rgb(87 63 52 / 7%);
  color: #98766a;
  font-size: 10px;
  line-height: 1.4;
  backdrop-filter: blur(10px);
}

.group-chat-red-packet-claim-notice > span {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #f05b3e, #ca2b2d);
  color: #ffe9b2;
  font-size: 11px;
}

.group-chat-red-packet-claim-notice p {
  overflow: hidden;
  margin: 0;
  color: #7f5c52;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-chat-red-packet-claim-notice time {
  flex: 0 0 auto;
  color: #b09a91;
  font-size: 9px;
}
