*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --shadow-shift: 6px;
    --shadow-blur: 15px;
    --circle-color: black;
}

body {
    position: relative;
    min-height: 100vh;
    margin: 0;

    display: flex;
    justify-content: center;
    align-items: center;

    overflow: hidden;

    background: linear-gradient(45deg, #f06, transparent);
}

.wave {
    position: relative;

    width: 80px;
    height: 80px;

    display: flex;
    justify-content: center;
    align-items: center;
}

/* Main button */
.wave-btn {
    position: relative;
    z-index: 100;

    width: 80px;
    height: 80px;

    border: none;
    border-radius: 20px;

    background: var(--circle-color);
    color: white;

    font-size: 14px;
    font-weight: bold;

    transform: rotate(45deg);

    cursor: pointer;

    transition:
        transform 0.2s ease-in-out,
        opacity 0.2s ease-in-out;

    box-shadow:
        var(--shadow-shift)
        var(--shadow-shift)
        var(--shadow-blur)
        rgba(0, 0, 0, 0.5);
}

/* Keep the text straight */
.wave-btn span {
    display: block;

    transform: rotate(-45deg);
}

/* Hover effect */
.wave-btn:hover {
    transform: rotate(45deg) scale(1.1);
}

/* Remove default focus outline */
.wave-btn:focus {
    outline: none;
}

/* Keyboard accessibility */
.wave-btn:focus-visible {
    outline: 3px solid blue;
    outline-offset: 4px;
}

/* Click effect */
.wave-btn:active {
    opacity: 0.7;
    transform: rotate(45deg) scale(1);
}


/* Ripple container */
.wave-effect {
    position: absolute;

    top: 50%;
    left: 50%;

    width: 500px;
    height: 500px;

    transform: translate(-50%, -50%);

    pointer-events: none;
}


/* Ripple circles */
.wave-circle {
    position: absolute;

    top: 50%;
    left: 50%;

    width: 0;
    height: 0;

    background: transparent;

    border: 10px solid var(--circle-color);
    border-radius: 50%;

    transform: translate(-50%, -50%);

    box-shadow:
        inset var(--shadow-shift)
        var(--shadow-shift)
        var(--shadow-blur)
        rgba(0, 0, 0, 0.5),

        inset calc(var(--shadow-shift) * -1)
        calc(var(--shadow-shift) * -1)
        var(--shadow-blur)
        rgba(0, 0, 0, 0.5);

    animation:
        ripple 3s cubic-bezier(0, 0.2, 0.8, 1)
        infinite;
}


/* Delay each ripple */
.wave-effect .wave-circle:nth-child(2) {
    animation-delay: -1s;
}

.wave-effect .wave-circle:nth-child(3) {
    animation-delay: -2s;
}


/* Ripple animation */
@keyframes ripple {
    0% {
        width: 0;
        height: 0;

        opacity: 1;
    }

    100% {
        width: 500px;
        height: 500px;

        opacity: 0;
    }
}