/* styles.css – финальная версия с поддержкой выбора цвета обводки */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
*::-webkit-scrollbar {
    display: none;
}

body {
    background: #0a0e1a;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: #eef2ff;
    padding-top: 70px;
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

/* ===== Верхняя панель ===== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(56, 189, 248, 0.25);
    padding: 12px 16px;
    z-index: 101;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header-logo {
    font-weight: 700;
    font-size: 18px;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.header-icons {
    display: flex;
    gap: 20px;
    align-items: center;
}
.header-icon {
    font-size: 24px;
    cursor: pointer;
    transition: 0.2s;
    position: relative;
}
.header-icon:active {
    transform: scale(0.94);
}
.notification-badge {
    position: absolute;
    top: -8px;
    right: -12px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* ===== Карточка профиля ===== */
.card {
    background: rgba(18, 24, 38, 0.7);
    backdrop-filter: blur(16px);
    border-radius: 28px;
    padding: 18px;
    margin: 12px 16px;
    border: 1px solid rgba(56, 189, 248, 0.2);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: visible !important;
}

/* Аватарка – центрированная */
#avatarClickWrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    cursor: pointer;
}
.avatar-circle {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    background-color: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(2px);
    border: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-bottom: 8px;
    transition: 0.2s;
}
.avatar-circle:hover {
    transform: scale(1.02);
}
.avatar-emoji {
    display: inline-block;
    line-height: 1;
}
.small-text {
    font-size: 12px;
    color: #9ca3af;
}

/* ===== Нижняя панель вкладок ===== */
.tabs-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(56, 189, 248, 0.25);
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
    z-index: 100;
    overflow-x: auto;
    white-space: nowrap;
}
.tabs {
    display: inline-flex;
    gap: 6px;
    padding: 0 12px;
}
.tab {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 60px;
    background: rgba(255, 255, 255, 0.04);
    transition: all 0.2s;
    cursor: pointer;
    min-width: 68px;
}
.tab.active {
    background: linear-gradient(135deg, #2b6e9e, #1a4c6e);
    box-shadow: 0 0 12px rgba(43, 110, 158, 0.6);
}
.tab-icon { font-size: 22px; margin-bottom: 4px; }
.tab-label { font-size: 11px; font-weight: 600; letter-spacing: 0.3px; }

/* ===== Кнопки и поля ===== */
button {
    background: linear-gradient(135deg, #2b6e9e, #1a4c6e);
    border: none;
    padding: 14px 20px;
    border-radius: 44px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    width: 100%;
    margin-top: 14px;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
button:active { transform: scale(0.96); opacity: 0.9; }
button.secondary { background: rgba(255, 255, 255, 0.1); margin-top: 8px; }
input {
    width: 100%;
    padding: 14px 18px;
    margin: 8px 0;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 44px;
    background: #111827;
    color: #f0f4ff;
    outline: none;
}
input:focus {
    border-color: #2b6e9e;
    box-shadow: 0 0 0 2px rgba(43, 110, 158, 0.4);
}

/* ===== Модальные окна (кнопки закреплены внизу) ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: #121826;
    border-radius: 32px;
    max-width: 90%;
    width: 450px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #2b6e9e;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    position: relative;
}
.modal-content h3 {
    text-align: center;
    margin: 16px 0 0 0;
    font-size: 18px;
    flex-shrink: 0;
}
.close-modal {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 28px;
    cursor: pointer;
    color: #9ca3af;
    z-index: 1;
}
.modal-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 16px 0;
    flex-shrink: 0;
}
.scrollable-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px;
}
.modal-buttons {
    position: sticky;
    bottom: 0;
    background: #121826;
    padding: 16px 20px;
    margin-top: auto;
    border-top: 1px solid rgba(56, 189, 248, 0.2);
    display: flex;
    gap: 12px;
}
.modal-buttons button {
    flex: 1;
    margin-top: 0;
}

/* ===== Сетки выбора ===== */
.avatars-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 20px 0;
}
.avatar-option {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    width: 65px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    margin: 0 auto;
}
.avatar-option.selected {
    border: 2px solid #2b6e9e;
    background: rgba(43, 110, 158, 0.3);
    transform: scale(1.05);
}
.avatar-option .avatar-emoji { font-size: 40px; line-height: 1; }
.bg-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 20px 0;
}
.bg-option {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.2s;
    margin: 0 auto;
    border: 2px solid transparent;
}
.bg-option.selected { border-color: #2b6e9e; transform: scale(1.05); }
.custom-color-preview {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    cursor: pointer;
    margin: 0 auto;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2b6e9e;
    font-size: 28px;
}

/* ===== Обводки – 3 варианта, каждый с выбором цвета ===== */
.border-options-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
}
.border-option-item {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.border-option-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 2;
}
.border-option-preview {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #2b6e9e;
    border: 3px solid rgba(255,255,255,0.9);
}
.border-option-details {
    flex: 1;
}
.border-option-name {
    font-weight: 600;
    font-size: 16px;
}
.border-option-price {
    font-size: 12px;
    color: #fbbf24;
}
.border-option-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}
.border-color-picker {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: transparent;
    padding: 0;
}
.border-select-btn {
    background: linear-gradient(135deg, #2b6e9e, #1a4c6e);
    border: none;
    padding: 8px 16px;
    border-radius: 40px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.border-select-btn:active { transform: scale(0.96); }
.border-select-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ===== Уведомления (модалка списка) ===== */
.notifications-list {
    max-height: 400px;
    overflow-y: auto;
}
.notification-item {
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.notification-item.unread {
    background: rgba(43,110,158,0.2);
    border-left: 3px solid #2b6e9e;
}
.notification-message { flex:1; font-size:13px; }
.notification-time {
    font-size:10px;
    color:#9ca3af;
    margin:0 12px;
    min-width:80px;
    text-align:right;
}
.notification-actions button {
    background:none;
    border:none;
    color:#9ca3af;
    cursor:pointer;
    padding:4px 8px;
    font-size:16px;
    width:auto;
    margin:0;
    box-shadow:none;
}

/* ===== Градиенты для фона аватарки ===== */
.bg-gradient1 { background: linear-gradient(135deg, #2b6e9e, #1a4c6e); }
.bg-gradient2 { background: linear-gradient(135deg, #9b59b6, #8e44ad); }
.bg-gradient3 { background: linear-gradient(135deg, #e67e22, #d35400); }
.bg-gradient4 { background: linear-gradient(135deg, #27ae60, #2ecc71); }
.bg-gradient5 { background: linear-gradient(135deg, #f1c40f, #f39c12); }
.bg-gradient6 { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.bg-gradient7 { background: linear-gradient(135deg, #1abc9c, #16a085); }
.bg-gradient8 { background: linear-gradient(135deg, #3498db, #2980b9); }
.bg-gradient9 { background: linear-gradient(135deg, #34495e, #2c3e50); }
.bg-gradient10 { background: linear-gradient(135deg, #ff9a9e, #fad0c4); }
.bg-gradient11 { background: linear-gradient(135deg, #a18cd1, #fbc2eb); }

/* ===== Достижения, статистика, прочее ===== */
.achievement-icons { display:flex; justify-content:center; gap:16px; margin:16px 0; flex-wrap:wrap; }
.achi-icon {
    width:56px; height:56px; background:rgba(255,255,255,0.05); border-radius:50%;
    display:flex; align-items:center; justify-content:center; font-size:32px; cursor:pointer;
    transition:0.2s; border:1px solid transparent;
}
.achi-icon.earned { background:linear-gradient(135deg,#2b6e9e,#1a4c6e); border-color:#60a5fa; box-shadow:0 0 10px rgba(43,110,158,0.5); }
.stats-container { display:flex; flex-direction:column; gap:12px; margin:16px 0; }
.stats-row { display:flex; gap:12px; justify-content:space-between; }
.stat-card { background:rgba(0,0,0,0.3); border-radius:24px; padding:16px; text-align:center; flex:1; }
.stat-value { font-size:28px; font-weight:800; background:linear-gradient(135deg,#eef2ff,#a5b4fc); -webkit-background-clip:text; background-clip:text; color:transparent; }
.stat-label { font-size:12px; margin-top:4px; }
.achievements-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; margin:16px 0; max-height:400px; overflow-y:auto; }
.achievement-card { background:rgba(0,0,0,0.3); border-radius:18px; padding:10px 8px; text-align:center; cursor:pointer; transition:0.2s; border:1px solid transparent; }
.achievement-card.selected { border-color:#2b6e9e; background:rgba(43,110,158,0.2); }
.achievement-card.disabled { opacity:0.4; cursor:not-allowed; filter:grayscale(0.3); }
.achievement-icon { font-size:28px; margin-bottom:4px; }
.achievement-name { font-weight:600; font-size:13px; }
.achievement-desc, .achievement-condition, .achievement-date { font-size:10px; color:#9ca3af; margin-top:4px; }
.progress-bar { background:rgba(255,255,255,0.1); border-radius:10px; height:6px; overflow:hidden; margin:6px 0; }
.progress-fill { background:linear-gradient(90deg,#2b6e9e,#60a5fa); height:100%; width:0%; border-radius:10px; }
.next-achievements { margin-top:12px; background:rgba(0,0,0,0.2); border-radius:20px; padding:12px; }
.next-achievement-item { margin-bottom:12px; }
.rank-card { display:flex; align-items:center; justify-content:space-between; background:rgba(0,0,0,0.3); border-radius:20px; padding:12px; margin-top:12px; }
.topup-amounts { display:flex; gap:12px; margin:16px 0; flex-wrap:wrap; }
.amount-btn { background:rgba(255,255,255,0.05); padding:10px 16px; border-radius:60px; text-align:center; cursor:pointer; transition:0.2s; font-weight:600; }
.amount-btn.selected { background:linear-gradient(135deg,#2b6e9e,#1a4c6e); color:white; box-shadow:0 0 8px #2b6e9e; }
.ticker { background:rgba(0,0,0,0.35); border-radius:60px; padding:8px 16px; overflow:hidden; white-space:nowrap; margin:12px 0; font-size:14px; }
.ticker-content { display:inline-block; animation:scroll 20s linear infinite; }
@keyframes scroll { 0% { transform:translateX(100%); } 100% { transform:translateX(-100%); } }
.info-panel { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:12px 0; }
.info-card { background:rgba(0,0,0,0.3); border-radius:20px; padding:12px; text-align:center; }
.filter-bar { display:flex; gap:8px; margin-bottom:16px; flex-wrap:wrap; }
.filter-btn, .sort-btn, .timeframe-btn { background:rgba(255,255,255,0.05); padding:6px 14px; border-radius:60px; font-size:13px; font-weight:500; cursor:pointer; transition:0.2s; }
.filter-btn.active, .sort-btn.active, .timeframe-btn.active { background:linear-gradient(135deg,#2b6e9e,#1a4c6e); color:white; }
.leaderboard-item, .history-item, .referral-item { display:flex; justify-content:space-between; padding:10px 0; border-bottom:1px solid rgba(255,255,255,0.05); }
#ordersList, #usersList, #adminOrdersList { max-height:400px; overflow-y:auto; }
