.fear-final {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: #101010;
  color: #e4e0d8;
}

.fear-final[open] {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
}

.fear-final::backdrop { background: #101010; }

.fear-final__image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  justify-self: center;
  transform: translateY(30px);
}

.fear-final__return {
  z-index: 1;
  justify-self: center;
  margin: 0;
  padding: 12px 18px max(12px, env(safe-area-inset-bottom));
  border: 0;
  background: transparent;
  color: inherit;
  font: italic 16px/1.4 Georgia, serif;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.8s ease;
}

.fear-final__return:disabled {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: none;
}

.fear-final__return:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: -4px;
}

/* Keep the image's existing height; use the side margin only when it fits. */
@media (min-width: calc(150dvh + 340px)) {
  .fear-final__return {
    justify-self: end;
    margin-right: 8px;
    transform: translateY(-100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fear-final__return { transition: none; }
}
