/* Floating invite to the baby checklist. Markup sits in each public page; behavior is in js/main.js. */
.quiz-invite {
    position: fixed;
    right: 1.25rem;
    bottom: 1.5rem;
    z-index: 45;
    max-width: calc(100% - 6rem);   /* keeps clear of the WhatsApp button on the left */
    opacity: 0;
    transform: translateY(140%) scale(.85);
    transition: transform .7s cubic-bezier(.34, 1.56, .64, 1), opacity .4s ease;
}
.quiz-invite.is-visible { opacity: 1; transform: none; }

.quiz-invite-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem .5rem .5rem 1.15rem;
    background: #fff;
    border-radius: 9999px;
    color: #2C2420;
    text-decoration: none;
    box-shadow: 0 14px 34px -12px rgba(44, 36, 32, .38), inset 0 0 0 1px rgba(228, 213, 190, .9);
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), box-shadow .3s ease;
}
.quiz-invite-link:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -14px rgba(44, 36, 32, .45), inset 0 0 0 1px rgba(200, 97, 74, .5); }
.quiz-invite-link:focus-visible { outline: 2px solid #C8614A; outline-offset: 3px; }

.quiz-invite-emoji {
    position: relative;
    flex-shrink: 0;
    width: 2.9rem;
    height: 2.9rem;
    border-radius: 50%;
    background: #FBEDE8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}
/* Soft pulse ring around the baby */
.quiz-invite-emoji::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    animation: invite-ring 2.4s ease-out infinite;
}
.quiz-invite-emoji span { display: inline-block; transform-origin: 50% 85%; animation: invite-wiggle 4s ease-in-out infinite; }

.quiz-invite-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.quiz-invite-title { font-weight: 600; font-size: .95rem; white-space: nowrap; }
.quiz-invite-sub { font-size: .75rem; color: #8C8078; white-space: nowrap; }
.quiz-invite-sub b { color: #C8614A; font-weight: 600; }

.quiz-invite-close {
    position: absolute;
    top: -.45rem;
    left: -.45rem;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #2C2420;
    color: #FAF7F0;
    font-size: .95rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity .2s ease;
}
.quiz-invite:hover .quiz-invite-close,
.quiz-invite:focus-within .quiz-invite-close { opacity: 1; }
@media (hover: none) { .quiz-invite-close { opacity: 1; } }

/* Speech bubble that says hi once per visit */
.quiz-invite-bubble {
    position: absolute;
    right: .35rem;
    bottom: calc(100% + .65rem);
    padding: .45rem .85rem;
    border-radius: 1rem 1rem .3rem 1rem;
    background: #2C2420;
    color: #FAF7F0;
    font-size: .8rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(8px) scale(.85);
    transform-origin: bottom right;
    transition: opacity .3s ease, transform .45s cubic-bezier(.34, 1.56, .64, 1);
}
.quiz-invite.say-hi .quiz-invite-bubble { opacity: 1; transform: none; }

@keyframes invite-ring {
    0%       { box-shadow: 0 0 0 0 rgba(200, 97, 74, .45); }
    70%, 100% { box-shadow: 0 0 0 14px rgba(200, 97, 74, 0); }
}
@keyframes invite-wiggle {
    0%, 70%, 100% { transform: rotate(0); }
    75% { transform: rotate(-14deg); }
    80% { transform: rotate(12deg); }
    85% { transform: rotate(-8deg); }
    90% { transform: rotate(5deg); }
    95% { transform: rotate(0); }
}

@media (max-width: 420px) {
    .quiz-invite { right: 1rem; }
    .quiz-invite-link { gap: .6rem; padding-left: .95rem; }
    .quiz-invite-emoji { width: 2.6rem; height: 2.6rem; font-size: 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
    .quiz-invite, .quiz-invite-link, .quiz-invite-bubble { transition: opacity .3s ease; transform: none; }
    .quiz-invite-emoji::after, .quiz-invite-emoji span { animation: none; }
}
