@charset "UTF-8";

html { font-size: 112.5%; }
:root {
  color-scheme: light;
  --paper: #F6EEDD;
  --ink: #4A3426;
  --ink-2: #5E4636;
  --ink-3: #7A6250;
  --cream: #FFF8EC;
  --accent: #A5552F;
  --muted: var(--ink-3);
  --edge: var(--ink);
  font-family: "Nishiki Teki", "Noto Sans SC", serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: #d9decb; color: var(--ink); font-size: 1rem; line-height: 1.65; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button, summary { -webkit-tap-highlight-color: transparent; }
button { border: 1.5px solid var(--edge); background: transparent; border-radius: 12px; padding: .45rem 1rem; min-height: 44px; }
button:hover { background: #fffaf3; }
button:active { filter: brightness(.95); }
button { transition: background-color 120ms ease, border-color 120ms ease; }
button:focus-visible, summary:focus-visible { outline: 3px solid #536538; outline-offset: 4px; }
p, h1, h2 { margin: 0; }
h1, h2 { font-size: 1.05rem; font-weight: 600; }
h1, .daybar, .choice, .continue-button, .speech p { font-family: "Nishiki Teki", "Noto Sans SC", serif; font-weight: 400; letter-spacing: 0; }
.wordmark { font-size: 1.55rem; }
h1:focus, .clue-result:focus { outline: none; }
.game-shell { width: min(100% - 1.5rem, 430px); margin: .75rem auto; padding-bottom: max(.75rem, env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 .2rem .35rem; }
.topbar nav { display: flex; gap: .2rem; }
.topbar button { display: grid; place-items: center; background: transparent; border: none; width: 44px; height: 44px; padding: 0; color: var(--ink); }
.daybar { display: flex; justify-content: space-between; margin: 0 .35rem .55rem; color: var(--ink-2); font-size: .95rem; }
.encounter, .ending { background: #fff9ef; border: 1px solid #e4d8c4; border-radius: 22px; padding: .85rem .85rem 1rem; }
.scene-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .15rem .35rem .65rem; }
.stage { background: transparent; border: 0; overflow: hidden; display: flex; flex-direction: column; }
.scene-placeholder { position: relative; width: 100%; aspect-ratio: 3 / 4; flex: none; overflow: hidden; border-radius: 16px; background: #e7dccb; }
.scene-reading { position: absolute; top: .7rem; left: 0; right: 0; display: flex; justify-content: center; padding: 0 .8rem; pointer-events: none; }
.scene-reading > p { margin: 0; padding: .28rem .75rem; border-radius: 14px; background: rgb(30 30 24 / .62); color: #fffdf4; font-size: .84rem; line-height: 1.45; text-align: center; }
.scene-hotspots { position: absolute; inset: 0; pointer-events: none; }
.speech { display: grid; margin: .75rem .15rem 0; padding: .7rem .9rem .8rem; border-radius: 14px; background: #fff; }
.speech-layer { grid-area: 1 / 1; }
.speech-sizer { visibility: hidden; }
.speaker { display: block; margin-bottom: .15rem; color: var(--ink-3); font-size: .82rem; }
.speech p { font-size: 1.05rem; line-height: 1.55; letter-spacing: 0; }
.home-status { margin: .55rem .15rem 0; padding: .55rem .8rem; border-radius: 12px; background: #e7efd8; color: #4d5a3e; font-size: .92rem; }
.occupancy { display: flex; gap: .35rem; }
.occupancy span { padding: .12rem .55rem; border-radius: 999px; background: #f3eadc; color: var(--ink-2); font-size: .8rem; }
.controls { padding: .85rem .15rem 0; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.choice, .continue-button { border-color: #4A3426; background: #4A3426; color: #fffdf8; }
.choice { min-height: 52px; border-radius: 14px; font-size: 1.05rem; letter-spacing: 0; box-shadow: none; }
.speech.is-silent { background: transparent; padding: 0; margin-top: .35rem; }
.choice:hover, .continue-button:hover { border-color: #8D6B52; background: #8D6B52; color: #fffdf8; }
.continue-button { display: block; width: 100%; min-height: 52px; border-radius: 14px; letter-spacing: 0; }
.clue-result { font-size: .9375rem; }
.ending { padding: 1.5rem; }
.ending > h1 { text-align: center; margin: .4rem 0 1.2rem; font-size: 1.2rem; }
.ending-cats { display: grid; gap: .85rem; }
.ending-cats article { background: #e5e8d6; border: 1px solid #bec4a6; border-radius: 12px; padding: 1rem 1.15rem; }
.cat-heading { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.cat-heading span { color: #5d674b; font-size: .875rem; }
.ending-cats p { margin-top: .6rem; }
.ending-actions { display: flex; justify-content: center; gap: .8rem; margin-top: 1.2rem; }
.ending-actions button { flex: 1; }
dialog { color: var(--ink); background: var(--paper); border: 2px solid var(--edge); border-radius: 16px; padding: 1.3rem; width: 470px; max-width: calc(100% - 2rem); max-height: 85dvh; }
#journal-dialog { width: min(100% - 1rem, 420px); padding: .8rem .15rem 1rem; background: var(--paper); border: 1px solid #e4d8c4; overflow: hidden; }
#journal-dialog .dialog-heading { padding: 0 .7rem; }
.album { display: flex; gap: .7rem; overflow-x: auto; overflow-y: hidden; padding: .35rem .7rem .2rem; scroll-snap-type: x mandatory; }
.polaroid { display: flex; flex: 0 0 168px; flex-direction: column; align-items: center; width: 168px; min-height: 0; padding: .35rem .35rem .55rem; border: 3px solid #2c241c; border-radius: 2px; background: #fffdf8; color: var(--ink); font-size: .78rem; line-height: 1.35; letter-spacing: 0; scroll-snap-align: start; }
.polaroid:nth-child(odd) { transform: rotate(-1.5deg); }
.polaroid:nth-child(even) { transform: rotate(1.2deg); }
.polaroid img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #f3ead8; }
.polaroid span:last-child { display: block; width: 100%; margin-top: .35rem; min-height: 2.6em; }
.pin { width: 14px; height: 14px; margin: -.7rem auto .25rem; border: 2px solid #2c241c; border-radius: 50%; background: #e25b78; }
#photo-dialog[open] { display: flex; flex-direction: column; gap: .6rem; width: min(100% - 1rem, 520px); background: transparent; border: 0; padding: 0; }
#photo-dialog::backdrop { background: rgb(20 16 12 / .72); }
#photo-dialog img { width: 100%; height: auto; background: #111; }
#photo-dialog button { align-self: end; background: #fffaf3; }
dialog::backdrop { background: rgb(44 48 30 / .4); }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.dialog-heading button { font-size: .875rem; }
.note { border-top: 1px solid #d7ccb2; padding: .8rem 0; }
.note > span { font-size: .875rem; color: var(--muted); }
.note p { margin-top: .25rem; }
.empty-note, .menu-status { padding: .5rem 0 1rem; }
.menu-status { font-size: .875rem; color: var(--muted); }
#menu-dialog > .choice { width: 100%; }
#restart-dialog > p { margin-top: .5rem; }
.dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 1rem; margin-top: 1.2rem; }
.memories { border: 1px solid #d7ccb2; border-radius: 10px; padding: .7rem; margin-bottom: 1rem; }
.memories summary { cursor: pointer; }
.memories p { font-size: .9375rem; margin-top: .75rem; }
.save-warning { font-size: .875rem; padding: .75rem; background: var(--paper); border-radius: 8px; margin-top: .8rem; }
.action-error { width: min(calc(100% - 2rem), 430px); margin: .75rem auto; padding: .75rem; border-radius: 8px; color: #763c29; background: #fff3e6; }
.action-error:empty { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 520px) {
  .game-shell { width: min(100% - 1rem, 430px); }
}
@media (max-height: 850px) {
  .stage { min-height: 0; }
  .topbar { margin-bottom: .5rem; }
  .controls { padding-top: .7rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

.occupancy { font-variant-numeric: tabular-nums; }
.hotspot { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); pointer-events: auto; min-width: 44px; min-height: 44px; padding: .35rem .85rem; border: 0; border-radius: 999px; background: #3f4a34; color: #fffdf8; font-size: .95rem; letter-spacing: .08em; box-shadow: 0 0 0 3px rgb(255 253 248 / .85); animation: hotspot-pulse 1.4s ease-in-out infinite; }
.hotspot.is-seen, .hotspot[aria-pressed="true"] { animation: none; background: #6d7a5c; }
@keyframes hotspot-pulse { 0%, 100% { box-shadow: 0 0 0 3px rgb(255 253 248 / .9); } 50% { box-shadow: 0 0 0 7px rgb(255 253 248 / .15); } }
.scene-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ending > .occupancy { justify-content: center; }
@media (max-width: 350px) { .scene-heading { padding-inline: 0; } .occupancy span { padding-inline: .5rem; } }

.narration > p { grid-area: 1 / 1; }
.speech-sizer { visibility: hidden; }
.speech.is-silent { background: transparent; }
