:root {
  --bg: #f7f8fc; --surface: #fff; --surface-soft: #f1f2f8; --text: #17182b;
  --muted: #777990; --primary: #5b5bd6; --primary-dark: #4646b7; --border: #e8e9f1;
  --success: #21a879; --success-soft: #eaf8f2; --danger: #dc6471; --danger-soft: #fdecef;
  --amber: #f2a93b; --blue: #4c86db; --shadow: 0 14px 40px rgba(39,43,82,.08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: "DM Sans", sans-serif; color: var(--text); background: var(--bg); }
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }
.topbar { height: 76px; display:flex; align-items:center; justify-content:space-between; max-width:1180px; margin:auto; padding:0 24px; }
.brand { border:0; background:none; display:flex; align-items:center; gap:10px; color:var(--text); }
.brand-mark { width:38px; height:38px; border-radius:12px; display:grid; place-items:center; background:linear-gradient(135deg,#7475e8,#4f50bd); color:#fff; box-shadow:0 8px 18px rgba(91,91,214,.24); transform:rotate(-4deg); }
.brand-mark span { font-family:"Manrope"; font-size:21px; transform:rotate(4deg); }
.brand-text { font-family:"Manrope"; font-size:17px; }.brand-text strong { color:var(--primary); }
.top-actions { display:flex; gap:8px; }.icon-button { width:40px; height:40px; border:1px solid var(--border); border-radius:12px; background:var(--surface); color:var(--muted); transition:.2s; font-size:17px; }.icon-button:hover { border-color:var(--primary); color:var(--primary); transform:translateY(-2px); }
.screen { display:none; animation:screenIn .35s ease both; }.screen.active { display:block; }
@keyframes screenIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
main { max-width:1180px; margin:auto; padding:0 24px 60px; }
.hero { min-height:390px; display:grid; grid-template-columns:1.08fr .92fr; align-items:center; padding:42px 56px; border-radius:28px; background:linear-gradient(115deg,#f1f1fb 0%,#f8f8fd 58%,#ededfa 100%); overflow:hidden; position:relative; }
.hero-copy { position:relative; z-index:2; }.eyebrow { display:inline-flex; align-items:center; gap:8px; color:var(--primary); font-weight:700; font-size:13px; text-transform:uppercase; letter-spacing:.08em; }.eyebrow-dot { width:8px; height:8px; border-radius:50%; background:#8b8ce8; }
.hero h1 { font-family:"Manrope"; font-size:48px; line-height:1.08; letter-spacing:-2px; margin:16px 0 16px; }.hero h1 span { color:var(--primary); }.hero-copy p { color:var(--muted); font-size:18px; margin:0 0 28px; }
.primary-button { border:0; border-radius:13px; background:var(--primary); color:#fff; height:52px; padding:0 24px; font-weight:700; display:inline-flex; align-items:center; justify-content:center; gap:14px; box-shadow:0 10px 24px rgba(91,91,214,.22); transition:.2s; }.primary-button:hover:not(:disabled) { background:var(--primary-dark); transform:translateY(-2px); box-shadow:0 14px 28px rgba(91,91,214,.28); }.primary-button:disabled { opacity:.45; cursor:not-allowed; box-shadow:none; }
.hero-art { height:300px; position:relative; }.orb { position:absolute; border-radius:50%; filter:blur(.2px); }.orb-one { width:220px; height:220px; right:20px; top:30px; background:linear-gradient(135deg,#cfd0fa,#aeb0ed); opacity:.75; }.orb-two { width:120px; height:120px; right:-20px; bottom:-15px; background:#e2e2fb; }
.hero-card { position:absolute; background:rgba(255,255,255,.92); border:1px solid rgba(255,255,255,.8); box-shadow:0 18px 40px rgba(67,67,126,.12); }.hero-card-main { width:210px; height:130px; border-radius:20px; right:55px; top:70px; padding:24px; }.hero-card-label { display:block; color:var(--muted); font-size:13px; }.hero-card-main strong { display:block; font-family:"Manrope"; font-size:38px; margin-top:4px; }.mini-progress { height:7px; background:#ececf5; border-radius:10px; margin-top:10px; overflow:hidden; }.mini-progress span { display:block; width:68%; height:100%; border-radius:10px; background:var(--primary); }
.hero-card-score { width:145px; height:82px; border-radius:16px; right:230px; bottom:18px; display:grid; grid-template-columns:36px 1fr; grid-template-rows:1fr 1fr; align-items:center; padding:12px; }.hero-card-score>span { grid-row:1/3; width:34px; height:34px; border-radius:10px; background:#fff4dd; color:var(--amber); display:grid; place-items:center; }.hero-card-score strong { align-self:end; }.hero-card-score small { color:var(--muted); align-self:start; }
.section-block { margin-top:42px; }.section-heading { display:flex; justify-content:space-between; align-items:end; margin-bottom:16px; }.section-kicker { color:var(--primary); font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.1em; }.section-heading h2 { margin:4px 0 0; font-family:"Manrope"; font-size:25px; }.question-count { color:var(--muted); font-size:13px; }
.subject-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:18px; }.subject-card { border:1px solid var(--border); background:var(--surface); border-radius:18px; padding:22px; min-height:170px; transition:.25s; text-align:left; color:var(--text); }.subject-card:hover { transform:translateY(-5px); border-color:#cfd0ed; box-shadow:var(--shadow); }.subject-card-head { display:flex; justify-content:space-between; align-items:flex-start; }.subject-icon { width:48px; height:48px; border-radius:14px; display:grid; place-items:center; font-family:"Manrope"; font-size:20px; }.subject-icon.algebra { background:#eeedff; color:var(--primary); }.subject-icon.science { background:#eaf8f2; color:var(--success); }.subject-icon.computer { background:#edf3fd; color:var(--blue); }.subject-arrow { color:#aaa; }.subject-card h3 { font-family:"Manrope"; margin:16px 0 5px; }.subject-card p { color:var(--muted); font-size:13px; margin:0 0 12px; }.subject-card-meta { color:var(--primary); font-size:12px; font-weight:700; }
.stats-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:18px; }.stat-card { background:var(--surface); border:1px solid var(--border); border-radius:16px; padding:18px; display:flex; align-items:center; gap:14px; }.stat-icon { width:44px; height:44px; border-radius:12px; display:grid; place-items:center; font-weight:800; }.stat-icon.purple { background:#eeedff;color:var(--primary); }.stat-icon.amber { background:#fff4df;color:var(--amber); }.stat-icon.blue { background:#edf3fd;color:var(--blue); }.stat-card strong { display:block;font-family:"Manrope";font-size:23px; }.stat-card span { color:var(--muted);font-size:12px; }
.leaderboard { background:var(--surface); border:1px solid var(--border); border-radius:16px; overflow:hidden; }.leader-row { display:grid; grid-template-columns:45px 1fr 100px 100px; align-items:center; min-height:64px; padding:0 18px; border-bottom:1px solid var(--border); }.leader-row:last-child { border-bottom:0; }.leader-rank { color:var(--muted); font-weight:700; }.leader-subject { font-weight:700; }.leader-score { font-weight:800; color:var(--primary); }.leader-date { color:var(--muted); font-size:12px;text-align:right; }.leader-empty { padding:22px; color:var(--muted); text-align:center; }
.screen-container { max-width:960px; margin:auto; }.screen-container.narrow { max-width:780px; }.back-button,.text-button { border:0;background:none;color:var(--muted);font-weight:700;padding:10px 0; }.back-button:hover,.text-button:hover { color:var(--primary); }.setup-header { text-align:center;margin:22px 0 26px; }.setup-header h1 { font-family:"Manrope";font-size:38px;margin:8px 0 6px; }.setup-header p { color:var(--muted);margin:0; }
.setup-card,.settings-card { background:var(--surface);border:1px solid var(--border);border-radius:22px;padding:28px;box-shadow:var(--shadow); }.setup-card fieldset { border:0;padding:0;margin:0 0 24px; }.setup-card legend { font-weight:800;margin-bottom:12px; }.subject-options { display:grid;grid-template-columns:repeat(3,1fr);gap:12px; }.subject-option input,.segmented input,.mode-card input { position:absolute;opacity:0; }.subject-option>span { height:72px;border:1px solid var(--border);border-radius:14px;display:flex;align-items:center;gap:10px;padding:12px;font-weight:700; }.subject-option input:checked+span { border-color:var(--primary);background:#f4f4ff;color:var(--primary);box-shadow:0 0 0 2px rgba(91,91,214,.08); }.subject-option .subject-icon { width:38px;height:38px;font-size:15px; }
.setup-row { display:grid;grid-template-columns:1fr 1fr;gap:24px; }.segmented { display:flex;background:var(--surface-soft);border-radius:12px;padding:4px; }.segmented label { flex:1; }.segmented label span { height:42px;border-radius:9px;display:grid;place-items:center;color:var(--muted);font-weight:700;font-size:13px; }.segmented input:checked+span { background:var(--surface);color:var(--primary);box-shadow:0 3px 10px rgba(40,43,77,.07); }
.mode-options { display:grid;grid-template-columns:1fr 1fr;gap:12px; }.mode-card { position:relative;border:1px solid var(--border);border-radius:14px;padding:14px;display:flex;align-items:center;gap:12px; }.mode-card:has(input:checked) { border-color:var(--primary);background:#f7f7ff; }.mode-icon { width:42px;height:42px;border-radius:11px;background:var(--surface-soft);display:grid;place-items:center;color:var(--primary); }.mode-card strong,.mode-card small { display:block; }.mode-card small { color:var(--muted);margin-top:3px; }.setup-start { width:100%; }
.quiz-layout { display:grid;grid-template-columns:minmax(0,1fr) 210px;gap:24px;max-width:980px;margin:auto; }.quiz-main { min-width:0; }.quiz-top { height:52px;display:flex;justify-content:space-between;align-items:center; }.timer { height:38px;min-width:92px;border-radius:11px;background:var(--surface);border:1px solid var(--border);display:flex;align-items:center;justify-content:center;gap:7px;color:var(--primary); }.progress-meta { display:flex;justify-content:space-between;color:var(--muted);font-size:13px;margin:8px 0 8px; }.progress-meta strong { color:var(--primary); }.progress-track { height:7px;background:#e7e8f0;border-radius:10px;overflow:hidden;margin-bottom:18px; }.progress-fill { height:100%;width:0;background:linear-gradient(90deg,var(--primary),#8586ed);border-radius:10px;transition:.35s; }
.question-card { background:var(--surface);border:1px solid var(--border);border-radius:22px;padding:30px;box-shadow:var(--shadow); }.question-badges { display:flex;gap:8px;flex-wrap:wrap; }.difficulty-badge,.worksheet-badge { display:inline-flex;height:26px;align-items:center;border-radius:20px;padding:0 10px;background:#eeedff;color:var(--primary);font-size:11px;font-weight:800;text-transform:uppercase; }.worksheet-badge { background:#e9f7f0;color:var(--success); }.question-card h1 { font-family:"Manrope";font-size:27px;line-height:1.35;margin:16px 0 22px; }.answer-grid { display:grid;grid-template-columns:1fr 1fr;gap:12px; }.answer-button { min-height:68px;border:1px solid var(--border);background:var(--surface);border-radius:14px;padding:12px 14px;text-align:left;display:flex;align-items:center;gap:12px;color:var(--text);transition:.18s; }.answer-button:hover:not(:disabled) { border-color:#bfc0df;transform:translateY(-2px); }.answer-letter { width:34px;height:34px;border-radius:9px;background:var(--surface-soft);display:grid;place-items:center;font-weight:800;color:var(--muted);flex:0 0 auto; }.answer-button.correct { border-color:var(--success);background:var(--success-soft); }.answer-button.correct .answer-letter { background:var(--success);color:#fff; }.answer-button.incorrect { border-color:var(--danger);background:var(--danger-soft); }.answer-button.incorrect .answer-letter { background:var(--danger);color:#fff; }.answer-button:disabled { cursor:default; }
.feedback { margin-top:16px;border-radius:14px;padding:14px 16px;border-left:4px solid var(--success);background:var(--success-soft); }.feedback.wrong { border-left-color:var(--danger);background:var(--danger-soft); }.feedback-heading { display:flex;justify-content:space-between; }.feedback-heading span { color:var(--primary);font-weight:800; }.feedback p { color:var(--muted);margin:7px 0 0;font-size:13px; }.question-actions { display:flex;justify-content:space-between;margin-top:22px; }.secondary-button { height:52px;border:1px solid var(--border);border-radius:13px;background:var(--surface);color:var(--text);padding:0 20px;font-weight:700; }.secondary-button:hover { border-color:var(--primary);color:var(--primary); }
.quiz-summary { margin-top:52px;background:var(--surface);border:1px solid var(--border);border-radius:18px;padding:20px;height:max-content; }.quiz-summary h3 { margin:0 0 14px;font-size:15px; }.summary-ring { width:118px;height:118px;border-radius:50%;background:conic-gradient(var(--primary) 0deg,#ececf4 0deg);margin:10px auto 16px;display:grid;place-items:center; }.summary-ring>div { width:92px;height:92px;border-radius:50%;background:var(--surface);display:grid;place-content:center;text-align:center; }.summary-ring strong { font-family:"Manrope";font-size:24px; }.summary-ring span { color:var(--muted);font-size:11px; }.summary-line { display:flex;justify-content:space-between;padding:10px 0;border-top:1px solid var(--border);font-size:13px;color:var(--muted); }.summary-line strong { color:var(--text); }
.results-container { max-width:820px; }.result-hero { text-align:center;padding:20px 20px 10px; }.result-badge { width:58px;height:58px;border-radius:18px;background:#fff2d8;color:var(--amber);display:grid;place-items:center;font-size:25px;margin:0 auto 10px;transform:rotate(-4deg); }.result-hero h1 { font-family:"Manrope";font-size:36px;margin:6px 0 4px; }.result-hero p { color:var(--muted);margin:0 0 12px; }.score-ring { --score:0deg;width:150px;height:150px;border-radius:50%;background:conic-gradient(var(--primary) var(--score),#ececf4 0);margin:18px auto;display:grid;place-items:center; }.score-ring>div { width:124px;height:124px;border-radius:50%;background:var(--surface);display:grid;place-content:center; }.score-ring strong { font-family:"Manrope";font-size:30px; }.score-ring span { color:var(--muted);font-size:11px; }
.result-stats { display:grid;grid-template-columns:repeat(4,1fr);gap:12px; }.result-stats article { background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:16px;text-align:center; }.result-stats strong { display:block;font-family:"Manrope";font-size:20px; }.result-stats span { color:var(--muted);font-size:12px; }.result-details { display:grid;grid-template-columns:1.5fr 1fr;gap:12px;margin-top:12px; }.breakdown-card,.personal-card { background:var(--surface);border:1px solid var(--border);border-radius:16px;padding:18px; }.breakdown-card h3,.personal-card h3 { margin:0 0 12px;font-size:14px; }.breakdown-row { display:grid;grid-template-columns:100px 1fr 40px;align-items:center;gap:8px;margin:8px 0;font-size:12px; }.breakdown-bar { height:7px;border-radius:8px;background:var(--surface-soft);overflow:hidden; }.breakdown-bar span { height:100%;display:block;background:var(--primary);border-radius:8px; }.record-score { display:flex;justify-content:space-between;align-items:center;color:var(--muted); }.record-score strong { font-family:"Manrope";font-size:25px;color:var(--primary); }.personal-card p { color:var(--muted);font-size:12px; }.result-actions { display:flex;justify-content:center;align-items:center;gap:10px;margin-top:18px; }
.review-list { display:grid;gap:12px; }.review-card { background:var(--surface);border:1px solid var(--border);border-radius:16px;padding:18px; }.review-card.correct { border-left:4px solid var(--success); }.review-card.incorrect { border-left:4px solid var(--danger); }.review-card h3 { margin:0 0 10px;font-size:16px; }.review-answer { display:grid;gap:5px;color:var(--muted);font-size:13px; }.review-answer strong.correct-text { color:var(--success); }.review-answer strong.incorrect-text { color:var(--danger); }.review-card p { color:var(--muted);font-size:12px;margin:10px 0 0; }
.settings-card { max-width:620px;margin:auto; }.setting-row { display:flex;justify-content:space-between;align-items:center;padding:16px 0;border-bottom:1px solid var(--border); }.setting-row strong,.setting-row span { display:block; }.setting-row div span { color:var(--muted);font-size:12px;margin-top:3px; }.switch { position:relative;width:48px;height:28px; }.switch input { opacity:0; }.switch span { position:absolute;inset:0;background:#dfe0e8;border-radius:20px;transition:.2s; }.switch span:after { content:"";position:absolute;width:20px;height:20px;left:4px;top:4px;border-radius:50%;background:#fff;box-shadow:0 2px 5px rgba(0,0,0,.15);transition:.2s; }.switch input:checked+span { background:var(--primary); }.switch input:checked+span:after { transform:translateX(20px); }.danger-button { margin-top:18px;height:44px;border:1px solid #efbcc2;background:var(--danger-soft);color:#b94d59;border-radius:11px;padding:0 16px;font-weight:700; }
.toast { position:fixed;left:50%;bottom:-80px;transform:translateX(-50%);background:#25263a;color:#fff;border-radius:12px;padding:12px 18px;box-shadow:0 12px 30px rgba(0,0,0,.2);transition:.3s;z-index:20;font-size:13px; }.toast.show { bottom:24px; }
body.dark { --bg:#171823;--surface:#222331;--surface-soft:#2d2e3f;--text:#f4f4f8;--muted:#aaaabd;--border:#343647;--shadow:0 14px 40px rgba(0,0,0,.18); }.dark .hero { background:linear-gradient(115deg,#262738,#20212e 65%,#2b2c40); }.dark .topbar,.dark .brand { color:var(--text); }.dark .hero-card { background:rgba(40,41,57,.94); }.dark .leaderboard,.dark .setup-card,.dark .settings-card,.dark .question-card,.dark .quiz-summary,.dark .breakdown-card,.dark .personal-card,.dark .result-stats article,.dark .review-card { background:var(--surface); }.dark .summary-ring>div { background:var(--surface); }.dark .score-ring>div { background:var(--surface); }
@media (max-width:900px) { .hero { padding:36px;grid-template-columns:1fr 280px; }.hero h1 { font-size:39px; }.subject-grid { grid-template-columns:1fr 1fr; }.quiz-layout { grid-template-columns:1fr; }.quiz-summary { display:none; } }
@media (max-width:680px) { .topbar { height:66px;padding:0 16px; }.brand-text { font-size:14px; }.top-actions { gap:5px; }.icon-button { width:36px;height:36px; } main { padding:0 14px 40px; }.hero { min-height:430px;grid-template-columns:1fr;padding:30px 24px; }.hero h1 { font-size:36px; }.hero-copy p { font-size:16px; }.hero-art { height:150px;margin-top:-10px; }.orb-one { width:150px;height:150px;right:20px;top:-5px; }.hero-card-main { width:170px;height:105px;right:30px;top:20px;padding:16px; }.hero-card-main strong { font-size:30px; }.hero-card-score { right:170px;bottom:-10px;width:130px;height:72px; }.subject-grid,.stats-grid { grid-template-columns:1fr; }.section-heading { align-items:flex-start; }.question-count { display:none; }.subject-card { min-height:150px; }.subject-options,.mode-options { grid-template-columns:1fr; }.setup-row { grid-template-columns:1fr;gap:0; }.setup-card { padding:18px; }.quiz-layout { display:block; }.question-card { padding:20px 16px; }.question-card h1 { font-size:22px; }.answer-grid { grid-template-columns:1fr; }.question-actions { gap:8px; }.question-actions .primary-button,.question-actions .secondary-button { height:48px;padding:0 12px;font-size:13px; }.result-stats { grid-template-columns:1fr 1fr; }.result-details { grid-template-columns:1fr; }.result-actions { flex-wrap:wrap; }.result-actions .primary-button { order:-1;width:100%; }.leader-row { grid-template-columns:35px 1fr 70px; }.leader-date { display:none; } }
.worksheet-options { display:grid; grid-template-columns:repeat(6,1fr); }
.site-footer { max-width:1180px; margin:0 auto; padding:18px 24px 30px; text-align:center; color:var(--muted); font-size:13px; font-weight:600; }
@media (max-width:680px) {
  .worksheet-options { grid-template-columns:repeat(3,1fr); }
  .worksheet-options label span { height:38px; font-size:12px; }
}