/* The times-table practice (website/static/practice.js; [[practice …]] on the times-table pages, the English
   times-tables-practice/ page). Loaded only by pages that have it. On a 360 px phone the card's inside is 296 px
   (360 − 2 × 16 wrap − 2 × 4 border − 2 × 12 padding) and this box's inside 266 px (2 × 12 padding, 2 × 3 border):
   five 48 px table chips a row (5 × 48 + 4 × 6 = 264), three pad keys of 83 px (3 × 83 + 2 × 8 = 265). */
.practice { clear: both; margin: 0 0 1.4em; padding: 14px 12px 16px; background: #fff; color: var(--ink);
  border: 3px solid var(--ink); border-radius: 22px; }
.practice [hidden] { display: none !important; }
.practice h2 { margin: 0 0 0.4em; }
.practice :focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }
.pr-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the choice: chips of at least 48 x 48 px; a chosen one is violet with light text (not told by colour alone) */
.pr-choose { border: 0; padding: 0; margin: 0 0 0.6em; min-width: 0; }
.pr-choose legend { font-weight: 900; padding: 0; margin: 0 0 0.4em; }
.pr-chips { display: flex; flex-wrap: wrap; gap: 8px 6px; margin: 0 0 8px; }
.pr-chip { position: relative; display: inline-block; }
.pr-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pr-chip span { display: flex; align-items: center; justify-content: center; min-width: 48px; min-height: 48px;
  padding: 4px 12px; background: var(--cream); border: 3px solid var(--ink); border-radius: 999px; font-weight: 900; }
.pr-chip input:checked + span { background: var(--violet); color: #fff; box-shadow: inset 0 -4px 0 var(--ink); }
.pr-chip input:focus-visible + span { outline: 3px solid var(--violet); outline-offset: 3px; }
.pr-pick { color: #a3302b; font-weight: 900; }
.pr-start-row, .pr-again-row { text-align: center; margin: 0.6em 0; }
.practice button.btn:disabled { opacity: 0.5; cursor: default; transform: none; }

/* one question: the fact, the answer field, a fixed-height place for the feedback (nothing jumps), the pad */
.pr-play { max-width: 340px; margin: 0 auto; text-align: center; }
.pr-progress { margin: 0; font-size: 0.95rem; opacity: 0.8; }
.pr-question { margin: 0; font-size: 2.4rem; font-weight: 900; line-height: 1.25; white-space: nowrap;
  font-variant-numeric: tabular-nums; }
.pr-answer { display: block; width: 5.2em; min-height: 56px; margin: 6px auto 4px; padding: 2px 8px; font: inherit;
  font-size: 2rem; font-weight: 900; text-align: center; color: var(--ink); background: var(--cream);
  border: 3px solid var(--ink); border-radius: 14px; }
.pr-feedback { min-height: 7.6rem; margin: 0 0 8px; }
.pr-beast { display: block; width: 84px; margin: 0 auto; animation: pr-pop 0.35s ease-out; }
.pr-say { margin: 0; font-size: 1.3rem; font-weight: 900; }
.pr-hint { margin: 0.2em 0 0; line-height: 1.45; }
.pr-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 14px; }
.pr-pad button { min-height: 56px; padding: 0; font: inherit; font-size: 1.6rem; font-weight: 900; color: var(--ink);
  background: var(--cream); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 4px 0 var(--ink);
  cursor: pointer; touch-action: manipulation; }
.pr-pad button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.pr-pad .pr-zero { grid-column: span 2; }
.pr-checked .pr-pad { opacity: 0.45; }
.pr-go { display: block; width: 100%; min-height: 56px; padding: 10px 12px; }
@keyframes pr-pop { 0% { transform: scale(0.4); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* the end of a round */
.pr-result { text-align: center; }
.pr-score { margin: 0.1em 0 0.2em; font-size: 2.6rem; font-weight: 900; }
.pr-missed { list-style: none; padding: 0; margin: 0 0 0.6em; font-size: 1.25rem; font-weight: 900; }
.pr-game { margin: 1em 0 0.6em; }

@media (prefers-reduced-motion: reduce) {
  .practice *, .practice *::before, .practice *::after { animation: none !important; transition: none !important; }
}
