/* 《흙 속에는 밤이 있을까》 — the ending story (src/story.js), same look as the standalone page moru-story/story.css.
   Everything is under .ms so nothing of the garden changes. Fonts: the app's own (Gowun Batang, IBM Plex Sans KR). */
.ms{--ink:#3E2B1C;--ink-2:#6B5440;--paper:#F4ECD6;--green:#4F6B2E;position:fixed;inset:0;z-index:650;box-sizing:border-box;overflow:hidden;color:var(--ink);font-family:var(--f-body,"IBM Plex Sans KR"),system-ui,sans-serif;font-size:15px;line-height:1.5;-webkit-tap-highlight-color:transparent;user-select:none;-webkit-user-select:none;touch-action:manipulation;background:var(--paper)}
.ms [hidden]{display:none !important}
.ms section{position:absolute;inset:0}
.ms-col{position:relative;width:var(--col-w,100%);height:100%;margin:0 auto}
.ms-pic{position:absolute;left:0;top:var(--pic-y,0);width:100%;height:var(--pic-h);overflow:hidden}
.ms-bg{position:absolute;inset:0;width:100%;height:100%;display:block;opacity:0;transition:opacity .45s ease}
.ms-bg.on{opacity:1}
.ms-moru{position:absolute;width:auto;opacity:0;transition:opacity .3s ease;pointer-events:none}
.ms-moru.on{opacity:1}
.ms-cap{position:absolute;left:calc((var(--col-w) - 100vw) / 2);right:calc((var(--col-w) - 100vw) / 2);top:var(--cap-top);bottom:0;background:var(--panel,var(--paper));display:flex;flex-direction:column;padding:10px 20px calc(12px + env(safe-area-inset-bottom,0px))}
.ms-cap.fade::before{content:"";position:absolute;left:0;right:0;bottom:100%;height:56px;background:linear-gradient(to bottom,transparent,var(--panel))}
.ms-hint{margin:0 0 4px;font-size:12.5px;color:var(--ink-2);text-align:center;opacity:.85}
.ms-text{flex:1;width:100%;max-width:520px;margin:0 auto;display:flex;flex-direction:column;justify-content:center;font-size:18.5px;line-height:1.62;letter-spacing:-.005em;word-break:keep-all;overflow-wrap:break-word;text-align:center;min-height:0}
.ms-text .ln{display:block}
.ms-text.speech{font-weight:500;font-size:19.5px;color:#3D5222}
.ms-text.in{animation:ms-in .22s ease}
@keyframes ms-in{from{opacity:.15}to{opacity:1}}
.ms-measure{position:absolute;visibility:hidden;left:-9999px;top:0;display:block}
.ms-nav{display:flex;gap:8px;justify-content:space-between;align-items:center;padding-top:8px;width:100%;max-width:520px;margin:0 auto}
.ms-btn{min-height:46px;min-width:72px;padding:0 14px;white-space:nowrap;border-radius:999px;border:1.5px solid #D7C5A0;background:#FFFBF0;color:var(--ink);font:500 15px/1 var(--f-body,"IBM Plex Sans KR"),system-ui,sans-serif;cursor:pointer;box-shadow:0 2px 0 rgba(120,90,50,.12)}
.ms-btn:disabled{opacity:.38;cursor:default}
.ms-btn.ms-primary{background:#5E7B35;border-color:#4C6629;color:#FFFBF0}
.ms-btn.ms-quiet{border-color:transparent;background:transparent;box-shadow:none;color:var(--ink-2);min-width:0}
.ms-btn:focus-visible{outline:3px solid #A8C77A;outline-offset:2px}
.ms-sound{position:absolute;z-index:20;top:calc(10px + env(safe-area-inset-top,0px));right:calc(10px + env(safe-area-inset-right,0px));display:flex;flex-direction:column;align-items:flex-end;gap:6px}
.ms-music{width:44px;height:44px;border-radius:22px;border:1px solid rgba(255,255,255,.9);background:rgba(255,251,240,.88);color:var(--ink);display:grid;place-items:center;box-shadow:0 2px 6px rgba(80,60,30,.12)}
.ms-music[data-on="false"]{color:var(--ink-2);opacity:.8}
.ms-music[data-status="blocked"]{box-shadow:0 0 0 3px #E9C46A}
.ms-sound-panel{width:220px;padding:10px 12px 8px;border-radius:16px;background:#FFFBF0;border:1px solid #E3D3B0;box-shadow:0 6px 18px rgba(80,60,30,.16);font-size:14px}
.ms-sound-row{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:44px}
.ms-vol input{flex:1;accent-color:#5E7B35;min-width:0}
.ms-switch{position:relative;width:52px;height:32px;border-radius:16px;border:0;background:#CDBF9F;padding:0}
.ms-switch i{position:absolute;top:3px;left:3px;width:26px;height:26px;border-radius:13px;background:#FFFBF0;transition:transform .2s}
.ms-switch[aria-checked="true"]{background:#5E7B35}
.ms-switch[aria-checked="true"] i{transform:translateX(20px)}
.ms-sound-note{margin:2px 0 0;font-size:12.5px;line-height:1.45;color:var(--ink-2);word-break:keep-all}
.ms-sound-note:empty{display:none}
/* start screen: the first picture with the title on its cream ground */
.ms-start-card{position:absolute;left:calc((var(--col-w) - 100vw) / 2);right:calc((var(--col-w) - 100vw) / 2);top:var(--cap-top);bottom:0;background:#F2E8D5;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:0 20px calc(12px + env(safe-area-inset-bottom,0px));text-align:center}
.ms-start-card h1{margin:0;font-family:var(--f-display,"Gowun Batang"),serif;font-weight:700;font-size:27px;letter-spacing:-.01em;color:#3A2716;word-break:keep-all}
.ms-sub{margin:0 0 8px;font-size:14.5px;color:var(--ink-2)}
.ms-start-card .ms-btn{min-width:170px;font-size:16px}
.ms-start .ms-bg{opacity:1}
@media (prefers-reduced-motion: reduce){ .ms-bg,.ms-moru,.ms-switch i{transition:none} .ms-text.in{animation:none} }

.ms *,.ms *::before,.ms *::after{box-sizing:border-box}
.ms h1{text-wrap:balance}
/* inside Pocket Bloom: a close button that is always there (top left; the music button is top right) */
.ms-close{position:absolute;z-index:21;top:calc(10px + env(safe-area-inset-top,0px));left:calc(10px + env(safe-area-inset-left,0px));width:44px;height:44px;border-radius:22px;border:1px solid rgba(255,255,255,.9);background:rgba(255,251,240,.88);color:var(--ink);display:grid;place-items:center;box-shadow:0 2px 6px rgba(80,60,30,.12);cursor:pointer;padding:0}
.ms-close:focus-visible,.ms-music:focus-visible{outline:3px solid #A8C77A;outline-offset:2px}
/* last screen: ‘이전 · 다시 읽기 · 정원으로 돌아가기’ — on narrow phones the garden button takes its own row */
@media (max-width:419px){ .ms-nav.last{flex-wrap:wrap;row-gap:8px} .ms-nav.last [data-ms="finish"]{flex:1 0 100%} .ms-nav.last [data-ms="again"]{flex:1} }
:root[data-motion="reduce"] .ms-bg,:root[data-motion="reduce"] .ms-moru,:root[data-motion="reduce"] .ms-switch i{transition:none}
:root[data-motion="reduce"] .ms-text.in{animation:none}
