/* BibLeo prototype. Purple and gold, Nunito. Designed at 390px wide. */
:root {
  --p-950: #1c0a40;
  --p-900: #2a0f5c;
  --p-800: #34146f;
  --p-700: #44208f;
  --p-600: #5626a8;
  --p-500: #6c35bf;
  --p-400: #8a55d6;
  --p-300: #b391ea;
  --p-200: #d6c4f5;
  --bg-top: #2c0f62;
  --bg-bottom: #8b43b8;
  --card: rgba(255, 255, 255, 0.12);
  --card-strong: rgba(255, 255, 255, 0.18);
  --card-line: rgba(255, 255, 255, 0.32);
  --gold: #ffc52e;
  --gold-dark: #d4940a;
  --gold-soft: #ffe08a;
  --ink: #2a0f5c;
  --cream: #fff3dc;
  --white: #ffffff;
  --muted: rgba(255, 255, 255, 0.78);
  --ok-bg: #c9f2b0;
  --ok: #2e9e44;
  --ok-dark: #1f7a32;
  --ok-ink: #17452a;
  --bad-bg: #ffd9c7;
  --bad: #e2563a;
  --bad-dark: #b93b22;
  --bad-ink: #6b2210;
  --leo: #f5a623;
  --leo-dark: #e07b12;
  --leo-light: #fce3b0;
  --gold-text: #ffc52e; /* gold used as text: bright on purple, darker on light screens */
  --radius: 22px;
  --radius-pill: 999px;
  --gutter: 20px;
  --font: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-weight: 600;
  color: var(--white);
  background: var(--p-950);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- App frame ---------- */
#app {
  position: relative;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--p-600) 55%, var(--bg-bottom) 100%);
}
@media (min-width: 500px) {
  body { background: radial-gradient(circle at 50% 30%, #3a1a7a, #120628 70%); }
  #app { height: min(100dvh, 900px); min-height: 0; margin-top: max(0px, calc((100dvh - 900px) / 2)); border-radius: 36px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
}
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 20px);
  overflow-y: auto; overflow-x: hidden;
  animation: screen-in 0.28s ease-out;
}
.screen.no-anim { animation: none; }
.screen.tabbed { padding: 0; overflow: hidden; }
.screen.tabbed > .scroll {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 100px);
}
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.grow { flex: 1 1 auto; }
.center { text-align: center; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }

/* ---------- Type ---------- */
h1, h2, h3 { margin: 0; font-weight: 900; letter-spacing: -0.01em; }
h1 { font-size: 30px; line-height: 1.15; }
h2 { font-size: 26px; line-height: 1.2; }
h3 { font-size: 20px; line-height: 1.25; }
p { margin: 0; line-height: 1.45; }
.lead { font-size: 17px; color: var(--muted); }
.eyebrow { font-size: 13px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--p-200); }
.small { font-size: 14px; color: var(--muted); }
.wordmark { font-weight: 900; font-size: 52px; letter-spacing: -0.02em; }
.wordmark span { color: var(--gold); }

/* ---------- Buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 56px; padding: 14px 20px;
  border-radius: 18px; font-weight: 900; font-size: 18px;
  transition: transform 0.08s ease, filter 0.15s ease, background 0.2s;
  user-select: none;
}
.btn:active:not(:disabled) { transform: translateY(3px); }
.btn-gold { background: var(--gold); color: var(--ink); box-shadow: 0 5px 0 var(--gold-dark); }
.btn-gold:active:not(:disabled) { box-shadow: 0 2px 0 var(--gold-dark); }
.btn-gold:disabled { background: rgba(255, 255, 255, 0.22); color: rgba(255, 255, 255, 0.55); box-shadow: 0 5px 0 rgba(0, 0, 0, 0.15); }
.btn-ghost { background: var(--card-strong); border: 2px solid var(--card-line); color: var(--white); }
.btn-green { background: var(--ok); color: #fff; box-shadow: 0 5px 0 var(--ok-dark); }
.btn-red { background: var(--bad); color: #fff; box-shadow: 0 5px 0 var(--bad-dark); }
.link { display: block; margin: 16px auto 0; font-weight: 900; font-size: 17px; text-decoration: underline; text-underline-offset: 4px; color: var(--white); padding: 6px 12px; }
.bottom { margin-top: auto; padding-top: 16px; }
.bottom .btn + .btn { margin-top: 14px; }

/* ---------- Pills, cards ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: var(--radius-pill);
  border: 2px solid var(--card-line); background: var(--card);
  font-weight: 900; font-size: 16px; white-space: nowrap;
}
.pill svg { width: 18px; height: 18px; }
.card {
  background: var(--card); border: 2px solid var(--card-line);
  border-radius: var(--radius); padding: 16px 18px;
}
.card-cream { background: var(--cream); color: var(--ink); border-color: transparent; }
.bar { height: 14px; border-radius: 99px; background: rgba(20, 5, 50, 0.55); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--gold); border-radius: 99px; transition: width 0.5s ease; }
.dots { display: flex; justify-content: center; gap: 8px; margin: 18px 0 4px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--p-200); }
.dots i.on { background: var(--p-200); }

/* ---------- Choice options ---------- */
.options { display: grid; gap: 14px; }
.opt {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  min-height: 60px; padding: 14px 18px;
  border-radius: var(--radius-pill); border: 2px solid var(--card-line); background: var(--card-strong);
  font-weight: 800; font-size: 18px; line-height: 1.25;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.opt.multiline { border-radius: 24px; }
.opt .radio { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.85); position: relative; }
.opt.sel { border-color: var(--gold); background: rgba(150, 70, 120, 0.55); }
.opt.sel .radio { border-color: var(--gold); background: var(--gold); box-shadow: inset 0 0 0 3px rgba(150, 70, 120, 0.9); }
.opt .mark { margin-left: auto; font-size: 20px; font-weight: 900; }
.opt.right { background: var(--ok-bg); border-color: var(--ok); color: var(--ok-ink); }
.opt.right .radio { border-color: var(--ok); background: var(--ok); box-shadow: inset 0 0 0 3px var(--ok-bg); }
.opt.wrong { background: var(--bad-bg); border-color: var(--bad); color: var(--bad-ink); }
.opt.wrong .radio { border-color: var(--bad); background: var(--bad); box-shadow: inset 0 0 0 3px var(--bad-bg); }
.opt.done { opacity: 0.45; }
.opt:disabled { cursor: default; }
.shake { animation: shake 0.35s; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.pop { animation: pop 0.3s; }
@keyframes pop { 50% { transform: scale(1.05); } }

/* ---------- Lesson ---------- */
.lesson-top { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.lesson-top .x { width: 36px; height: 36px; display: grid; place-items: center; flex: none; }
.lesson-top .bar { flex: 1; }
.q-label { margin-bottom: 10px; }
.q-title { font-size: 27px; font-weight: 900; line-height: 1.2; margin-bottom: 22px; }
.q-title .hl {
  display: inline-block; background: var(--gold); color: var(--ink);
  padding: 0 10px; border-radius: 10px; line-height: 1.3; cursor: pointer;
  box-shadow: 0 3px 0 var(--gold-dark);
  animation: glow 1.8s ease-in-out infinite;
}
.q-title .hl.opened { animation: none; box-shadow: none; }
@keyframes glow { 50% { box-shadow: 0 3px 0 var(--gold-dark), 0 0 0 7px rgba(255, 197, 46, 0.28); } }
.ref-chip { display: inline-block; text-decoration: underline; text-underline-offset: 3px; font-size: 14px; font-weight: 800; color: var(--p-200); margin: -10px 0 18px; }
.reveal-card { text-align: center; padding: 18px; }
.reveal-card .script { font-size: 44px; font-weight: 800; line-height: 1.2; margin: 6px 0 4px; }
.reveal-card .translit { font-size: 16px; color: var(--muted); font-style: italic; }
.reveal-card .gloss { font-size: 24px; font-weight: 900; margin-top: 8px; }
.reveal-card .expl { font-size: 16px; color: var(--muted); margin-top: 10px; line-height: 1.4; }
/* Tap to reveal: question sits in the middle of the screen (Veronique, 15 Nov). */
.reveal-screen { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center; padding-bottom: 6vh; }
.reveal-screen .q-title { font-size: 30px; }
.reveal-screen .ref-chip { margin-top: -8px; }
.reveal-screen .reveal-hint { margin-bottom: 12px; }
.reveal-screen .bubble-row { justify-content: center; text-align: left; }
.disc-inline .share-card .headline { font-size: 24px; }
.reveal-card.hidden-state { border-style: dashed; color: var(--muted); padding: 34px 18px; }
.reveal-in { animation: reveal-in 0.45s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes reveal-in { from { opacity: 0; transform: scale(0.85) rotateX(40deg); } to { opacity: 1; transform: none; } }
[lang="he"], [lang="arc"] { direction: rtl; unicode-bidi: isolate; }
.bubble-row { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.bubble-row .avatar { width: 72px; height: 72px; }
.bubble { position: relative; background: var(--cream); color: var(--ink); padding: 12px 16px; border-radius: 18px; font-weight: 800; font-size: 16px; line-height: 1.35; }
.bubble::before { content: ""; position: absolute; left: -8px; top: 50%; margin-top: -8px; border: 8px solid transparent; border-right-color: var(--cream); border-left: 0; }
.info-title { font-size: 26px; font-weight: 900; line-height: 1.2; margin: 18px 0 12px; }
.info-body { font-size: 18px; line-height: 1.5; color: inherit; }
.info-body strong { color: var(--white); }

/* True / false */
.tf { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tf .opt { justify-content: flex-start; }
.statement { font-size: 26px; font-weight: 900; line-height: 1.25; }

/* Match pairs */
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.match .col { display: grid; gap: 12px; align-content: start; }
.match .opt { font-size: 16px; min-height: 58px; padding: 10px 14px; border-radius: 22px; }
.match .opt.right { opacity: 0.55; }

/* Sort */
.chips { display: flex; flex-wrap: wrap; gap: 10px; min-height: 52px; }
.chip {
  padding: 11px 18px; border-radius: var(--radius-pill);
  border: 2px solid var(--card-line); background: var(--card-strong);
  font-weight: 900; font-size: 17px; touch-action: none; user-select: none;
  transition: transform 0.12s, background 0.15s, border-color 0.15s;
}
.chip.sel { border-color: var(--gold); background: rgba(150, 70, 120, 0.6); transform: translateY(-2px); }
.chip.right { background: var(--ok-bg); border-color: var(--ok); color: var(--ok-ink); }
.chip.wrong { background: var(--bad-bg); border-color: var(--bad); color: var(--bad-ink); }
.chip.ghost { opacity: 0.25; }
.drag-proxy { position: fixed; z-index: 100; pointer-events: none; transform: scale(1.08) rotate(-2deg); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35); }
.zones { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.zone {
  min-height: 150px; border-radius: 18px; border: 2px dashed var(--card-line); background: rgba(30, 8, 70, 0.4);
  padding: 10px; display: flex; flex-direction: column; gap: 8px; transition: background 0.15s, border-color 0.15s;
}
.zones.many .zone { min-height: 92px; }
.zone .zlabel { font-size: 14px; font-weight: 800; color: var(--muted); text-align: center; padding: 4px 0; }
.zone .chips { justify-content: center; min-height: 0; gap: 8px; }
.zone .chip { font-size: 15px; padding: 8px 14px; }
.zone.over, .zone.target { border-color: var(--gold); background: rgba(255, 197, 46, 0.12); }
.order-list { display: grid; gap: 10px; }
.order-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; border: 2px solid var(--card-line); background: var(--card-strong); font-weight: 900; font-size: 18px; touch-action: none; user-select: none; }
.order-item .num { width: 30px; height: 30px; border-radius: 50%; background: rgba(0, 0, 0, 0.25); display: grid; place-items: center; font-size: 15px; flex: none; }
.order-item .grip { margin-left: auto; opacity: 0.6; font-size: 22px; line-height: 1; padding: 0 2px; }
.order-item .arrows { display: flex; gap: 4px; }
.order-item .arrows button { width: 34px; height: 34px; border-radius: 10px; background: rgba(0, 0, 0, 0.2); font-size: 16px; }
.order-item.dragging { opacity: 0.35; }
.order-item.right { background: var(--ok-bg); border-color: var(--ok); color: var(--ok-ink); }
.order-item.wrong { background: var(--bad-bg); border-color: var(--bad); color: var(--bad-ink); }
.end-label { font-size: 13px; font-weight: 800; color: var(--p-200); text-transform: uppercase; letter-spacing: 0.08em; margin: 6px 0; }

/* Fill blank */
.blank { display: inline-block; min-width: 92px; border-bottom: 3px solid var(--gold); text-align: center; color: var(--gold-text); padding: 0 6px; }

/* Recap */
.recap-list { list-style: none; margin: 0; padding: 0; }
.recap-list li { display: flex; gap: 10px; font-size: 18px; font-weight: 800; line-height: 1.35; }
.recap-list li + li { margin-top: 10px; }
.disc-box .eyebrow { margin-bottom: 8px; }
.disc-box p { font-size: 17px; margin-bottom: 14px; }

/* ---------- Bottom sheets ---------- */
.sheet-backdrop { position: absolute; inset: 0; background: rgba(15, 4, 35, 0.6); z-index: 40; animation: fade 0.2s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 41;
  background: var(--p-700); border-radius: 28px 28px 0 0; border-top: 2px solid var(--card-line);
  padding: 12px var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 24px);
  animation: sheet-up 0.3s cubic-bezier(.2, .9, .3, 1);
  max-height: 92%; overflow-y: auto;
}
.sheet .grabber { width: 44px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.4); margin: 0 auto 18px; }
@keyframes sheet-up { from { transform: translateY(100%); } }
.feedback { position: absolute; left: 0; right: 0; bottom: 0; z-index: 30; border-radius: 28px 28px 0 0; padding: 20px var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 22px); animation: sheet-up 0.28s cubic-bezier(.2, .9, .3, 1); }
.feedback.ok { background: var(--ok-bg); color: var(--ok-ink); }
.feedback.bad { background: var(--bad-bg); color: var(--bad-ink); }
.feedback .head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.feedback .head .avatar { width: 58px; height: 58px; }
.feedback h3 { font-size: 24px; }
.feedback p { font-size: 17px; font-weight: 700; margin-bottom: 16px; }

/* ---------- Scene / illustrations ---------- */
.scene { position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: 22px; overflow: hidden; background: linear-gradient(170deg, #2a0e5c, #4a1f8f 70%, #5a2aa8); }
.scene svg.bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene .leo-wrap { position: absolute; left: 50%; bottom: 25%; width: 34%; transform: translateX(-50%); }
.scene.tall { aspect-ratio: 4 / 3; }
.scene.short { aspect-ratio: 16 / 7.5; }
.scene .asset-tag { position: absolute; right: 10px; bottom: 8px; font-size: 10px; font-weight: 700; color: rgba(255, 255, 255, 0.35); letter-spacing: 0.04em; }
.avatar { border-radius: 50%; background: var(--p-500); border: 3px solid var(--p-300); overflow: hidden; flex: none; display: grid; place-items: center; }
.avatar svg { width: 92%; height: 92%; margin-top: 10%; }

/* Leo animation */
.leo { display: block; width: 100%; height: auto; overflow: visible; }
.leo .tail { transform-origin: 66px 178px; animation: tail 2.6s ease-in-out infinite; }
.leo .eyes { transform-origin: 100px 72px; animation: blink 4.5s infinite; }
.leo .head { transform-origin: 100px 120px; }
.leo.mood-thinking .head, .leo.mood-puzzled .head { animation: tilt 2.4s ease-in-out infinite; }
@keyframes tail { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-14deg); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
@keyframes tilt { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-7deg); } }
.anim-hop { animation: hop 0.6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes hop { 40% { transform: translateY(-14%); } }
.anim-celebrate { animation: celebrate 1.1s ease-in-out infinite; }
@keyframes celebrate { 0%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-10%) rotate(-4deg); } 50% { transform: translateY(0) rotate(0); } 75% { transform: translateY(-6%) rotate(4deg); } }
.anim-droop { animation: droop 0.8s ease-out; }
@keyframes droop { 30% { transform: translateY(5%) rotate(-5deg); } }
.anim-bob { animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4%); } }
.sparkle { animation: twinkle 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.sparkle:nth-of-type(2) { animation-delay: 0.8s; }
.sparkle:nth-of-type(3) { animation-delay: 1.6s; }
@keyframes twinkle { 50% { opacity: 0.35; transform: scale(0.7); } }

/* ---------- Home ---------- */
.home-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.home-head .avatar { width: 46px; height: 46px; background: var(--gold); border-color: var(--gold-dark); }
.home-head .hello { font-weight: 900; font-size: 20px; line-height: 1.1; }
.home-head .hello small { display: block; font-size: 13px; font-weight: 700; color: var(--muted); }
.home-head .pills { margin-left: auto; display: flex; gap: 8px; }
.home-head .pill { padding: 8px 12px; font-size: 15px; }
.course-card .row { align-items: flex-start; }
.course-card .title { font-weight: 900; font-size: 19px; }
.course-card .sub { font-size: 15px; color: var(--muted); }
.course-card .switch { margin-left: auto; font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 4px; padding: 4px 0 4px 8px; }
.course-card .progress { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.course-card .progress .bar { flex: 1; }
.course-card .progress b { font-weight: 900; }
.quest-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding: 13px 16px; font-weight: 900; }
.path { position: relative; margin: 10px calc(var(--gutter) * -1) 0; flex: none; }
.path svg.lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.node { position: absolute; width: 112px; height: 82px; transform: translate(-50%, -50%); }
.node svg { width: 100%; height: 100%; overflow: visible; }
.node.current::before { content: ""; position: absolute; inset: -12px -14px -4px; border-radius: 50%; background: rgba(255, 220, 120, 0.22); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.1); opacity: 0.55; } }
.node .label { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 2px; white-space: nowrap; font-size: 13px; font-weight: 800; color: var(--muted); }
.path-leo { position: absolute; width: 96px; transform: translate(-50%, -78%); pointer-events: none; }
.path-deco { position: absolute; pointer-events: none; opacity: 0.95; }
.unit-banner { position: absolute; left: 50%; transform: translateX(-50%); text-align: center; width: 80%; }
.unit-banner .card { padding: 12px; font-size: 15px; }

/* ---------- Tab bar ---------- */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around;
  padding: 10px 6px calc(env(safe-area-inset-bottom, 0px) + 10px);
  background: rgba(28, 8, 64, 0.92); backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.tabbar button { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; font-weight: 800; color: rgba(255, 255, 255, 0.85); min-width: 60px; padding: 4px; }
.tabbar button svg { width: 28px; height: 28px; }
.tabbar button.on { color: var(--gold); }

/* ---------- Rewards ---------- */
.reward-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.reward-tiles .card b { display: block; font-size: 24px; font-weight: 900; }
.reward-tiles .card span { font-size: 15px; color: var(--muted); }
.goal-card .row b { margin-left: auto; white-space: nowrap; }
.goal-card .bar { flex: 1; }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- Share card ---------- */
.share-card {
  border: 4px solid var(--gold); border-radius: 26px; padding: 24px 22px;
  background: linear-gradient(160deg, #3a1580, #6a2fb8 70%, #8a45c4);
  display: flex; flex-direction: column;
}
.share-card.story { aspect-ratio: 9 / 16; max-height: 56vh; margin: 0 auto; }
.share-card .eyebrow { color: var(--gold); font-size: 14px; }
.share-card .headline { font-size: 28px; font-weight: 900; line-height: 1.15; margin: 10px 0 14px; }
.share-card .orig { background: var(--cream); color: var(--ink); border-radius: 16px; padding: 12px 16px; }
.share-card .orig .lang { font-size: 12px; font-weight: 900; letter-spacing: 0.1em; color: var(--p-500); }
.share-card .orig .script { font-size: 34px; font-weight: 900; line-height: 1.2; }
.share-card .orig .translit { font-style: italic; color: var(--p-500); font-weight: 800; }
.share-card .expl { font-size: 16px; margin-top: 14px; line-height: 1.4; }
.share-card .foot { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.share-card .foot .avatar { width: 36px; height: 36px; border-width: 2px; }
.share-card .foot .wm { font-weight: 900; font-size: 20px; }
.share-card .foot .wm span { color: var(--gold); }
.share-card .foot .lnk { margin-left: auto; font-size: 12px; font-weight: 800; text-align: right; }
.share-card.story .foot { margin-top: auto; }
.seg { display: flex; gap: 10px; margin: 16px 0 10px; }
.seg button { padding: 9px 18px; border-radius: 99px; border: 2px solid var(--card-line); font-weight: 900; }
.seg button.on { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.topbar { display: flex; align-items: center; justify-content: center; position: relative; min-height: 40px; margin-bottom: 16px; font-weight: 900; font-size: 19px; }
.topbar .back { position: absolute; left: -6px; width: 40px; height: 40px; display: grid; place-items: center; font-size: 26px; }
.overlay { position: absolute; inset: 0; z-index: 50; background: linear-gradient(180deg, var(--bg-top) 0%, var(--p-600) 55%, var(--bg-bottom) 100%); }

/* ---------- Toast ---------- */
.toast { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); z-index: 90; background: var(--cream); color: var(--ink); font-weight: 800; padding: 10px 16px; border-radius: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); animation: fade 0.2s; max-width: 88%; text-align: center; font-size: 15px; }

/* ---------- Debug ---------- */
.debug h3 { margin: 22px 0 10px; font-size: 16px; color: var(--gold); text-transform: uppercase; letter-spacing: 0.08em; }
.debug .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.debug .grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.debug button.d { background: var(--card-strong); border: 1px solid var(--card-line); border-radius: 12px; padding: 10px 8px; font-weight: 800; font-size: 14px; text-align: center; }
.debug button.d.on { background: var(--gold); color: var(--ink); }
.debug button.d.todo { opacity: 0.4; }
.debug .kv { font-size: 14px; color: var(--muted); line-height: 1.6; }
.debug input { width: 70px; padding: 8px; border-radius: 10px; border: 1px solid var(--card-line); background: rgba(0, 0, 0, 0.3); color: #fff; font: inherit; }
.debug .screen-list button { display: flex; width: 100%; text-align: left; padding: 9px 10px; border-radius: 10px; font-size: 14px; font-weight: 700; }
.debug .screen-list button:nth-child(odd) { background: rgba(255, 255, 255, 0.05); }
.debug .screen-list .st { margin-left: auto; font-size: 12px; color: var(--muted); }

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

/* Lesson button stays pinned to the bottom when a screen (e.g. the recap with its card) scrolls. */
.screen > .foot { position: sticky; bottom: 0; z-index: 2; margin-left: calc(var(--gutter) * -1); margin-right: calc(var(--gutter) * -1); padding: 18px var(--gutter) 0; background: linear-gradient(180deg, rgba(139, 67, 184, 0), var(--bg-bottom) 40%); }

/* ================= Stage 2 ================= */
/* List rows (settings, profile, book list) */
.list { margin: 0 calc(var(--gutter) * -1); }
.list .li { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 16px var(--gutter); border-bottom: 1px solid rgba(255, 255, 255, 0.16); font-weight: 900; font-size: 17px; }
.list .li .sub { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-top: 2px; }
.list .li .end { margin-left: auto; font-weight: 800; color: var(--muted); font-size: 15px; white-space: nowrap; }
.list .li .end::after { content: " ›"; }
.list .li .end.plain::after { content: ""; }
.list .li.dim { opacity: 0.45; }
.list .section { padding: 18px var(--gutter) 4px; font-size: 13px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; color: var(--p-200); }

/* Form fields */
.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-weight: 900; font-size: 15px; margin-bottom: 6px; }
.field input { width: 100%; padding: 15px 16px; border-radius: 16px; border: 2px solid var(--card-line); background: var(--card-strong); color: #fff; font: inherit; font-size: 17px; font-weight: 700; }
.field input::placeholder { color: rgba(255, 255, 255, 0.5); }
.field input:focus { outline: none; border-color: var(--gold); }
.code-input { text-transform: uppercase; letter-spacing: 0.12em; }

/* Toggle switch */
.switch-t { position: relative; width: 52px; height: 30px; border-radius: 99px; background: rgba(255, 255, 255, 0.25); flex: none; transition: background 0.2s; }
.switch-t::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.switch-t.on { background: var(--gold); }
.switch-t.on::after { transform: translateX(22px); }

/* Segmented pill choices */
.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choices button { padding: 10px 18px; border-radius: 99px; border: 2px solid var(--card-line); background: var(--card); font-weight: 900; }
.choices button.on { background: var(--gold); color: var(--ink); border-color: var(--gold); }

/* Bible */
.tabs2 { display: flex; gap: 10px; margin-bottom: 4px; }
.tabs2 button { padding: 10px 16px; border-radius: 99px; border: 2px solid var(--card-line); background: var(--card); font-weight: 900; }
.tabs2 button.on { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.chapter-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.chapter-grid button { aspect-ratio: 1.15; border-radius: 14px; border: 2px solid var(--card-line); background: var(--card-strong); font-weight: 900; font-size: 17px; }
.chapter-grid button.last { border-color: var(--gold); }
.reader { font-size: calc(18px * var(--rs, 1)); line-height: 1.7; font-weight: 600; }
.reader p { margin: 0 0 1em; line-height: 1.7; }
.reader sup { font-size: 0.62em; font-weight: 900; color: var(--gold); margin-right: 2px; vertical-align: super; line-height: 0; }
.reader .v.hl { background: rgba(255, 197, 46, 0.28); border-radius: 6px; box-shadow: 0 0 0 3px rgba(255, 197, 46, 0.28); }
.reader-wrap.theme-light { --reader-bg: #fbf8ff; --reader-ink: #2a0f5c; }
.reader-wrap.theme-sepia { --reader-bg: #f6ecd6; --reader-ink: #4a3218; }
.reader-wrap.theme-light .reader-page, .reader-wrap.theme-sepia .reader-page { background: var(--reader-bg); color: var(--reader-ink); border-radius: 22px; padding: 18px 18px 6px; }
.reader-wrap.theme-light .reader sup, .reader-wrap.theme-sepia .reader sup { color: #7a4c00; }
.reader-nav { display: flex; justify-content: space-between; gap: 12px; }
.reader-nav .btn { width: auto; min-height: 48px; padding: 10px 18px; font-size: 16px; }
.notice { font-size: 12px; color: var(--muted); text-align: center; margin-top: 14px; }

/* Plans */
.plan-opt .price { margin-left: auto; font-weight: 900; }
.tick-list { list-style: none; padding: 0; margin: 0 0 18px; }
.tick-list li { font-size: 17px; font-weight: 800; line-height: 1.5; }
.tick-list li::before { content: "✓ "; color: var(--gold-text); }
.code-box { font-size: 30px; font-weight: 900; letter-spacing: 0.12em; text-align: center; margin-top: 6px; }
.fake-store { background: #f2f2f7; color: #111; border-radius: 22px; padding: 18px; }
.fake-store .row { justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #ddd; font-size: 15px; }
.fake-store h3 { color: #111; margin-bottom: 6px; }
.fake-store .note { font-size: 13px; color: #666; margin: 10px 0 14px; }
.btn-store { background: #0a84ff; color: #fff; }

/* Profile */
.prof-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.prof-head .letter { width: 64px; height: 64px; border-radius: 50%; background: var(--gold); color: var(--ink); display: grid; place-items: center; font-size: 30px; font-weight: 900; flex: none; overflow: hidden; }
.prof-head .letter svg { width: 90%; margin-top: 12%; }
.stat3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat3 .card { padding: 12px 14px; }
.stat3 b { display: block; font-size: 24px; font-weight: 900; }
.stat3 span { font-size: 13px; color: var(--muted); }
.disc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.disc-grid .card { text-align: left; min-height: 96px; padding: 12px 14px; }
.disc-grid .card b { display: block; font-size: 15px; line-height: 1.3; margin-top: 4px; }
.disc-grid .card.locked { opacity: 0.5; border-style: dashed; }

/* Calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-weight: 900; }
.cal-head button { width: 38px; height: 38px; border-radius: 12px; background: var(--card); font-size: 18px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.cal .dow { font-size: 12px; color: var(--muted); font-weight: 900; }
.cal .d { aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; font-size: 14px; font-weight: 800; }
.cal .d.learned { background: var(--gold); color: var(--ink); }
.cal .d.frozen { background: #8fe3ff; color: #12395a; }
.cal .d.today { box-shadow: 0 0 0 2px #fff; }
.cal .d.future { opacity: 0.35; }
.legend { display: flex; gap: 14px; justify-content: center; font-size: 13px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.save-badge { display: inline-block; margin-left: 6px; padding: 2px 9px; border-radius: 99px; background: var(--gold); color: var(--ink); font-size: 13px; font-weight: 900; vertical-align: 2px; white-space: nowrap; }

/* ================= Stage 3 ================= */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2 .btn { min-height: 52px; font-size: 16px; padding: 10px; }
.item-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.item-grid .card { padding: 12px 6px; text-align: center; min-height: 104px; }
.item-grid .card.in-use { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; }
.item-grid .card.locked, .card.locked { opacity: 0.55; border-style: dashed; }
.den-slots { position: absolute; left: 4%; right: 4%; bottom: 5%; display: flex; justify-content: space-between; pointer-events: none; }
.den-trophies { position: absolute; top: 6%; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; pointer-events: none; }
.den-item { background: rgba(20, 5, 50, 0.45); border-radius: 12px; padding: 6px 6px 4px; text-align: center; color: #fff; min-width: 64px; }
.den-item svg { width: 26px; height: 26px; }
.den-item span { font-size: 10px !important; }

/* Home: avatar, streak, gems, course card and quests stay pinned while the path scrolls. */
.home-sticky {
  position: sticky; z-index: 6;
  top: calc((env(safe-area-inset-top, 0px) + 18px) * -1);
  margin: calc((env(safe-area-inset-top, 0px) + 18px) * -1) calc(var(--gutter) * -1) 0;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) var(--gutter) 12px;
  background: var(--bg-top);
  box-shadow: 0 10px 18px -8px rgba(10, 2, 30, 0.55);
}
.home-sticky .course-card { background: #3f1a83; }
.home-sticky .quest-row { background: #3f1a83; }
.quest-row { width: 100%; gap: 12px; }
.home-head .hello { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* ================= Light screens (15 Nov 2026: "too much purple") =================
   Lessons, reading, profile, settings and lists sit on warm off-white with purple text.
   Purple stays for Leo's world: splash, Home path, celebrations, the Den. */
.light, .sheet {
  --gold-text: #7a4c00;
  --white: #2a0f5c;
  --muted: rgba(42, 15, 92, 0.66);
  --card: #ffffff;
  --card-strong: #ffffff;
  --card-line: #e4daf3;
  --p-200: #7b4fc4;
  color: var(--ink);
}
.screen.light { background: #fbf7ef; }
.sheet { background: #fbf7ef; border-top: 0; box-shadow: 0 -12px 30px rgba(20, 5, 50, 0.25); }
.sheet .grabber { background: #d8cdea; }
.light .bar, .sheet .bar { background: #ece4f7; }
.light .opt .radio, .sheet .opt .radio { border-color: #b9a6dc; }
.light .opt.sel, .sheet .opt.sel, .light .chip.sel { background: #fff4d6; border-color: var(--gold); }
.light .opt.sel .radio, .sheet .opt.sel .radio { box-shadow: inset 0 0 0 3px #fff4d6; }
.light .btn-gold:disabled, .sheet .btn-gold:disabled { background: #ece4f7; color: #6e5c99; box-shadow: 0 5px 0 #ddd2ee; }
.light .btn-ghost, .sheet .btn-ghost { border-color: #d9cdee; }
.light .zone { background: #f4eefc; border-color: #cdbdea; }
.light .blank { color: #7a4c00; }
.light .bubble, .sheet .bubble { background: #f0e8fb; }
.light .bubble::before { border-right-color: #f0e8fb; }
.light .list .li, .sheet .list .li { border-bottom-color: #ece4f7; }
.light .order-item .num { background: #ece4f7; }
.light .order-item .arrows button { background: #ece4f7; }
.light .cal .d.today { box-shadow: 0 0 0 2px var(--ink); }
.light .cal-head button { background: #ece4f7; }
.light .field input { background: #fff; color: var(--ink); }
.light .field input::placeholder { color: #a796c4; }
.light .switch-t { background: #ddd2ee; }
.light .switch-t.on { background: var(--gold); }
.light .reveal-card.reveal-in, .light .card { box-shadow: 0 2px 0 #ece4f7; }
.light .avatar { border-color: #d6c4f5; }
.light .den-item { background: rgba(20, 5, 50, 0.45); color: #fff; }
.light .item-grid .card.in-use { box-shadow: 0 0 0 2px var(--gold) inset; }
.light .reader-wrap.theme-dark .reader-page { background: #2a0f5c; color: #fff; border-radius: 22px; padding: 18px 18px 6px; }
.light .reader-wrap.theme-dark .reader-page h2 { color: #fff; }
.light .reader sup { color: #7a4c00; }
.light .reader-wrap.theme-dark .reader sup { color: var(--gold); }
.light .reader .v.hl { background: rgba(255, 197, 46, 0.35); }
/* Purple panels inside light screens keep their own white text. */
.share-card, .scene, .fake-store { --white: #fff; --muted: rgba(255, 255, 255, 0.78); --p-200: #d6c4f5; }
.share-card { color: #fff; }
.fake-store { color: #111; }
.drag-proxy { background: #fff !important; color: var(--ink) !important; border-color: var(--gold) !important; }

/* Tab bar goes white everywhere. */
.tabbar { background: rgba(255, 255, 255, 0.97); border-top: 1px solid #e9e1f5; }
.tabbar button { color: #8a79ad; }
.tabbar button.on { color: var(--p-600); }
.tabbar button.on svg { color: var(--gold-dark); }
.screen.light > .foot { background: linear-gradient(180deg, rgba(251, 247, 239, 0), #fbf7ef 40%); }

/* Home header: slim strip after scrolling (15 Nov). */
.home-sticky .home-head, .home-sticky .course-card, .home-sticky .avatar { transition: all 0.2s ease; }
.home-sticky.compact { padding-bottom: 10px; }
.home-sticky.compact .home-head { margin-bottom: 8px; }
.home-sticky.compact .home-head .avatar { width: 34px; height: 34px; }
.home-sticky.compact .hello { font-size: 17px; }
.home-sticky.compact .hello small { display: none; }
.home-sticky.compact .home-head .pill { padding: 6px 10px; font-size: 14px; }
.home-sticky.compact .course-card { display: flex; align-items: center; gap: 12px; padding: 9px 14px; border-radius: 16px; }
.home-sticky.compact .course-card .row { flex: none; }
.home-sticky.compact .course-card .title { font-size: 15px; }
.home-sticky.compact .course-card .sub, .home-sticky.compact .course-card .switch { display: none; }
.home-sticky.compact .course-card .progress { flex: 1; margin-top: 0; }
.home-sticky.compact .course-card .bar { height: 10px; }
.home-sticky.compact .quest-row { display: none; }

/* ================= Highlights and notes (15 Nov) ================= */
.reader .v { cursor: pointer; border-radius: 5px; transition: background 0.15s; -webkit-touch-callout: none; }
.reader .v.sel { text-decoration: underline dotted var(--gold-dark); text-decoration-thickness: 2px; text-underline-offset: 4px; background: rgba(255, 197, 46, 0.15); }
.mark-yellow { background: rgba(255, 214, 64, 0.5) !important; }
.mark-green { background: rgba(120, 214, 130, 0.45) !important; }
.mark-blue { background: rgba(120, 185, 255, 0.45) !important; }
.mark-pink { background: rgba(255, 150, 190, 0.45) !important; }
.reader-wrap.theme-dark .mark-yellow, .reader-wrap.theme-dark .mark-green, .reader-wrap.theme-dark .mark-blue, .reader-wrap.theme-dark .mark-pink { color: #fff; }
.note-dot { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-left: 2px; border-radius: 50%; background: var(--gold); color: var(--ink); font-size: 13px; font-weight: 900; vertical-align: 2px; line-height: 1; }
.verse-bar { position: absolute; left: 10px; right: 10px; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); z-index: 35; background: #fff; color: var(--ink); border-radius: 22px; padding: 14px 16px; box-shadow: 0 10px 30px rgba(20, 5, 50, 0.3); animation: sheet-up 0.22s ease-out; --white: #2a0f5c; --card-strong: #fff; --card-line: #e4daf3; }
.swatch { width: 38px; height: 38px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px #d9cdee; font-size: 16px; }
.swatch-yellow { background: #ffd640; } .swatch-green { background: #78d682; } .swatch-blue { background: #78b9ff; } .swatch-pink { background: #ff96be; }
.swatch-none { background: #f3eefb; color: var(--ink); }
.note-quote { font-size: 16px; line-height: 1.55; margin-top: 8px; max-height: 120px; overflow-y: auto; }
.note-quote sup { color: #7a4c00; font-weight: 900; font-size: 0.65em; margin-right: 2px; }
.field textarea { width: 100%; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--card-line); background: #fff; color: var(--ink); font: inherit; font-size: 17px; font-weight: 600; resize: vertical; }
.field textarea:focus { outline: none; border-color: var(--gold); }
.mark-row { display: block; width: 100%; text-align: left; }
.mark-row > span { display: block; }
.mark-row .mark-quote { margin: 4px 0 6px; }
.mark-row .mark-note { font-weight: 800; font-size: 16px; margin-bottom: 6px; white-space: pre-wrap; }
.mark-row .mark-hl { display: inline; padding: 1px 2px; border-radius: 4px; font-size: 16px; line-height: 1.6; margin-top: 4px; }

/* Readability pass (15 Nov): nothing white or pale on the light screens. */
.light .list .li.dim { opacity: 0.62; }
.light .reader sup, .sheet sup { color: var(--gold-text); }
.light input, .light textarea, .sheet input, .sheet textarea { color: var(--ink); }
.light .opt.right, .sheet .opt.right { color: var(--ok-ink); }
.light .opt.wrong, .sheet .opt.wrong { color: var(--bad-ink); }
.light .small, .sheet .small { color: var(--muted); }

/* Leo's onboarding messages arrive like a text message: avatar, typing dots, then the bubble pops in. */
.msg .msg-avatar { animation: msg-avatar 0.3s cubic-bezier(.3, 1.5, .5, 1) both; }
.msg .msg-bubble { transform-origin: 0% 100%; animation: msg-in 0.28s cubic-bezier(.3, 1.4, .5, 1) 0.15s both; }
.msg .msg-bubble.msg-pop { animation: msg-pop 0.32s cubic-bezier(.3, 1.6, .5, 1) both; }
.msg .typing { padding: 14px 16px; }
.dots { display: inline-flex; gap: 5px; align-items: center; height: 10px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: #9a85c4; animation: dot 1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes msg-avatar { from { opacity: 0; transform: scale(0.6); } }
@keyframes msg-in { from { opacity: 0; transform: scale(0.5) translateY(6px); } }
@keyframes msg-pop { 0% { transform: scale(0.85); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes dot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }
.light .cal .d.future { opacity: 0.6; }
.light .cal-head button:disabled { opacity: 0.5 !important; }
.light .card.locked, .light .item-grid .card.locked { opacity: 0.75; }

/* The tap-to-reveal "aha" card matches the purple discovery card (15 Nov). */
.reveal-card.reveal-in, .light .reveal-card.reveal-in {
  background: linear-gradient(160deg, #3a1580, #6a2fb8 70%, #8a45c4);
  border: 3px solid var(--gold); box-shadow: 0 8px 20px rgba(58, 21, 128, 0.25);
  color: #fff; --white: #fff; --muted: rgba(255, 255, 255, 0.82); --gold-text: #ffc52e;
}
.reveal-card.reveal-in .eyebrow { color: var(--gold); }
.reveal-card.reveal-in .script { display: inline-block; background: var(--cream); color: var(--ink); border-radius: 16px; padding: 4px 16px 8px; margin: 10px 0 6px; }
.reveal-card.reveal-in .translit { color: rgba(255, 255, 255, 0.85); }

/* Discovery card: lesson artwork behind, Leo sitting next to the wordmark (15 Nov). */
.share-card { position: relative; overflow: hidden; background: #3a1580; }
.share-card > * { position: relative; z-index: 1; }
.share-card > .card-art { position: absolute; inset: 0; z-index: 0; }
.share-card > .card-art svg { width: 100%; height: 100%; display: block; }
.share-card .foot { align-items: flex-end; }
.share-card .foot .foot-leo { width: 44px; margin-bottom: -2px; flex: none; }
.share-card .foot .foot-leo svg { width: 100%; height: auto; display: block; }
.share-card .foot .wm { margin-bottom: 2px; }

/* Correct answer: Leo cheers in a speech bubble, gold sparkles burst out (15 Nov). */
.feedback { overflow: visible; }
.fb-leo { position: relative; flex: none; }
.leo-cheer {
  position: absolute; left: 44px; bottom: 56px; white-space: nowrap; z-index: 3;
  background: #fff; color: var(--ok-ink); font-weight: 900; font-size: 16px;
  padding: 8px 14px; border-radius: 16px 16px 16px 4px; box-shadow: 0 6px 16px rgba(20, 60, 30, 0.25);
  transform-origin: 0% 100%; animation: msg-pop 0.35s cubic-bezier(.3, 1.6, .5, 1) 0.1s both;
}
.sparkle-burst { position: absolute; left: 29px; top: 29px; width: 0; height: 0; pointer-events: none; z-index: 2; }
.sparkle-burst i {
  position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; background: var(--gold);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: burst 0.9s cubic-bezier(.2, .8, .3, 1) forwards;
}
.sparkle-burst i.dot { width: 8px; height: 8px; left: -4px; top: -4px; clip-path: none; border-radius: 50%; background: #fff3c4; }
@keyframes burst { 0% { transform: translate(0, 0) scale(0.3) rotate(0); opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(1) rotate(160deg); opacity: 0; } }

/* Info cards without a heading: more room under the art, bigger text (15 Nov). */
.info-body.solo { margin-top: 26px; font-size: 21px; line-height: 1.5; font-weight: 700; }

/* Share card: Leo and the wordmark are bigger, it's prime brand space (15 Nov). */
.share-card .foot { margin-top: 22px; gap: 10px; }
.share-card .foot .foot-leo { width: 68px; margin-bottom: -4px; }
.share-card .foot .wm { font-size: 30px; line-height: 1; margin-bottom: 6px; }
.share-card .foot .lnk { max-width: 34%; margin-bottom: 6px; }

/* True or false: statement and both answers centred, answers stacked (15 Nov). */
.tf-screen { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center; padding-bottom: 6vh; }
.tf-screen .statement { margin-bottom: 26px; }
.tf-screen .tf { grid-template-columns: 1fr; gap: 14px; width: 100%; max-width: 320px; margin: 0 auto; }
.tf-screen .tf .opt { justify-content: center; position: relative; font-size: 20px; min-height: 62px; }
.tf-screen .tf .opt .radio { position: absolute; left: 20px; }
.tf-screen .tf .opt .mark { position: absolute; right: 20px; }

/* Lesson cover page (15 Nov): full-screen purple title card with the lesson's artwork. */
.lesson-cover {
  position: absolute; inset: 0; z-index: 40; overflow: hidden; color: #fff;
  display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top, 0px) + 18px) var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 22px);
  --white: #fff; --muted: rgba(255, 255, 255, 0.82); --p-200: #ffc52e;
  animation: fade 0.25s ease-out;
}
.lesson-cover.leaving { animation: cover-out 0.32s ease-in forwards; }
@keyframes cover-out { to { opacity: 0; transform: scale(1.04); } }
.lesson-cover > * { position: relative; z-index: 1; }
.lesson-cover > .cover-art { position: absolute; inset: 0; z-index: 0; }
.lesson-cover > .cover-art svg { width: 100%; height: 100%; display: block; }
.lesson-cover .cover-x { width: 40px; height: 40px; display: grid; place-items: center; color: #fff; }
.cover-body { margin-top: 12vh; }
.cover-body .eyebrow { color: var(--gold); font-size: 15px; }
.cover-body h1 { font-size: 40px; line-height: 1.08; margin: 10px 0 14px; text-shadow: 0 3px 18px rgba(20, 5, 50, 0.4); }
.cover-meta { font-size: 17px; font-weight: 800; color: rgba(255, 255, 255, 0.88); }
.cover-leo { width: 34%; max-width: 150px; margin: auto 0 18px 6px; }
.cover-go { flex: none; }
/* Cover: Leo big, filling the space between the title and Begin (15 Nov). */
.lesson-cover .cover-leo { width: 62%; max-width: 270px; margin: auto auto 10px; filter: drop-shadow(0 12px 24px rgba(20, 5, 50, 0.35)); }
.lesson-cover .cover-body { margin-top: 8vh; }

/* ================= Daily puzzles (16 Nov) ================= */
.daily-slot { margin-top: 14px; }
.daily-card { padding: 14px 14px 12px; }
.daily-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.daily-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px 8px; border-radius: 16px; background: rgba(255, 255, 255, 0.1); border: 2px solid var(--card-line); color: #fff; }
.daily-tile .daily-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 12px; background: var(--gold); color: var(--ink); }
.daily-tile .daily-icon svg { width: 22px; height: 22px; }
.daily-tile .daily-name { font-size: 11.5px; font-weight: 900; line-height: 1.15; text-align: center; }
.daily-tile.done { opacity: 0.7; }
.daily-tile.done .daily-icon { background: rgba(255, 255, 255, 0.25); color: #fff; }
.daily-tick { position: absolute; top: 4px; right: 6px; font-weight: 900; color: var(--gold); }
.btw-card { text-align: center; background: linear-gradient(160deg, #3a1580, #6a2fb8 70%, #8a45c4); border: 3px solid var(--gold); color: #fff; --white: #fff; --muted: rgba(255, 255, 255, .82); }
.btw-card .eyebrow { color: var(--gold); }
.btw-literal { font-size: 28px; font-weight: 900; line-height: 1.2; margin: 8px 0 4px; }
.btw-script { display: inline-block; font-size: 30px; font-weight: 900; background: var(--cream); color: var(--ink); border-radius: 14px; padding: 2px 14px 6px; margin-top: 8px; }
.btw-translit { font-style: italic; margin-top: 4px; }
.clues { margin-top: 14px; display: grid; gap: 8px; }
.clue { background: #fff4d6; border-radius: 14px; padding: 10px 14px; font-size: 15px; }
.who-clues { margin: 0; padding-left: 26px; display: grid; gap: 10px; }
.who-clues li { font-size: 17px; font-weight: 800; line-height: 1.35; padding: 10px 12px; background: #fff; border-radius: 14px; border: 2px solid var(--card-line); }
.who-clues li::marker { color: var(--gold-text); font-weight: 900; }
.more-clue { margin-top: 12px; min-height: 46px; font-size: 16px; }
.who-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.who-grid .opt { justify-content: center; text-align: center; border-radius: 18px; }
.fok-solved { display: grid; gap: 8px; margin-bottom: 8px; }
.fok-band { border-radius: 14px; padding: 10px 12px; text-align: center; color: var(--ink); animation: pop .3s; }
.fok-band b { display: block; font-size: 15px; text-transform: uppercase; letter-spacing: .06em; }
.fok-band span { font-size: 14px; font-weight: 700; }
.band-0 { background: #ffd23f; } .band-1 { background: #d6c4f5; } .band-2 { background: #ffd0b0; } .band-3 { background: #bfe3ff; }
.fok-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.fok-tile { aspect-ratio: 1 / .82; border-radius: 12px; background: #ece4f7; color: var(--ink); font-weight: 900; font-size: 12.5px; padding: 2px; word-break: break-word; line-height: 1.1; transition: transform .1s, background .15s; }
.fok-tile.sel { background: var(--p-600); color: #fff; transform: scale(.96); }
.fok-mistakes { display: flex; gap: 6px; align-items: center; justify-content: center; margin: 14px 0; font-size: 14px; font-weight: 800; color: var(--muted); }
.fok-mistakes i { width: 12px; height: 12px; border-radius: 50%; background: var(--p-600); display: inline-block; }
.fok-mistakes i.used { background: #ddd2ee; }
.fok-actions { gap: 8px; }
.fok-actions .btn { min-height: 46px; font-size: 15px; padding: 8px; }
.wotd-grid { display: grid; gap: 6px; justify-content: center; margin: 4px 0 16px; }
.wotd-row { display: grid; grid-template-columns: repeat(5, 52px); gap: 6px; }
.wotd-row .cell { height: 52px; display: grid; place-items: center; border-radius: 10px; border: 2px solid #ddd2ee; background: #fff; font-size: 24px; font-weight: 900; color: var(--ink); }
.wotd-row .cell.typed { border-color: var(--p-400); animation: pop .15s; }
.wotd-row .cell.hit { background: var(--gold); border-color: var(--gold-dark); color: var(--ink); }
.wotd-row .cell.near { background: #b391ea; border-color: #8a55d6; color: #fff; }
.wotd-row .cell.absent { background: #4a3a6e; border-color: #4a3a6e; color: #fff; }
.kb-row { display: flex; gap: 5px; justify-content: center; margin-bottom: 6px; }
.key { flex: 1; max-width: 34px; height: 46px; border-radius: 8px; background: #ece4f7; color: var(--ink); font-weight: 900; font-size: 15px; }
.key.wide { max-width: 58px; flex: 1.6; font-size: 13px; }
.key.hit { background: var(--gold); } .key.near { background: #b391ea; color: #fff; } .key.absent { background: #4a3a6e; color: #fff; }
.puzzle-result { margin-top: 20px; scroll-margin-top: 10px; }
.puzzle-reveal p + p { margin-top: 4px; }

/* ================= Avatar (16 Nov) ================= */
.avatar-svg { width: 100%; height: 100%; display: block; }
.prof-avatar { width: 84px; height: 84px; flex: none; border-radius: 50%; }
.home-av { background: transparent !important; border: 0 !important; overflow: visible !important; }
.home-av .avatar-svg { margin: 0 !important; width: 100% !important; height: 100% !important; }
.avatar-preview { width: 140px; height: 140px; margin: 0 auto; }
.avatar-preview.small-prev { width: 110px; height: 110px; }
.avatar-body .eyebrow { margin: 14px 0 8px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches .swatch { width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px #d9cdee; }
.swatches .swatch.on { box-shadow: 0 0 0 3px var(--gold); }
.shop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.shop-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; text-align: center; }
.shop-item .shop-av { width: 62px; height: 62px; }
.shop-item b { font-size: 13px; line-height: 1.2; }
.shop-item.worn { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; }
.frame-dot { width: 34px; height: 34px; border-radius: 50%; border: 6px solid rgba(255, 255, 255, .7); box-shadow: 0 0 0 1px #d9cdee; flex: none; }

/* Prides and friend avatars (16 Nov) */
.friend-av { display: inline-block; flex: none; border-radius: 50%; overflow: hidden; }
.pride-card { padding: 18px; }
.pride-members { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pride-member { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 10px 4px; border-radius: 16px; background: #fff; border: 2px solid var(--card-line); }
.pride-member b { font-size: 15px; }
.pride-member .small { font-size: 12px; }

/* Den: Leo in the course scene (16 Nov) */
.scene-wrap { flex: none; position: relative; border-radius: 24px; overflow: hidden; margin: 8px 0 4px; box-shadow: 0 10px 30px rgba(10, 2, 30, 0.4); }
.course-scene { display: block; width: 100%; height: auto; }
.scene-leo-hit { position: absolute; inset: 0; background: transparent; }
.scene-card { text-align: center; }
.scene-thumb { border-radius: 18px; overflow: hidden; max-height: 360px; }
.scene-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.scene-chip { padding: 5px 10px; border-radius: 99px; font-size: 13px; font-weight: 800; border: 1.5px dashed rgba(255, 255, 255, 0.35); color: rgba(255, 255, 255, 0.7); }
.scene-chip.on { border: 1.5px solid var(--gold); background: rgba(255, 197, 46, 0.15); color: #fff; }
/* Home path climbs upward (17 Nov): Daily card sits on the ground floor below the path. */
.daily-slot { margin-top: 6px; margin-bottom: 8px; }
.path .path-deco { opacity: 0.35; }
.unit-banner .card { border-style: dashed; }

/* Daily card lives in the pinned Home header (17 Nov). Collapsed: one slim strip of tappable puzzle icons. */
.home-sticky .daily-slot { margin: 10px 0 0; }
.home-sticky .daily-card { background: #3f1a83; padding: 10px 12px; }
.daily-title { font-size: 18px; }
.daily-count { display: none; }
.home-sticky .daily-grid { margin-top: 8px; gap: 6px; }
.home-sticky .daily-tile { padding: 8px 2px 6px; }
.home-sticky.compact .daily-slot { margin-top: 8px; }
.home-sticky.compact .daily-card { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 16px; }
.home-sticky.compact .daily-head { flex: none; gap: 6px; }
.home-sticky.compact .daily-title { font-size: 15px; }
.home-sticky.compact .daily-count { display: inline; font-size: 13px; font-weight: 800; color: var(--muted); }
.home-sticky.compact .daily-sub { display: none; }
.home-sticky.compact .daily-grid { flex: 1; margin-top: 0; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.home-sticky.compact .daily-tile { flex-direction: row; justify-content: center; padding: 3px; border-radius: 12px; }
.home-sticky.compact .daily-tile .daily-name { display: none; }
.home-sticky.compact .daily-tile .daily-icon { width: 30px; height: 30px; border-radius: 9px; }
.home-sticky.compact .daily-tile .daily-icon svg { width: 18px; height: 18px; }
.home-sticky.compact .daily-tick { top: -3px; right: 2px; font-size: 13px; }

/* Slim fixed Home header (17 Nov) */
.home-sticky.slim { padding-bottom: 10px; }
.home-sticky.slim .home-head { margin-bottom: 8px; }
.home-sticky.slim .home-head .avatar { width: 38px; height: 38px; }
.home-sticky.slim .hello { font-size: 18px; }
.home-sticky.slim .home-head .pill { padding: 6px 10px; font-size: 14px; }
.course-strip { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 14px; border-radius: 16px; text-align: left; background: #3f1a83; }
.course-strip .cs-text { display: flex; flex-direction: column; min-width: 0; flex: 0 1 auto; max-width: 52%; }
.course-strip .cs-text b { font-size: 15px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.course-strip .cs-text .small { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.course-strip .bar { flex: 1; height: 9px; display: block; }
.course-strip .cs-count { font-size: 14px; }
.course-strip .cs-caret { font-size: 13px; opacity: .8; }
.quest-chip { display: block; width: 100%; margin-top: 8px; padding: 7px 12px; border-radius: 14px; border: 1.5px solid var(--card-line); background: rgba(255,255,255,.08); font-weight: 800; font-size: 14px; text-align: left; }
/* Daily tab */
.tabbar button { position: relative; }
.tabbar.tabs-6 button { min-width: 0; flex: 1; font-size: 11.5px; }
.tabbar.tabs-6 button svg { width: 25px; height: 25px; }
.tab-dot { position: absolute; top: 2px; right: calc(50% - 18px); width: 9px; height: 9px; border-radius: 50%; background: #ff5a5a; border: 2px solid #fff; }
.daily-row { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 16px; }
.daily-row .daily-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: var(--gold); color: var(--ink); flex: none; }
.daily-row .daily-icon svg { width: 28px; height: 28px; }
.daily-row .daily-text { display: flex; flex-direction: column; min-width: 0; }
.daily-row .daily-text b { font-size: 18px; }
.daily-row .daily-end { margin-left: auto; font-weight: 900; white-space: nowrap; }
.daily-row.done .daily-icon { background: #ece4f7; color: var(--p-500); }
.daily-row.done .daily-end { color: var(--ok); font-size: 20px; }

/* Den fits one screen (17 Nov): Leo's bubble floats over the room; tighter spacing. */
.scene-wrap { margin: 6px 0 12px; }
.scene-wrap .den-bubble { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); max-width: 86%; text-align: center; z-index: 2; box-shadow: 0 6px 16px rgba(10, 2, 30, 0.35); }
.scene-wrap .den-bubble::before { display: none; }
.den-count { margin-bottom: 8px; }
.den-next { font-weight: 800; margin-top: 10px; line-height: 1.35; }
.den-note { margin-top: 8px; }
.scene-wrap { background: #2c0f62; }
.scene-wrap .course-scene { max-height: 50vh; margin: 0 auto; }
@media (max-height: 760px) {
  .scene-wrap .course-scene { max-height: 46vh; }
  .den-note { display: none; }
}
/* Leo's tap bubble sits right above his head, with a tail pointing at him (17 Nov). */
.scene-wrap .den-bubble { top: auto; bottom: 41%; max-width: 64%; font-size: 15px; padding: 9px 14px; }
.scene-wrap .den-bubble::after { content: ""; position: absolute; left: 50%; bottom: -8px; margin-left: -8px; border: 8px solid transparent; border-top-color: var(--cream); border-bottom: 0; }
