body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: url("peony-bg-tile.png");
    background-repeat: repeat;
    background-size: 340px 340px;
    font-family: "Pixelify Sans", sans-serif;
    color: #7a3b3b;
}

/* Envelope Screen */
#envelope-container {
    text-align: center;
    cursor: pointer;
}

@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;
}

#envelope-container p {
    font-size: 32px;
    margin-top: 10px;
}

#letter-container {
    display: none;
    position: fixed;
    inset: 0;
    justify-content: center;
    align-items: center;
}

.letter-window {
    width: 90vw;
    max-width: 800px;
    min-height: 60vh;
    padding: 190px 60px 50px 60px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    background-image: url("window.png");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 12px;
    box-sizing: border-box;

    transform: scale(1.2);
    opacity: 0;
    transition: transform 0.6s ease, opacity 0.6s ease;
}

.letter-window.open {
    transform: scale(1);
    opacity: 1;
}

/* Cat */
.cat {
    width: 130px;
    margin-bottom: 10px;
}

/* Letter body / message */
.letter-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    background-color: rgba(255, 245, 245, 0.55);
    border-radius: 12px;
    padding: 20px 26px;
    max-height: 42vh;
    overflow-y: auto;
}

.letter-text {
    font-size: 22px;
    line-height: 1.5;
    margin: 0;
    white-space: pre-wrap;
}

.signature {
    font-size: 22px;
    margin: 0;
    align-self: flex-end;
    font-style: italic;
}

/* Chasing cat (oneko-style sprite) */
#chase-cat {
    position: fixed;
    top: 0;
    left: 0;
    width: 100px;
    height: 106px;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
}

#chase-cat-sprite {
    width: 100%;
    height: 100%;
    background-image: url("cat-spritesheet.png");
    background-repeat: no-repeat;
    background-size: 600px 106px;
    background-position: 0 0;
    image-rendering: pixelated;
    transform-origin: center bottom;
}

#chase-cat.face-left #chase-cat-sprite {
    transform: scaleX(-1);
}

#cat-zzz {
    position: absolute;
    top: -22px;
    right: 6px;
    font-family: "Pixelify Sans", sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: #7a3b3b;
    opacity: 0;
    pointer-events: none;
}

#cat-zzz.show {
    animation: zzz-float 1.6s ease-in-out infinite;
}

@keyframes zzz-float {
    0%   { opacity: 0; transform: translateY(0); }
    20%  { opacity: 1; }
    100% { opacity: 0; transform: translateY(-18px); }
}


