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

:root {
    --bg:       #0f1729;
    --surface:  #151f35;
    --card:     #1a2540;
    --border:   rgba(255,255,255,0.1);
    --text:     #f1f5f9;
    --text-muted: #8b9dc0;
    --primary:  #6366f1;
    --primary-light: #818cf8;
    --success:  #10b981;
    --error:    #ef4444;
    --warn:     #f59e0b;
    --radius:   14px;
}

body {
    font-family: 'Lexend', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 16px 32px;
}

/* ─── HEADER ─── */
.play-header {
    width: 100%;
    max-width: 640px;
    padding: 18px 0 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.play-header-logo {
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ─── PROGRESS BAR ─── */
.progress-wrap {
    width: 100%;
    max-width: 640px;
    margin-bottom: 12px;
}
.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 600;
}
.progress-bar-outer {
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
}
.progress-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #7c3aed);
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(0.4,0,0.2,1);
}

/* ─── QUIZ CARD ─── */
.quiz-card {
    width: 100%;
    max-width: 640px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    margin-bottom: 16px;
}
.quiz-title-section {
    text-align: center;
    padding: 20px 20px 28px;
    width: 100%;
    max-width: 640px;
}
.quiz-title-section h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.2;
}
.quiz-title-section p {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 480px;
    margin: 0 auto 20px;
}
.quiz-meta-chips {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.chip {
    padding: 4px 12px;
    background: rgba(99,102,241,0.12);
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary-light);
}

/* ─── QUESTION ─── */
.q-number {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-light);
    margin-bottom: 10px;
}
.q-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 22px;
}

/* ─── OPTIONS ─── */
.options-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.option-btn {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-family: 'Lexend', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.18s;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.35;
}
.option-btn:hover:not([disabled]) {
    border-color: var(--primary-light);
    background: rgba(99,102,241,0.08);
    color: #fff;
}
.option-btn[disabled] { cursor: default; }
.option-letter {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid currentColor;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    opacity: 0.7;
}
/* States */
.option-btn.selected { border-color: var(--primary); background: rgba(99,102,241,0.12); color: #fff; }
.option-btn.selected .option-letter { opacity: 1; }
.option-btn.correct  { border-color: var(--success); background: rgba(16,185,129,0.12); color: #6ee7b7; }
.option-btn.correct .option-letter { border-color: var(--success); color: var(--success); opacity: 1; }
.option-btn.wrong    { border-color: var(--error); background: rgba(239,68,68,0.08); color: #fca5a5; }
.option-btn.wrong .option-letter { border-color: var(--error); color: var(--error); opacity: 1; }

/* ─── EXPLANATION ─── */
.explanation-box {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.88rem;
    line-height: 1.5;
    display: none;
}
.explanation-box.show { display: block; }
.explanation-box.right { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.2); color: #6ee7b7; }
.explanation-box.wrong { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2); color: #fca5a5; }

/* ─── NEXT BUTTON ─── */
.next-btn {
    width: 100%;
    max-width: 640px;
    padding: 15px 24px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    font-family: 'Lexend', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}
.next-btn.visible { display: flex; }
.next-btn:hover { opacity: 0.92; transform: translateY(-1px); }

/* ─── RESULTS SCREEN ─── */
.results-card {
    width: 100%;
    max-width: 640px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
}
.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    background: rgba(99,102,241,0.08);
}
.score-pct { font-size: 2rem; font-weight: 900; color: var(--text); }
.score-label { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.results-title { font-size: 1.3rem; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.results-sub   { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 24px; }
.results-stats { display: flex; gap: 16px; justify-content: center; margin-bottom: 24px; flex-wrap: wrap; }
.rstat { padding: 12px 20px; background: var(--surface); border-radius: 10px; font-size: 0.9rem; }
.rstat-val { font-size: 1.3rem; font-weight: 800; color: var(--text); }
.rstat-lbl { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.restart-btn {
    padding: 13px 28px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    font-family: 'Lexend', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    margin: 4px;
}
.restart-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.review-section { margin-top: 24px; text-align: left; }
.review-section h3 { font-size: 0.88rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 12px; }
.review-item { padding: 12px 14px; border-radius: 10px; margin-bottom: 8px; border: 1px solid var(--border); }
.review-item.wrong-ans { border-color: rgba(239,68,68,0.25); background: rgba(239,68,68,0.05); }
.review-item.right-ans { border-color: rgba(16,185,129,0.2); background: rgba(16,185,129,0.04); }
.review-q { font-size: 0.88rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.review-given { font-size: 0.8rem; color: #fca5a5; }
.review-correct { font-size: 0.8rem; color: #6ee7b7; font-weight: 600; }

/* ─── NOT FOUND / ERROR ─── */
.error-screen {
    width: 100%;
    max-width: 480px;
    text-align: center;
    padding: 60px 24px;
}
.error-screen h2 { font-size: 1.3rem; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.error-screen p  { font-size: 0.9rem; color: var(--text-muted); }

/* ─── START BUTTON ─── */
.start-btn {
    padding: 15px 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    font-family: 'Lexend', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.start-btn:hover { opacity: 0.9; transform: translateY(-2px); }

/* ─── FOOTER ATTRIB ─── */
.play-footer {
    margin-top: 24px;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.22);
    text-align: center;
}
.play-footer a { color: rgba(255,255,255,0.35); text-decoration: none; }
.play-footer a:hover { color: rgba(255,255,255,0.6); }

/* ─── TIMER ─── */
.timer-bar {
    width: 100%;
    max-width: 640px;
    height: 3px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    margin-bottom: 8px;
    overflow: hidden;
}
.timer-inner {
    height: 100%;
    background: var(--warn);
    border-radius: 2px;
    transition: width 1s linear;
}
