:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #cbd5e1;
    --accent: #10b981;
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Background Animations */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    filter: blur(80px);
    opacity: 0.6;
}

.blob {
    position: absolute;
    border-radius: 50%;
    animation: move 20s infinite alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #4f46e5;
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 350px;
    height: 350px;
    background: #7c3aed;
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: #2563eb;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes move {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(100px, 50px) scale(1.1);
    }
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--glass-border);
    font-family: inherit;
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn.primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn.active {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.btn.icon-only {
    padding: 0.75rem;
    aspect-ratio: 1;
}

.stats {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    color: var(--text-dim);
    border: 1px solid var(--glass-border);
    font-variant-numeric: tabular-nums;
    min-width: 120px;
    text-align: center;
}

/* Navigation & Single Card Layout */
#single-question-area {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    position: relative;
    padding: 2rem 0;
}

.navigation {
    display: flex;
    align-items: center;
    gap: 2rem;
    width: 100%;
}

#active-card-container {
    flex: 1;
    min-width: 0;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
    border-color: var(--primary);
}

.nav-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.question-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem;
    margin-bottom: 0;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.6s ease-out both;
    min-height: 250px;
    display: flex;
    flex-direction: column;
}

.question-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: var(--shadow-lg);
    background: rgba(30, 41, 59, 0.85);
}

.card-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
}

.q-number {
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    text-transform: uppercase;
}

.q-text {
    flex: 1;
    font-size: 1.2rem;
    font-weight: 600;
    color: #e2e8f0;
}

.chevron {
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.question-card.active .chevron {
    transform: rotate(180deg);
}

.answer-container {
    max-height: 0;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.question-card.active .answer-container {
    max-height: 500px;
    opacity: 1;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.answer {
    color: var(--text-muted);
    font-size: 1.05rem;
    white-space: pre-wrap;
}

.answer-label {
    display: block;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

/* LAP Mode & Feedback */
#lap-feedback {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    animation: fadeIn 0.4s ease-out;
}

#lap-feedback p {
    font-weight: 600;
    color: var(--text-dim);
}

.feedback-btns {
    display: flex;
    gap: 1.5rem;
}

.feedback-btn {
    padding: 1rem 2rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--card-bg);
    color: white;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.feedback-btn.correct:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
    transform: translateY(-2px);
}

.feedback-btn.wrong:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    transform: translateY(-2px);
}

/* Results Screen */
#results-screen {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    animation: fadeIn 0.5s ease;
}

.results-content {
    text-align: center;
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.score-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.score-card {
    padding: 1.5rem;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
}

.score-card.correct {
    border-color: rgba(34, 197, 94, 0.3);
}

.score-card.wrong {
    border-color: rgba(239, 68, 68, 0.3);
}

.score-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

.score-val {
    font-size: 2rem;
    font-weight: 800;
}

.correct .score-val {
    color: #22c55e;
}

.wrong .score-val {
    color: #ef4444;
}

.percentage-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

#score-percentage {
    position: absolute;
    font-size: 1.5rem;
    font-weight: 800;
}

.progress-ring__circle {
    transition: stroke-dashoffset 0.8s ease-out;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    stroke-dasharray: 326.72;
    stroke-dashoffset: 326.72;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loader {
    text-align: center;
    padding: 3rem;
    font-size: 1.2rem;
    color: var(--text-muted);
}

.hidden {
    display: none !important;
}

footer {
    text-align: center;
    margin-top: 4rem;
    padding-bottom: 2rem;
    color: #475569;
    font-size: 0.9rem;
}

@media (max-width: 640px) {
    h1 {
        font-size: 2.5rem;
    }

    .question-card {
        padding: 1.25rem;
    }

    .q-text {
        font-size: 1.1rem;
    }

    .navigation {
        gap: 0.5rem;
    }
}