:root {
    /* Colors from design.md */
    --primary: #B96D7A;
    --on-primary: #ffffff;
    --brand-mauve: #B8969D;
    --brand-sage: #A2AB87;
    --brand-blush: #E9D2D2;
    --brand-cream: #F2F4E2;
    --canvas: #FCFBFB;
    --ink: #38292C;
    --ink-strong: #1A1112;
    --hairline: #E9D2D2;
}

body {
    background-color: #FDF4F6; /* Lighter pastel pink */
    background-image: radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.6) 0%, transparent 20%),
                      radial-gradient(circle at 90% 80%, rgba(255, 255, 255, 0.6) 0%, transparent 20%);
    color: var(--ink);
    font-family: 'DM Sans', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Floating Sakura & Petals */
.sakura, .flower {
    position: absolute;
    top: -50px;
    opacity: 0.7;
    animation: fall linear infinite;
    pointer-events: none;
}

/* Improved Sakura Petal */
.sakura {
    background-image: url('./assets/sakura.gif');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.9;
}

/* Improved Cherry Blossom Flower */
.flower {
    background-image: url('./assets/sakura.gif');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.9;
}

@keyframes fall {
    0% { transform: translateY(0) rotate(0deg) translateX(0); }
    25% { transform: translateY(25vh) rotate(90deg) translateX(50px); }
    50% { transform: translateY(50vh) rotate(180deg) translateX(0px); }
    75% { transform: translateY(75vh) rotate(270deg) translateX(-50px); }
    100% { transform: translateY(110vh) rotate(360deg) translateX(0px); }
}

#app {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    z-index: 10;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

#question-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card {
    background-color: var(--canvas);
    border: 1px solid var(--hairline);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    max-width: 500px;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
    transition: all 0.3s ease;
}

button {
    background-color: var(--primary);
    color: var(--on-primary);
    border: none;
    border-radius: 9999px;
    padding: 12px 32px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

button:hover {
    background-color: #9A5965; /* Deep Rose deep */
}

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

/* Error Shake Animation for Cards */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

/* SweetAlert Responsive Pop & Shake */
@keyframes swal-shake {
    0% { transform: scale(0.5); opacity: 0; }
    40% { transform: scale(1.05); opacity: 1; }
    60% { transform: scale(1) translateX(-10px); }
    70% { transform: scale(1) translateX(10px); }
    80% { transform: scale(1) translateX(-10px); }
    90% { transform: scale(1) translateX(10px); }
    100% { transform: scale(1) translateX(0); }
}

.swal-shake-responsive {
    animation: swal-shake 0.6s ease-out forwards;
}

/* Page Turn Animation */
@keyframes pageTurn {
    0% { transform: perspective(1200px) rotateY(-90deg); opacity: 0; }
    100% { transform: perspective(1200px) rotateY(0deg); opacity: 1; }
}

.book-page {
    background-color: #fdf5e6;
    background-image: url("https://www.transparenttextures.com/patterns/parchment.png");
    border-radius: 4px 24px 24px 4px; /* Right side rounded like pages */
    box-shadow: inset 20px 0 20px rgba(0,0,0,0.04), 8px 10px 25px rgba(0,0,0,0.12);
    border-left: 4px solid #d4c0ab; /* Book spine */
    transform-origin: left center;
    animation: pageTurn 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    font-family: 'Georgia', serif;
}

.book-page h1, .book-page h2 {
    color: var(--primary);
}

.book-page p {
    color: var(--ink-strong);
}

/* Mobile-First Responsive Styles */
@media (max-width: 600px) {
    .card {
        padding: 20px;
        border-radius: 20px;
        max-width: 90%;
    }
    
    h2 { font-size: 1.5rem; }
    
    button {
        width: 100%;
        padding: 15px;
    }

    .swal2-popup {
        width: 85% !important;
        max-width: 100% !important;
        margin: auto !important;
        font-size: 0.95rem !important;
        box-sizing: border-box !important;
        justify-self: center !important;
    }
}

/* Gallery & Lightbox Styles */
.gallery-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
    gap: 10px;
}

.gallery-main {
    width: 100%;
    max-width: 300px;
    border-radius: 8px;
    border: 4px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.gallery-main:hover {
    transform: scale(1.02);
}

.gallery-thumbs {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.gallery-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 3px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.gallery-thumb:hover {
    transform: scale(1.05);
}

.reward-single-img {
    width: 100%;
    max-width: 300px;
    border-radius: 8px;
    margin: 20px 0;
    border: 4px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.reward-single-img:hover {
    transform: scale(1.02);
}

.lightbox {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    cursor: zoom-out;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

.lightbox img, .lightbox video {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    outline: none;
}
