
html, body {
    background: #0a0512 !important;
    color-scheme: dark;
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    font-family: "Mali", Arial, sans-serif;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
}

body {
    background: #0a0512;
    background: radial-gradient(ellipse at center bottom, #2d1b4e 0%, #1a0a2e 30%, #0a0512 70%, #050208 100%);
}

canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    display: block;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

@media screen and (max-width: 768px) {
    canvas {
        max-width: 100vw;
        max-height: 100vh;
    }
    * {
        touch-action: manipulation;
    }
}

#musicToggle {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    display: block;
    cursor: pointer;
    z-index: 999;
    transition: transform 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

#musicToggle:hover {
    transform: scale(1.08);
}

#musicToggle:active {
    transform: scale(0.94);
}

#musicToggle .cd-disc {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    pointer-events: none;
    background:
        radial-gradient(circle, #0b0b0f 0 9%, #fd9595 9.5% 22%, rgba(255, 255, 255, 0.35) 22.5% 24%, transparent 24.5%),
        repeating-radial-gradient(circle, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 3px),
        conic-gradient(from 20deg, #2a2a33, #6b5a7a, #2a2a33, #8a6f88, #2a2a33, #5d6b8a, #2a2a33);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18), 0 3px 10px rgba(0, 0, 0, 0.55), 0 0 12px rgba(253, 149, 149, 0.25);
    animation: lemyCdSpin 3s linear infinite;
    animation-play-state: paused;
}

#musicToggle .cd-disc::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.35), transparent 40%, transparent 60%, rgba(255, 255, 255, 0.15));
}

#musicToggle.playing .cd-disc {
    animation-play-state: running;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25), 0 3px 10px rgba(0, 0, 0, 0.55), 0 0 16px rgba(253, 149, 149, 0.55);
}

@keyframes lemyCdSpin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    #musicToggle .cd-disc {
        animation-duration: 8s;
    }
}

/* Shooting Stars */
.shooting-stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

@keyframes shooting-star-opacity {
    0% { opacity: 0; }
    40% { opacity: 1; }
    60% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes shooting-star-pos {
    0% { transform: scale(0) rotate(0) translate3d(0, 0, 0); }
    100% { transform: scale(1) rotate(0) translate3d(-450px, 450px, 0); }
}

.shooting-star {
    display: block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #fff;
    position: absolute;
    transform-origin: 100% 0;
    animation: shooting-star-opacity 6s infinite ease-in, shooting-star-pos 6s infinite ease-in;
    box-shadow: 0 0 8px 3px rgba(255, 255, 255, 0.4);
    opacity: 0;
}

.shooting-star:after {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 3px;
    border: 0 solid #fff;
    border-width: 0 80px 1.5px;
    border-color: transparent transparent transparent rgba(255, 255, 255, 0.4);
    transform: rotate(-45deg) translate3d(1px, 2px, 0);
    box-shadow: 0 0 2px 0 rgba(255, 255, 255, 0.2);
    transform-origin: 0% 100%;
}

#text-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.floating-text {
    position: absolute;
    transform: translate(-50%, -50%) scale(1);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.27), opacity 0.3s;
    font-weight: 500;
    font-size: 14px;
    color: white;
    width: 300px;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
    will-change: transform, opacity;
    pointer-events: auto;
    cursor: grab;
    touch-action: none;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 5px 10px;
    border-radius: 5px;
    box-sizing: border-box;
    max-width: 80vw;
}

.floating-image {
    position: absolute;
    width: 35px;
    height: 35px;
    object-fit: cover;
    background: transparent;
    box-shadow: none;
    border: none;
    pointer-events: auto;
    cursor: grab;
    border-radius: 5px;
    transform: translate(-50%, -50%) scale(1);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.27), opacity 0.3s;
    user-select: none;
    will-change: transform, opacity;
    -webkit-user-drag: none;
    touch-action: none;
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    background-color: transparent;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    cursor: zoom-out;
    object-fit: contain;
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.modal-close-btn i {
    font-size: 20px;
    color: #333;
}

.modal-close-btn:hover {
    background-color: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .modal-content {
        max-width: 95%;
        max-height: 85%;
        padding: 10px;
    }
    .modal-content img {
        width: 100%;
        height: auto;
        max-height: 80vh;
        object-fit: contain;
    }
    .modal-close-btn {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
    }
}

/* Tap Hint */
.tap-hint {
    position: fixed;
    bottom: 25%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    animation: fadeInHint 1s ease-out 4s forwards;
}

.tap-hint-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.tap-hint-icon {
    width: 50px;
    height: 50px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: tapPulse 1.5s ease-in-out infinite;
    background: rgba(255, 105, 180, 0.2);
    backdrop-filter: blur(5px);
}

.tap-hint-icon::before {
    content: '';
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
}

.tap-hint-text {
    font-family: 'Mali', sans-serif;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    animation: textGlow 2s ease-in-out infinite;
}

.tap-hint-arrow {
    font-size: 24px;
    color: rgba(255, 255, 255, 0.8);
    animation: bounceArrow 1s ease-in-out infinite;
}

@keyframes fadeInHint {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes tapPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(255, 105, 180, 0.4);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 30px rgba(255, 105, 180, 0.7);
    }
}

@keyframes textGlow {
    0%, 100% { text-shadow: 0 2px 10px rgba(255, 105, 180, 0.3); }
    50% { text-shadow: 0 2px 20px rgba(255, 105, 180, 0.8); }
}

@keyframes bounceArrow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.tap-hint.hidden {
    animation: fadeOutHint 0.5s ease-out forwards;
}

@keyframes fadeOutHint {
    from { opacity: 1; }
    to { opacity: 0; visibility: hidden; }
}

@media screen and (max-width: 768px) {
    .tap-hint {
        bottom: 20%;
    }
    .tap-hint-icon {
        width: 45px;
        height: 45px;
    }
    .tap-hint-text {
        font-size: 14px;
    }
}
/* ==================== CUPID ON MAIN PAGE ==================== */
#cupid-container {
    position: fixed;
    left: 2%;
    top: 5%;
    z-index: 500;
    pointer-events: none;
}
#cupid-img {
    width: clamp(110px, 24vw, 190px);
    cursor: pointer;
    pointer-events: auto;
    transform: scaleX(-1) rotate(-20deg);
    animation: cupidFloat 3s ease-in-out infinite, cupidEnter 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) both, cupidGlow 2s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(255, 105, 180, 0.5));
    -webkit-user-drag: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
@keyframes cupidGlow {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(255, 105, 180, 0.5)) drop-shadow(0 0 40px rgba(255, 20, 147, 0.3)); }
    50% { filter: drop-shadow(0 0 35px rgba(255, 105, 180, 0.8)) drop-shadow(0 0 60px rgba(255, 20, 147, 0.5)); }
}
@keyframes cupidFloat {
    0%, 100% { transform: scaleX(-1) translateY(0) rotate(-20deg); }
    50% { transform: scaleX(-1) translateY(-15px) rotate(-17deg); }
}
@keyframes cupidEnter {
    from { transform: scaleX(-1) translateX(150%) scale(0.3) rotate(-20deg); opacity: 0; }
    to { transform: scaleX(-1) translateX(0) scale(1) rotate(-20deg); opacity: 1; }
}
@keyframes cupidShoot {
    0% { transform: scaleX(-1) rotate(-20deg) scale(1); }
    20% { transform: scaleX(-1) rotate(-25deg) scale(1.08) translateX(10px); }
    50% { transform: scaleX(-1) rotate(-15deg) scale(0.95) translateX(-15px); }
    100% { transform: scaleX(-1) rotate(-20deg) scale(1) translateX(0); }
}
#cupid-img.bye {
    animation: cupidBye 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes cupidBye {
    0% { transform: scaleX(-1) rotate(-20deg) scale(1); opacity: 1; }
    30% { transform: scaleX(-1) rotate(-10deg) scale(1.1) translateY(-20px); opacity: 1; }
    100% { transform: scaleX(-1) rotate(10deg) scale(0.2) translateY(-200px) translateX(100px); opacity: 0; }
}
/* Floating hearts around Cupid */
.cupid-hearts {
    position: absolute;
    width: 200px;
    height: 200px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.cupid-heart {
    position: absolute;
    font-size: 20px;
    opacity: 0;
    animation: floatHeart 3s ease-in-out infinite;
}
.cupid-heart:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; }
.cupid-heart:nth-child(2) { left: 80%; top: 30%; animation-delay: 0.5s; }
.cupid-heart:nth-child(3) { left: 20%; top: 70%; animation-delay: 1s; }
.cupid-heart:nth-child(4) { left: 70%; top: 60%; animation-delay: 1.5s; }
.cupid-heart:nth-child(5) { left: 50%; top: 10%; animation-delay: 2s; }
@keyframes floatHeart {
    0%, 100% { opacity: 0; transform: translateY(0) scale(0.5); }
    20% { opacity: 0.8; transform: translateY(-10px) scale(1); }
    80% { opacity: 0.8; transform: translateY(-30px) scale(1); }
    100% { opacity: 0; transform: translateY(-50px) scale(0.5); }
}
/* Sparkles around Cupid */
.cupid-sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px #fff, 0 0 20px #ff69b4;
    opacity: 0;
    animation: sparkle 2s ease-in-out infinite;
}
.cupid-sparkle:nth-child(1) { left: 5%; top: 15%; animation-delay: 0s; }
.cupid-sparkle:nth-child(2) { left: 90%; top: 25%; animation-delay: 0.3s; }
.cupid-sparkle:nth-child(3) { left: 15%; top: 80%; animation-delay: 0.6s; }
.cupid-sparkle:nth-child(4) { left: 85%; top: 70%; animation-delay: 0.9s; }
.cupid-sparkle:nth-child(5) { left: 50%; top: 5%; animation-delay: 1.2s; }
.cupid-sparkle:nth-child(6) { left: 30%; top: 50%; animation-delay: 1.5s; }
@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(0); }
    50% { opacity: 1; transform: scale(1.5); }
}
/* Touch indicator for Cupid */
.cupid-touch-hint {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: bounceHint 1.5s ease-in-out infinite;
}
.cupid-touch-hint .arrow-up {
    font-size: 24px;
    color: #ff69b4;
    text-shadow: 0 0 10px rgba(255, 105, 180, 0.8);
    animation: arrowPulse 1s ease-in-out infinite;
}
.cupid-touch-hint .hint-text {
    font-family: 'Mali', sans-serif;
    font-size: 14px;
    color: white;
    background: rgba(255, 105, 180, 0.3);
    padding: 5px 15px;
    border-radius: 20px;
    white-space: nowrap;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 105, 180, 0.5);
}
@keyframes bounceHint {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}
@keyframes arrowPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
#flying-arrow {
    position: fixed;
    width: clamp(60px, 10vw, 100px);
    z-index: 510;
    opacity: 0;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}
#cupid-hint {
    position: fixed;
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    opacity: 0;
    animation: cupidHintPulse 2.5s ease-in-out infinite, cupidHintEnter 1s ease-out 1.5s forwards;
}
#cupid-hint span {
    font-family: 'Mali', sans-serif;
    font-size: clamp(12px, 3vw, 16px);
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 0 15px rgba(255, 105, 180, 0.5);
    background: rgba(255, 105, 180, 0.15);
    padding: 8px 22px;
    border-radius: 30px;
    border: 1px solid rgba(255, 105, 180, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    white-space: nowrap;
}
@keyframes cupidHintPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}
@keyframes cupidHintEnter {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 0.8; transform: translateX(-50%) translateY(0); }
}
#cupid-hint.hidden {
    opacity: 0 !important;
    transition: opacity 0.4s ease;
    pointer-events: none;
}
#heart-explosion {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 520;
    width: 0;
    height: 0;
}
.explosion-particle {
    position: absolute;
    animation: particleExplode var(--duration, 1s) cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
@keyframes particleExplode {
    0% { transform: translate(0, 0) scale(1) rotate(0deg); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(var(--end-scale, 0.3)) rotate(var(--rot)); opacity: 0; }
}
/* Envelope Overlay - blocks clicks to canvas when envelope is shown */
#envelope-overlay {
    position: fixed;
    inset: 0;
    z-index: 519;
    background: radial-gradient(circle at 50% 45%, rgba(48, 20, 74, 0.96) 0%, rgba(14, 6, 26, 0.97) 55%, rgba(5, 2, 10, 0.98) 100%);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}
#envelope-overlay.show {
    opacity: 1;
    pointer-events: auto;
}
/* Envelope */
#envelope-img {
    position: fixed;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: clamp(180px, 50vw, 280px);
    z-index: 520;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    filter: drop-shadow(0 0 30px rgba(255, 105, 180, 0.6)) drop-shadow(0 0 60px rgba(255, 20, 147, 0.3));
    -webkit-user-drag: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: filter 0.3s ease;
}
#envelope-img.show {
    opacity: 1;
    pointer-events: auto;
    animation: envelopeAppear 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
#envelope-img.show:hover {
    filter: drop-shadow(0 0 40px rgba(255, 105, 180, 0.9)) drop-shadow(0 0 80px rgba(255, 20, 147, 0.5));
}
#envelope-img.open {
    animation: envelopeOpen 0.6s ease-in forwards;
    pointer-events: none;
}
@keyframes envelopeAppear {
    0% { transform: translate(-50%, -50%) scale(0) rotate(-15deg); opacity: 0; }
    60% { transform: translate(-50%, -50%) scale(1.1) rotate(3deg); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
}
@keyframes envelopeBob {
    0%, 100% { transform: translate(-50%, -50%) scale(1) rotate(-1deg); }
    50% { transform: translate(-50%, -50%) scale(1.03) rotate(1deg); }
}
@keyframes envelopeOpen {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.2) rotate(5deg); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(0.3) rotate(-10deg); opacity: 0; }
}
#envelope-hint {
    position: fixed;
    top: calc(45% + clamp(90px, 25vw, 140px) + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 520;
    opacity: 0;
    pointer-events: none;
}
#envelope-hint.show {
    animation: cupidHintEnter 0.6s ease-out 0.5s forwards, cupidHintPulse 2s ease-in-out 1.1s infinite;
    pointer-events: auto;
    cursor: pointer;
}
#envelope-hint span {
    font-family: 'Mali', sans-serif;
    font-size: clamp(12px, 3vw, 16px);
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 0 15px rgba(255, 105, 180, 0.5);
    background: rgba(255, 105, 180, 0.15);
    padding: 8px 22px;
    border-radius: 30px;
    border: 1px solid rgba(255, 105, 180, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    white-space: nowrap;
}
.screen-flash {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle, rgba(255,105,180,0.5), rgba(255,20,147,0.2), transparent);
    z-index: 515;
    pointer-events: none;
    opacity: 0;
}
#love-popup {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.7);
    transition: opacity 0.5s ease;
}
#love-popup.active {
    opacity: 1;
    pointer-events: auto;
}
.popup-card {
    position: relative;
    background: linear-gradient(145deg, #fdf8f0, #f9f3e8, #fef9f2);
    border-radius: 20px;
    padding: 25px 30px 30px;
    width: min(500px, 90vw);
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 200, 180, 0.3);
    transform: scale(0.3) translateY(40px);
    transition: transform 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#love-popup.active .popup-card {
    transform: scale(1) translateY(0);
}
.popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #666;
    transition: all 0.3s ease;
    z-index: 10;
}
.popup-close:hover {
    background: rgba(255, 100, 100, 0.2);
    color: #e74c3c;
    transform: scale(1.1);
}
.popup-title {
    font-family: 'Pacifico', cursive;
    font-size: clamp(22px, 5vw, 30px);
    color: #c41e3a;
    text-align: center;
    margin: 0 0 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 10px;
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.popup-title .heart-icon {
    color: #e74c3c;
    font-size: 0.8em;
}
.popup-content {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
.popup-image-container {
    position: relative;
    flex-shrink: 0;
    width: 45%;
}
.popup-image {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}
.popup-heart-decoration {
    position: absolute;
    top: -10px;
    left: -10px;
    font-size: 28px;
    animation: heartBeat 1.5s ease-in-out infinite;
}
@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}
.popup-message-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10px 0;
}
.popup-message {
    font-family: 'Mali', cursive;
    font-size: clamp(14px, 3vw, 17px);
    font-style: italic;
    line-height: 1.8;
    color: #5a4a42;
    margin: 0;
    padding: 15px;
    border-left: 3px solid rgba(200, 150, 120, 0.4);
    background: rgba(255, 255, 255, 0.5);
    border-radius: 0 10px 10px 0;
    min-height: 100px;
    max-height: 200px;
    overflow-y: auto;
    text-align: center;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.popup-message::-webkit-scrollbar {
    width: 6px;
}
.popup-message::-webkit-scrollbar-track {
    background: rgba(200, 150, 120, 0.1);
    border-radius: 3px;
}
.popup-message::-webkit-scrollbar-thumb {
    background: rgba(200, 150, 120, 0.4);
    border-radius: 3px;
}
.popup-message .typewriter {
    display: inline;
}
.popup-message .typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: #5a4a42;
    margin-left: 2px;
    animation: cursorBlink 0.8s infinite;
    vertical-align: text-bottom;
}
@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}
.popup-confetti {
    position: fixed;
    pointer-events: none;
    z-index: 3000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    display: none;
}
.popup-confetti.active {
    display: block;
}
.confetti-piece {
    position: absolute;
    top: -50px;
    border-radius: 3px;
    filter: drop-shadow(0 0 3px rgba(255, 105, 180, 0.5));
    will-change: transform, opacity;
}
@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(var(--fall-distance, 600px)) rotate(var(--fall-rot, 720deg)) scale(0.3);
        opacity: 0;
    }
}
/* Sparkle burst effect khi mở popup */
.popup-sparkle-burst {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}
.sparkle-particle {
    position: absolute;
    font-size: 20px;
    animation: sparkleBurst 1.5s ease-out forwards;
    opacity: 0;
}
@keyframes sparkleBurst {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0);
        opacity: 0;
    }
}
@media (max-width: 500px) {
    .popup-content {
        flex-direction: column;
        align-items: center;
    }
    .popup-image-container {
        width: 70%;
    }
    .popup-message {
        text-align: center;
        border-left: none;
        border-top: 3px solid rgba(200, 150, 120, 0.4);
        border-radius: 0 0 10px 10px;
    }
}

/* ==================== ANTI-COPY / SECURITY ==================== */
html, body, * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}
input, textarea, [contenteditable="true"] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}
img {
    -webkit-user-drag: none;
    pointer-events: auto;
}
@media print {
    html, body { display: none !important; visibility: hidden !important; }
    body::before {
        content: "💝 Nội dung được bảo vệ — không thể in.";
        visibility: visible;
        display: block;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-size: 18px;
        color: #000;
    }
}
    
canvas#effects-overlay { z-index: 2; }
