:root {
    --block-size: 40px;
    --love-w: 520px;
    --love-h: 440px;
    --love-ml: -220px;
    --love-mt: -260px;
    --boy-size: 220px;
    --boy-left: 20px;
    --boy-bottom: 80px;
    --heart-size: 150;
    --name-font: 40px;
    --text-font: 32px;
    --rise-dist: 180;
}

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

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Ma Shan Zheng', cursive, sans-serif;
}

body {
    overflow: hidden;
    background: #ffffff;
}

.start-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(ellipse at center, #fff5f7 0%, #ffffff 70%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease;
}

.start-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.start-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.start-heart-icon {
    animation: heartPulse 1.2s ease-in-out infinite;
}

.start-heart-icon svg {
    filter: drop-shadow(0 0 15px rgba(255, 77, 109, 0.5));
}

@keyframes heartPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

.start-content input {
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(255, 77, 109, 0.4);
    color: #ff4d6d;
    font-size: 22px;
    font-family: 'Ma Shan Zheng', cursive;
    text-align: center;
    padding: 8px 20px;
    outline: none;
    width: 220px;
    letter-spacing: 3px;
    transition: border-color 0.3s;
}

.start-content input::placeholder {
    color: rgba(255, 77, 109, 0.35);
    font-size: 18px;
}

.start-content input:focus {
    border-bottom-color: #ff4d6d;
}

.start-btn {
    padding: 10px 48px;
    background: linear-gradient(135deg, #ff4d6d, #ff85a1);
    color: #fff;
    font-size: 20px;
    font-family: 'Ma Shan Zheng', cursive;
    border-radius: 25px;
    cursor: pointer;
    letter-spacing: 6px;
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none;
}

.start-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 0 24px rgba(255, 77, 109, 0.5);
}

.start-btn:active {
    transform: scale(0.97);
}

.container {
    width: 100%; height: 100%;
    position: relative;
    opacity: 0;
    transition: opacity 1s ease;
}

.container.visible { opacity: 1; }

.body_left {
    width: var(--boy-size);
    height: var(--boy-size);
    left: var(--boy-left);
    bottom: var(--boy-bottom);
    position: absolute;
    z-index: 98;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.body_left.show { opacity: 1; }

.body_left img {
    width: 100%; height: 100%;
    object-fit: contain;
}

.boy-emoji {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    font-size: 80px;
    animation: boyShoot 0.6s ease-in-out infinite alternate;
}

@keyframes boyShoot {
    0% { transform: translate(-50%, -50%) rotate(-5deg); }
    100% { transform: translate(-50%, -50%) rotate(5deg) translateX(5px); }
}

.container .love {
    width: var(--love-w);
    height: var(--love-h);
    left: 50%; top: 50%;
    position: absolute;
    margin-top: var(--love-mt);
    margin-left: var(--love-ml);
}

.love .block {
    right: 0;
    position: absolute;
    visibility: hidden;
    background-color: transparent;
}

.love .block div {
    width: var(--block-size);
    height: var(--block-size);
    position: absolute;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M462.3 62.6C407.5 15.9 326 24.3 275.7 76.2L256 96.5l-19.7-20.3C186.1 24.3 104.5 15.9 49.7 62.6c-62.8 53.6-66.1 149.8-9.9 207.9l193.5 199.8c12.5 12.9 32.8 12.9 45.3 0l193.5-199.8c56.3-58.1 53-154.3-9.8-207.9z' fill='%23ff4d6d'/%3E%3C/svg%3E") no-repeat center/contain;
    box-sizing: border-box;
    will-change: transform, opacity;
}

.love.fading .block div {
    opacity: 0 !important;
    transform: scale(0) !important;
    transition: opacity 1.2s ease, transform 1.2s ease !important;
}

.blessing-container {
    position: fixed;
    bottom: 10%;
    left: 0;
    width: 100%;
    height: 80px;
    overflow: hidden;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1s ease;
}

.blessing-container.active {
    opacity: 1;
}

.blessing-item {
    position: absolute;
    width: 100%;
    text-align: center;
    font-size: var(--text-font);
    color: #ff4d6d;
    letter-spacing: 3px;
    text-shadow: 0 0 20px rgba(255, 77, 109, 0.4), 0 0 40px rgba(255, 77, 109, 0.2);
    opacity: 0;
    transform: translateY(30px);
    animation: blessingFadeIn 3s ease forwards;
    white-space: nowrap;
}

.blessing-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(10px);
    animation: charReveal 0.4s ease forwards;
}

@keyframes charReveal {
    0% { 
        opacity: 0; 
        transform: translateY(10px) scale(0.8); 
        text-shadow: none;
    }
    50% {
        opacity: 1;
        transform: translateY(-2px) scale(1.1);
        text-shadow: 0 0 20px rgba(255, 77, 109, 0.8);
    }
    100% { 
        opacity: 1; 
        transform: translateY(0) scale(1);
        text-shadow: 0 0 20px rgba(255, 77, 109, 0.4), 0 0 40px rgba(255, 77, 109, 0.2);
    }
}

@keyframes blessingFadeIn {
    0% { opacity: 0; transform: translateY(30px); }
    15% { opacity: 1; transform: translateY(0); }
    85% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-20px); }
}

#particleCanvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 97;
    pointer-events: none;
}

.footer {
    bottom: 30px;
    position: fixed;
    width: 100%;
    z-index: 99;
    opacity: 0;
    transition: opacity 1s ease;
}

.footer.show { opacity: 1; }

.footer .border .border-top {
    border-top: 2px solid #ff4d6d;
    transform-origin: left center;
    animation: border 3s ease forwards;
    box-shadow: 0 0 6px rgba(255, 77, 109, 0.4);
}

.footer .border .border-bottom {
    float: right;
    border-top: 2px solid #ff85a1;
    transform-origin: right center;
    animation: border 2.5s ease 3s forwards;
    box-shadow: 0 0 6px rgba(255, 133, 161, 0.4);
}

@keyframes border {
    0% { width: 0; }
    100% { width: 100%; }
}

.blessing-popup {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 9998;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

.blessing-popup.show {
    opacity: 1;
    pointer-events: auto;
}

.blessing-popup .popup-backdrop {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(ellipse at center, rgba(26,10,46,0.85) 0%, rgba(10,0,20,0.95) 70%);
}

.blessing-popup .popup-card {
    position: relative;
    z-index: 1;
    max-width: 420px;
    width: 85%;
    padding: 48px 36px 40px;
    background: linear-gradient(145deg, rgba(255,77,109,0.12) 0%, rgba(10,0,20,0.9) 50%, rgba(255,133,161,0.08) 100%);
    border: 1px solid rgba(255,77,109,0.3);
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 0 60px rgba(255,77,109,0.2), 0 0 120px rgba(255,77,109,0.1), inset 0 0 30px rgba(255,77,109,0.05);
    transform: scale(0.7) translateY(30px);
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s ease;
    opacity: 0;
}

.blessing-popup.show .popup-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.popup-heart-icon {
    margin-bottom: 20px;
    animation: popupHeartPulse 1.5s ease-in-out infinite;
}

.popup-heart-icon svg {
    filter: drop-shadow(0 0 12px rgba(255,77,109,0.6));
}

@keyframes popupHeartPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.popup-blessing-text {
    font-size: 28px;
    color: #fff;
    letter-spacing: 3px;
    line-height: 1.6;
    text-shadow: 0 0 20px rgba(255,77,109,0.4), 0 0 40px rgba(255,77,109,0.2);
    margin-bottom: 24px;
    word-break: break-word;
}

.popup-name {
    font-size: 22px;
    color: #ff85a1;
    letter-spacing: 4px;
    text-shadow: 0 0 15px rgba(255,77,109,0.3);
}

.popup-divider {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ff4d6d, transparent);
    margin: 16px auto;
    border-radius: 1px;
}

.popup-sparkles {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    overflow: hidden;
    border-radius: 20px;
}

.popup-sparkle {
    position: absolute;
    width: 4px; height: 4px;
    background: #ff4d6d;
    border-radius: 50%;
    animation: sparkleFloat 3s ease-in-out infinite;
    box-shadow: 0 0 6px rgba(255,77,109,0.6);
}

@keyframes sparkleFloat {
    0%, 100% { opacity: 0; transform: translateY(0) scale(0); }
    20% { opacity: 1; transform: translateY(-10px) scale(1); }
    80% { opacity: 0.6; transform: translateY(-40px) scale(0.5); }
    100% { opacity: 0; transform: translateY(-60px) scale(0); }
}

@media (max-width: 768px) {
    :root {
        --block-size: 28px;
        --love-w: 364px;
        --love-h: 308px;
        --love-ml: -154px;
        --love-mt: -182px;
        --boy-size: 150px;
        --boy-left: 10px;
        --boy-bottom: 60px;
        --heart-size: 110;
        --name-font: 30px;
        --text-font: 22px;
        --rise-dist: 120;
    }

    .start-content input {
        font-size: 18px;
        width: 200px;
    }

    .start-btn {
        padding: 8px 36px;
        font-size: 18px;
    }

    .blessing-item {
        letter-spacing: 1px;
        white-space: normal;
        padding: 0 20px;
    }

    .boy-emoji {
        font-size: 56px;
    }

    .popup-card {
        padding: 36px 28px 32px;
    }

    .popup-blessing-text {
        font-size: 24px;
        letter-spacing: 2px;
    }

    .popup-name {
        font-size: 20px;
    }

    .footer {
        bottom: 16px;
    }
}

@media (max-width: 480px) {
    :root {
        --block-size: 22px;
        --love-w: 286px;
        --love-h: 242px;
        --love-ml: -121px;
        --love-mt: -143px;
        --boy-size: 120px;
        --boy-left: 5px;
        --boy-bottom: 50px;
        --heart-size: 85;
        --name-font: 24px;
        --text-font: 18px;
        --rise-dist: 90;
    }

    .start-heart-icon svg {
        width: 52px;
        height: 52px;
    }

    .start-content {
        gap: 18px;
    }

    .start-content input {
        font-size: 16px;
        width: 180px;
        padding: 6px 16px;
    }

    .start-content input::placeholder {
        font-size: 15px;
    }

    .start-btn {
        padding: 8px 30px;
        font-size: 16px;
        letter-spacing: 4px;
    }

    .blessing-container {
        bottom: 8%;
        height: 60px;
    }

    .boy-emoji {
        font-size: 44px;
    }

    .popup-card {
        padding: 28px 20px 24px;
    }

    .popup-blessing-text {
        font-size: 20px;
        letter-spacing: 1px;
    }

    .popup-name {
        font-size: 18px;
        letter-spacing: 2px;
    }

    .popup-heart-icon svg {
        width: 36px;
        height: 36px;
    }

    .footer {
        bottom: 10px;
    }

    .footer .border .border-top,
    .footer .border .border-bottom {
        border-top-width: 1px;
    }
}

@media (max-width: 360px) {
    :root {
        --block-size: 18px;
        --love-w: 234px;
        --love-h: 198px;
        --love-ml: -99px;
        --love-mt: -117px;
        --boy-size: 100px;
        --boy-left: 2px;
        --boy-bottom: 40px;
        --heart-size: 70;
        --name-font: 20px;
        --text-font: 16px;
        --rise-dist: 70;
    }

    .boy-emoji {
        font-size: 36px;
    }
}
