@font-face {
    font-family: 'SourceSans3';
    src: url('../assets/fonts/SourceSans3-Regular.woff2') format('woff2'),
         url('../assets/fonts/SourceSans3-Regular.woff')   format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'SourceSans3';
    src: url('../assets/fonts/SourceSans3-Semibold.woff2') format('woff2'),
         url('../assets/fonts/SourceSans3-Semibold.woff')   format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'SourceSans3';
    src: url('../assets/fonts/SourceSans3-Bold.woff2') format('woff2'),
         url('../assets/fonts/SourceSans3-Bold.woff')   format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
#invites-page {          
    height: calc(100% - var(--menu-height));
    overflow-y: auto;
}
.invites-page {
    font-family: 'SourceSans3', sans-serif;
    background-color: #0c0c16;
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-direction: column;
    box-sizing: border-box;
}
@media (min-width: 601px) {
    .invites-page {
        justify-content: center;
    }
}
.invites-wrapper {
    width: 100%;
    height: 100%;
    max-width: 390px;
    padding: 20px 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: auto;
    margin-right: auto;
}
.invites-title {
    font-weight: 700;
    font-size: 32px;
    background: linear-gradient(to right, #ffc74e 0%, #fff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    line-height: 1.2;
    margin: 0;
    flex-shrink: 0;
}
.stats-container, .summary-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 15px;
    flex-shrink: 0;
}
.stat-box {
    flex: 1;
    background-color: rgba(31, 38, 44, 0.7);
    border-radius: 12px;
    padding: 6px 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.2));
}
.stat-value {
    font-size: 38px;
    font-weight: 700;
    background: linear-gradient(to bottom, #fef9ec, #faae1e);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stat-label {
    color: #f5e9be;
    font-size: 19px;
    position: relative;
    bottom: 4px;
}
.invites-description {
    color: #bdbebe;
    font-size: 15px;
    text-align: center;
    line-height: 1.5;
    margin: 14px 0;
    flex-shrink: 0;
}
.referral-actions-container {
    width: 100%;
    background-color: rgba(29, 34, 39, 0.7);
    border-radius: 14px;
    border: 1px solid #26292e;
    padding: 14px 15px 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 15px;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.4));
    flex-shrink: 0;
}
.referral-section {
    width: 100%;
    box-sizing: border-box;
}
.referral-title {
    color: #e9dcb6;
    font-size: 21px;
    font-weight: 500;
    margin-bottom: 12px;
}
.link-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #252a30;
    border: 1px solid #373a41;
    border-radius: 8px;
    padding: 10px 5px 10px 15px;
}
#referralLinkText {
    color: #ecdebc;
    font-size: 16px;
}
.copy-button {
    background: linear-gradient(to bottom, #ffe308, #f4a919);
    color: #180400;
    font-weight: 700;
    font-size: 14px;
    border: 2px solid #de8d01;
    border-radius: 16px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    width: 57px;
    height: 28px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.copy-button:active {
    transform: scale(0.95);
}
.copy-button:disabled {
    background: #8a8a93;
    border-color: #777;
    color: #fff;
    cursor: default;
}
.copy-button.is-copied:disabled {
    color: #fff6cf;
    border-color: #d9a82d;
    background: linear-gradient(145deg, #806018, #3e351d);
    box-shadow: 0 0 0 1px rgba(255, 211, 92, 0.16), 0 0 14px rgba(255, 190, 40, 0.22);
    opacity: 1;
    font-size: 18px;
    animation: referral-copy-confirm 360ms cubic-bezier(.2, .85, .3, 1);
}

@keyframes referral-copy-confirm {
    0% { transform: scale(.82); }
    65% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.action-buttons {
    width: 100%;
    display: flex;
    gap: 15px;
}
.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-image: linear-gradient(to bottom, #3a3f46, #202328);
    color: #e0e0e0;
    border: 1px solid #1c1f23;
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.15s ease-out;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1),  /* Внутренние тени для создания эффекта блика сверху и затенения снизу */
                inset 0 -1px 1px rgba(0, 0, 0, 0.2);
}
.action-btn:active {
    transform: scale(0.95);
}
.action-btn img {
    height: 16px;
    width: auto;
}
.invites-separator {
    width: 100%;
    height: 2px;
    background: linear-gradient( to right, rgba(85, 85, 85, 0) 0%, rgba(85, 85, 85, 0.5) 50%, rgba(85, 85, 85, 0) 100% );
    margin: 10px 0;
    flex-shrink: 0;
}
.summary-box {
    flex: 1;
    background-color: rgba(23, 28, 34, 0.7);
    border-radius: 12px;
    padding: 6px 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0px;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.2));
}
.summary-label {
    color: #ffffff;
    font-size: 24px;
    font-weight: 200;
}
.summary-value {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
}
.summary-value span {
    font-size: 30px;
    background: linear-gradient(to bottom, #fef9ec, #faae1e);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.summary-value .icon-invited {
    height: 25px;
    width: auto;
}
.summary-value .icon-earnings {
    height: 21px;
    width: auto;
}
.referrals-sheet-overlay {
    position: fixed;
    inset: 0 0 calc(var(--menu-height, 70px) + var(--safe-area-inset-bottom, 0px)) 0;
    z-index: 940;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
    background: rgba(4, 7, 12, 0);
    pointer-events: none;
    visibility: hidden;
    transition: background-color 260ms ease, visibility 0s linear 320ms;
}

.referrals-sheet-overlay.is-open {
    background: rgba(4, 7, 12, 0.72);
    pointer-events: auto;
    visibility: visible;
    transition: background-color 260ms ease;
}

.referrals-sheet-overlay.is-preparing {
    visibility: visible;
}

.referrals-sheet {
    width: min(100%, 390px);
    max-height: min(68vh, 520px);
    overflow: hidden;
    color: #f5f5f5;
    background: linear-gradient(155deg, rgba(37, 43, 51, 0.99), rgba(14, 18, 24, 0.99));
    border: 1px solid rgba(255, 197, 66, 0.28);
    border-radius: 22px 22px 14px 14px;
    box-shadow: 0 -16px 50px rgba(0, 0, 0, 0.48), 0 0 34px rgba(255, 179, 0, 0.08);
    transform: translate3d(0, calc(100% + 24px), 0);
    opacity: 0;
    transition: transform 340ms cubic-bezier(.22, .9, .28, 1), opacity 220ms ease;
    will-change: transform;
}

.referrals-sheet-overlay.is-open .referrals-sheet {
    transform: translate3d(0, 0, 0);
    opacity: 1;
}

.referrals-sheet-handle {
    width: 42px;
    height: 4px;
    margin: 9px auto 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, #8d6411, #ffd45d, #8d6411);
}

.referrals-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.referrals-sheet-kicker {
    color: #ffc53d;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.referrals-sheet-header h2 {
    margin: 2px 0 0;
    font-size: 25px;
    line-height: 1;
}

.referrals-sheet-close {
    padding: 8px 12px;
    color: #d5d7da;
    font: 600 13px 'SourceSans3', sans-serif;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
}

.referrals-sheet-list {
    max-height: min(50vh, 390px);
    overflow-y: auto;
    padding: 8px 14px 16px;
    overscroll-behavior: contain;
}

.referrals-sheet-item {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.referrals-sheet-number {
    color: #ffca45;
    font-size: 12px;
    font-weight: 700;
}

.referrals-sheet-identity {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.referrals-sheet-identity strong {
    overflow: hidden;
    color: #f4f4f4;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.referrals-sheet-identity span {
    color: #8f969e;
    font-size: 12px;
}

.referrals-sheet-reward {
    color: #ffd05a;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.referrals-sheet-empty {
    display: flex;
    min-height: 128px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    color: #9da2a8;
    text-align: center;
}

.referrals-sheet-empty strong {
    color: #f3d886;
    font-size: 18px;
}

.referrals-sheet-empty span {
    max-width: 250px;
    font-size: 13px;
}
#invites-page .invites-wrapper {
    height: auto;
    min-height: 100%;
    padding: 16px 22px 6px;
}

#invites-page .invites-title {
    font-size: 26px;
    line-height: 1.16;
    margin: 0 0 14px;
}

#invites-page .invites-program-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    flex-shrink: 0;
    width: 100%;
    margin-bottom: 13px;
    border: 1px solid #33383c;
    border-radius: 12px;
    background: rgba(16, 20, 23, .65);
    box-sizing: border-box;
}

#invites-page .invites-program-tab {
    position: relative;
    min-width: 0;
    min-height: 38px;
    padding: 7px 6px 9px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: #96989b;
    font: 700 16px/1.2 'SourceSans3', sans-serif;
    cursor: pointer;
    transition: color 180ms ease, background-color 180ms ease;
}

#invites-page .invites-program-tab[aria-selected="true"] {
    color: #ffce50;
    background: linear-gradient(135deg, rgba(50, 53, 55, .6), rgba(35, 37, 39, .75));
    border-color: #34393c;
    box-shadow: inset 0 1px 0 #ffffff06;
}

#invites-page .invites-program-tab[aria-selected="true"]::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 2px;
    right: 2px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(90deg, #ffcc35, #ffdf68, #ffc426);
}

#invites-page .invites-program-tab:focus-visible,
#invites-page .affiliate-open-bot:focus-visible {
    outline: 2px solid #ffdf68;
    outline-offset: 3px;
}

#invites-page .invites-program-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    flex-shrink: 0;
}

#invites-page .invites-program-panel[hidden] {
    display: none;
}
#invites-page .invites-program-panel.is-switching-out {
    opacity: 0;
    transition: opacity 200ms ease-in-out;
    pointer-events: none;
}

#invites-page .affiliate-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

#invites-page .affiliate-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 76px;
    padding: 6px;
    border-radius: 13px;
    background: linear-gradient(130deg, rgba(30, 36, 40, .9), rgba(25, 30, 33, .78));
    box-shadow: 0 4px 12px #0002;
    box-sizing: border-box;
}

#invites-page .affiliate-rate {
    font-size: 38px;
    font-weight: 700;
    line-height: 1.1;
    background: linear-gradient(180deg, #fff0ba, #ffc642);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#invites-page .affiliate-stat > span {
    margin-top: 3px;
    color: #eee3be;
    font-size: 16px;
    line-height: 1.25;
    white-space: nowrap;
}

#invites-page .affiliate-lifetime {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #fff5df;
    font-size: 25px;
    font-weight: 700;
    line-height: 1.65;
    white-space: nowrap;
}

#invites-page .affiliate-lifetime svg {
    width: 32px;
    height: 22px;
    flex-shrink: 0;
    fill: none;
    stroke: #ffd24b;
    stroke-width: 3;
    stroke-linecap: round;
    overflow: visible;
}

#invites-page .affiliate-intro {
    margin: 11px 0;
    color: #b7babf;
    font-size: 15px;
    line-height: 1.4;
    text-align: center;
}

#invites-page .affiliate-guide {
    overflow: hidden;
    border: 1px solid #34393d;
    border-radius: 17px;
    background: linear-gradient(125deg, rgba(29, 34, 37, .88), rgba(22, 26, 29, .78));
    box-shadow: 0 6px 16px #0002, inset 0 1px 0 #ffffff03;
}

#invites-page .affiliate-guide-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 9px 16px;
    box-sizing: border-box;
}

#invites-page .affiliate-plane {
    flex-shrink: 0;
    width: 25px;
    height: 25px;
    fill: none;
    stroke: #ffd455;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#invites-page .affiliate-guide-header h2 {
    position: relative;
    z-index: 1;
    margin: 0;
    color: #fff4df;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

#invites-page .affiliate-guide-stars {
    position: relative;
    width: 49px;
    height: 28px;
    flex-shrink: 0;
    margin-left: auto;
}

#invites-page .affiliate-guide-stars::before {
    content: '';
    position: absolute;
    width: 65px;
    height: 1px;
    top: 23px;
    right: 3px;
    transform: rotate(-19deg);
    background: linear-gradient(90deg, transparent, #b68a2999);
}

#invites-page .affiliate-guide-stars img {
    position: absolute;
    width: 19px;
    height: 19px;
    right: 0;
    top: 5px;
}

#invites-page .affiliate-guide-stars img:first-child {
    width: 12px;
    height: 12px;
    right: 24px;
    top: 1px;
}

#invites-page .affiliate-guide-body {
    padding: 12px 15px;
    border-top: 1px solid #303538;
    border-radius: 16px 16px 0 0;
    background: linear-gradient(115deg, rgba(14, 18, 20, .2), rgba(33, 35, 37, .12));
}

#invites-page .affiliate-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0 0 14px;
    padding: 0 0 0 15px;
    list-style: none;
}

#invites-page .affiliate-steps li {
    position: relative;
    display: grid;
    grid-template-columns: 27px minmax(0, 1fr);
    gap: 24px;
    min-height: 39px;
}

#invites-page .affiliate-steps li:not(:last-child)::after {
    content: '';
    position: absolute;
    width: 2px;
    top: 31px;
    bottom: -9px;
    left: 12px;
    border-radius: 2px;
    background: linear-gradient(#656b70, #50565a);
}

#invites-page .affiliate-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 27px;
    height: 27px;
    margin-top: 1px;
    border: 1px solid #ffdd5b;
    border-radius: 50%;
    box-sizing: border-box;
    color: #16130b;
    background: linear-gradient(135deg, #ffe47a, #ffd23c 65%, #eeb62b);
    box-shadow: inset 0 1px 0 #fff4b96b;
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
}

#invites-page .affiliate-steps h3 {
    margin: 0;
    color: #f7f2e6;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

#invites-page .affiliate-steps p {
    margin: 3px 0 0;
    color: #b7b9bf;
    font-size: 14px;
    line-height: 1.3;
}

#invites-page .affiliate-open-bot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 43px;
    padding: 6px 12px;
    border: 1px solid #ffe892;
    border-radius: 15px;
    box-sizing: border-box;
    color: #100f08;
    background: linear-gradient(115deg, #ffdb45, #ffca26 58%, #ffda52);
    box-shadow: inset 0 1px 1px #fff5be9c, inset 0 -3px 5px #a9770026, 0 3px 8px #0003;
    font: 600 19px/1.2 'SourceSans3', sans-serif;
    text-decoration: none;
    cursor: pointer;
    transition: filter 160ms ease, transform 160ms ease;
}

#invites-page .affiliate-open-bot:active {
    transform: scale(.985);
    filter: brightness(.96);
}

#invites-page .affiliate-open-bot svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#invites-page .affiliate-notice {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 11px;
    padding: 9px 16px;
    border: 1px solid #34393d;
    border-radius: 14px;
    background: linear-gradient(115deg, rgba(30, 35, 38, .8), rgba(22, 27, 30, .7));
}

#invites-page .affiliate-notice svg {
    width: 23px;
    height: 23px;
    flex-shrink: 0;
    fill: none;
    stroke: #ffd24b;
    stroke-width: 2.2;
    stroke-linecap: round;
}

#invites-page .affiliate-notice p {
    margin: 0;
    color: #b9bdc3;
    font-size: 14px;
    line-height: 1.3;
}

#invites-page .invites-program-footnote {
    margin: 5px 0 0;
    color: #a4a8af;
    font-size: 13px;
    line-height: 1.25;
    text-align: center;
}

#invites-page #referralLinkText {
    min-width: 0;
    overflow-wrap: anywhere;
    -webkit-user-select: text;
    user-select: text;
}

#invites-page .link-box { gap: 10px; }
#invites-page .stat-box,
#invites-page .summary-box { min-width: 0; }
#invites-page .summary-value small { color: #ead8a3; font-size: 15px; }

@media (max-width: 374px) {
    #invites-page .invites-wrapper { padding: 16px 16px 12px; }
    #invites-page .invites-title { font-size: 26px; }
    #invites-page .affiliate-stat > span { font-size: 14px; }
    #invites-page .affiliate-lifetime { font-size: 22px; gap: 5px; }
    #invites-page .affiliate-lifetime svg { width: 27px; }
    #invites-page .affiliate-guide-header { padding-inline: 13px; gap: 10px; }
    #invites-page .affiliate-guide-header h2 { font-size: 17px; }
    #invites-page .affiliate-guide-stars { width: 31px; }
    #invites-page .affiliate-guide-stars img:first-child { right: 18px; }
    #invites-page .affiliate-steps { padding-left: 0; }
    #invites-page .affiliate-steps li { gap: 14px; }
    #invites-page .affiliate-steps h3 { font-size: 15px; }
    #invites-page .affiliate-notice { gap: 10px; padding-inline: 12px; }
    #invites-page .affiliate-notice-break { display: none; }
    #invites-page .invites-program-footnote { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    #invites-page .invites-program-tab,
    #invites-page .affiliate-open-bot { transition: none; }
}
