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

:root {
    --terminal-green: #00ff41;
    --terminal-bg: #0d1117;
    --paper-color: #f4e8d0;
    --ink-color: #2d1810;
    --heart-pink: #ed95c1;
    --accent-blue: #64b5f6;
}

body {
    font-family: 'IBM Plex Mono', monospace;
    background: var(--terminal-bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    padding: 20px;
}

/* Animated code background */
.code-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.15;
    font-family: 'Courier Prime', monospace;
    font-size: 14px;
    color: var(--terminal-green);
    line-height: 1.6;
    overflow: hidden;
    pointer-events: none;
}

.code-line {
    white-space: nowrap;
    animation: scrollCode 20s linear infinite;
}

.code-line:nth-child(even) {
    animation-duration: 25s;
    animation-delay: -5s;
}

.code-line:nth-child(3n) {
    animation-duration: 30s;
    color: var(--heart-pink);
}

@keyframes scrollCode {
    from { transform: translateX(100%); }
    to { transform: translateX(-100%); }
}

/* Floating hearts */
.heart {
    position: fixed;
    font-size: 20px;
    animation: floatHeart 8s infinite ease-in-out;
    opacity: 0.3;
    pointer-events: none;
}

@keyframes floatHeart {
    0%, 100% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { transform: translateY(-10vh) rotate(360deg); opacity: 0; }
}

/* Letter container */
.letter-container {
    position: relative;
    z-index: 10;
    perspective: 1000px;
    width: 100%;
    max-width: 500px;
}

.letter {
    background: var(--paper-color);
    width: 100%;
    padding: 50px 40px;
    border-radius: 4px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 0 100px rgba(0, 0, 0, 0.03);
    position: relative;
    animation: letterAppear 1s ease-out;
    background-image: 
        repeating-linear-gradient(
            transparent,
            transparent 30px,
            rgba(45, 24, 16, 0.05) 30px,
            rgba(45, 24, 16, 0.05) 31px
        );
}

@keyframes letterAppear {
    from { 
        transform: rotateX(-90deg) translateY(-50px);
        opacity: 0;
    }
    to { 
        transform: rotateX(0deg) translateY(0);
        opacity: 1;
    }
}

/* Stamps and decorations */
.stamp {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border: 3px dashed var(--ink-color);
    transform: rotate(12deg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    opacity: 0.7;
}

.code-snippet {
    position: absolute;
    top: 15px;
    left: 20px;
    font-family: 'Courier Prime', monospace;
    font-size: 10px;
    color: var(--terminal-green);
    opacity: 0.4;
    transform: rotate(-5deg);
}

h1 {
    font-family: 'Special Elite', cursive;
    color: var(--ink-color);
    text-align: center;
    font-size: 32px;
    margin-bottom: 30px;
    letter-spacing: 1px;
    position: relative;
}

h1::before,
h1::after {
    content: '💖';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
}

h1::before { left: -40px; }
h1::after { right: -40px; }

.message {
    font-family: 'Special Elite', cursive;
    color: var(--ink-color);
    text-align: center;
    font-size: 18px;
    margin-bottom: 35px;
    line-height: 1.6;
}

.buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    position: relative;
    height: 60px;
    margin-top: 20px;
}

button {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 600;
    padding: 12px 30px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

#yesBtn {
    background: linear-gradient(135deg, #f8427e 0%, #fabbcd 100%);
    color: white;
    position: relative;
}

#yesBtn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(241, 9, 86, 0.5);
}

#yesBtn:active {
    transform: scale(0.98);
}

#noBtn {
    background: linear-gradient(135deg, #1791f5 0%, #aec8eb 100%);
    padding: 12px 40px;
    color: white;
    top: 70%;
    position: absolute;
}

#noBtn:hover {
    background: linear-gradient(135deg, #7652e1 0%, #988ae3 100%);
}

/* Success reveal */
.reveal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 17, 23, 0.95);
    z-index: 100;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    animation: fadeIn 0.5s ease-out;
    padding: 20px;
}

.reveal.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.photo-container {
    position: relative;
    animation: photoFly 1s ease-out;
    margin-bottom: 30px;
}

@keyframes photoFly {
    0% { 
        transform: translateY(-100vh) rotate(-180deg) scale(0);
        opacity: 0;
    }
    60% {
        transform: translateY(20px) rotate(5deg) scale(1.1);
    }
    100% { 
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
}

.photo {
    width: 350px;
    height: 350px;
    border-radius: 20px;
    box-shadow: 
        0 30px 80px rgba(255, 105, 180, 0.3),
        0 0 0 10px white,
        0 0 0 11px var(--heart-pink);
    object-fit: cover;
    animation: photoGlow 2s ease-in-out infinite;
}


.heart-overlay {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    opacity: 0.2;
    filter: invert(78%) sepia(92%) saturate(600%) hue-rotate(295deg) brightness(110%) contrast(105%);
    animation: heartPulse 2s ease-in-out infinite;
}

@keyframes photoGlow {
    0%, 100% { 
        filter: drop-shadow(0 30px 80px rgba(255, 105, 180, 0.5)) drop-shadow(0 0 20px rgba(255, 105, 180, 0.3));
    }
    50% { 
        filter: drop-shadow(0 30px 100px rgba(255, 105, 180, 0.8)) drop-shadow(0 0 40px rgba(100, 181, 246, 0.5));
    }
}

@keyframes heartPulse {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.15);
    }
}

.happy-message {
    font-family: 'Special Elite', cursive;
    font-size: 48px;
    color: var(--heart-pink);
    text-align: center;
    animation:
        messageAppear 1s ease-out 0.5s both,
        floatText 3s ease-in-out infinite 1.5s;
    text-shadow: 0 0 20px rgba(255, 105, 180, 0.5);
}

@keyframes messageAppear {
    from { 
        opacity: 0;
        transform: scale(0.5);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

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

.sparkles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.sparkle {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: sparkleFloat 3s ease-in-out infinite;
}

@keyframes sparkleFloat {
    0%, 100% { 
        opacity: 0;
        transform: translateY(0) scale(0);
    }
    50% { 
        opacity: 1;
        transform: translateY(-50px) scale(1);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .code-background {
        font-size: 10px;
    }

    .letter {
        padding: 40px 25px;
    }

    h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }

    h1::before,
    h1::after {
        font-size: 18px;
    }

    h1::before { left: -30px; }
    h1::after { right: -30px; }

    .message {
        font-size: 16px;
        margin-bottom: 25px;
    }

    .message strong {
        font-size: 20px !important;
    }

    .stamp {
        width: 50px;
        height: 50px;
        font-size: 24px;
        top: 15px;
        right: 15px;
    }

    .code-snippet {
        font-size: 8px;
        top: 12px;
        left: 15px;
    }

    button {
        padding: 10px 25px;
        font-size: 14px;
    }

    #noBtn {
        padding: 10px 30px;
    }

    .photo {
        width: 280px;
        height: 280px;
        border-radius: 15px;
        box-shadow: 
            0 20px 60px rgba(255, 105, 180, 0.3),
            0 0 0 8px white,
            0 0 0 9px var(--heart-pink);
    }

    .heart-overlay {
        width: 450px;
        height: 450px;
    }

    .happy-message {
        font-size: 32px;
    }

    .buttons {
        height: 50px;
    }
}

@media (max-width: 480px) {
    .letter {
        padding: 30px 20px;
    }

    h1 {
        font-size: 20px;
    }

    h1::before,
    h1::after {
        font-size: 16px;
    }

    h1::before { left: -25px; }
    h1::after { right: -25px; }

    .message {
        font-size: 14px;
    }

    .message strong {
        font-size: 18px !important;
    }

    button {
        padding: 8px 20px;
        font-size: 12px;
    }

    #noBtn {
        padding: 8px 25px;
    }

    .photo {
        width: 240px;
        height: 240px;
        border-radius: 12px;
        box-shadow: 
            0 15px 50px rgba(255, 105, 180, 0.3),
            0 0 0 6px white,
            0 0 0 7px var(--heart-pink);
    }

    .heart-overlay {
        width: 380px;
        height: 380px;
    }

    .happy-message {
        font-size: 24px;
    }

    .stamp {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

/* Landscape mobile fixes */
@media (max-height: 600px) and (orientation: landscape) {
    .photo {
        width: 200px;
        height: 200px;
    }

    .happy-message {
        font-size: 24px;
    }

    .letter {
        padding: 25px 20px;
    }

    h1 {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .message {
        font-size: 13px;
        margin-bottom: 20px;
    }
}