html, body {
    width: 100%;
    height: 100%;
    overflow: hidden; 
}

body {
    background-color: #fce4ec; 
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.card {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    max-width: 90vw;
    max-height: 90vh;
    width: 90%;
    box-sizing: border-box;
}

.image-container svg {
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

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

h1 {
    font-size: clamp(1.3rem, 2.4vw, 1.8rem);
    color: #1e88e5; 
    margin-bottom: 2rem;
    line-height: 1.3;
    word-break: keep-all;
    padding: 0 0.5rem;
}

.buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative; 
}

button {
    border: none;
    padding: 0.8rem 2.5rem;
    border-radius: 50px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
}

#yesBtn {
    background-color: #d81b60; 
    color: white;
    box-shadow: 0 4px 15px rgba(216, 27, 96, 0.3);
}

#yesBtn:hover {
    transform: scale(1.08);
    background-color: #c2185b;
}

.yes-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    transform: scale(0.01);
    transform-origin: center;
    transition: transform 0.8s cubic-bezier(0.2, 0.0, 0.8, 1.0), opacity 0.2s ease;
    z-index: 10002;
    pointer-events: none;
    opacity: 0;
    display: none;
}

.yes-overlay.active {
    display: block;
    opacity: 1;
    transform: scale(1);
}

#noBtn {
    background-color: #f5f5f5;
    color: #333;
}

.subtext {
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 1rem;
}

.video-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    z-index: 10002;
    transition: opacity 1s ease;
}

.video-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.video-overlay.fadeout {
    opacity: 0;
}

#effectVideo {
    width: 100%;
    height: 100%;
    object-fit: contain; 
    background: #000;
}

.final {
    position: fixed;
    inset: 0;
    background: #fce4ec; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    opacity: 0;
    transition: opacity 1.5s ease;
    z-index: 9998;
    pointer-events: none; 
    visibility: hidden;
}

.final.show {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.final-text {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 20px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    pointer-events: none; 
}

.final-text h1 {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: clamp(1.8rem, 5vw, 3rem);
    color: #fff !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    margin-bottom: 0.5rem;
}

.final-text p {
    font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: #fff !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.final.show {
    opacity: 1;
    pointer-events: auto;
}

.final-photos {
    touch-action: none;
    position: absolute;
    inset: 0;
    pointer-events: auto;
    
}

.final-photos img {
    touch-action: none;
    will-change: transform;
    position: absolute;
    width: 110px;
    height: 140px;
    object-fit: cover;
    border: 6px solid #fff;
    border-bottom: 20px solid #fff;
    border-radius: 4px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                top 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                left 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    cursor: zoom-in;
    pointer-events: auto;
}

.final-photos img:hover {
    transform: scale(1.05) rotate(0deg) !important;
    z-index: 5;
}

.final-photos img.active {
    transform: translate(-50%, -50%) !important;
    border: 10px solid #fff;
    border-bottom: 40px solid #fff;
    z-index: 10002;
    cursor: zoom-out;
}

.final-photos img:nth-child(1) { top: 5%; left: 8%; }
.final-photos img:nth-child(2) { top: 8%; right: 8%; }
.final-photos img:nth-child(3) { top: 28%; left: 4%; }
.final-photos img:nth-child(4) { top: 28%; right: 4%; }
.final-photos img:nth-child(5) { bottom: 28%; left: 4%; }
.final-photos img:nth-child(6) { bottom: 28%; right: 4%; }
.final-photos img:nth-child(7) { bottom: 8%; left: 10%; }
.final-photos img:nth-child(8) { bottom: 8%; right: 10%; }

.replay {
    pointer-events: auto;
    margin-top: 2rem;
    font-size: 1.2rem;
    border: none;
    background: #f5f5f5;
    border-radius: 999px;
    padding: 0.6rem 1.4rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.replay:hover { background: #eee; }

.stamp {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.4rem;
    z-index: 10005;
    pointer-events: none;
}

.stamp.show {
    display: flex;
    opacity: 1;
}

.stamp .block {
    font-weight: 800;
    letter-spacing: 0.2rem;
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    color: #fff;
    text-shadow: 0 0 10px rgba(255,255,255,0.4);
    opacity: 0;
    transform: scale(1.3) rotate(-2deg);
    text-align: center;
    padding: 0 1rem;
}

.stamp.show .block {
    animation: stampIn 0.25s ease forwards, stampSpin 2s linear forwards;
    animation-delay: var(--d), calc(var(--d) + 0.3s);
    transform-origin: center;
}

@keyframes stampIn {
    0% { opacity: 0; transform: scale(1.6) rotate(-5deg); }
    70% { opacity: 1; transform: scale(0.95) rotate(0deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes stampSpin {
    0% { opacity: 1; transform: rotate(0deg); }
    50% { opacity: 1; transform: rotate(360deg); }
    100% { opacity: 0; transform: rotate(720deg); }
}

@media (max-width: 768px) {
    .card {
        width: 100%;
        height: 100vh;
        max-width: none;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        box-shadow: none;
        padding: 2rem 1.5rem;
    }

    h1 { font-size: 1.4rem; color: #1e88e5; }
    p { color: #1e88e5; }

    .buttons {
        flex-wrap: wrap;
        gap: 0.8rem;
    }

    button { padding: 0.7rem 2rem; }

    .image-container svg { width: 120px; height: 120px; }

    .final { font-size: 1.6rem; text-align: center; padding: 0 1rem; }
    .final p { font-size: 1rem; color: #fff; }

    .final-photos img {
        width: 60px;
        height: 85px;
    }

    #effectVideo {
        object-fit: cover; 
    }
    
    body {
        background-color: white; 
    }
}

#testFinalBtn {
    z-index: 10050;
    pointer-events: auto;
}
