/* --- Royal & Prestigious Theme with Maroon --- */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    line-height: 1.7;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
    color: #333;
    padding-top: 70px;
}

/* --- Streak Container --- */
#streak-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(45deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 12px 20px;
    text-align: center;
    font-size: 1.2em;
    font-weight: 600;
    z-index: 1005;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    animation: none;
}

#streak-container.pulsing {
    animation: pulse-background 2s infinite ease-in-out;
}

@keyframes pulse-background {
    0% { box-shadow: 0 3px 8px rgba(0,0,0,0.15), 0 0 0 0 rgba(255, 255, 255, 0.4); }
    70% { box-shadow: 0 3px 8px rgba(0,0,0,0.15), 0 0 0 10px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 3px 8px rgba(0,0,0,0.15), 0 0 0 0 rgba(255, 255, 255, 0); }
}

#streak-count {
    font-size: 1.8em;
    color: #FFD700;
    display: inline-block;
    position: relative;
    padding: 0 5px;
    font-family: 'Courier New', Courier, monospace;
    text-shadow: 0 0 5px rgba(255,215,0,0.7);
}

.digit-slot {
    display: inline-block;
    overflow: hidden;
    height: 1.2em;
    line-height: 1.2em;
    position: relative;
    vertical-align: middle;
}
.digit-reel {
    position: relative;
}
.digit-reel span {
    display: block;
    height: 1.2em;
    line-height: 1.2em;
}

#repair-streak-button {
    background-color: #ff6b6b;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
#repair-streak-button:hover {
    background-color: #ee5253;
    transform: translateY(-1px);
}
#repair-streak-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
    transform: translateY(0);
}

header {
    background-color: #800000;
    color: #FFFDD0;
    padding: 1.5rem 1rem;
    text-align: center;
    border-bottom: 4px solid #DAA520;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    margin-top: 0;
}

header h1 {
    margin: 0;
    font-size: 2.2em;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.4);
}

main {
    padding: 30px;
    max-width: 800px;
    margin: 40px auto;
    background-color: #FFFFF0;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

main h2 {
    color: #800000;
    border-bottom: 2px solid #DAA520;
    padding-bottom: 12px;
    margin-bottom: 30px;
    font-size: 1.8em;
    font-weight: normal;
}

#achievements-list {
    margin-top: 20px;
}

.achievement-item {
    background-color: #F5F5DC;
    border: 1px solid #D3D3D3;
    border-left: 6px solid #B8860B;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 25px;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.achievement-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.achievement-item h3 {
    margin-top: 0;
    margin-bottom: 8px;
    color: #36454F;
    font-size: 1.4em;
}

.achievement-item .achievement-date {
    font-size: 0.9em;
    color: #696969;
    margin-bottom: 12px;
    font-style: italic;
}

.achievement-item p:not(.achievement-date) {
    color: #2F4F4F;
    font-size: 1.05em;
    margin-bottom: 0;
    line-height: 1.6;
}

footer {
    text-align: center;
    margin-top: 50px;
    padding: 25px;
    color: #696969;
    font-size: 0.95em;
    border-top: 1px solid #E0E0E0;
}

/* --- Achievement Reveal Animation --- */
.achievement-item.reveal-init {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: opacity 1.5s ease-out, transform 1.2s ease-out;
}
.achievement-item.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* --- Specific Achievement Styles --- */
#first-achievement {
    cursor: pointer;
    background-color: #FFF8DC;
    border-color: #DAA520;
    border-left-color: #800000;
    border-width: 1px;
    border-left-width: 6px;
}
#first-achievement h3 {
    color: #800000;
    font-weight: bold;
}

/* --- Reward Buttons --- */
.treasure-button,
.yoga-button,
.baby-tap-button,
.mystery-button,
.sparkle-button {
    background-color: #DAA520;
    color: #800000;
    border: 1px solid #B8860B;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: bold;
    margin-top: 15px;
    display: inline-block;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.treasure-button:hover,
.yoga-button:hover,
.baby-tap-button:hover,
.mystery-button:hover,
.sparkle-button:hover {
    background-color: #b8860b;
    color: #FFFDD0;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}
.treasure-button:active,
.yoga-button:active,
.baby-tap-button:active,
.mystery-button:active,
.sparkle-button:active {
    transform: scale(0.98);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}
.mystery-button {
    background-color: #6A5ACD;
    color: #FFFDD0;
    border-color: #483D8B;
}
.mystery-button:hover { background-color: #483D8B; }

.sparkle-button {
    background-color: #FFB6C1; /* LightPink */
    color: #800020; /* Burgundy */
    border-color: #db7093; /* PaleVioletRed */
}
.sparkle-button:hover {
    background-color: #f8a5b3;
    color: #5c0017;
}

/* --- Emoji Pop Animation --- */
.flower-emoji {
    position: fixed;
    user-select: none;
    pointer-events: none;
    z-index: 1002;
}
@keyframes flower-pop {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0.5) rotate(0deg); }
    50% { opacity: 1; transform: translate(-50%, -150%) scale(1.2) rotate(15deg); }
    100% { opacity: 0; transform: translate(-50%, -250%) scale(0.8) rotate(-15deg); }
}

/* --- Modal Base Styles --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0; top: 0;
    width: 100%; height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    padding-top: 40px;
}
.modal-content {
    background-color: #FFFFF0;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 450px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    color: #36454F;
}
.modal-content h3 { margin-top: 5px; color: #800000; text-align: center; margin-bottom: 15px; }
.close-button { color: #aaa; position: absolute; top: 8px; right: 15px; font-size: 28px; font-weight: bold; line-height: 1; cursor: pointer; }
.close-button:hover, .close-button:focus { color: #333; text-decoration: none; }

/* --- Treasure Game Styles --- */
#game-area { position: relative; height: 100px; background-color: #F5F5DC; border: 1px solid #D3D3D3; border-radius: 5px; margin: 20px 0; overflow: hidden; cursor: pointer; }
#stick-figure { position: absolute; bottom: 5px; left: 10%; transition: left 0.4s ease-in-out; user-select: none; transform: translateX(-50%); line-height: 0; }
#stick-figure img { display: block; height: 70px; width: auto; max-width: 100%; }
#flower-target { position: absolute; bottom: 10px; right: 10%; font-size: 2.5em; opacity: 0; transition: opacity 0.5s ease-in 0.2s; user-select: none; transform: translateX(50%); }
#game-message { text-align: center; margin-top: 15px; font-style: italic; color: #696969; min-height: 1.2em; }

/* --- Yoga Game Styles --- */
#yoga-character-area { text-align: center; margin-bottom: 20px; }
#yoga-character { font-size: 4em; line-height: 1; display: inline-block; transition: transform 0.3s ease; }
#yoga-game-area { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 20px 0; }
.pose-button { padding: 10px 15px; font-size: 1em; cursor: pointer; border: 1px solid #B8860B; background-color: #FFF8DC; color: #800000; border-radius: 5px; transition: background-color 0.2s ease, transform 0.1s ease, opacity 0.3s ease; }
.pose-button:hover:not(:disabled) { background-color: #fdf3d1; transform: translateY(-2px); }
.pose-button:active:not(:disabled) { transform: translateY(0px); }
.pose-button.completed, .pose-button:disabled { background-color: #e0e0e0; color: #888; border-color: #ccc; cursor: not-allowed; opacity: 0.7; }
#yoga-message { text-align: center; margin-top: 15px; font-style: italic; color: #696969; min-height: 1.2em; font-weight: bold; }

/* --- Baby Tap Game Styles --- */
#baby-tap-area { position: relative; height: 200px; background-color: #FFF8DC; border: 2px dashed #FFC0CB; border-radius: 10px; margin: 20px auto; width: 90%; max-width: 350px; overflow: hidden; cursor: pointer; }
#baby-tappable { position: absolute; font-size: 3em; cursor: pointer; user-select: none; transition: transform 0.1s ease-out, left 0.2s linear, top 0.2s linear; padding: 5px; }
#baby-tappable.tapped-animation { transform: scale(1.2); }
#baby-tap-message { text-align: center; margin-top: 15px; font-style: italic; color: #FF69B4; min-height: 1.2em; font-weight: bold; }

/* --- Mystery Reveal Styles --- */
#temp-mystery-text { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 5rem; color: #9370DB; font-family: 'Times New Roman', Times, serif; font-weight: bold; text-align: center; letter-spacing: 2px; text-shadow: 0 0 8px #C9A0DC, 0 0 15px #C9A0DC, 0 0 25px #C9A0DC, 2px 2px 2px rgba(0,0,0,0.3); opacity: 0; transition: opacity 0.6s ease-in-out; z-index: 1003; pointer-events: none; padding: 20px; background-color: rgba(25, 0, 50, 0.3); border-radius: 10px; }
#temp-mystery-text.visible { opacity: 1; }

/* --- Sparkle Particle Styles --- */
.sparkle-particle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1010;
    opacity: 0; /* Initial opacity controlled by animation */
    /* The animation will use CSS variables for varied movement */
    animation: sparkle-float var(--duration) ease-in-out forwards;
    will-change: transform, opacity; /* Hint for browser performance */
}

@keyframes sparkle-float {
    0% {
        transform: translate(var(--start-tx), var(--start-ty)) scale(0.2);
        opacity: 0;
    }
    20% { /* Initial burst and brighten */
        transform: translate(var(--mid-tx), var(--mid-ty)) scale(1);
        opacity: 1;
        box-shadow: 0 0 var(--glow-size) var(--glow-color), 0 0 calc(var(--glow-size) * 1.5) var(--glow-color);
    }
    80% { /* Float around, maintain brightness */
        transform: translate(var(--end-tx), var(--end-ty)) scale(0.8);
        opacity: 0.9;
        box-shadow: 0 0 calc(var(--glow-size) * 0.7) var(--glow-color), 0 0 var(--glow-size) var(--glow-color);
    }
    100% { /* Fade out */
        transform: translate(var(--final-tx), var(--final-ty)) scale(0.1);
        opacity: 0;
        box-shadow: none;
    }
}

/* --- Screen Glow Overlay --- */
#screen-glow-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(255, 223, 186, 0.6) 0%, rgba(255, 192, 203, 0.0) 75%);
    opacity: 0;
    transition: opacity 0.7s ease-out;
    pointer-events: none;
    z-index: 1000;
}
#screen-glow-overlay.visible {
    opacity: 1;
}

/* --- Optional: Display Newest First --- */
/*
#achievements-list {
    display: flex;
    flex-direction: column-reverse;
}
*/