/* Later victories celebrate only the opportunities unlocked by this battle. */
#battle-ending.won[data-stage='rewards'] .loot-reveal {
  border: 0;
  box-shadow: none;
  background: none;
}
#battle-ending .loot-next-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #d6efee;
  text-align: center;
  font:
    800 14px/1.35 'Nunito',
    sans-serif;
  margin: 12px auto 0;
  max-width: 440px;
}
#battle-ending .loot-next-hint img {
  width: 30px;
  height: 32px;
  flex: 0 0 30px;
}
#battle-ending .loot-next-hint b {
  color: #ffe39a;
}
[data-loot-troop] .loot-mini-portrait {
  overflow: visible;
}
[data-loot-troop][data-opportunity]:not([data-opportunity='']) .loot-mini-portrait::after {
  content: '';
  position: absolute;
  top: -7px;
  right: -7px;
  width: 15px;
  height: 15px;
  z-index: 8;
  border: 2px solid #ffdb94;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, #ff9a84, #f2453e 50%, #a81124);
  box-shadow: 0 2px 4px #051d38;
  animation: reward-dot 1.7s ease-in-out infinite;
}
#battle-ending.won[data-reward-content='gems'] {
  align-items: center;
}
#battle-ending.won[data-reward-content='gems'] .celebration-scene {
  height: 100%;
  justify-content: center;
  gap: 30px;
}
#battle-ending.won[data-reward-content='gems'] .loot-reveal {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}
#battle-ending.won[data-reward-content='gems'] .loot-prize {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: auto;
  grid-row: auto;
}
#battle-ending.won[data-reward-content='gems'] .loot-stage {
  width: min(360px, 85vw);
  height: 190px;
  flex: none;
}
#battle-ending.won[data-reward-content='gems'] .loot-heap {
  transform: scale(1.25);
}
#battle-ending.won[data-reward-content='gems'] .loot-total {
  position: relative;
  margin: 0;
  text-align: center;
  flex-direction: row;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  white-space: nowrap;
}
#battle-ending.won[data-reward-content='gems'] .loot-total strong,
#battle-ending.won[data-reward-content='gems'] .loot-total span {
  font-size: clamp(38px, 6vw, 50px);
  line-height: 1.1;
}
#battle-ending.won[data-reward-content='gems'] .celebration-actions {
  margin: 0 0 24px;
}
#battle-ending.won[data-reward-content='cards'] {
  align-items: center;
}
#battle-ending.won[data-reward-content='cards'] .celebration-scene {
  width: min(900px, 100%);
  gap: 16px;
}
#battle-ending.won[data-reward-content='cards'] .loot-reveal {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0;
  align-items: center;
}
#battle-ending.won[data-reward-content='cards'] .loot-prize {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(440px, 100%);
  height: 140px;
  grid-row: auto;
}
#battle-ending.won[data-reward-content='cards'] .loot-stage {
  width: 230px;
  height: 130px;
  flex: none;
}
#battle-ending.won[data-reward-content='cards'] .loot-total {
  position: relative;
  text-align: center;
}
.level-card-unlocks {
  width: 100%;
  min-width: 0;
}
#battle-ending .level-card-unlocks h3 {
  margin: 0 0 14px;
  font:
    30px/1.1 'Lilita One',
    sans-serif;
  color: #ffe49f;
  text-align: center;
}
.level-unlock-cards {
  display: flex;
  align-items: start;
  gap: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 15px 10px 12px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: #e9c16d #15384c;
}
.level-unlock-cards:has(> :last-child:nth-child(-n + 3)) {
  justify-content: center;
}
.level-unlock-cards > article {
  flex: 0 0 150px;
  position: relative;
  scroll-snap-align: center;
  animation: reward-card-arrive 0.65s cubic-bezier(0.2, 0.8, 0.2, 1.1) both;
  animation-delay: calc(1.6s + var(--card-index, 0) * 0.1s);
}
#battle-ending .level-unlock-cards .loot-mini-portrait {
  width: 125px;
  height: auto;
  aspect-ratio: 63/88;
  margin: 0 auto;
}
#battle-ending .level-unlock-cards .loot-card-name {
  top: auto;
  bottom: 0;
  font-size: 17px;
}
#battle-ending .level-unlock-cards .loot-card-benefit,
#battle-ending .level-unlock-cards .loot-buy-stats {
  position: static;
  width: auto;
  min-height: 0;
  height: auto;
  margin: 9px 0 4px;
}
#battle-ending .level-unlock-cards .loot-card-benefit span,
#battle-ending .level-unlock-cards .loot-buy-stats span {
  font-size: 13px;
  line-height: 1.3;
}
#battle-ending .level-unlock-cards .loot-unlock-pill {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  font-size: 12px;
  margin: 0 0 8px;
}
#battle-ending .level-unlock-cards .loot-ranks {
  font-size: 17px;
}
#battle-ending .level-unlock-cards .loot-price {
  position: static;
  margin: 7px 0 0;
}
#battle-ending .level-unlock-cards .loot-price b {
  font-size: 25px;
}
.hero-battle-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  margin-top: 18px;
}
.hero-battle-stats > div {
  display: grid;
  grid-template-columns: 30px auto;
  gap: 2px 6px;
  align-items: center;
  animation: hero-portrait-arrive 0.55s 1.1s both;
}
.hero-battle-stats > div + div {
  animation-delay: 1.4s;
}
.hero-battle-stats img {
  width: 30px;
  height: 32px;
}
.hero-battle-stats strong {
  font:
    32px 'Lilita One',
    sans-serif;
  color: #ffe59e;
}
.hero-battle-stats strong b {
  font-weight: 400;
}
.hero-battle-stats small {
  font-size: 17px;
}
#battle-ending.won .hero-battle-stats span {
  grid-column: 1/-1;
  font:
    800 13px 'Nunito',
    sans-serif;
  color: #bed8dd;
}
@keyframes reward-dot {
  50% {
    box-shadow:
      0 0 0 5px #f14b4233,
      0 0 14px #ff8d5f88;
  }
}
@keyframes reward-card-arrive {
  from {
    opacity: 0;
    transform: translateY(25px) rotate(-5deg) scale(0.85);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (max-width: 600px) {
  .level-unlock-cards {
    gap: 12px;
  }
  .level-unlock-cards > article {
    flex-basis: 122px;
  }
  #battle-ending .level-unlock-cards .loot-mini-portrait {
    width: 108px;
  }
  #battle-ending .level-unlock-cards .loot-card-name {
    font-size: 15px;
  }
  #battle-ending .level-unlock-cards .loot-card-benefit span,
  #battle-ending .level-unlock-cards .loot-buy-stats span {
    font-size: 11px;
  }
  #battle-ending .level-unlock-cards .loot-unlock-pill {
    font-size: 10px;
  }
  .level-unlock-cards:has(> :last-child:nth-child(3)) {
    justify-content: flex-start;
  }
}
@media (max-height: 740px) and (orientation: portrait) {
  .hero-battle-stats {
    gap: 20px;
    margin-top: 10px;
  }
  .hero-battle-stats strong {
    font-size: 27px;
  }
  #battle-ending.won .hero-spotlight {
    width: 150px;
  }
  #battle-ending.won .hero-spotlight > svg {
    height: 150px;
  }
  #battle-ending.won[data-stage='hero'] .celebration-scene {
    gap: 10px;
  }
  #battle-ending.won .hero-honors h2 {
    font-size: 28px;
  }
  #battle-ending.won .hero-damage strong {
    font-size: 40px;
  }
  #battle-ending .loot-next-hint {
    font-size: 11px;
    margin-top: 6px;
  }
  #battle-ending.won[data-reward-content='cards'] .loot-prize {
    height: 95px;
  }
  #battle-ending.won[data-reward-content='cards'] .loot-stage {
    height: 95px;
    width: 190px;
  }
  #battle-ending .level-card-unlocks h3 {
    font-size: 25px;
    margin-bottom: 6px;
  }
  #battle-ending .level-unlock-cards .loot-mini-portrait {
    width: 90px;
  }
  .level-unlock-cards > article {
    flex-basis: 108px;
  }
  #battle-ending.won[data-reward-content='cards'] .loot-reveal {
    gap: 6px;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  #battle-ending.won[data-reward-content='cards'] .loot-reveal {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 8px 20px;
  }
  #battle-ending.won[data-reward-content='cards'] .loot-prize {
    grid-column: 1;
    grid-row: 1/3;
    flex-direction: column;
    height: auto;
  }
  #battle-ending.won[data-reward-content='cards'] .loot-total strong {
    font-size: 50px;
  }
  #battle-ending.won[data-reward-content='cards'] .loot-stage {
    height: 80px;
  }
  .level-unlock-cards > article {
    flex-basis: 102px;
  }
  #battle-ending .level-unlock-cards .loot-mini-portrait {
    width: 66px;
  }
  #battle-ending .level-unlock-cards .loot-card-name {
    font-size: 11px;
  }
  #battle-ending .level-unlock-cards .loot-card-benefit span,
  #battle-ending .level-unlock-cards .loot-buy-stats span {
    font-size: 10px;
  }
  #battle-ending .level-unlock-cards .loot-price b {
    font-size: 20px;
  }
  #battle-ending .level-card-unlocks h3 {
    font-size: 22px;
    margin-bottom: 0;
  }
  #battle-ending .loot-next-hint {
    font-size: 11px;
    margin: 0;
  }
  #battle-ending.won[data-reward-content='cards'] .celebration-scene {
    gap: 5px;
  }
  .level-unlock-cards {
    padding: 10px 5px 5px;
  }
  #battle-ending.won[data-reward-content='gems'] .loot-prize {
    flex-direction: row;
  }
  #battle-ending.won[data-reward-content='gems'] .loot-stage {
    height: 140px;
  }
  .hero-battle-stats {
    margin-top: 7px;
    gap: 20px;
  }
  .hero-battle-stats strong {
    font-size: 24px;
  }
  #battle-ending.won .hero-battle-stats span {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  [data-loot-troop] .loot-mini-portrait::after,
  .level-unlock-cards > article,
  .hero-battle-stats > div {
    animation: none !important;
  }
}
[data-loot-troop][data-opportunity]::after {
  display: none;
}
#battle-ending.won[data-stage='rewards'],
#battle-ending.won[data-stage='hero'] {
  background: radial-gradient(ellipse at 50% 38%, #2c576b, #102e46 65%, #081d32);
}

/* Keep the complete crystal silhouette inside its allocation, away from the counter. */
#battle-ending.won[data-stage='rewards'] .loot-prize {
  gap: clamp(22px, 4vw, 40px);
}
#battle-ending.won[data-reward-content='cards'] .loot-stage {
  width: clamp(150px, 42vw, 250px);
}
#battle-ending.won[data-reward-content='cards'] .loot-heap {
  transform: scale(0.86);
}
#battle-ending.won[data-reward-content='cards'] .loot-total {
  flex: 0 0 auto;
  margin: 0;
  min-width: 90px;
}
#battle-ending.won[data-reward-content='cards'] .loot-total span {
  margin-top: 10px;
}
#battle-ending.won[data-reward-content='cards'] .loot-reveal {
  gap: 24px;
}
.level-unlock-cards > article {
  animation: none;
  --reveal-delay: calc(2.25s + var(--card-index, 0) * 0.13s);
}
.reward-card-stage {
  position: relative;
  isolation: isolate;
  perspective: 850px;
  margin: 0 auto;
}
.reward-card-stage::before,
.reward-card-stage::after {
  content: '';
  pointer-events: none;
  position: absolute;
  z-index: -1;
  inset: -14px -12px;
  border-radius: 50%;
  background: radial-gradient(ellipse, #fff5bb99, #62dffb44 45%, transparent 72%);
  animation: reward-light-bloom 2s var(--reveal-delay) both;
}
.reward-card-stage::after {
  background: repeating-conic-gradient(
    from 12deg,
    transparent 0deg 19deg,
    #ffec9c55 22deg 26deg,
    transparent 29deg 45deg
  );
  -webkit-mask-image: radial-gradient(ellipse, #000 10%, transparent 70%);
  mask-image: radial-gradient(ellipse, #000 10%, transparent 70%);
  animation: reward-rays-turn 2.4s var(--reveal-delay) both;
}
#battle-ending .reward-card-stage .loot-mini-portrait {
  animation: reward-card-spin 2s var(--reveal-delay) linear both;
  box-shadow:
    0 3px #9c743c,
    0 12px 25px #031526aa,
    0 0 22px #ffe39e55;
}
.reward-card-shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}
.reward-card-shine::before {
  content: '';
  position: absolute;
  inset: -30% -90%;
  background: linear-gradient(110deg, transparent 40%, #fffbeebb 49%, transparent 58%);
  animation: reward-card-polish 0.85s calc(var(--reveal-delay) + 1.75s) both;
}
.level-unlock-cards .loot-unlock-pill,
.level-unlock-cards .loot-card-benefit,
.level-unlock-cards .loot-buy-stats,
.level-unlock-cards .loot-price {
  animation: reward-detail-reveal 0.45s calc(var(--reveal-delay) + 1.65s) both;
}
#battle-ending .level-unlock-cards .loot-price {
  gap: 6px;
  white-space: nowrap;
  padding: 7px 0 0;
}
#battle-ending .level-unlock-cards .loot-price small {
  flex-shrink: 0;
}
#battle-ending .level-unlock-cards .loot-card-benefit,
#battle-ending .level-unlock-cards .loot-buy-stats {
  transform: none;
}
.level-unlock-cards {
  padding: 24px 18px 14px;
}
#battle-ending .level-unlock-cards:has(> :only-child) .loot-mini-portrait {
  width: 150px;
}
.level-unlock-cards > article:only-child {
  flex-basis: 195px;
}
@keyframes reward-card-spin {
  0% {
    opacity: 0;
    transform: translateY(18px) rotateY(-40deg) rotateZ(-12deg) scale(0.45);
  }
  18% {
    opacity: 1;
    transform: translateY(6px) rotateY(0deg) rotateZ(-8deg) scale(0.72);
  }
  38% {
    transform: translateY(-8px) rotateY(140deg) rotateZ(5deg) scale(0.94);
  }
  58% {
    transform: translateY(-12px) rotateY(520deg) rotateZ(-3deg) scale(1.07);
  }
  78% {
    transform: translateY(-5px) rotateY(690deg) rotateZ(2deg) scale(1.05);
  }
  90% {
    transform: translateY(1px) rotateY(723deg) rotateZ(-1deg) scale(0.99);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotateY(720deg) rotateZ(0) scale(1);
  }
}
@keyframes reward-light-bloom {
  0%,
  15% {
    opacity: 0;
    transform: scale(0.4);
  }
  65% {
    opacity: 1;
    transform: scale(1.15);
  }
  100% {
    opacity: 0.75;
    transform: scale(1);
  }
}
@keyframes reward-rays-turn {
  from {
    opacity: 0;
    transform: rotate(-50deg) scale(0.3);
  }
  65% {
    opacity: 0.9;
  }
  to {
    opacity: 0.4;
    transform: rotate(45deg) scale(1.1);
  }
}
@keyframes reward-card-polish {
  from {
    transform: translateX(-65%);
  }
  to {
    transform: translateX(65%);
  }
}
@keyframes reward-detail-reveal {
  from {
    opacity: 0;
    translate: 0 7px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}
@media (max-width: 600px) {
  #battle-ending.won[data-reward-content='cards'] .loot-heap {
    transform: scale(0.62);
  }
  #battle-ending.won[data-reward-content='cards'] .loot-total strong {
    font-size: 50px;
  }
  #battle-ending.won[data-reward-content='cards'] .loot-reveal {
    gap: 12px;
  }
  #battle-ending .level-unlock-cards:has(> :only-child) .loot-mini-portrait {
    width: 130px;
  }
}
@media (max-height: 740px) {
  #battle-ending .level-unlock-cards:has(> :only-child) .loot-mini-portrait {
    width: 90px;
  }
  #battle-ending.won[data-reward-content='cards'] .loot-reveal {
    gap: 6px;
  }
  .level-unlock-cards {
    padding-block: 16px 8px;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  #battle-ending .level-unlock-cards:has(> :only-child) .loot-mini-portrait {
    width: 66px;
  }
  #battle-ending.won[data-stage='rewards'] .loot-prize {
    gap: 14px;
  }
  #battle-ending.won[data-reward-content='cards'] .loot-stage {
    width: 180px;
  }
  #battle-ending.won[data-reward-content='cards'] .loot-heap {
    transform: scale(0.64);
  }
}
@media (prefers-reduced-motion: reduce) {
  #battle-ending .reward-card-stage *,
  #battle-ending .reward-card-stage::before,
  #battle-ending .reward-card-stage::after,
  #battle-ending .reward-card-shine::before,
  #battle-ending .level-unlock-cards > article > * {
    animation: none !important;
  }
}
@media (max-height: 600px) and (orientation: portrait) {
  #battle-ending.won[data-reward-content='cards'] .loot-prize,
  #battle-ending.won[data-reward-content='cards'] .loot-stage {
    height: 76px;
  }
  #battle-ending.won[data-reward-content='cards'] .celebration-scene {
    gap: 8px;
  }
}
#battle-ending .level-unlock-cards .loot-card-benefit,
#battle-ending .level-unlock-cards .loot-buy-stats {
  background: none;
  padding: 0;
}
@media (prefers-reduced-motion: reduce) {
  .reward-card-shine {
    display: none;
  }
}
#battle-ending.won[data-reward-content='cards'] .loot-total {
  align-self: flex-end;
}
@media (max-height: 500px) and (orientation: landscape) {
  #battle-ending.won[data-reward-content='cards'] .loot-total {
    align-self: center;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  .level-unlock-cards {
    padding: 10px 8px 5px;
  }
  #battle-ending .level-unlock-cards .loot-price {
    padding-top: 0;
  }
}
@media (min-height: 741px) {
  #battle-ending .level-unlock-cards:has(> :only-child) .loot-buy-stats span,
  #battle-ending .level-unlock-cards:has(> :only-child) .loot-card-benefit span,
  #battle-ending .level-unlock-cards:has(> :only-child) .loot-price small {
    font-size: 14px;
  }
  #battle-ending .level-unlock-cards:has(> :only-child) .loot-unlock-pill {
    font-size: 13px;
  }
}

#battle-ending .level-unlock-cards .loot-card-description {
  margin: 10px auto 7px;
  max-width: 220px;
  color: #e0eef0;
  font:
    700 13px/1.3 Nunito,
    sans-serif;
  text-align: center;
  animation: reward-detail-reveal 0.45s calc(var(--reveal-delay) + 1.65s) both;
}
.level-unlock-cards > article {
  flex-basis: 180px;
}
@media (max-width: 600px) {
  .level-unlock-cards > article {
    flex-basis: 156px;
  }
  .level-unlock-cards:has(> :last-child:nth-child(2)) {
    justify-content: flex-start;
  }
  #battle-ending .level-unlock-cards .loot-card-description {
    font-size: 12px;
  }
}
@media (max-height: 600px) and (orientation: portrait) {
  #battle-ending.won[data-reward-content='cards'] .loot-prize,
  #battle-ending.won[data-reward-content='cards'] .loot-stage {
    height: 56px;
  }
  #battle-ending .level-unlock-cards .loot-mini-portrait,
  #battle-ending .level-unlock-cards:has(> :only-child) .loot-mini-portrait {
    width: 76px;
  }
  #battle-ending .level-unlock-cards .loot-card-description {
    margin-block: 5px;
    font-size: 11px;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  .level-unlock-cards > article {
    flex-basis: 160px;
  }
  #battle-ending .level-unlock-cards .loot-card-description {
    font-size: 11px;
    margin-block: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #battle-ending .level-unlock-cards .loot-card-description {
    animation: none;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  #battle-ending .level-unlock-cards .loot-mini-portrait,
  #battle-ending .level-unlock-cards:has(> :only-child) .loot-mini-portrait {
    width: 52px;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  #battle-ending.won[data-reward-content='cards'] .celebration-scene {
    gap: 0;
  }
  #battle-ending.won[data-reward-content='cards'] .celebration-actions button {
    min-height: 44px;
    height: 44px;
    padding: 4px 12px;
    font-size: 24px;
  }
}

/* A replay celebrates retained mastery, never an empty gem pile. */
#battle-ending.won[data-reward-content='replay'] {
  align-items: center;
  background: radial-gradient(ellipse at 50% 38%, #306879, #123147 60%, #0a2237);
}
#battle-ending.won[data-reward-content='replay'] .celebration-scene {
  width: min(620px, 100%);
  gap: clamp(18px, 4dvh, 36px);
}
.replay-reveal {
  width: 100%;
  text-align: center;
  color: #e4f2ed;
}
#battle-ending .replay-eyebrow {
  margin: 0 0 12px;
  font:
    900 13px/1.4 Nunito,
    sans-serif;
  letter-spacing: 1.5px;
  color: #a7dddf;
}
#battle-ending .replay-reveal h2 {
  font-size: clamp(28px, 6vw, 46px);
}
.replay-stars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: clamp(20px, 4dvh, 42px) 0;
  filter: drop-shadow(0 6px 4px #051d36);
}
.replay-stars img {
  width: clamp(72px, 20vw, 125px);
  height: auto;
}
.replay-stars img:nth-child(2) {
  width: clamp(90px, 24vw, 150px);
  margin-top: -18px;
}
.replay-stars .earned {
  filter: drop-shadow(0 0 22px #ffcf6360);
}
.replay-stars .unearned {
  filter: grayscale(1);
  opacity: 0.25;
}
.replay-achievement > strong {
  font:
    clamp(23px, 4vw, 32px) 'Lilita One',
    sans-serif;
  color: #ffe49d;
}
#battle-ending .replay-achievement p {
  margin: 6px 0 0;
  font-size: 15px;
  color: #c7e4e5;
}
.replay-record {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 20px 0 0;
  color: #aff5f1;
}
.replay-record img {
  width: 38px;
}
.replay-record strong {
  display: block;
  font:
    30px 'Lilita One',
    sans-serif;
  color: #ffebac;
}
.replay-record small {
  display: block;
  font:
    13px Nunito,
    sans-serif;
  color: #b9dbdf;
}
.replay-reward-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 22px;
  margin: 24px auto 0;
  border-top: 1px solid #91c5c52b;
  width: fit-content;
  max-width: 100%;
  text-align: left;
}
.replay-reward-note img {
  width: 34px;
  height: 38px;
}
.replay-reward-note strong {
  font-size: 15px;
  color: #cee8e8;
}
#battle-ending .replay-reward-note p {
  margin: 3px 0 0;
  font-size: 13px;
  color: #9fc4cc;
}
@media (prefers-reduced-motion: no-preference) {
  .replay-stars img {
    animation: replay-star-land 0.75s calc(0.15s + var(--star-index) * 0.17s)
      cubic-bezier(0.2, 0.8, 0.25, 1.2) both;
  }
  .replay-achievement,
  .replay-record,
  .replay-reward-note {
    animation: reward-detail-reveal 0.5s 0.85s both;
  }
}
@keyframes replay-star-land {
  from {
    opacity: 0;
    transform: translateY(-32px) scale(0.35) rotate(-18deg);
  }
  70% {
    opacity: 1;
    transform: scale(1.14) rotate(5deg);
  }
  to {
    transform: none;
  }
}
@media (max-height: 650px) {
  #battle-ending.won[data-reward-content='replay'] .celebration-scene {
    gap: 12px;
  }
  .replay-stars {
    margin: 18px 0;
  }
  .replay-stars img {
    width: 70px;
  }
  .replay-stars img:nth-child(2) {
    width: 85px;
  }
  .replay-record {
    margin-top: 12px;
  }
  .replay-reward-note {
    margin-top: 14px;
    padding-top: 12px;
  }
}
@media (max-height: 500px) and (orientation: landscape) {
  #battle-ending.won[data-reward-content='replay'] .celebration-scene {
    width: min(760px, 100%);
    gap: 8px;
  }
  .replay-reveal {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 5px 20px;
    align-items: center;
  }
  #battle-ending .replay-eyebrow {
    grid-column: 2;
    margin: 0;
  }
  #battle-ending .replay-reveal h2 {
    grid-column: 2;
    font-size: 27px;
    margin: 0;
  }
  .replay-stars {
    grid-column: 1;
    grid-row: 1 / 6;
    margin: 0;
    gap: 2px;
  }
  .replay-achievement,
  .replay-record,
  .replay-reward-note {
    grid-column: 2;
    margin: 0;
  }
  .replay-achievement > strong {
    font-size: 22px;
  }
  #battle-ending .replay-achievement p {
    font-size: 12px;
  }
  .replay-record strong {
    font-size: 23px;
  }
  .replay-reward-note {
    padding-top: 7px;
    justify-self: center;
  }
  #battle-ending.won[data-reward-content='replay'] .celebration-actions button {
    min-height: 44px;
    height: 44px;
    font-size: 24px;
    padding: 4px 12px;
  }
}

#battle-ending.won .loot-total {
  opacity: 0;
  transition: opacity 0.28s ease;
}
#battle-ending.won .loot-total.is-counting {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  #battle-ending.won .loot-total {
    transition: none;
  }
}
