/* The flash: a pill that appears under the menu, says its piece, and
   fades. Fixed rather than in the flow, so nothing on the page shifts to
   make room for a sentence that will be gone in a moment. */
@layer components {

.flash {
  position: fixed;
  /* Under the floating menu, which holds the top centre. */
  inset-block-start: calc(4.3rem + env(safe-area-inset-top));
  inset-inline: 0;
  display: flex;
  justify-content: center;
  padding-inline: 1rem;
  /* A word is not a door: it never intercepts a tap meant for the page
     underneath it. */
  pointer-events: none;
  z-index: 70;
}
.flash__word {
  margin: 0;
  max-inline-size: min(90vw, 28rem);
  padding: 0.65rem 1.3rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 8px 30px oklch(var(--lch-ink) / 28%);
  /* Held long enough to read, then gone — and the fade's end is what
     removes it from the document. */
  animation: appear-then-fade 4s 200ms both;
}
.flash__word--alert { background: var(--alert); color: var(--paper-high); }

}

/* Opacity only, so it stays honest under reduced motion — and it must
   keep running there regardless, since its end is what clears it away. */
@keyframes appear-then-fade {
  0%, 100% { opacity: 0; }
  6%, 72% { opacity: 1; }
}
