:root {
    --primary-color: #ff4d6d;
    --secondary-color: #ff8fa3;
    --bg-color: #0b0d17;
    --text-color: #ffffff;
    --glow-color: rgba(255, 77, 109, 0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Outfit', sans-serif;
    color: var(--text-color);
    position: relative;
}

/* --- Universe Background --- */
.stars,
.twinkling {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.stars {
    background: #000 url('http://www.script-tutorials.com/demos/360/images/stars.png') repeat top center;
    z-index: 0;
}

.twinkling {
    background: transparent url('http://www.script-tutorials.com/demos/360/images/twinkling.png') repeat top center;
    z-index: 1;
    animation: move-twink-back 200s linear infinite;
    opacity: 0.5;
}

@keyframes move-twink-back {
    from {
        background-position: 0 0;
    }

    to {
        background-position: -10000px 5000px;
    }
}

/* Fallback for stars if images fail or for local generation */
body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
    z-index: -1;
}

/* --- Heart Styling --- */
.container {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.heart-container {
    position: relative;
    width: 220px;
    height: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.heart-container:active {
    transform: scale(0.95);
}

.heart-svg {
    width: 150px;
    fill: var(--primary-color);
    filter: drop-shadow(0 0 10px var(--glow-color)) drop-shadow(0 0 20px var(--primary-color));
    animation: heartbeat 1.5s infinite;
}

.heart.clicked .heart-svg {
    animation: none;
    transform: scale(1.1);
    fill: #ff0040;
}

@keyframes heartbeat {
    0% {
        transform: scale(1);
    }

    15% {
        transform: scale(1.15);
    }

    30% {
        transform: scale(1);
    }

    45% {
        transform: scale(1.15);
    }

    60% {
        transform: scale(1);
    }

    100% {
        transform: scale(1);
    }
}

.click-hint {
    margin-top: 2rem;
    font-size: 1.2rem;
    opacity: 0.7;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.4;
    }
}

/* --- Floating Phrases --- */
.floating-phrase {
    position: absolute;
    color: white;
    font-family: 'Dancing Script', cursive;
    font-size: 1.5rem;
    pointer-events: none;
    white-space: nowrap;
    text-shadow: 0 0 5px rgba(255, 77, 109, 0.8);
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    animation: floatUp 4s ease-out forwards;
    opacity: 0;
}

@keyframes floatUp {
    0% {
        transform: translate(-50%, 0) scale(0.5);
        opacity: 0;
    }

    10% {
        opacity: 1;
        transform: translate(-50%, -20px) scale(1.1);
    }

    100% {
        transform: translate(-50%, -150px) scale(1);
        opacity: 0;
    }
}

/* --- Audio Control --- */
.audio-control {
    position: absolute;
    top: 20px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.music-note {
    animation: wiggle 2s infinite ease-in-out;
}

@keyframes wiggle {

    0%,
    100% {
        transform: rotate(-10deg);
    }

    50% {
        transform: rotate(10deg);
    }
}

/* Burst Particles */
.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    pointer-events: none;
    animation: burst 1s ease-out forwards;
}

@keyframes burst {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* --- Mobile Responsiveness --- */
@media (max-width: 600px) {
    .floating-phrase {
        font-size: 1.2rem;
        white-space: normal;
        /* Allow text to wrap on small screens */
        text-align: center;
        max-width: 90%;
        /* Prevent overflow */
        padding: 6px 12px;
    }

    .heart-svg {
        width: 120px;
    }

    .audio-control {
        font-size: 0.8rem;
        padding: 8px 16px;
    }
}