/* Сброс стилей и базовые настройки */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

:root {
    --tg-theme-bg-color: #ffffff;
    --tg-theme-text-color: #000000;
    --tg-theme-hint-color: #999999;
    --tg-theme-link-color: #2481cc;
    --tg-theme-button-color: #2481cc;
    --tg-theme-button-text-color: #ffffff;
    --tg-theme-secondary-bg-color: #f4f4f5;
    
    --primary-color: #0088cc;
    --success-color: #4caf50;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --info-color: #2196F3;
    
    --border-radius: 12px;
    --spacing: 16px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--tg-theme-bg-color);
    color: var(--tg-theme-text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--spacing);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Loader */
.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--tg-theme-secondary-bg-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Экраны */
.screen {
    animation: fadeIn 0.3s ease-in;
    position: relative;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Заголовки */
.header {
    text-align: center;
    margin-bottom: calc(var(--spacing) * 2);
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 0px;
}

.header h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--tg-theme-hint-color);
    font-size: 14px;
}

/* Футер приложения */
.app-footer {
    margin-top: calc(var(--spacing) * 2);
    padding-top: var(--spacing);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.channel-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 16px;
    text-decoration: none;
    color: var(--tg-theme-hint-color);
    font-size: 13px;
    font-weight: 400;
    transition: opacity 0.2s ease;
}

.channel-link:hover {
    opacity: 0.7;
}

.channel-icon {
    font-size: 14px;
}

/* Кнопка переключения языка */
.language-toggle-btn,
.bug-report-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--tg-theme-secondary-bg-color);
    color: var(--tg-theme-hint-color);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.language-toggle-btn:hover,
.bug-report-btn:hover {
    opacity: 0.7;
    transform: scale(1.05);
}

.language-toggle-btn:active,
.bug-report-btn:active {
    transform: scale(0.95);
}

/* Модальное окно выбора языка */
.language-modal-content {
    max-width: 320px;
    padding: 24px;
}

.language-modal-content h3 {
    margin: 0 0 20px 0;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--tg-theme-text-color);
}

.language-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid var(--tg-theme-secondary-bg-color);
    border-radius: 12px;
    background: var(--tg-theme-bg-color);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px;
}

.language-option:hover {
    background: var(--tg-theme-secondary-bg-color);
}

.language-option.active {
    border-color: var(--tg-theme-button-color);
    background: var(--tg-theme-secondary-bg-color);
}

.language-flag {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 24px;
}

.language-flag svg {
    width: 28px;
    height: 20px;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.language-name {
    flex: 1;
    text-align: left;
    font-weight: 500;
    color: var(--tg-theme-text-color);
}

.language-check {
    font-size: 18px;
    font-weight: bold;
    color: var(--tg-theme-button-color);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.language-option.active .language-check {
    opacity: 1;
}

/* Информация о пользователе */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: var(--spacing);
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: var(--border-radius);
    margin-bottom: calc(var(--spacing) * 1.5);
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #00a8ff);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 20px;
    overflow: hidden;
    position: relative;
}

.user-avatar span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.user-details h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.user-details p {
    font-size: 14px;
    color: var(--tg-theme-hint-color);
}

/* Кнопки меню */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Кнопки */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background-color: var(--tg-theme-secondary-bg-color);
    color: var(--tg-theme-text-color);
}

.btn-admin {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 2px solid #764ba2;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-admin:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* Фильтры админки */
.filter-btn {
    padding: 8px 16px;
    border: 2px solid var(--tg-theme-secondary-bg-color);
    border-radius: 8px;
    background: var(--tg-theme-bg-color);
    color: var(--tg-theme-text-color);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-btn:hover {
    background: var(--tg-theme-secondary-bg-color);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Карточка сделки в админке */
.admin-deal-card {
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: transform 0.2s;
}

.admin-deal-card:hover {
    transform: translateY(-2px);
}

.admin-deal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.admin-deal-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--tg-theme-text-color);
    margin: 0 0 4px 0;
}

.admin-deal-uuid {
    font-size: 11px;
    font-family: 'Courier New', monospace;
    color: var(--tg-theme-hint-color);
    word-break: break-all;
    overflow-wrap: break-word;
}

.admin-deal-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    font-size: 12px;
}

.admin-deal-info-item {
    display: flex;
    flex-direction: column;
}

.admin-deal-info-label {
    color: var(--tg-theme-hint-color);
    font-size: 11px;
}

.admin-deal-info-value {
    color: var(--tg-theme-text-color);
    font-weight: 600;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--tg-theme-secondary-bg-color);
    color: var(--tg-theme-text-color);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-danger {
    background-color: #f44336;
    color: white;
    border: 2px solid #f44336;
}

.btn-danger:hover {
    background-color: #d32f2f;
    border-color: #d32f2f;
}

.btn-complaint {
    background-color: #FF9800;
    color: white;
    border: 2px solid #FF9800;
    font-size: 14px;
}

.btn-complaint:hover {
    background-color: #F57C00;
    border-color: #F57C00;
}

.btn-icon {
    font-size: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon svg {
    display: block;
}

.channel-icon svg {
    display: block;
}

/* Глобальные стили для SVG иконок в кнопках */
button svg {
    vertical-align: middle;
}

.btn-icon-small {
    padding: 8px 12px;
    font-size: 14px;
}

.btn-refresh {
    margin-top: var(--spacing);
}

/* Формы */
.form-group {
    margin-bottom: calc(var(--spacing) * 1.5);
    overflow: hidden;
}

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

.form-control,
input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="email"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--tg-theme-secondary-bg-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    background-color: var(--tg-theme-bg-color);
    color: var(--tg-theme-text-color);
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    max-width: 100%;
}

.form-control:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--tg-theme-hint-color);
}

textarea.form-control,
textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--tg-theme-hint-color);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: calc(var(--spacing) * 2);
    padding-bottom: 20px;
}

.form-actions .btn {
    flex: 1;
}

/* Стили для полей date и time */
input[type="date"],
input[type="time"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.7;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Сообщения об успехе/ошибке */
.success-message,
.error-message,
.expired-message,
.cancelled-message {
    text-align: center;
    padding: 32px 24px;
    margin: 16px 0;
}

/* Завершенная сделка */
.success-message h3 {
    color: var(--tg-theme-text-color);
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
}

.success-message p {
    color: var(--tg-theme-hint-color);
    margin: 0;
    font-size: 14px;
}

/* Истекшая сделка */
.expired-message h3 {
    color: var(--tg-theme-text-color);
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
}

.expired-message p {
    color: var(--tg-theme-hint-color);
    margin: 0;
    font-size: 14px;
}

/* Отмененная сделка */
.cancelled-message h3 {
    color: var(--tg-theme-text-color);
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
}

.cancelled-message p {
    color: var(--tg-theme-hint-color);
    margin: 0;
    font-size: 14px;
}

.success-icon,
.error-icon,
.expired-icon,
.cancelled-icon {
    font-size: 64px;
    margin-bottom: 12px;
}

/* Старые стили для обратной совместимости */
.error-message h2,
.error-message h3 {
    color: var(--danger-color);
    margin-bottom: 12px;
}

/* Контейнер ссылки на сделку */
.deal-link-box {
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: var(--border-radius);
    padding: var(--spacing);
    margin: calc(var(--spacing) * 2) 0;
}

.deal-link-label {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
    margin-bottom: 8px;
    font-weight: 600;
}

.deal-link-display {
    background-color: var(--tg-theme-bg-color);
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    word-break: break-all;
    color: var(--tg-theme-link-color);
    font-family: 'Courier New', monospace;
    border: 2px solid var(--tg-theme-link-color);
}

/* Вертикальный заголовок сделки */
.deal-header-vertical {
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: var(--border-radius);
    padding: 20px 16px;
    margin-bottom: 20px;
    text-align: center;
}

.deal-header-vertical h2 {
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--tg-theme-text-color);
}

.status-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.status-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--tg-theme-hint-color);
}

/* Кнопка копирования ссылки (полная ширина) */
.btn-copy-link-full {
    width: 100%;
    padding: 12px 20px;
    background-color: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-copy-link-full:active {
    transform: scale(0.98);
    opacity: 0.8;
}

/* Детали сделки */
.deal-header {
    margin-bottom: calc(var(--spacing) * 2);
}

.status-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
}

.status-badge.active {
    background-color: #e3f2fd;
    color: #1976d2;
}

.status-badge.payment_confirmed {
    background-color: #fff9c4;
    color: #f57f17;
}

.status-badge.service_pending {
    background-color: #fff9c4;
    color: #f57f17;
}

.status-badge.completed {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-badge.cancelled {
    background-color: #ffebee;
    color: #c62828;
}

.status-badge.expired {
    background-color: #f5f5f5;
    color: #757575;
}

.status-badge.payment_pending {
    background-color: #fff3e0;
    color: #e65100;
}

.status-badge.waiting_seller_deposit {
    background-color: #fff9c4;
    color: #f57f17;
}

.status-badge.premarket_active {
    background-color: #e1f5fe;
    color: #0277bd;
}

.status-badge.premarket_expired {
    background-color: #ffe0b2;
    color: #e65100;
}

.deal-details {
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: var(--border-radius);
    padding: var(--spacing);
    margin-bottom: calc(var(--spacing) * 2);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row#comment-row {
    align-items: flex-start !important;
}

/* Маленькая кнопка копирования в строках */
.btn-copy-inline {
    background-color: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-copy-inline:active {
    transform: scale(0.95);
}

.btn-copy-inline:hover {
    opacity: 0.9;
}

.detail-label {
    font-weight: 600;
    color: var(--tg-theme-hint-color);
    font-size: 14px;
}

.detail-value {
    font-weight: 600;
    font-size: 14px;
}

/* Стили для комментария сделки с отступом */
#deal-comment {
    white-space: normal !important;
    display: block !important;
    word-wrap: break-word;
    flex: 1;
    text-align: right;
    line-height: 1.6;
}

#deal-comment > div,
#deal-comment .user-comment-indent {
    margin-left: 20px !important;
    margin-top: 6px !important;
    display: inline-block !important;
    padding-left: 0 !important;
    width: auto !important;
    max-width: 100% !important;
}

.user-comment-indent {
    margin-left: 20px !important;
    margin-top: 6px !important;
    padding-left: 20px !important;
    display: inline-block !important;
    width: auto !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Дополнительные стили для гарантии применения */
#deal-comment .user-comment-indent,
.detail-value .user-comment-indent {
    margin-left: 20px !important;
    padding-left: 20px !important;
    margin-top: 6px !important;
    display: inline-block !important;
}

#deal-comment br {
    display: block;
    margin-bottom: 4px;
}

/* Рейтинг пользователя */
.user-rating {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
    margin-left: 8px;
    font-weight: normal;
}

.user-rating::before {
    content: "⭐ ";
    font-size: 11px;
}

/* Секция оплаты */
.payment-section {
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: var(--border-radius);
    padding: var(--spacing);
    margin-bottom: calc(var(--spacing) * 2);
}

.payment-section h3 {
    margin-bottom: 12px;
    font-size: 16px;
}

/* Строка с реквизитами */
.payment-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--tg-theme-bg-color);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.payment-row.comment-row {
    background-color: #fff3e0;
    border: 2px solid var(--warning-color);
}

.payment-info-block {
    flex: 1;
    min-width: 0;
}

.payment-label {
    font-size: 11px;
    color: var(--tg-theme-hint-color);
    margin-bottom: 4px;
    font-weight: 600;
}

.payment-label.warning {
    color: #e65100;
}

.payment-value {
    font-size: 13px;
    word-break: break-all;
    line-height: 1.3;
}

.payment-value.amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.payment-value.mono {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: var(--tg-theme-link-color);
    word-break: break-all;
    overflow-wrap: break-word;
}

.payment-value.comment {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: 700;
    color: #e65100;
    letter-spacing: 1px;
}

/* Разбивка комиссии */
.fee-breakdown {
    background-color: var(--tg-theme-secondary-bg-color, rgba(0, 0, 0, 0.02));
    border-radius: 8px;
    padding: 12px;
    margin: 8px 0 16px 0;
    border: 1px dashed var(--tg-theme-hint-color, rgba(0, 0, 0, 0.1));
    opacity: 0.8;
}

.fee-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
}

.fee-row.fee-service {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin-top: 6px;
    padding-top: 10px;
}

.fee-label {
    color: var(--tg-theme-hint-color);
    font-weight: 500;
}

.fee-row.fee-service .fee-label {
    color: #e65100;
    font-weight: 600;
}

.fee-value {
    font-weight: 600;
    color: var(--tg-theme-text-color);
}

.fee-row.fee-service .fee-value {
    color: #e65100;
}

.fee-row.fee-network .fee-label {
    color: #e65100;
    font-weight: 600;
}

.fee-row.fee-network .fee-value {
    color: #e65100;
}

/* Маленькая кнопка копирования */
.btn-copy-small {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background-color: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-copy-small:active {
    transform: scale(0.95);
}

/* Секции действий */
.action-section {
    margin-bottom: calc(var(--spacing) * 2);
}

.help-text {
    text-align: center;
    color: var(--tg-theme-hint-color);
    font-size: 14px;
    margin-top: 8px;
}

/* Алерты */
.alert {
    padding: 16px;
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-info {
    background-color: #e3f2fd;
    color: #1976d2;
    border-left: 4px solid var(--info-color);
}

.alert-warning {
    background-color: #fff3e0;
    color: #e65100;
    border-left: 4px solid var(--warning-color);
}

/* Табы */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: calc(var(--spacing) * 2);
    background-color: var(--tg-theme-secondary-bg-color);
    padding: 4px;
    border-radius: var(--border-radius);
}

.tab {
    flex: 1;
    padding: 10px 8px;
    border: none;
    background-color: transparent;
    color: var(--tg-theme-text-color);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.tab.active {
    background-color: var(--tg-theme-bg-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Контейнер сделок */
.deals-container {
    margin-bottom: calc(var(--spacing) * 2);
}

.deal-card {
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: var(--border-radius);
    padding: var(--spacing);
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    word-wrap: break-word;
}

.deal-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.deal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 12px;
    max-width: 100%;
}

.deal-card-title {
    font-size: 16px;
    font-weight: 600;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    flex: 1;
    min-width: 0;
}

.deal-card-amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    flex-shrink: 0;
    white-space: nowrap;
}

.deal-card-info {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
}

.empty-state {
    text-align: center;
    padding: calc(var(--spacing) * 3);
    color: var(--tg-theme-hint-color);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Адаптация для темной темы */
@media (prefers-color-scheme: dark) {
    .payment-warning {
        background-color: rgba(255, 152, 0, 0.1);
    }
    
    .alert-info {
        background-color: rgba(33, 150, 243, 0.1);
    }
    
    .alert-warning {
        background-color: rgba(255, 152, 0, 0.1);
    }
}

/* Роадмап стадий сделки */
.deal-roadmap {
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: var(--border-radius);
    padding: 20px 16px;
    margin-bottom: 20px;
}

.roadmap-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    color: var(--tg-theme-text-color);
}

.roadmap-timeline {
    position: relative;
    padding-left: 45px; 
}

.roadmap-timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 10px;
    bottom: 27px;
    width: 2px;
    background: linear-gradient(180deg, 
        var(--tg-theme-hint-color) 0%, 
        var(--tg-theme-hint-color) 100%);
}

.roadmap-step {
    position: relative;
    padding-bottom: 24px;
}

.roadmap-step:last-child {
    padding-bottom: 0;
}

.step-marker {
    position: absolute;
    left: -22px;
    top: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #d1d5db;
    border: 3px solid var(--tg-theme-secondary-bg-color);
    transition: all 0.3s ease;
    z-index: 2;
}

/* Статусы маркеров */
.roadmap-step.completed .step-marker {
    background-color: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.roadmap-step.active .step-marker {
    background-color: #fbbf24;
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.2);
    animation: pulse 2s ease-in-out infinite;
}

.roadmap-step.pending .step-marker {
    background-color: #9ca3af;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.2);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(251, 191, 36, 0.1);
    }
}

.step-content {
    padding-left: 8px;
}

.step-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--tg-theme-text-color);
    margin-bottom: 2px;
    line-height: 1.4;
}

.step-description {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
    line-height: 1.3;
}

.roadmap-step.completed .step-title {
    color: #10b981;
}

.roadmap-step.active .step-title {
    color: #f59e0b;
    font-weight: 700;
}

.roadmap-step.pending .step-title {
    color: var(--tg-theme-hint-color);
}

.roadmap-step.pending .step-description {
    opacity: 0.6;
}

/* Кнопка просмотра транзакции */
.step-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 2px;
}

.btn-view-tx {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #0098ea 0%, #0066cc 100%);
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 152, 234, 0.2);
    white-space: nowrap;
}

.btn-view-tx:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 152, 234, 0.3);
    background: linear-gradient(135deg, #0088da 0%, #0055bb 100%);
}

.btn-view-tx:active {
    transform: translateY(0);
}

.tx-icon {
    font-size: 12px;
}

.tx-text {
    font-size: 10px;
    letter-spacing: 0.3px;
}

/* Адаптация для маленьких экранов */
@media (max-width: 480px) {
    .container {
        padding: 12px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .header h2 {
        font-size: 20px;
    }
    
    .btn {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .form-control {
        padding: 10px 14px;
        font-size: 15px;
    }
}

/* Профиль пользователя */
.profile-info {
    text-align: center;
    padding: 20px 0;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #00a8ff);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 40px;
    overflow: hidden;
    position: relative;
}

.profile-avatar span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Статистика */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
}

.stat-card {
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-card-wide {
    grid-column: 1 / -1;
}

.stat-icon {
    font-size: 32px;
    line-height: 1;
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--tg-theme-hint-color);
    margin-bottom: 6px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--tg-theme-text-color);
    margin-bottom: 4px;
}

.stat-count {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
}

/* Дополнительные правила для предотвращения переполнения */
/* Для всех элементов с моноширинным шрифтом */
[style*="Courier New"],
[style*="monospace"] {
    word-break: break-all;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Для длинных строк и кодов */
.mono,
code,
pre {
    word-break: break-all;
    overflow-wrap: break-word;
    max-width: 100%;
    white-space: pre-wrap;
}

/* ===== Модальное окно профиля пользователя ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background-color: var(--tg-theme-bg-color);
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--tg-theme-hint-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--tg-theme-hint-color);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background-color: var(--tg-theme-secondary-bg-color);
}

.modal-body {
    padding: 20px;
}

/* Кликабельные имена пользователей */
.clickable-user-name {
    transition: all 0.2s ease;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

.clickable-user-name:hover {
    background-color: var(--primary-color);
    color: white !important;
    text-decoration: none !important;
    transform: scale(1.05);
}

.clickable-user-name:active {
    transform: scale(0.98);
}

/* Чек-лист профиля */
.profile-checklist {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checklist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: 8px;
    gap: 12px;
}

.checklist-label {
    font-size: 14px;
    color: var(--tg-theme-hint-color);
    flex-shrink: 0;
}

.checklist-value {
    font-size: 14px;
    font-weight: 600;
    text-align: right;
    word-break: break-word;
}

/* Реферальная кнопка */
.btn-referral {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.btn-referral:hover {
    background: linear-gradient(135deg, #5568d3 0%, #63408b 100%);
}

/* Анимация для кнопок реферальной программы */
#copy-referral-btn:active,
#share-referral-btn:active {
    transform: scale(0.96);
    opacity: 0.9;
}

#copy-referral-btn:hover {
    box-shadow: 0 4px 12px rgba(52, 120, 246, 0.35);
    transform: translateY(-1px);
}

#share-referral-btn:hover {
    background: rgba(52, 120, 246, 0.05);
    border-color: var(--tg-theme-button-color, #3478f6);
}

/* Анимация копирования */
@keyframes button-success {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.btn-copied {
    animation: button-success 0.3s ease;
    background: #4CAF50 !important;
    border-color: #4CAF50 !important;
}

/* ==================== СТИЛИ ПРЕМАРКЕТА ==================== */

/* Бейдж премаркета */
.premarket-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 12px;
    vertical-align: middle;
    animation: badge-appear 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes badge-appear {
    from {
        opacity: 0;
        transform: scale(0.5) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Карточка информации о премаркете */
.premarket-info-card {
    margin: 20px 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 16px;
    overflow: hidden;
    animation: card-slide-in 0.5s ease-out;
}

@keyframes card-slide-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.premarket-info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    font-size: 15px;
}

.premarket-info-header svg {
    animation: rotate-icon 2s ease-in-out infinite;
}

@keyframes rotate-icon {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(10deg); }
}

.premarket-info-content {
    padding: 16px;
}

.premarket-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.premarket-info-row:last-child {
    border-bottom: none;
}

.premarket-info-row .label {
    font-size: 14px;
    color: var(--tg-theme-hint-color);
}

.premarket-info-row .value {
    font-size: 16px;
    font-weight: 600;
    color: var(--tg-theme-text-color);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Таймер обратного отсчета */
.countdown-timer-card {
    margin: 20px 16px;
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    animation: card-slide-in 0.6s ease-out 0.2s both;
}

.countdown-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    font-size: 15px;
}

.countdown-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.countdown-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--tg-theme-text-color);
    min-width: 60px;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse-number 1s ease-in-out infinite;
}

@keyframes pulse-number {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.countdown-label {
    font-size: 11px;
    color: var(--tg-theme-hint-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.countdown-separator {
    font-size: 32px;
    font-weight: 700;
    color: var(--tg-theme-hint-color);
    margin: 0 4px;
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
    0%, 49%, 100% { opacity: 1; }
    50%, 99% { opacity: 0.3; }
}

.countdown-progress-bar {
    height: 6px;
    background: rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.countdown-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 1s linear, background 0.5s ease;
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Секция внесения залога */
.premarket-deposit-section {
    margin: 20px 16px;
    animation: card-slide-in 0.5s ease-out;
}

.deposit-header {
    text-align: center;
    margin-bottom: 24px;
}

.deposit-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.deposit-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--tg-theme-text-color);
    margin: 0 0 8px 0;
}

.deposit-header p {
    font-size: 14px;
    color: var(--tg-theme-hint-color);
    margin: 0;
}

.deposit-info-box {
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.deposit-amount {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 2px dashed rgba(0, 0, 0, 0.1);
}

.deposit-amount .label {
    font-size: 14px;
    color: var(--tg-theme-hint-color);
}

.deposit-amount .amount {
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.deposit-amount .percent {
    font-size: 14px;
    color: var(--tg-theme-hint-color);
}

.deposit-address-box {
    margin-bottom: 20px;
}

.deposit-address-box label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--tg-theme-text-color);
    margin-bottom: 8px;
}

.address-display {
    background: rgba(102, 126, 234, 0.05);
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.address-display:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.address-display:active {
    transform: translateY(0);
}

.address-display code {
    flex: 1;
    font-size: 13px;
    word-break: break-all;
    color: var(--tg-theme-text-color);
    font-family: 'Courier New', monospace;
}

.address-display svg {
    flex-shrink: 0;
    stroke: #667eea;
}

.deposit-address-box small {
    display: block;
    font-size: 12px;
    color: var(--tg-theme-hint-color);
    margin-top: 8px;
    text-align: center;
}

.deposit-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: rgba(102, 126, 234, 0.05);
    border-left: 3px solid #667eea;
    border-radius: 8px;
    margin-top: 20px;
}

.deposit-note svg {
    flex-shrink: 0;
    stroke: #667eea;
    margin-top: 2px;
}

.deposit-note span {
    font-size: 13px;
    line-height: 1.5;
    color: var(--tg-theme-text-color);
}

/* ============= МАРКЕТПЛЕЙС ============= */

/* Шапка маркетплейса */
.marketplace-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: #242F3D;
    height: 56px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-back-btn,
.header-create-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    border-radius: 8px;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.header-back-btn:hover,
.header-create-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.header-back-btn:active,
.header-create-btn:active {
    background-color: rgba(255, 255, 255, 0.2);
}

.header-back-btn svg {
    stroke: #FFFFFF;
}

.header-create-btn {
    background-color: var(--tg-theme-button-color, #0088cc);
    color: #FFFFFF;
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.header-create-btn svg {
    stroke: #FFFFFF;
}

.header-title {
    flex: 1;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0;
    padding: 0 12px;
}

/* Фильтры маркетплейса */
.marketplace-filters {
    background-color: var(--tg-theme-bg-color, #ffffff);
    border-bottom: 1px solid var(--tg-theme-secondary-bg-color, #f4f4f5);
    padding: 12px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.marketplace-filters::-webkit-scrollbar {
    display: none;
}

.filters-scroll {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    min-width: max-content;
}

.filter-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background-color: var(--tg-theme-secondary-bg-color, #f4f4f5);
    color: var(--tg-theme-text-color, #000000);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}

.filter-btn.active {
    background-color: var(--tg-theme-button-color, #0088cc);
    color: #FFFFFF;
}

.filter-btn:not(.active):hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.filter-btn.filter-icon {
    padding: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255, 152, 0, 0.1);
    color: #ff9800;
}

.filter-btn.filter-icon svg {
    stroke: currentColor;
}

/* Выпадающий список категорий */
.category-filter-wrapper {
    position: relative;
    display: inline-block;
}

.category-filter-select {
    padding: 8px 16px;
    padding-right: 36px;
    border: none;
    border-radius: 20px;
    background-color: var(--tg-theme-secondary-bg-color, #f4f4f5);
    color: var(--tg-theme-text-color, #000000);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    min-width: 140px;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

.category-filter-select:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.category-filter-select:focus {
    outline: none;
    background-color: var(--tg-theme-button-color, #0088cc);
    color: #FFFFFF;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.category-filter-select option {
    background-color: var(--tg-theme-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
    padding: 8px;
}

/* Кнопка фильтра подарков */
.category-filter-btn {
    padding: 8px 16px;
    padding-right: 36px;
    border: none;
    border-radius: 20px;
    background-color: var(--tg-theme-secondary-bg-color, #f4f4f5);
    color: var(--tg-theme-text-color, #000000);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    position: relative;
}

.category-filter-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.category-filter-btn:active {
    transform: scale(0.98);
}

.category-filter-btn svg {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.6;
}

/* Кнопка сброса фильтров */
.reset-filters-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background-color: var(--tg-theme-secondary-bg-color, #f4f4f5);
    color: var(--tg-theme-text-color, #000000);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 0;
}

.reset-filters-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}

.reset-filters-btn:active {
    transform: scale(0.95);
}

.reset-filters-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

/* Список объявлений маркетплейса */
.marketplace-list {
    background-color: var(--tg-theme-bg-color, #ffffff);
}

.marketplace-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--tg-theme-secondary-bg-color, #f4f4f5);
    cursor: pointer;
    transition: background-color 0.15s;
    background-color: var(--tg-theme-bg-color, #ffffff);
}

.marketplace-item:active {
    background-color: var(--tg-theme-secondary-bg-color, #f4f4f5);
}

.marketplace-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.marketplace-item-icon tgs-player {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}

.marketplace-item-icon tgs-player picture,
.marketplace-item-icon tgs-player picture canvas {
    width: 100% !important;
    height: 100% !important;
}

.marketplace-item-icon {
    font-size: 40px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: var(--tg-theme-secondary-bg-color, #f4f4f5);
    border-radius: 12px;
}

.marketplace-item-content-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.marketplace-item-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--tg-theme-text-color, #000000);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

.marketplace-item-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 10px;
    background: var(--tg-theme-secondary-bg-color, rgba(255, 255, 255, 0.05));
    border-radius: 6px;
}

.marketplace-item-category {
    font-size: 11px;
    color: var(--tg-theme-hint-color, #999999);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

.marketplace-item-subtitle {
    font-size: 11px;
    color: var(--tg-theme-hint-color, #999999);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

.marketplace-item-seller {
    font-size: 10px;
    color: var(--tg-theme-hint-color, #999999);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
    margin-top: 2px;
}

.marketplace-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.marketplace-item-price {
    font-size: 16px;
    font-weight: 600;
    color: var(--tg-theme-text-color, #000000);
    white-space: nowrap;
}

.marketplace-item-buy-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 16px;
    background-color: var(--tg-theme-button-color, #0088cc);
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.marketplace-item-buy-btn:active {
    opacity: 0.7;
}

/* Пустое состояние */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-text {
    font-size: 16px;
    color: var(--tg-theme-hint-color, #999999);
}

/* Загрузка дополнительных элементов */
.loading-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 12px;
}

.loading-more p {
    font-size: 14px;
    color: var(--tg-theme-hint-color, #999999);
}

.spinner-small {
    width: 24px;
    height: 24px;
    border: 3px solid var(--tg-theme-secondary-bg-color, #f4f4f5);
    border-top-color: var(--tg-theme-button-color, #0088cc);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Форма создания оффера */
.create-offer-form {
    padding: 16px;
    background-color: var(--tg-theme-bg-color, #ffffff);
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--tg-theme-text-color, #000000);
}

#gift-link-input {
    width: 100% !important;
    min-width: 250px !important;
    flex: 1 1 0% !important;
    max-width: none !important;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--tg-theme-secondary-bg-color, #f4f4f5);
    border-radius: 12px;
    font-size: 16px;
    background-color: var(--tg-theme-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #000000);
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--tg-theme-button-color, #0088cc);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--tg-theme-hint-color, #999999);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 2px solid var(--tg-theme-secondary-bg-color, #f4f4f5);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background-color: var(--tg-theme-bg-color, #ffffff);
}

.radio-label:hover {
    border-color: var(--tg-theme-button-color, #0088cc);
    background-color: rgba(0, 136, 204, 0.05);
}

.radio-label input[type="radio"] {
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--tg-theme-button-color, #0088cc);
}

.radio-label input[type="radio"]:checked + span {
    font-weight: 600;
    color: var(--tg-theme-button-color, #0088cc);
}

.radio-label:has(input[type="radio"]:checked) {
    border-color: var(--tg-theme-button-color, #0088cc);
    background-color: rgba(0, 136, 204, 0.1);
}

.radio-label span {
    flex: 1;
    font-size: 16px;
    color: var(--tg-theme-text-color, #000000);
    user-select: none;
}

/* Опции выбора подарков */
.gift-options {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--tg-theme-secondary-bg-color, #f4f4f5);
}

/* Секция завершения премаркета */
.premarket-complete-section {
    margin: 20px 16px;
    animation: card-slide-in 0.5s ease-out;
}

.complete-header {
    text-align: center;
    margin-bottom: 24px;
}

.complete-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.complete-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--tg-theme-text-color);
    margin: 0 0 8px 0;
}

.complete-header p {
    font-size: 14px;
    color: var(--tg-theme-hint-color);
    margin: 0;
}

.payout-info {
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.payout-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 15px;
}

.payout-row.total {
    border-top: 2px solid rgba(0, 0, 0, 0.1);
    margin-top: 8px;
    padding-top: 16px;
    font-weight: 700;
    font-size: 18px;
}

.payout-row .value {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* Pulse анимация для кнопок */
.pulse-animation {
    animation: pulse-button 2s ease-in-out infinite;
}

@keyframes pulse-button {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
}

/* Большие кнопки */
.btn-large {
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.btn-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn-large:active {
    transform: translateY(0);
}

/* Стили для выбора NFT-подарков */
.gift-options-block {
    margin-top: 20px;
    padding: 16px;
    background: var(--tg-theme-secondary-bg-color);
    border-radius: var(--border-radius);
}

.gift-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.gift-option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    background: var(--tg-theme-bg-color);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.gift-option-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.gift-option-card.selected {
    border-color: var(--primary-color);
    background: rgba(0, 136, 204, 0.1);
    box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.2);
}

.gift-preview-container {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--tg-theme-secondary-bg-color);
    position: relative;
}

.gift-preview-placeholder {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 8px;
}

tgs-player {
    display: block;
    width: 80px;
    height: 80px;
    position: relative;
    overflow: hidden;
}

tgs-player picture {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 80px !important;
    max-height: 80px !important;
    position: relative !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

tgs-player picture canvas {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    display: block !important;
    object-fit: contain !important;
}

tgs-player picture > * {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    display: block !important;
    object-fit: contain !important;
}

.gift-option-name {
    font-size: 12px;
    text-align: center;
    color: var(--tg-theme-text-color);
    font-weight: 500;
    line-height: 1.3;
    word-break: break-word;
    max-width: 100px;
}

.gift-option-card.selected .gift-option-name {
    color: var(--primary-color);
    font-weight: 600;
}

/* Кнопка выбора модели */
.model-select-btn {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--tg-theme-secondary-bg-color);
    border: 1px solid var(--tg-theme-hint-color);
    border-radius: var(--border-radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    color: var(--tg-theme-text-color);
}

.model-select-btn:hover {
    background-color: var(--tg-theme-bg-color);
    border-color: var(--primary-color);
}

.model-select-btn:active {
    transform: scale(0.98);
}

.model-select-btn svg {
    color: var(--tg-theme-hint-color);
    transition: transform 0.2s ease;
}

/* Bottom Sheet Modal */
.bottom-sheet-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    pointer-events: none;
}

.bottom-sheet-modal.show {
    display: block;
    pointer-events: all;
}

.bottom-sheet-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bottom-sheet-modal.show .bottom-sheet-backdrop {
    opacity: 1;
}

.bottom-sheet-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 85vh;
    background-color: var(--tg-theme-bg-color);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bottom-sheet-modal.show .bottom-sheet-content {
    transform: translateY(0);
}

.bottom-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--tg-theme-secondary-bg-color);
    flex-shrink: 0;
}

.bottom-sheet-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--tg-theme-text-color);
}

.bottom-sheet-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--tg-theme-hint-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    width: 36px;
    height: 36px;
}

.bottom-sheet-close:hover {
    background-color: var(--tg-theme-secondary-bg-color);
}

.bottom-sheet-search {
    position: relative;
    padding: 16px 20px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--tg-theme-secondary-bg-color);
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 60px !important;
    background-color: var(--tg-theme-secondary-bg-color);
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 16px;
    color: var(--tg-theme-text-color);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.search-input::placeholder {
    color: var(--tg-theme-hint-color);
    opacity: 1;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--tg-theme-bg-color);
    padding-left: 60px !important;
}

.search-icon {
    position: absolute;
    left: 36px; /* 20px (padding контейнера) + 16px (отступ от края input) */
    top: 50%;
    transform: translateY(-50%);
    color: var(--tg-theme-hint-color);
    pointer-events: none;
    z-index: 2;
    width: 20px;
    height: 20px;
    display: block;
}

.bottom-sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.model-selector-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.model-selector-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--tg-theme-secondary-bg-color);
    gap: 16px;
}

.model-selector-item:hover {
    background-color: var(--tg-theme-secondary-bg-color);
}

.model-selector-item.selected {
    background-color: rgba(var(--primary-color-rgb, 0, 136, 204), 0.1);
}

.model-selector-item:last-child {
    border-bottom: none;
}

.model-selector-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--tg-theme-hint-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.model-selector-item.selected .model-selector-checkbox {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.model-selector-checkbox svg {
    width: 16px;
    height: 16px;
    color: white;
    display: none;
}

.model-selector-item.selected .model-selector-checkbox svg {
    display: block;
}

.model-selector-preview {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: 12px;
    overflow: hidden;
}

.model-selector-preview tgs-player {
    width: 100%;
    height: 100%;
}

.model-selector-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.model-selector-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--tg-theme-text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.model-selector-item.selected .model-selector-name {
    color: var(--primary-color);
    font-weight: 600;
}

/* Стили для цветных блоков фонов */
.model-selector-preview[style*="background"] {
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.model-selector-item.selected .model-selector-preview {
    border-color: var(--primary-color);
    box-shadow: 0 2px 12px rgba(0, 136, 204, 0.4);
}

/* Стили для PNG изображений в превью узоров */
.model-selector-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Стили для страницы объявления маркетплейса */
.marketplace-offer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--tg-theme-bg-color);
    border-bottom: 1px solid var(--tg-theme-section-separator-color, rgba(255, 255, 255, 0.1));
    position: sticky;
    top: 0;
    z-index: 100;
}

.marketplace-offer-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--tg-theme-text-color);
    margin: 0;
}

.marketplace-offer-content {
    padding: 20px 16px 160px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.marketplace-offer-preview {
    width: 100%;
    max-width: min(280px, calc(100vw - 48px));
    margin: 0 auto 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    z-index: 0;
}

/* Убираем общее правило для всех div, так как оно влияло на контейнер ссылки */

.offer-preview-placeholder {
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(60px, 15vw, 80px);
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 16px;
    border: 1px solid var(--tg-theme-section-separator-color, rgba(255, 255, 255, 0.1));
}

.marketplace-offer-preview tgs-player {
    width: 100% !important;
    height: 100% !important;
    min-width: 200px !important;
    min-height: 200px !important;
    max-width: none !important;
    max-height: none !important;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.marketplace-offer-preview tgs-player picture {
    width: 100% !important;
    height: 100% !important;
    min-width: 200px !important;
    min-height: 200px !important;
    max-width: none !important;
    max-height: none !important;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.marketplace-offer-preview tgs-player picture canvas {
    width: 100% !important;
    height: 100% !important;
    min-width: 200px !important;
    min-height: 200px !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.marketplace-offer-preview a {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 12px;
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 8px;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    word-break: break-all;
    transition: opacity 0.2s;
}

.marketplace-offer-preview a:active {
    opacity: 0.7;
}

.marketplace-offer-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--tg-theme-text-color);
    margin-bottom: 8px;
    text-align: center;
    padding: 0 4px;
    word-wrap: break-word;
}

.marketplace-offer-category {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
    text-align: center;
    margin-bottom: 8px;
}

/* Цена теперь в футере */

.marketplace-offer-seller-info {
    margin-top: 8px;
    margin-bottom: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--tg-theme-section-separator-color, rgba(255, 255, 255, 0.1));
}

.seller-main {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--tg-theme-bg-color);
    border-radius: 8px;
}

.seller-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--tg-theme-section-bg-color, rgba(255, 255, 255, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.seller-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.seller-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.seller-details {
    flex: 1;
    min-width: 0;
}

.seller-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--tg-theme-text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.seller-stats {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.seller-stats svg {
    color: #FFC107;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    vertical-align: middle;
}

.marketplace-offer-date {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
    text-align: center;
    margin-bottom: 8px;
    padding: 0 4px;
}

.offer-divider {
    height: 1px;
    background: var(--tg-theme-section-separator-color, rgba(255, 255, 255, 0.1));
    margin: 8px 0;
    margin: 8px 0;
    width: 100%;
}

.marketplace-offer-product-info {
    margin-bottom: 8px;
    padding: 8px 4px;
    border-top: 1px solid var(--tg-theme-section-separator-color, rgba(255, 255, 255, 0.1));
}

.product-info-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--tg-theme-hint-color);
    margin-bottom: 6px;
}

.product-info-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.product-info-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 8px;
    font-size: 14px;
}

.product-info-label-small {
    color: var(--tg-theme-hint-color);
    font-size: 13px;
}

.product-info-value {
    color: var(--tg-theme-text-color);
    font-weight: 500;
    text-align: right;
    word-break: break-word;
    margin-left: 12px;
}

.marketplace-offer-description {
    margin-bottom: 8px;
    margin-top: 8px;
}

.description-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--tg-theme-hint-color);
    margin-bottom: 6px;
}

.description-text {
    font-size: 16px;
    line-height: 1.5;
    color: var(--tg-theme-text-color);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.marketplace-offer-details {
    margin-bottom: 8px;
}

.offer-detail-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--tg-theme-bg-color);
    border-radius: 8px;
    margin-bottom: 6px;
    margin-bottom: 8px;
}

.offer-detail-item .detail-label {
    font-size: 14px;
    color: var(--tg-theme-hint-color);
}

.offer-detail-item .detail-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--tg-theme-text-color);
    text-align: right;
}

/* Липкий футер */
.marketplace-offer-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--tg-theme-bg-color);
    border-top: 1px solid var(--tg-theme-section-separator-color, rgba(255, 255, 255, 0.1));
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 100;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.offer-footer-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.offer-footer-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    line-height: 1.2;
}

.offer-footer-commission {
    font-size: 11px;
    color: var(--tg-theme-hint-color);
    text-align: center;
    line-height: 1.2;
}

.marketplace-offer-buy-btn {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: var(--primary-color);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.marketplace-offer-buy-btn:active {
    opacity: 0.8;
}

.marketplace-offer-delete-btn {
    width: 100%;
    padding: 14px 24px;
    margin-top: 12px;
    background-color: var(--tg-theme-destructive-text-color, #f44336);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}

.marketplace-offer-delete-btn:hover {
    background-color: #d32f2f;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}

.marketplace-offer-delete-btn:active {
    opacity: 0.8;
    transform: scale(0.98);
}

.marketplace-offer-delete-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.back-btn {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--tg-theme-text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s;
}

.back-btn:active {
    background: var(--tg-theme-secondary-bg-color);
}

/* Стили для страницы обмена подарками */
.gift-exchange-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.gift-column {
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* Стили для отдельных ячеек подарков (подтверждено) */
.gift-cell.confirmed {
    position: relative;
}

.gift-cell.confirmed::before {
    /* Полупрозрачный оранжевый overlay на ячейку */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 152, 0, 0.3); /* Полупрозрачный оранжевый */
    border-radius: 8px;
    z-index: 10;
    pointer-events: none;
}

.gift-cell.confirmed::after {
    /* Значок замочка на ячейке */
    content: '🔒';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    opacity: 0.7;
    z-index: 11;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Стили для отдельных ячеек подарков (проверено/получено) */
.gift-cell.verified {
    position: relative;
}

.gift-cell.verified::before {
    /* Полупрозрачный зеленый overlay на ячейку */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(76, 175, 80, 0.3); /* Полупрозрачный зеленый */
    border-radius: 8px;
    z-index: 10;
    pointer-events: none;
}

.gift-cell.verified::after {
    /* Значок галочки на ячейке */
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 36px;
    color: #4caf50;
    font-weight: bold;
    opacity: 0.8;
    z-index: 11;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.gift-column-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
    color: var(--tg-theme-text-color);
}

.gift-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
    min-height: 200px;
}

.gift-cell {
    aspect-ratio: 1;
    border: 2px dashed var(--tg-theme-hint-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tg-theme-secondary-bg-color);
    position: relative;
    transition: all 0.2s ease;
    overflow: hidden;
}

.gift-cell.filled {
    border: 2px solid var(--primary-color);
    background: var(--tg-theme-bg-color);
    border-style: solid;
}

/* Статусы подтверждения теперь применяются к колонкам, а не к отдельным ячейкам */

.gift-cell-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tg-theme-hint-color);
    font-size: 24px;
}

.gift-cell-content {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    z-index: 0; /* Подарок должен быть под overlay */
}

.gift-animation {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    animation: giftPulse 2s ease-in-out infinite;
}

.gift-cell-content tgs-player {
    width: 90% !important;
    height: 90% !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(0.9) !important;
    max-width: none !important;
    max-height: none !important;
    display: block !important;
    z-index: 1 !important;
}

.gift-cell-content tgs-player picture {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    position: relative !important;
    display: block !important;
}

.gift-cell-content tgs-player picture canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain !important;
    display: block !important;
}

.gift-cell-content > div {
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

@keyframes giftPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.gift-remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(244, 67, 54, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    padding: 0;
    transition: all 0.2s ease;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.gift-remove-btn:hover {
    background: #d32f2f;
    transform: scale(1.1);
}

.gift-remove-btn:active {
    transform: scale(0.95);
}

.gift-buttons-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.gift-buttons-row .gift-add-btn,
.gift-buttons-row .gift-confirm-btn {
    flex: 1;
    min-width: 0;
}

.gift-divider {
    height: 1px;
    background: var(--tg-theme-hint-color);
    opacity: 0.2;
    margin-top: 16px;
    margin-bottom: 16px;
}

/* Блок оплаты обмена */
.gift-payment-info {
    margin-top: 16px;
    padding: 16px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.gift-payment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 14px;
    color: var(--tg-theme-text-color);
}

.gift-payment-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.gift-payment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.gift-payment-label {
    color: var(--tg-theme-hint-color);
}

.gift-payment-value {
    font-weight: 600;
    color: var(--tg-theme-text-color);
}

.gift-payment-item.gift-payment-fee {
    opacity: 0.8;
}

.gift-payment-divider {
    height: 1px;
    background: var(--tg-theme-hint-color);
    opacity: 0.1;
    margin: 4px 0;
}

.gift-payment-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 4px;
    font-size: 15px;
}

.gift-payment-total .gift-payment-label {
    font-weight: 600;
    color: var(--tg-theme-text-color);
}

.gift-payment-total .gift-payment-value {
    font-weight: 700;
    font-size: 16px;
    color: var(--primary-color);
}

.gift-payment-wallet {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(102, 126, 234, 0.1);
}

.gift-payment-wallet-label {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
    margin-bottom: 4px;
}

.gift-payment-wallet-address {
    font-size: 13px;
    font-family: 'Courier New', monospace;
    color: var(--tg-theme-text-color);
    word-break: break-all;
    padding: 8px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
}

.gift-payment-balance {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(102, 126, 234, 0.1);
}

.gift-payment-balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
}

.gift-payment-balance-label {
    color: var(--tg-theme-hint-color);
}

.gift-payment-balance-value {
    font-weight: 600;
    color: var(--tg-theme-text-color);
}

.gift-payment-progress {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.gift-payment-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #4caf50);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.gift-payment-balance-status {
    font-size: 12px;
    text-align: center;
    color: var(--tg-theme-hint-color);
}

.gift-payment-balance-status.success {
    color: #4caf50;
    font-weight: 600;
}

.gift-payment-balance-status.warning {
    color: #ff9800;
    font-weight: 600;
}

.gift-payment-balance-status.error {
    color: #f44336;
    font-weight: 600;
}

.gift-input-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gift-input-wrapper {
    display: flex;
    gap: 8px;
}

.gift-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--tg-theme-hint-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--tg-theme-bg-color);
    color: var(--tg-theme-text-color);
    box-sizing: border-box;
}

.gift-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.gift-add-btn {
    width: 100%;
    padding: 12px 20px;
    white-space: nowrap;
}

.gift-count {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
    text-align: center;
}

.gift-count.full {
    color: var(--danger-color);
    font-weight: 600;
}

.gift-exchange-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
    position: relative;
    z-index: 10;
    background: var(--tg-theme-bg-color);
    padding-top: 16px;
}

.gift-confirm-btn,
.gift-copy-link-btn {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    position: relative;
    z-index: 20;
}

.gift-confirm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.gift-exchange-back-btn-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: var(--tg-theme-bg-color);
    border-top: 1px solid rgba(0,0,0,0.08);
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.gift-exchange-content {
    padding-bottom: 100px !important;
}

@media (max-width: 600px) {
    .gift-exchange-columns {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .gift-grid {
        min-height: 180px;
    }
}

