:root {
    --bg-main: #121212;
    --card-bg: #18181c;
    --card-border: #2d2d34;
    --accent-blue: #0088CC;
    --accent-blue-hover: #0077b5;
    --text-white: #ffffff;
    --muted: #8e8e93;
    --danger-red: #ff3b30;
    --success-green: #30d158;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-white);
    overflow: hidden;
    user-select: none;
}

/* Принудительное ограничение размера контейнера мобильного экрана */
.app-container {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    background-color: var(--bg-main);
}

/* === СКВОЗНОЙ ХЕДЕР === */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background-color: var(--bg-main);
    border-bottom: 1px solid #1f1f24;
    z-index: 50;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.back-nav-btn {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 20px;
    cursor: pointer;
}

.balance-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-white);
    cursor: pointer;
}

.plus-circle {
    background-color: var(--accent-blue);
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.icon-btn {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    color: var(--text-white);
}

.cart-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background-color: var(--danger-red);
    color: white;
    font-size: 9px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--bg-main);
}

/* === ОСНОВНОЙ КОНТЕНТ === */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 70px;
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

.subscreen {
    display: none;
}

.subscreen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    padding: 16px 16px 8px;
}

/* СЕГМЕНТ-КОНТРОЛЬ */
.segment-control-wrap {
    padding: 8px 16px;
}

.segment-control {
    display: flex;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 2px;
}

.seg-btn {
    flex: 1;
    padding: 8px 0;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
}

.seg-btn.active {
    background-color: var(--card-border);
    color: var(--text-white);
}

/* ПОИСК И ФИЛЬТРЫ */
.search-filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px 12px;
}

.search-input-wrap {
    position: relative;
    flex: 1;
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 9px;
    font-size: 13px;
    color: var(--muted);
}

.search-input-wrap input {
    width: 100%;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 8px 12px 8px 32px;
    font-size: 13px;
    color: var(--text-white);
    outline: none;
}

.icon-btn.active-view {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* СЕТКА NFT 2х2 */
.nft-grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 16px;
}

.nft-card-item {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.nft-card-item:active {
    transform: scale(0.98);
}

.nft-card-cover {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    object-fit: cover;
    background: linear-gradient(135deg, #4f46e5, #9333ea, #ec4899);
}

.pixelated {
    image-rendering: pixelated;
}

.nft-card-name {
    font-size: 13px;
    font-weight: 700;
    margin-top: 8px;
    padding: 0 2px;
}

.blue-price-btn {
    width: 100%;
    background-color: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 7px 0;
    font-size: 12px;
    font-weight: 700;
    margin-top: 6px;
    cursor: pointer;
}

/* ТАБЛИЦА КОЛЛЕКЦИЙ */
.coll-table-header {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    padding: 8px 16px;
    border-bottom: 1px solid #1f1f24;
}

.coll-table-body {
    padding: 0 16px;
}

.coll-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #1a1a1e;
}

.coll-info {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 40%;
}

.coll-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
}

.coll-title {
    font-size: 13px;
    font-weight: 700;
}

.coll-stat {
    text-align: right;
    width: 30%;
    display: flex;
    flex-direction: column;
}

.coll-price {
    font-size: 13px;
    font-weight: 700;
}

.percent-plus {
    color: var(--success-green);
    font-size: 11px;
    font-weight: 600;
}

.percent-minus {
    color: var(--danger-red);
    font-size: 11px;
    font-weight: 600;
}

/* ПУСТЫЕ СОСТОЯНИЯ (EMPTY STATES) */
.empty-state-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 12px;
}

.empty-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.empty-desc {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.4;
    max-width: 260px;
}

/* АКТИВНОСТЬ (ЛЕНТА) */
.activity-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
}

.act-sub-lbl {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}

.sort-chip {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 11px;
    color: var(--muted);
}

.activity-list {
    padding: 0 16px;
}

.act-row-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 10px;
    margin-bottom: 8px;
    cursor: pointer;
}

.act-row-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.act-thumb {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: cover;
}

.act-meta {
    display: flex;
    flex-direction: column;
}

.act-name {
    font-size: 13px;
    font-weight: 700;
}

.act-txid {
    font-size: 11px;
    color: var(--muted);
    margin-top: 1px;
}

.act-row-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.act-price-bold {
    font-size: 13px;
    font-weight: 700;
}

/* МЕНЮ (ПРОФИЛЬ) */
.menu-screen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 16px;
}

.menu-profile-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 12px 16px;
    margin: 0 16px 16px;
}

.profile-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.profile-name {
    font-size: 15px;
    font-weight: 700;
}

.profile-handle {
    font-size: 12px;
    color: var(--muted);
}

.menu-nav-group {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    margin: 0 16px 12px;
    overflow: hidden;
}

.menu-nav-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #1f1f24;
    cursor: pointer;
}

.menu-nav-row:last-child {
    border-bottom: none;
}

.menu-nav-row:active {
    background-color: var(--card-border);
}

.menu-row-icon {
    font-size: 16px;
    color: var(--accent-blue);
    width: 20px;
    text-align: center;
}

.menu-row-text {
    font-size: 14px;
    font-weight: 500;
}

.menu-group-header {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    padding: 8px 24px;
}

/* СТРАНИЦА NFT ТОВАРА */
.product-banner-wrap {
    width: 100%;
    padding: 16px 16px 0;
}

.product-full-img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 20px;
    object-fit: cover;
}

.product-body {
    padding: 16px;
}

.product-coll-link {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-blue);
}

.product-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.product-main-title {
    font-size: 22px;
    font-weight: 800;
}

.product-actions {
    display: flex;
    gap: 8px;
}

.action-circle-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.product-desc-box {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
    margin-top: 10px;
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 10px 12px;
}

.specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 14px;
}

.spec-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.spec-meta {
    display: flex;
    flex-direction: column;
}

.spec-label {
    font-size: 10px;
    color: var(--muted);
}

.spec-value {
    font-size: 12px;
    font-weight: 700;
    margin-top: 2px;
}

.spec-chat-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--card-border);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.price-section {
    margin-top: 16px;
}

.price-label {
    font-size: 11px;
    color: var(--muted);
}

.price-big-text {
    font-size: 24px;
    font-weight: 800;
    margin-top: 2px;
}

.blue-link-btn {
    background: none;
    border: none;
    color: var(--accent-blue);
    font-size: 12px;
    font-weight: 700;
    margin-top: 6px;
    cursor: pointer;
}

.product-buy-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-main);
    border-top: 1px solid var(--card-border);
    padding: 12px 16px;
    display: flex;
    gap: 10px;
    z-index: 40;
    max-width: 480px;
    margin: 0 auto;
}

.buy-primary-btn {
    flex: 1;
    background-color: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    padding: 12px 0;
    cursor: pointer;
}

.buy-cart-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background-color: var(--accent-blue);
    border: none;
    color: white;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* === ВСПЛЫВАЮЩИЕ BOTTOM SHEETS === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.bottom-sheet {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    background-color: var(--card-bg);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    z-index: 201;
    transition: bottom 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    padding-bottom: 20px;
}

.bottom-sheet.show {
    bottom: 0;
}

.sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 10px;
}

.sheet-title {
    font-size: 16px;
    font-weight: 700;
}

.close-red-square {
    width: 28px;
    height: 28px;
    background-color: var(--danger-red);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sheet-body {
    padding: 10px 20px;
}

.field-label {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
}

.range-inputs-row {
    display: flex;
    gap: 10px;
}

.dark-input-box {
    flex: 1;
    background-color: var(--bg-main);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 10px;
    font-size: 13px;
    color: var(--muted);
}

.slider-container {
    position: relative;
    height: 4px;
    background-color: var(--card-border);
    margin: 20px 0;
    border-radius: 2px;
}

.slider-track-bar {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background-color: var(--accent-blue);
}

.slider-thumb {
    position: absolute;
    top: -6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--accent-blue);
    border: 2px solid white;
}

.radio-group-box {
    background-color: var(--bg-main);
    border-radius: 12px;
    border: 1px solid var(--card-border);
    overflow: hidden;
}

.radio-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #1f1f24;
    font-size: 13px;
    cursor: pointer;
}

.radio-row:last-child {
    border-bottom: none;
}

.radio-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.radio-row.active .radio-dot {
    border-color: var(--accent-blue);
}

.radio-row.active .radio-dot::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-blue);
}

/* ГРАФИК */
.chart-canvas-box {
    position: relative;
    height: 140px;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 15px;
}

.chart-price-axis {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 10px;
    color: var(--muted);
}

.red-glow-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 45px;
    height: 2px;
    background-color: var(--danger-red);
    box-shadow: 0 0 12px rgba(255, 59, 48, 0.8);
}

.chart-date-axis {
    position: absolute;
    bottom: -18px;
    left: 0;
    right: 45px;
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--muted);
}

.period-pills-row {
    display: flex;
    background-color: var(--bg-main);
    padding: 3px;
    border-radius: 10px;
    margin-top: 25px;
}

.pill-btn {
    flex: 1;
    padding: 6px 0;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 12px;
    border-radius: 8px;
    cursor: pointer;
}

.pill-btn.active {
    background-color: var(--card-border);
    color: white;
}

/* КНОПКИ И ВВОД */
.modal-center-desc {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.4;
}

.primary-blue-btn {
    width: 100%;
    background-color: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 0;
    font-size: 14px;
    font-weight: 700;
    margin-top: 15px;
    cursor: pointer;
}

.lang-pills-row {
    display: flex;
    gap: 8px;
}

.lang-btn {
    flex: 1;
    padding: 10px 0;
    background-color: var(--bg-main);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    color: var(--muted);
    font-size: 12px;
}

.lang-btn.active {
    background-color: var(--card-border);
    color: white;
    border-color: var(--accent-blue);
}

.big-status-cross {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--danger-red);
    color: white;
    font-size: 28px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px auto 0;
}

.payment-methods-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pay-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-main);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
}

.pay-card-row.active {
    border-color: var(--accent-blue);
}

.pay-card-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pay-card-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background-color: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.pay-card-title {
    font-size: 13px;
    font-weight: 700;
}

.pay-card-limit {
    font-size: 10px;
    color: var(--muted);
}

.dark-input {
    width: 100%;
    background-color: var(--bg-main);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 13px;
    color: white;
    outline: none;
}

.dark-input::placeholder {
    color: var(--muted);
}

.big-number-val {
    font-size: 24px;
    font-weight: 800;
    margin: 4px 0 10px;
}

.error-msg-text {
    font-size: 12px;
    color: white;
    margin-top: 15px;
    line-height: 1.4;
}

/* === НИЖНИЙ ТАБ-БАР === */
.bottom-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    background-color: var(--bg-main);
    border-top: 1px solid #1f1f24;
    display: flex;
    padding: 8px 0 10px;
    z-index: 50;
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
}

.tab-icon {
    font-size: 18px;
    margin-bottom: 2px;
}

.tab-item.active {
    color: var(--accent-blue);
}

.flex-align-center {
    display: flex;
    align-items: center;
}