/* Animated Moodnaut rig. Each art layer moves on its own (plan v3 §5; the comms buddy replaced visor eyes on 25 Nov). */
.mn-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: #120530;
  isolation: isolate;
}
.mn-stage img { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; pointer-events: none; -webkit-user-drag: none; }
.mn-bg { animation: mn-drift 38s ease-in-out infinite alternate; transform-origin: 50% 50%; }
@keyframes mn-drift { from { transform: scale(1.04) translate(0, 0); } to { transform: scale(1.1) translate(-1.5%, 1%); } }

.mn-stars { position: absolute; inset: 0; pointer-events: none; }
.mn-star { position: absolute; width: 0.7%; aspect-ratio: 1; border-radius: 50%; background: #fff; box-shadow: 0 0 6px 2px rgba(255,255,255,.7); animation: mn-twinkle var(--d, 3s) ease-in-out infinite; animation-delay: var(--delay, 0s); opacity: 0; }
@keyframes mn-twinkle { 0%, 100% { opacity: 0; transform: scale(.4); } 50% { opacity: 1; transform: scale(1); } }

.mn-group { position: absolute; inset: 0; }
.mn-char { animation: mn-float 5.2s ease-in-out infinite; }
@keyframes mn-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.6%); } }

.mn-smoke { animation: mn-puff 1.7s ease-in-out infinite; }
@keyframes mn-puff { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.05, .95); } }
.mn-smoke.is-fire { animation: mn-puff .9s ease-in-out infinite, mn-flicker .35s steps(2) infinite; }
@keyframes mn-flicker { 50% { filter: brightness(1.18) saturate(1.2); } }

.mn-bodygroup { animation: mn-sway 6.4s ease-in-out infinite; }
@keyframes mn-sway { 0%, 100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.2deg); } }

.mn-helmetgroup { animation: mn-tilt 4.1s ease-in-out infinite; }
@keyframes mn-tilt { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }

.mn-hands { animation: mn-hands 3.1s ease-in-out infinite; }
@keyframes mn-hands { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-.6%); } }

/* Comms buddy: tiny alien in a mini UFO (replaces the visor eyes, 25 Nov 2026) */
.mn-buddy { position: absolute; left: 68%; top: 55%; width: 31%; aspect-ratio: 1; pointer-events: none; z-index: 2; animation: mn-buddy-float 4.6s ease-in-out infinite; }
.mn-buddy-svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 3px 0 rgba(0,0,0,.35)); }
@keyframes mn-buddy-float {
  0%, 100% { transform: translate(0, 0) rotate(-4deg); }
  25% { transform: translate(-6%, -9%) rotate(3deg); }
  50% { transform: translate(-2%, -3%) rotate(-2deg); }
  75% { transform: translate(5%, -10%) rotate(5deg); }
}
.mn-buddy-beam { opacity: .18; transition: opacity .3s; }
.mn-buddy-lights circle { animation: mn-buddy-light 1.5s steps(1) infinite; animation-delay: calc(var(--i) * .3s); }
@keyframes mn-buddy-light { 0%, 60% { opacity: 1; } 61%, 100% { opacity: .35; } }
.mn-buddy-ant { transform-box: fill-box; transform-origin: 50% 100%; animation: mn-buddy-ant 2.2s ease-in-out infinite; }
.mn-buddy-ant.is-r { animation-delay: -1.1s; }
@keyframes mn-buddy-ant { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
.mn-buddy-eyes { transform-box: fill-box; transform-origin: center; }
.mn-buddy-eyes.is-blinking { animation: mn-blink .18s ease-in-out; }
@keyframes mn-blink { 50% { transform: scaleY(.1); } }
.mn-buddy-blush { opacity: 0; transition: opacity .3s; }
.mn-mood-happy .mn-buddy-blush, .mn-mood-proud .mn-buddy-blush, .mn-mood-excited .mn-buddy-blush { opacity: .75; }
.mn-buddy-talk { opacity: 0; transform-box: fill-box; transform-origin: center; }

/* Talking: the buddy's mouth moves, its beam pulses, the helmet nods */
.mn-talking .mn-buddy-mouth { opacity: 0; }
.mn-talking .mn-buddy-talk { opacity: 1; animation: mn-buddy-mouth .22s ease-in-out infinite alternate; }
@keyframes mn-buddy-mouth { from { transform: scaleY(.25); } to { transform: scaleY(1.05); } }
.mn-talking .mn-buddy-beam { animation: mn-buddy-beam .3s ease-in-out infinite alternate; }
@keyframes mn-buddy-beam { from { opacity: .25; } to { opacity: .7; } }
.mn-talking .mn-buddy { animation: mn-buddy-chatter .5s ease-in-out infinite alternate; }
@keyframes mn-buddy-chatter { from { transform: translate(-2%, -4%) rotate(-5deg); } to { transform: translate(2%, -7%) rotate(5deg); } }
.mn-talking .mn-helmetgroup { animation: mn-chatter .32s ease-in-out infinite alternate; }
@keyframes mn-chatter { from { transform: rotate(-2deg) translateY(0); } to { transform: rotate(2deg) translateY(-.6%); } }

/* Buddy mood extras */
.mn-mood-sleepy .mn-buddy, .mn-mood-bored .mn-buddy { animation: mn-buddy-doze 6s ease-in-out infinite; }
@keyframes mn-buddy-doze { 0%, 100% { transform: translateY(4%) rotate(-8deg); } 50% { transform: translateY(6%) rotate(-5deg); } }
.mn-mood-sleepy .mn-buddy-ant, .mn-mood-bored .mn-buddy-ant { animation: none; transform: rotate(-28deg); }
.mn-mood-sleepy .mn-buddy-ant.is-r, .mn-mood-bored .mn-buddy-ant.is-r { transform: rotate(28deg); }
.mn-mood-sleepy .mn-buddy-lights circle { animation: none; opacity: .3; }
.mn-mood-excited .mn-buddy-ant, .mn-mood-surprised .mn-buddy-ant { animation-duration: .35s; }
.mn-mood-excited .mn-buddy-lights circle { animation-duration: .5s; }
.mn-mood-grumpy .mn-buddy-lights circle, .mn-mood-annoyed .mn-buddy-lights circle { fill: #ff2a2a; }

/* Mood reactions on the whole character */
.mn-mood-happy .mn-char, .mn-mood-excited .mn-char, .mn-mood-proud .mn-char { animation: mn-bounce .9s cubic-bezier(.3,1.6,.6,1) infinite; }
@keyframes mn-bounce { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-5%); } }
.mn-mood-annoyed .mn-char, .mn-mood-grumpy .mn-char { animation: mn-shake .5s ease-in-out 3, mn-float 5.2s ease-in-out .5s infinite; }
@keyframes mn-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-1.6%) rotate(-1.5deg); } 75% { transform: translateX(1.6%) rotate(1.5deg); } }
.mn-mood-bored .mn-char, .mn-mood-sleepy .mn-char { animation: mn-slump 7s ease-in-out infinite; }
@keyframes mn-slump { 0%, 100% { transform: translateY(1.5%) rotate(-1deg); } 50% { transform: translateY(2.5%) rotate(1deg); } }
.mn-mood-bored .mn-helmetgroup, .mn-mood-sleepy .mn-helmetgroup { animation: mn-droop 7s ease-in-out infinite; }
@keyframes mn-droop { 0%, 100% { transform: rotate(5deg) translateY(1%); } 50% { transform: rotate(7deg) translateY(1.5%); } }
.mn-mood-surprised .mn-char { animation: mn-jump .6s ease-out 1, mn-float 5.2s ease-in-out .6s infinite; }
@keyframes mn-jump { 30% { transform: translateY(-7%) scale(1.02); } 100% { transform: translateY(0); } }
.mn-mood-worried .mn-char { animation: mn-tremble .12s linear infinite alternate; }
@keyframes mn-tremble { from { transform: translateX(-.25%); } to { transform: translateX(.25%); } }

.mn-zzz { position: absolute; font-family: var(--font-display, sans-serif); color: #fff; font-size: clamp(14px, 4cqw, 28px); text-shadow: 2px 2px 0 #000; opacity: 0; pointer-events: none; }
.mn-zzz { left: 80%; top: 50%; }
.mn-mood-sleepy .mn-zzz { animation: mn-zzz 2.4s ease-out infinite; }
@keyframes mn-zzz { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(40%, -120%) scale(1.2); } }

/* Teaser silhouette for streaks (plan v3 §3, reveal style B) */
.mn-stage.is-silhouette .mn-char { filter: brightness(0) blur(var(--mn-blur, 6px)); }
/* The buddy stays visible during a streak: it is the one sending the transmissions. */

@media (prefers-reduced-motion: reduce) {
  .mn-stage *, .mn-stage { animation: none !important; transition: none !important; }
}
