/* Companheiro de estudo interativo do EstudaMath. */
.study-pet-widget {
  position: fixed;
  right: 22px;
  bottom: 18px;
  z-index: 80;
  width: 94px;
  height: 100px;
  pointer-events: none;
}

.study-pet,
.study-pet-message {
  pointer-events: auto;
}

.study-pet {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 86px;
  height: 86px;
  padding: 0;
  cursor: pointer;
  background: transparent;
  border: 0;
  animation: study-pet-float 3.5s ease-in-out infinite;
}

.study-pet:focus-visible {
  outline: 3px solid rgba(9, 105, 232, .4);
  outline-offset: 4px;
  border-radius: 50%;
}

.study-pet-halo {
  position: absolute;
  right: 4px;
  bottom: 2px;
  width: 72px;
  height: 72px;
  border: 1px solid rgba(112, 217, 255, .65);
  border-radius: 50%;
  opacity: .55;
  animation: study-pet-halo 3.5s ease-in-out infinite;
}

.study-pet-body {
  position: absolute;
  right: 14px;
  bottom: 9px;
  width: 57px;
  height: 56px;
  display: grid;
  place-items: center;
  background: #0969e8;
  border: 2px solid #071943;
  border-radius: 45% 45% 40% 40%;
  box-shadow: 0 9px 18px rgba(7, 25, 67, .23), inset 0 -5px 0 rgba(7, 83, 186, .35);
  transition: transform .18s ease;
}

.study-pet-ear {
  position: absolute;
  top: 14px;
  width: 22px;
  height: 24px;
  background: #70d9ff;
  border: 2px solid #071943;
  z-index: -1;
  transition: transform .18s ease;
}

.study-pet-ear-left {
  left: 12px;
  transform: rotate(-28deg);
  border-radius: 12px 4px 4px;
}

.study-pet-ear-right {
  right: 8px;
  transform: rotate(28deg);
  border-radius: 4px 12px 4px;
}

.study-pet-antenna {
  position: absolute;
  top: 5px;
  right: 39px;
  width: 5px;
  height: 16px;
  background: #071943;
  border-radius: 3px;
  transform: rotate(9deg);
}

.study-pet-antenna::after {
  position: absolute;
  top: -5px;
  left: -4px;
  width: 12px;
  height: 12px;
  content: "";
  background: #ffd85c;
  border: 2px solid #071943;
  border-radius: 50%;
  animation: study-pet-antenna 2.7s ease-in-out infinite;
}

.study-pet-face {
  position: absolute;
  top: 12px;
  left: 8px;
  right: 8px;
  height: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  background: #071943;
  border: 1.5px solid #70d9ff;
  border-radius: 7px;
  transition: transform .18s ease;
}

.study-pet-eye {
  width: 5px;
  height: 8px;
  background: #70d9ff;
  border-radius: 50%;
  animation: study-pet-blink 4.2s ease-in-out infinite;
}

.study-pet-smile {
  position: absolute;
  bottom: 3px;
  left: 50%;
  width: 11px;
  height: 5px;
  border-bottom: 1.5px solid #70d9ff;
  border-radius: 0 0 10px 10px;
  transform: translateX(-50%);
}

.study-pet-cheek {
  position: absolute;
  top: 39px;
  width: 7px;
  height: 4px;
  background: #ffd85c;
  border-radius: 4px;
  opacity: .9;
}

.study-pet-cheek-left { left: 8px; }
.study-pet-cheek-right { right: 8px; }

.study-pet-mark {
  position: absolute;
  bottom: 0;
  color: #ffffff;
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 800;
}

.study-pet-tail {
  position: absolute;
  right: 1px;
  bottom: 23px;
  width: 22px;
  height: 10px;
  background: #63d8be;
  border: 2px solid #071943;
  border-left: 0;
  border-radius: 0 12px 12px 0;
  transform-origin: left center;
  animation: study-pet-tail 1.5s ease-in-out infinite;
}

.study-pet-spark {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #ffd85c;
  border-radius: 50%;
  opacity: 0;
}

.study-pet-spark-one { top: 13px; right: 3px; }
.study-pet-spark-two { top: 29px; left: 5px; background: #63d8be; }

.study-pet-message {
  position: absolute;
  right: 0;
  bottom: 86px;
  width: 244px;
  padding: 14px 14px 12px;
  color: #294366;
  font-size: .9rem;
  line-height: 1.48;
  background: #ffffff;
  border: 1px solid #cfe2f7;
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(19, 54, 107, .18);
  animation: study-pet-message-in .2s ease-out;
}

.study-pet-message::after {
  position: absolute;
  right: 24px;
  bottom: -7px;
  width: 12px;
  height: 12px;
  content: "";
  background: #ffffff;
  border-right: 1px solid #cfe2f7;
  border-bottom: 1px solid #cfe2f7;
  transform: rotate(45deg);
}

.study-pet-message-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: #0969e8;
  font-size: .72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.study-pet-message-label i {
  width: 7px;
  height: 7px;
  background: #42bf91;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(66, 191, 145, .14);
}

.study-pet-message p {
  margin: 0 26px 0 0;
}

.study-pet-close {
  position: absolute;
  top: 9px;
  right: 9px;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: #5c6b88;
  font-weight: 900;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 50%;
}

.study-pet-close:hover {
  color: #ffffff;
  background: #0969e8;
}


.study-pet-widget.is-curious .study-pet-body { transform: rotate(-5deg) translateY(-2px); }
.study-pet-widget.is-curious .study-pet-ear-left { transform: rotate(-42deg); }
.study-pet-widget.is-curious .study-pet-ear-right { transform: rotate(42deg); }
.study-pet-widget.is-curious .study-pet-face { transform: scale(1.05); }
.study-pet-widget.is-curious .study-pet-tail { animation-duration: .65s; }

.study-pet-widget.is-talking .study-pet-body {
  animation: study-pet-talk .62s ease-in-out infinite;
}

.study-pet-widget.is-talking .study-pet-face {
  transform: scale(1.04);
}

.study-pet-widget.is-talking .study-pet-tail {
  animation-duration: .7s;
}

.study-pet-widget.is-talking .study-pet-spark {
  animation: study-pet-spark 1s ease-out infinite;
}
.study-pet-widget.is-thinking .study-pet-body { animation: study-pet-think .7s ease-in-out 2; }
.study-pet-widget.is-thinking .study-pet-antenna::after { background: #70d9ff; }

.study-pet-widget.is-celebrating .study-pet { animation: study-pet-celebrate .72s ease-in-out 2; }
.study-pet-widget.is-celebrating .study-pet-spark,
.study-pet-widget.is-encouraging .study-pet-spark { animation: study-pet-spark .8s ease-out 2; }
.study-pet-widget.is-celebrating .study-pet-tail { animation-duration: .42s; }

@keyframes study-pet-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-7px) rotate(1deg); }
}

@keyframes study-pet-halo {
  0%, 100% { transform: scale(.88); opacity: .2; }
  50% { transform: scale(1); opacity: .65; }
}

@keyframes study-pet-tail {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(21deg); }
}

@keyframes study-pet-blink {
  0%, 44%, 48%, 100% { transform: scaleY(1); }
  46% { transform: scaleY(.1); }
}

@keyframes study-pet-antenna {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.22); }
}

@keyframes study-pet-think {
  0%, 100% { transform: rotate(0); }
  50% { transform: rotate(-8deg) translateY(-3px); }
}

@keyframes study-pet-talk {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(-3deg); }
}
@keyframes study-pet-celebrate {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-14px) rotate(-8deg); }
}

@keyframes study-pet-spark {
  0% { opacity: 0; transform: scale(.4); }
  45% { opacity: 1; transform: translateY(-12px) scale(1); }
  100% { opacity: 0; transform: translateY(-21px) scale(.3); }
}

@keyframes study-pet-message-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 680px) {
  .study-pet-widget {
    right: 12px;
    bottom: 12px;
    transform: scale(.86);
    transform-origin: bottom right;
  }
}

@media (prefers-reduced-motion: reduce) {
  .study-pet,
  .study-pet-halo,
  .study-pet-tail,
  .study-pet-eye,
  .study-pet-antenna::after,
  .study-pet-spark {
    animation: none !important;
  }
}

/* Polimento cromático do mascote — julho de 2026 */
.study-pet:focus-visible {
  outline-color: rgba(73, 190, 255, .58);
}

.study-pet-halo {
  background: radial-gradient(circle, rgba(103, 226, 255, .2) 0 43%, rgba(90, 126, 255, .09) 58%, transparent 72%);
  border-color: rgba(103, 226, 255, .75);
  box-shadow: 0 0 18px rgba(60, 177, 255, .2), inset 0 0 14px rgba(124, 99, 255, .13);
}

.study-pet-body {
  overflow: hidden;
  background: linear-gradient(145deg, #38b9ff 0%, #0878ee 42%, #3157db 70%, #6a4bd4 100%);
  border-color: #06183d;
  box-shadow: 0 11px 22px rgba(7, 45, 121, .3), 0 3px 8px rgba(65, 174, 255, .2), inset 0 2px 0 rgba(255, 255, 255, .34), inset 0 -7px 11px rgba(35, 36, 146, .3);
}

.study-pet-body::before {
  position: absolute;
  top: 3px;
  left: 8px;
  width: 34px;
  height: 15px;
  content: "";
  pointer-events: none;
  background: linear-gradient(110deg, rgba(255,255,255,.52), rgba(255,255,255,.07));
  border-radius: 50%;
  transform: rotate(-8deg);
}

.study-pet-body::after {
  position: absolute;
  right: 5px;
  bottom: 8px;
  width: 8px;
  height: 18px;
  content: "";
  pointer-events: none;
  background: linear-gradient(180deg, rgba(180, 238, 255, .3), transparent);
  border-radius: 8px;
}

.study-pet-ear {
  background: linear-gradient(145deg, #92f0ff 0%, #55c6ff 46%, #7c6cff 100%);
  border-color: #06183d;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.46), 0 4px 9px rgba(45, 92, 190, .22);
}

.study-pet-antenna {
  background: linear-gradient(180deg, #152b5c, #06183d);
}

.study-pet-antenna::after {
  background: radial-gradient(circle at 35% 30%, #fff4a8 0 14%, #ffd85c 33%, #ffad42 74%, #ff7b4e 100%);
  border-color: #06183d;
  box-shadow: 0 0 0 3px rgba(255, 202, 79, .14), 0 0 12px rgba(255, 177, 55, .5), inset 0 1px 2px rgba(255,255,255,.72);
}

.study-pet-face {
  z-index: 1;
  background: linear-gradient(180deg, #07173b 0%, #0b285b 100%);
  border-color: #72e6ff;
  box-shadow: inset 0 2px 5px rgba(1, 8, 28, .74), 0 1px 0 rgba(255,255,255,.18), 0 0 8px rgba(84, 219, 255, .18);
}

.study-pet-eye {
  background: linear-gradient(180deg, #d6fbff, #62e8ff 48%, #49bfff);
  box-shadow: 0 0 6px rgba(96, 232, 255, .85);
}

.study-pet-smile {
  border-bottom-color: #79ecff;
}

.study-pet-cheek {
  z-index: 1;
  background: linear-gradient(90deg, #ffac66, #ffd85c 55%, #fff0a0);
  box-shadow: 0 0 5px rgba(255, 196, 76, .48);
}

.study-pet-mark {
  z-index: 1;
  text-shadow: 0 1px 3px rgba(13, 24, 82, .48), 0 0 5px rgba(164, 233, 255, .4);
}

.study-pet-tail {
  background: linear-gradient(90deg, #38cfa9, #70e8c9 55%, #65d9ff);
  border-color: #06183d;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.42), 0 4px 8px rgba(24, 127, 128, .2);
}

.study-pet-spark {
  background: radial-gradient(circle at 35% 30%, #fff8bc, #ffd85c 56%, #ff9f43);
  box-shadow: 0 0 8px rgba(255, 193, 69, .65);
}

.study-pet-spark-two {
  background: radial-gradient(circle at 35% 30%, #d9fff6, #63d8be 58%, #3ebed7);
  box-shadow: 0 0 8px rgba(76, 221, 194, .6);
}

.study-pet-message {
  background: linear-gradient(145deg, #ffffff 0%, #f8fcff 62%, #f5f3ff 100%);
  border-color: #bfdcf6;
  box-shadow: 0 18px 40px rgba(19, 54, 107, .2), 0 4px 12px rgba(68, 126, 222, .09), inset 0 1px 0 rgba(255,255,255,.92);
}

.study-pet-message::after {
  background: #f8fbff;
  border-color: #bfdcf6;
}

.study-pet-message-label {
  color: #176fe3;
}

.study-pet-message-label i {
  background: linear-gradient(145deg, #72e6bf, #2dbb8c);
}

.study-pet-close:hover {
  background: linear-gradient(145deg, #168cf4, #5d56df);
}

.study-pet-widget.is-thinking .study-pet-antenna::after {
  background: radial-gradient(circle at 35% 30%, #e5fdff, #70d9ff 50%, #5c7cff);
}


/* Expressividade dos olhos — julho de 2026 */
.study-pet-eye {
  position: relative;
  transform-origin: center;
  animation: study-pet-eye-life 6.2s cubic-bezier(.45, 0, .25, 1) infinite;
}

.study-pet-eye:nth-child(2) {
  animation-delay: .055s;
}

.study-pet-eye::after {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 2px;
  height: 2px;
  content: "";
  background: rgba(255,255,255,.96);
  border-radius: 50%;
  box-shadow: 0 0 3px rgba(255,255,255,.85);
  animation: study-pet-eye-glint 3.1s ease-in-out infinite;
}

.study-pet-eye:nth-child(2)::after {
  animation-delay: .18s;
}

.study-pet-widget.is-curious .study-pet-eye {
  animation: study-pet-eye-curious 1.75s ease-in-out infinite;
}

.study-pet-widget.is-talking .study-pet-eye {
  animation-duration: 3.1s;
}

.study-pet-widget.is-thinking .study-pet-eye {
  animation: study-pet-eye-thinking 1.65s ease-in-out infinite;
}

.study-pet-widget.is-celebrating .study-pet-eye,
.study-pet-widget.is-encouraging .study-pet-eye {
  animation: study-pet-eye-happy .82s ease-in-out infinite;
}

@keyframes study-pet-eye-life {
  0%, 8%, 13%, 27%, 32%, 47%, 52%, 68%, 73%, 88%, 100% {
    transform: translate(0, 0) scale(1, 1);
  }
  9.5%, 11.5%, 28.5%, 30.5%, 69.5%, 71.5% {
    transform: translate(0, 0) scale(1.08, .09);
  }
  19%, 23% {
    transform: translateX(-1.35px) scale(1, 1.03);
  }
  39%, 44% {
    transform: translateX(1.35px) scale(1, 1.03);
  }
  57%, 62% {
    transform: translateY(-1px) scale(1.08, 1.05);
  }
  81%, 85% {
    transform: translateY(.7px) scale(1.03, .94);
  }
}

@keyframes study-pet-eye-glint {
  0%, 20%, 100% { opacity: .9; transform: translate(0, 0) scale(1); }
  42% { opacity: .45; transform: translate(.7px, .4px) scale(.65); }
  58% { opacity: 1; transform: translate(-.3px, -.4px) scale(1.25); }
  72% { opacity: .7; transform: translate(0, 0) scale(.85); }
}

@keyframes study-pet-eye-curious {
  0%, 100% { transform: translate(-.7px, -1px) scale(1.18, 1.12); }
  45% { transform: translate(1px, -.6px) scale(1.25, 1.18); }
  52% { transform: translate(1px, -.6px) scale(1.22, .12); }
  59% { transform: translate(1px, -.6px) scale(1.25, 1.18); }
}

@keyframes study-pet-eye-thinking {
  0%, 100% { transform: translate(-1px, -1.2px) scale(1.08); }
  50% { transform: translate(1px, -1.2px) scale(1.12); }
}

@keyframes study-pet-eye-happy {
  0%, 100% { transform: translateY(0) scale(1.12, .72); }
  50% { transform: translateY(-.7px) scale(1.18, .52); }
}

@media (prefers-reduced-motion: reduce) {
  .study-pet-eye::after {
    animation: none !important;
  }
}

/* Android/celulares: ocupa menos da área útil e mantém o balão controlado. */
@media (max-width: 680px) {
  .study-pet-widget {
    right: 8px;
    bottom: 8px;
    transform: scale(.78);
    transform-origin: bottom right;
  }

  .study-pet-message {
    bottom: 82px;
    width: min(222px, calc(100vw - 32px));
    max-height: 38vh;
    overflow-y: auto;
  }
}