/* Poop Maker — スマホ縦が基準。PC では中央に 480px 幅 */
:root {
  --bg: #f7efe1;
  --card: #fffdf8;
  --ink: #3b2a1a;
  --muted: #8a7660;
  --line: #e8d9c2;
  --brown: #7a4a20;
  --brown-2: #a8692f;
  --gold: #e8b923;
  --blue: #5aa6d6;
  --radius: 16px;
  --icon-bg: #fffdf8;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; padding: max(12px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }
.screen { display: flex; flex-direction: column; gap: 12px; }
.screen[hidden] { display: none; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
small { font-size: 12px; }
.muted { color: var(--muted); margin: 0; }
.ic { width: 22px; height: 22px; flex: none; }

/* ---- ボタン ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px;
  min-height: 48px; padding: 10px 16px; border-radius: 14px;
  background: var(--card); border: 2px solid var(--line); cursor: pointer;
  font-weight: 700; text-align: center;
}
.btn small { flex-basis: 100%; font-weight: 400; color: var(--muted); line-height: 1.3; }
.btn.primary { background: var(--brown); border-color: var(--brown); color: #fff; }
.btn.primary small { color: #f3dcc4; }
.btn.ghost { background: transparent; }
.btn.big { min-height: 58px; font-size: 17px; }
.btn.small { min-height: 40px; padding: 6px 12px; font-size: 14px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn:not(:disabled):active { transform: translateY(1px); }
.row { display: flex; gap: 10px; }
.row > .btn { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.iconbtn { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); display: grid; place-items: center; cursor: pointer; }
.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 14px; }
.card h3 { font-size: 14px; color: var(--muted); margin-bottom: 8px; }

/* ---- タイトル ---- */
#screen-title { text-align: center; padding-top: 8px; }
.title-art { width: min(280px, 78vw); margin: 0 auto -6px; }
.title-art svg { width: 100%; height: auto; display: block; }
/* 見出し（D23）: 1行目は小さく、2行目を大きく弾ませる */
.headline { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 2px; }
.hl1 { font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: 0.04em; }
.hl2 { font-size: clamp(34px, 10.5vw, 46px); font-weight: 900; color: var(--brown); letter-spacing: 0.02em; line-height: 1.1; text-shadow: 0 3px 0 #f1d9b9, 0 6px 14px rgba(122, 74, 32, 0.18); transform: rotate(-2deg); animation: boing 0.9s cubic-bezier(.2, 1.6, .4, 1) both; }
:root[lang="en"] .hl2 { font-size: clamp(28px, 8.6vw, 38px); }
.brand { margin: 2px 0 0; display: flex; justify-content: center; align-items: baseline; gap: 8px; }
.brand b { font-size: 17px; letter-spacing: 0.06em; color: #fff; background: var(--brown); border-radius: 999px; padding: 2px 12px; }
.brand span { font-size: 13px; font-weight: 700; color: var(--brown-2); }
.hook { margin: 2px auto 0; display: inline-block; font-size: 13px; font-weight: 800; color: #b4840c; border: 2px dashed #ecc65a; border-radius: 999px; padding: 3px 12px; background: #fff8de; }
.tagline { margin: 4px 0 8px; color: var(--muted); font-size: 13px; }
@keyframes boing { 0% { transform: rotate(-2deg) scale(0.6); opacity: 0; } 60% { transform: rotate(-2deg) scale(1.08); opacity: 1; } 100% { transform: rotate(-2deg) scale(1); } }

/* ---- 1日 ---- */
.dayhead { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.dh-day { font-weight: 700; color: var(--brown-2); }
.dh-clock { font-size: 34px; font-weight: 800; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.dh-tummy { display: flex; align-items: center; justify-content: flex-end; gap: 6px; font-size: 11px; color: var(--muted); text-align: right; line-height: 1.2; }
.dh-tummy b { display: block; font-size: 14px; color: var(--ink); }
.face { width: 40px; height: 40px; flex: none; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(17, 1fr); gap: 2px; }
.tl { aspect-ratio: 1 / 1.25; border-radius: 7px; display: grid; place-items: center; background: #efe3cf; color: #b9a587; font-size: 10px; font-weight: 700; }
.tl .ic { width: 15px; height: 15px; }
.tl.meal { background: #f6dcc0; }
.tl.done { background: #e9d6b8; color: var(--brown); }
.tl.done.meal { background: #e9c49a; }
.tl.now { background: var(--brown); color: #fff; box-shadow: 0 0 0 2px #f1d9b9; }
.turn { display: flex; flex-direction: column; gap: 10px; }
.turn-head { display: flex; align-items: baseline; gap: 10px; }
.turn-head h2 { font-size: 20px; }
.turn-head h2 small { margin-left: 8px; font-size: 14px; color: var(--muted); font-weight: 400; }
.turn-time { font-weight: 800; color: #fff; background: var(--brown-2); border-radius: 8px; padding: 2px 8px; font-size: 14px; }
.acts { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 8px; }
.act { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 74px; padding: 8px 4px; border-radius: 14px; border: 2px solid var(--line); background: #fff; cursor: pointer; font-size: 12px; font-weight: 700; line-height: 1.25; text-align: center; }
.act .ic { width: 26px; height: 26px; color: var(--brown); }
.act:active { background: #fbf2e4; }
.act.snackbtn .ic { color: #d2558a; }
.act.sleepbtn { background: #eef1f8; border-color: #d6dcec; }
.act.sleepbtn .ic { color: #44508a; }
.log { font-size: 13px; color: var(--muted); }
.log summary { cursor: pointer; padding: 4px 2px; }
.log ol { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.log b { display: inline-block; width: 46px; color: var(--brown-2); }
.foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; }

/* ---- 食事・お菓子 ---- */
.subtop { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 8px; position: sticky; top: 0; background: var(--bg); padding: 6px 0; z-index: 2; }
.subtop h1 { font-size: 20px; text-align: center; }
.subtop h1 small { margin-left: 6px; color: var(--muted); font-weight: 400; font-size: 14px; }
.subtop h1.hall { color: #b4840c; text-shadow: 0 2px 0 #fbe7a6; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; position: sticky; top: 56px; background: var(--bg); padding-bottom: 6px; z-index: 2; }
.tab { padding: 7px 6px; border-radius: 999px; border: 2px solid var(--line); background: var(--card); font-weight: 700; font-size: 14px; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; justify-content: center; white-space: nowrap; }
.tab.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.tab i { font-style: normal; font-size: 11px; background: var(--gold); color: var(--ink); border-radius: 999px; min-width: 18px; padding: 0 5px; }
.rule { margin: -4px 0 0; font-size: 12px; color: var(--muted); }
.list { padding-bottom: 210px; }
.subhead { font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.chip { display: flex; align-items: center; gap: 6px; min-height: 46px; padding: 6px 10px; border-radius: 12px; border: 2px solid var(--line); background: #fff; cursor: pointer; text-align: left; font-size: 14px; line-height: 1.25; }
.chip .ic { width: 20px; height: 20px; color: var(--brown-2); }
.chip.on { border-color: var(--brown); background: #fbecd9; box-shadow: inset 0 0 0 1px var(--brown); }
.tray { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: rgba(247, 239, 225, 0.96); backdrop-filter: blur(6px); border-top: 2px solid var(--line); padding: 10px 16px max(12px, env(safe-area-inset-bottom)); }
.tray > * { max-width: 448px; margin-left: auto; margin-right: auto; }
/* 食事の画面の下: 抜く・いつもの登録（D29）・これで食べる。3つ並ぶので「抜く」は細く、字は少し小さく */
.tray .row { gap: 8px; }
.tray .row > .btn { padding-left: 10px; padding-right: 10px; font-size: 15px; gap: 4px; }
.tray .row > [data-act="skip-meal"] { flex: 0.62; }
.tray .row > [data-act="save-usual"] { flex: 1.08; font-size: 14px; }
.tray .row > [data-act="save-usual"] .ic { width: 16px; height: 16px; color: var(--gold); }
.tray .row > [data-act="eat"] { flex: 1.2; }
.sums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 8px; }
.sum { text-align: left; border: 1.5px solid var(--line); background: var(--card); border-radius: 10px; padding: 4px 8px; font-size: 11px; line-height: 1.3; cursor: pointer; min-height: 40px; overflow: hidden; }
.sum b { display: block; font-size: 11px; color: var(--muted); }
.sum span { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; font-weight: 700; }
.sum.need { border-color: #e7a46a; background: #fff3e6; }
.sum.has { border-color: #cfa77a; }

/* ---- 1日を過ごす（ドット絵・D19） ---- */
.stage { width: 100%; max-width: 448px; margin: 0 auto; border-radius: var(--radius); overflow: hidden; border: 3px solid var(--ink); background: #141a3e; line-height: 0; box-shadow: 0 4px 0 #e2cba8; }
.stage svg { width: 100%; height: auto; display: block; }
.lv-cap { margin: 0; min-height: 3em; font-weight: 700; line-height: 1.45; }
.lv-cap b { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 8px; background: var(--brown-2); color: #fff; font-size: 13px; font-variant-numeric: tabular-nums; }
.btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---- 音（D21） ---- */
.sw { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.swbtn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px; border-radius: 14px; border: 2px solid var(--line); background: #fff; cursor: pointer; font-weight: 700; }
.swbtn b { font-size: 12px; color: var(--muted); }
.swbtn[aria-pressed="true"] { background: var(--brown); border-color: var(--brown); color: #fff; }
.swbtn[aria-pressed="true"] b { color: #f3dcc4; }
.note-s { font-size: 12px; }
.row > .iconbtn { width: 48px; height: auto; min-height: 48px; flex: none; }

/* ---- 言葉（D22） ---- */
:root[lang="ko"] body { font-family: "Hiragino Maru Gothic ProN", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif; }
.langs { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.lang { padding: 6px 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--card); font-weight: 700; font-size: 13px; cursor: pointer; }
.lang[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.lang[lang="ko"] { font-family: "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif; }

/* ---- 結果 ---- */
.restop { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; }
.restop h2 { text-align: center; font-size: 16px; color: var(--muted); }
.toilet-wrap { width: min(360px, 92vw); margin: 0 auto; animation: fadein 0.25s ease-out both; }
.toilet-wrap svg { width: 100%; height: auto; display: block; }
/* 出てきたウンチのひとこと（D33）。便器のタンクの上に吹き出し、しっぽは下のウンチへ。1字ずつ出る。流すと消える */
.toilet-wrap { position: relative; }
.say { position: absolute; top: 2px; left: 50%; translate: -50% 0; width: max-content; max-width: 94%; margin: 0; padding: 6px 14px; background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; font-weight: 700; font-size: 15px; line-height: 1.35; text-align: center; text-wrap: balance; box-shadow: 0 3px 0 rgba(59, 42, 26, 0.18); transform-origin: 50% 100%; animation: say-in 0.28s cubic-bezier(0.3, 1.6, 0.5, 1) both; transition: opacity 0.2s; }
.say::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 12px; height: 12px; margin-left: -6px; background: #fff; border: solid var(--ink); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.say span { animation: say-ch 0.04s linear both; }
.say.still { animation: none; }
.flushing .say { opacity: 0; }
@keyframes say-in { from { transform: scale(0.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes say-ch { from { opacity: 0; } to { opacity: 1; } }
.resname { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.resname h1 { font-size: 24px; }
.resname .note { margin: 0; color: var(--muted); }
.new { display: inline-block; background: #e8473b; color: #fff; font-weight: 800; font-size: 13px; padding: 2px 10px; border-radius: 999px; transform: rotate(-4deg); animation: pulse 1.2s ease-in-out infinite; }
.newtags { display: flex; gap: 8px; justify-content: center; margin: 2px 0 0; flex-wrap: wrap; }
.newtags span { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 700; color: #b4840c; }
.newtags .ic { width: 16px; height: 16px; }
.bchips { display: flex; flex-wrap: wrap; gap: 6px; }
.bchip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 999px; background: #f3e6d1; border: 1.5px solid #e2cba8; font-weight: 700; font-size: 13px; cursor: default; }
button.bchip { cursor: pointer; }
.bchip.isnew { background: #fff1c7; border-color: #ecc65a; }
.bchip i { font-style: normal; font-size: 10px; color: #e8473b; }
.bchip.locked { background: #efe8dc; border-style: dashed; color: #b3a38c; }

/* ---- 図鑑 ---- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stats div { background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 6px 4px; text-align: center; font-size: 20px; font-weight: 800; line-height: 1.15; }
.stats b { display: block; font-size: 11px; color: var(--muted); }
.stats small { font-size: 11px; color: var(--muted); font-weight: 400; }
.stats em { display: block; font-style: normal; font-size: 11px; color: var(--brown-2); }
.dexgrid { display: grid; grid-template-columns: 58px repeat(16, 1fr); gap: 2px; align-items: center; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 8px 6px; }
.corner { height: 1px; }
.ch { aspect-ratio: 1; border-radius: 50%; background: #e9dfcf; color: #b7a68d; font-size: 9px; display: grid; place-items: center; }
.ch.seen { background: var(--c); border: 0; padding: 0; cursor: pointer; }
.swatch { width: 72px; height: 72px; border-radius: 50%; margin: 4px auto 0; background: var(--c); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.15); }
.swatch.rainbow { background: conic-gradient(#d9433b, #ec8a2c, #e7c93a, #5ca345, #3a7bd5, #8a4fb3, #d9433b); }
.swatch.gold { background: radial-gradient(circle at 35% 30%, #fff3b0, #e8b923 55%, #a8770f); }
.ch[data-color="rainbow"].seen { background: conic-gradient(#d9433b, #ec8a2c, #e7c93a, #5ca345, #3a7bd5, #8a4fb3, #d9433b); }
.ch[data-color="gold"].seen { background: radial-gradient(circle at 35% 30%, #fff3b0, #e8b923 55%, #a8770f); }
.rh { display: flex; align-items: center; gap: 2px; border: 0; background: none; padding: 0; font-size: 10px; font-weight: 700; color: var(--muted); text-align: left; line-height: 1.1; cursor: default; min-height: 20px; }
.rh.seen { cursor: pointer; }
.rh svg { width: 26px; height: 16px; flex: none; }
.rh .q { width: 26px; text-align: center; color: #c9b9a0; font-size: 12px; }
.rh.seen { color: var(--ink); }
.cell { aspect-ratio: 1; border-radius: 5px; background: #f1e8da; color: #cdbda3; font-size: 9px; display: grid; place-items: center; border: 0; padding: 0; }
.cell.found { background: var(--c); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18); }
.cell.none { background: transparent; color: #d8cab3; font-size: 9px; }
.cell.found.rainbow { background: conic-gradient(#d9433b, #ec8a2c, #e7c93a, #5ca345, #3a7bd5, #8a4fb3, #d9433b); }
.cell.found.gold { background: radial-gradient(circle at 35% 30%, #fff3b0, #e8b923 55%, #a8770f); }
.cell.wide { grid-column: span 16; aspect-ratio: auto; height: 18px; font-size: 11px; font-weight: 700; }
.cell.wide.found { background: linear-gradient(90deg, #cfd9e6, #eef3f8, #cfd9e6); color: #44508a; }

/* ---- ダイアログ・トースト ---- */
dialog { border: 0; border-radius: 20px; padding: 0; width: min(420px, calc(100vw - 32px)); background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(40, 20, 0, 0.3); }
dialog::backdrop { background: rgba(40, 25, 10, 0.45); }
.dlg-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.dlg-body h2 { font-size: 19px; text-align: center; }
.dlg-body h3 { font-size: 13px; color: var(--muted); }
.dlg-text { margin: 0; }
.dlg-art { padding: 6px 4px 0; }
.dlg-art svg { width: 100%; height: auto; max-height: 220px; display: block; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; }
.menu { margin: 0; font-size: 14px; }
#toast { position: fixed; left: 50%; bottom: 220px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 8px 16px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 30; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
.boot:empty { display: none; }
.boot { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; background: var(--bg); }
.boot code { background: #efe3cf; padding: 1px 6px; border-radius: 6px; }

/* ---- 動き（ウンチの湯気・金粉も） ---- */
.pm-steam { animation: steam 2.4s ease-in-out infinite; }
.pm-twinkle { animation: twinkle 1.6s ease-in-out infinite; }
@keyframes steam { 0% { transform: translateY(6px); opacity: 0; } 30% { opacity: 0.85; } 100% { transform: translateY(-14px); opacity: 0; } }
@keyframes twinkle { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
/* 結果のウンチの動き（poop.js の toiletSVG の motion）: 落ちる → つぶれて弾む → 浮く物は揺れる・ほかはぷるぷる。しぶきと波紋 */
.pm-fall { animation: pm-fall 0.55s cubic-bezier(.55, 0, 1, .5) both; }
@keyframes pm-fall { from { transform: translateY(-190px); } to { transform: translateY(0); } }
.pm-squash { transform-box: fill-box; transform-origin: 50% 100%; animation: pm-squash 0.65s ease-out 0.55s; }
@keyframes pm-squash { 0% { transform: scale(1.16, 0.78); } 35% { transform: scale(0.93, 1.1); } 65% { transform: scale(1.04, 0.96); } 100% { transform: scale(1, 1); } }
.pm-floaty { transform-box: fill-box; transform-origin: 50% 50%; animation: pm-floaty 2.6s ease-in-out 1.2s infinite; }
@keyframes pm-floaty { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-3px) rotate(-1.6deg); } }
.pm-breathe { transform-box: fill-box; transform-origin: 50% 100%; animation: pm-breathe 2.8s ease-in-out 1.2s infinite; }
@keyframes pm-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.03, 0.97); } }
.pm-settle { transform-box: fill-box; transform-origin: 50% 100%; animation: pm-settle 3.4s ease-in-out 1.2s infinite; }
@keyframes pm-settle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(1.5px); } }
/* 出たあとのウンチの動き（D32）: 顔と手足（D30）を動かす。表情ごとに腕と体、目はまばたき。落ちて弾み終わる 1.2 秒から（タイトルの絵も同じ） */
.pm-arm, .pm-blink { transform-box: view-box; transform-origin: 0 0; }
.pm-move .pm-blink { animation: pm-blink 3.4s linear 1.6s infinite; }
@keyframes pm-blink { 0%, 90%, 100% { transform: scaleY(1); } 94% { transform: scaleY(0.12); } }
.pm-move .pm-joy .pm-arm-l { animation: pm-pump-l 0.5s ease-in-out 1.2s infinite alternate; }
.pm-move .pm-joy .pm-arm-r { animation: pm-pump-r 0.5s ease-in-out 1.2s infinite alternate; }
@keyframes pm-pump-l { from { transform: rotate(-12deg); } to { transform: rotate(16deg); } }
@keyframes pm-pump-r { from { transform: rotate(12deg); } to { transform: rotate(-16deg); } }
.pm-move .pm-smile .pm-arm-r { animation: pm-wave 0.38s ease-in-out 1.2s infinite alternate; }
.pm-move .pm-smile .pm-arm-l { animation: pm-dangle-l 2.2s ease-in-out 1.2s infinite alternate; }
@keyframes pm-wave { from { transform: rotate(-22deg); } to { transform: rotate(18deg); } }
.pm-move .pm-strain .pm-arm-l { animation: pm-flex-l 0.3s ease-in-out 1.2s infinite alternate; }
.pm-move .pm-strain .pm-arm-r { animation: pm-flex-r 0.3s ease-in-out 1.2s infinite alternate; }
@keyframes pm-flex-l { from { transform: rotate(4deg); } to { transform: rotate(-14deg); } }
@keyframes pm-flex-r { from { transform: rotate(-4deg); } to { transform: rotate(14deg); } }
.pm-move .pm-limp .pm-arm-l { animation: pm-dangle-l 1.4s ease-in-out 1.2s infinite alternate; }
.pm-move .pm-limp .pm-arm-r { animation: pm-dangle-r 1.4s ease-in-out 1.6s infinite alternate; }
@keyframes pm-dangle-l { from { transform: rotate(-10deg); } to { transform: rotate(12deg); } }
@keyframes pm-dangle-r { from { transform: rotate(10deg); } to { transform: rotate(-12deg); } }
.pm-move .pm-sweat { transform-box: fill-box; animation: pm-sweat 1.4s ease-in 1.2s infinite; }
@keyframes pm-sweat { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(7px); opacity: 0; } }
.pm-hop { transform-box: fill-box; transform-origin: 50% 100%; animation: pm-hop 0.5s ease-in-out 1.2s infinite alternate; }
@keyframes pm-hop { from { transform: translateY(0) scale(1.02, 0.98); } to { transform: translateY(-5px) scale(0.98, 1.02); } }
.pm-sway { transform-box: fill-box; transform-origin: 50% 100%; animation: pm-sway 2.2s ease-in-out 1.2s infinite alternate; }
@keyframes pm-sway { from { transform: rotate(-2.5deg); } to { transform: rotate(2.5deg); } }
.pm-shiver { transform-box: fill-box; transform-origin: 50% 100%; animation: pm-shiver 1.4s linear 1.2s infinite; }
@keyframes pm-shiver { 0%, 55%, 100% { transform: translateX(0); } 60%, 70%, 80% { transform: translateX(-1.4px); } 65%, 75%, 85% { transform: translateX(1.4px); } 90% { transform: translateX(0); } }
.pm-droop { transform-box: fill-box; transform-origin: 50% 100%; animation: pm-droop 3s ease-in-out 1.2s infinite alternate; }
@keyframes pm-droop { from { transform: rotate(-3deg) scale(1, 1); } to { transform: rotate(3deg) scale(1.02, 0.97); } }
.pm-drop { opacity: 0; transform-box: fill-box; transform-origin: 50% 50%; animation: pm-drop 0.75s ease-out forwards; }
@keyframes pm-drop { 0% { opacity: 0.95; transform: translate(0, 0) scale(0.5); } 45% { opacity: 0.95; transform: translate(calc(var(--dx) * 0.7), var(--dy)) scale(1); } 100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) * 0.15)) scale(0.8); } }
.pm-ring { opacity: 0; transform-box: fill-box; transform-origin: 50% 50%; animation: pm-ring 0.95s ease-out forwards; }
@keyframes pm-ring { 0% { opacity: 0.9; transform: scale(0.2); } 100% { opacity: 0; transform: scale(1.45); } }
.pm-tint { animation: fadein 0.6s ease-out 0.25s both; }
/* 流す（D27）: 水の流れに乗って便器の中をぐるっと回り、水面の真ん中（160,168）へ小さくなって吸い込まれる */
.pm-swirl { opacity: 0; }
.flushing .pm-flush { transform-origin: 160px 168px; animation: pm-flush 1.3s ease-in forwards; }
@keyframes pm-flush {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
  18% { transform: translate(34px, 10px) rotate(12deg) scale(0.9); }
  36% { transform: translate(0, 18px) rotate(0deg) scale(0.78); }
  54% { transform: translate(-34px, 10px) rotate(-12deg) scale(0.62); }
  70% { transform: translate(0, 4px) rotate(0deg) scale(0.45); }
  84% { transform: translate(16px, 10px) rotate(8deg) scale(0.25); opacity: 1; }
  100% { transform: translate(0, 12px) rotate(0deg) scale(0); opacity: 0; }
}
.flushing .pm-swirl { animation: pm-swirl 1.3s ease-in-out forwards; }
.flushing .pm-swirl-rot { transform-box: fill-box; transform-origin: 50% 50%; animation: pm-spin 1.3s linear forwards; }
@keyframes pm-swirl { 0% { opacity: 0; } 20%, 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes pm-spin { to { transform: rotate(-720deg); } }
body.busy button { pointer-events: none; }
@keyframes pulse { 0%, 100% { transform: rotate(-4deg) scale(1); } 50% { transform: rotate(-4deg) scale(1.08); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
