:root {
    --primary-color: #FFB7B2;
    --secondary-color: #FFDAC1;
    --accent-color: #E2F0CB;
    --text-color: #555;
    --bg-color: #FFF5F5;
    --font-main: 'Noto Sans SC', sans-serif;
    --font-cute: 'ZCOOL KuaiLe', cursive;
    --font-hand: 'Ma Shan Zheng', cursive;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-main);
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-color);
    overflow: hidden;
    /* Prevent scrolling for the game */
    height: 100vh;
    width: 100vw;
    position: relative;
}

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

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Background Elements */
.bg-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Abstract Blobs */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.4;
    animation: blobFloat 20s infinite alternate;
}

.blob-1 {
    width: 300px;
    height: 300px;
    background: #FF9AA2;
    top: -50px;
    left: -50px;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: #B5EAD7;
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
}

.blob-3 {
    width: 250px;
    height: 250px;
    background: #C7CEEA;
    top: 40%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes blobFloat {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(30px, 50px) scale(1.1);
    }
}

/* SVG Decorations */
.deco-icon {
    position: absolute;
    /* Increased size for better visibility of details */
    width: 120px;
    height: 120px;
    /* Removed color override to allow SVG internal colors */
    animation: float 8s ease-in-out infinite;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.1));
    /* Add depth */
}

.rabbit-1 {
    top: 10%;
    left: 5%;
    animation-delay: 0s;
    width: 150px;
    height: 150px;
}

.rabbit-2 {
    bottom: 15%;
    right: 5%;
    animation-delay: 2s;
    width: 130px;
    height: 130px;
    transform: scaleX(-1);
    /* Flip */
}

.cake {
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 180px;
    animation-delay: 1s;
    z-index: 1;
}

.b1 {
    top: 15%;
    right: 15%;
    width: 100px;
    height: 100px;
    animation-delay: 3s;
}

.b2 {
    top: 45%;
    left: 5%;
    width: 90px;
    height: 90px;
    animation-delay: 1.5s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

/* Candle Flicker */
.flame {
    transform-origin: center bottom;
    animation: flicker 1.5s ease-in-out infinite alternate;
}

@keyframes flicker {
    0% {
        transform: scale(1) rotate(-2deg);
        opacity: 0.9;
    }

    25% {
        transform: scale(1.1) rotate(2deg);
        opacity: 1;
    }

    50% {
        transform: scale(0.9) rotate(-1deg);
        opacity: 0.8;
    }

    75% {
        transform: scale(1.05) rotate(1deg);
        opacity: 1;
    }

    100% {
        transform: scale(1) rotate(-2deg);
        opacity: 0.9;
    }
}

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
    z-index: 1;
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 10;
}

/* Intro Screen */
#intro-screen {
    background: linear-gradient(135deg, #fff0f0 0%, #ffe9e9 100%);
}

.intro-text {
    font-family: var(--font-cute);
    font-size: 2rem;
    text-align: center;
    line-height: 1.5;
    animation: popIn 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Game Screen */
#game-screen {
    /* No background here to see bg elements, or semi-transparent */
    background: rgba(255, 255, 255, 0.8);
}

#game-question {
    position: absolute;
    top: 20%;
    font-family: var(--font-cute);
    font-size: 2rem;
    color: #FF6B6B;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
}

.game-btn {
    position: absolute;
    padding: 20px 40px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 50px;
    font-family: var(--font-cute);
    font-size: 1.2rem;
    color: white;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.1),
        inset 0 0 10px rgba(255, 255, 255, 0.4);
    transition: transform 0.1s, width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), height 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), font-size 0.5s;
    white-space: nowrap;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 2px;
}

.happy {
    background: linear-gradient(135deg, rgba(255, 154, 162, 0.9) 0%, rgba(255, 183, 178, 0.9) 100%);
    left: 20%;
    top: 50%;
}

.unhappy {
    background: linear-gradient(135deg, rgba(181, 234, 215, 0.9) 0%, rgba(199, 206, 234, 0.9) 100%);
    right: 20%;
    top: 50%;
    color: #fff;
}

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


/* Message Screen */
#message-screen {
    background: #fff;
    padding: 20px;
    overflow-y: auto;
    /* Allow scrolling if text is long on small screens */
    display: block;
    /* Override flex for scrolling */
}

.message-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 2px solid #FFB7B2;
}

.message-content h3 {
    font-family: var(--font-cute);
    color: #FF6B6B;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.message-content p {
    font-family: var(--font-hand);
    /* Handwritten style */
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 15px;
    text-align: justify;
}

.signature {
    text-align: right;
    margin-top: 20px;
    font-weight: bold;
    color: #FF9AA2;
}

.next-btn {
    display: block;
    margin: 30px auto 0;
    padding: 12px 40px;
    background: #FFB7B2;
    color: white;
    border: none;
    border-radius: 25px;
    font-family: var(--font-cute);
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s;
}

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

/* Polaroid Screen */
#polaroid-screen {
    background-color: #FFDAC1;
}

.camera-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.camera {
    width: 200px;
    height: 180px;
    background: #fff;
    border-radius: 30px;
    position: relative;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    z-index: 5;
    cursor: pointer;
    transition: transform 0.2s;
}

.camera:active {
    transform: scale(0.95);
}

.lens {
    width: 100px;
    height: 100px;
    background: #333;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 5px solid #ddd;
}

.lens::after {
    content: '';
    position: absolute;
    top: 20px;
    right: 20px;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.flash {
    width: 30px;
    height: 30px;
    background: #ddd;
    border-radius: 5px;
    position: absolute;
    top: 20px;
    right: 20px;
}

.shutter {
    width: 30px;
    height: 10px;
    background: #FF6B6B;
    border-radius: 5px;
    position: absolute;
    top: -5px;
    right: 40px;
}

.output-slot {
    width: 160px;
    height: 10px;
    background: #222;
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 5px;
}

.photo-wrapper {
    position: absolute;
    top: 150px;
    /* Start inside/behind camera */
    left: 50%;
    transform: translateX(-50%) scale(0.5);
    opacity: 0;
    transition: all 1.5s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 4;
}

.photo-wrapper.developed {
    top: 220px;
    transform: translateX(-50%) scale(1) rotate(-5deg);
    opacity: 1;
}

.polaroid {
    background: #fff;
    padding: 15px 15px 40px 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    width: 220px;
    text-align: center;
}

.photo-frame {
    width: 100%;
    height: 220px;
    /* Square-ish */
    background: #eee;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 2s ease 1s;
    /* Slow develop effect */
}

.photo-wrapper.developed img {
    opacity: 1;
}

.click-hint {
    margin-top: 20px;
    font-family: var(--font-cute);
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

.meteor-btn {
    margin-top: 300px;
    /* Push below photo */
    padding: 10px 30px;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid #fff;
    color: #fff;
    border-radius: 20px;
    font-family: var(--font-cute);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.5s;
}

.meteor-btn.visible {
    opacity: 1;
}

.hidden {
    display: none;
}

/* Meteor Screen */
#meteor-screen {
    background: #000;
}

#meteor-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.wish-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-family: var(--font-cute);
    font-size: 2rem;
    opacity: 0;
    animation: fadeIn 2s ease 1s forwards;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

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

/* Confetti */
#confetti-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
}

/* Typing Effect */
.typing-cursor::after {
    content: '|';
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}