:root {
    --bg-deep: #05070f;
    --bg-grad-a: #0a0f2c;
    --bg-grad-b: #05070f;
    --neon-blue: #29b6ff;
    --neon-cyan: #5ef1ff;
    --neon-green: #4ade80;
    --text-main: #e8f1ff;
    --text-dim: #8ea3c4;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --danger: #ff6b6b;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: radial-gradient(circle at 20% 0%, var(--bg-grad-a) 0%, var(--bg-grad-b) 55%);
    color: var(--text-main);
    min-height: 100vh;
}

.hidden { display: none !important; }

/* ---------- Boot screen ---------- */
#boot-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
}
.spinner {
    width: 34px;
    height: 34px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--neon-blue);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#boot-text { color: var(--text-dim); max-width: 280px; }

/* ---------- Glass utility ---------- */
.glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

/* ---------- App shell ---------- */
#app-shell {
    max-width: 480px;
    margin: 0 auto;
    padding-bottom: 90px;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 16px 8px;
}
.user-info { display: flex; align-items: center; gap: 12px; }
.avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--neon-blue), #7b5cff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 0 16px rgba(41, 182, 255, 0.5);
    overflow: hidden;
    flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.greeting { margin: 0; font-size: 15px; font-weight: 600; }
.plan-badge {
    display: inline-block;
    margin-top: 3px;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    border-radius: 999px;
    background: rgba(41, 182, 255, 0.15);
    color: var(--neon-cyan);
    border: 1px solid rgba(94, 241, 255, 0.35);
    cursor: pointer;
}
.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-main);
    font-size: 16px;
    cursor: pointer;
    position: relative;
}
.notif-btn { position: relative; }
.notif-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 0 6px rgba(255, 107, 107, 0.6);
}
.notif-badge.hidden { display: none; }

.app-main { padding: 12px 16px 0; display: flex; flex-direction: column; gap: 16px; }

/* Banner slider */
.banner-slider-wrap { position: relative; }
.banner-slider {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    border-radius: 18px;
    scrollbar-width: none;
}
.banner-slider::-webkit-scrollbar { display: none; }
.banner-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    height: 140px;
    border-radius: 18px;
    background-size: cover;
    background-position: center;
    background-color: #101636;
    display: flex;
    align-items: flex-end;
    padding: 12px;
    border: 1px solid var(--glass-border);
}
.banner-slide span {
    background: rgba(0, 0, 0, 0.45);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}
.banner-dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.banner-dots .dot-item {
    width: 6px; height: 6px; border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transition: background 0.2s, width 0.2s;
}
.banner-dots .dot-item.active { background: var(--neon-blue); width: 16px; border-radius: 4px; }

/* Balance card */
.balance-card { padding: 20px; position: relative; overflow: hidden; }
.balance-card::before {
    content: '';
    position: absolute;
    top: -40%; right: -20%;
    width: 220px; height: 220px;
    background: radial-gradient(circle, rgba(41,182,255,0.35), transparent 70%);
    pointer-events: none;
}
.balance-label { margin: 0; color: var(--text-dim); font-size: 13px; }
.balance-amount {
    margin: 4px 0 14px;
    font-size: 30px;
    font-weight: 800;
    text-shadow: 0 0 18px rgba(41, 182, 255, 0.45);
}
.balance-breakdown {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 16px;
}
.balance-breakdown div { display: flex; align-items: center; gap: 6px; }
.balance-breakdown strong { margin-left: auto; color: var(--text-main); font-weight: 700; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-blue { background: var(--neon-blue); box-shadow: 0 0 6px var(--neon-blue); }
.dot-green { background: var(--neon-green); box-shadow: 0 0 6px var(--neon-green); }

.balance-actions { display: flex; gap: 10px; }
.btn-pill {
    flex: 1;
    padding: 11px 8px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.btn-deposit { border-color: rgba(41, 182, 255, 0.4); }
.btn-withdraw { border-color: rgba(74, 222, 128, 0.4); }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-card { padding: 14px 8px; text-align: center; }
.stat-icon { font-size: 20px; }
.stat-value { margin: 6px 0 2px; font-size: 17px; font-weight: 800; }
.stat-label { margin: 0; font-size: 11px; color: var(--text-dim); }

/* Check-in */
.checkin-card { padding: 18px; }
.checkin-title { margin: 0; font-weight: 700; font-size: 15px; }
.checkin-sub { margin: 2px 0 14px; font-size: 12px; color: var(--text-dim); }
.checkin-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 14px; }
.checkin-day {
    aspect-ratio: 1;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    gap: 2px;
}
.checkin-day span.d { font-weight: 700; font-size: 11px; color: var(--text-main); }
.checkin-day.claimed {
    background: rgba(74, 222, 128, 0.12);
    border-color: rgba(74, 222, 128, 0.4);
    color: var(--neon-green);
}
.checkin-day.claimed span.d { color: var(--neon-green); }
.checkin-day.today {
    border-color: var(--neon-blue);
    box-shadow: 0 0 10px rgba(41, 182, 255, 0.4);
}
.btn-checkin {
    width: 100%;
    padding: 13px;
    border-radius: 14px;
    border: none;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--neon-blue), #7b5cff);
    color: #05070f;
    box-shadow: 0 0 18px rgba(41, 182, 255, 0.4);
}
.btn-checkin:disabled {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-dim);
    box-shadow: none;
    cursor: not-allowed;
}

/* CTA */
.cta-card {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    border-color: rgba(41, 182, 255, 0.3);
}
.cta-title { margin: 0; font-weight: 700; font-size: 14px; }
.cta-sub { margin: 2px 0 0; font-size: 12px; color: var(--text-dim); }
.cta-arrow { margin-left: auto; font-size: 18px; color: var(--neon-blue); }

/* Bottom nav */
.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 448px;
    display: flex;
    justify-content: space-between;
    padding: 10px 6px;
    border-radius: 20px;
    background: rgba(10, 14, 34, 0.85);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.nav-item {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 4px;
    cursor: pointer;
}
.nav-icon { font-size: 18px; }
.nav-item.active { color: var(--neon-cyan); text-shadow: 0 0 10px rgba(94, 241, 255, 0.6); }

/* Toast */
#toast {
    position: fixed;
    left: 50%;
    bottom: 100px;
    transform: translateX(-50%) translateY(20px);
    background: rgba(20, 24, 46, 0.95);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    max-width: 90%;
    text-align: center;
    z-index: 50;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
