body {
    overflow: hidden;
    background-color: wheat;
    margin: 0;
    font-family: 'Open Sans', sans-serif;;
}

.mail {
    position: absolute;
    display: none;

    animation: mail-walk 2s cubic-bezier(0.76, 0.56, 0.92, 0.1) infinite alternate;
    pointer-events: none;
    z-index: 100;
}

.mail,
.mail * {
    user-select: none;
    -webkit-user-select: none;
}

.mail--ingame {
    cursor: pointer;
    pointer-events: all;
    animation-play-state: running;
}

.win .mail,
.mail--opened {
    animation-play-state: paused;
}

.win .mail,
.mail--ingame,
.mail--opened {
    display: block;
}

.mail__icon {
    width: 50px;
    height: 50px;
    margin: -10px;
    padding: 10px;
    animation: shake 1s infinite alternate;
}

.mail__attachment {
    display: none;
    max-width: 300px;
}

.mail--opened .mail__attachment {
    display: block;
    animation: hide 3.5s ease-in forwards;
}

.win .mail__attachment {
    display: block;
    animation: show 2s forwards;
    margin-top: -50%;
    margin-left: -50%;
}

.mail__attachment-text {
    width: 100%;
    font-size: 1.5rem;
    text-align: center;
    font-weight: bold;
    background: white;
    padding: 30px 10px 20px;
    border-radius: 50%;
}

.mail__attachment-image {
    max-width: 100%;
}

.win .mail__attachment-text {
    visibility: hidden;
}

.mail__attachment-text::after {
    content: '';
    display: block;
    position: relative;
    left: 0;
    bottom: -10px;
    width: 15px;
    height: 15px;
    background-color: white;
    border-radius: 50%;
}

.mail--opened .mail__icon {
    display: none;
    animation: bulb 0.2s ease-in forwards;
}

.win .mail__icon {
    display: none;
}

@keyframes bulb {
    0% {

    }
    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }
    100% {
        transform: scale(2);
        opacity: 0.7;
    }
}

@keyframes mail-walk {
    to {
        transform: translate3d(50vw, 50vh, 0px);
    }
}

@keyframes show {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes hide {
    100% {
        opacity: 0;
    }
}

@keyframes shake {
    10%, 90% {
      transform: translate3d(-1px, 0, 0);
    }
    
    20%, 80% {
      transform: translate3d(2px, 0, 0);
    }
  
    30%, 50%, 70% {
      transform: translate3d(-3px, 0, 0);
    }
  
    40%, 60% {
      transform: translate3d(3px, 0, 0);
    }
  }

.intro,
.congratulations {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 300;
    font-size: 1.5rem;
}

.congratulations__content {
    color: #ff6400;
    padding: 10px 60px;
    text-shadow: 1px 1px 2px pink;
}

.congratulations__content h1 {
    line-height: 1;
    transition: text-shadow 0.5s;
    text-shadow: 3px 4px 0 #e79c10, 5px 6px 0 #d53a33;;
}

.intro {
    font-size: 1rem;
    background-color: white;
    z-index: 400;
    align-items: center;
}

.person {
    position: absolute;
    top: 80vh;
    left: 50vw;
    width: 500px;
    transform: translate3d(-50%, -50%, 0);
    z-index: 200;
    pointer-events: none;
    margin-left: 10px;
}

.congratulations--one h1 {
    font-size: 2.5rem;
    text-shadow: 3px 4px 0 #e79c10, 5px 6px 0 #d53a33;
}

.congratulations--two h1 {
    font-size: 2.5rem;
    text-shadow: 3px 4px 0 #d3a859, 5px 6px 0 #ff3b30;
}

.congratulations--three h1 {
    font-size: 3.5rem;
    text-shadow: 3px 4px 0 #e4aa3e, 5px 6px 0 #da6059;
}

.congratulations--four h1 {
    font-size: 3.5rem;
    text-shadow: 3px 4px 0 #d69823, 5px 6px 0 #e04139;
}
