:root {
  --ink: #102a43;
  --ink-soft: #486581;
  --paper: #f5f1e8;
  --paper-light: #fffdf8;
  --line: #d9e2ec;
  --teal: #0f766e;
  --teal-dark: #0b5f59;
  --teal-pale: #e2f2ef;
  --orange: #ef8354;
  --orange-pale: #fff0e8;
  --red: #c3423f;
  --red-pale: #ffebe9;
  --green: #16866f;
  --green-pale: #e3f6ef;
  --navy: #102a43;
  --shadow: 0 20px 55px rgba(16, 42, 67, 0.13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(15, 118, 110, 0.08), transparent 27rem),
    radial-gradient(circle at 90% 28%, rgba(239, 131, 84, 0.09), transparent 28rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, summary:focus-visible { outline: 3px solid rgba(239, 131, 84, 0.55); outline-offset: 3px; }
.hidden { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.page-glow { position: fixed; z-index: -1; border-radius: 999px; pointer-events: none; }
.page-glow-one { top: 110px; left: -190px; width: 370px; height: 370px; border: 1px solid rgba(15, 118, 110, 0.12); }
.page-glow-two { right: -120px; bottom: 80px; width: 300px; height: 300px; border: 1px solid rgba(239, 131, 84, 0.15); }

.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  min-height: 76px; padding: 12px max(24px, calc((100vw - 1160px) / 2));
  border-bottom: 1px solid rgba(16, 42, 67, 0.08); background: rgba(245, 241, 232, 0.88); backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0; border: 0; background: transparent; cursor: pointer; text-align: left; }
.brand-mark {
  display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; color: white; background: var(--navy);
  font-family: Georgia, serif; font-size: 24px; box-shadow: 0 8px 20px rgba(16, 42, 67, 0.18);
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: -0.01em; }
.brand small { margin-top: 1px; color: var(--ink-soft); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.lifetime-stat {
  display: flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid rgba(16, 42, 67, 0.09);
  border-radius: 999px; background: rgba(255, 253, 248, 0.72); color: var(--ink-soft); font-size: 13px;
}
.lifetime-stat b { color: var(--ink); }
.stat-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(22, 134, 111, 0.11); }

.shell { width: min(1160px, calc(100% - 32px)); margin: 0 auto; padding: 52px 0 84px; }
.screen { animation: screen-in 360ms ease both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.hero {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr); align-items: center;
  min-height: 360px; padding: 42px 52px; overflow: hidden; border-radius: 32px; color: white;
  background: linear-gradient(120deg, rgba(255,255,255,0.04), transparent 36%), var(--navy); box-shadow: var(--shadow);
}
.hero::after {
  content: "E = −∇V"; position: absolute; right: 35%; bottom: 22px; color: rgba(255, 255, 255, 0.045);
  font-family: Georgia, serif; font-size: clamp(50px, 8vw, 105px); white-space: nowrap; transform: rotate(-5deg);
}
.eyebrow, .section-kicker { margin: 0 0 12px; color: #83d5cb; font-size: 12px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.hero h1 {
  position: relative; z-index: 1; margin: 0; font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(50px, 7.2vw, 88px); font-weight: 500; letter-spacing: -0.055em; line-height: 0.91;
}
.hero h1 em { color: var(--orange); font-weight: 500; }
.hero-text { position: relative; z-index: 1; max-width: 620px; margin: 24px 0 26px; color: #c9d9e6; font-size: 16px; line-height: 1.65; }
.hero-meta { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; }
.hero-meta span { padding: 8px 11px; border: 1px solid rgba(255,255,255,0.11); border-radius: 999px; color: #adc2d2; font-size: 12px; background: rgba(255,255,255,0.045); }
.hero-meta b { color: white; }
.orbit-visual { position: relative; z-index: 2; width: 280px; height: 280px; justify-self: center; }
.nucleus {
  position: absolute; top: 50%; left: 50%; display: grid; width: 70px; height: 70px; place-items: center; border-radius: 50%;
  color: white; background: var(--orange); box-shadow: 0 0 55px rgba(239, 131, 84, 0.45); font-family: Georgia, serif; font-size: 34px;
  transform: translate(-50%, -50%);
}
.orbit { position: absolute; inset: 35px; border: 1px solid rgba(131, 213, 203, 0.33); border-radius: 50%; }
.orbit-one { transform: rotate(15deg) scaleY(0.44); }
.orbit-two { transform: rotate(75deg) scaleY(0.44); }
.orbit-three { transform: rotate(135deg) scaleY(0.44); }
.orbit i { position: absolute; top: 50%; left: -5px; width: 11px; height: 11px; border-radius: 50%; background: #83d5cb; box-shadow: 0 0 17px rgba(131, 213, 203, 0.9); }

.setup-panel {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 34px 0 16px; padding: 22px 24px;
  border: 1px solid rgba(16, 42, 67, 0.09); border-radius: 20px; background: rgba(255, 253, 248, 0.7);
}
.setup-panel .section-kicker, .topics-section .section-kicker, .result-card .section-kicker { margin-bottom: 5px; color: var(--teal); }
.setup-panel h2, .section-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 25px; font-weight: 600; }
.count-picker { display: flex; gap: 6px; padding: 5px; border-radius: 14px; background: #e8e4dc; }
.count-button {
  min-width: 72px; padding: 10px 16px; border: 0; border-radius: 10px; color: var(--ink-soft); background: transparent;
  cursor: pointer; font-size: 13px; font-weight: 800; transition: 180ms ease;
}
.count-button:hover { color: var(--ink); }
.count-button.active { color: white; background: var(--navy); box-shadow: 0 5px 12px rgba(16,42,67,0.18); }

.mixed-card {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; width: 100%; padding: 22px 26px; border: 0;
  border-radius: 22px; color: white; background: linear-gradient(100deg, var(--teal-dark), var(--teal));
  box-shadow: 0 15px 35px rgba(15, 118, 110, 0.22); cursor: pointer; text-align: left; transition: transform 180ms ease, box-shadow 180ms ease;
}
.mixed-card:hover { transform: translateY(-2px); box-shadow: 0 20px 42px rgba(15, 118, 110, 0.28); }
.mixed-icon {
  display: grid; width: 52px; height: 52px; margin-right: 16px; place-items: center; border: 1px solid rgba(255,255,255,0.18);
  border-radius: 16px; background: rgba(255,255,255,0.1); font-size: 29px;
}
.mixed-copy small, .mixed-copy strong, .mixed-copy span { display: block; }
.mixed-copy small { margin-bottom: 2px; color: #b7e8e1; font-size: 11px; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; }
.mixed-copy strong { font-family: Georgia, serif; font-size: 25px; }
.mixed-copy span { margin-top: 3px; color: #d5efeb; font-size: 13px; }
.mixed-cta { display: flex; align-items: center; gap: 13px; font-size: 13px; font-weight: 800; }
.mixed-cta b { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; color: var(--teal-dark); background: white; font-size: 18px; }

.special-exam-section { margin-top: 27px; }
.special-exam-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 3px 10px; }
.special-exam-heading .section-kicker { margin: 0; color: #a64f23; }
.special-exam-heading > span { color: var(--ink-soft); font-size: 11px; }
.special-exam-card {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; width: 100%;
  padding: 22px 25px; overflow: hidden; border: 1px solid rgba(166, 79, 35, 0.2); border-radius: 22px; color: var(--ink);
  background: linear-gradient(115deg, rgba(255,253,248,0.98), rgba(255,232,211,0.92));
  box-shadow: 0 14px 34px rgba(125, 71, 37, 0.12); cursor: pointer; text-align: left; transition: 180ms ease;
}
.special-exam-card::after {
  content: "FINAL"; position: absolute; right: 116px; top: 50%; color: rgba(166,79,35,0.055);
  font-family: Georgia, serif; font-size: 62px; font-weight: 800; letter-spacing: 0.08em; transform: translateY(-50%) rotate(-4deg);
}
.special-exam-card:hover { border-color: rgba(166,79,35,0.42); background: linear-gradient(115deg, #fffdfa, #ffe7d0); box-shadow: 0 19px 42px rgba(125,71,37,0.18); transform: translateY(-2px); }
.special-exam-year {
  position: relative; z-index: 1; display: grid; width: 52px; height: 52px; margin-right: 16px; place-items: center;
  border-radius: 16px; color: white; background: #a64f23; box-shadow: 0 8px 18px rgba(166,79,35,0.22); font-family: Georgia, serif; font-size: 27px; font-weight: 800;
}
.special-exam-copy { position: relative; z-index: 1; }
.special-exam-copy small, .special-exam-copy strong, .special-exam-copy span { display: block; }
.special-exam-copy small { margin-bottom: 2px; color: #a64f23; font-size: 10px; font-weight: 850; letter-spacing: 0.11em; text-transform: uppercase; }
.special-exam-copy strong { font-family: Georgia, serif; font-size: 25px; }
.special-exam-copy span { margin-top: 4px; color: #6f625b; font-size: 12px; }
.special-exam-copy span b { color: #a64f23; }
.special-exam-cta { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; color: #8d421f; font-size: 12px; font-weight: 850; white-space: nowrap; }
.special-exam-cta b { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; color: white; background: #a64f23; font-size: 18px; }

.topic-mixer {
  margin-top: 26px; padding: 25px; border: 1px solid rgba(16, 42, 67, 0.11); border-radius: 23px;
  background: linear-gradient(145deg, rgba(255, 253, 248, 0.94), rgba(224, 244, 241, 0.48));
  box-shadow: 0 12px 30px rgba(16, 42, 67, 0.06);
}
.topic-mixer-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; }
.topic-mixer-heading .section-kicker { margin-bottom: 5px; color: var(--teal); }
.topic-mixer-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 27px; }
.topic-mixer-heading p:not(.section-kicker) { max-width: 620px; margin: 7px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.5; }
.topic-mixer-tools { display: flex; flex: 0 0 auto; gap: 7px; }
.topic-mixer-tools button {
  padding: 9px 11px; border: 1px solid rgba(15, 118, 110, 0.2); border-radius: 10px; color: var(--teal-dark);
  background: rgba(255,255,255,0.7); cursor: pointer; font-size: 11px; font-weight: 800; transition: 160ms ease;
}
.topic-mixer-tools button:hover:not(:disabled) { border-color: var(--teal); background: white; }
.topic-mixer-tools button:disabled { opacity: 0.42; cursor: not-allowed; }
.topic-mixer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 20px; }
.topic-mixer-option {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; min-height: 70px; padding: 12px 14px;
  border: 1px solid rgba(16,42,67,0.1); border-radius: 14px; color: var(--ink); background: rgba(255,255,255,0.68);
  cursor: pointer; text-align: left; transition: 160ms ease;
}
.topic-mixer-option:hover { border-color: rgba(15,118,110,0.34); background: white; transform: translateY(-1px); }
.topic-mixer-check {
  display: grid; width: 34px; height: 34px; margin-right: 11px; place-items: center; border: 1px solid rgba(16,42,67,0.12);
  border-radius: 10px; color: transparent; background: #f2f3f1; font-size: 15px; font-weight: 900; transition: 160ms ease;
}
.topic-mixer-option small, .topic-mixer-option strong { display: block; }
.topic-mixer-option small { margin-bottom: 3px; color: var(--ink-soft); font-size: 9px; font-weight: 750; }
.topic-mixer-option strong { font-size: 12px; line-height: 1.32; }
.topic-mixer-option.is-selected { border-color: var(--teal); background: var(--teal-pale); box-shadow: inset 0 0 0 1px rgba(15,118,110,0.08); }
.topic-mixer-option.is-selected .topic-mixer-check { border-color: var(--teal); color: white; background: var(--teal); }
.topic-mixer-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; padding-top: 17px; border-top: 1px solid rgba(16,42,67,0.09); }
.topic-mixer-footer > span { color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.topic-mixer-footer > button {
  padding: 12px 16px; border: 0; border-radius: 12px; color: white; background: var(--navy); cursor: pointer;
  font-size: 12px; font-weight: 850; box-shadow: 0 8px 18px rgba(16,42,67,0.16); transition: 160ms ease;
}
.topic-mixer-footer > button:hover:not(:disabled) { background: #173d5d; transform: translateY(-1px); }
.topic-mixer-footer > button:disabled { color: #8a969f; background: #e1e5e6; box-shadow: none; cursor: not-allowed; }
.topic-mixer-footer b { margin-left: 8px; }

.wrong-pool-section {
  margin-top: 26px; padding: 25px; border: 1px solid rgba(195, 66, 63, 0.16); border-radius: 23px;
  background: linear-gradient(145deg, rgba(255, 253, 248, 0.92), rgba(255, 235, 233, 0.52));
  box-shadow: 0 12px 30px rgba(16, 42, 67, 0.06);
}
.wrong-pool-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.wrong-pool-heading .section-kicker { margin-bottom: 5px; color: var(--red); }
.wrong-pool-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 27px; }
.wrong-pool-heading p:not(.section-kicker) { margin: 7px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.5; }
.wrong-pool-count {
  flex: 0 0 auto; min-width: 78px; padding: 10px 13px; border: 1px solid rgba(195,66,63,0.18); border-radius: 999px;
  color: #9f3c39; background: rgba(255,255,255,0.72); font-size: 12px; font-weight: 800; text-align: center;
}
.wrong-pool-count b { margin-right: 3px; font-family: Georgia, serif; font-size: 20px; }
.wrong-pool-content { margin-top: 20px; }
.wrong-mixed-button {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; width: 100%; padding: 17px 19px;
  border: 1px solid rgba(195,66,63,0.19); border-radius: 17px; color: var(--ink); background: rgba(255,255,255,0.8);
  cursor: pointer; text-align: left; transition: 170ms ease;
}
.wrong-mixed-button:hover { border-color: rgba(195,66,63,0.42); background: white; transform: translateY(-1px); box-shadow: 0 10px 24px rgba(16,42,67,0.07); }
.wrong-mixed-icon { display: grid; width: 43px; height: 43px; margin-right: 13px; place-items: center; border-radius: 13px; color: white; background: var(--red); font-size: 22px; }
.wrong-mixed-button small, .wrong-mixed-button strong, .wrong-mixed-button em { display: block; }
.wrong-mixed-button small { color: var(--red); font-size: 10px; font-weight: 850; letter-spacing: 0.09em; text-transform: uppercase; }
.wrong-mixed-button strong { margin-top: 2px; font-family: Georgia, serif; font-size: 21px; }
.wrong-mixed-button em { margin-top: 3px; color: var(--ink-soft); font-size: 11px; font-style: normal; }
.wrong-mixed-button > b { color: var(--red); font-size: 12px; white-space: nowrap; }
.wrong-pool-cleanup {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 11px; padding: 12px 14px;
  border: 1px dashed rgba(15,118,110,0.23); border-radius: 14px; background: rgba(235,248,246,0.58);
}
.wrong-pool-cleanup span, .wrong-pool-cleanup strong, .wrong-pool-cleanup small { display: block; }
.wrong-pool-cleanup strong { color: var(--teal-dark); font-size: 11px; }
.wrong-pool-cleanup small { margin-top: 3px; color: var(--ink-soft); font-size: 10px; line-height: 1.4; }
.wrong-pool-cleanup button {
  flex: 0 0 auto; padding: 9px 12px; border: 1px solid rgba(15,118,110,0.25); border-radius: 10px;
  color: var(--teal-dark); background: white; cursor: pointer; font-size: 10px; font-weight: 850; white-space: nowrap; transition: 160ms ease;
}
.wrong-pool-cleanup button:hover:not(:disabled) { border-color: rgba(15,118,110,0.5); background: var(--teal-pale); transform: translateY(-1px); }
.wrong-pool-cleanup button:disabled { opacity: 0.45; cursor: not-allowed; }
.wrong-topic-heading { display: flex; justify-content: space-between; gap: 12px; margin: 22px 2px 11px; }
.wrong-topic-heading strong { font-size: 13px; }
.wrong-topic-heading span { color: var(--ink-soft); font-size: 11px; }
.wrong-topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.wrong-topic-button {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; min-height: 76px; padding: 12px 13px;
  border: 1px solid rgba(16,42,67,0.09); border-radius: 14px; color: var(--ink); background: rgba(255,255,255,0.66);
  cursor: pointer; text-align: left; transition: 160ms ease;
}
.wrong-topic-button:hover { border-color: rgba(195,66,63,0.3); background: white; transform: translateX(2px); }
.wrong-topic-count { display: grid; width: 36px; height: 36px; margin-right: 10px; place-items: center; border-radius: 11px; color: var(--red); background: var(--red-pale); font-family: Georgia, serif; font-size: 17px; font-weight: 800; }
.wrong-topic-button small, .wrong-topic-button strong { display: block; }
.wrong-topic-button small { margin-bottom: 3px; color: var(--ink-soft); font-size: 9px; }
.wrong-topic-button strong { font-size: 12px; line-height: 1.3; }
.wrong-topic-button > b { margin-left: 8px; color: var(--red); }
.wrong-pool-empty { display: flex; align-items: center; gap: 13px; margin-top: 17px; padding: 16px; border-radius: 15px; color: var(--ink-soft); background: rgba(255,255,255,0.56); }
.wrong-pool-empty > span { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: var(--green); background: var(--green-pale); font-size: 22px; }
.wrong-pool-empty strong, .wrong-pool-empty p { display: block; margin: 0; }
.wrong-pool-empty strong { color: var(--ink); font-size: 13px; }
.wrong-pool-empty p { margin-top: 3px; font-size: 11px; line-height: 1.45; }

.topics-section { margin-top: 46px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-heading > span { color: var(--ink-soft); font-size: 12px; }
.topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.topic-card {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; min-height: 108px; padding: 18px 19px;
  overflow: hidden; border: 1px solid rgba(16, 42, 67, 0.09); border-radius: 19px; color: var(--ink);
  background: rgba(255, 253, 248, 0.83); cursor: pointer; text-align: left; transition: 180ms ease;
}
.topic-card::after { content: ""; position: absolute; right: -24px; bottom: -38px; width: 90px; height: 90px; border: 1px solid rgba(15, 118, 110, 0.1); border-radius: 50%; }
.topic-card:hover { z-index: 1; border-color: rgba(15, 118, 110, 0.3); background: white; box-shadow: 0 14px 30px rgba(16, 42, 67, 0.09); transform: translateY(-2px); }
.topic-rank {
  display: grid; width: 44px; height: 44px; margin-right: 14px; place-items: center; border-radius: 14px;
  color: var(--teal-dark); background: var(--teal-pale); font-family: Georgia, serif; font-size: 18px; font-weight: 700;
}
.topic-card:nth-child(2n) .topic-rank { color: #aa4b23; background: var(--orange-pale); }
.topic-copy small, .topic-copy strong { display: block; }
.topic-copy small { margin-bottom: 5px; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.topic-copy strong { max-width: 390px; font-size: 15px; line-height: 1.35; }
.topic-arrow { position: relative; z-index: 1; color: var(--teal); font-size: 19px; }

.progress-card {
  display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-top: 42px; padding: 23px 26px;
  border: 1px dashed rgba(16, 42, 67, 0.18); border-radius: 19px;
}
.progress-copy { display: flex; align-items: center; gap: 13px; }
.progress-icon { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 50%; color: var(--green); background: var(--green-pale); font-weight: 900; }
.progress-copy small, .progress-copy strong { display: block; }
.progress-copy small { margin-bottom: 3px; color: var(--ink-soft); font-size: 11px; }
.progress-copy strong { font-size: 14px; }
.progress-numbers { display: flex; gap: 32px; }
.progress-numbers div { text-align: center; }
.progress-numbers b, .progress-numbers span { display: block; }
.progress-numbers b { font-family: Georgia, serif; font-size: 22px; }
.progress-numbers span { margin-top: 2px; color: var(--ink-soft); font-size: 10px; text-transform: uppercase; }
.progress-actions { display: flex; align-items: center; gap: 24px; }
.reset-stats-button {
  padding: 9px 12px; border: 1px solid rgba(195, 66, 63, 0.2); border-radius: 11px; color: #9f3c39;
  background: rgba(255, 235, 233, 0.58); cursor: pointer; font-size: 11px; font-weight: 800; white-space: nowrap; transition: 160ms ease;
}
.reset-stats-button:hover:not(:disabled) { border-color: rgba(195, 66, 63, 0.42); background: var(--red-pale); transform: translateY(-1px); }
.reset-stats-button:disabled { opacity: 0.42; cursor: not-allowed; }

.quiz-screen { width: min(920px, 100%); margin: 0 auto; }
.quiz-toolbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; margin-bottom: 14px; }
.ghost-button, .exam-frame-head button { width: max-content; padding: 0; border: 0; color: var(--ink-soft); background: transparent; cursor: pointer; font-size: 13px; font-weight: 700; }
.ghost-button:hover, .exam-frame-head button:hover { color: var(--teal); }
.quiz-labels { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: 12px; }
.topic-pill { max-width: 400px; padding: 7px 11px; overflow: hidden; border-radius: 999px; color: var(--teal-dark); background: var(--teal-pale); font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.quiz-score { justify-self: end; display: flex; align-items: baseline; gap: 7px; color: var(--ink-soft); font-size: 11px; text-transform: uppercase; }
.quiz-score b { color: var(--ink); font-family: Georgia, serif; font-size: 24px; }
.progress-track { height: 6px; margin-bottom: 22px; overflow: hidden; border-radius: 99px; background: #dedbd4; }
.progress-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), #45aaa0); transition: width 300ms ease; }

.question-card { padding: 28px; border: 1px solid rgba(16, 42, 67, 0.08); border-radius: 26px; background: rgba(255, 253, 248, 0.92); box-shadow: var(--shadow); }
.question-meta, .question-meta > div { display: flex; align-items: center; }
.question-meta { justify-content: space-between; gap: 15px; margin-bottom: 17px; }
.question-meta > div { min-width: 0; gap: 10px; }
.question-number { flex: 0 0 auto; padding: 5px 8px; border-radius: 7px; color: white; background: var(--navy); font-size: 11px; font-weight: 800; }
.question-source { overflow: hidden; color: var(--ink-soft); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.streak-badge { flex: 0 0 auto; padding: 6px 9px; border-radius: 999px; color: #9b421d; background: var(--orange-pale); font-size: 11px; font-weight: 800; }
.exam-frame { overflow: hidden; border: 1px solid #d7dce1; border-radius: 16px; background: #eef1f3; }
.exam-frame-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 13px; border-bottom: 1px solid #d7dce1; color: var(--ink-soft); background: #e5eaed; font-size: 10px; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; }
.exam-frame-head button { font-size: 10px; text-transform: none; }
.exam-image-button { display: block; width: 100%; padding: 14px; border: 0; background: transparent; cursor: zoom-in; }
.exam-image-button img { display: block; width: 100%; max-height: 560px; object-fit: contain; border-radius: 7px; background: white; }
.target-hint { margin: 0; padding: 12px 14px; border-bottom: 1px solid #eadac8; color: #704127; background: #fff7ee; text-align: left; }
.target-hint > span { display: block; margin-bottom: 4px; color: #a45831; font-size: 9px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.target-hint > strong { display: block; font-size: 13px; font-weight: 800; line-height: 1.5; }
.clean-question { margin: 24px 2px 18px; }
.clean-question > span { display: block; margin-bottom: 7px; color: var(--teal); font-size: 10px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; }
.clean-question h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(20px, 3vw, 28px); font-weight: 600; line-height: 1.32; }
.choice-hint { margin: -3px 0 13px; padding: 10px 12px; border-left: 3px solid var(--orange); color: var(--ink-soft); background: var(--orange-pale); font-size: 12px; line-height: 1.5; }

.options-list { display: grid; gap: 14px; }
.option-button {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; width: 100%; min-height: 74px; padding: 14px 18px 14px 12px;
  border: 1px solid #d8dee4; border-radius: 14px; color: var(--ink); background: white; cursor: pointer; text-align: left; transition: 150ms ease;
}
.option-button:hover:not(:disabled) { border-color: var(--teal); background: #f7fcfb; transform: translateX(3px); }
.option-letter { display: grid; width: 37px; height: 37px; margin-right: 12px; place-items: center; border-radius: 10px; color: var(--ink-soft); background: #eef2f5; font-size: 13px; font-weight: 900; }
.option-text { min-width: 0; font-size: 16px; font-weight: 650; line-height: 1.75; overflow-wrap: anywhere; }
.option-status { width: 24px; color: transparent; font-size: 19px; font-weight: 900; text-align: right; }
.option-button:disabled { cursor: default; }
.option-button.is-correct { border-color: var(--green); background: var(--green-pale); }
.option-button.is-correct .option-letter { color: white; background: var(--green); }
.option-button.is-correct .option-status { color: var(--green); }
.option-button.is-wrong { border-color: var(--red); background: var(--red-pale); }
.option-button.is-wrong .option-letter { color: white; background: var(--red); }
.option-button.is-wrong .option-status { color: var(--red); }
.option-button.is-muted { opacity: 0.56; }

.feedback-panel { margin-top: 18px; padding: 19px; border-radius: 17px; animation: feedback-in 220ms ease both; }
@keyframes feedback-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.feedback-panel.correct { border: 1px solid rgba(22,134,111,0.24); background: var(--green-pale); }
.feedback-panel.wrong { border: 1px solid rgba(195,66,63,0.22); background: var(--red-pale); }
.feedback-heading { display: flex; align-items: center; gap: 12px; }
.feedback-icon { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: white; font-size: 20px; font-weight: 900; }
.correct .feedback-icon { background: var(--green); }
.wrong .feedback-icon { background: var(--red); }
.feedback-heading small, .feedback-heading h3 { display: block; margin: 0; }
.feedback-heading small { margin-bottom: 2px; color: var(--ink-soft); font-size: 10px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.feedback-heading h3 { font-family: Georgia, serif; font-size: 21px; }
.correct-answer-box { margin-top: 15px; padding: 13px 14px; border-radius: 11px; background: rgba(255,255,255,0.72); }
.correct-answer-box span, .correct-answer-box strong { display: block; }
.correct-answer-box span { margin-bottom: 4px; color: var(--red); font-size: 10px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.correct-answer-box strong { font-size: 15px; line-height: 1.75; }
.solution-details { margin-top: 14px; border-top: 1px solid rgba(16,42,67,0.1); padding-top: 13px; }
.solution-details summary { width: max-content; color: var(--ink-soft); cursor: pointer; font-size: 12px; font-weight: 800; }
.solution-details p { margin: 12px 0 0; color: var(--ink); font-size: 14px; line-height: 1.78; }
.solution-note { padding: 10px 12px; border-left: 3px solid var(--orange); background: rgba(255,255,255,0.55); }

.math-frac {
  display: inline-grid;
  grid-template-rows: auto auto;
  min-width: 1.4em;
  margin: 0 0.18em;
  vertical-align: -0.72em;
  color: inherit;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 650;
  line-height: 1.05;
  text-align: center;
  white-space: nowrap;
}
.math-frac-num { padding: 0 0.24em 0.12em; border-bottom: 1.5px solid currentColor; }
.math-frac-den { padding: 0.12em 0.24em 0; }
.math-sup-frac {
  display: inline-grid;
  grid-template-rows: auto auto;
  min-width: 0.8em;
  margin-left: 0.08em;
  vertical-align: 0.68em;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.66em;
  font-weight: 700;
  line-height: 0.9;
  text-align: center;
  white-space: nowrap;
}
.math-sup-frac-num { padding: 0 0.12em 0.08em; border-bottom: 1px solid currentColor; }
.math-sup-frac-den { padding: 0.08em 0.12em 0; }
.math-root {
  display: inline-flex;
  align-items: flex-start;
  margin: 0 0.08em;
  vertical-align: -0.16em;
  color: inherit;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 650;
  line-height: 1.05;
  white-space: nowrap;
}
.math-root-sign {
  margin-right: -0.08em;
  font-size: 1.26em;
  font-weight: 400;
  line-height: 1.05;
}
.math-root-body {
  min-height: 1.05em;
  padding: 0.08em 0.13em 0;
  border-top: 1.5px solid currentColor;
  line-height: 1.05;
}
.option-text sup, .option-text sub, .correct-answer-box sup, .correct-answer-box sub,
.solution-details sup, .solution-details sub, .clean-question sup, .clean-question sub { line-height: 0; }

.next-button, .primary-button, .secondary-button { border: 0; border-radius: 13px; cursor: pointer; font-weight: 850; }
.next-button { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; margin-top: 14px; padding: 15px 20px; color: white; background: var(--navy); box-shadow: 0 10px 22px rgba(16,42,67,0.18); }
.next-button:hover, .primary-button:hover { background: #173d5d; }
.keyboard-tip { margin: 14px 0 0; color: var(--ink-soft); font-size: 10px; text-align: center; }

.result-screen { width: min(700px, 100%); margin: 20px auto 0; }
.result-card { padding: 52px; border: 1px solid rgba(16,42,67,0.08); border-radius: 28px; background: var(--paper-light); box-shadow: var(--shadow); text-align: center; }
.result-ring { display: grid; width: 154px; height: 154px; margin: 0 auto 26px; place-content: center; border-radius: 50%; background: conic-gradient(var(--teal) var(--score-angle, 0deg), #e4e7e7 0); box-shadow: inset 0 0 0 15px var(--paper-light); }
.result-ring strong, .result-ring span { display: block; }
.result-ring strong { font-family: Georgia, serif; font-size: 39px; }
.result-ring span { margin-top: 1px; color: var(--ink-soft); font-size: 10px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.result-card h1 { margin: 0; font-family: Georgia, serif; font-size: 42px; }
.result-card > p:not(.section-kicker) { max-width: 500px; margin: 12px auto 28px; color: var(--ink-soft); line-height: 1.6; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 28px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; }
.result-stats div { padding: 17px 10px; }
.result-stats div + div { border-left: 1px solid var(--line); }
.result-stats b, .result-stats span { display: block; }
.result-stats b { font-family: Georgia, serif; font-size: 28px; }
.result-stats .right b { color: var(--green); }
.result-stats .wrong b { color: var(--red); }
.result-stats span { margin-top: 2px; color: var(--ink-soft); font-size: 10px; text-transform: uppercase; }
.result-actions { display: grid; gap: 9px; }
.primary-button, .secondary-button { padding: 14px 18px; }
.primary-button { color: white; background: var(--navy); }
.secondary-button { color: var(--teal-dark); background: var(--teal-pale); }
.secondary-button:hover { background: #d3ebe7; }
.text-button { padding: 10px; border: 0; color: var(--ink-soft); background: transparent; cursor: pointer; font-size: 12px; font-weight: 750; }
.text-button:hover { color: var(--teal); }

.image-dialog { width: min(1100px, calc(100% - 30px)); max-height: calc(100vh - 30px); padding: 46px 18px 18px; overflow: auto; border: 0; border-radius: 18px; background: #eef1f3; box-shadow: 0 28px 80px rgba(0,0,0,0.35); }
.image-dialog::backdrop { background: rgba(7, 22, 35, 0.76); backdrop-filter: blur(5px); }
.image-dialog button { position: absolute; top: 9px; right: 12px; display: grid; width: 32px; height: 32px; place-items: center; border: 0; border-radius: 50%; color: white; background: var(--navy); cursor: pointer; font-size: 22px; }
.image-dialog img { display: block; width: 100%; height: auto; border-radius: 8px; background: white; }

.loading-screen { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; gap: 15px; color: var(--ink-soft); background: var(--paper); text-align: center; }
.loader { width: 42px; height: 42px; margin: 0 auto; border: 3px solid #d7dfdf; border-top-color: var(--teal); border-radius: 50%; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 780px) {
  .shell { padding-top: 28px; }
  .hero { grid-template-columns: 1fr; padding: 37px 30px; }
  .orbit-visual { position: absolute; right: -70px; bottom: -88px; opacity: 0.28; }
  .hero h1 { font-size: clamp(48px, 14vw, 70px); }
  .hero-text { max-width: 85%; }
  .setup-panel { align-items: flex-start; flex-direction: column; }
  .count-picker { width: 100%; }
  .count-button { flex: 1; min-width: 0; }
  .topic-grid { grid-template-columns: 1fr; }
  .topic-mixer-grid { grid-template-columns: 1fr; }
  .wrong-topic-grid { grid-template-columns: 1fr; }
  .progress-card { align-items: flex-start; flex-direction: column; }
  .progress-actions { width: 100%; align-items: stretch; flex-direction: column; gap: 14px; }
  .progress-numbers { width: 100%; justify-content: space-around; }
  .reset-stats-button { align-self: flex-end; }
  .quiz-toolbar { grid-template-columns: 1fr auto; }
  .quiz-labels { grid-column: 1 / -1; grid-row: 2; justify-content: center; }
  .question-card { padding: 18px; border-radius: 20px; }
  .result-card { padding: 38px 22px; }
}

@media (max-width: 520px) {
  .topbar { min-height: 66px; padding: 10px 16px; }
  .brand-mark { width: 38px; height: 38px; }
  .lifetime-stat { padding: 8px 10px; }
  .shell { width: min(100% - 20px, 1160px); }
  .hero { min-height: 390px; padding: 30px 22px; border-radius: 23px; }
  .hero-text { max-width: 100%; font-size: 14px; }
  .hero-meta span { font-size: 10px; }
  .setup-panel { margin-top: 20px; padding: 18px; }
  .mixed-card { padding: 18px; }
  .mixed-icon { width: 44px; height: 44px; }
  .mixed-copy strong { font-size: 20px; }
  .mixed-cta { font-size: 0; }
  .special-exam-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .special-exam-card { padding: 18px; }
  .special-exam-year { width: 44px; height: 44px; }
  .special-exam-copy strong { font-size: 20px; }
  .special-exam-cta { font-size: 0; }
  .special-exam-card::after { display: none; }
  .topic-mixer { padding: 19px; }
  .topic-mixer-heading { flex-direction: column; }
  .topic-mixer-tools { width: 100%; }
  .topic-mixer-tools button { flex: 1; }
  .topic-mixer-footer { align-items: stretch; flex-direction: column; }
  .topic-mixer-footer > button { width: 100%; }
  .wrong-pool-section { padding: 19px; }
  .wrong-pool-heading { align-items: flex-start; }
  .wrong-mixed-button { padding: 14px; }
  .wrong-pool-cleanup { align-items: stretch; flex-direction: column; gap: 10px; }
  .wrong-pool-cleanup button { width: 100%; white-space: normal; }
  .wrong-mixed-button > b { font-size: 0; }
  .wrong-mixed-button > b::after { content: "→"; font-size: 18px; }
  .topic-card { min-height: 96px; padding: 15px; }
  .topic-copy strong { font-size: 14px; }
  .question-meta { align-items: flex-start; }
  .question-meta > div { align-items: flex-start; flex-direction: column; }
  .question-source { max-width: 230px; white-space: normal; }
  .exam-image-button { padding: 8px; }
  .option-button { padding-right: 10px; }
  .option-text { font-size: 13px; }
  .feedback-panel { padding: 15px; }
  .result-stats b { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
