:root {
  color-scheme: dark;
  background: #000;
  color: #fff;
  font-family: system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
main {
  width: min(96vw, 1300px, max(640px, 144svh));
  margin: 0 auto;
  padding: clamp(12px, 5svh, 52px) 0 16px;
}
.stage {
  position: relative;
  isolation: isolate;
}
.stage img { display: block; width: 100%; height: auto; }
#caption:empty, #notice:empty { display: none; }
#caption {
  position: absolute;
  top: var(--y, 77%);
  left: clamp(20%, var(--x, 50%), 80%);
  transform: translate(-50%, -50%);
  width: max-content;
  max-width: 39%;
  padding: .18em .38em;
  border-radius: .2em;
  background: rgb(0 0 0 / 88%);
  text-shadow: 0 1px 3px #000;
  text-align: center;
  font-weight: 750;
  font-size: clamp(15px, 2.4vw, 28px);
  line-height: 1.24;
  overflow-wrap: anywhere;
}
#caption.narrator {
  left: 50%;
  width: min(88%, 31ch);
  max-width: none;
  line-height: 1.36;
  white-space: pre-line;
  font-family: Georgia, serif;
  font-weight: normal;
}
.interaction { margin: 0 auto; width: min(94%, 760px); }
#choices { padding: .6rem 0 .25rem; }
button {
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
button:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.choice {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: .55rem .6rem .55rem 1.55rem;
  text-align: left;
  position: relative;
  color: #ffdd62;
  font-size: clamp(16px, 2.1vw, 22px);
  line-height: 1.35;
}
.choice::before { content: "›"; position: absolute; left: .45rem; }
.choice:hover, .choice:focus-visible { color: #fff3b0; text-decoration: underline; }
#controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .15rem .75rem;
  margin-top: .5rem;
  color: #bbb;
}
#controls button { min-height: 44px; padding: 0 .45rem; text-decoration: underline; }
dialog {
  width: min(92vw, 560px);
  max-height: 82svh;
  color: #eee;
  background: #111;
  border: 1px solid #666;
  padding: 1rem 1.25rem;
  line-height: 1.5;
}
dialog::backdrop { background: rgb(0 0 0 / 78%); }
dialog form { display: flex; justify-content: end; }
dialog button { min-height: 44px; text-decoration: underline; }
dialog li { margin-block: .45rem; white-space: pre-line; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
@media (max-width: 550px) {
  main { width: 100%; padding-top: clamp(16px, 7svh, 45px); }
  #caption.narrator {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: min(94%, 33ch);
    margin: .55rem auto 0;
    font-size: 19px;
  }
}
