/* PuppyPay — Referral / Team UI */

.ref-banner-carousel {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 2px 2px 8px;
  margin: 0 0 14px;
  scrollbar-width: none;
}
.ref-banner-carousel::-webkit-scrollbar { display: none; }

.ref-banner {
  flex: 0 0 85%;
  scroll-snap-align: start;
  border-radius: 16px;
  padding: 16px 16px 14px;
  color: #fff;
  min-height: 96px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}
.ref-banner h3 {
  font-size: 15px;
  font-weight: 800;
  margin: 0 0 6px;
  letter-spacing: -.02em;
}
.ref-banner p {
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
  opacity: .92;
}
.ref-banner b { font-weight: 800; }
.ref-banner.b1 {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #3b82f6 100%);
}
.ref-banner.b2 {
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 55%, #2dd4bf 100%);
}
.ref-banner.b3 {
  background: linear-gradient(135deg, #b45309 0%, #f59e0b 55%, #fbbf24 100%);
  color: #1c1917;
}
.ref-banner.b3 p { opacity: .85; }

.ref-hero {
  background: linear-gradient(160deg, #ffffff 0%, #eff6ff 50%, #dbeafe 100%);
  border: 1.5px solid #93c5fd;
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow:
    0 8px 22px rgba(37, 99, 235, 0.1),
    inset 0 1px 0 rgba(255,255,255,.9);
}
.ref-hero-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  color: #64748b;
  margin-bottom: 10px;
}
.ref-code-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.ref-code {
  flex: 1;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .04em;
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ref-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.ref-icon-btn:active { background: #e2e8f0; }
.ref-share-row {
  display: flex;
  gap: 8px;
}
.ref-share-row .btn { flex: 1; }

.ref-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 4px 0 14px;
  padding: 14px 12px 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
}
.ref-qr-img {
  width: 168px;
  height: 168px;
  margin: 0 auto 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  object-fit: contain;
  display: block;
}
.ref-qr-actions {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 6px;
}
.ref-qr-actions .btn {
  min-width: 140px;
}
.ref-qr-hint {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
  text-align: center;
  width: 100%;
  line-height: 1.4;
}

.ref-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.ref-stat {
  background: linear-gradient(160deg, #ffffff 0%, #eff6ff 50%, #dbeafe 100%);
  border: 1.5px solid #93c5fd;
  border-radius: 14px;
  padding: 12px 12px 11px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}
.ref-stat.green {
  background: linear-gradient(160deg, #ffffff 0%, #ecfdf5 50%, #d1fae5 100%);
  border-color: #6ee7b7;
}
.ref-stat .lbl {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 4px;
}
.ref-stat .val {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -.02em;
}
.ref-stat.green .val { color: #15803d; }

/* Referral separate wallet */
.ref-wallet-card {
  background: linear-gradient(160deg, #ffffff 0%, #ecfdf5 55%, #d1fae5 100%);
  border: 1.5px solid #6ee7b7;
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.12);
}
.ref-wallet-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ref-wallet-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  color: #047857;
  margin-bottom: 4px;
}
.ref-wallet-bal {
  font-size: 22px;
  font-weight: 800;
  color: #065f46;
  letter-spacing: -.02em;
}
.ref-wallet-hint {
  margin: 10px 0 0;
  font-size: 11px;
  color: #64748b;
  line-height: 1.35;
}
#refTransferBtn {
  flex-shrink: 0;
  white-space: nowrap;
}

.ref-milestones {
  background: linear-gradient(160deg, #ffffff 0%, #f8fafc 100%);
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
}
.ref-ms-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.ref-ms-ring {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  position: relative;
}
.ref-ms-ring svg { width: 52px; height: 52px; transform: rotate(-90deg); }
.ref-ms-ring-bg { fill: none; stroke: #e2e8f0; stroke-width: 4; }
.ref-ms-ring-fg { fill: none; stroke: #2563eb; stroke-width: 4; stroke-linecap: round; }
.ref-ms-ring-txt {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #1e40af;
}
.ref-ms-next { flex: 1; min-width: 0; }
.ref-ms-next-label {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
}
.ref-ms-next-count {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 8px;
}
.ref-ms-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
}
.ref-ms-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  border-radius: 99px;
  transition: width .35s ease;
  width: 0;
}
.ref-ms-track {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ref-ms-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.ref-ms-item.done {
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.ref-ms-item.claimable {
  background: #eff6ff;
  border-color: #93c5fd;
}
.ref-ms-item .ms-need {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  flex: 1;
}
.ref-ms-item .ms-reward {
  font-size: 13px;
  font-weight: 800;
  color: #15803d;
}
.ref-ms-item button {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
}
.ref-ms-item button:disabled {
  background: #cbd5e1;
  color: #64748b;
  cursor: default;
}

.ref-info-banner-wrap { margin-bottom: 14px; }
.ref-info-banner {
  width: 100%;
  border-radius: 14px;
  display: block;
}
.ref-rules {
  background: linear-gradient(160deg, #ffffff 0%, #eff6ff 100%);
  border: 1.5px solid #93c5fd;
  border-radius: 14px;
  padding: 14px;
}
.ref-rules h4 {
  font-size: 14px;
  font-weight: 800;
  margin: 0 0 10px;
  color: #0f172a;
}
.ref-rule-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
  font-size: 12.5px;
  color: #334155;
  line-height: 1.4;
}
.ref-rule-item:last-child { margin-bottom: 0; }
.ref-rule-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  background: #dbeafe;
  color: #1e40af;
  padding: 4px 8px;
  border-radius: 8px;
  white-space: nowrap;
}

.ref-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  margin: 4px 0 10px;
}

.ref-filter {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
}
.ref-filter button {
  flex-shrink: 0;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.ref-filter button.active {
  background: #1e40af;
  border-color: #1e40af;
  color: #fff;
}

.ref-bottom-spacer { height: 72px; }

.ref-sticky-invite {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  bottom: 84px;
  width: calc(100% - 32px);
  max-width: 398px;
  z-index: 40;
  transition: transform .25s ease;
  pointer-events: none;
  display: none;
}
.ref-sticky-invite.show {
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
  display: block;
}
.ref-sticky-btn {
  width: 100%;
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

body:has(#loginView.active) .ref-sticky-invite,
body:has(#registerView.active) .ref-sticky-invite,
body:has(#forgotView.active) .ref-sticky-invite,
html:not(.has-token) .ref-sticky-invite {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateX(-50%) translateY(200%) !important;
}

.ref-ms-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.ref-ms-chip.ready {
  border-color: #93c5fd;
  background: #eff6ff;
}
.ref-ms-chip.claimed {
  border-color: #a7f3d0;
  background: #ecfdf5;
}
.ref-ms-chip-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.ref-ms-chip-body { flex: 1; min-width: 0; }
.ref-ms-chip-name {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}
.ref-ms-chip-need {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}
.ref-ms-claim-btn {
  border: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  padding: 7px 12px;
  border-radius: 999px;
  color: #fff;
  background: #2563eb;
}
.ref-ms-chip-lock, .ref-ms-chip-done {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
}
.ref-ms-chip-lock { color: #94a3b8; background: #f1f5f9; }
.ref-ms-chip-done { color: #15803d; background: #dcfce7; }

.ref-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(145deg, #fff, #f8fafc);
  border: 1px solid #e2e8f0;
  margin-bottom: 8px;
}
.ref-card-av {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dbeafe, #93c5fd);
  color: #1e3a8a;
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ref-card-body { flex: 1; min-width: 0; }
.ref-card-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}
.ref-card-meta {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}
.ref-card-right { text-align: right; flex-shrink: 0; }
.ref-card-earn {
  font-size: 13px;
  font-weight: 800;
  color: #059669;
}
