/* === ОСНОВНЫЕ СТИЛИ === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: #0A0E1A;
    color: #FFFFFF;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* === GLOBAL LOGO STYLES === */
/* Make token logo transparent, circular and blend well on any background */
img[src*="IMG_0360.PNG"],
.balance-icon,
.token-logo {
    background: transparent !important;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    border-radius: 50% !important; /* Делаем круглым */
    object-fit: cover;
}

/* Фоновая картинка - СТАТИЧНАЯ */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('/imgs/IMG_9666.PNG');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed; /* Фиксируем фон */
    z-index: -2;
    will-change: auto; /* Отключаем динамическую оптимизацию */
}

/* Затемняющий оверлей для лучшей читаемости */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 26, 0.75);
    z-index: -1;
}

.container {
    width: 100%;
    max-width: 100vw;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 80px; /* Отступ для навигации снизу */
    position: relative;
    z-index: 1;
}

/* Когда клавиатура открыта — не фиксируем навигацию, чтобы она не заезжала над клавиатурой */
.keyboard-open .container {
    padding-bottom: 16px;
}

/* === ВЕРХНИЙ ХЕДЕР === */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(18, 25, 44, 0.5);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 16px;
    font-weight: 600;
    color: #FFFFFF;
}

.user-status {
    font-size: 12px;
    color: #A0AEC0;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.balance-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
}

.balance-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(102, 126, 234, 0.15);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #FFFFFF;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.balance-icon {
    width: 20px;
    height: 20px;
    object-fit: cover;
    border-radius: 50%; /* Круглые иконки */
}

/* Make any square logos circular where used as avatars or badges */
.logo-round,
.balance-icon,
.list-icon img,
.user-avatar,
.center-logo,
.logo1 img,
img[src*="IMG_0360.PNG"] {
    border-radius: 50% !important; /* Все лого круглые */
}

.balance-icon-emoji {
    font-size: 16px;
    line-height: 1;
}

.balance-label {
    font-size: 11px;
    color: #A0AEC0;
    text-transform: uppercase;
}

.balance-amount {
    font-size: 18px;
    font-weight: 700;
    color: #48BB78;
}

.balance-secondary {
    font-size: 13px;
    color: #A0AEC0;
}

/* === ОСНОВНОЙ КОНТЕНТ === */
.main-content {
    flex: 1;
    padding: 20px;
}

.section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #FFFFFF;
}

/* === КАРТОЧКИ === */
.card {
    background: rgba(18, 25, 44, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #FFFFFF;
}

.card-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.card-description {
    font-size: 14px;
    color: #A0AEC0;
    margin-bottom: 16px;
    line-height: 1.5;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* === СПОНСОРСКАЯ КОЛЛЕКЦИЯ === */
.sponsor-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.2) 100%);
    border: 1px solid rgba(102, 126, 234, 0.35);
    position: relative;
    overflow: hidden;
}

.sponsor-card::after {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 70%);
    opacity: 0.6;
    pointer-events: none;
}

.sponsor-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.sponsor-card__titles {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sponsor-card__tag {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.85);
}

.sponsor-card__badge {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 0 0 1px rgba(102, 126, 234, 0.25);
}

.sponsor-card__subtitle {
    font-size: 14px;
    color: rgba(226, 232, 240, 0.9);
    line-height: 1.6;
    margin: 16px 0;
}

.sponsor-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sponsor-card__stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sponsor-card__stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
}

.sponsor-card__stat-label {
    font-size: 12px;
    color: rgba(226, 232, 240, 0.75);
}

.sponsor-card__cta {
    font-size: 13px;
    color: #ffffff;
    opacity: 0.9;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.sponsor-card:hover .sponsor-card__cta {
    opacity: 1;
    transform: translateX(4px);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* === СТРАНИЦА SUBGRAM === */
.sponsor-stats {
    margin-bottom: 24px;
}

.sponsor-intro {
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.15) 0%, rgba(56, 161, 105, 0.12) 100%);
    border: 1px solid rgba(72, 187, 120, 0.25);
    color: #E6FFFA;
}

.sponsor-intro__title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #ffffff;
}

.sponsor-intro__steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    color: rgba(226, 232, 240, 0.9);
    line-height: 1.6;
}

.sponsor-intro__step {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.sponsor-intro__highlight {
    color: #48BB78;
    font-weight: 700;
}

.sponsor-intro__note {
    margin-top: 12px;
    font-size: 12px;
    color: rgba(226, 232, 240, 0.65);
    line-height: 1.6;
}

.sponsor-task-card {
    background: rgba(18, 25, 44, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.sponsor-task-card:hover {
    border-color: rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.sponsor-task-card--completed {
    border-color: rgba(72, 187, 120, 0.45);
}

.sponsor-task-card__top {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sponsor-task-card__logo {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: rgba(102, 126, 234, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    overflow: hidden;
    flex-shrink: 0;
}

.sponsor-task-card__logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sponsor-task-card__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sponsor-task-card__name {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.sponsor-task-card__meta {
    font-size: 13px;
    color: #A0AEC0;
}

.sponsor-task-card__reward {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #48BB78;
    font-size: 15px;
}

.sponsor-task-card__reward img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.sponsor-task-card__actions {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sponsor-task-card__status {
    font-size: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1.3;
}

.sponsor-task-card__status--success {
    background: rgba(72, 187, 120, 0.15);
    color: #68D391;
    border: 1px solid rgba(72, 187, 120, 0.25);
}

.sponsor-task-card__status--info {
    background: rgba(102, 126, 234, 0.15);
    color: #A3BFFA;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.sponsor-task-card__status--warn {
    background: rgba(236, 201, 75, 0.15);
    color: #F6E05E;
    border: 1px solid rgba(236, 201, 75, 0.25);
}

.sponsor-task-card__status--error {
    background: rgba(245, 101, 101, 0.15);
    color: #FC8181;
    border: 1px solid rgba(245, 101, 101, 0.25);
}

/* === КНОПКИ === */
/* Контейнер для кнопок (синий прямоугольник) */
.buttons-container {
    background: rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 16px;
    padding: 16px;
    backdrop-filter: blur(10px);
}

.btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    position: relative;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #48BB78 0%, #38A169 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.25);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(72, 187, 120, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #F56565 0%, #E53E3E 100%);
    color: #FFFFFF;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
}

/* === СТАТИСТИКА === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: rgba(18, 25, 44, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-label {
    font-size: 12px;
    color: #A0AEC0;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #FFFFFF;
}

.stat-change {
    font-size: 12px;
    margin-top: 4px;
}

.stat-change.positive {
    color: #48BB78;
}

.stat-change.negative {
    color: #F56565;
}

/* === НИЖНЯЯ НАВИГАЦИЯ === */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(18, 25, 44, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.keyboard-open .bottom-nav {
    display: none; /* Скрываем футер при открытой клавиатуре */
}

.keyboard-open .container {
    padding-bottom: 0; /* Убираем отступ снизу при открытой клавиатуре */
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #A0AEC0;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(102, 126, 234, 0.15);
    color: #667eea;
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
}

/* === СПИСКИ === */
.list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list-item {
    background: rgba(18, 25, 44, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.list-item:hover {
    transform: translateX(4px);
    border-color: rgba(102, 126, 234, 0.5);
}

.list-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.list-content {
    flex: 1;
}

.list-title {
    font-size: 15px;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 4px;
}

.list-subtitle {
    font-size: 13px;
    color: #A0AEC0;
}

.list-action {
    flex-shrink: 0;
}

/* === ФОРМЫ === */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: #FFFFFF;
    font-size: 15px;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.1);
}

.form-input::placeholder {
    color: #A0AEC0;
}

/* === УТИЛИТЫ === */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 12px;
}

.gap-4 {
    gap: 16px;
}

/* === ЗАГРУЗЧИК === */
.loader {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === МОДАЛЬНОЕ ОКНО === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: rgba(18, 25, 44, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 24px;
    max-width: 400px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #FFFFFF;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* === EXCHANGE STYLES === */
.exchange-balances-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.exchange-balance-card {
    background: rgba(18, 25, 44, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.exchange-balance-card:hover {
    transform: translateY(-2px);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
}

.exchange-currency-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.exchange-icon-emoji {
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.exchange-balance-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.exchange-balance-label {
    font-size: 12px;
    color: #A0AEC0;
    font-weight: 500;
}

.exchange-balance-value {
    font-size: 18px;
    font-weight: 700;
    color: #FFFFFF;
}

/* === АДАПТИВНОСТЬ === */
@media (max-width: 480px) {
    .header {
        padding: 12px 16px;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .exchange-balances-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .balance-container {
        gap: 8px;
    }
    
    .balance-item {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .balance-icon {
        width: 16px;
        height: 16px;
    }
}
