:root {
  --sky: #418EE9;
  --cream: #FFF3DC;
  --yellow: #FBC024;
  --ink: #065279;
  --paw-cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cg fill='%23FBC024' stroke='%23065279' stroke-width='1.2'%3E%3Cellipse cx='16' cy='21' rx='9' ry='7'/%3E%3Ccircle cx='6' cy='13' r='4'/%3E%3Ccircle cx='13' cy='7' r='4'/%3E%3Ccircle cx='21' cy='7' r='4'/%3E%3Ccircle cx='27' cy='14' r='4'/%3E%3C/g%3E%3C/svg%3E") 6 4, pointer;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  background: var(--sky);
  color: var(--cream);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif;
}
.world {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 58px 24px 38px;
}
.world-back {
  position: fixed;
  z-index: 50;
  top: 18px;
  left: 22px;
  padding: 5px 0;
  border-bottom: 2px solid var(--yellow);
  color: var(--cream);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}
.world-back:focus-visible { outline: 3px dashed var(--cream); outline-offset: 5px; }
.world-scene {
  position: relative;
  width: min(1100px, 100%);
  aspect-ratio: 1672 / 941;
}
.world-reference {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 1;
  transition: opacity 260ms ease;
}
.world-scene.is-ready .world-reference { opacity: 0; }
.actor {
  position: absolute;
  z-index: 3;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  opacity: 0;
  cursor: var(--paw-cursor);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: translate 1800ms cubic-bezier(.35, .05, .25, 1), opacity 260ms ease;
}
.world-scene.is-ready .actor { opacity: 1; }
.actor img {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: 50% 100%;
  pointer-events: none;
  user-select: none;
}
.actor:focus-visible { outline: 3px dashed var(--cream); outline-offset: 1px; border-radius: 28%; }
.actor--ying { left: 49.04%; top: 13.82%; width: 31.46%; z-index: 4; }
.actor--cream { left: 38.82%; top: 45.16%; width: 22.85%; z-index: 5; }
.actor--white { left: 28.89%; top: 64.82%; width: 28.71%; z-index: 5; }
.actor--black { left: 73.57%; top: 38.47%; width: 20.69%; z-index: 3; }
.actor--orange { left: 60.17%; top: 61.64%; width: 31.1%; z-index: 6; }
.actor.is-moving img { animation: actor-trot 650ms ease-in-out 2; }
.actor.is-petted img { animation: actor-pet 720ms ease-out 1; }
.actor-message {
  position: absolute;
  z-index: 20;
  left: 50%;
  bottom: 92%;
  width: max-content;
  max-width: 220px;
  padding: 10px 14px;
  border: 2px solid var(--cream);
  border-radius: 14px 14px 14px 4px;
  background: var(--cream);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.65;
  text-align: left;
  box-shadow: 4px 5px 0 rgba(6, 82, 121, .16);
  opacity: 0;
  visibility: hidden;
  translate: -50% 0;
  pointer-events: none;
}
.actor--black .actor-message, .actor--orange .actor-message {
  left: auto;
  right: 0;
  border-radius: 14px 14px 4px;
  translate: none;
}
.actor-message.is-visible { visibility: visible; animation: actor-message 2800ms ease both; }
@keyframes actor-trot {
  0%, 100% { transform: translateY(0) rotate(0); }
  35% { transform: translateY(-6px) rotate(-1.2deg); }
  70% { transform: translateY(-2px) rotate(1deg); }
}
@keyframes actor-pet {
  0%, 100% { transform: scale(1) rotate(0); }
  35% { transform: scale(1.035) rotate(-1.5deg); }
  65% { transform: scale(.99) rotate(1deg); }
}
@keyframes actor-message {
  0% { opacity: 0; transform: translateY(7px) scale(.96); }
  10%, 82% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-5px) scale(.98); }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 600px) {
  .world { padding: 54px 0 24px; }
  .world-back { top: 14px; left: 16px; font-size: 12px; }
  .actor-message { max-width: 150px; padding: 7px 9px; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .world-reference, .actor { transition: none; }
  .actor img, .actor-message { animation: none !important; }
  .actor-message.is-visible { opacity: 1; visibility: visible; }
}
