/* Standalone pieces can live in the top bar, the lesson path or a sheet. */
.fx-mascot {
  display: inline-block;
  width: 5rem;
  height: auto;
  overflow: visible;
  vertical-align: middle;
}
/* Keep the existing two-character layout box around the wider artwork. */
.fx-mascot[data-friend] { aspect-ratio: 169 / 132; }
.fx-mascot, #reading-mascot { cursor: pointer; }
.fx-mascot:focus-visible, #reading-mascot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
.fx-tap-waving .fx-path-idle,
.fx-tap-waving > .fx-character:has(> .fx-tap-wave) > :not(.fx-tap-wave) { opacity: 0; animation: none !important; }
.fx-tap-waving .fx-path-wave { opacity: 1; animation: none !important; }
.fx-mascot-bubble { position: fixed; z-index: 60; translate: -50% 0; width: max-content; max-width: min(180px, 90vw);
  padding: 4px 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink);
  box-shadow: 0 3px 10px #14223533; font-size: 12px; font-weight: 700; line-height: 1.35; text-align: center;
  pointer-events: none; animation: fx-fade-in .16s ease-out; }
.fx-recording .fx-mascot-bubble { display: none; }
.fx-mascot-shadow { filter: blur(2px); }
.fx-mascot-body {
  transform-origin: 50% 90%;
  animation: fx-idle 3.2s ease-in-out infinite;
}
.fx-cheer .fx-mascot-body { animation: fx-cheer 1.1s ease-in-out 3, fx-idle 3.2s ease-in-out 3.3s infinite; }
.fx-sleep .fx-mascot-body { animation: none; }
@media (prefers-reduced-motion: no-preference) {
  .fx-mascot-speaking .fx-mascot-body {
    transform-box: fill-box;
    animation: fx-speaking .23s ease-in-out infinite alternate;
  }
}
@keyframes fx-speaking {
  from { scale: 1.025 .98; }
  to { scale: .99 1.04; }
}
@keyframes fx-idle {
  50% { transform: translateY(-2.5px) rotate(-1deg); }
}
@keyframes fx-cheer {
  0%, 85%, 100% { transform: none; }
  16% { transform: translateY(1.5px) scale(1.02, .98); }
  46% { transform: translateY(-7px) rotate(-3deg); }
}

.fx-ring { width: 2rem; height: 2rem; vertical-align: middle; overflow: visible; }
.fx-ring-track { stroke: var(--line); }
.fx-ring-fill {
  stroke: #f28c28;
  stroke-linecap: round;
  stroke-dasharray: 100 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset .55s cubic-bezier(.22, .75, .2, 1);
}

/* Confetti starts in the sheet illustration, or above the page for a daily goal. */
.fx-confetti {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 48;
  pointer-events: none;
}
.fx-stage > .fx-confetti { position: absolute; z-index: 2; }
.fx-piece {
  position: absolute;
  top: 20%;
  left: 50%;
  width: 5px;
  height: 9px;
  border-radius: 1.5px;
  animation: fx-scatter 1.1s var(--fx-delay) both;
}
.fx-piece:nth-child(3n) { width: 6px; height: 6px; border-radius: 50%; }
.fx-piece:nth-child(4n) { width: 4px; height: 8px; border-radius: 70% 30% 65% 35%; }
@keyframes fx-scatter {
  0% { opacity: 0; transform: translate(0, 8px); animation-timing-function: ease-out; }
  12% { opacity: 1; }
  38% { transform: translate(calc(var(--fx-dx) * .73), var(--fx-lift)) rotate(var(--fx-turn)); animation-timing-function: ease-in; }
  100% { opacity: 0; transform: translate(var(--fx-dx), 180px) rotate(calc(var(--fx-turn) * 1.6)); }
}

.fx-float {
  position: fixed;
  z-index: 50;
  display: grid;
  place-items: center;
  pointer-events: none;
  border-radius: 2em;
  white-space: nowrap;
  font: inherit;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.2;
  transform: translate(-50%, -100%);
}
.fx-xp {
  padding: 6px 12px;
  background: #ffe5b1;
  color: #653611;
  border: 1px solid #e6b45f;
  animation: fx-rise .95s ease-out both;
}
.fx-check {
  width: 31px;
  height: 31px;
  color: var(--ok);
  border: 2px solid currentColor;
  background: var(--card);
  font-size: 21px;
  animation: fx-pop .9s ease-out both;
}
@keyframes fx-rise {
  0% { opacity: 0; transform: translate(-50%, -82%); }
  18% { opacity: 1; }
  72% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, calc(-100% - 38px)); }
}
@keyframes fx-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.7); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
  36%, 76% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%); }
}
.fx-notices {
  position: fixed;
  inset: calc(env(safe-area-inset-top) + 10px) 8px auto;
  z-index: 49;
  display: grid;
  justify-items: center;
  gap: 5px;
  pointer-events: none;
}
.fx-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 5px 14px 5px 6px;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--card-shadow);
  font-size: 14px;
  font-weight: 650;
  animation: fx-notice 2s ease both;
}
.fx-notice-icon {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 4px;
  border-radius: 50%;
  background: #ffe8bc;
  color: #784b12;
  font-variant-numeric: tabular-nums;
}
.fx-combo .fx-notice-icon { color: #1f4e79; background: #deedfa; }
.fx-goal .fx-notice-icon { background: #e8b923; color: #583615; }
@keyframes fx-notice {
  0%, 100% { opacity: 0; }
  0% { transform: translateY(-5px); }
  12%, 86% { opacity: 1; transform: none; }
}

.fx-sheet-open { overflow: hidden; }
.fx-sheet {
  --fx-tint: #f28c28;
  --fx-ribbon: #c0392b;
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  width: 100%; height: 100%; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; overflow: auto; overscroll-behavior: contain; border: 0;
  color: var(--ink); font: inherit;
  background: transparent;
}
.fx-sheet[open] { animation: fx-arrive .23s cubic-bezier(.2, .72, .18, 1) both; }
.fx-sheet::backdrop { background: rgb(14 22 32 / 53%); animation: fx-fade-in .18s ease-out; }
.fx-sheet-level { --fx-tint: #1f4e79; --fx-ribbon: #1f4e79; }
.fx-sheet-badge { --fx-tint: #e8b923; }
.fx-sheet[open] { display: flex; }
.fx-sheet-goal { --fx-tint: #e8b923; --fx-ribbon: #3fa34d; }
.fx-card {
  width: min(100% - 24px, 490px); min-width: 0; margin: auto;
  padding: max(20px, env(safe-area-inset-top)) calc(22px + env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) calc(22px + env(safe-area-inset-left));
  border: 1px solid var(--line); border-radius: var(--window-radius); background: var(--card);
  box-shadow: var(--window-shadow); text-align: center;
}
.fx-goal-score { font-size: 24px; font-weight: 850; margin: 10px 0; color: var(--accent); }
.fx-stage {
  position: relative; isolation: isolate; display: grid; grid-template: minmax(0,1fr) / minmax(0,1fr);
  place-items: center; overflow: hidden; height: clamp(135px,31dvh,255px); margin: 0 0 15px;
  background: radial-gradient(ellipse closest-side, color-mix(in srgb, var(--fx-tint) 32%, transparent), transparent);
}
.fx-stage::before {
  content: ""; position: absolute; z-index: -1; height: 120%; aspect-ratio: 1;
  background: repeating-conic-gradient(from 7deg, transparent 0deg 14deg, color-mix(in srgb, var(--fx-tint) 23%, transparent) 14deg 28deg);
  mask-image: radial-gradient(closest-side, black 40%, transparent 100%);
}
.fx-stage::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 15px;
  left: 26%;
  top: 55%;
  background: var(--fx-tint);
  clip-path: polygon(50% 0, 61% 35%, 100% 50%, 61% 62%, 50% 100%, 38% 62%, 0 50%, 38% 35%);
}
.fx-stage::after { top: 29%; left: 72%; width: 13px; height: 21px; }
.fx-stage > .fx-mascot { width: auto; height: 96%; max-width: 65%; }
.fx-sheet-tree { --fx-tint: #d7a650; }
.fx-sheet-tree .fx-stage { height: clamp(155px, 30dvh, 255px); margin: 4px 0 0; overflow: visible; }
.fx-sheet-tree .fx-stage::after { display: none; }
.fx-sheet-tree .fx-stage > .fx-mascot { position: absolute; right: 0; bottom: 10%; width: min(31%, 124px); height: auto; }
.fx-tree-drawings { position: relative; isolation: isolate; height: 100%; max-width: 73%; width: auto; aspect-ratio: 1;
  margin-inline-end: 19%; display: grid; place-items: center; }
.fx-tree-drawings .tree-art { grid-area: 1 / 1; width: 100%; height: 100%; }
.tree-plant, .tree-soil { transform-origin: 32px 52px; }
.fx-tree-copy h3 { margin: 0 0 5px; color: var(--heading); font-size: clamp(19px, 5vw, 24px); }
.fx-tree-copy p { margin: 4px 0; font-size: 14px; }
.fx-tree-copy .fx-tree-next { color: var(--muted); }
.fx-tree-copy .fx-tree-seeds { display: inline-flex; align-items: center; gap: 5px; margin: 6px 0;
  padding: 4px 10px; border-radius: var(--chip-radius); background: var(--gold-soft); color: var(--ink); font-weight: 750; }
.fx-tree-seeds svg { width: 18px; height: 18px; color: var(--ruby); }
.fx-tree-drawings .fx-burst { inset: 58% auto auto 54%; z-index: 1; }
.fx-tree-drawings .fx-burst:last-child { inset: 76% auto auto 40%; }
@media (prefers-reduced-motion: no-preference) {
  .fx-tree-before .tree-soil { display: none; }
  .fx-tree-before .tree-plant { animation: tree-sink .46s ease-in both; }
  .fx-tree-after .tree-soil { animation: tree-soil-bump .65s ease-in-out .2s both; }
  .fx-tree-after .tree-plant { animation: tree-rise .86s cubic-bezier(.24,.72,.32,1) .35s both; }
  .fx-tree-after .tree-leaf { animation: tree-unfold .42s ease-out .83s both; }
  .fx-tree-after g:nth-child(odd) > .tree-leaf { animation-delay: .94s; }
  .fx-tree-after .tree-blossom { animation: tree-bloom .42s ease-out 1.12s both; }
  .fx-tree-after .tree-fruit { animation: tree-bloom .46s cubic-bezier(.2,.7,.34,1.5) 1.22s both; }
  .fx-tree-after g:nth-child(even) > :is(.tree-blossom, .tree-fruit) { animation-delay: 1.3s; }
  .fx-tree-drawings .fx-particle { animation-delay: calc(1.14s + var(--burst-delay)); }
  .fx-tree-drawings .fx-burst:last-child .fx-particle { animation-delay: calc(1.36s + var(--burst-delay)); }
}
@media (prefers-reduced-motion: reduce) {
  html:not(.fx-recording) .reader .fx-tree-before { animation: tree-fade-out .35s ease-in-out both !important; }
  html:not(.fx-recording) .reader .fx-tree-after { animation: fx-fade-in .35s ease-in-out both !important; }
}
@keyframes tree-fade-out { to { opacity: 0; } }
@keyframes tree-sink { 27% { transform: scale(1.08,.87); } to { opacity: 0; transform: translateY(5px) scale(.23,.04); } }
@keyframes tree-soil-bump { 32% { transform: translateY(-3px) scale(.94,1.28); } 65% { transform: scale(1.04,.84); } }
@keyframes tree-rise {
  0% { opacity: 0; transform: translateY(3px) scale(.55,.04); }
  18% { opacity: 1; transform: scale(.76,.28); }
  58% { transform: scale(.9,1.11); }
  76% { transform: scale(1.05,.92); }
  100% { transform: none; }
}
@keyframes tree-unfold { from { opacity: 0; transform: rotate(-22deg) scale(.09,.03); } }
@keyframes tree-bloom { from { opacity: 0; transform: scale(.05); } }
.fx-medal {
  position: relative;
  height: 80%;
  aspect-ratio: 104 / 112;
  transform: rotate(-4deg);
}
.fx-medal-art { display: block; width: 100%; height: 100%; }
.fx-medal-value {
  position: absolute;
  inset: 14% 18% 31%;
  display: grid;
  place-items: center;
  color: #1f4e79;
  font-weight: 800;
  font-size: clamp(24px, 4.3vh, 34px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.fx-heading {
  margin: 0;
  color: var(--heading);
  font-size: clamp(25px, 5vw, 34px);
  line-height: 1.3;
  font-weight: 750;
  overflow-wrap: anywhere;
}
.fx-label, .fx-description { color: var(--muted); }
.fx-label { margin: 0 0 3px; font-size: 14px; font-weight: 600; }
.fx-description { margin: 8px 0 0; font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; }
.fx-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0 0;
  text-align: start;
}
.fx-stat {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--chip-radius);
  background: var(--soft);
}
.fx-stat-label { color: var(--muted); font-size: 13px; line-height: 1.35; }
.fx-stat-value {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 23px;
  line-height: 1.12;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
}
.fx-stat:first-child {
  background: color-mix(in srgb, #f28c28 9%, var(--card));
  border-color: color-mix(in srgb, #f28c28 50%, var(--line));
}
.fx-continue {
  display: block;
  width: 100%;
  min-height: 50px;
  margin: 18px 0 0;
  padding: 9px 14px;
  border: 0;
  background: var(--action);
  color: white;
  box-shadow: var(--action-shadow);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.fx-continue:active { transform: translateY(2px); }
.fx-continue:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@keyframes fx-arrive { from { opacity: 0; transform: translateY(16px); } }
@keyframes fx-fade-in { from { opacity: 0; } }
@media (min-width: 700px) {

  .fx-card { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .fx-mascot-body, .fx-cheer .fx-mascot-body { animation: none; }
  .fx-confetti { display: none; }
  .fx-ring-fill { transition: none; }
  .fx-sheet[open], .fx-sheet::backdrop, .fx-float, .fx-notice { animation: none; }
  .fx-check { transform: translate(-50%, -50%); }
}
/* Also freeze artwork already mounted by the host at the instant the mic opens. */
.fx-recording .fx-mascot-body, .fx-recording .fx-ring-fill {
  animation: none;
  transition: none;
}
.fx-recording .fx-float, .fx-recording .fx-confetti, .fx-recording .fx-notices { display: none; }

.fx-seed-flight { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.fx-flying-seed { position: absolute; width: 19px; height: 19px; margin: -10px; animation: fx-collect-seed .62s cubic-bezier(.33,.07,.68,.93) both; }
.fx-seed-label, .fx-treasure {
  position: fixed; padding: 6px 11px; border: 1px solid var(--ruby); border-radius: 12px;
  color: var(--ruby); background: var(--ruby-paper); box-shadow: 0 3px 9px #36212920;
  font-size: 14px; font-weight: 800; pointer-events: none;
}
.fx-seed-label { animation: fx-label-in .22s .28s ease-out backwards; }
.fx-treasure { z-index: 50; top: 27%; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; white-space: nowrap; background: var(--paper); }
.fx-treasure svg { width: 62px; height: 58px; }
.fx-chest-lid { transform-origin: 15px 32px; transform: rotate(-17deg) translateY(-9px); animation: fx-open-lid .55s ease-out both; }
.fx-chest-seeds { animation: fx-label-in .35s .22s ease-out backwards; }
.fx-purchased {
  position: absolute; inset: 0; display: grid; place-items: center; border: 2px solid #d99b44; border-radius: inherit;
  color: #ffe2a3; text-shadow: 0 1px 3px #75401c, -13px 8px 0 #f8bf63, 12px -9px 0 #f6ca80; pointer-events: none;
  font-size: 24px; animation: fx-purchase .8s ease-out both;
}
@keyframes fx-collect-seed {
  0% { opacity: 0; transform: translate(var(--start-x),var(--start-y)) rotate(-26deg); }
  20% { opacity: 1; transform: translate(var(--burst-x),var(--burst-y)) rotate(-14deg); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(0,0) rotate(15deg) scale(.65); }
}
@keyframes fx-label-in { from { transform: translateY(6px); opacity: 0; } }
@keyframes fx-open-lid { 0%,20% { transform: none; } 70% { transform: rotate(-21deg) translateY(-11px); } }
@keyframes fx-purchase { 0% { opacity: 0; scale: .78; } 28% { opacity: 1; } 100% { opacity: 0; scale: 1.08; } }
@media (prefers-reduced-motion: reduce) { .fx-flying-seed { display: none; } }
.fx-recording :is(.fx-seed-flight,.fx-treasure,.fx-purchased) { display: none; }

@media (prefers-reduced-motion: no-preference) {
  html:not(.fx-recording) :is(#reward-sheet[open] #reward-art > .treasure-art, #lesson-sheet[open] #sheet-icon:has(> .treasure-art)) {
    animation: treasure-arrive .48s cubic-bezier(.2,.8,.32,1.2) both;
  }
}
@keyframes treasure-arrive { from { transform: translateY(15px) rotate(-8deg) scale(.68); opacity: 0; } }

.fx-chest-copy { display: grid; gap: 3px; }
.fx-chest-copy small { font-size: 12px; }
.fx-quest-toast { position: fixed; z-index: 49; inset: calc(var(--hud) + 36px) auto auto 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); padding: 9px 14px; border: 1px solid var(--atlas-rule); border-radius: 12px; background: var(--paper); color: var(--atlas-ink); box-shadow: 0 3px 12px #14223522; pointer-events: none; font-size: 14px; }
.fx-quest-progress, .fx-quest-reward { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fx-quest-progress b { font-variant-numeric: tabular-nums; color: var(--ok); }
.fx-quest-reward > :last-child { color: var(--ok); }
.fx-quest-reward .fx-mascot { pointer-events: auto; }
.fx-card > .share-action { margin: 12px 0 0; }
@media (prefers-reduced-motion: no-preference) {
  html:not(.fx-recording) .quest-finished, html:not(.fx-recording) .fx-quest-reward .quest-mark { animation: quest-turn .35s ease-out; }
  html:not(.fx-recording) .quest-changed .quest-progress { animation: quest-update .45s ease-out; }
  html:not(.fx-recording) .fx-quest-toast { animation: quest-arrive .17s ease-out; }
}
@keyframes quest-turn { from { transform: perspective(420px) rotateX(70deg); } }
@keyframes quest-update { from { opacity: .4; transform: translateY(2px); } }
@keyframes quest-arrive { from { opacity: 0; margin-top: 5px; } }

/* Sentence reactions share the recorder's corner and can follow the feedback into its dialog. */
#reading-mascot-dock { display: none; position: fixed; right: calc(var(--pad) + env(safe-area-inset-right));
  bottom: calc(5px + env(safe-area-inset-bottom)); z-index: 6; pointer-events: none; --reader-reaction-lift: -52px; }
.reader:is([data-view=read], [data-view=review]) #reading-mascot-dock { display: block; }
.reader[data-view=read]:not(.owner-review) #reading-mascot-dock { bottom: calc(14px + env(safe-area-inset-bottom)); }
#reading-mascot { position: relative; width: clamp(60px, 19vw, 86px); height: 62px; pointer-events: auto; }
.feedback-content #reading-mascot { margin-inline-start: auto; flex: none; }
#reading-mascot :is(.reading-idle, .fx-sentence-reaction) { position: absolute; inset: auto 0 0; }
#reading-mascot .fx-mascot { width: 100%; }
#reading-mascot .fx-mascot-body, .fx-path .fx-mascot-body { animation: none; }
#reading-mascot:has(.fx-sentence-reaction) .reading-idle { visibility: hidden; }
.fx-retry-bubble { position: absolute; right: 0; bottom: calc(100% - 8px); width: max-content; padding: 3px 7px;
  background: var(--blue-soft); color: var(--ink); border: 1px solid var(--line); border-radius: 9px;
  font-size: 11px; font-weight: 700; line-height: 1.35; }
.feedback-content .fx-retry-bubble { bottom: -7px; }
.fx-character, .fx-companion { transform-box: fill-box; transform-origin: 50% 87%; }
.fx-sentence-reaction { --reaction-offset: 0ms; }
.fx-burst { position: absolute; left: 47%; top: 44%; pointer-events: none; }
.fx-shop-seeds { left: 9px; top: 50%; z-index: 3; }
.fx-particle { position: absolute; width: 13px; height: 13px; margin: -6px; color: #ffe1a0;
  text-shadow: 0 1px 2px #744320; font-size: 13px; line-height: 1; opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
  .fx-sentence-reaction .fx-character { animation: var(--reaction-name) var(--reaction-time) ease-in-out var(--reaction-offset) both; }
  .fx-sentence-reaction .fx-companion { animation: reader-pet-hop var(--reaction-time) ease-in-out var(--reaction-offset) both; }
  .fx-react-hop { --reaction-name: reader-hop; }
  .fx-react-spin { --reaction-name: reader-spin; }
  .fx-react-wave { --reaction-name: reader-wave; }
  .fx-react-dance { --reaction-name: reader-dance; }
  .fx-react-clap { --reaction-name: reader-clap; }
  .fx-react-seeds { --reaction-name: reader-hop; }
  .fx-react-thumb { --reaction-name: reader-thumb; }
  .fx-react-think { --reaction-name: reader-think; }
  .fx-react-think .fx-companion { animation-name: reader-think; }
  .fx-react-finish { --reaction-name: reader-finish; }
  .fx-retry-bubble { animation: fx-fade-in .18s ease-out var(--reaction-offset) both; }
  .fx-particle { animation: fx-burst-out .55s ease-out calc(.14s + var(--burst-delay) + var(--reaction-offset, 0ms)) both; }
  .fx-react-clap .fx-particle { animation: reader-clap-flash .28s ease-out calc(.18s + var(--reaction-offset)) 2 both; }
  .fx-shop-seeds .fx-particle { animation-delay: var(--burst-delay); }
}
@media (prefers-reduced-motion: reduce) {
  html:not(.fx-recording) .reader .fx-sentence-reaction { animation: fx-fade-in .22s ease-out var(--reaction-offset) both !important; }
  html:not(.fx-recording) .reader .fx-purchased { animation: fx-twinkle .8s ease-out both !important; }
}
@keyframes fx-soft-pulse { 0% { opacity: .42; } 45%, 100% { opacity: 1; } }
@keyframes fx-twinkle { 0%, 100% { opacity: 0; } 38% { opacity: 1; } }
@keyframes reader-hop {
  18% { transform: translateY(2px) scale(1.13,.88); }
  43% { transform: translateY(-25px) scale(.94,1.1); }
  68% { transform: translateY(1px) scale(1.08,.93); }
  85% { transform: translateY(-5px); }
}
@keyframes reader-spin {
  16%, 84% { transform: none; }
  31% { transform: translateY(-9px) scaleX(.08); }
  50% { transform: translateY(-16px) scaleX(-1); }
  68% { transform: translateY(-8px) scaleX(-.08); }
}
@keyframes reader-wave {
  20%, 48% { transform: translateY(-4px) rotate(-12deg); }
  35%, 63% { transform: rotate(6deg); }
}
@keyframes reader-dance {
  24%, 68% { transform: translate(-9px,-8px) rotate(-11deg); }
  45%, 83% { transform: translate(9px,-8px) rotate(11deg); }
}
@keyframes reader-clap {
  18%, 46% { transform: scale(.94,1.05); }
  30%, 58% { transform: scale(1.09,.97); }
}
@keyframes reader-clap-flash {
  0% { opacity: 0; }
  48% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--burst-x), calc(var(--burst-y) * .58)); }
}
@keyframes reader-thumb { 25%, 64% { transform: translateY(-8px) rotate(-7deg) scale(1.12); } }
@keyframes reader-think { 33%, 70% { transform: rotate(9deg); } }
@keyframes reader-pet-hop {
  18%, 69% { transform: scale(1.08,.92); }
  38% { transform: translateY(-17px) rotate(9deg); }
  57% { transform: translateY(-9px) rotate(-5deg); }
}
@keyframes reader-finish {
  17% { transform: scale(1.18,.88); }
  37%, 69% { transform: translateY(-32px) rotate(-9deg) scale(1.18); }
  53%, 83% { transform: translateY(-4px) rotate(8deg) scale(1.08); }
}
@keyframes fx-burst-out {
  0% { opacity: 0; transform: scale(.65); }
  18%, 58% { opacity: 1; }
  77% { transform: translate(var(--burst-x), var(--burst-y)) rotate(var(--burst-rotation)); }
  100% { opacity: 0; transform: translate(var(--burst-x), calc(var(--burst-y) + 8px)) rotate(var(--burst-rotation)); }
}

/* Owner: "I cannot see the animations". Make the reading reactions big and obvious: Նռնիկ grows out of his corner
   for the reaction (about twice his size) and settles back; he breathes gently while waiting. */
@media (prefers-reduced-motion: no-preference) {
  #reading-mascot .fx-sentence-reaction { transform-origin: 100% 100%;
    animation: reader-grow var(--reaction-time) cubic-bezier(.3,1.4,.5,1) var(--reaction-offset) both; z-index: 5; }
  #reading-mascot .reading-idle .fx-mascot { animation: reader-breathe 2.6s ease-in-out infinite; transform-origin: 50% 100%; }
  .feedback-content, .feedback-content > * { overflow: visible; }
}
@keyframes reader-grow {
  0% { transform: scale(1); }
  14%, 82% { transform: translate(-14px, var(--reader-reaction-lift, -10px)) scale(2); }
  100% { transform: scale(1); }
}
@keyframes reader-breathe { 50% { transform: translateY(-3px) scale(1.03, .97); } }
