:root {
    --primary: #8b5cf6;
    /* Violet */
    --secondary: #10b981;
    /* Emerald */
    --accent: #f59e0b;
    /* Amber */
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

.crystal-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 30%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(16, 185, 129, 0.15) 0%, transparent 50%);
    z-index: -2;
}

.glow-orb {
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.5;
    animation: drift 20s infinite alternate;
}

.purple {
    background: var(--primary);
    top: -100px;
    left: -100px;
}

.emerald {
    background: var(--secondary);
    bottom: -100px;
    right: -100px;
    animation-delay: -10s;
}

@keyframes drift {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(100px, 100px);
    }
}

.quiz-container {
    width: 90%;
    max-width: 600px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 3rem 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Start Screen */
.badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid var(--primary);
    border-radius: 100px;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}

.title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.title span {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.chapter-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.tag {
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
}

.btn-primary {
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 16px;
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 20px -5px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

.personal-note {
    font-family: 'Dancing Script', cursive;
    margin-top: 2rem;
    text-align: center;
    font-size: 1.4rem;
    color: #cbd5e1;
}

/* Quiz Screen */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.q-progress {
    font-weight: 700;
    font-size: 1.2rem;
}

.timer-box {
    width: 100px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    overflow: hidden;
}

#timer-bar {
    width: 100%;
    height: 100%;
    background: var(--secondary);
    transition: width 0.1s linear;
}

.chapter-indicator {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 6px;
    color: var(--secondary);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

#question-text {
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 2rem;
}

.options-grid {
    display: grid;
    gap: 12px;
}

.option-btn {
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    color: var(--text-main);
    text-align: left;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.option-btn.correct {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--secondary);
}

.option-btn.wrong {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

.progress-track {
    margin-top: 3rem;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 100px;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

/* Result Screen */
.result-card {
    text-align: center;
}

.score-display {
    font-size: 5rem;
    font-weight: 900;
    margin: 2rem 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.score-total {
    font-size: 2rem;
    color: var(--text-muted);
    -webkit-text-fill-color: var(--text-muted);
}

.feedback-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 20px;
    margin-bottom: 2.5rem;
    font-weight: 500;
    color: #e2e8f0;
}

@media (max-width: 480px) {
    .quiz-container {
        padding: 2rem 1.5rem;
    }

    .title {
        font-size: 1.8rem;
    }

    #question-text {
        font-size: 1.2rem;
    }
}