/* Escolha do companheiro */
.mascot-section {
  background: radial-gradient(ellipse at top right, #fbeded, transparent 64%), linear-gradient(145deg, #fff, #faf4fd);
}

.mascot-section-intro { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.mascot-section-intro .mascot-sparkle { color: #9e7bb7; font-size: 3rem; }
.mascot-section fieldset { min-width: 0; margin: 12px 0 0; padding: 0; border: 0; }
.mascot-section legend { margin-bottom: 8px; color: #65547c; font-size: .8rem; font-weight: 800; }
.mascot-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.mascot-option { position: relative; min-width: 0; cursor: pointer; }
.mascot-option input { position: absolute; inset: 0 auto auto 0; width: 1px; height: 1px; opacity: 0; }

.mascot-option-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 66px;
  height: 100%;
  gap: 3px;
  padding: 6px 3px;
  border: 1px solid #eadff0;
  border-radius: 11px;
  background: #fff;
  color: #5d4c77;
  text-align: center;
  transition: border-color .2s, background .2s, transform .2s;
}

.mascot-option:hover .mascot-option-content { border-color: #b296cd; transform: translateY(-2px); }
.mascot-option input:checked + .mascot-option-content {
  border-color: #a487c5;
  background: linear-gradient(145deg, #f3e8fc, #fff1ed);
  box-shadow: inset 0 0 0 1px #b69acf70, 0 3px 9px #9c78c01a;
}

.mascot-option input:checked + .mascot-option-content::after {
  content: '✓';
  position: absolute;
  top: 2px;
  right: 4px;
  color: #77529a;
  font-size: .74rem;
  font-weight: 900;
}

.mascot-option input:focus-visible + .mascot-option-content { outline: 2px solid #8669af; outline-offset: 2px; }
.mascot-option input:disabled + .mascot-option-content { opacity: .64; }

.mascot-option-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: linear-gradient(135deg, #eae2fb, #fcebe7);
  font-size: 1.16rem;
  line-height: 1;
}

.mascot-option-content strong { font-size: .72rem; overflow-wrap: anywhere; }
.mascot-option-content small { color: #785e8d; font-size: .68rem; }
.mascot-form-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.mascot-form-footer .mascot-status { margin: 0; color: #675679; font-size: .8rem; }
.mascot-form-footer .mascot-status[data-error] { color: #a73558; }
.profile-sidebar .mascot-section summary { color: #344576; cursor: pointer; }
.profile-sidebar .mascot-section summary span { margin-left: 6px; color: #65547c; font-size: .78rem; }
.profile-sidebar .mascot-section fieldset { margin-top: 9px; }

/* A posição no viewport é controlada pelo script. Só a arte interna anima aqui. */
button.wandering-mascot {
  --pet-fur: #efa379;
  --pet-light: #ffd2ad;
  --pet-paw: #d9906c;
  --pet-line: #aa6b5d;
  --pet-belly: #fff2df;
  --pet-blush: #e9969d;
  --pet-eye: #4b3652;
  --pet-texture:
    radial-gradient(ellipse at 1px 1px, #fff6 0 .65px, transparent .9px) 0 0 / 4px 5px,
    repeating-linear-gradient(54deg, transparent 0 3px, #fff3 3.5px 4px, transparent 4.5px 7px);
  position: fixed;
  z-index: 18;
  top: 0;
  left: 0;
  width: 94px;
  height: 94px;
  padding: 0;
  border: 0;
  border-radius: 28px;
  background: transparent;
  box-shadow: none;
  color: inherit;
  overflow: visible;
  appearance: none;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button.wandering-mascot:focus-visible { outline: 2px solid #8669af; outline-offset: 2px; }
button.wandering-mascot.is-dragging { cursor: grabbing; }
button.wandering-mascot:is(.is-dragging, .is-falling) { z-index: 22; }

.wandering-mascot :is(.mascot-art, .mascot-shadow, .mascot-reaction),
.wandering-mascot .mascot-art :is(span, i) {
  position: absolute;
  display: block;
  box-sizing: border-box;
  pointer-events: none;
}

.wandering-mascot .mascot-art {
  inset: 0;
  filter: drop-shadow(0 2px 2px #5d355523);
  transform-origin: 50% 93%;
}

.wandering-mascot.from-right .mascot-art { transform: scaleX(-1); }
.wandering-mascot .mascot-shadow {
  left: 16px;
  bottom: 5px;
  width: 63px;
  height: 8px;
  border-radius: 50%;
  background: #69477337;
  filter: blur(2px);
  transition: opacity .15s ease, scale .18s ease;
}

.wandering-mascot:is(.is-dragging, .is-falling) .mascot-shadow { opacity: 0; }
.wandering-mascot.is-landing .mascot-shadow { scale: 1.25 1; }
.wandering-mascot .mascot-body {
  left: 22px;
  bottom: 14px;
  width: 54px;
  height: 35px;
  border: 1px solid var(--pet-line);
  border-radius: 53% 48% 44% 47%;
  background: var(--pet-texture), linear-gradient(148deg, var(--pet-light), var(--pet-fur));
  box-shadow: inset 0 -4px 7px #60354a21, inset 0 2px 3px #fff6;
}

.wandering-mascot .mascot-body::before {
  content: '';
  position: absolute;
  top: 5px;
  left: -3px;
  width: 11px;
  height: 17px;
  background: var(--pet-fur);
  clip-path: polygon(100% 0, 12% 35%, 42% 42%, 0 58%, 43% 68%, 19% 85%, 100% 100%);
  rotate: 14deg;
}

.wandering-mascot .mascot-belly {
  right: 5px;
  bottom: 3px;
  width: 20px;
  height: 18px;
  border-radius: 50%;
  background: var(--pet-texture), var(--pet-belly);
}

.wandering-mascot .mascot-tail {
  left: 6px;
  bottom: 24px;
  width: 34px;
  height: 21px;
  border: 1px solid var(--pet-line);
  border-radius: 69% 42% 59% 41%;
  background: var(--pet-texture), linear-gradient(135deg, var(--pet-light), var(--pet-fur));
  box-shadow: inset 0 -4px 5px #69425a26;
  rotate: 24deg;
  transform-origin: right center;
}

.wandering-mascot.mascot-fox .mascot-tail::after {
  content: '';
  position: absolute;
  left: 1px;
  top: 1px;
  width: 14px;
  height: 16px;
  border-radius: 80% 25% 55% 42%;
  background: var(--pet-texture), var(--pet-belly);
}

.wandering-mascot .mascot-head {
  left: 35px;
  bottom: 34px;
  width: 48px;
  height: 40px;
  isolation: isolate;
  border: 1px solid var(--pet-line);
  border-radius: 48% 47% 45% 49%;
  background: var(--pet-texture), linear-gradient(148deg, var(--pet-light) 15%, var(--pet-fur));
  box-shadow: inset 0 -3px 6px #6c39561a, inset 0 2px 3px #fff8;
}

.wandering-mascot .mascot-head::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 12px;
  width: 23px;
  height: 7px;
  border-radius: 50%;
  background: var(--pet-light);
  opacity: .7;
  rotate: -8deg;
}

.wandering-mascot .mascot-ear {
  z-index: -1;
  top: -9px;
  width: 17px;
  height: 19px;
  border: 1px solid var(--pet-line);
  border-radius: 68% 20% 31% 25%;
  background: var(--pet-texture), var(--pet-light);
}

.wandering-mascot .mascot-ear-left { left: 0; rotate: -21deg; }
.wandering-mascot .mascot-ear-right { right: 1px; transform: scaleX(-1) rotate(-21deg); }
.wandering-mascot .mascot-ear::after {
  content: '';
  position: absolute;
  inset: 4px 3px 4px;
  border-radius: inherit;
  background: var(--pet-blush);
}

.wandering-mascot .mascot-eye {
  z-index: 2;
  top: 15px;
  width: 5px;
  height: 7px;
  border-radius: 50%;
  background: var(--pet-eye);
}

.wandering-mascot .mascot-eye-left { left: 11px; }
.wandering-mascot .mascot-eye-right { right: 11px; }
.wandering-mascot .mascot-eye::after {
  content: '';
  position: absolute;
  left: 1px;
  top: 1px;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff;
}

.wandering-mascot .mascot-muzzle {
  left: 50%;
  top: 22px;
  width: 20px;
  height: 11px;
  translate: -50% 0;
  border-radius: 48%;
  background: var(--pet-belly);
}

.wandering-mascot .mascot-nose {
  z-index: 2;
  left: 50%;
  top: 22px;
  width: 5px;
  height: 4px;
  translate: -50% 0;
  border-radius: 45% 45% 60% 60%;
  background: #714b63;
}

.wandering-mascot .mascot-cheek {
  top: 24px;
  width: 8px;
  height: 5px;
  border-radius: 50%;
  background: var(--pet-blush);
  box-shadow: 0 0 3px var(--pet-blush);
  opacity: .74;
}

.wandering-mascot .mascot-cheek-left { left: 5px; }
.wandering-mascot .mascot-cheek-right { right: 5px; }
.wandering-mascot .mascot-leg {
  bottom: 9px;
  width: 12px;
  height: 16px;
  border: 1px solid var(--pet-line);
  border-radius: 8px;
  background: var(--pet-texture), var(--pet-paw);
  transform-origin: top center;
}

.wandering-mascot .mascot-leg-back { left: 30px; }
.wandering-mascot .mascot-leg-front { left: 60px; }
.wandering-mascot .mascot-glimmer {
  top: 8px;
  right: 2px;
  color: #a27cb8;
  font-size: 13px;
  opacity: .72;
  text-shadow: 0 0 4px #fff;
}

.wandering-mascot .mascot-art :is(.mascot-crest, .mascot-wing) { display: none; }

/* Variações do elenco */
.wandering-mascot.mascot-cat {
  --pet-fur: #c4b3de;
  --pet-light: #e9dff8;
  --pet-paw: #b6a0d3;
  --pet-line: #9075aa;
  --pet-belly: #f9ecf8;
}

.wandering-mascot.mascot-cat .mascot-tail {
  left: 7px;
  bottom: 23px;
  width: 31px;
  height: 11px;
  border-radius: 19px;
  rotate: 40deg;
}

.wandering-mascot.mascot-cat .mascot-muzzle::before,
.wandering-mascot.mascot-cat .mascot-muzzle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: -7px;
  width: 8px;
  height: 1px;
  background: #9378a8;
  box-shadow: 0 3px #9378a8;
  rotate: 6deg;
}

.wandering-mascot.mascot-cat .mascot-muzzle::after { left: auto; right: -7px; rotate: -6deg; }

.wandering-mascot.mascot-panda {
  --pet-fur: #f1e7f0;
  --pet-light: #fff8f5;
  --pet-paw: #726179;
  --pet-line: #7f6c85;
  --pet-belly: #fff9f6;
}

.wandering-mascot.mascot-panda .mascot-tail { left: 12px; width: 17px; height: 15px; background: var(--pet-paw); }
.wandering-mascot.mascot-panda .mascot-ear { border-radius: 50%; background: var(--pet-texture), var(--pet-paw); }
.wandering-mascot.mascot-panda .mascot-ear::after { display: none; }
.wandering-mascot.mascot-panda .mascot-eye { box-shadow: 0 0 0 3px #87768e; }

.wandering-mascot.mascot-bunny {
  --pet-fur: #f2d9df;
  --pet-light: #fff0ef;
  --pet-paw: #e5bfc9;
  --pet-line: #b57e93;
  --pet-belly: #fff8f3;
}

.wandering-mascot.mascot-bunny .mascot-ear { top: -18px; width: 12px; height: 24px; border-radius: 70% 65% 40% 42%; }
.wandering-mascot.mascot-bunny .mascot-ear-left { left: 6px; rotate: -16deg; }
.wandering-mascot.mascot-bunny .mascot-ear-right { right: 6px; transform: rotate(16deg); }
.wandering-mascot.mascot-bunny .mascot-tail { left: 12px; bottom: 24px; width: 18px; height: 18px; background: var(--pet-texture), var(--pet-belly); border-radius: 50%; }

.wandering-mascot.mascot-capybara {
  --pet-fur: #cc9a77;
  --pet-light: #f1c6a0;
  --pet-paw: #b68267;
  --pet-line: #976855;
  --pet-belly: #e8b792;
  --pet-blush: #eaa39a;
}

.wandering-mascot.mascot-capybara .mascot-ear { top: -4px; width: 12px; height: 11px; border-radius: 50%; }
.wandering-mascot.mascot-capybara .mascot-ear-left { left: 5px; }
.wandering-mascot.mascot-capybara .mascot-ear-right { right: 5px; }
.wandering-mascot.mascot-capybara .mascot-head { border-radius: 40% 44% 34% 39%; }
.wandering-mascot.mascot-capybara .mascot-muzzle { top: 21px; width: 31px; height: 13px; border-radius: 9px; }
.wandering-mascot.mascot-capybara .mascot-tail { left: 15px; width: 11px; height: 13px; border-radius: 50%; }

.wandering-mascot.mascot-axolotl {
  --pet-fur: #f4a8bd;
  --pet-light: #fdd6dd;
  --pet-paw: #e690ac;
  --pet-line: #b96c93;
  --pet-belly: #fff1eb;
  --pet-blush: #e67ca3;
  --pet-texture: radial-gradient(circle at 2px 2px, #fff5 0 .6px, transparent 1px) 0 0 / 6px 6px;
}

.wandering-mascot.mascot-axolotl .mascot-head { width: 50px; height: 35px; bottom: 34px; left: 31px; }
.wandering-mascot.mascot-axolotl .mascot-ear {
  top: 3px;
  left: -12px;
  width: 18px;
  height: 25px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(140deg, #ec86ac, #bc5686);
  clip-path: polygon(100% 38%, 10% 0, 2% 16%, 73% 51%, 0 40%, 0 61%, 74% 68%, 16% 82%, 25% 100%, 100% 79%);
}
.wandering-mascot.mascot-axolotl .mascot-ear-right { left: auto; right: -12px; }
.wandering-mascot.mascot-axolotl .mascot-ear::after { display: none; }
.wandering-mascot.mascot-axolotl .mascot-tail { left: 3px; width: 36px; border-radius: 5% 77% 52% 80%; rotate: 35deg; }
.wandering-mascot.mascot-axolotl .mascot-nose { width: 8px; height: 4px; background: transparent; border-bottom: 1px solid #834763; }

.wandering-mascot.mascot-griffin {
  --pet-fur: #dab088;
  --pet-light: #fff1d4;
  --pet-paw: #c89066;
  --pet-line: #ac795c;
  --pet-belly: #fff8e6;
}

.wandering-mascot.mascot-griffin .mascot-art .mascot-wing {
  display: block;
  left: 19px;
  bottom: 32px;
  width: 32px;
  height: 26px;
  border: 1px solid var(--pet-line);
  border-radius: 91% 23% 55% 32%;
  background: repeating-linear-gradient(25deg, #fff4 0 3px, transparent 4px 7px), linear-gradient(140deg, #fff6df, #d9a67c);
  rotate: -17deg;
}

.wandering-mascot.mascot-griffin .mascot-ear { background: var(--pet-texture), #f0c89a; }
.wandering-mascot.mascot-griffin .mascot-tail { width: 22px; height: 10px; bottom: 27px; border-radius: 20px; }
.wandering-mascot.mascot-griffin .mascot-nose { width: 14px; height: 9px; background: #e0a144; clip-path: polygon(0 0, 100% 0, 48% 100%); }

.wandering-mascot.mascot-dragon {
  --pet-fur: #8ec3b0;
  --pet-light: #d5efd4;
  --pet-paw: #70ac9b;
  --pet-line: #608e81;
  --pet-belly: #e7edba;
  --pet-blush: #f8adac;
}

.wandering-mascot.mascot-dragon .mascot-ear { top: -11px; height: 16px; border-radius: 76% 0 62% 10%; background: #f7dbaf; }
.wandering-mascot.mascot-dragon .mascot-ear::after { display: none; }
.wandering-mascot.mascot-dragon .mascot-tail { width: 40px; left: 2px; border-radius: 18% 70% 41% 64%; }
.wandering-mascot.mascot-dragon .mascot-art .mascot-crest {
  display: block;
  left: 5px;
  top: -13px;
  width: 35px;
  height: 15px;
  background: #8c6db0;
  clip-path: polygon(0 100%, 2% 47%, 19% 81%, 23% 18%, 48% 69%, 58% 8%, 80% 64%, 92% 22%, 100% 100%);
  rotate: -4deg;
}

.wandering-mascot.mascot-dragon .mascot-art .mascot-wing {
  display: block;
  left: 20px;
  bottom: 32px;
  width: 32px;
  height: 24px;
  background: linear-gradient(145deg, #a68cc6, #755c9a);
  clip-path: polygon(100% 100%, 0 62%, 12% 2%, 38% 30%, 57% 12%, 83% 62%);
}

.wandering-mascot.mascot-unicorn {
  --pet-fur: #dfd5f0;
  --pet-light: #fff7f1;
  --pet-paw: #bba7d8;
  --pet-line: #9f84b9;
  --pet-belly: #fceef7;
}

.wandering-mascot.mascot-unicorn .mascot-head { border-radius: 48% 43% 37% 50%; }
.wandering-mascot.mascot-unicorn .mascot-tail {
  background: var(--pet-texture), linear-gradient(122deg, #efa5bb, #c5a7ed 53%, #91c8d5);
  rotate: 36deg;
}

.wandering-mascot.mascot-unicorn .mascot-art .mascot-crest {
  display: block;
  left: 17px;
  top: -18px;
  width: 16px;
  height: 24px;
  background: repeating-linear-gradient(25deg, #f6cb88 0 4px, #fff0b7 5px 8px);
  clip-path: polygon(57% 0%, 100% 100%, 0 100%);
  rotate: 10deg;
}

.wandering-mascot .mascot-reaction {
  z-index: 3;
  top: 3px;
  right: 0;
  min-width: 17px;
  padding: 1px 3px;
  border-radius: 7px;
  background: #fff9fded;
  color: #8b559e;
  text-align: center;
  font-size: 13px;
  line-height: 1.1;
  opacity: 0;
  box-shadow: 0 1px 4px #5e3d723b;
}

.wandering-mascot .mascot-reaction:empty::before { content: '✧'; }
.wandering-mascot.is-walking .mascot-art { animation: pet-bob .46s ease-in-out infinite alternate; }
.wandering-mascot.is-walking .mascot-tail { animation: pet-wag .55s ease-in-out infinite alternate; }
.wandering-mascot.is-walking .mascot-leg { animation: pet-step .38s ease-in-out infinite alternate; }
.wandering-mascot.is-walking .mascot-leg-front { animation-direction: alternate-reverse; }
.wandering-mascot.is-dragging .mascot-art { scale: 1.08; }
.wandering-mascot.is-falling .mascot-art { scale: .83 1.16; }
.wandering-mascot.is-landing .mascot-art { animation: pet-land .38s cubic-bezier(.14,.63,.36,1); }
.wandering-mascot.is-greeting .mascot-art { animation: pet-greet .55s ease-in-out; }
.wandering-mascot:is(.is-landing, .is-greeting) .mascot-reaction { animation: pet-react .55s ease-out both; }
.wandering-mascot:is(.is-dragging, .is-landing) .mascot-glimmer { opacity: 1; }

@keyframes pet-bob { to { translate: 0 -2px; } }
@keyframes pet-step { from { rotate: -16deg; } to { rotate: 16deg; } }
@keyframes pet-wag { to { transform: rotate(-13deg); } }
@keyframes pet-land {
  0%, 15% { scale: 1.34 .34; }
  53% { scale: .92 1.13; }
  77% { scale: 1.04 .92; }
  100% { scale: 1; }
}
@keyframes pet-greet {
  0%, 100% { translate: 0 0; }
  38%, 65% { translate: 0 -7px; }
}
@keyframes pet-react {
  0% { opacity: 0; translate: 0 4px; }
  30%, 70% { opacity: 1; }
  100% { opacity: 0; translate: 0 -9px; }
}

@media (prefers-reduced-motion: reduce) {
  .wandering-mascot.wandering-mascot :is(.mascot-art, .mascot-leg, .mascot-tail, .mascot-reaction) { animation: none; scale: none; }
  .wandering-mascot:is(.is-landing, .is-greeting) .mascot-reaction { opacity: 1; }
  .wandering-mascot .mascot-shadow, .mascot-option-content { transition: none; transform: none; }
}
