
.fx-layer {
  position: fixed;
  inset: 0;
  z-index: 45;
  overflow: hidden;
  pointer-events: none;
}

.total-flight-glow,
.total-win-flare {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.total-flight-glow {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle, #fffbe6 0%, rgba(255, 214, 92, 0.95) 28%, rgba(255, 170, 40, 0.45) 55%, transparent 72%);
}

.total-win-flare {
  border-radius: 12px;
  background: radial-gradient(closest-side, rgba(255, 240, 170, 0.85), rgba(255, 196, 64, 0.4) 60%, transparent);
  box-shadow: 0 0 18px 6px rgba(255, 200, 80, 0.55);
}

.fly-orb {
  position: fixed;
  z-index: 16;
  transform-origin: top left;
}

:where([data-float-host]) {
  position: relative;
}

.float-text {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 45;
  pointer-events: none;
  transform: translate(-50%, -50%);
  color: var(--gold);
  font-family: var(--display);
  font-size: 1.3rem;
  text-shadow: 0 0 8px rgba(255, 211, 77, 0.8), 0 2px 4px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  animation: float-up 800ms ease-out forwards;
}

.beam {
  position: fixed;
  width: 6px;
  margin-left: -3px;
  transform-origin: top center;
  border-radius: 3px;
  background: linear-gradient(180deg, #fff, var(--gold) 30%, #ff6a00);
  box-shadow: 0 0 12px var(--gold), 0 0 24px #ff6a00;
  animation: beam 600ms ease-out forwards;
}

.coin {
  position: absolute;
  width: 30px;
  height: 30px;
  background: url("../art/ui/coin-gold.webp") center / contain no-repeat;
  transform: translate(-50%, -50%);
  animation: coin 1300ms cubic-bezier(0.3, 0, 0.7, 1) both;
}

.banner {
  position: fixed;
  left: 50%;
  top: 40%;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  opacity: 0;
}

.banner::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: -1;
  width: 150vmin;
  height: 150vmin;
  margin: -75vmin 0 0 -75vmin;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 230, 140, 0.55), transparent 45%),
    repeating-conic-gradient(rgba(255, 211, 77, 0.35) 0 7deg, transparent 7deg 18deg);
  -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 65%);
  mask-image: radial-gradient(circle, #000 20%, transparent 65%);
}

.banner.show::before {
  animation: rays 6s linear infinite;
}

.banner-title {
  font-size: clamp(2.4rem, 13vw, 4.2rem);
  font-weight: 900;
  white-space: nowrap;
  filter: drop-shadow(0 2px 0 var(--gold-deep)) drop-shadow(0 4px 0 #6a0016) drop-shadow(0 0 16px rgba(255, 106, 0, 0.9));
}

.banner.bonus .banner-title {
  background-image: linear-gradient(180deg, #f0fff4, #6dff9e 45%, #0b8a40 52%, #b0ffc8 80%, #0b6a36);
  filter: drop-shadow(0 2px 0 #054018) drop-shadow(0 0 16px var(--jade));
}

.banner-amount {
  font-size: clamp(2.1rem, 10.5vw, 3.1rem);
  font-weight: 900;
  filter: drop-shadow(0 0 1px #2a1000) drop-shadow(0 0 1px #2a1000) drop-shadow(0 3px 0 #4a2200) drop-shadow(0 4px 2px #000) drop-shadow(0 0 10px rgba(255, 160, 0, 0.8));
}


.toast {
  position: fixed;
  left: 50%;
  top: calc(var(--safe-top) + 12px);
  width: calc(100% - 32px);
  max-width: 488px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #6a0e1c, #2a0510);
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 1px var(--gold-deep), 0 6px 20px rgba(0, 0, 0, 0.5);
  font-size: 0.95rem;
  transform: translate(-50%, calc(-100% - var(--safe-top) - 24px));
  transition: transform 250ms ease;
  pointer-events: none;
  z-index: 56;
}

.toast.show {
  transform: translate(-50%, 0);
}

.toast.interrupted {
  transition: none;
}

/* ---------- Add to Home Screen hint (Safari, shown once) ---------- */

.install-hint {
  position: fixed;
  left: 50%;
  top: calc(50% + (var(--safe-top) - var(--safe-bottom)) / 2);
  width: calc(100% - 32px);
  max-width: 488px;
  max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 12px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #6a0e1c, #2a0510);
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 1px var(--gold-deep), 0 8px 24px rgba(0, 0, 0, 0.6);
  font-size: 0.85rem;
  line-height: 1.3;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.96);
  transition: transform 300ms ease, opacity 300ms ease;
  z-index: 25;
}

.install-hint.show {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.install-hint[hidden] {
  display: none;
}

.install-hint-icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

.install-hint-text {
  flex: 1;
  color: var(--text);
}

.install-hint-text strong {
  font-family: var(--display);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-shadow: 0 1px 0 #000;
}

.install-hint-text strong:first-child {
  display: block;
  color: var(--gold);
}

/* Safari's share icon: a box with an arrow out of the top. */
.install-hint-share {
  position: relative;
  display: inline-block;
  width: 12px;
  height: 11px;
  margin: 0 2px -1px;
  border: 2px solid var(--neon-cyan);
  border-top-color: transparent;
  border-radius: 2px;
}

.install-hint-share::before {
  content: "\2191";
  position: absolute;
  left: 50%;
  top: -9px;
  transform: translateX(-50%);
  color: var(--neon-cyan);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.install-hint-close {
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 1rem;
  touch-action: manipulation;
}

@media (prefers-reduced-motion: reduce) {
  .install-hint { transition: none; }
}

@media (max-height: 700px) {
  .deal-panel { gap: 4px; }
  .deal-panel::before,
  .deal-panel::after { font-size: 1.5rem; }
  .deal-pill { font-size: 0.7rem; }
  .deal-chest { padding: 1px 0 6px; }
  .deal-chest.mine .deal-chest-label { bottom: 8px; }
  .deal-bottom { min-height: 120px; }
  .tower { padding: 2px 0 10px; }
  .plaque { padding: 0 6px 1px; }
  .plaque-amount { font-size: 0.85rem; }
  .jackpot.minor .plaque-amount,
  .jackpot.mini .plaque-amount { font-size: 0.8rem; }
  .meters { padding: 0 4px 3px; margin: 3px 30px 0; --gate-inset: 2px -10px -2px; }
  .meter::before { top: 4px; height: 14px; }
  .guardian { width: 30px; height: 70px; bottom: 4px; }
  .guardian:not(.flip) { left: -4px; }
  .guardian.flip { right: -4px; }
  .meter { flex-direction: row; gap: 4px; padding-top: 1px; }
  .meter-label { flex: none; order: 0; min-width: 0; margin: 0; padding: 1px 12px; white-space: nowrap; }
  .meter.top .meter-label { min-width: 0; padding: 1px 12px; }
  .meter-slots { flex: 1; gap: 4px; padding: 2px 6px; }
  .slot { width: 27px; height: 27px; border-width: 3px; font-size: 0.56rem; }
  .spin-button { padding: 2px 0; }
  .bet-row { margin-bottom: 4px; }
  .bet-value,
  .win-box { height: 44px; }
  .controls { padding-top: 4px; margin-top: 4px; }
  .pearl-tile,
  .pearl-tile.storm { min-height: 64px; padding: 6px 2px 5px; gap: 2px; }
  .pearl-tile .pearl { width: 32px; height: 32px; font-size: 32px; }
  .pearl-open-all { min-height: 44px; margin-bottom: 8px; }
  .pearl-open:not(.all) .pearl-reward-row { gap: 8px; }
  .pearl-open:not(.all) .pearl-prize.tile { width: 72px; min-height: 82px; padding: 6px 3px; }
  .pearl-open:not(.all) .pearl-prize.tile.coins { width: 90px; }
  .pearl-open:not(.all) .pearl-prize.tile .pearl-prize-icon { font-size: 1.6rem; }
  .wheel-panel { gap: 6px; }
  .wheel-sign { margin-bottom: 6px; padding-bottom: 7px; }
  .wheel-title { font-size: 1.45rem; }
  .wheel-sign-bolt { height: 26px; width: 9px; }
  .wheel-days { margin-top: 2px; }
  .wheel-day { gap: 9px; }
  .wheel-day::before,
  .wheel-day-prize { height: 26px; }
  .wheel-day-prize .pearl { width: 18px; height: 18px; font-size: 18px; }
  .wheel-track { top: 29px; height: 5px; }
  .wheel-stage { --stage: min(92vw, 360px, 46vh, calc(100vh - var(--safe-top) - var(--safe-bottom) - 300px)); margin: 10px 0 4px; }
  .wheel-label-inner { font-size: 0.8rem; }
  .wheel-label-inner { padding-left: 1.5%; gap: 2px; }
  .wheel-prize { min-height: 36px; }
  .wheel-prize-text { font-size: 1.5rem; }
  .wheel.cashback .wheel-prize { min-height: 56px; }
  .wheel.cashback .wheel-stage { --stage: min(92vw, 360px, 46vh, calc(100vh - var(--safe-top) - var(--safe-bottom) - 308px)); }
  html:not(.landscape) .wheel.cashback .wheel-stage { --stage: min(92vw, 360px, 46vh, calc(100vh - var(--safe-top) - var(--safe-bottom) - 324px)); }
  .wheel-cashback-value { font-size: 1.05rem; }
  .wheel-offer-amount { font-size: 1.35rem; margin-bottom: 2px; }
  .wheel-keys { min-height: 48px; }
  .wheel-skip,
  .wheel-continue,
  .wheel-unlock { min-height: 48px; }
}

