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

body {
    font-family: 'Raleway', sans-serif;
    min-height: 100vh;
    background: #0a0a1a;
    color: #e0e0e0;
    overflow-x: hidden;
}

.cosmic-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #1a1a3e 0%, #0a0a1a 50%, #050510 100%);
    z-index: -2;
}

.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #fff, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(2px 2px at 160px 120px, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 230px 80px, #fff, transparent),
        radial-gradient(2px 2px at 300px 150px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 400px 60px, #fff, transparent),
        radial-gradient(2px 2px at 500px 200px, rgba(255,255,255,0.8), transparent);
    background-repeat: repeat;
    background-size: 550px 200px;
    animation: twinkle 8s ease-in-out infinite;
    z-index: -1;
}

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

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    font-size: 4rem;
    margin-bottom: 10px;
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { text-shadow: 0 0 20px rgba(138, 43, 226, 0.8), 0 0 40px rgba(138, 43, 226, 0.4); }
    50% { text-shadow: 0 0 30px rgba(138, 43, 226, 1), 0 0 60px rgba(138, 43, 226, 0.6); }
}

h1 {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, #c9a0dc 0%, #8a2be2 50%, #4b0082 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.tagline {
    font-size: 1rem;
    color: #9a9ac0;
    font-weight: 300;
    letter-spacing: 1px;
}

main {
    flex: 1;
}

.input-section {
    margin-bottom: 30px;
}

textarea {
    width: 100%;
    min-height: 120px;
    padding: 20px;
    font-family: 'Raleway', sans-serif;
    font-size: 1rem;
    background: rgba(20, 20, 40, 0.8);
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 12px;
    color: #e0e0e0;
    resize: vertical;
    transition: all 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: rgba(138, 43, 226, 0.8);
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.2);
}

textarea::placeholder {
    color: #6a6a8a;
}

button {
    width: 100%;
    padding: 16px 32px;
    margin-top: 15px;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #6a0dad 0%, #8a2be2 50%, #9932cc 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(138, 43, 226, 0.4);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 1.3rem;
}

.loading {
    text-align: center;
    padding: 40px;
}

.loader {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 3px solid rgba(138, 43, 226, 0.2);
    border-top-color: #8a2be2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    color: #9a9ac0;
    font-style: italic;
}

.hidden {
    display: none !important;
}

.response-container {
    background: rgba(20, 20, 40, 0.9);
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 16px;
    padding: 30px;
    margin-top: 20px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.response {
    line-height: 1.8;
    white-space: pre-wrap;
}

.response h2, .response strong {
    color: #c9a0dc;
    font-family: 'Cinzel', serif;
}

footer {
    text-align: center;
    padding: 30px 0;
    color: #6a6a8a;
    font-size: 0.9rem;
    border-top: 1px solid rgba(138, 43, 226, 0.2);
    margin-top: 40px;
}

footer .signature {
    font-size: 0.75rem;
    font-style: italic;
    color: #8a8aaa;
    margin-top: 15px;
    letter-spacing: 0.5px;
}

@media (max-width: 600px) {
    h1 {
        font-size: 1.8rem;
    }
    
    .logo {
        font-size: 3rem;
    }
    
    .container {
        padding: 20px 15px;
    }
    
    textarea {
        min-height: 100px;
        padding: 15px;
    }
    
    .response-container {
        padding: 20px;
    }
}
