:root {
    --bg-color: #FAF7F2;
    --text-color: #2E2E2E;
    --accent-color: #B76E79;
    --secondary-color: #D6C1A3;
    --glass-bg: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(255, 255, 255, 0.6);
    
    --font-heading: 'DM Serif Display', serif;
    --font-body: 'Inter', sans-serif;
    
    --transition-speed: 0.4s;
}

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

body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 10% 10%, rgba(183, 110, 121, 0.15) 0px, transparent 50%),
        radial-gradient(at 90% 90%, rgba(214, 193, 163, 0.2) 0px, transparent 50%),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    color: var(--text-color);
    font-family: var(--font-body);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Floating background blobs */
body::before, body::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    z-index: 1;
    opacity: 0.6;
    animation: floatBlob 20s infinite alternate ease-in-out;
}

body::before {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-color) 0%, transparent 70%);
    top: -100px;
    left: -100px;
}

body::after {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--secondary-color) 0%, transparent 70%);
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

@keyframes floatBlob {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 40px) scale(1.1); }
}

.container {
    width: 90%;
    max-width: 550px;
    padding: 3rem;
    text-align: center;
    position: relative;
    z-index: 10;
    
    /* Creative Glassmorphism */
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.05),
        inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    
    animation: fadeInContainer 1s ease-out;
}

@keyframes fadeInContainer {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Typography */
.title {
    font-family: var(--font-heading);
    font-size: 3rem;
    margin-bottom: 2.5rem;
    font-weight: 400;
    line-height: 1.1;
    color: var(--text-color);
    text-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.big-question {
    font-size: 3.5rem;
}

/* Inputs */
.input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    position: relative;
}

input[type="text"] {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(46, 46, 46, 0.2);
    padding: 12px 0;
    font-family: var(--font-body);
    font-size: 1.35rem;
    color: var(--text-color);
    text-align: center;
    outline: none;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    border-bottom-color: var(--accent-color);
    letter-spacing: 0.5px;
    transform: translateY(-2px);
}

input[type="text"]::placeholder {
    color: rgba(46, 46, 46, 0.3);
    font-style: italic;
    font-weight: 300;
}

/* Messages / Hints */
.message {
    min-height: 1.5rem;
    font-size: 0.95rem;
    font-style: italic;
    color: var(--accent-color);
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

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

/* Buttons */
.btn {
    background: linear-gradient(135deg, var(--accent-color), #a05a65);
    color: white;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    padding: 14px 40px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(183, 110, 121, 0.3);
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255,255,255,0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(183, 110, 121, 0.4);
}

.btn:hover::after {
    opacity: 1;
}

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

.buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 2rem;
}

.secondary-btn {
    background: transparent;
    color: var(--text-color);
    border: 1px solid rgba(214, 193, 163, 0.5);
    box-shadow: none;
}

.secondary-btn:hover {
    background: rgba(214, 193, 163, 0.15);
    border-color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(214, 193, 163, 0.2);
}

.screen {
    /* position: absolute; removed to allow container to wrap content */
    width: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease;
    display: none; /* Controlled by JS ultimately, but safe default */
}

.screen.active {
    display: block;
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.screen.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-20px);
}

/* Transparent mode for final reveal */
.container.transparent-mode {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    transition: all 1s ease;
}

/* Progress Dots */
.progress-container {
    margin-top: 3.5rem;
    position: relative;
    display: flex;
    justify-content: center;
}

.dots {
    display: flex;
    gap: 12px;
}

.dot {
    width: 6px;
    height: 6px;
    background-color: rgba(46, 46, 46, 0.1);
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dot.active {
    background-color: var(--accent-color);
    transform: scale(1.8);
    box-shadow: 0 0 10px rgba(183, 110, 121, 0.4);
}

.dot.completed {
    background-color: var(--accent-color);
    opacity: 0.4;
}

/* Reveal Sequences */
.reveal-step {
    transition: opacity 1.2s ease;
}

.reveal-step.hidden {
    display: none;
    opacity: 0;
}

.reveal-step.visible {
    display: block;
    opacity: 1;
    animation: fadeInSoft 1.5s ease forwards;
}

@keyframes fadeInSoft {
    from { opacity: 0; transform: translateY(15px); filter: blur(4px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* Confetti Canvas */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.heart-container {
    font-size: 6rem;
    margin-top: 2rem;
    animation: beatHeart 2s infinite cubic-bezier(0.21, 2, 0.32, 1);
    filter: drop-shadow(0 10px 20px rgba(183, 110, 121, 0.4));
}

@keyframes beatHeart {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.3); }
    30% { transform: scale(1); }
    45% { transform: scale(1.15); }
    60% { transform: scale(1); }
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .container {
        width: 100%;
        height: 100%;
        max-width: none;
        border-radius: 0;
        border: none;
        background: transparent; /* Cleaner on mobile */
        box-shadow: none;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 1.5rem;
    }
    
    .title {
        font-size: 2.5rem;
    }
    .big-question {
        font-size: 3rem;
    }
    .input-group {
        max-width: 100%;
    }
}
/* New Decorative Elements */
.corner-decoration {
    position: absolute;
    width: 200px;
    height: 200px;
    pointer-events: none;
    z-index: 5;
}

.top-left {
    top: 0;
    left: 0;
}

.bottom-right {
    bottom: 0;
    right: 0;
}

/* Music Widget */
.music-widget {
    position: absolute;
    top: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 20;
    opacity: 0.7;
    transition: opacity 0.3s;
    cursor: default;
}

.music-widget:hover {
    opacity: 1;
}

.equalizer {
    display: flex;
    gap: 3px;
    height: 20px;
    align-items: flex-end;
}

.bar {
    width: 3px;
    background-color: var(--accent-color);
    animation: equalize 1s infinite alternate ease-in-out;
}

.bar:nth-child(2) { animation-delay: 0.2s; height: 15px; }
.bar:nth-child(3) { animation-delay: 0.4s; height: 10px; }
.bar:nth-child(4) { animation-delay: 0.1s; height: 18px; }

@keyframes equalize {
    0% { height: 5px; }
    100% { height: 20px; }
}

.track-info {
    display: flex;
    flex-direction: column;
    font-size: 0.75rem;
    text-align: left;
    line-height: 1.2;
}

.track-name {
    font-family: var(--font-heading);
    color: var(--text-color);
    letter-spacing: 0.5px;
}

.track-status {
    font-size: 0.65rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Mobile adjust for widget */
@media (max-width: 480px) {
    .music-widget {
        top: 1rem;
        right: 1rem;
        transform: scale(0.8);
        transform-origin: top right;
    }
    
    .corner-decoration {
        width: 100px;
        height: 100px;
    }
}
/* New Grid Styles */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    width: 100%;
    margin-top: 3rem;
    opacity: 0;
    transition: opacity 1s ease;
    padding-bottom: 3rem; /* Space at bottom for scrolling */
}

.photo-grid.visible {
    opacity: 1;
    display: grid; /* override hidden if needed, though reveal-step logic usually handles it */
}

.grid-item {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, z-index 0.3s;
    cursor: pointer;
    background-color: rgba(255,255,255,0.2);
}

.grid-item:hover {
    transform: scale(1.1) rotate(2deg);
    z-index: 10;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* Allow scrolling when grid is active */
body.scroll-active {
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
    padding-bottom: 50px;
}

/* Adjust scrollbar */
body::-webkit-scrollbar {
    width: 8px;
}

body::-webkit-scrollbar-track {
    background: transparent;
}

body::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
    border-radius: 4px;
}

/* Ensure container expands for grid */
.container.grid-mode {
    max-width: 1000px; /* Wider for grid */
    padding-top: 5rem;
}

@media (min-width: 768px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    .grid-item {
        height: 200px;
    }
}
