:root {
  --bs-primary: #6b4eff;
  --bs-primary-rgb: 107, 78, 255;
  --purple: #664bfb;
  --purple-light: #a294ff;
  --bg: #f3f4f8;
  --muted: #8b92a8;
  --green: #22c55e;
  --red: #ef4444;
  --radius: 18px;
}

.apmint-body {
  background: var(--bg);
  padding-bottom: 88px;
}

.apmint-body.home-page {
  background: #f4f4f5;
  padding-bottom: 0;
}

.apmint-container {
  max-width: 480px;
}

.apmint-page-loader {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.apmint-page-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.apmint-page-loader .spinner-border {
  width: 2.5rem;
  height: 2.5rem;
  border-width: 0.2em;
  color: var(--purple, #664bfb);
}
html.apmint-theme-dark .apmint-page-loader {
  background: #11183c;
}
html.apmint-theme-dark .apmint-page-loader .spinner-border {
  color: #856ffc;
}
.apmint-page-loader.d-none { display: none !important; }
html.apmint-lang-loading .apmint-body > :not(#apmint-page-loader),
body.apmint-lang-loading.apmint-body > :not(#apmint-page-loader) {
  visibility: hidden !important;
}
html.apmint-page-ready .apmint-body > :not(#apmint-page-loader) {
  visibility: visible;
}

.apmint-sub-topbar-inner {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 8px;
}
.apmint-sub-title {
  text-align: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.apmint-sub-back {
  justify-self: start;
}

.btn-primary {
  --bs-btn-bg: var(--purple);
  --bs-btn-border-color: var(--purple);
  --bs-btn-hover-bg: #5a3fe8;
  --bs-btn-hover-border-color: #5a3fe8;
}

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #7c4dff, #536dfe);
  display: inline-block;
}

.hero-banner-wrap {
  line-height: 0;
  background: #0ea5e9;
}
.hero-banner-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.icon-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ede9fe;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--purple);
}

.apmint-tabs .nav-link {
  color: var(--muted);
  font-weight: 600;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
}
.apmint-tabs .nav-link.active {
  color: var(--purple);
  background: transparent;
  border-bottom-color: var(--purple);
}

.trade-row,
.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f4;
}
.trade-row:last-child,
.price-row:last-child {
  border-bottom: none;
}
.pnl-up { color: var(--green); font-weight: 700; }
.pnl-down { color: var(--red); }
.strike { text-decoration: line-through; color: var(--red); font-size: 0.85rem; }

.apmint-bottom-nav .bottom-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.72rem;
  color: var(--muted);
  padding: 4px 12px;
}
.apmint-bottom-nav .bottom-link.active {
  color: var(--purple);
}

.float-invite {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 72px;
  z-index: 1030;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(107, 78, 255, 0.35);
}

.event-balance { font-size: 1.6rem; font-weight: 800; }
.yield-tag { color: var(--green); font-weight: 600; font-size: 0.9rem; }
.prize-green { color: var(--green); font-size: 2rem; font-weight: 800; }

/* Wheel (lucky-canvas + reference layout) */
.wheel-modal-content {
  background: transparent !important;
  border: none;
  color: #fff;
  box-shadow: none;
}
.wheel-dialog {
  max-width: 360px;
  width: auto;
}

/* Bootstrap 模态：默认 65% 宽；可滚动/大内容 90%（转盘除外） */
.modal-dialog:not(.wheel-dialog) {
  width: 65%;
  max-width: 65%;
}
.modal-dialog.modal-dialog-scrollable:not(.wheel-dialog),
.modal-dialog.apmint-modal-xl:not(.wheel-dialog) {
  width: 90%;
  max-width: 90%;
}
@media (max-width: 576px) {
  .modal-dialog:not(.wheel-dialog) {
    width: 92%;
    max-width: 92%;
  }
}
.wheel-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 20;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  line-height: 1;
  padding: 0;
}
.wheel-close-btn:disabled {
  opacity: 1;
  cursor: not-allowed;
  font-size: 0.875rem;
  font-weight: 700;
}
.wheel-close-btn:not(:disabled) {
  cursor: pointer;
}
.wheel-head-line {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.5;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.65);
}
.wheel-head-highlight {
  font-size: 1.125rem;
  font-weight: 900;
}
.wheel-head-gold {
  color: #ffe500;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}
.wheel-head-sub {
  font-size: 0.875rem;
  font-weight: 700;
  opacity: 0.95;
}
.wheel-meta-block {
  margin-top: 14px;
  text-align: center;
}
.wheel-meta-spins {
  margin: 0 0 6px;
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}
.wheel-meta-spins strong {
  font-size: 1.05rem;
  color: #ffe500;
}
.wheel-meta-record-link {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 2px 6px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}
.wheel-meta-record-link:hover,
.wheel-meta-record-link:focus-visible {
  color: #ffe500;
}
.wheel-drawer-root {
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
}
#wheel-recharge-tiers-drawer-root {
  z-index: 2060;
}
.wheel-drawer-root:not([hidden]) {
  pointer-events: auto;
}
.wheel-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.wheel-drawer-root.is-open .wheel-drawer-backdrop {
  opacity: 1;
}
.wheel-drawer-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(78vh, 520px);
  background: #fff;
  border-radius: 16px 16px 0 0;
  transform: translateY(100%);
  transition: transform 0.28s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
}
.wheel-drawer-root.is-open .wheel-drawer-sheet {
  transform: translateY(0);
}
.wheel-drawer-handle {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: #d8dee8;
  margin: 10px auto 4px;
  flex-shrink: 0;
}
.wheel-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 12px;
  border-bottom: 1px solid #eef1f4;
}
.wheel-drawer-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #1a2744;
}
.wheel-drawer-close {
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: #8a94a6;
  padding: 0 4px;
  cursor: pointer;
}
.wheel-drawer-scroll {
  overflow-y: auto;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0));
  -webkit-overflow-scrolling: touch;
}
.wheel-drawer-rule {
  margin-bottom: 16px;
  padding: 14px 16px !important;
}
.wheel-drawer-rule-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #2c3e50;
}
body.wheel-drawer-open {
  overflow: hidden;
}
.wheel-shell {
  position: relative;
  width: 300px;
  height: 300px;
  margin: 0 auto;
  filter: drop-shadow(0 8px 22px rgba(110, 128, 255, 0.45));
}
.wheel-shell #wheel-canvas {
  position: relative;
  z-index: 1;
}
.wheel-shell #wheel-canvas canvas {
  display: block;
  margin: 0 auto;
}
.led-ring {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.led-ring i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px #fff, 0 0 14px rgba(255, 255, 255, 0.85);
  animation: led-flash 0.7s step-end infinite;
}
.led-ring i:nth-child(2n) {
  animation-delay: 0.35s;
}
.led-ring.is-spinning i {
  animation-duration: 0.28s;
}
.led-ring.is-spinning i:nth-child(2n) {
  animation-delay: 0.14s;
}
@keyframes led-flash {
  0%,
  49% {
    background: #fff;
    box-shadow: 0 0 8px #fff, 0 0 16px rgba(255, 255, 255, 0.95);
    opacity: 1;
  }
  50%,
  100% {
    background: rgba(255, 255, 255, 0.22);
    box-shadow: none;
    opacity: 0.35;
  }
}
.go-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 6;
  width: 92px;
  height: 105px;
  margin-left: -46px;
  margin-top: -60px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.go-btn img {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.go-btn:disabled {
  cursor: not-allowed;
  opacity: 0.85;
}

.auth-input-group {
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #dee2e6;
  background: #fff;
}
.auth-input-group .input-group-text {
  background: #fff;
  border: none;
}
.auth-input-group .form-control {
  border: none;
  box-shadow: none;
}

.qr-frame {
  background: #1e1b4b;
  border-radius: 16px;
  padding: 16px;
  display: inline-block;
}

.wallet-grid { display: flex; gap: 10px; overflow-x: auto; padding: 8px 0; }
.wallet-item {
  min-width: 88px;
  text-align: center;
  font-size: 0.75rem;
  padding: 8px;
  border-radius: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  background: #fff;
}
.wallet-item.active { border-color: var(--purple); background: #f5f3ff; }
.wallet-item-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
  display: block;
  margin: 0 auto 4px;
}
.wallet-item-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wallet-item--placeholder { cursor: default; border: none; background: transparent; min-width: auto; }
.wallet-drawer-root {
  position: fixed;
  inset: 0;
  z-index: 1060;
  pointer-events: none;
  visibility: hidden;
}
.wallet-drawer-root.is-open {
  pointer-events: auto;
  visibility: visible;
}
.wallet-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.wallet-drawer-root.is-open .wallet-drawer-backdrop { opacity: 1; }
.wallet-drawer-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(88vh, 640px);
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.23, 0.09, 0.08, 1.13);
}
.wallet-drawer-root.is-open .wallet-drawer-sheet { transform: translateY(0); }
.wallet-drawer-handle {
  width: 36px;
  height: 4px;
  border-radius: 4px;
  background: #d0d0d0;
  margin: 10px auto 4px;
  flex-shrink: 0;
}
.wallet-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 12px;
  flex-shrink: 0;
}
.wallet-drawer-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: env(safe-area-inset-bottom, 12px);
}
.wallet-drawer-list { padding: 0 8px; }
.wallet-drawer-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}
.wallet-drawer-row:hover { background: #f6f6f6; }
.wallet-drawer-row.active { background: #f5f3ff; }
.wallet-drawer-row-icon {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.wallet-drawer-row-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
  background: #f3f3f3;
}
.wallet-drawer-row-fallback {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ede9fe;
  color: var(--purple);
}
.wallet-drawer-row-name {
  flex: 1;
  font-size: 0.9375rem;
  font-weight: 500;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wallet-drawer-row-check {
  color: var(--purple);
  opacity: 0;
  flex-shrink: 0;
}
.wallet-drawer-row.active .wallet-drawer-row-check { opacity: 1; }
body.wallet-drawer-open {
  overflow: hidden;
  touch-action: none;
}

.empty-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #ede9fe;
  color: var(--purple);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* Bottom nav invite bubble — global (matches aipha-mint index-DXKRitBY) */
@keyframes apmint-invite-bubble-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}

.home-bottom-nav .bottom-nav-item > .invite-bubble-slot {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  transform: translateX(-50%);
  z-index: 2;
  pointer-events: none;
}

.home-bottom-nav .bottom-nav-item .invite-bubble {
  position: relative;
  display: inline-block;
  white-space: nowrap;
  background: #664bfb;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  padding: 5px 8px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(102, 75, 251, 0.35);
  will-change: transform;
  -webkit-animation: apmint-invite-bubble-float 1.8s ease-in-out infinite;
  animation: apmint-invite-bubble-float 1.8s ease-in-out infinite;
}

.home-bottom-nav .bottom-nav-item .invite-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  transform: translateX(-50%);
  border-width: 5px 5px 0;
  border-style: solid;
  border-color: #664bfb transparent transparent;
  pointer-events: none;
}
