/* ================================================================
   MEMORIZ — Design System
   Dark neuro-tech UI · mobile-first (iOS) · no dependencies
   ================================================================ */

:root {
  /* Palette */
  --bg-0: #070B14;
  --bg-1: #0B1220;
  --bg-2: #101A2E;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-2: rgba(255, 255, 255, 0.1);
  --stroke: rgba(255, 255, 255, 0.09);
  --stroke-2: rgba(255, 255, 255, 0.16);

  --cyan: #3EDBFF;
  --cyan-dim: rgba(62, 219, 255, 0.14);
  --violet: #9D6BFF;
  --violet-dim: rgba(157, 107, 255, 0.14);
  --blue: #3B82F6;
  --green: #34D399;
  --green-dim: rgba(52, 211, 153, 0.14);
  --amber: #FBBF24;
  --amber-dim: rgba(251, 191, 36, 0.14);
  --red: #F87171;
  --red-dim: rgba(248, 113, 113, 0.16);

  --text-1: #EDF2FB;
  --text-2: #93A0B8;
  --text-3: #5B6880;

  --grad-brand: linear-gradient(135deg, #3EDBFF 0%, #9D6BFF 100%);
  --grad-cta: linear-gradient(135deg, #2563EB 0%, #3EDBFF 120%);

  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 22px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  overscroll-behavior: none;
}

body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(157, 107, 255, 0.12), transparent 60%),
    radial-gradient(1000px 500px at -10% 10%, rgba(62, 219, 255, 0.10), transparent 55%),
    var(--bg-0);
  color: var(--text-1);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}

.app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  padding: calc(14px + var(--safe-top)) 18px calc(96px + var(--safe-bottom));
  animation: screenIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes screenIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Typography ---------- */
h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 14px; font-weight: 700; }
.muted { color: var(--text-2); }
.small { font-size: 12.5px; }
.xsmall { font-size: 11px; }
.section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--text-2);
  margin: 26px 0 12px;
}
.section-title svg { width: 15px; height: 15px; color: var(--cyan); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-l);
  padding: 18px;
}
.card + .card { margin-top: 14px; }
.card.glow-brand {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--bg-1), var(--bg-1)) padding-box,
    linear-gradient(135deg, rgba(62,219,255,0.55), rgba(157,107,255,0.55)) border-box;
  box-shadow: 0 12px 44px -18px rgba(97, 163, 255, 0.45);
}

/* ---------- Buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%;
  padding: 15px 18px;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
  background: var(--grad-cta);
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease, opacity 0.12s;
  box-shadow: 0 10px 26px -12px rgba(59, 130, 246, 0.7);
}
.btn:active { transform: scale(0.975); filter: brightness(1.12); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.secondary {
  background: var(--surface-2);
  border: 1px solid var(--stroke-2);
  box-shadow: none;
  color: var(--text-1);
}
.btn.ghost {
  background: transparent;
  border: 1px solid var(--stroke);
  box-shadow: none;
  color: var(--text-2);
}
.btn.danger { background: linear-gradient(135deg, #DC2626, #F87171); box-shadow: none; }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn.compact { width: auto; padding: 10px 16px; font-size: 13.5px; border-radius: 11px; }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 520px;
  display: flex;
  padding: 8px 10px calc(8px + var(--safe-bottom));
  background: rgba(9, 14, 26, 0.97);
  border-top: 1px solid var(--stroke);
  z-index: 50;
}
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 0 5px;
  border: none; background: none;
  font-family: inherit; font-size: 10px; font-weight: 600;
  color: var(--text-3);
  cursor: pointer;
  border-radius: 12px;
  transition: color 0.15s;
}
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--cyan); }
.tab.active svg { filter: drop-shadow(0 0 8px rgba(62, 219, 255, 0.6)); }

/* ---------- Header ---------- */
.profile-header { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.avatar {
  width: 58px; height: 58px; flex: none;
  border-radius: 50%;
  background: var(--grad-brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: #0A1020;
  box-shadow: 0 0 0 2px var(--bg-0), 0 0 0 4px rgba(62, 219, 255, 0.4);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.profile-meta { flex: 1; min-width: 0; }
.profile-name { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.profile-badges { display: flex; gap: 12px; margin-top: 4px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; color: var(--text-2);
}
.pill svg { width: 14px; height: 14px; }
.pill .accent { color: var(--cyan); }
.pill.streak svg { color: var(--amber); }
.pill.level svg { color: var(--cyan); }

.xpbar { height: 5px; border-radius: 3px; background: var(--surface-2); margin-top: 8px; overflow: hidden; }
.xpbar > div { height: 100%; border-radius: 3px; background: var(--grad-brand); transition: width 0.6s cubic-bezier(0.22,1,0.36,1); }

/* ---------- IQ hero card ---------- */
.iq-hero { text-align: center; padding: 22px 18px; }
.iq-label {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-2);
}
.iq-label svg { width: 16px; height: 16px; color: var(--violet); }
.iq-value {
  font-size: 64px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05;
  margin: 6px 0 2px;
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.iq-value.empty { font-size: 40px; }
.iq-sub { font-size: 12.5px; color: var(--text-2); line-height: 1.55; }
.iq-sub b { color: var(--text-1); }

/* ---------- Stat / skill rows ---------- */
.skill-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; }
.skill-row + .skill-row { border-top: 1px solid var(--stroke); }
.skill-ic {
  width: 40px; height: 40px; flex: none;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.skill-ic svg { width: 21px; height: 21px; }
.skill-body { flex: 1; min-width: 0; }
.skill-name { font-size: 13.5px; font-weight: 700; }
.skill-lvl { font-size: 11.5px; color: var(--text-2); font-weight: 600; margin-top: 1px; }
.meter { height: 6px; border-radius: 3px; background: var(--surface-2); margin-top: 7px; overflow: hidden; }
.meter > div { height: 100%; border-radius: 3px; transition: width 0.6s cubic-bezier(0.22,1,0.36,1); }

.tint-cyan { background: var(--cyan-dim); color: var(--cyan); }
.tint-violet { background: var(--violet-dim); color: var(--violet); }
.tint-amber { background: var(--amber-dim); color: var(--amber); }
.tint-green { background: var(--green-dim); color: var(--green); }
.fill-cyan { background: linear-gradient(90deg, #2563EB, var(--cyan)); }
.fill-violet { background: linear-gradient(90deg, #7C3AED, var(--violet)); }
.fill-amber { background: linear-gradient(90deg, #D97706, var(--amber)); }
.fill-green { background: linear-gradient(90deg, #059669, var(--green)); }

/* ---------- Module grid ---------- */
.module-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.module-card {
  position: relative;
  border-radius: var(--radius-l);
  border: 1px solid var(--stroke);
  background: var(--surface);
  padding: 16px 14px;
  cursor: pointer;
  transition: transform 0.12s ease;
  overflow: hidden;
  text-align: left;
  font-family: inherit;
  color: var(--text-1);
}
.module-card:active { transform: scale(0.97); }
.module-card .m-ic {
  width: 42px; height: 42px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.module-card .m-ic svg { width: 22px; height: 22px; }
.module-card .m-title { font-size: 14px; font-weight: 800; letter-spacing: -0.01em; }
.module-card .m-sub { font-size: 11.5px; color: var(--text-2); margin-top: 3px; line-height: 1.45; }
.module-card.wide { grid-column: 1 / -1; }
.module-card .m-badge {
  position: absolute; top: 12px; right: 12px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.05em;
  padding: 4px 8px; border-radius: 20px;
  background: var(--cyan-dim); color: var(--cyan);
}

/* ---------- Session / game shell ---------- */
.game-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 16px;
}
.game-top .btn-icon {
  width: 38px; height: 38px; flex: none;
  border-radius: 12px; border: 1px solid var(--stroke);
  background: var(--surface); color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-family: inherit;
}
.game-top .btn-icon svg { width: 18px; height: 18px; }
.game-stats { display: flex; gap: 8px; }
.stat-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 11px;
  background: var(--surface); border: 1px solid var(--stroke);
  font-size: 13px; font-weight: 700;
  min-width: 64px; justify-content: center;
}
.stat-chip svg { width: 14px; height: 14px; color: var(--cyan); }
.stat-chip.warn svg, .stat-chip.warn span { color: var(--amber); }
.stat-chip.danger svg, .stat-chip.danger span { color: var(--red); }

.progressbar { height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; margin-bottom: 16px; }
.progressbar > div { height: 100%; background: var(--grad-brand); transition: width 0.3s ease; }

/* ---------- Memory match board ---------- */
.mm-board {
  display: grid; gap: 9px;
  perspective: 900px;
  margin-top: 6px;
}
.mm-card {
  aspect-ratio: 3 / 3.6;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.42s cubic-bezier(0.3, 1.2, 0.4, 1), opacity 0.3s;
  cursor: pointer;
  border-radius: 12px;
}
.mm-card.flipped { transform: rotateY(180deg); }
.mm-card.matched { opacity: 0.32; pointer-events: none; }
.mm-card.moving { animation: mmShuffle 0.5s ease; }
@keyframes mmShuffle {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(0.7) rotate(8deg); }
  100% { transform: scale(1) rotate(0); }
}
.mm-face {
  position: absolute; inset: 0;
  border-radius: 12px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex; align-items: center; justify-content: center;
}
.mm-back {
  background:
    linear-gradient(var(--bg-2), var(--bg-2)) padding-box,
    linear-gradient(150deg, rgba(62,219,255,0.4), rgba(157,107,255,0.35)) border-box;
  border: 1px solid transparent;
}
.mm-back svg { width: 34%; height: 34%; color: rgba(147, 160, 184, 0.5); }
.mm-front {
  transform: rotateY(180deg);
  background: linear-gradient(160deg, rgba(62,219,255,0.16), rgba(157,107,255,0.16)), var(--bg-2);
  border: 1px solid var(--stroke-2);
}
.mm-front svg { width: 52%; height: 52%; }
.mm-card.wrong .mm-front { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.mm-card.good .mm-front { border-color: var(--green); box-shadow: 0 0 14px rgba(52, 211, 153, 0.5); }

/* ---------- Palace ---------- */
.palace-scene {
  position: relative;
  border-radius: var(--radius-l);
  border: 1px solid var(--stroke);
  overflow: hidden;
  background: linear-gradient(180deg, #0D1526 0%, #0A101E 100%);
}
.palace-scene svg { display: block; width: 100%; height: auto; }
.palace-slot { cursor: pointer; }
.palace-slot .slot-glow { opacity: 0; transition: opacity 0.25s; }
.palace-slot.lit .slot-glow { opacity: 1; }
.palace-order {
  font-weight: 800;
}
.palace-tray {
  display: flex; flex-wrap: wrap; gap: 9px; justify-content: center;
  margin-top: 14px;
}
.tray-item {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--stroke-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.2s;
  font-family: inherit; color: var(--text-1);
}
.tray-item:active { transform: scale(0.93); }
.tray-item.used { opacity: 0.25; pointer-events: none; }
.tray-item.selected { border-color: var(--cyan); box-shadow: 0 0 12px rgba(62,219,255,0.5); }
.tray-item svg { width: 30px; height: 30px; }

/* ---------- IQ test ---------- */
.iq-question { margin-top: 4px; }
.iq-prompt { font-size: 16px; font-weight: 700; line-height: 1.5; margin-bottom: 16px; }
.iq-figure {
  border-radius: var(--radius-m);
  border: 1px solid var(--stroke);
  background: var(--bg-1);
  padding: 12px;
  margin-bottom: 16px;
}
.iq-figure svg { display: block; width: 100%; height: auto; }
.iq-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.iq-options.single { grid-template-columns: 1fr; }
.iq-opt {
  padding: 14px 12px;
  border-radius: 13px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  font-family: inherit; font-size: 14.5px; font-weight: 600;
  color: var(--text-1);
  cursor: pointer;
  transition: transform 0.1s, border-color 0.15s;
  text-align: center;
}
.iq-opt svg { display: block; width: 64%; max-width: 90px; height: auto; margin: 0 auto; }
.iq-opt:active { transform: scale(0.97); }
.iq-opt.picked { border-color: var(--cyan); background: var(--cyan-dim); }

.digit-display {
  display: flex; align-items: center; justify-content: center;
  min-height: 140px;
  font-size: 64px; font-weight: 800; letter-spacing: 0.02em;
  color: var(--cyan);
  text-shadow: 0 0 30px rgba(62, 219, 255, 0.5);
}
.digit-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.digit-pad button {
  padding: 16px 0; border-radius: 13px;
  border: 1px solid var(--stroke); background: var(--surface);
  color: var(--text-1); font-family: inherit; font-size: 20px; font-weight: 700;
  cursor: pointer;
}
.digit-pad button:active { background: var(--surface-2); }
.digit-entry {
  min-height: 44px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 26px; font-weight: 800; letter-spacing: 0.15em;
  color: var(--text-1);
}

/* Speed coding */
.code-key {
  display: flex; justify-content: center; gap: 8px;
  padding: 12px; border-radius: var(--radius-m);
  background: var(--bg-1); border: 1px solid var(--stroke);
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.code-pair { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 44px; }
.code-pair svg { width: 26px; height: 26px; color: var(--text-1); }
.code-pair span { font-size: 13px; font-weight: 800; color: var(--cyan); }
.code-target {
  display: flex; align-items: center; justify-content: center;
  min-height: 110px;
}
.code-target svg { width: 72px; height: 72px; color: var(--text-1); }

/* ---------- Results / summary ---------- */
.result-hero { text-align: center; padding: 30px 18px 22px; }
.result-score {
  font-size: 56px; font-weight: 800; letter-spacing: -0.03em;
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.result-stars { display: flex; justify-content: center; gap: 6px; margin: 10px 0; }
.result-stars svg { width: 30px; height: 30px; color: var(--amber); }
.result-stars svg.off { color: var(--surface-2); }
.reward-row {
  display: flex; justify-content: center; gap: 18px; margin-top: 14px;
}
.reward-row .pill { font-size: 14px; }

.gauss-wrap { margin: 8px 0 4px; }
.index-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.index-cell {
  border-radius: var(--radius-m); border: 1px solid var(--stroke);
  background: var(--surface); padding: 13px;
}
.index-cell .ix-name { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.index-cell .ix-val { font-size: 26px; font-weight: 800; margin-top: 3px; }

/* ---------- Charts ---------- */
.chart-card svg { display: block; width: 100%; height: auto; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.legend .pill::before {
  content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--c, var(--cyan));
}

/* ---------- Challenges & badges ---------- */
.challenge-row { display: flex; gap: 12px; align-items: center; padding: 13px 0; }
.challenge-row + .challenge-row { border-top: 1px solid var(--stroke); }
.challenge-body { flex: 1; min-width: 0; }
.challenge-name { font-size: 13.5px; font-weight: 700; }
.challenge-progress { font-size: 11.5px; color: var(--text-2); margin-top: 2px; }
.check-ic {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--stroke-2); color: var(--text-3);
}
.check-ic.done { background: var(--green-dim); border-color: var(--green); color: var(--green); }
.check-ic svg { width: 16px; height: 16px; }

.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge-cell {
  border-radius: var(--radius-m); border: 1px solid var(--stroke);
  background: var(--surface); padding: 14px 8px;
  text-align: center;
}
.badge-cell.locked { opacity: 0.35; }
.badge-cell .b-ic {
  width: 44px; height: 44px; margin: 0 auto 8px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.badge-cell .b-ic svg { width: 22px; height: 22px; }
.badge-cell .b-name { font-size: 10.5px; font-weight: 700; line-height: 1.3; }

/* ---------- Settings ---------- */
.set-row {
  display: flex; align-items: center; gap: 12px; padding: 14px 0;
}
.set-row + .set-row { border-top: 1px solid var(--stroke); }
.set-row .s-label { flex: 1; font-size: 14px; font-weight: 600; }
.set-row .s-sub { font-size: 11.5px; color: var(--text-2); margin-top: 2px; font-weight: 500; }
.toggle {
  width: 48px; height: 28px; flex: none;
  border-radius: 15px; border: none;
  background: var(--surface-2);
  position: relative; cursor: pointer;
  transition: background 0.2s;
}
.toggle::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--text-2);
  transition: transform 0.2s, background 0.2s;
}
.toggle.on { background: rgba(62, 219, 255, 0.35); }
.toggle.on::after { transform: translateX(20px); background: var(--cyan); }

input.field {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--stroke-2);
  background: var(--bg-1);
  color: var(--text-1);
  font-family: inherit; font-size: 15px; font-weight: 600;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}
input.field:focus { border-color: var(--cyan); }

/* ---------- Overlay / modal ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4, 7, 14, 0.88);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn 0.2s ease;
}
.overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: 100%; max-width: 520px;
  background: var(--bg-1);
  border: 1px solid var(--stroke-2); border-bottom: none;
  border-radius: 24px 24px 0 0;
  padding: 22px 20px calc(24px + var(--safe-bottom));
  animation: sheetUp 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes sheetUp { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Utility ---------- */
.row { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-14 { margin-top: 14px; } .mt-20 { margin-top: 20px; }
.hidden { display: none !important; }

.countdown-ring { display: block; margin: 0 auto; }

.toast {
  position: fixed; left: 50%; bottom: calc(110px + var(--safe-bottom));
  transform: translateX(-50%);
  background: var(--bg-2); border: 1px solid var(--stroke-2);
  color: var(--text-1);
  padding: 11px 18px; border-radius: 14px;
  font-size: 13.5px; font-weight: 700;
  box-shadow: 0 18px 40px -12px rgba(0,0,0,0.6);
  z-index: 200;
  display: flex; align-items: center; gap: 8px;
  animation: toastIn 0.25s cubic-bezier(0.22,1,0.36,1);
  white-space: nowrap;
}
.toast svg { width: 16px; height: 16px; color: var(--cyan); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Auth : segmented control & avatar picker ---------- */
.seg {
  display: flex; gap: 6px;
  padding: 5px;
  border-radius: 14px;
  background: var(--surface); border: 1px solid var(--stroke);
}
.seg-btn {
  flex: 1;
  padding: 11px 0;
  border: none; border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  font-family: inherit; font-size: 13.5px; font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.seg-btn.active {
  background: var(--surface-2);
  color: var(--text-1);
  box-shadow: inset 0 0 0 1px var(--stroke-2);
}

.avatar-pick {
  position: relative;
  width: 74px; height: 74px; flex: none;
  border-radius: 50%;
  border: 1.5px dashed var(--stroke-2);
  background: var(--surface);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
}
.avatar-pick svg { width: 30px; height: 30px; }
.avatar-pick img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-plus {
  position: absolute; bottom: -2px; right: -2px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--grad-cta);
  color: #fff; font-size: 16px; font-weight: 800; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-0);
}

/* Onboarding */
.onboard {
  min-height: calc(100dvh - 120px);
  display: flex; flex-direction: column; justify-content: center;
}
.brand-mark { display: flex; align-items: center; justify-content: center; margin-bottom: 22px; }
.brand-mark svg { width: 84px; height: 84px; }
.brand-name {
  text-align: center; font-size: 34px; font-weight: 800; letter-spacing: -0.03em;
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-tag { text-align: center; color: var(--text-2); font-size: 14px; margin-top: 6px; line-height: 1.6; }
