/* Design System & Styling */
:root {
    --bg-red: #c91c1c;         /* Cute rich crimson red */
    --accent-blue: #a4d4fc;    /* Cute light ribbon blue */
    --accent-blue-dark: #7cbcf5;
    --text-white: #ffffff;
    --polaroid-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    --btn-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    --btn-hover-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
    --cute-font: 'Fredoka', 'Quicksand', 'Nunito', sans-serif;
}

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

body {
    background-color: var(--bg-red);
    font-family: var(--cute-font);
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Floating Hearts Background */
.hearts-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.heart-particle {
    position: absolute;
    bottom: -50px;
    font-size: 24px;
    opacity: 0.6;
    animation: floatUp 6s linear infinite;
    user-select: none;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg) scale(0.8);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-105vh) rotate(360deg) scale(1.2);
        opacity: 0;
    }
}

/* Main Container: two columns on desktop, centered */
.main-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6vw;
    width: 95%;
    max-width: 1100px;
    height: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    margin: auto;
    z-index: 10;
    padding: 20px;
    overflow: hidden;
}

/* Polaroid Wrapper (Left Side) */
.polaroid-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 420px;
}

/* Polaroid Card Style */
.polaroid-card {
    background-color: #ffffff;
    padding: 16px 16px 45px 16px;
    border-radius: 4px;
    box-shadow: var(--polaroid-shadow);
    transform: rotate(-3deg);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.polaroid-card:hover {
    transform: rotate(-1deg) scale(1.02);
}

.photo-container {
    width: 100%;
    aspect-ratio: 1.15; /* slightly wider than tall as in template screenshot */
    overflow: hidden;
    border: 1px solid #eaeaea;
    background-color: #f7f7f7;
    border-radius: 2px;
}

.couple-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.polaroid-caption {
    margin-top: 15px;
    font-size: 24px;
    color: #444;
    display: flex;
    justify-content: center;
    align-items: center;
}

.heart-icon {
    display: inline-block;
    animation: heartbeat 1.5s infinite;
}

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

/* Ribbon Bow placing */
.ribbon-bow {
    position: absolute;
    top: -25px;
    right: -25px;
    z-index: 15;
    transform: rotate(15deg);
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.25));
    pointer-events: none;
}

/* Teddy Bear Alignment */
.teddy-bear {
    position: absolute;
    bottom: -35px;
    left: -45px;
    width: 120px;
    z-index: 20;
    pointer-events: none;
    animation: teddyBreath 3s ease-in-out infinite alternate;
}

.teddy-bear img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

@keyframes teddyBreath {
    0% {
        transform: scale(1) translateY(0);
    }
    100% {
        transform: scale(1.05) translateY(-5px) rotate(2deg);
    }
}

/* Passcode Wrapper (Right Side) */
.passcode-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 400px;
    text-align: center;
    color: var(--text-white);
}

.passcode-title {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 25px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    letter-spacing: 0.5px;
}

/* Dots / Boxes */
.dots-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 35px;
    transition: transform 0.1s ease;
}

.dot-box {
    width: 50px;
    height: 50px;
    border: 3px solid var(--text-white);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-white);
    background-color: transparent;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Active populated dot state */
.dot-box.filled {
    background-color: var(--text-white);
    color: var(--bg-red);
    transform: scale(1.08);
}

.dot-box.filled::after {
    content: "•";
    font-size: 2.8rem;
    line-height: 0;
}

/* Keypad Grid styling */
.keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px 25px;
    margin-bottom: 35px;
    width: 100%;
    max-width: 290px;
}

/* Key Buttons styling */
.key-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    background-color: var(--text-white);
    color: var(--bg-red);
    font-family: var(--cute-font);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: var(--btn-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    outline: none;
}

.key-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--btn-hover-shadow);
    background-color: #fff0f0;
}

.key-btn:active {
    transform: scale(0.92);
}

/* Visual Keyboard press effect class */
.key-btn.pressed {
    transform: scale(0.92);
    background-color: #ffe0e0;
}

/* Passcode Hint style */
.passcode-hint {
    font-size: 1.1rem;
    font-style: italic;
    opacity: 0.9;
    letter-spacing: 0.5px;
    margin-top: 10px;
}

/* Error Shake Animation */
.shake {
    animation: shakeAnim 0.4s ease-in-out;
}

@keyframes shakeAnim {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

.dot-box.error {
    border-color: #ffcccc;
    background-color: rgba(255, 0, 0, 0.2);
    animation: flashError 0.4s ease-in-out;
}

@keyframes flashError {
    0%, 100% { border-color: var(--text-white); }
    50% { border-color: #ff8888; }
}

/* Success Unlock Overlay */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-red);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

.success-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.success-content {
    text-align: center;
    color: var(--text-white);
    transform: scale(0.8);
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-overlay.show .success-content {
    transform: scale(1);
}

.success-heart {
    font-size: 6rem;
    margin-bottom: 20px;
    animation: successPulse 1.2s infinite ease-in-out alternate;
}

@keyframes successPulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(255,255,255,0.4)); }
    100% { transform: scale(1.15); filter: drop-shadow(0 0 25px rgba(255,255,255,0.8)); }
}

.success-content h2 {
    font-size: 2.5rem;
    margin-bottom: 25px;
}

/* Success Loading Dots */
.loading-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.loading-dots span {
    width: 12px;
    height: 12px;
    background-color: var(--text-white);
    border-radius: 50%;
    display: inline-block;
    animation: dotBounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Birthday screen wrapper */
.birthday-screen-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #fafafa; /* Cute soft off-white/light-grey background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

.birthday-screen-wrapper.show {
    opacity: 1;
    pointer-events: auto;
}

.birthday-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 550px;
    padding: 20px;
}

.birthday-gif {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    filter: drop-shadow(0 10px 25px rgba(0,0,0,0.06));
}

/* NEXT Button */
.next-btn {
    position: fixed;
    bottom: 40px;
    right: 40px;
    background-color: #000000;
    color: #ffffff;
    border: none;
    border-radius: 50px;
    padding: 12px 35px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: var(--cute-font);
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 95;
}

.next-btn:hover {
    transform: scale(1.08);
    background-color: #222222;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.next-btn:active {
    transform: scale(0.95);
}

/* Wish Screen Wrapper (Page 3) */
.wish-screen-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-red);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 85;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
    color: var(--text-white);
    text-align: center;
    overflow-y: auto;
    padding: 30px 15px;
}

.wish-screen-wrapper.show {
    opacity: 1;
    pointer-events: auto;
}

.wish-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
    transition: opacity 0.8s ease, transform 0.8s ease;
    transform: translateY(0);
    opacity: 1;
}

.wish-title.fade-out {
    opacity: 0;
    transform: translateY(-15px);
}

/* Cake vector container */
.cake-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    transition: transform 0.3s ease;
}

.cake-container:hover {
    transform: scale(1.02);
}

/* Wind gust styling representing blowing air */
.wind-gust {
    position: absolute;
    height: 8px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.75) 30%, rgba(255, 255, 255, 0.85) 70%, rgba(255, 255, 255, 0) 100%);
    border-radius: 10px;
    opacity: 0;
    pointer-events: none;
    z-index: 15;
    filter: blur(1.5px);
    width: 140px;
}

@keyframes blowWind {
    0% {
        left: -160px;
        opacity: 0;
        transform: scaleY(1.3) skewX(-25deg);
    }
    15% {
        opacity: 0.85;
    }
    85% {
        opacity: 0.85;
    }
    100% {
        left: calc(100% + 60px);
        opacity: 0;
        transform: scaleY(0.3) skewX(-25deg) translateY(-12px);
    }
}

/* Bending flames when blowing air */
.flame.blowing {
    animation: none !important;
    transform: scaleX(0.65) scaleY(0.5) rotate(35deg) translate(14px, -10px) !important;
    transform-origin: 50% 90% !important;
    transition: transform 0.15s ease !important;
}

.flame-inner.blowing {
    animation: none !important;
    transform: scaleX(0.65) scaleY(0.5) rotate(35deg) translate(14px, -10px) !important;
    transform-origin: 50% 90% !important;
    transition: transform 0.15s ease !important;
}

/* Sparkle shimmer keyframes */
.sparkle {
    animation: sparkleShimmer 2.5s infinite ease-in-out;
    transform-origin: center;
}

.sparkle:nth-child(2) {
    animation-delay: 0.8s;
}

.sparkle:nth-child(3) {
    animation-delay: 1.5s;
}

@keyframes sparkleShimmer {
    0%, 100% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); opacity: 0.9; }
}

/* SVG Flame Flickering animation */
.flame {
    animation: flameFlicker 0.15s infinite alternate ease-in-out;
    transform-origin: 50% 90%;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.flame-inner {
    animation: flameFlicker 0.1s infinite alternate-reverse ease-in-out;
    transform-origin: 50% 90%;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

@keyframes flameFlicker {
    0% { transform: scale(1) rotate(-2deg); }
    100% { transform: scale(1.08) rotate(3deg) skewX(2deg); }
}

/* Blown out flames */
.flame.extinguished, .flame-inner.extinguished {
    transform: scale(0) translateY(-10px) !important;
    opacity: 0 !important;
}

/* Blown smoke rising */
.smoke-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: rgba(220, 220, 220, 0.7);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10;
}

/* BLOW Button (matching screenshot) */
.blow-btn {
    background-color: #8a0c0c; /* Dark crimson red capsule */
    color: var(--text-white);
    border: none;
    border-radius: 50px;
    padding: 12px 55px;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: var(--cute-font);
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 95;
    outline: none;
    border: 2px solid rgba(255,255,255,0.1);
}

.blow-btn:hover {
    transform: scale(1.08);
    background-color: #700909;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.blow-btn:active {
    transform: scale(0.95);
}

/* Hide blow button when blown out */
.blow-btn.hide {
    opacity: 0;
    transform: scale(0.5);
    pointer-events: none;
    display: none;
}

/* Live Lifetime Counter */
.timer-container {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 100%;
    max-width: 480px;
    display: none;
}

.timer-container.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    margin-top: 15px;
    display: block;
}

.timer-label {
    font-size: 1.1rem;
    font-weight: 550;
    margin-bottom: 12px;
    opacity: 0.95;
    letter-spacing: 0.5px;
}

.timer-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    width: 100%;
}

.timer-box {
    background-color: rgba(255, 255, 255, 0.12);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.timer-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-white);
    line-height: 1.2;
}

.timer-unit {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.9;
    color: #ffcccc;
    text-transform: capitalize;
}

/* Next button bottom-right on Wish screen */
.wish-next-btn {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wish-next-btn.show {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

/* Responsive CSS rules */
@media (max-width: 850px) {
    .main-container {
        flex-direction: column;
        gap: 2.5vh;
        padding: 10px;
        justify-content: space-around;
        height: 100dvh;
        max-height: 100dvh;
    }
    
    .polaroid-wrapper {
        max-width: min(270px, 34vh);
    }

    .polaroid-card {
        padding: 10px 10px 28px 10px;
    }

    .polaroid-caption {
        margin-top: 6px;
        font-size: 18px;
    }

    .teddy-bear {
        width: 75px;
        bottom: -22px;
        left: -28px;
    }
    
    .ribbon-bow {
        top: -15px;
        right: -15px;
    }

    .ribbon-bow svg {
        width: 55px;
        height: 55px;
    }
    
    .passcode-wrapper {
        max-height: 52vh;
        width: 100%;
    }

    .passcode-title {
        font-size: 1.4rem;
        margin-bottom: 8px;
    }

    .dots-container {
        margin-bottom: 12px;
        gap: 10px;
    }

    .dot-box {
        width: 36px;
        height: 36px;
        border-width: 2px;
        font-size: 1.3rem;
        border-radius: 8px;
    }

    .dot-box.filled::after {
        font-size: 2rem;
    }

    .keypad-grid {
        gap: 10px 16px;
        max-width: 230px;
        margin-bottom: 5px;
    }

    .key-btn {
        width: 52px;
        height: 52px;
        font-size: 1.4rem;
    }

    .next-btn {
        bottom: 25px;
        right: 25px;
        padding: 10px 28px;
        font-size: 1rem;
    }
    
    .birthday-inner {
        max-width: 90%;
    }

    .wish-title {
        font-size: 1.8rem;
    }

    #cakeSvg {
        width: min(250px, 35vh);
        height: min(250px, 35vh);
    }

    .timer-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .timer-box {
        padding: 8px 4px;
        border-radius: 8px;
    }

    .timer-num {
        font-size: 1.3rem;
    }

    /* Page 4 mobile responsive styles */
    .scrapbook-card {
        width: 90%;
        max-width: 375px;
        height: 82vh;
        max-height: 540px;
    }
    
    .letter-content {
        padding: 35px 20px 20px 20px;
    }

    .title-brush-wrapper {
        margin-bottom: 10px;
    }

    .letter-heading {
        font-size: clamp(1.2rem, 3.2vh, 1.5rem);
    }

    .brush-stroke {
        padding: 4px 25px;
    }

    .letter-body-container {
        gap: 2px;
    }

    .letter-text {
        font-size: clamp(0.95rem, 2.7vh, 1.2rem);
        margin: 0;
        line-height: 1.25;
    }
    
    .hibiscus-decor {
        bottom: -15px;
        right: -15px;
    }

    .hibiscus-decor svg {
        width: 70px;
        height: 70px;
    }
    
    .pink-bow-decor {
        top: -15px;
        left: -15px;
    }

    .pink-bow-decor svg {
        width: 70px;
        height: 70px;
    }

    .music-toggle-btn {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

/* ==========================================
   PAGE 4: SCRAPBOOK CARD LAYOUT
   ========================================== */

.letter-screen-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #c45966; /* Rich warm plaster pink background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 80;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
    overflow: hidden;
}

.letter-screen-wrapper.show {
    opacity: 1;
    pointer-events: auto;
}

.scrapbook-card {
    position: relative;
    width: 90%;
    max-width: 440px;
    height: 84vh;
    max-height: 620px;
    z-index: 5;
    transform: translateY(35px) scale(0.95);
    opacity: 0;
    transition: transform 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 1.2s ease;
}

.letter-screen-wrapper.show .scrapbook-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.torn-paper-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.pink-bow-decor {
    position: absolute;
    top: -22px;
    left: -22px;
    z-index: 10;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
    transform: scale(0) rotate(-45deg);
    transition: transform 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s;
}

.letter-screen-wrapper.show .pink-bow-decor {
    transform: scale(1) rotate(0deg);
}

.letter-content {
    position: relative;
    z-index: 5;
    padding: 60px 40px 40px 40px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.title-brush-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
}

/* Premium brush paint stroke overlay */
.brush-stroke {
    position: relative;
    background: linear-gradient(90deg, rgba(244, 63, 94, 0) 0%, rgba(244, 63, 94, 0.35) 15%, rgba(244, 63, 94, 0.35) 85%, rgba(244, 63, 94, 0) 100%);
    padding: 8px 45px;
    border-radius: 4px;
    transform: scaleX(0.8);
    opacity: 0;
    transition: transform 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 1.2s ease;
}

.letter-screen-wrapper.show .brush-stroke {
    transform: scaleX(1);
    opacity: 1;
    transition-delay: 0.4s;
}

.pink-butterfly {
    position: absolute;
    left: -5px;
    top: -12px;
    z-index: 15;
    animation: butterflyFloat 3s infinite ease-in-out alternate;
    transform-origin: center;
}

@keyframes butterflyFloat {
    0% { transform: translateY(0) rotate(-5deg) scale(1); }
    100% { transform: translateY(-4px) rotate(5deg) scale(1.05); }
}

.letter-heading {
    font-family: 'Pacifico', cursive;
    color: #3f1a1a;
    font-size: 2rem;
    font-weight: 400;
    text-shadow: 0 1px 1px rgba(255,255,255,0.5);
    white-space: nowrap;
}

.letter-body-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.letter-text {
    font-family: 'Caveat', cursive;
    color: #4a2121;
    font-size: clamp(1.3rem, 2.8vh, 1.8rem);
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
    letter-spacing: 0.2px;
}

/* Individual animated words in the letter */
.letter-word {
    display: inline-block;
    margin-right: 0.25em; /* dynamic word spacing */
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: opacity 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.15), transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

.letter-screen-wrapper.show .letter-word {
    /* transition-delay is set dynamically via JavaScript for staggered loading word-by-word */
    opacity: 1;
    transform: translateY(0) scale(1);
}

.hibiscus-decor {
    position: absolute;
    bottom: -22px;
    right: -22px;
    z-index: 10;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
    transform: scale(0) rotate(-45deg);
    transition: transform 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.5s;
}

.letter-screen-wrapper.show .hibiscus-decor {
    transform: scale(1) rotate(0deg);
}

/* Music Toggle Button styling */
.music-toggle-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-white);
    font-size: 1.4rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 200;
    outline: none;
    user-select: none;
}

.music-toggle-btn:hover {
    transform: scale(1.12);
    background-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.music-toggle-btn.playing {
    animation: musicPulse 1.8s infinite ease-in-out alternate;
}

@keyframes musicPulse {
    0% { transform: scale(1) rotate(0deg); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
    100% { transform: scale(1.08) rotate(15deg); box-shadow: 0 0 15px rgba(255,255,255,0.4); }
}

.music-toggle-btn:active {
    transform: scale(0.92);
}
