/* ========================================
   💕 A LOVE LETTER ACROSS LIFETIMES 💕
   ======================================== */

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

body {
    min-height: 100vh;
    background: linear-gradient(135deg, 
        #1a0a1e 0%, 
        #2d1b3d 25%,
        #1e0a2e 50%,
        #2a1235 75%,
        #1a0a1e 100%
    );
    font-family: 'Cormorant Garamond', serif;
    color: #fff;
    overflow-x: hidden;
    position: relative;
}

.reveal-body {
    background: linear-gradient(135deg, 
        #0a0015 0%, 
        #1a0a2e 30%,
        #2d1040 50%,
        #1a0a2e 70%,
        #0a0015 100%
    );
}

/* ========================================
   FLOATING HEARTS
   ======================================== */
.hearts-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.floating-heart {
    position: absolute;
    bottom: -50px;
    animation: floatUp linear infinite;
    filter: drop-shadow(0 0 10px rgba(255, 100, 150, 0.5));
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg) scale(0.5);
        opacity: 0;
    }
}

/* ========================================
   TWINKLING STARS
   ======================================== */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #fff;
    border-radius: 50%;
    animation: twinkle ease-in-out infinite;
    box-shadow: 0 0 6px #fff, 0 0 12px rgba(255, 200, 255, 0.5);
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* ========================================
   ROSE PETALS
   ======================================== */
.petals-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.rose-petal {
    position: absolute;
    top: -30px;
    width: 15px;
    height: 20px;
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: fallPetal linear infinite;
    opacity: 0.7;
    filter: drop-shadow(0 0 5px rgba(255, 100, 150, 0.5));
}

@keyframes fallPetal {
    0% {
        transform: translateY(0) rotate(0deg) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(100vh) rotate(720deg) translateX(100px);
        opacity: 0;
    }
}

/* ========================================
   GLOW ORBS
   ======================================== */
.glow-orb {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, 
        rgba(255, 100, 150, 0.3) 0%, 
        rgba(150, 50, 100, 0.1) 50%,
        transparent 70%
    );
    filter: blur(60px);
    animation: orbPulse 4s ease-in-out infinite;
    z-index: 0;
}

.orb-pink {
    background: radial-gradient(circle, 
        rgba(255, 150, 200, 0.4) 0%, 
        rgba(200, 100, 150, 0.2) 50%,
        transparent 70%
    );
}

@keyframes orbPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* ========================================
   MAIN CONTAINER
   ======================================== */
.main-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
    padding: 2rem;
}

/* ========================================
   WELCOME SCREEN
   ======================================== */
.welcome-screen {
    text-align: center;
    animation: fadeInUp 1.5s ease-out;
}

.welcome-content {
    position: relative;
    z-index: 1;
}

.infinity-symbol {
    font-size: 4rem;
    color: #ff6b9d;
    margin-bottom: 1rem;
    animation: infinityPulse 2s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(255, 100, 150, 0.8);
}

@keyframes infinityPulse {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.1);
        filter: brightness(1.3);
    }
}

.title-animate {
    font-family: 'Dancing Script', cursive;
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #ffb8d0 50%, #ff6b9d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    animation: titleShimmer 3s ease-in-out infinite;
}

@keyframes titleShimmer {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.2);
    }
}

.subtitle-animate {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-style: italic;
    color: rgba(255, 200, 220, 0.9);
    margin-bottom: 2rem;
    animation: fadeIn 2s ease-out 0.5s both;
}

.rose-decoration {
    font-size: 3rem;
    margin: 1.5rem 0;
    animation: roseSway 3s ease-in-out infinite;
}

@keyframes roseSway {
    0%, 100% {
        transform: rotate(-5deg);
    }
    50% {
        transform: rotate(5deg);
    }
}

.instruction-text {
    font-size: 1.2rem;
    color: rgba(255, 200, 220, 0.7);
    margin-bottom: 2rem;
    font-style: italic;
}

.enter-btn {
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
    border: none;
    padding: 1.2rem 3rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
    color: #fff;
    border-radius: 50px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    box-shadow: 0 10px 40px rgba(255, 100, 150, 0.4);
}

.enter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.enter-btn:hover::before {
    left: 100%;
}

.enter-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 50px rgba(255, 100, 150, 0.6);
}

.btn-hearts {
    margin-left: 0.5rem;
}

/* ========================================
   NAME SCREEN
   ======================================== */
.name-screen {
    text-align: center;
    width: 100%;
    max-width: 600px;
}

.name-content {
    position: relative;
    z-index: 1;
}

.feather-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: featherFloat 3s ease-in-out infinite;
}

@keyframes featherFloat {
    0%, 100% {
        transform: translateY(0) rotate(-5deg);
    }
    50% {
        transform: translateY(-10px) rotate(5deg);
    }
}

.name-title {
    font-family: 'Dancing Script', cursive;
    font-size: 3rem;
    background: linear-gradient(135deg, #fff 0%, #ffb8d0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.name-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 200, 220, 0.7);
    font-style: italic;
    margin-bottom: 3rem;
}

.input-container {
    position: relative;
    margin-bottom: 2rem;
}

.name-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(255, 150, 200, 0.3);
    padding: 1rem 0;
    font-family: 'Dancing Script', cursive;
    font-size: 2.5rem;
    color: #fff;
    text-align: center;
    letter-spacing: 0.3rem;
    outline: none;
    transition: all 0.3s ease;
}

.name-input::placeholder {
    color: rgba(255, 200, 220, 0.4);
    font-size: 1.2rem;
    font-family: 'Cormorant Garamond', serif;
    letter-spacing: 0.1rem;
}

.name-input:focus {
    border-bottom-color: #ff6b9d;
}

.input-underline {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #ff6b9d, #ffb8d0, #ff6b9d);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.name-input:focus ~ .input-underline {
    width: 100%;
}

.input-glow {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 20px;
    background: radial-gradient(ellipse, rgba(255, 100, 150, 0.3) 0%, transparent 70%);
    filter: blur(10px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.name-input:focus ~ .input-glow {
    opacity: 1;
}

.typed-letters {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin: 2rem 0;
    min-height: 60px;
}

.typed-letter {
    font-family: 'Dancing Script', cursive;
    font-size: 2.5rem;
    color: #ff6b9d;
    animation: letterPop 0.5s ease-out both;
    text-shadow: 0 0 20px rgba(255, 100, 150, 0.8);
}

@keyframes letterPop {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    50% {
        transform: scale(1.3) rotate(10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

.hint-text {
    font-size: 1.1rem;
    min-height: 30px;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.hint-text.success {
    color: #ffb8d0;
    animation: hintPulse 1s ease-in-out infinite;
}

.hint-text.error {
    color: #ff6b9d;
}

@keyframes hintPulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

.submit-btn {
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 50%, #ff6b9d 100%);
    background-size: 200% 100%;
    border: none;
    padding: 1.2rem 3rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
    color: #fff;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 10px 40px rgba(255, 100, 150, 0.4);
}

.submit-btn.pulse-glow {
    animation: submitGlow 1.5s ease-in-out infinite;
}

@keyframes submitGlow {
    0%, 100% {
        box-shadow: 0 10px 40px rgba(255, 100, 150, 0.4);
        background-position: 0% 50%;
    }
    50% {
        box-shadow: 0 10px 60px rgba(255, 100, 150, 0.8);
        background-position: 100% 50%;
    }
}

.submit-btn:hover {
    transform: translateY(-3px) scale(1.05);
}

.heart-icon {
    margin-left: 0.5rem;
}

/* ========================================
   ERROR SCREEN
   ======================================== */
.error-screen {
    text-align: center;
}

.error-content {
    position: relative;
    z-index: 1;
}

.sad-heart {
    font-size: 5rem;
    margin-bottom: 2rem;
    animation: heartBreak 2s ease-in-out infinite;
}

@keyframes heartBreak {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.1) rotate(-5deg);
    }
    75% {
        transform: scale(0.9) rotate(5deg);
    }
}

.error-message {
    font-size: 1.5rem;
    color: rgba(255, 200, 220, 0.8);
    font-style: italic;
    margin-bottom: 2rem;
}

.try-again-btn {
    background: transparent;
    border: 2px solid #ff6b9d;
    padding: 1rem 2.5rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    color: #ff6b9d;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.try-again-btn:hover {
    background: #ff6b9d;
    color: #fff;
    box-shadow: 0 10px 30px rgba(255, 100, 150, 0.4);
}

/* ========================================
   REVEAL PAGE
   ======================================== */
.reveal-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
    padding: 2rem;
}

.letter-reveal {
    text-align: center;
    width: 100%;
    max-width: 800px;
}

.name-display {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 3rem;
}

.name-letter {
    font-family: 'Dancing Script', cursive;
    font-size: 2.5rem;
    width: 50px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: all 0.5s ease;
}

.name-letter.hidden-letter {
    background: rgba(255, 100, 150, 0.1);
    color: rgba(255, 200, 220, 0.3);
}

.name-letter.revealed {
    background: linear-gradient(135deg, rgba(255, 100, 150, 0.3), rgba(200, 70, 105, 0.3));
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 100, 150, 0.8);
    box-shadow: 0 5px 20px rgba(255, 100, 150, 0.3);
}

.name-letter.current {
    background: linear-gradient(135deg, #ff6b9d, #c44569);
    color: #fff;
    transform: scale(1.2);
    box-shadow: 0 10px 40px rgba(255, 100, 150, 0.6);
    animation: currentPulse 1s ease-in-out infinite;
}

@keyframes currentPulse {
    0%, 100% {
        box-shadow: 0 10px 40px rgba(255, 100, 150, 0.6);
    }
    50% {
        box-shadow: 0 10px 60px rgba(255, 100, 150, 0.9);
    }
}

.current-letter-container {
    position: relative;
    margin-bottom: 3rem;
}

.current-letter-container.animate .current-letter {
    animation: letterRevealAnim 1s ease-out;
}

.letter-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 100, 150, 0.4) 0%, transparent 70%);
    filter: blur(40px);
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0.9;
    }
}

.current-letter {
    font-family: 'Dancing Script', cursive;
    font-size: 8rem;
    background: linear-gradient(135deg, #fff 0%, #ffb8d0 50%, #ff6b9d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
    text-shadow: none;
    filter: drop-shadow(0 0 30px rgba(255, 100, 150, 0.8));
}

@keyframes letterRevealAnim {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

.message-container {
    margin-bottom: 3rem;
    min-height: 200px;
}

.main-message {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 1.5rem;
    transition: opacity 0.5s ease;
}

.sub-message {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    font-style: italic;
    color: rgba(255, 200, 220, 0.8);
    transition: opacity 0.5s ease;
}

.next-btn {
    background: linear-gradient(135deg, rgba(255, 100, 150, 0.2), rgba(200, 70, 105, 0.2));
    border: 2px solid rgba(255, 100, 150, 0.5);
    padding: 1rem 2.5rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
    color: #ffb8d0;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.next-btn:hover {
    background: linear-gradient(135deg, #ff6b9d, #c44569);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 10px 40px rgba(255, 100, 150, 0.5);
    transform: translateY(-3px);
}

.arrow {
    transition: transform 0.3s ease;
}

.next-btn:hover .arrow {
    transform: translateX(5px);
}

/* ========================================
   FINAL SCREEN
   ======================================== */
.final-screen {
    text-align: center;
    width: 100%;
    max-width: 900px;
    position: relative;
}

.final-glow {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, 
        rgba(255, 100, 150, 0.3) 0%, 
        rgba(150, 50, 100, 0.1) 50%,
        transparent 70%
    );
    filter: blur(80px);
    z-index: 0;
}

.celebration-hearts {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 100;
}

.celebration-heart {
    position: absolute;
    font-size: 2rem;
    animation: burstOut 2s ease-out forwards;
}

@keyframes burstOut {
    0% {
        transform: translate(0, 0) scale(0);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translate(
            calc(cos(var(--angle)) * var(--distance)),
            calc(sin(var(--angle)) * var(--distance))
        ) scale(1);
        opacity: 0;
    }
}

.final-name {
    font-family: 'Dancing Script', cursive;
    font-size: 4rem;
    background: linear-gradient(135deg, #fff 0%, #ffb8d0 50%, #ff6b9d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
    animation: finalNameGlow 2s ease-in-out infinite;
}

@keyframes finalNameGlow {
    0%, 100% {
        filter: brightness(1) drop-shadow(0 0 20px rgba(255, 100, 150, 0.5));
    }
    50% {
        filter: brightness(1.2) drop-shadow(0 0 40px rgba(255, 100, 150, 0.8));
    }
}

.letter-paper {
    background: linear-gradient(135deg, 
        rgba(255, 250, 245, 0.95) 0%, 
        rgba(255, 240, 235, 0.95) 100%
    );
    border-radius: 20px;
    padding: 3rem;
    margin-bottom: 2rem;
    position: relative;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        inset 0 2px 10px rgba(255, 255, 255, 0.5);
    overflow: hidden;
}

.paper-texture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 30px,
            rgba(200, 150, 150, 0.03) 30px,
            rgba(200, 150, 150, 0.03) 31px
        );
    pointer-events: none;
}

.letter-content {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
    line-height: 2;
    color: #3a2a2a;
    text-align: left;
    position: relative;
    z-index: 1;
}

.closing-message {
    font-family: 'Dancing Script', cursive;
    font-size: 2rem;
    color: #ffb8d0;
    margin: 2rem 0;
    animation: closingPulse 2s ease-in-out infinite;
}

@keyframes closingPulse {
    0%, 100% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

.forever-together {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

.infinity {
    font-size: 2rem;
    color: #ff6b9d;
    animation: infinityRotate 4s linear infinite;
}

@keyframes infinityRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.love-text {
    font-family: 'Dancing Script', cursive;
    font-size: 1.5rem;
    color: #ffb8d0;
}

.restart-btn {
    background: transparent;
    border: 2px solid rgba(255, 100, 150, 0.5);
    padding: 1rem 2.5rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    color: #ffb8d0;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.restart-btn:hover {
    background: linear-gradient(135deg, #ff6b9d, #c44569);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 10px 40px rgba(255, 100, 150, 0.5);
}

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

.fade-in {
    animation: fadeIn 0.8s ease-out;
}

.fade-out {
    animation: fadeOut 0.8s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .title-animate {
        font-size: 2.5rem;
    }
    
    .subtitle-animate {
        font-size: 1.3rem;
    }
    
    .name-input {
        font-size: 1.8rem;
    }
    
    .typed-letter {
        font-size: 1.8rem;
    }
    
    .name-letter {
        font-size: 1.5rem;
        width: 35px;
        height: 45px;
    }
    
    .current-letter {
        font-size: 5rem;
    }
    
    .main-message {
        font-size: 1.2rem;
    }
    
    .final-name {
        font-size: 2.5rem;
    }
    
    .letter-paper {
        padding: 1.5rem;
    }
    
    .letter-content {
        font-size: 1.1rem;
    }
}
