:root {
    --text: #6b6375;
    --text-h: #08060d;
    --bg: #fff;
    --border: #e5e4e7;
    --code-bg: #f4f3ec;
    --accent: #aa3bff;
    --accent-bg: rgba(170, 59, 255, 0.1);
    --accent-border: rgba(170, 59, 255, 0.5);
    --social-bg: rgba(244, 243, 236, 0.5);
    --shadow: rgba(0, 0, 0, 0.1) 0 10px 15px -3px, rgba(0, 0, 0, 0.05) 0 4px 6px -2px;
    --danger: #f44336;
    --success: #4caf50;
    --warning: #ff9800;

    --sans: system-ui, 'Segoe UI', Roboto, sans-serif;
    --mono: ui-monospace, Consolas, monospace;

    --radius: 8px;
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;

    font: 16px/1.5 var(--sans);
    color: var(--text);
    background: var(--bg);
}

@media (prefers-color-scheme: dark) {
    :root {
        --text: #9ca3af;
        --text-h: #f3f4f6;
        --bg: #16171d;
        --border: #2e303a;
        --code-bg: #1f2028;
        --accent: #c084fc;
        --accent-bg: rgba(192, 132, 252, 0.15);
        --accent-border: rgba(192, 132, 252, 0.5);
        --social-bg: rgba(47, 48, 58, 0.5);
        --shadow: rgba(0, 0, 0, 0.4) 0 10px 15px -3px, rgba(0, 0, 0, 0.25) 0 4px 6px -2px;
    }
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; padding: 0; min-height: 100vh; padding-bottom: 70px; }

#app {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
}

h1, h2, h3 {
    font-weight: 600;
    color: var(--text-h);
    margin: 0 0 var(--space-sm);
}
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }

p { margin: 0 0 var(--space-sm); }

.hidden { display: none !important; }

/* Views */
.view { display: none; padding: var(--space-md); }
.view.active { display: block; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text-h);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.btn:hover { border-color: var(--accent-border); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-primary:hover { opacity: 0.9; }
.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.btn-small { padding: var(--space-xs) var(--space-sm); font-size: 13px; }
.btn-full { width: 100%; }

/* Forms */
.form-group {
    margin-bottom: var(--space-md);
    text-align: left;
}
.form-group label {
    display: block;
    margin-bottom: var(--space-xs);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-h);
}
input[type="text"],
input[type="number"],
input[type="email"],
input[type="date"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text-h);
    font: inherit;
    font-size: 14px;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
}
.form-hint { font-size: 13px; color: var(--accent); }

/* Status Bar */
#status-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: var(--space-sm) var(--space-md);
    background: var(--accent);
    color: #fff;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    transition: opacity 0.3s;
}
#status-bar.celebrate {
    animation: pulse 0.5s ease-in-out 3;
}

/* Transaction Overlay */
.transaction-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.transaction-overlay-content {
    text-align: center;
    color: #fff;
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto var(--space-md);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}
.modal-content {
    position: relative;
    background: var(--bg);
    border-radius: var(--radius);
    padding: var(--space-lg);
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow);
}
.btn-close-modal {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text);
}
.warning-text { color: var(--warning); font-size: 13px; margin: var(--space-sm) 0; }

/* Stat cards */
.stat-card {
    background: var(--social-bg);
    border-radius: var(--radius);
    padding: var(--space-md);
    text-align: center;
}
.stat-label { font-size: 13px; color: var(--text); margin-bottom: var(--space-xs); }
.stat-value { font-size: 24px; font-weight: 600; color: var(--text-h); }
.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

/* Badge */
.verification-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.verification-badge.tier-1 { background: var(--code-bg); color: var(--text); }
.verification-badge.tier-2 { background: var(--accent-bg); color: var(--accent); }
.verification-badge.tier-3 { background: var(--success); color: #fff; }
.verification-badge.tier-4 { background: gold; color: #000; }

.jail-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: var(--danger);
    color: #fff;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    background: var(--accent-bg);
    color: var(--accent);
    margin: 2px;
}

/* User avatar */
.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 600;
    color: var(--accent);
    overflow: hidden;
    flex-shrink: 0;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text);
    font-size: 14px;
}

.loading {
    text-align: center;
    padding: var(--space-lg);
    color: var(--text);
}

/* Home */
.home-container {
    text-align: center;
    padding: var(--space-xl) var(--space-md);
}
.home-title {
    font-size: 32px;
    color: var(--accent);
    margin-bottom: var(--space-xs);
}
.home-subtitle {
    color: var(--text);
    font-size: 16px;
}

/* Animations */
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}
.shake { animation: shake 0.3s ease-in-out; }
.pulse { animation: pulse 0.5s ease-in-out; }
