/* Shaninan: Avot — app chrome + base screens. Mobile-first, designed at 390px. */

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ink); /* letterbox color beyond the app column */
  color: var(--ink-text);
  font-family: var(--ui);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 430px;
  margin: 0 auto;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--parchment);
  position: relative;
  overflow: hidden;
}

/* ---------- status bar ---------- */
#status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: calc(.6rem + env(safe-area-inset-top)) .9rem .6rem;
  background: var(--ink);
  color: var(--cream);
  flex: 0 0 auto;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--navy);
  color: var(--gold-pale);
  border: 1px solid rgba(182, 144, 71, .55);
  border-radius: 999px;
  padding: .3rem .7rem;
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .02em;
  white-space: nowrap;
}
.chip svg { width: 14px; height: 14px; display: block; }
.chip--league {
  font-family: var(--serif);
  font-size: .92rem;
  letter-spacing: .04em;
}
.chip--streak.is-cold { color: var(--cream-mute); border-color: rgba(183, 174, 156, .35); }

/* ---------- screen container ---------- */
#screen {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}

/* ---------- tab bar ---------- */
#tab-bar {
  flex: 0 0 auto;
  display: flex;
  background: var(--ink);
  border-top: 1px solid rgba(182, 144, 71, .3);
  padding-bottom: env(safe-area-inset-bottom);
}
#tab-bar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  padding: .55rem 0 .5rem;
  text-decoration: none;
  color: var(--cream-mute);
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: color .15s ease;
}
#tab-bar a svg { width: 22px; height: 22px; display: block; }
#tab-bar a.is-active { color: var(--gold-pale); }

/* route-driven chrome visibility */
body[data-route="splash"] #status-bar,
body[data-route="splash"] #tab-bar { display: none; }
body[data-route="lesson"] #tab-bar { display: none; }

/* ---------- shared bits ---------- */
.eyebrow {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold-label);
  margin: 0 0 .4rem;
}
.screen-pad { padding: 1.25rem 1.1rem 2rem; }
h1.screen-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.9rem;
  color: var(--ink);
  margin: 0 0 .25rem;
  line-height: 1.15;
}
.lead { color: #5C564B; font-size: .95rem; margin: 0 0 1.4rem; }

.btn-gold {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--gold);
  color: #2A1E08;
  border: none;
  padding: .9rem;
  border-radius: var(--radius);
  font-family: var(--ui);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background .15s ease, transform .1s ease;
}
.btn-gold:active { background: var(--gold-bright); transform: scale(.985); }
.btn-gold:disabled { opacity: .45; cursor: default; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: 0 4px 14px rgba(11, 12, 16, .06);
}

.he {
  font-family: var(--hebrew);
  direction: rtl;
  text-align: right;
  line-height: 1.8;
  color: var(--ink);
}

hr.rule { border: none; border-top: 1px solid var(--line); margin: 1.25rem 0; }

/* ---------- splash ---------- */
.splash {
  flex: 1;
  background: var(--ink);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem 1.5rem calc(2rem + env(safe-area-inset-bottom));
  position: relative;
  overflow: hidden;
}
.splash .he-bg {
  position: absolute;
  inset: 0;
  font-family: var(--hebrew);
  color: rgba(217, 184, 106, .06);
  font-size: 6.2rem;
  line-height: 1.2;
  letter-spacing: .4rem;
  user-select: none;
  pointer-events: none;
  word-break: break-all;
  padding: 1rem;
}
.splash > * { position: relative; }
.splash .wordmark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 3.2rem;
  letter-spacing: .01em;
  margin: 0;
  line-height: 1;
}
.splash .he-mark {
  font-family: var(--hebrew);
  color: var(--gold-pale);
  font-size: 1.35rem;
  margin-top: .45rem;
  letter-spacing: .15em;
}
.splash .tagline {
  color: var(--cream-mute);
  font-style: italic;
  font-family: var(--serif);
  font-size: 1.05rem;
  margin: 1rem 0 2.2rem;
}
.splash form { width: 100%; max-width: 300px; }
.splash input[type="text"] {
  width: 100%;
  background: var(--navy);
  border: 1px solid rgba(182, 144, 71, .55);
  border-radius: var(--radius);
  color: var(--cream);
  font-family: var(--ui);
  font-size: 1rem;
  padding: .85rem .9rem;
  margin-bottom: .8rem;
  text-align: center;
}
.splash input[type="text"]::placeholder { color: var(--cream-mute); }
.splash input[type="text"]:focus { outline: 2px solid var(--gold); outline-offset: 1px; }

/* ---------- path (perek game map) ---------- */
.path-screen { display: flex; flex-direction: column; }

/* perek header — ink hero with ambient letters */
.path-hero {
  position: relative;
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(201, 162, 75, .14), transparent 60%),
    var(--ink);
  color: var(--cream);
  text-align: center;
  padding: 1.35rem 1.2rem 1.45rem;
  overflow: hidden;
  flex: 0 0 auto;
}
.path-hero > * { position: relative; }
.path-hero .eyebrow { color: var(--gold-label); margin-bottom: .25rem; }
.path-hero-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  user-select: none;
}
.path-hero-ambient span {
  position: absolute;
  font-family: var(--hebrew);
  color: rgba(217, 184, 106, .07);
  line-height: 1;
}
.perek-he {
  font-family: var(--hebrew);
  font-weight: 700;
  font-size: 2.35rem;
  line-height: 1.1;
  margin: 0;
  color: var(--cream);
  direction: rtl;
}
.perek-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: .95rem;
  color: var(--cream-mute);
  margin: .15rem 0 .8rem;
}
.perek-progress {
  display: flex;
  align-items: center;
  gap: .7rem;
  max-width: 280px;
  margin: 0 auto;
}
.perek-progress-count {
  font-size: .78rem;
  font-weight: 600;
  color: var(--gold-pale);
  letter-spacing: .04em;
  white-space: nowrap;
}
.perek-progress-count strong { font-size: .92rem; }
.perek-progress-track {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: rgba(239, 230, 212, .16);
  overflow: hidden;
}
.perek-progress-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--gold-pale));
  box-shadow: 0 0 6px rgba(201, 162, 75, .8);
  transition: width .5s ease;
}

/* perek selector — chevrons either side of the perek letter */
.perek-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  margin: 0 auto .8rem;
  max-width: 320px;
}
.perek-nav-center { flex: 1; min-width: 0; }
.perek-nav .perek-sub { margin-bottom: 0; }
.perek-nav-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(201, 162, 75, .45);
  background: rgba(201, 162, 75, .08);
  color: var(--gold-pale);
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.perek-nav-btn svg { width: 20px; height: 20px; }
.perek-nav-btn:hover:not(:disabled) { background: rgba(201, 162, 75, .18); }
.perek-nav-btn:active:not(:disabled) { transform: scale(.92); }
.perek-nav-btn:disabled {
  opacity: .28;
  cursor: default;
  border-color: rgba(239, 230, 212, .18);
  color: var(--cream-mute);
}

/* Kinyan Torah — the bonus unit wears extra gold trim */
.path-hero--bonus {
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(201, 162, 75, .26), transparent 62%),
    var(--ink);
  border-bottom: 2px solid rgba(201, 162, 75, .55);
  box-shadow: inset 0 -10px 24px -16px rgba(217, 184, 106, .55);
}
.path-hero--bonus .perek-he { color: var(--gold-pale); }
.perek-bonus-tag {
  display: inline-block;
  font-family: var(--ui);
  font-style: normal;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink);
  background: linear-gradient(120deg, var(--gold), var(--gold-pale));
  border-radius: 999px;
  padding: .12rem .5rem;
  vertical-align: 1px;
}

/* locked-perek note above the padlocked map */
.perek-locked-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  margin: .9rem 1.2rem 0;
  padding: .55rem .9rem;
  border: 1px dashed rgba(176, 139, 67, .5);
  border-radius: var(--radius);
  background: rgba(176, 139, 67, .07);
  color: var(--gold-label);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-align: center;
}
.perek-locked-note svg { width: 15px; height: 15px; flex: 0 0 auto; }

/* "coming soon" scroll — perek file not authored yet (never a crash) */
.perek-soon {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.6rem 2rem 3.2rem;
  animation: soon-in .3s ease both;
}
.perek-soon .eyebrow { color: var(--gold-label); }
.soon-medallion {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  margin-bottom: 1.1rem;
  background:
    radial-gradient(circle at 32% 28%, rgba(217, 184, 106, .35), transparent 58%),
    var(--navy);
  border: 2px solid rgba(201, 162, 75, .55);
  box-shadow: var(--shadow-soft);
}
.soon-medallion.is-locked { border-style: dashed; opacity: .75; }
.soon-he {
  font-family: var(--hebrew);
  font-weight: 700;
  font-size: 2.6rem;
  color: var(--gold-pale);
  line-height: 1;
}
.soon-title {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--ink-text);
  margin: .1rem 0 .35rem;
}
.soon-note {
  max-width: 300px;
  color: #5C564B;
  font-size: .92rem;
  line-height: 1.5;
  margin: 0;
}
@keyframes soon-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .perek-soon { animation: none; }
  .perek-nav-btn { transition: none; }
}

/* the map canvas */
.path-map {
  position: relative;
  background:
    radial-gradient(140% 60% at 50% 0%, rgba(20, 24, 43, .05), transparent 55%),
    var(--parchment);
}
.path-vignette {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 110px;
  background: linear-gradient(rgba(11, 12, 16, .22), rgba(11, 12, 16, .07) 55%, transparent);
  pointer-events: none;
}
.path-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  user-select: none;
  overflow: hidden;
}
.path-ambient span {
  position: absolute;
  font-family: var(--hebrew);
  font-size: 8.5rem;
  line-height: 1;
  color: rgba(42, 38, 32, .045);
}
.path-trail {
  position: absolute;
  top: 0; left: 0;
  pointer-events: none;
}
.path-trail .trail-ink {
  fill: none;
  stroke: rgba(42, 38, 32, .28);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: .5 12;
}
.path-trail .trail-gold {
  fill: none;
  stroke: var(--gold);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: .5 11;
  filter: drop-shadow(0 1px 2px rgba(140, 110, 47, .35));
}

/* node geometry */
.map-node {
  position: absolute;
  transform: translate(-50%, 0);
}
.node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  margin-top: -33px; /* center the 66px disc on the trail point */
  font-family: var(--ui);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.node--locked { cursor: default; }
.node-disc {
  position: relative;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .12s ease;
}
.node:not(.node--locked):active .node-disc { transform: scale(.94); }
.node-num, .seal-num {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1;
}

/* labels under each node */
.node-label {
  margin-top: .45rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .1rem;
  width: 120px;
  text-align: center;
  pointer-events: none;
}
.node-ref {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: #8A8170;
  background: rgba(239, 230, 212, .92); /* lift the label off the dotted trail */
  border-radius: 999px;
  padding: .05rem .4rem;
}
.node--mastered .node-ref { color: var(--gold-label); }
.node--current .node-ref { color: var(--ink); }
.node--locked .node-ref { color: #A89F8C; }
.node-tanna {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: .92rem;
  line-height: 1.2;
  color: var(--ink);
  background: rgba(239, 230, 212, .85);
  border-radius: 6px;
  padding: 0 .3rem;
}

/* mastered — gold wax seal, stamped */
.node--mastered .node-disc {
  background: radial-gradient(circle at 35% 28%, var(--gold-pale), var(--gold) 58%, #8C6E2F 100%);
  border-radius: 46% 54% 51% 49% / 53% 47% 55% 45%; /* irregular wax edge */
  transform: rotate(var(--stamp, 0deg));
  box-shadow:
    var(--shadow-seal),
    inset 0 2px 3px rgba(255, 246, 222, .55),
    inset 0 -3px 5px rgba(58, 42, 8, .35);
  color: #3A2A08;
}
.node--mastered .node-disc::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: inherit;
  border: 1.5px solid rgba(58, 42, 8, .35);
  box-shadow: 0 1px 0 rgba(255, 246, 222, .35);
}
.node--mastered .seal-num {
  text-shadow: 0 1px 0 rgba(255, 246, 222, .45), 0 -1px 1px rgba(58, 42, 8, .4);
}
.node--mastered:not(.node--locked):active .node-disc {
  transform: rotate(var(--stamp, 0deg)) scale(.94);
}

/* current — glowing gold ring, soft pulse */
.node--current .node-disc,
.node--open .node-disc {
  background: var(--parchment);
  border: 3px solid var(--gold-bright);
  color: var(--ink);
  box-shadow:
    0 0 0 5px rgba(201, 162, 75, .18),
    0 0 16px rgba(201, 162, 75, .5),
    var(--shadow-soft);
}
.node--current .node-disc { animation: node-pulse 2.4s ease-in-out infinite; }
@keyframes node-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 4px rgba(201, 162, 75, .16),
      0 0 12px rgba(201, 162, 75, .4),
      var(--shadow-soft);
  }
  50% {
    box-shadow:
      0 0 0 8px rgba(201, 162, 75, .26),
      0 0 22px rgba(201, 162, 75, .65),
      var(--shadow-soft);
  }
}

/* locked — dimmed ink medallion with padlock (opaque: hides the trail behind it) */
.node--locked .node-disc {
  background: linear-gradient(165deg, #DDD6C6, #D1CABA);
  border: 2px solid rgba(20, 24, 43, .12);
  color: rgba(42, 38, 32, .42);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, .35);
}
.node--locked .node-disc svg { width: 20px; height: 20px; }

/* wiggle-deny on locked tap */
.node-disc.deny { animation: deny-shake .38s ease; }
@keyframes deny-shake {
  20% { transform: translateX(-4px) rotate(-2deg); }
  40% { transform: translateX(4px) rotate(2deg); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}
.node--mastered .node-disc.deny { animation: none; }

/* chazara checkpoint — larger flame medallion */
.node--checkpoint { margin-top: -43px; }
.node--checkpoint .node-disc {
  width: 86px;
  height: 86px;
}
.node--checkpoint .node-disc svg { width: 38px; height: 38px; }
.node--checkpoint.node--open .node-disc {
  background:
    radial-gradient(circle at 50% 28%, rgba(217, 184, 106, .25), transparent 62%),
    var(--navy);
  border: 3px solid var(--gold-bright);
  color: var(--gold-pale);
  box-shadow:
    0 0 0 6px rgba(201, 162, 75, .16),
    0 0 22px rgba(201, 162, 75, .55),
    var(--shadow-soft);
}
.node--checkpoint.node--open .node-disc::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px solid rgba(217, 184, 106, .5);
}
.node--checkpoint.node--locked .node-disc {
  background: linear-gradient(165deg, #DED7C8, #D2CBBC);
  border: 2px dashed rgba(20, 24, 43, .22);
  color: rgba(42, 38, 32, .35);
  box-shadow: none;
}
.node--checkpoint .node-label { width: 160px; }
.node--checkpoint .node-ref {
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.node--checkpoint.node--open .node-ref { color: var(--gold-label); }

/* chazara stub screen */
.chazara-stub .he-inline {
  font-family: var(--hebrew);
  color: var(--gold-label);
  font-size: 1.5rem;
}

@media (prefers-reduced-motion: reduce) {
  .node--current .node-disc { animation: none; }
  .node-disc.deny { animation: none; }
  .node-disc, .perek-progress-fill { transition: none; }
  .feedback-band, .peek-overlay, .peek-sheet, .summary-seal { animation: none; }
  .xp-toast { animation: xp-float 1.35s step-end forwards; }
  .lesson-progress i, .tile, .intro-dots .dot { transition: none; }
  .choice, .tanna-card { transition: none; }
  /* M5 juice — every motion effect stands down */
  .fx-tap, .fx-shake, .spark-burst .spark { animation: none !important; }
  .combo-meter, .combo-meter.is-hot, .combo-meter.is-bump, .combo-meter.is-break { animation: none !important; }
  .combo-meter { transition: none; transform: none; }
  .node-disc.seal-stamp-in, .stat-num--xp.stat-pop { animation: none !important; }
  /* the flashing countdown stops pulsing but the numeral stays legible */
  .flash-count .fc-num.fc-pulse { animation: none !important; }
  #screen.screen-enter { animation: none !important; }
  /* M7 — leaderboard + tier-cross motion stands down */
  .lb-loading-dot { animation: none; }
  .summary-tiercross { animation: none; }
  .lb-tab { transition: none; }
}

/* ---------- lesson runner ---------- */
body[data-route="lesson"] #screen { overflow: hidden; }
.lesson-screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* intro card — swipeable pages: mishnah + Kulp, then Rashi */
.intro-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-top: .5rem; }
.intro-pager {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.intro-pager::-webkit-scrollbar { display: none; }
.intro-page {
  flex: 0 0 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  overflow-y: auto;
  padding: .75rem 1.15rem 1rem;
}
.intro-tanna {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.55rem;
  color: var(--ink);
  margin: 0;
  line-height: 1.15;
}
.intro-tanna-he {
  font-family: var(--hebrew);
  color: var(--gold-label);
  font-size: 1rem;
  margin: .1rem 0 .9rem;
}
.mishnah-frame {
  position: relative;
  font-size: 1.35rem;
  line-height: 2;
  padding: 1.15rem 1.25rem;
  border-radius: 12px;
  background: linear-gradient(180deg, #F6EEDD, var(--parchment));
  border: 1px solid var(--gold);
  box-shadow: 0 6px 18px rgba(11, 12, 16, .07);
}
.mishnah-frame::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 8px;
  border: 1px solid rgba(182, 144, 71, .35);
  pointer-events: none;
}
.intro-sub { margin-top: 1.15rem; }
.intro-en { color: var(--ink-text); font-size: .95rem; line-height: 1.65; margin: .15rem 0 0; }
.rashi-point { border-right: 3px solid var(--gold); padding-right: .9rem; margin: 1.1rem 0 1.3rem; }
.rashi-he { font-size: 1.12rem; line-height: 1.9; margin: 0 0 .45rem; }
.rashi-en { color: #5C564B; font-size: .9rem; line-height: 1.6; margin: 0; }
.intro-dots { display: flex; justify-content: center; gap: .45rem; padding: .6rem 0 .2rem; flex: 0 0 auto; }
.intro-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: var(--line);
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.intro-dots .dot.is-on { background: var(--gold); transform: scale(1.3); }
.intro-actions { flex: 0 0 auto; padding: .6rem 1.15rem calc(1rem + env(safe-area-inset-bottom)); }
.btn-gold small {
  display: block;
  font-weight: 500;
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .7;
  margin-top: .2rem;
}

/* lesson top bar — X · gold progress · combo meter · counter · peek */
.lesson-top { flex: 0 0 auto; display: flex; align-items: center; gap: .6rem; padding: .75rem .9rem .55rem; }
.lesson-x { background: none; border: none; padding: .3rem; color: #8A8170; cursor: pointer; display: flex; }
.lesson-x svg { width: 18px; height: 18px; }
.lesson-progress { flex: 1; height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.lesson-progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--gold-pale));
  box-shadow: 0 0 6px rgba(201, 162, 75, .7);
  transition: width .35s ease;
}
.lesson-count {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--gold-label);
  white-space: nowrap;
}
/* combo meter — DECORATION ONLY: the real streak number, big in the center */
.combo-meter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  background: var(--navy);
  border: 1.5px solid rgba(182, 144, 71, .65);
  border-radius: 50%;
}
.combo-meter b {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--gold-pale);
  font-variant-numeric: tabular-nums;
}
.combo-meter[hidden] { display: none; }
.peek-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: transparent;
  border: 1.5px solid var(--gold);
  color: var(--gold-label);
  border-radius: 999px;
  padding: .28rem .65rem;
  font-family: var(--ui);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  cursor: pointer;
}
.peek-btn svg { width: 13px; height: 13px; }
.peek-btn:disabled { opacity: .4; cursor: default; }

/* exercise framework — stage holds the countdown + an ex-host the exercise owns */
.exercise-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ex-host { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ex-body { flex: 1; min-height: 0; overflow-y: auto; padding: .4rem 1.15rem .8rem; }
.ex-prompt { font-weight: 600; font-size: 1.02rem; color: var(--ink); margin: .1rem 0 1.1rem; }
.ex-footer { flex: 0 0 auto; padding: .7rem 1.15rem calc(.9rem + env(safe-area-inset-bottom)); }

/* tiles (word bank + cloze choices) — key-cap depth, Frank Ruhl */
.tile {
  font-family: var(--hebrew);
  font-size: 1.18rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-bottom: 3px solid #D0C5AC;
  border-radius: 10px;
  padding: .38rem .8rem .3rem;
  cursor: pointer;
  transition: transform .08s ease, opacity .15s ease;
}
.tile:active { transform: translateY(2px); border-bottom-width: 1px; }
.tile.is-used { opacity: .22; pointer-events: none; }

/* word bank */
.wb-strip {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: .45rem;
  min-height: 104px;
  padding: .65rem;
  margin-bottom: 1.15rem;
  background: var(--parchment-2);
  border: 1px dashed rgba(182, 144, 71, .55);
  border-radius: 12px;
}
.wb-bank { display: flex; flex-wrap: wrap; gap: .5rem; }

/* flashing-number countdown — the v2 clock: a big gold numeral pulsing once
   per second. NO draining ring, NO bar. Red-tinted on the last 3 seconds. */
.flash-count {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  pointer-events: none;
}
.flash-count .fc-num {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--gold);
  text-shadow: 0 0 14px rgba(201, 162, 75, .45);
  font-variant-numeric: tabular-nums;
}
.flash-count.is-urgent .fc-num {
  color: var(--red);
  text-shadow: 0 0 14px rgba(192, 57, 43, .4);
}
.fc-num.fc-pulse { animation: fc-pulse .55s cubic-bezier(.2, .9, .35, 1); }
@keyframes fc-pulse {
  0% { transform: scale(1.35); opacity: .55; }
  100% { transform: scale(1); opacity: 1; }
}

/* gate screen — the cloze warning card; the sentence stays hidden until Go */
.gate-screen {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem 1.15rem calc(1.4rem + env(safe-area-inset-bottom));
}
.gate-card {
  width: 100%;
  max-width: 330px;
  text-align: center;
  background: linear-gradient(180deg, #F6EEDD, var(--parchment));
  border: 1px solid var(--gold);
  border-radius: 14px;
  padding: 1.6rem 1.3rem 1.4rem;
  box-shadow: 0 8px 24px rgba(11, 12, 16, .1);
}
.gate-line {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.45rem;
  line-height: 1.3;
  color: var(--ink);
  margin: .5rem 0 1.3rem;
}
.gate-go { max-width: 200px; margin: 0 auto; }

/* cloze — gold-underline gap in the line */
.cloze-line { font-size: 1.32rem; line-height: 2.2; margin: .4rem 0 0; }
.cloze-gap {
  display: inline-block;
  min-width: 92px;
  margin: 0 .25rem;
  padding: 0 .4rem;
  background: none;
  border: none;
  border-bottom: 2.5px solid var(--gold);
  border-radius: 0;
  font-family: var(--hebrew);
  font-size: 1.32rem;
  line-height: 1.6;
  color: var(--ink);
  vertical-align: bottom;
  text-align: center;
  cursor: pointer;
}
.cloze-choices { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }

/* feedback band — the ONLY green/red use in the app */
.feedback-band {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: .95rem 1.15rem calc(1rem + env(safe-area-inset-bottom));
  border-radius: 18px 18px 0 0;
  color: #fff;
  box-shadow: 0 -10px 30px rgba(11, 12, 16, .25);
  animation: band-up .28s cubic-bezier(.2, .9, .3, 1.15);
}
.feedback-band.is-correct { background: var(--green); }
.feedback-band.is-wrong { background: var(--red); }
@keyframes band-up { from { transform: translateY(100%); } }
.fb-head { display: flex; align-items: center; gap: .55rem; font-size: 1.06rem; margin-bottom: .65rem; }
.fb-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  flex: 0 0 auto;
}
.fb-icon svg { width: 15px; height: 15px; }
.fb-xp { margin-left: auto; font-weight: 800; font-size: 1rem; }
.fb-label {
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .85;
  margin: 0 0 .3rem;
}
.fb-answer {
  background: rgba(255, 255, 255, .16);
  border-radius: 10px;
  padding: .55rem .7rem;
  font-size: .92rem;
  line-height: 1.55;
  margin-bottom: .8rem;
  white-space: pre-line;
}
.fb-answer.he { font-family: var(--hebrew); font-size: 1.08rem; line-height: 1.9; color: #fff; }
.btn-band {
  display: block;
  width: 100%;
  background: #fff;
  border: none;
  border-radius: 12px;
  padding: .8rem;
  font-family: var(--ui);
  font-weight: 800;
  font-size: .98rem;
  cursor: pointer;
}
.feedback-band.is-correct .btn-band { color: var(--green); }
.feedback-band.is-wrong .btn-band { color: var(--red); }

/* +XP toast */
.xp-toast {
  position: absolute;
  left: 50%;
  bottom: 178px;
  transform: translateX(-50%);
  z-index: 40;
  background: var(--navy);
  color: var(--gold-pale);
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: .4rem .95rem;
  font-weight: 800;
  font-size: .95rem;
  pointer-events: none;
  animation: xp-float 1.35s ease forwards;
}
@keyframes xp-float {
  0% { opacity: 0; transform: translate(-50%, 14px) scale(.9); }
  18% { opacity: 1; transform: translate(-50%, 0) scale(1.05); }
  32% { transform: translate(-50%, -2px) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -34px); }
}

/* peek overlay — the sanctioned re-appearance of the study text */
.peek-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(11, 12, 16, .55);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  animation: fade-in .2s ease;
}
@keyframes fade-in { from { opacity: 0; } }
.peek-sheet {
  background: var(--parchment);
  border-radius: 18px 18px 0 0;
  max-height: 88%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -16px 40px rgba(11, 12, 16, .4);
  animation: band-up .25s ease;
}
.peek-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1.15rem .3rem;
  flex: 0 0 auto;
}
.peek-head .eyebrow { margin: 0; }
.peek-close { background: none; border: none; color: #8A8170; padding: .25rem; cursor: pointer; display: flex; }
.peek-close svg { width: 16px; height: 16px; }
.peek-body { overflow-y: auto; min-height: 0; padding: .5rem 1.15rem .6rem; }
.peek-foot { flex: 0 0 auto; padding: .6rem 1.15rem calc(.9rem + env(safe-area-inset-bottom)); }

/* lesson summary — the ink hero moment */
.lesson-summary {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.6rem calc(2rem + env(safe-area-inset-bottom));
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(201, 162, 75, .16), transparent 60%),
    var(--ink);
  color: var(--cream);
}
.summary-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 2rem;
  margin: .1rem 0 .4rem;
  color: var(--cream);
}
.summary-note { color: var(--cream-mute); font-size: .92rem; max-width: 300px; margin: 0 0 1.6rem; }
.lesson-summary .btn-gold { max-width: 300px; }
.summary-seal {
  width: 84px;
  height: 84px;
  margin-bottom: 1.2rem;
  background: radial-gradient(circle at 35% 28%, var(--gold-pale), var(--gold) 58%, #8C6E2F 100%);
  border-radius: 46% 54% 51% 49% / 53% 47% 55% 45%;
  box-shadow:
    var(--shadow-seal),
    inset 0 2px 3px rgba(255, 246, 222, .55),
    inset 0 -3px 5px rgba(58, 42, 8, .35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3A2A08;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.9rem;
  animation: seal-stamp .45s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes seal-stamp {
  0% { transform: scale(1.6) rotate(-6deg); opacity: 0; }
  60% { transform: scale(.95); opacity: 1; }
}
.summary-stats { display: flex; gap: 2.4rem; margin: .9rem 0 1.1rem; }
.summary-stats .stat { display: flex; flex-direction: column; align-items: center; }
.stat-num { font-family: var(--serif); font-weight: 700; font-size: 2.3rem; color: var(--gold-pale); line-height: 1.1; }
.stat-lbl {
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cream-mute);
  margin-top: .2rem;
}
.stat-num--xp { min-width: 3.2ch; } /* the odometer must not reflow its neighbors */

/* score over the visible lesson maximum — "1,180 / 1,500" */
.summary-outof {
  font-size: .92rem;
  color: var(--cream-mute);
  font-variant-numeric: tabular-nums;
  margin: -.4rem 0 1.1rem;
}
.summary-outof b { color: var(--gold-pale); font-weight: 800; }

/* perfect-lesson badge — gold owns the celebration */
.perfect-badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  background: linear-gradient(160deg, var(--gold-bright), var(--gold));
  color: #2A1F08;
  border: 1px solid var(--gold-pale);
  border-radius: 999px;
  padding: .35rem 1rem;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .03em;
  margin: 0 0 .9rem;
  box-shadow: 0 0 18px rgba(201, 162, 75, .45);
}
.perfect-badge b { font-weight: 800; }
.perfect-badge .pb-star { font-size: .95rem; line-height: 1; }

/* summary detail lines — best streak (decoration recap) */
.summary-lines {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .45rem;
  margin: 0 0 1.3rem;
}
.sum-line {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  background: var(--navy);
  border: 1px solid rgba(182, 144, 71, .45);
  border-radius: 999px;
  padding: .35rem .9rem;
  color: var(--cream-mute);
  font-size: .8rem;
  font-weight: 600;
}
.sum-line svg { width: 13px; height: 13px; color: var(--gold-pale); flex: 0 0 auto; }
.sum-line b { color: var(--gold-pale); font-weight: 800; }

/* ---------- who said it — quote frame + tanna collectible cards ---------- */
.wsi-quote {
  position: relative;
  font-size: 1.22rem;
  line-height: 2;
  padding: 1rem 1.15rem;
  border-radius: 12px;
  background: linear-gradient(180deg, #F6EEDD, var(--parchment));
  border: 1px solid var(--gold);
  box-shadow: 0 6px 18px rgba(11, 12, 16, .07);
  margin-bottom: 1.15rem;
}
.wsi-quote::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 8px;
  border: 1px solid rgba(182, 144, 71, .35);
  pointer-events: none;
}
.tanna-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.tanna-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  text-align: center;
  background: #fff;
  border: 1.5px solid var(--gold);
  border-radius: 14px;
  box-shadow: 0 3px 10px rgba(11, 12, 16, .08);
  cursor: pointer;
  font-family: var(--ui);
  transition: transform .1s ease, box-shadow .15s ease, border-color .15s ease;
}
.tanna-card:not(.is-locked):active { transform: scale(.97); }
.tanna-band {
  display: block;
  background: linear-gradient(180deg, #1B2138, var(--navy));
  color: var(--gold-pale);
  font-family: var(--hebrew);
  font-size: 1rem;
  line-height: 1.3;
  padding: .5rem .4rem .45rem;
  border-bottom: 1px solid rgba(182, 144, 71, .6);
}
.tanna-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .2rem;
  padding: .6rem .55rem .7rem;
}
.tanna-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  color: var(--ink);
}
.tanna-era {
  font-size: .67rem;
  line-height: 1.4;
  color: #857E70;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tanna-card.is-locked { cursor: default; }
/* answer reveal — green/red is correct/wrong feedback ONLY */
.tanna-card.is-correct {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(30, 138, 76, .25), 0 3px 10px rgba(11, 12, 16, .08);
}
.tanna-card.is-correct .tanna-band { background: var(--green); color: #fff; border-bottom-color: rgba(255, 255, 255, .3); }
.tanna-card.is-wrong {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(192, 57, 43, .22), 0 3px 10px rgba(11, 12, 16, .08);
}
.tanna-card.is-wrong .tanna-band { background: var(--red); color: #fff; border-bottom-color: rgba(255, 255, 255, .3); }

/* ---------- lettered choice cards (mcq — plain · rashi flavors) ---------- */
.mcq-q { font-family: var(--serif); font-size: 1.18rem; line-height: 1.4; }
.quiz-choices { display: flex; flex-direction: column; gap: .65rem; }
.choice {
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1.5px solid var(--line);
  border-bottom-width: 3px;
  border-radius: 13px;
  padding: .8rem .85rem;
  font-family: var(--ui);
  font-weight: 600;
  font-size: .9rem;
  line-height: 1.4;
  color: var(--ink-text);
  cursor: pointer;
  transition: border-color .12s ease, box-shadow .12s ease, transform .08s ease;
}
.choice:not(.is-locked):active { transform: translateY(1px); }
.choice-key {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--navy);
  color: var(--gold-pale);
  font-weight: 800;
  font-size: .8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.choice-label { flex: 1; min-width: 0; }
.choice.is-selected { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(182, 144, 71, .3); }
.choice.is-locked { pointer-events: none; }
/* answered states — green/red is correct/wrong feedback ONLY */
.choice.is-correct { border-color: var(--green); background: #E6F4EC; box-shadow: none; }
.choice.is-correct .choice-key { background: var(--green); color: #fff; }
.choice.is-wrong { border-color: var(--red); background: #F8E9E7; box-shadow: none; }
.choice.is-wrong .choice-key { background: var(--red); color: #fff; }

/* rationale line in the feedback band (mcq why) */
.fb-why {
  font-size: .8rem;
  line-height: 1.5;
  opacity: .95;
  margin: 0 0 .8rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- placeholder screens ---------- */
.placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
}
.placeholder .glyph {
  font-family: var(--hebrew);
  font-size: 2.6rem;
  color: var(--gold);
  margin-bottom: .6rem;
}
.placeholder .note { color: #857E70; font-size: .85rem; max-width: 280px; }

/* ---------- profile ---------- */
.profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .92rem;
}
.profile-row:last-child { border-bottom: none; }
.profile-row .k { font-weight: 600; color: var(--ink-text); }
.profile-row .v { color: #5C564B; }
.toggle {
  appearance: none;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  cursor: pointer;
  transition: background .15s ease;
  flex: 0 0 auto;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(11, 12, 16, .25);
  transition: left .15s ease;
}
.toggle:checked { background: var(--gold); }
.toggle:checked::after { left: 23px; }
.attribution { font-size: .72rem; color: #857E70; margin-top: 1.2rem; line-height: 1.5; }

/* personal code + chavurah forms (M6 backend) */
.section-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--ink-text);
  margin: 1.4rem 0 .6rem;
}
.code-row { display: flex; align-items: center; gap: .6rem; margin: 0 0 1.4rem; }
.code-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .95rem;
  letter-spacing: .12em;
  color: var(--ink-text);
  background: rgba(182, 144, 71, .14);
  border: 1px solid rgba(182, 144, 71, .45);
  border-radius: 8px;
  padding: .25rem .55rem;
}
.code-chip--sm { font-size: .8rem; padding: .15rem .45rem; }
.btn-copy {
  font: 600 .78rem var(--ui);
  color: var(--gold-label);
  background: none;
  border: 1px solid rgba(182, 144, 71, .45);
  border-radius: 8px;
  padding: .3rem .6rem;
  cursor: pointer;
}
.btn-copy:active { background: rgba(182, 144, 71, .14); }
.btn-copy--sm { font-size: .68rem; padding: .2rem .45rem; }
.chav-invite { display: inline-flex; align-items: center; gap: .4rem; }
.profile-league { display: inline-flex; align-items: center; gap: .4rem; }
.profile-league b { color: var(--ink); font-weight: 700; }
.btn-link {
  font: 600 .9rem var(--ui);
  color: var(--gold-label);
  background: none;
  border: none;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}
.chavurah-form { display: flex; gap: .5rem; margin-top: .7rem; }
.chavurah-form input[type="text"] {
  flex: 1;
  min-width: 0;
  font: 500 .92rem var(--ui);
  color: var(--ink-text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .55rem .7rem;
}
.chavurah-form input[type="text"]:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.btn-gold.btn-inline { width: auto; padding: .55rem 1rem; font-size: .85rem; }
.form-status { font-size: .8rem; color: #5C564B; min-height: 1.1em; margin: .6rem 0 0; }
.form-status.is-error { color: var(--red, #C0392B); }
.card .note { color: #857E70; font-size: .85rem; }

/* ---------- magic-link sign-in (additive — anonymous play never gated) ---------- */
.auth-card { margin-top: 1rem; }
.auth-card .btn-inline { margin-top: .9rem; }
.auth-card--in { border-color: rgba(182, 144, 71, .45); background: rgba(182, 144, 71, .07); }
.auth-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--ink);
  margin: 0 0 .3rem;
}
.auth-body { color: #5C564B; font-size: .88rem; line-height: 1.5; margin: 0; }
.auth-body b { color: var(--ink); font-weight: 700; }

.signin-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(11, 12, 16, .55);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  animation: fade-in .2s ease;
}
.signin-sheet {
  background: var(--parchment);
  border-radius: 18px 18px 0 0;
  max-height: 92%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -16px 40px rgba(11, 12, 16, .4);
  animation: band-up .25s ease;
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 560px) {
  .signin-overlay { justify-content: center; align-items: center; }
  .signin-sheet { border-radius: 18px; max-width: 420px; width: 92%; }
}
.signin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.15rem .2rem;
}
.signin-head .eyebrow { margin: 0; }
.signin-body { padding: .4rem 1.15rem 1.15rem; }
.signin-body .auth-body { margin-bottom: 1rem; }
.signin-body input[type="email"] {
  width: 100%;
  font: 500 1rem var(--ui);
  color: var(--ink-text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .7rem .8rem;
  margin-bottom: .8rem;
}
.signin-body input[type="email"]:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.signin-sent { text-align: center; padding: .6rem 0 .2rem; }
.signin-sent-seal {
  width: 54px;
  height: 54px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, var(--gold-pale), var(--gold) 62%, #8C6E2F 100%);
  box-shadow: var(--shadow-seal), inset 0 2px 3px rgba(255, 246, 222, .5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2A1E08;
  font-weight: 800;
  font-size: 1.5rem;
}
.signin-sent .btn-gold { margin-top: 1.1rem; }

/* ---------- M5 juice — motion layer (gold owns ALL the energy) ---------- */

/* screen transitions — subtle parchment slide/fade between routes (~200ms) */
#screen.screen-enter { animation: screen-in .2s ease; }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } }

/* tap bounce — quick spring on tiles/cards/choices */
.fx-tap { animation: fx-tap .14s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes fx-tap {
  35% { transform: scale(.94); }
  100% { transform: scale(1); }
}

/* wrong-answer shake — 4px, 3 gentle oscillations, never punishing */
.fx-shake { animation: fx-shake .4s ease; }
@keyframes fx-shake {
  15% { transform: translateX(-4px); }
  30% { transform: translateX(4px); }
  45% { transform: translateX(-4px); }
  60% { transform: translateX(4px); }
  80% { transform: translateX(-2px); }
}

/* gold-spark particle burst — 8–14 sparks, self-cleaning in <650ms */
.spark-burst {
  position: absolute;
  width: 0;
  height: 0;
  z-index: 60;
  pointer-events: none;
}
.spark-burst .spark {
  position: absolute;
  left: -3px;
  top: -3px;
  width: 6px;
  height: 6px;
  background: linear-gradient(135deg, var(--gold-pale), var(--gold));
  border-radius: 1.5px;
  box-shadow: 0 0 6px rgba(201, 162, 75, .85);
  opacity: 0;
  animation: spark-fly .55s cubic-bezier(.15, .85, .45, 1) forwards;
}
@keyframes spark-fly {
  0% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(.35); }
}

/* combo meter motion — bumps on streaks, glows when hot, breaks gray.
   Decoration only: it celebrates the run, it never pays. */
.combo-meter {
  transform-origin: center;
  transition: transform .18s cubic-bezier(.34, 1.56, .64, 1);
}
.combo-meter.is-hot {
  border-color: var(--gold-bright);
  animation: combo-glow 1.5s ease-in-out infinite;
}
@keyframes combo-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 162, 75, 0), 0 0 5px rgba(201, 162, 75, .3); }
  50% { box-shadow: 0 0 0 4px rgba(201, 162, 75, .15), 0 0 14px rgba(201, 162, 75, .75); }
}
.combo-meter.is-bump { animation: combo-bump .26s cubic-bezier(.34, 1.56, .64, 1); }
.combo-meter.is-hot.is-bump {
  animation:
    combo-bump .26s cubic-bezier(.34, 1.56, .64, 1),
    combo-glow 1.5s ease-in-out infinite;
}
@keyframes combo-bump {
  0% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.combo-meter.is-break { animation: combo-break .45s ease both; }
@keyframes combo-break {
  0% { filter: saturate(.1) brightness(.85); transform: scale(.8); opacity: .9; }
  100% { filter: saturate(.1) brightness(.85); transform: scale(.68); opacity: 0; }
}

/* wax-seal stamp-in — the node's seal slams onto the path */
.node-disc.seal-stamp-in {
  animation: seal-stamp-in .5s cubic-bezier(.2, 1.3, .4, 1) both;
}
@keyframes seal-stamp-in {
  0% { transform: rotate(calc(var(--stamp, 0deg) - 9deg)) scale(1.9); opacity: 0; }
  55% { transform: rotate(var(--stamp, 0deg)) scale(.9); opacity: 1; }
  100% { transform: rotate(var(--stamp, 0deg)) scale(1); opacity: 1; }
}

/* XP odometer settle pop */
.stat-pop { animation: stat-pop .32s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes stat-pop {
  40% { transform: scale(1.16); }
}

/* ---------- M7 — league medallions (Avot 5:20) ---------- */
.league-medallion {
  display: inline-flex;
  width: var(--med-size, 28px);
  height: var(--med-size, 28px);
  flex: 0 0 auto;
  vertical-align: middle;
}
.league-medallion svg { width: 100%; height: 100%; display: block; }
.league-medallion .med-disc {
  fill: var(--navy);
  stroke: var(--gold);
  stroke-width: 2;
}
.league-medallion .med-ring {
  fill: none;
  stroke: rgba(201, 162, 75, .4);
  stroke-width: 1;
}
.league-medallion .med-art {
  fill: none;
  stroke: var(--gold-pale);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.league-medallion .med-art--fine { stroke-width: 1.25; }
.league-medallion .med-dot { fill: var(--gold-pale); stroke: none; }
/* resting/dim tier — keyline cools, art recedes; still gold family, never gray-blue */
.league-medallion.is-dim .med-disc { stroke: rgba(182, 144, 71, .35); fill: rgba(20, 24, 43, .55); }
.league-medallion.is-dim .med-ring { stroke: rgba(201, 162, 75, .14); }
.league-medallion.is-dim .med-art { stroke: rgba(217, 184, 106, .38); }
.league-medallion.is-dim .med-dot { fill: rgba(217, 184, 106, .38); }

/* status-bar league chip hosts a small medallion */
.chip--league { padding-left: .35rem; }
.chip--league .league-medallion { margin-right: .05rem; }

/* league progression strip — 4 medallions, gold hairline marching to the next tier */
.league-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
}
.ls-tier {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  position: relative;
}
.ls-tier .ls-th {
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--cream-mute);
  font-variant-numeric: tabular-nums;
}
.ls-tier.is-lit .ls-th { color: var(--gold-pale); }
.ls-tier.is-current .league-medallion {
  filter: drop-shadow(0 0 8px rgba(201, 162, 75, .55));
}
.ls-rail {
  flex: 1;
  max-width: 56px;
  height: 2px;
  margin: 0 .35rem 1rem;
  background: rgba(217, 184, 106, .18);
  border-radius: 999px;
  overflow: hidden;
}
.ls-rail i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-pale));
  box-shadow: 0 0 5px rgba(201, 162, 75, .8);
  border-radius: 999px;
}

/* ---------- M7 — leaderboard screen ---------- */
.lb-screen { flex: 1; display: flex; flex-direction: column; }
.lb-hero {
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(201, 162, 75, .14), transparent 60%),
    var(--ink);
  color: var(--cream);
  padding: 1.15rem 1.1rem 1.15rem;
  flex: 0 0 auto;
}
.lb-hero .eyebrow { color: var(--gold-label); margin-bottom: .65rem; }
.lb-hero-me { display: flex; align-items: center; gap: .8rem; }
.lb-hero-stats { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.lb-hero-league {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.45rem;
  line-height: 1.1;
  color: var(--cream);
}
.lb-hero-league .he-inline {
  font-family: var(--hebrew);
  font-style: normal;
  font-size: 1.05rem;
  color: var(--gold-pale);
}
.lb-hero-xp { font-size: .8rem; color: var(--cream-mute); }
.lb-hero-xp b { color: var(--gold-pale); font-size: .95rem; }
.lb-countdown {
  margin-left: auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  background: var(--navy);
  border: 1px solid rgba(182, 144, 71, .45);
  border-radius: 999px;
  padding: .28rem .65rem;
  font-size: .68rem;
  font-weight: 600;
  color: var(--cream-mute);
  white-space: nowrap;
}
.lb-countdown b { color: var(--gold-pale); font-weight: 800; }

/* tabs — gold underline on the active board */
.lb-tabs {
  display: flex;
  background: var(--parchment);
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.lb-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  padding: .75rem 0 .6rem;
  font: 700 .8rem var(--ui);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #8A8170;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.lb-tab[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--gold);
}

/* chavurah selector chips (only when the user has several) */
.lb-chavurot {
  display: flex;
  gap: .45rem;
  padding: .65rem 1.1rem 0;
  flex-wrap: wrap;
  flex: 0 0 auto;
}
.lb-chav-chip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .28rem .75rem;
  font: 600 .76rem var(--ui);
  color: #5C564B;
  cursor: pointer;
}
.lb-chav-chip.is-on {
  border-color: var(--gold);
  color: var(--ink);
  background: rgba(182, 144, 71, .12);
}

/* board body */
.lb-body { flex: 1 1 auto; padding: .8rem 1.1rem .4rem; }
.lb-loading {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #857E70;
  font-size: .85rem;
  padding: 1.2rem .2rem;
}
.lb-loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  animation: lb-breathe 1.1s ease-in-out infinite;
}
@keyframes lb-breathe { 50% { opacity: .25; transform: scale(.8); } }
.lb-offline {
  font-size: .72rem;
  color: #857E70;
  font-style: italic;
  margin: 0 0 .55rem;
}
.lb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.lb-row {
  display: flex;
  align-items: center;
  gap: .7rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .55rem .75rem;
}
.lb-row.is-you {
  border: 1.5px solid var(--gold);
  box-shadow: 0 0 0 2px rgba(182, 144, 71, .22), 0 3px 10px rgba(11, 12, 16, .07);
  background: linear-gradient(180deg, #FBF4E4, #F6EEDD);
}
.lb-rank {
  width: 30px;
  flex: 0 0 30px;
  text-align: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.05rem;
  color: #8A8170;
  font-variant-numeric: tabular-nums;
}
/* top-3 — parchment-and-gold wax medals (palette only: golds + parchment + navy) */
.lb-medal {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 46% 54% 51% 49% / 53% 47% 55% 45%;
  font-family: var(--hebrew);
  font-weight: 700;
  font-size: .85rem;
}
.lb-medal--1 {
  background: radial-gradient(circle at 35% 28%, var(--gold-pale), var(--gold) 58%, #8C6E2F 100%);
  color: #3A2A08;
  box-shadow: var(--shadow-seal), inset 0 1px 2px rgba(255, 246, 222, .55);
}
.lb-medal--2 {
  background: radial-gradient(circle at 35% 28%, #F2E9D5, #D9CDB2 58%, #A99A77 100%);
  color: #4A4131;
  box-shadow: 0 2px 6px rgba(140, 110, 47, .25), inset 0 1px 2px rgba(255, 252, 244, .6);
}
.lb-medal--3 {
  background: radial-gradient(circle at 35% 28%, #E9DEC6, #CBBD9C 58%, #97875F 100%);
  color: #463C28;
  box-shadow: 0 2px 5px rgba(140, 110, 47, .2), inset 0 1px 2px rgba(255, 250, 238, .5);
}
.lb-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .05rem; }
.lb-name {
  font-weight: 700;
  font-size: .92rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: .4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-you-tag {
  font: 700 .58rem var(--ui);
  font-style: normal;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold-label);
  background: rgba(182, 144, 71, .16);
  border-radius: 999px;
  padding: .08rem .4rem;
}
.lb-league-sub { font-size: .68rem; color: #8A8170; }
.lb-xp {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: .2rem;
}
.lb-xp i {
  font: 700 .58rem var(--ui);
  font-style: normal;
  letter-spacing: .08em;
  color: #8A8170;
}
.lb-row.is-you .lb-xp { color: var(--gold-label); }

/* empty / quiet states */
.lb-quiet { padding: 1.2rem .2rem; }
.lb-quiet .note { color: #857E70; font-size: .88rem; }
.lb-empty {
  text-align: center;
  padding: 1.6rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lb-empty-medallions { display: flex; gap: .55rem; margin-bottom: 1rem; }
.lb-empty-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--ink);
  margin: 0 0 .3rem;
}
.lb-empty .note { color: #857E70; font-size: .88rem; max-width: 280px; margin: 0 0 1.2rem; }
.lb-empty-btn { max-width: 280px; text-decoration: none; }

/* flavor footer — Avot 5:20 */
.lb-flavor {
  flex: 0 0 auto;
  text-align: center;
  padding: 1rem 1.3rem 1.4rem;
}
.lb-pasuk {
  font-size: .98rem;
  line-height: 1.8;
  color: #6B6354;
  margin: 0;
}
.lb-pasuk-src {
  font-family: var(--serif);
  font-style: italic;
  font-size: .74rem;
  color: #9A917E;
  margin: .25rem 0 0;
}

/* ---------- M7 — tier-cross moment on the lesson summary ---------- */
.summary-tiercross {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  margin: .2rem 0 1.1rem;
  animation: tier-stamp .55s cubic-bezier(.2, 1.35, .4, 1) both;
}
.summary-tiercross .league-medallion {
  filter: drop-shadow(0 0 14px rgba(201, 162, 75, .65));
}
.tc-he {
  font-family: var(--hebrew);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--gold-pale);
  margin: .2rem 0 0;
}
.tc-line { font-size: .88rem; color: var(--cream-mute); margin: 0; }
.tc-line b { color: var(--gold-pale); }
@keyframes tier-stamp {
  0% { transform: scale(1.7); opacity: 0; }
  60% { transform: scale(.94); opacity: 1; }
  100% { transform: scale(1); }
}

/* ---- M8: PWA install (gold chip in profile · one-time toast · iOS hint) ---- */
.install-row {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin: 0 0 1rem;
}
.install-chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-family: var(--ui);
  font-weight: 600;
  font-size: .88rem;
  letter-spacing: .02em;
  color: var(--ink);
  background: linear-gradient(160deg, var(--gold-bright), var(--gold));
  border: 1px solid var(--gold-pale);
  border-radius: 999px;
  padding: .42rem .95rem;
  cursor: pointer;
  box-shadow: var(--shadow-seal);
}
.install-chip svg { width: 15px; height: 15px; }
.install-chip:active { transform: translateY(1px); }
.install-chip-x {
  background: none;
  border: 0;
  color: var(--cream-mute);
  font-size: 1.1rem;
  line-height: 1;
  padding: .3rem .45rem;
  cursor: pointer;
}

/* subtle one-time toast — bottom, above the tab bar */
.install-toast {
  position: fixed;
  left: 50%;
  bottom: calc(64px + env(safe-area-inset-bottom, 0px) + .8rem);
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: .55rem;
  max-width: min(92vw, 380px);
  background: var(--navy);
  border: 1px solid rgba(201, 162, 75, .55);
  border-radius: 999px;
  padding: .45rem .5rem .45rem .95rem;
  box-shadow: var(--shadow-soft);
  animation: install-toast-in .35s cubic-bezier(.2, 1.2, .4, 1) both;
}
.install-toast.is-leaving { animation: install-toast-out .3s ease both; }
.install-toast-msg {
  font-family: var(--ui);
  font-size: .8rem;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.install-toast-btn {
  font-family: var(--ui);
  font-weight: 600;
  font-size: .78rem;
  color: var(--ink);
  background: var(--gold-bright);
  border: 0;
  border-radius: 999px;
  padding: .3rem .75rem;
  cursor: pointer;
  flex: 0 0 auto;
}
.install-toast-x {
  background: none;
  border: 0;
  color: var(--cream-mute);
  font-size: 1rem;
  line-height: 1;
  padding: .2rem .4rem;
  cursor: pointer;
  flex: 0 0 auto;
}
@keyframes install-toast-in {
  from { opacity: 0; transform: translate(-50%, 14px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes install-toast-out {
  to { opacity: 0; transform: translate(-50%, 10px); }
}
@media (prefers-reduced-motion: reduce) {
  .install-toast, .install-toast.is-leaving { animation: none; }
}

/* iOS Safari one-time Add-to-Home-Screen hint */
.ios-hint { margin-bottom: 1rem; }
.ios-hint-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink-text);
  margin: 0 0 .25rem;
}
.ios-hint-body {
  font-family: var(--ui);
  font-size: .84rem;
  color: var(--ink-text);
  margin: 0 0 .35rem;
}
.ios-hint-body svg {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  color: var(--gold-label);
}

/* ======================================================================
   m3 — viral invite loop (share buttons · join landing · nudges)
   Brand tokens only: ink/navy/parchment/gold/ink-text; green/red stay
   verdict-only. Mobile single-column, holds the visual bar.
   ====================================================================== */

/* ---------- share buttons (gold outline, used app-wide) ---------- */
.btn-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  width: 100%;
  margin-top: .7rem;
  padding: .7rem .9rem;
  font: 700 .9rem var(--ui);
  color: var(--gold-label);
  background: rgba(182, 144, 71, .08);
  border: 1px solid rgba(182, 144, 71, .45);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, transform .1s ease;
}
.btn-share:active { background: rgba(182, 144, 71, .18); transform: scale(.99); }
.btn-share svg { width: 17px; height: 17px; }
.btn-share--ghost {
  background: none;
  font-weight: 600;
  color: var(--gold-label);
}
.chav-block { padding: .2rem 0; }
.chav-block + .chav-block { border-top: 1px solid var(--line); margin-top: .2rem; }
.chav-block .btn-share { margin-top: .35rem; margin-bottom: .35rem; }

/* subtle referral earnings line in profile */
.ref-earn {
  font: 600 .82rem var(--ui);
  color: var(--gold-label);
  background: rgba(182, 144, 71, .07);
  border: 1px solid rgba(182, 144, 71, .3);
  border-radius: 10px;
  padding: .5rem .65rem;
  margin: .6rem 0 .2rem;
  line-height: 1.45;
}
.ref-earn b { color: var(--ink); font-weight: 800; }

/* ---------- brand toast (copy-link fallback) ---------- */
.invite-toast {
  position: fixed;
  left: 50%;
  bottom: calc(76px + env(safe-area-inset-bottom));
  transform: translate(-50%, 14px);
  z-index: 260;
  max-width: 86%;
  padding: .65rem 1rem;
  font: 600 .85rem var(--ui);
  color: #2A1E08;
  background: var(--gold);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(11, 12, 16, .28);
  opacity: 0;
  transition: opacity .22s ease, transform .22s ease;
  pointer-events: none;
}
.invite-toast.is-in { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) {
  .invite-toast { transition: opacity .22s ease; transform: translate(-50%, 0); }
}

/* ---------- post-seal share affordances ---------- */
.summary-share {
  width: 100%;
  max-width: 300px;
  margin: .6rem auto 0;
}
.seal-share {
  color: #2A1E08;
  background: var(--gold);
  border-color: var(--gold);
}
.seal-share:active { background: var(--gold-bright); }

/* ---------- leaderboard invite + #2 nudge ---------- */
.lb-invite { padding: 0 1.1rem 1.4rem; }
.lb-nudge {
  font: 500 .86rem var(--ui);
  color: var(--ink-text);
  background: rgba(182, 144, 71, .08);
  border: 1px solid rgba(182, 144, 71, .3);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  padding: .6rem .75rem;
  margin: 0 0 .4rem;
  line-height: 1.45;
}
.lb-share-btn { margin-top: .3rem; }

/* ---------- join landing (#join?c=CODE) ---------- */
/* Standalone branded landing for a brand-new invited visitor: hide BOTH the
   bottom nav and the top league/streak/XP status-bar chrome (which would read
   as a stranger's "Namer · 0 · 0 XP" on what should be a clean invite page). */
body[data-route="join"] #tab-bar { display: none; }
body[data-route="join"] #status-bar { display: none; }
.join-screen {
  min-height: 100%;
  padding: 2rem 1.3rem 2.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.join-screen .eyebrow { color: var(--gold-label); }
.join-medallions {
  display: flex;
  gap: .35rem;
  justify-content: center;
  margin-bottom: 1.1rem;
  opacity: .95;
}
.join-loading {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #5C564B;
  font: 500 .9rem var(--ui);
  margin-top: 1.4rem;
}
.join-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.7rem;
  color: var(--ink);
  line-height: 1.15;
  margin: .2rem 0 .5rem;
}
.join-note {
  color: #5C564B;
  font: 400 .92rem var(--ui);
  line-height: 1.55;
  max-width: 320px;
  margin: 0 0 1.4rem;
}
.join-card {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 20px rgba(11, 12, 16, .08);
  padding: 1.6rem 1.3rem;
  margin: .4rem 0 1.1rem;
}
.join-inviter { font: 500 .95rem var(--ui); color: #5C564B; margin: 0 0 .2rem; }
.join-inviter b { color: var(--ink); font-weight: 700; }
.join-chavurah {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 2rem;
  color: var(--ink);
  line-height: 1.1;
  margin: 0 0 .55rem;
}
.join-members { font: 500 .85rem var(--ui); color: var(--gold-label); margin: 0; }
.join-pasuk {
  font-family: var(--hebrew);
  direction: rtl;
  font-size: 1.15rem;
  color: var(--ink-text);
  opacity: .85;
  margin: 0 0 1.3rem;
}
.join-screen .btn-gold { width: 100%; max-width: 360px; }
.join-screen .btn-share { max-width: 360px; }
.join-form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: .6rem; }
.join-form input[type="text"] {
  width: 100%;
  font: 500 1rem var(--ui);
  color: var(--ink-text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .75rem .85rem;
  text-align: center;
}
.join-form input[type="text"]:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.join-screen .form-status { text-align: center; }

/* ---- soft signup gate (screens/gate.js) — one-time, after the first lesson -- */
/* a focused full-screen moment like splash/join — hide the app chrome so the tab
   bar can't silently bypass the gate (the gate's own Skip/Create are the exits),
   and the gate's big XP/streak stats don't duplicate the status-bar chips. */
body[data-route="gate"] #tab-bar { display: none; }
body[data-route="gate"] #status-bar { display: none; }
.gate-signup .gate-stats { display: flex; gap: 2.4rem; margin: .9rem 0 1.2rem; }
.gate-signup .gate-stats .stat { display: flex; flex-direction: column; align-items: center; }
.gate-signup .auth-body { margin: 0 0 1.1rem; }
.gate-form { display: flex; flex-direction: column; gap: .6rem; max-width: 360px; }
.gate-form input {
  width: 100%;
  font: 500 1rem var(--ui);
  color: var(--ink-text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .75rem .85rem;
}
.gate-form input::placeholder { color: var(--cream-mute); }
.gate-form input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.gate-form .btn-gold { margin-top: .3rem; }
.gate-signup #gate-skip { display: block; margin: .9rem auto 0; }
