* {
    box-sizing: border-box;
}

:root {
    --glow-red: rgba(255, 12, 70, 0.85);
}

body {
    background: radial-gradient(circle at 50% 40%, #2b000d 0%, #140006 50%, #050002 100%);
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Background Canvas */
#hearts-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

/* Ambient Radial Glow */
.romantic-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(255, 12, 70, 0.14) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
    animation: ambient-pulse 6s ease-in-out infinite alternate;
}

@keyframes ambient-pulse {
    0% { opacity: 0.5; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.08); }
}

/* Ground & Flower Layout */
.ground {
    width: 100vmin;
    aspect-ratio: 1.5;
    overflow: visible;
    position: absolute;
    bottom: 20vh;
    left: 50%;
    transform-origin: center bottom;
    transform: translateX(-50%) scale(1.25);
    animation: shrink 1.5s ease-in forwards 4s;
    z-index: 2;
}

.flower-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10%;
    aspect-ratio: 16;
    container-type: inline-size;
    filter: drop-shadow(0 0 25cqi var(--glow-red));
    justify-items: center;
    align-content: center;
    transform-origin: bottom center;
    cursor: pointer;
    transition: filter 0.3s ease;
}

.flower-container:hover {
    filter: drop-shadow(0 0 38cqi rgba(255, 77, 121, 1));
}

.flower-container:first-child {
    top: 50%;
    left: 50%;
}
.flower-container:nth-child(2) {
    top: 45%;
    left: 30%;
    width: 8%;
}
.flower-container:nth-child(3) {
    top: 45%;
    left: 70%;
    width: 8%;
}
.flower-container:nth-child(4) {
    top: 85%;
    left: 95%;
    width: 20%;
}
.flower-container:nth-child(5) {
    top: 130%;
    left: 30%;
    width: 30%;
}
.flower-container:nth-child(6) {
    top: 60%;
    left: 10%;
    width: 12%;
}
.flower-container:nth-child(7) {
    top: 20%;
    left: 15%;
    width: 6%;
}
.flower-container:nth-child(8) {
    top: 15%;
    left: 35%;
    width: 5%;
}
.flower-container:nth-child(9) {
    top: 26%;
    left: 85%;
    width: 7%;
}
.flower-container:nth-child(10) {
    top: 22%;
    left: 60%;
    width: 6.5%;
}
.flower-container:nth-child(11) {
    top: 35%;
    left: 20%;
    width: 7.5%;
}
.flower-container:nth-child(12) {
    top: 38%;
    left: 80%;
    width: 7.5%;
}

/* Flower Top & Petals */
.flower-top {
    width: 50cqi;
    aspect-ratio: 1.5;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translate(-50%, 50%);
    z-index: 1;
}

.flower-circle {
    width: 30cqi;
    aspect-ratio: 1.5;
    border-radius: 50%;
    background: radial-gradient(circle, #ffccd5 0%, #ff0c46 60%, #80001a 100%);
    box-shadow: inset 0px -3cqi 5cqi rgba(128, 0, 26, 0.8), 0 0 20cqi #ff0c46;
    position: absolute;
    scale: 0;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 100% 100% 100% 100%/90% 90% 90% 90%;
    filter: drop-shadow(0 0 15cqi #ff0c46);
    transform-origin: top left;
}

.flower-petal {
    width: 80%;
    aspect-ratio: 1;
    background-color: #ff0c46;
    background-image: linear-gradient(135deg, #ff0040 0%, #ff4d6d 45%, #b3002d 100%);
    box-shadow: inset 0 0 10cqi rgba(255, 204, 213, 0.4), 0 0 15cqi rgba(255, 12, 70, 0.6);
    position: absolute;
    opacity: 0;
}

.flower-petal__1 {
    bottom: 42%;
    right: 65%;
    border-radius: 0px 100% 5% 100%/0px 100% 5% 100%;
    transform: rotate(-10deg) scale(0.82);
}

.flower-petal__2 {
    bottom: 42%;
    left: 65%;
    border-radius: 0px 100% 5% 100%/0px 100% 5% 100%;
    transform: rotate(100deg) scale(0.82);
}

.flower-petal__3 {
    bottom: 40%;
    left: 10%;
    border-radius: 0px 100% 50% 100%/0px 100% 50% 100%;
    transform: rotate(45deg) scale(0.8);
}

.flower-petal__4 {
    top: -10%;
    left: 80%;
    border-radius: 0px 100% 0% 100%/0px 100% 0% 100%;
    transform: rotate(135deg) scale(0.9);
}

.flower-petal__5 {
    top: -10%;
    right: 70%;
    border-radius: 0px 100% 0% 100%/0px 100% 0% 100%;
    transform: rotate(315deg) scale(0.9);
}

.flower-petal__6 {
    top: 50%;
    right: 65%;
    border-radius: 0px 100% 10% 100%/0px 100% 5% 100%;
    transform: rotate(270deg) scale(1.1);
}

.flower-petal__7 {
    top: 50%;
    left: 65%;
    border-radius: 0px 100% 10% 100%/0px 100% 5% 100%;
    transform: rotate(180deg) scale(1.1);
}

.flower-petal__8 {
    top: 50%;
    left: 10%;
    border-radius: 0px 100% 50% 100%/0px 100% 30% 100%;
    transform: rotate(225deg) scale(1);
}

/* Red Glowing Light Particles */
.flower-light {
    width: 3.5cqi;
    aspect-ratio: 1;
    position: absolute;
    border-radius: 50%;
    opacity: 0;

    &:nth-child(odd) {
        background-color: #ffccd5;
        filter: blur(1.5cqi) drop-shadow(0 0 8cqi #ff0c46);
    }

    &:nth-child(even) {
        background-color: #ff0c46;
        filter: blur(1.5cqi) drop-shadow(0 0 8cqi #ff4d6d);
    }
}

.flower-light__1 { top: 10%; left: 20%; scale: 0.8; }
.flower-light__2 { top: 20%; left: 80%; scale: 1.2; }
.flower-light__3 { top: 30%; left: 50%; scale: 1.5; }
.flower-light__4 { top: 40%; left: 10%; }
.flower-light__5 { top: 50%; left: 90%; scale: 2; }
.flower-light__6 { top: 60%; left: 30%; }
.flower-light__7 { top: 70%; left: 40%; scale: 0.5; }
.flower-light__8 { top: 60%; left: 60%; }

/* Stems, Leaves & Grass */
.flower-bottom {
    width: 6%;
    aspect-ratio: 0.02;
    left: 47%;
    top: 50%;
}

.flower-grass__3 {
    left: 70% !important;
    width: 75cqi;
    height: 100cqi;
}

.flower-grass__4 {
    right: 70% !important;
    width: 75cqi;
    height: 90cqi;
}

.flower-stem {
    width: 100%;
    height: 100%;
    transform: scaleY(0);
    background-image: linear-gradient(to left, rgba(0, 0, 0, 0.4), transparent, rgba(128, 0, 32, 0.4)),
                      linear-gradient(to top, transparent 10%, #7a0c2e, #b3002d);
    border-radius: 50px 50px 0 0;
    transform-origin: bottom center;
    box-shadow: 0 0 10px rgba(255, 12, 70, 0.3);
}

.flower-leaf {
    width: 40%;
    aspect-ratio: 2.5;
    position: absolute;
    scale: 0;
    opacity: 0;

    &:nth-child(even) {
        right: 55%;
        background-image: linear-gradient(120deg, #990026cc 0%, #4a001300 90%);
        border-radius: 0% 100% 0% 100%/0% 100% 0% 100%;
        transform-origin: bottom right;
    }

    &:nth-child(odd) {
        left: 55%;
        background-image: linear-gradient(300deg, #990026cc 0%, #4a001300 90%);
        border-radius: 100% 0% 100% 0%/100% 0% 100% 0%;
        transform-origin: bottom left;
    }
}

.flower-leaf__2 { top: 25%; transform: rotate(-15deg) scale(1); }
.flower-leaf__1 { top: 31%; transform: rotate(15deg) scale(1); }
.flower-leaf__4 { top: 37%; transform: rotate(-15deg) scale(1.2); }
.flower-leaf__3 { top: 43%; transform: rotate(15deg) scale(1.2); }
.flower-leaf__6 { top: 50%; transform: rotate(-15deg) scale(1.5); }
.flower-leaf__5 { top: 56%; transform: rotate(15deg) scale(1.5); }

.flower-grass {
    position: absolute;
    bottom: -20cqi;
    width: 80cqi;
    height: 120cqi;
    opacity: 0;
    scale: 0;
    mask-image: linear-gradient(to top, transparent 15%, #fff 50%);

    &:nth-child(odd) {
        right: 55%;
        border-top-right-radius: 100%;
        border-right: 5cqi solid #b3002daa;
        transform-origin: bottom right;
    }

    &:nth-child(even) {
        left: 55%;
        border-top-left-radius: 100%;
        border-left: 5cqi solid #b3002daa;
        transform-origin: bottom left;
    }
}



/* Animations */
.animate {
    &.flower-container {
        animation: flower-rotate 12s linear infinite;
    }

    .flower-circle {
        animation: grass-grow 0.25s ease-in forwards 3s;
    }

    .flower-petal {
        animation: petal-grow 0.5s ease-in forwards,
                    flower-rotate 3s linear infinite;
    }

    .flower-petal__3 { animation-delay: 3.2s; }
    .flower-petal__2 { animation-delay: 3.3s; }
    .flower-petal__4 { animation-delay: 3.4s; }
    .flower-petal__7 { animation-delay: 3.5s; }
    .flower-petal__8 { animation-delay: 3.6s; }
    .flower-petal__6 { animation-delay: 3.7s; }
    .flower-petal__5 { animation-delay: 3.8s; }
    .flower-petal__1 { animation-delay: 3.9s; }

    .flower-stem {
        animation: stem-grow 3s ease-in forwards;
    }

    .flower-grass {
        animation: grass-grow 1s ease-in forwards 1.5s,
                   flower-rotate 6s linear infinite;
    }

    .flower-leaf {
        animation: grass-grow 0.75s ease-in forwards, 
                   flower-rotate 6s linear infinite;
    }

    .flower-leaf__2 { animation-delay: 2s; }
    .flower-leaf__1 { animation-delay: 1.9s; }
    .flower-leaf__4 { animation-delay: 1.8s; }
    .flower-leaf__3 { animation-delay: 1.65s; }
    .flower-leaf__6 { animation-delay: 1.5s; }
    .flower-leaf__5 { animation-delay: 1.25s; }

    .flower-light {
        animation: light-float 5s ease-in-out infinite;
    }

    .flower-light__1 { animation-delay: 4.7s; }
    .flower-light__2 { animation-delay: 5.2s; }
    .flower-light__3 { animation-delay: 5.7s; }
    .flower-light__4 { animation-delay: 6.2s; }
    .flower-light__5 { animation-delay: 6.7s; }
    .flower-light__6 { animation-delay: 7.2s; }
    .flower-light__7 { animation-delay: 7.7s; }
    .flower-light__8 { animation-delay: 8.2s; }
}

@keyframes petal-grow {
    0% { scale: 0; opacity: 0.9; }
    50% { scale: 1; opacity: 0.9; }
    75% { scale: 1.1; opacity: 0.95; }
    90% { scale: 0.95; opacity: 0.95; }
    100% { scale: 1; opacity: 1; }
}

@keyframes grass-grow {
    100% { opacity: 1; scale: 1; }
}

@keyframes stem-grow {
    0% { border-radius: 10%; }
    100% { transform: scaleY(1); }
}

@keyframes flower-rotate {
    0%, 100% { rotate: 0deg; }
    25% { rotate: 5deg; }
    75% { rotate: -5deg; }
}

@keyframes shrink {
    100% { transform: translateX(-50%) scale(1.08); }
}

@keyframes light-float {
    0% { opacity: 0; transform: translate(0, 0); }
    25% { opacity: 1; transform: translate(20cqi, -25cqi); }
    50% { opacity: 1; transform: translate(0, -50cqi); }
    75% { opacity: 1; transform: translate(-20cqi, -75cqi); }
    100% { opacity: 0; transform: translate(0, -100cqi); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translate(-50%, -30px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}
