@keyframes star-fx-sparkle {
  0% {
    transform: translate(-50%, -50%) rotate(var(--star-angle)) translateX(0) scale(0.2);
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) rotate(var(--star-angle)) translateX(var(--star-distance)) scale(1);
    opacity: 0;
  }
}
@keyframes star-fx-float-up {
  0% {
    transform: translate(-50%, 0);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -52px);
    opacity: 0;
  }
}
@keyframes star-fx-float-down {
  0% {
    transform: translate(-50%, 0);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  100% {
    transform: translate(-50%, 52px);
    opacity: 0;
  }
}
@keyframes star-fx-pop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.35) rotate(-8deg);
  }
  70% {
    transform: scale(0.92) rotate(4deg);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes star-fx-shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}
.star-fx-sparkle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--star-size, 6px);
  height: var(--star-size, 6px);
  border-radius: 50%;
  background: #f5b301;
  box-shadow: 0 0 6px rgba(245, 179, 1, 0.8);
  pointer-events: none;
  animation: star-fx-sparkle 700ms cubic-bezier(0.2, 0.7, 0.3, 1) var(--star-delay, 0ms) forwards;
}

.star-fx-sparkle--star {
  width: auto;
  height: auto;
  background: none;
  box-shadow: none;
  color: #f5b301;
  font-size: var(--star-size, 10px);
  line-height: 1;
}

.star-fx-float {
  position: absolute;
  left: 50%;
  top: -6px;
  transform: translate(-50%, 0);
  padding: 2px 9px;
  border-radius: 999px;
  background: #d99a00;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  line-height: 18px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  animation: star-fx-float-up 1100ms ease-out forwards;
}

.star-fx-float--loss {
  top: auto;
  bottom: -6px;
  background: #e0564b;
  animation-name: star-fx-float-down;
}

.star-fx-pop {
  animation: star-fx-pop 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.star-fx-shake {
  animation: star-fx-shake 400ms ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
  .star-fx-sparkle,
.star-fx-float {
    display: none;
  }

  .star-fx-pop,
.star-fx-shake {
    animation: none;
  }
}
@keyframes star-reward-progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}
.star-reward {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(16, 24, 40, 0);
  transition: background 0.35s ease;
  pointer-events: none;
}
.star-reward[hidden] {
  display: none;
}

.star-reward--visible {
  background: rgba(16, 24, 40, 0.45);
  pointer-events: auto;
}

.star-reward__card {
  position: relative;
  width: min(420px, 100%);
  padding: 28px 24px 24px;
  border-radius: 20px;
  background: linear-gradient(160deg, #ffffff 0%, #fff8e6 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(245, 179, 1, 0.35);
  text-align: center;
  overflow: hidden;
  transform: translateY(24px) scale(0.92);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}
.star-reward--visible .star-reward__card {
  transform: none;
  opacity: 1;
}

.star-reward__close {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 6px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #6b7683;
  cursor: pointer;
}
.star-reward__close:hover, .star-reward__close:focus-visible {
  background: rgba(0, 0, 0, 0.06);
  outline: none;
}

.star-reward__badge {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff3c4, #ffd457 60%, #f5b301);
  box-shadow: 0 10px 30px rgba(245, 179, 1, 0.45), inset 0 -4px 10px rgba(0, 0, 0, 0.08);
}
.star-reward--loss .star-reward__badge {
  background: radial-gradient(circle at 30% 30%, #ffd9d5, #ef8a80 60%, #e0564b);
  box-shadow: 0 10px 30px rgba(224, 86, 75, 0.4), inset 0 -4px 10px rgba(0, 0, 0, 0.08);
}

.star-reward__icon {
  font-size: 56px;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(120, 80, 0, 0.35);
}

.star-reward__fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.star-reward__title {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 800;
  color: #2b3440;
}

.star-reward__subtitle {
  margin-top: 2px;
  font-size: 13px;
  color: #6b7683;
}

.star-reward__total {
  margin: 10px 0 4px;
  font-size: 44px;
  font-weight: 900;
  line-height: 1.1;
  color: #d99a00;
  font-variant-numeric: tabular-nums;
}
.star-reward__total .material-icons {
  font-size: 34px;
  vertical-align: -6px;
}
.star-reward--loss .star-reward__total {
  color: #e0564b;
}

.star-reward__reasons {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.star-reward__reason {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  border: 1px solid #ffe08a;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  font-size: 13px;
  font-weight: 600;
  color: #4a5560;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  transition-delay: calc(var(--star-i, 0) * 90ms + 500ms);
}
.star-reward--visible .star-reward__reason {
  opacity: 1;
  transform: none;
}

.star-reward__reason-qty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: #f5b301;
  color: #ffffff;
  font-weight: 800;
}

.star-reward__reason--loss {
  border-color: #f4b6b0;
}
.star-reward__reason--loss .star-reward__reason-qty {
  background: #e0564b;
}

.star-reward__link {
  display: inline-block;
  margin-top: 18px;
  padding: 10px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f5b301, #ff8c00);
  color: #ffffff !important;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(255, 140, 0, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.star-reward__link:hover, .star-reward__link:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(255, 140, 0, 0.45);
  text-decoration: none;
}

.star-reward__progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 4px;
  background: #f5b301;
  transform-origin: left;
}
.star-reward--visible .star-reward__progress {
  animation: star-reward-progress 8s linear forwards;
}
.star-reward--loss .star-reward__progress {
  background: #e0564b;
}

.star-menu--lit {
  color: #f5b301 !important;
  text-shadow: 0 0 10px rgba(245, 179, 1, 0.7);
}

@media (prefers-reduced-motion: reduce) {
  .star-reward,
.star-reward__card,
.star-reward__reason,
.star-reward__link {
    transition: none;
  }

  .star-reward__progress {
    display: none;
  }
}