/* --- Переменные инкапсулированы в префикс --- */
.screen-referrals {
    --sr-bg-main: #0d1117;
    --sr-bg-card: rgba(22, 27, 34, 0.8);
    --sr-border-card: rgba(255, 255, 255, 0.08);
    --sr-accent-cyan: #5ab9d0;
    --sr-accent-cyan-hover: #4a9eb5;
    --sr-text-primary: #ffffff;
    --sr-text-secondary: #8b949e;
    --sr-success-green: #3fb950;
    --sr-glass-bg: rgba(255, 255, 255, 0.03);
    --sr-radius-card: 16px;
    --sr-radius-btn: 12px;
    --sr-font-main: 'Inter', -apple-system, sans-serif;

    color: var(--sr-text-primary);
    line-height: 1.5;
    font-family: var(--sr-font-main);
    min-height: 100vh;
    padding-bottom: 40px;
}

.screen-referrals * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: inherit;
}

.screen-referrals .container {
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
}

/* --- Glassmorphism Elements --- */
.screen-referrals .card {
    background-color: var(--sr-bg-card);
    border: 1px solid var(--sr-border-card);
    border-radius: var(--sr-radius-card);
    padding: 18px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* --- Tabs --- */
.screen-referrals .tabs {
    display: flex;
    background: var(--sr-glass-bg);
    border-radius: 14px;
    padding: 5px;
    margin-bottom: 24px;
    border: 1px solid var(--sr-border-card);
}

.screen-referrals .screen-referrals-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--sr-text-secondary);
    padding: 12px 0;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.screen-referrals .screen-referrals-tab-btn.active {
    background: var(--sr-accent-cyan);
    color: #000;
}

.screen-referrals .screen-referrals-tab-content {
    display: none;
    animation: screenReferralsFadeIn 0.4s ease-out;
}

.screen-referrals .screen-referrals-tab-content.active {
    display: block;
}

@keyframes screenReferralsFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Typography & UI Elements --- */
.screen-referrals .section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.screen-referrals .card-subtitle {
    font-size: 14px;
    color: var(--sr-text-secondary);
    margin-bottom: 18px;
}

/* --- How it works --- */
.screen-referrals .step-item {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    position: relative;
}

.screen-referrals .step-number {
    width: 28px;
    height: 28px;
    background: var(--sr-glass-bg);
    border: 1px solid var(--sr-accent-cyan);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--sr-accent-cyan);
    flex-shrink: 0;
}

.screen-referrals .step-text b {
    color: var(--sr-text-primary);
}

.screen-referrals .step-text p {
    font-size: 13px;
    color: var(--sr-text-secondary);
    margin-top: 2px;
}

/* --- Charts --- */
.screen-referrals .chart-container {
    height: 200px;
    margin: 10px 0;
}

/* --- Detailed Friend List --- */
.screen-referrals .friend-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.screen-referrals .friend-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.screen-referrals .friend-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--sr-accent-cyan), #8e44ad);
    border: 2px solid var(--sr-border-card);
    background-size: cover;
}

.screen-referrals .friend-info {
    flex: 1;
}

.screen-referrals .friend-name {
    font-weight: 600;
    font-size: 14px;
}

.screen-referrals .friend-uid {
    font-size: 11px;
    color: var(--sr-text-secondary);
    font-family: monospace;
}

.screen-referrals .friend-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--sr-border-card);
}

.screen-referrals .detail-label {
    color: var(--sr-text-secondary);
    display: block;
    margin-bottom: 2px;
}

.screen-referrals .tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--sr-glass-bg);
    font-size: 11px;
    font-weight: 600;
}

.screen-referrals .tag.plus {
    color: #f1c40f;
    border: 1px solid rgba(241, 196, 15, 0.3);
}

/* --- Shared Styles --- */
.screen-referrals .btn-primary {
    width: 100%;
    background: var(--sr-accent-cyan);
    color: #000;
    border: none;
    padding: 14px;
    border-radius: var(--sr-radius-btn);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.screen-referrals .btn-primary:active {
    transform: scale(0.98);
}

.screen-referrals .link-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--sr-border-card);
    padding: 12px;
    border-radius: var(--sr-radius-btn);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}