* {
  box-sizing: border-box;
}

:root {
  --size: 60;
  --margin: 20;
  --pokeball-size: 50;
  --pokeball-white: #e6e6e6;
  --pokeball-red: #f20d0d;
  --beam-color: #f20d59;
}

@media (max-width: 600px) {
  :root {
    --size: 85;
  }
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: #d1ecfa;
}

.ditto {
  --hue: 320;
  --lightness: 75;
  --stroke: 5;
  height: calc(var(--size) * 1vmin);
  width: calc(var(--size) * 1vmin);
  z-index: 2;
}

.ditto>g {
  transform: translate(200px, 200px);
}

.ditto g {
  fill: hsla(var(--hue), 100%, calc(var(--lightness) * 1%), var(--alpha, 1));
  stroke: #000;
  stroke-width: calc(var(--stroke) * 1px);
  transition: d 0.15s ease;
}

.ditto path {
  transition: d 0.15s ease;
}

.ditto__real {
  opacity: 0;
}

.ditto__body {
  --lightness: 45;
  --stroke: 0;
}

.ditto__clone {
  --lightness: 80;
  --stroke: 0;
}

.ditto__stroke {
  --hue: 0;
  --alpha: 0;
  --stroke: 5;
  --lightness: 0;
  fill: none;
}

.ditto__outline {
  --hue: 340;
  --lightness: 50;
  --stroke: 0;
}

.pokeball {
  --level: 50;
  height: 100%;
  width: 100%;
  border-radius: 50%;
  border: 2px solid #000;
  position: relative;
  overflow: hidden;
  transition: all 0.15s ease;
  cursor: pointer;
  background: var(--pokeball-white);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  outline: transparent;
}

.pokeball:after {
  content: '';
  position: absolute;
  top: 25%;
  left: 75%;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  height: 10px;
  width: 10px;
  transform: translate(-25%, -25%) rotate(-20deg);
  z-index: 2;
}

.pokeball:before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  height: 80%;
  width: 80%;
  border: 2px solid #595959;
  z-index: 2;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  -webkit-clip-path: polygon(50% 50%, 100% 65%, 100% 100%, 65% 100%);
  clip-path: polygon(50% 50%, 100% 65%, 100% 100%, 65% 100%);
}

.pokeball__beam {
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform: translate(-50%, 0);
  width: calc(var(--pokeball-size) * 0.25px);
  background: var(--beam-color);
  filter: blur(2px);
  height: calc((var(--size) * 0.22vmin) + (var(--margin) * 1vmin) + (var(--pokeball-size) * 0.5px));
  z-index: -1;
}

.pokeball__wrapper {
  transform-style: preserve-3d;
  height: calc(var(--pokeball-size) * 1px);
  width: calc(var(--pokeball-size) * 1px);
  position: relative;
  margin-top: calc(var(--margin) * 1vmin);
}

.pokeball:hover {
  --level: 0;
}

.pokeball__face {
  height: 100%;
  background: linear-gradient(var(--pokeball-red) calc(50% - 1px), #000 calc(50% - 1px) calc(50% + 1px), var(--pokeball-white) calc(50% + 1px));
  width: 100%;
  position: absolute;
  top: calc(var(--level) * 1%);
  left: 0;
  transition: all 0.15s ease;
  transform: translate(0, -50%);
}

.pokeball__face:after {
  content: "";
  height: 5px;
  width: 5px;
  border: 2px solid #000;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: calc(var(--level) * 1%);
  left: 50%;
  transform: translate(-50%, -50%);
}

.pokeball__face:before {
  content: "";
  height: 12px;
  width: 12px;
  border: 2px solid #000;
  border-radius: 50%;
  background: #bfbfbf;
  position: absolute;
  top: calc(var(--level) * 1%);
  left: 50%;
  transition: all 0.15s ease;
  transform: translate(-50%, -50%);
}