:root {
    --bg: #000000;
    --surface: #111111;
    --surface-light: #1E1E1E;
    --border: #333333;
    --primary: #FFFFFF;
    --text: #FFFFFF;
    --text-sec: #888888;
    
    /* Colors */
    --accent-green: #CCFF00;
    --accent-red: #FF3B30;
    --accent-pink: #FF66C4;
    --accent-orange: #FFA500;
    --accent-blue: #0088CC;
}

/* =========================================
   GLOBAL RESET
========================================= */
* {
    box-sizing: border-box;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

input, textarea {
    -webkit-user-select: text;
    user-select: text;
}

html {
    background-color: var(--bg);
    width: 100%;
    height: 100%;
}

body {
    margin: 0 auto;
    padding: 0;
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    padding-bottom: 120px;
    max-width: 480px;
    min-height: 100vh;
}

img { pointer-events: none; display: block; }
h1, h2, h3, h4, p { margin: 0; }
a { text-decoration: none; color: inherit; }

/* Interactive Elements */
button, a, input, textarea, .action-btn, .action-btn-small, 
.card-icon-area, .nav-item, .nav-trade-circle, .token-item, 
.launch-card, .crypto-card, .btn-white-large, .back-btn, 
.market-item, .btn-launch-pill, .upload-circle, .time-btn, 
.social-card, .filter-chip, .oc-buy-btn, .m-filter-btn, 
.p-tab, .hist-card, .goods-item {
    pointer-events: auto;
    cursor: pointer;
}
button { border: none; }

/* === UTILS === */
.text-sec { color: var(--text-sec); font-size: 13px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.hidden { display: none !important; }

/* === ICONS === */
.icon { 
    width: 24px; height: 24px; fill: none; stroke: currentColor; 
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; 
    pointer-events: none; 
}
.icon-blyx-right {
    width: 16px; height: 16px; object-fit: contain;
    transform: translateY(-1px); margin-left: 4px;
}

/* === BUTTONS & INPUTS === */
.btn { 
    border: none; border-radius: 12px; padding: 14px; font-size: 16px; 
    font-weight: 700; cursor: pointer; transition: opacity 0.2s; 
    width: 100%; display: flex; justify-content: center; align-items: center; 
}
.btn:active { opacity: 0.8; }
.btn-primary { background: var(--primary); color: #000000; }

.btn-white-large {
    background: white; color: black; height: 56px; border-radius: 16px; 
    font-size: 18px; font-weight: 800; display: flex; align-items: center; 
    justify-content: center; gap: 8px; width: 100%; border: none; cursor: pointer;
    box-shadow: 0 4px 15px rgba(255,255,255,0.1);
}
.btn-white-large:active { opacity: 0.9; }
.btn-disabled { background: #333 !important; color: #777 !important; pointer-events: none; }

.back-btn { 
    background: transparent; border: none; padding: 8px; color: white; 
    cursor: pointer; display: flex; align-items: center; 
}

.btn-buy-floating {
    width: 100%; height: 56px; background: #FFFFFF; color: #000;
    border-radius: 16px; border: none; font-size: 18px; font-weight: 800;
    cursor: pointer; box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    display: flex; justify-content: center; align-items: center; gap: 8px;
    transition: all 0.2s;
}
.btn-text { background: none; border: none; color: white; font-weight: 600; font-size: 16px; padding: 10px; }

/* Input Wrappers */
.input-wrapper { 
    background: #1c1c1c; border-radius: 16px; 
    border: 1px solid transparent; 
    display: flex; align-items: center; 
    padding: 0 16px; height: 54px; margin-bottom: 12px; 
    transition: border 0.2s; width: 100%; 
}
.input-wrapper:focus-within { border-color: #333; }
.input-wrapper input { 
    flex: 1; background: transparent; border: none; 
    color: white; font-size: 16px; font-weight: 500; 
    height: 100%; padding: 0; 
}
.input-wrapper input::placeholder { color: #555; }
.input-suffix { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: white; }
.star-icon-small { width: 20px; height: 20px; object-fit: contain; }

/* Row Inputs (Min/Max limits) */
.row-inputs {
    display: flex;
    gap: 12px;
    width: 100%;
}
.row-inputs > div {
    flex: 1;
    min-width: 0;
}

/* Validation Error Text */
.error-text {
    color: #FF3B30;
    font-size: 12px;
    margin-top: 5px;
    margin-bottom: 10px;
    min-height: 15px;
    font-weight: 500;
}

/* Avatar inside Input */
.input-with-avatar { position: relative; display: flex; align-items: center; }
.avatar-preview {
    width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
    margin-right: 10px; display: none; background: #333; border: 1px solid #555; flex-shrink: 0;
}
.avatar-visible { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }

/* =========================================
   LAUNCH SCREEN (CREATE TOKEN)
========================================= */
.header-nav { 
    display: flex; align-items: center; gap: 15px; 
    padding: 20px 16px; margin-bottom: 10px; width: 100%; 
}
.header-title { font-size: 20px; font-weight: 700; }

.step-header { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.step-badge { 
    background: var(--accent-green); color: black; width: 24px; height: 24px; 
    border-radius: 50%; display: flex; align-items: center; justify-content: center; 
    font-size: 14px; font-weight: 700; 
}
.step-title-text { font-size: 20px; font-weight: 700; }

.upload-circle { 
    width: 80px; height: 80px; background: var(--surface-light); border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; cursor: pointer; 
    overflow: hidden; position: relative; border: 1px solid var(--border); 
}
.upload-circle img { width: 100%; height: 100%; object-fit: cover; }
.upload-placeholder { font-size: 30px; color: var(--text-sec); }

.launch-label { font-size: 14px; font-weight: 600; margin-bottom: 8px; display: block; margin-top: 20px; }
.label-row { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 8px; margin-top: 20px; }
.char-counter { font-size: 14px; font-weight: 600; color: #555; }

.launch-input-box { 
    background: var(--surface-light); border-radius: 12px; padding: 14px 16px; 
    border: 1px solid transparent; width: 100%;
}
.launch-input-box:focus-within { border-color: var(--text-sec); }
.launch-input-box input, .launch-input-box textarea { 
    background: transparent; border: none; color: white; font-size: 16px; width: 100%; padding: 0; 
}
.launch-input-box textarea { resize: none; height: 80px; }

/* Review Step */
.review-label { font-size: 14px; color: var(--text-sec); font-weight: 600; margin-bottom: 10px; text-align: left; }
.big-price-container { display: flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; margin-bottom: 8px; position: relative; }
.big-price-input {
    background: transparent; border: none; color: white; font-size: 48px; font-weight: 800;
    padding: 0; margin: 0; text-align: left; line-height: 1.2; height: auto;
    min-width: 40px; width: 40px; max-width: calc(100% - 60px); z-index: 2;
}
.big-icon { width: 42px; height: 42px; object-fit: contain; flex-shrink: 0; margin-top: 4px; }
.token-calc-text { font-size: 13px; color: var(--text-sec); font-weight: 500; text-align: left; }
#widthMachine { position: absolute; visibility: hidden; height: 0; font-size: 48px; font-weight: 800; white-space: pre; left: 0; }

.cost-info-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding: 0 4px; }
.cost-text-left { font-size: 13px; color: var(--text-sec); font-weight: 500; }
.cost-highlight { color: white; font-weight: 700; }
.btn-icon { width: 24px; height: 24px; object-fit: contain; margin-bottom: -2px; }

.fixed-bottom-bar {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 480px; padding: 0 16px; z-index: 9999;
}
.bottom-cost-panel {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 480px; padding: 0 16px; z-index: 100;
}
.cost-label { margin-bottom: 8px; font-size: 14px; color: #888; font-weight: 600; }

/* --- REAL CROPPER STYLES --- */
.cropper-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: #000; z-index: 10000;
    display: none; flex-direction: column;
}
.cropper-body {
    flex: 1; position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
#cropperImg { position: absolute; transform-origin: center; will-change: transform; }
.cropper-mask {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle 120px at center, transparent 120px, rgba(0,0,0,0.7) 122px);
    pointer-events: none; border: 2px solid rgba(255,255,255,0.1);
}
.cropper-circle-guide {
    position: absolute; width: 240px; height: 240px;
    border: 2px solid #fff; border-radius: 50%;
    pointer-events: none;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7);
}
.cropper-footer {
    height: 80px; background: #111;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 24px; z-index: 10001;
}
.btn-pill-white { background: white; color: black; border: none; padding: 8px 20px; border-radius: 20px; font-weight: 700; font-size: 14px; }


/* =========================================
   CRYPTO INFO (NEW DESIGN & STATS)
========================================= */

/* Header */
.launch-header {
    position: relative; width: 100%;
    background: url('Sprites/WaveBg.png') no-repeat center center;
    background-size: cover; 
    border-bottom-left-radius: 32px;
    border-bottom-right-radius: 32px;
    padding-top: 10px; padding-bottom: 30px;
    text-align: center; margin-bottom: 20px;
    border-bottom: 1px solid #222;
}
.top-nav { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; }

/* Token Info */
.token-avatar-big {
    width: 80px; height: 80px; border-radius: 50%;
    object-fit: cover; margin: 10px auto 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    border: 2px solid rgba(255,255,255,0.1);
}
.token-name-header {
    font-size: 24px; font-weight: 800; text-transform: uppercase;
    margin-bottom: 15px; letter-spacing: 0.5px; color: white;
}

/* Stats: Holders | Transactions */
.stats-split-row {
    display: flex; align-items: center; justify-content: center;
    gap: 15px; margin-bottom: 15px;
    font-size: 13px; font-weight: 600; color: #888;
}
.stat-box { display: flex; align-items: center; gap: 6px; }
.stat-val { color: white; font-weight: 700; }
.divider-v { width: 1px; height: 12px; background: #444; }

/* Market Cap (Centered Big) */
.market-cap-row {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; margin-bottom: 20px;
}
.mc-val { font-size: 32px; font-weight: 800; color: white; line-height: 1; }
.mc-icon { width: 28px; height: 28px; object-fit: contain; }

.market-cap-text { font-size: 42px; font-weight: 800; color: #FFFFFF; margin-bottom: 25px; text-shadow: 0 0 20px rgba(255,255,255,0.15); } 

/* Bonding Curve Progress */
.progress-container { padding: 0 24px; margin-bottom: 10px; }
.p-bar-bg {
    width: 100%; height: 6px; background: rgba(255,255,255,0.2);
    border-radius: 4px; position: relative; margin-bottom: 8px;
}
.p-bar-fill {
    position: absolute; left: 0; top: 0; bottom: 0;
    background: #FFFFFF; border-radius: 4px;
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
    transition: width 0.3s ease;
}
.p-labels { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: #EEE; }

/* Tabs */
.tabs-scroll {
    display: flex; gap: 20px; padding: 0 20px; margin-bottom: 15px;
    overflow-x: auto; scrollbar-width: none;
    border-bottom: 1px solid #222;
}
.tab-link {
    padding: 10px 0; font-size: 15px; font-weight: 600; color: #777;
    position: relative; cursor: pointer; white-space: nowrap; transition: color 0.2s;
}
.tab-link.active { color: #FFFFFF; }
.tab-link.active::after {
    content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 4px; height: 4px; background: #FFFFFF; border-radius: 50%;
}

.content-section { padding: 0 16px; }

/* Chart Controls (UPDATED for Scrolling) */
.chart-controls { 
    display: flex; gap: 8px; margin-bottom: 10px; align-items: center; padding-left: 4px; 
    overflow-x: auto; scrollbar-width: none; 
}
.time-btn {
    font-size: 13px; font-weight: 700; color: #555;
    padding: 6px 12px; border-radius: 8px; cursor: pointer;
    transition: 0.2s; background: #111; white-space: nowrap;
}
.time-btn.active { color: #000; background: #FFF; }
.chart-area { height: 320px; width: 100%; background: transparent; position: relative; overflow: hidden; margin-bottom: 20px; }
.chart-area canvas { display: block; width: 100%; height: 100%; }

/* Transactions List */
.trans-summary {
    background: var(--surface-light); border-radius: 16px;
    padding: 16px; display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 20px; border: 1px solid #222;
}
.ts-item { display: flex; flex-direction: column; }
.ts-label { font-size: 12px; color: var(--text-sec); display: flex; align-items: center; gap: 6px; margin-bottom: 4px;}
.ts-dot { width: 6px; height: 6px; border-radius: 50%; }
.ts-val { font-size: 18px; font-weight: 700; color: white; }
.pie-chart-icon { 
    width: 28px; height: 28px; border: 4px solid #333; 
    border-top: 4px solid var(--accent-green); 
    border-right: 4px solid var(--accent-pink); border-radius: 50%; 
}

.trans-list { display: flex; flex-direction: column; gap: 12px; }
.trans-item { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; }
.ti-left { display: flex; align-items: center; gap: 12px; }
.ti-avatar { width: 36px; height: 36px; border-radius: 50%; background: #333; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.ti-info { display: flex; flex-direction: column; gap: 3px; }
.ti-addr { font-size: 14px; font-weight: 700; color: white; }
.ti-action { font-size: 12px; font-weight: 600; }
.ti-time { color: var(--text-sec); font-weight: 400; margin-left: 4px; }
.ti-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.ti-amount-row { display: flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 800; color: white; }
.ti-amount-token { font-size: 12px; color: var(--text-sec); margin-top: 2px; }

/* Socials Tab */
.social-list { display: flex; flex-direction: column; gap: 12px; }
.social-card {
    background: var(--surface-light); border: 1px solid #222;
    border-radius: 16px; padding: 16px;
    display: flex; justify-content: space-between; align-items: center;
    transition: background 0.2s;
}
.social-card:active { background: #252525; }
.sc-left { display: flex; flex-direction: column; gap: 4px; }
.sc-title { font-size: 16px; font-weight: 700; color: white; }
.sc-sub { font-size: 12px; color: var(--text-sec); }
.sc-icon { width: 36px; height: 36px; object-fit: contain; }

/* Special Colors */
.bg-orange-soft { background: rgba(255, 165, 0, 0.2); color: orange; }
.bg-pink-soft { background: rgba(255, 105, 180, 0.2); color: hotpink; }
.c-pink { color: var(--accent-pink); }
.c-green { color: var(--accent-green); }

.fixed-action-container {
    position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 480px; padding: 0 16px; z-index: 90;
}

/* =========================================
   OTHER SCREENS (HOME/MARKETS/WALLET)
========================================= */
.section-title { 
    width: 100%; 
    padding: 0 16px; 
    margin: 20px 0 12px; 
    font-size: 20px; 
    font-weight: 700; 
    color: white; 
}

/* --- CAROUSEL (EARN) --- */
.carousel-container { 
    display: flex; 
    overflow-x: auto; 
    scroll-snap-type: x mandatory; /* Баннеры "прилипают" при скролле */
    gap: 20px; 
    padding: 0 16px; 
    margin-bottom: 12px; 
    -webkit-overflow-scrolling: touch; 
    scrollbar-width: none; 
}
.carousel-container::-webkit-scrollbar { display: none; }

.news-card { 
    position: relative; 
    flex: 0 0 100%; 
    width: 100%; 
    height: 160px; 
    border-radius: 20px; 
    background-color: #1c1c1c; 
    overflow: hidden; 
    border: none; /* Убрана обводка */
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    padding: 20px; 
    scroll-snap-align: center; /* Центровка при остановке скролла */
}

.news-bg { 
    position: absolute; top: 0; left: 0; 
    width: 100%; height: 100%; 
    object-fit: cover; z-index: 0; opacity: 0.6; 
}
.news-content { 
    position: relative; z-index: 1; width: 65%; 
}
.news-title { 
    font-size: 20px; font-weight: 700; 
    line-height: 1.2; margin-bottom: 15px; color: white; 
}

.action-btn-small { 
    background: white; color: black; border: none; 
    padding: 10px 24px; border-radius: 24px; 
    font-weight: 700; font-size: 14px; cursor: pointer; 
    display: inline-flex; justify-content: center; align-items: center; 
    width: fit-content; 
}

.banner-icon { 
    position: absolute; right: 15px; top: 50%; 
    transform: translateY(-50%); height: 85px; width: auto; 
    object-fit: contain; z-index: 2; 
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.6)); 
}

/* Индикаторы слайдера (Квадратные точки) */
.carousel-dots { 
    display: flex; justify-content: center; gap: 6px; 
    position: absolute; bottom: 10px; left: 0; right: 0; z-index: 3; 
}
.dot { 
    width: 6px; height: 6px; 
    background: rgba(255,255,255,0.3); 
    border-radius: 1px; /* Квадрат */
    transition: 0.2s; 
}
.dot.active { 
    background: #fff; width: 6px; 
}

/* --- EVENTS SECTION --- */
.events-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 16px;
    margin-bottom: 24px;
    width: 100%;
}

.event-card {
    position: relative;
    background-color: #111;
    border: none; /* Убрана обводка */
    border-radius: 20px;
    height: 180px; /* Уменьшенная высота */
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px;
}

.event-bg { 
    position: absolute; top: 0; left: 0; 
    width: 100%; height: 100%; object-fit: cover; 
    opacity: 0.3; z-index: 0; 
}
.event-icon-center { 
    position: absolute; top: 45%; left: 50%; 
    transform: translate(-50%, -50%); 
    width: 64px; height: 64px; object-fit: contain; 
    z-index: 1; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5)); 
}
.event-content { 
    position: relative; z-index: 2; 
    display: flex; flex-direction: column; 
}
.event-title { 
    font-size: 16px; font-weight: 700; color: white; 
    margin-bottom: 4px; line-height: 1.2; 
}
.event-timer { 
    font-size: 13px; font-weight: 500; color: #888; 
}
.timer-active { color: #ccc; }

/* --- LAUNCH CARD (Старый баннер, стили оставляем на всякий случай) --- */
.launch-card { 
    background: var(--surface); margin: 0 16px 20px 16px; 
    width: calc(100% - 32px); padding: 16px 20px; 
    border-radius: 16px; border: 1px solid var(--border); 
    display: flex; align-items: center; justify-content: space-between; 
    cursor: pointer; 
}
.launch-text h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.launch-text p { font-size: 12px; color: var(--text-sec); margin: 0; }
.coin-icon-3d { width: 48px; height: 48px; object-fit: contain; }

/* --- TOKEN LIST --- */
.token-list { 
    width: 100%; padding: 0 16px 120px 16px; 
    display: flex; flex-direction: column; gap: 8px; 
}
.token-item { 
    background: var(--surface-light); border-radius: 16px; 
    padding: 12px 16px; display: flex; 
    justify-content: space-between; align-items: center; cursor: pointer; 
}
.token-left { display: flex; align-items: center; gap: 12px; }
.token-icon-circle { 
    width: 40px; height: 40px; background: #333; 
    border-radius: 50%; display: flex; align-items: center; 
    justify-content: center; color: white; font-weight: 600; 
    font-size: 14px; overflow: hidden; 
}
.token-info-text { display: flex; flex-direction: column; }
.t-name { font-weight: 700; font-size: 15px; color: white; }
.t-sub { font-size: 12px; color: var(--text-sec); }
.t-price { font-weight: 700; font-size: 15px; color: white; }
.t-change { font-size: 12px; color: var(--accent-green); font-weight: 500; }

/* --- BALANCE CARD (Wallet) --- */
.balance-card { 
    width: 100%; padding: 40px 16px 20px; text-align: left; 
}
.balance-label { 
    color: var(--text-sec); font-size: 14px; margin-bottom: 5px; 
}
.balance-val { 
    font-size: 42px; font-weight: 700; letter-spacing: -1px; color: white; 
}
.actions-row { 
    display: flex; gap: 12px; width: 100%; 
    padding: 0 16px; margin-bottom: 30px; 
}
.action-btn { 
    flex: 1; background: var(--surface); 
    border: 1px solid var(--border); border-radius: 16px; 
    height: 80px; display: flex; flex-direction: column; 
    align-items: center; justify-content: center; gap: 8px; 
    cursor: pointer; transition: background 0.2s; 
}
.action-btn:active { background: var(--surface-light); }
.action-label { font-size: 14px; font-weight: 600; }
/* === PORTFOLIO (FIXED FOR 3 COLUMNS) === */
.portfolio-section { width: 100%; padding: 0 16px; }
.portfolio-title { font-size: 18px; font-weight: 700; margin-bottom: 15px; }

.portfolio-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); /* 3 колонки */
    gap: 8px; /* Меньший отступ */
    width: 100%;
}

.crypto-card { 
    background: var(--surface); 
    border: 1px solid var(--border); 
    border-radius: 16px; 
    padding: 10px 8px; /* Уменьшенные внутренние отступы */
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
    position: relative; 
    cursor: pointer;
    width: 100% !important; /* Принудительная ширина */
    min-width: 0; /* Чтобы не вылезало за пределы */
}

.card-icon-area { 
    flex: 1; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin-bottom: 6px;
}

.card-icon-img { 
    width: 36px; /* Уменьшенная иконка */
    height: 36px; 
    object-fit: cover; 
    border-radius: 50%; 
}

.token-icon-fallback {
    width: 36px; 
    height: 36px; 
    border-radius: 50%; 
    background: #333;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; color: white;
}

.card-info { 
    display: flex; 
    flex-direction: column; 
    width: 100%; 
    text-align: left;
}

.token-name { 
    font-size: 11px; 
    font-weight: 700; 
    color: white; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    margin-bottom: 4px;
}

/* Цена и количество друг под другом */
.card-row { 
    display: flex; 
    flex-direction: column; 
    align-items: flex-start;
    gap: 2px;
}

.price-tag { 
    font-size: 10px; 
    color: white; 
    font-weight: 600; 
    display: flex; 
    align-items: center; 
    gap: 2px; 
}

.token-amount { 
    font-size: 10px; 
    color: var(--text-sec); 
    font-weight: 500; 
}

/* === END PORTFOLIO FIX === */

.market-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 16px 10px; width: 100%; }
.market-title-big { font-size: 20px; font-weight: 700; color: white; }
.btn-launch-pill { background: white; color: black; border: none; border-radius: 20px; padding: 8px 16px; font-size: 14px; font-weight: 700; cursor: pointer; transition: opacity 0.2s; }
.search-container { padding: 10px 16px; margin-top: 5px; margin-bottom: 10px; }
.search-input-box { background: #1c1c1c; border-radius: 16px; display: flex; align-items: center; padding: 0 12px; height: 44px; border: 1px solid transparent; transition: border 0.2s; }
.search-input-box:focus-within { border-color: #333; }
.search-icon { color: #555; width: 20px; height: 20px; }
.search-input { flex: 1; background: transparent; border: none; color: white; font-size: 15px; font-weight: 500; margin-left: 10px; height: 100%; padding: 0; }
.search-input::placeholder { color: #555; }
.market-list { display: flex; flex-direction: column; padding: 0 16px 120px; }
.market-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; cursor: pointer; border-bottom: 1px solid #111; }
.market-left { display: flex; align-items: center; gap: 12px; }
.coin-avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: #222; display: flex; align-items: center; justify-content: center; }
.coin-img { width: 100%; height: 100%; object-fit: cover; }
.coin-letter { font-weight: 700; color: white; font-size: 16px; }
.market-info { display: flex; flex-direction: column; gap: 2px; }
.market-pair { font-size: 15px; font-weight: 700; color: white; }
.market-right { text-align: right; display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }
.market-price-row { display: flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 700; color: white; }
.market-change { font-size: 12px; font-weight: 600; }
.color-red { color: var(--accent-red); }
.color-green { color: var(--accent-green); }

/* Bottom Nav */
.bottom-nav {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    width: 92%; max-width: 440px; background: #0A0A0A;
    border-radius: 24px; height: 64px;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 20px; border: 1px solid var(--border);
    box-shadow: 0 10px 40px rgba(0,0,0,0.8); z-index: 100;
}
.nav-item { color: #555; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; cursor: pointer; transition: 0.2s; }
.nav-item.active { color: #FFF; }
.nav-trade-circle { 
    width: 56px; height: 56px; background: #FFFFFF; border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; color: #000; 
    transform: translateY(-25%); box-shadow: 0 0 20px rgba(255,255,255,0.15); 
    transition: transform 0.2s; cursor: pointer; 
}
.nav-trade-circle:active { transform: translateY(-25%) scale(0.95); }

/* === FILTERS === */
.filter-chips {
    display: flex; gap: 8px; padding: 0 16px; margin-bottom: 15px;
}
.filter-chip {
    background: #111; color: #666; padding: 6px 12px; 
    border-radius: 8px; font-size: 13px; font-weight: 700; 
    transition: 0.2s; border: 1px solid transparent;
}
.filter-chip.active {
    background: #FFFFFF; color: #000000;
}

/* === P2P MARKET FIXES === */
.market-filters {
    display: flex;
    gap: 8px;
    padding: 0 4px;
    margin-bottom: 15px;
    overflow-x: auto;
    scrollbar-width: none;
}
.m-filter-btn {
    background: #1c1c1c;
    color: #888;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #333;
    white-space: nowrap;
}
.m-filter-btn.active {
    background: #fff;
    color: #000;
    border-color: #fff;
}

.order-card {
    background: #111;
    border: 1px solid #222;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 10px;
    position: relative;
}
.oc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}
.oc-price {
    font-size: 20px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 4px;
}
.oc-buy-btn {
    background: #1c1c1c;
    border: 1px solid #333;
    color: white;
    padding: 6px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.oc-user-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.oc-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #333; 
    border: 1px solid #444;
}
.oc-avatar-img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #444;
}
.oc-username {
    font-size: 14px;
    font-weight: 600;
    color: white;
}
.oc-stats {
    font-size: 12px;
    color: #666;
}

.oc-limits-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #888;
    margin-top: 4px;
}
.oc-val {
    color: #ccc;
    font-weight: 500;
}

#mainActionBtn {
    transition: all 0.3s ease;
    font-weight: 800;
    font-size: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.p2p-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 4px;
}
.p2p-title { font-size: 18px; font-weight: 700; color: white; }

/* --- WALLET HISTORY & NEW PROFILE STYLES --- */
.wh-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #1a1a1a;
}
.wh-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.wh-icon-bg {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #1c1c1c;
    display: flex;
    align-items: center;
    justify-content: center;
}
.wh-icon-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}
.wh-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.wh-title {
    font-size: 15px;
    font-weight: 700;
    color: white;
}
.wh-sub {
    font-size: 12px;
    color: #666;
}
.wh-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}
.wh-amount {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}
.wh-date {
    font-size: 11px;
    color: #555;
}

/* === LOADER STYLES (Added as requested) === */
#globalLoader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: #000000; z-index: 99999;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 0.3s ease, visibility 0.3s;
}
#globalLoader.loaded { opacity: 0; visibility: hidden; pointer-events: none; }
.custom-spinner {
    width: 40px; height: 40px; border-radius: 50%;
    border: 4px solid #333; border-top-color: #ffffff;
    animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* =========================================
   === PRIVACY & WELCOME SCREEN STYLES === 
========================================= */

/* Главный контейнер (центрирует лого и текст) */
.privacy-container {
    display: flex;
    flex-direction: column;
    align-items: center;    /* Центр по горизонтали */
    justify-content: center; /* Центр по вертикали */
    text-align: center;
    padding: 0 30px 180px;  /* Отступ снизу под кнопку */
    height: 85vh;           /* Занимает почти весь экран */
    box-sizing: border-box;
}

/* Иконка Bitly */
.brand-icon {
    width: 90px;
    height: 90px;
    object-fit: contain;
    margin-bottom: 24px;
    filter: drop-shadow(0 0 25px rgba(255,255,255,0.1));
}

/* Приветствие */
.welcome-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 12px;
    color: #FFFFFF;
    text-align: center;
}

/* Описание под заголовком */
.welcome-sub {
    font-size: 15px;
    color: #888888;
    line-height: 1.5;
    max-width: 280px;
    margin: 0 auto;
}

/* Фиксированная панель снизу (Чекбокс + Кнопка) */
.fixed-bottom-bar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 440px; 
    padding: 0 20px;
    z-index: 9999;
    box-sizing: border-box;
}

/* Ряд с чекбоксом */
.checkbox-row {
    display: flex;
    align-items: flex-start; /* Выравнивание по верхней линии текста */
    gap: 10px;
    margin-bottom: 20px;
    cursor: pointer;
    text-align: left;
}

/* Скрываем стандартный квадрат */
.checkbox-row input {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
}

/* Кастомный квадрат чекбокса (уменьшен под мелкий текст) */
.checkmark {
    height: 18px;
    width: 18px;
    background-color: #000;
    border: 2px solid #333;
    border-radius: 5px;
    position: relative;
    flex-shrink: 0;
    margin-top: 1px; /* Тонкая настройка центрирования к тексту */
    transition: all 0.2s ease;
}

/* Когда нажат */
.checkbox-row input:checked ~ .checkmark {
    background-color: #FFFFFF;
    border-color: #FFFFFF;
}

/* Галочка внутри */
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid black;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.checkbox-row input:checked ~ .checkmark:after {
    display: block;
}

/* Текст "I have read and agree..." */
.checkbox-text {
    font-size: 12px; /* Уменьшено, чтобы влезало в 1.5-2 строки */
    color: #888;
    line-height: 1.4;
    user-select: none;
}

/* Ссылка внутри текста */
.privacy-link {
    color: #FFFFFF;
    text-decoration: underline;
    font-weight: 600;
}

.privacy-link:active {
    opacity: 0.6;
}

/* Состояние заблокированной кнопки */
.btn-locked {
    background: #1a1a1a !important;
    color: #444 !important;
    pointer-events: none;
    box-shadow: none !important;
    opacity: 0.7;
}

/* =========================================
   EVENTS SECTION
========================================= */
.events-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Две колонки */
    gap: 12px;
    padding: 0 16px;
    margin-bottom: 24px;
    width: 100%;
}

.event-card {
    position: relative;
    background-color: #111;
    /* УБРАНА ОБВОДКА */
    border: none; 
    border-radius: 20px;
    /* УВЕЛИЧЕНА ВЫСОТА (было 120px, стало 220px - чтобы были выше новостей) */
    height: 220px; 
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px;
}

/* Фон карточки */
.event-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0.3;
    z-index: 0;
}

/* 3D Иконка по центру */
.event-icon-center {
    position: absolute;
    top: 45%; left: 50%;
    transform: translate(-50%, -50%);
    width: 64px; /* Чуть увеличил иконку под большую карточку */
    height: 64px;
    object-fit: contain;
    z-index: 1;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}

/* Текст внизу */
.event-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
}

.event-title {
    font-size: 16px; /* Чуть крупнее шрифт */
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
    line-height: 1.2;
}

.event-timer {
    font-size: 13px;
    font-weight: 500;
    color: #888;
}

.timer-active {
    color: #ccc; 
}
