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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #ffd1ff 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Floating background hearts */
.floating-hearts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.floating-heart {
    position: absolute;
    bottom: -50px;
    width: 30px;
    height: 30px;
    background: rgba(255, 105, 180, 0.3);
    transform: rotate(45deg);
    animation: float-up 8s infinite ease-in;
    animation-delay: var(--delay);
    left: var(--x);
}

.floating-heart::before,
.floating-heart::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    background: rgba(255, 105, 180, 0.3);
    border-radius: 50%;
}

.floating-heart::before {
    top: -15px;
    left: 0;
}

.floating-heart::after {
    top: 0;
    left: -15px;
}

@keyframes float-up {
    0% {
        bottom: -50px;
        opacity: 0;
        transform: rotate(45deg) scale(0.5);
    }
    50% {
        opacity: 0.7;
    }
    100% {
        bottom: 110vh;
        opacity: 0;
        transform: rotate(45deg) scale(1.2);
    }
}

/* Main container */
.container {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.container.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

/* Heart container and main heart */
.heart-container {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
    width: 200px;
    height: 200px;
}

.heart-container:hover {
    transform: scale(1.1);
}

.heart-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Pacifico', cursive;
    font-size: 2.2rem;
    color: #fff;
    text-shadow: 3px 3px 10px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 255, 255, 0.5);
    pointer-events: none;
    z-index: 10;
    white-space: nowrap;
    animation: pulse-text 2s infinite ease-in-out;
    letter-spacing: 1px;
}

@keyframes pulse-text {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }
}

.heart {
    position: relative;
    width: 200px;
    height: 200px;
    animation: heartbeat 1.5s infinite ease-in-out;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.heart::before,
.heart::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 160px;
    background: linear-gradient(135deg, #ff6b9d 0%, #ff4d7d 50%, #ff1f68 100%);
    border-radius: 50px 50px 0 0;
    filter: drop-shadow(0 15px 30px rgba(255, 20, 147, 0.5));
}

.heart::before {
    left: 100px;
    transform: rotate(-45deg);
    transform-origin: 0 100%;
}

.heart::after {
    left: 0;
    transform: rotate(45deg);
    transform-origin: 100% 100%;
}

.heart-pulse {
    position: absolute;
    top: 0;
    left: 0;
    width: 200px;
    height: 200px;
    animation: pulse-ring 2s infinite ease-out;
    pointer-events: none;
}

.heart-pulse::before,
.heart-pulse::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 160px;
    border: 3px solid rgba(255, 255, 255, 0.9);
    border-radius: 50px 50px 0 0;
}

.heart-pulse::before {
    left: 100px;
    transform: rotate(-45deg);
    transform-origin: 0 100%;
}

.heart-pulse::after {
    left: 0;
    transform: rotate(45deg);
    transform-origin: 100% 100%;
}

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

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* Message container */
.message-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.message-container.active {
    opacity: 1;
    visibility: visible;
}

.message-content {
    position: relative;
    background: linear-gradient(135deg, rgba(255, 238, 248, 0.95) 0%, rgba(255, 224, 240, 0.95) 100%);
    border-radius: 30px;
    padding: 50px;
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(255, 20, 147, 0.5);
    transform: scale(0.5) rotateX(90deg);
    transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.message-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 30px;
    z-index: 0;
    opacity: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    animation: messageSlideshow 35s infinite;
}

@keyframes messageSlideshow {
    0% {
        background-image: url('photo1.jpg');
        opacity: 0.15;
    }
    12% {
        opacity: 0.15;
    }
    14.28% {
        opacity: 0;
        background-image: url('photo2.jpg');
    }
    26.28% {
        opacity: 0.15;
    }
    28.56% {
        opacity: 0;
        background-image: url('photo3.jpg');
    }
    40.56% {
        opacity: 0.15;
    }
    42.84% {
        opacity: 0;
        background-image: url('photo4.jpg');
    }
    54.84% {
        opacity: 0.15;
    }
    57.12% {
        opacity: 0;
        background-image: url('photo5.jpg');
    }
    69.12% {
        opacity: 0.15;
    }
    71.4% {
        opacity: 0;
        background-image: url('photo6.jpg');
    }
    83.4% {
        opacity: 0.15;
    }
    85.68% {
        opacity: 0;
        background-image: url('photo7.jpg');
    }
    97.68% {
        opacity: 0.15;
    }
    100% {
        opacity: 0;
    }
}

.message-container.active .message-content {
    transform: scale(1) rotateX(0deg);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #ff6b9d, #c06c84);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 20px rgba(255, 20, 147, 0.4);
    transition: all 0.3s ease;
    z-index: 10;
}

.close-btn:hover {
    transform: rotate(90deg) scale(1.1);
    background: linear-gradient(135deg, #c06c84, #ff6b9d);
}

.message-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.message-header h2 {
    font-family: 'Dancing Script', cursive;
    font-size: 2.8rem;
    background: linear-gradient(135deg, #ff6b9d, #c06c84);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbow-text 3s infinite ease-in-out;
}

@keyframes rainbow-text {
    0%, 100% {
        filter: hue-rotate(0deg);
    }
    50% {
        filter: hue-rotate(20deg);
    }
}

.message-body {
    line-height: 1.8;
    position: relative;
    z-index: 1;
}

.message-section {
    margin-bottom: 25px;
    opacity: 0;
    animation: fade-in-up 0.8s forwards;
    position: relative;
    z-index: 1;
}

.message-container.active .message-section:nth-child(1) {
    animation-delay: 0.3s;
}

.message-container.active .message-section:nth-child(2) {
    animation-delay: 0.5s;
}

.message-container.active .message-section:nth-child(3) {
    animation-delay: 0.7s;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-text {
    font-size: 1.2rem;
    color: #5a3a4a;
    text-align: center;
    line-height: 1.8;
}

.message-footer {
    margin-top: 40px;
    text-align: right;
    opacity: 0;
    animation: fade-in-up 0.8s forwards 0.9s;
    position: relative;
    z-index: 1;
}

.signature {
    font-size: 1.3rem;
    color: #ff6b9d;
    font-style: italic;
    margin: 5px 0;
}

.signature-name {
    font-size: 1.8rem;
    font-weight: bold;
    background: linear-gradient(135deg, #ff6b9d, #c06c84);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Bubbly hearts */
.bubbly-hearts {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    border-radius: 30px;
}

.bubble-heart {
    position: absolute;
    font-size: 2rem;
    opacity: 0;
    animation: bubble-float 4s infinite ease-in-out;
}

.bubble-heart:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
}

.bubble-heart:nth-child(2) {
    left: 25%;
    animation-delay: 1s;
}

.bubble-heart:nth-child(3) {
    left: 50%;
    animation-delay: 2s;
}

.bubble-heart:nth-child(4) {
    left: 70%;
    animation-delay: 0.5s;
}

.bubble-heart:nth-child(5) {
    left: 85%;
    animation-delay: 1.5s;
}

.bubble-heart:nth-child(6) {
    left: 40%;
    animation-delay: 2.5s;
}

@keyframes bubble-float {
    0% {
        bottom: -30px;
        opacity: 0;
        transform: translateX(0) rotate(0deg);
    }
    50% {
        opacity: 0.8;
        transform: translateX(30px) rotate(180deg);
    }
    100% {
        bottom: 100%;
        opacity: 0;
        transform: translateX(-30px) rotate(360deg);
    }
}

/* Scrollbar styling */
.message-content::-webkit-scrollbar {
    width: 10px;
}

.message-content::-webkit-scrollbar-track {
    background: rgba(255, 182, 193, 0.3);
    border-radius: 10px;
}

.message-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ff6b9d, #c06c84);
    border-radius: 10px;
}

.message-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #c06c84, #ff6b9d);
}

/* Responsive design */
@media (max-width: 768px) {
    .heart-text {
        font-size: 1.6rem;
    }
    
    .heart-container {
        width: 160px;
        height: 160px;
    }
    
    .heart {
        width: 160px;
        height: 160px;
    }
    
    .heart::before,
    .heart::after {
        width: 80px;
        height: 128px;
    }
    
    .heart::before {
        left: 80px;
    }
    
    .heart::after {
        left: 0;
    }
    
    .heart-pulse {
        width: 160px;
        height: 160px;
    }
    
    .heart-pulse::before,
    .heart-pulse::after {
        width: 80px;
        height: 128px;
    }
    
    .heart-pulse::before {
        left: 80px;
    }
    
    .heart-pulse::after {
        left: 0;
    }
    
    .message-content {
        padding: 30px;
    }
    
    .message-header h2 {
        font-size: 1.8rem;
    }
    
    .message-text {
        font-size: 1rem;
    }
}
