.d3-scene {
  height: 100%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #30271f;
}
.d3-art,
.d3-plane,
.d3-base,
.d3-performance,
.d3-effect,
.d3-memory {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.d3-art {
  container-type: size;
  overflow: hidden;
}
.d3-plane {
  inset: 0 auto auto 50%;
  width: max(100cqw, calc(100cqh * 941 / 1672));
  aspect-ratio: 941/1672;
  transform: translateX(-50%);
}
.d3-base,
.d3-performance,
.d3-memory {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.d3-plane[data-ready='false'] {
  visibility: hidden;
}
@media (orientation: landscape) and (max-height: 600px) {
  .d3-plane[data-cast='true'] {
    transform: translate(-50%, clamp(calc(100cqh - 100%), calc(39cqh - var(--d3-face-line)), 0px));
  }
}
/* Keep dialogue and the first directed pose together, including on a cold load. */
.d3-scene:has(.d3-plane[data-waiting-portrait='true']) .episode-pane {
  visibility: hidden;
}
.d3-memory {
  opacity: 0;
  animation: d3-memory 2.2s both;
}
.d3-effect {
  opacity: 0;
}
.d3-effect.shutter {
  background: white;
  animation: d3-flash 0.65s both;
  z-index: 5;
}
.d3-polaroid {
  position: absolute;
  top: 22%;
  left: 33%;
  width: 34%;
  aspect-ratio: 4/5;
  border: 9px solid #f8f3e8;
  border-bottom-width: 30px;
  background: #eeeadf;
  box-shadow: 0 5px 20px #3217;
  animation: d3-develop 1.2s ease-out both;
}
.d3-scene .scene-presentation {
  pointer-events: none;
}
.d3-scene .episode-pane {
  pointer-events: auto;
}
.d3-scene:has(.episode-chat, .episode-choices),
.d3-scene[data-story-beat='preview'] {
  --scene-text-top: 43%;
}
/* Choices sit over bright photos (the hanbok rack, the accessory tray). The text
   block carries its own shade, so it stays readable wherever it starts, and on
   short phones it may grow taller so every choice fits on screen. */
.d3-scene .episode-pane:has(.episode-choices) {
  background: linear-gradient(180deg, transparent, #11131785 32px, #111317ad 100px, #111317ba);
}
.d3-scene .episode-pane:has(.episode-choices) :is(.episode-speaker, .episode-dialogue, .episode-narration, .d3-prompt) {
  text-shadow:
    0 1px 2px #111317d9,
    0 0 10px #111317a6;
}
@media (max-height: 800px) {
  .d3-scene:has(.episode-choices) {
    --scene-text-top: 30%;
  }
}
.d3-scene .d3-sheet {
  max-height: calc(100% - 100px);
  background: linear-gradient(180deg, #151719db, #151719f7 36px);
}
/* The birth form scrolls under the teller's face while she waits for a reply. */
.d3-scene[data-story-beat='birth'] .d3-sheet {
  max-height: 55%;
}
.d3-overline {
  color: #eed3a4;
  letter-spacing: 0.15em;
  font-size: 0.65rem;
  font-weight: 650;
  text-transform: uppercase;
}
.d3-note,
.d3-form small,
.d3-end dd {
  font-size: 0.82rem;
  line-height: 1.45;
}
.d3-note,
.d3-form small {
  color: #e2d6c6;
}
.d3-prompt {
  margin: 12px 0 0;
}
.d3-sheet button,
.d3-dialog button,
.d3-four button,
.d3-primary {
  font: inherit;
  cursor: pointer;
}
.d3-sheet button,
.d3-four button,
.d3-end > a.d3-primary {
  display: block;
  width: 100%;
  border: 1px solid #bca48580;
  background: #352c28;
  color: #fff6e9;
  min-height: 42px;
  padding: 9px 11px;
  margin: 5px 0;
  border-radius: 9px;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.3;
}
.d3-sheet button:disabled,
.d3-dialog button:disabled {
  opacity: 0.55;
}
.d3-sheet .d3-primary,
.d3-four button,
.d3-end > a.d3-primary {
  background: #e9d2ac;
  color: #2b2018;
  border-color: #f7e7c7;
  font-weight: 650;
  text-decoration: none;
}
.d3-sheet .d3-link,
.d3-dialog .d3-link {
  background: transparent;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  min-height: 34px;
}
.d3-option-row {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}
.d3-option-row > button:first-child {
  flex: 1;
}
.d3-option-row .d3-hint {
  width: 44px;
  min-height: 44px;
  text-align: center;
  text-decoration: none;
  border: 1px solid var(--episode-line);
  border-radius: 50%;
  background: #171719b3;
}
.d3-option-row small {
  width: 100%;
}
.episode-choice[data-highlighted] {
  border-color: #edce83;
  background: #50452e;
}
.d3-form {
  display: grid;
  gap: 7px;
}
.d3-form label,
.d3-dialog label {
  display: grid;
  gap: 4px;
  font-size: 0.85rem;
}
.d3-form input,
.d3-form select,
.d3-form textarea,
.d3-dialog textarea {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid #b39c80;
  border-radius: 7px;
  padding: 6px 9px;
  background: #fffaf1;
  color: #31251f;
  font: inherit;
  color-scheme: light;
}
.d3-form input[type='checkbox'] {
  width: 20px;
  min-height: 20px;
}
/* The birth details, asked as a conversation: the teller's question, the
   player's last answer said back, and the replies to choose from. The sheet
   keeps one height for every question, so the teller and the room never move. */
.d3-scene[data-story-beat='birth'] .d3-sheet:has(.d3-talk) {
  display: flex;
  flex-direction: column;
  /* Short phones keep enough room for a question and its replies. */
  height: max(44%, 352px);
}
.d3-talk {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.d3-talk p {
  margin: 0;
}
.d3-talk .episode-you {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  margin: 0;
  max-height: none;
}
.d3-sheet .d3-talk .d3-change,
.d3-sheet .d3-talk .d3-aside-action {
  display: inline;
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--episode-gold);
  font: 12px/1.5 'K Hada Sans', Arial, sans-serif;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.d3-sheet .d3-talk .d3-aside-action {
  justify-self: center;
  min-height: 36px;
  color: #e4d3bd;
  font-size: 13px;
  text-decoration-color: #d9b57a99;
}
/* The player's replies look like every other reply in the story. */
.d3-answers {
  display: grid;
  gap: 8px;
  margin-top: auto;
}
.d3-sheet .d3-talk .episode-choice {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 11px 20px;
  border: 1px solid var(--episode-line);
  border-radius: 99px;
  background: #171719b3;
  color: var(--episode-paper);
  font: 17px/1.35 'K Hada Sans', Arial, sans-serif;
  text-align: left;
}
@media (hover: hover) {
  .d3-sheet .d3-talk .episode-choice:not(:disabled):hover {
    border-color: var(--episode-gold);
    background: #32291fd9;
  }
}
/* Two short replies side by side: a time, or not knowing it. */
.d3-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.d3-sheet .d3-talk .d3-pair .episode-choice {
  padding-inline: 12px;
  text-align: center;
}
/* Scroll wheels, as on a phone's date picker: the chosen row sits between two
   fine rules and the rows above and below fade out. */
.d3-wheels {
  --rows: 3;
  position: relative;
  display: grid;
  grid-template-columns: 1.35fr 0.75fr 1fr;
}
.d3-wheels[data-clock='12'] {
  grid-template-columns: 1fr 1fr 1fr;
}
.d3-wheels[data-clock='24'] {
  grid-template-columns: 1fr 1fr;
}
.d3-wheels[data-order='day'] {
  grid-template-columns: 0.75fr 1.35fr 1fr;
}
.d3-wheels::after {
  content: '';
  position: absolute;
  inset: auto 0 calc((var(--rows) - 1) / 2 * 34px);
  height: 34px;
  border-block: 1px solid #d9b57a66;
  pointer-events: none;
}
.d3-wheel {
  display: grid;
  min-width: 0;
}
.d3-wheel-label {
  margin-bottom: 0;
  font-family: 'K Hada Sans', Arial, sans-serif;
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
  color: #eed3a4b3;
}
.d3-wheel-track {
  box-sizing: border-box;
  height: calc(var(--rows) * 34px);
  padding-block: calc((var(--rows) - 1) / 2 * 34px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  text-align: center;
  outline: 0;
  cursor: grab;
  -webkit-mask-image: linear-gradient(180deg, #0000, #0009 18%, #000 34%, #000 66%, #0009 82%, #0000);
  mask-image: linear-gradient(180deg, #0000, #0009 18%, #000 34%, #000 66%, #0009 82%, #0000);
}
.d3-wheel-track:active {
  cursor: grabbing;
}
.d3-wheel-track::-webkit-scrollbar {
  display: none;
}
.d3-wheel-item {
  display: block;
  height: 34px;
  scroll-snap-align: center;
  font: 21px/34px 'K Hada Story', Georgia, serif;
  white-space: nowrap;
  color: #d8cbbb80;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.d3-wheel-item[data-on] {
  color: var(--episode-paper);
}
.d3-wheel-track:focus-visible .d3-wheel-item[data-on] {
  color: var(--episode-gold);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}
/* The birthplace is typed like any other reply. */
.d3-where {
  display: grid;
  gap: 4px;
}
.d3-place-box {
  box-sizing: border-box;
  width: 100%;
  min-height: 50px;
  padding: 12px 18px;
  border: 1px solid #d9b57a88;
  border-radius: 25px;
  background: #171719a6;
  color: var(--episode-paper);
  font: 16px/1.5 'K Hada Sans', Arial, sans-serif;
}
.d3-place-box::placeholder {
  color: #d7cab8;
  opacity: 0.75;
}
/* Focus shows on the box’s own border, like a typed reply. */
.d3-talk .d3-place-box:focus-visible {
  outline: 0;
  border-color: var(--episode-gold);
}
.d3-places {
  max-height: 96px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #d9b57a66 transparent;
}
.d3-sheet .d3-places button {
  display: grid;
  width: 100%;
  min-height: 46px;
  margin: 0;
  padding: 7px 18px;
  border: 0;
  border-bottom: 1px solid #d9b57a2e;
  border-radius: 0;
  background: transparent;
  color: var(--episode-paper);
  font: 15px/1.35 'K Hada Sans', Arial, sans-serif;
  text-align: left;
}
.d3-sheet .d3-places button:is(:hover, :focus-visible) {
  background: #e7bb7c14;
}
.d3-sheet .d3-places button:focus-visible {
  outline-offset: -3px;
}
.d3-places small {
  font-size: 12px;
  color: #bfb2a1;
}
.d3-aside,
.d3-warning,
.d3-fineprint {
  font-family: 'K Hada Sans', Arial, sans-serif;
}
.d3-aside {
  padding: 2px 18px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #cdc0af;
}
.d3-warning {
  font-size: 13px;
  line-height: 1.45;
  color: #ffd2ae;
}
.d3-fineprint {
  font-size: 11.5px;
  line-height: 1.45;
  color: #a99c8b;
}
/* Readings unavailable: the teller's line and a way on. */
.d3-birth {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  font-family: 'K Hada Sans', Arial, sans-serif;
}
.d3-closed {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}
.d3-sheet .d3-birth .episode-continue {
  min-height: 48px;
  margin: 8px 0 0;
  padding: 11px 20px;
  border-color: var(--episode-line);
  border-radius: 99px;
  background: #171719b3;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.06em;
}
/* With the keyboard up there is no room to keep the teller in view. */
.episode-portrait[data-keyboard-open='true'] .d3-scene[data-story-beat='birth'] .d3-sheet {
  height: auto;
  max-height: calc(100% - 64px);
}
.d3-sheet button:focus-visible,
.d3-dialog :focus-visible {
  outline: 3px solid #e9af5b;
  outline-offset: 2px;
}
.d3-look {
  margin: 12px 0 18px;
  background: #f1e6d3;
  color: #3e3026;
  border: 1px solid #b59a74;
  border-radius: 12px;
  overflow: hidden;
}
.d3-look > div {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8%;
  padding: 12px 6px;
  background: radial-gradient(ellipse, #fff9ea, #e8d9bf);
}
.d3-look img {
  height: 145px;
  max-width: 55%;
  object-fit: contain;
}
.d3-look img + img {
  height: 88px;
  max-width: 29%;
}
.d3-look figcaption {
  text-align: center;
  font:
    italic 0.9rem/1.4 Georgia,
    serif;
  padding: 6px;
}
.d3-look.compact {
  margin: 7px 0;
}
.d3-look.compact img {
  height: 65px;
}
.d3-look.compact img + img {
  height: 41px;
}
.d3-look.compact > div {
  padding: 4px;
}
.d3-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  max-height: min(87dvh, 800px);
  width: min(calc(100vw - 28px), 415px);
  max-width: 95vw;
  padding: 22px 24px;
  box-sizing: border-box;
  overflow: auto;
  overscroll-behavior: contain;
  color: #352c26;
  background: #fbf4e7;
  border: 1px solid #c3a578;
  border-radius: 17px;
  box-shadow: 0 20px 80px #160c0859;
  font:
    1rem/1.47 system-ui,
    sans-serif;
}
.d3-dialog[open] {
  animation: d3-modal 0.23s ease-out;
}
.d3-dialog::backdrop {
  background: #23191173;
  backdrop-filter: blur(4px);
}
.d3-dialog header {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}
.d3-dialog h2,
.d3-four h1,
.d3-end h1 {
  font:
    1.9rem/1.12 Georgia,
    serif;
  margin: 4px 0 12px;
}
.d3-dialog p,
.d3-dialog ul {
  margin: 10px 0;
}
.d3-dialog h3,
.d3-dialog h4,
.d3-end h2 {
  font:
    1.15rem/1.25 Georgia,
    serif;
  margin: 16px 0 6px;
}
.d3-dialog button {
  min-height: 38px;
  padding: 7px 10px;
  background: #fffaf0;
  color: #433025;
  border: 1px solid #b9a388;
  border-radius: 7px;
}
.d3-dialog .d3-close {
  font-size: 1.5rem;
  min-width: 36px;
  background: transparent;
  border: 0;
}
.d3-dialog .d3-primary {
  display: block;
  width: 100%;
  background: #483329;
  color: #fff7e5;
  margin: 9px 0;
}
.d3-shop {
  background: repeating-linear-gradient(85deg, #fffbf112 0 2px, #ead7b710 3px 4px), #faf1df;
}
.d3-shop .d3-overline {
  color: #78603c;
}
.d3-shop .d3-seal {
  float: right;
  border: 2px solid #954e3e;
  color: #954e3e;
  padding: 3px;
  font:
    1rem Georgia,
    serif;
  transform: rotate(3deg);
}
.d3-benefit {
  border-block: 1px solid #ceb78e;
  margin: 13px 0;
  padding: 7px 0;
}
.d3-price {
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.d3-price strong {
  font:
    1.8rem Georgia,
    serif;
}
.d3-shop small,
.d3-shop .d3-link {
  display: block;
  text-align: center;
  width: 100%;
}
/* The purchase and "Maybe later" stay in view; the details scroll above. */
.d3-shop {
  padding-bottom: 0;
}
.d3-shop-actions {
  position: sticky;
  bottom: 0;
  margin: 12px -24px 0;
  padding: 6px 24px 10px;
  background: #faf1df;
  border-top: 1px solid #ceb78e;
  box-shadow: 0 -10px 14px -12px #4a321f59;
}
.d3-shop-actions .d3-primary {
  margin: 4px 0 4px;
}
@media (max-width: 400px), (max-height: 760px) {
  .d3-shop {
    padding: 16px 18px 0;
  }
  .d3-shop-actions {
    margin-inline: -18px;
    padding-inline: 18px;
  }
  .d3-shop h2 {
    font-size: 1.6rem;
    margin-bottom: 6px;
  }
  .d3-shop p,
  .d3-shop ul {
    margin: 7px 0;
  }
  .d3-shop ul {
    font-size: 0.93rem;
    line-height: 1.36;
  }
  .d3-shop .d3-benefit {
    margin: 9px 0;
    padding: 5px 0;
  }
}
.d3-catalog {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.d3-catalog img {
  display: block;
  width: 100%;
  height: 67px;
  object-fit: contain;
}
.d3-catalog span {
  font-size: 0.73rem;
}
.d3-tabs {
  display: flex;
  gap: 5px;
}
.d3-tabs [aria-pressed='true'] {
  background: #4a382b;
  color: white;
}
.d3-report h4 {
  text-transform: capitalize;
}
.d3-album-photo {
  max-width: 100%;
}
.d3-end h1 {
  margin-top: 6px;
}
.d3-end {
  font:
    1rem/1.4 Georgia,
    serif;
}
.d3-end a {
  color: #e7cfaa;
}
.d3-end .d3-note {
  font-family: system-ui, sans-serif;
}
.d3-vocab > div {
  display: flex;
  gap: 9px;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid #d6b88940;
  font-family: system-ui, sans-serif;
}
.d3-four {
  height: 100%;
  overflow: auto;
  padding: 100px 24px 30px;
  color: #34281e;
  background: #fbf1df;
}
.d3-inline {
  padding: 8px;
  border-block: 1px solid #d6b88940;
}
.hada-passport {
  position: fixed;
  z-index: 12;
  top: max(5px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 2px 6px;
  padding: 4px 10px;
  background: #2c261ff0;
  color: #f7e4c2;
  border: 1px solid #b59a70;
  border-radius: 9px;
  font:
    600 0.58rem/1.2 system-ui,
    sans-serif;
  letter-spacing: 0.045em;
}
.hada-passport progress {
  width: 100%;
  height: 4px;
  grid-column: span 2;
  accent-color: #d8ba80;
}
@media (max-width: 439px) {
  .hada-passport {
    top: max(12px, env(safe-area-inset-top));
    grid-template-columns: auto;
    justify-items: center;
    gap: 1px;
    padding: 5px 8px;
  }
  .hada-passport progress {
    grid-column: auto;
  }
}
.d3-retry-art {
  position: absolute;
  pointer-events: auto;
  top: 15%;
  left: 12px;
}
@keyframes d3-memory {
  0%,
  100% {
    opacity: 0;
  }
  25%,
  65% {
    opacity: 0.85;
  }
}
@keyframes d3-flash {
  0%,
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@keyframes d3-develop {
  from {
    opacity: 0;
    transform: translateY(40%) rotate(-7deg);
  }
  to {
    opacity: 0.96;
    transform: translateY(0) rotate(-7deg);
  }
}
@keyframes d3-modal {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .d3-dialog[open],
  .d3-polaroid {
    animation: none;
  }
  /* Keep the short opacity fades when the shared shell suspends movement.
     Each decorative cover is already transparent in its settled state. */
  .d3-scene .d3-effect.shutter {
    background: #eee6d5;
    animation: d3-soft 0.6s both !important;
  }
  .d3-scene .d3-memory {
    animation: d3-memory 1.5s both !important;
  }
  @keyframes d3-soft {
    from {
      opacity: 0.2;
    }
    to {
      opacity: 0;
    }
  }
}

.d3-dialog header > h2 {
  flex: 1;
  min-width: 0;
}
.d3-dialog header > .d3-close {
  flex: 0 0 36px;
  width: 36px;
  padding: 0;
  color: #503e2e;
  background: transparent;
}
.d3-fade-cover {
  position: absolute;
  inset: 0;
  z-index: 6;
  background: #080603;
  opacity: 0;
  pointer-events: none;
}


/* The Day 3 ending matches the Chapter 1 and 2 endings: the same fonts, title
   size, labels and pill buttons. The paid Episode 4 button keeps its fill. */
.d3-end {
  font: 17px/1.5 'K Hada Story', 'K Hada Sans', Georgia, serif;
}
.d3-end h1 {
  font: 400 34px/1.15 'K Hada Story', Georgia, serif;
  margin: 10px 0 20px;
}
.d3-end h2 {
  font: 400 21px/1.3 'K Hada Story', Georgia, serif;
  margin: 24px 0 8px;
}
.d3-end .d3-overline {
  margin: 0;
  font: 400 11px/1.6 'K Hada Sans', Arial, sans-serif;
  letter-spacing: 0.23em;
  color: var(--episode-gold);
}
.d3-end .d3-vocab > div,
.d3-end .d3-note,
.d3-end dd {
  font-family: 'K Hada Sans', Arial, sans-serif;
}
.d3-end > button:not(.episode-hint),
.d3-end > a.d3-primary,
.d3-end .d3-inline button:not(.d3-link) {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 16px 0 0;
  padding: 11px 20px;
  border: 1px solid var(--episode-line);
  border-radius: 99px;
  background: #171719b3;
  color: var(--episode-paper);
  font: 12px/1.35 'K Hada Sans', Arial, sans-serif;
  letter-spacing: 0.06em;
  text-align: center;
  text-decoration: none;
}
.d3-end .d3-primary {
  background: #e9d2ac;
  color: #2b2018;
  border-color: #f7e7c7;
  font-weight: 650;
}
.d3-end .d3-inline .d3-link {
  font: 12px/1.5 'K Hada Sans', Arial, sans-serif;
  color: #e4d3bd;
}
.d3-end > .episode-hint {
  width: auto;
  min-height: 44px;
  margin: 4px 0 0;
  padding: 10px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #e4d3bd;
  font: 12px/1.5 'K Hada Sans', Arial, sans-serif;
  text-align: left;
}
@media (hover: hover) {
  .d3-end > button:not(.episode-hint, .d3-primary):not(:disabled):hover {
    border-color: var(--episode-gold);
    background: #32291fd9;
  }
}
