@charset "UTF-8";

:root {
  color-scheme: dark;
  --ink: #171a19;
  --ink-soft: #252b29;
  --paper: #e9e5d8;
  --paper-bright: #f7f4e9;
  --muted: #a4aaa2;
  --accent: #c5d5b6;
  --line: rgba(224, 230, 216, .18);
  --serif: "Noto Serif SC", "Songti SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-family: var(--sans);
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: var(--ink); }
body { color: var(--paper); overflow-x: hidden; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; cursor: pointer; }
button:disabled { cursor: default; opacity: .38; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
button { -webkit-user-select: none; user-select: none; }
button, input, select, textarea { font-size: 16px; }
img { -webkit-user-drag: none; user-select: none; }
::selection { color: var(--ink); background: var(--accent); }

#start-screen {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  padding: max(30px, env(safe-area-inset-top)) max(5.8vw, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(5.8vw, env(safe-area-inset-left));
  background: radial-gradient(ellipse at 28% 47%, #3c4640 0, #252e29 34%, #1b211e 67%, #171c19 100%);
}
#start-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .16;
  background-image: repeating-linear-gradient(0deg, transparent 0 3px, rgba(221, 229, 208, .05) 4px 4.5px), repeating-linear-gradient(90deg, transparent 0 5px, rgba(221, 229, 208, .04) 6px 6.5px);
}
.cover-header, .cover-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.cover-header { width: 100%; margin-inline: auto; max-width: 1440px; }
.wordmark { display: inline-flex; align-items: center; gap: 11px; font-family: var(--serif); font-size: 16px; letter-spacing: .14em; }
.paper-mark { display: inline-block; width: 20px; height: 23px; border: 1px solid #a8b19b; transform: rotate(-8deg); }
.paper-mark::after { content: ""; display: block; width: 6px; height: 6px; margin: -1px -1px 0 auto; background: var(--ink-soft); border-left: 1px solid #a8b19b; border-bottom: 1px solid #a8b19b; }
.edition { display: inline-flex; gap: 9px; align-items: center; color: #b7bfb0; font-size: 11px; letter-spacing: .13em; }
.edition > span { width: 5px; height: 5px; background: #a7bc91; border-radius: 50%; }
.cover-layout { flex: 1; display: grid; grid-template-columns: 1.12fr 1fr; align-items: center; gap: 9vw; width: min(1100px, 100%); margin: 36px auto 54px; }
.cover-art { position: relative; width: 100%; aspect-ratio: .96; display: grid; place-items: center; }
.cover-art::before { content: ""; position: absolute; width: 85%; height: 84%; border: 1px solid rgba(211, 223, 196, .10); border-radius: 50%; transform: rotate(-18deg); }
.cover-art::after { content: ""; position: absolute; width: 68%; height: 68%; border: 1px solid rgba(211, 223, 196, .055); border-radius: 50%; }
.paper-house { position: relative; z-index: 1; width: 65%; aspect-ratio: .87; transform: rotate(-5deg); filter: drop-shadow(19px 22px 14px rgba(0, 0, 0, .23)); }
.paper-roof { position: absolute; inset: 0 0 52%; background: linear-gradient(135deg, #d5d1bf 0 49.5%, #aaa994 50% 100%); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.paper-wall { position: absolute; inset: 44% 7% 0; background: linear-gradient(103deg, #c5c4b0, #e5e1cc 47%, #cecdb8 48%, #babda8); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 96%); }
.paper-wall::after { content: ""; position: absolute; inset: 0; opacity: .15; background: repeating-linear-gradient(0deg, transparent 0 2px, #636b5e 3px 3.3px); }
.paper-fold { position: absolute; left: 50%; top: 43%; width: 1px; height: 54%; background: rgba(79, 84, 68, .32); transform: rotate(1deg); }
.paper-window { position: absolute; left: 22%; top: 60%; width: 16%; height: 15%; background: #687465; box-shadow: inset 2px 1px 4px rgba(0, 0, 0, .2); }
.paper-window::before, .paper-window::after { content: ""; position: absolute; background: #b2b29d; }
.paper-window::before { top: 0; bottom: 0; width: 2px; left: 50%; }
.paper-window::after { left: 0; right: 0; height: 2px; top: 50%; }
.paper-door { position: absolute; right: 21%; bottom: 1%; width: 18%; height: 31%; background: linear-gradient(95deg, #9c9f89, #b4b69f); border-top: 1px solid #878e7b; border-left: 1px solid #919782; }
.paper-door::after { content: ""; position: absolute; width: 3px; height: 3px; background: #606f5b; border-radius: 50%; right: 18%; top: 50%; }
.paper-shadow { position: absolute; bottom: 14%; left: 19%; width: 65%; height: 9%; background: #111711; border-radius: 50%; filter: blur(13px); opacity: .4; transform: rotate(-5deg); }
.cover-art-caption { position: absolute; bottom: 3%; color: #8f9b89; font-family: var(--serif); font-size: 11px; letter-spacing: .3em; }
.eyebrow { margin: 0 0 18px; font-size: 11px; font-weight: 400; letter-spacing: .23em; color: #a9b79b; }
.cover-copy h1 { display: flex; align-items: flex-start; position: relative; margin: 0 0 23px -6px; font-family: var(--serif); font-size: clamp(64px, 7vw, 100px); font-weight: 400; letter-spacing: .06em; line-height: 1.2; white-space: nowrap; }
.title-seal { display: inline-flex; justify-content: center; align-items: center; margin: 11px 0 0 13px; width: 24px; height: 32px; border: 1px solid #9d7668; color: #bb9786; font-size: 13px; }
.cover-divider { width: 39px; height: 1px; background: #7e8d72; margin-bottom: 27px; }
#start-description { max-width: 340px; color: #b1b8a9; font-size: 14px; line-height: 1.95; letter-spacing: .035em; margin: 0 0 31px; }
.start-actions { display: flex; flex-direction: column; gap: 12px; max-width: 330px; }
.button-primary, .button-secondary { min-height: 56px; width: 100%; border: 1px solid transparent; display: flex; align-items: center; justify-content: space-between; padding: 16px 21px; text-align: left; font-size: 14px; letter-spacing: .08em; border-radius: 2px; transition: background .18s ease, transform .18s ease; }
.button-primary { color: #283023; background: #d0dac2; border-color: #d0dac2; }
.button-primary:hover:not(:disabled) { background: #e2e8d9; transform: translateY(-1px); }
.button-arrow { font-size: 24px; line-height: 1; font-weight: 300; }
.button-secondary { border-color: #535f4d; background: rgba(20, 27, 20, .15); color: #c2cbb8; }
.button-secondary:hover:not(:disabled) { background: #35402e; }
.resume-detail { font-size: 10px; letter-spacing: .03em; opacity: .62; }
.cover-hint { display: flex; align-items: center; gap: 8px; margin: 21px 0 0; color: #8f9c86; font-size: 11px; letter-spacing: .025em; }
.cover-hint span { font-size: 19px; }
.cover-footer { width: 100%; max-width: 1440px; margin: 0 auto; color: #8b9584; font-size: 10px; letter-spacing: .07em; }
.cover-footer p { margin: 0; }
.footer-rule { flex: 1; height: 1px; background: rgba(190, 203, 176, .12); }

#game-screen { width: 100%; height: 100svh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: #121614; }
#stage { flex: 1; min-height: 0; position: relative; isolation: isolate; overflow: hidden; background: radial-gradient(ellipse at center, #364037, #111813); }
#background { position: absolute; inset: 0; z-index: -3; width: 100%; height: 100%; object-fit: contain; transition: opacity .35s ease; }
#background:not([src]), #background[src=""] { opacity: 0; }
.scene-shade { position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(0deg, rgba(10, 17, 12, .24), transparent 45%, rgba(10, 17, 12, .08)); }
#characters { position: absolute; inset: 0; z-index: -2; pointer-events: none; overflow: hidden; }
#characters img { position: absolute; left: 50%; bottom: 0; max-width: 85%; height: 93%; object-fit: contain; transform: translateX(-50%); transform-origin: center bottom; }
#dialogue { position: absolute; display: flex; flex-direction: column; width: min(1000px, calc(100% - 80px)); min-height: 156px; max-height: 46%; left: 50%; bottom: 28px; transform: translateX(-50%); padding: 24px 34px 31px; background: rgba(20, 28, 23, .91); color: var(--paper-bright); border: 1px solid rgba(206, 218, 193, .24); border-radius: 3px; text-align: left; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 12px 45px rgba(0, 0, 0, .2); overflow: auto; -webkit-overflow-scrolling: touch; }
.dialogue-topline { position: absolute; top: 0; left: 34px; width: 47px; height: 2px; background: #b9caa6; }
#speaker { display: block; color: #c6d6b5; margin: 0 0 11px; font-weight: 600; letter-spacing: .12em; font-size: 14px; line-height: 1.4; }
#speaker:empty { display: none; }
#text { display: block; font-size: clamp(16px, 1.5vw, 20px); font-family: var(--serif); line-height: 1.85; letter-spacing: .045em; white-space: pre-wrap; overflow-wrap: break-word; }
#advance-hint { display: flex; align-items: center; gap: 9px; color: #a0ad95; position: absolute; bottom: 11px; right: 20px; font-size: 9px; letter-spacing: .07em; }
.advance-triangle { width: 0; height: 0; border-top: 5px solid #c5d2b7; border-left: 4px solid transparent; border-right: 4px solid transparent; }
#choices { position: absolute; z-index: 3; left: 50%; top: 38%; transform: translate(-50%, -50%); width: min(540px, calc(100% - 48px)); display: flex; flex-direction: column; gap: 12px; }
#choices:empty { display: none; }
#choices > button { width: 100%; padding: 16px 23px; min-height: 56px; border: 1px solid #9aa68d; background: rgba(233, 234, 218, .95); color: #273322; font-family: var(--serif); font-size: 16px; line-height: 1.6; border-radius: 2px; box-shadow: 0 6px 20px #0003; transition: background .15s ease, transform .15s ease; }
#choices > button:hover:not(:disabled), #choices > button:focus-visible { background: #f8f9ed; transform: translateY(-2px); }
#toolbar { display: flex; align-items: center; gap: 4px; padding: 5px max(18px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); min-height: 56px; border-top: 1px solid #a4b39420; background: #182019; }
#toolbar > button { border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 68px; min-height: 44px; padding: 8px 13px; color: #b4c0a9; border-radius: 3px; font-size: 12px; letter-spacing: .035em; }
#toolbar > button:hover { background: #c4d1b512; color: #e1e8d9; }
#toolbar > button[aria-pressed="true"] { color: #e0eccc; }
.toolbar-icon { font-family: var(--sans); font-size: 20px; line-height: 1; font-weight: 300; }
.toolbar-separator { width: 1px; height: 18px; margin-inline: 9px; background: #9faf8f27; }
.toolbar-spacer { flex: 1; }

#status { position: fixed; z-index: 20; pointer-events: none; left: 50%; bottom: max(82px, calc(env(safe-area-inset-bottom) + 69px)); transform: translateX(-50%); max-width: min(560px, calc(100vw - 36px)); margin: 0; border-radius: 4px; color: #edf1e8; background: #243020f5; border: 1px solid #8d9f7c66; padding: 12px 18px; font-size: 13px; line-height: 1.6; text-align: center; box-shadow: 0 6px 24px #0004; }
#status:empty { display: none; }
#busy { position: fixed; inset: 0; z-index: 30; background: #172018e8; display: flex; align-items: center; justify-content: center; gap: 14px; backdrop-filter: blur(6px); font-size: 14px; color: #d8e0cc; }
.spinner { height: 20px; width: 20px; border: 1px solid #87977955; border-top-color: #cfddbd; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

#overlay-dialog { color: #dce4d4; width: min(650px, calc(100vw - 32px)); max-height: min(720px, calc(100svh - 48px)); padding: 0; border: 1px solid #82907466; border-radius: 5px; background: #202a21; box-shadow: 0 25px 80px #0009; }
#overlay-dialog::backdrop { background: #080f0bbb; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.overlay-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 25px 28px 22px; border-bottom: 1px solid #a3b18e29; }
.overlay-header .eyebrow { font-size: 9px; letter-spacing: .14em; margin-bottom: 8px; color: #96a58a; }
.overlay-header h2 { margin: 0; font-family: var(--serif); font-size: 24px; font-weight: 400; letter-spacing: .1em; }
#overlay-close { border: 1px solid #a3b18e29; border-radius: 50%; background: transparent; min-height: 44px; min-width: 44px; font-size: 25px; color: #b7c6a9; }
#overlay-close:hover { background: #afc39815; }
#overlay-content { padding: 24px 28px 30px; overflow-y: auto; max-height: calc(100svh - 175px); font-size: 14px; line-height: 1.9; }
#overlay-content p { margin: 0 0 15px; }
#overlay-content a { color: #d5e5bf; text-underline-offset: 4px; }
#overlay-content button { min-height: 44px; border: 1px solid #a5b69466; border-radius: 2px; padding: 9px 16px; margin: 5px 9px 5px 0; background: #b2c59b17; }
#overlay-content button:hover { background: #b2c59b30; }
.history-entry { padding: 15px 0; border-bottom: 1px solid #a4b39019; }
.history-entry:first-child { padding-top: 0; }
.history-entry:last-child { border-bottom: 0; }
.history-speaker { display: block; color: #b3c4a2; font-weight: 600; font-size: 12px; letter-spacing: .08em; margin-bottom: 5px; }
.history-text { color: #d5ddcc; font-family: var(--serif); font-size: 16px; white-space: pre-wrap; }
.save-slot { display: flex; flex-direction: column; gap: 5px; width: 100%; text-align: left; }
.save-slot small { color: #a5b19b; font-size: 11px; }
.empty-note { color: #9dad91; text-align: center; padding: 24px 10px; }

@media (max-width: 720px) and (orientation: portrait) {
  #start-screen { padding: max(24px, env(safe-area-inset-top)) 27px max(20px, env(safe-area-inset-bottom)); }
  .cover-header { gap: 12px; }
  .wordmark { font-size: 14px; }
  .edition { font-size: 10px; letter-spacing: .04em; }
  .cover-layout { display: flex; flex-direction: column; gap: 20px; margin: 10px auto 29px; max-width: 400px; justify-content: center; }
  .cover-art { width: clamp(175px, 55vw, 265px); aspect-ratio: 1.13; margin-top: 5px; }
  .paper-house { width: 59%; }
  .cover-art-caption { display: none; }
  .cover-copy { width: 100%; }
  .cover-copy > .eyebrow { display: none; }
  .cover-copy h1 { justify-content: center; font-size: clamp(56px, 17vw, 76px); margin: 0 0 13px; }
  .title-seal { width: 19px; height: 27px; font-size: 11px; margin-left: 9px; margin-top: 9px; }
  .cover-divider { margin: 0 auto 17px; width: 29px; }
  #start-description { text-align: center; margin: 0 auto 22px; max-width: 275px; font-size: 12px; line-height: 1.85; }
  .start-actions { max-width: 330px; margin-inline: auto; gap: 10px; }
  .button-primary, .button-secondary { min-height: 52px; font-size: 13px; padding: 14px 18px; }
  .cover-hint { justify-content: center; margin-top: 13px; font-size: 10px; }
  .cover-footer { justify-content: center; flex-wrap: wrap; gap: 7px 14px; font-size: 9px; }
  .footer-rule { flex: 0 0 1px; width: 1px; height: 9px; }
  #stage { background: radial-gradient(ellipse at 50% 35%, #3a453b, #172119 70%); }
  #background { top: 4%; bottom: auto; height: 63%; object-fit: contain; }
  #characters { top: 4%; bottom: 33%; }
  #characters img { max-width: 110%; height: 93%; }
  .scene-shade { background: linear-gradient(0deg, #172119 14%, transparent 57%); }
  #dialogue { bottom: 20px; min-height: 29%; max-height: 43%; width: calc(100% - 30px); padding: 22px 21px 31px; background: rgba(23, 33, 25, .96); border-color: #b7c6a740; }
  .dialogue-topline { left: 21px; width: 34px; }
  #speaker { font-size: 13px; margin-bottom: 10px; }
  #text { font-size: 17px; line-height: 1.95; letter-spacing: .025em; }
  #choices { top: 38%; width: calc(100% - 42px); gap: 10px; }
  #choices > button { padding: 13px 18px; min-height: 52px; font-size: 15px; }
  #toolbar { gap: 0; padding-inline: max(8px, env(safe-area-inset-left)); justify-content: space-around; }
  #toolbar > button { min-width: 55px; padding: 7px 9px; gap: 5px; font-size: 11px; }
  .toolbar-icon { font-size: 18px; }
  .toolbar-separator { margin-inline: 2px; }
  .toolbar-spacer { display: none; }
  .overlay-header { padding: 21px 22px 18px; }
  #overlay-content { padding: 18px 22px 25px; }
}

@media (max-height: 620px) and (orientation: landscape) {
  #start-screen { min-height: 100svh; padding: max(16px, env(safe-area-inset-top)) max(30px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(30px, env(safe-area-inset-left)); }
  .cover-layout { grid-template-columns: 1fr 1.15fr; gap: 6vw; max-width: 900px; margin: 15px auto 20px; }
  .cover-art { max-width: 290px; justify-self: center; }
  .cover-art-caption { font-size: 8px; }
  .eyebrow { margin-bottom: 8px; font-size: 9px; }
  .cover-copy h1 { font-size: 57px; margin-bottom: 10px; }
  .title-seal { height: 24px; width: 18px; margin-top: 8px; font-size: 10px; }
  .cover-divider { margin-bottom: 12px; }
  #start-description { font-size: 11px; margin-bottom: 15px; max-width: 310px; }
  .start-actions { gap: 8px; max-width: 310px; }
  .button-primary, .button-secondary { min-height: 44px; padding: 10px 16px; font-size: 12px; }
  .button-arrow { font-size: 20px; }
  .cover-hint { font-size: 9px; margin-top: 8px; }
  .cover-hint span { font-size: 15px; }
  .cover-footer { font-size: 8px; }
  #toolbar { min-height: 44px; padding-block: 0; padding-bottom: env(safe-area-inset-bottom); }
  #toolbar > button { min-height: 42px; padding-block: 6px; }
  #dialogue { bottom: 13px; width: calc(100% - max(60px, env(safe-area-inset-left) * 2)); padding: 15px 25px 23px; min-height: 107px; max-height: 49%; }
  .dialogue-topline { left: 25px; }
  #speaker { font-size: 12px; margin-bottom: 6px; }
  #text { font-size: 15px; line-height: 1.7; }
  #advance-hint { bottom: 7px; font-size: 8px; }
  #choices { top: 32%; gap: 8px; }
  #choices > button { min-height: 44px; padding: 9px 18px; font-size: 14px; }
}

@media (min-width: 1500px) { #background { object-fit: contain; } }
.chat-header { display:flex; justify-content:space-between; align-items:center; padding:15px 20px; border-bottom:1px solid #ffffff20; color:#eef1e7; font-size:15px; }
.chat-header small { color:#a2b49c; font-size:11px; }
#chat-panel { position:absolute; z-index:4; inset:6% auto 5% 50%; transform:translateX(-50%); width:min(520px,calc(100% - 40px)); display:flex; flex-direction:column; min-height:0; overflow:hidden; background:#202b27f7; border:1px solid #c4d5b744; border-radius:12px; box-shadow:0 16px 60px #0008; }
#chat-messages { flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; padding:17px; display:flex; flex-direction:column; gap:14px; }
.chat-message { display:flex; flex-direction:column; align-items:flex-start; max-width:88%; align-self:flex-start; gap:5px; }
.chat-message.mine { align-self:flex-end; align-items:flex-end; }
.chat-message.with-avatar { position:relative;margin-left:32px;max-width:calc(88% - 32px); }
.chat-message.with-avatar.mine { margin-left:0;margin-right:32px; }
.chat-avatar { position:absolute;left:-36px;top:21px;width:29px;height:29px;border-radius:5px;object-fit:cover; }
.mine .chat-avatar { left:auto;right:-36px; }
.chat-author { font-size:11px; color:#a9b9a1; margin-inline:3px; }
.chat-author:empty,.history-speaker:empty { display:none; }
.chat-time { align-self:center; max-width:100%; }
.chat-time .chat-bubble { padding:2px 8px; background:transparent; color:#9eaf97; font-size:11px; text-align:center; }
.chat-bubble { margin:0; padding:10px 13px; background:#e4e8da; color:#243128; border-radius:2px 11px 11px 11px; font-size:15px; line-height:1.7; white-space:pre-wrap; overflow-wrap:anywhere; }
.mine .chat-bubble { border-radius:11px 2px 11px 11px; background:#bcd3a7; }
.chat-image-button { display:block; padding:0; border:1px solid #c4d5b755; border-radius:8px; background:#17201a; max-width:220px; overflow:hidden; }
.chat-image-button img { display:block; width:100%; height:auto; max-height:240px; object-fit:contain; }
#chat-next { flex-shrink:0; display:flex; justify-content:center; gap:14px; border:0; border-top:1px solid #c4d5b72b; min-height:48px; padding:11px 20px; color:#dce8d2; background:#2d3d31; font-size:13px; }
.history-image { display:block; max-width:min(260px,100%); max-height:260px; object-fit:contain; margin-block:7px; border-radius:5px; }
.image-preview { display:block; max-width:100%; max-height:65svh; margin:auto; object-fit:contain; }
.test-entry-button { display:block; width:100%; text-align:left; }
@media (max-width:720px) and (orientation:portrait) { #chat-panel { inset:15px 15px 16px; transform:none; width:auto; } .chat-image-button { max-width:200px; } }
@media (max-height:620px) and (orientation:landscape) { #chat-panel { top:8px; bottom:8px; width:min(570px,calc(100% - 50px)); } .chat-header { padding:8px 16px; } #chat-messages { padding:12px 18px; } .chat-image-button img { max-height:150px; } #chat-next { min-height:42px; padding:8px 18px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

#text,.chat-bubble,.history-text { font-size:var(--reading-size,17px); }
#dialogue[data-printer="F"] { top:30%;bottom:auto;min-height:0;max-height:40%;text-align:center;align-items:center;background:#15201890;border:0;box-shadow:none; }
#dialogue[data-printer="F"] .dialogue-topline { display:none; }
.title-tools { display:flex; justify-content:center; gap:24px; max-width:330px; margin-top:12px; }
.title-tools button { background:none; border:0; border-bottom:1px solid #a4b68a55; color:#b9c9aa; min-height:44px; font-size:12px; }
.setting-row { display:flex; flex-direction:column; gap:10px; margin:12px 0 24px; }
#retry-button { position:fixed;z-index:50;bottom:20px;left:50%;transform:translateX(-50%);min-height:44px;background:#d0dac2;color:#283023;padding:10px 20px;border:1px solid #9eaf90; }
#scene-continue { position:absolute;z-index:6;bottom:20px;left:50%;transform:translateX(-50%);max-width:calc(100% - 32px);min-height:48px;padding:12px 24px;background:#dce8cd;color:#24301f;border:1px solid #f0f6e7;border-radius:24px;font-size:14px;font-weight:600;box-shadow:0 4px 20px #0005;text-align:center; }
#scene-continue:hover { background:#edf4e3; }
#scene-continue:disabled { opacity:.7;cursor:default; }
#advance-hint { font-size:12px;color:#d4e2c6; }
#overlay-content .media-skip { min-height:48px;padding:12px 24px;background:#dce8cd;color:#24301f;border-color:#f0f6e7;border-radius:24px;font-size:14px;font-weight:600; }
#overlay-content .media-skip:hover { background:#edf4e3; }
#printer-scene { position:absolute;inset:0;z-index:1;overflow:auto;background:#111; }
.printer-illustration { width:100%;height:100%;object-fit:contain;position:absolute;inset:0; }
.printer-text { position:absolute;left:6%;right:6%;bottom:5%;max-height:45%;overflow:auto;white-space:pre-wrap;text-align:left;font-family:var(--serif);font-size:var(--reading-size,17px);line-height:1.9;padding:20px 24px;background:#e9e9dceb;color:#253324;border:1px solid #a9b8a577; }
.setting-row input { width:100%; min-height:40px; accent-color:#c1d2ad; }
.ending-badges { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-bottom:24px; }
.ending-badges span { text-align:center; font-size:11px; padding:8px; border:1px solid #9faf8f27; color:#8c9984; }
.ending-badges .unlocked { color:#d5e6c4; border-color:#a5b69488; }
.memory-grid { display:grid;grid-template-columns:repeat(2,1fr);gap:8px; }
#overlay-content .memory-grid button { margin:0; padding:3px; }
.memory-grid img { display:block;width:100%;aspect-ratio:16/9;object-fit:contain; }
.rain-layer { position:absolute;inset:0;z-index:0;overflow:hidden;pointer-events:none; }
.background-outgoing { position:absolute;inset:0;z-index:-3;width:100%;height:100%;object-fit:contain; }
@media (max-width:720px) and (orientation:portrait) { .background-outgoing {top:4%;bottom:auto;height:63%;} }
.rain-layer i { position:absolute;top:-18%;height:13%;width:1px;background:linear-gradient(transparent,#b4cee5);animation:rainfall .9s linear infinite;transform:rotate(13deg); }
.rain-layer.still i { animation:none;top:30%; }
@keyframes rainfall { to { translate:-15vw 125vh; } }
#overlay-dialog.ending-dialog { width:min(1100px,calc(100vw - 16px));max-height:calc(100dvh - 16px);background:#080808; }
.ending-dialog .overlay-header { padding:10px 20px; }
.ending-dialog .overlay-header .eyebrow { display:none; }
.ending-dialog .overlay-header h2 { font-size:15px; }
.ending-dialog #overlay-content { padding:0;max-height:none;overflow:visible; }
.ending-canvas { position:relative;width:100%;height:min(64svh,580px);overflow:hidden;background:#000;isolation:isolate; }
.ending-video { position:absolute;inset:0;width:100%;height:100%;object-fit:contain;z-index:-1; }
.ending-opening { position:absolute;inset:10% 8%;display:grid;place-items:center;text-align:center;white-space:pre-wrap;font-family:var(--serif);font-size:clamp(16px,2.4vw,28px);line-height:1.9;color:white; }
.ending-scroll { position:absolute;top:0;left:10%;width:80%;white-space:pre-wrap;text-align:center;line-height:1.8;font-family:var(--serif);font-size:clamp(13px,1.7vw,22px);color:white;will-change:transform; }
#overlay-content .ending-note { padding:8px 16px 0;margin:0;font-size:11px;color:#b9c7ae; }
.ending-controls { display:flex;justify-content:center;gap:16px;padding:0 10px 8px; }
@media (max-width:720px) and (orientation:portrait) { .title-tools { margin-inline:auto; } #toolbar .toolbar-separator { display:none; } #toolbar>button { min-width:0;flex:1;gap:3px;padding:8px 3px; } }
@media (max-height:620px) and (orientation:landscape) { .ending-canvas { height:calc(100dvh - 143px); } }
