/* Split from website/static/css/pages.css. Keep selector order compatible with the original cascade. */

/* Shop page */
#shop {
  position: relative;
  overflow: visible;
}

#shop .top-bar {
  position: sticky;
  top: 0;
  z-index: 9;
  min-height: 56px;
}

#shop .shop-test-mode-banner {
  width: 100%;
  padding: 8px 12px;
  margin: 0 0 8px 0;
  font-size: 12px;
  line-height: 1.4;
  color: #1a1a1a;
  background: #fef3c7;
  border-radius: 8px;
  text-align: center;
  box-sizing: border-box;
}

#shop .shop-test-mode-banner a {
  color: #b45309;
  font-weight: 600;
  text-decoration: underline;
}

#shop .shop-test-mode-banner a:hover {
  color: #92400e;
}

#shop .shop-top-balance {
  position: absolute;
  left: 50%;
  display: inline-flex;
  align-items: baseline;
  gap: 0.24ch;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 600;
  line-height: 22px;
  color: #ffffff;
  text-align: center;
  white-space: nowrap;
}

#shop .shop-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 16px 0 calc(120px + env(safe-area-inset-bottom));
}

#shop .shop-credits-heading {
  font-size: 18px;
  font-weight: 600;
  line-height: 22px;
  color: #ffffff;
  margin-top: 6px;
}

#shop .shop-token-card {
  position: relative;
  width: 100%;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

#shop .shop-token-display {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  pointer-events: none;
  color: #ffffff;
  font-size: 56px;
  font-weight: 600;
  line-height: 0.88;
  z-index: 1;
  transition: opacity 140ms var(--motion-ease-soft), transform 140ms var(--motion-ease-soft);
}

#shop .shop-token-input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  padding: 0 18px;
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 56px;
  font-weight: 600;
  line-height: 0.88;
  text-align: center;
  outline: none;
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  transition: color 120ms var(--motion-ease-soft), opacity 120ms var(--motion-ease-soft);
}

#shop .shop-token-input::-webkit-scrollbar {
  display: none;
}

#shop .shop-token-card.is-editing .shop-token-display {
  opacity: 0;
  transform: translateY(-4px);
}

#shop .shop-token-card.is-editing .shop-token-input {
  color: #ffffff;
  caret-color: #ffffff;
  opacity: 1;
  pointer-events: auto;
}

#shop .shop-token-card:not(.is-editing) .shop-token-input {
  color: transparent;
  caret-color: transparent;
  opacity: 0;
  pointer-events: none;
}

#shop .shop-value-animate {
  display: inline-flex;
  font-variant-numeric: tabular-nums;
  align-items: baseline;
  justify-content: center;
  white-space: nowrap;
  will-change: opacity;
}

#shop .shop-value-animate.is-refreshing {
  animation: shopValueRefresh 180ms cubic-bezier(0.22, 0.78, 0.18, 1);
}

#shop .shop-value-inline {
  white-space: nowrap;
}

#shop .shop-token-display.shop-value-animate,
#shop .shop-token-display .shop-value-animate {
  align-items: center;
  line-height: inherit;
}

@keyframes shopValueRefresh {
  0% {
    opacity: 0.48;
  }
  100% {
    opacity: 1;
  }
}

#shop .shop-slider {
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  --shop-slider-fill: 23%;
  overflow: visible;
}

#shop .shop-slider-track {
  position: relative;
  height: 6px;
  background: rgba(120, 120, 128, 0.16);
  border-radius: 999px;
  overflow: visible;
}

#shop .shop-slider-fill {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 6px;
  width: var(--shop-slider-fill);
  background: #ffffff;
  border-radius: 100px;
}

#shop .shop-slider-thumb {
  position: absolute;
  top: 50%;
  left: var(--shop-slider-fill);
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #262832;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

#shop .shop-slider-input {
  position: absolute;
  left: 0;
  top: -8px;
  width: 100%;
  height: 28px;
  opacity: 0;
  cursor: pointer;
}

#shop .shop-slider-labels {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#shop .shop-slider-endpoint {
  min-width: 0;
  width: 100%;
  font-size: 13px;
  line-height: 22px;
  color: #b6b6b6;
}

#shop .shop-slider-endpoint:last-child {
  text-align: right;
}

#shop .shop-credit-selection {
  width: 100%;
  display: flex;
  justify-content: center;
}

#shop .shop-credit-options {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%;
  flex-wrap: wrap;
}

#shop .shop-credit-option {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  min-width: 60px;
  height: 34px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: none;
  color: #ffffff;
  font-size: 13px;
  line-height: 18px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.12s ease;
}

#shop .shop-credit-option:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(0.99);
  opacity: 0.95;
}

#shop .shop-credit-option:active {
  transform: scale(0.97);
}

#shop .shop-credit-option.active {
  background: #ffffff;
  color: #000000;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

#shop .shop-context-hint {
  width: 100%;
  min-height: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.24ch;
  font-size: 15px;
  font-weight: 500;
  line-height: 22px;
  color: #ffffff;
}

#shop .shop-glass-panel {
  width: 100%;
  background: rgba(97, 94, 94, 0.1);
  border-radius: 20px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

#shop .shop-glass-title {
  font-size: 13px;
  font-weight: 400;
  line-height: 22px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 10px;
}

#shop .shop-glass-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

#shop .shop-glass-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 400;
  line-height: 22px;
  color: #ffffff;
}

#shop .shop-glass-value {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.16ch;
  font-size: 13px;
  font-weight: 400;
  line-height: 22px;
  color: #ffffff;
}

#shop .shop-tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--ui-chat-icon-button-size);
  height: var(--ui-chat-icon-button-size);
  flex: 0 0 var(--ui-chat-icon-button-size);
  background: transparent;
  cursor: default;
}

#shop .shop-tooltip-trigger svg {
  width: 16px;
  height: 16px;
  display: block;
}

#shop .shop-disclaimer {
  width: 100%;
  text-align: center;
  font-size: 11px;
  font-weight: 400;
  line-height: 20px;
  color: #ffffff;
  opacity: 0.8;
}

#shop .shop-purchase-btn {
  position: fixed;
  left: 50%;
  bottom: calc(var(--footer-floating-cta-bottom) + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: calc(100vw - 32px);
  max-width: 528px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #ffffff;
  color: #191b23;
  border: none;
  border-radius: 14px;
  font-weight: 600;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.12s ease, background 0.12s ease;
  z-index: 9;
}

#shop .shop-purchase-btn:hover:not(:disabled) {
  background: #f2f2f2;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.4);
  transform: translateX(-50%) scale(0.99);
  opacity: 0.95;
}

#shop .shop-purchase-btn:active:not(:disabled) {
  background: #e9e9e9;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
  transform: translateX(-50%) scale(0.97);
}

#shop .shop-purchase-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

#shop .shop-purchase-label,
#shop .shop-purchase-price {
  font-size: 15px;
  font-weight: 600;
  line-height: 22px;
  color: #191b23;
}

#shop .shop-purchase-price {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

#shop .shop-purchase-currency {
  display: inline-block;
}

#shop .shop-purchase-divider {
  width: 1px;
  height: 22px;
  background: #b6b6b6;
}

#shop .shop-tooltip {
  position: fixed;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#shop .shop-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

#shop .shop-tooltip-content {
  background: #1f2129;
  color: #f2f3f7;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 18px;
  border: none;
  width: fit-content;
  max-width: min(90vw, 380px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

#shop .shop-tooltip-line + .shop-tooltip-line {
  margin-top: 4px;
}

#shop .shop-tooltip-example {
  color: rgba(242, 243, 247, 0.8);
}

body.shop-payment-modal-open .footer.tap-bar.bottom-bar {
  transform: translateY(140%);
  opacity: 0;
  pointer-events: none;
}

#shop .shop-payment-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: rgba(5, 6, 10, 0);
  transition: opacity var(--motion-fast) var(--motion-ease-enter),
    background var(--motion-fast) var(--motion-ease-enter),
    visibility 0s linear var(--motion-fast);
}

#shop .shop-payment-modal.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  background: rgba(5, 6, 10, 0.68);
  transition-delay: 0s;
}

#shop .shop-payment-sheet {
  box-sizing: border-box;
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 100vw;
  max-width: 560px;
  min-height: 409px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 24px;
  padding: 32px 16px calc(96px + env(safe-area-inset-bottom));
  background:
    radial-gradient(96% 112% at 50% -8%, rgba(84, 96, 223, 0.12) 0%, rgba(84, 96, 223, 0) 50%),
    #191b23;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 16px 16px 0 0;
  isolation: isolate;
  overflow: hidden;
  opacity: 0;
  transform: translateX(-50%) translateY(28px);
  transition: opacity var(--motion-fast) var(--motion-ease-enter),
    transform var(--motion-fast) var(--motion-ease-enter);
  will-change: transform, opacity;
}

#shop .shop-payment-modal.open .shop-payment-sheet {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#shop .shop-payment-sheet::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -418px;
  width: 420px;
  height: 420px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(52, 49, 110, 0.24) 0%, rgba(52, 49, 110, 0) 72%);
  z-index: 0;
  pointer-events: none;
}

#shop .shop-payment-animate {
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: translateY(14px) scale(0.992);
  transition: opacity var(--motion-fast) var(--motion-ease-soft),
    transform var(--motion-fast) var(--motion-ease-soft);
}

#shop .shop-payment-modal.is-ready .shop-payment-animate {
  opacity: 1;
  transform: none;
}

#shop .shop-payment-modal.is-ready .shop-payment-header {
  transition-delay: 18ms;
}

#shop .shop-payment-modal.is-ready .shop-payment-option-reveal:nth-of-type(1) {
  transition-delay: 36ms;
}

#shop .shop-payment-modal.is-ready .shop-payment-option-reveal:nth-of-type(2) {
  transition-delay: 54ms;
}

#shop .shop-payment-modal.is-ready .shop-payment-option-reveal:nth-of-type(3) {
  transition-delay: 72ms;
}

#shop .shop-payment-modal.is-ready .shop-payment-pay-reveal {
  transition-delay: 90ms;
}

#shop .shop-payment-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}

#shop .shop-payment-sparkle {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

#shop .shop-payment-sparkle svg {
  width: 24px;
  height: 24px;
  display: block;
}

#shop .shop-payment-title {
  margin: 0;
  color: #ffffff;
  font-size: 24px;
  font-weight: 400;
  line-height: 29px;
  letter-spacing: -0.02em;
}

#shop .shop-payment-options {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#shop .shop-payment-option-reveal,
#shop .shop-payment-pay-reveal {
  width: 100%;
}

#shop .shop-payment-option {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease,
    background 0.15s ease, border-color 0.15s ease, box-shadow 0.12s ease;
}

#shop .shop-payment-option:hover {
  transform: scale(0.99);
  opacity: 0.95;
  background: rgba(255, 255, 255, 0.08);
}

#shop .shop-payment-option:active {
  transform: scale(0.97);
}

#shop .shop-payment-option.is-selected {
  border-color: rgba(124, 188, 255, 0.34);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(87, 102, 255, 0.08));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 0 0 1px rgba(33, 183, 255, 0.06);
}

#shop .shop-payment-option:focus-visible,
#shop .shop-payment-pay-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(110, 201, 255, 0.6);
}

#shop .shop-payment-option-label {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  color: #ffffff;
  font-size: 16px;
  font-weight: 400;
  line-height: 19px;
}

#shop .shop-payment-card-icons {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
}

#shop .shop-payment-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  position: relative;
  overflow: hidden;
}

#shop .shop-payment-card-icon--visa {
  width: 54px;
  height: 24px;
}

#shop .shop-payment-card-icon--mastercard {
  width: 38px;
  height: 24px;
}

#shop .shop-payment-card-icon svg {
  position: absolute;
  display: block;
  max-width: none;
  max-height: none;
}

#shop .shop-payment-card-icon--visa svg {
  width: 130px;
  height: 96px;
  left: -38px;
  top: -16px;
}

#shop .shop-payment-card-icon--mastercard svg {
  width: 107px;
  height: 99px;
  left: -37px;
  top: -18px;
}

#shop .shop-payment-option-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

#shop .shop-payment-option-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

#shop .shop-payment-pay-btn {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 16px;
  border: none;
  border-radius: 14px;
  background: #ffffff;
  color: #191b23;
  font-size: 15px;
  font-weight: 600;
  line-height: 22px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease,
    box-shadow 0.12s ease, background 0.12s ease;
}

#shop .shop-payment-pay-label,
#shop .shop-payment-pay-price {
  font-size: 15px;
  font-weight: 600;
  line-height: 22px;
  color: #191b23;
}

#shop .shop-payment-pay-divider {
  width: 1px;
  height: 22px;
  background: #b6b6b6;
  flex: 0 0 auto;
}

#shop .shop-payment-pay-price {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  min-width: 52px;
}

#shop .shop-payment-pay-currency:empty {
  display: none;
}

#shop .shop-payment-pay-btn:hover:not(:disabled) {
  background: #f2f2f2;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.4);
  transform: scale(0.99);
  opacity: 0.95;
}

#shop .shop-payment-pay-btn:active:not(:disabled) {
  background: #e9e9e9;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
  transform: scale(0.97);
}

#shop .shop-payment-pay-btn:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

#shop .shop-payment-pay-btn[data-state="loading"]:disabled {
  cursor: wait;
}

@media (prefers-reduced-motion: reduce) {
  #shop .shop-payment-modal,
  #shop .shop-payment-sheet,
  #shop .shop-payment-animate {
    transition-duration: 1ms !important;
  }

  #shop .shop-payment-animate {
    opacity: 1;
    transform: none;
  }
}
