/* Referral ("invite a friend") modal — shared across all pages. */
.ref-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1200;
    backdrop-filter: blur(3px);
    padding: 16px;
}
.ref-overlay.show { display: flex; }

.ref-sheet {
    width: 100%;
    max-width: 380px;
    background: var(--tg-theme-bg-color, #18222d);
    color: var(--tg-theme-text-color, #fff);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 22px 20px 20px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
    text-align: center;
}
.ref-sheet h2 { font-size: 20px; margin: 0 0 6px; }
.ref-sheet .ref-sub { font-size: 13.5px; line-height: 1.45; color: var(--tg-theme-hint-color, rgba(255,255,255,0.7)); margin: 0 0 16px; }

.ref-stats {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}
.ref-stat {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 8px;
}
.ref-stat .ref-num { font-size: 22px; font-weight: 800; }
.ref-stat .ref-lbl { font-size: 11px; color: var(--tg-theme-hint-color, rgba(255,255,255,0.6)); margin-top: 2px; }

.ref-link-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.ref-link {
    flex: 1;
    min-width: 0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 11px 12px;
    color: var(--tg-theme-text-color, #fff);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ref-copy {
    flex: 0 0 auto;
    border: none;
    border-radius: 10px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.12);
    color: var(--tg-theme-text-color, #fff);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.ref-copy:active { transform: scale(0.95); }

.ref-share {
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 14px;
    background: linear-gradient(135deg, #3aa0ff, #1c7fe0);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(28, 127, 224, 0.4);
}
.ref-share:active { transform: scale(0.98); }

.ref-close {
    margin-top: 12px;
    background: none;
    border: none;
    color: var(--tg-theme-hint-color, rgba(255,255,255,0.6));
    font-size: 14px;
    cursor: pointer;
}
.ref-note { font-size: 12px; color: var(--tg-theme-hint-color, rgba(255,255,255,0.55)); margin-top: 10px; line-height: 1.4; }
