/* Custom default font */
body {
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    /* Prevent scrolling */
}

/* Fonts for cards and headings */
.font-pacifico {
    font-family: 'Pacifico', cursive;
}

.font-gochi {
    font-family: 'Gochi Hand', cursive;
    line-height: 1.2;
}

/* Screen containers */
.screen {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    transition: opacity 1s ease-in-out, transform 1s ease-in-out;
    opacity: 1;
    transform: scale(1);
    overflow: hidden;
    /* Prevent internal scrolling */
}

/* Screen transition classes */
.screen.hidden {
    opacity: 0;
    transform: scale(1.1);
    pointer-events: none;
    z-index: -1;
}

/* NEW: Colorful Aurora Background */
.bg-aurora {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab, #ffcf40);
    background-size: 400% 400%;
    animation: gradient-aurora 20s ease infinite;
}

@keyframes gradient-aurora {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* NEW: Glassmorphism Effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* NEW: Start Button Style */
.start-button-pulse {
    background-image: linear-gradient(to right, #da22ff, #9d60ff, #da22ff);
    background-size: 200% auto;
    animation: gradient-flow 2s linear infinite, pulse-slow 2s infinite;
}

@keyframes gradient-flow {
    to {
        background-position: 200% center;
    }
}

@keyframes pulse-slow {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 15px rgba(218, 34, 255, 0.5);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 25px rgba(218, 34, 255, 0.8);
    }
}

/* --- NEW CAKE STYLES --- */
.cake-container {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    margin-top: 20px;
}

.cake-plate {
    width: 280px;
    height: 20px;
    background: #f0f0f0;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    position: absolute;
    bottom: 60px;
}

.cake-bottom {
    width: 240px;
    height: 90px;
    background: #fcf1d8;
    /* Cake sponge */
    border-radius: 12px;
    position: absolute;
    bottom: 70px;
    border: 3px solid #eab308;
    /* yellow-600 */
}

.icing-bottom {
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    height: 40px;
    background: #f48fb1;
    /* Pink icing */
    border-radius: 12px 12px 0 0;
}

.drip {
    position: absolute;
    width: 20px;
    height: 30px;
    background: #f48fb1;
    border-radius: 0 0 10px 10px;
    top: 20px;
}

.drip.d1 {
    left: 20px;
}

.drip.d2 {
    left: 80px;
    height: 25px;
}

.drip.d3 {
    left: 140px;
}

.drip.d4 {
    left: 200px;
    height: 25px;
}

.cake-top {
    width: 180px;
    height: 80px;
    background: #fcf1d8;
    border-radius: 8px;
    position: absolute;
    bottom: 160px;
    /* On top of bottom layer */
    border: 3px solid #eab308;
}

.icing-top {
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    height: 40px;
    background: #f0abfc;
    /* Lighter pink/purple icing */
    border-radius: 8px 8px 0 0;
}

/* NEW: Candle Container */
.candle-container {
    position: absolute;
    bottom: 230px;
    /* On top of top cake layer */
    width: 140px;
    display: flex;
    justify-content: space-around;
    z-index: 10;
}

.candle {
    position: relative;
    width: 12px;
    height: 45px;
    background: #ffffff;
    border-radius: 5px 5px 0 0;
    border: 2px solid #e0e0e0;
}

/* Colorful candles */
.candle:nth-child(even) {
    background-image: linear-gradient(to top, #a7f3d0 33%, #ffffff 33%, #ffffff 66%, #a7f3d0 66%);
}

.candle:nth-child(odd) {
    background-image: linear-gradient(to top, #fbcfe8 33%, #ffffff 33%, #ffffff 66%, #fbcfe8 66%);
}

.flame {
    position: absolute;
    width: 12px;
    height: 20px;
    background: #f6b900;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    animation: flicker 1s infinite alternate;
    transform-origin: bottom;
    cursor: pointer;
}

.flame.blown-out {
    animation: none;
    opacity: 0;
    transform: translateX(-50%) scaleY(0);
    transition: all 0.3s ease-out;
}

@keyframes flicker {
    0% {
        transform: translateX(-50%) scaleY(1) scaleX(1);
    }

    50% {
        transform: translateX(-52%) scaleY(1.1) scaleX(1.1);
    }

    100% {
        transform: translateX(-48%) scaleY(1) scaleX(1);
    }
}

.smoke {
    position: absolute;
    top: -40px;
    left: 50%;
    width: 5px;
    height: 10px;
    background: #b0b0b0;
    border-radius: 3px;
    opacity: 0;
    transform-origin: bottom;
}

.flame.blown-out+.smoke {
    animation: smoke-rise 2s ease-out forwards;
}

@keyframes smoke-rise {
    0% {
        opacity: 0;
        transform: translate(-50%, 0) scale(0);
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -30px) scale(1.5);
    }
}

/* --- END CAKE STYLES --- */

/* Typing animation */
.typing-container {
    width: 90%;
    max-width: 600px;
    text-align: center;
}

.typing-text {
    overflow: hidden;
    border-right: .15em solid #f48fb1;
    white-space: nowrap;
    margin: 0.5rem auto;
    letter-spacing: .05em;
    animation: typing 3s steps(30, end), blink-caret .75s step-end infinite;
    /* NEW: Better readability */
    color: #111;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.4);
}

.typing-text:nth-child(2) {
    animation-delay: 3s;
    animation-name: typing-2;
    animation-duration: 3s;
    width: 0;
}

.typing-text:nth-child(3) {
    animation-delay: 6s;
    animation-name: typing-3;
    animation-duration: 4s;
    width: 0;
}

@keyframes typing {
    from {
        width: 0
    }

    to {
        width: 100%
    }
}

@keyframes typing-2 {
    from {
        width: 0
    }

    to {
        width: 100%
    }
}

@keyframes typing-3 {
    from {
        width: 0
    }

    to {
        width: 100%
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent
    }

    50% {
        border-color: #f48fb1
    }
}

/* Card swiper */
.card-swiper {
    width: 100%;
    height: 100%;
    display: flex;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.card-swiper::-webkit-scrollbar {
    display: none;
}

.card {
    flex: 0 0 100vw;
    height: 100vh;
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px;
    text-align: center;
    position: relative;
}

/* NEW: Upgraded Card Content Box */
.card-content {
    width: 90%;
    max-width: 400px;
    min-height: 450px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    /* Use glass effect */
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* NEW: Update doodle and text colors for contrast on glass */
.card-content h2,
.card-content p,
.card-content h3 {
    color: #212121;
    /* Darker text for readability */
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.2);
}

.card-content .text-pink-500 {
    color: #d81b60;
    /* Stronger pink */
}

.card-content .text-pink-600 {
    color: #c2185b;
    /* Stronger pink */
}

/* Doodles */
.doodle-ghost {
    width: 100px;
    height: 120px;
    background: #fff;
    border: 3px solid #333;
    border-radius: 50% 50% 40% 40% / 60% 60% 50% 50%;
    position: relative;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.doodle-ghost::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 0;
    width: 100%;
    height: 20px;
    background: #fff;
    border-bottom: 3px solid #333;
    border-radius: 0 0 50% 50% / 0 0 100% 100%;
}

.doodle-ghost .eye {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #333;
    border-radius: 50%;
    top: 40px;
}

.doodle-ghost .eye.left {
    left: 30px;
}

.doodle-ghost .eye.right {
    right: 30px;
}

.doodle-ghost .mouth {
    position: absolute;
    width: 20px;
    height: 10px;
    border: 3px solid transparent;
    border-bottom-color: #333;
    border-radius: 0 0 100% 100%;
    top: 55px;
    left: 50%;
    transform: translateX(-50%);
}

.doodle-ghost .blush {
    position: absolute;
    width: 10px;
    height: 5px;
    background: #fbcfe8;
    border-radius: 50%;
    top: 50px;
}

.doodle-ghost .blush.left {
    left: 15px;
}

.doodle-ghost .blush.right {
    right: 15px;
}

.doodle-heart {
    color: #ef4444;
    font-size: 3rem;
    animation: beat 1.5s infinite;
}

@keyframes beat {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.doodle-bean {
    width: 50px;
    height: 70px;
    background: #84cc16;
    border: 3px solid #3f6212;
    border-radius: 50% / 40% 40% 60% 60%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.7rem;
    color: #3f6212;
    font-weight: bold;
}

/* Swipe prompt */
.swipe-prompt {
    position: absolute;
    bottom: 30px;
    font-size: 0.9rem;
    color: #111;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
    animation: bounce-right 2s infinite;
}

@keyframes bounce-right {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(0);
    }

    40% {
        transform: translateX(5px);
    }

    60% {
        transform: translateX(3px);
    }
}

/* NEW: Confetti Animation */
.confetti {
    position: absolute;
    top: -20px;
    width: 10px;
    height: 10px;
    opacity: 0;
    animation: fall-and-fade 4s linear forwards;
    z-index: 100;
}

.confetti:nth-child(even) {
    width: 15px;
    height: 8px;
    border-radius: 0;
}

@keyframes fall-and-fade {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(110vh) rotate(720deg);
        opacity: 0;
    }
}