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

body {
    background-color: #fff9fc;
    background-image: 
        linear-gradient(rgba(241, 91, 181, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(241, 91, 181, 0.04) 1px, transparent 1px);
    background-size: 25px 25px; 
    font-family: 'Quicksand', sans-serif;
    overflow: hidden; 
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    color: #4a4a4a;
}

body::before {
    content: '';
    position: fixed;
    top:0; left:0; right:0; bottom:0;
    background: radial-gradient(circle at 10% 20%, #ffe0e9 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, #ffd6e4 0%, transparent 40%),
                radial-gradient(circle at 50% 50%, #fff9e6 0%, transparent 60%);
    z-index: -1;
}

#floating-elements-container {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 0;
    pointer-events: none;
}

.screen {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: scale(0.96) translateY(20px);
    z-index: 10;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

.screen.exit {
    opacity: 0;
    transform: scale(1.04) translateY(-20px);
}

.screen-header {
    text-align: center;
    margin-bottom: 20px;
    z-index: 20;
}

.card-wrapper {
    background: #fffcf9; 
    border-radius: 30px;
    box-shadow: 0 20px 50px rgba(241, 91, 181, 0.12);
    padding: 40px 30px;
    width: 90vw;
    max-width: 680px; 
    max-height: 85vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.letter-wrapper {
    background: #fdf5e6; 
    border: 1px solid #fae1d4;
    padding: 30px;
}

.mac-dots {
    position: absolute;
    top: 20px; left: 25px;
    display: flex; gap: 8px;
}
.mac-dots .dot {
    width: 14px; height: 14px; border-radius: 50%;
}
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.card-top-text {
    position: absolute;
    top: 18px;
    width: 100%;
    left: 0;
    text-align: center;
    font-size: 0.95rem;
    color: #888;
    font-weight: 700;
}

.pink-title {
    font-family: 'Fraunces', serif;
    font-size: 3.2rem;
    color: #f15bb5;
    line-height: 1.2;
    margin-bottom: 10px;
}
.pink-title-small {
    font-family: 'Fraunces', serif;
    font-size: 2.2rem;
    color: #f15bb5;
}
.subtitle-text {
    font-size: 1.1rem;
    color: #888;
    font-weight: 600;
}

.body-text {
    font-size: 1.15rem;
    color: #555;
    line-height: 1.6;
    max-width: 85%;
    font-weight: 600;
}

.pink-highlight {
    font-size: 1.2rem;
    color: #f15bb5;
    font-weight: 700;
}

.pink-text { color: #f15bb5 !important; }
.text-right { text-align: right; width: 100%; }

.pink-pill-btn {
    background: #f15bb5; 
    color: white;
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    padding: 12px 45px;
    border-radius: 40px;
    border: none;
    box-shadow: 0 8px 15px rgba(241, 91, 181, 0.35);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 20;
}
.pink-pill-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 20px rgba(241, 91, 181, 0.45);
}
.pink-pill-btn:active {
    transform: translateY(1px);
}

.outline-btn {
    background: transparent; 
    color: #f15bb5;
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    padding: 10px 40px;
    border-radius: 40px;
    border: 2px solid #f15bb5;
    cursor: pointer;
}
.btn-group { display: flex; gap: 15px; }
.tricky-btn { position: relative; transition: all 0.2s ease; }

.letter-inner {
    background: white;
    border-radius: 20px;
    padding: 25px 30px; /* Reduced padding to give text more horizontal space */
    width: 100%;
    box-shadow: 0 10px 25px rgba(0,0,0,0.03);
    text-align: left;
    margin-top: 10px;
    position: relative;
    z-index: 5;
}
.letter-header {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    color: #666;
    border-bottom: 2px solid #f9f9f9;
    padding-bottom: 15px;
    margin-bottom: 20px;
    font-size: 1.1rem;
}
.icon-circle {
    background: #f15bb5;
    color: white;
    width: 30px; height: 30px;
    display: flex; justify-content: center; align-items: center;
    border-radius: 50%;
    font-size: 0.9rem;
}
.handwriting {
    font-family: 'Caveat', cursive;
    font-size: 1.55rem; /* Slightly smaller for much better readability */
    color: #444;
    line-height: 1.6; /* Better breathing room between lines */
    letter-spacing: 0.5px;
}
.stamp-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 25px;
}
.cute-stamp {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px dashed #ffb3c6;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #f15bb5;
    font-size: 1.2rem;
    transform: rotate(-15deg);
    opacity: 0.6;
}

.corner-decor { position: absolute; z-index: 10; pointer-events: none; }
.top-right { top: -20px; right: -20px; }
.bottom-left { bottom: -20px; left: -10px; }
.bottom-right { bottom: -20px; right: -20px; }
.top-right-overlap { top: -15px; right: -10px; z-index: 15; }

.footer-text {
    position: absolute;
    bottom: 20px;
    font-weight: 700;
    color: #888;
    font-size: 0.95rem;
}

.gif-large {
    max-width: 80%;
    max-height: 25vh;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.scrapbook-photo {
    background: #fff;
    padding: 10px 10px 30px 10px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    object-fit: cover;
    border: 1px solid #f0f0f0;
}

/* Original Stack for Kisses section (as requested) */
.photo-stack {
    position: relative;
    width: 100%;
    height: 35vh;
    display: flex;
    justify-content: center;
    align-items: center;
}
.photo-stack .scrapbook-photo {
    width: 250px;
    aspect-ratio: 4 / 5;
    height: auto;
    max-width: 70vw;
}
.photo-stack .tilt-left { transform: rotate(-5deg); position: absolute; left: 12%; }
.photo-stack .tilt-right { transform: rotate(5deg); position: absolute; right: 12%; }

/* NEW Layout: Side-by-side perfectly aligned (no overlap) */
.photo-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 15px; /* Spaces them out perfectly */
    width: 100%;
}
.photo-row .scrapbook-photo {
    position: relative;
    left: auto;
    right: auto;
    width: 220px; /* Fixed width */
    aspect-ratio: 4 / 5; /* Forces perfectly uniform polaroids! */
    height: auto;
    max-width: 40vw; /* Keeps them safely within mobile bounds */
    z-index: 1;
    transition: transform 0.3s ease, z-index 0s;
    cursor: pointer;
}
.photo-row .tilt-left { transform: rotate(-4deg); }
.photo-row .tilt-right { transform: rotate(4deg); }

/* Awesome interactive Jugad: Hovering makes it pop out */
.photo-row .scrapbook-photo:hover {
    transform: scale(1.15) rotate(0deg);
    z-index: 10;
}

.music-player {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 15px;
}
#record-player { width: 100px; transition: transform 1s ease; }
.spin-record { animation: spin 3s linear infinite; }
.top-text-img { width: 70%; max-height: 70px; object-fit: contain; }

.mt-1 { margin-top: 15px; }
.mt-2 { margin-top: 25px; }
.mt-3 { margin-top: 40px; }
.hidden { display: none !important; }

@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes pop-in { 0% { transform: scale(0); } 80% { transform: scale(1.1); } 100% { transform: scale(1); } }
@keyframes wobble { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
.pop-in { animation: pop-in 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.wobble { animation: wobble 3s ease-in-out infinite; }

.floating-bg-element {
    position: absolute;
    pointer-events: none;
    animation: floatBg 15s linear infinite;
    opacity: 0.6;
}
@keyframes floatBg {
    0% { transform: translateY(110vh) rotate(0deg); }
    100% { transform: translateY(-10vh) rotate(360deg); }
}

.floating-emoji {
    position: fixed;
    font-size: 2.5rem;
    pointer-events: none;
    z-index: 999;
}
.falling { animation: fallDown linear forwards; }
.rising { animation: floatUp linear forwards; }

@keyframes fallDown {
    0% { transform: translateY(-20vh) scale(0.5) rotate(0deg); opacity: 1; }
    100% { transform: translateY(120vh) scale(1.5) rotate(360deg); opacity: 0; }
}

@keyframes floatUp {
    0% { transform: translateY(0) scale(1) rotate(-10deg); opacity: 1; }
    100% { transform: translateY(-400px) scale(2) rotate(20deg); opacity: 0; }
}

/* NEW INTERACTIVE CAKE */
.interactive-cake {
    position: relative;
    font-size: 130px;
    width: 150px; height: 160px;
    cursor: pointer;
    margin-top: 20px;
    z-index: 15;
}
.cake-half {
    position: absolute;
    top: 0; left: 0;
    transition: transform 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.left-half { clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%); }
.right-half { clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%); }

.interactive-cake.cut .left-half {
    transform: translateX(-40px) rotate(-15deg);
}
.interactive-cake.cut .right-half {
    transform: translateX(40px) rotate(15deg);
}

/* NEW GIFT BOX */
.gift-container {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    width: 80%;
    min-height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    border: 2px dashed #f15bb5;
    transition: all 0.3s ease;
}
.gift-container:hover { transform: scale(1.05); }
.gift-container.opened { cursor: default; border-style: solid; }
.gift-emoji { font-size: 80px; }

.shake {
    animation: shakeBox 0.5s cubic-bezier(.36,.07,.19,.97) both infinite;
}
@keyframes shakeBox {
    0%, 100% { transform: translateX(0) rotate(0); }
    25% { transform: translateX(-10px) rotate(-10deg); }
    75% { transform: translateX(10px) rotate(10deg); }
}

.fade-in { animation: fadeIn 1s ease forwards; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* FLOATING MUSIC TOGGLE BUTTON */
.floating-music-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border: 2px solid #f15bb5;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(241, 91, 181, 0.3);
    transition: all 0.3s ease;
    color: #f15bb5;
}
.floating-music-btn:hover {
    transform: scale(1.1);
    background: #fdf5e6;
}

/* RESPONSIVE DESIGN (Tablets & Mobile) */
@media (max-width: 768px) {
    .screen {
        justify-content: flex-start;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 40px 10px; /* Padding creates breathing room when scrolled */
    }
    
    .screen::-webkit-scrollbar { width: 5px; }
    .screen::-webkit-scrollbar-thumb { background-color: #f15bb5; border-radius: 5px; }

    .card-wrapper {
        margin: auto; /* Magic vertical centering when content is smaller than viewport */
        max-height: none; 
        height: auto;
        width: 95vw;
        padding: 30px 20px;
    }

    /* Force override inline font-sizes in HTML for mobile */
    .pink-title, .pink-title[style] { font-size: 2.2rem !important; line-height: 1.2 !important; margin-top: 15px !important; }
    .pink-title-small, .pink-title-small[style] { font-size: 1.6rem !important; }
    .body-text, .body-text[style] { font-size: 1.1rem !important; }
    
    .handwriting, .handwriting[style] { font-size: 1.35rem !important; line-height: 1.4 !important; }
    
    .letter-inner { padding: 20px 15px; }
    
    .pink-pill-btn { padding: 12px 30px; font-size: 1rem; }
    .btn-group { flex-direction: column; gap: 10px; }
    
    .photo-row { gap: 10px; }
    .photo-row .scrapbook-photo { width: 140px; }
    .photo-stack .scrapbook-photo { width: 180px; }
    
    .interactive-cake { font-size: 100px; width: 120px; height: 120px; margin-top: 10px; }
    
    .gift-container { width: 95%; padding: 20px; min-height: 150px; }
    .gift-emoji { font-size: 60px; }
    
    .stamp-container { flex-direction: column; align-items: flex-end; gap: 5px; margin-top: 15px; }
    .cute-stamp { width: 40px; height: 40px; font-size: 1rem; }
    
    .top-right-overlap { right: -15px; top: -10px; width: 80px !important; }
    .gif-large { max-height: 20vh; }
    
    #screen-9 .pink-title[style] { font-size: 3rem !important; margin-top: 10px !important; }
    #screen-6 .pink-title[style] { font-size: 2.8rem !important; }
}

@media (max-width: 480px) {
    .pink-title, .pink-title[style] { font-size: 1.9rem !important; }
    .photo-row .scrapbook-photo { width: 130px; }
    .photo-stack .scrapbook-photo { width: 150px; }
    .card-top-text { font-size: 0.85rem; top: 12px; }
    .mac-dots { top: 12px; left: 15px; }
    .letter-inner { padding: 15px 10px; }
}
