* {
  box-sizing: border-box;
  font-family: "Comic Sans", "Comic Sans MS", "Chalkboard", "ChalkboardSE-Regular", sans-serif;
  cursor: url(img/cursor.png), auto;
}

body {
  margin: 0;
  display: flex;
  align-items: center;
  height: 100dvh;
}

#main {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-inline: auto;
}

#search_box {
  border: 0;
  outline: 0;
  background: url("img/sprites.png") -5px -5px;
  opacity: 0;
  height: 49px;
  width: 654px;
  padding-inline: 11px;
  font-size: 20px;
  font-weight: bold;

  body.loaded & {
    opacity: 1;
  }
}

.eye,
button {
  background-repeat: no-repeat;
  background-position: center;
}

#eyes {
  display: flex;
  justify-content: space-between;

  .eye {
    position: relative;
  }

  #left_eye {
    width: 66px;
    height: 63px;
    background: url("img/sprites.png") -83px -64px;
  }

  #right_eye {
    width: 68px;
    height: 65px;
    background: url("img/sprites.png") -5px -64px;
  }

  .pupil {
    position: absolute;
    border-radius: 100%;
    margin: 7px;
    width: 10px;
    height: 10px;
  }

  #left_pupil {
    background: url("img/sprites.png") -381px -64px;
  }

  #right_pupil {
    background: url("img/sprites.png") -401px -64px;
  }

  .lids {
    --border-width: 3px;
    position: absolute;
    inset: 4px;
    z-index: 1;
    border-radius: 50%;
    overflow: hidden;

    &::before,
    &::after {
      --closed-height: calc(var(--closed-height-percent) + var(--border-width));
      content: "";
      display: block;
      position: absolute;
      height: 0;
      width: 100%;
      background: #fff;
      transition: height 0.3s;
      /*animation: lid-blink 4s infinite;*/
    }

    &::before {
      --closed-height-percent: 60%;
      top: calc(var(--border-width) * -1);
      border-bottom: solid #060507 var(--border-width);
    }

    &::after {
      --closed-height-percent: 40%;
      bottom: calc(var(--border-width) * -1);
      border-top: solid #060507 var(--border-width);
    }
  }
}

/*@keyframes lid-blink {
  45% {
    height: 0;
  }
  50% {
    height: var(--closed-height);
  }
  60% {
    height: 0;
  }
}*/

#main {
  &.blink,
  &:has(.lids:hover) {
    .lids {
      &::before,
      &::after {
        height: var(--closed-height);
        transition: height 0.2s;
      }
    }
  }
}

#buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 130px;

  button {
    border: none;
    background-color: transparent;
    transition: scale 0.1s;

    &:active {
      scale: 0.9;
    }

    &::before {
      content: attr(data-tooltip);
      display: none;
      position: absolute;
      position-anchor: --tooltip;
      position-area: top center;
      margin-bottom: 8px;
      text-box: trim-both cap alphabetic;
      white-space: nowrap;
      font-size: 16px;
      scale: 0;
      opacity: 0;
      transition-property: scale, opacity;
      transition-duration: 0.7s;
      transition-delay: 0.3s;
      transition-timing-function: linear(0.00, 0.0297, 0.102, 0.205, 0.327, 0.458, 0.590, 0.717, 0.832, 0.932, 1.02, 1.08, 1.13, 1.16, 1.18, 1.19, 1.18, 1.17, 1.15, 1.13, 1.10, 1.08, 1.05, 1.03, 1.01, 0.998, 0.985, 0.976, 0.970, 0.966, 0.965, 0.966, 0.968, 0.972, 0.976, 0.981, 0.985, 0.990, 0.994, 0.997, 1.00, 1.00, 1.00, 1.01, 1.01, 1.01, 1.01, 1.01, 1.01, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00);
      transform-origin: 50% 100%;
    }

    &:hover:not(:active) {
      anchor-name: --tooltip;

      &::before {
        display: block;
        scale: 1;
        opacity: 1;

        @starting-style {
          scale: 0;
          opacity: 0;
        }
      }
    }
  }

  #button_1 {
    width: 32px;
    height: 29px;
    background: url("img/sprites.png") -339px -64px;
  }

  #button_2 {
    width: 54px;
    height: 46px;
    background: url("img/sprites.png") -159px -64px;

    &::before {
      translate: -10% 2px;
    }
  }

  #button_3 {
    width: 48px;
    height: 43px;
    background: url("img/sprites.png") -223px -64px;
  }

  #button_4 {
    width: 48px;
    height: 40px;
    background: url("img/sprites.png") -281px -64px;
  }
}