:root {
    --primary: #00ff88;
    --primary-glow: rgba(0, 255, 136, 0.4);
    --bg: #050b14;
    --card-bg: rgba(13, 25, 41, 0.85);
    --border: rgba(255, 255, 255, 0.1);
    --text: #ffffff;
    --text-dim: #a0aec0;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

#networkCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Чтобы фон был сзади контента */
    background: radial-gradient(circle at center, #0a192f 0%, #02060c 100%);
  }

/* NAVBAR CALIBRATION */
.navbar {
    position: fixed; top: 0; width: 100%; height: 80px;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 5%; background: rgba(3, 8, 15, 0.95);
    backdrop-filter: blur(15px); border-bottom: 1px solid var(--border); z-index: 2000;
}

.logo { font-family: 'Orbitron', sans-serif; font-weight: 700; letter-spacing: 2px; font-size: 1.2rem; }
.logo span { color: var(--primary); }

.nav-actions { display: flex; align-items: center; gap: 15px; }

/* NETWORK DROPDOWN FIX */
.network-wrapper { position: relative; }

.network-select {
    background: transparent; border: 1px solid var(--primary); color: var(--primary);
    padding: 0 15px; border-radius: 8px; font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem; cursor: pointer; height: 40px; transition: 0.3s;
    display: flex; align-items: center; justify-content: center;
}
.network-select:hover { background: var(--primary-glow); }

.dropdown-content {
    display: none; /* Скрыто по умолчанию */
    position: absolute; 
    top: calc(100% + 10px); 
    right: 0;
    background: #0d1929;
    min-width: 180px;
    border: 1px solid var(--primary);
    border-radius: 12px;
    overflow: hidden;
    z-index: 3000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}



.progress-container {
    margin: 20px 0;
    width: 100%;
}

.progress-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 8px;
    text-align: right;
    font-family: 'Orbitron', sans-serif;
}

/* Серый фон (дорожка) */
.progress-bar-bg {
    width: 100%;
    height: 12px; /* Высота должна быть явно указана */
    background: rgba(255, 255, 255, 0.1); 
    border-radius: 10px;
    overflow: hidden; /* Чтобы заливка не вылезала за края */
    margin: 10px 0;
}

/* Цветная полоска прогресса */
.progress-bar-fill {
    height: 100%; /* Занимает всю высоту родителя */
    width: 0%;    /* Меняется через JS */
    background: linear-gradient(90deg, #00ff88, #00bdff); /* Яркий градиент */
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.5); /* Свечение */
    transition: width 1s ease-in-out; /* Плавное движение */
}

/* Класс который добавляется через JS */
.dropdown-content.show { display: block !important; }

.dropdown-content div {
    padding: 12px 20px; color: #fff; font-size: 0.85rem;
    cursor: pointer; transition: 0.2s; border-bottom: 1px solid var(--border);
}
.dropdown-content div:last-child { border-bottom: none; }
.dropdown-content div:hover { background: var(--primary); color: #000; }

.wallet-info-wrapper { display: flex; align-items: center; gap: 10px; }

.balances-badge {
    background: rgba(255,255,255,0.05); padding: 0 15px; height: 40px;
    border-radius: 10px; font-size: 0.85rem; border: 1px solid var(--border);
    display: flex; align-items: center;
}
.sep { margin: 0 8px; opacity: 0.2; }

.connect-button {
    background: var(--primary); color: #000; border: none;
    padding: 0 20px; border-radius: 8px; font-weight: 700;
    font-family: 'Orbitron', sans-serif; cursor: pointer; height: 40px;
    transition: 0.3s;
}
.connect-button:hover { box-shadow: 0 0 15px var(--primary-glow); transform: translateY(-1px); }

/* LAYOUT & CARDS */
.container { max-width: 1100px; margin: 120px auto 40px; padding: 0 20px; }
.section-block { margin-bottom: 80px; text-align: center; }

.section-title {
    font-family: 'Orbitron', sans-serif; font-size: 1.8rem;
    margin-bottom: 35px; letter-spacing: 3px; display: inline-block;
    width: 100%; text-align: center;
}
.section-title span { color: var(--primary); text-shadow: 0 0 15px var(--primary-glow); }

.glass-card {
    background: var(--card-bg); backdrop-filter: blur(15px);
    border: 1px solid var(--border); border-radius: 24px;
    padding: 35px; margin: 0 auto; width: 100%;
}

.mint-card, .transfer-box { max-width: 580px; }

/* STAKING LAYOUT */
.staking-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 30px; }
.plans-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin-top: 25px; }

.plan-card {
    background: rgba(255,255,255,0.03); border: 1px solid var(--border);
    padding: 20px; border-radius: 15px; cursor: pointer; transition: 0.3s;
}
.plan-card.selected { border-color: var(--primary); background: rgba(0, 255, 136, 0.05); }

.stakes-container { margin-top: 20px; display: flex; flex-direction: column; gap: 15px; }
.stake-row {
    background: rgba(0,0,0,0.4); border: 1px solid var(--border);
    padding: 20px; border-radius: 18px; text-align: left;
}

.stake-header {
    display: flex;
    justify-content: space-between; /* Расталкивает элементы по краям */
    align-items: center;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px; /* Небольшой отступ от строки с наградой */
}

/* Стиль для кнопки разстейка */
.btn-claim {
    width: 100%;
    margin-top: 15px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), rgba(0, 189, 255, 0.1));
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 12px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.1);
}

.btn-claim:hover:not(:disabled) {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 20px var(--primary-glow);
    transform: translateY(-2px);
}

.btn-claim:active:not(:disabled) {
    transform: translateY(0);
}

/* Состояние, когда кнопка заблокирована (LOCKED) */
.btn-claim:disabled {
    border-color: #444;
    color: #666;
    background: rgba(255, 255, 255, 0.05);
    cursor: not-allowed;
    box-shadow: none;
}


/* NFT EDITIONS */
/* Состояние MINT (Активная кнопка) */
.btn-mint-nft {
    background: #ffffff !important; /* Белый фон как на скрине */
    color: #000000 !important;    /* Черный текст */
    border-radius: 25px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-mint-nft:hover {
    background: var(--primary) !important; /* Зеленый при наведении */
    box-shadow: 0 0 15px var(--primary-glow);
}

/* Состояние ALREADY MINTED (Заблокированная кнопка) */
.btn-mint-nft:disabled {
    background: rgba(0, 255, 136, 0.05) !important; /* Почти прозрачный зеленый фон */
    color: rgba(0, 255, 136, 0.5) !important;       /* Зеленый текст 0.5 прозрачности */
    border: 1px solid rgba(0, 255, 136, 0.2) !important; 
    cursor: not-allowed;
}

.nft-display-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px; padding-top: 20px; 
}
.nft-card { 
    background: var(--card-bg); padding: 20px; border-radius: 20px; 
    border: 1px solid var(--border); transition: 0.3s;
}
.nft-card:hover { border-color: var(--primary); transform: translateY(-5px); }
.nft-image { width: 100%; border-radius: 150px; margin-bottom: 15px; }

/* INPUTS & BUTTONS */
.web3-input {
    background: rgba(0,0,0,0.5); border: 1px solid var(--border);
    border-radius: 14px; display: flex; align-items: center; padding: 5px 18px;
    margin-top: 15px;
}
.web3-input input {
    background: transparent; border: none; color: #fff; padding: 14px 0;
    width: 100%; outline: none; font-size: 1rem;
}

.action-btn {
    background: linear-gradient(90deg, #00ff88, #00bdff);
    color: #000; border: none; border-radius: 12px;
    font-family: 'Orbitron', sans-serif; font-weight: 700;
    cursor: pointer; transition: 0.3s; text-transform: uppercase;
}
.centered-btn { padding: 18px 45px; min-width: 260px; margin: 30px auto 0; display: block; }

.add-token-btn {
    background: transparent; border: 1px dashed var(--text-dim); color: var(--text-dim);
    font-size: 0.75rem; margin-top: 20px; padding: 8px 15px; border-radius: 8px;
    cursor: pointer; transition: 0.3s;
}
.add-token-btn:hover { border-color: var(--primary); color: var(--primary); }

/* FOOTER */
.footer { padding: 80px 20px 40px; text-align: center; border-top: 1px solid var(--border); margin-top: 50px; }
.testnet-alert { color: #ffcc00; font-size: 0.85rem; margin-bottom: 25px; }
.social-links { display: flex; justify-content: center; gap: 35px; margin-bottom: 25px; }
.social-links a { color: #fff; text-decoration: none; font-size: 0.95rem; font-family: 'Orbitron'; transition: 0.3s; }
.social-links a:hover { color: var(--primary); text-shadow: 0 0 10px var(--primary-glow); }

/* MOBILE ADAPTATION */
@media (max-width: 768px) {
    .navbar { 
        height: auto !important; 
        padding: 12px 10px !important; 
        flex-direction: column !important; /* Логотип будет над кнопками */
        gap: 12px !important;
        background: rgba(2, 6, 12, 0.98);
        border-bottom: 1px solid rgba(100, 255, 218, 0.15);
        position: fixed;
        width: 100%;
        top: 0;
        left: 0;
    }

    /* 1. ЛОГОТИП - ТЕПЕРЬ СВЕРХУ */
    .logo { 
        order: 1 !important; 
        margin: 0 auto !important; 
        font-size: 1.3rem;
        display: block !important;
        text-align: center;
        width: 100%;
    }

    /* 2. КОНТЕЙНЕР ДЛЯ НИЖНЕГО РЯДА (Баланс + Сеть + Коннект) */
    .nav-actions {
        display: flex !important;
        flex-direction: row !important; /* Все в одну линию под логотипом */
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        order: 2 !important;
        gap: 6px !important;
    }

    /* БАЛАНС - СЛЕВА (нормальный, не сломанный) */
    .balances-badge { 
        display: flex !important; 
        order: 1 !important; 
        flex: 1 !important;
        justify-content: center;
        align-items: center;
        background: rgba(255, 255, 255, 0.05);
        padding: 0 5px !important;
        border-radius: 6px;
        height: 36px; /* Такая же высота, как у кнопок */
        font-size: 0.65rem !important; 
        border: 1px solid rgba(100, 255, 218, 0.1);
        white-space: nowrap;
    }

    /* СЕТЬ - ПО ЦЕНТРУ */
    .network-wrapper {
        order: 2 !important;
        flex: 1.2 !important;
    }

    /* КОШЕЛЕК - СПРАВА */
    .wallet-info-wrapper {
        display: contents; 
    }

    .connect-button {
        order: 3 !important;
        flex: 1 !important;
        background: #00ffaa !important;
        color: #000 !important;
    }

    /* Общий стиль для кнопок в ряду */
    .network-select, .connect-button { 
        width: 100% !important;
        height: 36px !important;
        font-size: 0.7rem !important; 
        padding: 0 4px !important;
        border-radius: 6px !important;
        font-weight: bold;
    }

    .container { 
        margin-top: 180px !important; 
    }
}

/* MODAL FIX */
/* --- MODAL SYSTEM CALIBRATION --- */
.modal-overlay {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(3, 8, 15, 0.9); /* Более глубокий фон */
    backdrop-filter: blur(8px);
    z-index: 5000; 
    display: none; /* Переключается через JS */
    align-items: center; 
    justify-content: center; 
    padding: 20px;
}

.modal-contentmint {
    background: #0d1929; 
    border: 1px solid var(--primary);
    padding: 40px 30px; 
    border-radius: 24px; 
    position: relative; 
    width: 100%; 
    max-width: 450px;
    
    /* Центрирование контента внутри */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center; 
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.15);
}

.close-x {
    position: absolute; 
    top: 15px; 
    right: 20px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    transition: 0.2s;
}

.close-x:hover {
    color: var(--primary);
    transform: rotate(90deg);
}

#modalIcon {
    font-size: 3.5rem;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#modalDesc {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center; /* Центрирует все дочерние элементы (h3, p, div) */
}

#modalDesc h3 {
    margin: 10px 0;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
}

#modalDesc p {
    margin: 5px 0;
    color: var(--text-dim);
    font-size: 0.95rem;
}

#modalDesc a {
    margin-top: 10px;
    display: inline-block;
}

/* Спиннер тоже должен быть по центру */
.spinner {
    width: 50px; 
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Анимация вращения */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Убедись, что у класса .spinner прописаны эти свойства */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 255, 136, 0.1); /* Бледный след */
    border-top: 4px solid var(--primary);    /* Яркая движущаяся часть */
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;      /* Теперь заработает! */
}


.section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px; /* Отступ между текстом и иконкой */
}

.title-icon-after {
    color: var(--primary); /* Твой зеленый цвет */
    font-size: 1.2rem;     /* Размер иконки */
    filter: drop-shadow(0 0 8px var(--primary-glow)); /* Неоновое свечение */
    /* Можно добавить небольшую анимацию пульсации */
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% { opacity: 0.7; }
    50% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 0.7; }
}


/* Контейнер для кранов */
.faucet-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-family: 'Inter', sans-serif;
}

.faucet-label {
    font-size: 12px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
    font-weight: 700;
}

.faucet-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Стиль кнопок-чипов */
.faucet-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(100, 255, 218, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    color: #64ffda;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(5px);
}

.faucet-chip i {
    font-size: 14px;
}

/* Эффект при наведении */
.faucet-chip:hover {
    background: rgba(100, 255, 218, 0.1);
    border-color: #64ffda;
    box-shadow: 0 0 15px rgba(100, 255, 218, 0.3);
    transform: translateY(-2px);
}

/* Адаптивность для мобилок */
@media (max-width: 480px) {
    .faucet-chip {
        padding: 6px 12px;
        font-size: 11px;
    }
}



@media (max-width: 768px) {
    /* 1. Выстраиваем карточки (Stake и Active Stakes) вертикально */
    .staking-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
        width: 100% !important;
        padding: 0 10px !important;
    }

    /* 2. Карточки на всю ширину */
    .glass-card {
        width: 100% !important;
        padding: 20px 15px !important;
        box-sizing: border-box !important;
    }

    /* 3. Сетка планов (2 в ряд, а не 4 или 1) */
    .plans-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important; /* Два плана в ряд - самое удобное для пальцев */
        gap: 10px !important;
        width: 100% !important;
    }

    /* Уменьшаем шрифты в планах, чтобы цифры не вылезали */
    .plans-grid div {
        padding: 12px 5px !important;
        font-size: 0.8rem !important;
    }

    /* 4. Поле ввода и кнопка MAX */
    .web3-input {
        width: 100% !important;
        display: flex !important;
    }

    .web3-input input {
        flex: 1 !important;
        font-size: 1rem !important; /* Чтобы iOS не увеличивал экран при фокусе */
    }

    /* 5. Кнопка STAKE NOW на всю ширину */
    .centered-btn {
        width: 100% !important;
        margin: 20px 0 0 0 !important;
        height: 50px !important;
        font-size: 1rem !important;
    }

    /* 6. Заголовок секции */
    .section-title {
        font-size: 1.5rem !important;
        margin-bottom: 20px !important;
    }
}