/* ==========================================================================
   Мочи — стили страницы и персонажа
   ========================================================================== */

:root {
  --bg: #f6f2fb;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --border: rgba(40, 24, 80, 0.09);
  --text: #241a3b;
  --muted: #6c6485;
  --eye: #231934;
  --shadow: 0 18px 40px -22px rgba(60, 30, 120, 0.35);
  --shadow-c: rgba(50, 26, 110, 0.14);
  --user-bg: #241a3b;
  --user-text: #fbf9ff;
  --blob-opacity: 0.8;
  --font: 'Nunito', ui-rounded, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Unbounded', 'Nunito', system-ui, sans-serif;

  /* характер (по умолчанию «Добряк») */
  --b1: #dcfbeb;
  --b2: #86e3c3;
  --b3: #3dbb95;
  --ink: #1d6f58;
  --leaf: #8be36d;
  --leaf-ink: #2e8639;

  /* настроение фона */
  --mood-a: #e6ebf7;
  --mood-b: #f1e6f7;
  --mood-c: #e2f4ef;
}

/* тёмная тема: как в системе (data-theme нет) или выбрана вручную (D20: кнопка темы) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #16131f;
    --surface: rgba(36, 31, 52, 0.72);
    --surface-solid: #262036;
    --border: rgba(255, 255, 255, 0.08);
    --text: #f1edf9;
    --muted: #a59dbb;
    --shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.7);
    --shadow-c: rgba(0, 0, 0, 0.35);
    --user-bg: #f1edf9;
    --user-text: #1d1730;
    --blob-opacity: 0.2;
    --wave: var(--b2);
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #16131f;
  --surface: rgba(36, 31, 52, 0.72);
  --surface-solid: #262036;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f1edf9;
  --muted: #a59dbb;
  --shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.7);
  --shadow-c: rgba(0, 0, 0, 0.35);
  --user-bg: #f1edf9;
  --user-text: #1d1730;
  --blob-opacity: 0.2;
  --wave: var(--b2);
  color-scheme: dark;
}

:root[data-persona='grumpy'] { --b1: #ffe2de; --b2: #ff9c91; --b3: #e3554d; --ink: #962f2a; }
:root[data-persona='hyper'] { --b1: #fff7cc; --b2: #ffd866; --b3: #ffa62e; --ink: #9d5c06; }
:root[data-persona='dreamy'] { --b1: #f0eaff; --b2: #c1b1ff; --b3: #8c75ef; --ink: #4a399e; }

:root[data-mood='happy'] { --mood-a: #fff0b0; --mood-b: #ffd6e2; --mood-c: #d6f4ff; }
:root[data-mood='laughing'] { --mood-a: #ffe59c; --mood-b: #ffcfb3; --mood-c: #fff3c4; }
:root[data-mood='excited'] { --mood-a: #ffe07f; --mood-b: #b5f0ff; --mood-c: #ffc7e6; }
:root[data-mood='love'] { --mood-a: #ffc4dc; --mood-b: #ffe0ee; --mood-c: #ffd0d6; }
:root[data-mood='shy'] { --mood-a: #ffd1e2; --mood-b: #ffe8d4; --mood-c: #f7dcf2; }
:root[data-mood='proud'] { --mood-a: #ffe7a1; --mood-b: #d6efff; --mood-c: #e9ddff; }
:root[data-mood='surprised'] { --mood-a: #d3eeff; --mood-b: #fff0bd; --mood-c: #e4e0ff; }
:root[data-mood='thinking'] { --mood-a: #e0e3ff; --mood-b: #e2f2ff; --mood-c: #efe6ff; }
:root[data-mood='confused'] { --mood-a: #e8ddff; --mood-b: #d8f1ec; --mood-c: #f4e2ff; }
:root[data-mood='sad'] { --mood-a: #c9dcff; --mood-b: #dbe2f0; --mood-c: #d4e6f7; }
:root[data-mood='crying'] { --mood-a: #b8d0ff; --mood-b: #d0d9ef; --mood-c: #c3dcff; }
:root[data-mood='angry'] { --mood-a: #ffb8ab; --mood-b: #ffd4bb; --mood-c: #ffc1c1; }
:root[data-mood='annoyed'] { --mood-a: #f0d9c6; --mood-b: #e6e0ee; --mood-c: #f2e4d2; }
:root[data-mood='scared'] { --mood-a: #d2d9ef; --mood-b: #e5d5f3; --mood-c: #cfd8f5; }
:root[data-mood='sleepy'] { --mood-a: #d6d2f3; --mood-b: #c8d5ec; --mood-c: #ddd7f0; }

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--b3) 70%, transparent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --- фон настроения ---------------------------------------------------- */

.mood {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  width: 62vmax;
  height: 62vmax;
  border-radius: 50%;
  filter: blur(80px);
  opacity: var(--blob-opacity);
  transition: background-color 1.4s ease;
  animation: drift 22s ease-in-out infinite alternate;
}

.b1 { top: -26vmax; left: -18vmax; background: var(--mood-a); }
.b2 { bottom: -30vmax; right: -16vmax; background: var(--mood-b); animation-delay: -7s; }
.b3 { top: 20vh; right: 18vw; width: 36vmax; height: 36vmax; background: var(--mood-c); animation-delay: -13s; }

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(6vmax, 4vmax) scale(1.12); }
}

/* --- шапка ------------------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  flex: none;
}

.brand-mark path {
  fill: var(--b2);
  stroke: var(--ink);
  stroke-width: 2.6;
  transition: fill 0.6s, stroke 0.6s;
}

.brand-mark circle {
  fill: var(--eye);
}

.brand-name {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.brand-tag {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.seg button {
  border: 0;
  background: transparent;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--muted);
  transition: background 0.2s, color 0.2s;
}

.seg button[aria-pressed='true'] {
  background: var(--text);
  color: var(--bg);
}

.pill-btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(12px);
  font-size: 13px;
  font-weight: 800;
  transition: transform 0.15s, background 0.2s;
}

.pill-btn { padding: 0 13px 0 10px; }
.icon-btn { width: 38px; flex: none; }

.pill-btn:active,
.icon-btn:active { transform: scale(0.94); }

.pill-btn svg,
.icon-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pill-btn .i-speaker { fill: currentColor; }
.pill-btn .i-wave1,
.pill-btn .i-wave2,
.pill-btn .i-mute { display: none; }
.pill-btn[data-sound='chirp'] .i-wave1 { display: block; }
.pill-btn[data-sound='voice'] .i-wave1,
.pill-btn[data-sound='voice'] .i-wave2 { display: block; }
.pill-btn[data-sound='off'] .i-mute { display: block; }
.pill-btn[data-sound='off'] { color: var(--muted); }

/* кнопка темы: показан значок выбранной */
#themeBtn :is(.i-auto, .i-sun, .i-moon) { display: none; }
#themeBtn[data-theme='auto'] .i-auto,
#themeBtn[data-theme='light'] .i-sun,
#themeBtn[data-theme='dark'] .i-moon { display: inline; }
#themeBtn .i-fill,
#themeBtn .i-moon path { fill: currentColor; }

/* подписи, которые видны только в меню телефона */
.btn-label { display: none; }

/* --- меню на телефоне (D20) ------------------------------------------------ */

.menu-btn { display: none; }
.menu,
.menu-backdrop { display: none; }

@media (max-width: 860px) {
  .controls,
  .personas { display: none; }
  .menu-btn { display: inline-flex; }

  .menu-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(20, 12, 40, 0.34);
    animation: menu-fade 0.18s ease;
  }

  .menu:not([hidden]) {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: fixed;
    z-index: 41;
    top: calc(8px + env(safe-area-inset-top));
    left: 8px;
    right: 8px;
    max-height: calc(100dvh - 16px - env(safe-area-inset-top));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px 16px 18px;
    border-radius: 24px;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    box-shadow: 0 24px 60px -18px rgba(20, 10, 50, 0.55);
    animation: menu-in 0.24s cubic-bezier(0.3, 1.3, 0.5, 1);
  }
}

@keyframes menu-fade { from { opacity: 0; } }
@keyframes menu-in { from { opacity: 0; transform: translateY(-10px) scale(0.98); } }

.menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.menu-title {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
}

.menu-row h3 {
  margin: 0 0 8px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.menu-row-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.menu-row-inline h3 { margin: 0; }

.menu .mood-chip { margin: 0; font-size: 14px; }
.menu .btn-label { display: inline; font-size: 14px; font-weight: 800; }

.menu .gender-seg { display: flex; width: 100%; }
.menu .gender-btn {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  height: 42px;
  font-size: 20px;
}

.menu .persona-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.menu .persona-btn { justify-content: flex-start; padding: 6px 12px 6px 6px; font-size: 14px; }
.menu .persona-btn svg { width: 26px; height: 26px; }
.menu .persona-desc { display: block; margin: 8px 2px 0; text-align: left; }

.menu .pill-btn { width: auto; padding: 0 14px 0 10px; }
.menu .pill-label { display: inline; }

.menu #resetBtn {
  width: 100%;
  height: 46px;
  gap: 8px;
}

/* --- раскладка --------------------------------------------------------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 440px);
  gap: 28px;
  max-width: 1200px;
  height: calc(100dvh - 68px);
  margin: 0 auto;
  padding: 0 20px 20px;
}

.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding-top: clamp(16px, 4vh, 48px);
}

.char-wrap {
  position: relative;
  width: min(390px, 44vh, 100%);
  aspect-ratio: 1;
  cursor: pointer;
  touch-action: none; /* зажать Мочи — говорить: без прокрутки и масштаба */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none; /* iOS: долгое нажатие на Мочи — не системное меню */
  -webkit-tap-highlight-color: transparent;
}

/* курсор печати — Мочи печатает ответ прямо в ленте (D19) */
.msg .caret {
  display: inline-block;
  width: 0.5ch;
  animation: caret 0.8s steps(1) infinite;
}

@keyframes caret {
  50% { opacity: 0; }
}

/* --- подпись эмоции и характеры --------------------------------------- */

.mood-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  padding: 6px 13px 6px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--muted);
}

.mood-chip .emo {
  font-size: 17px;
  line-height: 1;
}

.mood-chip.pop {
  animation: chip-pop 0.4s cubic-bezier(0.3, 1.6, 0.5, 1);
}

@keyframes chip-pop {
  0% { transform: scale(0.85); }
  100% { transform: scale(1); }
}

.personas {
  margin-top: 22px;
  text-align: center;
  max-width: 100%;
}

.personas-title {
  margin: 0 0 9px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.persona-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
}

.persona-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

/* мальчик / девочка */
.gender-seg {
  display: inline-flex;
  flex: none;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  backdrop-filter: blur(12px);
}

.gender-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 19px;
  line-height: 1;
  opacity: 0.55;
  filter: grayscale(0.6);
  transition: background 0.2s, opacity 0.2s, filter 0.2s, transform 0.15s;
}

.gender-btn:active { transform: scale(0.92); }

.gender-btn[aria-checked='true'] {
  opacity: 1;
  filter: none;
  background: color-mix(in srgb, var(--b2) 45%, var(--surface-solid));
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.persona-btn {
  --c2: #86e3c3;
  --c3: #1d6f58;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(12px);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.persona-btn[data-p='grumpy'] { --c2: #ff9c91; --c3: #962f2a; }
.persona-btn[data-p='hyper'] { --c2: #ffd866; --c3: #9d5c06; }
.persona-btn[data-p='dreamy'] { --c2: #c1b1ff; --c3: #4a399e; }

.persona-btn:active { transform: scale(0.95); }

.persona-btn svg {
  width: 26px;
  height: 26px;
  flex: none;
}

.persona-btn svg path { fill: var(--c2); stroke: var(--c3); stroke-width: 2.4; }
.persona-btn svg circle { fill: var(--eye); }

.persona-btn[aria-checked='true'] {
  border-color: var(--c3);
  background: color-mix(in srgb, var(--c2) 38%, var(--surface-solid));
}

.persona-desc {
  min-height: 1.4em;
  margin: 9px 0 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
}

/* --- голос: «зажми меня и говори» под Мочи (D19) --------------------------- */

.voice-bar {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  margin-top: 10px;
  padding: 5px 14px 5px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  font-size: 14px;
  font-weight: 800;
  color: var(--muted);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.voice-bar[hidden] { display: none; }

.voice-bar:not([data-state='idle']) {
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: var(--shadow);
}

/* волна: высота палочек — громкость (--lvl ставит app.js), в ожидании ответа — сама «дышит» */
.wave {
  --lvl: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 18px;
}

.wave i {
  width: 3.5px;
  height: 100%;
  border-radius: 3px;
  background: var(--wave, var(--ink)); /* в тёмной теме --ink слишком тёмный — там --wave светлее */
  transform: scaleY(calc(0.18 + var(--lvl) * var(--k, 1)));
  transition: transform 0.08s linear, background 0.6s;
}

.wave i:nth-child(1) { --k: 0.45; }
.wave i:nth-child(2) { --k: 0.8; }
.wave i:nth-child(3) { --k: 1; }
.wave i:nth-child(4) { --k: 0.7; }
.wave i:nth-child(5) { --k: 0.4; }

.voice-bar[data-state='idle'] .wave i { transform: scaleY(0.35); opacity: 0.6; }
.voice-bar[data-state='idle'] .wave i:nth-child(odd) { transform: scaleY(0.55); }
.voice-bar[data-state='listening'] .wave i { background: #ff4f6d; }

.voice-bar[data-state='thinking'] .wave i { animation: wave-wait 1.1s ease-in-out infinite; }
.voice-bar[data-state='thinking'] .wave i:nth-child(2) { animation-delay: 0.12s; }
.voice-bar[data-state='thinking'] .wave i:nth-child(3) { animation-delay: 0.24s; }
.voice-bar[data-state='thinking'] .wave i:nth-child(4) { animation-delay: 0.36s; }
.voice-bar[data-state='thinking'] .wave i:nth-child(5) { animation-delay: 0.48s; }

@keyframes wave-wait {
  0%, 100% { transform: scaleY(0.2); opacity: 0.5; }
  40% { transform: scaleY(0.62); opacity: 1; }
}


/* пока зажат — Мочи подсвечен */
.char-wrap.holding .mochi { filter: drop-shadow(0 0 18px color-mix(in srgb, #ff4f6d 55%, transparent)); }

@media (max-width: 860px) {
  .voice-bar { min-height: 30px; margin-top: 6px; padding: 3px 12px 3px 10px; font-size: 13px; }
}

/* --- чат --------------------------------------------------------------- */

.chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  overflow: hidden;
}

.log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 16px 10px;
}

.msg {
  display: flex;
  gap: 8px;
  max-width: 88%;
  animation: msg-in 0.3s cubic-bezier(0.3, 1.4, 0.5, 1);
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
}

.msg.user {
  align-self: flex-end;
}

.msg.user .line {
  background: var(--user-bg);
  color: var(--user-text);
  border-color: transparent;
  border-radius: 18px 18px 6px 18px;
}

.msg.mochi {
  align-self: flex-start;
}

.msg .avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-top: 2px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--b2) 55%, var(--surface-solid));
  border: 1.5px solid color-mix(in srgb, var(--ink) 45%, transparent);
  font-size: 16px;
  line-height: 1;
}

.msg .lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.msg .line {
  padding: 9px 13px;
  border-radius: 18px 18px 18px 6px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  font-size: 15.5px;
  font-weight: 600;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

/* реплика звонка, пока не распознана, — скрыта (display: flex иначе перебивает hidden) */
.msg[hidden],
.msg .line[hidden] { display: none; }

.msg.local .line {
  border-style: dashed;
}

.msg.note {
  align-self: center;
  max-width: none;
  padding: 4px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 6%, transparent);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.typing-dots {
  display: inline-flex;
  gap: 4px;
  padding: 4px 2px;
}

.typing-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: dot-bounce 1s ease-in-out infinite;
}

.typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-dots i:nth-child(3) { animation-delay: 0.3s; }

@keyframes dot-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  margin: 6px 12px 0;
  padding: 6px;
  border-radius: 24px;
  background: var(--surface-solid);
  border: 1.5px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.composer:focus-within {
  border-color: color-mix(in srgb, var(--b3) 70%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--b2) 28%, transparent);
}

.composer textarea {
  flex: 1;
  min-width: 0;
  max-height: 140px;
  padding: 9px 8px;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.composer textarea::placeholder {
  color: var(--muted);
  opacity: 0.85;
  /* подсказка — в одну строку: с кнопками звонка и микрофона на телефоне поле узкое */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.send {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  transition: transform 0.15s, opacity 0.2s, background 0.6s;
}

.send svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.send:disabled {
  opacity: 0.38;
  cursor: default;
}

.send:not(:disabled):active { transform: scale(0.9); }

.hint {
  margin: 8px 12px 12px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

/* --- телефоны ---------------------------------------------------------- */

@media (max-width: 860px) {
  .topbar { height: 60px; padding: 10px 14px; }
  .brand-tag { display: none; }
  .pill-label { display: none; }
  .pill-btn { width: 38px; padding: 0; }

  /* Чат — нижняя треть экрана, остальное — Мочи (D21: «для Мочи больше места»). */
  .layout {
    --chat-h: clamp(190px, 36dvh, 340px);
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) var(--chat-h);
    gap: 10px;
    height: calc(100dvh - 60px);
    padding: 0 12px calc(10px + env(safe-area-inset-bottom));
  }

  .stage { padding-top: 6px; }
  /* Высота сцены = экран − шапка − чат − отступы; минус место под полоску голоса и эффекты над головой. */
  .char-wrap { width: min(320px, 100%, calc(100dvh - 60px - var(--chat-h) - 104px)); }
  .mood-chip { margin-top: 0; padding: 4px 11px 4px 8px; font-size: 12.5px; }

  .personas { margin-top: 10px; width: 100%; }
  .personas-title,
  .persona-desc { display: none; }
  .persona-row {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 2px;
    margin: 0 -12px;
    padding-inline: 12px;
  }
  .persona-row::-webkit-scrollbar { display: none; }
  .persona-list { flex-wrap: nowrap; }
  .gender-btn { width: 30px; height: 28px; font-size: 17px; }
  .persona-btn { padding: 4px 12px 4px 4px; font-size: 13px; }
  .persona-btn svg { width: 22px; height: 22px; }

  .chat { border-radius: 22px; }
  .log { padding: 14px 12px 8px; }
  .hint { display: none; }
  .composer { margin: 6px 8px 8px; }
}

@media (max-width: 860px) and (max-height: 640px) {
  .stage { padding-top: 4px; }
  .personas { display: none; }
}

/* Телефон боком: экран низкий — Мочи слева, чат справа, как на компьютере. */
@media (max-width: 860px) and (max-height: 500px) and (orientation: landscape) {
  .layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    grid-template-rows: minmax(0, 1fr);
  }
  .char-wrap { width: min(320px, 100%, calc(100dvh - 60px - 84px)); }
}

/* ==========================================================================
   Персонаж
   ========================================================================== */

.mochi {
  --amp: 1;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.mochi .s1 { stop-color: var(--b1); transition: stop-color 0.7s; }
.mochi .s2 { stop-color: var(--b2); transition: stop-color 0.7s; }
.mochi .s3 { stop-color: var(--b3); transition: stop-color 0.7s; }

.mochi .body {
  fill: url(#mBody);
  stroke: var(--ink);
  stroke-width: 4.5;
  transition: stroke 0.7s;
}

.mochi .tint {
  fill: var(--tint, #000);
  opacity: var(--tint-op, 0);
  transition: opacity 0.6s, fill 0.6s;
  pointer-events: none;
}

/* злость перекрашивает тело в красный при любом характере (наложение красного на мятный дало бы бурый) */
.mochi[data-emotion='angry'] { --b1: #ffd2ca; --b2: #ff7b6b; --b3: #e0352a; --ink: #8c1f19; }

.mochi .gloss { fill: #fff; opacity: 0.55; }
.mochi .shadow { fill: var(--shadow-c); }
.mochi .bow { display: none; }
:root[data-gender='girl'] .mochi .bow { display: inline; }
:root[data-gender] .mochi.art-mode .bow { display: none; }
.mochi .bow-loop { fill: #ff8fc0; stroke: #d8467f; stroke-width: 2.2; stroke-linejoin: round; }
.mochi .bow-knot { fill: #ff6fa9; stroke: #d8467f; stroke-width: 2.2; }
.mochi .bow-tail { fill: none; stroke: #d8467f; stroke-width: 2.6; stroke-linecap: round; }

.mochi .stem { fill: none; stroke: var(--leaf-ink); stroke-width: 4; stroke-linecap: round; }
.mochi .leaf { fill: var(--leaf); stroke: var(--leaf-ink); stroke-width: 3; stroke-linejoin: round; }
.mochi .ink { fill: var(--eye); }
.mochi .hl { fill: #fff; }
.mochi .hl-wet { opacity: 0; transition: opacity 0.3s; }
.mochi[data-emotion='sad'] .hl-wet,
.mochi[data-emotion='scared'] .hl-wet,
.mochi[data-emotion='love'] .hl-wet { opacity: 1; }
.mochi .line { fill: none; stroke: var(--eye); stroke-width: 5.5; stroke-linecap: round; stroke-linejoin: round; }
.mochi .line.thin { stroke-width: 4.6; }
.mochi .tongue { fill: #ff7f9f; }
.mochi .teeth { stroke: #fff; stroke-width: 3.2; stroke-linecap: round; }
.mochi .cheek { fill: #ff8fb3; opacity: var(--cheeks, 0.35); transition: opacity 0.45s; }
.mochi .v-heart { fill: #ff4f8b; }

/* слои, которыми двигает JS и эмоции */
.mochi .face,
.mochi .gaze {
  transition: transform 0.14s ease-out;
}

.mochi .eye-scale,
.mochi .blinker,
.mochi .brow,
.mochi .mouth,
.mochi .m-talk,
.mochi .m-wail {
  transform-box: fill-box;
  transform-origin: center;
}

.mochi .eye-scale { transition: transform 0.28s cubic-bezier(0.3, 1.5, 0.5, 1); }
.mochi .blinker { transition: transform 0.07s ease-in-out; }
.mochi.blink .blinker { transform: scaleY(0.08); }

/* варианты глаз и рта */
.mochi .v,
.mochi .m {
  opacity: 0;
  transition: opacity 0.14s ease;
}

.mochi:is([data-eyes='open'], [data-eyes='big'], [data-eyes='small'], [data-eyes='tiny'], [data-eyes='odd']) .v-open,
.mochi[data-eyes='happy'] .v-happy,
.mochi[data-eyes='closed'] .v-closed,
.mochi[data-eyes='squeeze'] .v-squeeze,
.mochi[data-eyes='heart'] .v-heart,
.mochi:is([data-eyes='flat'], [data-eyes='angry']) .v-flat {
  opacity: 1;
}

.mochi[data-eyes='big'] .eye-scale { transform: scale(1.22); }
.mochi[data-eyes='small'] .eye-scale { transform: scale(0.84); }
.mochi[data-eyes='tiny'] .eye-scale { transform: scale(0.6); }
.mochi[data-eyes='odd'] .eye-l .eye-scale { transform: scale(1.26); }
.mochi[data-eyes='odd'] .eye-r .eye-scale { transform: scale(0.78); }
.mochi[data-eyes='angry'] .eye-scale { transform: rotate(17deg) translateY(1px); }
.mochi[data-eyes='heart'] .eye-scale { animation: heartbeat 0.9s ease-in-out infinite; }

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.18); }
  30% { transform: scale(0.96); }
  45% { transform: scale(1.1); }
}

.mochi:is([data-mouth='smile-s']) .m-smile-s,
.mochi[data-mouth='smile'] .m-smile,
.mochi[data-mouth='grin'] .m-grin,
.mochi[data-mouth='o'] .m-o,
.mochi[data-mouth='o-small'] .m-o-small,
.mochi[data-mouth='frown'] .m-frown,
.mochi[data-mouth='wobble'] .m-wobble,
.mochi[data-mouth='flat'] .m-flat,
.mochi[data-mouth='smirk'] .m-smirk,
.mochi[data-mouth='cat'] .m-cat,
.mochi[data-mouth='shout'] .m-shout,
.mochi[data-mouth='wail'] .m-wail {
  opacity: 1;
}

.mochi[data-mouth='wail'] .m-wail { animation: wail 0.5s ease-in-out infinite; }
.mochi[data-mouth='wobble'] .mouth { animation: wobble-mouth 0.35s ease-in-out infinite; }
.mochi[data-mouth='grin'][data-emotion='laughing'] .mouth { animation: laugh-mouth 0.28s ease-in-out infinite; }

.mochi.talking .m { opacity: 0; }
.mochi.talking .m-talk { opacity: 1; animation: talk 0.34s ease-in-out infinite; }

/* звонок: рот открывается по громкости настоящего голоса (--mouth 0…1 ставит character.js) */
.mochi.voice .m { opacity: 0; }
.mochi.voice .m-talk {
  opacity: 1;
  transform: scale(calc(0.86 + var(--mouth, 0) * 0.16), calc(0.24 + var(--mouth, 0) * 0.86));
  transition: opacity 0.1s ease, transform 0.07s linear;
}

@keyframes talk {
  0%, 100% { transform: scale(0.92, 0.32); }
  30% { transform: scale(1, 1); }
  55% { transform: scale(0.96, 0.5); }
  78% { transform: scale(1, 0.88); }
}

@keyframes wail {
  0%, 100% { transform: scale(1, 0.86); }
  50% { transform: scale(1.06, 1.08); }
}

@keyframes wobble-mouth {
  0%, 100% { transform: translateX(-1px); }
  50% { transform: translateX(1px); }
}

@keyframes laugh-mouth {
  0%, 100% { transform: scale(1, 1); }
  50% { transform: scale(1.04, 0.84); }
}

/* брови */
.mochi .brow path { fill: none; stroke: var(--eye); stroke-width: 4.6; stroke-linecap: round; }
.mochi .brow { opacity: 0; transition: transform 0.32s cubic-bezier(0.3, 1.4, 0.5, 1), opacity 0.2s; }
.mochi:not([data-brows='none']) .brow { opacity: 1; }
.mochi[data-brows='angry'] .brow { transform: translateY(5px) rotate(22deg); }
.mochi[data-brows='sad'] .brow { transform: translateY(-1px) rotate(-18deg); }
.mochi[data-brows='up'] .brow { transform: translateY(-8px); }
.mochi[data-brows='flat'] .brow { transform: translateY(4px); }
.mochi[data-brows='think'] .brow-l { transform: translateY(-7px) rotate(-10deg); }
.mochi[data-brows='think'] .brow-r { transform: translateY(2px) rotate(5deg); }
.mochi[data-brows='confused'] .brow-l { transform: translateY(-8px) rotate(-14deg); }
.mochi[data-brows='confused'] .brow-r { transform: translateY(3px) rotate(14deg); }
.mochi[data-brows='smug'] .brow-l { transform: translateY(-5px) rotate(-6deg); }
.mochi[data-brows='smug'] .brow-r { transform: translateY(1px) rotate(10deg); }

/* тело */
.mochi .body-anim,
.mochi .squash {
  transform-box: view-box;
  transform-origin: 120px 206px;
}

.mochi .shadow {
  transform-box: fill-box;
  transform-origin: center;
}

.mochi[data-body='idle'] .body-anim { animation: breathe 3.4s ease-in-out infinite; }
.mochi[data-body='bounce'] .body-anim { animation: bounce 0.9s ease-in-out infinite; }
.mochi[data-body='bounce'] .shadow { animation: shadow-hop 0.9s ease-in-out infinite; }
.mochi[data-body='laugh'] .body-anim { animation: laugh 0.42s ease-in-out infinite; }
.mochi[data-body='jump'] .body-anim { animation: jump 0.72s ease-in-out infinite; }
.mochi[data-body='jump'] .shadow { animation: shadow-hop 0.72s ease-in-out infinite; }
.mochi[data-body='sway'] .body-anim { animation: sway 2.4s ease-in-out infinite; }
.mochi[data-body='wiggle'] .body-anim { animation: wiggle 1.3s ease-in-out infinite; }
.mochi[data-body='puff'] .body-anim { animation: puff 2.2s ease-in-out infinite; }
.mochi[data-body='hop'] .body-anim { animation: hop 0.85s cubic-bezier(0.3, 1.3, 0.5, 1) both; }
.mochi[data-body='tilt'] .body-anim { animation: tilt 3.2s ease-in-out infinite; }
.mochi[data-body='tilt-r'] .body-anim { animation: tilt-r 2.2s ease-in-out infinite; }
.mochi[data-body='droop'] .body-anim { animation: droop 4s ease-in-out infinite; }
.mochi[data-body='sob'] .body-anim { animation: sob 0.7s ease-in-out infinite; }
.mochi[data-body='shake'] .body-anim { animation: shake 0.28s linear infinite; }
.mochi[data-body='lean'] .body-anim { animation: lean 3s ease-in-out infinite; }
.mochi[data-body='tremble'] .body-anim { animation: tremble 0.12s linear infinite; }
.mochi[data-body='snooze'] .body-anim { animation: snooze 3.8s ease-in-out infinite; }

@keyframes breathe {
  0%, 100% { transform: scale(1, 1); }
  50% { transform: scale(1.012, 1.03); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0) scale(1.04, 0.96); }
  18% { transform: translateY(0) scale(0.97, 1.04); }
  50% { transform: translateY(calc(-12px * var(--amp))) scale(0.99, 1.02); }
  84% { transform: translateY(0) scale(1.03, 0.97); }
}

@keyframes shadow-hop {
  0%, 100% { transform: scale(1.04); opacity: 1; }
  50% { transform: scale(0.82); opacity: 0.6; }
}

@keyframes laugh {
  0%, 100% { transform: translateY(0) rotate(0); }
  25% { transform: translateY(calc(-5px * var(--amp))) rotate(calc(-3deg * var(--amp))); }
  50% { transform: translateY(0) scale(1.02, 0.97); }
  75% { transform: translateY(calc(-5px * var(--amp))) rotate(calc(3deg * var(--amp))); }
}

@keyframes jump {
  0%, 100% { transform: translateY(0) scale(1.07, 0.92); }
  30% { transform: translateY(calc(-24px * var(--amp))) scale(0.94, 1.08); }
  55% { transform: translateY(calc(-28px * var(--amp))) scale(1, 1); }
  82% { transform: translateY(0) scale(1.08, 0.9); }
}

@keyframes sway {
  0%, 100% { transform: rotate(calc(-3deg * var(--amp))); }
  50% { transform: rotate(calc(3deg * var(--amp))) scale(1.02); }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0) scale(0.97); }
  25% { transform: rotate(calc(-4deg * var(--amp))) scale(0.97); }
  75% { transform: rotate(calc(4deg * var(--amp))) scale(0.97); }
}

@keyframes puff {
  0%, 100% { transform: scale(1.04) rotate(-3deg); }
  50% { transform: scale(1.07) rotate(-4deg); }
}

@keyframes hop {
  0% { transform: translateY(0) scale(1.1, 0.88); }
  28% { transform: translateY(calc(-22px * var(--amp))) scale(0.92, 1.1); }
  58% { transform: translateY(0) scale(1.05, 0.95); }
  78%, 100% { transform: translateY(0) scale(1.03, 1.03); }
}

@keyframes tilt {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(-8deg) translateY(-2px); }
}

@keyframes tilt-r {
  0%, 100% { transform: rotate(7deg); }
  40% { transform: rotate(9deg); }
  70% { transform: rotate(5deg); }
}

@keyframes droop {
  0%, 100% { transform: scale(1.05, 0.93); }
  50% { transform: scale(1.06, 0.9); }
}

@keyframes sob {
  0%, 100% { transform: scale(1.05, 0.93) translateY(0); }
  20% { transform: scale(1.07, 0.9) translateY(2px); }
  40% { transform: scale(1.04, 0.95) translateY(-2px); }
  60% { transform: scale(1.07, 0.91) translateY(2px); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(calc(-4px * var(--amp))); }
  40% { transform: translateX(calc(4px * var(--amp))); }
  60% { transform: translateX(calc(-3px * var(--amp))); }
  80% { transform: translateX(calc(3px * var(--amp))); }
}

@keyframes lean {
  0%, 100% { transform: rotate(-4deg) translateX(-2px); }
  50% { transform: rotate(-5.5deg) translateX(-3px); }
}

@keyframes tremble {
  0%, 100% { transform: translate(0, 0) scale(0.93); }
  25% { transform: translate(-1.5px, 0.5px) scale(0.93); }
  50% { transform: translate(1.5px, -0.5px) scale(0.93); }
  75% { transform: translate(-1px, -0.5px) scale(0.93); }
}

@keyframes snooze {
  0%, 100% { transform: scale(1.04, 0.95) rotate(4deg); }
  50% { transform: scale(1, 1) rotate(5deg); }
}

/* разовые «бульк»-ы */
.mochi.boing .squash { animation: boing 0.45s cubic-bezier(0.3, 1.6, 0.4, 1); }
.mochi.poked .squash { animation: poke 0.5s ease-out; }

@keyframes boing {
  0% { transform: scale(1, 1); }
  25% { transform: scale(1.12, 0.86); }
  55% { transform: scale(0.94, 1.08); }
  80% { transform: scale(1.03, 0.98); }
  100% { transform: scale(1, 1); }
}

@keyframes poke {
  0% { transform: scale(1.2, 0.78); }
  35% { transform: translateY(-8px) scale(0.9, 1.13); }
  70% { transform: scale(1.04, 0.97); }
  100% { transform: none; }
}

/* росток */
.mochi .sprout {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transition: transform 0.5s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.mochi[data-sprout='idle'] .sprout { animation: sprout-sway 3.2s ease-in-out infinite; }
.mochi[data-sprout='wiggle'] .sprout { animation: sprout-wiggle 0.6s ease-in-out infinite; }
.mochi[data-sprout='spin'] .sprout { animation: sprout-wiggle 0.22s linear infinite; }
.mochi[data-sprout='shake'] .sprout { animation: sprout-shake 0.12s linear infinite; }
.mochi[data-sprout='perk'] .sprout { transform: scale(1.08, 1.14); }
.mochi[data-sprout='up'] .sprout { transform: translateY(-6px) scale(1.12, 1.26); }
.mochi[data-sprout='stiff'] .sprout { transform: scale(0.96, 1.24); }
.mochi[data-sprout='droop'] .sprout { transform: rotate(50deg) translate(2px, 3px) scale(0.94); }
.mochi[data-sprout='flat'] .sprout { transform: rotate(-60deg); }
.mochi[data-sprout='tilt'] .sprout { transform: rotate(28deg); }

@keyframes sprout-sway {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

@keyframes sprout-wiggle {
  0%, 100% { transform: rotate(-16deg); }
  50% { transform: rotate(16deg); }
}

@keyframes sprout-shake {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(8deg); }
}

/* эффекты */
.mochi .fxg {
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}

.mochi[data-fx~='hearts'] .fx-hearts,
.mochi[data-fx~='sparkles'] .fx-sparkles,
.mochi[data-fx~='steam'] .fx-steam,
.mochi[data-fx~='vein'] .fx-vein,
.mochi[data-fx~='sweat'] .fx-sweat,
.mochi[data-fx~='tear'] .fx-tear,
.mochi[data-fx~='streams'] .fx-streams,
.mochi[data-fx~='question'] .fx-question,
.mochi[data-fx~='exclaim'] .fx-exclaim,
.mochi[data-fx~='zzz'] .fx-zzz,
.mochi[data-fx~='dots'] .fx-dots,
.mochi[data-fx~='puff'] .fx-puff,
.mochi[data-fx~='gloom'] .fx-gloom,
.mochi[data-fx~='blushlines'] .fx-blushlines {
  opacity: 1;
}

.mochi .float,
.mochi .twinkle,
.mochi .puff,
.mochi .vein,
.mochi .sweat,
.mochi .tear,
.mochi .qmark,
.mochi .excl,
.mochi .zz,
.mochi .dot,
.mochi .hmph {
  transform-box: fill-box;
  transform-origin: center;
}

.mochi .float { fill: #ff5c93; animation: float-up 2.4s ease-in infinite; }
.mochi .h2 { animation-delay: -0.8s; }
.mochi .h3 { animation-delay: -1.6s; }

@keyframes float-up {
  0% { transform: translateY(8px) scale(0.4); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(-40px) scale(1.15); opacity: 0; }
}

.mochi .twinkle { fill: #ffc934; animation: twinkle 1.6s ease-in-out infinite; }
.mochi .t2 { animation-delay: -0.4s; }
.mochi .t3 { animation-delay: -0.8s; }
.mochi .t4 { animation-delay: -1.2s; }

@keyframes twinkle {
  0%, 100% { transform: scale(0) rotate(0deg); }
  50% { transform: scale(1) rotate(45deg); }
}

.mochi .puff circle { fill: #fff; stroke: rgba(40, 20, 60, 0.12); stroke-width: 1.5; }
.mochi .pl { animation: steam-l 1.1s ease-out infinite; }
.mochi .pr { animation: steam-r 1.1s ease-out infinite; animation-delay: -0.5s; }

@keyframes steam-l {
  0% { transform: translate(0, 6px) scale(0.4); opacity: 0; }
  30% { opacity: 0.95; }
  100% { transform: translate(-14px, -26px) scale(1.25); opacity: 0; }
}

@keyframes steam-r {
  0% { transform: translate(0, 6px) scale(0.4); opacity: 0; }
  30% { opacity: 0.95; }
  100% { transform: translate(14px, -26px) scale(1.25); opacity: 0; }
}

.mochi .vein { fill: none; stroke: #ff3b30; stroke-width: 3.4; stroke-linecap: round; animation: vein 0.45s ease-in-out infinite alternate; }

@keyframes vein {
  from { transform: scale(0.85); }
  to { transform: scale(1.15); }
}

.mochi .sweat,
.mochi .tear { fill: #b4e3ff; stroke: #4aa3e6; stroke-width: 1.6; }
.mochi .sweat { animation: sweat 1.8s ease-in infinite; }
.mochi .tear { animation: tear-fall 1.7s ease-in infinite; }

@keyframes sweat {
  0% { transform: translateY(-4px); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(9px); opacity: 0.85; }
}

@keyframes tear-fall {
  0% { transform: translateY(0) scale(0.4); opacity: 0; }
  15% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(46px) scale(0.9); opacity: 0; }
}

.mochi .stream {
  fill: url(#mTear);
  transform-box: fill-box;
  transform-origin: 50% 0;
  animation: stream 0.6s ease-in-out infinite alternate;
}

.mochi .s-r { animation-delay: -0.3s; }

@keyframes stream {
  from { transform: scaleY(0.72); }
  to { transform: scaleY(1.06); }
}

.mochi .qmark,
.mochi .excl,
.mochi .zz {
  font-family: var(--display);
  font-weight: 700;
  text-anchor: middle;
}

.mochi .qmark { font-size: 28px; fill: var(--ink); animation: q-bob 1.6s ease-in-out infinite; }
.mochi .q2 { font-size: 22px; animation-delay: -0.8s; }

@keyframes q-bob {
  0%, 100% { transform: translateY(0) rotate(-12deg); }
  50% { transform: translateY(-5px) rotate(12deg); }
}

.mochi .excl { font-size: 42px; fill: #ff4d5e; animation: excl 0.9s ease-in-out infinite; }

@keyframes excl {
  0%, 100% { transform: scale(1) rotate(8deg); }
  50% { transform: scale(1.15) rotate(14deg); }
}

.mochi .zz { fill: var(--ink); opacity: 0; animation: zz 2.7s ease-in-out infinite; }
.mochi .z1 { font-size: 15px; }
.mochi .z2 { font-size: 19px; animation-delay: -0.9s; }
.mochi .z3 { font-size: 24px; animation-delay: -1.8s; }

@keyframes zz {
  0% { transform: translate(0, 0) scale(0.5); opacity: 0; }
  25% { opacity: 0.9; }
  100% { transform: translate(28px, -40px) scale(1.2); opacity: 0; }
}

.mochi .dot { fill: #fff; stroke: var(--ink); stroke-width: 2.4; animation: dot-pulse 1.2s ease-in-out infinite; }
.mochi .d2 { animation-delay: 0.2s; }
.mochi .d3 { animation-delay: 0.4s; }

@keyframes dot-pulse {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}

.mochi .hmph circle { fill: #fff; stroke: rgba(40, 20, 60, 0.18); stroke-width: 1.5; }
.mochi .hmph { animation: hmph 1.8s ease-out infinite; }

@keyframes hmph {
  0% { transform: translate(0, 0) scale(0.3); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translate(24px, 6px) scale(1.2); opacity: 0; }
}

.mochi .gloom { fill: none; stroke: #7d88ff; stroke-width: 2.6; stroke-linecap: round; animation: gloom 1.2s ease-in-out infinite alternate; }

@keyframes gloom {
  from { opacity: 0.45; }
  to { opacity: 0.95; }
}

.mochi .fx-blushlines path { fill: none; stroke: #ff5c8a; stroke-width: 2.4; stroke-linecap: round; }

/* нарисованный Мочи (кадры из scripts/art) */
.mochi.art-mode :is(.sprout, .body, .tint, .gloss, .face) { display: none; }
.mochi.art-mode { transition: transform 0.25s ease-out; }
.mochi .art image { opacity: 0; transition: opacity 0.18s ease; }
.mochi .art image.on { opacity: 1; }
.mochi .art image.snap { transition: none; }

@media (prefers-reduced-motion: reduce) {
  .blob,
  .wave i,
  .menu,
  .menu-backdrop,
  .mochi *,
  .msg,
  .mood-chip.pop {
    animation: none !important;
  }
  .mochi .zz,
  .mochi .twinkle,
  .mochi .float { opacity: 0.8; transform: none; }
}
