.cookie-popup {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 99;
    background-color: #00000046;
}

.cookie-popup.show {
    display: flex;
}

.backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    backdrop-filter: blur(3px);
}

.dialog {
    position: relative;
    width: 95%;
    max-width: 500px;
    border-radius: 18px;
    background: #fffde3;
    box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
    overflow: hidden;
    transform: translateY(10px);
    opacity: 0;
    transition: 220ms ease;
    border: 2px solid #a1a1a1;
}

.cookie-popup.show .dialog {
    transform: translateY(0);
    opacity: 1;
}

.dialog-head {
    display: flex;
    justify-content: end;
    padding: 20px;
    box-sizing: border-box;
}

.dialog-head .btn-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 30px;
    line-height: 1;
    border: 1px solid #000;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
    background-color: #fff;
    transition: 0.2s;
    cursor: pointer;
}

.dialog-head .btn-close:hover {
    background-color: #000;
    color: #fff;
}

.dialog-body {
    padding: 20px;
    display: grid;
    gap: 10px;
    justify-items: center;
    padding-bottom: 35px;
}

.dialog-body hgroup {
    text-align: center;
    font-family: 'Paperozi';
}

.dialog-body hgroup h3 {
    font-size: 30px;
    margin-bottom: 10px;
}

.dialog-body hgroup p {
    font-size: 18px;
}

/* ===== Cookie stage ===== */
.stage {
    position: relative;
    width: 100%;
    display: grid;
    place-items: center;
    padding: 8px 0 6px;
    margin: 30px 0;
}

#cookie {
    width: 100%;
    height: auto;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .18));
    transform-origin: 50% 70%;
    margin-bottom: 50px;
}

#cookie.wiggle {
    animation: wiggle 420ms ease;
}

/* Paper */
.paper {
    position: absolute;
    left: 50%;
    top: 56%;
    width: 100%;
    max-width: 280px;
    min-height: 120px;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    text-align: center;
    border: 1px solid #f18960;
    background-color: #fff;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.paper.show {
    animation: slideOut 680ms cubic-bezier(.2, .9, .2, 1) forwards;
}

.paper .text {
    font-size: 19px;
    color: #231815;
    word-break: keep-all;
    white-space: pre-wrap;
    line-height: 1.5;
    font-weight: 400;
}

.paper .text.typing::after {
    content: "";
    display: inline-block;
    width: 10px;
    height: 1.05em;
    margin-left: 6px;
    background: rgba(0, 0, 0, .35);
    animation: blink 900ms steps(1, end) infinite;
    vertical-align: -2px;
}

/* Controls */
.controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 4px;
}

.btn-reset {
    padding: 10px 16px;
    border-radius: 30px;
    background: #eb6100;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 15px;
    padding: 10px 20px;
    width: 155px;
    transition: 0.2s;
}

.btn-reset:hover {
    background: #f58332;
}

.note {
    font-size: 12px;
    opacity: .65;
    text-align: center;
    margin: 0 0 6px;
}

/* Crumbs */
.crumbs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: visible;
}

.crumb {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: radial-gradient(circle at 30% 30%, #ffd59a 0%, #f0b35f 55%, #c97d2a 100%);
    box-shadow: 0 8px 14px rgba(0, 0, 0, .12);
    opacity: 0;
}

@media screen and (max-width: 576px) {
    .cookie-popup .stage {
        height: fit-content;
    }

    .paper {
        max-width: 200px;
        min-height: 80px;
    }

    .paper .text {
        font-size: 17px;
    }

    .dialog-body hgroup h3 {
        font-size: 25px;
    }

    .dialog-body hgroup p {
        font-size: 17px;
    }
}

@keyframes floaty {
    0% {
        translate: 0 0
    }

    50% {
        translate: 0 -10px
    }

    100% {
        translate: 0 0
    }
}

@keyframes slideOut {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(-30px);
    }
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

@keyframes wiggle {
    0% {
        transform: rotate(0)
    }

    25% {
        transform: rotate(-2.2deg)
    }

    50% {
        transform: rotate(2deg)
    }

    75% {
        transform: rotate(-1.2deg)
    }

    100% {
        transform: rotate(0)
    }
}

@keyframes pop {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(.9);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    100% {
        transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(.95);
        opacity: 0;
    }
}