
.pearl-open-rays {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 160vmax;
  height: 160vmax;
  margin: -80vmax 0 0 -80vmax;
  background: repeating-conic-gradient(rgba(255, 230, 160, 0.16) 0 6deg, transparent 6deg 16deg);
  -webkit-mask-image: radial-gradient(circle, #000 8%, transparent 45%);
  mask-image: radial-gradient(circle, #000 8%, transparent 45%);
  opacity: 0;
  transition: opacity 400ms ease;
  animation: rays 12s linear infinite;
  pointer-events: none;
}

.level-up.capsule-up {
  background: radial-gradient(circle at 50% 42%, rgba(186, 40, 190, 0.9), rgba(22, 4, 40, 0.97) 70%);
}

.level-up.capsule-up .pearl-open-rays {
  opacity: 0;
  transition: opacity 400ms ease;
}

.level-up.capsule-up.burst .pearl-open-rays {
  opacity: 0.9;
}

.level-up-title.capsule-title {
  font-size: 2.3rem;
  white-space: nowrap;
}

.level-up-stage.capsule-stage {
  height: 170px;
  transition: height 400ms ease;
}

.capsule-up.burst .level-up-stage.capsule-stage {
  height: 120px;
}

.chest.capsule-big {
  width: 150px;
  height: 116px;
  filter: drop-shadow(0 0 22px rgba(255, 79, 216, 0.8));
}


.capsule-up.shaking .capsule-big {
  animation: capsule-shake 1100ms ease-in forwards;
}

.capsule-up.burst .capsule-big {
  animation: capsule-pop 500ms ease-out forwards;
}

.capsule-up.burst .capsule-stage::after {
  content: "";
  position: absolute;
  inset: -40px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff, rgba(255, 190, 240, 0.6) 30%, transparent 65%);
  animation: pearl-flash 700ms ease-out forwards;
  pointer-events: none;
}

.capsule-prize-name {
  display: block;
  font-family: var(--display);
  font-size: 1.7rem;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
  background-image: var(--gold-bevel);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 var(--gold-deep)) drop-shadow(0 0 10px rgba(255, 79, 216, 0.8));
  animation: capsule-name 420ms cubic-bezier(0.2, 1.6, 0.4, 1);
}

.level-up.capsule-up.top {
  background: radial-gradient(circle at 50% 42%, rgba(255, 150, 60, 0.92), rgba(120, 10, 90, 0.95) 45%, rgba(20, 0, 30, 0.97) 75%);
}

.capsule-up.top .capsule-prize-name {
  font-size: 2.4rem;
  filter: drop-shadow(0 2px 0 var(--gold-deep)) drop-shadow(0 0 18px rgba(255, 255, 255, 0.9));
}

@keyframes capsule-wobble {
  0%, 60%, 100% { transform: rotate(0); }
  66% { transform: rotate(-7deg); }
  74% { transform: rotate(6deg); }
  82% { transform: rotate(-4deg); }
  90% { transform: rotate(2deg); }
}

@keyframes capsule-shake {
  0% { transform: rotate(0) scale(0.6); }
  15% { transform: rotate(-5deg) scale(1); }
  30% { transform: rotate(5deg); }
  45% { transform: rotate(-8deg); }
  60% { transform: rotate(8deg) scale(1.04); }
  75% { transform: rotate(-11deg) scale(1.06); }
  90% { transform: rotate(11deg) scale(1.08); }
  100% { transform: rotate(0) scale(1.1); }
}

@keyframes capsule-pop {
  0% { transform: scale(1.1); filter: brightness(2.5) drop-shadow(0 0 30px #fff); }
  100% { transform: scale(0.7); filter: drop-shadow(0 0 22px rgba(255, 79, 216, 0.8)); }
}

@keyframes capsule-name {
  from { transform: scale(0.4); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .level-up-stage.capsule-stage,
  .level-up.capsule-up .pearl-open-rays {
    transition: none;
  }
  .capsule-up.shaking .capsule-big,
  .capsule-up.burst .capsule-big,
  .capsule-up.burst .capsule-stage::after,
  .capsule-prize-name {
    animation: none;
  }
  .capsule-up.burst .capsule-stage::after {
    display: none;
  }
}


.spire-coin {
  width: 16px;
  height: 16px;
  box-shadow: none;
}

.spire-tier {
  position: relative;
  isolation: isolate;
  flex: none;
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) 76px;
  align-items: center;
  gap: 6px;
  min-height: 40px;
}

.spire-tier::before {
  content: "";
  position: absolute;
  left: 52px;
  right: 72px;
  bottom: 1px;
  z-index: -1;
  height: 5px;
  background: var(--gold-rim);
  clip-path: polygon(0 0, 3% 55%, 97% 55%, 100% 0, 100% 40%, 98% 100%, 2% 100%, 0 40%);
  opacity: 0.8;
}

.spire-ribbon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 9px;
  background:
    linear-gradient(180deg, var(--spire-ribbon-sheen), transparent 48%, var(--spire-ribbon-shade)),
    linear-gradient(180deg, var(--c), var(--c-dark));
  box-shadow: inset 0 2px 0 var(--gold-light), inset 0 -2px 0 var(--gold-dark);
  clip-path: polygon(0 0, 100% 0, calc(100% - 7px) 50%, 100% 100%, 0 100%, 7px 50%);
}

.spire-ribbon-name {
  color: var(--text);
  font-family: var(--display);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
  text-shadow: 0 1px 0 var(--c-dark), 0 0 2px rgba(0, 0, 0, 0.9);
}

.spire-tier.paid {
  opacity: 0.6;
}

.spire-prize {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}

.spire-planet {
  width: 16px;
  height: 16px;
  font-size: 16px;
}

.spire-prize .spire-coin {
  width: 14px;
  height: 14px;
}

.spire-prize-coins {
  color: var(--gold-light);
  font-family: var(--display);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-shadow: 0 1px 0 #000;
}

.spire-check {
  display: none;
  flex: none;
  width: 8px;
  height: 14px;
  margin: -4px 4px 0 0;
  border: solid var(--jade);
  border-width: 0 3px 3px 0;
  border-radius: 1px;
  transform: rotate(40deg);
  filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.8));
}

.spire-tier.paid .spire-check {
  display: block;
}

.spire-tier.paid .spire-coin,
.spire-tier.paid .spire-planet {
  display: none;
}

.spire-up-gem {
  position: relative;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--spire-gem-art) center / contain no-repeat;
}

.spire-up-gem.amber { --spire-gem-art: url("../art/nebula-empress/gems/amber.webp"); }
.spire-up-gem.sapphire { --spire-gem-art: url("../art/nebula-empress/gems/sapphire.webp"); }
.spire-up-gem.jade { --spire-gem-art: url("../art/nebula-empress/gems/jade.webp"); }
.spire-up-gem.ruby { --spire-gem-art: url("../art/nebula-empress/gems/ruby.webp"); }

.spire-up-gem::after {
  content: "";
  position: absolute;
  inset: 22%;
  background: url("../art/lobby/rush.webp") center / contain no-repeat;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

.spire-up-prizes {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  min-height: 104px;
}

.spire-up-prize {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 96px;
  animation: spire-prize-in 300ms ease-out both;
}

.spire-up-prizes.four {
  gap: 8px;
}

.spire-up-prizes.four .spire-up-prize {
  width: 82px;
}

.spire-up-mark.credits-coin {
  width: 60px;
  height: 60px;
}

.spire-up-mark.pearl {
  width: 60px;
  height: 60px;
  font-size: 60px;
}

.spire-up-amount {
  color: var(--gold-light);
  font-family: var(--display);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-align: center;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6);
}

.spire-up-label {
  margin-top: -3px;
  color: var(--muted);
  font-family: var(--display);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
  text-shadow: 0 1px 0 #000;
}

.spire-up-prize.planet .spire-up-amount {
  color: var(--text);
  font-size: 0.95rem;
}

.spire-up-note {
  max-width: 300px;
  color: var(--text);
  font-size: 0.8125rem;
  line-height: 1.35;
  text-align: center;
}

.spire-up-note[hidden] {
  display: none;
}

@keyframes spire-gem-in {
  from { transform: scale(0.4); opacity: 0; }
}

@keyframes spire-prize-in {
  from { transform: translateY(10px); opacity: 0; }
}

.level-up.league-up {
  --league-up-hall: #10283f;
  --league-up-floor: #061222;
  --league-up-scrim: rgba(6, 18, 34, 0.28);
  gap: 14px;
  background: linear-gradient(var(--league-up-scrim), var(--league-up-scrim)),
    url("../art/ui/league-podium.webp") center bottom / cover no-repeat,
    radial-gradient(circle at 50% 38%, var(--league-up-hall), var(--league-up-floor) 74%);
}

.level-up.league-up.down {
  --league-up-scrim: rgba(6, 18, 34, 0.78);
}

.level-up.league-up .pearl-open-rays {
  opacity: 0.85;
}

.level-up.league-up.down .pearl-open-rays {
  display: none;
}

.level-up-title.league-up-title {
  font-size: 2.6rem;
  line-height: 1.1;
  white-space: nowrap;
}

.level-up-title.league-up-title.long {
  font-size: 2.1rem;
}

.level-up.league-up.down .level-up-title {
  background: none;
  color: var(--muted);
  filter: none;
  text-shadow: 0 2px 0 var(--navy-deep);
}

.level-up-stage.league-up-stage {
  height: 140px;
}

.level-up.league-up.down .level-up-stage::before {
  display: none;
}

.league-up-badge {
  position: relative;
  display: inline-flex;
  justify-content: center;
  animation: spire-gem-in 700ms cubic-bezier(0.2, 1.5, 0.4, 1) both;
}

.league-up-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  filter: drop-shadow(0 3px 0 var(--gold-deep)) drop-shadow(0 0 22px rgba(255, 212, 90, 0.45));
}

.league-up-mark .league-mark {
  width: 100%;
  height: 100%;
}

.level-up.league-up.down .league-up-mark {
  opacity: 0.7;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.6));
}

.level-up.league-up.down .league-up-mark .league-mark {
  color: var(--muted);
}

.league-up-sub {
  position: absolute;
  left: 50%;
  bottom: 4px;
  min-width: 36px;
  padding: 1px 6px 0;
  border: 1px solid var(--gold);
  border-radius: 4px;
  background: var(--navy-deep);
  box-shadow: 0 0 0 1px var(--gold-deep);
  color: var(--gold-light);
  font-family: var(--display);
  font-size: 1.15rem;
  line-height: 1.15;
  letter-spacing: 0.08em;
  text-align: center;
  text-shadow: 0 1px 0 #000;
  transform: translateX(-50%);
}

.league-up-place {
  color: var(--text);
  font-family: var(--display);
  font-size: 1.5rem;
  letter-spacing: 0.08em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6);
}

.league-up-prize {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  animation: spire-prize-in 300ms ease-out both;
}

.league-up-coin.credits-coin {
  width: 56px;
  height: 56px;
}

.league-up-amount {
  max-width: 100%;
  color: var(--gold-light);
  font-family: var(--display);
  font-size: 1.9rem;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-align: center;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6);
}

.league-up-note {
  max-width: 320px;
  color: var(--text);
  font-size: 0.8125rem;
  line-height: 1.35;
  text-align: center;
  text-wrap: balance;
}

.league-up .pearl-collect {
  width: min(240px, 100%);
}

@media (max-height: 700px) {
  .level-up.league-up { gap: 10px; }
  .level-up-stage.league-up-stage { height: 110px; }
  .league-up-mark { width: 96px; height: 96px; }
  .spire-tier { min-height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .spire-up-prize,
  .league-up-badge,
  .league-up-prize {
    animation: none;
  }
}


.level-row {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 2px 0;
}

.level-row .rush-button,
.level-row .league-button {
  width: 44px;
  height: 44px;
  border-radius: 8px;
}

.level-row .league-icon { font-size: 1.05rem; }
.level-row .league-rank { font-size: 0.7rem; }
.level-row .badge { top: -4px; right: -4px; }

.level {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
  height: 28px;
}

.level-star {
  position: relative;
  z-index: 1;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-right: -8px;
  background: url("../art/ui/level-star.webp") center / contain no-repeat;
  filter: drop-shadow(0 0 4px rgba(255, 211, 77, 0.8));
  color: #4a2a00;
  font-family: var(--display);
  font-size: 0.74rem;
  letter-spacing: -0.03em;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.level-star > span {
  margin-top: 3px;
}

.level-star.long {
  font-size: 0.58rem;
}

.level-bar {
  position: relative;
  flex: 1;
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid var(--gold-dark);
  box-shadow: 0 0 0 1px var(--gold-deep), inset 0 2px 3px rgba(0, 0, 0, 0.6);
}

.level-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), transparent 55%),
    linear-gradient(90deg, #b0128a, var(--neon-pink) 70%, #ffb0f0);
  box-shadow: 0 0 8px var(--neon-pink);
  transition: width 400ms ease-out;
}

.level-text {
  position: absolute;
  left: 30px;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  color: #fff;
  font-family: var(--display);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px #000, 0 0 3px #000;
  pointer-events: none;
}

.wheel-button {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  min-width: 88px;
  padding: 0 10px 0 3px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 50%),
    linear-gradient(180deg, var(--console-light), var(--navy-deep));
  border: 2px solid var(--gold-dark);
  box-shadow: 0 0 0 1px var(--gold-deep);
  color: var(--muted);
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.wheel-button.ready {
  border-color: var(--gold);
  color: var(--gold-light);
  animation: wheel-ready 1.6s ease-in-out infinite;
}

.wheel-button.ready::after {
  content: "";
  position: absolute;
  top: -4px;
  right: -3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--ruby);
  border: 2px solid #fff;
}

.wheel-icon {
  flex: none;
  width: 22px;
  height: 22px;
  background: url("../art/lobby/wheel.webp") center / contain no-repeat;
}

.wheel-button.ready .wheel-icon {
  animation: wheel-icon-spin 4s linear infinite;
}

.bet-step.locked {
  position: relative;
  opacity: 0.75;
}

.bet-step.locked::after {
  content: "";
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 12px;
  height: 10px;
  border: 1px solid var(--gold-deep);
  border-radius: 2px;
  background: var(--gold-bevel);
}

.bet-step.locked::before {
  content: "";
  position: absolute;
  right: -2px;
  bottom: 4px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--gold);
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
}

