.magic-8-ball-wrapper {
    max-width: 720px;
    margin: 0 auto; 
} 

.magic-question-group {
    background: linear-gradient(145deg, rgba(13, 110, 253, 0.08), rgba(111, 66, 193, 0.06));
    border: 1px solid rgba(13, 110, 253, 0.16);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(13, 110, 253, 0.08);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
 
.magic-question-group:focus-within {
    box-shadow: 0 12px 32px rgba(13, 110, 253, 0.16);
    transform: translateY(-2px);
} 

.magic-question-input {
    font-size: 1.05rem;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid rgba(13, 110, 253, 0.25);
    resize: none;
}

.magic-answer-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.magic-answer-wrapper.reveal {
    opacity: 1;
    transform: translateY(0);
}

.magic-visual-scene {
    position: relative;
    width: 260px;
    height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.magic-orbit {
    position: absolute;
    border-radius: 50%;
    border: 1px dashed rgba(148, 187, 255, 0.35);
    animation: orbitSpin 14s linear infinite;
    opacity: 0.55;
    pointer-events: none;
}

.magic-orbit-one {
    width: 240px;
    height: 240px;
}

.magic-orbit-two {
    width: 200px;
    height: 200px;
    animation-duration: 11s;
    animation-direction: reverse;
    opacity: 0.4;
}

.magic-decor {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(13, 110, 253, 0.2), rgba(111, 66, 193, 0.18));
    box-shadow: 0 10px 24px rgba(56, 72, 248, 0.35);
    backdrop-filter: blur(2.5px);
    animation: decorFloat 7s ease-in-out infinite;
    pointer-events: none;
}

.magic-decor-one {
    top: 22px;
    left: 30px;
}

.magic-decor-two {
    bottom: 38px;
    right: 24px;
    animation-duration: 6.2s;
    animation-delay: -1.1s;
}

.magic-decor-three {
    top: 72px;
    right: 84px;
    animation-duration: 5.4s;
    animation-delay: -0.6s;
}

.magic-ball {
    position: relative;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #3a4af4, #080b2d 65%, #020309 100%);
    box-shadow: 0 25px 60px rgba(56, 72, 248, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
}

.magic-ball-glow {
    position: absolute;
    inset: -20px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 72, 248, 0.25), transparent 70%);
    filter: blur(22px);
    z-index: -1;
    animation: magicGlow 5s ease-in-out infinite;
}

.magic-ball-window {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 18px;
    background: radial-gradient(circle at 30% 30%, #0f1c64, #050a1f 80%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(174, 196, 255, 0.28);
    box-shadow: inset 0 0 18px rgba(148, 187, 255, 0.35);
    transform: rotate(12deg);
}

.magic-ball-inner {
    width: 88%;
    height: 88%;
    background: radial-gradient(circle at 50% 25%, rgba(192, 223, 255, 0.28), rgba(24, 49, 128, 0.65));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 18px;
    color: #f1f5ff;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.02em;
}

.magic-ball-inner.idle {
    font-size: 3.4rem;
    font-weight: 700;
    letter-spacing: -0.05em;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.magic-ball-inner.idle .magic-ball-answer {
    font-size: inherit;
    line-height: 1;
}

.magic-ball-inner.shake {
    animation: magicBallShake 0.9s ease forwards;
}

.magic-ball-answer {
    font-size: 1.05rem;
    text-transform: uppercase;
}

.magic-answer-details {
    max-width: 420px;
    text-align: center;
}

.magic-answer-heading {
    display: inline-block;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--bs-primary-text-emphasis);
    margin-bottom: 0.75rem;
}

.magic-answer-question {
    word-break: break-word;
}

.magic-answer-tone {
    font-size: 0.85rem;
    padding: 0.5rem 1.1rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.tone-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid transparent;
}

.tone-positive {
    background: rgba(25, 135, 84, 0.18);
    color: #0f5132;
    border-color: rgba(25, 135, 84, 0.4);
}

.tone-neutral {
    background: rgba(13, 110, 253, 0.18);
    color: #052c65;
    border-color: rgba(13, 110, 253, 0.35);
}

.tone-negative {
    background: rgba(220, 53, 69, 0.18);
    color: #58151c;
    border-color: rgba(220, 53, 69, 0.35);
}

.magic-history-table table {
    border-radius: 12px;
    overflow: hidden;
}

.magic-history-answer {
    min-width: 220px;
}

[data-bs-theme="dark"] .magic-question-group {
    background: linear-gradient(145deg, rgba(111, 66, 193, 0.14), rgba(25, 135, 84, 0.08));
    border-color: rgba(173, 181, 189, 0.2);
    box-shadow: 0 8px 24px rgba(13, 110, 253, 0.12);
}

[data-bs-theme="dark"] .magic-question-input {
    border-color: rgba(173, 181, 189, 0.35);
    background-color: rgba(3, 6, 23, 0.65);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .magic-orbit {
    border-color: rgba(158, 197, 255, 0.25);
}

[data-bs-theme="dark"] .magic-decor {
    background: linear-gradient(145deg, rgba(13, 110, 253, 0.28), rgba(111, 66, 193, 0.3));
    box-shadow: 0 10px 24px rgba(9, 20, 68, 0.55);
}

[data-bs-theme="dark"] .magic-answer-heading {
    color: #9ec5fe;
}

[data-bs-theme="dark"] .tone-positive {
    background: rgba(25, 135, 84, 0.25);
    color: #9fe2bf;
}

[data-bs-theme="dark"] .tone-neutral {
    background: rgba(13, 110, 253, 0.25);
    color: #9ec5ff;
}

[data-bs-theme="dark"] .tone-negative {
    background: rgba(220, 53, 69, 0.25);
    color: #f5b6c0;
}

@keyframes magicGlow {
    0%, 100% {
        opacity: 0.5;
        transform: scale(0.96);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

@keyframes magicBallShake {
    0%, 100% {
        transform: rotate(0deg);
    }
    20% {
        transform: rotate(6deg);
    }
    40% {
        transform: rotate(-5deg);
    }
    60% {
        transform: rotate(4deg);
    }
    80% {
        transform: rotate(-3deg);
    }
}

@keyframes orbitSpin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes decorFloat {
    0%, 100% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 0.9;
    }
    50% {
        transform: translate3d(0, -10px, 0) scale(1.05) rotate(4deg);
        opacity: 1;
    }
}

@media (min-width: 768px) {
    .magic-answer-wrapper {
        flex-direction: row;
        align-items: center;
        justify-content: center;
    }

    .magic-answer-details {
        text-align: left;
    }
}
