/* done: the shutdown. A short log, then an old-TV switch-off (an overlay on <body>, .scr-done.scr-done-tv),
   then a beating pixel heart on the dark screen. Dialogs carry .scr-done themselves (they live in the
   overlay layer): .scr-done.scr-done__vdlg (voucher) and .scr-done.scr-done__rdlg (restart). */
.scr-done.screen {
  justify-content: center;
}

.scr-done .scr-done__big {
  font-family: var(--font-ui);
  font-size: var(--fs-xl);
  line-height: 1.1;
  text-transform: uppercase;
}

.scr-done .scr-done__body {
  font-size: var(--fs-m);
}

.scr-done .scr-done__log {
  display: grid;
  gap: 4px;
  margin-bottom: 0;
  padding: 10px 12px;
  list-style: none;
  font-size: var(--fs-s);
  line-height: 1.3;
  background: var(--lav-l);
  border: var(--bw) solid var(--ink);
  box-shadow: inset 3px 3px 0 0 var(--lav);
}

.scr-done .scr-done__line {
  visibility: hidden;
}

.scr-done .scr-done__line.is-shown {
  visibility: visible;
}

.scr-done .scr-done__tag {
  display: inline-block;
  padding: 0 5px;
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  line-height: 1.45;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--yellow);
  border: 2px solid var(--ink);
  visibility: hidden;
}

.scr-done .scr-done__tag.is-shown {
  visibility: visible;
  animation: pop-in var(--t-fast) steps(3) both;
}

/* --- the end screen --- */
.scr-done .scr-done__final {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: var(--win-max);
  text-align: center;
}

.scr-done .scr-done__final:not(.is-ready) > :not(.scr-done__heart) {
  visibility: hidden;
}

.scr-done .scr-done__final.is-ready > :not(.scr-done__heart) {
  animation: fade-in var(--t-med) steps(4) both;
}

.scr-done .scr-done__heart {
  display: grid;
  place-items: center;
  width: 99px;
  height: 88px;
  margin-bottom: 6px;
}

.scr-done .scr-done__heart.is-waiting {
  visibility: hidden;
}

/* ink outline on the light screen; on the dark screen it would vanish, so there it is dark pink */
.scr-done .scr-done__heart .scr-done__heart-off,
.scr-done.screen.is-off .scr-done__heart .scr-done__heart-on {
  display: none;
}

.scr-done.screen.is-off .scr-done__heart .scr-done__heart-off {
  display: block;
}

/* lub-dub: whole art pixels only (9, 11, 10 px per pixel), so the heart stays crisp */
.scr-done .scr-done__heart svg {
  width: 81px;
  height: 72px;
  animation: scr-done-beat calc(1100ms / var(--speed)) steps(1, end) infinite;
}

@keyframes scr-done-beat {
  0% { width: 81px; height: 72px; }
  12% { width: 99px; height: 88px; }
  24% { width: 81px; height: 72px; }
  36% { width: 90px; height: 80px; }
  48%, 100% { width: 81px; height: 72px; }
}

.scr-done .scr-done__bye {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--fs-l);
  line-height: 1.1;
  text-transform: uppercase;
}

.scr-done .scr-done__byesub {
  margin: 0;
  font-size: var(--fs-m);
}

.scr-done .scr-done__btns {
  margin-top: 14px;
}

.scr-done .scr-done__btns .btn {
  min-width: 132px;
}

/* the quiet way back to the hand-off */
.scr-done .scr-done__resend {
  min-height: var(--tap);
  margin-top: 6px;
  padding: 4px 8px;
  font-size: var(--fs-s);
  line-height: 1.25;
}

.scr-done.screen.is-off .scr-done__resend {
  color: var(--lav);
}

/* dark: the switched-off monitor (with faint scanlines) */
.scr-done.screen.is-off {
  background-color: var(--ink);
  background-image: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0 3px, transparent 3px 6px);
}

.scr-done.screen.is-off .scr-done__win {
  display: none;
}

.scr-done.screen.is-off .scr-done__bye {
  color: var(--pink);
}

.scr-done.screen.is-off .scr-done__byesub {
  color: var(--lav-l);
}

.scr-done.screen.is-off .scr-done__btns .btn {
  box-shadow: var(--sh) var(--sh) 0 0 var(--lav-d);
}

.scr-done.screen.is-off .scr-done__btns .btn:active {
  box-shadow: none;
}

@media (min-width: 768px) {
  .scr-done .scr-done__heart {
    width: 126px;
    height: 112px;
  }

  .scr-done .scr-done__heart svg {
    width: 108px;
    height: 96px;
    animation-name: scr-done-beat-big;
  }

  .scr-done .scr-done__bye {
    font-size: var(--fs-xl);
  }
}

@keyframes scr-done-beat-big {
  0% { width: 108px; height: 96px; }
  12% { width: 126px; height: 112px; }
  24% { width: 108px; height: 96px; }
  36% { width: 117px; height: 104px; }
  48%, 100% { width: 108px; height: 96px; }
}

/* light: FEATURES.shutdown off, the heart sits under the window */
.scr-done.screen.is-light .scr-done__final {
  padding: 8px 0;
}

/* --- the switch-off overlay on <body> --- */
.scr-done.scr-done-tv {
  position: fixed;
  inset: 0;
  z-index: 80;
  overflow: hidden;
  pointer-events: none;
}

.scr-done .scr-done-tv__beam {
  position: absolute;
  box-shadow: 0 0 0 200vmax var(--ink);
}

/* after the switch-off: a dark strip over the taskbar, so the whole display reads as "off"
   (instantly dark: it takes over from the beam's dark surroundings without a flash) */
.scr-done.scr-done-tv.is-strip {
  bottom: auto;
  background-color: var(--ink);
  background-image: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0 3px, transparent 3px 6px);
}

/* --- the restart dialog: stacked buttons --- */
.scr-done.scr-done__rdlg .btn-row {
  flex-direction: column;
  align-items: stretch;
}

/* --- the voucher dialog --- */
.scr-done.scr-done__vdlg .dialog__text {
  font-size: var(--fs-s);
}

.scr-done .scr-done__voucher {
  background: var(--paper);
  border: var(--bw) solid var(--ink);
  box-shadow: 3px 3px 0 0 var(--ink);
}

.scr-done .scr-done__vhead {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding: 8px;
  font-family: var(--font-ui);
  font-size: var(--fs-s);
  line-height: 1.2;
  text-transform: uppercase;
  background: var(--pink);
  border-bottom: var(--bw) dashed var(--ink);
}

.scr-done .scr-done__vrows {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 12px;
  align-items: baseline;
  margin: 0;
  padding: 10px 12px;
}

.scr-done .scr-done__vrows dt {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  line-height: 1.3;
  text-transform: uppercase;
}

.scr-done .scr-done__vrows dd {
  margin: 0;
  font-size: var(--fs-s);
  line-height: 1.3;
}

.scr-done .scr-done__redact {
  display: inline-block;
  padding: 0 3px;
  color: var(--ink);
  background: var(--ink);
  letter-spacing: 0;
  -webkit-user-select: none;
  user-select: none;
}

.scr-done .scr-done__vfoot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 12px;
  font-size: var(--fs-xs);
  line-height: 1.3;
  background: var(--lav-l);
  border-top: var(--bw) dashed var(--ink);
}
