/* mysterious.boo - Haunted Forest Library */
/* Colors: #C0A030, #F0E8D8, #E8D8B0, #E0A040, #908070, #1A1E14, #A03030, #B8A890 */
/* Fonts: Creepster, Crimson Text */

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

body {
    font-family: 'Crimson Text', Georgia, serif;
    color: #B8A890;
    background: #1A1E14;
    overflow-x: hidden;
}

.ghost-trail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

/* Candle Glow */
.candle-glow {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(ellipse 400px 300px at 50% 30%, rgba(224, 160, 64, 0.06) 0%, transparent 100%);
}

/* Rooms */
.room {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    overflow: hidden;
}

.room__content {
    max-width: 800px;
    width: 100%;
    padding: 40px;
    position: relative;
    z-index: 5;
}

.room--entrance {
    background: linear-gradient(180deg, #0E1208, #1A1E14);
    text-align: center;
}

.room--candlelit {
    background: linear-gradient(180deg, #1A1E14, #2A2018, #1A1E14);
}

.room--mossy {
    background: linear-gradient(180deg, #1A1E14, #1E2418, #1A1E14);
}

.room--foggy {
    background: linear-gradient(180deg, #1A1E14, #1E1C18, #1A1E14);
}

.room--exit {
    background: #0E1208;
    min-height: 40vh;
    text-align: center;
}

/* Fog Layer */
.fog-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(transparent 0%, rgba(184, 168, 144, 0.03) 50%, transparent 100%);
    pointer-events: none;
    animation: fogDrift 12s ease-in-out infinite;
}

/* Candle */
.candle {
    display: inline-block;
    margin-bottom: 24px;
    position: relative;
}

.candle::before {
    content: '';
    display: block;
    width: 8px;
    height: 40px;
    background: linear-gradient(#F0E8D8, #E8D8B0);
    border-radius: 2px 2px 0 0;
    margin: 0 auto;
}

.candle-flame {
    width: 12px;
    height: 20px;
    background: radial-gradient(ellipse at center bottom, #E0A040, #C0A030 40%, transparent 70%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    animation: flicker 3s ease-in-out infinite;
    opacity: 0;
    animation: candleFadeIn 2s ease forwards, flicker 3s ease-in-out infinite;
}

/* Typography */
.mystery-title {
    font-family: 'Creepster', cursive;
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    font-weight: 400;
    letter-spacing: 0.02em;
    color: #E8D8B0;
    margin-bottom: 32px;
}

.mystery-title--hero {
    opacity: 0;
}

.whisper {
    font-family: 'Crimson Text', serif;
    font-size: 0.85rem;
    font-style: italic;
    color: #908070;
    letter-spacing: 0.08em;
    text-transform: lowercase;
}

/* Book Cards */
.book-card {
    background: rgba(240, 232, 216, 0.04);
    border-left: 3px solid #C0A030;
    padding: 28px 32px;
    margin-bottom: 24px;
    border-radius: 0 4px 4px 0;
    transition: background 0.3s ease;
}

.book-card:hover {
    background: rgba(240, 232, 216, 0.07);
}

.book-card__text {
    font-family: 'Crimson Text', serif;
    font-size: 1.05rem;
    line-height: 1.85;
    color: #B8A890;
    margin-bottom: 12px;
}

.book-card__source {
    font-family: 'Crimson Text', serif;
    font-size: 0.85rem;
    font-style: italic;
    color: #908070;
}

/* Mushrooms */
.mushroom {
    position: absolute;
    z-index: 2;
    pointer-events: none;
}

.mushroom::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: #908070;
    border-radius: 3px;
}

.mushroom::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 50% 50% 0 0;
}

.mushroom--1 {
    bottom: 10%;
    left: 5%;
}
.mushroom--1::before { width: 6px; height: 18px; }
.mushroom--1::after { width: 28px; height: 14px; bottom: 16px; background: #A03030; opacity: 0.5; }

.mushroom--2 {
    bottom: 8%;
    right: 8%;
}
.mushroom--2::before { width: 5px; height: 14px; }
.mushroom--2::after { width: 22px; height: 11px; bottom: 12px; background: #C0A030; opacity: 0.4; }

.mushroom--3 {
    top: 12%;
    right: 6%;
}
.mushroom--3::before { width: 7px; height: 20px; }
.mushroom--3::after { width: 34px; height: 17px; bottom: 18px; background: #A03030; opacity: 0.45; }

.mushroom--4 {
    bottom: 15%;
    left: 3%;
}
.mushroom--4::before { width: 5px; height: 12px; }
.mushroom--4::after { width: 24px; height: 12px; bottom: 10px; background: #E0A040; opacity: 0.35; }

.mushroom--5 {
    top: 10%;
    right: 4%;
}
.mushroom--5::before { width: 8px; height: 24px; }
.mushroom--5::after { width: 40px; height: 20px; bottom: 22px; background: #C0A030; opacity: 0.4; }

.mushroom--6 {
    bottom: 12%;
    left: 6%;
}
.mushroom--6::before { width: 6px; height: 16px; }
.mushroom--6::after { width: 30px; height: 15px; bottom: 14px; background: #A03030; opacity: 0.4; }

/* Footer */
.footer-text {
    font-family: 'Creepster', cursive;
    font-size: 0.9rem;
    color: #908070;
    opacity: 0.4;
    margin-top: 16px;
}

/* Reveal */
.room-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
}

.room-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Animations */
@keyframes flicker {
    0%, 100% { opacity: 1; transform: translateX(-50%) scale(1); }
    10% { opacity: 0.85; transform: translateX(-50%) scale(0.95); }
    20% { opacity: 1; transform: translateX(-50%) scale(1.02); }
    30% { opacity: 0.9; transform: translateX(-50%) scale(0.98); }
    50% { opacity: 1; transform: translateX(-50%) scale(1); }
    60% { opacity: 0.88; transform: translateX(-50%) scale(0.97); }
    80% { opacity: 0.95; transform: translateX(-50%) scale(1.01); }
}

@keyframes candleFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fogDrift {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(20px); }
}

/* Responsive */
@media (max-width: 600px) {
    .room__content {
        padding: 24px;
    }

    .book-card {
        padding: 20px;
    }

    .mushroom {
        display: none;
    }
}
