:root {
  color-scheme: dark;
  --background: #0d0e10;
  --text: #f0f1f3;
  --muted: #878b93;
  --faint: #50545b;
  --line: #292c31;
  --line-hover: #454950;
  --panel: #121316;
  --code: #101114;
  --accent: #b7e46c;
  --correct: #7ed6a5;
  --incorrect: #e48888;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--background);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button {
  color: inherit;
  font: inherit;
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.page {
  display: flex;
  flex-direction: column;
  width: min(100% - 40px, 620px);
  min-height: 100vh;
  margin: 0 auto;
}

.question {
  padding: clamp(48px, 11vh, 96px) 0 56px;
}

h1 {
  max-width: 590px;
  margin: 0 0 34px;
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 570;
  letter-spacing: -0.035em;
  line-height: 1.35;
}

.code-block {
  margin: 0 0 32px;
  overflow-x: auto;
  border: 0;
  background: var(--code);
  scrollbar-color: var(--line-hover) transparent;
}

.code-block code {
  display: block;
  min-width: max-content;
  padding: 20px 22px;
  color: #c8cbd1;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  tab-size: 4;
  white-space: pre;
}

.syntax-keyword { color: #c49bdc; }
.syntax-type { color: #85c7c2; }
.syntax-string { color: #b8cf85; }
.syntax-number { color: #dda775; }
.syntax-comment { color: #5f646d; }
.syntax-preprocessor { color: #d7a870; }

.inline-code {
  color: #c8cbd1;
  font-family: var(--mono);
  font-size: 0.9em;
  font-weight: 400;
  letter-spacing: -0.015em;
}

.options {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.option {
  display: grid;
  grid-template-columns: 24px 1fr 18px;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 50px;
  padding: 9px 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: #c9cbd0;
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  transition: border-color 100ms ease, background 100ms ease;
}

.option:hover {
  background: var(--panel);
  color: var(--text);
}

.option-number {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
}

.option-text {
  min-width: 0;
}

.option-icon,
.option-icon svg {
  width: 16px;
  height: 16px;
}

.option-icon svg,
.result-label svg,
.next-button svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.option.correct {
  background: transparent;
  color: var(--correct);
}

.option.incorrect {
  background: transparent;
  color: var(--incorrect);
}

.option.muted {
  color: #696d74;
  opacity: 0.62;
}

.option.muted:hover,
.option.inspected {
  opacity: 1;
}

.explanation {
  margin-top: 34px;
}

.result-label {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-bottom: 11px;
  color: var(--correct);
  font-family: var(--mono);
  font-size: 11px;
}

.review-state {
  margin-left: 2px;
  color: var(--faint);
  font-size: 9px;
}

.is-incorrect .result-label {
  color: var(--incorrect);
}

.result-label svg {
  width: 14px;
}

.explanation p {
  max-width: 590px;
  margin: 0 0 12px;
  color: #a9adb5;
  font-size: 13px;
  line-height: 1.7;
}

.explanation .takeaway {
  color: var(--muted);
}

.explanation .correct-answer {
  color: #c9cbd0;
  font-family: var(--mono);
  font-size: 11px;
}

.next-button {
  display: flex;
  gap: 6px;
  align-items: center;
  width: max-content;
  margin-top: 10px;
  margin-left: auto;
  padding: 9px 0;
  border: 0;
  background: transparent;
  color: #d9dadd;
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
}

.next-button:hover {
  color: var(--text);
}

.next-button svg {
  width: 15px;
}

.bank-size {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: auto;
  padding: 0 0 22px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
}

.bank-separator {
  color: var(--line-hover);
}

.bank-action {
  padding: 3px 0;
  border: 0;
  border-bottom: 1px solid var(--line-hover);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

.bank-action:hover {
  border-color: var(--muted);
  color: var(--text);
}

.redemption-action {
  color: var(--incorrect);
}

.load-error p {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 560px) {
  .page {
    width: min(100% - 28px, 620px);
  }

  .question {
    padding-top: 42px;
  }

  h1 {
    margin-bottom: 28px;
  }

  .code-block {
    margin-right: -7px;
    margin-left: -7px;
  }

  .code-block code {
    padding: 16px;
    font-size: 11px;
  }

  .option {
    grid-template-columns: 20px 1fr 16px;
    gap: 9px;
    padding: 10px 7px;
  }
}

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