:root {
    --primary-color: #ff4d6d;
    /* Pink */
    --secondary-color: #ff8fa3;
    /* Light pink */
    --bg-gradient-start: #ffdde1;
    /* Light pink */
    --bg-gradient-end: #ee9ca7;
    /* Rose pink */
    --text-color: #592e39;
    /* Dark pink-brown */
    --glass-bg: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(255, 255, 255, 0.8);
    /* White border */
    --font-heading: 'Dancing Script', cursive;
    --font-body: 'Nunito', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    font-family: var(--font-body);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Canvas Background */
#heartCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* Common Layout Utilities */
.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease;
}

.centered {
    text-align: center;
}

.hidden {
    opacity: 0;
    pointer-events: none;
    z-index: -1;
    display: none !important;
    /* Force hide layout */
}

/* Glassmorphism Container */
.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    max-width: 90%;
    width: 500px;
    text-align: center;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.content-layout {
    max-width: 90%;
    width: 600px;
    text-align: center;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    /* Ensure vertical centering */
}

/* Initial Screen */
#initial-screen h1 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, var(--primary-color), #ff758c);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.instruction {
    font-size: 1rem;
    opacity: 0.8;
    margin-bottom: 0;
}

.instruction:last-of-type {
    margin-bottom: 2rem;
}

/* Play Button */
#play-btn {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    color: white;
    font-size: 1.5rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 77, 109, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: var(--font-body);
}

#play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 77, 109, 0.6);
}

.pulse-button {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.7);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 77, 109, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 77, 109, 0);
    }
}

/* Content Screen */
.card h1 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.text-content {
    min-height: 100px;
    /* Prevent jumping */
    font-size: 1.25rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    color: #4a4a4a;
}

/* Special confession styling */
.special-confession {
    font-size: 2.5rem !important;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--primary-color);
    text-align: center;
}

/* Interaction Area */
#final-question {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 600px;
}

.big-question {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 20px;
    position: relative;
    /* For button positioning context if needed */
}

.response-btn {
    padding: 12px 30px;
    border-radius: 30px;
    border: none;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-body);
}

.yes {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(255, 77, 109, 0.3);
}

.yes:hover {
    transform: scale(1.1);
    background-color: #ff2a51;
}

.no {
    background-color: #ededed;
    color: #888;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .glass-container {
        width: 90%;
        padding: 1.5rem;
    }

    .content-layout {
        width: 90%;
        padding: 1rem;
    }

    #initial-screen h1 {
        font-size: 2rem;
    }

    .instruction {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }

    #play-btn {
        padding: 12px 30px;
        font-size: 1.2rem;
    }

    .card h1 {
        font-size: 2rem;
    }

    .text-content {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .confession-line {
        font-size: 1rem;
        line-height: 1.5;
    }

    .big-question {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    .response-btn {
        padding: 10px 25px;
        font-size: 1rem;
    }

    .celebration-content h1 {
        font-size: 2.5rem !important;
    }

    .celebration-content p {
        font-size: 1rem;
    }
}

/* Celebration & Appreciation Overlay */
#celebration,
#appreciation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    animation: fadeIn 0.5s ease;
}

.celebration-content {
    text-align: center;
}

.celebration-content h1 {
    font-family: var(--font-heading);
    font-size: 4rem;
    color: var(--primary-color);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Dynamic Text Lines */
.text-container {
    display: flex;
    flex-direction: column;
    min-height: 100px;
}

.line-wrapper {
    max-height: 0;
    opacity: 0;
    transform: translateY(30px);
    margin-top: 0;
    overflow: hidden;
    transition: max-height 1.5s cubic-bezier(0.19, 1, 0.22, 1),
        opacity 1.5s cubic-bezier(0.19, 1, 0.22, 1),
        transform 1.5s cubic-bezier(0.19, 1, 0.22, 1),
        margin-top 1.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.line-wrapper.reveal {
    max-height: 200px;
    /* Large enough for any line */
    opacity: 1;
    transform: translateY(0);
    margin-top: 1.5rem;
}

.text-container>.line-wrapper:first-child.reveal {
    margin-top: 0;
}

.line-wrapper .confession-line {
    font-size: 1.25rem;
    line-height: 1.6;
    color: #4a4a4a;
    padding: 0.5rem 0;
}