@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,700;1,400&family=Quintessential&family=Playfair+Display:wght@700&display=swap');

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

body {
    background: linear-gradient(-45deg, #0f0c29, #302b63, #24243e, #000000);
    background-size: 400% 400%;
    animation: gradientAnimation 12s ease infinite;
    font-family: 'Lora', serif;
    color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    overflow-x: hidden;
}

@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    background: radial-gradient(circle, #8a2be2, transparent);
    border-radius: 50%;
    animation: float 8s infinite linear;
    opacity: 0.6;
}

@keyframes float {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

.container {
    text-align: center;
    background: rgba(0, 0, 0, 0.6);
    padding: 50px 40px;
    border-radius: 25px;
    box-shadow: 
        0 0 50px rgba(138, 43, 226, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    max-width: 650px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(138, 43, 226, 0.1), transparent);
    animation: shine 6s infinite linear;
    pointer-events: none;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(0deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(360deg); }
}

.oracle-title {
    font-family: 'Playfair Display', serif;
    background: linear-gradient(45deg, #ff6bff, #a855f7, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 3.8em;
    margin-bottom: 15px;
    text-shadow: 0 0 30px rgba(168, 85, 247, 0.5);
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% { text-shadow: 0 0 20px rgba(168, 85, 247, 0.5); }
    100% { text-shadow: 0 0 40px rgba(168, 85, 247, 0.8), 0 0 60px rgba(102, 51, 204, 0.4); }
}

.subtitle {
    font-style: italic;
    color: #d8b4fe;
    margin-bottom: 40px;
    font-size: 1.3em;
    text-shadow: 0 0 10px rgba(216, 180, 254, 0.5);
}

.input-group {
    position: relative;
    margin: 30px 0;
}

textarea {
    width: 100%;
    height: 120px;
    padding: 20px;
    border-radius: 15px;
    border: 2px solid rgba(168, 85, 247, 0.3);
    background: rgba(0, 0, 0, 0.3);
    color: #f0f0f0;
    font-size: 1.1em;
    font-family: 'Lora', serif;
    resize: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

textarea:focus {
    outline: none;
    border-color: #a855f7;
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.4);
    background: rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

textarea::placeholder {
    color: #9ca3af;
    font-style: italic;
}

.button-group {
    position: relative;
}

button {
    margin-top: 10px;
    padding: 18px 45px;
    font-size: 1.3em;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(45deg, #a855f7, #6366f1);
    border: none;
    border-radius: 60px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    box-shadow: 
        0 0 25px rgba(168, 85, 247, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.8s;
}

button:hover::before {
    left: 100%;
}

button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 0 40px rgba(168, 85, 247, 0.7),
        0 10px 25px rgba(0, 0, 0, 0.3);
}

button:active {
    transform: translateY(-1px) scale(1.02);
}

button:disabled {
    background: linear-gradient(45deg, #6b7280, #4b5563);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

button:disabled::before {
    display: none;
}

#response-container {
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(102, 51, 204, 0.05));
    border-radius: 20px;
    border-left: 6px solid #cda4de;
    text-align: left;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

#response-container.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

#response-container h2 {
    color: #e9d5ff;
    margin-bottom: 15px;
    font-family: 'Playfair Display', serif;
    font-size: 1.8em;
    text-shadow: 0 0 10px rgba(233, 213, 255, 0.3);
}

#response-text {
    font-size: 1.3em;
    font-style: italic;
    line-height: 1.7;
    color: #f3e8ff;
    text-shadow: 0 0 5px rgba(243, 232, 255, 0.2);
}

.crystal-ball {
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle at 30% 30%, rgba(168, 85, 247, 0.3), transparent 70%);
    border-radius: 50%;
    filter: blur(20px);
    animation: floatCrystal 8s ease-in-out infinite;
    z-index: -1;
}

.crystal-ball:nth-child(1) {
    top: -100px;
    left: -100px;
}

.crystal-ball:nth-child(2) {
    bottom: -100px;
    right: -100px;
    animation-delay: -4s;
}

@keyframes floatCrystal {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.1); }
}

@media (max-width: 768px) {
    .container {
        padding: 30px 20px;
        margin: 10px;
    }
    
    .oracle-title {
        font-size: 2.8em;
    }
    
    textarea {
        height: 100px;
        font-size: 1em;
    }
    
    button {
        padding: 15px 35px;
        font-size: 1.1em;
    }
}

/* ANIMATIONS ALEATOIRES POUR TOUTES LES IMAGES */
.manga-character {
    position: fixed;
    width: 180px;
    height: 180px;
    z-index: 9997;
    opacity: 0;
    pointer-events: none;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 0 20px #ff49b6);
}

/* Images différentes avec des chemins différents */
.manga-character.rocket {
    background-image: url('anime-rocket.gif');
    animation: randomFly1 25s linear infinite;
    width: 200px;
    height: 200px;
}

.manga-character.girl1 {
    background-image: url('anime-girl-2.webp');
    animation: randomFly2 30s linear infinite;
}

.manga-character.girl2 {
    background-image: url('anime-girl-3.webp');
    animation: randomFly3 35s linear infinite;
}

/* Traînées pour toutes les images */
.manga-character::after {
    content: '';
    position: absolute;
    width: 150px;
    height: 30px;
    background: radial-gradient(ellipse, var(--trail-color, #ff00ff), #8a2be2, transparent 80%);
    filter: blur(10px);
    opacity: 0.7;
    top: 60%;
    left: -60px;
    animation: trailPulse 0.3s ease-in-out infinite alternate;
}

.manga-character.rocket::after {
    --trail-color: #ff00ff;
}

.manga-character.girl1::after {
    --trail-color: #00ffff;
}

.manga-character.girl2::after {
    --trail-color: #ffff00;
}

/* Animations aléatoires différentes pour chaque type */
@keyframes randomFly1 {
    0%, 20% {
        opacity: 0;
        transform: translateX(120vw) translateY(80vh) rotate(-25deg) scale(0.7);
    }
    25% {
        opacity: 0.9;
        transform: translateX(90vw) translateY(40vh) rotate(-15deg) scale(0.9);
    }
    45% {
        opacity: 1;
        transform: translateX(50vw) translateY(20vh) rotate(0deg) scale(1.1);
    }
    65% {
        opacity: 0.8;
        transform: translateX(10vw) translateY(60vh) rotate(15deg) scale(0.9);
    }
    85% {
        opacity: 0.6;
        transform: translateX(-40vw) translateY(30vh) rotate(25deg) scale(0.8);
    }
    100% {
        opacity: 0;
        transform: translateX(-120vw) translateY(100vh) rotate(35deg) scale(0.6);
    }
}

@keyframes randomFly2 {
    0%, 15% {
        opacity: 0;
        transform: translateX(-50px) translateY(120vh) rotate(20deg) scale(0.6);
    }
    20% {
        opacity: 0.8;
        transform: translateX(100px) translateY(80vh) rotate(10deg) scale(0.8);
    }
    40% {
        opacity: 0.9;
        transform: translateX(400px) translateY(50vh) rotate(0deg) scale(1);
    }
    60% {
        opacity: 0.7;
        transform: translateX(700px) translateY(70vh) rotate(-10deg) scale(1.2);
    }
    80% {
        opacity: 0.5;
        transform: translateX(1000px) translateY(30vh) rotate(-20deg) scale(0.9);
    }
    100% {
        opacity: 0;
        transform: translateX(1300px) translateY(-50vh) rotate(-30deg) scale(0.7);
    }
}

@keyframes randomFly3 {
    0%, 10% {
        opacity: 0;
        transform: translateX(80vw) translateY(-100px) rotate(15deg) scale(0.8);
    }
    15% {
        opacity: 0.7;
        transform: translateX(60vw) translateY(150px) rotate(25deg) scale(1);
    }
    35% {
        opacity: 0.9;
        transform: translateX(30vw) translateY(300px) rotate(35deg) scale(1.1);
    }
    55% {
        opacity: 0.8;
        transform: translateX(0vw) translateY(200px) rotate(25deg) scale(0.9);
    }
    75% {
        opacity: 0.6;
        transform: translateX(-30vw) translateY(350px) rotate(15deg) scale(0.7);
    }
    100% {
        opacity: 0;
        transform: translateX(-80vw) translateY(500px) rotate(5deg) scale(0.5);
    }
}

@keyframes trailPulse {
    0% {
        transform: scaleX(0.7);
        opacity: 0.4;
    }
    100% {
        transform: scaleX(1.1);
        opacity: 0.8;
    }
}

/* Délais aléatoires pour chaque instance */
.manga-character.delay-1 { animation-delay: 0s; }
.manga-character.delay-2 { animation-delay: 8s; }
.manga-character.delay-3 { animation-delay: 16s; }
.manga-character.delay-4 { animation-delay: 24s; }
.manga-character.delay-5 { animation-delay: 32s; }
.manga-character.delay-6 { animation-delay: 40s; }

/* Effet de scintillement */
.manga-sparkle {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 30%, rgba(255, 255, 255, 0.3) 70%, transparent 100%);
    animation: sparkle 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}