/* ============================================
   VALENTINE'S DAY GAME - STYLES
   For Lolo 💕
   ============================================ */

/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --pink-light: #ffe0ec;
    --pink: #ff6b9d;
    --pink-dark: #e8457a;
    --rose: #ff2d55;
    --red: #ff1744;
    --red-dark: #c51162;
    --purple: #9c27b0;
    --gold: #ffd700;
    --white: #ffffff;
    --cream: #fff5f7;
    --shadow: rgba(255, 107, 157, 0.3);
    --glow: rgba(255, 45, 85, 0.5);
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
}

body {
    background: linear-gradient(135deg, #1a0011 0%, #2d0a1f 25%, #1a0a2e 50%, #2d0a1f 75%, #1a0011 100%);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === FLOATING HEARTS BACKGROUND === */
.hearts-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.floating-heart {
    position: absolute;
    bottom: -50px;
    font-size: 20px;
    opacity: 0;
    animation: floatUp linear infinite;
    pointer-events: none;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-110vh) rotate(720deg) scale(0.3);
        opacity: 0;
    }
}

/* === SCREENS === */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    z-index: 1;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    z-index: 10;
}

/* ============================================
   SCREEN 1: INTRO
   ============================================ */
.intro-container {
    text-align: center;
    padding: 2rem;
}

/* Envelope Animation */
.envelope {
    width: 120px;
    height: 80px;
    margin: 0 auto 2rem;
    position: relative;
    cursor: pointer;
    animation: envelopeBounce 2s ease-in-out infinite;
}

.envelope-body {
    width: 120px;
    height: 80px;
    background: linear-gradient(135deg, #ff6b9d, #ff2d55);
    border-radius: 8px;
    position: relative;
    box-shadow: 0 10px 40px rgba(255, 45, 85, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.envelope-flap {
    width: 0;
    height: 0;
    border-left: 60px solid transparent;
    border-right: 60px solid transparent;
    border-top: 50px solid #e8457a;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    transform-origin: top;
    animation: flapOpen 2s ease-in-out infinite alternate;
}

.letter {
    font-size: 2rem;
    animation: letterPeek 2s ease-in-out infinite alternate;
}

@keyframes envelopeBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes flapOpen {
    0% { transform: rotateX(0deg); }
    100% { transform: rotateX(30deg); }
}

@keyframes letterPeek {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}

/* Intro Title */
.intro-title {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.shimmer {
    background: linear-gradient(
        120deg,
        var(--pink) 0%,
        var(--gold) 25%,
        var(--pink) 50%,
        var(--gold) 75%,
        var(--pink) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmerMove 3s linear infinite;
}

@keyframes shimmerMove {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.intro-subtitle {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    color: var(--pink-light);
    margin-bottom: 1.5rem;
}

.name-highlight {
    color: var(--gold);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    font-weight: 700;
}

.intro-text {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2.5rem;
    font-weight: 300;
}

/* Open Button */
.btn-open {
    background: linear-gradient(135deg, var(--pink), var(--rose));
    border: none;
    color: white;
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px var(--shadow);
}

.btn-open:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 45px var(--glow);
}

.btn-open:active {
    transform: translateY(0) scale(0.98);
}

.btn-icon {
    margin-left: 0.5rem;
    display: inline-block;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.btn-sparkle {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 40%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 60%
    );
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

/* ============================================
   SCREEN 2: JOURNEY
   ============================================ */
.journey-container {
    text-align: center;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
}

.journey-messages {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
}

.journey-msg {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(1.3rem, 4vw, 2rem);
    opacity: 0;
    transform: translateY(30px);
    animation: msgAppear 0.8s ease forwards;
    line-height: 1.4;
}

.journey-msg.fade-out {
    animation: msgFadeOut 0.5s ease forwards;
}

@keyframes msgAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes msgFadeOut {
    to {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
}

.journey-msg .emoji {
    font-size: 2em;
    display: block;
    margin-top: 0.5rem;
}

.journey-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 3rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--pink), var(--rose), var(--gold));
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* ============================================
   SCREEN 3: THE QUESTION
   ============================================ */
.question-container {
    padding: 2rem;
    width: 90%;
    max-width: 550px;
}

.question-card {
    background: linear-gradient(145deg, rgba(255, 107, 157, 0.1), rgba(156, 39, 176, 0.1));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 107, 157, 0.2);
    border-radius: 30px;
    padding: clamp(2rem, 5vw, 3rem);
    text-align: center;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.3),
        inset 0 0 80px rgba(255, 107, 157, 0.05);
    position: relative;
    overflow: visible;
}

.heart-beat {
    font-size: clamp(3rem, 10vw, 5rem);
    animation: heartBeat 1s ease-in-out infinite;
    display: block;
    margin-bottom: 1rem;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.3); }
    30% { transform: scale(1); }
    45% { transform: scale(1.15); }
    60% { transform: scale(1); }
}

.question-title {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(2rem, 6vw, 3rem);
    color: var(--pink-light);
    margin-bottom: 0.2rem;
}

.question-name {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(2.5rem, 8vw, 4rem);
    background: linear-gradient(135deg, var(--pink), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.question-subtitle {
    font-size: clamp(0.8rem, 2vw, 1rem);
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 2rem;
    font-weight: 300;
}

/* Buttons Container */
.buttons-container {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    min-height: 80px;
    position: relative;
}

/* YES Button */
.btn-yes {
    background: linear-gradient(135deg, #00c853, #69f0ae);
    border: none;
    color: white;
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 25px rgba(0, 200, 83, 0.3);
    position: relative;
    z-index: 5;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.btn-yes:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 35px rgba(0, 200, 83, 0.5);
}

/* NO Button */
.btn-no {
    background: linear-gradient(135deg, #78909c, #90a4ae);
    border: none;
    color: white;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 5;
    user-select: none;
}

/* Attempt Counter */
.attempt-counter {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    min-height: 1.5em;
    font-style: italic;
}

/* ============================================
   SCREEN 4: CELEBRATION
   ============================================ */
#confettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.celebration-container {
    text-align: center;
    padding: 2rem;
    position: relative;
    z-index: 50;
}

.celebration-hearts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.celebration-title {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    margin-bottom: 2rem;
}

.letter-pop {
    display: inline-block;
    opacity: 0;
    transform: scale(0) rotate(-180deg);
    animation: letterPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    background: linear-gradient(135deg, var(--gold), var(--pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes letterPop {
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.celebration-message {
    margin-bottom: 2.5rem;
}

.love-text {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    color: var(--pink-light);
    margin-bottom: 0.3rem;
    animation: loveGlow 2s ease-in-out infinite alternate;
}

.love-text-sub {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: var(--pink);
    animation: loveGlow 2s ease-in-out infinite alternate 0.5s;
}

@keyframes loveGlow {
    from { text-shadow: 0 0 10px var(--glow); }
    to { text-shadow: 0 0 30px var(--glow), 0 0 60px rgba(255, 107, 157, 0.2); }
}

.heart-union {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-top: 1rem;
    animation: pulse 2s ease-in-out infinite;
}

/* Love Meter */
.love-meter {
    max-width: 350px;
    margin: 0 auto 2.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(255, 107, 157, 0.15);
}

.love-meter-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

.love-meter-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.love-meter-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--pink), var(--rose), var(--red), var(--gold));
    background-size: 200% 100%;
    border-radius: 6px;
    transition: width 2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: meterShine 2s linear infinite;
}

@keyframes meterShine {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.love-meter-value {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--pink), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Restart Button */
.btn-restart {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-restart:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .question-card {
        padding: 1.5rem;
        border-radius: 20px;
    }

    .buttons-container {
        flex-direction: column;
        gap: 1rem;
    }

    .btn-yes, .btn-no {
        width: 80%;
    }
}

/* ============================================
   UTILITY ANIMATIONS
   ============================================ */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px) rotate(-2deg); }
    40% { transform: translateX(10px) rotate(2deg); }
    60% { transform: translateX(-5px) rotate(-1deg); }
    80% { transform: translateX(5px) rotate(1deg); }
}

/* Particle burst for No button */
.particle {
    position: fixed;
    pointer-events: none;
    font-size: 1.2rem;
    z-index: 1000;
    animation: particleBurst 1s ease-out forwards;
}

@keyframes particleBurst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0) rotate(360deg);
    }
}
