:root {
    --bg-color-1: #0f172a;
    --bg-color-2: #1e1b4b;
    --text-color: #f8fafc;
    --accent-color: #f43f5e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: linear-gradient(135deg, var(--bg-color-1), var(--bg-color-2));
    color: var(--text-color);
    min-height: 100vh;
    overflow: hidden; /* prevent scrolling during animations */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Controls */
#controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    gap: 10px;
}

button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    color: white;
    border-radius: 30px;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 700;
}

button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

/* Countdown Screen */
#countdownScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #4338ca, #312e81);
    z-index: 50;
    transition: opacity 1s ease-out;
}

#countdownNumber {
    font-size: 15rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; text-shadow: 0 0 40px rgba(255, 255, 255, 1); }
    100% { transform: scale(1); opacity: 0; }
}

/* Popup Message */
#popupMessage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: rgba(255, 255, 255, 0.95);
    color: var(--bg-color-1);
    padding: 2rem 4rem;
    border-radius: 20px;
    font-size: 3rem;
    font-weight: 900;
    text-align: center;
    z-index: 60;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: nowrap;
}

#popupMessage.show {
    transform: translate(-50%, -50%) scale(1);
}

/* Main Page */
#mainPage {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 1.5s ease-in;
    position: relative;
    z-index: 10;
}

#mainPage.visible {
    opacity: 1;
}

.content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    z-index: 2;
    text-align: center;
}

/* Photo */
.photo-container {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    padding: 10px;
    background: linear-gradient(45deg, #f43f5e, #8b5cf6, #3b82f6);
    box-shadow: 0 0 30px rgba(244, 63, 94, 0.5);
    animation: borderGlow 3s infinite alternate;
    transition: transform 0.5s ease;
}

.photo-container:hover {
    transform: scale(1.05) rotate(5deg);
}

@keyframes borderGlow {
    0% { box-shadow: 0 0 30px rgba(244, 63, 94, 0.3); }
    50% { box-shadow: 0 0 50px rgba(139, 92, 246, 0.6); }
    100% { box-shadow: 0 0 80px rgba(59, 130, 246, 0.8); }
}

#friendPhoto {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--bg-color-2);
}

/* Text */
.text-container {
    max-width: 800px;
}

#mainHeading {
    font-size: 4rem;
    color: white;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 40px rgba(244, 63, 94, 0.6);
    font-weight: 900;
    margin-bottom: 1rem;
}

#message {
    margin-top: 20px;
    font-size: 20px;
    text-align: center;
    line-height: 1.6;
    color: #e2e8f0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 1s ease;
}

#message.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Confetti & Balloons */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #f00;
    top: -10px;
    z-index: 100;
    animation: fall linear forwards;
    pointer-events: none;
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(720deg);
    }
}

.balloon {
    position: absolute;
    bottom: -100px;
    width: 60px;
    height: 80px;
    background: radial-gradient(circle at 20px 20px, rgba(255,255,255,0.8), transparent);
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    animation: floatUp linear forwards;
    z-index: 1;
    opacity: 0.8;
    pointer-events: none;
}

.balloon::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 60px;
    background: rgba(255,255,255,0.3);
}

@keyframes floatUp {
    to {
        transform: translateY(-120vh) rotate(20deg);
    }
}

.hidden {
    display: none !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    #countdownNumber { font-size: 10rem; }
    #popupMessage { font-size: 1.8rem; padding: 1.5rem; width: 90%; white-space: normal; }
    .photo-container { width: 220px; height: 220px; }
    #mainHeading { font-size: 2.5rem; }
    #message { font-size: 16px; margin-top: 15px; }
    #controls { flex-direction: column; top: 10px; right: 10px; gap: 5px; }
    button { padding: 8px 16px; font-size: 0.9rem; }
}
