:root {
  --primary: #6C5CE7;
  --primary-dark: #5346c9;
  --accent: #00B894;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg: #f7f7fb;
  --card: #ffffff;
  --text: #1a1a2e;
  --muted: #6b7280;
  --border: #e5e7eb;
  --radius: 16px;
  --gradient: linear-gradient(135deg, #6C5CE7 0%, #00B894 100%);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Bengali", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

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

.app-shell {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 96px;
  min-height: 100vh;
}

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

.card-gradient {
  background: var(--gradient);
  color: #fff;
  border: none;
}

.card-gradient .muted { color: rgba(255,255,255,.8); }

h1, h2, h3 { margin: 0 0 4px; }
.muted { color: var(--muted); font-size: 14px; }
.error-text { color: var(--danger); font-size: 14px; }

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

.balance-amount { font-size: 40px; font-weight: 800; letter-spacing: -1px; margin: 6px 0; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat-card .value { font-size: 22px; font-weight: 700; color: var(--primary); margin-top: 4px; }

.progress-bar { width: 100%; height: 10px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--gradient); border-radius: 999px; transition: width .4s ease; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 20px; border-radius: 12px; border: none;
  font-size: 16px; font-weight: 700; cursor: pointer; transition: transform .15s ease, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--gradient); color: #fff; }
.btn-outline { background: transparent; border: 2px solid var(--border); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { width: auto; padding: 8px 14px; font-size: 14px; }

.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-success { background: rgba(34,197,94,.12); color: var(--success); }
.badge-warning { background: rgba(245,158,11,.12); color: var(--warning); }
.badge-danger { background: rgba(239,68,68,.12); color: var(--danger); }
.badge-muted { background: rgba(107,114,128,.12); color: var(--muted); }

.list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 12px 14px; border: 2px solid var(--border); border-radius: 10px;
  font-size: 15px; background: var(--card); color: var(--text);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); }

.method-select { display: flex; gap: 10px; }
.method-option {
  flex: 1; text-align: center; padding: 14px; border: 2px solid var(--border); border-radius: 12px; cursor: pointer; font-weight: 700;
}
.method-option.selected { border-color: var(--primary); background: rgba(108,92,231,.08); color: var(--primary); }

.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-around;
  background: var(--card); border-top: 1px solid var(--border);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  max-width: 560px; margin: 0 auto;
}
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 10px; color: var(--muted); font-size: 11px; font-weight: 600; border-radius: 10px; }
.nav-item svg { width: 22px; height: 22px; }
.nav-item.active { color: var(--primary); }

#toast-container { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; width: calc(100% - 32px); max-width: 520px; }
.toast { padding: 12px 18px; border-radius: 12px; color: #fff; font-weight: 600; font-size: 14px; text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.15); animation: toast-in .2s ease; }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.connect-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.connect-card { text-align: center; max-width: 320px; }
.spinner { width: 44px; height: 44px; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; margin: 0 auto 20px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: .4; }

.lang-toggle { display: flex; gap: 6px; }
.lang-toggle a { padding: 6px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; border: 1px solid var(--border); }
.lang-toggle a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--border); background: var(--card); display: flex; align-items: center; justify-content: center; cursor: pointer; }

.mission-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mission-info h3 { font-size: 15px; }
.mission-reward { color: var(--accent); font-weight: 700; font-size: 14px; }

.tier-badge { font-size: 32px; }

@media (prefers-color-scheme: dark) {
  :root { --bg:#0f0f1a; --card:#1a1a2e; --text:#f1f1f6; --border:#2c2c44; --muted:#9797ad; }
}
