:root {
    --primary-color: #3A95D5;
    --button-bg: #DCE9F3;
    --background-color: #FFFFFF;
    --text-color: #222222;
    --secondary-text: #999999;
    --light-gray: #EFEFEF;
    --border-color: #EEEEEE;
    --tab-border: #D9D9D9;
    --user-bg: #EFEFEF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    padding: 0;
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 0 20px 20px;
    position: relative;
}

.container.loading .preloader {
    display: flex;
}
.container.loading > *:not(.preloader) {
    visibility: hidden;
}
.container:not(.loading) .preloader {
    display: none !important;
}
.preloader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 2000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.preloader-circle {
    width: 60px;
    height: 60px;
    border: 6px solid var(--light-gray);
    border-top: 6px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.preloader-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color);
    text-align: center;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.user-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px 0px;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.user-info {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 16px;
}

.user-username {
    font-size: 14px;
    color: var(--secondary-text);
}

.telegram-icon {
    width: 36px;
    height: 36px;
}

.telegram-icon svg {
    width: 100%;
    height: 100%;
}

.balance {
    text-align: center;
    margin-bottom: 25px;
}

.balance-amount {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-color);
}

.balance-usd {
    font-size: 18px;
    color: var(--text-color);
    margin-bottom: 20px;
}

.action-buttons {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    gap: 10px;
}

.action-button {
    flex: 1;
    background-color: var(--button-bg);
    color: var(--primary-color);
    border: none;
    border-radius: 10px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
}

.action-button svg {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    fill: var(--primary-color);
}

.connect-wallet {
    width: 100%;
    background-color: var(--light-gray);
    color: var(--text-color);
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 25px;
    cursor: pointer;
}

#connect-wallet {
    width: 100%;
}

#connect-wallet > div,
#connect-wallet tc-root,
#connect-wallet tc-root > div {
    width: 100% !important;
}

/* Кнопка с подключенным кошельком */
#connect-wallet button[data-tc-button="true"] {
    width: 100% !important;
    display: flex !important;
    justify-content: center;
    align-items: center !important;
    gap: 8px;
    padding: 12px;
    border-radius: 10px;
    box-sizing: border-box;
    font-size: 16px;
    font-weight: 500;
    background-color: var(--light-gray) !important;
    color: var(--text-color) !important;
    overflow: hidden;
}

/* Убедимся, что текст не разъезжается */
#connect-wallet [data-tc-text="true"] {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Иконка TON */
#connect-wallet button[data-tc-button="true"] svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.tabs {
    display: flex;
    position: relative;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--tab-border);
}

.tab {
    padding: 12px 15px 10px;
    font-size: 16px;
    font-weight: 500;
    color: var(--secondary-text);
    cursor: pointer;
    position: relative;
    flex: 1;
    text-align: center;
}

.tab.active {
    color: var(--primary-color);
}

.tab-indicator {
    position: absolute;
    bottom: -2px;
    height: 4px;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.transaction-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
}

.transaction-icon {
    width: 40px;
    height: 40px;
    background-color: var(--light-gray);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.transaction-icon svg path {
    fill: #3A95D5; /* или конкретный цвет, например, #000 */
    
}

.transaction-details {
    flex: 1;
}

.transaction-title {
    font-weight: 500;
    margin-bottom: 5px;
}

.transaction-date {
    font-size: 14px;
    color: var(--secondary-text);
}

.transaction-amount {
    text-align: right;
}

.amount-value {
    font-weight: 500;
    color: #4CAF50;
}

.amount-label {
    font-size: 14px;
    color: var(--secondary-text);
    margin-top: 2px;
}

.referral-section {
    margin-bottom: 20px;
}

.section-title {
    font-weight: 500;
    margin-bottom: 15px;
    font-size: 16px;
}

.referral-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.referral-link {
    flex: 3;
    background-color: var(--light-gray);
    border-radius: 10px;
    padding: 15px;
    font-size: 14px;
    word-break: break-all;
}

.copy-button {
    flex: 1;
    background-color: var(--light-gray);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.stats-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.stat-box {
    flex: 1;
    background-color: var(--light-gray);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.stat-value {
    font-weight: 600;
    font-size: 18px;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: var(--secondary-text);
}

.task-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
}

.task-icon {
    width: 40px;
    height: 40px;
    background-color: var(--light-gray);
    border-radius: 10px;
    margin-right: 15px;
    background-size: cover;
}

.task-details {
    flex: 1;
}

.task-title {
    font-weight: 500;
    margin-bottom: 5px;
}

.task-reward {
    font-size: 14px;
    color: var(--secondary-text);
}

.task-button {
    background-color: var(--button-bg);
    color: var(--primary-color);
    border: none;
    border-radius: 10px;
    padding: 8px 15px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.task-button svg {
    margin-right: 5px;
    width: 14px;
    height: 14px;
    fill: var(--primary-color);
}

.task-button.completed {
    background-color: #ccc;
    cursor: not-allowed;
}

.toast {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    max-width: 500px;
    margin: 0 auto;
    padding: 12px 20px;
    border-radius: 12px;
    color: var(--text-color);
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(-20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.toast.success {
    background: rgba(76, 175, 80, 0.15);
}

.toast.error {
    background: rgba(244, 67, 54, 0.15);
}

.toast.info {
    background: rgba(33, 150, 243, 0.15);
}

.toast[style*="opacity: 1"] {
    transform: translateY(0);
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
}

.modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    max-width: 500px;
    margin: 0 auto;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    padding: 20px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    transform: translateY(100%);
    transition: transform 0.2s ease-out;
    max-height: 80vh;
    overflow-y: auto;
}

.modal.active {
    transform: translateY(0);
}

.modal-header {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 20px;
}

.modal-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--light-gray);
    border-radius: 10px;
    margin-bottom: 15px;
    font-size: 16px;
}

.modal-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-button {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-align: center;
}

.modal-button.cancel {
    background-color: var(--light-gray);
    color: var(--text-color);
}

.modal-button.submit {
    flex: 1;
    background-color: var(--button-bg);
    color: var(--primary-color);
    border: none;
    border-radius: 10px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
}

.modal-button.submit svg {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    fill: var(--primary-color);
}

.modal-description {
    font-size: 14px;
    color: var(--secondary-text);
    margin-bottom: 20px;
    line-height: 1.4;
}

.access-list {
    list-style: none;
    padding: 0;
}

.access-list li {
    display: flex;
    align-items: center;
    padding: 10px 0;
    font-size: 14px;
    color: var(--text-color);
}

.access-list li::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
}