.pearl-open > .pearl-skip,
.level-up > .reveal-skip {
  position: absolute;
  right: 18px;
  bottom: calc(var(--safe-bottom) + 20px);
  z-index: 4;
}

.pearl-open > .pearl-skip,
.level-up > .reveal-skip,
.voyage-up-actions > .reveal-skip {
  min-width: 96px;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid rgba(205, 185, 255, 0.7);
  border-radius: 10px;
  background: linear-gradient(180deg, #8d5fff, #5a2fd6);
  box-shadow: 0 0 12px rgba(140, 90, 255, 0.6);
  color: #fff;
  font-family: var(--display);
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pearl-open.done .pearl-skip,
.level-up.done .reveal-skip {
  display: none;
}

.pearl-prizes {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 360px;
  min-height: 120px;
}

.pearl-prize {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #2a1a6a, var(--navy-deep));
  border: 2px solid var(--gold-dark);
  box-shadow: 0 0 0 1px var(--gold-deep);
  color: var(--text);
  font-family: var(--display);
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-shadow: 0 1px 0 #000;
  animation: pearl-prize 300ms ease-out;
}

.pearl-prize.coins {
  border-color: var(--gold);
  font-size: 1.4rem;
  color: var(--gold-light);
}

.pearl-open .pearl-prize {
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.pearl-prize-icon {
  flex: none;
  font-size: 1.4rem;
}

.pearl-collect {
  position: relative;
  display: block;
  width: 100%;
  max-width: 360px;
  visibility: hidden;
}

.pearl-open.done .pearl-collect {
  visibility: visible;
}

.pearl-open.all {
  gap: 12px;
}

.pearl-open.all .pearl-open-name {
  font-size: 1.7rem;
}

.pearl-open.all.burst .pearl-open-stage {
  height: 110px;
}

.pearl-open.all .pearl-prizes,
.pearl-open.all.burst .pearl-prizes {
  flex: 0 1 auto;
  min-height: 0;
}

.pearl-open.all .pearl-reward-row {
  gap: 8px;
}

.pearl-open.all .pearl-prize.tile {
  width: 72px;
  min-height: 82px;
  padding: 6px 3px;
}

.pearl-open.all .pearl-prize.tile.coins {
  width: 90px;
}

.pearl-open.all .pearl-prize.tile .pearl-prize-icon {
  font-size: 1.6rem;
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.pearl-prize.tile.starlight .pearl-prize-icon {
  display: block;
  width: 34px;
  height: 34px;
  margin: 0 auto;
  filter: none;
}

.pearl-prize.tile.starlight .pearl-prize-amount {
  color: var(--starlight);
}

.booster-mark {
  flex: none;
  width: 1em;
  height: 1em;
  object-fit: contain;
}

.pearl-prize.tile .booster-mark.pearl-prize-icon {
  display: block;
  width: 34px;
  height: 34px;
  margin: 0 auto;
}

.pearl-reward-row:has(> .pearl-prize.tile:nth-child(5)) .booster-mark.pearl-prize-icon {
  width: 30px;
  height: 30px;
}

.pearl-reward-row:has(> .pearl-prize.tile:nth-child(6)) .booster-mark.pearl-prize-icon {
  width: 28px;
  height: 28px;
}


.pearl-reward-row:has(> .pearl-prize.tile:nth-child(5)) {
  gap: 5px;
}

.pearl-reward-row:has(> .pearl-prize.tile:nth-child(5)) > .pearl-prize.tile {
  width: 62px;
  min-height: 82px;
  padding: 6px 2px;
}

.pearl-reward-row:has(> .pearl-prize.tile:nth-child(5)) > .pearl-prize.tile.coins {
  width: 82px;
}

.pearl-reward-row:has(> .pearl-prize.tile:nth-child(5)) .pearl-prize-icon {
  font-size: 1.6rem;
}

.pearl-reward-row:has(> .pearl-prize.tile:nth-child(6)) {
  gap: 4px;
}

.pearl-reward-row:has(> .pearl-prize.tile:nth-child(6)) > .pearl-prize.tile {
  width: 52px;
  padding: 6px 1px;
}

.pearl-reward-row:has(> .pearl-prize.tile:nth-child(6)) > .pearl-prize.tile.coins {
  width: 66px;
}

/* STARLIGHT is the row's longest label: its tile is 4px wider (66, five
   more and the gaps make 350px, inside the 353px row; the coins' tile
   keeps its 66px, which "+4.50M" needs in WebKit). */
.pearl-reward-row:has(> .pearl-prize.tile:nth-child(6)) > .pearl-prize.tile.starlight {
  width: 56px;
}

.pearl-reward-row:has(> .pearl-prize.tile:nth-child(6)) .pearl-prize-amount {
  font-size: 1rem;
}

.pearl-reward-row:has(> .pearl-prize.tile:nth-child(6)) .pearl-prize-text {
  letter-spacing: 0;
}

.pearl-reward-row:has(> .pearl-prize.tile:nth-child(6)) > .pearl-prize.tile.starlight .pearl-prize-icon {
  width: 28px;
  height: 28px;
}


.pearl-prize-amount {
  flex: none;
  color: var(--gold-light);
  font-variant-numeric: tabular-nums;
  letter-spacing: normal;
  text-transform: none;
  white-space: pre;
}

.pearl-prize.coins,
.pearl-open.all .pearl-prize:not(.each) {
  flex: none;
}



.pearl-open.leaving {
  z-index: 44;
  pointer-events: none;
  background: transparent;
}

.pearl-open.leaving > .pearl-open-space {
  animation: leave-fade 420ms ease-in-out both;
}

.pearl-open.leaving .pearl-open-title {
  animation: leave-drop 330ms cubic-bezier(0.4, 0, 0.7, 0.3) both;
}

.pearl-open.leaving .pearl-prizes {
  animation: leave-drop 340ms cubic-bezier(0.4, 0, 0.7, 0.3) 40ms both;
}

.pearl-open.leaving .pearl-open-star {
  animation: leave-star 400ms ease-in both;
}

.pearl-open.leaving .pearl-collect {
  animation: leave-fade 200ms ease-out both;
}

@keyframes leave-fade {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes leave-drop {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(56px) scale(0.94); }
}

@keyframes leave-star {
  0% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
  62% { opacity: 1; transform: scale(0.1); box-shadow: 0 0 60px 20px rgba(255, 255, 255, 0.6); }
  78% { opacity: 1; transform: scale(0.14); box-shadow: 0 0 220px 90px rgba(255, 255, 255, 0.95); }
  100% { opacity: 0; transform: scale(0.02); box-shadow: 0 0 400px 160px rgba(255, 255, 255, 0); }
}

.streak-bolt {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  filter: drop-shadow(0 0 3px var(--p-light, var(--gold-light))) drop-shadow(0 0 10px var(--p-glow, var(--gold)));
  animation: streak-flicker 700ms linear both;
}

.streak-bolt polyline {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.streak-bolt .streak-glow {
  stroke: var(--p, var(--gold));
  stroke-width: 8;
  opacity: 0.55;
}

.streak-bolt .streak-core {
  stroke: var(--p-light, var(--gold-light));
  stroke-width: 2.4;
}

.streak-bolt .streak-glow.fork { stroke-width: 4.5; }
.streak-bolt .streak-core.fork { stroke-width: 1.3; }

@keyframes streak-flicker {
  0% { opacity: 0; }
  6% { opacity: 1; }
  18% { opacity: 0.45; }
  26% { opacity: 1; }
  40% { opacity: 0.6; }
  50% { opacity: 1; }
  64% { opacity: 0.7; }
  72% { opacity: 0.95; }
  100% { opacity: 0; }
}

.dust-speck {
  position: absolute;
  border-radius: 50%;
  background: var(--gold-light);
  box-shadow: 0 0 6px 1px var(--gold);
  opacity: 0;
  animation: dust-drift 1200ms ease-out both;
}

.dust-speck.tier {
  background: var(--p-light, var(--text));
  box-shadow: 0 0 6px 2px var(--p-glow, var(--gold));
}

@keyframes dust-drift {
  0% { opacity: 0; transform: translate(0, 0) scale(0.5); }
  18% { opacity: 1; transform: translate(calc(var(--dx) * 0.2), calc(var(--dy) * 0.15)) scale(1); }
  55% { opacity: 0.6; }
  70% { opacity: 0.95; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.4); }
}

@media (prefers-reduced-motion: reduce) {
  .streak-bolt,
  .dust-speck {
    display: none;
  }
}


.fly-coin {
  position: absolute;
  width: 32px;
  height: 32px;
  background: url("../art/ui/coin-gold.webp") center / contain no-repeat;
  filter: drop-shadow(0 0 4px rgba(255, 211, 77, 0.8)) drop-shadow(0 0 10px rgba(255, 150, 20, 0.4));
  opacity: 0;
  will-change: transform, opacity;
}

.credits.coin-pop {
  animation: coin-credits-pop 120ms ease-out;
}

.credits.coin-pop .credits-coin {
  animation: coin-icon-bump 180ms cubic-bezier(0.3, 1.6, 0.5, 1);
}

.coin-ring {
  position: absolute;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border-radius: 50%;
  border: 2px solid var(--gold-light);
  box-shadow: 0 0 10px 1px var(--gold), inset 0 0 8px rgba(255, 211, 77, 0.6);
  animation: coin-ring 520ms ease-out forwards;
}

@keyframes coin-credits-pop {
  50% { transform: scale(1.06); }
}

@keyframes coin-icon-bump {
  40% { transform: scale(1.28); }
}

@keyframes coin-ring {
  from { transform: scale(0.6); opacity: 1; }
  to { transform: scale(2.6); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .credits.coin-pop,
  .credits.coin-pop .credits-coin {
    animation: none;
  }
  .coin-ring {
    animation-duration: 1ms;
  }
}


.fly-boost {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  filter: drop-shadow(0 0 5px var(--boost-glow, var(--gold))) drop-shadow(0 0 12px var(--boost-glow, var(--gold)));
  will-change: transform;
}

.boost-spark {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold-light);
  box-shadow: 0 0 4px 1px var(--boost-glow, var(--gold));
  animation: boost-spark 520ms ease-out both;
}

@keyframes boost-spark {
  0% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.3); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .boost-spark { display: none; }
}


