/* ================================================================
   DESIGN SYSTEM — Gilman ♥ Fariha
   Premium romantic dark theme with rose-gold accents
   ================================================================ */

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Rose-gold palette */
    --rose-100: #fff0f3;
    --rose-200: #ffccd5;
    --rose-300: #ffb3c1;
    --rose-400: #ff8fa3;
    --rose-500: #ff758f;
    --rose-600: #ff4d6d;
    --rose-700: #c9184a;
    
    /* Deep romantic tones */
    --plum-900: #0d0015;
    --plum-800: #1a0a2e;
    --plum-700: #2d1b4e;
    --plum-600: #44276d;
    
    /* Gold accent */
    --gold-300: #ffd700;
    --gold-400: #e8b931;
    --gold-500: #c9a227;
    
    /* Glass */
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
    
    /* Typography */
    --ff-script: Arial, sans-serif;
    --ff-display: Arial, sans-serif;
    --ff-body: Arial, sans-serif;
    --ff-vibes: Arial, sans-serif;
    
    /* Transitions */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--ff-body);
    background: var(--plum-900);
    color: var(--rose-100);
    overflow: hidden;
    height: 100dvh;
    height: 100vh;
    width: 100vw;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Screens ---------- */
.screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s var(--ease-out-expo), visibility 0.8s;
    z-index: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    z-index: 10;
}

/* ================================================================
   CONFETTI CANVAS
   ================================================================ */
#confettiCanvas {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    width: 100%;
    height: 100%;
}

/* ================================================================
   FLOATING HEARTS BACKGROUND
   ================================================================ */
.floating-hearts {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.floating-heart {
    position: absolute;
    bottom: -60px;
    font-size: 1.2rem;
    opacity: 0;
    animation: floatUp linear infinite;
    pointer-events: none;
}

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

/* ================================================================
   SCREEN 1: WELCOME
   ================================================================ */
.welcome-glow {
    position: absolute;
    width: min(600px, 90vw);
    height: min(600px, 90vw);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 77, 109, 0.25) 0%, transparent 70%);
    animation: pulseGlow 4s ease-in-out infinite;
    z-index: 0;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.3); opacity: 1; }
}

.welcome-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 1.5rem;
    max-height: 100dvh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Sparkle ring */
.sparkle-ring {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    flex-shrink: 0;
}

.sparkle {
    position: absolute;
    font-size: 1.4rem;
    color: var(--gold-300);
    animation: sparkleFloat 3s ease-in-out infinite;
    text-shadow: 0 0 10px var(--gold-300);
}

.s1 { top: 0;  left: 50%; transform: translateX(-50%); animation-delay: 0s; }
.s2 { top: 20%; right: 0;  animation-delay: 0.5s; }
.s3 { bottom: 20%; right: 0;  animation-delay: 1s; }
.s4 { bottom: 0; left: 50%; transform: translateX(-50%); animation-delay: 1.5s; }
.s5 { bottom: 20%; left: 0;  animation-delay: 2s; }
.s6 { top: 20%; left: 0;  animation-delay: 2.5s; }

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

/* Welcome title */
.welcome-title {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 1rem;
}

.welcome-title .line1 {
    font-family: var(--ff-vibes);
    font-size: clamp(2rem, 7vw, 4.5rem);
    color: var(--rose-400);
    text-shadow: 0 0 40px rgba(255, 141, 163, 0.5);
    animation: fadeSlideUp 1s var(--ease-out-expo) 0.2s both;
}

.welcome-title .line2 {
    font-family: var(--ff-display);
    font-size: clamp(1rem, 3.5vw, 2rem);
    font-weight: 400;
    color: var(--rose-200);
    animation: fadeSlideUp 1s var(--ease-out-expo) 0.5s both;
}

.welcome-title .line3 {
    font-family: var(--ff-display);
    font-size: clamp(1rem, 3.5vw, 2rem);
    font-weight: 600;
    font-style: italic;
    color: var(--rose-300);
    animation: fadeSlideUp 1s var(--ease-out-expo) 0.8s both;
}

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

.welcome-sub {
    font-family: var(--ff-script);
    font-size: clamp(1rem, 3vw, 1.3rem);
    color: var(--rose-300);
    margin-bottom: 1.5rem;
    animation: fadeSlideUp 1s var(--ease-out-expo) 1.1s both;
}

.gilman-name {
    color: var(--gold-300);
    font-weight: 700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

/* Enter button */
.enter-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 2.5rem;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--rose-600), var(--rose-700));
    color: white;
    font-family: var(--ff-body);
    font-size: clamp(1rem, 3vw, 1.2rem);
    font-weight: 500;
    letter-spacing: 0.05em;
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow:
        0 0 20px rgba(255, 77, 109, 0.4),
        0 0 60px rgba(255, 77, 109, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.4s var(--ease-spring);
    animation: fadeSlideUp 1s var(--ease-out-expo) 1.4s both,
               btnPulse 2s ease-in-out 2.4s infinite;
}

.enter-btn:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow:
        0 0 30px rgba(255, 77, 109, 0.6),
        0 0 80px rgba(255, 77, 109, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.enter-btn:active {
    transform: scale(0.96);
}

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

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

@keyframes btnPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 77, 109, 0.4), 0 0 60px rgba(255, 77, 109, 0.2); }
    50% { box-shadow: 0 0 40px rgba(255, 77, 109, 0.6), 0 0 100px rgba(255, 77, 109, 0.3); }
}

.btn-icon {
    font-size: 1.4rem;
    animation: heartBeat 1.2s infinite;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1); }
    42% { transform: scale(1.3); }
    56% { transform: scale(1); }
}

/* Floating petals on welcome screen */
.welcome-petals {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.petal {
    position: absolute;
    font-size: 2rem;
    opacity: 0.4;
    animation: petalDrift 8s ease-in-out infinite;
}

.p1 { top: 10%; left: 10%; animation-delay: 0s; }
.p2 { top: 20%; right: 15%; animation-delay: 1.5s; }
.p3 { bottom: 20%; left: 20%; animation-delay: 3s; }
.p4 { top: 40%; right: 8%; animation-delay: 4.5s; }
.p5 { bottom: 10%; right: 25%; animation-delay: 6s; }

@keyframes petalDrift {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.3; }
    25% { transform: translateY(-20px) rotate(15deg); opacity: 0.6; }
    50% { transform: translateY(-10px) rotate(-10deg); opacity: 0.4; }
    75% { transform: translateY(-30px) rotate(20deg); opacity: 0.5; }
}

/* ================================================================
   SCREEN 2: MESSAGE SCREEN
   ================================================================ */
.dynamic-bg {
    position: absolute;
    inset: 0;
    transition: background 1.5s ease;
    z-index: 0;
}

.message-container {
    position: relative;
    z-index: 2;
    width: min(92vw, 700px);
    max-height: calc(100dvh - 100px);
    max-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* ---------- Design Variant: Glass Card ---------- */
.design-glass .msg-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: clamp(1.5rem, 4vw, 3rem) clamp(1.2rem, 3vw, 2.5rem);
    box-shadow: var(--glass-shadow);
    animation: cardEnter 0.8s var(--ease-spring) both;
}

/* ---------- Design Variant: Neon Glow ---------- */
.design-neon .msg-card {
    background: rgba(13, 0, 21, 0.8);
    border: 2px solid var(--rose-500);
    border-radius: 20px;
    padding: clamp(1.5rem, 4vw, 3rem) clamp(1.2rem, 3vw, 2.5rem);
    box-shadow:
        0 0 15px rgba(255, 117, 143, 0.3),
        0 0 45px rgba(255, 117, 143, 0.1),
        inset 0 0 30px rgba(255, 117, 143, 0.05);
    animation: cardEnter 0.8s var(--ease-spring) both;
}

/* ---------- Design Variant: Polaroid Photo ---------- */
.design-polaroid .msg-card {
    background: #fefefe;
    color: #2d1b4e;
    border-radius: 4px;
    padding: 1rem 1rem 2rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4), 0 2px 6px rgba(0,0,0,0.2);
    transform: rotate(-2deg);
    animation: polaroidDrop 0.8s var(--ease-spring) both;
    max-width: min(420px, 85vw);
}

.design-polaroid .msg-card .card-photo {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 2px;
    margin-bottom: 1rem;
    max-height: 35vh;
}

.design-polaroid .msg-text {
    font-family: var(--ff-script) !important;
    color: #44276d !important;
    font-size: clamp(1rem, 3vw, 1.4rem) !important;
    text-shadow: none !important;
}

.design-polaroid .msg-author {
    color: var(--rose-700) !important;
    text-shadow: none !important;
}

@keyframes polaroidDrop {
    from {
        opacity: 0;
        transform: rotate(-8deg) translateY(-60px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: rotate(-2deg) translateY(0) scale(1);
    }
}

/* ---------- Design Variant: Floating Minimal ---------- */
.design-minimal .msg-card {
    background: transparent;
    padding: 2rem;
    animation: cardEnter 0.8s var(--ease-spring) both;
}

.design-minimal .msg-text {
    font-family: var(--ff-vibes) !important;
    font-size: clamp(1.5rem, 5vw, 3.5rem) !important;
    line-height: 1.4 !important;
    background: linear-gradient(135deg, var(--rose-300), var(--gold-300));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---------- Design Variant: Split Screen with Photo ---------- */
.design-split .msg-card {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: clamp(1rem, 3vw, 2rem);
    box-shadow: var(--glass-shadow);
    animation: cardEnter 0.8s var(--ease-spring) both;
    max-width: min(800px, 92vw);
}

.design-split .card-photo {
    width: min(200px, 35vw);
    height: min(260px, 40vh);
    object-fit: cover;
    border-radius: 16px;
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.design-split .msg-text-wrap {
    flex: 1;
    text-align: left;
}

/* ---------- Design Variant: Sticker Burst ---------- */
.design-sticker .msg-card {
    background: linear-gradient(135deg, var(--plum-700), var(--plum-800));
    border-radius: 30px;
    padding: clamp(1.5rem, 4vw, 3rem) clamp(1.2rem, 3vw, 2.5rem);
    border: 2px solid rgba(255, 215, 0, 0.2);
    box-shadow:
        0 20px 60px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.1);
    animation: cardEnter 0.8s var(--ease-spring) both;
    position: relative;
    overflow: hidden;
}

.design-sticker .msg-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 215, 0, 0.05), transparent, rgba(255, 117, 143, 0.05), transparent);
    animation: rotateBg 8s linear infinite;
}

@keyframes rotateBg {
    to { transform: rotate(360deg); }
}

/* ---------- Design Variant: Typewriter ---------- */
.design-typewriter .msg-card {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border-left: 4px solid var(--rose-500);
    border-radius: 0 12px 12px 0;
    padding: clamp(1.5rem, 4vw, 3rem) clamp(1.2rem, 3vw, 2.5rem);
    animation: slideFromLeft 0.6s var(--ease-out-expo) both;
}

.design-typewriter .msg-text {
    font-family: Arial, sans-serif !important;
    font-size: clamp(0.95rem, 2.5vw, 1.3rem) !important;
    letter-spacing: 0.02em;
    border-right: 2px solid var(--rose-400);
    padding-right: 4px;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { border-color: transparent; }
}

@keyframes slideFromLeft {
    from { opacity: 0; transform: translateX(-60px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ---------- Design Variant: Full Photo Background ---------- */
.design-fullphoto .msg-card {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    min-height: min(400px, 60vh);
    max-height: 80vh;
    width: min(92vw, 600px);
    display: flex;
    align-items: flex-end;
    animation: cardEnter 0.8s var(--ease-spring) both;
}

.design-fullphoto .card-photo-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.design-fullphoto .msg-overlay {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 3rem 2rem 2rem;
    background: linear-gradient(to top, rgba(13, 0, 21, 0.95) 0%, rgba(13, 0, 21, 0.6) 60%, transparent 100%);
}

/* ---------- Design Variant: Circular Photo ---------- */
.design-circle .msg-card {
    text-align: center;
    padding: 2rem;
    animation: cardEnter 0.8s var(--ease-spring) both;
}

.design-circle .card-photo {
    width: min(180px, 40vw);
    height: min(180px, 40vw);
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--rose-400);
    box-shadow: 0 0 30px rgba(255, 117, 143, 0.4);
    margin: 0 auto 1.5rem;
    animation: photoFloat 4s ease-in-out infinite;
}

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

/* ---------- Shared Message Text Styles ---------- */
@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.msg-emoji {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 0.8rem;
    display: block;
    animation: bounceIn 0.6s var(--ease-spring) 0.3s both;
}

@keyframes bounceIn {
    from { transform: scale(0) rotate(-20deg); }
    to { transform: scale(1) rotate(0); }
}

.msg-text {
    font-family: var(--ff-display);
    font-size: clamp(0.95rem, 2.8vw, 1.8rem);
    line-height: 1.5;
    color: var(--rose-100);
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
}

.msg-author {
    font-family: var(--ff-script);
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: var(--gold-300);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    position: relative;
    z-index: 1;
}

/* ---------- Next Button ---------- */
.next-btn {
    position: fixed;
    bottom: 2.5rem;
    right: 2.5rem;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 2rem;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, rgba(255, 77, 109, 0.8), rgba(201, 24, 74, 0.8));
    backdrop-filter: blur(10px);
    color: white;
    font-family: var(--ff-body);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 77, 109, 0.3);
    transition: all 0.3s var(--ease-spring);
}

.next-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 6px 30px rgba(255, 77, 109, 0.5);
}

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

/* ---------- Progress Dots ---------- */
.progress-dots {
    position: fixed;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.4s var(--ease-out-expo);
}

.dot.active {
    background: var(--rose-400);
    box-shadow: 0 0 10px rgba(255, 141, 163, 0.6);
    transform: scale(1.3);
}

.dot.done {
    background: var(--gold-300);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

/* ================================================================
   SCREEN 3: FINALE
   ================================================================ */
.finale-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 50%, rgba(255, 77, 109, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 30%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(201, 24, 74, 0.1) 0%, transparent 50%),
        var(--plum-900);
}

.finale-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 1.5rem 1rem;
    animation: fadeSlideUp 1s var(--ease-out-expo) both;
    max-height: 100dvh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

/* Photo collage */
.photo-collage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    max-width: min(380px, 70vw);
    margin: 0 auto 1.5rem;
    transform: rotate(-1deg);
    flex-shrink: 0;
}

.collage-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: clamp(8px, 2vw, 16px);
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    transition: all 0.5s var(--ease-spring);
}

.collage-img:hover {
    transform: scale(1.08) rotate(2deg);
    border-color: var(--rose-400);
    box-shadow: 0 12px 40px rgba(255, 117, 143, 0.3);
    z-index: 5;
}

.c1 { animation: collageIn 0.8s var(--ease-spring) 0.1s both; }
.c2 { animation: collageIn 0.8s var(--ease-spring) 0.3s both; transform: rotate(2deg); }
.c3 { animation: collageIn 0.8s var(--ease-spring) 0.5s both; transform: rotate(-1deg); }
.c4 { animation: collageIn 0.8s var(--ease-spring) 0.7s both; }

@keyframes collageIn {
    from { opacity: 0; transform: scale(0.5) rotate(-10deg); }
    to { opacity: 1; transform: scale(1) rotate(0); }
}

.finale-title {
    font-family: var(--ff-vibes);
    font-size: clamp(1.8rem, 7vw, 4rem);
    color: var(--rose-300);
    margin-bottom: 0.8rem;
    text-shadow: 0 0 30px rgba(255, 141, 163, 0.4);
}

.heart-icon {
    color: var(--rose-600);
    display: inline-block;
    animation: heartBeat 1.2s infinite;
}

.finale-text {
    font-family: var(--ff-display);
    font-size: clamp(0.95rem, 2.5vw, 1.2rem);
    color: var(--rose-200);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    max-width: min(500px, 90vw);
    margin-left: auto;
    margin-right: auto;
}

.restart-btn {
    display: inline-flex;
    padding: 0.8rem 2.5rem;
    border: 2px solid var(--rose-400);
    border-radius: 50px;
    background: transparent;
    color: var(--rose-300);
    font-family: var(--ff-body);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.4s var(--ease-spring);
}

.restart-btn:hover {
    background: var(--rose-600);
    border-color: var(--rose-600);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 77, 109, 0.4);
}

/* ================================================================
   CELEBRATION STICKERS
   ================================================================ */
.celebration-sticker {
    position: fixed;
    font-size: 3rem;
    z-index: 90;
    pointer-events: none;
    animation: stickerPop 1.5s var(--ease-spring) forwards;
}

@keyframes stickerPop {
    0% {
        transform: scale(0) rotate(-30deg);
        opacity: 0;
    }
    30% {
        transform: scale(1.4) rotate(10deg);
        opacity: 1;
    }
    60% {
        transform: scale(1) rotate(-5deg);
        opacity: 1;
    }
    100% {
        transform: scale(0.8) rotate(0deg) translateY(-30px);
        opacity: 0;
    }
}

/* ================================================================
   CARD EXIT ANIMATION
   ================================================================ */
.msg-card.exit {
    animation: cardExit 0.5s var(--ease-out-expo) forwards;
}

@keyframes cardExit {
    to {
        opacity: 0;
        transform: translateY(-40px) scale(0.9);
    }
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

/* Tablets */
@media (max-width: 768px) {
    .design-split .msg-card {
        flex-direction: column;
    }
    
    .design-split .card-photo {
        width: 100%;
        height: 180px;
    }
    
    .design-split .msg-text-wrap {
        text-align: center;
    }
    
    .message-container {
        padding: 0.8rem;
        max-height: calc(100dvh - 80px);
        max-height: calc(100vh - 80px);
    }
    
    .next-btn {
        bottom: 1.2rem;
        right: 1.2rem;
        padding: 0.6rem 1.3rem;
        font-size: 0.85rem;
    }
    
    .progress-dots {
        bottom: 1.5rem;
    }
    
    .photo-collage {
        max-width: min(260px, 65vw);
        gap: 6px;
    }
    
    .design-fullphoto .msg-card {
        min-height: min(300px, 50vh);
    }
    
    .design-circle .card-photo {
        width: min(130px, 35vw);
        height: min(130px, 35vw);
    }
    
    .sparkle-ring {
        width: 60px;
        height: 60px;
        margin-bottom: 0.5rem;
    }
    
    .sparkle {
        font-size: 1rem;
    }
    
    .welcome-petals .petal {
        font-size: 1.4rem;
    }
}

/* Phones */
@media (max-width: 480px) {
    .welcome-title .line1 {
        font-size: clamp(1.8rem, 9vw, 2.5rem);
    }
    
    .welcome-title .line2,
    .welcome-title .line3 {
        font-size: clamp(0.9rem, 4vw, 1.2rem);
    }
    
    .welcome-sub {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }
    
    .enter-btn {
        padding: 0.7rem 2rem;
        font-size: 0.95rem;
    }
    
    .msg-card {
        padding: 1.2rem 1rem !important;
    }
    
    .msg-emoji {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }
    
    .msg-text {
        font-size: 0.95rem !important;
        line-height: 1.5;
        margin-bottom: 0.8rem;
    }
    
    .msg-author {
        font-size: 0.95rem;
    }
    
    .finale-title {
        font-size: clamp(1.6rem, 8vw, 2.2rem);
    }
    
    .finale-text {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 1rem;
    }
    
    .photo-collage {
        max-width: min(220px, 60vw);
        gap: 5px;
        margin-bottom: 1rem;
    }
    
    .collage-img {
        border-radius: 8px;
        border-width: 2px;
    }
    
    .restart-btn {
        padding: 0.6rem 1.8rem;
        font-size: 0.9rem;
    }
    
    .next-btn {
        bottom: 1rem;
        right: 1rem;
        padding: 0.55rem 1.1rem;
        font-size: 0.8rem;
        gap: 0.3rem;
    }
    
    .next-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .progress-dots {
        bottom: 1.2rem;
        gap: 5px;
    }
    
    .dot {
        width: 6px;
        height: 6px;
    }
    
    .design-fullphoto .msg-card {
        min-height: min(280px, 50vh);
        border-radius: 16px;
    }
    
    .design-fullphoto .msg-overlay {
        padding: 2rem 1rem 1rem;
    }
    
    .design-polaroid .msg-card .card-photo {
        max-height: 28vh;
    }
    
    .design-minimal .msg-text {
        font-size: clamp(1.2rem, 5vw, 2rem) !important;
    }
    
    .sparkle-ring {
        width: 50px;
        height: 50px;
        margin-bottom: 0.4rem;
    }
}

/* Very small phones */
@media (max-width: 360px) {
    .welcome-title .line1 {
        font-size: 1.6rem;
    }
    
    .welcome-title .line2,
    .welcome-title .line3 {
        font-size: 0.85rem;
    }
    
    .msg-text {
        font-size: 0.85rem !important;
    }
    
    .photo-collage {
        max-width: 180px;
    }
    
    .finale-title {
        font-size: 1.5rem;
    }
}

/* Short screens (landscape phones) */
@media (max-height: 500px) {
    .sparkle-ring {
        width: 40px;
        height: 40px;
        margin-bottom: 0.3rem;
    }
    
    .welcome-title {
        margin-bottom: 0.5rem;
    }
    
    .welcome-sub {
        margin-bottom: 0.8rem;
    }
    
    .photo-collage {
        max-width: 180px;
        margin-bottom: 0.8rem;
    }
    
    .finale-title {
        font-size: 1.5rem;
        margin-bottom: 0.4rem;
    }
    
    .finale-text {
        font-size: 0.85rem;
        margin-bottom: 0.8rem;
    }
    
    .message-container {
        max-height: calc(100dvh - 60px);
        max-height: calc(100vh - 60px);
    }
}
