*,
*::after,
*::before {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue';
}

a,
button,
img {
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

button {
  background-color: transparent;
  border: none;
  outline: none;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

body {
  height: 100vh;
  width: 100%;
  overflow: hidden;
  align-content: center;
}

.scene {
  width: 1920px;
  height: 1080px;
  background: url(assets/scene.webp) repeat-x;
  animation: move 5s linear infinite;
  width: 100%;
  background-position: bottom;
  position: relative;
  transform: translateY(-20%);
}

@keyframes move {
  0% {
    background-position: 0px;
  }
  100% {
    background-position: -960px;
  }
}

#sonic {
  width: 108px;
  height: 130px;
  background: url(assets/sonic.webp) repeat-x;
  animation: run 0.4s steps(8) infinite;
  margin: auto;
  position: absolute;
  bottom: 20%;
}

@keyframes run {
  0% {
    background-position: 0;
  }
  100% {
    background-position: -760px;
  }
}

#ring1,
#ring2,
#ring3,
#ring4 {
  width: 76px;
  height: 76px;
  background: url(assets/rings.webp) repeat-x;
  transform: scale(0.75, 0.75);
  position: absolute;
  bottom: 25%;
}

#ring1 {
  right: 70%;
  animation: turn 1s steps(10) infinite, near 1.1s linear infinite,
    transparent 1.1s linear infinite;
}

#ring2 {
  right: 64%;
  animation: turn 1s steps(10) infinite, near 1.1s linear 0.1s infinite,
    transparent 1.1s linear 0.1s infinite;
}

#ring3 {
  right: 60%;
  animation: turn 1s steps(10) infinite, near 1.1s linear 0.3s infinite,
    transparent 1.1s linear 0.3s infinite;
}

#ring4 {
  right: 56%;
  animation: turn 1s steps(10) infinite, near 1.1s linear 0.7s infinite,
    transparent 1.1s linear 0.7s infinite;
}

@keyframes turn {
  0% {
    background-position: 0;
  }
  100% {
    background-position: 760px;
  }
}

@keyframes near {
  100% {
    margin-right: 480px;
  }
}

@keyframes transparent {
  55% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
