/* R9R1: focus the original A2 paper; never paint a second paper over it. */
body[data-stage="A3_BLESSING"] .letter-film {
  inset: auto !important;
  left: 50% !important;
  top: var(--letter-film-top) !important;
  width: var(--letter-film-width) !important;
  height: var(--letter-film-height) !important;
  margin: 0 !important;
  transform: translateX(-50%);
  aspect-ratio: auto;
}
body[data-stage="A3_BLESSING"] .letter-video {
  width: 100% !important;
  height: 100% !important;
  object-fit: fill;
}
body[data-stage="A3_BLESSING"] .letter-vignette {
  height: 100%;
  bottom: 0;
}
body[data-stage="A3_BLESSING"] :is(#letterForm, #mobileLetterForm) {
  display: none !important;
  position: absolute;
  inset: 13.5% auto auto 38.2% !important;
  width: 23.5% !important;
  height: var(--letter-paper-height) !important;
  padding: 5px 6px 7px !important;
  overflow: auto !important;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scroll-padding: 8px;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  transform: none !important;
}
body[data-stage="A3_BLESSING"][data-letter-layout="desktop"] #letterForm.is-visible,
body[data-stage="A3_BLESSING"][data-letter-layout="mobile"] #mobileLetterForm.is-visible {
  display: block !important;
}
body[data-stage="A3_BLESSING"] :is(.letter-form-inner, .mobile-paper) {
  display: flex !important;
  flex-direction: column;
  gap: 5px !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 3px 10px !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
body[data-stage="A3_BLESSING"] :is(.letter-kicker, .paper-field > span, .paper-field input, .paper-field textarea, .visibility, .visibility legend, .seal-button) {
  color: #2d1e16;
  font-size: max(16px, 1rem) !important;
  line-height: 1.3;
}
body[data-stage="A3_BLESSING"] .paper-field { gap: 2px; }
body[data-stage="A3_BLESSING"] :is(.paper-field input, .paper-field textarea) {
  padding: 3px 2px;
  border-bottom-color: rgba(64, 38, 25, .5);
}
body[data-stage="A3_BLESSING"] .paper-field textarea { min-height: 3.625em !important; height: 3.625em !important; }
body[data-stage="A3_BLESSING"] :is(.paper-field small, .form-status, .letter-scroll-hint) { font-size: max(14px, .875rem) !important; }
body[data-stage="A3_BLESSING"] .letter-scroll-hint { margin: 0; color: #493121; text-align: center; line-height: 1.4; }
body[data-stage="A3_BLESSING"] .visibility { gap: 1px; }
body[data-stage="A3_BLESSING"] .visibility label { min-height: 27px; }
body[data-stage="A3_BLESSING"] .seal-button {
  width: min(220px, 92%);
  min-height: 44px;
  padding: 7px 14px !important;
  color: #fff7e7 !important;
}
body[data-stage="A3_BLESSING"] :is(input, textarea, button):focus-visible { outline: 2px solid #79283e; outline-offset: 1px; }
body[data-stage="A3_BLESSING"] .reveal-step { animation: none !important; opacity: 1; transform: none; }

@media (orientation: landscape) and (max-height: 560px) and (max-width: 1000px) {
  body[data-stage="A3_BLESSING"] :is(.letter-kicker, .paper-field > span, .paper-field input, .paper-field textarea, .visibility, .visibility legend, .seal-button) {
    font-size: max(16px, 1rem) !important;
  }
  body[data-stage="A3_BLESSING"] .paper-field textarea { min-height: 3em !important; height: 3em !important; }
  body[data-stage="A3_BLESSING"] .visibility label { min-height: 25px; }
  body[data-stage="A3_BLESSING"] .seal-button { min-height: 44px; }
}

.r9r1-media-retry {
  position: fixed; z-index: 10000; inset: 0;
  display: grid; place-content: center; gap: 16px;
  padding: 24px; background: rgba(8, 4, 4, .88); color: #fff1d8;
  text-align: center; font-size: 18px;
}
.r9r1-media-retry[hidden] { display: none !important; }
.r9r1-media-retry button {
  min-height: 48px; padding: 10px 22px; color: inherit;
  background: #6b2335; border: 1px solid #d6b47b; font: inherit; cursor: pointer;
}

/* Closing curtain travels down as one full-width surface. */
.r9-finale-curtain i:first-child { width: 100%; left: 0; transform: translateY(-102%); }
.r9-finale-curtain i:last-child { display: none; }
.finale-performance-panel.is-curtain-closing .r9-finale-curtain i:first-child { transform: translateY(0); }

@media (max-width: 760px) {
  body[data-stage] #trilogyNavigation button {
    font-size: 15px; min-height: 44px; max-width: 46%;
    white-space: normal; line-height: 1.35;
  }
  body[data-stage="CHAPTER_MENU"] #chapterMenu .story-board__title {
    font-size: 14px !important; line-height: 1.45; white-space: normal; overflow-wrap: anywhere;
  }
  body[data-stage="CHAPTER_MENU"] #chapterMenu .story-board__eyebrow { font-size: 12px !important; }
}
/* Keep a buffering state explicit without replacing the performance frame. */
.r9r2-media-buffer {
  position: fixed;
  z-index: 10020;
  top: 24%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 32px);
  padding: 12px 16px;
  border: 1px solid #bba078;
  border-radius: 8px;
  background: #211a16;
  color: #fff6e5;
  font-size: 17px;
  line-height: 1.5;
  pointer-events: auto;
}
.r9r2-media-buffer button { flex: none; padding: 8px; color: inherit; background: #453729; border: 1px solid #bba078; border-radius: 4px; font: inherit; cursor: pointer; }
/* R9R2: the full Encore film already contains the actors and physical props. */
.answer-encore.has-started .answer-film-layer.is-active {
  opacity: 1;
  transition: none;
}
.answer-encore.has-started .answer-couple,
.answer-encore.has-started .answer-paths,
.answer-encore.has-started .answer-letter-prop,
.answer-encore.has-started .answer-seat-prop {
  display: none;
}
