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

/* 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;
}

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

.letter-window{
    width: 90vw;
    max-width: 800px;
    aspect-ratio: 3/2;
    padding: 20px 20px 0 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    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: 10px;
    padding-top: 120px;

    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: 28px;
    margin: 0;
    line-height: 1.1;
}

p {
    font-size: 18px;
    margin: 0;
}

/* Cat */

.cat {
    width: 250px;
    margin: 10px 0;
    transition: width 0.4s ease;
}

.letter-window.final .cat {
    width: 180px;
}

/* buttons */
.buttons {
    display: flex;
    justify-content: flex-start;
    gap: 30px;
    position: relative;
}

.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{
    max-width: 520px;

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

/* Photos row + subtitle */
.photos{
    display:flex;
    gap:14px;
    align-items:center;
    justify-content:center;
    margin-top: 6px;
}

#justina-photo, #me-photo{
    width: 140px;
    height: 140px;
    border-radius: 999px;
    object-fit: cover;
    display: block;
    box-shadow: 0 10px 28px rgba(0,0,0,0.28);
    border: 3px solid rgba(255,255,255,0.78);
    background: rgba(255,255,255,0.25);
}

#subtitle{
    margin: 10px 0 0;
    text-align: center;
    font-size: 16px;
    line-height: 1.3;
    opacity: 0.95;
}

.final-text .ps{
    display:inline-block;
    margin-top: 10px;
}

/* Make photo pop on final screen */
.letter-window.final #justina-photo,
.letter-window.final #me-photo{
    width: 170px;
    height: 170px;
    margin-top: 2px;
}

#envelope-container p{
    font-size: 22px;
    margin-top: 10px;
    width: 100%;
    text-align: center;
}


/* --- Layout polish for text blocks --- */
#subtitle{
    max-width: 520px;
    width: calc(100% - 80px);
    margin: 10px auto 0;
    font-size: 16px;
    line-height: 1.35;
    text-align: center;
}

/* Final message box (keeps text neat inside the frame) */
.final-text{
    max-width: 560px;
    width: calc(100% - 80px);
    margin: 8px auto 0;
    padding: 14px 18px;
    box-sizing: border-box;
    background: rgba(255,255,255,0.60);
    border: 2px solid rgba(255,255,255,0.55);
    border-radius: 14px;
    line-height: 1.35;
    font-size: 16px;
    text-align: center;
}

.final-text strong{
    display: block;
    margin-bottom: 6px;
    font-size: 18px;
}

.final-text .ps{
    display:block;
    margin-top: 10px;
}


/* Question inside the frame */
#letter-title{
    max-width: 560px;
    width: calc(100% - 90px);
    margin: 8px auto 0;
    padding: 8px 14px;
    box-sizing: border-box;
    background: rgba(255,255,255,0.55);
    border: 2px solid rgba(255,255,255,0.45);
    border-radius: 14px;
    font-size: 22px;
    line-height: 1.2;
}

/* --- Toast notification --- */
.toast{
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.92);
  border: 2px solid rgba(255,255,255,0.55);
  box-shadow: 0 14px 34px rgba(0,0,0,0.25);
  font-size: 16px;
  cursor: pointer;
  user-select: none;
  max-width: min(520px, calc(100vw - 40px));
  text-align: center;
}

/* --- Modal --- */
.modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 18px;
  box-sizing: border-box;
}

.modal-card{
  width: min(520px, 100%);
  background: rgba(255,240,245,0.98);
  border: 2px solid rgba(255,255,255,0.55);
  border-radius: 18px;
  box-shadow: 0 18px 44px rgba(0,0,0,0.35);
  padding: 16px;
  position: relative;
  text-align: center;
}

.modal-close{
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: rgba(255,255,255,0.8);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.modal-img{
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 10px 22px rgba(0,0,0,0.22);
}

.modal-text{
  margin-top: 12px;
  font-size: 18px;
  line-height: 1.35;
}

.modal-play{
  margin-top: 10px;
  padding: 10px 18px;
  border: none;
  border-radius: 12px;
  background: #e75480;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}
