:root {
    --bg-dark: #020c1b;
    --bg-light: #0a192f;
    --heart-glass-bg: rgba(255, 255, 255, 0.1);
    --text-white: #ffffff;

    /* Blue Glass Variables */
    --glass-blue: rgba(67, 97, 238, 0.85);
    --glass-cyan: rgba(76, 201, 240, 0.85);
    --glass-border: rgba(255, 255, 255, 0.3);
    --heart-glow: rgba(76, 201, 240, 0.6);
}

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

body {
    font-family: 'Outfit', sans-serif;
    /* Active Mesh Gradient Background */
    background: linear-gradient(-45deg, #020c1b, #0a192f, #1e002e, #001219);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* --- Background Effects --- */
/* --- Background Effects --- */
.background-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
    /* Removed redundant radial gradients to reduce overdraw since mesh gradient is active */
}

.floating-heart {
    position: absolute;
    /* Font size will be set via JS, but set a base here */
    font-size: 24px;
    opacity: 0.8;
    animation: floatingUp linear infinite;
    pointer-events: none;
    /* Optimize animation performance */
    will-change: transform, opacity;
    /* Glow effect for the emojis (Cyan + Red) */
    text-shadow: 0 0 10px rgba(76, 201, 240, 0.8), 0 0 20px rgba(239, 71, 111, 0.6);
    /* No background/border for emojis */
    background: transparent;
    box-shadow: none;
    transform: none;
    /* Emojis are upright */
}

/* Remove geometric construction */
/* .floating-heart::before, .floating-heart::after { content: none; } */

.heart-red {
    background: rgba(239, 71, 111, 0.6);
    /* Red/Pink */
}

.heart-blue {
    background: rgba(76, 201, 240, 0.6);
    /* Cyan/Blue */
}

@keyframes floatingUp {
    0% {
        transform: translateY(110vh) scale(0.5);
        opacity: 0;
    }

    20% {
        opacity: 0.8;
    }

    100% {
        transform: translateY(-10vh) scale(1.2);
        opacity: 0;
    }
}

/* --- Main Layout --- */
.main-wrapper {
    z-index: 10;
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- Heart Wrapper & Interaction --- */
.heart-wrapper {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;

    transition: transform 0.1s linear;
    animation: pulseHeart 4s infinite ease-in-out;
    /* Crucial for blocking scroll interaction on mobile while holding */
    touch-action: none;
    will-change: transform, filter;
}

/* --- The Visual Heart Shape (Geometric Glass) --- */
.heart-shape {
    position: absolute;
    width: 100%;
    height: 100%;

    /* Blue Glass Gradient for the Square (Restored) */
    background: linear-gradient(135deg, var(--glass-blue), var(--glass-cyan));

    /* Glass Effect (Restored) */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    /* Stronger base glow (60px) and slight pulse transition */
    box-shadow: 0 0 60px var(--heart-glow), inset 0 0 20px rgba(255, 255, 255, 0.2);
    transition: box-shadow 0.3s ease, filter 0.3s ease;

    transform: rotate(-45deg);
}

/* Restore the Circles (Lobes) */
.heart-shape::before,
.heart-shape::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;

    /* Inherit the Glass Look */
    background: inherit;
    backdrop-filter: inherit;
    -webkit-backdrop-filter: inherit;
    border: inherit;
    box-shadow: inherit;
}

.heart-shape::before {
    top: -50%;
    left: 0;
    border-bottom: none;
    border-right: none;
}

.heart-shape::after {
    top: 0;
    left: 50%;
    border-bottom: none;
    border-left: none;
}

/* Remove SVG Overlay style */
/* .heart-border-svg { display: none; } */

/* --- Content Overlay --- */
.content-overlay {
    position: absolute;
    /* Strict centering relative to wrapper */
    /* Strict centering relative to wrapper */
    top: 45%;
    /* Back to 45% because geometric heart visual center is lower than the full SVG shape */
    left: 50%;
    transform: translate(-50%, -50%);
    /* Center it exactly on that 45% point */

    z-index: 20;
    text-align: center;
    width: 160%;
    pointer-events: none;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.romantic-title {
    font-family: 'Great Vibes', cursive;
    font-size: 3.5rem;
    /* Larger */
    color: var(--text-white);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5), 0 0 20px rgba(76, 201, 240, 0.3);
    margin-bottom: 5px;
    line-height: 1.1;
}

.counter {
    /* Glass inside Glass */
    background: rgba(10, 25, 47, 0.4);
    padding: 10px 20px;
    border-radius: 25px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    gap: 10px;
    /* Use baseline alignment to ensure numbers and colons sit on the same line naturally */
    align-items: baseline;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 30px;
}

.time-val {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: 1.8rem;
    line-height: 1;
    letter-spacing: 1px;
}

.separator {
    font-size: 1.4rem;
    opacity: 0.6;
    /* With baseline alignment, we don't need manual offsets */
    align-self: baseline;
    padding-bottom: 0;
}

.date-label {
    font-size: 0.85rem;
    opacity: 0.7;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 8px;
    font-weight: 300;
}

@keyframes pulseHeart {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }

    50% {
        transform: scale(1.03);
        filter: brightness(1.1);
    }

    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

/* --- Mobile Optimization --- */
@media (max-width: 768px) {
    .heart-wrapper {
        /* 
           STRICT SIZING: 
           Use 70vw to fill more space but stay safe.
        */
        /* 
           55vw width = ~77vw diagonal. 
           Safe on mobile.
        */
        width: 55vw;
        height: 55vw;
        max-width: 250px;
        max-height: 250px;
    }

    .romantic-title {
        font-size: 2.2rem;
    }

    /* Content overlay needs to be wider relative to the smaller heart wrapper */
    .content-overlay {
        width: 200%;
        top: 42%;
        /* Slightly higher on mobile to be safe */
    }

    .time-val {
        font-size: 1.5rem;
        /* Restored size slightly */
    }

    .counter {
        padding: 10px 14px;
        gap: 8px;
    }

    .date-label {
        font-size: 0.8rem;
    }
}

@media (max-width: 380px) {
    .heart-wrapper {
        /* Even safer for tiny screens */
        width: 65vw;
        height: 65vw;
    }

    .romantic-title {
        font-size: 2rem;
    }

    .time-val {
        font-size: 1.2rem;
    }
}