@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700&display=swap');

:root {
    --bg: #060d1a;
    --card-bg: #0d1b2e;
    --card-border: rgba(34, 211, 238, 0.15);
    --cyan: #22d3ee;
    --blue: #3b82f6;
    --green: #22c55e;
    --purple: #a855f7;
    --text: #e2e8f0;
    --muted: #64748b;
    --nav-bg: #0a1525;
    --nav-active: rgba(34, 211, 238, 0.12);
    --gradient-green: linear-gradient(135deg, #22c55e, #0ea5e9);
    --gradient-buy: linear-gradient(135deg, #6366f1, #8b5cf6);
    --gradient-featured: linear-gradient(135deg, #7c3aed, #a855f7);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    height: 100%;
    overflow: hidden;
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}

/* CIRCUIT BACKGROUND */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(34, 211, 238, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34, 211, 238, 0.04) 1px, transparent 1px);
    background-size: 35px 35px;
    pointer-events: none;
    z-index: 0;
}

/* HEADER */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    background: rgba(6, 13, 26, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
    z-index: 100;
}

.balance-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.3);
    border-radius: 20px;
    padding: 5px 12px;
}

.rub-icon {
    font-size: 12px;
    color: var(--cyan);
    font-weight: 700;
}

.rub-label {
    font-size: 11px;
    color: var(--muted);
}

#balance {
    font-weight: 700;
    font-size: 13px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.flag {
    font-size: 22px;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--muted);
    display: flex;
    align-items: center;
}

/* MAIN CONTENT */
.app-content {
    position: fixed;
    top: 54px;
    bottom: 66px;
    left: 0;
    right: 0;
    overflow-y: auto;
    z-index: 1;
    padding: 14px 12px;
}

/* SECTIONS */
.tab-section {
    display: none;
}

.tab-section.active {
    display: block;
}

.section-title {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 14px;
}

/* CARD BLOCK */
.card-block {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
}

.card-label {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
}

/* AMOUNT DISPLAY */
.amount-display {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    text-align: center;
    padding: 12px;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

/* SLIDER */
.slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    background: linear-gradient(to right, var(--cyan), var(--blue));
    border-radius: 4px;
    outline: none;
    margin-bottom: 10px;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--cyan);
    border: 2px solid white;
    cursor: pointer;
}

.amount-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.preset-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: var(--text);
    padding: 7px 0;
    font-size: 13px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    transition: all 0.2s;
}

.preset-btn.active {
    background: rgba(34, 211, 238, 0.15);
    border-color: var(--cyan);
    color: var(--cyan);
}

.you-get {
    color: var(--cyan);
    font-size: 12px;
    margin-bottom: 8px;
}

.reward-list {
    margin-bottom: 10px;
}

.reward-row {
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 13px;
    color: var(--muted);
}

.reward-row.cyan,
.reward-row span {
    color: var(--cyan);
}

.note {
    font-size: 10px;
    color: var(--muted);
    margin-bottom: 6px;
}

.bonus-text {
    text-align: center;
    color: var(--green);
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 12px;
}

/* BUTTONS */
.btn-main {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    border: none;
    background: var(--gradient-buy);
    color: white;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    letter-spacing: 1px;
    transition: transform 0.15s, opacity 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-main:active {
    transform: scale(0.97);
    opacity: 0.9;
}

.btn-green {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    border: none;
    background: var(--gradient-green);
    color: white;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: transform 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-green:active {
    transform: scale(0.97);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--purple);
    background: transparent;
    color: var(--purple);
    font-size: 13px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
}

.divider-text {
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    padding: 6px 4px 12px;
}

/* MINER UNLOCK CARD */
.miner-unlock-card {}

.miner-slider {
    height: 140px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.miner-slider .swiper-slide img,
.miner-slider-2 .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.unlock-info {
    text-align: center;
    margin-bottom: 10px;
}

.unlock-label {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 4px;
}

.unlock-value {
    color: var(--cyan);
    font-weight: 700;
    font-size: 16px;
}

.unlock-sub {
    color: var(--text);
    font-size: 13px;
    margin-bottom: 10px;
}

.small-note {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
}

.swiper-button-next,
.swiper-button-prev {
    color: var(--cyan) !important;
    --swiper-navigation-size: 18px;
}

/* TOGGLE TABS */
.toggle-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.toggle-btn {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn.active {
    background: rgba(34, 211, 238, 0.15);
    border-color: var(--cyan);
    color: var(--cyan);
}

.toggle-panel {
    display: none;
}

.toggle-panel.active {
    display: block;
}

/* REF BLOCK */
.ref-block {}

.ref-link-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 12px;
}

.ref-link-text {
    flex: 1;
    font-size: 11px;
    color: var(--muted);
    word-break: break-all;
}

.copy-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--cyan);
}

/* LEVEL TABS */
.level-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.level-btn {
    padding: 7px 16px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--muted);
    font-size: 12px;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.level-btn.active {
    background: var(--cyan);
    border-color: var(--cyan);
    color: #000;
    font-weight: 700;
}

.table-header {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 10px;
}

.table-empty {
    color: var(--muted);
    font-size: 12px;
    padding: 10px 0;
}

.bonus-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 13px;
}

.cyan {
    color: var(--cyan);
}

/* MINER TAB */
.miner-main-card {}

.miner-slider-2 {
    height: 130px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.mining-btn {
    margin-top: 0;
}

.field-label {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
}

.field-value {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

.sell-btn {}

.upgrade-btn {}

/* TASK ITEMS */
.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.invite-task {
    margin-top: 0;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 12px;
}

.task-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.task-svg {
    color: var(--cyan);
}

.task-text {
    flex: 1;
}

.task-name {
    font-size: 13px;
    font-weight: 600;
}

.task-reward {
    font-size: 11px;
    color: var(--cyan);
    margin-top: 2px;
}

.task-progress {
    background: rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}

.task-progress.btn-small {
    background: rgba(34, 211, 238, 0.12);
    color: var(--cyan);
    border: 1px solid rgba(34, 211, 238, 0.3);
    cursor: pointer;
    font-size: 11px;
}

/* WITHDRAW TAB */
.withdraw-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.withdraw-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.withdraw-item:active {
    background: rgba(255, 255, 255, 0.05);
}

.withdraw-item.featured {
    background: var(--gradient-featured);
    border: none;
}

.withdraw-group {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    overflow: hidden;
}

.withdraw-group .withdraw-item {
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0;
}

.withdraw-group .withdraw-item:last-child {
    border-bottom: none;
}

.wi-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
}

.wi-svg {
    color: white;
}

.wi-arrow {
    margin-left: auto;
    color: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

.reinvest-ico {
    background: rgba(255, 255, 255, 0.2);
}

.wi-text {
    flex: 1;
}

.fk-icon {
    background: #1a5276;
    color: #fff;
}

.trx-icon {
    background: #c0392b;
    color: #fff;
    font-size: 11px;
}

.bnb-icon {
    background: #f39c12;
    color: #000;
    font-size: 11px;
}

.ton-icon {
    background: #2980b9;
    color: #fff;
    font-size: 11px;
}

.ltc-icon {
    background: #7f8c8d;
    color: #fff;
    font-size: 11px;
}

.wi-name {
    font-size: 14px;
    font-weight: 700;
}

.wi-sub {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 2px;
}

.withdraw-item.featured .wi-sub {
    color: rgba(255, 255, 255, 0.8);
}

/* MODAL */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}

.modal-overlay.hidden {
    display: none;
}

.modal-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 22px;
    width: 100%;
    max-width: 340px;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
}

.modal-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 10px;
    color: var(--text);
    font-size: 14px;
    font-family: 'Outfit', sans-serif;
    margin-bottom: 12px;
    outline: none;
}

.modal-input:focus {
    border-color: var(--cyan);
}

.modal-btns {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.modal-btns .btn-outline,
.modal-btns .btn-green {
    flex: 1;
}

/* BOTTOM NAV */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 66px;
    background: var(--nav-bg);
    border-top: 1px solid var(--card-border);
    display: flex;
    align-items: stretch;
    z-index: 100;
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    transition: all 0.2s;
    border-radius: 0;
    padding: 0;
}

.nav-btn.active {
    background: var(--nav-active);
    color: var(--cyan);
}

.nav-label {
    font-size: 10px;
    font-family: 'Outfit', sans-serif;
}

/* Lucide icon sizes */
.nav-lucide {
    width: 22px;
    height: 22px;
    stroke-width: 1.8;
}

.lucide-sm {
    width: 16px;
    height: 16px;
    stroke-width: 2;
    display: inline-block;
    vertical-align: middle;
}

.lucide-md {
    width: 20px;
    height: 20px;
    stroke-width: 1.8;
}

.lucide-xs {
    width: 13px;
    height: 13px;
    stroke-width: 2;
    display: inline-block;
    vertical-align: middle;
}

/* Mining active state */
.mining-active {
    background: linear-gradient(135deg, #dc2626, #ef4444) !important;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.85;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 3px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(34, 211, 238, 0.2);
    border-radius: 3px;
}

/* TOAST NOTIFICATION */
.toast-notification {
    position: fixed;
    bottom: 76px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(13, 27, 46, 0.95);
    border: 1px solid rgba(34, 211, 238, 0.3);
    color: var(--text);
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 13px;
    font-family: 'Outfit', sans-serif;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 300;
    pointer-events: none;
    max-width: 90vw;
    text-align: center;
}

.toast-notification.toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* REFERRAL TABLE */
.ref-table-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.ref-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 12px;
}

/* APP FOOTER */
.app-footer {
    position: fixed;
    bottom: 66px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 10px;
    color: var(--muted);
    padding: 3px 0;
    background: var(--nav-bg);
    z-index: 99;
}

/* Adjust content for footer */
.app-content {
    bottom: 78px !important;
}

/* MINER TAB — summary row */
.miner-summary-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.miner-stat-box {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 10px 6px;
    text-align: center;
}

.miner-stat-label {
    font-size: 10px;
    color: var(--muted);
    margin-bottom: 4px;
}

.miner-stat-val {
    font-size: 14px;
    font-weight: 700;
    color: var(--cyan);
}

.section-subtitle {
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 10px;
}

/* MINER GRID */
.miners-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.miner-loading {
    color: var(--muted);
    font-size: 13px;
    text-align: center;
    padding: 20px;
}

/* MINER CARD */
.miner-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.miner-card.locked {
    opacity: 0.65;
}

.miner-card.running {
    border-color: rgba(34, 211, 238, 0.4);
}

.miner-card.finished {
    border-color: rgba(34, 197, 94, 0.5);
}

.miner-card.cooldown {
    border-color: rgba(239, 68, 68, 0.35);
}

.miner-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.miner-card-img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 8px;
    flex-shrink: 0;
}

.miner-card-info {
    flex: 1;
}

.miner-card-name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 2px;
}

.miner-card-desc {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 4px;
}

.miner-card-stats {
    font-size: 11px;
    color: var(--cyan);
}

.level-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.miner-progress-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.miner-progress-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.miner-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), var(--blue));
    border-radius: 3px;
    transition: width 1s linear;
}

.miner-progress-label {
    font-size: 10px;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
}

.miner-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-idle {
    background: rgba(100, 116, 139, 0.2);
    color: var(--muted);
}

.badge-running {
    background: rgba(34, 211, 238, 0.15);
    color: var(--cyan);
}

.badge-finished {
    background: rgba(34, 197, 94, 0.15);
    color: var(--green);
}

.badge-cooldown {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.badge-locked {
    background: rgba(100, 116, 139, 0.1);
    color: var(--muted);
}

.miner-action-row {
    display: flex;
    gap: 8px;
}

.btn-miner-start {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    border: none;
    background: var(--gradient-green);
    color: white;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-miner-collect {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-miner-unlock {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--purple);
    background: transparent;
    color: var(--purple);
    font-size: 12px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-miner-disabled {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    font-size: 12px;
    font-family: 'Outfit', sans-serif;
    cursor: not-allowed;
}