/* Referrals screen. Kept separate from app.css to make the component auditable. */

.fs-refs-subtitle {
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 6px;
}

/* Ссылка + основное действие "поделиться/скопировать" */
.fs-refs-share-block {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fs-refs-input {
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  font-size: 11px;
  padding: 9px 14px;
  outline: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.fs-refs-share-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.fs-refs-share-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.16s ease;
  background: linear-gradient(135deg, #22c55e, #3b82f6);
  color: #f9fafb;
  box-shadow:
    0 12px 25px rgba(34, 197, 94, 0.35),
    0 0 0 1px rgba(15, 23, 42, 0.8);
}

.fs-refs-share-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-0.5px);
}

.fs-refs-share-btn-icon {
  font-size: 14px;
  line-height: 1;
}

.fs-refs-copy-btn {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  background: rgba(15, 23, 42, 0.98);
  color: #e5e7eb;
  font-size: 15px;
  cursor: pointer;
  transition: 0.16s ease;
}

.fs-refs-copy-btn:hover {
  border-color: rgba(148, 163, 184, 0.9);
}

.fs-refs-copy-icon {
  line-height: 1;
}

.fs-refs-copy-label {
  display: none;
  font-size: 13px;
  font-weight: 600;
}

/* лёгкий подсвет после копирования */
.fs-refs-copy-btn--done {
  border-color: rgba(34, 197, 94, 0.9);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.4);
  color: #bbf7d0;
}

/* Если Web Share API недоступен (например, десктоп): единственная кнопка
   "Скопировать" занимает всю ширину и выглядит как основное действие. */
.fs-refs-share-row--share-unavailable .fs-refs-copy-btn {
  flex: 1;
  width: auto;
  height: auto;
  padding: 10px 14px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #22c55e, #3b82f6);
  color: #f9fafb;
  box-shadow:
    0 12px 25px rgba(34, 197, 94, 0.35),
    0 0 0 1px rgba(15, 23, 42, 0.8);
}

.fs-refs-share-row--share-unavailable .fs-refs-copy-btn--done {
  border: none;
  box-shadow:
    0 0 0 2px rgba(34, 197, 94, 0.9),
    0 12px 25px rgba(34, 197, 94, 0.35);
}

.fs-refs-share-row--share-unavailable .fs-refs-copy-label {
  display: inline-flex;
}

.fs-refs-note500 {
  font-size: 11px;
  color: #9ca3af;
}

.fs-refs-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.fs-refs-pill {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 11px;
  padding: 6px 8px;
  background: rgba(17, 24, 39, 0.98);
  border: 1px solid rgba(55, 65, 81, 0.9);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.fs-refs-pill span:first-child {
  font-size: 10px;
  color: #9ca3af;
}

.fs-refs-pill strong {
  font-size: 12px;
  color: #e5e7eb;
  white-space: nowrap;
}

/* Список моих рефералов внутри карточки */
.fs-refs-list-container {
  margin-top: 10px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(55, 65, 81, 0.9);
  overflow: hidden;
}

.fs-refs-list-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  font-size: 12px;
  cursor: pointer;
}

.fs-refs-list-header [data-role='title'] {
  flex: 1;
  min-width: 0;
  color: #e5e7eb;
}

.fs-refs-list-header [data-role='count'] {
  font-size: 11px;
  color: #9ca3af;
  white-space: nowrap;
}

.fs-refs-list-arrow {
  font-size: 13px;
  opacity: 0.8;
  transition: transform 0.18s ease;
}

.fs-refs-list-arrow--open {
  transform: rotate(90deg);
}

.fs-refs-list-body {
  border-top: 1px solid rgba(55, 65, 81, 0.9);
  max-height: 120px; /* видно примерно 3 строки */
  overflow: hidden;
}

.fs-refs-list-body--open {
  max-height: 260px; /* раскрытый список со скроллом — может быть много рефералов */
  overflow-y: auto;
}

/* строки списка */
.fs-refs-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 12px;
}

.fs-refs-row:nth-child(odd) {
  background: rgba(15, 23, 42, 0.98);
}

.fs-refs-row:nth-child(even) {
  background: rgba(17, 24, 39, 0.98);
}

.fs-refs-row-place {
  width: 20px;
  text-align: right;
  font-weight: 600;
  color: #9ca3af;
}

.fs-refs-row-name {
  flex: 1;
  min-width: 0;
  color: #e5e7eb;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fs-refs-row-coins {
  font-size: 11px;
  color: #9ca3af;
  white-space: nowrap;
}

.fs-refs-row-payout {
  width: 70px;
  text-align: right;
  font-weight: 600;
  font-size: 11px;
}

.fs-refs-row-payout--zero {
  color: #e5e7eb; /* белый 0 USDT */
}

.fs-refs-row-payout--win {
  color: #22c55e; /* зелёный +1000 USDT */
}

/* Топ рефералов */
.fs-refs-top-list {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fs-refs-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(55, 65, 81, 0.9);
}

.fs-refs-top-rank {
  font-size: 14px;
  font-weight: 700;
  color: #e5e7eb;
  width: 28px;
  text-align: center;
}

.fs-refs-top-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fs-refs-top-name {
  font-size: 13px;
  color: #e5e7eb;
}

.fs-refs-top-meta {
  font-size: 11px;
  color: #9ca3af;
}

.fs-refs-top-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.85);
  color: #bbf7d0;
  white-space: nowrap;
}

.fs-refs-top-note {
  margin-top: 6px;
  font-size: 11px;
  color: #6b7280;
}

@media (max-width: 360px) {
  .fs-refs-share-row {
    flex-wrap: wrap;
  }
}
