:root {
    --primary-color: #ff6b81;
    --secondary-color: #ff4757;
    --bg-gradient-1: #2f3542;
    --bg-gradient-2: #1e272e;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-color: #ffffff;
    --text-muted: #dfe4ea;
}

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

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-color);
    background: linear-gradient(135deg, var(--bg-gradient-1), var(--bg-gradient-2));
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

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

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

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

/* Background floating shapes */
.bg-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite alternate cubic-bezier(0.1, 0.5, 0.9, 0.5);
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--primary-color);
    top: -100px;
    left: -100px;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: #ff7f50;
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

.shape-3 {
    width: 250px;
    height: 250px;
    background: #a29bfe;
    bottom: 30%;
    left: 20%;
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(100px, 150px) scale(1.2);
    }
}

/* UI Structure */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease, transform 0.8s ease;
    padding: 20px;
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 10;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.icon-wrap i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.wave {
    display: inline-block;
    animation: waveAnim 2s infinite;
    transform-origin: 70% 70%;
}

@keyframes waveAnim {
    0% {
        transform: rotate(0.0deg)
    }

    10% {
        transform: rotate(14.0deg)
    }

    20% {
        transform: rotate(-8.0deg)
    }

    30% {
        transform: rotate(14.0deg)
    }

    40% {
        transform: rotate(-4.0deg)
    }

    50% {
        transform: rotate(10.0deg)
    }

    60% {
        transform: rotate(0.0deg)
    }

    100% {
        transform: rotate(0.0deg)
    }
}

.title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.subtitle {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.btn {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 14px 28px;
    border-radius: 50px;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    outline: none;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 10px 20px -10px var(--secondary-color);
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px -10px var(--secondary-color);
}

/* Animations defined in CSS classes */
.pop-in {
    animation: popIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Quiz Styles */
.level-indicator {
    display: inline-block;
    background: rgba(255, 107, 129, 0.2);
    color: var(--primary-color);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.question {
    font-size: 1.8rem;
    line-height: 1.4;
    margin-bottom: 30px;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: white;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.feedback-text {
    margin-top: 15px;
    font-size: 1rem;
    min-height: 24px;
    transition: color 0.3s ease;
}

.feedback-error {
    color: #ff6b6b;
    animation: shake 0.5s ease;
}

.feedback-success {
    color: #1dd1a1;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* Catch Hearts Styles */
.level-header {
    text-align: center;
    position: absolute;
    top: 50px;
    left: 0;
    width: 100%;
    padding: 0 20px;
}

.instruction {
    font-size: 1.5rem;
    margin: 10px 0;
}

.score-display {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}

#game-area {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    /* Let clicks pass unless on heart */
}

.floating-heart {
    position: absolute;
    font-size: 2.5rem;
    color: var(--primary-color);
    cursor: pointer;
    pointer-events: auto;
    user-select: none;
    filter: drop-shadow(0 5px 15px rgba(255, 71, 87, 0.5));
    transition: transform 0.1s;
    animation: floatUp 4s linear forwards, pulse 1.5s infinite;
}

.floating-heart:active {
    transform: scale(0.8);
}

@keyframes floatUp {
    0% {
        top: 110%;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        top: -10%;
        opacity: 0;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Password Styles */
.hint {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 25px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#password-input {
    width: 100%;
    padding: 15px 20px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    color: white;
    font-family: inherit;
    font-size: 1.1rem;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
}

#password-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(255, 107, 129, 0.3);
}

/* Final Screen Styles */
.gallery-container {
    width: 90vw;
    max-width: 600px;
    aspect-ratio: 4/5;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    overflow: hidden;
    position: absolute;
    z-index: 1;
    border: 2px solid var(--glass-border);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: slowZoom 6s ease-in-out infinite alternate;
    transition: opacity 1s ease-in-out;
}

@keyframes slowZoom {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.08);
    }
}

.final-message-container {
    position: absolute;
    bottom: 5vh;
    z-index: 2;
    padding: 25px !important;
    background: rgba(20, 20, 20, 0.6) !important;
}

.elegant-title {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.final-text {
    font-size: 1.1rem;
    line-height: 1.6;
}

.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #fff;
    opacity: 0.8;
}

.fade-in {
    opacity: 0;
    animation: fadeInAnim 1s ease 0.5s forwards;
}

.fade-in-delay {
    opacity: 0;
    animation: fadeInAnim 1s ease 2s forwards;
}

@keyframes fadeInAnim {
    to {
        opacity: 1;
    }
}

/* Transitions */
.slide-up {
    transform: translateY(50px);
}

.active .slide-up {
    transform: translateY(0);
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.slide-down {
    transform: translateY(-50px);
}

.active .slide-down {
    transform: translateY(0);
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Sweet modal */
.sweet-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.sweet-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.sweet-modal-content {
    max-width: 90%;
    padding: 25px;
    animation: popIn 0.5s;
    text-align: center;
}

.sweet-img {
    width: auto;
    max-width: 100%;
    height: 35vh;
    max-height: 280px;
    object-fit: cover;
    border-radius: 16px;
    margin: 0 auto 20px auto;
    display: block;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 20px -5px rgba(0,0,0,0.3);
}

.sweet-text {
    font-size: 1.25rem;
    margin-bottom: 25px;
    font-style: italic;
    line-height: 1.5;
}

/* Mobile Responsiveness tweaks */
@media (max-width: 600px) {
    .glass-card {
        padding: 25px;
        width: 90%;
    }

    .title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .question {
        font-size: 1.4rem;
    }

    .elegant-title {
        font-size: 2.2rem;
    }

    .instruction {
        font-size: 1.3rem;
    }

    .btn {
        padding: 12px 24px;
        font-size: 1rem;
    }

    .gallery-container {
        width: 95vw;
    }
}