:root {
    --bg: #121212;
    --card: #18181C;
    --card-light: #2c2d35;
    --text: #ffffff;
    --muted: #8e8e93;
    --accent: #0088CC;
    --border: #2c2d35;
    --danger: #ff3b30;
    --success: #30d158;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: -apple-system, sans-serif; -webkit-tap-highlight-color: transparent;}
body { background: var(--bg); color: var(--text); overflow-x: hidden; }
a { text-decoration: none; color: inherit; }

/* === СКВОЗНОЙ ХЕДЕР === */
.top-bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; position: sticky; top: 0; background: var(--bg); z-index: 50; }
.balance-pill { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); padding: 4px 12px; border-radius: 20px; font-weight: 600; font-size: 14px; cursor: pointer; background: var(--card);}
.plus-icon { background: var(--accent); color: #fff; width: 18px; height: 18px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 14px; line-height: 0; padding-bottom: 2px;}
.top-icons { display: flex; gap: 10px; }
.icon-btn { position: relative; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); display: flex; justify-content: center; align-items: center; font-size: 18px; cursor: pointer; background: var(--card); color: var(--text);}
.icon-btn.dark { background: rgba(0,0,0,0.6); border: none; color:white; }
.cart-badge { position: absolute; top: -4px; right: -4px; background: var(--danger); color: white; font-size: 10px; width: 18px; height: 18px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-weight: bold;}

/* === НАВИГАЦИЯ === */
.page { display: none; padding-bottom: 90px; min-height: 100vh;}
.page.active { display: block; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.page-title { padding: 15px 20px; font-size: 22px;}
.sub-header { display: flex; align-items: center; padding: 15px; background: var(--bg); position: sticky; top: 60px; z-index:40;}

/* === ТАБЫ === */
.tabs { display: flex; background: var(--card); margin: 0 15px 15px; border-radius: 12px; padding: 4px; }
.tab { flex: 1; text-align: center; padding: 10px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; transition: 0.2s;}
.tab.active { background: var(--card-light); color: var(--text); }

.search-box { display: flex; gap: 8px; padding: 0 15px 15px; align-items: center;}
.search-box input { flex: 1; background: var(--card); border: 1px solid var(--border); color: var(--text); padding: 10px 15px 10px 35px; border-radius: 12px; font-size: 14px; outline: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%238e8e93' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 12px center;}
.filter-btn { background: var(--card); border: 1px solid var(--border); color: var(--muted); width: 40px; height: 40px; border-radius: 12px; font-size: 16px; cursor:pointer;}
.filter-btn.active-view { color: var(--text); border-color: var(--accent); }

/* === NFT СЕТКА/СПИСОК === */
.nft-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 15px; }
.nft-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 10px; cursor: pointer;}
.nft-card:active { transform: scale(0.97); }
.nft-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; margin-bottom: 8px; }
.nft-card .name { font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.nft-card .price { background: var(--accent); text-align: center; padding: 6px; border-radius: 12px; font-size: 12px; font-weight: bold; }

/* === КОЛЛЕКЦИИ === */
.coll-header { display: flex; font-size: 11px; color: var(--muted); padding: 5px 15px 10px; text-transform: uppercase;}
.coll-item { display: flex; align-items: center; padding: 12px 15px; border-bottom: 1px solid var(--border);}
.coll-item img { width: 36px; height: 36px; border-radius: 8px; margin-right: 12px; object-fit: cover;}
.coll-item .c-name { flex: 1; font-weight: 600; font-size: 14px; }
.coll-item .c-val { width: 70px; text-align: right; font-size: 13px; font-weight: 600;}
.coll-item .c-val span { display:block; font-size: 11px; font-weight:normal; }
.plus { color: var(--success); }
.minus { color: var(--danger); }

/* === АКТИВНОСТЬ === */
.act-header { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; padding: 15px 20px; text-transform: uppercase; font-weight: bold;}
.act-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--border); cursor: pointer;}
.act-item img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; margin-right: 12px;}
.act-item .info { flex: 1; }
.act-item .name { font-weight: 600; font-size: 15px; margin-bottom: 2px;}
.act-item .tag { font-size: 12px; color: var(--muted); }
.act-item .price { font-weight: bold; font-size: 14px; }
.act-item .arrow { color: var(--muted); margin-left: 5px; }

/* === МЕНЮ (ПРОФИЛЬ) === */
.menu-top-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 0;}
.menu-profile-card { display: flex; align-items: center; gap: 15px; padding: 15px; background: var(--card); margin: 0 15px 15px; border-radius: 16px; }
.menu-profile-card img { width: 44px; height: 44px; border-radius: 50%; }
.menu-profile-card .name { font-size: 15px; font-weight: bold; }
.menu-profile-card .username { font-size: 12px; color: var(--muted); }
.menu-list { background: var(--card); margin: 0 15px 15px; border-radius: 16px; overflow: hidden;}
.menu-item { padding: 16px 20px; display: flex; align-items: center; gap: 15px; font-size: 15px; color: var(--text); font-weight: 500; border-bottom: 1px solid var(--border);}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--card-light); }
.menu-icon { color: var(--accent); font-size: 18px; width: 24px; text-align: center; }
.menu-header { padding: 15px 20px 5px; font-size: 12px; color: var(--muted); text-transform: uppercase; font-weight: bold;}

/* === КОШЕЛЕК И ФОРМЫ === */
.pay-hint { padding: 0 20px 10px; color: var(--muted); font-size: 13px; font-weight: 500;}
.pay-method { display: flex; align-items: center; justify-content: space-between; background: var(--card); border: 1px solid var(--border); margin: 8px 15px; padding: 12px 15px; border-radius: 16px; cursor: pointer; }
.pay-method.active { border-color: var(--accent); }
.pay-icon-box { width: 36px; height: 36px; background: var(--card-light); border-radius: 10px; display: flex; justify-content: center; align-items: center; font-size: 18px; margin-right: 12px;}
.pay-info { flex: 1; }
.pay-name { font-weight: bold; font-size: 14px; }
.pay-limit { font-size: 12px; color: var(--muted); margin-top: 2px; }
.radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--muted); display: flex; justify-content: center; align-items: center; flex-shrink: 0;}
.pay-method.active .radio, .radio-row.active .radio { border-color: var(--accent); }
.pay-method.active .radio::after, .radio-row.active .radio::after { content: ''; width: 10px; height: 10px; background: var(--accent); border-radius: 50%; }

.input-field { background: var(--card); border: 1px solid var(--border); color: var(--text); padding: 14px 15px; border-radius: 12px; font-size: 15px; outline: none; margin: 0 15px 10px; width: calc(100% - 30px);}
.main-btn { background: var(--accent); color: white; border: none; padding: 16px; border-radius: 12px; font-size: 16px; font-weight: bold; width: calc(100% - 30px); margin: 20px 15px; cursor: pointer; }
.empty-state { text-align: center; padding: 80px 20px; color: var(--muted); }
.empty-icon { font-size: 64px; margin-bottom: 15px; opacity: 0.4; }
.empty-state h3 { color: var(--text); margin-bottom: 10px; font-size: 18px; }
.empty-state p { line-height: 1.5; font-size: 13px; }

/* === ШТОРКИ === */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 200; opacity: 0; pointer-events: none; transition: 0.3s; }
.overlay.show { opacity: 1; pointer-events: all; }
.bottom-sheet { position: fixed; bottom: -100%; left: 0; right: 0; background: var(--card); border-radius: 20px 20px 0 0; z-index: 201; transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1); max-height: 90vh; overflow-y: auto; padding-bottom: 30px;}
.bottom-sheet.show { bottom: 0; }
.sheet-header { display: flex; justify-content: space-between; align-items: center; padding: 20px; position: sticky; top: 0; background: var(--card); z-index: 10;}
.sheet-title { font-size: 18px; font-weight: bold; }
.close-red-btn { background: var(--danger); color: white; border: none; width: 32px; height: 32px; border-radius: 8px; font-size: 18px; cursor: pointer; display: flex; justify-content: center; align-items: center;}

/* === ФИЛЬТРЫ (ползунок) === */
.slider-track { position: relative; height: 4px; background: var(--card-light); margin: 20px 25px; border-radius: 2px;}
.slider-fill { position: absolute; height: 4px; background: var(--accent); left: 0; right: 0; border-radius: 2px;}
.slider-thumb { position: absolute; width: 20px; height: 20px; background: var(--accent); border: 3px solid white; border-radius: 50%; top: -8px; transform: translateX(-50%); box-shadow: 0 2px 5px rgba(0,0,0,0.3);}
.radio-list { display: flex; flex-direction: column; margin: 0 15px; background: var(--card-light); border-radius: 12px; padding: 5px 15px;}
.radio-row { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--border); cursor: pointer; font-size:14px;}
.radio-row:last-child { border-bottom: none; }
.lang-pill { flex: 1; padding: 12px; background: var(--card-light); border: none; color: var(--muted); border-radius: 12px; font-size: 14px; cursor: pointer;}
.lang-pill.active { background: var(--border); color: var(--text); }

/* === ГРАФИК === */
.chart-box { height: 180px; position: relative; margin: 20px 15px; padding-right: 40px;}
.chart-labels { position: absolute; right: 0; top: 0; height: 100%; display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--muted); }
.chart-line { position: absolute; bottom: 50%; left: 0; right: 40px; height: 2px; background: var(--danger); box-shadow: 0 0 20px rgba(255,59,48,0.7);}
.chart-dates { position: absolute; bottom: -20px; left: 0; right: 40px; display: flex; justify-content: space-between; font-size: 11px; color: var(--muted);}
.chart-tabs { display: flex; background: var(--card-light); margin: 30px 15px 0; border-radius: 12px; padding: 4px;}
.c-tab { flex: 1; text-align: center; padding: 8px; font-size: 13px; color: var(--muted); font-weight: 600; border-radius:10px;}
.c-tab.active { background: var(--card); color: var(--text); }

/* === ВЕРИФИКАЦИЯ КРУГ === */
.big-red-cross { width: 80px; height: 80px; background: var(--danger); border-radius: 50%; margin: 0 auto; display: flex; justify-content: center; align-items: center; color: white; font-size: 40px; font-weight: bold;}

/* === ПОЛНОЭКРАННОЕ NFT === */
.nft-full-page { position: fixed; inset: 0; background: var(--bg); z-index: 300; display: none; overflow-y: auto; padding-bottom: 100px; }
.nft-full-page.show { display: block; animation: slideUp 0.2s ease;}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.nft-nav { position: absolute; top: 15px; left: 15px; right: 15px; display: flex; justify-content: space-between; z-index: 10;}
#view-img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 0 0 24px 24px; }
.view-content { padding: 20px; }
.view-coll { color: var(--accent); font-weight: bold; font-size: 13px; margin-bottom: 5px; }
.view-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;}
.view-title { font-size: 20px; font-weight: bold; }
.view-actions { display: flex; gap: 8px; }
.view-desc { color: var(--muted); font-size: 13px; line-height: 1.4; margin-bottom: 20px; background: var(--card); padding: 12px 15px; border-radius: 12px;}
.stats-row { display: flex; gap: 10px; margin-bottom: 20px; }
.stat-box { flex: 1; background: var(--card); border-radius: 12px; padding: 12px 15px; display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--border);}
.stat-box .lbl { font-size: 11px; color: var(--muted); margin-bottom: 4px; display: block;}
.stat-box .val { font-size: 14px; font-weight: bold; }
.stat-icon { font-size: 18px; color: var(--muted);}
.price-lbl { color: var(--muted); font-size: 13px; margin-bottom: 5px; }
.price-val { font-size: 26px; font-weight: bold; margin-bottom: 15px;}
.chart-link { color: var(--accent); font-size: 13px; font-weight: 600; margin-bottom: 20px; display: inline-block; cursor: pointer;}
.buy-bar { position: fixed; bottom: 0; width: 100%; background: var(--bg); padding: 15px; border-top: 1px solid var(--border); display: flex; gap: 10px;}
.buy-btn { flex: 1; background: var(--accent); color: white; border: none; border-radius: 12px; font-size: 15px; font-weight: bold; cursor: pointer;}
.cart-btn-round { background: var(--accent); color: white; width: 50px; border-radius: 50%; font-size: 20px; display: flex; justify-content: center; align-items: center; cursor: pointer;}

/* === КОРЗИНА === */
.cart-item { display: flex; align-items: center; gap: 10px; padding: 10px 15px; border-bottom: 1px solid var(--border);}
.cart-item img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover;}
.cart-item .info { flex: 1;}
.cart-item .n { font-size: 13px; font-weight: 600;}
.cart-item .n-id { font-size: 11px; color: var(--muted);}
.cart-item .price-pill { background: var(--accent); color: white; padding: 5px 10px; border-radius: 15px; font-size: 12px; font-weight: bold;}
.cart-item .cart-actions { display:flex; gap:8px; color: var(--muted); font-size:16px;}
.cart-warning { color: var(--danger); text-align:center; padding: 15px; font-size:13px;}

/* === НИЖНЯЯ ПАНЕЛЬ === */
.bottom-nav { position: fixed; bottom: 0; width: 100%; background: rgba(18,18,18,0.95); backdrop-filter: blur(10px); border-top: 1px solid var(--border); display: flex; padding: 10px 0; z-index: 100;}
.nav-btn { flex: 1; text-align: center; color: var(--muted); font-size: 10px; font-weight: 600; cursor: pointer; }
.nav-btn .icon { font-size: 20px; margin-bottom: 4px; }
.nav-btn.active { color: var(--accent); }