.score-reward,
.reward-spectacle {
  isolation: isolate;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  animation: reward-lifetime var(--reward-duration) linear both;
}

.score-reward {
  position: absolute;
  z-index: 9;
  inset: 0;
  display: grid;
  place-items: end center;
  container-type: inline-size;
  padding: 0 4% 8%;
}

.score-reward__copy {
  position: relative;
  display: grid;
  place-items: center;
  color: var(--reward-type, #f5fada);
  text-align: center;
}

.score-reward__label { font-weight: 850; }

.score-reward__amount {
  font: 800 italic var(--payout-size, 1.6rem)/.96 var(--number, Georgia, serif);
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -.045em;
  padding-inline-end: .09em;
  white-space: nowrap;
}

.score-reward__ratio {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
}

.score-reward__mode {
  font-size: .71rem;
  font-weight: 850;
  line-height: 1.1;
  letter-spacing: .18em;
  text-indent: .18em;
  text-transform: uppercase;
  white-space: nowrap;
}

.score-reward .score-reward__copy {
  --payout-size: clamp(1.02rem, 5.7cqw, 2rem);
  z-index: 1;
  grid-auto-flow: column;
  column-gap: 2cqw;
  max-width: 96%;
  min-height: 31px;
  padding: 1.9cqw 3.4cqw;
  border: 1px solid #b6dc9c;
  border-radius: clamp(5px, 1.8cqw, 10px);
  background: linear-gradient(154deg, #254a36, #10241f 85%);
  box-shadow: inset 0 1px #c6f6b168, 0 2px #0e261a, 0 0 17px #9be6a674;
  animation: reward-small-hit 285ms cubic-bezier(.16, .74, .29, 1) both;
}

.score-reward .score-reward__label { font-size: clamp(.68rem, 3.35cqw, .96rem); }
.score-reward .score-reward__amount { font-size: min(var(--payout-size), calc(110cqw / var(--amount-length, 5))); }
.score-reward .score-reward__ratio {
  padding-left: 2cqw;
  border-left: 1px solid #b3dc9a77;
  color: #d9ecc2;
  font-size: clamp(.64rem, 3cqw, .86rem);
}

.score-reward[data-free='true'] .score-reward__copy {
  --reward-type: #fff1c6;
  border-color: #e9be79;
  background: linear-gradient(155deg, #573a1f, #271811 90%);
  box-shadow: inset 0 1px #fee8b24f, 0 2px #331d13, 0 0 20px #ffc67b80;
}
.score-reward[data-free='true'] :is(.score-reward__mode, .score-reward__ratio) { color: #ffda9d; }
.score-reward[data-free='true'] .score-reward__amount { font-size: min(var(--payout-size), calc(87cqw / var(--amount-length, 5))); }
.score-reward .score-reward__mode { font-size: clamp(.48rem, 2.5cqw, .72rem); letter-spacing: .07em; text-indent: 0; }

.score-reward__particle {
  position: absolute;
  left: 50%;
  top: 81%;
  width: var(--particle-size);
  aspect-ratio: 1;
  border: 1px solid #fff9;
  border-radius: 35% 40% 15% 45%;
  background: var(--spark);
  box-shadow: 0 0 8px var(--spark);
  animation: reward-small-spark 640ms var(--particle-delay) cubic-bezier(.08, .66, .19, 1) both;
}

.reward-spectacle {
  --reward-type: #fff0cd;
  --reward-glow: #cf6b49;
  --reward-light: #fec58c;
  --reward-border: #ffc788;
  --reward-frame: #e4a76671;
  --reward-panel: #2a1718;
  --reward-width: min(88vw, 31rem);
  --reward-title-size: clamp(1.75rem, 7.3vw, 3.7rem);
  --reward-score-size: clamp(2.3rem, 15.8vw, 6.2rem);
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
}

.reward-spectacle::before,
.reward-spectacle::after {
  content: '';
  position: absolute;
  pointer-events: none;
}

.reward-spectacle::before {
  z-index: 0;
  inset: 0;
  background: radial-gradient(ellipse at 50% 49%, #682e2b65, #2f1118a8 56%, #0c0b0eda 100%);
}

.reward-spectacle::after {
  z-index: 1;
  inset: clamp(9px, 2.4vmin, 28px);
  border: 1px solid var(--reward-frame);
  border-radius: clamp(9px, 2vmin, 25px);
  box-shadow: inset 0 0 25px #ff9a522d, inset 0 0 0 3px #ad745914;
}

.reward-spectacle__canvas {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.reward-spectacle__wave {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: clamp(320px, 78vmin, 980px);
  aspect-ratio: 1;
  border: 2px solid var(--reward-light);
  border-radius: 50%;
  outline: 1px solid var(--reward-glow);
  outline-offset: clamp(5px, 1vmin, 11px);
  box-shadow: 0 0 17px var(--reward-glow), inset 0 0 24px var(--reward-glow);
  animation: reward-viewport-wave 1280ms var(--wave-delay) cubic-bezier(.13, .56, .22, .96) both;
}

.reward-spectacle__wave:nth-of-type(2) { --wave-turn: -18deg; border-radius: 37%; }

.reward-spectacle__card,
.feature-spectacle__card {
  position: relative;
  z-index: 3;
  width: var(--reward-width);
  max-width: calc(100% - 30px);
  row-gap: clamp(5px, 1.6vmin, 15px);
  padding: clamp(21px, 5.5vmin, 52px) clamp(12px, 5.3vmin, 46px);
  border: 2px solid var(--reward-border);
  border-radius: clamp(12px, 4vmin, 33px);
  background:
    radial-gradient(ellipse at 50% 0, color-mix(in srgb, var(--reward-glow) 44%, transparent), transparent 71%),
    linear-gradient(146deg, color-mix(in srgb, var(--reward-panel) 86%, var(--reward-glow)), var(--reward-panel) 60%, var(--reward-panel));
  box-shadow: inset 0 0 0 3px #ffe5af22, 0 0 0 3px #160b09d4, 0 0 0 4px var(--reward-frame), 0 0 52px color-mix(in srgb, var(--reward-glow) 66%, transparent);
  animation: reward-card-hit 560ms cubic-bezier(.16, .75, .23, 1) both;
}

.reward-spectacle__card .score-reward__label {
  color: var(--reward-light);
  font: 750 var(--reward-title-size)/1.05 var(--number, Georgia, serif);
  letter-spacing: .045em;
  padding-inline-start: .04em;
  text-shadow: 0 2px #0f12118a, 0 0 18px color-mix(in srgb, var(--reward-glow) 68%, transparent);
}

.reward-spectacle__card .score-reward__amount {
  --payout-size: min(var(--reward-score-size), calc(128vw / var(--amount-length)), calc(54rem / var(--amount-length)));
  color: var(--reward-type);
  text-shadow: 0 1px var(--reward-border), 0 5px #100d0d8a, 0 0 23px color-mix(in srgb, var(--reward-glow) 54%, transparent);
  animation: reward-number-hit 570ms calc(var(--score-roll, 0ms) - 115ms) cubic-bezier(.15, .75, .3, 1) both;
}

.reward-spectacle__card .score-reward__ratio {
  padding: 5px clamp(12px, 3vmin, 22px);
  border: 1px solid var(--reward-frame);
  border-radius: 999px;
  background: #0e100c72;
  color: var(--reward-type);
  font-size: clamp(.8rem, 3.7vw, 1.25rem);
  line-height: 1.2;
  animation: reward-ratio-text 180ms calc(var(--score-roll, 160ms) - 145ms) ease-out both;
}

.reward-spectacle[data-free='true'] .reward-spectacle__card .score-reward__mode {
  color: #ffe1a1;
  text-shadow: 0 0 9px #eaa45566;
}

.reward-spectacle[data-tier='mega'] {
  --reward-type: #f0ffdc;
  --reward-glow: #65d0b5;
  --reward-light: #b9ffdb;
  --reward-border: #bcf8cf;
  --reward-frame: #84f5cc8a;
  --reward-panel: #102724;
  --reward-width: min(89vw, 36rem);
  --reward-title-size: clamp(1.95rem, 7.8vw, 4.25rem);
  --reward-score-size: clamp(2.65rem, 17vw, 7.2rem);
}

.reward-spectacle[data-tier='mega']::before {
  background:
    repeating-linear-gradient(123deg, transparent 0 18%, #8affd925 19%, transparent 23% 35%),
    radial-gradient(ellipse at 50% 49%, #32856c60, #132f35ab 52%, #081416ed 100%);
}

.reward-spectacle[data-tier='mega']::after {
  border-radius: clamp(7px, 1.8vmin, 21px) clamp(20px, 7vmin, 75px);
  box-shadow: inset 0 0 0 3px #9ffbd330, inset 0 0 27px #6cccc258, 0 0 15px #2e79566e;
}

.reward-spectacle[data-tier='mega'] .reward-spectacle__wave { --wave-turn: 17deg; border-radius: 20%; border-width: 3px; }
.reward-spectacle[data-tier='mega'] .reward-spectacle__wave:nth-of-type(2) { --wave-turn: -19deg; border-radius: 26%; }
.reward-spectacle[data-tier='mega'] .reward-spectacle__card { border-radius: 8px clamp(18px, 6vmin, 46px); }

.reward-spectacle[data-tier='mega'] .reward-spectacle__card::before,
.reward-spectacle[data-tier='mega'] .reward-spectacle__card::after {
  content: '';
  position: absolute;
  width: clamp(11px, 4vmin, 29px);
  aspect-ratio: 1;
  border: 1px solid #d6ffe9;
  background: linear-gradient(140deg, #bcffdf, #429d83 58%, #226c54);
  box-shadow: 0 0 17px #79e6c6, inset 0 0 0 2px #164f3f;
  transform: rotate(45deg);
}

.reward-spectacle[data-tier='mega'] .reward-spectacle__card::before { top: 10%; left: -1.7vmin; }
.reward-spectacle[data-tier='mega'] .reward-spectacle__card::after { bottom: 10%; right: -1.7vmin; }

.reward-spectacle[data-tier='legendary'] {
  --reward-type: #fff8d6;
  --reward-glow: #eeb85b;
  --reward-light: #ffe5a1;
  --reward-border: #ffdf8c;
  --reward-frame: #f2c06e9a;
  --reward-panel: #2d1910;
  --reward-width: min(89vw, 43rem);
  --reward-title-size: clamp(2.05rem, 8.4vw, 5rem);
  --reward-score-size: clamp(2.85rem, 18.6vw, 8.4rem);
}

.reward-spectacle[data-tier='legendary']::before {
  background:
    radial-gradient(ellipse at center, #b15c257b, #592f1bab 50%, #1f1211df 94%),
    repeating-conic-gradient(from 18deg at 50% 50%, #efab5475 0 11deg, transparent 16deg 32deg);
}

.reward-spectacle[data-tier='legendary']::after {
  inset: clamp(9px, 2.8vmin, 34px);
  border: 2px solid #ffcc793f;
  outline: 1px solid #bd824672;
  outline-offset: 4px;
  background:
    repeating-linear-gradient(45deg, transparent 0 19px, #f5cc7530 19px 21px, transparent 22px 32px),
    repeating-linear-gradient(-45deg, transparent 0 19px, #f5cc752e 19px 21px, transparent 22px 32px);
  mask-image: radial-gradient(ellipse at center, transparent 28%, #000 86%);
  box-shadow: inset 0 0 0 3px #8c502c89, inset 0 0 0 4px #f7c2766c, inset 0 0 36px #ffb65597;
}

.reward-spectacle[data-tier='legendary'] .reward-spectacle__wave {
  width: clamp(340px, 86vmin, 1080px);
  border: 3px solid #ffe6a2;
  outline: 2px solid #f1ad62;
  outline-offset: clamp(7px, 1.7vmin, 17px);
  box-shadow: 0 0 31px #ffc876, inset 0 0 18px #ffd2859f;
  animation-duration: 1430ms;
}

.reward-spectacle[data-tier='legendary'] .reward-spectacle__wave:nth-of-type(2) { --wave-turn: 19deg; border-radius: 34%; }
.reward-spectacle[data-tier='legendary'] .reward-spectacle__card {
  border-width: 3px;
  border-radius: clamp(20px, 6vmin, 53px) clamp(20px, 6vmin, 53px) clamp(14px, 3.4vmin, 34px) clamp(14px, 3.4vmin, 34px);
  box-shadow: inset 0 0 0 3px #a56e48, inset 0 0 0 4px #efb96b, 0 0 0 3px #784223, 0 0 0 5px #d69755, 0 0 70px #ce793f9f;
  animation-duration: 720ms;
}

.reward-spectacle[data-tier='legendary'] .reward-spectacle__card::before,
.reward-spectacle[data-tier='legendary'] .reward-spectacle__card::after {
  content: '';
  position: absolute;
  top: 50%;
  width: clamp(13px, 5.3vmin, 40px);
  height: clamp(30px, 12vmin, 95px);
  background: linear-gradient(145deg, #ffedaa 4%, #cc8a49 40%, #f5d484 51%, #9c572d 85%);
  clip-path: polygon(0 3%, 99% 26%, 73% 50%, 99% 74%, 0 97%, 30% 50%);
  transform: translateY(-50%);
}

.reward-spectacle[data-tier='legendary'] .reward-spectacle__card::before { left: -.55em; }
.reward-spectacle[data-tier='legendary'] .reward-spectacle__card::after { right: -.55em; transform: translateY(-50%) scaleX(-1); }
.reward-spectacle[data-tier='legendary'] .score-reward__label { font-weight: 750; letter-spacing: .07em; }
.reward-spectacle[data-tier='legendary'] .score-reward__amount { text-shadow: 0 2px #d3904d, 0 6px #3f210fe0, 0 0 24px #ffda8dba; }

.reward-spectacle[data-tier='free']::before {
  background: radial-gradient(ellipse at center, transparent 42%, #a76b2540 78%, #3e211169 100%);
}
.reward-spectacle[data-tier='free']::after { box-shadow: inset 0 0 23px #e6b45b58; }

.feature-spectacle {
  --reward-glow: #e6a352;
  --reward-light: #ffdc97;
  --reward-border: #ffd79a;
  --reward-frame: #d7a56c77;
  --reward-panel: #311718;
  --reward-width: min(89vw, 36rem);
  z-index: 41;
}

.feature-spectacle::before {
  background:
    radial-gradient(ellipse at 50% 52%, #b3553491, #632a2fac 54%, #1f1215e5 100%);
}

.feature-spectacle[data-kind='extend'] { --reward-panel: #39271a; }
.feature-spectacle[data-kind='start'] { --reward-panel: #541e26; }
.feature-spectacle .reward-spectacle__wave { border-radius: 25%; outline-offset: 12px; }
.feature-spectacle .reward-spectacle__wave:nth-of-type(2) { --wave-turn: 28deg; border-radius: 47%; }

.feature-spectacle__card {
  display: grid;
  place-items: center;
  color: #fff0cc;
  text-align: center;
  box-shadow: inset 0 0 0 3px #e3a3677b, 0 0 0 3px #593326, 0 0 0 4px #c28b4f, 0 0 47px #db733490;
}

.feature-spectacle__title {
  color: #ffe7aa;
  font: 750 clamp(1.9rem, 7vw, 4.15rem)/1.05 var(--number, Georgia, serif);
  text-shadow: 0 2px #482216, 0 0 14px #e99b607f;
  text-wrap: balance;
}

.feature-spectacle__detail {
  color: #fff0cf;
  font-size: clamp(.83rem, 3.5vw, 1.25rem);
  font-weight: 650;
  line-height: 1.3;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.feature-spectacle[data-presentation='ribbon'] {
  align-items: start;
  padding-block-start: max(env(safe-area-inset-top), clamp(8px, 3.3dvh, 35px));
}

.feature-spectacle[data-presentation='ribbon']::before,
.feature-spectacle[data-presentation='ribbon']::after,
.feature-spectacle[data-presentation='ribbon'] :is(.reward-spectacle__wave, .reward-spectacle__canvas) { display: none; }

.feature-spectacle[data-presentation='ribbon'] .feature-spectacle__card {
  width: max-content;
  min-width: min(56vw, 19rem);
  max-width: 92vw;
  row-gap: 3px;
  padding: 8px clamp(12px, 4vw, 24px) 10px;
  border-width: 1px;
  border-radius: 10px;
  box-shadow: inset 0 0 0 2px #edc68933, 0 0 0 1px #9d5b34, 0 4px 14px #1b0d0dcf;
}

.feature-spectacle[data-presentation='ribbon'] .feature-spectacle__title { font-size: clamp(1rem, 4.8vw, 1.6rem); }
.feature-spectacle[data-presentation='ribbon'] .feature-spectacle__detail { font-size: clamp(.69rem, 3.2vw, .91rem); }
.feature-spectacle[data-kind='finish'] { --reward-panel: #292218; }

@keyframes reward-lifetime {
  0% { opacity: 0; }
  8%, 80% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes reward-card-hit {
  0% { transform: translateY(7%) scale(.72); }
  46% { transform: translateY(-1%) scale(1.075); }
  65% { transform: scale(.99); }
  100% { transform: scale(1); }
}

@keyframes reward-number-hit {
  0% { transform: scale(1); }
  32% { transform: scale(1.09); }
  68% { transform: scale(.99); }
  100% { transform: scale(1); }
}

@keyframes reward-ratio-text { from { opacity: 0; } to { opacity: 1; } }

@keyframes reward-viewport-wave {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.35) rotate(var(--wave-turn, 0deg)); }
  28% { opacity: .71; }
  70% { opacity: .31; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.65) rotate(var(--wave-turn, 0deg)); }
}

@keyframes reward-small-hit {
  0% { transform: translateY(12%) scale(.8); }
  62% { transform: translateY(-2%) scale(1.055); }
  100% { transform: none; }
}

@keyframes reward-small-spark {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.33); }
  25% { opacity: .88; }
  100% { opacity: 0; transform: translate(var(--travel-x), var(--travel-y)) rotate(90deg) scale(.25); }
}

@media (max-height: 470px) {
  .reward-spectacle__card, .feature-spectacle__card { padding-block: clamp(12px, 4.3dvh, 29px); row-gap: 5px; }
  .reward-spectacle__card { translate: 0 4dvh; }
  .reward-spectacle__card .score-reward__label { font-size: min(var(--reward-title-size), 10dvh); }
  .reward-spectacle__card .score-reward__amount { font-size: min(var(--payout-size), 18dvh); }
  .feature-spectacle[data-presentation='ribbon'] { padding-block-start: max(env(safe-area-inset-top), 7px); }
}

@media (prefers-reduced-motion: reduce) {
  .score-reward,
  .reward-spectacle,
  .score-reward .score-reward__copy,
  .reward-spectacle__card,
  .reward-spectacle__card :is(.score-reward__amount, .score-reward__ratio),
  .feature-spectacle__card { animation: none; }

  .reward-spectacle__wave,
  .reward-spectacle__canvas,
  .score-reward__particle { display: none; }
}
