/* Quiz page: loaded after style.css and chat.css (reuses their color tokens). */
:root { --ok: #188038; --ok-bg: #e6f4ea; --no: #c5221f; --no-bg: #fce8e6; --tonal: #e5ecf3; --tonal-text: #1c3d5c; }
@media (prefers-color-scheme: dark) {
  :root { --ok: #81c995; --ok-bg: #1e3a2a; --no: #f28b82; --no-bg: #3c1f1e; --tonal: #2a4057; --tonal-text: #d6e4f2; }
}
body.quiz-page .shell { height: auto; min-height: 100%; }
.quiz-page .top { gap: 16px; }
.center { text-align: center; }
.quiz-title { text-align: center; font-size: 26px; font-weight: 500; margin: 24px 0 6px; }
#quiz { display: flex; flex-direction: column; gap: 16px; padding: 8px 0 24px; flex: 1; }
.qcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px; box-shadow: var(--shadow);
}
.qcard .topic { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.qcard .question { font-size: 19px; font-weight: 500; line-height: 1.45; margin: 0 0 16px; overflow-wrap: anywhere; }
.options { display: grid; gap: 10px; }
.option {
  display: flex; align-items: flex-start; gap: 12px; text-align: left;
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: transparent; color: var(--text);
  font-size: 15px; line-height: 1.45; overflow-wrap: anywhere;
}
.option:hover:not(:disabled) { background: var(--pill); }
.option:disabled { cursor: default; opacity: .75; }
.option .letter {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--tonal); color: var(--tonal-text); font-weight: 600; font-size: 14px;
}
.option.right { border-color: var(--ok); background: var(--ok-bg); opacity: 1; }
.option.right .letter { background: var(--ok); color: var(--surface); }
.option.wrong { border-color: var(--no); background: var(--no-bg); opacity: 1; }
.option.wrong .letter { background: var(--no); color: var(--surface); }
.feedback { margin-top: 16px; padding: 12px 14px; border-radius: 10px; }
.feedback.ok { background: var(--ok-bg); color: var(--ok); }
.feedback.no { background: var(--no-bg); color: var(--no); }
.feedback p { margin: 6px 0 0; color: var(--text); }
.actions { margin-top: 14px; display: flex; justify-content: flex-end; }
.actions.center { justify-content: center; }
.actions button { border-radius: 999px; padding: 10px 22px; }
.result-card .score { text-align: center; font-size: 56px; font-weight: 500; color: var(--accent); }
.weak { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.weak li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.weak a { color: var(--accent); text-decoration: none; white-space: nowrap; }
.qcard code { font-size: .92em; background: var(--tonal); color: var(--tonal-text); padding: 1px 5px; border-radius: 5px; }

/* entry link on the chat page: brand-colour ring, tonal fill */
:root { --quiz-fill: #e8eef4; }
@media (prefers-color-scheme: dark) { :root { --quiz-fill: #22374b; } }
.quiz-home { margin-top: 30px; }
.quiz-link {
  display: inline-flex; align-items: center; gap: 14px; max-width: 100%;
  padding: 10px 22px 10px 10px; border-radius: 999px; text-align: left;
  border: 2px solid transparent;
  background:
    linear-gradient(var(--quiz-fill), var(--quiz-fill)) padding-box,
    conic-gradient(from 200deg, var(--d-teal), var(--d-red), var(--d-lime), var(--d-green), var(--d-teal)) border-box;
  color: var(--text); text-decoration: none;
  transition: box-shadow .2s, transform .2s;
}
.quiz-link:hover, .quiz-link:focus-visible { box-shadow: var(--shadow); transform: translateY(-1px); outline: none; }
.quiz-ico { flex: none; width: 34px; height: 34px; margin-left: 6px; }
.quiz-txt { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.quiz-txt strong { font-size: 16px; font-weight: 500; color: var(--accent); }
.quiz-txt small { font-size: 13px; color: var(--muted); }
.quiz-arrow { flex: none; font-size: 18px; color: var(--accent); transition: transform .2s; }
.quiz-link:hover .quiz-arrow { transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) { .quiz-link, .quiz-arrow { transition: none; } .quiz-link:hover { transform: none; } }
body.chatting .quiz-home { display: none; }
.top-quiz { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--text); text-decoration: none; padding: 7px 12px; border-radius: 999px; white-space: nowrap; }
.top-quiz:hover { background: var(--pill); }
body.chatting .top .top-quiz { margin-left: auto; flex: none; }
body.chatting .top .top-quiz + #new-chat { margin-left: 0; }
.ico-sm { width: 16px; height: 16px; flex: none; }
.ico-title { width: 28px; height: 28px; vertical-align: -4px; margin-right: 10px; }
/* the dark-green square would vanish on a dark page: give it a thin brand-teal edge */
@media (prefers-color-scheme: dark) { .sq-deep { stroke: var(--d-teal); stroke-width: 1.2; } }
