/* Shared Piplix limit / upgrade dialog. Self-contained token fallbacks keep it
   consistent in the public, product, player, and trading layouts. */
.px-limit-modal {
  width: min(540px, calc(100vw - 32px));
  max-width: none;
  max-height: min(760px, calc(100dvh - 32px));
  margin: auto;
  padding: 0;
  overflow: visible;
  color: var(--px-ink-900, #20252a);
  background: transparent;
  border: 0;
  /* Use the same body token as onboarding rather than a modal-specific stack. */
  font: var(--px-text-body, 400 16px/1.5 'BR Hendrix', system-ui, sans-serif);
}
.px-limit-modal::backdrop {
  background: rgba(9, 12, 17, .76);
  backdrop-filter: blur(4px);
}
.px-limit-modal__card {
  position: relative;
  overflow: hidden;
  padding: 28px 38px 34px;
  text-align: center;
  background:
    radial-gradient(circle at 16% 7%, rgba(255, 151, 71, .18), transparent 27%),
    radial-gradient(circle at 87% 22%, rgba(82, 184, 219, .16), transparent 30%),
    var(--px-surface-0, #fff);
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 28px;
  box-shadow: 0 28px 80px rgba(5, 15, 28, .34);
}
.px-limit-modal__close {
  position: absolute;
  z-index: 2;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--px-ink-500, #65717a);
  background: rgba(255, 255, 255, .82);
  border: 1px solid var(--px-surface-200, #e0e6ea);
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.px-limit-modal__close:hover { color: var(--px-ink-900, #20252a); background: #fff; }
.px-limit-modal__art {
  position: relative;
  width: 178px;
  height: 164px;
  margin: -5px auto 12px;
  display: grid;
  place-items: end center;
}
.px-limit-modal__art::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 154px;
  height: 104px;
  transform: translateX(-50%);
  background: linear-gradient(145deg, #fff2e8, #eaf7fb);
  border-radius: 48% 52% 45% 55%;
}
.px-limit-modal__spark {
  position: absolute;
  z-index: 1;
  color: var(--px-brand, #f56b0f);
  font-size: 20px;
  animation: px-limit-float 2.6s ease-in-out infinite;
}
.px-limit-modal__spark--one { left: 6px; top: 45px; }
.px-limit-modal__spark--two { right: 5px; top: 23px; animation-delay: -.8s; color: #52b8db; }
.px-limit-modal__spark--three { right: 14px; bottom: 24px; animation-delay: -1.4s; font-size: 13px; }
.px-limit-modal__character {
  position: relative;
  z-index: 1;
  width: 170px;
  height: 166px;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 12px 12px rgba(70, 40, 18, .14));
}
.px-limit-modal__eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 0 0 12px;
  padding: 4px 12px;
  color: #a84408;
  background: #fff0e5;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.px-limit-modal__title {
  max-width: 410px;
  margin: 0 auto;
  color: var(--px-ink-900, #20252a);
  font-size: clamp(30px, 5vw, 42px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.035em;
}
.px-limit-modal__copy {
  max-width: 410px;
  margin: 14px auto 0;
  color: var(--px-ink-600, #58636c);
  font-size: 16px;
  line-height: 1.55;
}
.px-limit-modal__benefit {
  max-width: 400px;
  margin: 18px auto 0;
  padding: 12px 14px;
  color: var(--px-ink-700, #3c454c);
  background: rgba(246, 248, 249, .88);
  border: 1px solid var(--px-surface-200, #e0e6ea);
  border-radius: 14px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}
.px-limit-modal__actions { margin-top: 24px; display: grid; gap: 10px; }
.px-limit-modal__primary,
.px-limit-modal__secondary {
  font-family: inherit;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border-radius: 15px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}
.px-limit-modal__primary {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, var(--px-brand, #f56b0f), #e94f16);
  border: 1px solid transparent;
  box-shadow: 0 9px 20px rgba(245, 107, 15, .24);
}
.px-limit-modal__primary::after {
  content: '';
  position: absolute;
  z-index: 0;
  top: -80%;
  left: -45%;
  width: 28%;
  height: 260%;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 8%, rgba(255, 255, 255, .08) 31%, rgba(255, 255, 255, .7) 50%, rgba(255, 255, 255, .08) 69%, transparent 92%);
  transform: translateX(-170%) skewX(-19deg);
  animation: px-limit-pro-shine 3.8s ease-in-out infinite;
}
.px-limit-modal__primary:hover { color: #fff; transform: translateY(-1px); }
.px-limit-modal__secondary {
  color: var(--px-ink-700, #3c454c);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
}
.px-limit-modal__secondary:hover { background: var(--px-surface-100, #f4f6f7); }
body.px-limit-modal-open { overflow: hidden; }

@keyframes px-limit-float {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-7px) rotate(8deg); }
}
@keyframes px-limit-pro-shine {
  0%, 54% { transform: translateX(-170%) skewX(-19deg); }
  78%, 100% { transform: translateX(650%) skewX(-19deg); }
}
@media (prefers-reduced-motion: reduce) {
  .px-limit-modal__spark,
  .px-limit-modal__primary::after { animation: none; }
}

@media (max-width: 600px) {
  .px-limit-modal {
    width: 100%;
    max-height: 100dvh;
    margin: auto 0 0;
    overflow-y: auto;
  }
  .px-limit-modal__card {
    padding: 18px 22px max(16px, env(safe-area-inset-bottom));
    border-radius: 26px 26px 0 0;
  }
  .px-limit-modal__close { top: 12px; right: 14px; width: 40px; height: 40px; }
  .px-limit-modal__art { width: 138px; height: 112px; margin-bottom: 7px; }
  .px-limit-modal__art::before { width: 120px; height: 74px; }
  .px-limit-modal__character { width: 120px; height: 116px; }
  .px-limit-modal__eyebrow { margin-bottom: 9px; }
  .px-limit-modal__title { font-size: clamp(27px, 8vw, 33px); }
  .px-limit-modal__copy { margin-top: 9px; font-size: 14px; }
  .px-limit-modal__benefit { margin-top: 12px; padding: 10px 12px; font-size: 13px; }
  .px-limit-modal__actions { margin-top: 14px; gap: 5px; }
  .px-limit-modal__primary { min-height: 48px; }
  .px-limit-modal__secondary { min-height: 42px; }
}
