/* Dexquiz styles. Fonts are served from this site. */

[hidden] { display: none !important; }
a.icon-btn { text-decoration: none; color: inherit; }
/* Layout: one column. Six progress pips, then a question card (category, question, four answers), then an explanation panel that opens after each answer. */
:root {

  --accent: #4d46e5;
  --accent-ink: #ffffff;
  --good: #0f7a58;
  --good-bg: #d6f3e7;
  --bad: #b9302a;
  --bad-bg: #fde3e0;

}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
         
    --accent: #8f8aff; --accent-ink: #12112a; --good: #5fe0a8; --good-bg: #0f3a2b; --bad: #ff8a80; --bad-bg: #461a17;

  }
}
:root[data-theme="dark"] {
       
  --accent: #8f8aff; --accent-ink: #12112a; --good: #5fe0a8; --good-bg: #0f3a2b; --bad: #ff8a80; --bad-bg: #461a17;

}

* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--f-body); font-size: 16px; line-height: 1.45;
  padding-block: 20px 40px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 620px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { font-family: var(--f-display); font-weight: 800; font-size: 2rem; letter-spacing: -0.03em; line-height: 1; margin: 0;  }
.brand b { color: var(--accent); font-weight: 800; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: 999px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: .9rem; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(23, 22, 43, .18); }
.icon-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 12px; font-weight: 600; font-size: .9rem; }
.icon-btn svg { width: 16px; height: 16px; }

/* progress */
.meta-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.edition { font-family: var(--f-mono); font-size: .85rem; color: var(--muted); }
.pips { display: flex; gap: 6px; flex: 1; max-width: 260px; min-width: 150px; }
.pip { flex: 1; height: 10px; border-radius: 999px; background: var(--surface-2); }
.pip.cur { background: var(--accent); opacity: .45; }
.pip.ok { background: var(--good); }
.pip.no { background: var(--bad); }
.live { font-family: var(--f-mono); font-size: .85rem; color: var(--muted); }
.live strong { color: var(--ink); font-weight: 500; }

/* question card */
.card { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.qtop { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; font-size: .75rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.chip i { width: 10px; height: 10px; border-radius: 3px; background: var(--dot, var(--accent)); flex: none; }
.level { display: inline-flex; align-items: center; gap: 8px; font-size: .75rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.level span { display: inline-flex; gap: 3px; }
.level span i { width: 14px; height: 6px; border-radius: 2px; background: var(--line); }
.level span i.on { background: var(--ink); }
.qbody { display: flex; gap: 14px; align-items: center; }
.qspr { width: 72px; height: 72px; flex: none; background: var(--surface-2); border-radius: 16px; padding: 4px; }
.q { font-family: var(--f-display); font-weight: 700; font-size: 1.45rem; line-height: 1.2; letter-spacing: -0.015em; margin: 0; text-wrap: balance; min-width: 0; overflow-wrap: anywhere; }
.moves { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.moves li { background: var(--surface-2); border-radius: 12px; padding: 9px 12px; font-family: var(--f-mono); font-size: .92rem; text-align: center; overflow-wrap: anywhere; }
.note { margin: 0; font-size: .8rem; color: var(--muted); }

.opts { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.opt { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; border: 2px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px 14px; font-weight: 600; font-size: 1.02rem; min-height: 54px; transition: border-color .12s ease, background .12s ease; }
.opt .k { flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-family: var(--f-mono); font-size: .8rem; font-weight: 500; color: var(--muted); }
.opt .t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.opt .m { flex: none; width: 22px; height: 22px; }
.opt:not([disabled]):hover { border-color: var(--accent); }
.opt[disabled] { cursor: default; }
.opt.right { border-color: var(--good); background: var(--good-bg); }
.opt.right .k { background: var(--good); color: var(--surface); }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.opt.wrong .k { background: var(--bad); color: var(--surface); }
.opt.dim { opacity: .55; }

/* explanation */
.explain { border-radius: 16px; padding: 14px; display: flex; gap: 14px; align-items: center; }
.explain.ok { background: var(--good-bg); }
.explain.no { background: var(--bad-bg); }
.explain img { width: 64px; height: 64px; flex: none; background: var(--surface); border-radius: 14px; padding: 3px; }
.explain .tx { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.explain h3 { margin: 0; font-family: var(--f-display); font-size: 1.1rem; letter-spacing: -0.01em; }
.explain.ok h3 { color: var(--good); }
.explain.no h3 { color: var(--bad); }
.explain p { margin: 0; font-size: .95rem; }
.nextrow { display: flex; justify-content: flex-end; }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 11px 18px; font-weight: 700; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.hint-keys { font-size: .75rem; color: var(--muted); margin: 0; text-align: right; }

/* results */
.result { display: flex; flex-direction: column; gap: 14px; }
.score { display: flex; align-items: baseline; gap: 10px; }
.score .big { font-family: var(--f-display); font-weight: 800; font-size: 4rem; line-height: 1; letter-spacing: -0.04em; }
.score .of { font-family: var(--f-mono); color: var(--muted); font-size: 1.2rem; }
.verdict { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: 1.3rem; letter-spacing: -0.01em; }
.review { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.review li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; font-size: .92rem; }
.review svg { width: 20px; height: 20px; margin-top: 1px; }
.review .ok svg { color: var(--good); } .review .no svg { color: var(--bad); }
.review .rq { color: var(--muted); }
.review .ra { font-weight: 700; }
.sharebox { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); padding: 10px 12px; font-family: var(--f-mono); font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.next { font-family: var(--f-mono); font-size: .9rem; color: var(--muted); }

details.how { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 12px 16px; }
details.how summary { font-weight: 700; cursor: pointer; }
details.how ul { margin: 10px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
details.how li strong { color: var(--ink); }
.foot { font-size: .78rem; color: var(--muted); text-align: center; text-wrap: balance; margin: 0; }

dialog { border: 0; border-radius: 20px; padding: 20px; background: var(--surface); color: var(--ink); width: min(92vw, 420px); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(8, 8, 20, .55); }
dialog h2 { font-family: var(--f-display); font-size: 1.4rem; margin: 0 0 12px; letter-spacing: -0.02em; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0; }
.stats div { background: var(--surface-2); border-radius: 14px; padding: 12px; }
.stats dt { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stats dd { margin: 2px 0 0; font-family: var(--f-display); font-weight: 800; font-size: 1.8rem; font-variant-numeric: tabular-nums; }
.dist { margin: 14px 0 0; display: grid; gap: 5px; }
.dist h3 { margin: 0 0 2px; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dist .r { display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: center; font-family: var(--f-mono); font-size: .8rem; }
.dist .bar { background: var(--accent); color: var(--accent-ink); border-radius: 4px; padding: 1px 6px; min-width: 22px; text-align: right; font-variant-numeric: tabular-nums; }
.dist .bar.zero { background: var(--surface-2); color: var(--muted); }
dialog .close { margin-top: 14px; width: 100%; }

@media (max-width: 480px) {
  .brand { font-size: 1.7rem; }
  .q { font-size: 1.25rem; }
  .qspr { width: 60px; height: 60px; }
  .score .big { font-size: 3.4rem; }
}
@media (prefers-reduced-motion: reduce) { .opt { transition: none; } }
