*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}

body {
    background: #020002;
    background: radial-gradient(ellipse at 50% 75%, #120105 0%, #050002 55%, #000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vignette {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 35%, rgba(0, 0, 0, 0.9) 100%);
    z-index: 100;
    pointer-events: none;
}

.spotlight {
    position: fixed;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85vw;
    height: 85vh;
    background: radial-gradient(circle, rgba(255, 30, 80, 0.06) 0%, transparent 70%);
    filter: blur(50px);
    pointer-events: none;
    z-index: 1;
}


.trigger-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 200;
    opacity: 1;
    transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.8s;
    visibility: visible;
}

.trigger-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.glass-card {
    position: relative;
    width: min(85vw, 340px);
    background: rgba(22, 10, 15, 0.55);
    border: 1px solid rgba(255, 40, 100, 0.2);
    border-radius: 24px;
    padding: 35px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(255, 30, 80, 0.1);
    transform: scale(1);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.trigger-overlay.fade-out .glass-card {
    transform: scale(0.85);
}

.card-glow {
    position: absolute;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 30, 80, 0.15) 0%, transparent 70%);
    top: -40px;
    left: -40px;
    filter: blur(15px);
    pointer-events: none;
}

.rose-icon {
    font-size: 54px;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 12px rgba(255, 30, 80, 0.4));
    animation: pulseIcon 2s ease-in-out infinite;
}

@keyframes pulseIcon {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

.glass-card .title {
    color: #fff;
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 22px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.loading-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.loading-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(to right, #ff2e5e, #ff0044);
    border-radius: 3px;
    transition: width 0.1s linear;
}

.status-text {
    font-size: 12px;
    color: #b5a2b0;
    font-family: 'Fira Code', monospace;
    margin-bottom: 26px;
}

.start-button {
    position: relative;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #ff2e5e 0%, #ff0044 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.3s;
    box-shadow: 0 5px 20px rgba(255, 0, 68, 0.3);
}

.start-button:disabled {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    box-shadow: none;
    transform: none !important;
}

.start-button:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 25px rgba(255, 0, 68, 0.5),
        0 0 15px rgba(255, 50, 90, 0.3);
}

.start-button:active {
    transform: translateY(1px);
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: skewX(-25deg);
}

.start-button:not(:disabled):hover .btn-shine {
    animation: shine 1.2s ease-in-out infinite;
}

@keyframes shine {
    100% {
        left: 150%;
    }
}

.ambient-light {
    position: fixed;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 30, 60, 0.10) 0%, rgba(255, 20, 50, 0.04) 40%, transparent 65%);
    top: 32%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    transition: opacity 3s ease;
}

.ambient-light.visible {
    opacity: 1;
}



.scene {
    perspective: 1200px;
    perspective-origin: 50% 35%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 6vh;
    z-index: 20;
    transform: scale(0.95);
}

.rose-wrapper {
    transform-style: preserve-3d;
    position: relative;
    width: 300px;
    height: 480px;
    transform: rotateX(-22deg) rotateY(0deg);
    will-change: transform;
}

.rose-wrapper.rotating {
    animation: rotateRose 28s linear infinite;
}

@keyframes rotateRose {
    from {
        transform: rotateX(-22deg) rotateY(0deg);
    }

    to {
        transform: rotateX(-22deg) rotateY(360deg);
    }
}


.stem-group {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 250px;
    transform-style: preserve-3d;
}

.stem {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(to top, #092e12 0%, #114c23 30%, #1a6f35 70%, #114c23 100%);
    border-radius: 5px;
    transition: height 2.2s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
    will-change: height;
}

.stem.grow {
    height: 100%;
}

.stem-highlight {
    position: absolute;
    top: 0;
    left: 1px;
    width: 2.5px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(150, 255, 180, 0.15), transparent);
}

.thorn {
    position: absolute;
    width: 11px;
    height: 6px;
    opacity: 0;
    transition: opacity 0.5s ease 0.4s;
    z-index: 2;
}

.thorn::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a6f35, #092e12);
    clip-path: polygon(0% 85%, 100% 50%, 30% 0%);
}

.thorn-1 {
    right: -9px;
    bottom: 65%;
    transform: scaleX(-1);
}

.thorn-2 {
    left: -9px;
    bottom: 42%;
}

.stem.grow~.thorn {
    opacity: 0.75;
}

.leaf {
    position: absolute;
    width: 52px;
    height: 25px;
    opacity: 0;
    transition: opacity 0.6s ease, transform 1.1s cubic-bezier(0.34, 1.45, 0.64, 1);
    z-index: 2;
    will-change: transform, opacity;
}

.leaf::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(160deg, #2a944e 0%, #1a6f35 40%, #092e12 100%);
    border-radius: 2px 65% 2px 65%;
}

.leaf-vein {
    position: absolute;
    width: 60%;
    height: 1px;
    background: rgba(150, 255, 180, 0.12);
    top: 48%;
    left: 20%;
    z-index: 1;
}

.leaf-left {
    left: -52px;
    bottom: 56%;
    transform-origin: right center;
    transform: rotate(35deg) scale(0);
}

.leaf-left::before {
    border-radius: 65% 2px 65% 2px;
}

.leaf-right {
    left: 10px;
    bottom: 38%;
    transform-origin: left center;
    transform: rotate(-35deg) scale(0);
}

.leaf-right::before {
    border-radius: 2px 65% 2px 65%;
}

.leaf.visible {
    opacity: 1;
}

.leaf-left.visible {
    transform: rotate(15deg) scale(1);
}

.leaf-right.visible {
    transform: rotate(-15deg) scale(1);
}


.calyx {
    position: absolute;
    bottom: 242px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    transform-style: preserve-3d;
    z-index: 1;
}

.sepal {
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 14px;
    height: 32px;
    transform-origin: 50% 100%;
    background: linear-gradient(to top, #092e12 0%, #15582b 40%, #299c4c 100%);
    border-radius: 50% 50% 10% 10% / 80% 80% 20% 20%;
    clip-path: polygon(10% 100%, 0% 30%, 50% 0%, 100% 30%, 90% 100%);
    opacity: 0;
    transform: translateX(-50%) rotateY(var(--sepal-angle, 0deg)) rotateX(60deg) scale(0.5);
    transition:
        transform 1.3s cubic-bezier(0.25, 1, 0.5, 1) var(--sepal-delay, 0s),
        opacity 0.5s ease var(--sepal-delay, 0s);
    will-change: transform, opacity;
}

.calyx.visible .sepal {
    opacity: 0.95;
    transform: translateX(-50%) rotateY(var(--sepal-angle, 0deg)) rotateX(var(--sepal-curl, 22deg)) scale(1);
}


.rose-head {
    position: absolute;
    bottom: 245px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    transform-style: preserve-3d;
    z-index: 10;
}

.rose-glow {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(160, 5, 30, 0.18) 0%, rgba(100, 0, 20, 0.05) 45%, transparent 65%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 3.5s ease;
    z-index: -1;
    pointer-events: none;
}

.rose-glow-inner {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(180, 40, 60, 0.15) 0%, transparent 65%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 2s ease 0.8s;
    z-index: -1;
    pointer-events: none;
}

.rose-head.blooming .rose-glow {
    opacity: 1;
}

.rose-head.blooming .rose-glow-inner {
    opacity: 1;
}


.petal {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform-origin: 50% 100%;
    opacity: 0.002;
    will-change: transform, opacity;

    border-radius: 50% 50% 35% 35% / 45% 45% 55% 55%;

    transform:
        translateX(-50%) rotateY(var(--angle, 0deg)) translateZ(0px) rotateX(90deg) scale(0.1);

    transition:
        transform var(--bloom-dur, 2.4s) ease-in-out var(--delay, 0s),
        opacity 0.7s ease var(--delay, 0s);
}

.rose-head.blooming .petal {
    opacity: 1;
    transform:
        translateX(-50%) rotateY(var(--angle, 0deg)) translateZ(var(--tz, 0px)) rotateX(var(--curl, 30deg)) scale(var(--scale, 1));
}


.petal-bud {
    background: linear-gradient(to bottom, #3d0008 0%, #220003 40%, #100001 75%, #040000 100%);
}

.petal-core {
    background: linear-gradient(to bottom, #52000c 0%, #350005 40%, #1a0002 75%, #080000 100%);
}

.petal-inner {
    background: linear-gradient(to bottom, #6d0012 0%, #480008 40%, #250003 75%, #0c0000 100%);
}

.petal-mid-inner {
    background: linear-gradient(to bottom, #850018 0%, #5c000d 40%, #310004 75%, #120000 100%);
}

.petal-mid {
    background: linear-gradient(to bottom, #9a001d 0%, #6e0011 40%, #3b0005 75%, #160000 100%);
}

.petal-outer {
    background: linear-gradient(to bottom, #ad0022 0%, #7e0014 40%, #440007 75%, #1a0001 100%);
}

.petal-blush {
    background: linear-gradient(to bottom, #bf0028 0%, #8e0018 40%, #4e0008 75%, #1e0001 100%);
}


.falling-petal {
    position: fixed;
    width: var(--fp-w, 13px);
    height: var(--fp-h, 17px);
    background: radial-gradient(ellipse at 40% 30%, var(--fp-c1, #9a001d), var(--fp-c2, #3d0008) 75%);
    border-radius: 50% 50% 45% 55% / 60% 60% 40% 40%;
    opacity: 0;
    pointer-events: none;
    z-index: 50;
    animation: fallSway var(--f-dur, 7s) linear forwards;
    animation-delay: var(--f-delay, 0s);
    will-change: transform, opacity;
}

@keyframes fallSway {
    0% {
        opacity: 0;
        transform: translateX(0) translateY(0) rotate(0deg) rotateY(0deg) scale(1);
    }

    8% {
        opacity: 0.85;
    }

    25% {
        transform: translateX(var(--s1, 35px)) translateY(20vh) rotate(70deg) rotateY(40deg) scale(0.95);
    }

    50% {
        transform: translateX(var(--s2, -25px)) translateY(48vh) rotate(160deg) rotateY(90deg) scale(0.88);
    }

    75% {
        transform: translateX(var(--s3, 35px)) translateY(75vh) rotate(270deg) rotateY(150deg) scale(0.78);
        opacity: 0.55;
    }

    100% {
        opacity: 0;
        transform: translateX(var(--s4, 10px)) translateY(108vh) rotate(390deg) rotateY(210deg) scale(0.55);
    }
}


.end-text {
    position: fixed;
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    opacity: 0;
    transition: opacity 2s ease;
    z-index: 60;
}

.end-text.visible {
    opacity: 1;
}

.tagline {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: clamp(18px, 5.5vw, 30px);
    color: rgba(255, 195, 215, 0.95);
    letter-spacing: 4px;
    text-transform: lowercase;
    text-shadow:
        0 0 25px rgba(255, 80, 130, 0.4),
        0 0 60px rgba(255, 50, 100, 0.15);
    margin-bottom: 8px;
}

.rose-emoji {
    font-size: 32px;
    display: block;
    animation: floatEmoji 3s ease-in-out infinite;
}

@keyframes floatEmoji {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}


@media (max-width: 480px) {
    .rose-wrapper {
        transform: scale(0.82);
    }

    .tagline {
        letter-spacing: 2px;
    }
}

@media (max-height: 600px) {
    .rose-wrapper {
        transform: scale(0.68);
    }

    .end-text {
        bottom: 3%;
    }
}