:root {
    --primary-color: #ff3333;
    --secondary-color: #0b3d91;
    --gold: #ffd700;
    --white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

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

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    font-family: 'Quicksand', sans-serif;
    overflow: hidden;
    color: var(--white);
    position: relative;
}

/* Background Animation Layer */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: linear-gradient(125deg, #000000 0%, #0b1021 50%, #1b0c16 100%);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

.bg-animation::before, .bg-animation::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    mix-blend-mode: screen;
}

.bg-animation::before {
    background: radial-gradient(circle at 50% 50%, rgba(76, 175, 80, 0.1), transparent 60%),
                radial-gradient(circle at 10% 20%, rgba(20, 100, 200, 0.2), transparent 50%),
                radial-gradient(circle at 90% 80%, rgba(138, 43, 226, 0.2), transparent 50%);
    animation: aurora 20s infinite alternate;
    filter: blur(40px);
}

.bg-animation::after {
    background: radial-gradient(circle at 80% 20%, rgba(255, 107, 107, 0.15), transparent 50%),
                radial-gradient(ellipse at 20% 80%, rgba(100, 255, 218, 0.1), transparent 50%);
    animation: aurora-reverse 25s infinite alternate;
    filter: blur(60px);
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes aurora {
    0% { transform: scale(1) translate(0, 0); opacity: 0.5; }
    50% { transform: scale(1.2) translate(5%, 5%); opacity: 0.8; }
    100% { transform: scale(1) translate(-5%, -5%); opacity: 0.5; }
}

@keyframes aurora-reverse {
    0% { transform: scale(1.1) translate(0, 0); opacity: 0.6; }
    50% { transform: scale(1) translate(-5%, 5%); opacity: 0.3; }
    100% { transform: scale(1.1) translate(5%, -5%); opacity: 0.6; }
}

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

.snowflake {
    position: absolute;
    top: -10px;
    color: white;
    font-size: 1em;
    opacity: 0.8;
    user-select: none;
    animation-name: fall;
    animation-timing-function: linear;
    text-shadow: 0 0 5px rgba(255,255,255,0.8);
}

@keyframes fall {
    to {
        transform: translateY(105vh) rotate(360deg);
    }
}

/* --- INTRO SCREEN STYLES --- */
.intro-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.6); 
    transition: opacity 0.8s ease-out;
}

.intro-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.typing-text {
    font-family: 'Lobster', cursive;
    font-size: 3rem;
    margin-bottom: 2rem;
    min-height: 4rem;
    text-align: center;
    padding: 0 20px;
    animation: christmas-lights-text 2s infinite linear;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
}

@keyframes christmas-lights-text {
    0% { color: #ff3333; text-shadow: 0 0 15px #ff3333; }
    25% { color: #ffd700; text-shadow: 0 0 15px #ffd700; }
    50% { color: #2ecc71; text-shadow: 0 0 15px #2ecc71; }
    75% { color: #3498db; text-shadow: 0 0 15px #3498db; }
    100% { color: #ff3333; text-shadow: 0 0 15px #ff3333; }
}

.open-btn {
    padding: 15px 50px;
    font-size: 1.5rem;
    font-family: 'Pacifico', cursive;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    background: linear-gradient(
        45deg,
        #ff0000,
        #ff7300,
        #fffb00,
        #48ff00,
        #00ffd5,
        #002bff,
        #7a00ff,
        #ff00c8,
        #ff0000
    );
    background-size: 400%;
    animation: glowing-button 20s linear infinite;
    position: relative;
    z-index: 22;
}

.open-btn::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    background: inherit;
    background-size: inherit;
    animation: inherit;
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    border-radius: 50px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s;
}

.open-btn:hover::before {
    opacity: 1;
    filter: blur(20px);
}

@keyframes glowing-button {
    0% { background-position: 0 0; }
    50% { background-position: 400% 0; }
    100% { background-position: 0 0; }
}

.open-btn.visible {
    opacity: 1;
    transform: translateY(0);
}

.open-btn.hidden {
    display: none; 
}

/* --- MAIN CARD --- */
.card-container {
    position: relative;
    z-index: 10;
    perspective: 1000px;
    padding: 30px; 
    transition: all 1s ease;
    opacity: 1;
    transform: scale(1);
    max-width: 600px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.card-container.hidden-card {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
    position: absolute;
}

/* ==============================================
   REALISTIC GARLAND BORDER
   ============================================== */
.tinsel-border {
    position: absolute;
    top: -30px; 
    left: -30px;
    right: -30px;
    bottom: -30px;
    z-index: 5;
    pointer-events: none;
    border-radius: 40px;
    
    /* Simulate Pine Garland */
    background: 
        radial-gradient(ellipse at 50% 50%, #2f5a2f 30%, transparent 40%) 0 0,
        radial-gradient(ellipse at 50% 50%, #1e4d1e 30%, transparent 40%) 10px 10px,
        radial-gradient(ellipse at 50% 50%, #143d14 30%, transparent 40%) 20px 5px,
        radial-gradient(ellipse at 50% 50%, #0a290a 40%, transparent 50%) 5px 20px;
    background-size: 30px 30px; 
    background-color: transparent;
    
    /* Masking to create the frame (cut out the center) */
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    
    padding: 35px; /* Width of the garland */
    
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.6));
}

/* Light Bulbs NEON Effect - ULTRA BRIGHT */
.light-bulb {
    position: absolute;
    width: 16px; 
    height: 16px;
    border-radius: 50%;
    z-index: 20; /* Keep lights above the garland */
    pointer-events: none; 
    
    /* Super Intense Glow */
    box-shadow: 
        0 0 5px #fff, /* White hot core */
        0 0 10px currentColor, 
        0 0 20px currentColor,
        0 0 40px currentColor,
        0 0 80px currentColor; /* Distant atmosphere glow */
    
    opacity: 0.9;
    transition: opacity 0.2s, transform 0.2s;
}

/* Intensified Flash Animations */
@keyframes flash-1 {
    0%, 100% { opacity: 0.5; transform: scale(1); box-shadow: 0 0 5px #fff, 0 0 15px currentColor, 0 0 30px currentColor; }
    50% { opacity: 1; transform: scale(1.3); box-shadow: 0 0 10px #fff, 0 0 30px currentColor, 0 0 60px currentColor, 0 0 100px currentColor; }
}
@keyframes flash-2 {
    0%, 100% { opacity: 1; transform: scale(1.2); box-shadow: 0 0 10px #fff, 0 0 25px currentColor, 0 0 50px currentColor; }
    50% { opacity: 0.4; transform: scale(0.9); box-shadow: 0 0 5px #fff, 0 0 10px currentColor; }
}
@keyframes flash-3 {
    0%, 20%, 100% { opacity: 0.4; transform: scale(0.9); }
    10%, 30% { opacity: 1; transform: scale(1.4); box-shadow: 0 0 10px white, 0 0 40px currentColor, 0 0 80px currentColor; }
}
@keyframes flash-4 {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; box-shadow: 0 0 10px white, 0 0 30px currentColor, 0 0 60px currentColor; filter: brightness(2); }
}

/* Add some decorative ornaments via pseudo-elements at corners */
.tinsel-border::before, .tinsel-border::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 10;
}

/* Top Left Corner Decoration (Simulated Bow/Bell) */
.tinsel-border::before {
    top: -10px; left: -10px;
    background: radial-gradient(circle, gold 20%, orange 60%, transparent 70%); /* Abstract bell/bauble */
    box-shadow: 0 0 10px gold;
    border-radius: 50%;
}

/* Bottom Right Corner Decoration */
.tinsel-border::after {
    bottom: -10px; right: -10px;
    background: radial-gradient(circle, red 20%, darkred 60%, transparent 70%); /* Abstract bauble */
    box-shadow: 0 0 10px red;
    border-radius: 50%;
}

/* The actual card content sits inside */
.glass-card {
    z-index: 1;
    margin: 10px; /* Pull in slightly to let garland overhang */
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    max-width: 500px;
    width: 100%;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
    border: none;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

.glass-card:hover {
    transform: translateY(-5px) rotateX(2deg) rotateY(2deg);
}

.tree-icon {
    font-size: 4rem;
    color: #2ecc71;
    margin-bottom: 1rem;
    text-shadow: 0 0 15px rgba(46, 204, 113, 0.6);
    animation: glow 2s ease-in-out infinite alternate;
}

.title {
    font-family: 'Lobster', cursive; 
    font-size: 3.5rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 5px rgba(0,0,0,0.3);
    line-height: 1.2;
}

.recipient {
    font-family: 'Dancing Script', cursive;
    font-size: 2.5rem;
    color: #ff6b6b;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.4);
}

.message {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    color: #e0e0e0;
}

.signature {
    font-weight: 500;
    letter-spacing: 2px;
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--gold);
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 1rem;
    display: inline-block;
}

.decoration-icon {
    position: absolute;
    font-size: 1.5rem;
    color: rgba(255,255,255,0.4);
}

.top-left { top: 20px; left: 20px; transform: rotate(-15deg); }
.top-right { top: 20px; right: 20px; transform: rotate(15deg); }

@keyframes glow {
    from { text-shadow: 0 0 10px rgba(46, 204, 113, 0.4); transform: scale(1); }
    to { text-shadow: 0 0 20px rgba(46, 204, 113, 0.8); transform: scale(1.1); }
}

/* Sparkles */
.sparkle {
    position: absolute;
    background: white;
    border-radius: 50%;
    filter: blur(1px);
    opacity: 0;
    animation: sparkle-anim 3s infinite;
}

.s1 { width: 5px; height: 5px; top: 10%; right: 20%; animation-delay: 0s; }
.s2 { width: 3px; height: 3px; bottom: 15%; left: 10%; animation-delay: 1s; }
.s3 { width: 4px; height: 4px; top: 40%; left: 85%; animation-delay: 2s; }

@keyframes sparkle-anim {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1); opacity: 1; box-shadow: 0 0 10px white; }
    100% { transform: scale(0); opacity: 0; }
}

/* Mobile Responsive - FIXED */
@media (max-width: 600px) {
    .card-container { 
        padding: 15px; /* Minimal padding */
        height: auto;
        min-height: auto; 
        display: block; 
        margin-top: 10vh; /* Center vertically manually */
    }
    
    .glass-card {
        padding: 1.5rem;
        margin: 0; 
        width: 100%;
        max-width: 100%;
    }
    
    .tinsel-border {
        top: -6px; bottom: -6px; left: -6px; right: -6px;
        padding: 20px;
        border-radius: 25px;
    }

    .title { font-size: 2rem; }
    .recipient { font-size: 1.8rem; }
    .message { font-size: 1rem; }
    .typing-text { font-size: 1.5rem; }
    .open-btn { font-size: 1.1rem; padding: 10px 25px; }
}
