:root {
  color-scheme: dark;
  --night: #211723;
  --ivory: #f7efdf;
  --muted: #d5c6b6;
  --ink: #302330;
  --metal: #d6b588;
  --edge: rgba(227,202,162,.48);
  --side: clamp(1.25rem, 6.4vw, 7.75rem);
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif CJK JP", "Noto Serif JP", "MS PMincho", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  font-family: var(--serif);
  color: var(--ivory);
  background: var(--night);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body, h1, h2, h3, p { margin: 0; }
body { min-width: 280px; }
button, a { -webkit-tap-highlight-color: rgba(220,190,150,.22); }
button {
  appearance: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  color: inherit;
}
button, .primary, .secondary, .next { touch-action: manipulation; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .25em; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #ffdaa2;
  outline-offset: 4px;
}
button:disabled, [aria-disabled=true] { cursor: default; opacity: .52; }
::selection { background: #895866; color: white; }
[hidden] { display: none !important; }
noscript { display:block; padding: 2rem; }

.screen {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--night);
}
.screen::before, .screen::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  pointer-events: none;
}
.screen::before {
  background-image: var(--scene, none);
  background-position: var(--scene-x, 64%) var(--scene-y, 42%);
  background-size: cover;
  background-repeat: no-repeat;
}
.title-screen::after {
  background:
    linear-gradient(0deg, rgba(27,17,29,.72), transparent 31%),
    linear-gradient(180deg, rgba(22,14,24,.63), transparent 19%),
    linear-gradient(90deg, rgba(29,19,31,.95) 0%, rgba(33,23,34,.86) 25%, rgba(39,26,39,.59) 44%, rgba(43,27,39,.08) 70%, transparent);
}
.mast {
  position: sticky;
  top: calc(var(--site-top-inset, env(safe-area-inset-top, 0px)) - var(--site-header-inset, env(safe-area-inset-top, 0px)));
  z-index: 2;
  background: linear-gradient(180deg,rgba(28,19,30,.55),rgba(28,19,30,.24) 70%,transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: max(1.2rem, var(--site-header-inset, env(safe-area-inset-top, 0px))) max(var(--side), env(safe-area-inset-right)) .5rem max(var(--side), env(safe-area-inset-left));
}
.imprint {
  display: inline-flex;
  align-items: center;
  gap: .66rem;
  color: #fff5e1;
  white-space: nowrap;
  font-weight: 600;
  font-size: 1.04rem;
  letter-spacing: .15em;
  text-shadow: 0 1px 8px #251824;
}
.imprint::before {
  content: "";
  width: 1.36rem;
  height: .98rem;
  display: inline-block;
  background:
    linear-gradient(24deg, transparent 33%, currentColor 36% 42%, transparent 45%) 0 90% / 48% 65%,
    linear-gradient(-24deg, transparent 33%, currentColor 36% 42%, transparent 45%) 100% 90% / 48% 65%,
    linear-gradient(24deg, transparent 34%, currentColor 38% 44%, transparent 48%) 0 36% / 48% 65%,
    linear-gradient(-24deg, transparent 34%, currentColor 38% 44%, transparent 48%) 100% 36% / 48% 65%;
  background-repeat: no-repeat;
  color: var(--metal);
}
.tools, .title-actions, .dialogue-actions, .end-actions, .modal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
.tools { gap: .35rem 1.25rem; justify-content: end; }
.sound-toggle {
  min-width: 44px;
  min-height: 44px;
  display: inline-grid;
  place-items: center;
  flex: none;
  padding: 0;
  background: transparent;
  color: #fff4df;
  border-radius: .7rem;
}
.sound-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .28rem;
  padding: .3rem .46rem;
  border: 1px solid #bdab97;
  border-radius: 2rem;
  background: #302631;
}
.sound-pill svg { width: 1.12rem; height: 1.12rem; }
.sound-state { min-width: 2.6ch; font: 650 .66rem/1 var(--sans); letter-spacing: .045em; text-align: center; }
.sound-toggle[aria-pressed="true"] .sound-pill { color: #312630; background: #f6e3c5; border-color: #e8ceaa; }
.sound-toggle[aria-pressed="true"] .sound-mute,
.sound-toggle[aria-pressed="false"] .sound-waves { display: none; }
.sound-toggle:active .sound-pill { transform: scale(.95); }
.modal-tools { display: flex; align-items: center; gap: .6rem; flex: none; }
.modal-tools .sound-pill { border-color: #8a7766; }
.utility {
  min-height: 44px;
  padding: .42rem .2rem;
  color: #f5e9d5;
  background: transparent;
  font: 500 .91rem/1.35 var(--sans);
  text-shadow: 0 1px 6px #241825;
  text-decoration: underline;
  text-decoration-color: rgba(241,224,199,.52);
  text-underline-offset: .42em;
  text-decoration-thickness: 1px;
}
.title-content, .end-content {
  position: relative;
  margin: auto 0;
  padding: clamp(3rem, 8vh, 6.75rem) var(--side) max(clamp(3.25rem, 9vh, 7.5rem), env(safe-area-inset-bottom));
  width: min(100%, 53rem);
}
.eyebrow, .scene-label {
  display: flex;
  align-items: center;
  gap: .85rem;
  color: var(--metal);
  font: 500 .9rem/1.55 var(--sans);
  letter-spacing: .105em;
}
.eyebrow::before, .scene-label::before {
  content: "";
  flex: 0 0 2rem;
  height: 1px;
  background: currentColor;
}
.game-title, .end-title {
  margin: clamp(.75rem,2.4vh,1.65rem) 0 1.55rem;
  font-size: clamp(2.85rem,5vw,5.65rem);
  line-height: 1.32;
  font-weight: 550;
  letter-spacing: .025em;
  color: #fff2d9;
  font-feature-settings: "palt";
  text-shadow: 0 2px 24px rgba(30,15,27,.42);
  overflow-wrap: anywhere;
}
.end-title em { font-weight: inherit; font-style: normal; color: #e7bdb4; }
.game-title img {
  display: block;
  width: min(100%, clamp(19rem, 38vw, 35rem));
  height: auto;
}
.intro, .ending-text {
  color: #f6eadd;
  font-size: clamp(1rem,1.35vw,1.18rem);
  line-height: 1.95;
  letter-spacing: .045em;
  max-width: 33em;
  white-space: pre-line;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 8px rgba(32,18,30,.65);
}
.title-actions { gap: .85rem; margin-top: clamp(1.8rem, 5vh, 3.2rem); }
.primary, .secondary, .next {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  padding: .82rem 1.68rem;
  border: 1px solid var(--edge);
  border-radius: 2px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.025rem;
  text-decoration: none;
  text-align: center;
  line-height: 1.48;
  letter-spacing: .065em;
}
.primary {
  color: #382636;
  border-color: #e0cab0;
  background: linear-gradient(115deg, #fff2d6, #e9d0b3);
  box-shadow: 0 4px 18px rgba(22,12,21,.18);
}
.secondary {
  color: #f6e6cc;
  background: rgba(39,24,38,.77);
}
.title-actions .primary { min-width: 13rem; }
.play-screen { --side: clamp(1.25rem,4.5vw,5.5rem); }
.play-screen::after {
  background:
    linear-gradient(180deg, rgba(24,16,27,.69), transparent 25%),
    linear-gradient(0deg, rgba(27,18,29,.88), transparent 51%);
}
.stage {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  flex: 1;
  padding: clamp(8rem,22vh,22rem) max(var(--side), env(safe-area-inset-right)) max(clamp(1.25rem,4vh,3rem), env(safe-area-inset-bottom)) max(var(--side), env(safe-area-inset-left));
}
.dialogue {
  position: relative;
  width: min(100%, 60rem);
  padding: clamp(1.25rem,3vw,2.25rem) clamp(1.35rem,4vw,3rem) clamp(1.1rem,2.5vw,2rem);
  border: 1px solid rgba(225,194,151,.68);
  border-radius: 3px;
  color: #faefdf;
  background: linear-gradient(115deg, rgba(40,26,41,.97), rgba(43,29,43,.94) 65%, rgba(50,34,47,.93));
  box-shadow: 0 .9rem 2.8rem rgba(19,11,22,.23);
}
.scene-label {
  font: 500 .85rem/1.5 var(--sans);
  letter-spacing: .075em;
}
.scene-label::before { flex-basis: 1.4rem; }
.speaker {
  margin-top: .53rem;
  color: #efcfb0;
  font-size: clamp(1.15rem,2.1vw,1.45rem);
  font-weight: 600;
  letter-spacing: .09em;
}
.line {
  white-space: pre-line;
  overflow-wrap: anywhere;
  margin-top: .6rem;
  color: #fff2e7;
  font-size: clamp(1.08rem,1.6vw,1.29rem);
  line-height: 1.93;
  letter-spacing: .025em;
}
.speaker.narration, .narration .speaker {
  font: 500 .9rem/1.55 var(--sans);
  color: #d3bda8;
  letter-spacing: .055em;
}
.line.narration, .narration .line { letter-spacing: .04em; }
.choices {
  display: grid;
  gap: .62rem;
  margin-top: 1.15rem;
}
.choice {
  position: relative;
  min-height: 49px;
  width: 100%;
  padding: .68rem 2rem .68rem 2.25rem;
  text-align: left;
  border: 1px solid rgba(227,202,162,.53);
  border-radius: 2px;
  color: #fff1df;
  background: rgba(238,214,176,.08);
  font-size: 1.03rem;
  line-height: 1.6;
}
.choice::before {
  content: "";
  position: absolute;
  left: .95rem;
  top: calc(50% - .17rem);
  width: .34rem;
  height: .34rem;
  border: 1px solid var(--metal);
  transform: rotate(45deg);
}
.dialogue-actions { justify-content: flex-end; gap: .65rem; margin-top: .7rem; }
.next {
  min-height: 44px;
  padding: .52rem .25rem .52rem 1.4rem;
  border: 0;
  color: #f2d3a6;
  background: transparent;
  font-size: .97rem;
  text-decoration: underline;
  text-decoration-color: rgba(242,211,166,.46);
  text-underline-offset: .4em;
}
.end-screen::after {
  background:
    linear-gradient(180deg, rgba(19,14,22,.65), transparent 24%),
    linear-gradient(90deg, rgba(28,18,31,.97) 0%, rgba(35,21,36,.92) 28%, rgba(40,25,41,.68) 55%, rgba(42,25,42,.12) 85%),
    linear-gradient(0deg, rgba(26,17,29,.77), transparent 42%);
}
.end-content { width: min(100%, 56rem); padding-block: clamp(2rem,5vh,5rem); }
.end-title { font-size: clamp(2.2rem,4vw,3.9rem); margin-bottom: .9rem; }
.book-rec {
  position: relative;
  margin-top: 1.45rem;
  padding: .1rem .2rem .1rem 1.05rem;
  border-inline-start: 2px solid var(--metal);
  max-width: 32rem;
}
.book-rec small { display: block; font: 500 .85rem/1.7 var(--sans); letter-spacing: .065em; color: var(--metal); }
.book-rec a, .book-rec strong, .book-rec h2, .book-rec h3 {
  display: block;
  margin-top: .15rem;
  font-size: 1.1rem;
  line-height: 1.55;
  color: #fff1da;
}
.book-rec p { margin-top: .35rem; font-size: 1rem; line-height: 1.72; color:#e8d7c9; }
.end-actions { margin-top: 1.7rem; gap: .72rem; }
.modal {
  width: min(34rem, calc(100vw - 2rem));
  max-height: min(80vh, 48rem);
  max-height: min(80svh, 48rem);
  padding: 0;
  border: 1px solid #927a67;
  border-radius: 3px;
  color: var(--ink);
  background: linear-gradient(125deg,#f9f0df,#f0e4d4);
  box-shadow: 0 18px 60px rgba(21,10,21,.35);
  overflow: auto;
  overscroll-behavior: contain;
  color-scheme: light;
}
.modal::backdrop { background: rgba(25,15,27,.72); }
.modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem clamp(1.2rem,5vw,2rem);
  border-bottom: 1px solid #cbb6a3;
  background: #f6ebdc;
}
.modal h2 { font-weight: 600; font-size: 1.3rem; letter-spacing: .045em; }
.modal .utility { color: #634653; text-shadow: none; text-decoration-color: #aa898d; }
.modal-body { padding: 1.2rem clamp(1.2rem,5vw,2rem); font-size: 1rem; line-height: 1.85; }
.modal-body p { white-space: pre-line; overflow-wrap: anywhere; }
.record-list { list-style: none; margin: 0; padding: 0; }
.record-list li { padding: .87rem 0; border-bottom: 1px solid #d9cbb9; }
.record-list li:first-child { padding-top: 0; }
.record-list li:last-child { border-bottom: 0; }
.record-list strong { display: block; color: #694452; font-size: .97rem; }
.record-list p { margin-top: .16rem; line-height: 1.76; }
.modal-actions { justify-content: flex-end; gap: .75rem; padding: 0 clamp(1.2rem,5vw,2rem) 1.25rem; }
.modal button:focus-visible, .modal a:focus-visible { outline-color: #79415b; }

@media (hover:hover) {
  .primary:not(:disabled):hover { background: #fff3db; }
  .secondary:not(:disabled):hover, .choice:not(:disabled):hover { background: #674452; border-color: #e6bd8d; }
  .utility:not(:disabled):hover, .next:not(:disabled):hover { text-decoration-color: currentColor; }
  .book-rec a:hover { color: #f2d2a9; }
}
@media (min-width: 800px) and (min-height: 630px) {
  .title-content::after {
    content: "";
    width: 3.75rem;
    height: 1px;
    position: absolute;
    left: var(--side);
    bottom: 1.45rem;
    background: linear-gradient(90deg, var(--metal), transparent);
  }
}
@media (max-width: 740px) {
  :root { --side: clamp(1.3rem,5.5vw,2.6rem); }
  .mast {
    padding-top: max(.5rem, var(--site-header-inset, env(safe-area-inset-top, 0px)));
    padding-bottom: .3rem;
    gap: .55rem;
    align-items: center;
  }
  .imprint { font-size: .99rem; gap: .43rem; }
  .tools { gap: .18rem .8rem; }
  .utility { font-size: .875rem; }
  .title-screen::before, .end-screen::before { bottom: auto; height: 72vh; height: 72svh; }
  .title-screen::after {
    background:
      linear-gradient(180deg, rgba(25,16,28,.67), transparent 15%),
      linear-gradient(0deg, #211723 17%, rgba(33,23,35,.96) 31%, rgba(33,23,35,.7) 45%, rgba(33,23,35,.13) 65%, transparent 79%);
  }
  .title-content {
    margin: auto 0 0;
    padding: clamp(12rem,36vh,30rem) var(--side) max(2rem,calc(env(safe-area-inset-bottom) + 1rem));
    width: 100%;
  }
  .game-title {
    font-size: clamp(2.23rem,8.6vw,3.8rem);
    line-height: 1.35;
    margin: .65rem 0 .85rem;
  }
  .game-title img { width: min(100%, clamp(14rem, 70vw, 20rem)); }
  .eyebrow { font-size: .875rem; gap: .65rem; }
  .eyebrow::before { flex-basis: 1.5rem; }
  .intro, .ending-text { font-size: 1rem; line-height: 1.85; }
  .title-actions { gap: .65rem; margin-top: 1.35rem; }
  .title-actions .primary { min-width: 10rem; }
  .primary, .secondary { padding: .73rem 1.12rem; }
  .play-screen { --side: clamp(.8rem,3.8vw,1.5rem); }
  .play-screen::before { bottom: auto; height: 74vh; height: 74svh; }
  .play-screen::after {
    background:
      linear-gradient(180deg, rgba(26,17,28,.68), transparent 16%),
      linear-gradient(0deg, #211723 10%, rgba(33,23,35,.86) 31%, transparent 65%);
  }
  .stage {
    padding-top: clamp(6rem,26vh,19rem);
    padding-bottom: max(1rem, calc(env(safe-area-inset-bottom) + .4rem));
  }
  .dialogue { padding: 1.1rem 1.15rem .8rem; }
  .line { font-size: 1.07rem; line-height: 1.85; }
  .choice { font-size: 1rem; padding: .65rem 1rem .65rem 2rem; }
  .choice::before { left:.8rem; }
  .choices { gap: .45rem; margin-top: .9rem; margin-bottom: .25rem; }
  .dialogue-actions { margin-top: .15rem; }
  .end-screen::after {
    background:
      linear-gradient(180deg, rgba(25,16,28,.69), transparent 14%),
      linear-gradient(0deg, #211723 39%, rgba(33,23,35,.88) 58%, rgba(33,23,35,.24) 76%, transparent);
  }
  .end-content { margin: auto 0 0; padding: clamp(7rem,25vh,18rem) var(--side) max(1.75rem,calc(env(safe-area-inset-bottom) + 1rem)); }
  .end-title { margin: .66rem 0; }
  .end-actions { margin-top: 1.25rem; }
}
@media (max-width: 370px) {
  .mast { gap: .4rem; }
  .tools { gap: .4rem; }
  .imprint { letter-spacing: .045em; }
  .intro { letter-spacing: .01em; }
  .title-actions .primary { min-width: 8rem; }
  .dialogue { padding-inline: .9rem; }
}
@media (max-height: 550px) and (min-width: 600px) {
  .title-content, .end-content { padding-top: 1.5rem; padding-bottom: 1.5rem; }
  .title-actions { margin-top: 1rem; }
  .game-title img { width: min(100%, 15rem); }
  .game-title { margin-block: .5rem; font-size: clamp(2rem,5.5vw,3rem); }
  .stage { padding-top: 4rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .primary, .secondary, .choice { transition: background-color .16s, border-color .16s; }
  .modal[open] { animation: paper-in .15s ease-out; }
  @keyframes paper-in { from { opacity:0; transform:translateY(.32rem); } to { opacity:1; transform:translateY(0); } }
}
a.imprint {text-decoration:none}
.game-menu {display:grid;gap:.65rem;margin-top:1.1rem}
.game-menu .utility {justify-self:start}
.shelf-entry {font:600 1.09rem/1.6 var(--serif);background:transparent;color:#472238;padding:.45rem 0;text-align:left;text-decoration:underline;text-underline-offset:.32em}
.locked {color:#746669}
.your-choice {padding-left:.8rem!important;border-left:2px solid #957061}
.modal .book-rec :is(p,strong,small) {color:#624353}
.line {min-height:3.8em}
.title-content .intro {text-wrap:balance}
.letter-sheet {position:relative;margin-top:.8rem;padding:clamp(.9rem,2.2vw,1.4rem) clamp(1rem,3.5vw,2.1rem);border-left:3px solid #b89a71;background:linear-gradient(108deg,#f4e8d3,#ecddc6);color:#4e3c39;box-shadow:0 5px 12px #190e1b25}
.letter-sheet .line {color:#4e3c39;margin:0;min-height:0;font-size:clamp(1.01rem,1.55vw,1.2rem);letter-spacing:.07em}
.letter-sheet del {text-decoration-style:double;text-decoration-color:#765956}
.reader-line {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.unwritten {color:transparent}
.waiting-for-actor {visibility:hidden}
.play-screen .speaker {display:table}
.play-screen .dialogue[data-voice="leon"] .speaker {color:#c9def3}
.play-screen .dialogue[data-voice="adele"] .speaker {color:#f6cbbb}
