/* Shared textured character. Product buttons retain their own geometry. */
[data-tebya-ghost] {
  --ghost-size: 200px;
  position: relative;
  display: inline-block;
  width: var(--ghost-size);
  max-width: 100%;
  aspect-ratio: 1;
  vertical-align: middle;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}
button[data-tebya-ghost]:not([data-ghost-decorative]) {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
[data-tebya-ghost]:focus-visible {
  outline: 2px solid var(--tn-foreground, #f4f3ef);
  outline-offset: 5px;
  border-radius: 28%;
}
[data-tebya-ghost] > img,
.tebya-ghost__fallback { display: block; width: 100%; height: 100%; object-fit: contain; }
[data-tebya-ghost] > img[hidden],
.tebya-ghost__fallback[hidden] { display: none !important; }
.tebya-ghost__stage { position: absolute; inset: 0; pointer-events: none; }
.tebya-ghost__stage[hidden] { display: none !important; }
.tebya-ghost__float,
.tebya-ghost__rig { position: absolute; inset: 0; transform-origin: 50% 56%; }
.tebya-ghost__float { animation: tebya-ghost-float 6s ease-in-out infinite; }
.tebya-ghost__rig {
  transform: perspective(700px) rotateX(var(--ghost-tilt-x, 0deg)) rotateY(var(--ghost-tilt-y, 0deg));
}
.tebya-ghost__body,
.tebya-ghost__face {
  position: absolute;
  display: block;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.tebya-ghost__face { fill: none; stroke: none; stroke-width: 0; }
.tebya-ghost__eye { transform-box: fill-box; transform-origin: center; transition: transform .1s ease; }
[data-tebya-ghost].is-ghost-blinking .tebya-ghost__eye { transform: scaleY(.08); }
.tebya-ghost__shadow {
  position: absolute;
  left: 28%;
  top: 82%;
  width: 42%;
  height: 4%;
  border-radius: 50%;
  background: #0000002e;
  filter: blur(5px);
  animation: tebya-ghost-shadow 6s ease-in-out infinite;
}
[data-ghost-state='wave'] .tebya-ghost__rig { animation: tebya-ghost-greet 1.1s ease-in-out both; }
[data-ghost-state='happy'] .tebya-ghost__rig { animation: tebya-ghost-happy .9s ease-in-out both; }
[data-ghost-state='happy'] .tebya-ghost__eye { transform: scaleY(.55); }
[data-ghost-state='thinking'] .tebya-ghost__rig { animation: tebya-ghost-think 1.8s ease-in-out infinite alternate; }
[data-ghost-state='thinking'] .tebya-ghost__eye--right { transform: scaleY(.75); }
[data-ghost-state='sleep'] .tebya-ghost__eye { transform: scaleY(.055); }
[data-ghost-state='sleep'] .tebya-ghost__pupil { opacity: 0; }
[data-ghost-state='sleep'] .tebya-ghost__float { animation-duration: 8s; }
[data-ghost-state='surprised'] .tebya-ghost__rig { animation: tebya-ghost-surprise .55s ease-out both; }
[data-ghost-state='surprised'] .tebya-ghost__eye { transform: scale(1.13); }
[data-ghost-state='vanish'] .tebya-ghost__body { animation: tebya-ghost-body-out 1.05s ease-in both; }
[data-ghost-state='vanish'] .tebya-ghost__face { animation: tebya-ghost-eyes-out .3s 1.05s ease-in both; }
[data-ghost-state='vanish'] .tebya-ghost__shadow { opacity: 0; animation: none; }
[data-ghost-state='appear'] .tebya-ghost__body { animation: tebya-ghost-in .6s ease-out both; }
[data-ghost-state='appear'] .tebya-ghost__face { animation: tebya-ghost-in .45s .12s ease-out both; }
[data-tebya-ghost][data-ghost-paused='true'] *,
[data-tebya-ghost].is-ghost-reduced * { animation-play-state: paused !important; }
[data-tebya-ghost].is-ghost-reduced .tebya-ghost__float,
[data-tebya-ghost].is-ghost-reduced .tebya-ghost__rig,
[data-tebya-ghost].is-ghost-reduced .tebya-ghost__body,
[data-tebya-ghost].is-ghost-reduced .tebya-ghost__face,
[data-tebya-ghost].is-ghost-reduced .tebya-ghost__shadow {
  animation: none !important;
  opacity: 1;
  transform: none;
}
[data-tebya-ghost].is-ghost-reduced .tebya-ghost__eye { transition: none; }
@keyframes tebya-ghost-float {
  0%, 100% { transform: translateY(2px); }
  50% { transform: translateY(-3px); }
}
@keyframes tebya-ghost-shadow {
  0%, 100% { transform: scaleX(1); opacity: .7; }
  50% { transform: scaleX(.91); opacity: .45; }
}
@keyframes tebya-ghost-greet {
  0%, 100% { transform: rotate(0deg); }
  35% { transform: rotate(-2deg); }
  70% { transform: rotate(1deg); }
}
@keyframes tebya-ghost-happy {
  0%, 48%, 100% { transform: translateY(0) scale(1); }
  16%, 64% { transform: translateY(1px) scale(1.025, .97); }
  30%, 78% { transform: translateY(-8px) scale(.985, 1.025); }
}
@keyframes tebya-ghost-think {
  from { transform: rotate(-3deg) translateX(-1px); }
  to { transform: rotate(2deg) translateX(1px); }
}
@keyframes tebya-ghost-surprise {
  0%, 100% { transform: scale(1); }
  36% { transform: translateY(-5px) scale(1.045); }
}
@keyframes tebya-ghost-body-out {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: translateY(-8px) scale(.96); }
}
@keyframes tebya-ghost-eyes-out {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(.85); }
}
@keyframes tebya-ghost-in {
  from { opacity: 0; transform: translateY(5px) scale(.97); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  [data-tebya-ghost] * { animation: none !important; transition: none !important; }
  [data-tebya-ghost] .tebya-ghost__float,
  [data-tebya-ghost] .tebya-ghost__rig,
  [data-tebya-ghost] .tebya-ghost__body,
  [data-tebya-ghost] .tebya-ghost__face,
  [data-tebya-ghost] .tebya-ghost__shadow { opacity: 1; transform: none; }
}
