#conversation {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: auto;
  background: #a7b587;
  color: #2c4638;
  box-shadow: none;
}
#conversation::backdrop {
  background: #233c30;
}
.conversation-scene {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(400px, 1.15fr);
  align-items: center;
  gap: 4vw;
  padding: 7vh 6vw;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(
    165deg,
    #d6ddba 0%,
    #bdc99d 55%,
    #94aa77 55.3%,
    #9aaf7f 74%,
    #7f986e 74.3%
  );
}
#conversation[data-character="bramble"] .conversation-scene {
  background: linear-gradient(
    165deg,
    #d6dfbd 0%,
    #afc7a6 52%,
    #83b3b3 52.3%,
    #a7cdbe 70%,
    #8ba473 70.3%
  );
}
.conversation-sun {
  position: absolute;
  z-index: -1;
  width: 31vw;
  height: 31vw;
  max-width: 420px;
  max-height: 420px;
  top: -10vw;
  left: 12vw;
  background: #f7edb7;
  border-radius: 50%;
  opacity: 0.75;
}

.conversation-portrait {
  width: 100%;
  max-width: 530px;
  height: auto;
  align-self: end;
  justify-self: center;
  filter: drop-shadow(0 8px 0 #36563512);
}
.conversation-close {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  right: 22px;
  width: 46px;
  height: 46px;
  border: 1px solid #54715055;
  background: #f8f5df;
  color: #355441;
  border-radius: 50%;
  font-size: 28px;
  z-index: 2;
}
.conversation-card {
  position: relative;
  width: 100%;
  max-width: 670px;
  background: #faf5df;
  border: 3px solid #78845b;
  outline: 6px solid #f2e7c277;
  border-radius: 14px;
  padding: 42px 32px 26px;
  box-shadow: 0 10px 0 #45603922;
}
.conversation-name {
  position: absolute;
  left: 25px;
  top: -25px;
  min-width: 120px;
  background: #345641;
  color: #fff2ce;
  border: 3px solid #f5e7b9;
  border-radius: 8px;
  padding: 7px 24px;
  font-family: Fraunces, Georgia, serif;
  font-weight: 700;
  font-size: 28px;
}

#conversation-text {
  font-size: clamp(17px, 1.55vw, 22px);
  line-height: 1.6;
  white-space: pre-line;
  margin: 0 0 25px;
  color: #374b3b;
}
.conversation-choices {
  display: grid;
  gap: 10px;
}
.conversation-choice {
  min-height: 50px;
  text-align: left;
  background: #eae8cb;
  color: #35543e;
  border: 1px solid #c3c8a1;
  border-radius: 8px;
  padding: 12px 18px;
  font:
    600 16px "DM Sans",
    sans-serif;
  cursor: pointer;
}
.conversation-choice:first-child {
  background: #345641;
  color: #fff6da;
  border-color: #345641;
}
.conversation-choice::before {
  content: "▸";
  margin-right: 12px;
  color: #c4a758;
}
.conversation-choice:focus-visible,
.conversation-close:focus-visible {
  outline: 3px solid #b57732;
  outline-offset: 3px;
}
.conversation-choice:hover {
  filter: brightness(1.06);
}
.detector-status {
  position: absolute;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: #faf5dff5;
  color: #37543b;
  border: 2px solid #bbbc92;
  border-radius: 18px;
  padding: 12px 16px;
  box-shadow: 0 4px 16px #203f3826;
  pointer-events: none;
  white-space: nowrap;
}
.detector-icon { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.detector-readout { display: grid; gap: 6px; min-width: 136px; }
.detector-bars { display: flex; align-items: end; gap: 4px; height: 24px; }
.detector-bars i { width: 13px; height: 100%; border-radius: 3px; background: #d5d9c4; }
.detector-bars i:nth-child(-n+2) { height: 40%; }
.detector-bars i:nth-child(n+3):nth-child(-n+4) { height: 60%; }
.detector-bars i:nth-child(n+5):nth-child(-n+6) { height: 80%; }
.detector-bars i.lit { background: #688449; }
.detector-label { font-size: 12px; font-weight: 650; line-height: 1.2; }
.detector-status[data-signal="strong"] .lit { background: #b57a20; }
.detector-status[data-signal="ready"] { border-color: #365c43; background: #fff0b9; color: #254b37; }
.detector-status[data-signal="ready"] .lit { background: #365c43; }
@media (max-width: 700px) {
  .conversation-scene {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 55px 17px max(22px, env(safe-area-inset-bottom));
    align-content: center;
    overflow: visible;
  }

  .conversation-portrait {
    width: min(67vw, 280px);
    max-height: 33dvh;
    object-fit: contain;
    margin: 0 auto 11px;
    align-self: center;
  }
  .conversation-card {
    padding: 30px 20px 18px;
    border-width: 2px;
    outline-width: 4px;
    border-radius: 10px;
  }
  .conversation-name {
    font-size: 23px;
    top: -22px;
    left: 18px;
    padding: 5px 20px;
    min-width: 100px;
  }
  #conversation-text {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 18px;
  }

  .conversation-choice {
    font-size: 14px;
    padding: 10px 13px;
    min-height: 47px;
  }
  .conversation-sun {
    width: 240px;
    height: 240px;
    top: -70px;
    left: 20px;
  }
  .detector-status {
    bottom: 160px;
    font-size: 11px;
  }
}
@media (max-height: 550px) and (min-width: 701px) {
  .conversation-scene {
    padding: 40px 5vw 20px;
    grid-template-columns: 30% 1fr;
    gap: 4vw;
  }
  .conversation-card {
    padding: 28px 22px 17px;
  }
  #conversation-text {
    font-size: 15px;
    line-height: 1.4;
    margin-bottom: 12px;
  }
  .conversation-choice {
    min-height: 40px;
    font-size: 14px;
    padding: 8px 12px;
  }

  .conversation-portrait {
    max-height: 78vh;
    object-fit: contain;
  }
}
@media (max-width: 400px) and (max-height: 700px) {
  .conversation-scene {
    padding: 45px 14px 18px;
  }
  .conversation-portrait {
    max-height: 19dvh;
    margin-bottom: 10px;
  }
  .conversation-card {
    padding: 28px 15px 15px;
  }
  #conversation-text {
    font-size: 15px;
    line-height: 1.4;
    margin-bottom: 14px;
  }
  .conversation-choice {
    min-height: 44px;
    font-size: 13px;
  }
}
