:root {
    /* Valentine's Dream Palette */
    --bg-gradient: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%);
    --card-bg: rgba(255, 255, 255, 0.25); /* Frosted Glass Pink */
    --card-border: rgba(255, 255, 255, 0.4);
    --card-shine: rgba(255, 255, 255, 0.3);
    
    --primary-gradient: linear-gradient(to right, #ff758c 0%, #ff7eb3 100%);
    --accent-gold: #FFD700;
    --accent-red: #D4145A;
    --accent-soft-pink: #FFB7B2;
    
    --text-main: #FFFFFF; /* White text looks best on deep pinks, or dark grey on light pinks. Let's go with deep pink bg so white text. */
    --text-muted: rgba(255, 255, 255, 0.9);
    --text-highlight: #FFE5B4; /* Peach/Gold */
    
    --shadow-soft: 0 15px 35px rgba(255, 117, 140, 0.4);
    --glow-text: 0 0 10px rgba(255, 255, 255, 0.8);
}

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(to top, #fad0c4 0%, #fad0c4 1%, #ffd1ff 100%); /* Soft Pastel Pink/Peach */
    /* Let's try a deeper one for contrast if user insists on "Pink with hearts", usually means bright/cute. */
    background: linear-gradient(120deg, #f093fb 0%, #f5576c 100%); /* Lush Pink to Red */
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    margin: 0;
}

#three-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

#app-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.stage {
    position: absolute;
    width: 90%;
    max-width: 650px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px) scale(0.95);
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stage.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Premium Glass Card */
.glass-card {
    background: rgba(255, 255, 255, 0.2); /* Increased opacity for visibility */
    /* backdrop-filter: blur(40px); Stronger blur */
    -webkit-backdrop-filter: blur(40px);
    /* border: 2px solid rgba(255, 255, 255, 0.6); Thicker, brighter border */
    /* border-top: 2px solid rgba(255, 255, 255, 0.8); /* Extra pop on top */
    /* border-bottom: 2px solid rgba(255, 255, 255, 0.3); */
    border-radius: 30px;
    padding: 60px;
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.15), /* Deeper drop shadow */
        0 0 0 1px rgba(255, 255, 255, 0.2) inset; /* Inner subtle stroke */
    text-align: center;
    width: 100%;
    position: relative;
    overflow: hidden; 
}

/* Dynamic Shine Effect */
.glass-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 60%);
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.6s, transform 0.6s;
    pointer-events: none;
}

.glass-card:hover::after {
    opacity: 1;
    transform: scale(1);
}

.title {
    font-family: 'Dancing Script', cursive;
    font-size: 4.5rem;
    margin-bottom: 20px;
    margin-bottom: 20px;
    background: #fff; /* Solid white looks cleaner on vibrant background */
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 10px rgba(212, 20, 90, 0.2);
    padding-bottom: 10px; /* Prevent descender clipping */
}

.subtitle {
    font-size: 1.3rem;
    margin-bottom: 40px;
    font-weight: 300;
    letter-spacing: 0.8px;
    color: rgba(255, 255, 255, 0.8);
}

.stage-title {
    font-size: 2rem;
    margin-bottom: 30px;
    background: linear-gradient(45deg, var(--accent-gold), #ffffff); /* Gold to soft red */
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)); /* Shadow helps visibility */
}

/* Characters */
.pet-preview {
    display: flex;
    gap: 50px;
    font-size: 70px;
    margin-bottom: 40px;
    justify-content: center;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.4));
}

.pet {
    animation: float 4s ease-in-out infinite;
}
.cat { animation-delay: 1.5s; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* Premium Buttons */
.primary-btn {
    background: transparent;
    position: relative;
    padding: 18px 50px;
    font-size: 1.2rem;
    border: none;
    border-radius: 50px;
    color: #fff;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s ease;
    z-index: 1;
    box-shadow: 0 0 20px rgba(255, 0, 153, 0.3);
    font-weight: 600;
    letter-spacing: 1px;
}

.primary-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 300%; 
    height: 100%;
    background: linear-gradient(115deg, #ff9a9e, #fad0c4, #ff9a9e); /* Peach/Pink shift */
    background-size: 50% 100%;
    z-index: -1;
    transition: all 0.5s ease;
    border-radius: 50px;
}

.primary-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 30px rgba(255, 0, 153, 0.6);
}

.primary-btn:hover::before {
    background-position: 100% 0;
}

/* Game Canvas */
#game-canvas {
    width: 100%;
    height: 400px;
    background: rgba(0, 0, 0, 0.2); /* Semi-transparent to show body gradient */
    border-radius: 20px;
    margin: 30px 0;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.5), 0 0 20px rgba(0, 242, 254, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer; /* Interaction */
}

.score-display {
    font-size: 1.5rem;
    color: var(--accent-gold);
    font-weight: bold;
    text-shadow: 0 0 10px var(--accent-red);
    margin-top: 15px;
}

/* 3D Dice */
/* 3D Dice - Love Cube Style */
.dice-container {
    perspective: 1200px;
    margin: 50px auto;
    width: 160px;
    height: 160px;
    position: relative;
}

.dice-3d {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dice-face {
    position: absolute;
    width: 160px;
    height: 160px;
    background: #ffffff;
    /* Soft pink gradient tint */
    background: linear-gradient(135deg, #fff 0%, #fff0f5 100%);
    border: 3px solid var(--accent-gold);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: 800; /* Extra bold */
    color: var(--accent-red); /* Deep Pink/Red text */
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    box-shadow: inset 0 0 20px rgba(255, 183, 178, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    backface-visibility: visible;
}

.dice-face.exploding {
    animation: explodeFace 1.5s forwards cubic-bezier(0.19, 1, 0.22, 1);
    background: var(--accent-red); /* Turn red on explosion */
    color: #fff;
    border-color: #fff;
}

@keyframes explodeFace {
    0% { transform: var(--transform-start) scale(1); opacity: 1; }
    100% { transform: var(--transform-start) translateZ(400px) rotateZ(180deg) rotateX(45deg); opacity: 0; }
}

.front  { --transform-start: rotateY(0deg) translateZ(80px); transform: var(--transform-start); }
.right  { --transform-start: rotateY(90deg) translateZ(80px); transform: var(--transform-start); }
.back   { --transform-start: rotateY(180deg) translateZ(80px); transform: var(--transform-start); }
.left   { --transform-start: rotateY(-90deg) translateZ(80px); transform: var(--transform-start); }
.top    { --transform-start: rotateX(90deg) translateZ(80px); transform: var(--transform-start); }
.bottom { --transform-start: rotateX(-90deg) translateZ(80px); transform: var(--transform-start); }

/* Heart Reveal Logo */
.heart-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 120px;
    height: 120px;
    pointer-events: none;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
}

.heart-shape {
    position: relative;
    width: 60px;
    height: 60px;
    background-color: var(--accent-red);
    transform: rotate(-45deg);
    box-shadow: 0 0 40px rgba(212, 20, 90, 0.8);
    animation: heartPulse 1.5s infinite;
}

.heart-shape:before,
.heart-shape:after {
    content: "";
    position: absolute;
    width: 60px;
    height: 60px;
    background-color: var(--accent-red);
    border-radius: 50%;
}

.heart-shape:before {
    top: -30px;
    left: 0;
}

.heart-shape:after {
    left: 30px;
    top: 0;
}

@keyframes heartPulse {
    0% { transform: rotate(-45deg) scale(1); }
    15% { transform: rotate(-45deg) scale(1.1); }
    30% { transform: rotate(-45deg) scale(1); }
    45% { transform: rotate(-45deg) scale(1.1); }
    100% { transform: rotate(-45deg) scale(1); }
}

.growing {
    animation: growHeart 2s forwards elastic;
}

@keyframes growHeart {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2); opacity: 1; }
}

.heart-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin-top: 0; 
    width: 90vw; /* Relative to viewport to ensure it fits on screen */
    max-width: 500px;
    text-align: center;
    font-size: 2.2rem; 
    color: #fff;
    opacity: 0; 
    font-weight: 800;
    text-shadow: 0 0 10px #D4145A, 0 0 20px #D4145A;
    pointer-events: none;
    z-index: 101; 
    white-space: normal; /* Allow wrapping */
    line-height: 1.2;
    font-family: 'Dancing Script', cursive;
}

/* Memory Lane */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin: 40px 0;
    perspective: 1000px;
}

.memory-item {
    height: 160px;
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.memory-front, .memory-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 20px;
    padding: 20px;
    box-sizing: border-box;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.memory-front {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 50px;
}

.memory-back {
    background: linear-gradient(135deg, #FF512F 0%, #DD2476 100%); /* Passionate Red/Pink */
    transform: rotateY(180deg);
    color: #fff;
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    font-size: 1.15rem;
    line-height: 1.5;
}

.memory-item.flipped {
    transform: rotateY(180deg);
}

/* Question Stage */
.question-text {
    font-family: 'Dancing Script', cursive;
    font-size: 3.5rem;
    margin: 30px 0;
    background: linear-gradient(to right, #ffffff, #ffecec);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent; /* Standard property */
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.5));
}

.btn-group {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
 }

.yes-btn {
    background: linear-gradient(45deg, #00b09b, #96c93d); /* Fresh Green/Teal */
    color: white;
    font-weight: bold;
    font-size: 1.5rem;
    padding: 20px 60px;
    border-radius: 50px;
    border: none;
    box-shadow: 0 0 30px rgba(0, 176, 155, 0.4);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
}

.yes-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 50px rgba(0, 176, 155, 0.8);
}

.no-btn {
    background: linear-gradient(45deg, #ff416c, #ff4b2b); /* Vibrant Red/Orange */
    color: white;
    font-weight: bold;
    font-size: 1.5rem;
    padding: 20px 60px;
    border-radius: 50px;
    border: none;
    box-shadow: 0 0 30px rgba(255, 75, 43, 0.4);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
}

.no-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 50px rgba(255, 75, 43, 0.8);
}

/* Victory */
.hidden { display: none !important; }

.victory-title {
    font-family: 'Dancing Script';
    font-size: 4rem;
    background: linear-gradient(to right, #FFD166, #FF00CC);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px rgba(255, 0, 204, 0.4));
}

.date-details {
    margin-top: 30px;
    font-style: italic;
    color: var(--accent-gold);
}

.celebration-animation {
    margin: 30px 0;
}

.pet-dance {
    font-size: 60px;
    animation: dance 2s infinite ease-in-out;
}

.bird-fly {
    font-size: 40px;
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 10px;
}

.bird-fly div {
    animation: wing-beat 0.5s infinite alternate;
}

@keyframes dance {
    0%, 100% { transform: scale(1) rotate(0); }
    50% { transform: scale(1.2) rotate(10deg); }
}

@keyframes wing-beat {
    from { transform: translateY(0); }
    to { transform: translateY(-20px); }
}

/* Final Pets in Question Stage */
.final-pets {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 60px;
    margin-bottom: 30px;
}

.floating-pet {
    animation: float 3s ease-in-out infinite;
}

.bird-pet.big {
    font-size: 70px;
    animation-delay: 0.5s;
}

.bird-pet.small.ghost {
    opacity: 0.6;
    animation-delay: 1s;
    font-size: 40px;
}


@media (max-width: 768px) {
    #app-container {
        align-items: stretch; /* Stretch to fill height */
    }

    .stage {
        width: 100%;
        max-width: 100%;
        height: 100%; /* Full screen height */
        border-radius: 0;
    }

    .glass-card {
        width: 100%;
        height: 100%; /* Fill the stage */
        border-radius: 0; /* Remove rounded corners */
        padding: 30px 20px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        box-shadow: none; /* Flatten for full screen */
        overflow-y: auto; /* Allow scrolling if content is tall */
        border: none;
        background: rgba(255, 255, 255, 0.45); /* More opaque for mobile readability */
    }

    .title { font-size: 3.5rem; }
    .question-text { font-size: 2.5rem; }
    
    .memory-grid { 
        gap: 15px; 
        margin: 20px auto; /* Centered with auto margin */
        width: 100%; /* Force full width within the card */
    }
    
    /* Ensure other containers fill the mobile card */
    .input-group,
    .btn-group,
    .pet-love-scene,
    .dice-container,
    .intro-card > *,
    .victory-card > * {
        width: 100%;
        max-width: 100%;
    }

    .dice-container {
        display: flex;
        justify-content: center;
        margin-bottom: 60px; /* Add space for the explosion */
    }

    .heart-text {
        width: 90vw;
    }
    
    .intro-card {
        padding-top: 20px;
        padding-bottom: 20px;
    }

    /* Adjust game canvas height for mobile */
    #game-canvas {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .memory-grid { grid-template-columns: 1fr; } 
    .title { font-size: 3rem; }
}

/* Intro Card Styling */
.intro-card {
    padding-top: 50px;
    padding-bottom: 50px;
}

.heart-beat {
    display: inline-block;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    15% { transform: scale(1.3); }
    30% { transform: scale(1); }
    45% { transform: scale(1.3); }
    60% { transform: scale(1); }
    100% { transform: scale(1); }
}

.pet-love-scene {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin: 40px 0;
}

.pet-avatar {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 55px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    animation: floatAvatar 4s ease-in-out infinite;
}

.dog-avatar { animation-delay: 0s; }
.cat-avatar { animation-delay: 2s; }

@keyframes floatAvatar {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.pet-avatar:hover {
    transform: scale(1.1) rotate(5deg);
    background: rgba(255, 255, 255, 0.4);
}

.love-connector {
    font-size: 30px;
    animation: sparkle 2s infinite;
}

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

.pulse-action {
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* Password Stage Styling */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    width: 100%;
    max-width: 350px; /* Limit width */
    margin: 30px auto 0;
}

#password-input {
    width: 100%;
    padding: 18px 25px; /* Match button padding */
    font-size: 1.2rem;
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    outline: none;
    text-align: center;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); 
    box-sizing: border-box; /* Important for width */
}

#password-input::placeholder {
    color: rgba(255, 255, 255, 0.75);
    font-weight: 300;
}

#password-input:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: #fff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

#password-submit-btn {
    width: 100%; /* Match input width */
    box-sizing: border-box;
}
