/* =========================================================================
   Estela — mascote animado e interativo.

   Trabalha sobre:
   - cenas [data-mascot] da home (hero anonimo .hero__art e dashboard
     .mascot-scene), onde o svg de estela.svg fica inline com as camadas
     es-eyes/es-mouthes/es-head/es-hat/es-wand/es-particles...
   - o dock flutuante .mascot-dock, presente em todas as outras paginas.

   Os estados sao classes is-* no proprio [data-mascot]:
     is-idle | is-hover | is-wink | is-wave | is-offer | is-casting |
     is-joy | is-stars | is-thinking | is-heart | is-invite |
     is-confetti | is-worried | is-loading | is-surprise | is-sleep
   (mais is-speaking enquanto o balao mostra uma frase e is-quiet quando
   a pessoa silencia os baloes da sessao).

   Balao unico (fila com cooldown) + chat com acoes reais.
   ========================================================================= */

/* ------------------------------- cenas ---------------------------------- */

[data-mascot] {
  position: relative;
}

.mascot-hit {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  pointer-events: auto;
  border-radius: 26px;
  -webkit-tap-highlight-color: transparent;
  transition: scale 300ms ease;
}

.mascot-hit:focus-visible {
  outline: 3px solid rgba(255, 209, 102, 0.9);
  outline-offset: 6px;
}

.is-hover .mascot-hit {
  scale: 1.03;
}

.mascot-scene__hit-halo {
  position: absolute;
  inset: -6%;
  border-radius: 50%;
  background: radial-gradient(50% 50% at 50% 55%, rgba(255, 209, 102, 0.3), transparent 70%);
  opacity: 0;
  transition: opacity 320ms ease;
  pointer-events: none;
}

.is-hover .mascot-scene__hit-halo,
.is-joy .mascot-scene__hit-halo,
.is-wave .mascot-scene__hit-halo,
.is-heart .mascot-scene__hit-halo {
  opacity: 1;
}

/* --------------------------- dock flutuante ------------------------------ */

.mascot-dock {
  position: fixed;
  left: var(--space-4);
  bottom: var(--space-4);
  z-index: 70;
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  pointer-events: none;
}

.mascot-dock__halo {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(139, 92, 246, 0.5), rgba(255, 209, 102, 0.16) 60%, transparent 74%);
  filter: blur(5px);
  animation: haloPulse 7.5s ease-in-out infinite;
  pointer-events: none;
}

.mascot-dock__hit {
  width: 78px;
  height: 78px;
  border-radius: 50%;
}

.mascot-dock__orb {
  display: block;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 209, 102, 0.55);
  background: radial-gradient(120% 120% at 30% 18%, #2c1a63, #130a32);
  box-shadow: 0 16px 32px rgba(3, 6, 26, 0.55), 0 0 26px rgba(139, 92, 246, 0.42);
  animation: mascotFloat 7.5s ease-in-out infinite;
  transition: box-shadow 300ms ease, border-color 300ms ease;
}

.is-hover .mascot-dock__orb {
  border-color: rgba(255, 209, 102, 0.9);
  box-shadow: 0 18px 36px rgba(3, 6, 26, 0.6), 0 0 34px rgba(255, 209, 102, 0.35);
}

.mascot-dock .mascot-scene__bubble {
  bottom: calc(100% + 12px);
  top: auto;
  left: 0;
  right: auto;
  max-width: min(235px, 70vw);
}

.mascot-dock .mascot-scene__bubble::after {
  right: auto;
  left: 20px;
}

.mascot-dock .mascot-zzz {
  top: -6px;
  right: -4px;
}

.mascot-dock .mascot-quiet {
  top: -4px;
  right: -4px;
}

/* ---------------------- botao de silenciar baloes ------------------------ */

.mascot-quiet {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 7;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(167, 139, 250, 0.45);
  background: rgba(12, 8, 32, 0.88);
  color: #e9e0ff;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, border-color 200ms ease, color 200ms ease;
}

[data-mascot]:hover .mascot-quiet,
.mascot-quiet:focus-visible,
.is-quiet .mascot-quiet {
  opacity: 1;
  pointer-events: auto;
}

.mascot-quiet.is-off {
  color: #ffd166;
  border-color: rgba(255, 209, 102, 0.6);
}

.mascot-quiet.is-off::after,
.mascot-chat__mute.is-off::after {
  content: '';
  position: absolute;
  inset: 6px;
  background: linear-gradient(
    to top right,
    transparent calc(50% - 1.5px),
    currentColor calc(50% - 1.5px),
    currentColor calc(50% + 1.5px),
    transparent calc(50% + 1.5px)
  );
}

/* ----------------------------- expressoes -------------------------------- */
/* tudo que so aparece num estado nasce escondido; as regras de estado
   (abaixo) ligam a camada certa. A boca padrao e a --idle. */

[data-mascot] .es-eyes-shut,
[data-mascot] .es-mouth,
[data-mascot] .es-heart,
[data-mascot] .es-confetti,
[data-mascot] .es-cast,
[data-mascot] .es-stars,
[data-mascot] .es-symbols {
  opacity: 0;
}

[data-mascot] .es-mouth--idle {
  opacity: 1;
}

[data-mascot] .es-mouth,
[data-mascot] .es-eyes-open,
[data-mascot] .es-eyes-shut,
[data-mascot] .es-brow,
[data-mascot] .es-book-glow,
[data-mascot] .es-particles {
  transition: opacity 220ms ease;
}

/* piscar de olhos */
[data-mascot] .es-eyes-open {
  animation: estelaBlink 6.4s ease-in-out infinite;
}

[data-mascot] .es-eyes-shut {
  animation: estelaBlinkShut 6.4s ease-in-out infinite;
}

@keyframes estelaBlink {
  0%, 92%, 100% { opacity: 1; }
  94%, 96% { opacity: 0; }
}

@keyframes estelaBlinkShut {
  0%, 92%, 100% { opacity: 0; }
  94%, 96% { opacity: 1; }
}

/* sono e piscadela: o piscar automatico pausa e a Estela fecha os olhos */
.is-sleep .es-eyes-open,
.is-wink .es-eyes-open {
  animation: none;
  opacity: 0;
}

.is-sleep .es-eyes-shut,
.is-wink .es-eyes-shut {
  animation: none;
  opacity: 1;
}

/* no wink so o olho direito fecha */
.is-wink .es-lid--l {
  opacity: 0;
}

/* olhos que seguem o cursor (as mesmas vars que movem a figura) */
[data-mascot] .es-eye-track {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  translate: calc(var(--scene-x, 0) * 5px) calc(var(--scene-y, 0) * 4px);
  transition: translate 120ms ease-out;
}

.is-thinking .es-eye-track {
  translate: 0 -7px;
}

.is-loading .es-eye-track {
  animation: estelaGlance 1.7s ease-in-out infinite;
}

@keyframes estelaGlance {
  0%, 100% { translate: -6px 0; }
  50% { translate: 6px 0; }
}

/* boca */
.is-joy .es-mouth--idle,
.is-wave .es-mouth--idle,
.is-confetti .es-mouth--idle,
.is-heart .es-mouth--idle,
.is-stars .es-mouth--idle,
.is-wink .es-mouth--idle,
.is-surprise .es-mouth--idle,
.is-sleep .es-mouth--idle,
.is-worried .es-mouth--idle,
.is-offer .es-mouth--idle,
.is-invite .es-mouth--idle,
.is-casting .es-mouth--idle {
  opacity: 0;
}

.is-joy .es-mouth--joy,
.is-wave .es-mouth--joy,
.is-confetti .es-mouth--joy,
.is-heart .es-mouth--joy,
.is-stars .es-mouth--joy,
.is-wink .es-mouth--joy {
  opacity: 1;
}

.is-surprise .es-mouth--surprise {
  opacity: 1;
}

.is-sleep .es-mouth--sleep {
  opacity: 1;
}

.is-worried .es-mouth--worry {
  opacity: 1;
}

.is-offer .es-mouth--talk,
.is-invite .es-mouth--talk,
.is-casting .es-mouth--talk {
  opacity: 1;
}

/* falando: boca em movimento enquanto o balao (ou o chat) fala */
.is-speaking.is-idle .es-mouth--idle {
  opacity: 0;
}

.is-speaking.is-idle .es-mouth--talk {
  opacity: 1;
}

.is-speaking.is-idle .es-mouth--talk {
  transform-box: fill-box;
  transform-origin: 50% 30%;
  animation: estelaTalk 460ms ease-in-out infinite;
}

@keyframes estelaTalk {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.7); }
}

/* sobrancelhas */
[data-mascot] .es-brow {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  transition: transform 260ms ease;
}

.is-hover .es-brow--l,
.is-hover .es-brow--r,
.is-surprise .es-brow--l,
.is-surprise .es-brow--r,
.is-stars .es-brow--l,
.is-stars .es-brow--r,
.is-confetti .es-brow--l,
.is-confetti .es-brow--r {
  transform: translateY(-9px);
}

.is-worried .es-brow--l {
  transform: rotate(-14deg) translateY(-3px);
}

.is-worried .es-brow--r {
  transform: rotate(14deg) translateY(-3px);
}

.is-thinking .es-brow--l {
  transform: rotate(-9deg) translateY(-4px);
}

.is-thinking .es-brow--r {
  transform: rotate(7deg) translateY(-2px);
}

.is-joy .es-brow--l,
.is-joy .es-brow--r {
  transform: translateY(-5px);
}

/* ---------------------------- camadas magicas ---------------------------- */

[data-mascot] .es-particles {
  opacity: 0.5;
}

.is-joy .es-particles,
.is-wave .es-particles,
.is-surprise .es-particles,
.is-stars .es-particles,
.is-confetti .es-particles {
  opacity: 1;
  animation: estelaDrift 2.2s ease-in-out infinite;
}

@keyframes estelaDrift {
  0%, 100% { opacity: 0.35; translate: 0 0; }
  50% { opacity: 1; translate: 0 -8px; }
}

.is-stars .es-stars,
.is-surprise .es-stars,
.is-confetti .es-stars {
  opacity: 1;
  animation: estelaTwinkle 1.2s ease-in-out infinite;
}

@keyframes estelaTwinkle {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.is-heart .es-heart {
  opacity: 1;
  animation: estelaHeartPop 700ms cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

@keyframes estelaHeartPop {
  0% { transform: scale(0.4); }
  70% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.is-confetti .es-confetti {
  opacity: 1;
  transform-box: view-box;
  transform-origin: 305px 420px;
  animation: estelaConfetti 1.7s ease-in infinite;
}

@keyframes estelaConfetti {
  0% { transform: translateY(-60px) rotate(-8deg); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: translateY(120px) rotate(10deg); opacity: 0; }
}

.is-casting .es-cast {
  opacity: 1;
  transform-box: view-box;
  transform-origin: 556px 290px;
  animation: estelaCastSpin 1.4s linear infinite;
}

@keyframes estelaCastSpin {
  to { transform: rotate(360deg); }
}

.is-loading .es-symbols {
  opacity: 1;
  animation: estelaSymbols 1.7s ease-in-out infinite;
}

@keyframes estelaSymbols {
  0%, 100% { opacity: 0.35; translate: 0 4px; }
  50% { opacity: 1; translate: 0 -6px; }
}

/* brilho do livro e faiscas */
[data-mascot] .es-book-glow {
  opacity: 0.7;
}

.is-invite .es-book-glow,
.is-offer .es-book-glow,
.is-joy .es-book-glow {
  animation: estelaGlow 1.8s ease-in-out infinite;
}

@keyframes estelaGlow {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.is-invite .es-book,
.is-offer .es-book {
  transform-box: view-box;
  transform-origin: 198px 610px;
  animation: estelaBookLift 2.4s ease-in-out infinite;
}

@keyframes estelaBookLift {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(-4deg); }
}

.is-casting .es-spark {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: estelaSparkFast 0.6s ease-in-out infinite;
}

@keyframes estelaSparkFast {
  0%, 100% { opacity: 0.4; scale: 0.8; }
  50% { opacity: 1; scale: 1.15; }
}

.is-joy .es-spark,
.is-wave .es-spark,
.is-surprise .es-spark,
.is-hover .es-spark,
.is-stars .es-spark {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: estelaSpark 1.1s ease-in-out infinite;
}

@keyframes estelaSpark {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

[data-mascot] .es-aura {
  transition: opacity 400ms ease;
}

.is-sleep .es-aura {
  opacity: 0.55;
}

.is-joy .es-aura,
.is-confetti .es-aura,
.is-heart .es-aura {
  animation: estelaAura 2.6s ease-in-out infinite;
}

@keyframes estelaAura {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

/* -------------------------------- poses ---------------------------------- */

[data-mascot] .es-head {
  transform-box: view-box;
  transform-origin: 305px 470px;
  transition: transform 320ms ease;
}

.is-hover .es-head,
.is-offer .es-head {
  transform: rotate(-2.5deg);
}

.is-worried .es-head {
  transform: rotate(3deg);
}

.is-thinking .es-head {
  animation: estelaHeadTilt 2.4s ease-in-out infinite;
}

@keyframes estelaHeadTilt {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(1deg); }
}

[data-mascot] .es-hat {
  transform-box: view-box;
  transform-origin: 305px 195px;
  transition: transform 320ms ease;
}

[data-mascot] .es-hat-tip {
  transform-box: view-box;
  transform-origin: 305px 195px;
  transition: transform 320ms ease;
}

.is-wave .es-hat-tip {
  animation: estelaHatWiggle 620ms ease-in-out 2;
}

@keyframes estelaHatWiggle {
  0%, 100% { transform: rotate(0deg); }
  30% { transform: rotate(-6deg); }
  70% { transform: rotate(6deg); }
}

.is-confetti .es-hat-tip {
  animation: estelaHatParty 500ms ease-in-out 3;
}

@keyframes estelaHatParty {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  25% { transform: rotate(-6deg) translateY(-6px); }
  75% { transform: rotate(6deg) translateY(-2px); }
}

.is-thinking .es-hat-tip {
  animation: estelaThink 1.7s ease-in-out infinite;
}

@keyframes estelaThink {
  0%, 100% { transform: rotate(-1.8deg); }
  50% { transform: rotate(1.8deg); }
}

.is-sleep .es-hat-tip {
  transform: rotate(-4deg);
}

/* braco com a varinha */
[data-mascot] .es-arm--wave {
  transform-box: view-box;
  transform-origin: 384px 506px;
  transition: transform 320ms ease;
}

.is-wave .es-arm--wave {
  animation: estelaWave 560ms ease-in-out 2;
}

@keyframes estelaWave {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-34deg); }
  50% { transform: rotate(-8deg); }
  75% { transform: rotate(-30deg); }
}

.is-joy .es-arm--wave,
.is-surprise .es-arm--wave,
.is-offer .es-arm--wave {
  transform: rotate(-8deg);
}

.is-worried .es-arm--wave {
  animation: estelaShiver 320ms ease-in-out 4;
}

@keyframes estelaShiver {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-3deg); }
}

.is-sleep .es-arm--wave {
  transform: rotate(12deg);
}

/* varinha */
[data-mascot] .es-wand {
  transform-box: view-box;
  transform-origin: 486px 446px;
  transition: transform 320ms ease;
}

.is-casting .es-wand {
  transform: rotate(-14deg);
}

.is-joy .es-wand,
.is-surprise .es-wand {
  transform: rotate(-8deg);
}

/* pulo de boas-vindas do balao/figura */
.is-wave .mascot-hit {
  animation: estelaBounce 560ms ease-in-out 2;
}

@keyframes estelaBounce {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  30% { translate: 0 -15px; rotate: -2.5deg; }
  62% { translate: 0 -6px; rotate: 2.5deg; }
}

/* sono: respiracao lenta e tudo mais calmo */
.is-sleep .mascot-scene__figure {
  animation-duration: 14s, 10s;
}

.is-sleep .hero__character {
  animation-duration: 13s;
}

.is-sleep .es-particles {
  opacity: 0.25;
  animation-duration: 9s;
}

.is-sleep .mascot-dock__orb {
  animation-duration: 13s;
}

/* ------------------------------- balao ----------------------------------- */

[data-mascot] .mascot-scene__bubble {
  z-index: 5;
  background: linear-gradient(150deg, rgba(35, 17, 72, 0.96), rgba(17, 9, 42, 0.96));
  border: 1px solid rgba(167, 139, 250, 0.62);
  box-shadow: 0 18px 40px rgba(3, 6, 26, 0.55), 0 0 24px rgba(255, 209, 102, 0.16);
  color: #f6f2ff;
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transition: opacity 340ms ease, transform 340ms ease;
  pointer-events: none;
}

[data-mascot] .mascot-scene__bubble.is-shown {
  opacity: 1;
  transform: none;
}

[data-mascot] .mascot-scene__bubble.is-swap {
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transition-duration: 240ms;
}

/* detalhe dourado no balao */
[data-mascot] .mascot-scene__bubble::before {
  content: '✦';
  position: absolute;
  top: -10px;
  left: 12px;
  color: #ffd166;
  font-size: 0.95rem;
  line-height: 1;
  text-shadow: 0 0 10px rgba(255, 209, 102, 0.85);
}

/* cauda combina com o fundo */
[data-mascot] .mascot-scene__bubble::after {
  background: rgba(24, 12, 54, 0.96);
  border-color: rgba(167, 139, 250, 0.62);
}

.is-sleep .mascot-scene__bubble,
.is-quiet .mascot-scene__bubble {
  opacity: 0 !important;
}

/* Zzz do sono */
.mascot-zzz {
  position: absolute;
  top: 1%;
  right: 6%;
  z-index: 6;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 3px;
  color: #ffd166;
  text-shadow: 0 0 14px rgba(255, 209, 102, 0.75);
  opacity: 0;
  pointer-events: none;
  transition: opacity 360ms ease;
}

.is-sleep .mascot-zzz {
  opacity: 1;
  animation: estelaZzz 2.6s ease-in-out infinite;
}

@keyframes estelaZzz {
  0%, 100% { translate: 0 0; opacity: 0.55; }
  50% { translate: 7px -12px; opacity: 1; }
}

/* ----------------------------- chat panel ------------------------------- */

.mascot-chat {
  position: absolute;
  z-index: 40;
  left: -14%;
  bottom: -4%;
  display: flex;
  flex-direction: column;
  width: min(340px, 88vw);
  max-height: min(72vh, 560px);
  background: linear-gradient(155deg, rgba(31, 16, 66, 0.97), rgba(14, 8, 36, 0.97));
  border: 1px solid rgba(167, 139, 250, 0.5);
  border-radius: 18px;
  box-shadow: 0 26px 60px rgba(3, 6, 26, 0.6), 0 0 34px rgba(255, 209, 102, 0.14);
  color: #f4f0ff;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  visibility: hidden;
  transition: opacity 260ms ease, transform 260ms ease, visibility 260ms;
}

.mascot-chat.is-open {
  opacity: 1;
  transform: none;
  visibility: visible;
}

.mascot-chat--fixed {
  position: fixed;
  z-index: 78;
  left: var(--space-4);
  right: auto;
  bottom: calc(var(--space-4) + 92px);
  width: min(340px, calc(100vw - var(--space-4) * 2));
}

.mascot-chat__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(120deg, rgba(139, 92, 246, 0.3), rgba(255, 209, 102, 0.14));
  border-bottom: 1px solid rgba(167, 139, 250, 0.35);
}

.mascot-chat__avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 209, 102, 0.5);
  padding: 3px;
}

.mascot-chat__who {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.mascot-chat__who strong {
  font-family: var(--font-display);
  font-size: 1rem;
  color: #ffe9b8;
}

.mascot-chat__who span {
  font-size: 0.76rem;
  color: rgba(233, 224, 255, 0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mascot-chat__mute,
.mascot-chat__close {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  border: 1px solid rgba(167, 139, 250, 0.4);
  background: rgba(10, 6, 28, 0.5);
  color: #e9e0ff;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease;
}

.mascot-chat__mute {
  margin-left: auto;
}

.mascot-chat__mute.is-off {
  color: #ffd166;
  border-color: rgba(255, 209, 102, 0.6);
}

.mascot-chat__mute:hover,
.mascot-chat__close:hover {
  background: rgba(139, 92, 246, 0.35);
  border-color: rgba(255, 209, 102, 0.6);
}

.mascot-chat__mute:focus-visible,
.mascot-chat__close:focus-visible {
  outline: 2px solid rgba(255, 209, 102, 0.9);
  outline-offset: 2px;
}

.mascot-chat__log {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1 1 auto;
  min-height: 0;
}

.mascot-line {
  max-width: 88%;
  padding: 8px 11px;
  border-radius: 13px;
  font-size: 0.86rem;
  line-height: 1.45;
  animation: mascotLineIn 240ms ease;
}

@keyframes mascotLineIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.mascot-line--mascot {
  align-self: flex-start;
  background: rgba(139, 92, 246, 0.22);
  border: 1px solid rgba(167, 139, 250, 0.4);
  color: #f4f0ff;
  border-bottom-left-radius: 4px;
}

.mascot-line--user {
  align-self: flex-end;
  background: rgba(255, 209, 102, 0.16);
  border: 1px solid rgba(255, 209, 102, 0.45);
  color: #ffe9b8;
  border-bottom-right-radius: 4px;
}

/* indicador de digitacao */
.mascot-typing {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: rgba(139, 92, 246, 0.18);
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 13px;
  border-bottom-left-radius: 4px;
}

.mascot-typing__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(221, 210, 255, 0.7);
  animation: mascotTypingDot 1.2s ease-in-out infinite;
}

.mascot-typing__dot:nth-child(2) { animation-delay: 0.15s; }
.mascot-typing__dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes mascotTypingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.mascot-chat__asks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px 0;
}

.mascot-ask {
  border: 1px solid rgba(167, 139, 250, 0.45);
  background: rgba(20, 11, 48, 0.7);
  color: #ddd2ff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.mascot-ask:hover {
  background: rgba(139, 92, 246, 0.35);
  border-color: rgba(255, 209, 102, 0.6);
  color: #fff;
}

.mascot-ask:focus-visible {
  outline: 2px solid rgba(255, 209, 102, 0.9);
  outline-offset: 2px;
}

.mascot-chat__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  padding: 10px 14px;
  border-top: 1px solid rgba(167, 139, 250, 0.25);
}

.mascot-go {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 11px;
  border: 1px solid rgba(167, 139, 250, 0.4);
  background: rgba(255, 255, 255, 0.06);
  color: #efe9ff;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.mascot-go:hover {
  background: rgba(139, 92, 246, 0.3);
  border-color: rgba(255, 209, 102, 0.55);
  transform: translateY(-1px);
}

.mascot-go:focus-visible {
  outline: 2px solid rgba(255, 209, 102, 0.9);
  outline-offset: 2px;
}

.mascot-go svg {
  flex: none;
  opacity: 0.85;
}

/* campo de mensagem */
.mascot-chat__form {
  display: flex;
  gap: 8px;
  padding: 10px 14px 14px;
  border-top: 1px solid rgba(167, 139, 250, 0.25);
}

.mascot-chat__form input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 12px;
  border-radius: 11px;
  border: 1px solid rgba(167, 139, 250, 0.4);
  background: rgba(10, 6, 28, 0.6);
  color: #f4f0ff;
  font: inherit;
  font-size: 0.85rem;
}

.mascot-chat__form input::placeholder {
  color: rgba(233, 224, 255, 0.5);
}

.mascot-chat__form input:focus {
  outline: none;
  border-color: rgba(255, 209, 102, 0.65);
  box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.16);
}

.mascot-chat__form button {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid rgba(255, 209, 102, 0.5);
  background: linear-gradient(140deg, rgba(255, 209, 102, 0.28), rgba(139, 92, 246, 0.32));
  color: #ffe9b8;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease;
}

.mascot-chat__form button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 209, 102, 0.85);
}

.mascot-chat__form button:focus-visible {
  outline: 2px solid rgba(255, 209, 102, 0.9);
  outline-offset: 2px;
}

/* ------------------------- posicao do balao na hero ---------------------- */

/* data-mascot mora em .hero__art: balao acima dos chips (z5 > z4).
   Lado esquerdo: zona livre do cabelo, rosto/chips/floats sempre visiveis,
   cauda (padrao, baixo-direita) aponta para a bruxa */
.hero__art .mascot-scene__bubble {
  top: 20%;
  left: -4%;
  right: auto;
  max-width: 235px;
}

.hero__art .mascot-zzz {
  top: 0;
  left: 2%;
  right: auto;
}

.hero__art .mascot-quiet {
  top: 4%;
  right: 0;
}

/* ----------------------------- responsivo -------------------------------- */

@media (max-width: 1120px) {
  /* o toggle da sidebar ocupa o canto inferior esquerdo nesta faixa */
  .mascot-dock {
    bottom: calc(var(--space-4) + 64px);
  }
}

@media (max-width: 768px), (pointer: coarse) {
  /* arte movel: balao vai para a zona livre do cabelo esquerdo,
     longe do rosto; cauda aponta para baixo/direita (face) */
  .hero__art .mascot-scene__bubble {
    top: 32%;
    left: -1%;
    right: auto;
    max-width: 175px;
    font-size: 0.82rem;
  }

  .mascot-chat {
    left: -6%;
    width: min(320px, 92vw);
  }

  .mascot-chat--fixed {
    left: 10px;
    right: 10px;
    width: auto;
  }

  .mascot-chat__actions {
    grid-template-columns: 1fr 1fr;
  }

  .mascot-dock {
    left: var(--space-3);
  }

  .mascot-dock .mascot-scene__bubble {
    max-width: min(220px, 74vw);
    font-size: 0.84rem;
  }
}

/* ------------------------- prefers-reduced-motion ------------------------ */

@media (prefers-reduced-motion: reduce) {
  .mascot-hit,
  .mascot-zzz,
  .mascot-dock__orb,
  .mascot-dock__halo,
  .mascot-chat,
  .mascot-line,
  .mascot-typing__dot,
  [data-mascot] .mascot-scene__bubble,
  [data-mascot] .es-head,
  [data-mascot] .es-hat,
  [data-mascot] .es-hat-tip,
  [data-mascot] .es-arm--wave,
  [data-mascot] .es-wand,
  [data-mascot] .es-brow,
  [data-mascot] .es-eye-track {
    transition: none !important;
    animation: none !important;
  }

  [data-mascot] .es-eyes-open,
  [data-mascot] .es-eyes-shut,
  [data-mascot] .es-particles,
  [data-mascot] .es-stars,
  [data-mascot] .es-spark,
  [data-mascot] .es-confetti,
  [data-mascot] .es-cast,
  [data-mascot] .es-symbols,
  [data-mascot] .es-aura,
  [data-mascot] .es-book,
  [data-mascot] .es-book-glow,
  .is-wave .mascot-hit,
  .is-thinking .es-head,
  .is-loading .es-eye-track,
  .is-sleep .mascot-zzz {
    animation: none !important;
  }

  [data-mascot] .es-eyes-open { opacity: 1; }
  [data-mascot] .es-eyes-shut { opacity: 0; }
  .is-sleep [data-mascot] .es-eyes-open { opacity: 0; }
  .is-sleep [data-mascot] .es-eyes-shut { opacity: 1; }

  [data-mascot] .mascot-scene__bubble,
  [data-mascot] .mascot-scene__bubble.is-swap {
    transform: none;
  }

  [data-mascot] .es-eye-track {
    translate: 0 0;
  }
}
