/* ── The finished lesson (end_screen.js), the old done screen (phaseb.css 1115-1424, the dark
   tiers' inks 2451-2490): on the sky, not on the paper; the glowing dots and fireflies show. ── */
#notice.is-finished {
  --dkd-ink: var(--lav-ink);
  --dkd-ink-muted: var(--lav-ink-muted);
  --dkd-halo: none;
  --dkd-rule: rgba(74, 72, 120, 0.15);
  background: none;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#notice.is-finished::before, #notice.is-finished::after { display: none; }
.atmosphere.is-caught-up ~ .dk-shell #notice.is-finished {
  --dkd-ink: #0e0a1c;
  --dkd-ink-muted: #120d24;
  --dkd-halo: 0 1px 2px rgba(255, 255, 255, 0.45);
  --dkd-rule: rgba(22, 18, 42, 0.30);
}
.atmosphere.is-night ~ .dk-shell #notice.is-finished {
  --dkd-ink: rgba(238, 235, 250, 0.95);
  --dkd-ink-muted: rgba(226, 222, 244, 0.92);
  --dkd-halo: 0 1px 3px rgba(6, 8, 22, 0.85);
  --dkd-rule: rgba(255, 255, 255, 0.20);
}
body:has(#notice.is-finished) :is(#particles, #fireflyCanvas) { display: block; }

/* Buttons pinned to the bottom (the old .dk-done--split, phaseb.css 1150-1235, aag-2495): the
   day's words come after the buttons are on screen, so they grow down into the room above the
   buttons and never push them; a list too long for it scrolls. Anchored from the top, so the
   ring stays put too. */
.dk-shell:has(#notice.is-finished) { height: 100vh; height: 100svh; }
.dk-shell:has(#notice.is-finished) main { min-height: 0; }
#notice.is-finished:has(> #done:not(.hidden)) { flex: 1 1 auto; min-height: 0; margin: 0 auto; padding: 0 0 8px; }
#notice.is-finished .pl-done-head {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-top: max(0px, calc(50vh - 330px));
  margin-top: max(0px, calc(50svh - 330px));
  padding: 20px 0 24px;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent);
}
#notice.is-finished > #done { margin-top: auto; }
/* Room held for the count and its heading, and for next review while the day's reply is out
   (end_screen.js); the day's words grow into place, as on the old done screen. */
#notice.is-finished .is-waiting .dk-done__next:empty { display: block; }
#notice.is-finished :is(.dk-done__count, .dk-done__heading, .is-waiting .dk-done__next):empty::before { content: "\00a0"; }
@media (max-height: 500px) {
  #notice.is-finished .pl-done-head { padding-top: 0; }
  #notice.is-finished .dk-done__ring { width: 56px; height: 56px; margin-bottom: 16px; }
  #notice.is-finished .dk-done__count { font-size: 52px; }
  #notice.is-finished > #done { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0 12px; }
  #notice.is-finished :is(.dk-done__home, #keep_going):not(.hidden) { margin: 0; }
}

#notice.is-finished .dk-done__heading,
#notice.is-finished #status,
#notice.is-finished :is(#keep_going, #trial_login) {
  color: var(--dkd-ink-muted);
  text-shadow: var(--dkd-halo);
}
#notice.is-finished .dk-done__count { color: var(--dkd-ink); text-shadow: var(--dkd-halo); }
#notice.is-finished .dk-done__ring-arc,
#notice.is-finished .dk-done__check-mark svg { stroke: var(--dkd-ink); }
#notice.is-finished .dk-done__ring-bg { stroke: var(--dkd-rule); }
/* The buttons keep their place, unseen, until the day's reply says which ones to offer
   (end_panel.js), so a button never changes under a finger. */
#done.is-waiting > :is(#next, #keep_going) { visibility: hidden; }

.dk-done__words {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 560px;
}
.dk-done__words:not(:empty) { padding: 16px 0; }
.dk-done__word {
  font-family: var(--font-jp);
  font-size: 24px;
  line-height: 1;
  color: var(--dkd-ink);
  text-shadow: var(--dkd-halo);
}
.dk-done__word-dot {
  font-size: 10px;
  color: var(--dkd-ink-muted);
  opacity: 0.4;
  user-select: none;
}
.dk-done__next {
  font-family: var(--lav-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--dkd-ink-muted);
  text-shadow: var(--dkd-halo);
  margin: 20px 0 0;
}
.dk-done__next:empty { display: none; }

/* "Back to home": the Quit link's address, quieter than "Next lesson". */
.dk-done__home:not(.hidden) { display: table; margin: 18px auto 0; }
.dk-done__home {
  font-family: var(--lav-ui);
  font-size: 13px;
  font-weight: 700;
  color: var(--dkd-ink);
  text-decoration: none;
  padding: 11px 24px;
  border: 1.5px solid var(--dkd-rule);
  border-radius: 12px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.dk-done__home:hover { border-color: var(--dkd-ink-muted); transform: translateY(-1px); }
@media (max-width: 540px) { .dk-done__word { font-size: 20px; } }
@media (prefers-reduced-motion: reduce) {
  .dk-done__home { transition: none; }
  .dk-done__home:hover { transform: none; }
}
