html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: linear-gradient(135deg, #f8d5ec, #d5e8f8);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    position: relative;
}

.controls {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
}

button, a.button-link {
    padding: 10px 20px;
    margin: 5px;
    background: #ff69b4;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    display: inline-block;
}

button:hover, a.button-link:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px #ff69b4;
}

.main-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
    text-align: center;
}

.flower {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 20px;
    animation: bloom 3s ease forwards;
}

@keyframes bloom {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.petal {
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, #ff69b4, #ff1493);
    border-radius: 50%;
    position: absolute;
    animation: colorCycle 6s infinite alternate;
}

@keyframes colorCycle {
    0% { background: radial-gradient(circle, #ff69b4, #ff1493); }
    50% { background: radial-gradient(circle, #ffa6c9, #ff69b4); }
    100% { background: radial-gradient(circle, #ff69b4, #ff1493); }
}

.petal1 { top: 0; left: 35px; }
.petal2 { top: 35px; left: 0; }
.petal3 { top: 35px; right: 0; }
.petal4 { bottom: 0; left: 35px; }

.center {
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, #ffff66, #ffcc00);
    border-radius: 50%;
    position: absolute;
    top: 50px;
    left: 50px;
    z-index: 1;
    box-shadow: 0 0 15px #ffcc00;
    transition: box-shadow 0.5s;
}

#flower:hover .center {
    box-shadow: 0 0 35px #ffcc00;
}

.stem {
    width: 10px;
    height: 150px;
    background: linear-gradient(to bottom, #228b22, #006400);
    position: absolute;
    top: 150px;
    left: 70px;
}

.leaf {
    width: 50px;
    height: 20px;
    background: linear-gradient(to right, #32cd32, #006400);
    border-radius: 20px 0;
    position: absolute;
}

.leaf1 { top: 180px; left: 80px; transform: rotate(45deg); }
.leaf2 { top: 220px; left: 20px; transform: rotate(-45deg); }

.moon {
    width: 150px;
    height: 150px;
    margin: 20px auto;
}

.moon-core {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, #fdfd96, #fdd835, #fbc02d);
    border-radius: 50%;
    box-shadow: 0 0 20px 10px rgba(255, 241, 118, 0.5);
    animation: moonGlow 4s ease-in-out infinite alternate;
}

@keyframes moonGlow {
    from { box-shadow: 0 0 20px 10px rgba(255, 241, 118, 0.5); }
    to { box-shadow: 0 0 40px 20px rgba(255, 241, 118, 0.8); }
}

.message {
    margin-top: 20px;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.85);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: floatUp 3s infinite alternate;
}

@keyframes floatUp {
    from { transform: translateY(0); }
    to { transform: translateY(-10px); }
}

.hidden-love-note {
    display: none;
    margin-top: 20px;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 0 10px #ff69b4;
}

.countdown {
    margin-top: 20px;
    font-size: 1.2em;
    color: #d63384;
    background: rgba(255, 255, 255, 0.8);
    padding: 10px 20px;
    border-radius: 10px;
}

.stars-background::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background: radial-gradient(#fff 1px, transparent 1px);
    background-size: 50px 50px;
    animation: moveStars 20s linear infinite;
}

@keyframes moveStars {
    from { transform: translate(0, 0); }
    to { transform: translate(-50px, -50px); }
}

.floating-symbol, .balloons-container div, .particles-container div {
    position: fixed;
    bottom: -30px;
    font-size: 30px;
    animation: floatUpwards linear forwards;
    z-index: 999;
    pointer-events: none;
}

@keyframes floatUpwards {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(-100vh) rotate(360deg); opacity: 0; }
}

/* ----------------------- */
/* Mobile responsiveness   */
/* ----------------------- */

/* Make nav usable on phones */
.controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
.controls form { display: inline-block; }

@media (max-width: 768px) {
    .controls {
        left: 8px;
        right: 8px;
        top: auto;
        bottom: 10px;
        background: rgba(255,255,255,0.65);
        border-radius: 999px;
        padding: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        backdrop-filter: blur(6px);
        box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    }
    .controls button,
    .controls .button-link {
        flex: 0 0 auto;
        padding: 8px 12px;
        font-size: 0.9rem;
        border-radius: 999px;
        white-space: nowrap;
    }
}

/* Scale the decorative flower on small screens instead of rewriting sizes */
@media (max-width: 520px) {
    .flower { transform: scale(0.8); transform-origin: center top; }
    .message { font-size: 0.95rem; padding: 14px; }
    .hidden-love-note { font-size: 0.95rem; padding: 12px; }
}

@media (max-width: 380px) {
    .flower { transform: scale(0.7); }
    button, a.button-link { font-size: 0.9rem; padding: 8px 12px; }
}

/* Prevent horizontal scroll caused by large floating elements on tiny screens */
@media (max-width: 420px) {
    .floating-symbol { font-size: 22px !important; }
}

/* ----------------------- */
/* Floating Goofy Lines    */
/* ----------------------- */
.goofy-lines {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 14vh;
    width: 100%;
    display: grid;
    place-items: center;
    pointer-events: none;
    z-index: 950;
    padding: 0 12px;
}

.goofy-line {
    font-weight: 600;
    color: #7a1c5b;
    background: rgba(255,255,255,0.88);
    border: 2px solid rgba(255,105,180,0.35);
    border-radius: 999px;
    padding: 8px 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(255,105,180,0.25) inset;
    backdrop-filter: blur(6px);
    font-size: clamp(14px, 3.8vw, 22px);
    opacity: 0;
    transform: translateY(10px);
    animation: glFade 8s ease-in-out both;
}

@keyframes glFade {
    0% { opacity: 0; transform: translateY(10px); }
    10% { opacity: 1; transform: translateY(0); }
    85% { opacity: 1; transform: translateY(-3px); }
    100% { opacity: 0; transform: translateY(-6px); }
}

/* Toggle (Pause/Play) control */
.goofy-toggle {
    position: fixed;
    right: 12px;
    bottom: 16vh; /* sit near the lines */
    z-index: 960;
    padding: 6px 10px;
    font-size: 13px;
    line-height: 1;
    color: #7a1c5b;
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(122,28,91,0.25);
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    pointer-events: auto; /* ensure clickable over the non-interactive container */
}

@media (max-width: 768px) {
    .goofy-toggle { bottom: calc(16vh + 8px); }
}

/* Respect Reduced Motion: slow down animations */
@media (prefers-reduced-motion: reduce) {
    .goofy-line { animation-duration: 16s; }
}

