:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --brand: #15803d;
  --brand-light: #22c55e;
  --accent: #2563eb;
  --good: #16a34a;
  --bad: #dc2626;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Vazirmatn", "Segoe UI", Tahoma, system-ui, sans-serif;
  line-height: 1.7;
  -webkit-tap-highlight-color: transparent;
}
#app { max-width: 560px; margin: 0 auto; padding: 16px 16px 96px; min-height: 100vh; }

/* Header */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 2px 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; }
.brand .logo { width: 36px; height: 36px; border-radius: 10px; background: var(--brand); display: grid; place-items: center; font-size: 22px; }
.brand-name { display: flex; align-items: baseline; gap: 7px; }
.by-watan { font-size: 11px; font-weight: 600; color: var(--brand-light); letter-spacing: .3px; }
.lang-toggle { display: flex; background: var(--surface); border-radius: 999px; padding: 4px; gap: 2px; }
.lang-toggle button { border: 0; background: transparent; color: var(--muted); padding: 6px 12px; border-radius: 999px; font: inherit; cursor: pointer; }
.lang-toggle button.active { background: var(--brand); color: #fff; }

/* Cards */
.card { background: var(--surface); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card h2 { margin: 0 0 8px; font-size: 18px; }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; }
.spread { justify-content: space-between; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Streak / stats */
.stat { background: var(--surface-2); border-radius: var(--radius); padding: 14px; text-align: center; }
.stat .num { font-size: 28px; font-weight: 800; color: var(--brand-light); }
.stat .lbl { font-size: 13px; color: var(--muted); }

/* Subject tiles */
.subject { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius); background: var(--surface); cursor: pointer; border: 1px solid transparent; }
.subject:active { border-color: var(--brand); }
.subject .dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.subject .name { font-weight: 700; }
.subject .weight { font-size: 12px; color: var(--muted); }

/* Buttons */
button.btn { width: 100%; border: 0; border-radius: 12px; padding: 14px; font: inherit; font-weight: 700; cursor: pointer; background: var(--brand); color: #fff; }
button.btn.alt { background: var(--accent); }
button.btn.ghost { background: var(--surface-2); color: var(--text); }
button.btn:disabled { opacity: .5; }
.btn-row { display: grid; gap: 10px; margin-top: 8px; }

/* Inputs */
input.field { width: 100%; padding: 13px; border-radius: 12px; border: 1px solid var(--surface-2); background: var(--bg); color: var(--text); font: inherit; text-align: center; letter-spacing: 2px; }

/* Quiz */
.option { display: block; width: 100%; text-align: start; padding: 13px 16px; margin: 8px 0; border-radius: 12px; background: var(--surface-2); border: 2px solid transparent; color: var(--text); font: inherit; cursor: pointer; }
.option.correct { border-color: var(--good); background: rgba(22,163,74,.18); }
.option.wrong { border-color: var(--bad); background: rgba(220,38,38,.18); }
.option:disabled { cursor: default; }
.explain { background: var(--bg); border-radius: 10px; padding: 12px; margin-top: 8px; font-size: 14px; color: var(--muted); }
.progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.progress > i { display: block; height: 100%; background: var(--brand-light); transition: width .25s; }

/* Result + estimator */
.score-ring { text-align: center; padding: 18px; }
.score-ring .big { font-size: 46px; font-weight: 800; color: var(--brand-light); }
.chip { display: inline-block; background: var(--surface-2); border-radius: 999px; padding: 6px 12px; margin: 4px 4px 0 0; font-size: 13px; }

/* Bottom nav */
.nav { position: fixed; inset-inline: 0; bottom: 0; background: var(--surface); display: flex; max-width: 560px; margin: 0 auto; border-top: 1px solid var(--surface-2); }
.nav button { flex: 1; border: 0; background: transparent; color: var(--muted); padding: 12px 4px; font: inherit; font-size: 13px; cursor: pointer; }
.nav button.active { color: var(--brand-light); font-weight: 700; }

.note { font-size: 12px; color: var(--muted); text-align: center; margin-top: 14px; }
.badge-verify { font-size: 11px; background: var(--brand); color: #fff; border-radius: 999px; padding: 2px 8px; }
