@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600&family=Crimson+Text:ital@0;1&display=swap');

/* Force dark mystical theme regardless of theme toggle */
body {
    background: #0a0a0a !important;
    color: #e0d5c7;
    font-family: 'Crimson Text', serif;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

.app-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 60px);
}

/* Animated background stars */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.container {
    text-align: center;
    z-index: 10;
    max-width: 600px;
    padding: 20px;
}

h1 {
    font-family: 'Cinzel', serif;
    font-size: 3em;
    font-weight: 600;
    margin-bottom: 0.5em;
    color: #c9a961;
    text-shadow: 0 0 20px rgba(201, 169, 97, 0.5);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 20px rgba(201, 169, 97, 0.5); }
    to { text-shadow: 0 0 30px rgba(201, 169, 97, 0.8), 0 0 40px rgba(201, 169, 97, 0.4); }
}

.instructions {
    font-size: 1.2em;
    margin-bottom: 2em;
    line-height: 1.6;
    opacity: 0.9;
}

.ritual-text {
    font-style: italic;
    color: #c9a961;
    margin: 1em 0;
    font-size: 1.1em;
}

#mysticalInput {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #c9a961;
    border-radius: 10px;
    padding: 15px 25px;
    font-size: 1.1em;
    color: #e0d5c7;
    width: 100%;
    max-width: 400px;
    margin: 2em auto;
    text-align: center;
    font-family: 'Crimson Text', serif;
    transition: all 0.3s;
}

#mysticalInput:focus {
    outline: none;
    box-shadow: 0 0 30px rgba(201, 169, 97, 0.5);
    background: rgba(255, 255, 255, 0.1);
}

.button {
    background: linear-gradient(135deg, #c9a961 0%, #8b6914 100%);
    border: none;
    padding: 15px 40px;
    font-size: 1.2em;
    font-family: 'Cinzel', serif;
    color: #0a0a0a;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 1em;
    box-shadow: 0 5px 20px rgba(201, 169, 97, 0.3);
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(201, 169, 97, 0.5);
}

.oracle-chamber {
    display: none;
    margin-top: 3em;
}

.crystal-ball {
    width: 200px;
    height: 200px;
    margin: 0 auto 2em;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), transparent 40%),
                radial-gradient(circle, #1a0033, #000);
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 50px rgba(138, 43, 226, 0.5),
                inset 0 0 50px rgba(138, 43, 226, 0.3);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.mist {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(138, 43, 226, 0.4), transparent);
    animation: swirl 5s linear infinite;
}

@keyframes swirl {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.revelation {
    display: none;
    margin-top: 2em;
    position: relative;
    padding: 2em 1em;
}

/* Radiant light burst behind the answer */
.revelation__burst {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201, 169, 97, 0.3), rgba(138, 43, 226, 0.15), transparent 70%);
    transform: translate(-50%, -50%);
    z-index: 0;
    opacity: 0;
    pointer-events: none;
}

.revelation__burst.active {
    animation: burstExpand 2s ease-out forwards;
}

@keyframes burstExpand {
    0% { width: 0; height: 0; opacity: 0; }
    30% { opacity: 1; }
    100% { width: 500px; height: 500px; opacity: 0.8; }
}

/* Floating rune symbols */
.revelation__runes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.rune {
    position: absolute;
    font-size: 1.4em;
    opacity: 0;
    color: rgba(138, 43, 226, 0.6);
    text-shadow: 0 0 10px rgba(138, 43, 226, 0.8);
    animation: runeAppear 3s ease-in-out forwards;
}

@keyframes runeAppear {
    0% { opacity: 0; transform: translateY(20px) scale(0.5); }
    30% { opacity: 0.7; transform: translateY(0) scale(1); }
    70% { opacity: 0.7; }
    100% { opacity: 0.2; transform: translateY(-10px) scale(0.9); }
}

/* Preamble text */
.revelation__preamble {
    font-family: 'Crimson Text', serif;
    font-style: italic;
    font-size: 1.1em;
    color: rgba(201, 169, 97, 0.7);
    margin-bottom: 1.5em;
    opacity: 0;
    position: relative;
    z-index: 2;
    min-height: 1.5em;
}

.revelation__preamble.active {
    animation: preambleFade 2s ease-in forwards;
}

@keyframes preambleFade {
    0% { opacity: 0; letter-spacing: 0.3em; }
    100% { opacity: 1; letter-spacing: 0.05em; }
}

/* Ornamental dividers */
.revelation__ornament {
    position: relative;
    z-index: 2;
    height: 2px;
    max-width: 300px;
    margin: 0 auto;
    background: linear-gradient(90deg, transparent, #c9a961, transparent);
    opacity: 0;
}

.revelation__ornament.active {
    animation: ornamentReveal 1.5s ease-out forwards;
}

.revelation__ornament--top {
    margin-bottom: 1.2em;
}

.revelation__ornament--bottom {
    margin-top: 1.2em;
}

.revelation__ornament::before,
.revelation__ornament::after {
    content: '\2726';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #c9a961;
    font-size: 0.9em;
    text-shadow: 0 0 8px rgba(201, 169, 97, 0.6);
}

.revelation__ornament::before { left: -8px; }
.revelation__ornament::after { right: -8px; }

@keyframes ornamentReveal {
    0% { opacity: 0; max-width: 0; }
    100% { opacity: 1; max-width: 300px; }
}

/* The answer text */
.revelation__answer {
    font-size: 2.2em;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    color: #c9a961;
    position: relative;
    z-index: 2;
    min-height: 1.2em;
}

.revelation__answer .letter {
    display: inline-block;
    opacity: 0;
    text-shadow: 0 0 30px rgba(201, 169, 97, 0.8), 0 0 60px rgba(201, 169, 97, 0.4);
    animation: letterReveal 0.6s ease-out forwards;
}

@keyframes letterReveal {
    0% {
        opacity: 0;
        transform: translateY(15px) scale(1.4);
        text-shadow: 0 0 40px rgba(201, 169, 97, 1), 0 0 80px rgba(138, 43, 226, 0.8);
    }
    60% {
        opacity: 1;
        transform: translateY(-3px) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        text-shadow: 0 0 30px rgba(201, 169, 97, 0.8), 0 0 60px rgba(201, 169, 97, 0.4);
    }
}

/* Persistent glow pulse on the full answer once revealed */
.revelation__answer.complete {
    animation: answerPulse 3s ease-in-out infinite alternate;
}

@keyframes answerPulse {
    from { text-shadow: 0 0 20px rgba(201, 169, 97, 0.6), 0 0 40px rgba(201, 169, 97, 0.3); }
    to { text-shadow: 0 0 40px rgba(201, 169, 97, 1), 0 0 80px rgba(201, 169, 97, 0.5), 0 0 120px rgba(138, 43, 226, 0.3); }
}

.hidden-answer {
    position: absolute;
    left: -9999px;
}

#resetButton {
    margin-top: 2em;
    background: linear-gradient(135deg, #4a4a4a 0%, #2a2a2a 100%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.5s ease-in, visibility 0s 1.5s;
}

#resetButton.visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 1.5s ease-in, visibility 0s;
}
