/* Dars Academy app — design tokens, base, app shell and shared components.
   Module-specific styles live in modules/<id>/<id>.css and load only on that module's pages. */

@font-face { font-family: Peyda; src: url('/assets/fonts/peyda-regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: Peyda; src: url('/assets/fonts/peyda-bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
/* Tahoma scaled to Peyda's text width (measured: 15% wider regular, 25% wider bold), so
   lines wrap the same before and after Peyda arrives and the swap does not shift layout. */
@font-face { font-family: 'Peyda Fallback'; src: local('Tahoma'); font-weight: 400; size-adjust: 87%; }
@font-face { font-family: 'Peyda Fallback'; src: local('Tahoma Bold'), local('Tahoma-Bold'); font-weight: 700; size-adjust: 80%; }

:root {
  color-scheme: light;
  --brand: #01ee9c;
  --brand-strong: #00d68c;
  --brand-soft: #e6fcf4;
  --brand-ink: #047857;
  --accent: #7552d8;
  --accent-strong: #5635b2;
  --accent-soft: #f4f0ff;
  --accent-line: #d8ccf6;
  --ink: #0f172a;
  --text: #334155;
  --muted: #566376;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --surface: #ffffff;
  --canvas: #f8fafc;
  --danger: #c2415d;
  --danger-ink: #8f2a41;
  --danger-soft: #fff1f4;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.05);
  --shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 12px 32px rgb(15 23 42 / 0.07);
  --shadow-pop: 0 18px 45px rgb(15 23 42 / 0.16);
  --font: Peyda, 'Peyda Fallback', Tahoma, system-ui, sans-serif;
  --font-latin: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --gutter: 16px;
  --content: 1120px;
  --topbar-h: 60px;
  --bottom-nav-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --module-accent: var(--accent);
  --module-accent-strong: var(--accent-strong);
  --module-soft: var(--accent-soft);
}

/* Module accent themes; a module picks one by name in its manifest. */
[data-accent='purple'] { --module-accent: #7552d8; --module-accent-strong: #5635b2; --module-soft: #f4f0ff; }
[data-accent='green'] { --module-accent: #047857; --module-accent-strong: #065f46; --module-soft: #e6fcf4; }
[data-accent='blue'] { --module-accent: #1d4ed8; --module-accent-strong: #1e3a8a; --module-soft: #eaf1ff; }
[data-accent='orange'] { --module-accent: #c2410c; --module-accent-strong: #9a3412; --module-soft: #fff3eb; }

/* ---- base ---------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  background: var(--canvas);
  color: var(--ink);
  font: 400 1rem/1.75 var(--font);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom));
}
h1, h2, h3, h4, p, ol, ul, dl, dd, figure, blockquote { margin: 0; }
h1, h2, h3, h4 { line-height: 1.4; font-weight: 700; }
ul[class], ol[class] { list-style: none; padding: 0; }
a { color: inherit; text-decoration: none; }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:lang(en) { font-family: var(--font-latin); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
/* Programmatic focus targets (main after the skip link, a new question) are not controls. */
[tabindex='-1']:focus { outline: none; }

.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
/* Shown by the page markup only when this stylesheet is missing. */
.asset-warning { display: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { width: min(100% - 2 * var(--gutter), var(--content)); margin-inline: auto; }

.skip-link {
  position: fixed; z-index: 100; top: -100px; inset-inline-start: 12px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--ink); color: #fff; font-weight: 700;
}
.skip-link:focus { top: 12px; }

/* ---- app shell ----------------------------------------------------------------------- */

.topbar { position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 16px; height: var(--topbar-h); }
.brand { display: inline-flex; align-items: center; min-height: 44px; flex: none; border-radius: 8px; }
.brand svg { width: auto; height: 32px; }
.topbar-end { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.site-link { display: none; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; color: var(--muted); font-size: 0.875rem; font-weight: 700; }
.site-link:hover { color: var(--ink); background: var(--canvas); }

/* Global navigation: bottom tab bar on phones, inline in the top bar on wider screens. */
.primary-nav {
  position: fixed; z-index: 45; inset-inline: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--bottom-nav-h) + var(--safe-bottom));
  padding: 0 max(8px, env(safe-area-inset-left)) var(--safe-bottom) max(8px, env(safe-area-inset-right));
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 24px rgb(15 23 42 / 0.06);
}
.primary-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 48px; color: var(--muted); font-size: 0.75rem; font-weight: 700; line-height: 1.4;
}
.nav-icon { display: grid; place-items: center; width: 56px; height: 30px; border-radius: 999px; transition: background-color 0.2s var(--ease); }
.nav-icon .icon { width: 22px; height: 22px; }
.primary-nav a.is-active { color: var(--ink); }
.primary-nav a.is-active .nav-icon { background: var(--brand-soft); color: var(--brand-ink); }

/* Section navigation of the current module. */
.module-nav { background: var(--surface); border-bottom: 1px solid var(--line); }
.module-nav-inner { display: flex; align-items: center; gap: 16px; min-height: 52px; }
.module-nav-title { display: none; align-items: center; gap: 8px; font-weight: 700; white-space: nowrap; color: var(--ink); }
.module-nav-title .icon { color: var(--module-accent); }
.module-tabs { flex: 1; display: grid; grid-template-columns: repeat(var(--tabs, 4), 1fr); gap: 4px; padding-block: 6px; }
.module-tabs a {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 6px 8px; border-radius: 999px;
  color: var(--muted); font-size: 0.875rem; font-weight: 700; white-space: nowrap;
}
.module-tabs a .icon { display: none; }
.module-tabs a:hover { color: var(--ink); background: var(--canvas); }
.module-tabs a.is-active { background: var(--module-soft); color: var(--module-accent-strong); }

.page { flex: 1; width: 100%; padding-block: 20px 40px; }
.app-footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 0.875rem; }
.app-footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding-block: 18px; }
.app-footer nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.app-footer a { display: inline-block; padding-block: 4px; text-decoration: underline; text-underline-offset: 3px; }
.app-footer a:hover { color: var(--ink); }

/* Focus mode: navigation chrome steps aside (e.g. during a practice round). */
.is-focus body { padding-bottom: 0; }
.is-focus .topbar, .is-focus .module-nav, .is-focus .app-footer { display: none; }
.is-focus .page { padding: 0; }

@media (min-width: 600px) {
  .module-tabs a .icon { display: block; width: 18px; height: 18px; }
}

@media (min-width: 900px) {
  :root { --topbar-h: 68px; --gutter: 24px; }
  body { padding-bottom: 0; }
  .brand svg { height: 36px; }
  .site-link { display: inline-flex; }
  .primary-nav {
    position: static; display: flex; gap: 4px; height: auto; padding: 0;
    background: none; border: 0; box-shadow: none;
  }
  .primary-nav a { flex-direction: row; gap: 8px; min-height: 44px; padding: 8px 14px 8px 16px; border-radius: 999px; font-size: 0.9375rem; }
  .primary-nav a:hover { background: var(--canvas); color: var(--ink); }
  .primary-nav a.is-active { background: var(--brand-soft); }
  .primary-nav a.is-active .nav-icon { background: none; }
  .nav-icon { width: auto; height: auto; }
  .nav-icon .icon { width: 20px; height: 20px; }
  .module-nav-title { display: inline-flex; }
  .module-tabs { flex: none; display: flex; }
  .module-tabs a { padding-inline: 14px; }
  .page { padding-block: 36px 64px; }
}

/* ---- typography & layout ------------------------------------------------------------- */

.page-head { margin-bottom: 24px; }
.page-title { font-size: clamp(1.625rem, 1.2rem + 2vw, 2.375rem); line-height: 1.35; }
.lead { margin-top: 8px; max-width: 62ch; color: var(--text); font-size: 1.0625rem; }
.section { margin-top: 36px; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.section-title { font-size: 1.25rem; }
.section-note { color: var(--muted); font-size: 0.9375rem; }
.text-link { color: var(--accent-strong); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.text-link:hover { color: var(--ink); }
.muted { color: var(--muted); }
/* One short line of facts under a page title ("درس ۲۷ از ۴۲ • ۱۲ واژه"). */
.page-meta { margin-top: 6px; color: var(--muted); font-size: 0.9375rem; font-weight: 700; }
.sep { display: inline-block; width: 4px; height: 4px; margin-inline: 8px; border-radius: 50%; background: currentColor; opacity: 0.5; vertical-align: middle; }

/* ---- components ---------------------------------------------------------------------- */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 20px;
  border: 1px solid transparent; border-radius: var(--radius);
  font-weight: 700; line-height: 1.3; text-align: center;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.12s;
}
.button:active:not(:disabled) { transform: scale(0.98); }
.button--primary { background: var(--brand); color: var(--ink); }
.button--primary:hover:not(:disabled) { background: var(--brand-strong); }
.button--accent { background: var(--module-accent); color: #fff; }
.button--accent:hover:not(:disabled) { background: var(--module-accent-strong); }
.button--ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.button--ghost:hover:not(:disabled) { border-color: var(--module-accent); color: var(--module-accent-strong); }
.button--danger { background: var(--danger); color: #fff; }
.button--block { width: 100%; }
.button:disabled { opacity: 0.55; cursor: not-allowed; }

.icon-button { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 12px; background: transparent; color: var(--text); }
.icon-button:hover { background: var(--canvas); color: var(--ink); }
.link-button { min-height: 32px; padding: 2px 4px; border: 0; background: none; color: var(--accent-strong); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }

.meter { --value: 0%; height: 8px; overflow: hidden; border-radius: 999px; background: #e7ecf2; }
.meter > span { display: block; width: var(--value); height: 100%; border-radius: inherit; background: var(--brand); transition: width 0.4s var(--ease); }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stat dt { color: var(--muted); font-size: 0.8125rem; font-weight: 700; }
.stat dd { margin-top: 2px; font-size: 1.5rem; font-weight: 700; line-height: 1.4; }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.alert { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; margin-bottom: 20px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.alert > .icon { margin-top: 4px; }
.alert-body { flex: 1 1 220px; }
.alert-body p { margin-top: 2px; font-size: 0.9375rem; }
.alert .button { min-height: 44px; }
.alert--error { border-color: #f3c1cc; background: var(--danger-soft); color: var(--danger-ink); }

.empty-state { padding: 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); font-size: 0.9375rem; text-align: center; }

/* forms */
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field > legend { padding: 0; color: var(--ink); font-size: 0.9375rem; font-weight: 700; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.input, .select {
  width: 100%; min-height: 48px; padding: 10px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font-size: 1rem;
}
.input::placeholder { color: #6b7789; }
.input:focus-visible, .select:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.input[aria-invalid='true'] { border-color: var(--danger); }
.select-wrap { position: relative; }
.select { appearance: none; padding-inline-end: 44px; cursor: pointer; }
.select-wrap > .icon { position: absolute; top: 50%; inset-inline-end: 14px; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.form-grid { display: grid; gap: 12px; }
.form-error { min-height: 1.5em; color: var(--danger); font-size: 0.875rem; font-weight: 700; }
@media (min-width: 600px) { .form-grid { grid-template-columns: 1fr 1fr; } }

.segmented { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.segmented label { position: relative; display: block; }
.segmented input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.segmented label > span { display: flex; align-items: center; justify-content: center; min-height: 44px; height: 100%; padding: 6px; border-radius: 10px; color: var(--muted); font-size: 0.875rem; font-weight: 700; line-height: 1.4; text-align: center; }
.segmented input:checked + span { background: var(--module-soft); color: var(--module-accent-strong); box-shadow: inset 0 0 0 1px var(--accent-line); }
.segmented input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 1px; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.switch input { position: relative; flex: none; width: 50px; height: 30px; margin: 0; appearance: none; border-radius: 999px; background: #7b8799; cursor: pointer; transition: background-color 0.2s; }
.switch input::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: inset-inline-start 0.2s var(--ease); }
.switch input:checked { background: var(--brand-ink); }
.switch input:checked::after { inset-inline-start: 23px; }

/* dialog */
.dialog { width: min(100% - 32px, 460px); max-height: calc(100dvh - 32px); padding: 0; overflow: auto; border: 0; border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: 0 24px 70px rgb(15 23 42 / 0.3); }
.dialog::backdrop { background: rgb(15 23 42 / 0.55); }
.dialog[open] { animation: pop-in 0.22s var(--ease); }
.dialog-body { display: grid; gap: 14px; padding: 24px; }
.dialog-title { font-size: 1.25rem; }
.dialog-text { color: var(--text); font-size: 0.9375rem; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dialog-actions .button { flex: 1 1 140px; }

/* toasts */
.toast-region { position: fixed; z-index: 90; inset-inline: 12px; bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 12px); display: grid; justify-items: center; gap: 8px; pointer-events: none; }
.is-focus .toast-region { bottom: calc(var(--safe-bottom) + 12px); }
.toast {
  display: flex; align-items: center; gap: 10px; width: min(100%, 480px); min-height: 52px;
  padding: 6px; padding-inline-start: 16px;
  border-radius: var(--radius); background: var(--ink); color: #fff; box-shadow: 0 12px 32px rgb(15 23 42 / 0.28);
  pointer-events: auto; animation: toast-in 0.25s var(--ease);
}
.toast > .icon { color: var(--brand); }
.toast-message { flex: 1; font-size: 0.9375rem; line-height: 1.55; }
.toast-action { min-height: 40px; padding: 6px 14px; border: 0; border-radius: 10px; background: var(--brand); color: var(--ink); font-weight: 700; white-space: nowrap; }
.toast-close { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: none; color: #cbd5e1; }
.toast-close:hover { color: #fff; }
.toast :focus-visible { outline-color: var(--brand); }
@media (min-width: 900px) { .toast-region { bottom: 24px; } }

/* dashboard header: a personal greeting instead of a marketing hero */
.dash-head { margin-bottom: 20px; }
.dash-title { font-size: clamp(1.5rem, 1.25rem + 1.2vw, 2rem); line-height: 1.4; }
.wave { display: inline-block; font-size: 0.9em; }
.dash-sub { margin-top: 2px; color: var(--muted); font-size: 1.0625rem; }

/* "continue learning": the most important card of the dashboard and of a module home */
.continue {
  position: relative; display: grid; gap: 16px; overflow: hidden;
  padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.continue::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--module-accent); }
.continue-label { color: var(--muted); font-size: 0.875rem; font-weight: 700; }
.continue-module { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--text); font-size: 0.9375rem; font-weight: 700; }
.continue-icon { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 8px; background: var(--module-soft); color: var(--module-accent); }
.continue-icon .icon { width: 16px; height: 16px; }
.continue-title { margin-top: 2px; font-size: 1.625rem; line-height: 1.35; }
.continue-progress { display: grid; gap: 8px; }
.continue-progress-text { color: var(--muted); font-size: 0.875rem; }
.continue-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.continue-actions .button { flex: 1 1 auto; }
@media (min-width: 760px) {
  .continue { grid-template-columns: minmax(0, 1fr) minmax(180px, 260px) auto; align-items: center; gap: 20px 32px; padding: 24px 28px; }
  .continue-actions .button { flex: none; }
}

/* learning program cards, generated from module manifests */
.program-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.program {
  position: relative; display: grid; align-content: start; gap: 12px;
  padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.program:hover { border-color: var(--accent-line); box-shadow: var(--shadow); }
.program-head { display: flex; align-items: center; gap: 12px; }
.program-icon { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 14px; background: var(--module-soft); color: var(--module-accent); }
.program-icon .icon { width: 24px; height: 24px; }
.program-name { min-width: 0; }
.program-title { font-size: 1.125rem; line-height: 1.4; }
.program-title a::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.program-en { color: var(--muted); font-size: 0.8125rem; text-align: right; }
.program-description { color: var(--text); font-size: 0.9375rem; }
.program-meta { color: var(--text); font-size: 0.875rem; font-weight: 700; }
.program-progress { display: flex; align-items: center; gap: 12px; }
.program-progress .meter { flex: 1; }
.program-percent { min-width: 3ch; color: var(--muted); font-size: 0.8125rem; font-weight: 700; }
.program-status { margin-top: -6px; color: var(--muted); font-size: 0.8125rem; }
.program-links { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; }
.program-links a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); font-size: 0.875rem; font-weight: 700; }
.program-links a:hover { border-color: var(--module-accent); color: var(--module-accent-strong); }
.program-links .icon { width: 16px; height: 16px; color: var(--module-accent); }
.program-action { position: relative; z-index: 1; justify-self: start; min-height: 44px; padding-inline: 16px 14px; }

/* activity: a compact list, deliberately quieter than the cards above it */
.activity-section { max-width: 720px; }
.activity-list { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.activity-list > li + li { border-top: 1px solid var(--line); }
.activity-list > .empty-state { border: 0; border-radius: 0; text-align: start; }
.activity-item { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 16px; }
.activity-item:hover { background: var(--canvas); }
.activity-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.activity-icon .icon { width: 18px; height: 18px; }
.activity-title { flex: 1; display: grid; min-width: 0; font-size: 0.9375rem; font-weight: 700; line-height: 1.5; }
.activity-title small { color: var(--muted); font-size: 0.8125rem; font-weight: 400; }
.activity-item time { color: var(--muted); font-size: 0.8125rem; white-space: nowrap; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* status pages (404, offline) */
.status-page { display: grid; justify-items: center; gap: 12px; max-width: 560px; margin-inline: auto; padding-block: 32px; text-align: center; }
.status-icon { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 24px; background: var(--accent-soft); color: var(--accent); }
.status-icon .icon { width: 36px; height: 36px; }
.status-page .hero-actions { justify-content: center; }
.link-list { display: grid; gap: 8px; width: 100%; margin-top: 8px; text-align: start; }
.link-list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-weight: 700; }
.link-list a:hover { border-color: var(--accent-line); }

/* profile */
.profile-card { display: flex; align-items: center; gap: 16px; }
.avatar { display: grid; place-items: center; width: 56px; height: 56px; flex: none; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); font-size: 1.375rem; font-weight: 700; }
.settings-list { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.settings-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 16px 20px; }
.settings-row + .settings-row { border-top: 1px solid var(--line); }
.settings-row-text { flex: 1 1 240px; }
.settings-row-text strong { display: block; }
.settings-row-text span { display: block; color: var(--muted); font-size: 0.875rem; }
.settings-link { flex-wrap: nowrap; min-height: 64px; }
.settings-link:hover { background: var(--canvas); }
.settings-link > .icon { color: var(--muted); }
.app-version { color: var(--muted); font-size: 0.875rem; text-align: center; }

/* profile: my achievements (cards come from module achievement providers) */
.achievement-card { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.achievement-head { display: flex; align-items: center; gap: 10px; }
.achievement-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.achievement-icon .icon { width: 20px; height: 20px; }
.achievement-title { flex: 1; font-size: 1.0625rem; }
.achievement-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.achievement-stats div { padding: 10px 12px; border-radius: var(--radius); background: var(--canvas); }
.achievement-stats dt { color: var(--muted); font-size: 0.8125rem; }
.achievement-stats dd, .record-value { word-spacing: 0.12em; } /* Peyda's bold space is nearly invisible after digits */
.achievement-stats dd { font-size: 1.125rem; font-weight: 700; }
.achievement-subtitle { color: var(--text); font-size: 0.9375rem; }
.records-list { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); }
.records-list li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.records-list li + li { border-top: 1px solid var(--line); }
.record-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.record-icon .icon { width: 18px; height: 18px; }
.record-text { flex: 1; display: grid; min-width: 0; }
.record-text small { color: var(--muted); font-size: 0.8125rem; }
.record-value { font-weight: 700; text-align: end; }
.badge-list { display: flex; flex-wrap: wrap; gap: 8px; }
.badge-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 0.875rem; font-weight: 700; }
.badge-chip .icon { width: 16px; height: 16px; color: var(--accent); }
.badge-chip small { color: var(--muted); font-weight: 400; }
.badge-chip[data-rarity='rare'] { border-color: var(--accent-line); }
.badge-chip[data-rarity='epic'] { border-color: var(--accent-line); background: var(--accent-soft); }
.badge-chip[data-rarity='legendary'] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.badge-chip[data-rarity='legendary'] .icon { color: var(--brand-ink); }
@media (max-width: 599px) {
  .achievement-stats div:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (min-width: 600px) {
  .achievement-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
.stack { display: grid; gap: 16px; }
.section-tight { margin-top: 20px; }

/* about */
.about { max-width: 680px; }
.about .lead { max-width: none; }
.about-app { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.about-app p { margin-top: 6px; color: var(--text); }
.whatsapp-cta {
  display: flex; align-items: center; gap: 14px; min-height: 76px; margin-top: 28px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}
.whatsapp-cta:hover { border-color: #9fe2b8; box-shadow: var(--shadow); }
.whatsapp-cta:active { transform: scale(0.99); }
.whatsapp-mark { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 14px; background: #25d366; color: #fff; }
.whatsapp-mark .icon { width: 28px; height: 28px; }
.whatsapp-text { flex: 1; display: grid; gap: 2px; min-width: 0; }
.whatsapp-text strong { font-size: 1rem; line-height: 1.5; text-wrap: balance; }
.whatsapp-text small { color: var(--muted); font-size: 0.8125rem; }
.whatsapp-arrow { width: 18px; height: 18px; color: var(--muted); }
.about-version { margin-top: 40px; color: var(--muted); font-size: 0.875rem; }
.build-id { margin-top: 2px; font-size: 0.75rem; }

/* ---- motion -------------------------------------------------------------------------- */

@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
