:root { --bg:#f6f7fb; --card:#fff; --text:#1d2433; --muted:#6b7280; --accent:#2563eb; --ok:#16a34a; --bad:#dc2626; --border:#e5e7eb; }
@media (prefers-color-scheme: dark) {
  :root { --bg:#111827; --card:#1f2937; --text:#f3f4f6; --muted:#9ca3af; --accent:#60a5fa; --ok:#4ade80; --bad:#f87171; --border:#374151; }
}
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--text); font-family: system-ui, "Segoe UI", sans-serif; }
main { max-width: 520px; margin: 0 auto; padding: 24px 16px; }
main.wide { max-width: 860px; }
h1 { font-size: 1.4rem; margin: 0 0 16px; }
h2 { font-size: 1.1rem; margin: 0 0 8px; }
a { color: var(--accent); }
header.row { margin-bottom: 8px; }
.card { background:var(--card); border:1px solid var(--border); border-radius:12px; padding:20px; margin-bottom:16px; }
.row { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.row.between { justify-content: space-between; }
.tile { min-width: 110px; padding: 8px 12px; }
button { font: inherit; padding:10px 16px; border-radius:8px; border:1px solid var(--border); background:var(--card); color:var(--text); cursor:pointer; }
button.primary { background:var(--accent); color:#fff; border-color:var(--accent); }
button:disabled { opacity:.5; cursor:default; }
button.link { background:none; border:none; color:var(--accent); padding:0; font-size:.9rem; text-decoration:underline; }
input[type=password], select, label.stack input[type=text] { font: inherit; padding:8px 10px; border-radius:8px; border:1px solid var(--border); background:var(--bg); color:var(--text); }
label.stack { flex-direction: column; align-items: stretch; gap:4px; margin-bottom:12px; }
label.stack input { width:100%; font-size:1.1rem; }
tr.untested td { color: var(--muted); }
tr.untested td b { font-weight: 500; }
input[type=text] { font: inherit; font-size:1.3rem; padding:10px 12px; width:100%; border-radius:8px; border:1px solid var(--border); background:var(--bg); color:var(--text); }
.status { min-height: 1.6em; margin-top:10px; font-size:1.1rem; }
.ok { color:var(--ok); } .bad { color:var(--bad); }
.muted { color:var(--muted); font-size:.9rem; }
.big { font-size:1.6rem; font-weight:600; }
label { display:flex; gap:6px; align-items:center; }
ul.missed { padding-left:20px; margin:8px 0 0; }
table { width:100%; border-collapse: collapse; margin-top: 10px; font-size: .95rem; }
th, td { text-align:left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .85rem; }
.num { text-align: right; }
.tested { margin: 0 0 14px; font-size: .95rem; }
.bar { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; margin-top: 6px; display: flex; }
.bar-fill { height: 100%; transition: width .6s ease; }
.bar-fill.ok { background: var(--ok); } .bar-fill.bad { background: var(--bad); }

/* ---- celebration after a correct answer (static/celebrate.js) */
.cf-layer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.cf-praise { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%);
  font-size: 2.6rem; font-weight: 800; color: #fff; text-align: center; white-space: nowrap;
  text-shadow: 0 2px 4px rgba(0,0,0,.35);
  background: linear-gradient(135deg, #2563eb, #a855f7); padding: 10px 28px; border-radius: 999px;
  box-shadow: 0 8px 30px rgba(37,99,235,.45);
  animation: cf-pop .5s cubic-bezier(.2,1.6,.4,1) both, cf-fade .4s ease 1.3s both; }
.cf-streak { font-size: 1.1rem; font-weight: 600; margin-top: 4px; }
.cf-confetti { position: absolute; top: -20px; border-radius: 2px; animation: cf-fall linear both; }
.cf-rain { position: absolute; top: -40px; line-height: 1; animation: cf-fall linear both; }
.cf-burst { position: absolute; line-height: 1; animation: cf-burst 1.3s ease-out both; }
.cf-spark { position: absolute; width: 7px; height: 7px; border-radius: 50%; animation: cf-burst 1.4s ease-out both; }
.cf-bounce { position: absolute; left: 50%; top: 60%; font-size: 6rem; line-height: 1; animation: cf-bounce 1.5s ease-in-out both; }
.cf-wave { position: absolute; left: 50%; top: 62%; transform: translateX(-50%); display: flex; gap: 10px; font-size: 2.6rem; line-height: 1; }
.cf-wave-item { animation: cf-jump 1.6s ease-in-out both; }
@keyframes cf-pop  { from { transform: translate(-50%, -50%) scale(.2); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
@keyframes cf-fade { to { opacity: 0; } }
@keyframes cf-fall { 0% { transform: translateY(0) rotate(0deg); opacity: 1; } 100% { transform: translateY(110vh) rotate(540deg); opacity: .6; } }
@keyframes cf-burst { 0% { transform: translate(-50%, -50%) scale(.3); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.2); opacity: 0; } }
@keyframes cf-bounce { 0% { transform: translate(-50%, 60px) scale(.3); opacity: 0; } 30% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  45% { transform: translate(-50%, -30%) scale(1); } 60% { transform: translate(-50%, -55%) scale(1.1); } 75% { transform: translate(-50%, -45%) scale(1); }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; } }
@keyframes cf-jump { 0%, 100% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 35% { transform: translateY(-40px); }
  55% { transform: translateY(0); } 70% { transform: translateY(-20px); } 85% { transform: translateY(0); opacity: 1; } }
