/* The on-screen curriculum cards of Power-ups (P2, issue #349): Word flip, Odd one out, Boss rush, Memory match, Gap fill, Loot list,
   Headline writer, Belt check, Timeline snap and Tomorrow's first move. Linked from index.html; the rules of these cards live here and
   nowhere else (the view's own rules are in styles/views/power-ups.css, and the shared `.pu-live`, `.pu-actions` come from there).

   It has to hold at 360 px, and at 320 px with the root font size at 200 %: every flex and grid child that holds text gets `min-width: 0`,
   text wraps (`overflow-wrap: anywhere`), the grids shrink to one or two columns, and every control is at least 44 px tall.
   Nothing here moves on its own, so `prefers-reduced-motion` has nothing to turn off. */

.pu-run { display: flex; flex-direction: column; align-items: stretch; gap: 0.8rem; min-width: 0; overflow-wrap: anywhere; }
.pu-run h3, .pu-run h4 { margin: 0; }
.pu-count { margin: 0; font-size: 0.9rem; }
.pu-note { margin: 0; font-size: 0.9rem; }
.pu-closing { margin: 0; font-weight: 600; }
.pu-run .pu-actions { align-items: center; }
.pu-run .pu-live { min-height: 1.5em; }

/* Text for screen readers only. */
.pu-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* Word flip: the card is one big button. */
.pu-flip-card {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem;
  width: 100%; min-height: 9rem; padding: 1rem; font: inherit; text-align: center; cursor: pointer;
  color: var(--text); background: var(--surface-2); border: 2px solid var(--border); border-radius: var(--radius);
}
.pu-flip-card:hover, .pu-flip-card:focus-visible { border-color: var(--accent); }
.pu-flip-card:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }
.pu-flip-card.is-flipped { background: var(--accent-soft); border-color: var(--accent); }
.pu-flip-label { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.pu-flip-text { font-size: 1.5rem; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }

/* Odd one out and Gap fill: a list of big answer buttons. */
.pu-question { font-size: 1.15rem; }
.pu-options { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
@media (min-width: 560px) { .pu-options { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pu-option {
  min-height: 44px; padding: 0.6rem 0.8rem; font: inherit; font-weight: 600; text-align: center; cursor: pointer; min-width: 0;
  color: var(--text); background: var(--surface); border: 2px solid var(--border); border-radius: 10px; overflow-wrap: anywhere;
}
.pu-option:hover:not(:disabled), .pu-option:focus-visible { border-color: var(--accent); }
.pu-option:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }
.pu-option:disabled { cursor: default; color: var(--text); opacity: 0.85; }
.pu-option.is-odd { background: var(--good-soft); border-color: var(--good); }
.pu-option.is-wrong { background: var(--bad-soft); border-color: var(--bad); }
.pu-reveal { display: flex; flex-direction: column; gap: 0.4rem; min-height: 1.5em; }
.pu-reveal p { margin: 0; }
.pu-verdict { font-weight: 700; }
.pu-gap-sentence { margin: 0; font-size: 1.1rem; line-height: 1.5; }
.pu-blank { display: inline-block; min-width: 4ch; padding: 0 0.3em; border-bottom: 3px solid var(--accent); text-align: center; }
.pu-filled { color: var(--good); }

/* Boss rush and Timeline snap: the lesson's own task, drawn by the task renderer, under a counter. */
.pu-tasks .task { min-width: 0; }
.pu-combo { margin: 0; font-weight: 800; color: var(--accent); }

/* Memory match: twelve cards in two columns (three from 480 px), each a button. */
.pu-mm-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
@media (min-width: 480px) { .pu-mm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 720px) { .pu-mm-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pu-mm-grid li { min-width: 0; display: flex; }
.pu-mm-card {
  position: relative; flex: 1 1 auto; min-width: 0; min-height: 5rem; padding: 0.5rem; display: flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 700; text-align: center; cursor: pointer; overflow-wrap: anywhere;
  color: var(--accent-text); background: var(--accent); border: 2px solid var(--accent); border-radius: 12px;
}
.pu-mm-card:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
.pu-mm-card.is-up { color: var(--text); background: var(--accent-soft); }
.pu-mm-card.is-matched { color: var(--text); background: var(--good-soft); border-color: var(--good); cursor: default; }
.pu-mm-back { font-size: 1.6rem; }
.pu-mm-text { min-width: 0; overflow-wrap: anywhere; }
.pu-done-note { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }

/* Loot list, Headline writer and Tomorrow's first move: labelled text boxes. */
.pu-fields { display: flex; flex-direction: column; gap: 0.7rem; }
.pu-field { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.pu-field label, .pu-headline-label, .pu-move-label { font-weight: 700; }
.pu-input {
  font: inherit; width: 100%; min-height: 44px; max-width: 100%; padding: 0.45rem 0.7rem;
  border: 1.5px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text);
}
.pu-input:focus { border-color: var(--accent); }
.pu-loot-reveal { display: flex; flex-direction: column; gap: 0.7rem; }
.pu-loot-reveal:empty { display: none; }
.pu-loot-lesson { padding: 0.7rem 0.9rem; border-radius: 10px; background: var(--surface-2); min-width: 0; }
.pu-loot-lesson ul { margin: 0.4rem 0 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.4rem; }
.pu-loot-lesson li { min-width: 0; overflow-wrap: anywhere; }
.pu-paper { padding: 0.8rem 1rem; border: 2px solid var(--text); border-radius: 6px; background: var(--surface-2); text-align: center; }
.pu-paper-name { margin: 0; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.pu-headline-text { margin: 0.3rem 0 0; font-size: 1.4rem; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }

/* Belt check: one group of three belts per lesson. */
.pu-belt-list { display: flex; flex-direction: column; gap: 0.8rem; }
.pu-belt { margin: 0; padding: 0.7rem 0.9rem; min-width: 0; border: 1px solid var(--border); border-radius: 10px; }
.pu-belt legend { padding: 0 0.3rem; font-weight: 700; max-width: 100%; overflow-wrap: anywhere; }
.pu-belt-options { display: flex; flex-direction: column; gap: 0.4rem; }
.pu-belt-option { display: flex; align-items: center; gap: 0.6rem; min-height: 44px; padding: 0.2rem 0.5rem; border-radius: 8px; cursor: pointer; min-width: 0; }
.pu-belt-option span { min-width: 0; overflow-wrap: anywhere; }
.pu-belt-option input { flex: none; width: 1.25rem; height: 1.25rem; accent-color: var(--accent); }
.pu-belt--white { border-left: 6px solid var(--border); }
.pu-belt--green { border-left: 6px solid var(--tier-foundations); }
.pu-belt--black { border-left: 6px solid var(--text); }
.pu-belt-result { min-height: 1.5em; display: flex; flex-direction: column; gap: 0.5rem; }
.pu-belt-result p { margin: 0; }
.pu-belt-links { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.pu-belt-link { justify-content: flex-start; text-align: left; }
