* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    position: fixed;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #ffe6ea;
    font-family: 'Nunito', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
}

.background-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.floating-element {
    position: absolute;
    user-select: none;
    pointer-events: none;
}

.music-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    border: 2px solid #ff8fa3;
    cursor: pointer;
    z-index: 200;
    font-size: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(255, 143, 163, 0.3);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.music-btn:hover { transform: scale(1.1); }
.music-btn:active { transform: scale(0.9); }

.container {
    position: relative;
    z-index: 10;
    perspective: 1500px;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.envelope-wrapper {
    position: relative;
    width: 400px;
    height: 280px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.envelope-wrapper:hover {
    transform: scale(1.02);
}

.envelope-back {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #ffb3c1;
    border-radius: 4px;
    z-index: 1;
    box-shadow: 0 15px 40px rgba(255, 107, 129, 0.4);
}

.envelope-pocket {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    background-color: #ff477e;
    clip-path: polygon(0 0, 50% 50%, 100% 0, 100% 100%, 0 100%);
}

.envelope-pocket::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ff758f;
    clip-path: polygon(0 0, 50% 50%, 0 100%);
}

.envelope-pocket::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-color: #ff758f;
    clip-path: polygon(100% 0, 50% 50%, 100% 100%);
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ff8fa3;
    z-index: 4;
    clip-path: polygon(0 0, 50% 52%, 100% 0);
    transform-origin: top;
    transform-style: preserve-3d;
}

.envelope-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.heart-seal {
    font-size: 40px;
    background: #fff;
    width: 75px;
    height: 75px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(255, 71, 126, 0.5);
    animation: pulse 1.2s infinite;
    position: absolute;
    top: 45%;
    transform: translateY(-50%);
    pointer-events: auto;
}

.tap-text {
    position: absolute;
    bottom: 30px;
    font-family: 'Dancing Script', cursive;
    color: white;
    font-size: 32px;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.4);
}

.paper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 370px;
    height: 250px;
    z-index: 2;
    perspective: 2000px;
}

.paper-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

.paper-front-face, .paper-back-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.paper-front-face {
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
}

.paper-back-face {
    background: #fdfdfd;
}

.paper-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 350px;
}

.cat-gif {
    width: 140px;
    height: 140px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 10px;
}

.paper-content h1 {
    font-family: 'Dancing Script', cursive;
    color: #ff477e;
    font-size: 34px;
    margin-bottom: 10px;
    line-height: 1.2;
}

.sub-text {
    font-size: 18px;
    color: #ff758f;
    margin-bottom: 15px;
    font-weight: 700;
}

.divider {
    font-size: 20px;
    margin-bottom: 10px;
}

.promise-text {
    font-size: 16px;
    color: #64748b;
    margin-bottom: 25px;
    font-style: italic;
    line-height: 1.4;
    padding: 0 10px;
}

.buttons {
    display: flex;
    gap: 20px;
    width: 100%;
    justify-content: center;
    position: relative;
    height: 50px;
}

button {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

#yes-btn {
    background: #ff477e;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 71, 126, 0.4);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#no-btn {
    background: #f1f5f9;
    color: #64748b;
    z-index: 40;
}

.success-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffe6ea;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    visibility: hidden;
    opacity: 0;
    overflow: hidden;
}

.big-heart-bg {
    position: absolute;
    font-size: 500px;
    color: rgba(255, 71, 126, 0.1);
    z-index: 0;
    animation: heartThrob 2s infinite;
    user-select: none;
    pointer-events: none;
}

@keyframes heartThrob {
    0%, 100% { transform: scale(1); opacity: 0.1; }
    50% { transform: scale(1.1); opacity: 0.15; }
}

.sunburst {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 250vw;
    height: 250vw;
    background: repeating-conic-gradient(from 0deg, #ffc2d1 0deg 15deg, #ffe6ea 15deg 30deg);
    transform: translate(-50%, -50%);
    animation: rotateSunburst 30s linear infinite;
    opacity: 0.2;
    z-index: 1;
}

@keyframes rotateSunburst {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.success-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
}

.cat-collage {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.happy-cat {
    object-fit: contain;
    border-radius: 20px;
}

.main-cat { width: 280px; height: 280px; box-shadow: 0 10px 30px rgba(255, 71, 126, 0.3); }
.side-cat { width: 120px; height: 120px; opacity: 0.9; }

.bounce-text {
    font-family: 'Dancing Script', cursive;
    color: #ff477e;
    font-size: 64px;
    margin-bottom: 10px;
    text-shadow: 3px 3px 6px rgba(255, 71, 126, 0.2);
    animation: textBounce 1.5s infinite;
}

.rainbow-text {
    font-size: 28px;
    color: #ff758f;
    font-weight: 800;
    margin-bottom: 20px;
    background: linear-gradient(to right, #ff477e, #ff8fa3, #ff477e);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow 3s linear infinite;
}

.success-decoration {
    font-size: 32px;
    letter-spacing: 10px;
    animation: pulseScale 2s infinite;
}

@keyframes textBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.05); }
}

@keyframes rainbow {
    to { background-position: 200% center; }
}

@keyframes pulseScale {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
}

@keyframes pulse {
    0% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.15); }
    100% { transform: translateY(-50%) scale(1); }
}

@media (max-width: 450px) {
    /* REMOVED SCALE(0.75) - Using direct dimensions for mobile stability */
    .envelope-wrapper { 
        width: 300px; 
        height: 210px; 
    }
    
    .cat-collage {
        gap: 5px;
        flex-direction: column;
        align-items: center;
    }
    .main-cat { width: 180px; height: 180px; }
    .side-cat { display: none; }
    
    .bounce-text { font-size: 28px; margin-bottom: 5px; }
    .rainbow-text { font-size: 16px; margin-bottom: 10px; }
    .success-decoration { font-size: 16px; }
    .big-heart-bg { font-size: 250px; }
    
    .paper { 
        width: 94vw;
        max-width: 340px;
        height: 260px;
        padding: 25px 15px; 
    }
    .paper-content { width: 100%; max-width: 310px; }
    .cat-gif { width: 110px; height: 110px; margin-bottom: 12px; }
    .paper-content h1 { font-size: 26px; margin-bottom: 10px; }
    .sub-text { 
        font-size: 16px; 
        margin-bottom: 12px; 
        font-weight: 900; 
        line-height: 1.2; 
        white-space: nowrap;
    }
    .divider { font-size: 18px; margin-bottom: 12px; }
    .promise-text { font-size: 14px; margin-bottom: 22px; line-height: 1.5; }
    button { font-size: 16px; padding: 14px 24px; }
}