:root {
  --bg: #f6f7fb; --card: #ffffff; --text: #16181d; --muted: #5b6270; --line: #dfe3ea;
  --accent: #2155d6; --accent-text: #ffffff; --ok: #137a3f; --ok-bg: #e5f6ec; --bad: #b42318; --bad-bg: #fdecea;
  --focus: #f5a524;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101217; --card: #1a1d24; --text: #eef0f4; --muted: #a3aab8; --line: #2c313b;
    --accent: #6d95ff; --accent-text: #0c0f15; --ok: #5fd08f; --ok-bg: #11291c; --bad: #ff8a80; --bad-bg: #331614;
  }
}
* { box-sizing: border-box; }
html { font-size: 112.5%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, "Segoe UI", Roboto, sans-serif; line-height: 1.55;
}
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--card); padding: 8px 12px; z-index: 9; }
header.top { border-bottom: 1px solid var(--line); background: var(--card); }
header.top .in, main { max-width: 760px; margin: 0 auto; padding: 0 16px; }
header.top .in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { font-weight: 700; text-decoration: none; color: var(--text); font-size: 1.1rem; }
nav a { margin-inline-start: 14px; text-decoration: none; font-weight: 600; }
nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 5px; }
main { padding-top: 24px; padding-bottom: 48px; }
h1 { font-size: 1.7rem; line-height: 1.25; margin: 0 0 8px; }
h2 { font-size: 1.25rem; margin: 0 0 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin: 0 0 18px; }
.muted { color: var(--muted); }
.big { font-size: 3rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; }
.stat b { display: block; font-size: 1.6rem; }
button, .btn {
  font: inherit; font-weight: 600; border: 0; border-radius: 12px; padding: 12px 18px; cursor: pointer;
  background: var(--accent); color: var(--accent-text); text-decoration: none; display: inline-block;
}
button.ghost { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
button:disabled { opacity: .55; cursor: default; }
input, select {
  font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); min-height: 46px;
}
label { font-weight: 600; display: block; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.q { font-size: 1.15rem; font-weight: 600; white-space: pre-line; margin: 6px 0 14px; }
.opts { display: grid; gap: 10px; }
.opt {
  text-align: start; background: var(--bg); color: var(--text); border: 2px solid var(--line);
  font-weight: 500; padding: 14px 16px;
}
.opt:hover:not(:disabled) { border-color: var(--accent); }
.opt .k { display: inline-block; min-width: 1.6em; font-weight: 800; color: var(--muted); }
.opt.right { border-color: var(--ok); background: var(--ok-bg); }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.opt.mine { box-shadow: inset 0 0 0 2px var(--accent); }
.fb { border-radius: 12px; padding: 12px 14px; margin-top: 14px; white-space: pre-line; }
.fb.ok { background: var(--ok-bg); color: var(--ok); }
.fb.bad { background: var(--bad-bg); color: var(--bad); }
.fb .why { color: var(--text); display: block; margin-top: 6px; }
.tag { font-size: .85rem; color: var(--muted); }
.timer { height: 8px; background: var(--line); border-radius: 8px; overflow: hidden; margin: 8px 0 4px; }
.timer i { display: block; height: 100%; background: var(--accent); width: 100%; transition: width 1s linear; }
ol.board { padding-inline-start: 1.4em; margin: 0; }
ol.board li { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }
.code { font-size: 2.6rem; font-weight: 800; letter-spacing: .2em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }
@media (max-width: 520px) { .stats { grid-template-columns: 1fr 1fr 1fr; } .big { font-size: 2.4rem; } nav a { margin-inline-start: 10px; } }
.opt:disabled { opacity: 1; }
.opt:disabled:not(.right):not(.wrong):not(.mine) { color: var(--muted); }
