@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;700&display=swap");

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}
body { 
    font-family: "Fredoka", sans-serif; 
    background-image: url("../img/birthdayBg.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
    padding: clamp(16px, 4vw, 48px);
    box-sizing: border-box;
    overflow-x: hidden;
}
main {
    position: relative;
    width: min(100%, 1400px);
    min-height: calc(100vh - clamp(32px, 8vw, 96px));
}
p {
    font-family: inherit;
    font-size: clamp(1rem, 1.8vw, 1.25rem); 
    color: #b1a2e6;
    margin: 0 0 0 8%;
    max-width: 42rem;
}
h1 {
    font-size: clamp(2rem, 5vw, 3.125rem);
    color: #b1a2e6;
    margin: 2% 0 0 8%;
}
#blowCandleBtn,
#letterExit,
h1 {
    font-family: "Fredoka", sans-serif;
}
#letterButton {
    border: transparent;
    margin-left: 15%;
    margin-top: 25px;
    cursor: pointer;
    background: transparent; /* Ensures no default button background behind image */
}
#letterButton img {
    width: clamp(10rem, 24vw, 18rem);
    height: auto;
    aspect-ratio: 3 / 4;
    object-fit: contain;
    animation: breathe 2s infinite ease-in-out;
}
#letterExit {
    background: transparent;
    border: transparent;
    font-size: 16px;
}
#letterContent {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(20, 15, 35, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}
.letter-card {
    position: relative;
    width: min(92vw, 760px);
    max-height: 80vh;
    overflow-y: auto;
    margin: 0;
    padding: 56px 32px 32px;
    border-radius: 28px;
    background: rgba(255, 248, 235, 0.98);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
    color: #7b5ea7;
    line-height: 1.6;
}
.letter-card p {
    margin: 0;
    color: inherit;
     margin-bottom: 16px;
}
.letter-card #letterExit {
    position: absolute;
    top: 20px;
    left: 24px;
    margin-bottom: 10px;
    z-index: 1;
    font-size: 25px;
    color: #7b5ea7;
    cursor: pointer;
}
#blowCandleBtn {
    font-size: clamp(1rem, 2.8vw, 2.5rem);              
    font-weight: 600;
    position: absolute;
    top: clamp(5rem, 14vh, 15%);
    right: clamp(1rem, 8vw, 13%);
    background-color: #ae9bf3;   
    color: #fffff0;               
    border: 2px solid #ffffff;    
    padding: clamp(0.5rem, 1.2vw, 0.75rem) clamp(1rem, 2.5vw, 1.75rem);           
    border-radius: 50px;          
    cursor: pointer;              
    box-shadow: 0 8px 24px rgba(174, 155, 243, 0.4); 
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    animation: breathe 2s infinite ease-in-out;
}
#blowCandleBtn:hover {
    background-color: #9b84eb;    
    box-shadow: 0 12px 30px rgba(174, 155, 243, 0.6); 
}
.animated-object-container {
    pointer-events: none;
}
.animated-object {
    display: block;
    width: clamp(10rem, 24vw, 21.875rem);
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
    position: absolute;
    bottom: clamp(1rem, 4vh, 5%);
    right: clamp(1rem, 8vw, 13%);
}


#candleLightVideo, 
.animated-object,
.animated-object-container {
    border-radius: 120px;
    border: none !important;
    outline: none !important;
    outline-style: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent;
}

#candleLightVideo:focus,
#candleLightVideo:active,
#candleLightVideo:focus-visible,
.animated-object:focus,
.animated-object:active,
.animated-object:focus-visible {
    border: none !important;
    outline: none !important;
    outline-style: none !important;
    box-shadow: none !important;
}

#candleLightVideo, 
.animated-object {
    clip-path: inset(5px 5px); 
}

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

@media (max-width: 900px) {
    body {
        align-items: center;
        justify-content: flex-start;
    }

    main {
        width: 100%;
    }

    h1,
    p {
        margin-left: 4%;
        margin-right: 4%;
    }

    #letterButton {
        margin-left: 4%;
    }

    #blowCandleBtn {
        top: 9rem;
        right: 4%;
    }

    .animated-object {
        right: 4%;
        bottom: 4%;
    }
}

@media (max-width: 640px) {
    body {
        padding: 12px;
    }

    #letterButton img {
        width: min(68vw, 14rem);
    }

    #blowCandleBtn {
        top: auto;
        bottom: 38%;
        left: 4%;
        right: auto;
    }

    .animated-object {
        width: min(56vw, 14rem);
        right: 4%;
        bottom: 2%;
    }

    .letter-card {
        width: min(94vw, 760px);
        padding: 48px 20px 24px;
    }
}