/* --- TRASH TRUCK THEME COLORS --- */
:root {
    --tt-green: #718355;      /* Character Olive Green */
    --tt-yellow: #f9ca24;     /* Accent Yellow */
    --tt-grey: #a9afb2;       /* Compactor Silver */
    --tt-dark: #4a4e51;       /* Dirt/Text Brown-Grey */
    --sky: #70a1ff;
    --grass: #6ab04c;
}

/* --- RESET & LAYOUT --- */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Arial', sans-serif;
    /* Sky and Grass background */
    background: linear-gradient(to bottom, 
                var(--sky) 0%, var(--sky) 60%, 
                var(--grass) 60%, var(--grass) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

/* --- MAIN CARD CONTAINER --- */
#invite-container {
    width: 90%;
    max-width: 380px;
    height: 600px;
    background: rgba(255, 255, 255, 0.97);
    border: 8px solid var(--tt-yellow);
    border-radius: 40px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
    z-index: 10; /* Keep card behind balloons in final screen */
}

/* --- SCREEN LOGIC --- */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center; 
    align-items: center;     
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.screen.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* --- SCREEN 1: IMAGE FADE-IN --- */
.image-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
    opacity: 0;
}

#main-invite-image {
    max-width: 240px;
    width: 100%;
    height: auto;
    border-radius: 25px;
    border: 5px solid var(--tt-yellow);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.active .image-wrapper {
    animation: imageFadeIn 1.2s ease-out forwards;
    animation-delay: 0.2s;
}

@keyframes imageFadeIn {
    from { opacity: 0; transform: translateY(15px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- SCREEN 1: TEXT FLY-IN --- */
h1.title {
    color: var(--tt-dark);
    font-size: 2.8rem;
    margin: 0 0 10px;
    line-height: 1;
    letter-spacing: -1px;
}

p.description {
    color: var(--tt-dark);
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 25px;
}

.fly-in {
    opacity: 0;
    transform: translateY(30px);
}

.active .fly-in.title {
    animation: textFlyIn 0.8s ease-out forwards;
    animation-delay: 0.6s;
}

.active .fly-in.description {
    animation: textFlyIn 0.8s ease-out forwards;
    animation-delay: 0.8s;
}

@keyframes textFlyIn {
    0% { opacity: 0; filter: blur(10px); transform: translateY(30px) scale(0.8); }
    100% { opacity: 1; filter: blur(0); transform: translateY(0) scale(1); }
}

/* --- SCREEN 2: DETAILS & FORM --- */
.details-grid {
    background: #fff9e6;
    border: 3px dashed var(--tt-yellow);
    padding: 20px;
    border-radius: 25px;
    width: 100%;
    margin-bottom: 20px;
}

input {
    width: 100%;
    padding: 15px;
    margin-bottom: 12px;
    border: 3px solid #eee;
    border-radius: 20px;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
}

input:focus { border-color: var(--sky); }

button {
    width: 100%;
    background: var(--tt-green);
    color: white;
    border: none;
    padding: 18px;
    border-radius: 50px;
    font-size: 1.3rem;
    font-weight: bold;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 6px 0px #3d632b;
    transition: all 0.1s;
}

button:active { transform: translateY(4px); box-shadow: 0 2px 0px #3d632b; }

/* --- SCREEN 3: BALLOON EXPLOSION --- */
#confetti {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000; /* Balloons float over everything */
}

.balloon {
    position: absolute;
    bottom: -150px;
    animation: floatUpwards 6s linear forwards;
    will-change: transform;
}

.balloon-body {
    position: relative;
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
}

/* Balloon Knot */
.balloon-body::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 8px;
    background: inherit;
    clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
}

.balloon-string {
    position: absolute;
    bottom: -40px;
    left: 50%;
    width: 1px;
    height: 40px;
    background: rgba(0,0,0,0.1);
}

@keyframes floatUpwards {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(-130vh) rotate(10deg); opacity: 0; }
}