:root {
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
    --accent-color: #ffe66d;
    --bg-color: #f7f9fc;
    --text-color: #2c3e50;
    --font-heading: 'Dancing Script', cursive;
    --font-body: 'Poppins', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden; /* Prevent body scroll */
    min-height: 100vh;
}

/* Utils */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.8s ease-in-out;
}

.hidden {
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

.active {
    opacity: 1;
    z-index: 10;
}

/* Entrance Screen */
#entrance-screen {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    cursor: pointer;
}

.envelope-container {
    perspective: 1000px;
    cursor: pointer;
}

.envelope {
    width: 300px;
    height: 200px;
    background-color: #fff;
    position: relative;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    transform-style: preserve-3d;
    transition: transform 0.5s, box-shadow 0.5s;
}

.envelope.open {
    animation: openEnvelope 2s forwards ease-in-out;
}

@keyframes openEnvelope {
    0% { transform: scale(1); }
    30% { transform: scale(1); } /* Wait for flap */
    40% { transform: scale(1.1) rotate(2deg); } /* Anticipation */
    100% { transform: scale(50); } /* Super zoom */
}

.envelope:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 150px solid transparent;
    border-right: 150px solid transparent;
    border-top: 100px solid #ff6b6b;
    transform-origin: top;
    transition: transform 0.4s ease-in-out; /* Faster flap */
    z-index: 2;
}

.envelope.open .envelope-flap {
    transform: rotateX(180deg);
    z-index: 0;
    transition-delay: 0s;
}

.envelope-content {
    font-size: 3rem;
    transform: translateY(20px);
    transition: transform 0.5s ease 0.2s; /* Faster content pop */
    opacity: 0;
}

.envelope.open .envelope-content {
    transform: translateY(-50px);
    opacity: 1;
}

.click-hint {
    margin-top: 2rem;
    text-align: center;
    color: #fff;
    font-weight: 600;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-10px);}
    60% {transform: translateY(-5px);}
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

/* Main Content */
#main-content {
    /* Position is handled by .screen (fixed) */
    overflow-y: auto;
    padding-bottom: 50px;
    -webkit-overflow-scrolling: touch;
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    position: relative;
    z-index: 2;
}

.icon-btn {
    background: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s;
}

.icon-btn:hover {
    transform: scale(1.1);
}

.visitor-pill {
    background: rgba(255,255,255,0.8);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.message-section {
    text-align: center;
    padding: 4rem 20px;
    position: relative;
    z-index: 1;
}

h1 {
    font-family: var(--font-heading);
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(20px);
}

.message-section p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 0.5rem;
    opacity: 0;
    transform: translateY(20px);
}

/* Animations */
.animate-in {
    animation: fadeInUp 1s forwards;
}

.delay-1 { animation-delay: 0.5s; }
.delay-2 { animation-delay: 1s; }
.delay-3 { animation-delay: 1.5s; }
.delay-4 { animation-delay: 2s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Gallery */
.gallery-section {
    padding: 2rem 0;
    overflow: hidden;
}

.gallery-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 20px;
}

.photo-card {
    width: 200px;
    height: 250px;
    background: white;
    padding: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transform: rotate(calc(var(--i) * 5deg - 10deg));
    transition: transform 0.3s ease;
    cursor: pointer;
}

.photo-card:hover {
    transform: scale(1.1) rotate(0deg);
    z-index: 5;
}

.photo-placeholder {
    width: 100%;
    height: 100%;
    background: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    border-radius: 4px;
}

/* Replay Button */
.replay-section {
    text-align: center;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

.cta-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(255, 107, 107, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: 600;
}

.cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(255, 107, 107, 0.4);
}

.cta-btn:active {
    transform: translateY(1px);
}

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 3rem; }
    .photo-card { width: 150px; height: 200px; }
}
