/* stolen from https://www.w3schools.com/howto/howto_css_shake_image.asp */
@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

@keyframes shake-lots {
    0% { transform: translate(2px, 2px) rotate(0deg); }
    10% { transform: translate(-2px, -4px) rotate(-2deg); }
    20% { transform: translate(-6px, 0px) rotate(2deg); }
    30% { transform: translate(6px, 4px) rotate(0deg); }
    40% { transform: translate(2px, -2px) rotate(2deg); }
    50% { transform: translate(-2px, 4px) rotate(-2deg); }
    60% { transform: translate(-6px, 2px) rotate(0deg); }
    70% { transform: translate(6px, 2px) rotate(-2deg); }
    80% { transform: translate(-2px, -2px) rotate(2deg); }
    90% { transform: translate(2px, 4px) rotate(0deg); }
    100% { transform: translate(2px, -4px) rotate(-2deg); }
}

.overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: #00000080;
    transition-property: opacity;
    transition-duration: 500ms;
    transition-timing-function: linear;
}

.overlay.hidden {
    opacity: 0%;
}

.overlay .explosion-subject {
    aspect-ratio: 72/68;
    height: 50%;
}

.explosion-subject.shaking {
    animation: shake 0.25s;
    animation-iteration-count: 2;
}

.explosion-subject.shaking-lots {
    animation: shake-lots 0.25s;
    animation-iteration-count: 2;
}

.explosion-text {
    transition-duration: 500ms;
    transition-property: opacity, margin-bottom;
    transition-timing-function: linear;
    opacity: 100%;
    margin-top: 20px;
    font-size: 1.25rem;
    font-weight: 700;
}

.explosion-text.hidden {
    opacity: 0%;
    margin-bottom: calc(-1.25rem - 20px);
}

