body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #1b1b1b; /* Default dark background */
    cursor: none;
}

#garden {
    width: 100%;
    height: 100%;
    position: relative;
    cursor: none;
    z-index: 1;
}

.background-text {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Kablammo', cursive;
    font-size: 20vw;
    color: rgba(255, 255, 255, 0.2);
    mix-blend-mode: overlay;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    z-index: 0;
    --wobble-duration: 10s;
}

.background-text span {
    display: inline-block;
    animation: wobble var(--wobble-duration, 10s) ease-in-out infinite alternate;
}

@keyframes wobble {
    0% {
        transform: translate(0, 0) rotate(-1deg);
    }
    100% {
        transform: translate(0.5vw, 3vw) rotate(1deg);
    }
}

.flower {
    position: absolute;
    pointer-events: auto;
    cursor: none;
    transform: translate(-50%, -50%);
    --target-scale: 1;
    --target-rotation: 0deg;
    --grow-duration: 2s;
    --sway-duration: 4s;
    --sway-angle: 15deg;
    --center-size: 27px;
    animation:
        grow-rotate var(--grow-duration) ease-out forwards,
        sway var(--sway-duration) ease-in-out var(--grow-duration) infinite alternate;
}

.flower.fading {
    animation: fade-out 0.5s ease-out forwards !important;
    pointer-events: none;
}

.bloom {
    position: relative;
    width: 0;
    height: 0;
}

.petal, .leaf-bg {
    position: absolute;
    width: 40px;
    height: 60px;
    bottom: 0;
    left: 50%;
    margin-left: -20px;
    transform-origin: bottom center;
    border-radius: 0 100% 0 100%;
    background-image: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(0,0,0,0.1) 100%);
}

.petal.rounded {
    border-radius: 50% 50% 0 0;
}

.leaf-bg {
    background-color: #2e7d32; /* Darker green for leaves */
    width: 35px;
    height: 55px;
    margin-left: -17.5px;
    z-index: -1;
    background-image: linear-gradient(to top, rgba(0,0,0,0.2), transparent);
}

.flower-shading {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: -2;
    filter: blur(15px);
    opacity: 0.5;
    pointer-events: none;
}

.flower-center {
    position: absolute;
    width: var(--center-size, 27px);
    height: var(--center-size, 27px);
    background-color: #ffeb3b; /* Yellow center */
    border: 3px solid #fbc02d; /* Darker yellow thick border */
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
    box-sizing: border-box;
}


.flower.dragging {
    cursor: none;
    transition: none;
    z-index: 1000;
}

@keyframes grow-rotate {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) scale(var(--target-scale)) rotate(calc(var(--target-rotation) - var(--sway-angle)));
    }
}


@keyframes sway {
    0% {
        transform: translate(-50%, -50%) scale(var(--target-scale)) rotate(calc(var(--target-rotation) - var(--sway-angle)));
    }
    100% {
        transform: translate(-50%, -50%) scale(var(--target-scale)) rotate(calc(var(--target-rotation) + var(--sway-angle)));
    }
}

@keyframes fade-out {
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
}

/* Custom Cursor Styles */
.custom-cursor {
    position: fixed;
    width: 24px;
    height: 24px;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease-out;
    display: none; /* Hidden until first movement */
}

.custom-cursor.active {
    transform: translate(-50%, -50%) scale(1.3);
}

.cursor-petal {
    position: absolute;
    width: 6px;
    height: 10px;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom center;
    border-radius: 0 100% 0 100%;
    background: #ff4081;
    border: 0.5px solid rgba(255, 255, 255, 0.4);
}

.cursor-center {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #ffeb3b;
    border: 1px solid #fbc02d;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.trail-particle {
    position: fixed;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    animation: trail-fade 1s ease-out forwards;
}

@keyframes trail-fade {
    0% {
        opacity: 0.7;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0) translate(var(--tx, 0), var(--ty, 20px));
    }
}
