body {
    background-color: #1a1a2e;
    color: #e0e0e0;
    font-family: 'Space Grotesk', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    overflow: hidden;
    text-align: center;
}

#app {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

h1 {
    font-size: 3.5rem;
    color: #fca311;
    text-shadow: 0 0 15px rgba(252, 163, 17, 0.5);
}

#ball-container {
    position: relative;
    width: 300px;
    height: 300px;
}

#magic-8-ball {
    width: 100%;
    height: 100%;
    position: relative;
    perspective: 1000px;
}

#magic-8-ball img {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 25px rgba(0,0,0,0.7));
}

#answer-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    background: #0d0d1a;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    box-shadow: inset 0 0 20px #000;
}

#answer-container.visible {
    opacity: 1;
}


#answer-text {
    color: #3a86ff;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    max-width: 80%;
    text-shadow: 0 0 5px #3a86ff;
    animation: fadeInText 2s ease-in-out forwards;
    opacity: 0;
}


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


#input-area {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

#question-input {
    padding: 10px 15px;
    border: 2px solid #4a4e69;
    border-radius: 20px;
    background: #2a2a3e;
    color: #e0e0e0;
    font-size: 1.1rem;
    width: 280px;
    outline: none;
    transition: border-color 0.3s;
}

#question-input:focus {
    border-color: #fca311;
}

#ask-button {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    background: #fca311;
    color: #1a1a2e;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
}

#ask-button:hover {
    background-color: #ffb742;
}

#ask-button:active {
    transform: scale(0.95);
}

#magic-8-ball.shake {
    animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both;
    transform: translate3d(0, 0, 0);
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

#error-message {
    color: #ff4d4d;
    transition: opacity 0.3s;
    height: 1em;
}

#error-message.hidden {
    opacity: 0;
}