/* =====================================================
   Make a Wish — custom styles & animations
   Tailwind handles most layout/utility styling via CDN.
   This file is reserved for richer animations and
   gradients that are awkward to express inline.
   ===================================================== */

:root {
    --magic-glow: #facc15;
    --magic-soft: #fde68a;
    --night-top: #020617;   /* slate-950 */
    --night-bottom: #111827; /* gray-900 */
}

/* Smooth, intentional motion everywhere */
* {
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    /* Fallback gradient in case utility classes are overridden */
    background-attachment: fixed;
}

/* -----------------------------------------------------
   Twinkling stars
   Individual star elements are generated in script.js.
   ----------------------------------------------------- */
.star {
    position: absolute;
    border-radius: 9999px;
    background: #ffffff;
    opacity: 0;
    animation: twinkle var(--twinkle-duration, 4s) ease-in-out infinite;
    animation-delay: var(--twinkle-delay, 0s);
    will-change: opacity, transform;
}

@keyframes twinkle {
    0%,
    100% {
        opacity: 0.15;
        transform: scale(0.8);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.15);
    }
}

/* -----------------------------------------------------
   The flower pot — subtle "breathing" animation
   The SVG gently scales up and down to feel alive.
   ----------------------------------------------------- */
.pot-svg {
    transform-origin: center bottom;
    animation: breathe 4.5s ease-in-out infinite;
    transition: filter 0.5s ease, transform 0.5s ease;
}

@keyframes breathe {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.04);
    }
}

/* Magical glow + lift on hover */
.pot-btn {
    cursor: pointer;
}

.pot-btn:hover .pot-svg {
    transform: scale(1.08);
    filter: drop-shadow(0 0 18px rgba(250, 204, 21, 0.55))
        drop-shadow(0 0 40px rgba(233, 196, 106, 0.35));
    animation-play-state: paused;
}

.pot-btn:active .pot-svg {
    transform: scale(0.97);
}

/* Brighten the ambient aura when hovering the pot */
.pot-btn:hover ~ .aura,
#stage:hover .aura {
    opacity: 0.9;
}

/* -----------------------------------------------------
   The glowing green seed — the interactive trigger that
   sits at the bottom and sprouts into the flower on click.
   ----------------------------------------------------- */
.seed {
    cursor: pointer;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.seed-dot {
    box-shadow: 0 0 12px 3px rgba(132, 204, 22, 0.75),
        0 0 28px 8px rgba(34, 197, 94, 0.5);
    animation: seed-bob 2.6s ease-in-out infinite;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* A gentle bob + glow to invite the click */
@keyframes seed-bob {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-7px) scale(1.06); }
}

.seed-btn:hover .seed-dot,
.seed-btn:focus-visible .seed-dot {
    animation-play-state: paused;
    transform: scale(1.3);
    box-shadow: 0 0 16px 4px rgba(190, 242, 100, 0.9),
        0 0 36px 12px rgba(34, 197, 94, 0.6);
}

/* The seed is "spent" once it sprouts — it shrinks away into the soil. */
.seed.is-spent {
    opacity: 0;
    transform: translate(-50%, 8px) scale(0.3);
    pointer-events: none;
}

.seed.is-spent .seed-dot {
    animation: none;
}

/* =====================================================
   The magical sunflower growth sequence
   The whole timeline runs ~3.4s once `.is-growing`
   is added to #flower in script.js:
     • 0.0s → 1.4s  stem grows upward
     • 1.2s → 2.0s  leaves pop out
     • 1.8s → 3.2s  flower head blooms (elastic)
   ===================================================== */

.flower-svg {
    overflow: visible;
}

/* --- Initial (pre-growth) hidden states --- */
.stem {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
}

.leaf {
    transform: scale(0);
    opacity: 0;
    transform-box: fill-box;
}

.leaf-left {
    transform-origin: 100% 50%;
}

.leaf-right {
    transform-origin: 0% 50%;
}

.head {
    transform: scale(0);
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center bottom;
}

/* --- 1. Stem grows upward --- */
.flower.is-growing .stem {
    animation: stem-grow 1.4s ease-out forwards;
}

@keyframes stem-grow {
    to {
        stroke-dashoffset: 0;
    }
}

/* --- 2. Leaves pop out (staggered, springy) --- */
.flower.is-growing .leaf-left {
    animation: leaf-pop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 1.15s forwards;
}

.flower.is-growing .leaf-right {
    animation: leaf-pop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 1.35s forwards;
}

@keyframes leaf-pop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    60% {
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* --- 3. Flower head blooms with an elastic bounce --- */
.flower.is-growing .head {
    animation: bloom 1.5s cubic-bezier(0.18, 1.5, 0.5, 1) 1.8s forwards;
}

@keyframes bloom {
    0% {
        transform: scale(0) rotate(-35deg);
        opacity: 0;
    }
    45% {
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* --- After fully bloomed: a gentle, living sway --- */
.flower.is-bloomed {
    transform-origin: bottom center;
    animation: flower-sway 6s ease-in-out infinite;
}

@keyframes flower-sway {
    0%,
    100% {
        transform: rotate(-2deg);
    }
    50% {
        transform: rotate(2deg);
    }
}

/* -----------------------------------------------------
   The enchanted center — pulse + glow once bloomed
   `.is-magic` is added to #flower in script.js after
   the bloom animation ends.
   ----------------------------------------------------- */
.core-pulse-ring {
    transform-box: fill-box;
    transform-origin: center;
    opacity: 0;
}

.core-center {
    transform-box: fill-box;
    transform-origin: center;
    cursor: pointer;
}

.flower.is-magic .core {
    filter: drop-shadow(0 0 8px rgba(252, 211, 77, 0.9))
        drop-shadow(0 0 22px rgba(251, 191, 36, 0.55));
}

/* Expanding "radar" pulse emanating from the center */
.flower.is-magic .core-pulse-ring {
    animation: core-pulse 2.2s ease-out infinite;
}

@keyframes core-pulse {
    0% {
        transform: scale(0.7);
        opacity: 0.85;
    }
    100% {
        transform: scale(2.3);
        opacity: 0;
    }
}

/* Subtle breathing of the seed disk to invite a click */
.flower.is-magic .core-center {
    animation: core-breathe 2.2s ease-in-out infinite;
}

@keyframes core-breathe {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.09);
    }
}

/* The fade-in hint sits just below the bloom */
.magic-hint {
    text-shadow: 0 0 12px rgba(251, 191, 36, 0.45);
}

/* Once enchanted, the flower center becomes clickable */
.flower.is-magic .core-center {
    pointer-events: auto;
}

/* =====================================================
   Glassmorphism message card
   `.is-open` is toggled on #magic-modal in script.js.
   ===================================================== */
.magic-modal {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.magic-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.magic-modal-backdrop {
    background: rgba(2, 6, 23, 0.55);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

/* The card eases in with a soft lift + scale, and never grows taller
   than the screen — it scrolls inside itself instead (premium feel). */
.magic-card {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
    transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2),
        opacity 0.4s ease;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(252, 211, 77, 0.4) transparent;
}

.magic-card::-webkit-scrollbar {
    width: 6px;
}

.magic-card::-webkit-scrollbar-thumb {
    background: rgba(252, 211, 77, 0.35);
    border-radius: 9999px;
}

.magic-modal.is-open .magic-card {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Preserve line breaks in the typed message */
.message-text {
    white-space: pre-wrap;
}

/* The user's own wish revealed inside the message card */
.message-wish {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.message-wish.is-shown {
    opacity: 1;
    transform: translateY(0);
}

.wish-quote {
    position: relative;
    white-space: pre-wrap;
    line-height: 1.55;
    text-shadow: 0 0 14px rgba(251, 191, 36, 0.25);
}

.wish-quote::before {
    content: '\201C';
    margin-right: 2px;
    color: rgba(252, 211, 77, 0.7);
}

.wish-quote::after {
    content: '\201D';
    margin-left: 2px;
    color: rgba(252, 211, 77, 0.7);
}

/* Toast notifications — gentle, themed, auto-dismissing */
.toast {
    width: max-content;
    max-width: 92vw;
}

.toast-item {
    display: inline-block;
    max-width: 92vw;
    padding: 11px 20px;
    border-radius: 9999px;
    border: 1px solid rgba(252, 211, 77, 0.3);
    background: rgba(15, 23, 42, 0.72);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: #fde68a;
    font-size: 0.85rem;
    font-weight: 300;
    letter-spacing: 0.01em;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(251, 191, 36, 0.2);
    opacity: 0;
    transform: translateY(14px) scale(0.96);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.toast-item.is-shown {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Saved-wish list items */
.wish-item {
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    padding: 12px 14px;
}

.wish-item p {
    margin: 0;
    white-space: pre-wrap;
    font-size: 0.9rem;
    font-weight: 300;
    line-height: 1.5;
    color: rgba(241, 245, 249, 0.92);
}

.wish-item time {
    display: block;
    margin-top: 6px;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    color: rgba(252, 211, 77, 0.65);
}

.wishes-empty {
    padding: 28px 8px;
    text-align: center;
    font-style: italic;
    color: rgba(203, 213, 225, 0.7);
}

/* Soft custom scrollbar for the wishes list */
.wishes-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(252, 211, 77, 0.4) transparent;
}

.wishes-scroll::-webkit-scrollbar {
    width: 6px;
}

.wishes-scroll::-webkit-scrollbar-thumb {
    background: rgba(252, 211, 77, 0.35);
    border-radius: 9999px;
}

/* Blinking "live writing" caret */
.caret {
    display: inline-block;
    width: 2px;
    height: 1.05em;
    margin-left: 2px;
    vertical-align: -2px;
    background: #fcd34d;
    box-shadow: 0 0 6px rgba(252, 211, 77, 0.8);
    animation: caret-blink 1s steps(1) infinite;
    transition: opacity 0.6s ease;
}

@keyframes caret-blink {
    50% {
        opacity: 0;
    }
}

.caret.caret-done {
    opacity: 0;
}

/* -----------------------------------------------------
   Soft pulsing aura behind interactive elements
   ----------------------------------------------------- */
@keyframes aura-pulse {
    0%,
    100% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 0.75;
        transform: scale(1.08);
    }
}

.aura {
    animation: aura-pulse 5s ease-in-out infinite;
}

/* =====================================================
   Aurora night sky + crescent moon
   A soft, slow-drifting nebula deep behind the stars.
   ===================================================== */
.aurora {
    position: absolute;
    border-radius: 9999px;
    filter: blur(90px);
    opacity: 0.5;
    will-change: transform;
}

.aurora-1 {
    top: -10%;
    left: -10%;
    width: 55vw;
    height: 55vw;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.5), transparent 70%);
    animation: aurora-drift-1 22s ease-in-out infinite;
}

.aurora-2 {
    bottom: -15%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle at center, rgba(168, 85, 247, 0.38), transparent 70%);
    animation: aurora-drift-2 28s ease-in-out infinite;
}

.aurora-3 {
    top: 20%;
    right: 15%;
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle at center, rgba(20, 184, 166, 0.28), transparent 70%);
    animation: aurora-drift-1 32s ease-in-out infinite reverse;
}

@keyframes aurora-drift-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(6%, 8%) scale(1.12); }
}

@keyframes aurora-drift-2 {
    0%, 100% { transform: translate(0, 0) scale(1.05); }
    50% { transform: translate(-7%, -6%) scale(0.95); }
}

/* A glowing crescent moon, tucked up in the corner */
.moon {
    position: absolute;
    top: 9%;
    left: 11%;
    width: 90px;
    height: 90px;
    border-radius: 9999px;
    background: radial-gradient(circle at 35% 35%, #fffdf2, #fde9b8 55%, #e8c98f 100%);
    box-shadow: 0 0 40px 10px rgba(253, 230, 138, 0.35),
        0 0 90px 30px rgba(251, 191, 36, 0.15),
        inset -14px -10px 0 0 rgba(2, 6, 23, 0.0);
    animation: moon-glow 7s ease-in-out infinite;
}

@keyframes moon-glow {
    0%, 100% { box-shadow: 0 0 40px 10px rgba(253, 230, 138, 0.30), 0 0 90px 30px rgba(251, 191, 36, 0.12); }
    50% { box-shadow: 0 0 55px 14px rgba(253, 230, 138, 0.45), 0 0 120px 40px rgba(251, 191, 36, 0.20); }
}

/* =====================================================
   Drifting fireflies (generated in script.js)
   ===================================================== */
.firefly {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 9999px;
    background: #fde68a;
    box-shadow: 0 0 8px 2px rgba(253, 230, 138, 0.8),
        0 0 16px 6px rgba(251, 191, 36, 0.35);
    opacity: 0;
    will-change: transform, opacity;
    animation: firefly-float var(--fly-duration, 14s) ease-in-out infinite;
    animation-delay: var(--fly-delay, 0s);
}

@keyframes firefly-float {
    0% { opacity: 0; transform: translate(0, 0) scale(0.6); }
    15% { opacity: 0.9; }
    50% { transform: translate(var(--fly-x, 40px), var(--fly-y, -60px)) scale(1.1); }
    85% { opacity: 0.7; }
    100% { opacity: 0; transform: translate(calc(var(--fly-x, 40px) * 1.6), calc(var(--fly-y, -60px) * 1.8)) scale(0.5); }
}

/* =====================================================
   Cursor sparkle trail (generated in script.js)
   ===================================================== */
.cursor-spark {
    position: absolute;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    border-radius: 9999px;
    background: radial-gradient(circle, #fffbeb, #fcd34d 55%, rgba(251, 191, 36, 0) 75%);
    box-shadow: 0 0 8px 2px rgba(252, 211, 77, 0.7);
    opacity: 0.9;
    animation: spark-fade 0.7s ease-out forwards;
}

@keyframes spark-fade {
    0% { opacity: 0.9; transform: scale(1) translateY(0); }
    100% { opacity: 0; transform: scale(0.2) translateY(10px); }
}

/* =====================================================
   Shimmering animated header title
   ===================================================== */
.title-shimmer {
    background-size: 220% auto;
    animation: title-shimmer 6s linear infinite;
}

@keyframes title-shimmer {
    to {
        background-position: 220% center;
    }
}

/* =====================================================
   Radiant halo behind the bloomed flower
   `.is-lit` is toggled in script.js once the flower blooms.
   ===================================================== */
.flower-halo {
    background: radial-gradient(circle at center,
        rgba(253, 224, 71, 0.45) 0%,
        rgba(251, 191, 36, 0.22) 35%,
        rgba(251, 191, 36, 0) 70%);
    opacity: 0;
    transform: translateX(-50%) scale(0.6);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

.flower-halo.is-lit {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    animation: halo-pulse 5s ease-in-out infinite;
}

@keyframes halo-pulse {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.85; }
    50% { transform: translateX(-50%) scale(1.12); opacity: 1; }
}

/* =====================================================
   Swaying flower meadow along the bottom
   Flowers, grass & pollen are generated in script.js.
   ===================================================== */
.meadow {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 0;
    z-index: 5;
    pointer-events: none;
}

/* Soft glowing mist rising from the ground */
.meadow-ground {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 200px;
    background: radial-gradient(120% 100% at 50% 100%,
        rgba(251, 191, 36, 0.16) 0%,
        rgba(168, 85, 247, 0.08) 40%,
        rgba(2, 6, 23, 0) 75%);
    animation: ground-glow 8s ease-in-out infinite;
}

@keyframes ground-glow {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Each flower / grass blade sways from its base */
.meadow-flower,
.meadow-grass {
    position: absolute;
    bottom: -6px;
    transform-origin: bottom center;
    animation: meadow-sway var(--sway-dur, 4.5s) ease-in-out infinite;
    animation-delay: var(--sway-delay, 0s);
    will-change: transform;
}

.meadow-flower svg,
.meadow-grass svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.25));
}

@keyframes meadow-sway {
    0%, 100% { transform: rotate(var(--sway-from, -4deg)); }
    50% { transform: rotate(var(--sway-to, 4deg)); }
}

/* Shimmering dewdrops resting on the flowers */
.dewdrop {
    position: absolute;
    border-radius: 9999px;
    background: radial-gradient(circle at 35% 30%,
        rgba(255, 255, 255, 0.95),
        rgba(186, 230, 253, 0.6) 50%,
        rgba(125, 211, 252, 0.15) 100%);
    box-shadow: 0 0 6px 1px rgba(186, 230, 253, 0.6);
    animation: dew-shimmer var(--dew-dur, 3s) ease-in-out infinite;
    animation-delay: var(--dew-delay, 0s);
}

@keyframes dew-shimmer {
    0%, 100% { opacity: 0.55; transform: scale(0.82); }
    50% { opacity: 1; transform: scale(1); }
}

/* Golden pollen drifting up from the meadow */
.pollen {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 9999px;
    background: radial-gradient(circle, #fffbeb, #fcd34d 55%, rgba(251, 191, 36, 0) 75%);
    box-shadow: 0 0 8px 2px rgba(252, 211, 77, 0.65);
    opacity: 0;
    will-change: transform, opacity;
    animation: pollen-rise var(--pollen-dur, 7s) ease-in forwards;
}

@keyframes pollen-rise {
    0% { opacity: 0; transform: translateY(0) translateX(0) scale(0.6); }
    15% { opacity: 0.9; }
    80% { opacity: 0.8; }
    100% { opacity: 0; transform: translateY(var(--pollen-y, -60vh)) translateX(var(--pollen-x, 20px)) scale(1); }
}

/* =====================================================
   Foreground drifting mist / fog
   ===================================================== */
.fog {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 230px;
    z-index: 7;
    overflow: hidden;
    pointer-events: none;
}

.fog-layer {
    position: absolute;
    bottom: -20px;
    left: -50%;
    width: 200%;
    height: 100%;
    background: radial-gradient(ellipse 55% 100% at 30% 100%, rgba(226, 232, 240, 0.10), transparent 60%),
        radial-gradient(ellipse 50% 100% at 70% 100%, rgba(196, 181, 253, 0.08), transparent 60%);
    filter: blur(14px);
    animation: fog-drift 30s linear infinite;
}

.fog-layer.two {
    animation-duration: 44s;
    animation-direction: reverse;
    opacity: 0.7;
}

@keyframes fog-drift {
    from { transform: translateX(0); }
    to { transform: translateX(22%); }
}

/* The "wish granted" twinkle left behind by a shooting star */
.wish-twinkle {
    position: absolute;
    transform: translate(-50%, -50%);
    font-style: italic;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    color: #fde68a;
    text-shadow: 0 0 12px rgba(251, 191, 36, 0.7);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    animation: wish-pop 2.8s ease-out forwards;
}

@keyframes wish-pop {
    0% { opacity: 0; transform: translate(-50%, -40%) scale(0.8); }
    20% { opacity: 1; }
    78% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -95%) scale(1.05); }
}

/* =====================================================
   Shooting stars streaking across the night sky
   ===================================================== */
.shooting-star {
    position: absolute;
    height: 2px;
    width: var(--len, 160px);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(253, 230, 138, 0.9) 70%, #ffffff 100%);
    border-radius: 9999px;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.85));
    opacity: 0;
    transform: rotate(var(--angle, 24deg)) translateX(0);
    animation: shoot var(--dur, 1.1s) ease-in forwards;
}

@keyframes shoot {
    0% { opacity: 0; transform: rotate(var(--angle, 24deg)) translateX(0); }
    12% { opacity: 1; }
    100% { opacity: 0; transform: rotate(var(--angle, 24deg)) translateX(var(--travel, 70vw)); }
}

/* =====================================================
   Fluttering butterflies (generated in script.js)
   ===================================================== */
.butterflies {
    position: fixed;
    inset: 0;
    z-index: 15;
    overflow: hidden;
    pointer-events: none;
}

/* Each butterfly drifts across the screen on a wavy path */
.butterfly {
    position: absolute;
    top: 0;
    left: 0;
    width: 26px;
    height: 20px;
    will-change: transform;
    cursor: pointer;
    pointer-events: auto;
    animation: bf-fly var(--bf-dur, 18s) linear infinite;
    animation-delay: var(--bf-delay, 0s);
}

@keyframes bf-fly {
    0%   { transform: translate(-12vw, var(--y0, 70vh)) rotate(6deg); }
    25%  { transform: translate(28vw, calc(var(--y0, 70vh) - 9vh)) rotate(-6deg); }
    50%  { transform: translate(55vw, var(--y0, 70vh)) rotate(6deg); }
    75%  { transform: translate(82vw, calc(var(--y0, 70vh) - 7vh)) rotate(-6deg); }
    100% { transform: translate(114vw, var(--y0, 70vh)) rotate(6deg); }
}

/* Butterflies heading the other way */
.butterfly.rev {
    animation-direction: reverse;
}

.bf-wings {
    position: absolute;
    top: 0;
    left: 0;
    width: 26px;
    height: 20px;
    transform: scale(var(--bf-scale, 1));
    transform-origin: center;
}

.butterfly.rev .bf-wings {
    transform: scale(var(--bf-scale, 1)) scaleX(-1);
}

.bf-wing {
    position: absolute;
    top: 0;
    width: 13px;
    height: 20px;
    border-radius: 70% 70% 55% 55%;
    box-shadow: 0 0 6px rgba(251, 191, 36, 0.4);
    animation: bf-flap var(--flap, 0.28s) ease-in-out infinite alternate;
}

.bf-wing.l {
    left: 0;
    transform-origin: right center;
    background: linear-gradient(135deg, var(--c1, #fde68a), var(--c2, #f59e0b));
}

.bf-wing.r {
    right: 0;
    transform-origin: left center;
    background: linear-gradient(225deg, var(--c1, #fde68a), var(--c2, #f59e0b));
}

.bf-body {
    position: absolute;
    left: 50%;
    top: 2px;
    width: 2.5px;
    height: 16px;
    margin-left: -1.25px;
    border-radius: 9999px;
    background: #3b2a1a;
}

@keyframes bf-flap {
    from { transform: scaleX(1); }
    to { transform: scaleX(0.25); }
}

/* -----------------------------------------------------
   Accessibility: respect reduced-motion preferences
   ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
