/* Math facts. Base styles come from ../assets/den.css. */

.btn.small { font-size: 13px; padding: 5px 10px; }
.range { display: inline-flex; gap: 10px; align-items: center; white-space: nowrap; }
.presets { display: inline-flex; gap: 6px; flex-wrap: wrap; }
input[type=text] {
  font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px;
  background: #fff; color: var(--ink);
}

/* one setting per row */
.toggles { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; font-size: 15px; }
.toggles label { display: flex; gap: 8px; align-items: baseline; cursor: pointer; }

/* operation toggles */
.ops { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 6px; }
.ops label { cursor: pointer; }
.ops input { position: absolute; opacity: 0; pointer-events: none; }
.ops span {
  display: block; text-align: center; padding: 10px 6px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--card); font-size: 15px;
}
.ops span b { display: block; font-size: 26px; line-height: 1.1; }
.ops input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.ops input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* practice */
.meter .clock { font-variant-numeric: tabular-nums; }
.meter { align-items: center; }
#tally { display: inline-flex; gap: 6px; }
.pill { border-radius: 999px; padding: 3px 10px; font-size: 15px; font-weight: bold; font-variant-numeric: tabular-nums; }
.pill.ok { color: var(--good); background: var(--good-soft); }
.pill.no { color: var(--bad); background: var(--bad-soft); }
.again-note { color: var(--muted); font-style: italic; min-height: 22px; font-size: 15px; }
.problem {
  font-size: 64px; line-height: 1.1; margin: 6px 0 18px; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.problem .eq { color: var(--muted); }
.problem .q { color: var(--line); }
.problem .good { color: var(--good); }
.problem .fix { color: var(--accent); }
.problem .listen { color: var(--muted); font-size: 34px; font-style: italic; }
.dots { display: flex; justify-content: center; align-items: center; gap: 14px 18px; flex-wrap: wrap; margin: -6px 0 18px; }
.dots:empty { display: none; }
.dots .grp { display: inline-grid; gap: 6px; }
.dots .grp:empty { width: 22px; height: 22px; border: 2px dashed var(--line); border-radius: 50%; }
.dots .d { display: block; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); }
.dots .d.b { background: #d9822b; }
.dots .d.gone { background: transparent; border: 2px solid var(--line); position: relative; }
.dots .d.gone::after {
  content: ""; position: absolute; left: -3px; right: -3px; top: 50%; height: 2px;
  background: var(--bad); transform: rotate(-45deg);
}
.dots .op { font-size: 30px; color: var(--muted); }
#answer {
  font-size: 40px; font-family: Georgia, serif; text-align: center; font-variant-numeric: tabular-nums;
  padding: 10px 14px; width: 100%; max-width: 220px;
  border: 2px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
#answer:focus { outline: none; border-color: var(--accent); }

.stage.flash-good { animation: flash-good .3s ease-out; }
.stage.flash-bad { animation: flash-bad .6s ease-out; }
@keyframes flash-good { from { background: var(--good-soft); border-color: var(--good); } }
@keyframes flash-bad { from { background: var(--bad-soft); border-color: var(--bad); } }

.numpad {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  max-width: 280px; margin: 14px auto 0;
}
.numpad .key { font-size: 24px; padding: 12px 0; }
.numpad .key.wide { font-size: 16px; }
.numpad.hide { display: none; }

/* results */
.stats { display: flex; gap: 8px 18px; justify-content: center; flex-wrap: wrap; color: var(--muted); font-size: 15px; }
#misses { margin: 18px auto 0; max-width: 420px; }
#misses h3 { margin: 0 0 4px; color: var(--bad); }
table.results.misses { font-size: 20px; }
table.results.misses td { background: var(--bad-soft); }

@media (max-width: 700px) {
  .ops { grid-template-columns: repeat(2, 1fr); }
  .problem { font-size: 48px; }
  .problem .listen { font-size: 28px; }
  #answer { font-size: 34px; }
  .numpad { max-width: 100%; }
  .numpad .key { padding: 14px 0; }
}
