.ux-sr {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

:where(.journey-button, .outline-button, .home-card, .play-button,
       #send, #start, #overlay button) {
  transition: background-color 160ms ease, border-color 160ms ease,
    box-shadow 160ms ease, transform 100ms ease;
}

:where(.journey-button, .outline-button, .home-card, .play-button,
       #send, #start, #overlay button):not(:disabled):active {
  transform: translateY(1px);
}

:where(#app, #stage, #talk) button:focus-visible,
:where(#app, #stage, #talk) input:focus-visible {
  outline: 2px solid #9fc3d9;
  outline-offset: 3px;
}

#navigation button {
  transition: color 180ms ease, background-color 180ms ease;
}
#navigation button:active { background: #b8923a16; }
#navigation .nav-tab.locked { color: #736b5e; }
#navigation .nav-icon { transition: filter 400ms ease, color 400ms ease; }
#navigation .nav-tab.unlock-glow .nav-icon {
  animation: none;
  transform: none;
  color: var(--brass);
  filter: drop-shadow(0 0 5px #b8923a70);
}
#navigation .nav-tab[data-new="true"]::after {
  content: "";
  position: absolute;
  top: 9px;
  right: calc(50% - 22px);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 0 3px var(--paper);
}

#toast {
  top: 14px;
  bottom: auto;
  padding: 11px 14px;
  font-size: 11px;
  transform: translateY(-3px);
}
#toast.visible { transform: translateY(0); }

#lock-overlay { animation: none; }
#lock-card { animation: none; }

#bgm-toggle {
  width: 44px;
  height: 44px;
}
#feedback-toggle {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: 14px;
  z-index: 4;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid #b8923a88;
  border-radius: 3px;
  background: #2a262288;
  color: #f3ead8;
  font-size: 10px;
  letter-spacing: .04em;
}
#feedback-toggle[aria-pressed="true"] { border-color: #e0c578; }
#screen-home .home-heading { top: max(64px, 8%); }

.ux-frame-wait {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 20px;
  padding: 24px;
  background: var(--paper, #f3ead8);
  color: #514b40;
  text-align: center;
}
.ux-frame-wait::before {
  content: "";
  width: 34px;
  height: 34px;
  border: 1px solid #b8923a99;
  outline: 1px solid #b8923a33;
  outline-offset: 5px;
  border-radius: 50%;
}
.ux-frame-wait p {
  max-width: 24em;
  margin: 0;
  font-size: 12px;
  line-height: 2;
}
.frame-screen iframe.ux-frame-pending {
  opacity: 0;
  pointer-events: none;
}

#stage[data-mode] #message { padding-bottom: 58px; }
#stage[data-mode] #text {
  position: relative;
  padding: 0;
  white-space: pre-wrap;
}
#stage[data-mode] .ux-copy {
  display: block;
  visibility: hidden;
}
#stage[data-mode] .ux-ink {
  position: absolute;
  inset: 0;
}
#stage[data-mode] #next {
  position: absolute;
  right: 16px;
  bottom: 8px;
  min-width: 104px;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid #b8923a80;
  background: transparent;
  color: #65533d;
  font: inherit;
  font-size: 11px;
  letter-spacing: .08em;
  cursor: pointer;
  touch-action: manipulation;
  animation: none;
  transform: none;
}
#stage[data-mode] #next:active { background: #b8923a12; }

#talk #send { min-width: 5em; min-height: 44px; }
#talk #message { font-size: 16px; }
#talk #caption-next:disabled {
  opacity: 1;
  color: inherit;
  cursor: default;
}
#talk[data-reply="waiting"] #voice-state { color: #79643b; }

html[data-ux-visible="false"] *,
html[data-ux-visible="false"] *::before,
html[data-ux-visible="false"] *::after {
  animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  :where(.journey-button, .outline-button, .home-card, .play-button,
         #send, #start, #overlay button):active {
    transform: none;
  }
}
