:root{
    --bg:#050816;
    --bg2:#0b1022;
    --card:rgba(15,23,42,.82);
    --card2:rgba(30,41,59,.72);
    --line:rgba(255,255,255,.12);
    --line2:rgba(148,163,184,.18);
    --text:#f8fafc;
    --muted:#94a3b8;
    --muted2:#cbd5e1;
    --blue:#2563eb;
    --cyan:#06b6d4;
    --purple:#8b5cf6;
    --pink:#ec4899;
    --green:#22c55e;
    --red:#ef4444;
    --yellow:#f59e0b;
    --shadow:0 24px 70px rgba(0,0,0,.35);
    --radius:26px;
    --radius2:18px;
}

*{
    box-sizing:border-box;
}

html,
body{
    width:100%;
    max-width:100%;
    overflow-x:hidden;
}

body{
    margin:0;
    font-family:Arial,Helvetica,sans-serif;
    color:var(--text);
    background:
        radial-gradient(circle at top left, rgba(139,92,246,.34), transparent 32%),
        radial-gradient(circle at top right, rgba(6,182,212,.20), transparent 34%),
        radial-gradient(circle at bottom, rgba(37,99,235,.16), transparent 38%),
        linear-gradient(180deg,#020617,#0f172a 48%,#020617);
    min-height:100vh;
}

body.light{
    --bg:#eef4ff;
    --bg2:#f8fafc;
    --card:#ffffff;
    --card2:#f8fafc;
    --line:#e5e7eb;
    --line2:#e2e8f0;
    --text:#0f172a;
    --muted:#64748b;
    --muted2:#334155;
}

a{
    color:inherit;
    text-decoration:none;
}

button,
input,
select,
textarea{
    font-family:inherit;
}

button,
a{
    -webkit-tap-highlight-color:transparent;
}

img{
    max-width:100%;
    display:block;
}

.page{
    width:min(1180px,94%);
    margin:0 auto;
    padding:18px 0 96px;
}

.app-shell{
    width:min(470px,94%);
    margin:0 auto;
    padding:16px 0 96px;
}

.admin-shell{
    width:min(1180px,94%);
    margin:0 auto;
    padding:18px 0 96px;
}

/* TOP BAR */

.topbar{
    position:sticky;
    top:0;
    z-index:50;
    padding:12px 0;
    backdrop-filter:blur(18px);
}

.topbar-inner{
    width:min(1180px,94%);
    margin:0 auto;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    background:rgba(2,6,23,.72);
    border:1px solid var(--line);
    border-radius:22px;
    padding:10px 12px;
    box-shadow:0 16px 40px rgba(0,0,0,.25);
}

.brand{
    display:flex;
    align-items:center;
    gap:10px;
    min-width:0;
}

.brand-logo{
    width:42px;
    height:42px;
    border-radius:15px;
    display:grid;
    place-items:center;
    overflow:hidden;
    background:linear-gradient(135deg,rgba(139,92,246,.25),rgba(6,182,212,.16));
    border:1px solid var(--line);
    flex:0 0 42px;
}

.brand-logo img{
    width:100%;
    height:100%;
    object-fit:cover;
}

.brand-title{
    min-width:0;
}

.brand-title b{
    display:block;
    color:var(--text);
    font-size:15px;
    line-height:1.1;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.brand-title span{
    display:block;
    color:var(--muted);
    font-size:11px;
    font-weight:800;
    margin-top:3px;
}

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

.icon-btn{
    width:42px;
    height:42px;
    border:0;
    border-radius:15px;
    display:grid;
    place-items:center;
    color:var(--text);
    background:rgba(255,255,255,.08);
    border:1px solid var(--line);
    font-weight:900;
    cursor:pointer;
}

.icon-btn.primary{
    background:linear-gradient(135deg,var(--blue),var(--purple));
    border-color:rgba(255,255,255,.2);
}

/* BOTTOM NAV */

.bottom-nav{
    position:fixed;
    left:50%;
    bottom:14px;
    transform:translateX(-50%);
    z-index:60;
    width:min(470px,94%);
    display:grid;
    grid-template-columns:repeat(5,1fr);
    gap:8px;
    background:rgba(2,6,23,.84);
    border:1px solid var(--line);
    border-radius:25px;
    padding:8px;
    box-shadow:0 22px 70px rgba(0,0,0,.45);
    backdrop-filter:blur(18px);
}

.bottom-nav a{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:4px;
    min-height:54px;
    border-radius:18px;
    color:var(--muted);
    font-size:10px;
    font-weight:900;
}

.bottom-nav a.active,
.bottom-nav a:hover{
    color:#fff;
    background:linear-gradient(135deg,rgba(37,99,235,.8),rgba(139,92,246,.72));
}

.nav-dot{
    width:19px;
    height:19px;
    border-radius:8px;
    display:grid;
    place-items:center;
    background:rgba(255,255,255,.08);
    border:1px solid rgba(255,255,255,.10);
}

/* HERO / CARDS */

.hero{
    position:relative;
    overflow:hidden;
    border-radius:34px;
    padding:24px;
    background:
        radial-gradient(circle at top right,rgba(139,92,246,.35),transparent 36%),
        linear-gradient(145deg,rgba(15,23,42,.94),rgba(30,41,59,.74));
    border:1px solid var(--line);
    box-shadow:var(--shadow);
}

.hero:before{
    content:"";
    position:absolute;
    width:280px;
    height:280px;
    border-radius:50%;
    right:-125px;
    top:-130px;
    background:rgba(6,182,212,.15);
    filter:blur(2px);
}

.hero:after{
    content:"";
    position:absolute;
    width:220px;
    height:220px;
    border-radius:50%;
    left:-110px;
    bottom:-120px;
    background:rgba(139,92,246,.16);
}

.hero-inner{
    position:relative;
    z-index:1;
}

.hero-row{
    display:grid;
    grid-template-columns:1fr .85fr;
    gap:18px;
    align-items:center;
}

.hero h1{
    margin:0;
    font-size:clamp(35px,7vw,62px);
    line-height:.95;
    letter-spacing:-2px;
}

.hero p{
    margin:12px 0 0;
    color:var(--muted2);
    line-height:1.55;
    font-weight:800;
}

.hero-img{
    display:grid;
    place-items:center;
    min-height:230px;
}

.hero-img img{
    width:min(280px,90%);
    filter:drop-shadow(0 0 34px rgba(139,92,246,.58));
}

.card{
    background:var(--card);
    border:1px solid var(--line);
    border-radius:var(--radius);
    padding:18px;
    box-shadow:0 18px 54px rgba(0,0,0,.22);
    min-width:0;
}

.card.soft{
    background:rgba(255,255,255,.06);
}

.card h2,
.card h3{
    margin:0 0 13px;
    font-size:21px;
    letter-spacing:-.5px;
}

.card p{
    color:var(--muted);
    font-size:14px;
    line-height:1.55;
    font-weight:800;
}

/* DASHBOARD */

.balance-card{
    position:relative;
    overflow:hidden;
    border-radius:30px;
    padding:22px;
    background:linear-gradient(135deg,#2563eb,#8b5cf6 58%,#ec4899);
    box-shadow:0 24px 70px rgba(139,92,246,.28);
}

.balance-card:before{
    content:"";
    position:absolute;
    width:180px;
    height:180px;
    border-radius:50%;
    right:-75px;
    top:-75px;
    background:rgba(255,255,255,.18);
}

.balance-card span{
    display:block;
    color:#dbeafe;
    font-size:12px;
    font-weight:900;
    margin-bottom:8px;
    position:relative;
    z-index:1;
}

.balance-card strong{
    display:block;
    color:#fff;
    font-size:32px;
    line-height:1;
    letter-spacing:-1px;
    overflow-wrap:anywhere;
    position:relative;
    z-index:1;
}

.balance-card small{
    display:block;
    color:#e0f2fe;
    font-weight:900;
    margin-top:10px;
    position:relative;
    z-index:1;
}

.stats-grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:14px;
    margin:16px 0;
}

.stat{
    background:var(--card);
    border:1px solid var(--line);
    border-radius:22px;
    padding:16px;
    min-width:0;
}

.stat span{
    display:block;
    color:var(--muted);
    font-size:11px;
    font-weight:900;
    margin-bottom:7px;
}

.stat strong{
    display:block;
    color:var(--text);
    font-size:23px;
    font-weight:900;
    overflow-wrap:anywhere;
}

.quick-grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:12px;
    margin:16px 0;
}

.quick-card{
    background:rgba(255,255,255,.06);
    border:1px solid var(--line);
    border-radius:22px;
    padding:13px 10px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:8px;
    text-align:center;
    font-size:12px;
    font-weight:900;
    min-height:92px;
}

.quick-card img{
    width:42px;
    height:42px;
    object-fit:contain;
    filter:drop-shadow(0 0 14px rgba(139,92,246,.45));
}

/* SPIN */

.spin-card{
    position:relative;
    overflow:hidden;
    text-align:center;
    padding:24px 18px;
}

.spin-wheel-wrap{
    width:min(300px,88vw);
    height:min(300px,88vw);
    margin:0 auto 18px;
    display:grid;
    place-items:center;
    border-radius:50%;
    background:
        radial-gradient(circle,rgba(255,255,255,.12),transparent 62%),
        linear-gradient(135deg,rgba(139,92,246,.2),rgba(6,182,212,.1));
    border:1px solid var(--line);
    box-shadow:
        inset 0 0 45px rgba(139,92,246,.22),
        0 0 55px rgba(139,92,246,.28);
}

.spin-wheel{
    width:88%;
    height:88%;
    object-fit:contain;
    filter:drop-shadow(0 0 35px rgba(6,182,212,.5));
    transition:transform 1.8s cubic-bezier(.17,.67,.2,1.03);
}

.spin-wheel.spinning{
    transform:rotate(1440deg);
}

.spin-title{
    font-size:30px;
    margin:0 0 8px;
    letter-spacing:-1px;
}

.spin-subtitle{
    margin:0 0 18px;
    color:var(--muted);
    font-weight:800;
}

.result-box{
    margin-top:14px;
    border-radius:20px;
    padding:14px;
    font-weight:900;
    line-height:1.5;
    display:none;
}

.result-box.show{
    display:block;
}

.result-box.win{
    background:rgba(34,197,94,.14);
    border:1px solid rgba(34,197,94,.30);
    color:#bbf7d0;
}

.result-box.loss{
    background:rgba(239,68,68,.14);
    border:1px solid rgba(239,68,68,.30);
    color:#fecaca;
}

.countdown-pill{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:38px;
    padding:9px 14px;
    border-radius:999px;
    color:#fde68a;
    background:rgba(245,158,11,.13);
    border:1px solid rgba(245,158,11,.30);
    font-weight:900;
    margin:10px 0;
}

/* FORMS */

.form-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:14px;
}

.form-row{
    margin-bottom:14px;
}

.form-full{
    grid-column:1/-1;
}

label{
    display:block;
    font-size:12px;
    color:var(--muted2);
    font-weight:900;
    margin-bottom:7px;
}

.input,
.select,
.textarea{
    width:100%;
    border:1px solid var(--line);
    background:rgba(2,6,23,.62);
    color:#fff;
    border-radius:17px;
    padding:14px;
    outline:none;
    font-weight:800;
}

.textarea{
    min-height:110px;
    resize:vertical;
}

.input:focus,
.select:focus,
.textarea:focus{
    border-color:var(--purple);
    box-shadow:0 0 0 4px rgba(139,92,246,.18);
}

.input::placeholder{
    color:#64748b;
}

.help{
    color:var(--muted);
    font-size:12px;
    font-weight:800;
    line-height:1.5;
    margin:7px 0 0;
}

.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    border:0;
    width:100%;
    min-height:50px;
    border-radius:18px;
    padding:14px 16px;
    background:linear-gradient(135deg,var(--blue),var(--purple));
    color:#fff;
    font-size:15px;
    font-weight:900;
    cursor:pointer;
    box-shadow:0 15px 35px rgba(37,99,235,.22);
}

.btn:hover{
    filter:brightness(1.06);
}

.btn:disabled{
    opacity:.55;
    cursor:not-allowed;
}

.btn.green{
    background:linear-gradient(135deg,#16a34a,#22c55e);
}

.btn.red{
    background:linear-gradient(135deg,#dc2626,#f43f5e);
}

.btn.yellow{
    background:linear-gradient(135deg,#d97706,#f59e0b);
}

.btn.ghost{
    background:rgba(255,255,255,.07);
    border:1px solid var(--line);
    box-shadow:none;
}

.btn.small{
    min-height:38px;
    padding:9px 13px;
    font-size:12px;
    border-radius:13px;
    width:auto;
}

/* ALERTS */

.flash,
.alert{
    padding:14px 16px;
    border-radius:18px;
    margin:14px 0;
    line-height:1.55;
    font-weight:900;
}

.flash.success,
.alert.success{
    color:#bbf7d0;
    background:rgba(34,197,94,.14);
    border:1px solid rgba(34,197,94,.30);
}

.flash.error,
.alert.error{
    color:#fecaca;
    background:rgba(239,68,68,.14);
    border:1px solid rgba(239,68,68,.30);
}

.flash.warning,
.alert.warning{
    color:#fde68a;
    background:rgba(245,158,11,.13);
    border:1px solid rgba(245,158,11,.30);
}

.alert.info{
    color:#bfdbfe;
    background:rgba(37,99,235,.14);
    border:1px solid rgba(37,99,235,.30);
}

/* STATUS */

.badge,
.status{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:7px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:900;
    text-transform:capitalize;
}

.status.ok,
.badge.ok{
    background:rgba(34,197,94,.14);
    color:#bbf7d0;
    border:1px solid rgba(34,197,94,.28);
}

.status.wait,
.badge.wait{
    background:rgba(245,158,11,.13);
    color:#fde68a;
    border:1px solid rgba(245,158,11,.28);
}

.status.bad,
.badge.bad{
    background:rgba(239,68,68,.14);
    color:#fecaca;
    border:1px solid rgba(239,68,68,.28);
}

.status.normal,
.badge.normal{
    background:rgba(148,163,184,.14);
    color:#cbd5e1;
    border:1px solid rgba(148,163,184,.25);
}

/* LISTS / HISTORY */

.list{
    display:grid;
    gap:12px;
}

.list-item{
    background:rgba(255,255,255,.055);
    border:1px solid var(--line);
    border-radius:20px;
    padding:14px;
    display:grid;
    grid-template-columns:1fr auto;
    gap:12px;
    align-items:center;
    min-width:0;
}

.list-title{
    font-weight:900;
    color:var(--text);
    overflow-wrap:anywhere;
}

.list-sub{
    margin-top:4px;
    color:var(--muted);
    font-size:12px;
    font-weight:800;
    line-height:1.45;
}

.amount{
    text-align:right;
    font-size:16px;
    font-weight:900;
    overflow-wrap:anywhere;
}

.amount.credit{
    color:#4ade80;
}

.amount.debit{
    color:#fb7185;
}

.empty{
    padding:34px 16px;
    text-align:center;
    color:var(--muted);
    font-weight:800;
    line-height:1.6;
}

/* TABLES ADMIN */

.table-wrap{
    width:100%;
    overflow-x:auto;
    border-radius:22px;
    border:1px solid var(--line);
}

.table{
    width:100%;
    border-collapse:collapse;
    min-width:760px;
    background:rgba(15,23,42,.68);
}

.table th,
.table td{
    padding:13px 14px;
    border-bottom:1px solid var(--line2);
    text-align:left;
    vertical-align:middle;
    font-size:13px;
}

.table th{
    color:var(--muted2);
    font-weight:900;
    background:rgba(255,255,255,.05);
}

.table td{
    color:var(--text);
    font-weight:800;
}

.table tr:last-child td{
    border-bottom:0;
}

/* LOGIN */

.login-wrap{
    min-height:100vh;
    width:min(440px,94%);
    margin:0 auto;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:24px 0;
}

.login-card{
    width:100%;
    background:var(--card);
    border:1px solid var(--line);
    border-radius:34px;
    padding:24px;
    box-shadow:var(--shadow);
}

.login-logo{
    width:96px;
    height:96px;
    border-radius:30px;
    margin:0 auto 16px;
    display:grid;
    place-items:center;
    background:linear-gradient(135deg,rgba(139,92,246,.25),rgba(6,182,212,.16));
    border:1px solid var(--line);
    overflow:hidden;
}

.login-logo img{
    width:100%;
    height:100%;
    object-fit:cover;
}

.login-card h1{
    text-align:center;
    margin:0;
    font-size:32px;
    letter-spacing:-1px;
}

.login-card p{
    text-align:center;
    margin:10px 0 20px;
    color:var(--muted);
    font-weight:800;
    line-height:1.55;
}

/* PACKAGES */

.package-grid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:14px;
}

.package{
    position:relative;
    overflow:hidden;
    border-radius:24px;
    padding:18px;
    background:rgba(255,255,255,.06);
    border:1px solid var(--line);
}

.package:before{
    content:"";
    position:absolute;
    width:110px;
    height:110px;
    border-radius:50%;
    right:-50px;
    top:-50px;
    background:rgba(139,92,246,.18);
}

.package img{
    width:62px;
    height:62px;
    object-fit:contain;
    filter:drop-shadow(0 0 17px rgba(139,92,246,.45));
    position:relative;
    z-index:1;
}

.package h3{
    position:relative;
    z-index:1;
    margin:12px 0 6px;
    font-size:21px;
}

.package p{
    position:relative;
    z-index:1;
    margin:0 0 14px;
    color:var(--muted);
    font-weight:800;
}

/* ADDRESS / COPY */

.copy-box{
    background:rgba(2,6,23,.62);
    border:1px solid var(--line);
    border-radius:18px;
    padding:12px;
    word-break:break-all;
    overflow-wrap:anywhere;
    font-weight:900;
    color:#bfdbfe;
}

.copy-row{
    display:grid;
    grid-template-columns:1fr auto;
    gap:10px;
    align-items:center;
}

.copy-btn{
    border:0;
    min-height:42px;
    padding:10px 12px;
    border-radius:14px;
    background:linear-gradient(135deg,var(--blue),var(--purple));
    color:#fff;
    font-weight:900;
    cursor:pointer;
}

/* UTILITIES */

.mt-0{margin-top:0}
.mt-1{margin-top:8px}
.mt-2{margin-top:14px}
.mt-3{margin-top:20px}
.mb-0{margin-bottom:0}
.mb-1{margin-bottom:8px}
.mb-2{margin-bottom:14px}
.mb-3{margin-bottom:20px}

.grid-2{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:14px;
}

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

.grid-4{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:14px;
}

.text-muted{color:var(--muted)}
.text-green{color:#4ade80}
.text-red{color:#fb7185}
.text-yellow{color:#facc15}
.text-blue{color:#60a5fa}
.center{text-align:center}
.right{text-align:right}
.hide{display:none!important}

.footer{
    text-align:center;
    color:var(--muted);
    font-size:12px;
    font-weight:800;
    padding:28px 0;
}

/* MOBILE */

@media(max-width:980px){
    .hero-row{
        grid-template-columns:1fr;
    }

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

    .package-grid{
        grid-template-columns:repeat(2,1fr);
    }
}

@media(max-width:680px){
    .page,
    .admin-shell{
        width:94%;
        padding-top:14px;
    }

    .hero{
        padding:20px 16px;
        border-radius:30px;
    }

    .hero h1{
        font-size:42px;
    }

    .hero-img{
        min-height:180px;
    }

    .hero-img img{
        width:min(230px,84%);
    }

    .quick-grid{
        grid-template-columns:repeat(4,1fr);
        gap:8px;
    }

    .quick-card{
        min-height:78px;
        border-radius:18px;
        font-size:10px;
        padding:10px 6px;
    }

    .quick-card img{
        width:32px;
        height:32px;
    }

    .stats-grid,
    .grid-2,
    .grid-3,
    .grid-4,
    .package-grid,
    .form-grid{
        grid-template-columns:1fr;
    }

    .list-item{
        grid-template-columns:1fr;
    }

    .amount,
    .right{
        text-align:left;
    }

    .topbar-inner{
        border-radius:20px;
    }

    .brand-title b{
        max-width:170px;
    }

    .card{
        padding:16px;
        border-radius:23px;
    }

    .spin-card{
        padding:20px 14px;
    }

    .bottom-nav{
        bottom:10px;
        border-radius:23px;
    }

    .bottom-nav a{
        min-height:50px;
        font-size:9px;
    }

    .copy-row{
        grid-template-columns:1fr;
    }

    .copy-btn{
        width:100%;
    }
}

@media(max-width:390px){
    .hero h1{
        font-size:36px;
    }

    .quick-grid{
        gap:7px;
    }

    .quick-card{
        font-size:9px;
    }

    .brand-title b{
        max-width:135px;
    }

    .bottom-nav{
        gap:6px;
        padding:7px;
    }
}