/* ── Message panel and end states (r54). #notice is the card's paper (.dk-modal); its end
   state takes the old message panel's layout (web/static/js/lib/session_wait.js:66-74:
   centred, body line, one button) and, for a finished lesson, the done screen's check ring,
   count and heading (phaseb.css:1278-1335, no draw-in animation: the arc is drawn in full).
   The button is the done screen's home button (phaseb.css .dk-done__home, 1397-1414). ── */
#notice:has(> #status:empty):has(> #done.hidden) { display: none; }
#notice {
  text-align: center;
  padding: 14px 24px;
  margin-bottom: 16px;
  align-items: center;
}
#notice:has(> #done:not(.hidden)) { padding: 44px 32px 40px; margin-top: 24px; }
/* The page's script did not load or start (player.html): its line and "Try again". */
#page_failed { align-items: center; gap: 16px; margin-top: 24px; text-align: center; color: var(--lav-ink-soft); }
#page_failed[hidden] { display: none; }
#status {
  font-family: var(--lav-ui);
  font-size: 15px;
  line-height: 1.5;
  color: var(--lav-ink-soft);
  margin: 0;
}
#status:empty { display: none; }
#done { margin-top: 24px; }
/* A panel with no line (an empty Review sitting): the button alone, centred in the paper. */
#notice:not(.is-finished) > #status:empty + #done { margin-top: 0; }
.pl-done-head { display: flex; flex-direction: column; align-items: center; }
.pl-done-head + #status { margin-top: 4px; }
.pl-done-head.hidden { display: none; }
.dk-done__ring { position: relative; width: 88px; height: 88px; margin-bottom: 28px; }
.dk-done__ring svg { display: block; width: 100%; height: 100%; }
.dk-done__ring-bg { fill: none; stroke: rgba(74,72,120,0.10); stroke-width: 2.5; }
.dk-done__ring-arc { fill: none; stroke: var(--lav-purple); stroke-width: 2.5; stroke-linecap: round; }
.dk-done__check-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  line-height: 0;
}
.dk-done__check-mark svg { width: 32px; height: 32px; stroke: var(--lav-purple); }
.dk-done__count {
  font-family: var(--lav-display);
  font-weight: 700;
  font-size: 72px;
  line-height: 1;
  color: var(--lav-ink);
  margin: 0;
}
.dk-done__heading {
  font-family: var(--lav-display);
  font-weight: 500;
  font-size: 22px;
  color: var(--lav-ink-muted);
  margin: 8px 0 12px;
}
#next {
  min-height: 44px;  /* r66: 42px with Nunito, 39px with the fallback font before */
  font-family: var(--lav-ui);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  padding: 12px 28px;
  margin: 0;
  border: none;
  border-radius: 12px;
  background: var(--lav-purple);
  box-shadow: 0 4px 16px rgba(74,72,120,0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
#next:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(74,72,120,0.32);
  background: #5a5890;
}
/* r67: the old home's "I want to keep going" (atmosphere.css .done-keep-going): a quiet
   underlined line under the main button, on this panel's light ground. */
#keep_going:not(.hidden) { display: block; margin: 14px auto 0; }
#keep_going {
  min-height: 44px;
  font-family: var(--lav-ui);
  font-size: 13px;
  letter-spacing: 0.03em;
  color: var(--lav-ink-soft);
  background: none;
  border: none;
  padding: 0 8px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(74,72,120,0.30);
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
#keep_going:hover { color: var(--lav-purple); text-decoration-color: currentColor; }
@media (prefers-reduced-motion: reduce) {
  #next, #keep_going { transition: none; }
  #next:hover { transform: none; }
}
@media (max-width: 540px) {
  #notice:has(> #done:not(.hidden)) { padding: 36px 20px 32px; margin-top: 8px; }
  .dk-done__count { font-size: 60px; }
}

/* ── Reveal and rating (r53, build step 3): phaseb.css .dk-actions 829-839 and its phone rule
   852-873, .dk-reveal 875-910, .dk-reveal-prompt 916-924, .dk-rate* 1010-1085,
   .dk-already-know 1087-1097, .dk-undo 1099-1111, .dk-rate-btn phone padding 1516 (the card
   report is player-report.css), the guess line's debut 925-990. Trimmed: no "Saving..." line.
   Changed for the player's bars (r53): the link and the sub-labels are darker than the old ones
   (3:1 or better), and every control is at least 44px high. Class rules, so the global `button`
   rule below (#next's cursor, the disabled look) is unchanged. ── */
.dk-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding-top: 16px;
}
.dk-reveal-prompt {
  font-family: var(--lav-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--lav-ink-soft);
  text-align: center;
  margin: 0;
  position: relative; /* anchors the debut arrow */
}
/* The guess line's once-ever debut (guess_hint.js): one soft 1.2s swell while the arrow draws in
   above the line, points down at it, holds, and fades. Absolute, so it never moves the layout.
   Reduced motion: neither. */
@media (prefers-reduced-motion: no-preference) {
  .dk-reveal-prompt--debut { animation: lavGuessDebut 1.2s 1 both; }
  .dk-guess-arrow { animation: lavGuessArrowFade 3.4s 1 both; }
  .dk-guess-arrow path {
    animation: lavGuessArrowDraw 0.6s 0.35s 1 both cubic-bezier(0.45, 0, 0.3, 1);
  }
  .dk-guess-arrow path + path { animation-duration: 0.22s; animation-delay: 0.95s; }
}
.dk-guess-arrow {
  position: absolute;
  bottom: calc(100% + 10px);
  left: calc(50% - 110px);
  width: 80px;
  height: 55px;
  overflow: visible;
  pointer-events: none;
  fill: none;
  stroke: var(--lav-accent, #6c5ce7);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* The gap (2) is longer than the stroke and the start offset clears the path's start, so an
   undrawn stroke shows no round-cap dot. */
@keyframes lavGuessArrowDraw {
  from { stroke-dasharray: 1 2; stroke-dashoffset: 1.05; }
  to   { stroke-dasharray: 1 2; stroke-dashoffset: 0; }
}
@keyframes lavGuessArrowFade {
  0%, 59% { opacity: 1; transform: none;
            animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
  100%    { opacity: 0; transform: translateY(-2px); }
}
@keyframes lavGuessDebut {
  0%   { opacity: 0; transform: scale(0.96);
         animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }
  40%  { opacity: 1; transform: scale(1.06);
         animation-timing-function: cubic-bezier(0.45, 0, 0.25, 1); }
  100% { opacity: 1; transform: none; }
}
.dk-reveal {
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 14px 22px;
  background: var(--lav-purple);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-family: var(--lav-ui);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(74,72,120,0.25);
  transition: all 0.2s ease;
}
.dk-reveal:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(74,72,120,0.32);
  background: #5a5890;
}
.dk-reveal kbd {
  background: rgba(255,255,255,0.2);
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--lav-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.dk-rate { display: block; width: 100%; max-width: 440px; }
.dk-rate-review {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}
.dk-rate-btn {
  margin: 0;
  padding: 14px 22px;
  border-radius: 12px;
  font-family: var(--lav-ui);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 56px;
}
.dk-rate-btn__sub {
  font-size: 10px;
  font-weight: 700;
  opacity: 0.85;
  letter-spacing: 0.4px;
  text-transform: lowercase;
}
.dk-rate-btn--again {
  background: rgba(255,255,255,0.9);
  color: #c23a30;
  border: 1.5px solid rgba(194,58,48,0.3);
}
.dk-rate-btn--again:hover {
  background: rgba(194,58,48,0.05);
  border-color: rgba(194,58,48,0.5);
}
.dk-rate-btn--good {
  background: #2e7d32;
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(46,125,50,0.25);
}
.dk-rate-btn--good:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(46,125,50,0.32);
  background: #256b29;
}
/* A new card: the old learn face (.dk-rate-learn, .dk-rate-btn--learned): one wide "Got it"
   with no sub-label, "Already know this" under it. A review hides the link. */
#ratings.is-new .dk-rate-review { grid-template-columns: 1fr; justify-items: center; }
#ratings.is-new .dk-rate-btn--again,
#ratings.is-new .dk-rate-btn__sub { display: none; }
#ratings.is-new .dk-rate-btn--good {
  width: 100%;
  max-width: 320px;
  padding: 16px 32px;
  font-size: 15px;
}
.dk-already-know {
  display: none;
  min-height: 44px;
  margin: 4px auto 0;
  padding: 0 16px;
  background: none;
  border: none;
  font-family: var(--lav-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--lav-ink-soft);
  cursor: pointer;
  transition: color 0.15s ease;
}
.dk-already-know:hover { color: var(--lav-ink); }
#ratings.is-new .dk-already-know { display: block; }
/* The old Undo (phaseb.css 1099-1111), 44px high and in the link's darker ink, like every
   control. */
.dk-undo {
  min-height: 44px;
  padding: 0 12px;
  background: none;
  border: none;
  font-family: var(--lav-ui);
  font-size: 11px;
  font-weight: 700;
  color: var(--lav-ink-soft);
  cursor: pointer;
  transition: color 0.15s;
}
.dk-undo:hover { color: var(--lav-purple); }
.dk-reveal.hidden, .dk-rate.hidden, .dk-reveal-prompt.hidden { display: none; }
.dk-reveal:disabled, .dk-rate-btn:disabled, .dk-already-know:disabled { cursor: default; }
@media (max-width: 540px) {
  .dk-reveal kbd { display: none; }
  .dk-rate-btn { padding: 14px 18px; min-height: 56px; }
  /* Phones: the row sticks to the screen bottom while the card is taller than the screen,
     over a frosted strip, and settles under the card at its end (phaseb.css:852-873,
     aag-1951). Scoped to the card: the row only exists there. */
  html { scroll-padding-bottom: calc(130px + var(--safe-bottom)); }
  #controls {
    position: sticky;
    bottom: calc(10px + var(--safe-bottom));
    z-index: 2;
  }
  #controls::before {
    content: "";
    position: absolute;
    inset: -14px -16px -10px;
    bottom: calc(-10px - var(--safe-bottom));
    z-index: -1;
    pointer-events: none;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    -webkit-mask-image: linear-gradient(transparent, #000 18px, #000 calc(100% - 12px), transparent);
    mask-image: linear-gradient(transparent, #000 18px, #000 calc(100% - 12px), transparent);
  }
}
@media (prefers-reduced-motion: reduce) {
  .dk-reveal, .dk-rate-btn { transition: none; }
  .dk-reveal:hover, .dk-rate-btn--good:hover { transform: none; }
}

/* ── The page's plain button rule (the primer's own look is player-primer.css, r60) ── */
button { font-size: 16px; padding: 8px 16px; margin: 4px 4px 4px 0; border: 1px solid #bbb;
         border-radius: 6px; background: #f6f6f6; color: #222; cursor: pointer; }
button:disabled { opacity: 0.5; cursor: default; }
