:root {
    --bg: #08080c;
    --bg-card: #0f0f14;
    --bg-elevated: #16161f;
    --border: #1e1e2a;
    --border-bright: #2a2a3a;
    --text: #e8e8ef;
    --text-dim: #6b6b80;
    --text-muted: #404055;
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --green: #34d399;
    --green-dim: rgba(52, 211, 153, 0.12);
    --red: #f87171;
    --red-dim: rgba(248, 113, 113, 0.12);
    --font: 'DM Sans', -apple-system, sans-serif;
    --mono: 'JetBrains Mono', monospace;
    --radius: 16px;
    --radius-sm: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    font-size: 15px;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── Screens ────────────────────────────────────── */

.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; flex-direction: column; }

/* ── Landing ────────────────────────────────────── */

#landing {
    position: relative;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: hidden;
}

.landing-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 12s ease-in-out infinite;
}

.orb-1 {
    width: 300px; height: 300px;
    background: #6366f1;
    top: -80px; left: -60px;
    animation-delay: 0s;
}

.orb-2 {
    width: 200px; height: 200px;
    background: #818cf8;
    bottom: 10%; right: -40px;
    animation-delay: -4s;
}

.orb-3 {
    width: 150px; height: 150px;
    background: #34d399;
    top: 40%; left: 20%;
    opacity: 0.2;
    animation-delay: -8s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-30px) scale(1.05); }
}

.landing-content {
    position: relative;
    z-index: 1;
    max-width: 420px;
    width: 100%;
    text-align: center;
    animation: fadeUp 0.8s ease-out;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.logo-mark svg {
    width: 64px; height: 64px;
    margin-bottom: 20px;
}

.landing-title {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.landing-sub {
    color: var(--text-dim);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 40px;
}

.connect-section {
    text-align: left;
}

.connect-card {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.connect-card .connect-icon {
    flex-shrink: 0;
    width: 44px; height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-glow);
    border-radius: 12px;
    color: var(--accent);
}

.connect-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.connect-card p {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.5;
}

.divider {
    text-align: center;
    position: relative;
    margin: 20px 0;
}

.divider::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 50%;
    height: 1px;
    background: var(--border);
}

.divider span {
    position: relative;
    background: var(--bg);
    padding: 0 16px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.code-input-wrap {
    display: flex;
    gap: 10px;
}

.code-input {
    flex: 1;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--mono);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.code-input:focus {
    border-color: var(--accent);
}

.code-input::placeholder {
    color: var(--text-muted);
    font-family: var(--font);
}

.error-text {
    color: var(--red);
    font-size: 13px;
    margin-top: 8px;
    min-height: 20px;
}

.landing-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 48px;
    font-size: 12px;
    color: var(--text-muted);
}

.landing-footer strong {
    color: var(--text-dim);
    font-weight: 600;
}

.landing-footer .dot {
    width: 3px; height: 3px;
    border-radius: 50%;
    background: var(--text-muted);
}

/* ── Buttons ────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover { background: #5558e6; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-wallet {
    width: 100%;
    padding: 16px;
    background: var(--bg-elevated);
    border: 1px dashed var(--border-bright);
    color: var(--text-dim);
    border-radius: var(--radius-sm);
}

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

.btn-ghost {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ghost:hover { border-color: var(--text-dim); color: var(--text); }

/* ── Dashboard ──────────────────────────────────── */

.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(8, 8, 12, 0.9);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.dash-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 15px;
}

.dash-logo svg { width: 28px; height: 28px; }

.dash-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-dim);
}

.dash-main {
    max-width: 560px;
    margin: 0 auto;
    padding: 24px 20px 48px;
    width: 100%;
}

/* ── Balance Hero ───────────────────────────────── */

.balance-hero {
    text-align: center;
    padding: 40px 24px;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(99, 102, 241, 0.06) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.balance-hero::before {
    content: "";
    position: absolute;
    top: -1px; left: -1px; right: -1px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.balance-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.balance-amount {
    font-size: 56px;
    font-weight: 700;
    letter-spacing: -2px;
    font-family: var(--mono);
    background: linear-gradient(135deg, var(--text) 30%, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin-bottom: 6px;
}

.balance-unit {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 24px;
}

.balance-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
}

.stat { text-align: center; }

.stat-value {
    display: block;
    font-family: var(--mono);
    font-size: 18px;
    font-weight: 600;
}

.stat-value.green { color: var(--green); }
.stat-value.red { color: var(--red); }

.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-top: 2px;
}

.stat-divider {
    width: 1px;
    height: 32px;
    background: var(--border);
}

/* ── Cards ──────────────────────────────────────── */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h2 {
    font-size: 15px;
    font-weight: 600;
}

.badge {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.badge-soon {
    background: var(--accent-glow);
    color: var(--accent);
}

/* ── Claim preview ──────────────────────────────── */

.claim-preview {
    margin-bottom: 20px;
}

.claim-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-dim);
}

.claim-row:last-child { border-bottom: none; }

.claim-row .mono {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text);
}

/* ── Earn grid ──────────────────────────────────── */

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

.earn-item {
    text-align: center;
    padding: 16px 8px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.earn-icon {
    font-family: var(--mono);
    font-size: 18px;
    font-weight: 700;
    color: var(--green);
    margin-bottom: 6px;
}

.earn-item.spend .earn-icon { color: var(--red); }

.earn-label {
    font-size: 11px;
    color: var(--text-dim);
    line-height: 1.3;
}

/* ── Transaction list ───────────────────────────── */

.tx-list { }

.tx-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.tx-item:last-child { border-bottom: none; }

.tx-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.tx-icon.earn { background: var(--green-dim); color: var(--green); }
.tx-icon.spend { background: var(--red-dim); color: var(--red); }

.tx-info { flex: 1; min-width: 0; }

.tx-desc {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tx-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.tx-ref {
    display: inline;
    font-family: var(--mono);
    font-size: 10px;
    color: var(--text-muted);
    margin-left: 6px;
    opacity: 0.6;
}

.tx-amount {
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.tx-amount.positive { color: var(--green); }
.tx-amount.negative { color: var(--red); }

.empty-state {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ── Responsive ─────────────────────────────────── */

@media (max-width: 480px) {
    .balance-amount { font-size: 42px; }
    .earn-grid { grid-template-columns: repeat(2, 1fr); }
    .dash-main { padding: 20px 16px 48px; }
}
