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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow-x: hidden;
    min-height: 100vh;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    /* Mobile-specific body optimizations */
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Starry Background */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000 url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><circle cx="100" cy="100" r="1" fill="white"/><circle cx="300" cy="200" r="1" fill="white"/><circle cx="500" cy="150" r="1" fill="white"/><circle cx="700" cy="300" r="1" fill="white"/><circle cx="900" cy="250" r="1" fill="white"/><circle cx="150" cy="400" r="1" fill="white"/><circle cx="350" cy="500" r="1" fill="white"/><circle cx="550" cy="450" r="1" fill="white"/><circle cx="750" cy="600" r="1" fill="white"/><circle cx="950" cy="550" r="1" fill="white"/><circle cx="200" cy="700" r="1" fill="white"/><circle cx="400" cy="800" r="1" fill="white"/><circle cx="600" cy="750" r="1" fill="white"/><circle cx="800" cy="900" r="1" fill="white"/><circle cx="50" cy="950" r="1" fill="white"/></svg>') repeat;
    z-index: -2;
}

.twinkling {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><circle cx="100" cy="200" r="2" fill="white" opacity="0.8"/><circle cx="300" cy="300" r="1.5" fill="white" opacity="0.6"/><circle cx="500" cy="250" r="2.5" fill="white" opacity="0.7"/><circle cx="700" cy="400" r="1" fill="white" opacity="0.9"/><circle cx="900" cy="350" r="2" fill="white" opacity="0.5"/></svg>') repeat;
    z-index: -1;
    animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Page Styles */
.page {
    display: none;
    min-height: 100vh;
    position: relative;
    touch-action: pan-y;
    overscroll-behavior: contain;
    transition: opacity 0.3s ease-in-out;
}

.page.active {
    display: block;
    opacity: 1;
}

/* Ensure smooth transitions between pages */
.page:not(.active) {
    opacity: 0;
    pointer-events: none;
}

/* Prevent touch events during page transitions */
.page.transitioning {
    touch-action: none;
    pointer-events: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    touch-action: pan-y;
    overscroll-behavior: contain;
    /* Mobile container optimizations */
    box-sizing: border-box;
    width: 100%;
}

.content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeInUp 1s ease-out;
    touch-action: pan-y;
    overscroll-behavior: contain;
    /* Mobile content optimizations */
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

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

/* Page 1 Styles */
.title {
    font-family: 'Dancing Script', cursive;
    font-size: 4rem;
    color: #fff;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.message {
    margin-bottom: 2rem;
}

.main-text {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 1rem;
    font-weight: 300;
}

.sub-text {
    font-size: 1.2rem;
    color: #e0e0e0;
    font-style: italic;
}

.funny-text {
    font-size: 1rem;
    color: #ffd700;
    font-style: italic;
    margin-top: 0.5rem;
    opacity: 0.9;
}

.highlight {
    color: #ffd700;
    font-weight: 600;
    font-size: 2rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.birthday-cake {
    font-size: 4rem;
    margin: 2rem 0;
    animation: float 3s ease-in-out infinite;
}

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

.cute-message {
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(255, 182, 193, 0.2);
    border-radius: 15px;
    border: 2px dashed #ffb6c1;
}

.cute-message p {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.small-text {
    font-size: 0.9rem !important;
    color: #ffd700 !important;
    font-style: italic;
}

/* Button Styles */
.next-btn, .back-btn, .restart-btn {
    background: linear-gradient(45deg, #ff69b4, #ff1493, #ff69b4);
    border: none;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    color: white;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    margin: 1rem 0.5rem;
    box-shadow: 0 6px 20px rgba(255, 105, 180, 0.4);
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.next-btn:hover, .restart-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 105, 180, 0.6);
    background: linear-gradient(45deg, #ff1493, #ff69b4, #ff1493);
}

.back-btn {
    background: linear-gradient(45deg, #87ceeb, #4682b4, #87ceeb);
    box-shadow: 0 6px 20px rgba(135, 206, 235, 0.4);
}

.back-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(135, 206, 235, 0.6);
    background: linear-gradient(45deg, #4682b4, #87ceeb, #4682b4);
}

/* Page 2 Styles */
.ready-title {
    font-family: 'Dancing Script', cursive;
    font-size: 3.5rem;
    color: #fff;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.tease-container {
    margin-bottom: 2rem;
}

.tease-text {
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 1rem;
    opacity: 0;
    animation: teaseIn 0.5s ease-out forwards;
}

.tease-text:nth-child(1) { animation-delay: 0.5s; }
.tease-text:nth-child(2) { animation-delay: 1.5s; }
.tease-text:nth-child(3) { animation-delay: 2.5s; }

@keyframes teaseIn {
    to { opacity: 1; }
}

.funny-note {
    color: #ffd700;
    font-style: italic;
    font-size: 1rem;
    margin-top: 0.5rem;
}

.funny-facts {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1.5rem;
    margin: 2rem 0;
    border-left: 4px solid #ffd700;
}

.fact {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

.surprise-btn {
    background: linear-gradient(45deg, #ff6b6b, #ffa726, #ffd54f, #66bb6a, #42a5f5, #ab47bc);
    background-size: 300% 300%;
    border: none;
    padding: 1.5rem 3rem;
    font-size: 1.5rem;
    color: white;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    animation: gradientShift 3s ease infinite;
    margin: 2rem 0;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.surprise-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
}

/* Page 3 Styles */
.birthday-wish {
    font-family: 'Dancing Script', cursive;
    font-size: 3.5rem;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
    animation: gradientShift 3s ease-in-out infinite;
}

.tee-name {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: #ff69b4;
}





.wishes {
    margin-bottom: 1.5rem;
}

.wish-text {
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 0.7rem;
    line-height: 1.5;
}

.funny-wish {
    color: #ffd700;
    font-style: italic;
    font-size: 1rem;
    margin-top: 0.3rem;
}

.note {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #4ecdc4;
}

.note h3 {
    color: #4ecdc4;
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
}

.note-text {
    color: #fff;
    font-size: 1rem;
    line-height: 1.6;
    font-style: italic;
}

.birthday-quotes {
    background: rgba(255, 182, 193, 0.2);
    border-radius: 15px;
    padding: 1.2rem;
    margin: 1.5rem 0;
    border: 2px dashed #ffb6c1;
}

.quote {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 0.6rem;
    font-style: italic;
}

.balloons {
    font-size: 2.5rem;
    animation: float 4s ease-in-out infinite;
    margin: 1.5rem 0;
}

/* Fix touch/swipe issues on page 3 */
#page3 {
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

#page3 .container {
    touch-action: pan-y;
    overscroll-behavior: contain;
}

#page3 .content {
    touch-action: pan-y;
    overscroll-behavior: contain;
}

/* Prevent unwanted touch behaviors on animated elements */
#page3 .balloons,
#page3 .birthday-wish,
#page3 .note,
#page3 .birthday-quotes {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

/* Prevent unwanted touch behaviors on floating elements */
.birthday-cake,
.balloons,
.hearts {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    pointer-events: none;
}

/* Ensure smooth scrolling and prevent bounce effects */
html {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
}

/* Page 4: The Vibe Styles */
.vibe-title {
    font-family: 'Dancing Script', cursive;
    font-size: 4rem;
    color: #1db954;
    margin-bottom: 2rem;
    text-shadow: 0 0 20px rgba(29, 185, 84, 0.5);
    animation: musicPulse 2s ease-in-out infinite;
}

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

.vibe-intro {
    margin-bottom: 2rem;
}

.vibe-text {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 1rem;
}

.vibe-subtext {
    color: #1db954;
    font-style: italic;
    font-size: 1.1rem;
}

.spotify-container {
    background: rgba(29, 185, 84, 0.1);
    border-radius: 15px;
    padding: 1.5rem;
    margin: 2rem 0;
    border: 2px solid #1db954;
    box-shadow: 0 8px 25px rgba(29, 185, 84, 0.3);
}

.playlist-notes {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1.5rem;
    margin: 2rem 0;
    border-left: 4px solid #1db954;
}

.playlist-notes p {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease-out;
}

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

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    text-align: center;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
}

.close:hover {
    color: #000;
}

.modal-title {
    color: #333;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.modal-subtitle {
    color: #666;
    font-style: italic;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

#birthdayVideo {
    width: 100%;
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    margin-bottom: 1.5rem;
    /* Mobile video optimizations */
    height: auto;
    max-height: 60vh;
    object-fit: contain;
}

.video-notes {
    background: rgba(255, 105, 180, 0.1);
    border-radius: 10px;
    padding: 1rem;
    border-left: 3px solid #ff69b4;
}

.video-notes p {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* Page 5: Final Thank You Styles */
.thank-you {
    font-family: 'Dancing Script', cursive;
    font-size: 4rem;
    color: #ff69b4;
    margin-bottom: 2rem;
    text-shadow: 0 0 20px rgba(255, 105, 180, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

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

.final-message {
    margin-bottom: 2rem;
}

.final-text {
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.funny-final {
    color: #ffd700;
    font-style: italic;
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

.signature {
    margin-bottom: 2rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
}

.signature-text {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.signature-name {
    color: #ffd700;
    font-size: 1.5rem;
    font-weight: 600;
    font-style: italic;
}

.signature-sub {
    color: #ff69b4;
    font-size: 1rem;
    font-style: italic;
    margin-top: 0.5rem;
}

.final-jokes {
    background: rgba(255, 182, 193, 0.2);
    border-radius: 15px;
    padding: 1.5rem;
    margin: 2rem 0;
    border: 2px dashed #ffb6c1;
}

.joke {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 0.8rem;
    font-style: italic;
    line-height: 1.4;
}

.hearts {
    font-size: 2.5rem;
    animation: heartBeat 1.5s ease-in-out infinite;
    margin: 2rem 0;
}

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

/* Audio Control Button */
.audio-control-btn {
    position: fixed;
    bottom: 20px;
    right: 80px;
    z-index: 1002;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: white;
    font-size: 20px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.audio-control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.audio-control-btn.muted {
    background: rgba(255, 0, 0, 0.3);
    border-color: rgba(255, 0, 0, 0.5);
}

.audio-control-btn.playing {
    background: rgba(0, 255, 0, 0.3);
    border-color: rgba(0, 255, 0, 0.5);
    animation: pulse 2s infinite;
}

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

/* Mobile Optimization - Comprehensive Mobile Styles */

/* Base Mobile Styles */
@media screen and (max-width: 768px) {
    /* Container adjustments for mobile */
    .container {
        padding: 1rem;
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Content adjustments for mobile */
    .content {
        padding: 1.5rem;
        margin: 0.5rem;
        border-radius: 15px;
        max-width: 95vw;
        width: 100%;
    }
    
    /* Typography scaling for mobile */
    .title {
        font-size: 2.5rem;
        margin-bottom: 1.5rem;
        line-height: 1.2;
    }
    
    .ready-title {
        font-size: 2.5rem;
        margin-bottom: 1.5rem;
        line-height: 1.2;
    }
    
    .birthday-wish {
        font-size: 2.5rem;
        margin-bottom: 1rem;
        line-height: 1.2;
    }
    
    .vibe-title {
        font-size: 2.5rem;
        margin-bottom: 1.5rem;
        line-height: 1.2;
    }
    
    .thank-you {
        font-size: 2.5rem;
        margin-bottom: 1.5rem;
        line-height: 1.2;
    }
    
    /* Text sizing for mobile */
    .main-text {
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
        line-height: 1.4;
    }
    
    .sub-text {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    .wish-text {
        font-size: 1.1rem;
        margin-bottom: 0.6rem;
        line-height: 1.4;
    }
    
    .vibe-text {
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
        line-height: 1.4;
    }
    
    .final-text {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
        line-height: 1.4;
    }
    
    /* Button optimizations for mobile */
    .next-btn, .back-btn, .restart-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
        margin: 0.8rem 0.3rem;
        border-radius: 20px;
        min-height: 44px; /* iOS touch target minimum */
        width: auto;
        max-width: 100%;
        white-space: normal;
        word-wrap: break-word;
    }
    
    .surprise-btn {
        padding: 1.2rem 2rem;
        font-size: 1.2rem;
        margin: 1.5rem 0;
        min-height: 50px;
        width: auto;
        max-width: 100%;
    }
    
    /* Emoji sizing for mobile */
    .birthday-cake {
        font-size: 3rem;
        margin: 1.5rem 0;
    }
    
    .balloons {
        font-size: 2rem;
        margin: 1rem 0;
    }
    
    .hearts {
        font-size: 2rem;
        margin: 1.5rem 0;
    }
    
    /* Mobile-specific spacing */
    .message {
        margin-bottom: 1.5rem;
    }
    
    .cute-message {
        margin: 1.5rem 0;
        padding: 1rem;
    }
    
    .funny-facts {
        margin: 1.5rem 0;
        padding: 1rem;
    }
    
    .note {
        margin-bottom: 1rem;
        padding: 1rem;
    }
    
    .birthday-quotes {
        margin: 1rem 0;
        padding: 1rem;
    }
    
    .spotify-container {
        margin: 1.5rem 0;
        padding: 1rem;
        /* Mobile Spotify container optimizations */
        overflow: hidden;
        border-radius: 12px;
    }
    
    .playlist-notes {
        margin: 1.5rem 0;
        padding: 1rem;
        /* Ensure text doesn't get cut off on mobile */
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .playlist-notes p {
        margin-bottom: 0.8rem;
        line-height: 1.4;
        /* Prevent text truncation */
        white-space: normal;
        overflow: visible;
    }
    
    .signature {
        margin-bottom: 1.5rem;
        padding: 1.5rem;
    }
    
    .final-jokes {
        margin: 1.5rem 0;
        padding: 1rem;
    }
    
    /* Audio control button mobile positioning */
    .audio-control-btn {
        bottom: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

/* Small Mobile Devices */
@media screen and (max-width: 480px) {
    .container {
        padding: 0.8rem;
    }
    
    .content {
        padding: 1.2rem;
        margin: 0.3rem;
        border-radius: 12px;
    }
    
    .title, .ready-title, .birthday-wish, .vibe-title, .thank-you {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .main-text {
        font-size: 1.1rem;
    }
    
    .wish-text {
        font-size: 1rem;
    }
    
    .next-btn, .back-btn, .restart-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
        margin: 0.6rem 0.2rem;
    }
    
    .surprise-btn {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }
    
    .birthday-cake {
        font-size: 2.5rem;
    }
    
    .balloons, .hearts {
        font-size: 1.8rem;
    }
}

/* Extra Small Mobile Devices */
@media screen and (max-width: 360px) {
    .title, .ready-title, .birthday-wish, .vibe-title, .thank-you {
        font-size: 1.8rem;
    }
    
    .main-text {
        font-size: 1rem;
    }
    
    .wish-text {
        font-size: 0.9rem;
    }
    
    .next-btn, .back-btn, .restart-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .surprise-btn {
        padding: 0.8rem 1.2rem;
        font-size: 1rem;
    }
}

/* Mobile Landscape Orientation */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .container {
        padding: 1rem 2rem;
    }
    
    .content {
        padding: 1.2rem;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .title, .ready-title, .birthday-wish, .vibe-title, .thank-you {
        font-size: 2.2rem;
        margin-bottom: 1rem;
    }
    
    .birthday-cake {
        font-size: 2.5rem;
        margin: 1rem 0;
    }
    
    .balloons, .hearts {
        font-size: 1.8rem;
        margin: 1rem 0;
    }
}

/* Mobile Modal Optimizations */
@media screen and (max-width: 768px) {
    .modal-content {
        margin: 10% auto;
        padding: 1.5rem;
        width: 95%;
        max-width: none;
        border-radius: 15px;
    }
    
    .modal-title {
        font-size: 1.5rem;
        margin-bottom: 0.8rem;
    }
    
    .modal-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    #birthdayVideo {
        border-radius: 8px;
        margin-bottom: 1rem;
    }
    
    .close {
        right: 15px;
        top: 10px;
        font-size: 24px;
    }
}

/* Mobile Touch Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Optimize for touch devices */
    .next-btn:hover, .back-btn:hover, .restart-btn:hover, .surprise-btn:hover {
        transform: none;
        box-shadow: 0 6px 20px rgba(255, 105, 180, 0.4);
    }
    
    .audio-control-btn:hover {
        transform: none;
        background: rgba(255, 255, 255, 0.3);
    }
    
    /* Add active states for touch feedback */
    .next-btn:active, .back-btn:active, .restart-btn:active, .surprise-btn:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
    
    .audio-control-btn:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
}

/* Mobile Performance Optimizations */
@media screen and (max-width: 768px) {
    /* Reduce animations on mobile for better performance */
    .stars, .twinkling {
        animation-duration: 4s;
    }
    
    .birthday-cake {
        animation-duration: 4s;
    }
    
    .balloons {
        animation-duration: 5s;
    }
    
    .hearts {
        animation-duration: 2s;
    }
    
    /* Optimize backdrop-filter for mobile */
    .content {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
}

/* Mobile Accessibility Improvements */
@media screen and (max-width: 768px) {
    /* Ensure sufficient contrast and readability */
    .main-text, .wish-text, .vibe-text, .final-text {
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    }
    
    /* Improve button accessibility */
    .next-btn, .back-btn, .restart-btn, .surprise-btn {
        border: 2px solid rgba(255, 255, 255, 0.3);
    }
    
    /* Ensure emojis are visible */
    .birthday-cake, .balloons, .hearts {
        filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.5));
    }
}

/* Mobile-specific scrollbar styling */
@media screen and (max-width: 768px) {
    .content::-webkit-scrollbar {
        width: 6px;
    }
    
    .content::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 3px;
    }
    
    .content::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 3px;
    }
    
    .content::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.5);
    }
}

/* Mobile form and interactive element improvements */
@media screen and (max-width: 768px) {
    /* Ensure all interactive elements are properly sized for touch */
    button, [role="button"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Improve focus states for mobile */
    .next-btn:focus, .back-btn:focus, .restart-btn:focus, .surprise-btn:focus {
        outline: 2px solid #ff69b4;
        outline-offset: 2px;
    }
    
    /* Optimize iframe for mobile */
    .spotify-container iframe {
        height: 320px;
        border-radius: 8px;
        width: 100% !important;
        max-width: 100%;
        min-height: 300px;
        margin-bottom: 0.5rem;
    }
}

/* Mobile-specific animation optimizations */
@media (prefers-reduced-motion: reduce) {
    .stars, .twinkling, .birthday-cake, .balloons, .hearts {
        animation: none;
    }
    
    .title, .birthday-wish, .vibe-title, .thank-you {
        animation: none;
    }
}

/* High DPI mobile displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .content {
        border-width: 0.5px;
    }
    
    .next-btn, .back-btn, .restart-btn, .surprise-btn {
        border-width: 1px;
    }
}

/* Additional Mobile Touch and Performance Optimizations */
@media screen and (max-width: 768px) {
    /* Prevent text selection on interactive elements */
    .next-btn, .back-btn, .restart-btn, .surprise-btn, .audio-control-btn {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Optimize touch scrolling */
    .page {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* Improve button touch feedback */
    .next-btn:active, .back-btn:active, .restart-btn:active, .surprise-btn:active {
        background: linear-gradient(45deg, #ff1493, #ff69b4, #ff1493);
        transform: scale(0.98);
        transition: all 0.1s ease;
    }
    
    /* Mobile-specific spacing for better touch targets */
    .next-btn + .back-btn,
    .next-btn + .restart-btn {
        margin-top: 1rem;
    }
    
    /* Optimize emoji containers for mobile */
    .birthday-cake, .balloons, .hearts {
        display: flex;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    /* Mobile-specific content overflow handling */
    .content {
        max-height: 90vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Optimize modal for mobile */
    .modal {
        padding: 1rem;
    }
    
    .modal-content {
        margin: 5% auto;
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* Mobile landscape specific optimizations */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .container {
        padding: 0.5rem 1rem;
    }
    
    .content {
        padding: 1rem;
        max-height: 85vh;
    }
    
    .title, .ready-title, .birthday-wish, .vibe-title, .thank-you {
        font-size: 2rem;
        margin-bottom: 0.8rem;
    }
    
    .main-text, .wish-text, .vibe-text, .final-text {
        font-size: 1rem;
        margin-bottom: 0.6rem;
    }
    
    .next-btn, .back-btn, .restart-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
        margin: 0.5rem 0.2rem;
    }
    
    .surprise-btn {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }
}

/* Mobile performance and battery optimizations */
@media screen and (max-width: 768px) {
    /* Reduce motion for better performance */
    .stars, .twinkling {
        will-change: opacity;
    }
    
    .birthday-cake, .balloons, .hearts {
        will-change: transform;
    }
    
    /* Optimize backdrop filters for mobile */
    .content {
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
    }
    
    /* Reduce shadow complexity on mobile */
    .content {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    }
    
    .next-btn, .back-btn, .restart-btn, .surprise-btn {
        box-shadow: 0 4px 12px rgba(255, 105, 180, 0.4);
    }
    
    .surprise-btn {
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    }
}

/* Mobile accessibility and usability improvements */
@media screen and (max-width: 768px) {
    /* Ensure sufficient touch target sizes */
    .next-btn, .back-btn, .restart-btn, .surprise-btn {
        min-width: 120px;
        min-height: 48px;
    }
    
    .audio-control-btn {
        min-width: 48px;
        min-height: 48px;
    }
    
    /* Improve focus visibility for mobile */
    .next-btn:focus-visible,
    .back-btn:focus-visible,
    .restart-btn:focus-visible,
    .surprise-btn:focus-visible {
        outline: 3px solid #ff69b4;
        outline-offset: 2px;
        border-radius: 20px;
    }
    
    /* Mobile-specific text contrast improvements */
    .funny-text, .funny-wish, .funny-note, .funny-final {
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    }
    
    /* Ensure emojis are visible on all backgrounds */
    .birthday-cake, .balloons, .hearts {
        filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.7));
    }
}




