/* Result feedback reserves the same space before and after Godkend. */
.task-panel .task-feedback {
  position: relative; isolation: isolate; margin: 20px 0 14px;
  padding: 12px 16px; border: 2px solid transparent; border-radius: 20px;
  gap: 14px; background: var(--theme-wash);
}
.task-feedback h2 { min-width: 0; margin: 0; font-size: clamp(18px, 2.3vw, 25px); }
.task-panel[data-feedback-state-value="correct"] .task-feedback {
  background: var(--mint); border-color: var(--green); color: #105637;
}
.task-panel[data-feedback-state-value="wrong"] .task-feedback {
  background: #fff1d9; border-color: #c58024; color: #70460e;
}
.feedback-result-mark {
  display: grid; place-items: center; flex: 0 0 60px; width: 60px; height: 60px;
  border-radius: 50%; background: var(--green); color: white;
}
.feedback-result-mark .luxi-icon { width: 42px; height: 42px; stroke-width: 3; }
[data-feedback-state-value="wrong"] .feedback-result-mark { background: #8b5918; }
[data-feedback-state-value="correct"] .choice.correct { border-width: 2px; box-shadow: 0 0 0 4px #16734d32; }
.task-panel .task-next {
  background: var(--theme-action); color: var(--theme-ink); border: 2px solid var(--theme-strong);
  box-shadow: 0 4px 0 var(--theme-strong); gap: 10px;
}
/* Hover, press and focus keep the dark text on the theme's light button (prodtest 27.11.2026, M1): without the colour
   here, `.button.primary:hover` (application.css) made it white on yellow or cyan, and on an iPad the hover stays
   on the button after the tap on Godkend. */
.task-panel .task-next:is(:hover, :active, :focus-visible, .is-pressed):not(:disabled) { background: var(--theme-action); color: var(--theme-ink); }
.task-panel .task-next:hover:not(:disabled) { filter: brightness(1.04); }
.task-next .luxi-icon { width: 30px; height: 30px; flex-shrink: 0; }
.next-label { line-height: 1.25; }
/* Countdown to the next task (user note 03.10): a line along the bottom edge that
   runs out. Absolutely placed, so the button never changes size or wraps. */
.task-panel .task-next { position: relative; overflow: hidden; }
.next-countdown { position: absolute; left: 12px; right: 12px; bottom: 7px; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--theme-strong) 18%, transparent); pointer-events: none; }
.next-countdown-bar { display: block; height: 100%; border-radius: inherit; background: var(--theme-strong); transform-origin: left center; transition: transform 1s linear; }
@media (prefers-reduced-motion: reduce) { .next-countdown-bar { transition: none; } }
.countdown-pause { border-color: var(--line); background: var(--panel); }
.pause-symbol { font-size: 28px; font-weight: 900; line-height: 1; }
.feedback-confetti { position: absolute; inset: -10px 0; pointer-events: none; overflow: hidden; border-radius: inherit; z-index: -1; }
.confetti-piece { display: none; position: absolute; left: 50%; top: 15%; width: 9px; height: 14px; border-radius: 3px; background: var(--theme-accent); }
.confetti-piece:nth-child(3n) { background: var(--theme-primary); border-radius: 50%; }
.confetti-piece:nth-child(3n + 1) { background: var(--theme-action); }
.confetti-piece-0 { --x: -190px; --y: 65px; --r: -90deg; }
.confetti-piece-1 { --x: -155px; --y: 15px; --r: 130deg; }
.confetti-piece-2 { --x: -120px; --y: 80px; --r: 240deg; }
.confetti-piece-3 { --x: -85px; --y: 5px; --r: -200deg; }
.confetti-piece-4 { --x: -50px; --y: 70px; --r: 180deg; }
.confetti-piece-5 { --x: -20px; --y: -5px; --r: -140deg; }
.confetti-piece-6 { --x: 20px; --y: 90px; --r: 100deg; }
.confetti-piece-7 { --x: 50px; --y: 5px; --r: -230deg; }
.confetti-piece-8 { --x: 85px; --y: 75px; --r: 310deg; }
.confetti-piece-9 { --x: 120px; --y: 10px; --r: -190deg; }
.confetti-piece-10 { --x: 155px; --y: 80px; --r: 190deg; }
.confetti-piece-11 { --x: 190px; --y: 20px; --r: -280deg; }
@media (prefers-reduced-motion: no-preference) {
  .feedback-celebrate .confetti-piece { display: block; animation: feedback-confetti 1.2s ease-out both; }
  .feedback-celebrate .feedback-result-mark { animation: feedback-pop .45s ease-out; }
  .feedback-celebrate .task-next { animation: feedback-next .65s ease-in-out 2; }
}
@keyframes feedback-confetti {
  0% { opacity: 0; transform: translate(0, 30px) rotate(0); }
  15% { opacity: .9; }
  100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)); }
}
@keyframes feedback-pop { 0% { transform: scale(.8); } 65% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes feedback-next { 50% { box-shadow: 0 4px 0 var(--theme-strong), 0 0 0 5px var(--theme-soft); } }
/* Explicit hidden override: button display rules must not expose stopped timers. */
.task-panel [data-feedback-target][hidden] { display: none; }
@media (max-width: 600px) {
  .task-panel .task-feedback { padding: 10px; gap: 10px; }
  .task-feedback h2 { font-size: 18px; }
  .feedback-result-mark { flex-basis: 52px; width: 52px; height: 52px; }
  .feedback-result-mark .luxi-icon { width: 36px; height: 36px; }
  .task-panel .task-next { gap: 2px; }
}
/* Autoskift stopped by the child (touch, scroll, key or Bliv her, user note 09.11): the pause button
   shows the new state, and a short notice above the bar says so. */
.countdown-pause.stopped { border-color: var(--theme-strong); background: var(--theme-wash); color: var(--theme-ink); }
.autoadvance-stopped { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); z-index: 5;
  white-space: nowrap; padding: 8px 14px; border-radius: 99px; background: #302744; color: #fff;
  font-size: 14px; font-weight: 800; box-shadow: 0 6px 18px #0003; pointer-events: none; }
.autoadvance-stopped[hidden] { display: none; }
/* A wrong answer (UI review 20.11.2026, H2): one line that is itself »Prøv igen«, so the task behind it stays on
   screen. The round ↺ looked like a button and was not; now the whole line is. */
.task-panel[data-feedback-state-value="wrong"] .task-feedback { height: auto; min-height: 0; margin: 8px 0 6px; padding: 5px 8px 5px 10px; gap: 8px; }
.feedback-retry-form { display: flex; flex: 1 1 auto; min-width: 0; margin: 0; }
.feedback-retry { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; min-height: 44px; padding: 0; border: 0; border-radius: 12px; background: none; color: inherit; font: inherit; font-size: clamp(16px, 2vw, 20px); font-weight: 800; line-height: 1.2; text-align: left; cursor: pointer; touch-action: manipulation; }
.feedback-retry:focus-visible { outline: 3px solid #8b5918; outline-offset: 2px; }
.task-panel[data-feedback-state-value="wrong"] .feedback-result-mark { flex: 0 0 36px; width: 36px; height: 36px; }
.task-panel[data-feedback-state-value="wrong"] .feedback-result-mark .luxi-icon { width: 24px; height: 24px; }
.task-panel[data-feedback-state-value="wrong"] .task-feedback .audio-control { width: 40px; height: 40px; flex-basis: 40px; border-color: #c58024; background: #fff8ec; color: #70460e; }
/* After »Se svar og forklaring« (UI review 20.11.2026, M9): the pupil's own answer right over the facit, with the
   same two marks as in a choice task. */
.task-explanation .answer-row { display: grid; grid-template-columns: minmax(5.6rem, auto) minmax(0, 1fr) 24px; align-items: center; gap: 10px; margin: 0; padding: 6px 10px; border: 2px solid var(--green); border-radius: 12px; background: #fff; font-size: clamp(1.05rem, 1.6vw, 1.3rem); }
.task-explanation .answer-row + .answer-row { margin-top: -4px; }
.answer-row__label { font-size: .85rem; font-weight: 700; color: var(--muted); }
.answer-row__value { min-width: 0; font-weight: 800; overflow-wrap: anywhere; }
.task-explanation .answer-row > .luxi-icon { width: 24px; height: 24px; padding: 3px; border-radius: 50%; background: var(--green); color: #fff; stroke-width: 3; }
.task-explanation .answer-own { border-color: var(--red); background: var(--red-soft); color: #782238; }
.task-explanation .answer-own > .luxi-icon { background: var(--red); }
/* Once answered, the grey answer pad and the helper lines only take room from the answer and the explanation. */
.task-panel:not([data-task-state-value="unanswered"]) .answer-form :is(.answer-pad, .response-hint, .response-tools, .response-keyboard, .response-pieces, .discrete-counter .button) { display: none; }
/* Where the »Dit svar« line says it all, the answer fields under the explanation would only repeat it. */
.task-panel.answer-told .answer-form { display: none; }
/* The answered column builder is as tall as its blocks need, so the numbers stay on screen above the feedback. */
.task-panel:not([data-task-state-value="unanswered"]) .answer-form .discrete-bar { height: min(calc(var(--discrete-max, 10) * 28px), 8.25rem); }
