* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #070a0f;
    color: #f5f7fa;
}

button {
    font-family: inherit;
}

.app {
    max-width: 520px;
    min-height: 100vh;
    margin: auto;
    background:
        radial-gradient(circle at top right, rgba(0,180,255,.10), transparent 30%),
        #090d14;
    padding-bottom: 95px;
}

.topbar {
    height: 76px;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #18202d;
    position: sticky;
    top: 0;
    background: rgba(9,13,20,.95);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.brand {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 3px;
}

.tagline {
    font-size: 8px;
    letter-spacing: 1.8px;
    color: #76869c;
    margin-top: 3px;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    border: 0;
    background: transparent;
    font-size: 19px;
}

.avatar,
.profile-avatar {
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg,#00aaff,#1462ff);
    font-weight: bold;
}

.avatar {
    width: 36px;
    height: 36px;
}

main {
    padding: 18px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.welcome {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4px 0 18px;
}

.welcome h2 {
    margin: 4px 0;
}

.small {
    color: #78889c;
    font-size: 11px;
    letter-spacing: 1.4px;
}

.player-id {
    font-size: 12px;
    color: #8ea0b6;
}

.status {
    color: #36e39b;
    font-size: 12px;
}

.trade-card,
.tree-card,
.referral-card,
.wallet-main,
.big-total {
    border: 1px solid #1e2b3b;
    border-radius: 20px;
    padding: 20px;
    background: linear-gradient(145deg,#101722,#0b111a);
    margin-bottom: 18px;
}

.trade-head {
    display: flex;
    justify-content: space-between;
}

.trade-head h1 {
    font-size: 34px;
    margin: 8px 0;
}

.live {
    color: #32e19a;
    font-size: 11px;
}

.chart {
    height: 110px;
    color: #18aaff;
    margin: 10px 0;
}

.chart svg {
    width: 100%;
    height: 100%;
}

.trade-stats {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 8px;
}

.trade-stats div {
    background: #0a1018;
    padding: 10px;
    border-radius: 10px;
}

.trade-stats span {
    display: block;
    font-size: 9px;
    color: #728298;
}

.trade-stats strong {
    display: block;
    margin-top: 5px;
    font-size: 11px;
}

.balance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.balance-card {
    padding: 15px;
    border-radius: 14px;
    background: #101720;
    border: 1px solid #1c2734;
}

.balance-card span {
    font-size: 11px;
    color: #8392a5;
}

.balance-card strong {
    display: block;
    font-size: 19px;
    margin-top: 7px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(5,1fr);
    gap: 7px;
}

.quick-actions button {
    border: 0;
    border-radius: 13px;
    padding: 12px 3px;
    background: #111a25;
    color: white;
}

.quick-actions b {
    display: block;
    font-size: 19px;
    color: #26b5ff;
}

.quick-actions span {
    font-size: 9px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
}

.section-title span {
    font-size: 11px;
    color: #8291a5;
}

.income-list,
.profile-list {
    border: 1px solid #1b2735;
    border-radius: 16px;
    overflow: hidden;
}

.income-list div,
.profile-list div {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #182330;
}

.income-list div:last-child,
.profile-list div:last-child {
    border: 0;
}

.income-list span,
.profile-list span {
    color: #93a1b2;
    font-size: 13px;
}

.network-summary {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 8px;
    margin-bottom: 18px;
}

.network-summary div {
    padding: 15px 8px;
    text-align: center;
    background: #101720;
    border-radius: 13px;
}

.network-summary span {
    display: block;
    font-size: 10px;
    color: #8190a4;
}

.network-summary strong {
    display: block;
    font-size: 22px;
    margin-top: 5px;
}

.tree {
    text-align: center;
    padding: 15px 0;
}

.node {
    display: inline-block;
    padding: 10px 15px;
    background: #111d2a;
    border: 1px solid #1e9bea;
    border-radius: 12px;
    font-size: 11px;
}

.node small {
    display: block;
    color: #7f91a7;
    margin-top: 4px;
}

.children {
    display: flex;
    justify-content: space-around;
    margin-top: 35px;
}

.branches {
    width: 55%;
    height: 20px;
    margin: 0 auto;
    border-bottom: 1px solid #34516c;
}

.referral-card label {
    display: block;
    color: #7f91a7;
    font-size: 10px;
    margin-top: 14px;
}

.ref {
    background: #080d13;
    padding: 11px;
    border-radius: 9px;
    margin-top: 5px;
    font-size: 10px;
    overflow: hidden;
}

.big-total strong,
.wallet-main strong {
    display: block;
    font-size: 36px;
    margin: 8px 0;
}

.big-total span,
.wallet-main span,
.wallet-main small {
    color: #8595aa;
}

.wallet-actions {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 8px;
    margin-bottom: 18px;
}

.wallet-actions button,
.primary,
.secondary {
    padding: 13px;
    border-radius: 11px;
    border: 0;
}

.wallet-actions button,
.primary {
    background: #168bea;
    color: white;
}

.secondary {
    width: 100%;
    margin-top: 10px;
    background: #111a25;
    color: white;
    border: 1px solid #223247;
}

.primary {
    width: 100%;
    margin-top: 18px;
}

.profile-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.profile-avatar {
    width: 58px;
    height: 58px;
    font-size: 24px;
}

.profile-head h3 {
    margin: 0 0 5px;
}

.profile-head span {
    color: #8797aa;
    font-size: 12px;
}

.empty {
    padding: 30px;
    text-align: center;
    color: #708095;
    border: 1px dashed #27374a;
    border-radius: 15px;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 520px;
    width: 100%;
    height: 76px;
    display: grid;
    grid-template-columns: repeat(5,1fr);
    background: rgba(8,12,18,.97);
    border-top: 1px solid #1d2835;
    z-index: 20;
}

.nav {
    background: transparent;
    color: #718096;
    border: 0;
}

.nav b {
    display: block;
    font-size: 20px;
}

.nav span {
    font-size: 9px;
}

.nav.active {
    color: #22aaff;
}

@media(min-width:700px) {
    body {
        padding: 30px;
    }

    .app {
        border: 1px solid #1c2734;
        border-radius: 25px;
        overflow: hidden;
    }
}


/* =========================================================
   DEXFI LIVE ROI CHART
   ========================================================= */

.chart {
    position: relative;
    padding-bottom: 26px;
}

.chart-baseline {
    stroke: rgba(255,255,255,0.10);
    stroke-width: 1;
}

#roiProgressLine {
    transition: all 0.8s ease;
}

#roiProgressDot {
    transition: all 0.8s ease;
}

.chart-info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;

    display: flex;
    justify-content: space-between;

    font-size: 10px;
    color: #728298;
}

#roiChartCurrent {
    color: #18aaff;
}


/* =========================================================
   DEXFI ACTIVE CONTRACT
   ========================================================= */

.active-contract-card {
    margin-top: 14px;
    margin-bottom: 14px;
    padding: 16px;

    background: #0d141e;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
}

.contract-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.contract-header h3 {
    margin: 5px 0 0;
    font-size: 20px;
}

.contract-status {
    padding: 5px 9px;
    border-radius: 20px;

    background: rgba(50,225,154,0.10);
    color: #32e19a;

    font-size: 10px;
    font-weight: 700;
}

.contract-capital {
    margin-top: 18px;
}

.contract-capital span,
.contract-grid span,
.contract-time-grid span,
.contract-ref span {
    display: block;
    font-size: 9px;
    color: #728298;
}

.contract-capital strong {
    display: block;
    margin-top: 4px;
    font-size: 26px;
}

.contract-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 14px;
}

.contract-grid div,
.contract-time-grid div {
    background: #0a1018;
    padding: 10px;
    border-radius: 10px;
}

.contract-grid strong,
.contract-time-grid strong {
    display: block;
    margin-top: 5px;
    font-size: 12px;
}

.contract-progress-track {
    height: 7px;
    margin-top: 14px;

    overflow: hidden;

    background: rgba(255,255,255,0.07);
    border-radius: 20px;
}

.contract-progress-fill {
    width: 0%;
    height: 100%;

    background: currentColor;
    color: #18aaff;

    border-radius: 20px;

    transition: width 0.8s ease;
}

.contract-time-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

.contract-ref {
    margin-top: 12px;
    padding-top: 10px;

    border-top: 1px solid rgba(255,255,255,0.05);
}

.contract-ref strong {
    display: block;
    margin-top: 4px;

    font-size: 10px;
    color: #9ba8ba;

    word-break: break-all;
}


/* =========================================================
   DEXFI ACTIVE CONTRACT
   ========================================================= */

.active-contract-card {
    margin-top: 14px;
    margin-bottom: 14px;
    padding: 16px;

    background: #0d141e;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
}

.contract-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.contract-header h3 {
    margin: 5px 0 0;
    font-size: 20px;
}

.contract-status {
    padding: 5px 9px;
    border-radius: 20px;

    background: rgba(50,225,154,0.10);
    color: #32e19a;

    font-size: 10px;
    font-weight: 700;
}

.contract-capital {
    margin-top: 18px;
}

.contract-capital span,
.contract-grid span,
.contract-time-grid span,
.contract-ref span {
    display: block;
    font-size: 9px;
    color: #728298;
}

.contract-capital strong {
    display: block;
    margin-top: 4px;
    font-size: 26px;
}

.contract-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 14px;
}

.contract-grid div,
.contract-time-grid div {
    background: #0a1018;
    padding: 10px;
    border-radius: 10px;
}

.contract-grid strong,
.contract-time-grid strong {
    display: block;
    margin-top: 5px;
    font-size: 12px;
}

.contract-progress-track {
    height: 7px;
    margin-top: 14px;

    overflow: hidden;

    background: rgba(255,255,255,0.07);
    border-radius: 20px;
}

.contract-progress-fill {
    width: 0%;
    height: 100%;

    background: currentColor;
    color: #18aaff;

    border-radius: 20px;

    transition: width 0.8s ease;
}

.contract-time-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

.contract-ref {
    margin-top: 12px;
    padding-top: 10px;

    border-top: 1px solid rgba(255,255,255,0.05);
}

.contract-ref strong {
    display: block;
    margin-top: 4px;

    font-size: 10px;
    color: #9ba8ba;

    word-break: break-all;
}


/* DEXFI MULTI CONTRACT SELECTOR */

.contract-selector {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    margin-bottom: 14px;
    padding-bottom: 3px;
}

.contract-selector-btn {
    flex: 0 0 auto;

    border: 1px solid rgba(255,255,255,0.08);
    background: #0a1018;
    color: #728298;

    border-radius: 20px;
    padding: 7px 12px;

    font-size: 10px;
    cursor: pointer;
}

.contract-selector-btn.active {
    border-color: #18aaff;
    color: #18aaff;
}


/* =========================================================
   DEXFI DEPOSIT UI V1
   ========================================================= */

.wallet-actions{
    grid-template-columns:repeat(4,1fr);
}

.available-wallet-card{
    margin-bottom:18px;
    padding:16px;
    border:1px solid #1c2938;
    border-radius:13px;
    background:#0a1119;
}

.available-wallet-card span,
.available-wallet-card small{
    display:block;
    color:#728298;
}

.available-wallet-card span{
    font-size:10px;
    letter-spacing:1px;
    text-transform:uppercase;
}

.available-wallet-card strong{
    display:block;
    margin:6px 0 3px;
    font-size:25px;
}

.available-wallet-card small{
    font-size:10px;
}

.dexfi-modal{
    display:none;
    position:fixed;
    inset:0;
    z-index:9999;
    padding:20px;
    background:rgba(0,0,0,.78);
    align-items:center;
    justify-content:center;
}

.dexfi-modal.open{
    display:flex;
}

.dexfi-modal-card{
    position:relative;
    width:100%;
    max-width:420px;
    padding:22px;
    border:1px solid #223247;
    border-radius:16px;
    background:#0a1119;
}

.dexfi-modal-close{
    position:absolute;
    top:12px;
    right:14px;
    border:0;
    background:transparent;
    color:#ffffff;
    font-size:25px;
    cursor:pointer;
}

.dexfi-modal-label{
    margin-bottom:6px;
    color:#728298;
    font-size:9px;
    letter-spacing:1.5px;
}

.deposit-note{
    color:#8c9aab;
    font-size:11px;
    line-height:1.6;
}

.deposit-field-label{
    display:block;
    margin-top:18px;
    margin-bottom:7px;
    color:#8c9aab;
    font-size:10px;
}

.deposit-input{
    width:100%;
    box-sizing:border-box;
    padding:14px;
    border:1px solid #223247;
    border-radius:10px;
    outline:none;
    background:#070d13;
    color:#ffffff;
    font-size:16px;
}

.deposit-network{
    display:flex;
    justify-content:space-between;
    margin-top:12px;
    padding:12px;
    border:1px solid #1c2938;
    border-radius:10px;
    color:#8c9aab;
    font-size:11px;
}

.deposit-network strong{
    color:#ffffff;
}

.deposit-status{
    margin-top:14px;
    color:#8c9aab;
    font-size:11px;
    line-height:1.6;
    word-break:break-word;
}



/* =========================================================
   DEXFI DEPOSIT VERIFY UI V1
   ========================================================= */

.deposit-verify-panel{
    margin-top:18px;
    padding-top:16px;
    border-top:1px solid #1c2938;
}

.deposit-verify-panel[hidden]{
    display:none;
}

.deposit-wallet-address,
.deposit-reference{
    padding:12px;
    border:1px solid #1c2938;
    border-radius:10px;
    background:#070d13;
    color:#ffffff;
    font-size:11px;
    line-height:1.5;
    word-break:break-all;
}

.deposit-reference{
    color:#8c9aab;
}
