:root {
  --bg: #0b0e14;
  --panel: #11151f;
  --text: #e6e6e6;
  --muted: #a3acc5;
  --accent: #6cb6ff;
  --btn: #1a2130;
  --btn-hover: #23304a;
  --border: #2a3244;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica Neue, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.howItWorksLink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--btn);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  line-height: 1;
}

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

.howItWorksIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}

.brandText {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.logo {
  height: 28px;
  width: auto;
  display: block;
}

.header h1 {
  margin: 0;
  font-size: 20px;
}

.tagline {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.1;
}

.controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}

select,
button {
  background: var(--btn);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
}

button:hover {
  background: var(--btn-hover);
  cursor: pointer;
}

.main {
  padding: 24px;
}

.layout {
  width: 100%;
  max-width: 100%;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  align-items: start;
}

.sidebar {
  width: 220px;
  flex: 0 0 220px;
}

.sidebarCard {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  position: sticky;
  top: 16px;
}

.sidebarTitle {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--text);
  margin-bottom: 10px;
}

.scoreboardRows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scoreboardRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 13px;
}

.scoreboardLabel {
  color: var(--muted);
  font-weight: 650;
}

.scoreboardValue {
  color: var(--text);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.card {
  width: 100%;
  max-width: 900px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  justify-self: center;
}

.counter {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.paperLink {
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.3;
}

.paperLink a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 650;
}

.paperLink a:hover {
  text-decoration: underline;
}

.mcq-source {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.mcq-source a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 650;
}

.mcq-source a:hover {
  text-decoration: underline;
}

.totalAnswered {
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

.totalAnsweredTopbar {
  margin-bottom: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.totalAnswered,
.totalAnsweredTopbar {
  display: none;
}

.question {
  font-size: 18px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.topicFinished {
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0f1422;
}

.topicFinishedTitle {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 8px;
}

.topicFinishedBody {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.topicFinished a {
  color: var(--accent);
  text-decoration: none;
}

.topicFinished a:hover {
  text-decoration: underline;
}

.answer {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
  line-height: 1.6;
  white-space: pre-wrap;
}

.answer a {
  color: var(--accent);
}

.backToNavBar {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 10px;
}

.backToNavBtn {
  background: var(--btn);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1;
}

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

.beginnerNavTitle {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 6px;
}

.beginnerNavSubtitle {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 12px;
}

.beginnerNavToggleRow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.beginnerNavToggleLabel {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.beginnerNavToggleBtn {
  background: var(--btn);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1;
}

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

.beginnerNavList {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.beginnerNavItemBtn {
  text-align: left;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  font-weight: 650;
}

.beginnerNavItemRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.beginnerNavItemLabel {
  flex: 1 1 auto;
}

.beginnerNavCheck {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 900;
  font-size: 14px;
  line-height: 1;
}

.beginnerNavCheck.seen {
  color: rgba(66, 209, 137, 1);
  border-color: rgba(66, 209, 137, 0.45);
  background: rgba(66, 209, 137, 0.12);
}

.beginnerNavItemBtn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.codeBlock {
  margin: 10px 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  overflow-x: auto;
}

.codeBlock code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre;
  color: var(--text);
}

.hidden {
  display: none;
}

.controls #customTopicInput {
  width: 340px;
  background: var(--btn);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
}

.infoBox {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0f1422;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.status {
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0f1422;
  color: var(--muted);
  font-size: 13px;
}

@keyframes pulseStatus {
  0% {
    opacity: 0.65;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.65;
  }
}

.status.thinking {
  animation: pulseStatus 1.6s ease-in-out infinite;
}

@media (max-width: 920px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    width: 100%;
    flex: 0 0 auto;
  }
  .sidebarCard {
    position: static;
  }
}

/* ---------------------- */
/* MCQ (Multiple Choice)  */
/* ---------------------- */

.mcq-container {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mcq-background {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.mcq-question-block {
  padding: 14px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.mcq-question-text {
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.mcq-options-header {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.mcq-options-header-label {
  color: var(--text);
  font-weight: 600;
}


.mcq-options {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mcq-btn {
  min-width: 46px;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.mcq-btn:focus-visible {
  outline: 2px solid rgba(108, 182, 255, 0.7);
  outline-offset: 2px;
}

.mcq-btn.selected {
  border-color: rgba(108, 182, 255, 0.9);
  background: rgba(108, 182, 255, 0.12);
}

.mcq-btn.correct {
  border-color: rgba(66, 209, 137, 0.9);
  background: rgba(66, 209, 137, 0.14);
}

.mcq-btn.incorrect {
  border-color: rgba(255, 90, 90, 0.9);
  background: rgba(255, 90, 90, 0.12);
}

.mcq-btn:disabled {
  cursor: not-allowed;
  opacity: 0.9;
}

.mcq-submit-btn {
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  border-color: rgba(108, 182, 255, 0.5);
}

.mcq-score {
  margin-top: 6px;
  color: var(--accent);
  font-weight: 700;
}

.mcq-explanation {
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0f1422;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
  white-space: pre-wrap;
}

.mcq-explanation-item {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0f1422;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
  white-space: pre-wrap;
}