:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  background: #10162f;
  color: #fff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100svh;
  padding: 1rem;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 1rem;
}

main {
  display: grid;
  place-items: center;
  min-width: 0;
}

.nyan-pawel {
  width: min(100%, calc(100svh - 7rem), 44rem);
  aspect-ratio: 1;
  background-image: url('./nyanpaweu.png');
  background-size: 600% 200%;
  animation: fly 1.2s steps(1) infinite;
  image-rendering: pixelated;
  padding: 0;
  border: 0;
  background-color: transparent;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-touch-callout: none;
}


.nyan-pawel[data-held="true"] {
  background-image: url('./nyanpaweu-yellow.png');
}

.nyan-pawel[data-paused="true"] {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .nyan-pawel:not([data-paused="false"]) {
    animation-play-state: paused;
  }
}

.playback {
  justify-self: center;
  padding: 0.65rem 1.25rem;
  min-height: 44px;
  border: 1px solid #8992b0;
  border-radius: 0.5rem;
  background: #10162f;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.playback:hover {
  background: #222d50;
}

button:focus-visible {
  outline: 3px solid #ffe66d;
  outline-offset: 4px;
}

@keyframes fly {
  0%     { background-position: 0% 0%; }
  8.33%  { background-position: 20% 0%; }
  16.67% { background-position: 40% 0%; }
  25%    { background-position: 60% 0%; }
  33.33% { background-position: 80% 0%; }
  41.67% { background-position: 100% 0%; }
  50%    { background-position: 0% 100%; }
  58.33% { background-position: 20% 100%; }
  66.67% { background-position: 40% 100%; }
  75%    { background-position: 60% 100%; }
  83.33% { background-position: 80% 100%; }
  91.67% { background-position: 100% 100%; }
}