* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    touch-action: manipulation;
}

@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;600;700&display=swap');

body {
    font-family: 'Nunito Sans', sans-serif;
    background: linear-gradient(135deg, #8a6cfb 0%, #a86cfb 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: background 1s ease;
}

body.evening-mode {
    background: linear-gradient(135deg, #4a3c7b 0%, #5a3c6b 100%);
}

.floating-hearts {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.floating-hearts span {
    position: absolute;
    bottom: -10vh;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, rgba(255, 154, 217, 0.8), rgba(255, 107, 186, 0.8));
    transform: rotate(45deg);
    border-radius: 4px;
    opacity: 0;
    animation: floatUp 16s linear infinite;
    box-shadow: 0 8px 18px rgba(255, 121, 195, 0.2);
}

.floating-hearts span::before,
.floating-hearts span::after {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, rgba(255, 154, 217, 0.8), rgba(255, 107, 186, 0.8));
    border-radius: 50%;
}

.floating-hearts span::before {
    top: -11px;
    left: 0;
}

.floating-hearts span::after {
    left: -11px;
    top: 0;
}

.floating-hearts span:nth-child(1) {
    left: 12%;
    --float-x: -3;
    animation-duration: 18s;
    animation-delay: 0s;
}

.floating-hearts span:nth-child(2) {
    left: 28%;
    --float-x: 2;
    animation-duration: 22s;
    animation-delay: 3s;
}

.floating-hearts span:nth-child(3) {
    left: 45%;
    --float-x: -1;
    animation-duration: 20s;
    animation-delay: 6s;
}

.floating-hearts span:nth-child(4) {
    left: 62%;
    --float-x: 3;
    animation-duration: 17s;
    animation-delay: 2s;
}

.floating-hearts span:nth-child(5) {
    left: 75%;
    --float-x: -2;
    animation-duration: 24s;
    animation-delay: 8s;
}

.floating-hearts span:nth-child(6) {
    left: 88%;
    --float-x: -4;
    animation-duration: 19s;
    animation-delay: 4s;
}

.floating-hearts span:nth-child(7) {
    left: 35%;
    --float-x: 1;
    animation-duration: 23s;
    animation-delay: 10s;
}

.floating-hearts span:nth-child(8) {
    left: 55%;
    --float-x: -2;
    animation-duration: 21s;
    animation-delay: 12s;
}

.floating-hearts span:nth-child(9) {
    left: 5%;
    --float-x: 4;
    animation-duration: 19s;
    animation-delay: 1s;
}

.floating-hearts span:nth-child(10) {
    left: 18%;
    --float-x: -1;
    animation-duration: 25s;
    animation-delay: 5s;
}

.floating-hearts span:nth-child(11) {
    left: 38%;
    --float-x: 2;
    animation-duration: 20s;
    animation-delay: 7s;
}

.floating-hearts span:nth-child(12) {
    left: 52%;
    --float-x: -3;
    animation-duration: 18s;
    animation-delay: 9s;
}

.floating-hearts span:nth-child(13) {
    left: 68%;
    --float-x: 1;
    animation-duration: 22s;
    animation-delay: 11s;
}

.floating-hearts span:nth-child(14) {
    left: 82%;
    --float-x: -2;
    animation-duration: 21s;
    animation-delay: 13s;
}

.floating-hearts span:nth-child(15) {
    left: 95%;
    --float-x: -5;
    animation-duration: 23s;
    animation-delay: 15s;
}

.floating-hearts span:nth-child(16) {
    left: 42%;
    --float-x: 3;
    animation-duration: 24s;
    animation-delay: 4.5s;
}

.floating-hearts span:nth-child(17) {
    left: 8%;
    --float-x: 2;
    animation-duration: 20s;
    animation-delay: 2.5s;
}

.floating-hearts span:nth-child(18) {
    left: 22%;
    --float-x: -3;
    animation-duration: 19s;
    animation-delay: 6.5s;
}

.floating-hearts span:nth-child(19) {
    left: 48%;
    --float-x: 4;
    animation-duration: 21s;
    animation-delay: 8.5s;
}

.floating-hearts span:nth-child(20) {
    left: 65%;
    --float-x: -1;
    animation-duration: 23s;
    animation-delay: 3.5s;
}

.floating-hearts span:nth-child(21) {
    left: 78%;
    --float-x: 2;
    animation-duration: 18s;
    animation-delay: 10.5s;
}

.floating-hearts span:nth-child(22) {
    left: 92%;
    --float-x: -4;
    animation-duration: 22s;
    animation-delay: 14s;
}

.floating-hearts span:nth-child(23) {
    left: 15%;
    --float-x: 3;
    animation-duration: 24s;
    animation-delay: 16s;
}

.floating-hearts span:nth-child(24) {
    left: 58%;
    --float-x: -2;
    animation-duration: 20s;
    animation-delay: 12.5s;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem;
    gap: 1.2rem;
    position: relative;
    z-index: 1;
}

.reason-button {
    position: relative;
    background: transparent;
    color: #5f6fe8;
    border: none;
    padding: 1.5rem 3.4rem;
    font-size: 1.5rem;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.3s ease, color 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: buttonReveal 0.8s ease forwards;
    animation-delay: 3.2s;
}

.reason-button::before {
    content: "";
    position: absolute;
    inset: -16px;
    border-radius: inherit;
    z-index: -2;
    background: radial-gradient(circle at 50% 50%, rgba(255, 200, 244, 0.65) 0%, rgba(255, 170, 230, 0.45) 40%, rgba(115, 105, 255, 0.12) 70%, rgba(102, 126, 234, 0) 100%);
    filter: blur(18px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    opacity: 0.9;
}

.reason-button::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(245, 245, 255, 0.85));
    border-radius: inherit;
    z-index: -1;
    box-shadow: 0 18px 40px rgba(104, 120, 238, 0.25), 0 0 25px rgba(255, 188, 237, 0.35);
    transition: box-shadow 0.3s ease;
}

.reason-button:hover {
    transform: translateY(-3px);
    color: #505ede;
}

.reason-button:hover::before {
    opacity: 1;
    transform: scale(1.04);
}

.reason-button:hover::after {
    box-shadow: 0 20px 45px rgba(255, 168, 228, 0.45);
}

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

.reason-button:active::before {
    transform: scale(1.02);
}

.reason-button:active::after {
    box-shadow: 0 14px 30px rgba(103, 119, 238, 0.3);
}

.reason-text {
    margin-top: 2rem;
    font-size: 1.8rem;
    color: white;
    font-weight: 500;
    min-height: 3rem;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.reason-text.show {
    opacity: 1;
}

.heart-wrapper {
    position: relative;
    width: 280px;
    height: 280px;
    display: flex;
    justify-content: center;
    align-items: center;
    --heart-offset: -30px;
    --heart-scale: 1;
    transform: translateY(var(--heart-offset)) scale(var(--heart-scale));
    transform-origin: 50% 65%;
    margin-bottom: -0.4rem;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.heart-wrapper::before {
    content: "";
    position: absolute;
    inset: -30px;
    border-radius: 50%;
    z-index: -1;
    background: radial-gradient(circle at 50% 50%, rgba(255, 200, 244, 0.5) 0%, rgba(255, 170, 230, 0.35) 40%, rgba(255, 107, 186, 0.15) 70%, rgba(255, 107, 186, 0) 100%);
    filter: blur(25px);
    opacity: 0.8;
    pointer-events: none;
}

.heart-wrapper.stable {
    transform: translateY(-30px) !important;
}

.heart-wrapper.heart-animate {
    animation: heartLift 0.9s cubic-bezier(.4, 0, .2, 1);
    animation-delay: 2.4s;
    animation-fill-mode: both;
}

.heart-wrapper.pulse {
    animation: heartClickPulse 0.5s ease;
    transform-origin: 50% 65%;
}

.heart-wrapper.breathing {
    animation: heartBreath 3s ease-in-out;
    transform-origin: 50% 65%;
}

.heart-shape {
    width: 280px;
    height: 280px;
}

@media (max-width: 768px) {
    body {
        padding: 2rem 1.5rem;
    }

    .container {
        gap: 1rem;
        padding: 1.5rem 1.2rem;
    }

    .heart-wrapper {
        width: 280px;
        height: 280px;
        --heart-offset: -22px;
        transform-origin: 50% 65%;
        margin-bottom: -0.25rem;
    }

    .heart-shape {
        width: 280px;
        height: 280px;
    }

    .heart-label {
        font-size: 1.05rem;
        width: 90%;
        line-height: 1.35;
        padding: 0 0.3rem;
    }

    .reason-button {
        padding: 1.1rem 2.6rem;
        font-size: 1.25rem;
    }

    .reason-button::before {
        inset: -12px;
    }

    .floating-hearts span {
        width: 16px;
        height: 16px;
    }

    .floating-hearts span::before,
    .floating-hearts span::after {
        width: 16px;
        height: 16px;
    }

    .floating-hearts span::before {
        top: -8px;
    }

    .floating-hearts span::after {
        left: -8px;
    }

    .reason-text {
        font-size: 1.4rem;
        margin-top: 1.2rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 1.5rem 1rem;
    }

    .heart-wrapper {
        width: 265px;
        height: 265px;
        --heart-offset: -16px;
        transform-origin: 50% 65%;
        margin-bottom: -0.15rem;
    }

    .heart-shape {
        width: 265px;
        height: 265px;
    }

    .heart-label {
        font-size: 0.98rem;
        width: 88%;
        line-height: 1.3;
        padding: 0 0.4rem;
    }

    .reason-button {
        padding: 1rem 2.2rem;
        font-size: 1.15rem;
    }

    .reason-button::before {
        inset: -10px;
    }

    .reason-text {
        font-size: 1.25rem;
    }
}

.heart-half,
.heart-center {
    fill: #ff6b9a;
    opacity: 0;
}

.heart-half-left {
    animation: heartLeftEnter 1.4s cubic-bezier(.4, 0, .2, 1) forwards;
}

.heart-half-right {
    animation: heartRightEnter 1.4s cubic-bezier(.4, 0, .2, 1) forwards;
}

.heart-center {
    animation: heartCenterReveal 0.9s cubic-bezier(.4, 0, .2, 1) forwards;
    animation-delay: 0.7s;
}

.heart-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(20px);
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.02em;
    line-height: 1.5;
    width: 82%;
    opacity: 0;
    animation: heartLabelReveal 0.8s ease forwards;
    animation-delay: 1.4s;
}

@keyframes heartLift {
    0% {
        transform: translateY(calc(var(--heart-offset) + 28px));
    }
    100% {
        transform: translateY(var(--heart-offset));
    }
}

@keyframes heartClickPulse {
    0% {
        transform: translateY(var(--heart-offset)) scale(var(--heart-scale));
    }
    50% {
        transform: translateY(var(--heart-offset)) scale(calc(var(--heart-scale) * 1.12));
    }
    100% {
        transform: translateY(var(--heart-offset)) scale(var(--heart-scale));
    }
}

@keyframes heartBreath {
    0% {
        transform: translateY(var(--heart-offset)) scale(var(--heart-scale));
    }
    50% {
        transform: translateY(var(--heart-offset)) scale(calc(var(--heart-scale) * 1.05));
    }
    100% {
        transform: translateY(var(--heart-offset)) scale(var(--heart-scale));
    }
}

@keyframes buttonReveal {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heartLeftEnter {
    0% {
        transform: translateX(-160px) scale(0.7);
        opacity: 0;
    }
    60% {
        opacity: 1;
    }
    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes heartRightEnter {
    0% {
        transform: translateX(160px) scale(0.7);
        opacity: 0;
    }
    60% {
        opacity: 1;
    }
    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes heartCenterReveal {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    60% {
        opacity: 0;
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes heartLabelReveal {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) translateY(0);
    }
}

@keyframes floatUp {
    0% {
        transform: rotate(45deg) translateY(0) translateX(0) scale(0.8);
        opacity: 0;
    }
    10% {
        opacity: 0.45;
    }
    50% {
        transform: rotate(45deg) translateY(-55vh) translateX(calc(var(--float-x, 0) * 1vw)) scale(1);
        opacity: 0.65;
    }
    100% {
        transform: rotate(45deg) translateY(-120vh) translateX(calc(var(--float-x, 0) * 2vw)) scale(1.1);
        opacity: 0;
    }
}

.counter {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(10px);
    animation: counterReveal 0.6s ease forwards;
    animation-delay: 3.4s;
    margin-top: -0.5rem;
    margin-bottom: 0.3rem;
}

@keyframes counterReveal {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.footer {
    position: fixed;
    bottom: 3.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    font-weight: 400;
    z-index: 10;
}

.progress-bar-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.15);
    z-index: 100;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff6b9a, #ff9ec8);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px rgba(255, 107, 154, 0.6);
}

.click-hearts-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.click-heart {
    position: absolute;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, rgba(255, 154, 217, 0.8), rgba(255, 107, 186, 0.8));
    transform: rotate(45deg);
    border-radius: 4px;
    opacity: 0;
    animation: clickHeartFly 18s linear forwards;
    box-shadow: 0 8px 18px rgba(255, 121, 195, 0.2);
}

.click-heart::before,
.click-heart::after {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, rgba(255, 154, 217, 0.8), rgba(255, 107, 186, 0.8));
    border-radius: 50%;
}

.click-heart::before {
    top: -11px;
    left: 0;
}

.click-heart::after {
    left: -11px;
    top: 0;
}

@keyframes clickHeartFly {
    0% {
        transform: rotate(45deg) translateY(0) translateX(0) scale(0.8);
        opacity: 0;
    }
    10% {
        opacity: 0.45;
    }
    50% {
        transform: rotate(45deg) translateY(-55vh) translateX(calc(var(--float-x, 0) * 1vw)) scale(1);
        opacity: 0.65;
    }
    100% {
        transform: rotate(45deg) translateY(-120vh) translateX(calc(var(--float-x, 0) * 2vw)) scale(1.1);
        opacity: 0;
    }
}

.plus-one-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 60;
    display: flex;
    justify-content: center;
    align-items: center;
}

.plus-one {
    position: absolute;
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    opacity: 0;
    animation: plusOneFade 1s ease-out forwards;
    text-shadow: 0 2px 8px rgba(255, 107, 154, 0.6);
}

@keyframes plusOneFade {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    30% {
        opacity: 1;
        transform: translateY(0) scale(1.1);
    }
    100% {
        opacity: 0;
        transform: translateY(-30px) scale(1);
    }
}

.fireworks-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 70;
    overflow: hidden;
}

.firework {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    animation: fireworkExplode 1.2s ease-out forwards;
}

@keyframes fireworkExplode {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

.flash-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 107, 154, 0.4) 50%, transparent 100%);
    pointer-events: none;
    z-index: 65;
    opacity: 0;
    animation: flashEffect 0.8s ease-out forwards;
}

@keyframes flashEffect {
    0% {
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.micro-reaction-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 60;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 15vh;
}

.micro-reaction {
    position: absolute;
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.3rem;
    font-weight: 600;
    font-style: italic;
    opacity: 0;
    animation: microReactionFade 2.5s ease-out forwards;
    text-shadow: 0 2px 8px rgba(255, 107, 154, 0.4);
    white-space: nowrap;
}

@keyframes microReactionFade {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.9);
    }
    15% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    85% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
}

.candle-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    background: radial-gradient(circle at 50% 50%, rgba(255, 200, 150, 0.15) 0%, transparent 60%);
    transition: opacity 1s ease;
}

body.evening-mode .candle-glow {
    opacity: 1;
    animation: candleFlicker 3s ease-in-out infinite;
}

@keyframes candleFlicker {
    0%, 100% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
}

.final-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #8a6cfb 0%, #a86cfb 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.5s ease;
}

.final-screen.show {
    opacity: 1;
    pointer-events: all;
}

.final-message {
    font-size: 4rem;
    font-weight: 700;
    color: white;
    text-align: center;
    opacity: 0;
    transform: scale(0.8);
    animation: finalMessageReveal 2s ease forwards;
    text-shadow: 0 4px 20px rgba(255, 107, 154, 0.6);
}

@keyframes finalMessageReveal {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    .final-message {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .final-message {
        font-size: 2rem;
    }
}

