:root {
    --ball-color-1: #c3e8ff;
    --ball-color-2: #8ab5ff;
    --ball-color-3: #4a7dff;
    --ball-color-4: #1a4dff;
    --glow-color: rgba(74, 125, 255, 0.7);
    --glow-color-strong: rgba(74, 125, 255, 1);
}

body {
    background-color: #1a1a1a;
    color: #fff;
    font-family: 'Gothic A1', sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    text-align: center;
}

.scene {
    perspective: 1000px;
}

.crystal-ball-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin-top: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.crystal-ball-stand {
    position: absolute;
    width: 200px;
    height: 100px;
    background-color: #5a3a22;
    border-radius: 50% 50% 0 0 / 20% 20% 0 0;
    bottom: -20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5), inset 0 -5px 15px rgba(0,0,0,0.7);
    z-index: -1;
}

.crystal-ball-stand::before {
    content: '';
    position: absolute;
    width: 150px;
    height: 30px;
    background-color: #4a2e1c;
    border-radius: 50%;
    top: 50px;
    left: 25px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.5);
}

.crystal-ball {
    width: 80%;
    height: 80%;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 40%, var(--ball-color-1), var(--ball-color-2), var(--ball-color-3), var(--ball-color-4));
    box-shadow: 0 0 20px var(--glow-color), inset 0 0 30px rgba(255, 255, 255, 0.3);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transform-style: preserve-3d;
    animation: glow 3s infinite alternate;
    position: relative; /* Ensure the ball is on top */
    bottom: 50px; /* Move the ball up a bit */

}

.crystal-ball.negative {
    --ball-color-1: #ffc3c3;
    --ball-color-2: #ff8a8a;
    --ball-color-3: #ff4a4a;
    --ball-color-4: #ff1a1a;
    --glow-color: rgba(255, 74, 74, 0.7);
    --glow-color-strong: rgba(255, 74, 74, 1);
}

@keyframes glow {
    from {
        box-shadow: 0 0 20px var(--glow-color), inset 0 0 30px rgba(255, 255, 255, 0.3);
    }
    to {
        box-shadow: 0 0 40px var(--glow-color-strong), inset 0 0 40px rgba(255, 255, 255, 0.5);
    }
}

.message {
    font-size: 2rem; /* Adjusted for the smaller ball */
    font-weight: bold;
    color: #fff;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    text-shadow: 0 0 10px #fff;
}

.crystal-ball.active .message {
    opacity: 1;
}

.crystal-ball.active {
    animation: swirl 1.5s forwards;
}

@keyframes swirl {
    0% {
        transform: rotateY(0deg) rotateX(0deg);
    }
    50% {
        transform: rotateY(180deg) rotateX(20deg);
        background: radial-gradient(circle at 50% 40%, var(--ball-color-1), var(--ball-color-2), var(--ball-color-3), var(--ball-color-4));
        box-shadow: 0 0 50px var(--glow-color-strong), inset 0 0 50px rgba(255, 255, 255, 0.5);
    }
    100% {
        transform: rotateY(360deg) rotateX(0deg);
        background: radial-gradient(circle at 50% 40%, var(--ball-color-1), var(--ball-color-2), var(--ball-color-3), var(--ball-color-4));
        box-shadow: 0 0 40px var(--glow-color-strong), inset 0 0 40px rgba(255, 255, 255, 0.5);
    }
}
