/* O mesmo enquadramento da porta fechada mantém o zoom consistente. */
.locked-door {
  height: auto;
  aspect-ratio: .82;
  background: linear-gradient(#0000, #0009), url('assets/locked-door-v1.png') center 48% / cover no-repeat;
}
.unlock-card {
  text-align: center;
  margin: auto;
  max-width: 570px;
  padding-top: 15px;
}
.unlock-card h1 { font-size: clamp(2.6rem, 11vw, 4.1rem); }
.unlock-card > p:not(.overline) {
  font: 600 1.15rem/1.3 var(--serif);
  max-width: 370px;
  margin: 15px auto;
}

/* Na transição aparece a ilustração da porta já aberta, em uma única imagem. */
.open-door {
  overflow: hidden;
  position: relative;
  isolation: isolate;
  height: auto;
  width: min(100%, 340px);
  aspect-ratio: .82;
  border: 10px solid #695c3e;
  border-radius: 150px 150px 8px 8px;
  background: url('assets/open-door-v1.png') center 48% / cover no-repeat;
  box-shadow: 0 0 35px #edbe5b77, inset 0 0 0 4px #251c18, 0 9px 26px #0009;
  animation: door-reveal .72s cubic-bezier(.16,.8,.25,1) both;
}
.open-door .door-light {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: radial-gradient(ellipse at 50% 43%, rgba(255, 249, 213, .7) 0%, rgba(255, 225, 151, .32) 38%, transparent 73%);
  opacity: 0;
  transition: opacity .5s ease;
}
.open-door.is-opening .door-light { opacity: 1; }
#open-final:disabled { opacity: .65; cursor: wait; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .open-door .door-light { transition-duration: .01ms; }
}

@keyframes door-reveal {
  from { opacity: .5; transform: scale(.97); filter: brightness(.72); }
  to { opacity: 1; transform: none; filter: brightness(1); }
}

/* As metades recortam a mesma composição, sem repetir a porta. */
.encounter-door {
  overflow: hidden;
  isolation: isolate;
  background: url('assets/chapter-scene.png') center / cover no-repeat;
}
.door-leaf, .encounter-light {
  position: absolute;
  inset: 0;
  display: block;
}
.door-leaf {
  z-index: 2;
  background: linear-gradient(#0000, #0009), url('assets/locked-door-v1.png') center 48% / cover no-repeat;
  transition: transform 1.2s cubic-bezier(.22,.65,.3,1);
}
.leaf-left { clip-path: inset(0 50% 0 0); }
.leaf-right { clip-path: inset(0 0 0 50%); }
.is-opening .leaf-left { transform: translateX(-52%); }
.is-opening .leaf-right { transform: translateX(52%); }
.encounter-light {
  z-index: 1;
  background: radial-gradient(ellipse, #fff2b980, #efbf5c20 65%, transparent);
  opacity: 0;
  transition: opacity .8s;
}
.is-opening .encounter-light { opacity: 1; }
#use-key:disabled { cursor: wait; transform: none; }
.ambient.chapter-scene {
  background: linear-gradient(#06111a15, #06111a65), url('assets/chapter-scene.png') center top / cover no-repeat;
  animation: none;
}
.chapter-letter {
  margin: clamp(260px, 56vh, 550px) auto 0;
  padding: 30px clamp(20px, 5vw, 44px);
  background: linear-gradient(#061c23e8, #061c23f5);
  box-shadow: 0 12px 35px #0006;
  backdrop-filter: none;
}
.chapter-letter:before { display: none; }
@media (prefers-reduced-motion: reduce) {
  .door-leaf, .encounter-light { transition: none; }
}
