/* The scene is an SVG ink layer; the HTML button is its only interactive hit area. */
.word-creature-layer {
  overflow: visible;
  font-family: "Hiragino Maru Gothic ProN", "Arial Rounded MT Bold", sans-serif;
  pointer-events: none;
  isolation: isolate;
}

.word-creature-layer [class^="word-creature-"] {
  vector-effect: non-scaling-stroke;
}

.word-creature-scene {
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity calc(var(--word-creature-phase-duration, 350ms) * .55) ease,
    transform calc(var(--word-creature-phase-duration, 350ms) * .55) cubic-bezier(.2, 1.4, .4, 1);
}

.word-creature-scene--face {
  animation: word-creature-face-in calc(var(--word-creature-phase-duration, 350ms) * 1.1) cubic-bezier(.2, 1.35, .35, 1) both;
}

.word-creature-face-patch {
  fill: var(--word-creature-accent, #ef91a7);
  fill-opacity: .92;
  stroke: var(--word-creature-ink, #a85578);
  stroke-width: 3;
  stroke-linejoin: round;
}

.word-creature-face-brow {
  fill: none;
  stroke: var(--word-creature-ink, #a85578);
  stroke-width: 6;
  stroke-linecap: round;
}

.word-creature-face-sockets ellipse {
  fill: #fffaf5;
  stroke: var(--word-creature-ink, #a85578);
  stroke-width: 2;
}

.word-creature-face-dots circle {
  fill: var(--word-creature-ink, #a85578);
}

.word-creature-face-mouth {
  fill: none;
  stroke: var(--word-creature-ink, #a85578);
  stroke-width: 5;
  stroke-linecap: round;
}

.word-creature-face-glyph {
  fill: #fffaf4;
  paint-order: stroke;
  stroke: var(--word-creature-ink, #a85578);
  stroke-width: 2;
  font-size: 24px;
  font-weight: 900;
}

.word-creature-scene--wheel {
  animation: word-creature-wheel-roll calc(800ms * var(--word-creature-timing, 1)) cubic-bezier(.18, 1.25, .3, 1) both;
}

.word-creature-wheel-shadow {
  fill: #4f384522;
  filter: blur(3px);
}

.word-creature-wheel-rim {
  fill: var(--word-creature-rim, #e89ab0);
  fill-opacity: .32;
  stroke: var(--word-creature-ink, #a85578);
  stroke-width: 4;
}

.word-creature-wheel-inner {
  fill: #fffaf51f;
  stroke: #fffaf5aa;
  stroke-width: 3;
  stroke-dasharray: 3 9;
}

.word-creature-unwind {
  fill: none;
  stroke: var(--word-creature-ink, #a85578);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 4 9;
  opacity: .72;
  animation: word-creature-thread 700ms ease-out both;
}

.word-creature-wheel-glyph {
  fill: var(--word-creature-ink, #a85578);
  font-size: 22px;
  font-weight: 900;
  paint-order: stroke;
  stroke: #fffaf566;
  stroke-width: 2;
}

.word-creature-scene--belly {
  animation: word-creature-belly-pop calc(500ms * var(--word-creature-timing, 1)) cubic-bezier(.2, 1.4, .35, 1) both;
}

.word-creature-belly-window {
  fill: #fffaf51c;
  stroke: var(--word-creature-ink, #a85578);
  stroke-width: 4;
  stroke-dasharray: 2 8;
}

.word-creature-belly-orbit {
  fill: none;
  stroke: var(--word-creature-accent, #ef91a7);
  stroke-opacity: .65;
  stroke-width: 2;
  stroke-dasharray: 4 7;
  animation: word-creature-orbit calc(2.3s * var(--word-creature-timing, 1)) linear infinite;
}

.word-creature-belly-mouth {
  fill: none;
  stroke: var(--word-creature-ink, #a85578);
  stroke-width: 6;
  stroke-linecap: round;
  animation: word-creature-chew calc(900ms * var(--word-creature-timing, 1)) ease-in-out infinite alternate;
}

.word-creature-belly-glyph {
  fill: var(--word-creature-ink, #a85578);
  font-size: 19px;
  font-weight: 900;
  paint-order: stroke;
  stroke: #fffaf566;
  stroke-width: 2;
}

.word-creature-scene--hat {
  animation: word-creature-hat-land calc(900ms * var(--word-creature-timing, 1)) cubic-bezier(.2, 1.3, .35, 1) both;
}

.word-creature-hat-balloon {
  fill: #fffaf58f;
  stroke: var(--word-creature-ink, #a85578);
  stroke-width: 3;
  filter: drop-shadow(0 4px 2px #5c435c1f);
}

.word-creature-hat-tail {
  fill: #fffaf5b8;
  stroke: var(--word-creature-ink, #a85578);
  stroke-width: 3;
  stroke-linejoin: round;
}

.word-creature-hat-eyes circle {
  fill: #fffaf5;
  stroke: var(--word-creature-ink, #a85578);
  stroke-width: 2;
}

.word-creature-hat-dots circle {
  fill: var(--word-creature-ink, #a85578);
  animation: word-creature-blink 3.6s ease-in-out infinite;
}

.word-creature-hat-text {
  fill: var(--word-creature-ink, #a85578);
  font-size: 25px;
  font-weight: 900;
  letter-spacing: .04em;
  paint-order: stroke;
  stroke: #fffaf5;
  stroke-width: 3;
}

.word-creature-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: transparent;
  font-size: 0;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  white-space: normal;
  opacity: 1;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.word-creature-handle::before {
  content: attr(data-action);
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  opacity: .86;
  background: #fffaf5dd;
  border: 1px solid #d7c3c8;
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--word-creature-ink, #a85578);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  pointer-events: none;
}

.word-creature-handle:hover,
.word-creature-handle:focus-visible {
  background: transparent;
  border-color: transparent;
  transform: none;
}

.word-creature-handle:focus-visible {
  outline: none;
  border-color: var(--word-creature-ink, #a85578);
  box-shadow: 0 0 0 3px #fffaf5, 0 0 0 6px var(--word-creature-ink, #a85578);
}

.word-creature-handle:active {
  background: transparent;
  transform: none;
}

.word-creature-handle:disabled {
  opacity: 1;
  background: transparent;
  border-color: transparent;
  cursor: default;
  pointer-events: none;
}

.word-creature-handle.is-face {
  border-style: dashed;
}

.word-creature-handle.is-wheel {
  border-style: solid;
}

.word-creature-handle.is-belly,
.word-creature-handle.is-hat {
  opacity: 1;
}

.word-creature-native-face--hidden {
  opacity: 0;
  transition: opacity calc(var(--word-creature-phase-duration, 350ms) * .45) ease;
}

@keyframes word-creature-face-in {
  from { opacity: 0; transform: scale(.72) rotate(-7deg); }
  65% { opacity: 1; transform: scale(calc(1 + .08 * var(--word-creature-amplitude, 1))) rotate(3deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes word-creature-wheel-roll {
  from { opacity: 0; transform: translateX(-38px) rotate(-28deg) scale(.7, 1.12); }
  55% { opacity: 1; transform: translateX(9px) rotate(16deg) scale(1.05, .94); }
  to { opacity: 1; transform: translateX(0) rotate(0) scale(1); }
}

@keyframes word-creature-thread {
  from { stroke-dashoffset: 70; opacity: 0; }
  to { stroke-dashoffset: 0; opacity: .72; }
}

@keyframes word-creature-belly-pop {
  from { opacity: 0; transform: scale(.8); }
  70% { opacity: 1; transform: scale(1.05, .94); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes word-creature-chew {
  from { transform: scaleX(.82); }
  to { transform: scaleX(1.16); }
}

@keyframes word-creature-orbit { to { transform: rotate(360deg); } }

@keyframes word-creature-hat-land {
  from { opacity: 0; transform: translateY(-22px) scale(1.12, .82); }
  48% { opacity: 1; transform: translateY(6px) scale(.94, 1.1); }
  72% { transform: translateY(-3px) scale(1.03, .96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes word-creature-blink {
  0%, 42%, 48%, 100% { transform: scaleY(1); }
  45% { transform: scaleY(.12); }
}

@media (prefers-reduced-motion: reduce) {
  .word-creature-scene,
  .word-creature-scene--face,
  .word-creature-scene--wheel,
  .word-creature-scene--belly,
  .word-creature-scene--hat,
  .word-creature-unwind,
  .word-creature-belly-orbit,
  .word-creature-belly-mouth,
  .word-creature-hat-dots circle,
  .word-creature-handle,
  .word-creature-native-face--hidden {
    animation: none;
    transition: none;
  }
}
