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

body {
    font-family: 'Comic Sans MS', 'Arial', sans-serif;
    background: linear-gradient(135deg, #ffb3d9, #ffc4e1, #ffe5f0);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

body::before {
    content: '🎀';
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 40px;
    opacity: 0.3;
}

body::after {
    content: '🌸';
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 40px;
    opacity: 0.3;
}

.page {
    display: none;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    overflow-y: auto;
    max-height: 100vh;
}

.page.active {
    display: block;
}

.card {
    background: linear-gradient(135deg, #fff0f5, #ffe4e9);
    border-radius: 30px;
    padding: 30px;
    box-shadow: 0 15px 40px rgba(255, 105, 180, 0.3);
    text-align: center;
    position: relative;
    min-height: auto;
    max-height: none;
    border: 3px solid #ffb3d9;
    margin: 20px auto;
    overflow: visible;
}

.card::before {
    content: '🎀';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    opacity: 0.5;
}

.card::after {
    content: '🌸';
    position: absolute;
    bottom: 10px;
    left: 10px;
    font-size: 24px;
    opacity: 0.5;
}

/* Page 1 Styles */
.header h1 {
    color: #ff1493;
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.header h2 {
    color: #ff69b4;
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.subtitle {
    color: #ff1493;
    font-size: 18px;
    font-style: italic;
    margin: 10px 0 20px 0;
}

.diamond {
    color: #ff69b4;
    font-size: 24px;
}

.message {
    margin: 20px 0;
    line-height: 1.8;
    color: #555;
    text-align: center;
}

.message p {
    margin-bottom: 15px;
}

.diamonds {
    margin: 20px 0;
}

.diamonds .diamond {
    margin: 0 10px;
    font-size: 16px;
}

/* Hugging Girls Container */
.hugging-girls-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
    position: relative;
    min-height: 200px;
}

.hugging-girls-image {
    max-width: 280px;
    max-height: 220px;
    animation: gentleFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 5px 15px rgba(255, 105, 180, 0.4));
    border-radius: 20px;
    object-fit: contain;
}

.hugging-girls-fallback {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: gentleFloat 3s ease-in-out infinite;
}

.girl-left-svg {
    animation: hugLeft 3s ease-in-out infinite;
    transform-origin: center;
}

.girl-right-svg {
    animation: hugRight 3s ease-in-out infinite;
    transform-origin: center;
}

.floating-hearts {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 10;
}

.floating-hearts .heart {
    font-size: 24px;
    animation: floatHeart 2s ease-in-out infinite;
}

.floating-hearts .heart:nth-child(1) {
    animation-delay: 0s;
}

.floating-hearts .heart:nth-child(2) {
    animation-delay: 0.7s;
}

.floating-hearts .heart:nth-child(3) {
    animation-delay: 1.4s;
}

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

@keyframes hugLeft {
    0%, 100% {
        transform: translateX(0) rotate(0deg);
    }
    50% {
        transform: translateX(3px) rotate(2deg);
    }
}

@keyframes hugRight {
    0%, 100% {
        transform: translateX(0) rotate(0deg);
    }
    50% {
        transform: translateX(-3px) rotate(-2deg);
    }
}

@keyframes floatHeart {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateY(-20px) scale(1.3);
        opacity: 0.8;
    }
}

/* Page 2 Styles */
.game-title {
    color: #e74c3c;
    font-size: 20px;
    margin-bottom: 30px;
}

.tic-tac-toe {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 250px;
    margin: 0 auto 30px;
}

.cell {
    width: 70px;
    height: 70px;
    background: #ffeef8;
    border: 2px solid #e74c3c;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cell:hover {
    background: #fce4ec;
    transform: scale(1.05);
}

.cell:empty {
    background: #fff;
}

.hidden {
    display: none;
}

/* Success Popup Styles */
.success-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.success-popup:not(.hidden) {
    display: flex;
    justify-content: center;
    align-items: center;
}

.popup-overlay-chocolate {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

.popup-content-chocolate {
    position: relative;
    background: linear-gradient(135deg, #fff0f5, #ffe4f0);
    border: 4px solid #ff69b4;
    border-radius: 30px;
    padding: 40px 30px;
    max-width: 90%;
    width: 320px;
    text-align: center;
    z-index: 10000;
    box-shadow: 0 20px 60px rgba(255, 105, 180, 0.5);
    animation: popupBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.popup-title-chocolate {
    color: #ff1493;
    font-size: 26px;
    font-weight: bold;
    margin-bottom: 15px;
    animation: bounceIn 0.8s ease;
}

.popup-message-chocolate {
    color: #ff69b4;
    font-size: 18px;
    font-weight: bold;
    line-height: 1.6;
    animation: slideUp 0.8s ease 0.2s both;
}

.popup-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    transition: all 0.3s ease;
}

.popup-close-btn:hover {
    color: #ff1493;
    transform: scale(1.2);
}

/* Confetti Animation */
.confetti-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ff69b4;
    top: -10px;
    animation: confettiFall 3s linear forwards;
}

.confetti-piece:nth-child(2n) {
    background: #ff1493;
}

.confetti-piece:nth-child(3n) {
    background: #ffb3d9;
}

.confetti-piece:nth-child(4n) {
    background: #ffd700;
}

.confetti-piece:nth-child(5n) {
    background: #ff6347;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popupBounce {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes confettiFall {
    0% {
        transform: translateY(-10px) rotateZ(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotateZ(720deg);
        opacity: 0;
    }
}

/* Popup Styling */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-in-out;
}

.popup-overlay.active {
    display: flex;
}

.popup-content {
    background: linear-gradient(135deg, #ffeef8, #fff0f5);
    padding: 40px;
    border-radius: 25px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    position: relative;
    max-width: 350px;
    animation: popupBounce 0.6s ease-out;
    border: 3px solid #e74c3c;
}

.popup-title {
    color: #e74c3c;
    font-size: 24px;
    margin-bottom: 15px;
    animation: bounceIn 0.8s ease-out;
}

.popup-message {
    color: #333;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    animation: slideInUp 0.8s ease-out 0.2s both;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #e74c3c;
}

/* Confetti Animation */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #e74c3c;
    animation: confettiFall 3s linear forwards;
}

.confetti:nth-child(odd) {
    background: #f39c12;
    width: 8px;
    height: 8px;
}

.confetti:nth-child(3n) {
    background: #9b59b6;
    width: 12px;
    height: 12px;
}

.confetti:nth-child(4n) {
    background: #e67e22;
    width: 6px;
    height: 6px;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100px) rotateZ(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(500px) rotateZ(720deg);
        opacity: 0;
    }
}

@keyframes popupBounce {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideInUp {
    0% {
        transform: translateY(30px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Page 3 Styles */
.memories-header h2 {
    color: #e74c3c;
    font-size: 24px;
    margin-bottom: 15px;
}

.camera {
    font-size: 20px;
}

.from-to {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 14px;
    color: #333;
}

.photo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
    gap: 10px;
}

.nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #ffb3d9;
    background: linear-gradient(135deg, #ff99cc, #ffb3d9);
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(255, 105, 180, 0.3);
    transition: all 0.3s ease;
}

.nav-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(255, 105, 180, 0.5);
}

.nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.photo-display {
    flex: 1;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fff0f5, #ffe4f0);
    border: 3px solid #ffb3d9;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(255, 105, 180, 0.2);
    position: relative;
}

.photo-display::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 20px;
    width: 40px;
    height: 20px;
    background: #ffb3d9;
    border-radius: 10px 10px 0 0;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

.photo-display::after {
    content: '🎀';
    position: absolute;
    top: -15px;
    right: 20px;
    font-size: 20px;
}

.memory-photo {
    max-width: 100%;
    width: 100%;
    height: auto;
    border-radius: 15px;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    object-fit: cover;
    max-height: 300px;
}

.photo-caption {
    color: #ff1493;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    margin-top: 10px;
    font-style: italic;
}

.memories-footer {
    margin-top: 20px;
    font-size: 14px;
    color: #333;
}

.date, .valid, .closing {
    margin: 5px 0;
}

/* Page 4 Styles */
.music-title {
    color: #e74c3c;
    font-size: 22px;
    margin-bottom: 20px;
}

.album-art {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, #ffeef8, #ffe0f0);
    border-radius: 20px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border: 3px solid #ff99cc;
    box-shadow: 0 8px 20px rgba(255, 105, 180, 0.3);
}

.song-cover-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 17px;
    animation: fadeIn 0.5s ease-in-out;
}

.hugging-characters {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.character1, .character2 {
    font-size: 48px;
}

.heart {
    position: absolute;
    top: -20px;
    font-size: 24px;
    animation: float 2s infinite;
}

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

.now-playing {
    margin-bottom: 20px;
}

.now-playing p {
    color: #666;
    font-size: 12px;
    margin-bottom: 5px;
}

.now-playing h3 {
    color: #333;
    font-size: 18px;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.time {
    font-size: 12px;
    color: #666;
    min-width: 30px;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    position: relative;
}

.progress-fill {
    width: 20%;
    height: 100%;
    background: #e74c3c;
    border-radius: 2px;
}

.progress-handle {
    position: absolute;
    top: -4px;
    left: 20%;
    width: 12px;
    height: 12px;
    background: #e74c3c;
    border-radius: 50%;
    transform: translateX(-50%);
}

.music-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: #ffeef8;
    color: #e74c3c;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: #e74c3c;
    color: white;
    transform: scale(1.1);
}

.music-nav {
    display: flex;
    justify-content: space-between;
}

.nav-text-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    padding: 10px;
}

/* Page 5 Styles */
.thank-you-header {
    margin-bottom: 30px;
}

.from-bhal {
    color: #666;
    font-size: 12px;
    margin-bottom: 10px;
}

.thank-you-title {
    color: #e74c3c;
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 10px;
}

.thank-you-subtitle {
    color: #333;
    font-size: 18px;
    font-weight: bold;
}

.thank-you-message {
    margin: 30px 0;
    line-height: 1.8;
    color: #555;
}

.thank-you-message p {
    margin: 15px 0;
    font-size: 15px;
}

.love-message {
    font-size: 20px !important;
    font-weight: bold;
    color: #ff1493 !important;
    margin-top: 25px !important;
    text-align: center;
    animation: heartbeat 1.5s ease-in-out infinite;
}

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

.hello-kitty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
}

.last-msg-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #ff99cc;
    object-fit: cover;
    box-shadow: 0 5px 15px rgba(255, 105, 180, 0.4);
    animation: gentleFloat 3s ease-in-out infinite;
}

.kitty {
    font-size: 48px;
}

.kitty-sign {
    background: white;
    border: 2px solid #e74c3c;
    border-radius: 10px;
    padding: 10px 15px;
    font-size: 14px;
    color: #333;
    font-style: italic;
}

.final-footer {
    margin-top: 30px;
    font-size: 12px;
    color: #666;
}

/* Common Button Styles */
/* Button Group Container */
.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.next-btn, .back-btn {
    background: linear-gradient(135deg, #ff99cc, #ffb3d9);
    color: white;
    border: 2px solid #ff80b3;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 105, 180, 0.3);
    flex: 1;
    max-width: 150px;
}

.back-btn {
    background: linear-gradient(135deg, #d4a5ff, #e6b3ff);
    border: 2px solid #c48aff;
}

.next-btn:hover, .back-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px rgba(255, 105, 180, 0.5);
}

.next-btn:hover {
    background: linear-gradient(135deg, #ff80b3, #ff99cc);
}

.back-btn:hover {
    background: linear-gradient(135deg, #c48aff, #d4a5ff);
}

/* Single button centering */
.card > .back-btn {
    margin: 20px auto 0;
    display: block;
    max-width: 150px;
}

/* Responsive Design */
@media (max-width: 480px) {
    .card {
        padding: 20px;
        margin: 10px;
    }
    
    .tic-tac-toe {
        max-width: 200px;
    }
    
    .cell {
        width: 60px;
        height: 60px;
        font-size: 20px;
    }
    
    .album-art {
        width: 180px;
        height: 180px;
    }
    
    .song-cover-image {
        border-radius: 14px;
    }
    
    .character1, .character2 {
        font-size: 36px;
    }
    
    .final-large-photo {
        max-height: 60vh;
        border-radius: 15px;
        border: 3px solid #ff69b4;
    }
    
    .love-from {
        font-size: 20px;
        padding: 10px 20px;
    }
}

/* Page 6: Final Photo Page */
.full-photo-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.final-photo-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.final-large-photo {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 20px;
    border: 5px solid #ff69b4;
    box-shadow: 0 10px 30px rgba(255, 105, 180, 0.5);
    animation: photoZoomIn 1s ease-out;
}

@keyframes photoZoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.final-love-message {
    margin: 30px 0 20px;
    text-align: center;
}

.love-from {
    font-size: 28px;
    font-weight: bold;
    color: #ff1493;
    font-family: 'Comic Sans MS', cursive;
    text-shadow: 2px 2px 4px rgba(255, 105, 180, 0.3);
    animation: heartbeat 1.5s ease-in-out infinite;
    border: 3px solid #ff69b4;
    padding: 15px 30px;
    border-radius: 20px;
    background: linear-gradient(135deg, #fff, #ffe0f0);
    display: inline-block;
}

/* Animation for page transitions */
.page {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
