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

body {
    font-family: 'Crimson Text', serif;
    background: linear-gradient(to bottom, #0f0c29, #302b63, #24243e);
    min-height: 100vh;
    color: #e8e6e3;
    overflow-x: hidden;
}

/* Animated starfield background */
.stars, .twinkling {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

.stars {
    background: transparent url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 400"><circle fill="%23fff" cx="50" cy="50" r="1"/><circle fill="%23fff" cx="150" cy="80" r="0.5"/><circle fill="%23fff" cx="250" cy="30" r="1.2"/><circle fill="%23fff" cx="350" cy="100" r="0.8"/><circle fill="%23fff" cx="100" cy="200" r="1"/><circle fill="%23fff" cx="200" cy="150" r="0.6"/><circle fill="%23fff" cx="300" cy="250" r="1.1"/><circle fill="%23fff" cx="80" cy="350" r="0.7"/><circle fill="%23fff" cx="180" cy="300" r="1"/><circle fill="%23fff" cx="280" cy="380" r="0.5"/><circle fill="%23fff" cx="380" cy="320" r="0.9"/><circle fill="%23fff" cx="20" cy="120" r="0.8"/><circle fill="%23fff" cx="120" cy="280" r="1.2"/><circle fill="%23fff" cx="220" cy="220" r="0.6"/><circle fill="%23fff" cx="320" cy="180" r="1"/></svg>') repeat;
    background-size: 400px 400px;
    animation: twinkle 4s ease-in-out infinite;
    z-index: 0;
}

.twinkling {
    background: transparent url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 300"><circle fill="%23ffd700" opacity="0.6" cx="75" cy="75" r="1.5"/><circle fill="%23ffd700" opacity="0.4" cx="225" cy="150" r="1"/><circle fill="%23ffd700" opacity="0.5" cx="150" cy="225" r="1.2"/></svg>') repeat;
    background-size: 300px 300px;
    animation: twinkle 3s ease-in-out infinite alternate;
    z-index: 0;
}

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

/* Container */
.container {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 50px;
}

.crystal-ball {
    font-size: 80px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(147, 112, 219, 0.8));
    cursor: pointer;
    position: relative;
    display: inline-block;
    transition: filter 0.3s ease;
}

.crystal-ball:hover {
    filter: drop-shadow(0 0 30px rgba(255, 215, 0, 1));
}

.crystal-ball.color-shift {
    animation: float 3s ease-in-out infinite, colorShift 1s ease-in-out;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes colorShift {
    0% { filter: drop-shadow(0 0 25px rgba(147, 112, 219, 1)); }
    25% { filter: drop-shadow(0 0 35px rgba(255, 215, 0, 1)); }
    50% { filter: drop-shadow(0 0 35px rgba(255, 105, 180, 1)); }
    75% { filter: drop-shadow(0 0 35px rgba(0, 255, 255, 1)); }
    100% { filter: drop-shadow(0 0 25px rgba(147, 112, 219, 1)); }
}

/* Sparkle particles */
.sparkle {
    position: absolute;
    pointer-events: none;
    font-size: 20px;
    animation: sparkleFloat 1s ease-out forwards;
    z-index: 10;
}

@keyframes sparkleFloat {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}

h1 {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    background: linear-gradient(135deg, #ffd700, #ff69b4, #9370db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    margin-bottom: 10px;
}

.tagline {
    font-style: italic;
    color: #b8b5ff;
    font-size: 1.2rem;
}

/* Input Section */
.input-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    margin-bottom: 40px;
}

.input-section label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: #ffd700;
    margin-bottom: 15px;
    text-align: center;
}

#subject-line {
    width: 100%;
    padding: 18px 25px;
    font-size: 1.1rem;
    font-family: 'Crimson Text', serif;
    border: 2px solid rgba(147, 112, 219, 0.5);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    outline: none;
    transition: all 0.3s ease;
    margin-bottom: 25px;
}

#subject-line::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

#subject-line:focus {
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

#divine-btn {
    display: block;
    width: 100%;
    padding: 18px 40px;
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a2e;
    background: linear-gradient(135deg, #ffd700, #ff8c00, #ff69b4);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

#divine-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.6);
}

#divine-btn:active {
    transform: translateY(-1px);
}

.btn-text {
    display: inline-block;
}

/* Horoscope Result */
.horoscope-result {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.8s ease-out;
}

.horoscope-result.hidden {
    display: none;
}

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

.zodiac-symbol {
    font-size: 60px;
    text-align: center;
    margin-bottom: 15px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.horoscope-result h2 {
    font-family: 'Cinzel', serif;
    text-align: center;
    color: #ffd700;
    font-size: 1.8rem;
    margin-bottom: 25px;
}

#horoscope-reading {
    font-size: 1.2rem;
    line-height: 1.8;
    text-align: center;
    color: #e8e6e3;
    margin-bottom: 30px;
    font-style: italic;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(147, 112, 219, 0.3);
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #b8b5ff;
    margin-bottom: 8px;
}

.stat-value {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffd700;
}

/* Advice Section */
.advice-section {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(147, 112, 219, 0.1));
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.advice-section h3 {
    font-family: 'Cinzel', serif;
    text-align: center;
    color: #ffd700;
    margin-bottom: 15px;
}

#advice {
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Lucky Section */
.lucky-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    text-align: center;
}

.lucky-section span {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 0.95rem;
    border: 1px solid rgba(147, 112, 219, 0.3);
}

/* Footer */
footer {
    margin-top: 50px;
    text-align: center;
    padding: 30px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

footer p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 10px;
}

.copyright {
    font-style: italic;
}

/* Responsive */
@media (max-width: 600px) {
    h1 {
        font-size: 2rem;
    }

    .crystal-ball {
        font-size: 60px;
    }

    .input-section,
    .horoscope-result {
        padding: 25px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .lucky-section {
        flex-direction: column;
    }

    .lucky-section span {
        display: block;
    }
}
