:root {
    --bg-gradient: linear-gradient(135deg, #f0fdfa 0%, #e0e7ff 100%);
    --primary-blue: #4f46e5;
    --primary-hover: #4338ca;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --card-bg: rgba(255, 255, 255, 0.85);
    --border-color: rgba(255, 255, 255, 0.6);
    --doodle-color: #2563eb;
    --error-red: #ef4444;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'DM Sans', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-main);
    overflow-x: hidden;
}

/* Background Blobs */
.blob {
    position: absolute;
    filter: blur(90px);
    z-index: 0;
    opacity: 0.5;
    animation: flow 10s infinite ease-in-out alternate;
}

@keyframes flow {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(20px, -20px);
    }
}

.blob-1 {
    width: 50vw;
    height: 50vw;
    background: #c7d2fe;
    top: -10vw;
    left: -10vw;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
}

.blob-2 {
    width: 40vw;
    height: 40vw;
    background: #99f6e4;
    bottom: -10vw;
    right: -10vw;
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
}

/* Main Layout */
.main-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 700px;
    /* Slightly wider for headline */
    padding: 20px;
    padding-top: 40px;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-color);
    border-radius: 32px;
    padding: 40px 30px;
    box-shadow:
        0 20px 40px -5px rgba(0, 0, 0, 0.05),
        0 10px 20px -5px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
    min-height: 400px;
    /* Prevent huge layouts shifts */
    display: flex;
    flex-direction: column;
}

/* Header */
.quiz-header {
    text-align: center;
    margin-bottom: 30px;
}

.brand {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

.brand-text {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    color: var(--primary-blue);
    background: rgba(79, 70, 229, 0.08);
    padding: 8px 16px;
    border-radius: 100px;
}

.progress-container {
    margin-top: 20px;
    position: relative;
    padding: 0 10px;
}

.progress-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary-blue);
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Content Area */
#quiz-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

h1.question-title {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 30px 0;
    line-height: 1.3;
}

/* Typography for Interstitials */
.interstitial-content {
    text-align: center;
}

.interstitial-title {
    font-family: 'Kalam', cursive;
    font-size: 2rem;
    color: var(--primary-blue);
    margin-bottom: 15px;
    transform: rotate(-2deg);
}

.interstitial-body {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 30px;
    color: #374151;
}

/* Buttons & Inputs */
.options-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-option {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 18px 24px;
    border-radius: 16px;
    font-size: 1.1rem;
    font-family: inherit;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.btn-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.btn-option:active {
    transform: scale(0.98);
}

.btn-selected {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.btn-selected:hover {
    color: white;
    background: var(--primary-hover);
}

.btn-primary {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 100px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.2);
    margin-top: 20px;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

/* Range Slider */
.slider-container {
    padding: 20px 0;
    text-align: center;
}

input[type=range] {
    width: 100%;
    margin: 20px 0;
    accent-color: var(--primary-blue);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Memory Test Styles */
.memory-display {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-align: center;
    padding: 40px 0;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    margin-bottom: 20px;
}

/* Doodle Specifics */
.doodle-stroke {
    stroke: var(--doodle-color);
}

.doodle-decoration {
    position: absolute;
    pointer-events: none;
    opacity: 0.6;
}

.doodle-star-corner {
    top: -15px;
    right: -25px;
    transform: rotate(15deg);
}

/* Footer */
.quiz-footer {
    margin-top: 30px;
    text-align: center;
    font-size: 0.8rem;
    color: #9ca3af;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 15px;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Popup */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-content {
    background: white;
    padding: 40px;
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    position: relative;
}

.doodle-alert {
    font-family: 'Kalam', cursive;
    color: var(--error-red);
    font-size: 3rem;
    transform: rotate(-5deg);
    margin-bottom: 10px;
}

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

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

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