.branch-screen {
  --branch-ink: #203b34;
  --branch-accent: #246651;
  isolation: isolate;
  padding: var(--status-height, 42px) 0 calc(27px + env(safe-area-inset-bottom, 0px));
  background: radial-gradient(ellipse at 16% 20%, #fff6c3 0%, #eff7e5 52%, #d4ebdd 100%);
  color: var(--branch-ink);
}

.branch-background {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.branch-screen::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, #f7f8df8f, #eff6e52e 35%, #eaf5e9e6 65%, #e4f2e8);
  content: "";
}

.branch-nav {
  flex: none;
  padding: 6px 14px 0;
}

.branch-return {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding-inline: 8px 12px;
  border: 1px solid #d8e1cc;
  border-radius: 18px;
  background: #fcfff1eb;
  color: #36574a;
  font-size: 12px;
}

.branch-return:hover {
  background: #fffef0;
}

.branch-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  padding: 24px clamp(16px, 6.4cqw, 28px) 6px;
}

.branch-content > :first-child {
  margin-top: auto;
}

.branch-title {
  align-self: flex-start;
  margin: 0 0 10px;
  color: #245042;
  font-family: var(--serif);
  font-size: clamp(28px, 11cqw, 41px);
  line-height: 1.15;
  font-weight: 650;
  text-wrap: balance;
  text-shadow: 0 2px 10px #ffffff87;
}

.branch-title:focus {
  outline: none;
}

.branch-copy {
  margin: 0 0 17px;
  color: #31574b;
  font-size: 13px;
  line-height: 1.72;
  white-space: pre-wrap;
}

.branch-options {
  display: grid;
  flex: none;
  gap: 8px;
  width: 100%;
}

.branch-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 49px;
  padding: 10px 12px 10px 14px;
  border: 1px solid #a8c7b1;
  border-radius: 12px;
  background: #fffff3ed;
  color: var(--branch-accent);
  box-shadow: 0 3px 12px #27594a17;
  text-align: left;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
}

.branch-option:hover {
  border-color: #5d9671;
  background: #f3ffed;
}

.branch-option svg {
  flex: none;
}

.clue-gate {
  flex: 0 1 auto;
  max-height: 37%;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 8px 11px 10px;
  border-top: 1px solid #d1e4d7;
  background: #f0f7ed;
}

.clue-gate h3 {
  margin: 0 0 5px 3px;
  color: #365d49;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .02em;
}

.clue-links {
  display: grid;
  gap: 5px;
}

.clue-link {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid #c4deca;
  border-radius: 7px;
  background: #fbfff6;
  color: #2d654b;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
}

.clue-link:hover {
  background: #e6f2e4;
}

.chat-screen .choices .branch-reopen {
  min-height: 39px;
  background: #d8efdf;
  border-color: #a0c8ad;
  color: #255840;
}

.narration-screen {
  isolation: isolate;
  padding: var(--status-height, 42px) 0 calc(27px + env(safe-area-inset-bottom, 0px));
  background: #f5f5e5;
  color: #244139;
}

.narration-background {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .51;
  object-fit: cover;
}

.narration-screen::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, #f6f8e834, #fbfff184 42%, #faf7e76b);
  content: "";
}

.narration-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  display: grid;
  justify-items: center;
  align-content: safe center;
  gap: 16px;
  padding: 18px clamp(15px, 7cqw, 28px) 14px;
  text-align: center;
}

.narration-title,
.narration-copy {
  margin: 0;
  text-shadow: 0 1px 7px #ffffffb0;
}

.narration-title {
  font: 650 clamp(22px, 8cqw, 31px)/1.2 var(--serif);
  text-wrap: balance;
}

.narration-copy {
  max-width: 33ch;
  color: #29483f;
  font-size: clamp(15px, 4.7cqw, 17px);
  font-weight: 550;
  line-height: 1.85;
  white-space: pre-wrap;
}

.narration-copy:focus {
  outline: none;
}

.narration-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid #a7c8ad;
  border-radius: 19px;
  background: #fdfff0e8;
  color: #336650;
  font-size: 13px;
  font-weight: 650;
}

.narration-next:hover {
  background: #ebf9e3;
}

.narration-next svg {
  width: 15px;
  height: 15px;
}

@media (max-height: 580px) {
  .branch-content {
    padding-block-start: 15px;
  }

  .branch-title {
    margin-bottom: 5px;
  }

  .branch-copy {
    margin-bottom: 10px;
  }

  .branch-option {
    min-height: 43px;
  }
}
