* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #111;
    font-family: 'Kalam', cursive;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Welcome Overlay */
.welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: opacity 0.4s ease;
}

.welcome-box {
    background: #fdfbf7;
    border: 2px solid #D4AF37;
    padding: 30px 20px;
    text-align: center;
    border-radius: 12px;
    max-width: 360px;
    width: 100%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

.welcome-box h2 {
    font-family: 'Kalam', cursive;
    color: #7B1E24;
    font-size: 26px;
    margin-bottom: 8px;
}

.welcome-box p {
    font-family: sans-serif;
    color: #555;
    font-size: 13px;
    margin-bottom: 20px;
}

.royal-start-btn {
    background: linear-gradient(135deg, #7B1E24 0%, #581822 100%);
    color: #fff;
    border: 1px solid #D4AF37;
    padding: 12px 20px;
    font-size: 16px;
    font-family: 'Kalam', cursive;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    box-shadow: 0 4px 15px rgba(123, 30, 36, 0.4);
}

.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Main PDF Wrapper */
.pdf-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #111;
}

.pdf-page-wrapper {
    position: relative;
    width: 100%;
    background-color: #fff;
    line-height: 0;
    margin-bottom: 10px;
}

.pdf-page-wrapper canvas {
    width: 100% !important;
    height: auto !important;
    display: block;
}

/* ✍️ Page 1 Dynamic Guest Name Overlay Box */
.guest-name-overlay {
    position: absolute;
    top: 67%;
    left: 15%;
    width: 70%;
    height: 12%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    pointer-events: none;
    z-index: 5;
}

#guest-name-text {
    font-family: 'Kalam', cursive;
    font-weight: 500;
    color: #7B1E24;
    font-size: clamp(20px, 5.5vw, 36px);
    background: transparent;
    word-break: break-word;
    line-height: 1.2;
    width: 100%;
}

/* ⏳ Last Page Countdown & Venue Overlay Box (Shifted Down) */
.last-page-overlay {
    position: absolute;
    top: 70.5%; /* Niche shift kiya gaya hai taaki line design ke andar aaye */
    left: 10%;
    width: 80%;
    height: 20%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 5;
}

.countdown-box {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
}

.time-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(123, 30, 36, 0.08);
    border: 1px solid rgba(123, 30, 36, 0.25);
    padding: 4px 8px;
    border-radius: 5px;
    min-width: 44px;
}

.time-num {
    font-family: 'Cinzel', serif;
    font-size: 16px;
    font-weight: 700;
    color: #7B1E24;
    line-height: 1;
}

.time-label {
    font-size: 9px;
    color: #555;
    text-transform: uppercase;
    margin-top: 2px;
}

.time-colon {
    font-size: 16px;
    font-weight: bold;
    color: #7B1E24;
    margin-top: -8px;
}

/* Maps Venue Button */
.venue-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, #7B1E24 0%, #581822 100%);
    color: #fff;
    text-decoration: none;
    padding: 7px 16px;
    font-size: 12px;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    border-radius: 20px;
    border: 1px solid #D4AF37;
    box-shadow: 0 3px 8px rgba(0,0,0,0.25);
    transition: transform 0.2s ease;
    margin-top: 2px;
}

.venue-btn:active {
    transform: scale(0.95);
}

.venue-btn i {
    color: #D4AF37;
    font-size: 12px;
}

/* Music Toggle Button */
.music-toggle-btn {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1000;
    background: rgba(123, 30, 36, 0.9);
    color: #fff;
    border: 2px solid #D4AF37;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
}

.music-toggle-btn.playing {
    animation: rotateMusic 4s linear infinite;
}

@keyframes rotateMusic {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 🌸 Falling Rose Petals Animation Styles */
.petals-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    overflow: hidden;
    z-index: 99;
}

.petal {
    position: absolute;
    top: -10%;
    background: radial-gradient(circle, #ffccd5 0%, #d90429 100%);
    border-radius: 150% 0 150% 0;
    opacity: 0.75;
    animation: fall linear infinite;
}

@keyframes fall {
    0% {
        transform: translateY(0vh) translateX(0vw) rotate(0deg);
        opacity: 0.9;
    }
    50% {
        transform: translateY(50vh) translateX(3vw) rotate(180deg);
    }
    100% {
        transform: translateY(105vh) translateX(-3vw) rotate(360deg);
        opacity: 0.2;
    }
}