:root {
    --bg-color: #0d0205;
    --primary: #ff4d6d;
    --accent: #c9184a;
    --text: #fff0f3;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    background: linear-gradient(-45deg, #0d0205, #590d22, #a4133c, #0d0205);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    overflow-y: auto;
}

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

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 1.5rem;
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 600px;
}

.centered {
    justify-content: center;
    min-height: 60vh;
    /* Adjusted for mobile */
}

/* GIF Container */
.gif-container {
    width: 100%;
    max-width: 250px;
    aspect-ratio: 1/1;
    /* Ensure square aspect ratio */
    margin-bottom: 2rem;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(255, 77, 109, 0.3);
    border: 3px solid rgba(255, 77, 109, 0.5);
    background: rgba(0, 0, 0, 0.2);
}

.gif-container img {
    width: 100%;
    height: 108%;
    object-fit: cover;
}

h1.title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    /* Responsive font size */
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #ff8fa3, #fff0f3);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(255, 77, 109, 0.3);
    padding: 0 1rem;
}

.subtitle {
    font-size: clamp(1rem, 3vw, 1.2rem);
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2rem;
    font-weight: 300;
    padding: 0 1rem;
}

/* Input Styles */
.input-group {
    display: flex;
    gap: 0.5rem;
    background: var(--glass);
    padding: 0.5rem;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    max-width: 350px;
    /* Constrain width on large screens */
    flex-wrap: wrap;
    /* Allow wrapping on very small screens if needed */
    justify-content: center;
}

.input-group:focus-within {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(255, 77, 109, 0.2);
    border-color: rgba(255, 77, 109, 0.5);
}

input[type="password"] {
    background: transparent;
    border: none;
    padding: 0.8rem 1rem;
    color: white;
    font-size: 1.2rem;
    width: 80px;
    /* Smaller base width, flex grow handles rest */
    flex-grow: 1;
    text-align: center;
    outline: none;
    letter-spacing: 3px;
    font-family: 'Outfit', sans-serif;
    min-width: 0;
    /* Prevent overflow */
}

#mathAnswer {
    background: transparent;
    border: none;
    padding: 0.8rem 1rem;
    color: white;
    font-size: 1.2rem;
    width: 100%;
    text-align: left;
    outline: none;
    font-family: 'Outfit', sans-serif;
}

.styled-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.8rem 1rem;
    color: white;
    font-size: 1rem;
    width: 100%;
    border-radius: 8px;
    outline: none;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s ease;
}

.styled-input:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: #2ecc71;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.option-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.8rem;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 0.9rem;
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.option-btn.selected {
    background: #2ecc71;
    border-color: #2ecc71;
    font-weight: bold;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.4);
}

input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 1px;
    font-size: 0.9rem;
}

/* Button Styles */
button#unlockBtn {
    background: linear-gradient(135deg, #ff4d6d, #c9184a);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 40px;
    color: white;
    font-weight: 700;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.2s ease;
    white-space: nowrap;
}

button#unlockBtn:hover {
    transform: scale(1.05);
}

.buttons-container {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    /* Allow buttons to stack if needed */
    width: 100%;
}

.action-btn {
    padding: 1rem 2rem;
    /* Slightly smaller padding for mobile safety */
    border-radius: 50px;
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    font-family: 'Outfit', sans-serif;
    min-width: 120px;
}

.yes-btn {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
}

.yes-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(46, 204, 113, 0.6);
}

.no-btn {
    background: linear-gradient(135deg, #ff4d6d, #c9184a);
    color: white;
    /* Ensure it handles taps */
    touch-action: manipulation;
}

/* Floating Hearts */
.floating-heart {
    position: fixed;
    bottom: -50px;
    animation: floatUp 4s linear forwards;
    z-index: 100;
    pointer-events: none;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(-110vh) rotate(360deg);
        opacity: 0;
    }
}

.bg-emoji {
    position: fixed;
    bottom: -50px;
    animation: floatUp 15s linear forwards;
    /* Slower animation */
    z-index: 0;
    /* Behind everything */
    pointer-events: none;
    opacity: 0.3;
    /* Subtle */
    font-size: 2rem;
    filter: blur(1px);
    /* Slight blur for depth */
}

.error-msg {
    margin-top: 1rem;
    color: #ff8fa3;
    font-size: 0.9rem;
    height: 1.2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.error-msg.visible {
    opacity: 1;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: radial-gradient(circle, transparent 20%, #0d0205 150%);
    z-index: 1;
}

#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.secondary-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 2rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.secondary-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.glow-text {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 6vw, 3rem);
    /* Responsive */
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 77, 109, 0.6), 0 0 40px rgba(255, 77, 109, 0.3);
    margin-bottom: 2rem;
    line-height: 1.2;
    padding: 0 1rem;
}

/* Specific Card style */
.card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 90%;
    max-width: 600px;
    margin: 1rem auto;
    text-align: left;
    position: relative;
    z-index: 10;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #1a0508;
    border: 2px solid #ff4d6d;
    padding: 2rem;
    border-radius: 20px;
    max-width: 90%;
    width: 400px;
    text-align: center;
    box-shadow: 0 0 50px rgba(255, 77, 109, 0.4);
    transform: scale(0.7);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.math-problem {
    font-family: 'Times New Roman', serif;
    font-size: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #ff8fa3;
}

.close-modal {
    margin-top: 1rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
}

.love-letter {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1rem, 4vw, 1.4rem);
    /* Responsive font */
    line-height: 1.6;
    color: #eee;
    text-align: center;
}

.highlight {
    color: #ff4d6d;
    font-weight: bold;
    font-size: clamp(1.2rem, 5vw, 1.6rem);
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    button#unlockBtn {
        width: 100%;
        /* Full width button on mobile input */
        margin-top: 0.5rem;
    }

    .input-group {
        flex-direction: column;
        /* Stack input and button */
        border-radius: 20px;
        /* Slightly less rounded when stacked */
        padding: 1rem;
    }

    input[type="password"] {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        margin-bottom: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .buttons-container {
        flex-direction: column;
        /* Stack Yes/No on very small screens? or keep row? row is better usually, but check space */
        gap: 1rem;
    }

    .action-btn {
        width: 100%;
        max-width: 300px;
    }
}