:root {
    --bg-main: #0b0e14;
    --bg-card: #131722;
    --bg-card-hover: #181d2a;
    --bg-input: #1b202e;
    --border-color: #23293b;
    --border-focus: #9146ff;
    --twitch-purple: #9146ff;
    --twitch-hover: #772ce8;
    --twitch-glow: rgba(145, 70, 255, 0.35);
    --accent-cyan: #00f2fe;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Background ambient glow */
body::before {
    content: '';
    position: fixed;
    top: -150px;
    right: -100px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(145, 70, 255, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
    z-index: 0;
}

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

/* ── Top Navbar ── */
.navbar {
    background: rgba(19, 23, 34, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
}

.brand-logo .logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--twitch-purple), var(--accent-cyan));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    box-shadow: 0 0 16px var(--twitch-glow);
}

.brand-logo span.smm-tag {
    font-size: 0.7rem;
    padding: 2px 7px;
    background: rgba(145, 70, 255, 0.2);
    border: 1px solid rgba(145, 70, 255, 0.4);
    color: #c084fc;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    margin-left: 4px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
}

.nav-link {
    padding: 0.55rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    color: #fff;
    background: rgba(145, 70, 255, 0.15);
}

.nav-link.active {
    color: #c084fc;
    border: 1px solid rgba(145, 70, 255, 0.3);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-emerald);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-emerald);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-emerald);
    animation: pulseAnim 2s infinite;
}

@keyframes pulseAnim {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ── Main Layout ── */
.main-wrapper {
    flex: 1;
    max-width: 1320px;
    margin: 0 auto;
    width: 100%;
    padding: 2rem 1.5rem;
    position: relative;
    z-index: 1;
}

/* ── Stats Hero Grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: rgba(145, 70, 255, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: rgba(145, 70, 255, 0.12);
    border: 1px solid rgba(145, 70, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--twitch-purple);
    font-size: 1.35rem;
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.25);
    color: var(--accent-emerald);
}

.stat-icon.cyan {
    background: rgba(0, 242, 254, 0.12);
    border-color: rgba(0, 242, 254, 0.25);
    color: var(--accent-cyan);
}

.stat-icon.amber {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.25);
    color: var(--accent-amber);
}

.stat-info h4 {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.stat-info .stat-value {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-main);
}

/* ── Panel Box / Card ── */
.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    margin-bottom: 2rem;
}

.panel-header {
    padding: 1.35rem 1.75rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.015);
}

.panel-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.panel-body {
    padding: 1.75rem;
}

/* ── Form Controls ── */
.form-group {
    margin-bottom: 1.4rem;
}

.form-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

.form-control:focus, .form-select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--twitch-glow);
    background-color: #1e2434;
}

.form-help {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* ── Live Charge Display ── */
.charge-box {
    background: linear-gradient(135deg, rgba(145, 70, 255, 0.1), rgba(0, 242, 254, 0.05));
    border: 1px dashed rgba(145, 70, 255, 0.35);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1.5rem 0;
}

.charge-title {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.charge-amount {
    font-size: 1.75rem;
    font-weight: 900;
    color: #c084fc;
    font-family: 'JetBrains Mono', monospace;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--twitch-purple), var(--twitch-hover));
    color: #fff;
    box-shadow: 0 4px 16px var(--twitch-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #a968ff, var(--twitch-purple));
    box-shadow: 0 6px 20px rgba(145, 70, 255, 0.5);
    transform: translateY(-1px);
}

.btn-danger {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #fb7185;
}

.btn-danger:hover {
    background: #f43f5e;
    color: #fff;
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.35);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.82rem;
    border-radius: 6px;
}

.btn-block {
    width: 100%;
}

/* ── Table Styling ── */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.smm-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.smm-table th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-dim);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.smm-table td {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.92rem;
    color: var(--text-main);
    vertical-align: middle;
}

.smm-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.018);
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-info {
    background: rgba(0, 242, 254, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(0, 242, 254, 0.3);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
    background: rgba(244, 63, 94, 0.15);
    color: #fb7185;
    border: 1px solid rgba(244, 63, 94, 0.3);
}

/* ── Code Blocks / API Docs ── */
.code-box {
    background: #07090d;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88rem;
    color: #38bdf8;
    overflow-x: auto;
    margin: 0.75rem 0;
}

/* ── Footer ── */
.footer {
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    padding: 2rem 1.5rem;
    margin-top: auto;
}

.footer-content {
    max-width: 1320px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--text-dim);
    font-size: 0.88rem;
}

/* ── Auth Pages (Login / Register) ── */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.auth-card h2 {
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-card .auth-sub {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 1.75rem;
}

.auth-card .form-group { margin-bottom: 1.25rem; }

.auth-card .btn-block {
    width: 100%;
    padding: 0.9rem;
    font-size: 1rem;
    margin-top: 0.5rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-dim);
    font-size: 0.88rem;
}

.auth-footer a {
    color: var(--twitch-purple);
    font-weight: 600;
}

.auth-footer a:hover { color: #c084fc; }

.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-danger {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #fb7185;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

/* ── Balance Display (Navbar) ── */
.balance-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-emerald);
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: var(--transition);
}

.balance-pill:hover {
    background: rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    background: rgba(145, 70, 255, 0.1);
    border: 1px solid rgba(145, 70, 255, 0.25);
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #c084fc;
}

.btn-logout {
    padding: 0.4rem 0.75rem;
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.25);
    border-radius: 30px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #fb7185;
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    background: rgba(244, 63, 94, 0.25);
}

.btn-auth {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-auth-login {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.btn-auth-login:hover {
    border-color: var(--twitch-purple);
    color: #fff;
}

.btn-auth-register {
    background: linear-gradient(135deg, var(--twitch-purple), var(--twitch-hover));
    color: #fff;
    box-shadow: 0 2px 8px var(--twitch-glow);
}

/* ── Add Funds Page ── */
.funds-card {
    max-width: 640px;
    margin: 0 auto;
}

.balance-display {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(0, 242, 254, 0.05));
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-md);
    margin-bottom: 1.75rem;
}

.balance-display .balance-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    margin-bottom: 0.25rem;
}

.balance-display .balance-amount {
    font-size: 2.25rem;
    font-weight: 900;
    color: var(--accent-emerald);
    font-family: 'JetBrains Mono', monospace;
}

.amount-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.amount-preset {
    padding: 1rem;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.amount-preset:hover {
    border-color: rgba(145, 70, 255, 0.5);
    background: rgba(145, 70, 255, 0.05);
}

.amount-preset.active {
    border-color: var(--twitch-purple);
    background: rgba(145, 70, 255, 0.12);
    color: #c084fc;
    box-shadow: 0 0 12px var(--twitch-glow);
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.payment-method {
    padding: 1rem;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
}

.payment-method:hover { border-color: rgba(145, 70, 255, 0.4); color: var(--text-main); }
.payment-method.active { border-color: var(--twitch-purple); background: rgba(145, 70, 255, 0.1); color: #c084fc; }
.payment-method i { display: block; font-size: 1.5rem; margin-bottom: 0.5rem; }

/* ── Insufficient Balance Warning ── */
.balance-warning {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.88rem;
    color: var(--accent-amber);
}

.balance-warning a {
    color: #fbbf24;
    font-weight: 700;
    text-decoration: underline;
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-dim);
}
.empty-state i { font-size: 2.5rem; margin-bottom: 1rem; display: block; }
.empty-state p { font-size: 0.95rem; }

/* Responsive */
@media (max-width: 900px) {
    .nav-links { display: none; }
    .nav-actions .status-pill { display: none; }
    .amount-presets { grid-template-columns: repeat(2, 1fr); }
    .payment-methods { grid-template-columns: 1fr 1fr; }
    .auth-card { margin: 0 1rem; padding: 1.75rem; }
}

@media (max-width: 480px) {
    .nav-actions .balance-pill span:not(.balance-val) { display: none; }
    .nav-actions .user-pill { display: none; }
}
