* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

body {
    background-color: #ffffff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    max-width: 400px;
    width: 100%;
    background: white;
    min-height: 100vh;
    position: relative;
    padding: 20px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* Шапка профиля */
.header {
    padding: 15px 0;
}

.profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    overflow: hidden;
}

.username {
    font-size: 16px;
    color: #666;
    margin-bottom: 2px;
}

.balance {
    font-size: 28px;
    font-weight: bold;
    color: #333;
}

/* Главная кнопка */
.main-button-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 30px 0 40px 0;
}

.power-button {
    width: 140px;
    height: 140px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08), inset 0 0 10px rgba(0, 0, 0, 0.02);
    border: 1px solid #f0f0f0;
}

.power-button:active {
    transform: scale(0.96);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05), inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

.power-icon {
    width: 50px;
    height: 50px;
    border: 8px solid #007bff;
    border-radius: 50%;
    position: relative;
    border-top-color: transparent;
}

.power-icon::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 30px;
    background-color: #007bff;
    border-radius: 4px;
}

.button-label {
    margin-top: 20px;
    color: #555;
    font-size: 18px;
    font-weight: bold;
}

/* Статистика */
.stats {
    display: flex;
    gap: 15px;
    margin: 15px 0;
}

.stat-card {
    flex: 1;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.stat-card:active {
    transform: scale(0.98);
    background: #e9ecef;
}

.stat-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

/* Кнопка вывода */
.withdraw-container {
    margin-top: 40px;
    text-align: center;
}

.withdraw-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    width: 100%;
    max-width: 400px;
}

.withdraw-button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-body {
    padding: 20px;
}

/* QR код */
.qr-container {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    min-height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Адрес */
.address-container {
    margin: 20px 0;
}

.address-box {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    font-family: monospace;
    word-break: break-all;
    margin: 10px 0;
}

.copy-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    margin-top: 8px;
}

.copy-btn.secondary {
    background: #4a5bc4;
}

.create-invoice-btn {
    background: #0b6ef6;
    color: #fff;
    border: none;
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    width: 100%;
    font-weight: 700;
    margin-top: 10px;
}

.invoice-details {
    background: #f8f9ff;
    border: 1px solid #dce4ff;
    border-radius: 10px;
    padding: 12px;
    margin-top: 16px;
}

.invoice-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
    color: #2d3a66;
    padding: 6px 0;
}

.invoice-row strong {
    color: #0f1f4f;
    font-family: monospace;
}

.exact-warning {
    background: #fff4e5;
}

.exact-warning p {
    color: #8a5a00;
}

/* Выбор сети — карточки */
.network-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.network-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 2px solid #eee;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafafa;
    user-select: none;
}

.network-card:active {
    transform: scale(0.98);
}

.network-card.active {
    border-color: #007bff;
    background: #f0f5ff;
}

.network-logo {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
}

.network-card-info {
    flex: 1;
}

.network-name {
    font-size: 15px;
    font-weight: 700;
    color: #222;
}

.network-sub {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.network-check {
    font-size: 18px;
    color: #007bff;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.network-card.active .network-check {
    opacity: 1;
}

.network-info {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.network-info p {
    margin: 5px 0;
    color: #1976d2;
    font-size: 14px;
}

/* Форма вывода */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.asset-select {
    position: relative;
}

.asset-select-trigger {
    width: 100%;
    border: 2px solid #eee;
    background: #fff;
    border-radius: 10px;
    padding: 11px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.asset-select.open .asset-select-trigger,
.asset-select-trigger:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.asset-select-arrow {
    color: #5d6a8a;
    font-size: 14px;
}

#withdrawAssetTriggerContent {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.asset-select-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e8ebf5;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(19, 41, 88, 0.14);
    padding: 6px;
    display: none;
    z-index: 20;
}

.asset-select.open .asset-select-menu {
    display: block;
}

.asset-option {
    width: 100%;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
}

.asset-option:active {
    transform: scale(0.99);
}

.asset-option.active {
    background: #eef3ff;
}

.asset-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
}

.asset-meta {
    flex: 1;
    min-width: 0;
}

.asset-title {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #1b2648;
}

.asset-sub {
    display: block;
    font-size: 12px;
    color: #66708a;
}

.asset-fee {
    font-size: 12px;
    font-weight: 700;
    color: #27335d;
}

.withdraw-estimate {
    background: linear-gradient(180deg, #f7f9ff 0%, #f2f5ff 100%);
    border: 1px solid #dde5ff;
    border-radius: 12px;
    padding: 12px;
    margin: 14px 0 10px;
}

.estimate-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #31416f;
    padding: 4px 0;
}

.estimate-row strong {
    color: #152554;
}

.estimate-row.muted {
    color: #6a7598;
}

.withdraw-hint {
    color: #5f6f9b;
    font-size: 12px;
    margin-bottom: 14px;
}

.confirm-withdraw[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.confirm-withdraw {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
}

.confirm-withdraw.loading {
    opacity: 0.95;
    background: linear-gradient(135deg, #5a6ccf 0%, #6f49a1 100%);
    position: relative;
    cursor: wait;
}

.confirm-withdraw.loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: withdrawSpin 0.8s linear infinite;
    vertical-align: middle;
}

@keyframes withdrawSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.confirm-withdraw:active {
    transform: translateY(2px);
}
