/* Board Sprint: UP Board / NCERT Class 10. Dark, calm, focused: one task per screen. */
:root {
    --bs-bg: #070b16;
    --bs-surface: #0f1626;
    --bs-surface-2: #16203a;
    --bs-line: rgba(148, 163, 184, 0.16);
    --bs-text: #f1f5f9;
    --bs-muted: #94a3b8;
    --bs-accent: #22c55e;
    --bs-accent-2: #14b8a6;
    --bs-warm: #f59e0b;
    --bs-bad: #ef4444;
    --bs-gold: #fbbf24;
    --bs-radius: 18px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.bs-body {
    margin: 0; min-height: 100vh; background: var(--bs-bg); color: var(--bs-text);
    font-family: 'Outfit', 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; line-height: 1.5;
    background-image: radial-gradient(1200px 500px at 50% -200px, rgba(34, 197, 94, 0.12), transparent 70%);
}
#bsApp { max-width: 760px; margin: 0 auto; padding: 0 16px calc(32px + env(safe-area-inset-bottom)); }
a { color: inherit; }
button { font: inherit; }
:focus-visible { outline: 2px solid #5eead4; outline-offset: 2px; }

/* Header */
.bs-head { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 0 12px;
    background: linear-gradient(var(--bs-bg) 70%, rgba(7, 11, 22, 0)); }
.bs-head-title { flex: 1; min-width: 0; }
.bs-head-title h1 { margin: 0; font-size: 1.15rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bs-head-title p { margin: 2px 0 0; font-size: 0.8rem; color: var(--bs-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bs-head-right { display: flex; gap: 6px; align-items: center; }
.bs-back { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--bs-line);
    background: var(--bs-surface); color: var(--bs-text); text-decoration: none; font-size: 1.1rem; cursor: pointer; flex-shrink: 0; }
.bs-lang, .bs-signin { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--bs-line); background: var(--bs-surface);
    color: var(--bs-text); font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.bs-signin { background: linear-gradient(135deg, var(--bs-accent), var(--bs-accent-2)); border: none; color: #fff; }

.bs-main { display: flex; flex-direction: column; gap: 14px; }
.bs-card { background: var(--bs-surface); border: 1px solid var(--bs-line); border-radius: var(--bs-radius); padding: 16px; text-decoration: none; display: block; }
a.bs-card:hover { border-color: rgba(34, 197, 94, 0.45); }
.bs-grow { flex: 1; min-width: 0; }
.bs-muted { color: var(--bs-muted); margin: 0; }
.bs-small { font-size: 0.82rem; }
.bs-hi { color: #cbd5e1; font-size: 0.9em; }
.bs-h2 { font-size: 1.05rem; margin: 0 0 8px; }
.bs-eyebrow { margin: 0; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--bs-accent); font-weight: 800; }
.bs-center { text-align: center; }
.bs-big-icon { font-size: 2.6rem; }

/* Buttons */
.bs-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.bs-stack { flex-direction: column; }
.bs-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 10px 16px; border-radius: 14px;
    border: none; background: linear-gradient(135deg, var(--bs-accent), var(--bs-accent-2)); color: #fff; font-weight: 700; font-size: 0.98rem;
    text-decoration: none; cursor: pointer; text-align: center; }
.bs-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.bs-btn-ghost { background: var(--bs-surface-2); border: 1px solid var(--bs-line); color: var(--bs-text); }
.bs-btn-warm { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.bs-block { width: 100%; }

/* Home */
.bs-today { background: linear-gradient(160deg, rgba(34, 197, 94, 0.14), rgba(20, 184, 166, 0.05)); border-color: rgba(34, 197, 94, 0.3); }
.bs-today-top { display: flex; gap: 14px; align-items: center; justify-content: space-between; }
.bs-countdown { margin: 4px 0 2px; font-size: 1.3rem; font-weight: 700; }
.bs-countdown strong { font-size: 2.2rem; color: var(--bs-gold); }
.bs-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.bs-chip { font-size: 0.82rem; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: rgba(15, 23, 42, 0.6); border: 1px solid var(--bs-line); }
.bs-ring { width: 72px; height: 72px; flex-shrink: 0; }
.bs-ring-bg { fill: none; stroke: rgba(148, 163, 184, 0.2); stroke-width: 7; }
.bs-ring-fg { fill: none; stroke: var(--bs-accent); stroke-width: 7; stroke-linecap: round; transition: stroke-dasharray .4s; }
.bs-ring-text { fill: var(--bs-text); font-size: 14px; font-weight: 800; }
.bs-grid { display: grid; gap: 12px; }
.bs-subject { display: flex; gap: 14px; align-items: center; }
.bs-subject h3, .bs-chapter h3 { margin: 0; font-size: 1.02rem; }
.bs-subject-icon { font-size: 2rem; width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--bs-surface-2); }
.bs-go { font-size: 1.6rem; color: var(--bs-muted); }
.bs-bar { height: 7px; border-radius: 999px; background: rgba(148, 163, 184, 0.18); overflow: hidden; margin-top: 8px; }
.bs-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--bs-accent), var(--bs-accent-2)); }
.bs-nudge { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.bs-nudge p { margin: 0; }
.bs-how ol { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 6px; }

/* Subject and chapter */
.bs-list { display: flex; flex-direction: column; gap: 10px; }
.bs-chapter { display: flex; gap: 12px; align-items: center; }
.bs-chapter .bs-hi { margin: 0; }
.bs-ch-no { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; flex-shrink: 0; }
.bs-ch-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.bs-badge { font-size: 0.72rem; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: var(--bs-surface-2); color: var(--bs-muted); }
.bs-badge.s-mastered { background: rgba(34, 197, 94, 0.18); color: #86efac; }
.bs-badge.s-practising { background: rgba(245, 158, 11, 0.16); color: #fcd34d; }
.bs-tabs { display: flex; gap: 6px; padding: 4px; border-radius: 14px; background: var(--bs-surface); border: 1px solid var(--bs-line); overflow-x: auto; }
.bs-tab { flex: 1; min-height: 42px; border: none; border-radius: 10px; background: transparent; color: var(--bs-muted); font-weight: 700; cursor: pointer; white-space: nowrap; padding: 0 10px; }
.bs-tab[aria-selected="true"] { background: var(--bs-surface-2); color: var(--bs-text); }
.bs-stats { display: flex; gap: 14px; align-items: center; }
.bs-stats p { margin: 4px 0 0; }
.bs-notes { display: flex; flex-direction: column; gap: 12px; }
.bs-note h3 { margin: 0 0 6px; font-size: 1.02rem; display: flex; gap: 8px; align-items: center; }
.bs-note-no { width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center; background: rgba(34, 197, 94, 0.16); color: #86efac; font-size: 0.8rem; flex-shrink: 0; }
.bs-note-sub { margin: -2px 0 8px; }
.bs-note ul { margin: 6px 0 0; padding-left: 1.15rem; display: flex; flex-direction: column; gap: 5px; }
.bs-hi-list { border-top: 1px dashed var(--bs-line); padding-top: 8px !important; color: #e2e8f0; }
.bs-formula { margin: 6px 0; padding: 10px 12px; border-radius: 12px; background: #0b1220; border: 1px solid rgba(20, 184, 166, 0.35); font-family: 'Cambria Math', 'STIX Two Math', Georgia, serif; font-size: 1.02rem; white-space: pre-wrap; color: #99f6e4; }
.bs-written section { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.bs-qa summary { cursor: pointer; display: flex; gap: 10px; align-items: flex-start; list-style: none; font-weight: 600; }
.bs-qa summary::-webkit-details-marker { display: none; }
.bs-marks { flex-shrink: 0; font-size: 0.72rem; font-weight: 800; padding: 2px 7px; border-radius: 8px; background: rgba(251, 191, 36, 0.15); color: var(--bs-gold); }
.bs-answer { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--bs-line); white-space: pre-line; color: #e2e8f0; }

/* Quiz */
.bs-quiz { padding-top: 12px; }
.bs-quiz-top { display: flex; gap: 12px; align-items: center; }
.bs-quiz-title { font-size: 0.85rem; font-weight: 700; color: var(--bs-muted); }
.bs-timer { font-weight: 800; font-variant-numeric: tabular-nums; padding: 6px 10px; border-radius: 10px; background: var(--bs-surface); border: 1px solid var(--bs-line); }
.bs-timer.low { color: #fca5a5; border-color: rgba(239, 68, 68, 0.5); }
.bs-q-meta { margin: 0 0 8px; font-size: 0.78rem; color: var(--bs-muted); text-transform: capitalize; }
.bs-q-text { font-size: 1.08rem; font-weight: 600; white-space: pre-line; overflow-wrap: anywhere; }
.bs-options { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.bs-option { display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; min-height: 52px; padding: 12px; border-radius: 14px;
    border: 1.5px solid var(--bs-line); background: var(--bs-surface-2); color: var(--bs-text); cursor: pointer; font-size: 1rem; }
.bs-option:hover:not(:disabled) { border-color: rgba(34, 197, 94, 0.5); }
.bs-option:disabled { cursor: default; }
.bs-option.picked { border-color: var(--bs-accent-2); background: rgba(20, 184, 166, 0.14); }
.bs-option.right { border-color: var(--bs-accent); background: rgba(34, 197, 94, 0.16); }
.bs-option.wrong { border-color: var(--bs-bad); background: rgba(239, 68, 68, 0.14); }
.bs-opt-key { flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 0.85rem; background: rgba(148, 163, 184, 0.16); }
.bs-opt-text { flex: 1; min-width: 0; overflow-wrap: anywhere; white-space: pre-line; }
.bs-feedback { border-radius: var(--bs-radius); padding: 14px 16px; border: 1px solid; }
.bs-feedback.ok { border-color: rgba(34, 197, 94, 0.45); background: rgba(34, 197, 94, 0.08); }
.bs-feedback.no { border-color: rgba(239, 68, 68, 0.45); background: rgba(239, 68, 68, 0.07); }
.bs-expl { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; white-space: pre-line; color: #e2e8f0; overflow-wrap: anywhere; }
.bs-hi-block { padding-top: 8px; border-top: 1px dashed var(--bs-line); }
.bs-quiz-nav { margin-top: 0; }
.bs-quiz-nav .bs-btn { flex: 1; }
.bs-palette { display: flex; flex-wrap: wrap; gap: 6px; }
.bs-pal { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--bs-line); background: var(--bs-surface); color: var(--bs-muted); cursor: pointer; font-weight: 700; font-size: 0.8rem; }
.bs-pal.done { background: rgba(20, 184, 166, 0.2); color: var(--bs-text); }
.bs-pal.now { outline: 2px solid var(--bs-accent); }
.bs-report { align-self: center; background: none; border: none; color: var(--bs-muted); font-size: 0.82rem; cursor: pointer; text-decoration: underline; padding: 8px; }
.bs-table { border-collapse: collapse; margin: 8px 0; font-size: 0.9rem; display: block; overflow-x: auto; max-width: 100%; }
.bs-table td, .bs-table th { border: 1px solid var(--bs-line); padding: 6px 8px; vertical-align: top; }
.bs-q-text small, .bs-review small { display: block; color: var(--bs-muted); }

/* Result */
.bs-result { text-align: center; background: linear-gradient(160deg, rgba(251, 191, 36, 0.12), rgba(34, 197, 94, 0.06)); }
.bs-result h2 { margin: 6px 0 4px; font-size: 1.5rem; }
.bs-xp { margin: 10px 0 0; font-weight: 800; color: var(--bs-gold); }
.bs-breakdown { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--bs-line); text-decoration: none; font-size: 0.92rem; }
.bs-breakdown .bs-bar { grid-column: 1 / -1; margin-top: 4px; }
.bs-review { padding: 10px 0; border-bottom: 1px solid var(--bs-line); }
.bs-review summary { cursor: pointer; display: flex; gap: 8px; align-items: flex-start; }
.bs-review-mark { flex-shrink: 0; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-weight: 800; font-size: 0.8rem; }
.bs-review.ok .bs-review-mark { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.bs-review.no .bs-review-mark { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.bs-review p { margin: 8px 0 0; }

/* Sheet and toast */
.bs-sheet-bg { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, 0.6); display: flex; align-items: flex-end; justify-content: center; }
.bs-sheet { width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: var(--bs-surface); border: 1px solid var(--bs-line); border-radius: 20px 20px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); }
.bs-sheet:focus { outline: none; }
.bs-sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.bs-sheet-head h2 { margin: 0; font-size: 1.1rem; }
.bs-form { display: flex; flex-direction: column; gap: 12px; }
.bs-reasons { display: flex; flex-direction: column; gap: 8px; }
.bs-reasons label { display: flex; gap: 8px; align-items: center; min-height: 36px; }
.bs-form textarea { width: 100%; border-radius: 12px; border: 1px solid var(--bs-line); background: var(--bs-bg); color: var(--bs-text); padding: 10px; font: inherit; }
.bs-report-row { display: flex; flex-direction: column; gap: 6px; }
.bs-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; z-index: 1100;
    background: #111827; color: #fff; border: 1px solid var(--bs-line); padding: 10px 16px; border-radius: 12px; font-weight: 600; transition: all .25s; pointer-events: none; max-width: calc(100% - 32px); }
.bs-toast.show { opacity: 1; transform: translate(-50%, 0); }
.bs-skeleton { height: 120px; border-radius: var(--bs-radius); background: linear-gradient(90deg, var(--bs-surface), var(--bs-surface-2), var(--bs-surface)); background-size: 200% 100%; animation: bs-shine 1.4s infinite; }
@keyframes bs-shine { to { background-position: -200% 0; } }

@media (max-width: 420px) {
    .bs-countdown strong { font-size: 1.9rem; }
    .bs-ring { width: 62px; height: 62px; }
    .bs-head-title h1 { font-size: 1.02rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
