/* キャンセル界隈 — 縦画面優先（幅320pxから）。静かな色調で、状態に合わせて絵の彩度が少しずつ落ちる */
:root {
  --ink: #2c2a3a; --muted: #6d6878; --paper: #fbf7f0; --line: #e4dccf; --night: #2c2a3a; --accent: #d9776a; --sea: #5f9e8f; --gold: #e3a83b;
  --font: "Hiragino Maru Gothic ProN", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  --pop: cubic-bezier(.2, 1.3, .4, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--night); line-height: 1.7; overflow-x: hidden; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, textarea:focus-visible, input:focus-visible, .line:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.app { max-width: 560px; margin: 0 auto; background: var(--paper); min-height: 100vh; min-height: 100svh; }
.screen { display: none; }
.screen.is-active { display: block; }
.btn { display: block; width: 100%; min-height: 50px; padding: 12px 16px; border: 2px solid var(--ink); border-radius: 14px; background: #fff; font-weight: 800; font-size: 16px; box-shadow: 0 3px 0 var(--ink); transition: transform .1s; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn.primary { background: var(--ink); color: #fff; }
.btn small { display: block; font-size: 12px; font-weight: 700; opacity: .8; }
.link { background: none; border: 0; padding: 8px 6px; text-decoration: underline; text-underline-offset: 4px; font-weight: 700; color: var(--muted); }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
@keyframes inUp { from { transform: translateY(8px); opacity: 0; } }

/* タイトル */
#s-title.is-active { display: flex; flex-direction: column; min-height: 100svh; }
.t-art svg { display: block; width: 100%; height: auto; }
.t-body { padding: 18px 20px 28px; }
.t-brand { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; font-weight: 700; color: var(--muted); }
.t-brand img { border-radius: 4px; }
.t-title { margin: 6px 0 8px; font-size: clamp(32px, 10vw, 44px); line-height: 1.15; letter-spacing: .02em; }
.t-title span { display: block; margin-top: 6px; font-size: .42em; color: var(--accent); letter-spacing: .08em; }
.t-lead { margin: 0 0 16px; font-size: 15px; }
.t-btns { display: grid; gap: 10px; }
.t-links { display: flex; justify-content: center; gap: 16px; margin: 10px 0 0; }
.t-meta { margin: 6px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
.t-note, .t-next { margin: 12px 0 0; font-size: 12px; color: var(--muted); line-height: 1.7; }
.t-next { margin-top: 6px; }

/* 物語 */
#s-play.is-active { display: flex; flex-direction: column; height: 100vh; height: 100svh; min-height: 480px; background: var(--night); }
.bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); color: #fff; }
.b-date { margin: 0; display: flex; align-items: baseline; gap: 8px; font-size: 13px; white-space: nowrap; }
.b-date b { font-size: 15px; }
.b-date span { font-size: 12px; opacity: .75; }
.b-icons { display: flex; gap: 6px; }
.ib { position: relative; width: 40px; height: 40px; border-radius: 12px; border: 1.5px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); font-size: 17px; line-height: 1; }
.badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #e2604f; color: #fff; font-size: 11px; font-style: normal; font-weight: 800; line-height: 20px; }
.badge.many { background: #c2392b; }
.badge.bump { animation: bump .5s var(--pop); }
@keyframes bump { 40% { transform: scale(1.35); } }
.stage { position: relative; flex: 1 1 auto; min-height: 220px; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; }
.art-wrap { position: relative; width: 100%; max-width: 560px; aspect-ratio: 360 / 320; max-height: 100%; }
.art-wrap .layer { position: absolute; inset: 0; }
.art-wrap svg { display: block; width: 100%; height: 100%; filter: saturate(calc(1 - var(--gray, 0))) brightness(calc(1 - var(--gray, 0) * .12)); transition: filter 1.2s; }
.layer.fadein { animation: fadeIn .7s ease both; }
@keyframes fadeIn { from { opacity: 0; } }
/* 絵の中の小さな動き（「動きを減らす」で止まる） */
.glowscr { animation: glow 2.4s ease-in-out infinite; }
@keyframes glow { 50% { opacity: .75; } }
.alarm { animation: alarm 1.2s ease-in-out 3; transform-origin: 196px 226px; transform-box: view-box; }
@keyframes alarm { 10%, 30% { transform: rotate(-6deg); } 20%, 40% { transform: rotate(6deg); } 50% { transform: none; } }
.tw { animation: tw 3s ease-in-out infinite alternate; }
@keyframes tw { to { opacity: .2; } }
.cloud { animation: cloud 18s linear infinite alternate; }
@keyframes cloud { to { transform: translateX(30px); } }
.lantern { animation: lantern 4s ease-in-out infinite; transform-origin: 219px 108px; transform-box: view-box; }
@keyframes lantern { 50% { transform: rotate(3deg); } }
.steam { animation: steam 2.6s ease-in-out infinite; }
@keyframes steam { 50% { transform: translateY(-5px); opacity: .5; } }
.curOpen { animation: curOpen 2.4s ease both .6s; }
@keyframes curOpen { from { transform: translateX(-60px); } }
.sunbeam { animation: sun 3s ease both 1.2s; }
@keyframes sun { from { opacity: 0; } }
.cornerlight { animation: corner 3s ease-in-out infinite alternate; }
@keyframes corner { to { opacity: .5; } }

/* スマホのメッセージ */
.phone { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); width: min(78%, 330px); max-height: 74%; display: flex; flex-direction: column; border-radius: 22px; background: #f2f0f6; border: 6px solid #1c1b24; box-shadow: 0 16px 40px rgba(0,0,0,.4); overflow: hidden; z-index: 3; }
.phone.pop { animation: phoneIn .35s var(--pop); }
@keyframes phoneIn { from { transform: translate(-50%, 30px); opacity: 0; } }
.ph-h { margin: 0; padding: 8px 12px; background: #fff; font-size: 13px; font-weight: 800; border-bottom: 1px solid #e3e0ea; }
.ph-b { padding: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.pm { margin: 0; max-width: 86%; padding: 8px 11px; border-radius: 14px; font-size: 14px; line-height: 1.55; animation: inUp .3s ease; }
.pm b { display: block; font-size: 11px; color: var(--muted); }
.pm.them { align-self: flex-start; background: #fff; border-top-left-radius: 4px; }
.pm.me { align-self: flex-end; background: #c9ecd9; border-top-right-radius: 4px; }
/* カレンダー（日付が進む） */
.calv { position: absolute; inset: 8px; z-index: 4; display: flex; flex-direction: column; justify-content: center; padding: 10px; border-radius: 16px; background: rgba(251,247,240,.97); }
.calv.pop { animation: pop .35s var(--pop); }
.calv-k { margin: 0 0 6px; text-align: center; font-size: 13px; font-weight: 800; color: var(--muted); }
.cal-h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; font-size: 12px; }
.cal-h span { letter-spacing: .9em; color: var(--muted); font-size: 11px; }
.cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cd { min-height: 46px; padding: 2px 3px; border-radius: 6px; background: #fff; border: 1px solid var(--line); font-size: 9.5px; line-height: 1.25; overflow: hidden; transition: background .2s; }
.cd i { display: block; font-style: normal; font-weight: 800; font-size: 11px; color: var(--muted); }
.cd.pre { opacity: .45; }
.cd.past { background: #ece8e1; }
.cd.past i { text-decoration: line-through; text-decoration-color: rgba(0,0,0,.35); }
.cd.today { background: #fff3c9; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(227,168,59,.35); }
.ev { display: block; margin-top: 2px; padding: 1px 3px; border-radius: 4px; background: #e6eefc; word-break: break-all; }
.ev b { margin-right: 2px; }
.ev.done { background: #dff1e6; }
.ev.cancel { background: #f6dfdb; text-decoration: line-through; color: #8a5a54; }
.ev.left { background: #fff; border: 1px dashed #c9a24b; color: #8a6a20; }
.cal-next { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
/* 章・あとで響く・今だけ */
.chap { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(28,26,40,.9); color: #fff; text-align: center; }
.chap.run { animation: chap 2s ease both; }
@keyframes chap { 0% { opacity: 0; } 15%, 82% { opacity: 1; } 100% { opacity: 0; } }
.c-n { margin: 0; font-size: 13px; letter-spacing: .3em; opacity: .7; }
.c-t { margin: 4px 0; font-size: 26px; font-weight: 800; }
.c-s { margin: 0; font-size: 13px; opacity: .75; }
.echo { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 4; margin: 0; padding: 6px 14px; border-radius: 999px; background: rgba(44,42,58,.88); color: #ffd9a8; font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.echo.show { animation: inUp .5s ease; }
.chip { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 4; margin: 0; max-width: 92%; padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.94); color: var(--ink); font-size: 12.5px; font-weight: 800; box-shadow: 0 4px 14px rgba(0,0,0,.2); text-align: center; }
.chip.show { animation: chip 3.2s ease both; }
@keyframes chip { 0% { opacity: 0; transform: translate(-50%, -6px); } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
/* 文章と選択肢 */
.panel { flex: none; position: relative; padding: 12px 14px; padding-bottom: max(14px, env(safe-area-inset-bottom)); background: var(--paper); border-radius: 18px 18px 0 0; min-height: 168px; }
.line { position: relative; min-height: 140px; cursor: pointer; }
.line.in { animation: inUp .25s ease; }
.who { margin: 0 0 2px; min-height: 1.4em; font-size: 13px; font-weight: 800; color: var(--muted); }
.w-me .who { color: #3d6f8f; } .w-th .who { color: #6f7f9a; } .w-natsuki .who { color: #b27b17; } .w-mori .who { color: #7a6a4c; } .w-mom .who { color: #b05a4b; } .w-yuzu .who { color: #4c8a6a; }
.txt { margin: 0; font-size: 16.5px; line-height: 1.85; white-space: pre-wrap; }
.w-th .txt { color: #4e5a70; font-style: italic; }
.w-n .txt { color: #3d3a48; }
.w-phone .txt { color: var(--muted); font-size: 14px; }
.next { position: absolute; right: 2px; bottom: 0; color: var(--accent); font-size: 12px; animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .2; } }
.choices.in { animation: inUp .3s ease; }
.q { margin: 0 0 8px; font-size: 13px; font-weight: 800; color: var(--muted); }
.c-list { display: grid; gap: 8px; }
.opt { display: block; width: 100%; min-height: 52px; padding: 9px 14px; text-align: left; border: 2px solid var(--ink); border-radius: 14px; background: #fff; box-shadow: 0 3px 0 var(--ink); line-height: 1.4; }
.opt b { display: block; font-size: 15.5px; }
.opt small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.opt:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.opt.locked { opacity: .55; border-style: dashed; box-shadow: none; background: transparent; cursor: not-allowed; }
.opt.locked small { color: #8a5a54; }
@media (min-width: 420px) { .txt { font-size: 17px; } }
@media (max-height: 640px) { .panel { min-height: 0; } .line { min-height: 112px; } .txt { font-size: 15px; line-height: 1.7; } .opt { min-height: 46px; padding: 7px 12px; } .opt b { font-size: 14.5px; } .stage { min-height: 170px; } }

/* 結果 */
#s-result { padding: 16px 14px 32px; background: #efe9df; }
.diary { padding: 16px; border-radius: 16px; background: var(--paper); box-shadow: 0 10px 30px rgba(0,0,0,.12); border-top: 8px solid var(--ec, var(--sea)); }
.diary.in { animation: inUp .6s ease; }
.d-k { margin: 0 0 8px; font-size: 12px; color: var(--muted); font-weight: 700; }
.d-art svg { display: block; width: 100%; height: auto; border-radius: 10px; }
.d-label { margin: 12px 0 0; font-size: 12px; font-weight: 800; color: var(--ec); letter-spacing: .2em; }
.d-end { margin: 2px 0 6px; font-size: 24px; line-height: 1.35; }
.d-quote { margin: 0 0 10px; font-size: 15px; font-weight: 700; }
.d-scene p { margin: 0 0 6px; font-size: 14px; color: #4a4656; }
.d-hook { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: #fff7e3; border: 1.5px dashed #d9b25a; }
.d-hk { margin: 0; font-size: 12px; font-weight: 800; color: #9a7420; }
.d-hook p:last-child { margin: 2px 0 0; font-weight: 800; }
.block { margin-top: 14px; padding: 14px; border-radius: 14px; background: #fff; }
.block h3 { margin: 0 0 8px; font-size: 16px; }
.block h3 span { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sub-h { margin: 0 0 4px; font-size: 12px; font-weight: 800; color: var(--muted); }
.list { margin: 0; padding: 0; list-style: none; }
.list li { margin: 4px 0; padding: 6px 8px; border-radius: 8px; font-size: 13px; line-height: 1.5; }
.lost li { background: #f5e9e6; }
.kept li { background: #e6f2ec; }
.cancels { margin: 0; padding: 0; list-style: none; }
.cancels li { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px solid #f0ebe3; font-size: 13.5px; }
.cancels li span { flex: none; width: 1.4em; text-align: center; font-weight: 800; }
.cancels li.told span { color: var(--sea); } .cancels li.vague span { color: #b27b17; } .cancels li.silent span { color: #a5a0ad; }
.r-small { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.mcal .cd { min-height: 54px; }
.steps { margin: 0; padding-left: 0; list-style: none; counter-reset: s; }
.steps li { margin: 0 0 6px; padding: 6px 8px; border-radius: 8px; background: #f7f4ef; font-size: 13px; line-height: 1.5; }
.steps li span { display: block; font-size: 11px; color: var(--muted); }
.steps li b { display: block; }
.tpl { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chipb { padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--ink); background: #fff; font-size: 13px; font-weight: 700; }
.chipb.is-on { background: var(--ink); color: #fff; }
.share-label { display: block; margin-bottom: 4px; font-size: 12px; color: var(--muted); }
textarea { width: 100%; padding: 10px; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; font-size: 14px; line-height: 1.6; resize: vertical; }
.s-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.btn.x { background: #111; color: #fff; }
.next-ep { margin: 22px 0 6px; text-align: center; font-weight: 800; letter-spacing: .2em; color: var(--muted); }
.next-ep small { display: block; margin-top: 4px; letter-spacing: 0; font-weight: 700; }
.r-btns { display: grid; gap: 10px; margin-top: 10px; }
.r-hint { margin: 0; font-size: 13px; text-align: center; color: var(--muted); }
.r-note { margin: 16px 0 0; font-size: 12px; color: var(--muted); }

/* ダイアログ */
.modal { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(20,18,30,.6); }
.modal[hidden] { display: none; }
.modal.m-in .m-box { animation: pop .3s var(--pop); }
.m-box { width: min(100%, 520px); max-height: 88vh; overflow-y: auto; padding: 18px; border-radius: 18px; background: var(--paper); display: grid; gap: 10px; }
.m-box h2 { margin: 0; font-size: 18px; }
.m-txt { margin: 0; font-size: 14px; }
.m-txt.small { font-size: 12px; color: var(--muted); }
.row { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.row input[type=checkbox] { width: 22px; height: 22px; }
.row input[type=range] { flex: 1; }
.inbox { margin: 0; padding: 0; list-style: none; }
.inbox li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.inbox b { display: block; font-size: 12px; color: var(--muted); }
.album { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.album li { padding: 10px 12px; border-radius: 12px; background: #fff; border-left: 6px solid #ccc; }
.album li.got { border-left-color: var(--c); }
.album b { display: block; }
.album span { font-size: 12.5px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 30; margin: 0; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; transform: translate(-50%, 140%); opacity: 0; pointer-events: none; }
.toast.show { animation: toast 2.4s ease both; }
@keyframes toast { 10%, 85% { transform: translate(-50%, 0); opacity: 1; } }

/* 動きを減らす */
html.rm *, html.rm *::before, html.rm *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
html.rm .curOpen, html.rm .sunbeam { animation: none !important; }
/* 幅の狭い端末：上のバーを詰める */
@media (max-width: 360px) { .bar { padding-left: 8px; padding-right: 8px; } .b-date span { display: none; } .b-date b { font-size: 14px; } .b-icons { gap: 4px; } .ib { width: 36px; height: 36px; font-size: 15px; } }

/* ===================== v2：絵と動き ===================== */
/* 時間帯と天気の色温度（絵の上にうすく重ね、ゆっくり移り変わる） */
.tint { position: absolute; inset: 0; z-index: 1; pointer-events: none; mix-blend-mode: multiply; transition: background-color 1.8s ease; background-color: transparent; }
.tint.t-morning { background-color: rgba(255, 236, 205, .16); }
.tint.t-dusk { background-color: rgba(255, 168, 112, .16); }
.tint.t-night { background-color: rgba(52, 62, 128, .22); }
.tint.w-rain { background-color: rgba(120, 132, 160, .2); }
.art-wrap { z-index: 0; }
.stage.hush .art-wrap svg { filter: saturate(calc(1 - var(--gray, 0))) brightness(.86); }
.stage.hush .pile-hud { opacity: .3; }
/* 人物の小さな動き：まばたき・呼吸・表情が変わった瞬間 */
.art .lid { animation: blink 5.4s infinite; }
.art .eye:nth-of-type(2) .lid { animation-delay: .02s; }
@keyframes blink { 0%, 93% { opacity: 0; } 94.5%, 96.5% { opacity: 1; } 98%, 100% { opacity: 0; } }
.art .breath { animation: breathe 4.6s ease-in-out infinite; }
.art .headbob { animation: headbob 4.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: translateY(-.9px); } }
@keyframes headbob { 50% { transform: translateY(-1.3px); } }
.layer.react .hd { animation: react .45s ease; }
@keyframes react { 35% { transform: translateY(-2.5px); } }
.art .breath2 { animation: breathe 5.5s ease-in-out infinite; }
/* 絵の中の動き */
.art .sigh { animation: sigh 3.2s ease-out infinite; }
@keyframes sigh { 0% { opacity: 0; transform: translateY(6px); } 30% { opacity: .9; } 100% { opacity: 0; transform: translateY(-14px); } }
.art .ring { animation: ring 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes ring { 50% { transform: scale(1.12); } }
.art .flame { animation: flame 1.8s ease-in-out infinite alternate; }
@keyframes flame { to { opacity: .7; } }
.art .pass { animation: pass 6s linear infinite; }
@keyframes pass { to { transform: translateX(-70px); } }
.art .rain { animation: rain 1.1s linear infinite; }
@keyframes rain { to { transform: translate(-6px, 18px); } }
.art .drop { animation: dropIn .55s ease both; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-16px); } }
.art .bokeh { animation: bokeh 7s ease-in-out infinite alternate; }
@keyframes bokeh { to { transform: translate(6px, -6px); opacity: .25; } }
.art .pen { animation: pen 2.6s ease-in-out infinite; }
@keyframes pen { 50% { transform: translate(-6px, 3px); } }
.art .hook { animation: hook 2.8s ease-in-out infinite; }
@keyframes hook { 50% { filter: drop-shadow(0 0 6px rgba(255, 244, 196, .95)); } }
.art .lamp { animation: lamp 5s ease-in-out infinite alternate; }
@keyframes lamp { to { opacity: .82; } }
.art .sunrise { animation: sunrise 4s ease both; }
@keyframes sunrise { from { transform: translateY(14px); opacity: .3; } }
/* 積み重なる用事（書類）と未読（吹き出し） */
.pile-hud { position: absolute; left: 0; bottom: 0; width: 70px; height: 130px; z-index: 2; pointer-events: none; transition: opacity .6s; }
.pile-hud.off { opacity: 0; }
.pi { position: absolute; display: block; }
.pi.doc { left: 8px; bottom: calc(8px + var(--n) * 5px); width: 26px; height: 6px; border-radius: 1px; background: #fffdf6; border: 1px solid #b7aa95; box-shadow: 0 1px 0 rgba(0,0,0,.15); transform: rotate(calc((var(--n) - 4) * 1.5deg)); }
.pi.msg { left: 40px; bottom: calc(8px + var(--n) * 11px); width: 18px; height: 11px; border-radius: 6px; background: #fff; border: 1.5px solid #e2604f; }
.pi.msg::after { content: ""; position: absolute; right: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: #e2604f; }
.pi.new { animation: pileIn .5s cubic-bezier(.2, 1.2, .4, 1) both; }
.pi.out { animation: pileOut .45s ease forwards; }
@keyframes pileIn { from { opacity: 0; transform: translateY(-22px); } }
@keyframes pileOut { to { opacity: 0; transform: translateX(-14px); } }
.plus { position: absolute; top: -20px; right: -2px; font-size: 11px; font-weight: 800; color: #ffb3a8; animation: plus 1.4s ease forwards; pointer-events: none; }
@keyframes plus { from { opacity: 0; transform: translateY(6px); } 25% { opacity: 1; } to { opacity: 0; transform: translateY(-10px); } }
/* メッセージ：入力・消去・送信・既読・相手の入力中 */
.ph-in { display: none; margin: 0; padding: 8px 10px; min-height: 38px; background: #fff; border-top: 1px solid #e3e0ea; font-size: 14px; }
.ph-in.on { display: block; }
.ph-in.erase span { background: rgba(217, 119, 106, .18); }
.caret { display: inline-block; width: 1.5px; height: 1em; margin-left: 1px; vertical-align: -2px; background: var(--ink); animation: caret 1.1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.pm.sent { animation: sent .35s ease both; }
@keyframes sent { from { opacity: 0; transform: translate(10px, 12px) scale(.9); } }
.pm.me small { display: block; margin-top: 2px; font-size: 10px; color: #5f8f78; text-align: right; animation: fadeIn .4s ease; }
.pm.typing { display: flex; gap: 4px; padding: 10px 12px; }
.pm.typing i { width: 6px; height: 6px; border-radius: 50%; background: #b8b3c4; animation: dots 1s ease-in-out infinite; }
.pm.typing i:nth-child(2) { animation-delay: .15s; } .pm.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dots { 40% { transform: translateY(-4px); background: #8d879c; } }
/* 選択肢：押した感触 */
.opt { position: relative; overflow: hidden; transition: transform .12s ease, opacity .3s ease, background .2s, border-color .2s; }
.choices.in .opt { animation: optIn .35s ease both; }
.choices.in .opt:nth-child(2) { animation-delay: .05s; } .choices.in .opt:nth-child(3) { animation-delay: .1s; } .choices.in .opt:nth-child(4) { animation-delay: .15s; }
@keyframes optIn { from { opacity: 0; transform: translateY(10px); } }
.opt.chosen { transform: scale(.975); background: #fff6e2; border-color: var(--accent); box-shadow: 0 1px 0 var(--ink); }
.opt.chosen::after { content: ''; position: absolute; left: var(--rx, 50%); top: var(--ry, 50%); width: 10px; height: 10px; margin: -5px; border-radius: 50%; background: rgba(217, 119, 106, .35); animation: ripple .5s ease-out forwards; }
@keyframes ripple { to { transform: scale(40); opacity: 0; } }
.choices.decided .opt:not(.chosen) { opacity: 0; transform: translateX(-12px); }
/* キャンセルの瞬間 */
.fx { position: absolute; inset: 0; z-index: 6; display: none; pointer-events: none; }
.fx.on { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: rgba(28, 26, 40, .38); animation: fadeIn .3s ease; }
.fx.fade { animation: fxOut .45s ease forwards; }
@keyframes fxOut { to { opacity: 0; } }
.cx-card { width: min(74%, 270px); padding: 12px 14px; border-radius: 12px; background: #fffdf8; border-left: 6px solid #a5a0ad; box-shadow: 0 10px 28px rgba(0,0,0,.25); animation: pop .4s var(--pop); }
.cx.told .cx-card { border-left-color: var(--sea); } .cx.vague .cx-card { border-left-color: var(--gold); }
.cx-card span { display: block; font-size: 11px; color: var(--muted); font-weight: 700; }
.cx-card b { display: block; font-size: 16px; }
.cx-card em { display: block; margin-top: 2px; font-size: 11.5px; font-style: normal; color: var(--muted); }
.cx.gone .cx-card { animation: tear .65s ease forwards; }
@keyframes tear { to { opacity: 0; transform: translateY(-28px) rotate(-5deg) scale(.92); filter: blur(5px); } }
.fx.bloom::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 42%, rgba(255, 246, 220, .7), rgba(255, 246, 220, 0) 62%); animation: bloom 1.6s ease forwards; }
@keyframes bloom { 0% { opacity: 0; } 35% { opacity: 1; } 100% { opacity: .2; } }
.week { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; width: min(92%, 380px); animation: inUp .45s ease both; }
.wd { min-height: 46px; padding: 3px 4px; border-radius: 6px; background: rgba(255, 253, 248, .95); font-size: 10px; line-height: 1.2; }
.wd i { display: block; font-style: normal; font-weight: 800; color: var(--muted); }
.wd.blank { background: transparent; border: 1.5px dashed rgba(255, 255, 255, .9); color: #fff; }
.wd.blank i { color: #fff; }
.wd.blank s { display: block; margin-top: 2px; opacity: .7; animation: vanish 1.4s ease .3s forwards; }
@keyframes vanish { to { opacity: 0; } }
/* 結末の前：やめておいたことが重なる */
.fx.mon { background: rgba(28, 26, 40, .86); color: #fff; }
.mt { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: .06em; animation: fadeIn .6s ease; }
.mstack { position: relative; width: min(80%, 280px); height: 170px; transition: transform .9s ease, opacity .9s ease; }
.mc { position: absolute; left: 0; right: 0; top: calc(var(--i) * 9px); padding: 8px 10px; border-radius: 8px; background: #fffdf8; color: var(--ink); font-size: 12.5px; font-weight: 700; border-left: 5px solid #a5a0ad; transform: rotate(var(--r)); box-shadow: 0 4px 12px rgba(0,0,0,.25); animation: mcIn .5s ease calc(var(--i) * .3s) both; }
.mc span { display: block; font-size: 10px; color: var(--muted); font-weight: 700; }
.mc em { position: absolute; right: 8px; top: 8px; font-style: normal; }
.mc.told { border-left-color: var(--sea); } .mc.vague { border-left-color: var(--gold); } .mc.silent { opacity: .88; } .mc.done { border-left-color: var(--accent); }
@keyframes mcIn { from { opacity: 0; transform: translateY(-30px) rotate(0deg); } }
.mkept { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; text-align: center; }
.mkept li { opacity: 0; padding: 4px 12px; border-radius: 999px; background: rgba(255, 243, 214, .95); color: var(--ink); font-size: 12.5px; font-weight: 700; }
.fx.kept .mstack { transform: scale(.78) translateY(-8px); opacity: .5; }
.fx.kept .mkept li { animation: keptIn .6s ease calc(var(--i) * .35s) forwards; }
@keyframes keptIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.stage.quietend .pile-hud { opacity: 0; }
/* 章の扉：カレンダーの一枚絵を見せる */
.chap { background: linear-gradient(rgba(28, 26, 40, 0) 25%, rgba(28, 26, 40, .88) 72%); justify-content: flex-end; padding-bottom: 22px; }
/* 絵は高さに合わせて縮む（選択肢や文章が下にはみ出さない） */
.stage { min-height: 0; }
.art-wrap { height: 100%; width: auto; max-width: 100%; aspect-ratio: 360 / 320; }
@supports not (aspect-ratio: 1) { .art-wrap { width: 100%; height: auto; } }
