body {
    margin: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: url("heart-bg.jpg");
    font-family: "Pixelify Sans", sans-serif;
    overflow: hidden;
    position: relative;
}

#background-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 5;
    display: block;
}

@media (max-width: 768px) {
    #background-video {
        object-fit: contain;
        background-color: #000;
    }
}

.floating-text {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    max-width: 90vw;
    max-height: 80vh;
    background-color: rgba(0, 0, 0, 0.75);
    padding: 30px;
    border-radius: 15px;
    overflow-y: auto;
    text-align: center;
    animation: fadeIn 0.8s ease-in;
}

.floating-text p {
    font-size: 18px;
    line-height: 1.8;
    color: #ffffff;
    margin: 0;
    font-weight: 500;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .floating-text {
        max-width: 95vw;
        max-height: 70vh;
        padding: 20px;
    }

    .floating-text p {
        font-size: 16px;
        line-height: 1.6;
    }
}

/* Envelope Screen */
#envelope-container {
    text-align: center;
    cursor:pointer;
    position: relative;
    z-index: 10;
}

@keyframes pulse {
    0% {
        transform:scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

#envelope{
    width: 200px;
    animation: pulse 1.5s infinite;
    cursor: pointer;
}

.instruction-text {
    font-size: 18px;
    color: #ffffff;
    margin-top: 20px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 50%, 100% {
        opacity: 1;
    }
    25%, 75% {
        opacity: 0.7;
    }
}

#letter-container{
    display: none;
    position:fixed;
    inset: 0;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.letter-window{
    width: 90vw;
    max-width: 800px;
    aspect-ratio: 3/2;
    padding: 20px 20px 0 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-image: url("window.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 12px;
    gap: 1px;
    padding-top: 180px;

    transform: scale(1.2);
    opacity: 0;
    transition: transform 0.6s ease, opacity 0.6s ease;
}

.letter-window.open {
    transform: scale(1);
    opacity: 1;
}

h1 {
    font-size: 30px;
    margin:0;
}

p {
    font-size: 40px;
}

/* Cat */

.cat {
    width: 250px;
    margin: 10px 0;
    transition: width 0.4s ease;
}

.letter-window.final .cat {
    width: 180px;
}

.scroll-instruction {
    font-size: 18px;
    color: #d63384;
    font-weight: bold;
    text-align: center;
    margin: 15px 0;
    font-style: italic;
}

.next-btn {
    padding: 12px 30px;
    font-size: 18px;
    font-weight: bold;
    background-color: #ff69b4;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.next-btn:hover {
    background-color: #ff1493;
    transform: scale(1.05);
}

.next-btn:active {
    transform: scale(0.95);
}

/* buttons */
.buttons {
    display: flex;
    justify-content: center;
    gap: 30px;
    position: relative;
}

.letter-scroll-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    width: 100%;
    max-height: 400px;
    text-align: left;
    font-size: 16px;
    line-height: 1.8;
}

.letter-scroll-container::-webkit-scrollbar {
    width: 8px;
}

.letter-scroll-container::-webkit-scrollbar-track {
    background: rgba(255, 192, 203, 0.1);
    border-radius: 10px;
}

.letter-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(255, 105, 180, 0.6);
    border-radius: 10px;
}

.letter-scroll-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 105, 180, 0.8);
}

#letter-paragraph {
    margin: 0;
    color: #333;
    font-family: "Pixelify Sans", sans-serif;
}

.no-wrapper{
    position:relative;
}

.btn {
    width: 120px;
    cursor: pointer;
    user-select: none;
}

.yes-btn,
.no-btn {
width: 120px;
height: auto;
display: inline-block;
}

.yes-btn {
    position: relative;
    z-index: 2;
    transform-origin: center center;
    transition: transform 0.3s ease;
}

.no-btn {
    z-index: 1;
    position: relative;
    transition: transform 0.15s ease;
    cursor: default;
}

.final-text{
    font-size: 22px;
    line-height: 1.4;
    text-align: center;
    display: inline-block;
    padding: 10px 20px;
    background-color: rgba(255,240,240,0.5);
    border-radius: 12px;
}