/* ── Referral invite widget — compact ───────────────────────────────────── */

.referral-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 10px;
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 8px;
}

.referral-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.referral-card-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(165,180,252,0.8);
}

.referral-card-icon { font-size: 13px; }

.referral-code-block {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(99,102,241,0.07);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 8px;
  padding: 6px 10px;
}

.referral-code-text {
  flex: 1;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #c7d2fe;
  font-family: 'Courier New', monospace;
}

.referral-copy-btn {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid rgba(99,102,241,0.45);
  background: rgba(99,102,241,0.15);
  color: #a5b4fc;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.referral-copy-btn:hover { background: rgba(99,102,241,0.28); color: #c7d2fe; }
.referral-copy-btn.copied {
  border-color: rgba(52,211,153,0.45);
  background: rgba(52,211,153,0.12);
  color: #6ee7b7;
}

.referral-stats-row {
  display: flex;
  gap: 6px;
}

.referral-stat {
  flex: 1;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(226,182,104,.14);
  border-radius: 7px;
  padding: 5px 6px;
  text-align: center;
}
.referral-stat-val {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: #c7d2fe;
}
.referral-stat.converted .referral-stat-val { color: #34d399; }
.referral-stat-label {
  display: block;
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(175,195,240,0.5);
  margin-top: 1px;
}

.referral-how {
  font-size: 10px;
  color: rgba(175,195,240,0.5);
  line-height: 1.45;
}

.referral-how b { color: rgba(200,215,245,0.8); }

.referral-share-row {
  display: flex;
  gap: 5px;
}

.referral-share-link {
  flex: 1;
  font-size: 9.5px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid rgba(226,182,104,.15);
  background: rgba(255,255,255,0.03);
  color: rgba(175,195,240,0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: monospace;
  cursor: pointer;
}

.referral-copy-link-btn {
  flex-shrink: 0;
  font-size: 9.5px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid rgba(226,182,104,.18);
  background: rgba(255,255,255,0.04);
  color: rgba(175,195,240,0.65);
  transition: background 0.2s;
}
.referral-copy-link-btn:hover { background: rgba(255,255,255,0.09); color: #c7d2fe; }

/* Telegram group join button (always visible in widget) */
.ref-tg-btn {
  display: block;
  text-align: center;
  padding: 7px 10px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(0,136,204,0.22), rgba(0,136,204,0.12));
  border: 1px solid rgba(0,136,204,0.4);
  color: #5bc8f5;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}
.ref-tg-btn:hover {
  background: linear-gradient(135deg, rgba(0,136,204,0.34), rgba(0,136,204,0.2));
  border-color: rgba(0,136,204,0.65);
  color: #93dbff;
}

/* Premium welcome overlay (shown after referral confirm) */
#ref-welcome-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,8,18,0.88);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  animation: ref-overlay-in 0.3s ease;
}
@keyframes ref-overlay-in {
  from { opacity: 0; } to { opacity: 1; }
}
.ref-welcome-card {
  background: linear-gradient(160deg, rgba(16,20,40,0.98), rgba(10,14,28,0.98));
  border: 1px solid rgba(99,102,241,0.45);
  border-radius: 18px;
  padding: 32px 28px;
  max-width: 360px;
  width: 90%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 0 60px rgba(99,102,241,0.2);
}
.ref-welcome-icon { font-size: 40px; }
.ref-welcome-title {
  font-size: 20px;
  font-weight: 800;
  color: #e7edfb;
}
.ref-welcome-body {
  font-size: 13px;
  color: rgba(200,215,245,0.8);
  line-height: 1.55;
}
.ref-welcome-body b { color: #fcd34d; }
.ref-join-btn {
  display: block;
  padding: 13px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0088cc, #006aaa);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 0 24px rgba(0,136,204,0.4);
  transition: opacity 0.2s;
}
.ref-join-btn:hover { opacity: 0.88; }
.ref-welcome-note {
  font-size: 10.5px;
  color: rgba(175,195,240,0.45);
}
.ref-welcome-close {
  background: none;
  border: 1px solid rgba(226,182,104,.18);
  color: rgba(175,195,240,0.7);
  border-radius: 9px;
  padding: 9px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.ref-welcome-close:hover { background: rgba(255,255,255,0.06); color: #c7d2fe; }

/* Apply-code panel (for new users who received a code) */
.referral-apply-wrap {
  margin-top: 6px;
}
.referral-apply-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.referral-apply-input {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(99,102,241,0.35);
  background: rgba(99,102,241,0.08);
  color: #c7d2fe;
  font-family: monospace;
  outline: none;
}
.referral-apply-input::placeholder { color: rgba(165,180,252,0.35); }
.referral-apply-input:focus { border-color: rgba(99,102,241,0.6); }
.referral-apply-btn {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  background: rgba(99,102,241,0.28);
  color: #a5b4fc;
  transition: background 0.2s;
}
.referral-apply-btn:hover { background: rgba(99,102,241,0.44); }
.referral-apply-msg {
  font-size: 10.5px;
  margin-top: 5px;
  color: #6ee7b7;
}
.referral-apply-msg.error { color: #f87171; }

/* Toast */
.ref-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  z-index: 9999;
  pointer-events: none;
  box-shadow: 0 4px 24px rgba(0,0,0,0.45);
  animation: ref-toast-in 0.25s ease;
  background: rgba(52,211,153,0.18);
  color: #6ee7b7;
  border: 1px solid rgba(52,211,153,0.4);
}
@keyframes ref-toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
