
:root {
  --astral-top: #63f0ff;
  --astral-mid: #7a4dff;
  --astral-base: #c03cff;
  --astral-deep: #2a0d63;
  --astral-glow: rgba(140, 230, 255, 0.6);
}

.astral-mark {
  display: inline-block;
  flex: none;
  width: 1.4em;
  height: 1.4em;
  background: url("../art/drawn/astral.svg") center / contain no-repeat;
}

.astral-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 76px;
  min-height: 44px;
  padding: 4px 10px 4px 6px;
  border: 2px solid #d8f8ff;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.06) 46%, transparent 52%),
    linear-gradient(180deg, var(--astral-top), var(--astral-mid) 52%, var(--astral-base));
  box-shadow: 0 0 0 1px var(--astral-deep), 0 3px 0 var(--astral-deep);
  color: #fff;
  font-family: var(--display);
  font-size: var(--type-key);
  letter-spacing: 0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 var(--astral-deep), 0 0 3px var(--astral-deep);
  transition: transform 80ms ease;
}

.astral-key .astral-mark {
  width: 26px;
  height: 26px;
  margin: -6px 0;
}

.astral-key:active {
  transform: scale(0.96);
}

.astral-key.short {
  filter: saturate(0.55) brightness(0.8);
}

.astral-key:disabled {
  opacity: 0.45;
}

.astral-key[hidden] {
  display: none;
}


.astral-chip {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
  height: 44px;
  padding: 0 4px 0 2px;
  border: 0;
  background: none;
  color: var(--text);
  font-family: var(--display);
  font-size: var(--type-readout);
  letter-spacing: 0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.astral-chip::before {
  content: "";
  position: absolute;
  inset: 6px 0 6px 12px;
  z-index: -1;
  border: 1.5px solid var(--gold-dark);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 45%),
    linear-gradient(180deg, #000, #1a0b30);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.8), 0 0 0 1px #12051f;
}

.astral-chip {
  isolation: isolate;
}

.astral-chip .astral-mark {
  width: 32px;
  height: 32px;
}

.astral-chip-amount {
  min-width: 2ch;
  text-shadow: 0 1px 0 #000;
}

.astral-chip-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  background: linear-gradient(180deg, #4cf07d, #15a443 55%, #07662a);
  box-shadow: 0 0 0 1px var(--gold-deep);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  text-shadow: 0 1px 0 #054018;
}

.astral-chip.landed {
  animation: astral-landed 600ms ease-out;
}

@keyframes astral-landed {
  0% { transform: scale(1); }
  35% { transform: scale(1.12); filter: drop-shadow(0 0 8px var(--astral-glow)); }
  100% { transform: scale(1); }
}

html.landscape .lobby-topbar .credits {
  margin: 0 0 0 auto;
}

#pearl-sheet .pearl-astrals {
  position: absolute;
  top: calc(var(--safe-top) + 62px);
  right: calc(var(--safe-right) + 12px);
  z-index: 3;
}


.astral-store,
.astral-ask {
  z-index: 47;
}

.astral-ask {
  z-index: 46;
}

.astral-ask.open {
  background: rgba(8, 0, 20, 0.88);
}

.astral-store-panel,
.astral-ask-panel {
  align-items: center;
  gap: 8px;
}

.astral-store-panel {
  max-width: 372px;
  padding: 30px 12px 14px;
}

#astral-store.open {
  background: color-mix(in srgb, var(--bg-deep) 86%, transparent);
}

.astral-close {
  position: absolute;
  top: -14px;
  right: -14px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: linear-gradient(180deg, var(--lacquer-light), var(--violet) 55%, var(--violet-deep));
  box-shadow: 0 0 0 1px var(--gold-deep), 0 3px 6px rgba(0, 0, 0, 0.5);
}

.astral-close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #fff;
  stroke-width: 3;
  stroke-linecap: round;
}

.astral-held {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-family: var(--display);
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 #000;
}

.astral-held .astral-mark {
  width: 30px;
  height: 30px;
}

.astral-packs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 8px;
  width: 100%;
}

.astral-pack {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.astral-pack.claimed-now {
  animation: astral-landed 600ms ease-out;
}

.astral-pack-art {
  position: relative;
  display: block;
  width: 80px;
  height: 80px;
  overflow: hidden;
}

.astral-pack-art img,
.astral-hero img {
  position: absolute;
  width: 300%;
  height: 200%;
  max-width: none;
}

.astral-pack-tag {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 6px;
  border: 1px solid var(--neon-pink);
  border-radius: 4px;
  background: var(--red-dark);
  color: var(--text);
  font-family: var(--display);
  font-size: var(--type-label);
  letter-spacing: 0.06em;
  white-space: nowrap;
  text-shadow: 0 1px 0 #000;
}

.astral-pack-amount {
  font-family: var(--display);
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background-image: var(--gold-bevel);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 0 #2a1200) drop-shadow(0 0 2px rgba(0, 0, 0, 0.6));
}

.astral-pack-points {
  color: var(--text);
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0.035em;
  line-height: 1.1;
}

.astral-pack-buy {
  min-width: 76px;
  min-height: 44px;
  margin-top: 2px;
  padding: 4px 8px;
  border: 2px solid var(--gold-light);
  border-radius: var(--radius);
  background: var(--gold-bevel);
  box-shadow: 0 0 0 1px var(--gold-deep), 0 3px 0 var(--gold-deep);
  color: var(--gold-deep);
  font-family: var(--display);
  font-size: var(--type-key);
  letter-spacing: 0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.astral-pack-buy:active {
  transform: scale(0.96);
}

#astral-store .astral-pack-buy {
  color: var(--gold-ink);
  text-shadow: none;
}

.astral-pack-buy[hidden] {
  display: none;
}

.astral-ask-panel {
  max-width: 300px;
  padding: 30px 16px 12px;
}

.astral-ask-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
}

.astral-ask-hero .pearl.astral-ask-planet {
  width: 92px;
  height: 92px;
  font-size: 92px;
}

.astral-ask-hero .astral-ask-spark {
  width: 76px;
  height: 76px;
  filter: drop-shadow(0 0 10px rgba(255, 79, 216, 0.7));
}

.astral-ask-name {
  color: var(--text);
  font-family: var(--display);
  font-size: var(--type-readout);
  letter-spacing: 0.05em;
  text-align: center;
  text-shadow: 0 1px 0 #000;
}

.astral-ask-held {
  font-size: 1rem;
}

.astral-ask-balance-label {
  color: var(--muted);
  font-size: 0.8125rem;
}

.astral-ask-held .astral-mark {
  width: 24px;
  height: 24px;
}

.astral-ask-go,
.astral-ask-get {
  min-width: 150px;
}

.astral-ask-spend { margin-right: 3px; }

.astral-ask-decline {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--muted);
  font-family: var(--display);
  font-size: var(--type-key);
  letter-spacing: 0.06em;
}


.purchase-hero .astral-hero {
  position: relative;
  display: block;
  width: 120px;
  height: 120px;
  overflow: hidden;
  filter: drop-shadow(0 0 14px var(--astral-glow));
}

.spire-up-prize.astrals .astral-mark.spire-up-mark {
  width: 34px;
  height: 34px;
}


.wheel-respin-cost {
  position: absolute;
  left: 50%;
  top: calc(50% + 13% - 4px);
  z-index: 4;
  display: none;
  align-items: center;
  gap: 2px;
  padding: 1px 6px 1px 2px;
  border: 1px solid #d8f8ff;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--astral-mid), var(--astral-deep));
  box-shadow: 0 0 0 1px var(--astral-deep);
  color: #fff;
  font-family: var(--display);
  font-size: var(--type-readout);
  letter-spacing: 0.04em;
  line-height: 1;
  transform: translateX(-50%);
  pointer-events: none;
  text-shadow: 0 1px 0 var(--astral-deep);
}

.wheel-respin-cost .astral-mark {
  width: 22px;
  height: 22px;
}

.wheel.respin .wheel-respin-cost {
  display: inline-flex;
}

.wheel-astrals {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.wheel-respins {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--gold-deep);
  border-radius: 6px;
  background: var(--plate-fill);
  font-family: var(--display);
  letter-spacing: 0.05em;
  line-height: 1;
}

.wheel-respins-label {
  color: var(--text);
  font-size: var(--type-label);
  text-shadow: 0 1px 0 #000;
}

.wheel-respins-count {
  color: var(--gold-light);
  font-size: var(--type-readout);
  font-variant-numeric: tabular-nums;
}

.wheel.spinning .wheel-astrals,
.wheel.boosting .wheel-astrals {
  display: none;
}

.wheel.cosmic .wheel-astrals {
  visibility: hidden;
}

.chart-reward-keys {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 18px;
  width: 100%;
}

.chart-reward.respin-offer .chart-reward-keys .pearl-collect {
  width: min(200px, 46%);
}

.chart-reward-respin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 240ms ease;
}

.chart-reward-respin[hidden] {
  display: none;
}

.chart-reward.ready .chart-reward-respin {
  opacity: 1;
}

.chart-reward-respin-label {
  color: var(--text);
  font-family: var(--display);
  font-size: var(--type-label);
  letter-spacing: 0.06em;
  text-shadow: 0 1px 0 #000;
}

.chart-reward-respin-key {
  min-width: 150px;
}


.rush-fast .rush-booster-mark .astral-mark {
  width: 32px;
  height: 32px;
}

.rush-fast[hidden] {
  display: none;
}


.astral-trade {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 1px solid var(--hairline);
}

.astral-trade-name {
  color: var(--text);
  font-family: var(--display);
  font-size: var(--type-readout);
  letter-spacing: 0.06em;
  text-shadow: 0 1px 0 #000;
}

.astral-trade-keys {
  display: flex;
  gap: 8px;
}

.astral-trade-key {
  flex: 1 1 0;
  min-width: 0;
  gap: 2px;
  padding: 2px 6px 2px 2px;
}

.astral-trade-key .pearl.astral-trade-planet {
  width: 30px;
  height: 30px;
  font-size: 30px;
  flex: none;
}

.astral-trade-key .astral-mark {
  width: 20px;
  height: 20px;
  margin: 0;
}


html.landscape .astral-store-panel {
  max-width: 640px;
}

html.landscape .astral-packs {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

html.landscape .astral-ask-panel {
  max-width: 300px;
  gap: 6px;
}

html.landscape .astral-ask-hero {
  width: 76px;
  height: 76px;
}

html.landscape .astral-ask-hero .pearl.astral-ask-planet {
  width: 72px;
  height: 72px;
  font-size: 72px;
}

html.landscape #pearl-sheet.destination-screen .pearl-contents > .astral-trade {
  grid-column: 2;
  grid-row: 5;
  padding: 4px 0 6px;
}

html.landscape #pearl-sheet.destination-screen .pearl-odds-button { grid-row: 6; }
html.landscape #pearl-sheet.destination-screen .pearl-odds { grid-row: 7; }

html.landscape #pearl-sheet .pearl-astrals {
  top: 10px;
  right: calc(var(--safe-right) + 66px);
}

@media (max-width: 740px) {
  html.landscape .astral-trade-key {
    display: inline-grid;
    grid-template-columns: auto auto;
    align-content: center;
    justify-items: center;
    padding: 2px;
  }

  html.landscape .astral-trade-key .pearl.astral-trade-planet {
    grid-column: 1 / -1;
    width: 20px;
    height: 20px;
    font-size: 20px;
  }

  html.landscape .astral-trade-key .astral-mark {
    width: 14px;
    height: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .astral-chip.landed,
  .astral-pack.claimed-now {
    animation: none;
  }

  .chart-reward-respin {
    transition: none;
  }
}
